jb-core 0.28.0 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/configs/global.d.ts +10 -6
- package/configs/tsconfig-react.json +7 -10
- package/configs/tsconfig-web-component.json +8 -11
- package/dist/index.cjs.js +109 -1
- package/dist/index.cjs.js.br +0 -0
- package/dist/index.cjs.js.gz +0 -0
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +43 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +119 -1
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +113 -1
- package/dist/index.umd.js.br +0 -0
- package/dist/index.umd.js.gz +0 -0
- package/dist/index.umd.js.map +1 -1
- package/i18n/dist/index.cjs.js +57 -1
- package/i18n/dist/index.cjs.js.br +0 -0
- package/i18n/dist/index.cjs.js.gz +0 -0
- package/i18n/dist/index.cjs.js.map +1 -1
- package/i18n/dist/index.d.ts +39 -2
- package/i18n/dist/index.d.ts.map +1 -1
- package/i18n/dist/index.js +58 -1
- package/i18n/dist/index.js.br +0 -0
- package/i18n/dist/index.js.gz +0 -0
- package/i18n/dist/index.js.map +1 -1
- package/i18n/dist/index.umd.js +61 -1
- package/i18n/dist/index.umd.js.br +0 -0
- package/i18n/dist/index.umd.js.gz +0 -0
- package/i18n/dist/index.umd.js.map +1 -1
- package/i18n/tsconfig.json +1 -1
- package/index.js +2 -1
- package/package.json +26 -3
- package/react/dist/index.cjs.js +29 -1
- package/react/dist/index.cjs.js.map +1 -1
- package/react/dist/index.d.ts +25 -2
- package/react/dist/index.js +29 -1
- package/react/dist/index.js.map +1 -1
- package/react/dist/index.umd.js +32 -1
- package/react/dist/index.umd.js.map +1 -1
- package/react/lib/hooks/useLazyRef.ts +1 -3
- package/react/tsconfig.json +1 -1
- package/theme/dist/index.cjs.js +242 -1
- package/theme/dist/index.cjs.js.br +0 -0
- package/theme/dist/index.cjs.js.gz +0 -0
- package/theme/dist/index.cjs.js.map +1 -1
- package/theme/dist/index.d.ts +73 -4
- package/theme/dist/index.d.ts.map +1 -1
- package/theme/dist/index.js +244 -1
- package/theme/dist/index.js.br +0 -0
- package/theme/dist/index.js.gz +0 -0
- package/theme/dist/index.js.map +1 -1
- package/theme/dist/index.umd.js +246 -1
- package/theme/dist/index.umd.js.br +0 -0
- package/theme/dist/index.umd.js.gz +0 -0
- package/theme/dist/index.umd.js.map +1 -1
- package/theme/lib/sizes/index.ts +83 -43
- package/theme/stories/colors.mdx +1 -1
- package/theme/stories/sizes.mdx +16 -6
- package/theme/tsconfig.json +1 -1
package/theme/dist/index.js
CHANGED
|
@@ -1,2 +1,245 @@
|
|
|
1
|
-
var e
|
|
1
|
+
var e = class {
|
|
2
|
+
get value() {
|
|
3
|
+
return `oklch(${this.lightness} ${this.chroma} ${this.hue})`;
|
|
4
|
+
}
|
|
5
|
+
constructor(e, n) {
|
|
6
|
+
this.variableName = n, this.lightness = e.lightness, this.chroma = e.chroma, this.hue = e.hue;
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
function n(n) {
|
|
10
|
+
return new e({
|
|
11
|
+
lightness: 6 * (3 + 1.3 * n) * .01,
|
|
12
|
+
chroma: .001 * (14 + .09 * n),
|
|
13
|
+
hue: 258.36
|
|
14
|
+
}, `--jb-neutral-${n}`);
|
|
15
|
+
}
|
|
16
|
+
function t(n) {
|
|
17
|
+
return new e({
|
|
18
|
+
lightness: n.lightness + .07,
|
|
19
|
+
chroma: n.chroma + .07,
|
|
20
|
+
hue: n.hue
|
|
21
|
+
}, `${n.variableName}-hover`);
|
|
22
|
+
}
|
|
23
|
+
function r(n) {
|
|
24
|
+
return new e({
|
|
25
|
+
lightness: n.lightness - .1,
|
|
26
|
+
chroma: n.chroma - .05,
|
|
27
|
+
hue: n.hue
|
|
28
|
+
}, `${n.variableName}-pressed`);
|
|
29
|
+
}
|
|
30
|
+
function a(n) {
|
|
31
|
+
const t = Math.min(n.lightness + .12 * (1 - n.lightness), .985), r = n.chroma * (1 - .15 * (t - n.lightness));
|
|
32
|
+
return new e({
|
|
33
|
+
lightness: t,
|
|
34
|
+
chroma: Number(r.toFixed(3)),
|
|
35
|
+
hue: n.hue
|
|
36
|
+
}, `${n.variableName}-l`);
|
|
37
|
+
}
|
|
38
|
+
function i(n) {
|
|
39
|
+
const t = Math.max(n.lightness - .12 * n.lightness, .02);
|
|
40
|
+
return new e({
|
|
41
|
+
lightness: t,
|
|
42
|
+
chroma: n.chroma * (1 - .15 * (t - n.lightness)),
|
|
43
|
+
hue: n.hue
|
|
44
|
+
}, `${n.variableName}-d`);
|
|
45
|
+
}
|
|
46
|
+
function h(n) {
|
|
47
|
+
const t = Math.min(n.lightness + .65 * (1 - n.lightness), .93), r = .55 * n.chroma * (1 - .08 * (t - n.lightness)), a = n.hue >= 70 && n.hue <= 162 ? 5 : -3, i = n.hue + a;
|
|
48
|
+
return new e({
|
|
49
|
+
lightness: t,
|
|
50
|
+
chroma: Number(r.toFixed(3)),
|
|
51
|
+
hue: i
|
|
52
|
+
}, `${n.variableName}-subtle`);
|
|
53
|
+
}
|
|
54
|
+
function s(n) {
|
|
55
|
+
const t = Math.max(n.lightness - .35, .22), r = Math.min(1.6 * n.chroma, .28);
|
|
56
|
+
return new e({
|
|
57
|
+
lightness: Number(t.toFixed(3)),
|
|
58
|
+
chroma: Number(r.toFixed(3)),
|
|
59
|
+
hue: n.hue
|
|
60
|
+
}, `${n.variableName}-contrast`);
|
|
61
|
+
}
|
|
62
|
+
function l(e) {
|
|
63
|
+
return {
|
|
64
|
+
main: e,
|
|
65
|
+
hover: t(e),
|
|
66
|
+
pressed: r(e),
|
|
67
|
+
light: a(e),
|
|
68
|
+
dark: i(e),
|
|
69
|
+
subtle: h(e),
|
|
70
|
+
contrast: s(e)
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
const o = new e({
|
|
74
|
+
lightness: .6,
|
|
75
|
+
chroma: .26,
|
|
76
|
+
hue: 256
|
|
77
|
+
}, "--jb-primary"), u = new e({
|
|
78
|
+
lightness: .6,
|
|
79
|
+
chroma: .26,
|
|
80
|
+
hue: 286
|
|
81
|
+
}, "--jb-secondary"), c = new e({
|
|
82
|
+
lightness: .75,
|
|
83
|
+
chroma: .18,
|
|
84
|
+
hue: 70
|
|
85
|
+
}, "--jb-yellow"), m = new e({
|
|
86
|
+
lightness: .68,
|
|
87
|
+
chroma: .1484,
|
|
88
|
+
hue: 162.1
|
|
89
|
+
}, "--jb-green"), g = new e({
|
|
90
|
+
lightness: .6,
|
|
91
|
+
chroma: .22,
|
|
92
|
+
hue: 23.21
|
|
93
|
+
}, "--jb-red"), b = {
|
|
94
|
+
single: {
|
|
95
|
+
black: new e({
|
|
96
|
+
lightness: .14,
|
|
97
|
+
chroma: 0,
|
|
98
|
+
hue: 0
|
|
99
|
+
}, "--jb-black"),
|
|
100
|
+
white: new e({
|
|
101
|
+
lightness: 1,
|
|
102
|
+
chroma: 0,
|
|
103
|
+
hue: 0
|
|
104
|
+
}, "--jb-white"),
|
|
105
|
+
highlight: new e({
|
|
106
|
+
lightness: .93,
|
|
107
|
+
chroma: .2302,
|
|
108
|
+
hue: 125.18
|
|
109
|
+
}, "--jb-highlight")
|
|
110
|
+
},
|
|
111
|
+
neutral: [
|
|
112
|
+
n(0),
|
|
113
|
+
n(1),
|
|
114
|
+
n(2),
|
|
115
|
+
n(3),
|
|
116
|
+
n(4),
|
|
117
|
+
n(5),
|
|
118
|
+
n(6),
|
|
119
|
+
n(7),
|
|
120
|
+
n(8),
|
|
121
|
+
n(9),
|
|
122
|
+
n(10)
|
|
123
|
+
],
|
|
124
|
+
primary: l(o),
|
|
125
|
+
secondary: l(u),
|
|
126
|
+
yellow: l(c),
|
|
127
|
+
green: l(m),
|
|
128
|
+
red: l(g)
|
|
129
|
+
};
|
|
130
|
+
function y(e) {
|
|
131
|
+
try {
|
|
132
|
+
const { value: n, ...t } = e;
|
|
133
|
+
"function" == typeof window.CSS.registerProperty && window.CSS.registerProperty({ ...t }), d(e.name, n);
|
|
134
|
+
} catch (e) {}
|
|
135
|
+
}
|
|
136
|
+
function d(e, n) {
|
|
137
|
+
try {
|
|
138
|
+
n && (document.documentElement.style.getPropertyValue(e) || document.documentElement.style.setProperty(e, n));
|
|
139
|
+
} catch (e) {}
|
|
140
|
+
}
|
|
141
|
+
function p(e = "") {
|
|
142
|
+
return crypto?.randomUUID ? `${e}-${crypto.randomUUID()}` : `${e}-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
143
|
+
}
|
|
144
|
+
function x(e, n) {
|
|
145
|
+
y({
|
|
146
|
+
name: n ?? e.variableName ?? `--${p()}`,
|
|
147
|
+
syntax: "<color>",
|
|
148
|
+
inherits: !0,
|
|
149
|
+
initialValue: e.value
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
function w(e) {
|
|
153
|
+
x(e.main), x(e.dark), x(e.light), x(e.contrast), x(e.hover), x(e.pressed), x(e.subtle);
|
|
154
|
+
}
|
|
155
|
+
function v() {
|
|
156
|
+
var e;
|
|
157
|
+
(function(e) {
|
|
158
|
+
x(e.neutral[0], "--jb-neutral"), w(e.primary), w(e.secondary), w(e.red), w(e.red), w(e.green), w(e.yellow), x(e.single.black), x(e.single.white), x(e.single.highlight);
|
|
159
|
+
for (let n = 1; n <= 10; n++) x(e.neutral[n]);
|
|
160
|
+
})(b), x((e = b).single.black, "--jb-text-primary"), x(e.neutral[7], "--jb-text-secondary"), x(e.single.white, "--jb-text-contrast");
|
|
161
|
+
}
|
|
162
|
+
function f(e) {
|
|
163
|
+
function n(e) {
|
|
164
|
+
document.documentElement.style.setProperty(e.variableName, e.value);
|
|
165
|
+
}
|
|
166
|
+
function t(e) {
|
|
167
|
+
n(e.main), n(e.light), n(e.dark), n(e.contrast), n(e.subtle), n(e.hover), n(e.pressed);
|
|
168
|
+
}
|
|
169
|
+
e.primary && t(e.primary), e.secondary && t(e.secondary), e.green && t(e.green), e.red && t(e.red), e.yellow && t(e.yellow);
|
|
170
|
+
}
|
|
171
|
+
function j(n) {
|
|
172
|
+
const t = {};
|
|
173
|
+
return Object.keys(n).forEach((r) => {
|
|
174
|
+
t[r] = l(new e(n[r], `---jb-${r}`));
|
|
175
|
+
}), t;
|
|
176
|
+
}
|
|
177
|
+
function $() {
|
|
178
|
+
y({
|
|
179
|
+
name: "--jb-radius",
|
|
180
|
+
inherits: !0,
|
|
181
|
+
value: "1rem",
|
|
182
|
+
initialValue: "16px",
|
|
183
|
+
syntax: "<length-percentage>"
|
|
184
|
+
}), y({
|
|
185
|
+
name: "--jb-radius-xs",
|
|
186
|
+
inherits: !0,
|
|
187
|
+
value: "0.5rem",
|
|
188
|
+
initialValue: "8px",
|
|
189
|
+
syntax: "<length-percentage>"
|
|
190
|
+
}), y({
|
|
191
|
+
name: "--jb-radius-sm",
|
|
192
|
+
inherits: !0,
|
|
193
|
+
value: "0.75rem",
|
|
194
|
+
initialValue: "12px",
|
|
195
|
+
syntax: "<length-percentage>"
|
|
196
|
+
}), y({
|
|
197
|
+
name: "--jb-radius-lg",
|
|
198
|
+
inherits: !0,
|
|
199
|
+
value: "1.25rem",
|
|
200
|
+
initialValue: "20px",
|
|
201
|
+
syntax: "<length-percentage>"
|
|
202
|
+
}), y({
|
|
203
|
+
name: "--jb-radius-xl",
|
|
204
|
+
inherits: !0,
|
|
205
|
+
value: "1.5rem",
|
|
206
|
+
initialValue: "24px",
|
|
207
|
+
syntax: "<length-percentage>"
|
|
208
|
+
}), y({
|
|
209
|
+
name: "--jb-control-height-xs",
|
|
210
|
+
inherits: !0,
|
|
211
|
+
value: "1.5rem",
|
|
212
|
+
initialValue: "24px",
|
|
213
|
+
syntax: "<length-percentage>"
|
|
214
|
+
}), y({
|
|
215
|
+
name: "--jb-control-height-sm",
|
|
216
|
+
inherits: !0,
|
|
217
|
+
value: "2rem",
|
|
218
|
+
initialValue: "32px",
|
|
219
|
+
syntax: "<length-percentage>"
|
|
220
|
+
}), y({
|
|
221
|
+
name: "--jb-control-height-md",
|
|
222
|
+
inherits: !0,
|
|
223
|
+
value: "2.5rem",
|
|
224
|
+
initialValue: "40px",
|
|
225
|
+
syntax: "<length-percentage>"
|
|
226
|
+
}), y({
|
|
227
|
+
name: "--jb-control-height-lg",
|
|
228
|
+
inherits: !0,
|
|
229
|
+
value: "3rem",
|
|
230
|
+
initialValue: "48px",
|
|
231
|
+
syntax: "<length-percentage>"
|
|
232
|
+
}), y({
|
|
233
|
+
name: "--jb-control-height-xl",
|
|
234
|
+
inherits: !0,
|
|
235
|
+
value: "4rem",
|
|
236
|
+
initialValue: "64px",
|
|
237
|
+
syntax: "<length-percentage>"
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
function N() {
|
|
241
|
+
$(), v();
|
|
242
|
+
}
|
|
243
|
+
export { e as JBColor, l as createColorGroup, j as createThemeColor, b as defaultColors, v as defineColors, $ as defineSizes, s as getContrastColor, i as getDarkerColor, t as getHoverColor, a as getLighterColor, n as getNeutralColor, r as getPressedColor, h as getSubtleColor, y as registerCssProperty, N as registerDefaultVariables, f as setColors, d as setCssProperty };
|
|
244
|
+
|
|
2
245
|
//# sourceMappingURL=index.js.map
|
package/theme/dist/index.js.br
CHANGED
|
Binary file
|
package/theme/dist/index.js.gz
CHANGED
|
Binary file
|
package/theme/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../../../../../../../../Home/NeveshtAfzar/work/Azad/source/design-system/design-system/modules/jb-core/theme/lib/color/jb-color.ts","../../../../../../../../../../../../Home/NeveshtAfzar/work/Azad/source/design-system/design-system/modules/jb-core/theme/lib/color/utils.ts","../../../../../../../../../../../../Home/NeveshtAfzar/work/Azad/source/design-system/design-system/modules/jb-core/theme/lib/color/constants.ts","../../../../../../../../../../../../Home/NeveshtAfzar/work/Azad/source/design-system/design-system/modules/jb-core/theme/lib/utils.ts","../../dist/index.js","../../../../../../../../../../../../Home/NeveshtAfzar/work/Azad/source/design-system/design-system/modules/jb-core/theme/lib/color/define-colors.ts","../../../../../../../../../../../../Home/NeveshtAfzar/work/Azad/source/design-system/design-system/modules/jb-core/theme/lib/color/index.ts","../../../../../../../../../../../../Home/NeveshtAfzar/work/Azad/source/design-system/design-system/modules/jb-core/theme/lib/sizes/index.ts","../../../../../../../../../../../../Home/NeveshtAfzar/work/Azad/source/design-system/design-system/modules/jb-core/theme/lib/theme.ts"],"sourcesContent":["function e(e,t,o,n={}){document.addEventListener(t,t=>{t.composedPath().includes(e)&&(t.stopPropagation(),t.stopImmediatePropagation(),o(t))},{capture:!0,...n})}function t(e,t,o){const n={altKey:t.altKey,bubbles:t.bubbles,cancelable:t.cancelable,code:t.code,composed:t.composed,ctrlKey:t.ctrlKey,detail:t.detail,isComposing:t.isComposing,key:t.key,location:t.location,metaKey:t.metaKey,repeat:t.repeat,shiftKey:t.shiftKey,view:t.view,charCode:t.charCode,keyCode:t.keyCode,which:t.which,...o};return new KeyboardEvent(e,n)}function o(e,t,o){const n={bubbles:t.bubbles,cancelable:t.cancelable,composed:t.composed,detail:t.detail,isComposing:t.isComposing,view:t.view,which:t.which,data:t.data,dataTransfer:t.dataTransfer,inputType:t.inputType,targetRanges:\"function\"==typeof t.getTargetRanges?t.getTargetRanges():[],...o};return new InputEvent(e,n)}function n(e,t,o){const n={bubbles:t.bubbles,cancelable:t.cancelable,composed:t.composed,detail:t.detail,view:t.view,which:t.which,altKey:t.altKey,button:t.button,buttons:t.buttons,clientX:t.clientX,clientY:t.clientY,ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey,movementX:t.movementX,movementY:t.movementY,screenX:t.screenX,screenY:t.screenY,relatedTarget:t.relatedTarget,modifierAltGraph:t.getModifierState(\"AltGraph\"),modifierCapsLock:t.getModifierState(\"CapsLock\"),modifierFn:t.getModifierState(\"Fn\"),modifierFnLock:t.getModifierState(\"FnLock\"),modifierHyper:t.getModifierState(\"Hyper\"),modifierNumLock:t.getModifierState(\"NumLock\"),modifierScrollLock:t.getModifierState(\"ScrollLock\"),modifierSuper:t.getModifierState(\"Super\"),modifierSymbol:t.getModifierState(\"Symbol\"),modifierSymbolLock:t.getModifierState(\"SymbolLock\"),...o};return new MouseEvent(e,n)}function i(e,t,o){const n={bubbles:t.bubbles,cancelable:t.cancelable,composed:t.composed,detail:t.detail,view:t.view,which:t.which,relatedTarget:t.relatedTarget,...o};return new FocusEvent(e,n)}const r=()=>/Mobi/i.test(window.navigator.userAgent);function a(e){if(\"string\"!=typeof e)return\"\";return e.replace(/[۰-۹]/g,function(e){return String.fromCharCode(e.charCodeAt(0)-1728)})}function c(e){if(\"string\"!=typeof e&&isNaN(e))return\"\";return e.toString().replace(/[0-9]/g,function(e){return String.fromCharCode(e.charCodeAt(0)+1728)})}function l(e,t=document){const o=new CSSStyleSheet;return o.replaceSync(e),t.adoptedStyleSheets.push(o),o}function d(e=\"\"){return crypto?.randomUUID?`${e}-${crypto.randomUUID()}`:`${e}-${Date.now()}-${Math.random().toString(36).slice(2)}`}function s(e,t=!1){return null===e?t:\"\"===e||\"true\"===e.toLowerCase()||\"false\"!==e.toLowerCase()&&Boolean(e)}export{i as createFocusEvent,o as createInputEvent,t as createKeyboardEvent,n as createMouseEvent,c as enToFaDigits,a as faToEnDigits,l as injectCss,r as isMobile,e as listenAndSilentEvent,s as parseBooleanAttribute,d as uniqueId};\n//# sourceMappingURL=index.js.map"],"mappings":"AAEA,IAAa,EAAb,MAKE,SAAI,GACF,MAAA,SAAgB,KAAK,aAAa,KAAK,UAAU,KAAK,MACvD,CACD,WAAA,CAAY,EAAyB,GACnC,KAAK,aAAe,EACpB,KAAK,UAAY,EAAY,UAC7B,KAAK,OAAS,EAAY,OAC1B,KAAK,IAAM,EAAY,GACxB,GCTH,SAAgB,EAAgB,GAC9B,OAAO,IAAI,EAAQ,CAAE,UAAY,GAAK,EAAY,IAAR,GAAgB,IAAM,OAAgC,MAAvB,GAAc,IAAR,GAAwB,I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,OACf,EAAS,EAAM,MACf,EAAS,EAAM,UACf,EAAS,EAAM,QACf,EAAS,EAAM,OACf,EAAS,EAAM,QAChB,CACD,EAAO,SAAW,EAAc,EAAO,SACvC,EAAO,WAAa,EAAc,EAAO,WACzC,EAAO,OAAS,EAAc,EAAO,OACrC,EAAO,KAAO,EAAc,EAAO,KACnC,EAAO,QAAU,EAAc,EAAO,OACvC,CAID,SAAgB,EAAiB,GAC/B,MAAM,EAAsC,CAAE,EAM9C,OALA,OAAO,KAAK,GAAW,QAAS,IAC9B,MACM,EAAa,EADD,IAAI,EAAQ,EAAU,GAAA,SAAkC,MAE1E,EAAY,GAAyB,IAEhC,CACR,CC/CD,SAAgB,IAKd,EAAoB,CAClB,KAAK,cACL,UAAS,EACT,MAAM,OACN,aAAa,OACb,OAAO,wBAET,EAAoB,CAClB,KAAK,iBACL,UAAS,EACT,MAAA,SACA,aAAa,MACb,OAAO,wBAET,EAAoB,CAClB,KAAK,iBACL,UAAS,EACT,MAAA,UACA,aAAa,OACb,OAAO,wBAET,EAAoB,CAClB,KAAK,iBACL,UAAS,EACT,MAAA,UACA,aAAa,OACb,OAAO,wBAET,EAAoB,CAClB,KAAK,iBACL,UAAS,EACT,MAAA,SACA,aAAa,OACb,OAAO,uBApCV,CCDD,SAAgB,IACd,IACA,GACD"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["uniqueId"],"sources":["../lib/color/jb-color.ts","../lib/color/utils.ts","../lib/color/constants.ts","../lib/utils.ts","../../dist/index.js","../lib/color/define-colors.ts","../lib/color/index.ts","../lib/sizes/index.ts","../lib/theme.ts"],"sourcesContent":["import type { OklchParams } from \"./types\";\r\n\r\nexport class JBColor {\r\n lightness:number;\r\n chroma:number;\r\n hue:number;\r\n variableName?:`--${string}`;\r\n get value(){\r\n return `oklch(${this.lightness} ${this.chroma} ${this.hue})`;\r\n }\r\n constructor(colorParams:OklchParams, variableName?:`--${string}`) {\r\n this.variableName = variableName;\r\n this.lightness = colorParams.lightness;\r\n this.chroma = colorParams.chroma;\r\n this.hue = colorParams.hue;\r\n }\r\n}\r\n","import { JBColor } from \"./jb-color\";\r\nimport type { JBColorGroup } from \"./types\";\r\n\r\n//TODO: add DarkMode and LightMode to all the utils functions.\r\n\r\n\r\nexport function getNeutralColor(index: number) {\r\n return new JBColor({ lightness: (6 * (3 + index * 1.3)) * 0.01, chroma: (14 + (index * 0.09)) * 0.001, hue: 258.36 }, `--jb-neutral-${index}`);\r\n}\r\nexport function getHoverColor(color: JBColor) {\r\n return new JBColor({ lightness: color.lightness + 0.07, chroma: color.chroma + 0.07, hue: color.hue, }, `${color.variableName!}-hover`);\r\n}\r\nexport function getPressedColor(color: JBColor) {\r\n return new JBColor({ lightness: color.lightness - 0.1, chroma: color.chroma - 0.05, hue: color.hue, }, `${color.variableName!}-pressed`);\r\n}\r\n\r\nexport function getLighterColor(color: JBColor) {\r\n // Perceptual lightness increase (curved adjustment)\r\n const newL = Math.min(color.lightness + 0.12 * (1 - color.lightness), 0.985);\r\n\r\n // Chroma preservation with gamut safety\r\n const newC = color.chroma * (1 - 0.15 * (newL - color.lightness));\r\n\r\n return new JBColor({ lightness: newL, chroma: Number(newC.toFixed(3)), hue: color.hue }, `${color.variableName!}-l`);\r\n}\r\n\r\nexport function getDarkerColor(color: JBColor) {\r\n // Perceptual lightness decrease (curved adjustment)\r\n const newL = Math.max(color.lightness - 0.12 * color.lightness, 0.02);\r\n\r\n // Chroma preservation with gamut safety (slightly increased chroma as we darken)\r\n const newC = color.chroma * (1 - 0.15 * (newL - color.lightness));\r\n\r\n return new JBColor({ lightness: newL, chroma: newC, hue: color.hue }, `${color.variableName!}-d`);\r\n}\r\nexport function getSubtleColor(color: JBColor) {\r\n // High lightness while maintaining color presence\r\n const newL = Math.min(color.lightness + 0.65 * (1 - color.lightness), 0.93);\r\n\r\n // Keep substantial chroma but adjusted for lighter tones\r\n const newC = color.chroma * 0.55 * (1 - 0.08 * (newL - color.lightness));\r\n\r\n // Optional slight hue tuning for pastel aesthetics\r\n const hueShift = color.hue >= 70 && color.hue <= 162 ? 5 : -3;\r\n const newHue = color.hue + hueShift;\r\n\r\n return new JBColor(\r\n { lightness: newL, chroma: Number(newC.toFixed(3)), hue: newHue },\r\n `${color.variableName!}-subtle`\r\n );\r\n}\r\n/**\r\n * contrast is the color mostly used for text on top of the background. in light mode it is really dark and in dark mode it is really light.\r\n * It is not the same as the text color, and can be used elsewhere too.\r\n */\r\nexport function getContrastColor(color: JBColor) {\r\n // Fixed contrast parameters\r\n const LIGHTNESS_DEPTH = 0.35; // How much darker we make the color\r\n const CHROMA_BOOST = 1.6; // Color intensity multiplier\r\n const MIN_LIGHTNESS = 0.22; // Darkest allowed value\r\n const MAX_CHROMA = 0.28;// Prevent over-saturation\r\n\r\n // Calculate new values\r\n const newLightness = Math.max(color.lightness - LIGHTNESS_DEPTH, MIN_LIGHTNESS);\r\n const newChroma = Math.min(color.chroma * CHROMA_BOOST, MAX_CHROMA);\r\n\r\n // Maintain original hue for color harmony\r\n return new JBColor(\r\n {\r\n lightness: Number(newLightness.toFixed(3)),\r\n chroma: Number(newChroma.toFixed(3)),\r\n hue: color.hue\r\n },\r\n `${color.variableName!}-contrast`\r\n );\r\n}\r\n\r\nexport function createColorGroup(color: JBColor): JBColorGroup {\r\n return {\r\n main: color,\r\n hover: getHoverColor(color),\r\n pressed: getPressedColor(color),\r\n light: getLighterColor(color),\r\n dark: getDarkerColor(color),\r\n subtle: getSubtleColor(color),\r\n contrast: getContrastColor(color)\r\n }\r\n}","import { JBColor } from \"./jb-color\";\r\nimport type { JBThemeColors } from \"./types\";\r\nimport { getNeutralColor, createColorGroup } from \"./utils\";\r\n\r\nconst primary = new JBColor({lightness:0.6,chroma:0.26,hue:256},'--jb-primary');\r\nconst secondary = new JBColor({lightness:0.6,chroma:0.26,hue:286},'--jb-secondary');\r\nconst yellow = new JBColor({lightness:0.75,chroma:0.18,hue:70},'--jb-yellow');\r\nconst green = new JBColor({lightness:0.68,chroma:0.1484,hue:162.1},'--jb-green');\r\nconst red = new JBColor({lightness:0.6,chroma:0.22,hue:23.21},'--jb-red');\r\n\r\nexport const defaultColors:JBThemeColors = {\r\n single:{\r\n black: new JBColor({lightness:0.14,chroma:0,hue:0},'--jb-black'),\r\n white: new JBColor({lightness:1,chroma:0,hue:0},'--jb-white'),\r\n highlight:new JBColor({lightness:0.93,chroma:0.2302,hue:125.18},'--jb-highlight'),\r\n },\r\n neutral: [getNeutralColor(0),getNeutralColor(1),getNeutralColor(2),getNeutralColor(3),getNeutralColor(4),getNeutralColor(5),getNeutralColor(6),getNeutralColor(7),getNeutralColor(8),getNeutralColor(9),getNeutralColor(10)],\r\n primary:createColorGroup(primary),\r\n secondary:createColorGroup(secondary),\r\n yellow:createColorGroup(yellow),\r\n green:createColorGroup(green),\r\n red:createColorGroup(red),\r\n} as const;\r\n\r\n","export type PropertyDefinitionParameter = PropertyDefinition & {\r\n value?: string,\r\n}\r\n\r\nexport function registerCssProperty(parameter: PropertyDefinitionParameter) {\r\n try {\r\n const { value, ...rest } = parameter;\r\n if (typeof window.CSS.registerProperty == \"function\") {\r\n window.CSS.registerProperty({\r\n ...rest\r\n });\r\n }\r\n setCssProperty(parameter.name, value);\r\n } catch (e) {\r\n // if property is already defined or any other type of error\r\n }\r\n}\r\n\r\nexport function setCssProperty(name: string, value?: string) {\r\n try {\r\n if (value) {\r\n if (!document.documentElement.style.getPropertyValue(name)) {\r\n document.documentElement.style.setProperty(name, value);\r\n }\r\n }\r\n } catch (e) {\r\n //\r\n }\r\n}","function e(e, t, o, n = {}) {\n\tdocument.addEventListener(t, (t) => {\n\t\tt.composedPath().includes(e) && (t.stopPropagation(), t.stopImmediatePropagation(), o(t));\n\t}, {\n\t\tcapture: !0,\n\t\t...n\n\t});\n}\nfunction t(e, t, o) {\n\tconst n = {\n\t\taltKey: t.altKey,\n\t\tbubbles: t.bubbles,\n\t\tcancelable: t.cancelable,\n\t\tcode: t.code,\n\t\tcomposed: t.composed,\n\t\tctrlKey: t.ctrlKey,\n\t\tdetail: t.detail,\n\t\tisComposing: t.isComposing,\n\t\tkey: t.key,\n\t\tlocation: t.location,\n\t\tmetaKey: t.metaKey,\n\t\trepeat: t.repeat,\n\t\tshiftKey: t.shiftKey,\n\t\tview: t.view,\n\t\tcharCode: t.charCode,\n\t\tkeyCode: t.keyCode,\n\t\twhich: t.which,\n\t\t...o\n\t};\n\treturn new KeyboardEvent(e, n);\n}\nfunction o(e, t, o) {\n\tconst n = {\n\t\tbubbles: t.bubbles,\n\t\tcancelable: t.cancelable,\n\t\tcomposed: t.composed,\n\t\tdetail: t.detail,\n\t\tisComposing: t.isComposing,\n\t\tview: t.view,\n\t\twhich: t.which,\n\t\tdata: t.data,\n\t\tdataTransfer: t.dataTransfer,\n\t\tinputType: t.inputType,\n\t\ttargetRanges: \"function\" == typeof t.getTargetRanges ? t.getTargetRanges() : [],\n\t\t...o\n\t};\n\treturn new InputEvent(e, n);\n}\nfunction n(e, t, o) {\n\tconst n = {\n\t\tbubbles: t.bubbles,\n\t\tcancelable: t.cancelable,\n\t\tcomposed: t.composed,\n\t\tdetail: t.detail,\n\t\tview: t.view,\n\t\twhich: t.which,\n\t\taltKey: t.altKey,\n\t\tbutton: t.button,\n\t\tbuttons: t.buttons,\n\t\tclientX: t.clientX,\n\t\tclientY: t.clientY,\n\t\tctrlKey: t.ctrlKey,\n\t\tmetaKey: t.metaKey,\n\t\tshiftKey: t.shiftKey,\n\t\tmovementX: t.movementX,\n\t\tmovementY: t.movementY,\n\t\tscreenX: t.screenX,\n\t\tscreenY: t.screenY,\n\t\trelatedTarget: t.relatedTarget,\n\t\tmodifierAltGraph: t.getModifierState(\"AltGraph\"),\n\t\tmodifierCapsLock: t.getModifierState(\"CapsLock\"),\n\t\tmodifierFn: t.getModifierState(\"Fn\"),\n\t\tmodifierFnLock: t.getModifierState(\"FnLock\"),\n\t\tmodifierHyper: t.getModifierState(\"Hyper\"),\n\t\tmodifierNumLock: t.getModifierState(\"NumLock\"),\n\t\tmodifierScrollLock: t.getModifierState(\"ScrollLock\"),\n\t\tmodifierSuper: t.getModifierState(\"Super\"),\n\t\tmodifierSymbol: t.getModifierState(\"Symbol\"),\n\t\tmodifierSymbolLock: t.getModifierState(\"SymbolLock\"),\n\t\t...o\n\t};\n\treturn new MouseEvent(e, n);\n}\nfunction i(e, t, o) {\n\tconst n = {\n\t\tbubbles: t.bubbles,\n\t\tcancelable: t.cancelable,\n\t\tcomposed: t.composed,\n\t\tdetail: t.detail,\n\t\tview: t.view,\n\t\twhich: t.which,\n\t\trelatedTarget: t.relatedTarget,\n\t\t...o\n\t};\n\treturn new FocusEvent(e, n);\n}\nconst r = () => /Mobi/i.test(window.navigator.userAgent);\nfunction a(e) {\n\treturn \"string\" != typeof e ? \"\" : e.replace(/[۰-۹]/g, function(e) {\n\t\treturn String.fromCharCode(e.charCodeAt(0) - 1728);\n\t});\n}\nfunction c(e) {\n\treturn \"string\" != typeof e && isNaN(e) ? \"\" : e.toString().replace(/[0-9]/g, function(e) {\n\t\treturn String.fromCharCode(e.charCodeAt(0) + 1728);\n\t});\n}\nfunction l(e, t = document) {\n\tconst o = new CSSStyleSheet();\n\treturn o.replaceSync(e), t.adoptedStyleSheets.push(o), o;\n}\nfunction d(e = \"\") {\n\treturn crypto?.randomUUID ? `${e}-${crypto.randomUUID()}` : `${e}-${Date.now()}-${Math.random().toString(36).slice(2)}`;\n}\nfunction s(e, t = !1) {\n\treturn null === e ? t : \"\" === e || \"true\" === e.toLowerCase() || \"false\" !== e.toLowerCase() && Boolean(e);\n}\nexport { i as createFocusEvent, o as createInputEvent, t as createKeyboardEvent, n as createMouseEvent, c as enToFaDigits, a as faToEnDigits, l as injectCss, r as isMobile, e as listenAndSilentEvent, s as parseBooleanAttribute, d as uniqueId };\n\n//# sourceMappingURL=index.js.map","import { registerCssProperty } from \"../utils\";\r\nimport type { JBColor } from \"./jb-color\";\r\nimport { uniqueId } from \"jb-core\";\r\nimport type { JBColorGroup, JBThemeColors } from \"./types\";\r\n\r\nfunction defineColor(color:JBColor , name?:string){\r\nregisterCssProperty({\r\n name: name??color.variableName??`--${uniqueId()}`,\r\n syntax: \"<color>\",\r\n inherits: true,\r\n initialValue: color.value,\r\n });\r\n}\r\nfunction defineColorGroup(group:JBColorGroup){\r\n defineColor(group.main);\r\n defineColor(group.dark);\r\n defineColor(group.light);\r\n defineColor(group.contrast);\r\n defineColor(group.hover);\r\n defineColor(group.pressed);\r\n defineColor(group.subtle);\r\n}\r\nexport function defineColorCodes(colors:JBThemeColors){\r\n defineColor(colors.neutral[0],'--jb-neutral');\r\n defineColorGroup(colors.primary);\r\n defineColorGroup(colors.secondary);\r\n defineColorGroup(colors.red);\r\n defineColorGroup(colors.red);\r\n defineColorGroup(colors.green);\r\n defineColorGroup(colors.yellow);\r\n defineColor(colors.single.black);\r\n defineColor(colors.single.white);\r\n defineColor(colors.single.highlight);\r\n for(let i=1;i<=10;i++){\r\n defineColor(colors.neutral[i])\r\n }\r\n}\r\n\r\nexport function defineTextColors(colors:JBThemeColors) {\r\n defineColor(colors.single.black, \"--jb-text-primary\");\r\n defineColor(colors.neutral[7], \"--jb-text-secondary\");\r\n defineColor(colors.single.white, \"--jb-text-contrast\");\r\n}\r\n","import { defaultColors } from \"./constants\";\r\nimport { defineColorCodes, defineTextColors } from \"./define-colors\";\r\nimport { JBColor } from \"./jb-color\";\r\nimport type { ColorGroupsKey, JBColorGroup, JBThemeColors, OklchParams } from \"./types\";\r\nimport { createColorGroup } from \"./utils\";\r\nexport * from './utils';\r\nexport * from \"./jb-color\";\r\nexport * from \"./types\";\r\n\r\n\r\nexport { defaultColors };\r\n\r\nexport function defineColors() {\r\n defineColorCodes(defaultColors);\r\n defineTextColors(defaultColors);\r\n}\r\n\r\n\r\nexport type SetThemeColorParameter = {[key in ColorGroupsKey]?:JBColorGroup}\r\nexport function setColors(colors: SetThemeColorParameter) {\r\n function setColor(color: JBColor) {\r\n document.documentElement.style.setProperty(color.variableName as string, color.value);\r\n }\r\n function setColorGroup(group:JBColorGroup){\r\n setColor(group.main);\r\n setColor(group.light);\r\n setColor(group.dark);\r\n setColor(group.contrast);\r\n setColor(group.subtle);\r\n setColor(group.hover);\r\n setColor(group.pressed);\r\n }\r\n colors.primary && setColorGroup(colors.primary);\r\n colors.secondary && setColorGroup(colors.secondary);\r\n colors.green && setColorGroup(colors.green);\r\n colors.red && setColorGroup(colors.red);\r\n colors.yellow && setColorGroup(colors.yellow);\r\n}\r\n\r\nexport type CreateThemeColorParameter = {[key in ColorGroupsKey]?:OklchParams}\r\n\r\nexport function createThemeColor(parameter: CreateThemeColorParameter): Partial<JBThemeColors> {\r\n const themeColors: Partial<JBThemeColors> = {};\r\n Object.keys(parameter).forEach((key: string) => {\r\n const baseColor = new JBColor(parameter[key as ColorGroupsKey]!, `---jb-${key}`);\r\n const colorGroup = createColorGroup(baseColor);\r\n themeColors[key as ColorGroupsKey] = colorGroup;\r\n });\r\n return themeColors;\r\n}","import { registerCssProperty } from \"../utils.js\";\n\nexport function defineSizes() {\n defineRadiusVariables();\n defineControlHeightVariables();\n}\nfunction defineRadiusVariables() {\n // we use px instead of rem because css variables are not support rem as default value and we need to set rem value in a root element\n registerCssProperty({\n name: \"--jb-radius\",\n inherits: true,\n value: \"1rem\",\n // it define in @property so it should remain px not rem\n initialValue: \"16px\",\n syntax: \"<length-percentage>\",\n });\n registerCssProperty({\n name: \"--jb-radius-xs\",\n inherits: true,\n value: `0.5rem`,\n initialValue: \"8px\",\n syntax: \"<length-percentage>\",\n });\n registerCssProperty({\n name: \"--jb-radius-sm\",\n inherits: true,\n value: `0.75rem`,\n initialValue: \"12px\",\n syntax: \"<length-percentage>\",\n });\n registerCssProperty({\n name: \"--jb-radius-lg\",\n inherits: true,\n value: `1.25rem`,\n initialValue: \"20px\",\n syntax: \"<length-percentage>\",\n });\n registerCssProperty({\n name: \"--jb-radius-xl\",\n inherits: true,\n value: `1.5rem`,\n initialValue: \"24px\",\n syntax: \"<length-percentage>\",\n });\n}\n\nfunction defineControlHeightVariables() {\n registerCssProperty({\n name: \"--jb-control-height-xs\",\n inherits: true,\n value: \"1.5rem\",\n initialValue: \"24px\",\n syntax: \"<length-percentage>\",\n });\n registerCssProperty({\n name: \"--jb-control-height-sm\",\n inherits: true,\n value: \"2rem\",\n initialValue: \"32px\",\n syntax: \"<length-percentage>\",\n });\n registerCssProperty({\n name: \"--jb-control-height-md\",\n inherits: true,\n value: \"2.5rem\",\n initialValue: \"40px\",\n syntax: \"<length-percentage>\",\n });\n registerCssProperty({\n name: \"--jb-control-height-lg\",\n inherits: true,\n value: \"3rem\",\n initialValue: \"48px\",\n syntax: \"<length-percentage>\",\n });\n registerCssProperty({\n name: \"--jb-control-height-xl\",\n inherits: true,\n value: \"4rem\",\n initialValue: \"64px\",\n syntax: \"<length-percentage>\",\n });\n}\n","import { defineColors } from \"./color/index.js\";\r\nimport { defineSizes } from \"./sizes/index.js\";\r\n\r\nexport function registerDefaultVariables() {\r\n defineSizes();\r\n defineColors();\r\n}"],"mappings":"AAEA,IAAa,IAAb,MAAA;CAKE,IAAA,QAAI;EACF,OAAO,SAAS,KAAK,UAAA,GAAa,KAAK,OAAA,GAAU,KAAK,IAAA;CACxD;CACA,YAAY,GAAyB,GAAA;EACnC,KAAK,eAAe,GACpB,KAAK,YAAY,EAAY,WAC7B,KAAK,SAAS,EAAY,QAC1B,KAAK,MAAM,EAAY;CACzB;AAAA;ACTF,SAAgB,EAAgB,GAAA;CAC9B,OAAO,IAAI,EAAQ;EAAE,WAAY,KAAK,IAAY,MAAR,KAAgB;EAAM,QAAgC,QAAvB,KAAc,MAAR;EAAwB,KAAK;CAAA,GAAU,gBAAgB,GAAA;AACxI;AACA,SAAgB,EAAc,GAAA;CAC5B,OAAO,IAAI,EAAQ;EAAE,WAAW,EAAM,YAAY;EAAM,QAAQ,EAAM,SAAS;EAAM,KAAK,EAAM;CAAA,GAAQ,GAAG,EAAM,aAAA,OAAA;AACnH;AACA,SAAgB,EAAgB,GAAA;CAC9B,OAA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AAoB;EAClB,MAAM;EACN,UAAA,CAAU;EACV,OAAO;EACP,cAAc;EACd,QAAQ;CAAA,CAAA,GAEV,EAAoB;EAClB,MAAM;EACN,UAAA,CAAU;EACV,OAAO;EACP,cAAc;EACd,QAAQ;CAAA,CAAA,GAEV,EAAoB;EAClB,MAAM;EACN,UAAA,CAAU;EACV,OAAO;EACP,cAAc;EACd,QAAQ;CAAA,CAAA,GAEV,EAAoB;EAClB,MAAM;EACN,UAAA,CAAU;EACV,OAAO;EACP,cAAc;EACd,QAAQ;CAAA,CAAA,GAKV,EAAoB;EAClB,MAAM;EACN,UAAA,CAAU;EACV,OAAO;EACP,cAAc;EACd,QAAQ;CAAA,CAAA,GAEV,EAAoB;EAClB,MAAM;EACN,UAAA,CAAU;EACV,OAAO;EACP,cAAc;EACd,QAAQ;CAAA,CAAA,GAEV,EAAoB;EAClB,MAAM;EACN,UAAA,CAAU;EACV,OAAO;EACP,cAAc;EACd,QAAQ;CAAA,CAAA,GAEV,EAAoB;EAClB,MAAM;EACN,UAAA,CAAU;EACV,OAAO;EACP,cAAc;EACd,QAAQ;CAAA,CAAA,GAEV,EAAoB;EAClB,MAAM;EACN,UAAA,CAAU;EACV,OAAO;EACP,cAAc;EACd,QAAQ;CAAA,CAAA;AA3EZ;ACFA,SAAgB,IAAA;CACd,EAAA,GACA,EAAA;AACF;AAAA,SAAA,KAAA,SAAA,KAAA,kBAAA,KAAA,kBAAA,KAAA,eAAA,KAAA,cAAA,KAAA,aAAA,KAAA,kBAAA,KAAA,gBAAA,KAAA,eAAA,KAAA,iBAAA,KAAA,iBAAA,KAAA,iBAAA,KAAA,gBAAA,KAAA,qBAAA,KAAA,0BAAA,KAAA,WAAA,KAAA"}
|
package/theme/dist/index.umd.js
CHANGED
|
@@ -1,2 +1,247 @@
|
|
|
1
|
-
|
|
1
|
+
(function(e, t) {
|
|
2
|
+
"object" == typeof exports && "undefined" != typeof module ? t(exports) : "function" == typeof define && define.amd ? define(["exports"], t) : t((e = "undefined" != typeof globalThis ? globalThis : e || self).JBCoreTheme = {});
|
|
3
|
+
})(this, function(e) {
|
|
4
|
+
Object.defineProperty(e, Symbol.toStringTag, { value: "Module" });
|
|
5
|
+
var t = class {
|
|
6
|
+
get value() {
|
|
7
|
+
return `oklch(${this.lightness} ${this.chroma} ${this.hue})`;
|
|
8
|
+
}
|
|
9
|
+
constructor(e, t) {
|
|
10
|
+
this.variableName = t, this.lightness = e.lightness, this.chroma = e.chroma, this.hue = e.hue;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
function n(e) {
|
|
14
|
+
return new t({
|
|
15
|
+
lightness: 6 * (3 + 1.3 * e) * .01,
|
|
16
|
+
chroma: .001 * (14 + .09 * e),
|
|
17
|
+
hue: 258.36
|
|
18
|
+
}, `--jb-neutral-${e}`);
|
|
19
|
+
}
|
|
20
|
+
function r(e) {
|
|
21
|
+
return new t({
|
|
22
|
+
lightness: e.lightness + .07,
|
|
23
|
+
chroma: e.chroma + .07,
|
|
24
|
+
hue: e.hue
|
|
25
|
+
}, `${e.variableName}-hover`);
|
|
26
|
+
}
|
|
27
|
+
function i(e) {
|
|
28
|
+
return new t({
|
|
29
|
+
lightness: e.lightness - .1,
|
|
30
|
+
chroma: e.chroma - .05,
|
|
31
|
+
hue: e.hue
|
|
32
|
+
}, `${e.variableName}-pressed`);
|
|
33
|
+
}
|
|
34
|
+
function a(e) {
|
|
35
|
+
const n = Math.min(e.lightness + .12 * (1 - e.lightness), .985), r = e.chroma * (1 - .15 * (n - e.lightness));
|
|
36
|
+
return new t({
|
|
37
|
+
lightness: n,
|
|
38
|
+
chroma: Number(r.toFixed(3)),
|
|
39
|
+
hue: e.hue
|
|
40
|
+
}, `${e.variableName}-l`);
|
|
41
|
+
}
|
|
42
|
+
function l(e) {
|
|
43
|
+
const n = Math.max(e.lightness - .12 * e.lightness, .02);
|
|
44
|
+
return new t({
|
|
45
|
+
lightness: n,
|
|
46
|
+
chroma: e.chroma * (1 - .15 * (n - e.lightness)),
|
|
47
|
+
hue: e.hue
|
|
48
|
+
}, `${e.variableName}-d`);
|
|
49
|
+
}
|
|
50
|
+
function s(e) {
|
|
51
|
+
const n = Math.min(e.lightness + .65 * (1 - e.lightness), .93), r = .55 * e.chroma * (1 - .08 * (n - e.lightness)), i = e.hue >= 70 && e.hue <= 162 ? 5 : -3, a = e.hue + i;
|
|
52
|
+
return new t({
|
|
53
|
+
lightness: n,
|
|
54
|
+
chroma: Number(r.toFixed(3)),
|
|
55
|
+
hue: a
|
|
56
|
+
}, `${e.variableName}-subtle`);
|
|
57
|
+
}
|
|
58
|
+
function o(e) {
|
|
59
|
+
const n = Math.max(e.lightness - .35, .22), r = Math.min(1.6 * e.chroma, .28);
|
|
60
|
+
return new t({
|
|
61
|
+
lightness: Number(n.toFixed(3)),
|
|
62
|
+
chroma: Number(r.toFixed(3)),
|
|
63
|
+
hue: e.hue
|
|
64
|
+
}, `${e.variableName}-contrast`);
|
|
65
|
+
}
|
|
66
|
+
function h(e) {
|
|
67
|
+
return {
|
|
68
|
+
main: e,
|
|
69
|
+
hover: r(e),
|
|
70
|
+
pressed: i(e),
|
|
71
|
+
light: a(e),
|
|
72
|
+
dark: l(e),
|
|
73
|
+
subtle: s(e),
|
|
74
|
+
contrast: o(e)
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
const u = new t({
|
|
78
|
+
lightness: .6,
|
|
79
|
+
chroma: .26,
|
|
80
|
+
hue: 256
|
|
81
|
+
}, "--jb-primary"), c = new t({
|
|
82
|
+
lightness: .6,
|
|
83
|
+
chroma: .26,
|
|
84
|
+
hue: 286
|
|
85
|
+
}, "--jb-secondary"), g = new t({
|
|
86
|
+
lightness: .75,
|
|
87
|
+
chroma: .18,
|
|
88
|
+
hue: 70
|
|
89
|
+
}, "--jb-yellow"), m = new t({
|
|
90
|
+
lightness: .68,
|
|
91
|
+
chroma: .1484,
|
|
92
|
+
hue: 162.1
|
|
93
|
+
}, "--jb-green"), d = new t({
|
|
94
|
+
lightness: .6,
|
|
95
|
+
chroma: .22,
|
|
96
|
+
hue: 23.21
|
|
97
|
+
}, "--jb-red"), b = {
|
|
98
|
+
single: {
|
|
99
|
+
black: new t({
|
|
100
|
+
lightness: .14,
|
|
101
|
+
chroma: 0,
|
|
102
|
+
hue: 0
|
|
103
|
+
}, "--jb-black"),
|
|
104
|
+
white: new t({
|
|
105
|
+
lightness: 1,
|
|
106
|
+
chroma: 0,
|
|
107
|
+
hue: 0
|
|
108
|
+
}, "--jb-white"),
|
|
109
|
+
highlight: new t({
|
|
110
|
+
lightness: .93,
|
|
111
|
+
chroma: .2302,
|
|
112
|
+
hue: 125.18
|
|
113
|
+
}, "--jb-highlight")
|
|
114
|
+
},
|
|
115
|
+
neutral: [
|
|
116
|
+
n(0),
|
|
117
|
+
n(1),
|
|
118
|
+
n(2),
|
|
119
|
+
n(3),
|
|
120
|
+
n(4),
|
|
121
|
+
n(5),
|
|
122
|
+
n(6),
|
|
123
|
+
n(7),
|
|
124
|
+
n(8),
|
|
125
|
+
n(9),
|
|
126
|
+
n(10)
|
|
127
|
+
],
|
|
128
|
+
primary: h(u),
|
|
129
|
+
secondary: h(c),
|
|
130
|
+
yellow: h(g),
|
|
131
|
+
green: h(m),
|
|
132
|
+
red: h(d)
|
|
133
|
+
};
|
|
134
|
+
function y(e) {
|
|
135
|
+
try {
|
|
136
|
+
const { value: t, ...n } = e;
|
|
137
|
+
"function" == typeof window.CSS.registerProperty && window.CSS.registerProperty({ ...n }), p(e.name, t);
|
|
138
|
+
} catch (e) {}
|
|
139
|
+
}
|
|
140
|
+
function p(e, t) {
|
|
141
|
+
try {
|
|
142
|
+
t && (document.documentElement.style.getPropertyValue(e) || document.documentElement.style.setProperty(e, t));
|
|
143
|
+
} catch (e) {}
|
|
144
|
+
}
|
|
145
|
+
function f(e = "") {
|
|
146
|
+
return crypto?.randomUUID ? `${e}-${crypto.randomUUID()}` : `${e}-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
147
|
+
}
|
|
148
|
+
function x(e, t) {
|
|
149
|
+
y({
|
|
150
|
+
name: t ?? e.variableName ?? `--${f()}`,
|
|
151
|
+
syntax: "<color>",
|
|
152
|
+
inherits: !0,
|
|
153
|
+
initialValue: e.value
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
function v(e) {
|
|
157
|
+
x(e.main), x(e.dark), x(e.light), x(e.contrast), x(e.hover), x(e.pressed), x(e.subtle);
|
|
158
|
+
}
|
|
159
|
+
function w() {
|
|
160
|
+
var e;
|
|
161
|
+
(function(e) {
|
|
162
|
+
x(e.neutral[0], "--jb-neutral"), v(e.primary), v(e.secondary), v(e.red), v(e.red), v(e.green), v(e.yellow), x(e.single.black), x(e.single.white), x(e.single.highlight);
|
|
163
|
+
for (let t = 1; t <= 10; t++) x(e.neutral[t]);
|
|
164
|
+
})(b), x((e = b).single.black, "--jb-text-primary"), x(e.neutral[7], "--jb-text-secondary"), x(e.single.white, "--jb-text-contrast");
|
|
165
|
+
}
|
|
166
|
+
function j() {
|
|
167
|
+
y({
|
|
168
|
+
name: "--jb-radius",
|
|
169
|
+
inherits: !0,
|
|
170
|
+
value: "1rem",
|
|
171
|
+
initialValue: "16px",
|
|
172
|
+
syntax: "<length-percentage>"
|
|
173
|
+
}), y({
|
|
174
|
+
name: "--jb-radius-xs",
|
|
175
|
+
inherits: !0,
|
|
176
|
+
value: "0.5rem",
|
|
177
|
+
initialValue: "8px",
|
|
178
|
+
syntax: "<length-percentage>"
|
|
179
|
+
}), y({
|
|
180
|
+
name: "--jb-radius-sm",
|
|
181
|
+
inherits: !0,
|
|
182
|
+
value: "0.75rem",
|
|
183
|
+
initialValue: "12px",
|
|
184
|
+
syntax: "<length-percentage>"
|
|
185
|
+
}), y({
|
|
186
|
+
name: "--jb-radius-lg",
|
|
187
|
+
inherits: !0,
|
|
188
|
+
value: "1.25rem",
|
|
189
|
+
initialValue: "20px",
|
|
190
|
+
syntax: "<length-percentage>"
|
|
191
|
+
}), y({
|
|
192
|
+
name: "--jb-radius-xl",
|
|
193
|
+
inherits: !0,
|
|
194
|
+
value: "1.5rem",
|
|
195
|
+
initialValue: "24px",
|
|
196
|
+
syntax: "<length-percentage>"
|
|
197
|
+
}), y({
|
|
198
|
+
name: "--jb-control-height-xs",
|
|
199
|
+
inherits: !0,
|
|
200
|
+
value: "1.5rem",
|
|
201
|
+
initialValue: "24px",
|
|
202
|
+
syntax: "<length-percentage>"
|
|
203
|
+
}), y({
|
|
204
|
+
name: "--jb-control-height-sm",
|
|
205
|
+
inherits: !0,
|
|
206
|
+
value: "2rem",
|
|
207
|
+
initialValue: "32px",
|
|
208
|
+
syntax: "<length-percentage>"
|
|
209
|
+
}), y({
|
|
210
|
+
name: "--jb-control-height-md",
|
|
211
|
+
inherits: !0,
|
|
212
|
+
value: "2.5rem",
|
|
213
|
+
initialValue: "40px",
|
|
214
|
+
syntax: "<length-percentage>"
|
|
215
|
+
}), y({
|
|
216
|
+
name: "--jb-control-height-lg",
|
|
217
|
+
inherits: !0,
|
|
218
|
+
value: "3rem",
|
|
219
|
+
initialValue: "48px",
|
|
220
|
+
syntax: "<length-percentage>"
|
|
221
|
+
}), y({
|
|
222
|
+
name: "--jb-control-height-xl",
|
|
223
|
+
inherits: !0,
|
|
224
|
+
value: "4rem",
|
|
225
|
+
initialValue: "64px",
|
|
226
|
+
syntax: "<length-percentage>"
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
e.JBColor = t, e.createColorGroup = h, e.createThemeColor = function(e) {
|
|
230
|
+
const n = {};
|
|
231
|
+
return Object.keys(e).forEach((r) => {
|
|
232
|
+
n[r] = h(new t(e[r], `---jb-${r}`));
|
|
233
|
+
}), n;
|
|
234
|
+
}, e.defaultColors = b, e.defineColors = w, e.defineSizes = j, e.getContrastColor = o, e.getDarkerColor = l, e.getHoverColor = r, e.getLighterColor = a, e.getNeutralColor = n, e.getPressedColor = i, e.getSubtleColor = s, e.registerCssProperty = y, e.registerDefaultVariables = function() {
|
|
235
|
+
j(), w();
|
|
236
|
+
}, e.setColors = function(e) {
|
|
237
|
+
function t(e) {
|
|
238
|
+
document.documentElement.style.setProperty(e.variableName, e.value);
|
|
239
|
+
}
|
|
240
|
+
function n(e) {
|
|
241
|
+
t(e.main), t(e.light), t(e.dark), t(e.contrast), t(e.subtle), t(e.hover), t(e.pressed);
|
|
242
|
+
}
|
|
243
|
+
e.primary && n(e.primary), e.secondary && n(e.secondary), e.green && n(e.green), e.red && n(e.red), e.yellow && n(e.yellow);
|
|
244
|
+
}, e.setCssProperty = p;
|
|
245
|
+
});
|
|
246
|
+
|
|
2
247
|
//# sourceMappingURL=index.umd.js.map
|
|
Binary file
|
|
Binary file
|