Skip to content

Commit ec34929

Browse files
committed
refactor: color to use jb-design-system color
1 parent c9633bd commit ec34929

File tree

6 files changed

+20
-6
lines changed

6 files changed

+20
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# changelog
22

3+
## [5.7.0] - 2025-04-16
4+
### Breaking changes:
5+
- use jb-design-system color palette colors instead of internal color codes
6+
37
## [5.6.0] - 2025-03-26
48
### new features:
59
- add `error` prop/attribute to show custom error message.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,8 @@ more than above here is the css variable that we use in jb-date-input itself:
308308
| --jb-date-input-calendar-trigger-display | set it no none to hide calendar icon |
309309
| --jb-date-input-calendar-trigger-width | set calendar icon width |
310310
| --jb-date-input-calendar-trigger-height | set calendar icon height |
311+
| --jb-date-input-calendar-icon-color | calendar icon color |
312+
| --jb-date-input-calendar-icon-color-active | calendar icon color when calendar is open |
311313

312314
## add custom element in input box
313315

lib/jb-date-input.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use './variables.css';
2+
13
:host(:focus),
24
:host(:focus-visible) {
35
outline: none;
@@ -20,7 +22,7 @@
2022
&.--active {
2123
svg {
2224
.cls-1 {
23-
fill: #1f1735;
25+
fill: var(--calendar-icon-color-active);
2426
}
2527
}
2628
}
@@ -30,7 +32,7 @@
3032
height: 100%;
3133

3234
.cls-1 {
33-
fill: #bbb;
35+
fill: var(--calendar-icon-color);
3436

3537
}
3638
}

lib/jb-date-input.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { requiredValidation } from './validations';
1515
// eslint-disable-next-line no-duplicate-imports
1616
import { JBInputWebComponent } from 'jb-input';
1717
import { createInputEvent, createKeyboardEvent, createFocusEvent, listenAndSilentEvent, isMobile, enToFaDigits, faToEnDigits } from 'jb-core';
18+
import {defineColors} from 'jb-core/theme';
1819
export * from "./types.js";
1920

2021
if (HTMLElement == undefined) {
@@ -368,6 +369,7 @@ export class JBDateInputWebComponent extends HTMLElement implements WithValidati
368369
mode: 'open',
369370
delegatesFocus: true
370371
});
372+
defineColors();
371373
const html = `<style>${CSS}</style>` + '\n' + HTML;
372374
const element = document.createElement('template');
373375
element.innerHTML = html;

lib/variables.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
:host{
2+
--calendar-icon-color: var(--jb-date-input-calendar-icon-color, var(--jb-neutral-6));
3+
--calendar-icon-color-active: var(--jb-date-input-calendar-icon-color-active, var(--jb-neutral));
4+
}

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"jalali web-component",
3131
"jalali web component"
3232
],
33-
"version": "5.6.0",
33+
"version": "5.7.0",
3434
"bugs": "https://github.com/javadbat/jb-date-input/issues",
3535
"license": "MIT",
3636
"files": [
@@ -52,11 +52,11 @@
5252
"dependencies": {
5353
"date-fns": "^4.1.0",
5454
"date-fns-jalali": "^4.1.0-0",
55-
"jb-calendar": ">=4.2.4",
55+
"jb-calendar": ">=4.3.0",
5656
"jb-popover":">=1.1.1",
5757
"jb-validation":">=0.4.0",
58-
"jb-input":">=3.8.0",
59-
"jb-core":"0.4.0"
58+
"jb-input":">=3.10.0",
59+
"jb-core":"0.9.0"
6060
},
6161
"devDependencies": {
6262
"jb-form":">=0.6.10"

0 commit comments

Comments
 (0)