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.umd.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":";;;;CAEA,IAAa,IAAb,MAAA;EAKE,IAAA,QAAI;GACF,OAAO,SAAS,KAAK,UAAA,GAAa,KAAK,OAAA,GAAU,KAAK,IAAA;EACxD;EACA,YAAY,GAAyB,GAAA;GACnC,KAAK,eAAe,GACpB,KAAK,YAAY,EAAY,WAC7B,KAAK,SAAS,EAAY,QAC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OAAM;GACN,cAAa;GACb,QAAO;EAAA,CAAA;CApCX;CAAA,EAAA,UAAA,GAAA,EAAA,mBAAA,GAAA,EAAA,mBDqCA,SAAiC,GAAA;EAC/B,MAAM,IAAsC,CAAA;EAM5C,OALA,OAAO,KAAK,CAAA,CAAA,CAAW,SAAS,MAAA;GAG9B,EAAY,KADO,EAAiB,IADd,EAAQ,EAAU,IAAyB,SAAS,GAAA,CAAA;EAAA,CAAA,GAIrE;CACT,GAAA,EAAA,gBAAA,GAAA,EAAA,eAAA,GAAA,EAAA,cAAA,GAAA,EAAA,mBAAA,GAAA,EAAA,iBAAA,GAAA,EAAA,gBAAA,GAAA,EAAA,kBAAA,GAAA,EAAA,kBAAA,GAAA,EAAA,kBAAA,GAAA,EAAA,iBAAA,GAAA,EAAA,sBAAA,GAAA,EAAA,2BE9CA,WAAA;EACE,EAAA,GACA,EAAA;CACF,GAAA,EAAA,YFaA,SAA0B,GAAA;EACxB,SAAS,EAAS,GAAA;GAChB,SAAS,gBAAgB,MAAM,YAAY,EAAM,cAAwB,EAAM,KAAA;EACjF;EACA,SAAS,EAAc,GAAA;GACrB,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;EACjB;EACA,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;CACxC,GAAA,EAAA,iBAAA;AAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.umd.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":";;;;CAEA,IAAa,IAAb,MAAA;EAKE,IAAA,QAAI;GACF,OAAO,SAAS,KAAK,UAAA,GAAa,KAAK,OAAA,GAAU,KAAK,IAAA;EACxD;EACA,YAAY,GAAyB,GAAA;GACnC,KAAK,eAAe,GACpB,KAAK,YAAY,EAAY,WAC7B,KAAK,SAAS,EAAY,QAC1B,KAAK,MAAM,EAAY;EACzB;CAAA;CCTF,SAAgB,EAAgB,GAAA;EAC9B,OAAO,IAAI,EAAQ;GAAE,WAAY,KAAK,IAAY,MAAR,KAAgB;GAA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AAO,aAAa,EAAc,EAAO,SAAA,GACzC,EAAO,SAAS,EAAc,EAAO,KAAA,GACrC,EAAO,OAAO,EAAc,EAAO,GAAA,GACnC,EAAO,UAAU,EAAc,EAAO,MAAA;CACxC,GAAA,EAAA,iBAAA;AAAA,CAAA"}
|
package/theme/lib/sizes/index.ts
CHANGED
|
@@ -1,43 +1,83 @@
|
|
|
1
|
-
import { registerCssProperty } from "../utils.js";
|
|
2
|
-
|
|
3
|
-
export function defineSizes(){
|
|
4
|
-
defineRadiusVariables();
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
1
|
+
import { registerCssProperty } from "../utils.js";
|
|
2
|
+
|
|
3
|
+
export function defineSizes() {
|
|
4
|
+
defineRadiusVariables();
|
|
5
|
+
defineControlHeightVariables();
|
|
6
|
+
}
|
|
7
|
+
function defineRadiusVariables() {
|
|
8
|
+
// 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
|
|
9
|
+
registerCssProperty({
|
|
10
|
+
name: "--jb-radius",
|
|
11
|
+
inherits: true,
|
|
12
|
+
value: "1rem",
|
|
13
|
+
// it define in @property so it should remain px not rem
|
|
14
|
+
initialValue: "16px",
|
|
15
|
+
syntax: "<length-percentage>",
|
|
16
|
+
});
|
|
17
|
+
registerCssProperty({
|
|
18
|
+
name: "--jb-radius-xs",
|
|
19
|
+
inherits: true,
|
|
20
|
+
value: `0.5rem`,
|
|
21
|
+
initialValue: "8px",
|
|
22
|
+
syntax: "<length-percentage>",
|
|
23
|
+
});
|
|
24
|
+
registerCssProperty({
|
|
25
|
+
name: "--jb-radius-sm",
|
|
26
|
+
inherits: true,
|
|
27
|
+
value: `0.75rem`,
|
|
28
|
+
initialValue: "12px",
|
|
29
|
+
syntax: "<length-percentage>",
|
|
30
|
+
});
|
|
31
|
+
registerCssProperty({
|
|
32
|
+
name: "--jb-radius-lg",
|
|
33
|
+
inherits: true,
|
|
34
|
+
value: `1.25rem`,
|
|
35
|
+
initialValue: "20px",
|
|
36
|
+
syntax: "<length-percentage>",
|
|
37
|
+
});
|
|
38
|
+
registerCssProperty({
|
|
39
|
+
name: "--jb-radius-xl",
|
|
40
|
+
inherits: true,
|
|
41
|
+
value: `1.5rem`,
|
|
42
|
+
initialValue: "24px",
|
|
43
|
+
syntax: "<length-percentage>",
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function defineControlHeightVariables() {
|
|
48
|
+
registerCssProperty({
|
|
49
|
+
name: "--jb-control-height-xs",
|
|
50
|
+
inherits: true,
|
|
51
|
+
value: "1.5rem",
|
|
52
|
+
initialValue: "24px",
|
|
53
|
+
syntax: "<length-percentage>",
|
|
54
|
+
});
|
|
55
|
+
registerCssProperty({
|
|
56
|
+
name: "--jb-control-height-sm",
|
|
57
|
+
inherits: true,
|
|
58
|
+
value: "2rem",
|
|
59
|
+
initialValue: "32px",
|
|
60
|
+
syntax: "<length-percentage>",
|
|
61
|
+
});
|
|
62
|
+
registerCssProperty({
|
|
63
|
+
name: "--jb-control-height-md",
|
|
64
|
+
inherits: true,
|
|
65
|
+
value: "2.5rem",
|
|
66
|
+
initialValue: "40px",
|
|
67
|
+
syntax: "<length-percentage>",
|
|
68
|
+
});
|
|
69
|
+
registerCssProperty({
|
|
70
|
+
name: "--jb-control-height-lg",
|
|
71
|
+
inherits: true,
|
|
72
|
+
value: "3rem",
|
|
73
|
+
initialValue: "48px",
|
|
74
|
+
syntax: "<length-percentage>",
|
|
75
|
+
});
|
|
76
|
+
registerCssProperty({
|
|
77
|
+
name: "--jb-control-height-xl",
|
|
78
|
+
inherits: true,
|
|
79
|
+
value: "4rem",
|
|
80
|
+
initialValue: "64px",
|
|
81
|
+
syntax: "<length-percentage>",
|
|
82
|
+
});
|
|
83
|
+
}
|
package/theme/stories/sizes.mdx
CHANGED
|
@@ -29,8 +29,18 @@ you can easily change every css variable value like any other css variable see [
|
|
|
29
29
|
|
|
30
30
|
jb design system by default is a Modern and have a Round corner but you can change it base on your design language.
|
|
31
31
|
|
|
32
|
-
- `--jb-radius`:1rem (
|
|
33
|
-
- `--jb-radius-xs`:0.5rem (
|
|
34
|
-
- `--jb-radius-sm`:0.75rem (
|
|
35
|
-
- `--jb-radius-lg`:1.25rem (
|
|
36
|
-
- `--jb-radius-xl`:1.
|
|
32
|
+
- `--jb-radius`:1rem (1rem) - default border radius used in inputs or buttons.
|
|
33
|
+
- `--jb-radius-xs`:0.5rem (0.5rem) - for extra small button or some small elements
|
|
34
|
+
- `--jb-radius-sm`:0.75rem (0.75rem) - for small buttons
|
|
35
|
+
- `--jb-radius-lg`:1.25rem (1.25rem) - for big buttons
|
|
36
|
+
- `--jb-radius-xl`:1.5rem (1.5rem) - for extra large buttons and Box elements like modals content corner
|
|
37
|
+
|
|
38
|
+
## control height
|
|
39
|
+
|
|
40
|
+
Control height tokens keep interactive controls such as buttons, inputs, and selects aligned across the design system. Component-specific height variables can still override these shared defaults.
|
|
41
|
+
|
|
42
|
+
- `--jb-control-height-xs`:1.5rem (24px) - extra-small controls
|
|
43
|
+
- `--jb-control-height-sm`:2rem (32px) - small controls
|
|
44
|
+
- `--jb-control-height-md`:2.5rem (40px) - medium and default controls
|
|
45
|
+
- `--jb-control-height-lg`:3rem (48px) - large controls
|
|
46
|
+
- `--jb-control-height-xl`:4rem (64px) - extra-large controls
|