jb-core 0.29.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/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.gz +0 -0
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js.gz +0 -0
- package/dist/index.umd.js.map +1 -1
- package/i18n/dist/index.cjs.js +35 -39
- 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 +36 -39
- 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 +32 -36
- 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/index.js +2 -1
- package/package.json +1 -1
- package/react/dist/index.cjs.js +11 -11
- package/react/dist/index.cjs.js.map +1 -1
- package/react/dist/index.d.ts +25 -2
- package/react/dist/index.js +18 -18
- package/react/dist/index.js.map +1 -1
- package/react/dist/index.umd.js +8 -7
- package/react/dist/index.umd.js.map +1 -1
- package/react/lib/hooks/useLazyRef.ts +1 -3
- package/theme/dist/index.cjs.js +82 -52
- 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 +53 -23
- 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 +53 -23
- 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/sizes.mdx +15 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","names":[],"sources":["../lib/color/file:/A:/Home/NeveshtAfzar/work/Azad/source/design-system/design-system/modules/jb-core/theme/lib/color/jb-color.ts","../lib/color/file:/A:/Home/NeveshtAfzar/work/Azad/source/design-system/design-system/modules/jb-core/theme/lib/color/utils.ts","../lib/color/file:/A:/Home/NeveshtAfzar/work/Azad/source/design-system/design-system/modules/jb-core/theme/lib/color/constants.ts","../lib/file:/A:/Home/NeveshtAfzar/work/Azad/source/design-system/design-system/modules/jb-core/theme/lib/utils.ts","../../dist/index.js","../lib/color/file:/A:/Home/NeveshtAfzar/work/Azad/source/design-system/design-system/modules/jb-core/theme/lib/color/define-colors.ts","../lib/color/file:/A:/Home/NeveshtAfzar/work/Azad/source/design-system/design-system/modules/jb-core/theme/lib/color/index.ts","../lib/sizes/file:/A:/Home/NeveshtAfzar/work/Azad/source/design-system/design-system/modules/jb-core/theme/lib/sizes/index.ts","../lib/file:/A:/Home/NeveshtAfzar/work/Azad/source/design-system/design-system/modules/jb-core/theme/lib/theme.ts"],"sourcesContent":[null,null,null,null,"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",null,null,null,null],"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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AM;EACN,cAAa;EACb,QAAO;CAAA,CAAA;AApCX;AAAA,QAAA,UAAA,GAAA,QAAA,mBAAA,GAAA,QAAA,mBDqCA,SAAiC,GAAA;CAC/B,MAAM,IAAsC,CAAA;CAM5C,OALA,OAAO,KAAK,CAAA,CAAA,CAAW,SAAS,MAAA;EAG9B,EAAY,KADO,EAAiB,IADd,EAAQ,EAAU,IAAyB,SAAS,GAAA,CAAA;CAAA,CAAA,GAIrE;AACT,GAAA,QAAA,gBAAA,GAAA,QAAA,eAAA,GAAA,QAAA,cAAA,GAAA,QAAA,mBAAA,GAAA,QAAA,iBAAA,GAAA,QAAA,gBAAA,GAAA,QAAA,kBAAA,GAAA,QAAA,kBAAA,GAAA,QAAA,kBAAA,GAAA,QAAA,iBAAA,GAAA,QAAA,sBAAA,GAAA,QAAA,2BE9CA,WAAA;CACE,EAAA,GACA,EAAA;AACF,GAAA,QAAA,YFaA,SAA0B,GAAA;CACxB,SAAS,EAAS,GAAA;EAChB,SAAS,gBAAgB,MAAM,YAAY,EAAM,cAAwB,EAAM,KAAA;CACjF;CACA,SAAS,EAAc,GAAA;EACrB,EAAS,EAAM,IAAA,GACf,EAAS,EAAM,KAAA,GACf,EAAS,EAAM,IAAA,GACf,EAAS,EAAM,QAAA,GACf,EAAS,EAAM,MAAA,GACf,EAAS,EAAM,KAAA,GACf,EAAS,EAAM,OAAA;CACjB;CACA,EAAO,WAAW,EAAc,EAAO,OAAA,GACvC,EAAO,aAAa,EAAc,EAAO,SAAA,GACzC,EAAO,SAAS,EAAc,EAAO,KAAA,GACrC,EAAO,OAAO,EAAc,EAAO,GAAA,GACnC,EAAO,UAAU,EAAc,EAAO,MAAA;AACxC,GAAA,QAAA,iBAAA"}
|
|
1
|
+
{"version":3,"file":"index.cjs.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,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EAAO,SAAA,GACzC,EAAO,SAAS,EAAc,EAAO,KAAA,GACrC,EAAO,OAAO,EAAc,EAAO,GAAA,GACnC,EAAO,UAAU,EAAc,EAAO,MAAA;AACxC,GAAA,QAAA,iBAAA"}
|
package/theme/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,74 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
//#region modules/jb-core/theme/lib/color/jb-color.d.ts
|
|
2
|
+
declare class JBColor {
|
|
3
|
+
lightness: number;
|
|
4
|
+
chroma: number;
|
|
5
|
+
hue: number;
|
|
6
|
+
variableName?: `--${string}`;
|
|
7
|
+
get value(): string;
|
|
8
|
+
constructor(colorParams: OklchParams, variableName?: `--${string}`);
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region modules/jb-core/theme/lib/color/types.d.ts
|
|
12
|
+
type OklchParams = {
|
|
13
|
+
lightness: number;
|
|
14
|
+
chroma: number;
|
|
15
|
+
hue: number;
|
|
16
|
+
};
|
|
17
|
+
type JBColorGroup = {
|
|
18
|
+
main: JBColor;
|
|
19
|
+
hover: JBColor;
|
|
20
|
+
pressed: JBColor;
|
|
21
|
+
light: JBColor;
|
|
22
|
+
dark: JBColor;
|
|
23
|
+
subtle: JBColor;
|
|
24
|
+
contrast: JBColor;
|
|
25
|
+
};
|
|
26
|
+
type ColorGroupsKey = 'primary' | 'secondary' | 'yellow' | 'green' | 'red';
|
|
27
|
+
type JBThemeColors = { [key in ColorGroupsKey]: JBColorGroup } & {
|
|
28
|
+
single: {
|
|
29
|
+
black: JBColor;
|
|
30
|
+
white: JBColor;
|
|
31
|
+
highlight: JBColor;
|
|
32
|
+
};
|
|
33
|
+
neutral: JBColor[];
|
|
34
|
+
};
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region modules/jb-core/theme/lib/color/constants.d.ts
|
|
37
|
+
declare const defaultColors: JBThemeColors;
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region modules/jb-core/theme/lib/color/utils.d.ts
|
|
40
|
+
declare function getNeutralColor(index: number): JBColor;
|
|
41
|
+
declare function getHoverColor(color: JBColor): JBColor;
|
|
42
|
+
declare function getPressedColor(color: JBColor): JBColor;
|
|
43
|
+
declare function getLighterColor(color: JBColor): JBColor;
|
|
44
|
+
declare function getDarkerColor(color: JBColor): JBColor;
|
|
45
|
+
declare function getSubtleColor(color: JBColor): JBColor;
|
|
46
|
+
/**
|
|
47
|
+
* 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.
|
|
48
|
+
* It is not the same as the text color, and can be used elsewhere too.
|
|
49
|
+
*/
|
|
50
|
+
declare function getContrastColor(color: JBColor): JBColor;
|
|
51
|
+
declare function createColorGroup(color: JBColor): JBColorGroup;
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region modules/jb-core/theme/lib/color/index.d.ts
|
|
54
|
+
declare function defineColors(): void;
|
|
55
|
+
type SetThemeColorParameter = { [key in ColorGroupsKey]?: JBColorGroup };
|
|
56
|
+
declare function setColors(colors: SetThemeColorParameter): void;
|
|
57
|
+
type CreateThemeColorParameter = { [key in ColorGroupsKey]?: OklchParams };
|
|
58
|
+
declare function createThemeColor(parameter: CreateThemeColorParameter): Partial<JBThemeColors>;
|
|
59
|
+
//#endregion
|
|
60
|
+
//#region modules/jb-core/theme/lib/sizes/index.d.ts
|
|
61
|
+
declare function defineSizes(): void;
|
|
62
|
+
//#endregion
|
|
63
|
+
//#region modules/jb-core/theme/lib/utils.d.ts
|
|
64
|
+
type PropertyDefinitionParameter = PropertyDefinition & {
|
|
65
|
+
value?: string;
|
|
66
|
+
};
|
|
67
|
+
declare function registerCssProperty(parameter: PropertyDefinitionParameter): void;
|
|
68
|
+
declare function setCssProperty(name: string, value?: string): void;
|
|
69
|
+
//#endregion
|
|
70
|
+
//#region modules/jb-core/theme/lib/theme.d.ts
|
|
71
|
+
declare function registerDefaultVariables(): void;
|
|
72
|
+
//#endregion
|
|
73
|
+
export { ColorGroupsKey, CreateThemeColorParameter, JBColor, JBColorGroup, JBThemeColors, OklchParams, PropertyDefinitionParameter, SetThemeColorParameter, createColorGroup, createThemeColor, defaultColors, defineColors, defineSizes, getContrastColor, getDarkerColor, getHoverColor, getLighterColor, getNeutralColor, getPressedColor, getSubtleColor, registerCssProperty, registerDefaultVariables, setColors, setCssProperty };
|
|
5
74
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../lib/color/jb-color.ts","../lib/color/types.ts","../lib/color/constants.ts","../lib/color/utils.ts","../lib/color/index.ts","../lib/sizes/index.ts","../lib/utils.ts","../lib/theme.ts"],"mappings":";cAEa,OAAA;EACX,SAAA;EACA,MAAA;EACA,GAAA;EACA,YAAA;EAAA,IACI,KAAA;cAGQ,WAAA,EAAY,WAAW,EAAE,YAAA;AAAA;;;KCR3B,WAAA;EAAe,SAAA;EAAmB,MAAA;EAAgB,GAAA;AAAA;AAAA,KAClD,YAAA;EACR,IAAA,EAAM,OAAA;EACN,KAAA,EAAM,OAAA;EACN,OAAA,EAAQ,OAAA;EACR,KAAA,EAAM,OAAA;EACN,IAAA,EAAK,OAAA;EACL,MAAA,EAAO,OAAA;EACP,QAAA,EAAS,OAAA;AAAA;AAAA,KAED,cAAA;AAAA,KACA,aAAA,aAAyB,cAAA,GAAgB,YAAA;EACnD,MAAA;IACE,KAAA,EAAM,OAAA;IACN,KAAA,EAAM,OAAA;IACN,SAAA,EAAU,OAAA;EAAA;EAEZ,OAAA,EAAS,OAAA;AAAA;;;cCTE,aAAA,EAAc,aAYjB;;;iBChBM,eAAA,CAAgB,KAAA,WAAa,OAAA;AAAA,iBAG7B,aAAA,CAAc,KAAA,EAAO,OAAA,GAAO,OAAA;AAAA,iBAG5B,eAAA,CAAgB,KAAA,EAAO,OAAA,GAAO,OAAA;AAAA,iBAI9B,eAAA,CAAgB,KAAA,EAAO,OAAA,GAAO,OAAA;AAAA,iBAU9B,cAAA,CAAe,KAAA,EAAO,OAAA,GAAO,OAAA;AAAA,iBAS7B,cAAA,CAAe,KAAA,EAAO,OAAA,GAAO,OAAA;;;;;iBAoB7B,gBAAA,CAAiB,KAAA,EAAO,OAAA,GAAO,OAAA;AAAA,iBAsB/B,gBAAA,CAAiB,KAAA,EAAO,OAAA,GAAU,YAAY;;;iBCjE9C,YAAA;AAAA,KAMJ,sBAAA,aAAkC,cAAA,IAAiB,YAAY;AAAA,iBAC3D,SAAA,CAAU,MAA8B,EAAtB,sBAAsB;AAAA,KAoB5C,yBAAA,aAAqC,cAAA,IAAiB,WAAW;AAAA,iBAE7D,gBAAA,CAAiB,SAAA,EAAW,yBAAA,GAA4B,OAAA,CAAQ,aAAA;;;iBCvChE,WAAA;;;KCFJ,2BAAA,GAA8B,kBAAkB;EAC1D,KAAK;AAAA;AAAA,iBAGS,mBAAA,CAAoB,SAAsC,EAA3B,2BAA2B;AAAA,iBAc1D,cAAA,CAAe,IAAA,UAAc,KAAc;;;iBCf3C,wBAAA"}
|
package/theme/dist/index.js
CHANGED
|
@@ -43,7 +43,7 @@ function i(n) {
|
|
|
43
43
|
hue: n.hue
|
|
44
44
|
}, `${n.variableName}-d`);
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function h(n) {
|
|
47
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
48
|
return new e({
|
|
49
49
|
lightness: t,
|
|
@@ -51,7 +51,7 @@ function s(n) {
|
|
|
51
51
|
hue: i
|
|
52
52
|
}, `${n.variableName}-subtle`);
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function s(n) {
|
|
55
55
|
const t = Math.max(n.lightness - .35, .22), r = Math.min(1.6 * n.chroma, .28);
|
|
56
56
|
return new e({
|
|
57
57
|
lightness: Number(t.toFixed(3)),
|
|
@@ -66,8 +66,8 @@ function l(e) {
|
|
|
66
66
|
pressed: r(e),
|
|
67
67
|
light: a(e),
|
|
68
68
|
dark: i(e),
|
|
69
|
-
subtle:
|
|
70
|
-
contrast:
|
|
69
|
+
subtle: h(e),
|
|
70
|
+
contrast: s(e)
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
73
|
const o = new e({
|
|
@@ -127,39 +127,39 @@ const o = new e({
|
|
|
127
127
|
green: l(m),
|
|
128
128
|
red: l(g)
|
|
129
129
|
};
|
|
130
|
-
function
|
|
130
|
+
function y(e) {
|
|
131
131
|
try {
|
|
132
132
|
const { value: n, ...t } = e;
|
|
133
|
-
"function" == typeof window.CSS.registerProperty && window.CSS.registerProperty({ ...t }),
|
|
133
|
+
"function" == typeof window.CSS.registerProperty && window.CSS.registerProperty({ ...t }), d(e.name, n);
|
|
134
134
|
} catch (e) {}
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function d(e, n) {
|
|
137
137
|
try {
|
|
138
138
|
n && (document.documentElement.style.getPropertyValue(e) || document.documentElement.style.setProperty(e, n));
|
|
139
139
|
} catch (e) {}
|
|
140
140
|
}
|
|
141
|
-
function
|
|
141
|
+
function p(e = "") {
|
|
142
142
|
return crypto?.randomUUID ? `${e}-${crypto.randomUUID()}` : `${e}-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
143
143
|
}
|
|
144
|
-
function
|
|
145
|
-
|
|
146
|
-
name: n ?? e.variableName ?? `--${
|
|
144
|
+
function x(e, n) {
|
|
145
|
+
y({
|
|
146
|
+
name: n ?? e.variableName ?? `--${p()}`,
|
|
147
147
|
syntax: "<color>",
|
|
148
148
|
inherits: !0,
|
|
149
149
|
initialValue: e.value
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
|
-
function
|
|
153
|
-
|
|
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
154
|
}
|
|
155
155
|
function v() {
|
|
156
156
|
var e;
|
|
157
157
|
(function(e) {
|
|
158
|
-
|
|
159
|
-
for (let n = 1; n <= 10; n++)
|
|
160
|
-
})(b),
|
|
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
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function f(e) {
|
|
163
163
|
function n(e) {
|
|
164
164
|
document.documentElement.style.setProperty(e.variableName, e.value);
|
|
165
165
|
}
|
|
@@ -175,41 +175,71 @@ function j(n) {
|
|
|
175
175
|
}), t;
|
|
176
176
|
}
|
|
177
177
|
function $() {
|
|
178
|
-
|
|
178
|
+
y({
|
|
179
179
|
name: "--jb-radius",
|
|
180
180
|
inherits: !0,
|
|
181
181
|
value: "1rem",
|
|
182
182
|
initialValue: "16px",
|
|
183
183
|
syntax: "<length-percentage>"
|
|
184
|
-
}),
|
|
184
|
+
}), y({
|
|
185
185
|
name: "--jb-radius-xs",
|
|
186
186
|
inherits: !0,
|
|
187
187
|
value: "0.5rem",
|
|
188
188
|
initialValue: "8px",
|
|
189
189
|
syntax: "<length-percentage>"
|
|
190
|
-
}),
|
|
190
|
+
}), y({
|
|
191
191
|
name: "--jb-radius-sm",
|
|
192
192
|
inherits: !0,
|
|
193
193
|
value: "0.75rem",
|
|
194
194
|
initialValue: "12px",
|
|
195
195
|
syntax: "<length-percentage>"
|
|
196
|
-
}),
|
|
196
|
+
}), y({
|
|
197
197
|
name: "--jb-radius-lg",
|
|
198
198
|
inherits: !0,
|
|
199
199
|
value: "1.25rem",
|
|
200
200
|
initialValue: "20px",
|
|
201
201
|
syntax: "<length-percentage>"
|
|
202
|
-
}),
|
|
202
|
+
}), y({
|
|
203
203
|
name: "--jb-radius-xl",
|
|
204
204
|
inherits: !0,
|
|
205
205
|
value: "1.5rem",
|
|
206
206
|
initialValue: "24px",
|
|
207
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>"
|
|
208
238
|
});
|
|
209
239
|
}
|
|
210
240
|
function N() {
|
|
211
241
|
$(), v();
|
|
212
242
|
}
|
|
213
|
-
export { e as JBColor, l as createColorGroup, j as createThemeColor, b as defaultColors, v as defineColors, $ as defineSizes,
|
|
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 };
|
|
214
244
|
|
|
215
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":["../lib/color/file:/A:/Home/NeveshtAfzar/work/Azad/source/design-system/design-system/modules/jb-core/theme/lib/color/jb-color.ts","../lib/color/file:/A:/Home/NeveshtAfzar/work/Azad/source/design-system/design-system/modules/jb-core/theme/lib/color/utils.ts","../lib/color/file:/A:/Home/NeveshtAfzar/work/Azad/source/design-system/design-system/modules/jb-core/theme/lib/color/constants.ts","../lib/file:/A:/Home/NeveshtAfzar/work/Azad/source/design-system/design-system/modules/jb-core/theme/lib/utils.ts","../../dist/index.js","../lib/color/file:/A:/Home/NeveshtAfzar/work/Azad/source/design-system/design-system/modules/jb-core/theme/lib/color/define-colors.ts","../lib/color/file:/A:/Home/NeveshtAfzar/work/Azad/source/design-system/design-system/modules/jb-core/theme/lib/color/index.ts","../lib/sizes/file:/A:/Home/NeveshtAfzar/work/Azad/source/design-system/design-system/modules/jb-core/theme/lib/sizes/index.ts","../lib/file:/A:/Home/NeveshtAfzar/work/Azad/source/design-system/design-system/modules/jb-core/theme/lib/theme.ts"],"sourcesContent":[null,null,null,null,"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",null,null,null,null],"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,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SAAS,EAAc,EAAO,KAAA,GACrC,EAAO,OAAO,EAAc,EAAO,GAAA,GACnC,EAAO,UAAU,EAAc,EAAO,MAAA;AACxC;AAIA,SAAgB,EAAiB,GAAA;CAC/B,MAAM,IAAsC,CAAA;CAM5C,OALA,OAAO,KAAK,CAAA,CAAA,CAAW,SAAS,MAAA;EAG9B,EAAY,KADO,EAAiB,IADd,EAAQ,EAAU,IAAyB,SAAS,GAAA,CAAA;CAAA,CAAA,GAIrE;AACT;AC/CA,SAAgB,IAAA;CAKd,EAAoB;EAClB,MAAK;EACL,UAAA,CAAS;EACT,OAAM;EACN,cAAa;EACb,QAAO;CAAA,CAAA,GAET,EAAoB;EAClB,MAAK;EACL,UAAA,CAAS;EACT,OAAM;EACN,cAAa;EACb,QAAO;CAAA,CAAA,GAET,EAAoB;EAClB,MAAK;EACL,UAAA,CAAS;EACT,OAAM;EACN,cAAa;EACb,QAAO;CAAA,CAAA,GAET,EAAoB;EAClB,MAAK;EACL,UAAA,CAAS;EACT,OAAM;EACN,cAAa;EACb,QAAO;CAAA,CAAA,GAET,EAAoB;EAClB,MAAK;EACL,UAAA,CAAS;EACT,OAAM;EACN,cAAa;EACb,QAAO;CAAA,CAAA;AApCX;ACDA,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"}
|
|
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,gBAAg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,qBAAA,KAAA,0BAAA,KAAA,WAAA,KAAA"}
|
package/theme/dist/index.umd.js
CHANGED
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
hue: e.hue
|
|
40
40
|
}, `${e.variableName}-l`);
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function l(e) {
|
|
43
43
|
const n = Math.max(e.lightness - .12 * e.lightness, .02);
|
|
44
44
|
return new t({
|
|
45
45
|
lightness: n,
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
hue: e.hue
|
|
48
48
|
}, `${e.variableName}-d`);
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function s(e) {
|
|
51
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
52
|
return new t({
|
|
53
53
|
lightness: n,
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
hue: a
|
|
56
56
|
}, `${e.variableName}-subtle`);
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function o(e) {
|
|
59
59
|
const n = Math.max(e.lightness - .35, .22), r = Math.min(1.6 * e.chroma, .28);
|
|
60
60
|
return new t({
|
|
61
61
|
lightness: Number(n.toFixed(3)),
|
|
@@ -69,9 +69,9 @@
|
|
|
69
69
|
hover: r(e),
|
|
70
70
|
pressed: i(e),
|
|
71
71
|
light: a(e),
|
|
72
|
-
dark:
|
|
73
|
-
subtle:
|
|
74
|
-
contrast:
|
|
72
|
+
dark: l(e),
|
|
73
|
+
subtle: s(e),
|
|
74
|
+
contrast: o(e)
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
77
|
const u = new t({
|
|
@@ -82,11 +82,11 @@
|
|
|
82
82
|
lightness: .6,
|
|
83
83
|
chroma: .26,
|
|
84
84
|
hue: 286
|
|
85
|
-
}, "--jb-secondary"),
|
|
85
|
+
}, "--jb-secondary"), g = new t({
|
|
86
86
|
lightness: .75,
|
|
87
87
|
chroma: .18,
|
|
88
88
|
hue: 70
|
|
89
|
-
}, "--jb-yellow"),
|
|
89
|
+
}, "--jb-yellow"), m = new t({
|
|
90
90
|
lightness: .68,
|
|
91
91
|
chroma: .1484,
|
|
92
92
|
hue: 162.1
|
|
@@ -127,41 +127,41 @@
|
|
|
127
127
|
],
|
|
128
128
|
primary: h(u),
|
|
129
129
|
secondary: h(c),
|
|
130
|
-
yellow: h(
|
|
131
|
-
green: h(
|
|
130
|
+
yellow: h(g),
|
|
131
|
+
green: h(m),
|
|
132
132
|
red: h(d)
|
|
133
133
|
};
|
|
134
134
|
function y(e) {
|
|
135
135
|
try {
|
|
136
136
|
const { value: t, ...n } = e;
|
|
137
|
-
"function" == typeof window.CSS.registerProperty && window.CSS.registerProperty({ ...n }),
|
|
137
|
+
"function" == typeof window.CSS.registerProperty && window.CSS.registerProperty({ ...n }), p(e.name, t);
|
|
138
138
|
} catch (e) {}
|
|
139
139
|
}
|
|
140
|
-
function
|
|
140
|
+
function p(e, t) {
|
|
141
141
|
try {
|
|
142
142
|
t && (document.documentElement.style.getPropertyValue(e) || document.documentElement.style.setProperty(e, t));
|
|
143
143
|
} catch (e) {}
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function f(e = "") {
|
|
146
146
|
return crypto?.randomUUID ? `${e}-${crypto.randomUUID()}` : `${e}-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function x(e, t) {
|
|
149
149
|
y({
|
|
150
|
-
name: t ?? e.variableName ?? `--${
|
|
150
|
+
name: t ?? e.variableName ?? `--${f()}`,
|
|
151
151
|
syntax: "<color>",
|
|
152
152
|
inherits: !0,
|
|
153
153
|
initialValue: e.value
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
156
|
function v(e) {
|
|
157
|
-
|
|
157
|
+
x(e.main), x(e.dark), x(e.light), x(e.contrast), x(e.hover), x(e.pressed), x(e.subtle);
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function w() {
|
|
160
160
|
var e;
|
|
161
161
|
(function(e) {
|
|
162
|
-
|
|
163
|
-
for (let t = 1; t <= 10; t++)
|
|
164
|
-
})(b),
|
|
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
165
|
}
|
|
166
166
|
function j() {
|
|
167
167
|
y({
|
|
@@ -194,6 +194,36 @@
|
|
|
194
194
|
value: "1.5rem",
|
|
195
195
|
initialValue: "24px",
|
|
196
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>"
|
|
197
227
|
});
|
|
198
228
|
}
|
|
199
229
|
e.JBColor = t, e.createColorGroup = h, e.createThemeColor = function(e) {
|
|
@@ -201,8 +231,8 @@
|
|
|
201
231
|
return Object.keys(e).forEach((r) => {
|
|
202
232
|
n[r] = h(new t(e[r], `---jb-${r}`));
|
|
203
233
|
}), n;
|
|
204
|
-
}, e.defaultColors = b, e.defineColors =
|
|
205
|
-
j(),
|
|
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();
|
|
206
236
|
}, e.setColors = function(e) {
|
|
207
237
|
function t(e) {
|
|
208
238
|
document.documentElement.style.setProperty(e.variableName, e.value);
|
|
@@ -211,7 +241,7 @@
|
|
|
211
241
|
t(e.main), t(e.light), t(e.dark), t(e.contrast), t(e.subtle), t(e.hover), t(e.pressed);
|
|
212
242
|
}
|
|
213
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);
|
|
214
|
-
}, e.setCssProperty =
|
|
244
|
+
}, e.setCssProperty = p;
|
|
215
245
|
});
|
|
216
246
|
|
|
217
247
|
//# sourceMappingURL=index.umd.js.map
|
|
Binary file
|
|
Binary file
|