softable-pixels-web 1.1.7 → 1.1.9
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/dist/{Button-BiSdxI2A.js → Button-DCVmSier.js} +13 -13
- package/dist/Button-DCVmSier.js.map +1 -0
- package/dist/{CheckItem-DsIiS-2X.js → CheckItem-itm2oIeW.js} +6 -6
- package/dist/CheckItem-itm2oIeW.js.map +1 -0
- package/dist/{Checkbox-6ivVbzcX.js → Checkbox-ly07FlTH.js} +10 -10
- package/dist/Checkbox-ly07FlTH.js.map +1 -0
- package/dist/ContextMenu-fSz83oSd.js +304 -0
- package/dist/ContextMenu-fSz83oSd.js.map +1 -0
- package/dist/{Icon-Cv0qztmq.js → Icon-61UaAUrM.js} +5 -5
- package/dist/Icon-61UaAUrM.js.map +1 -0
- package/dist/{IconButton-BBdkzg3b.js → IconButton-CsHFWO8K.js} +2 -2
- package/dist/IconButton-CsHFWO8K.js.map +1 -0
- package/dist/{InfoSummary-uorFDD40.js → InfoSummary-DcupqKIy.js} +13 -13
- package/dist/InfoSummary-DcupqKIy.js.map +1 -0
- package/dist/Input-DLJz5Mrn.js +177 -0
- package/dist/Input-DLJz5Mrn.js.map +1 -0
- package/dist/Label-BhqH21lT.js +25 -0
- package/dist/Label-BhqH21lT.js.map +1 -0
- package/dist/Popover-BsDGCJ-f.js +81 -0
- package/dist/Popover-BsDGCJ-f.js.map +1 -0
- package/dist/Switch-B4e9qBOu.js +49 -0
- package/dist/Switch-B4e9qBOu.js.map +1 -0
- package/dist/{TabSwitch-De30bFX2.js → TabSwitch-CvnlK0NZ.js} +8 -8
- package/dist/TabSwitch-CvnlK0NZ.js.map +1 -0
- package/dist/{TextArea-CpIx36BV.js → TextArea-CUrG_9je.js} +5 -5
- package/dist/TextArea-CUrG_9je.js.map +1 -0
- package/dist/{ThemeContext-Dro_peJg.js → ThemeContext-CesN6Ejm.js} +28 -8
- package/dist/ThemeContext-CesN6Ejm.js.map +1 -0
- package/dist/{Typography-BE-vQSfx.js → Typography-j84zoCoZ.js} +5 -5
- package/dist/Typography-j84zoCoZ.js.map +1 -0
- package/dist/button.d.ts +2 -2
- package/dist/button.js +3 -3
- package/dist/check-item.d.ts +1 -1
- package/dist/check-item.js +4 -4
- package/dist/checkbox.d.ts +2 -2
- package/dist/checkbox.js +4 -4
- package/dist/context-menu.d.ts +2 -0
- package/dist/context-menu.js +9 -0
- package/dist/icon-button.d.ts +1 -1
- package/dist/icon-button.js +2 -2
- package/dist/{index-DUrGjyKy.d.ts → index-2WYvBk8I.d.ts} +23 -9
- package/dist/{index-akSk71wZ.d.ts → index-8GUY3yRY.d.ts} +3 -3
- package/dist/index-BANOx3xI.d.ts +44 -0
- package/dist/{index-CyvtOmP2.d.ts → index-BHhl7wD8.d.ts} +4 -3
- package/dist/index-BglHC9EI.d.ts +61 -0
- package/dist/{index-CIxyqe-m.d.ts → index-CCiP7SPG.d.ts} +8 -4
- package/dist/{index-C9iMLJTU.d.ts → index-Cmj1xJBu.d.ts} +4 -4
- package/dist/{index-BspBF3Mv.d.ts → index-CyntoY7A.d.ts} +33 -4
- package/dist/index-DH0vhxG-.d.ts +103 -0
- package/dist/index-DewFmT68.d.ts +15 -0
- package/dist/{index-DVz2cTUe.d.ts → index-YYjoEwNX.d.ts} +39 -5
- package/dist/index.d.ts +16 -10
- package/dist/index.js +20 -14
- package/dist/info-summary.d.ts +2 -2
- package/dist/info-summary.js +3 -3
- package/dist/input.d.ts +1 -2
- package/dist/input.js +5 -5
- package/dist/popover.d.ts +2 -0
- package/dist/popover.js +6 -0
- package/dist/{styleProps-D405c8KF.d.ts → styleProps-5iqKZpC1.d.ts} +1 -1
- package/dist/switch.d.ts +2 -0
- package/dist/switch.js +4 -0
- package/dist/tab-switch.d.ts +1 -1
- package/dist/tab-switch.js +3 -3
- package/dist/text-area.d.ts +2 -2
- package/dist/text-area.js +5 -5
- package/dist/theme-context.d.ts +1 -1
- package/dist/theme-context.js +1 -1
- package/dist/types-Dsf33Reg.d.ts +15 -0
- package/dist/{types-CDUx-y9q.d.ts → types-ubME1KhJ.d.ts} +5 -5
- package/dist/typography.d.ts +2 -2
- package/dist/typography.js +2 -2
- package/dist/use-dismiss.d.ts +20 -0
- package/dist/use-dismiss.js +3 -0
- package/dist/use-floating.d.ts +15 -0
- package/dist/use-floating.js +3 -0
- package/dist/use-virtual-anchor.d.ts +12 -0
- package/dist/use-virtual-anchor.js +40 -0
- package/dist/use-virtual-anchor.js.map +1 -0
- package/dist/useDismiss-DJ1mh-X3.js +35 -0
- package/dist/useDismiss-DJ1mh-X3.js.map +1 -0
- package/dist/useFloating--PcINgSt.js +295 -0
- package/dist/useFloating--PcINgSt.js.map +1 -0
- package/dist/{useThemedStyles-B7irjShy.d.ts → useThemedStyles-C6dNoaRC.d.ts} +25 -6
- package/dist/{useThemedStyles-3rUXJYgS.js → useThemedStyles-MLtE91hE.js} +1 -1
- package/dist/useThemedStyles-MLtE91hE.js.map +1 -0
- package/package.json +46 -1
- package/dist/Button-BiSdxI2A.js.map +0 -1
- package/dist/CheckItem-DsIiS-2X.js.map +0 -1
- package/dist/Checkbox-6ivVbzcX.js.map +0 -1
- package/dist/Icon-Cv0qztmq.js.map +0 -1
- package/dist/IconButton-BBdkzg3b.js.map +0 -1
- package/dist/InfoSummary-uorFDD40.js.map +0 -1
- package/dist/Input-BvbMEjwE.js +0 -327
- package/dist/Input-BvbMEjwE.js.map +0 -1
- package/dist/Label-QQpNWSeV.js +0 -79
- package/dist/Label-QQpNWSeV.js.map +0 -1
- package/dist/TabSwitch-De30bFX2.js.map +0 -1
- package/dist/TextArea-CpIx36BV.js.map +0 -1
- package/dist/ThemeContext-Dro_peJg.js.map +0 -1
- package/dist/Typography-BE-vQSfx.js.map +0 -1
- package/dist/index-pnnP9M22.d.ts +0 -49
- package/dist/useThemedStyles-3rUXJYgS.js.map +0 -1
|
@@ -54,6 +54,7 @@ const COMMON_MAP = {
|
|
|
54
54
|
sm: "0.25rem",
|
|
55
55
|
md: "0.375rem",
|
|
56
56
|
lg: "0.5rem",
|
|
57
|
+
xl: "0.75rem",
|
|
57
58
|
full: "9999rem"
|
|
58
59
|
},
|
|
59
60
|
fontSize: {
|
|
@@ -81,13 +82,15 @@ const defaultThemes = {
|
|
|
81
82
|
success: "#0EB24C",
|
|
82
83
|
warning: "#f59e0b",
|
|
83
84
|
error: "#ef4444",
|
|
85
|
+
destructive: "#ef4444",
|
|
84
86
|
invalid: "#f87171",
|
|
85
87
|
info: "#06b6d4",
|
|
86
88
|
background: {
|
|
87
89
|
primary: "#FFFFFF",
|
|
88
90
|
card: {
|
|
89
91
|
primary: "#F4F4F4",
|
|
90
|
-
secondary: "#F3F6F9"
|
|
92
|
+
secondary: "#F3F6F9",
|
|
93
|
+
hover: "#f2f2f2"
|
|
91
94
|
}
|
|
92
95
|
},
|
|
93
96
|
button: {
|
|
@@ -110,15 +113,19 @@ const defaultThemes = {
|
|
|
110
113
|
primary: "#222222",
|
|
111
114
|
secondary: "#6C6C6C",
|
|
112
115
|
disabled: "#A0A0A0",
|
|
113
|
-
inverse: "#FFFFFF"
|
|
116
|
+
inverse: "#FFFFFF",
|
|
117
|
+
error: "#EC3030"
|
|
114
118
|
}
|
|
115
119
|
},
|
|
116
120
|
...COMMON_MAP,
|
|
117
121
|
shadows: {
|
|
122
|
+
xs: "0px -1px 0px #0A0D120D inset, 0px 1px 2px #0A0D120D",
|
|
118
123
|
sm: "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
|
|
119
124
|
md: "0 4px 6px -1px rgba(0, 0, 0, 0.10)",
|
|
120
125
|
lg: "0 10px 15px -3px rgba(0, 0, 0, 0.10)",
|
|
121
|
-
xl: "0 20px 25px -5px rgba(0, 0, 0, 0.10)"
|
|
126
|
+
xl: "0 20px 25px -5px rgba(0, 0, 0, 0.10)",
|
|
127
|
+
"2xl": "0 25px 50px -12px rgba(0, 0, 0, 0.25)",
|
|
128
|
+
"ring-1": "0 0 0 1px rgba(0, 0, 0, 0.05)"
|
|
122
129
|
}
|
|
123
130
|
},
|
|
124
131
|
dark: {
|
|
@@ -130,13 +137,15 @@ const defaultThemes = {
|
|
|
130
137
|
success: "#0EB24C",
|
|
131
138
|
warning: "#f59e0b",
|
|
132
139
|
error: "#ef4444",
|
|
140
|
+
destructive: "#ef4444",
|
|
133
141
|
invalid: "#f87171",
|
|
134
142
|
info: "#06b6d4",
|
|
135
143
|
background: {
|
|
136
144
|
primary: "#090909",
|
|
137
145
|
card: {
|
|
138
146
|
primary: "#F4F4F4",
|
|
139
|
-
secondary: "#202020"
|
|
147
|
+
secondary: "#202020",
|
|
148
|
+
hover: "#e7e7e7"
|
|
140
149
|
}
|
|
141
150
|
},
|
|
142
151
|
button: {
|
|
@@ -159,15 +168,19 @@ const defaultThemes = {
|
|
|
159
168
|
primary: "#ECECEC",
|
|
160
169
|
secondary: "#C7CFD8",
|
|
161
170
|
disabled: "#8B93A0",
|
|
162
|
-
inverse: "#090909"
|
|
171
|
+
inverse: "#090909",
|
|
172
|
+
error: "#EC3030"
|
|
163
173
|
}
|
|
164
174
|
},
|
|
165
175
|
...COMMON_MAP,
|
|
166
176
|
shadows: {
|
|
177
|
+
xs: "0px -1px 0px #0A0D120D inset, 0px 1px 2px #0A0D120D",
|
|
167
178
|
sm: "0 1px 2px 0 rgba(0, 0, 0, 0.35)",
|
|
168
179
|
md: "0 4px 6px -1px rgba(0, 0, 0, 0.45)",
|
|
169
180
|
lg: "0 10px 15px -3px rgba(0, 0, 0, 0.50)",
|
|
170
|
-
xl: "0 20px 25px -5px rgba(0, 0, 0, 0.55)"
|
|
181
|
+
xl: "0 20px 25px -5px rgba(0, 0, 0, 0.55)",
|
|
182
|
+
"2xl": "0 25px 50px -12px rgba(0, 0, 0, 0.65)",
|
|
183
|
+
"ring-1": "0 0 0 1px rgba(0, 0, 0, 0.05)"
|
|
171
184
|
}
|
|
172
185
|
}
|
|
173
186
|
};
|
|
@@ -361,6 +374,7 @@ function themeToCssVars(theme) {
|
|
|
361
374
|
"--px-color-success": theme.colors.success,
|
|
362
375
|
"--px-color-warning": theme.colors.warning,
|
|
363
376
|
"--px-color-error": theme.colors.error,
|
|
377
|
+
"--px-color-destructive": theme.colors.destructive,
|
|
364
378
|
"--px-color-invalid": theme.colors.invalid,
|
|
365
379
|
"--px-color-info": theme.colors.info,
|
|
366
380
|
"--px-color-disabled": theme.colors.disabled,
|
|
@@ -369,12 +383,14 @@ function themeToCssVars(theme) {
|
|
|
369
383
|
"--px-surface": theme.colors.surface,
|
|
370
384
|
"--px-background-card-primary": theme.colors.background.card.primary,
|
|
371
385
|
"--px-background-card-secondary": theme.colors.background.card.secondary,
|
|
386
|
+
"--px-background-card-hover": theme.colors.background.card.hover,
|
|
372
387
|
"--px-border-primary": theme.colors.border.primary,
|
|
373
388
|
"--px-border-secondary": theme.colors.border.secondary,
|
|
374
389
|
"--px-text-primary": theme.colors.text.primary,
|
|
375
390
|
"--px-text-secondary": theme.colors.text.secondary,
|
|
376
391
|
"--px-text-disabled": theme.colors.text.disabled,
|
|
377
392
|
"--px-text-inverse": theme.colors.text.inverse,
|
|
393
|
+
"--px-text-error": theme.colors.text.error,
|
|
378
394
|
"--px-btn-filled-bg": theme.colors.button.filled.background,
|
|
379
395
|
"--px-btn-filled-label": theme.colors.button.filled.label,
|
|
380
396
|
"--px-btn-outlined-border": theme.colors.button.outlined.borderColor,
|
|
@@ -390,6 +406,7 @@ function themeToCssVars(theme) {
|
|
|
390
406
|
"--px-radius-sm": theme.borderRadius.sm,
|
|
391
407
|
"--px-radius-md": theme.borderRadius.md,
|
|
392
408
|
"--px-radius-lg": theme.borderRadius.lg,
|
|
409
|
+
"--px-radius-xl": theme.borderRadius.xl,
|
|
393
410
|
"--px-radius-full": theme.borderRadius.full,
|
|
394
411
|
"--px-fs-xs": theme.fontSize.xs,
|
|
395
412
|
"--px-fs-sm": theme.fontSize.sm,
|
|
@@ -401,10 +418,13 @@ function themeToCssVars(theme) {
|
|
|
401
418
|
"--px-fw-medium": theme.fontWeight.medium,
|
|
402
419
|
"--px-fw-semibold": theme.fontWeight.semibold,
|
|
403
420
|
"--px-fw-bold": theme.fontWeight.bold,
|
|
421
|
+
"--px-shadow-xs": theme.shadows.xs,
|
|
404
422
|
"--px-shadow-sm": theme.shadows.sm,
|
|
405
423
|
"--px-shadow-md": theme.shadows.md,
|
|
406
424
|
"--px-shadow-lg": theme.shadows.lg,
|
|
407
|
-
"--px-shadow-xl": theme.shadows.xl
|
|
425
|
+
"--px-shadow-xl": theme.shadows.xl,
|
|
426
|
+
"--px-shadow-2xl": theme.shadows["2xl"],
|
|
427
|
+
"--px-ring-1": theme.shadows["ring-1"]
|
|
408
428
|
};
|
|
409
429
|
}
|
|
410
430
|
|
|
@@ -516,4 +536,4 @@ function useTheme() {
|
|
|
516
536
|
|
|
517
537
|
//#endregion
|
|
518
538
|
export { useTheme as n, ThemeProvider as t };
|
|
519
|
-
//# sourceMappingURL=ThemeContext-
|
|
539
|
+
//# sourceMappingURL=ThemeContext-CesN6Ejm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThemeContext-CesN6Ejm.js","names":["result: any","out: any","defaultThemes: ThemeRegistry","ThemeProvider: React.FC<ThemeProviderProps>"],"sources":["../src/utils/functions/deepMerge.ts","../src/contexts/ThemeContext/constants.ts","../src/contexts/ThemeContext/utils/general.ts","../src/contexts/ThemeContext/utils/themeToCSSVars.ts","../src/contexts/ThemeContext/index.tsx"],"sourcesContent":["/** biome-ignore-all lint/suspicious/noExplicitAny: <Not needed> */\nexport type DeepPartial<T> = {\n [P in keyof T]?: T[P] extends Array<infer U>\n ? Array<DeepPartial<U>>\n : T[P] extends object\n ? DeepPartial<T[P]>\n : T[P]\n}\n\nexport function deepMerge<T>(base: T, override?: DeepPartial<T>): T {\n if (override === undefined) return clone(base)\n\n if (!isPlainObject(base) || !isPlainObject(override)) {\n return clone(override as T)\n }\n\n const result: any = Array.isArray(base) ? [] : {}\n\n const baseKeys = Object.keys(base as any) as (keyof T)[]\n const overrideKeys = Object.keys(override as any) as (keyof T)[]\n\n const allKeys = Array.from(new Set([...baseKeys, ...overrideKeys]))\n\n for (const k of allKeys) {\n const baseVal = (base as any)[k]\n const overrideVal = (override as any)[k]\n\n if (overrideVal === undefined) {\n result[k] = clone(baseVal)\n continue\n }\n\n if (isPlainObject(baseVal) && isPlainObject(overrideVal)) {\n result[k] = deepMerge(baseVal, overrideVal)\n continue\n }\n\n result[k] = clone(overrideVal)\n }\n\n return result as T\n}\n\nfunction isPlainObject(x: any): x is Record<string, any> {\n return !!x && typeof x === 'object' && !Array.isArray(x)\n}\n\nfunction clone<T>(v: T): T {\n if (v === undefined || v === null) return v\n if (Array.isArray(v)) return v.map(item => clone(item)) as unknown as T\n if (isPlainObject(v)) {\n const out: any = {}\n for (const k of Object.keys(v)) out[k] = clone((v as any)[k])\n return out\n }\n return v\n}\n","// theme/defaultThemes.ts\nimport type { ThemeRegistry } from './types'\n\nconst COMMON_MAP = {\n spacing: {\n xs: '0.25rem', // 4px\n sm: '0.5rem', // 8px\n md: '1rem', // 16px\n lg: '1.5rem', // 24px\n xl: '2rem', // 32px\n '2xl': '3rem' // 48px\n },\n borderRadius: {\n none: '0rem', // 0px\n sm: '0.25rem', // 4px\n md: '0.375rem', // 6px\n lg: '0.5rem', // 8px\n xl: '0.75rem', // 12px\n full: '9999rem' // \"infinite\" radius equivalent\n },\n fontSize: {\n xs: '0.75rem', // 12px\n sm: '0.875rem', // 14px\n md: '1rem', // 16px\n lg: '1.125rem', // 18px\n xl: '1.25rem', // 20px\n '2xl': '1.5rem' // 24px\n },\n fontWeight: { normal: 400, medium: 500, semibold: 600, bold: 700 }\n} as const\n\nexport const defaultThemes: ThemeRegistry = {\n light: {\n colors: {\n scrollbar: '#0000001a',\n disabled: '#D5D7DA',\n\n primary: '#0EB24C',\n secondary: '#6C6C6C',\n success: '#0EB24C',\n warning: '#f59e0b',\n error: '#ef4444',\n destructive: '#ef4444',\n invalid: '#f87171',\n info: '#06b6d4',\n\n background: {\n primary: '#FFFFFF',\n card: {\n primary: '#F4F4F4',\n secondary: '#F3F6F9',\n hover: '#f2f2f2'\n }\n },\n button: {\n filled: {\n label: '#FFFFFF',\n background: '#0EB24C'\n },\n\n outlined: {\n label: '#222222',\n borderColor: '#DDDDDD'\n },\n\n ghost: {\n label: '#6C6C6C'\n }\n },\n\n surface: '#FBFBFB',\n border: {\n primary: '#E8E8E9',\n secondary: '#E8E8E9'\n },\n\n text: {\n primary: '#222222',\n secondary: '#6C6C6C',\n disabled: '#A0A0A0',\n inverse: '#FFFFFF',\n error: '#EC3030'\n }\n },\n\n ...COMMON_MAP,\n\n shadows: {\n xs: '0px -1px 0px #0A0D120D inset, 0px 1px 2px #0A0D120D',\n sm: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',\n md: '0 4px 6px -1px rgba(0, 0, 0, 0.10)',\n lg: '0 10px 15px -3px rgba(0, 0, 0, 0.10)',\n xl: '0 20px 25px -5px rgba(0, 0, 0, 0.10)',\n '2xl': '0 25px 50px -12px rgba(0, 0, 0, 0.25)',\n 'ring-1': '0 0 0 1px rgba(0, 0, 0, 0.05)'\n }\n },\n\n dark: {\n colors: {\n scrollbar: '#858585',\n disabled: '#D5D7DA',\n\n primary: '#0EB24C',\n secondary: '#C7CFD8',\n success: '#0EB24C',\n warning: '#f59e0b',\n error: '#ef4444',\n destructive: '#ef4444',\n invalid: '#f87171',\n info: '#06b6d4',\n\n background: {\n primary: '#090909',\n card: {\n primary: '#F4F4F4',\n secondary: '#202020',\n hover: '#e7e7e7'\n }\n },\n button: {\n filled: {\n label: '#FFFFFF',\n background: '#0EB24C'\n },\n\n outlined: {\n label: '#ECECEC',\n borderColor: '#DDDDDD'\n },\n\n ghost: {\n label: '#6C6C6C'\n }\n },\n\n surface: '#090909',\n\n border: {\n primary: '#27282D',\n secondary: '#27282D'\n },\n\n text: {\n primary: '#ECECEC',\n secondary: '#C7CFD8',\n disabled: '#8B93A0',\n inverse: '#090909',\n error: '#EC3030'\n }\n },\n\n ...COMMON_MAP,\n\n shadows: {\n xs: '0px -1px 0px #0A0D120D inset, 0px 1px 2px #0A0D120D',\n sm: '0 1px 2px 0 rgba(0, 0, 0, 0.35)',\n md: '0 4px 6px -1px rgba(0, 0, 0, 0.45)',\n lg: '0 10px 15px -3px rgba(0, 0, 0, 0.50)',\n xl: '0 20px 25px -5px rgba(0, 0, 0, 0.55)',\n '2xl': '0 25px 50px -12px rgba(0, 0, 0, 0.65)',\n 'ring-1': '0 0 0 1px rgba(0, 0, 0, 0.05)'\n }\n }\n}\n","// Utils\n/** biome-ignore-all lint/suspicious/noExplicitAny: <Not needed> */\nimport { deepMerge } from '@utils/functions'\nimport { defaultThemes } from '../constants'\n\n// Types\nimport type { ThemeMode, ThemeRegistry, ThemeTokens } from '../types'\n\n/**\n * Theme Utilities\n * ===============\n * Small DOM utilities used by the ThemeProvider to:\n * - toggle dark mode class for Tailwind compatibility\n * - inject CSS variables (`--px-*`) into the document root\n * - read/watch the OS/browser theme preference (`prefers-color-scheme`)\n *\n * These helpers are:\n * - **client-safe** (guarded for SSR)\n * - **framework-agnostic** (only touch `documentElement`)\n * - **tiny** (no dependencies)\n */\n\n/**\n * CSSVarMap\n * ---------\n * A map of CSS custom properties to be applied on the document root.\n *\n * Notes:\n * - Keys must be valid CSS variable names (e.g. `\"--px-bg\"`, `\"--px-text-primary\"`).\n * - Values can be strings or numbers.\n * - If you store numbers (e.g. 16), you decide at consumption time whether it means px.\n *\n * You can keep it generic:\n * Record<`--${string}`, string | number>\n *\n * Or restrict to your library prefix:\n * Record<`--px-${string}`, string | number>\n */\nexport type CSSVarMap = Partial<Record<`--${string}`, string | number>>\n\n/**\n * applyThemeClass(themeName)\n * -------------------------\n * Applies the light/dark mode class to the `<html>` element.\n *\n * Tailwind’s dark mode (in the common \"class\" strategy) typically relies on a\n * `.dark` class. This function toggles ONLY the `dark` class:\n *\n * - themeName `\"dark\"` => adds `.dark`\n * - themeName `\"light\"` => removes `.dark`\n *\n * SSR:\n * - No-op on the server (when `document` is undefined).\n */\nexport function applyThemeClass(themeName: 'light' | 'dark') {\n if (typeof document === 'undefined') return\n const root = document.documentElement\n root.classList.toggle('dark', themeName === 'dark')\n}\n\n/**\n * applyCssVars(vars)\n * ------------------\n * Injects CSS variables into the document root (`<html>`).\n *\n * This is how the library exposes theme tokens as CSS variables.\n * Components can then use `var(--px-...)` in styles.\n *\n * Example:\n * ```ts\n * applyCssVars({ '--px-bg': '#fff', '--px-text-primary': '#111' })\n * ```\n *\n * Behavior:\n * - Ignores `null` / `undefined` values.\n * - Converts all values to string before applying.\n *\n * SSR:\n * - No-op on the server (when `document` is undefined).\n */\nexport function applyCssVars(vars: CSSVarMap) {\n if (typeof document === 'undefined') return\n const root = document.documentElement\n\n for (const [key, value] of Object.entries(vars)) {\n if (value == null) continue\n root.style.setProperty(key, String(value))\n }\n}\n\n/**\n * getSystemThemeName()\n * --------------------\n * Returns the current OS/browser color scheme preference.\n *\n * It reads `prefers-color-scheme: dark` using `window.matchMedia`.\n *\n * Returns:\n * - `\"dark\"` if the user prefers dark mode\n * - `\"light\"` otherwise\n *\n * SSR:\n * - Returns `\"light\"` on the server (safe default).\n */\nexport function getSystemThemeName(): 'light' | 'dark' {\n if (typeof window === 'undefined') return 'light'\n const prefersDark =\n window.matchMedia?.('(prefers-color-scheme: dark)').matches ?? false\n return prefersDark ? 'dark' : 'light'\n}\n\n/**\n * watchSystemTheme(onChange)\n * --------------------------\n * Subscribes to changes in OS/browser theme preference.\n *\n * Use this when your selected mode is `\"system\"` so the app immediately reacts\n * when the user changes their OS theme.\n *\n * - Calls `onChange('light' | 'dark')` whenever the preference changes.\n * - Returns an `unsubscribe()` function.\n *\n * Implementation details:\n * - Uses `matchMedia('(prefers-color-scheme: dark)')`.\n * - Supports both modern `addEventListener('change', ...)` and legacy Safari\n * `addListener(...)` APIs.\n *\n * SSR:\n * - Returns a no-op unsubscribe function on the server.\n */\nexport function watchSystemTheme(onChange: (name: 'light' | 'dark') => void) {\n if (typeof window === 'undefined') return () => {}\n\n const mq = window.matchMedia('(prefers-color-scheme: dark)')\n\n const handler = () => onChange(mq.matches ? 'dark' : 'light')\n\n handler()\n\n if (mq.addEventListener) {\n mq.addEventListener('change', handler)\n return () => mq.removeEventListener('change', handler)\n }\n\n mq.addListener(handler as any)\n return () => mq.removeListener(handler as any)\n}\n\n/**\n * Resolves an effective theme name from a mode.\n */\nexport function resolveName(mode: ThemeMode): string {\n if (mode !== 'system') return mode\n return getSystemThemeName()\n}\n\n/**\n * Builds a registry of user theme patches.\n */\nexport function buildRegistry(\n userThemes?: Partial<ThemeRegistry>\n): ThemeRegistry {\n return {\n light: {},\n dark: {},\n ...(userThemes ?? {})\n } as ThemeRegistry\n}\n\n/**\n * Builds the final resolved theme tokens.\n */\nexport function buildTheme(\n registry: ThemeRegistry,\n resolvedName: string,\n override?: Partial<ThemeTokens>\n): ThemeTokens {\n const base: ThemeTokens =\n resolvedName === 'dark'\n ? (defaultThemes.dark as ThemeTokens)\n : (defaultThemes.light as ThemeTokens)\n\n const selectedPatch = (registry[resolvedName] ?? registry.light) as any\n\n const merged = deepMerge(base, selectedPatch)\n return deepMerge(merged, override)\n}\n\nexport function isThemeMode(value: unknown): value is ThemeMode {\n return typeof value === 'string' && value.length > 0\n}\n\nexport function getLocalStorageSafe(): Storage | null {\n if (typeof window === 'undefined') return null\n try {\n return window.localStorage\n } catch {\n return null\n }\n}\n","// Types\nimport type { CSSVarMap } from './general'\nimport type { ThemeTokens } from '../types'\n\n/**\n * themeToCssVars(theme)\n * ---------------------\n * Converts a resolved `ThemeTokens` object into a CSS variable map (`CSSVarMap`).\n *\n * The ThemeProvider uses this function to inject `--px-*` variables into the\n * document root (`<html>`). Components can then rely on stable CSS variables,\n * making them framework-agnostic and compatible with Tailwind (via `.dark`).\n *\n * Why CSS variables?\n * - They are fast (native to the browser)\n * - They work across any styling strategy (inline styles, CSS modules, Tailwind, etc.)\n * - They enable dynamic theme switching without rerendering every component\n *\n * Requirements / Assumptions:\n * - The input `theme` must be **fully resolved** (i.e. complete `ThemeTokens`).\n * The ThemeProvider is responsible for merging partial theme patches on top\n * of a complete base theme (light/dark defaults).\n *\n * Variable naming:\n * - All variables are prefixed with `--px-` to avoid collisions.\n * - Tokens are grouped by category (colors, surfaces, borders, text, spacing, radius, typography, shadows).\n *\n * Notes:\n * - Spacing/radius/fontSize tokens are stored as numbers (e.g. `16`), which is valid\n * for CSS variables. When consuming them, you can:\n * - append `px` in JS (`${var}px`), or\n * - store them as strings here (e.g. `\"16px\"`) if you prefer.\n *\n * Example usage (component styles):\n * ```ts\n * const styles = {\n * background: 'var(--px-bg)',\n * color: 'var(--px-text-primary)',\n * borderColor: 'var(--px-border-primary)',\n * }\n * ```\n *\n * Example usage (Tailwind config / CSS):\n * ```css\n * .card {\n * background: var(--px-surface);\n * color: var(--px-text-primary);\n * border: 1px solid var(--px-border-primary);\n * }\n * ```\n */\nexport function themeToCssVars(theme: ThemeTokens): CSSVarMap {\n return {\n /**\n * Brand & intent colors\n */\n '--px-color-primary': theme.colors.primary,\n '--px-color-secondary': theme.colors.secondary,\n '--px-color-success': theme.colors.success,\n '--px-color-warning': theme.colors.warning,\n '--px-color-error': theme.colors.error,\n '--px-color-destructive': theme.colors.destructive,\n '--px-color-invalid': theme.colors.invalid,\n '--px-color-info': theme.colors.info,\n '--px-color-disabled': theme.colors.disabled,\n\n /**\n * Scrollbar\n */\n '--px-scrollbar': theme.colors.scrollbar,\n\n /**\n * Surfaces / backgrounds\n */\n '--px-bg': theme.colors.background.primary,\n '--px-surface': theme.colors.surface,\n '--px-background-card-primary': theme.colors.background.card.primary,\n '--px-background-card-secondary': theme.colors.background.card.secondary,\n '--px-background-card-hover': theme.colors.background.card.hover,\n\n /**\n * Borders\n * -------\n * Divider and outline colors.\n */\n '--px-border-primary': theme.colors.border.primary,\n '--px-border-secondary': theme.colors.border.secondary,\n\n /**\n * Text\n * ----\n * Text colors for different emphasis levels.\n */\n '--px-text-primary': theme.colors.text.primary,\n '--px-text-secondary': theme.colors.text.secondary,\n '--px-text-disabled': theme.colors.text.disabled,\n '--px-text-inverse': theme.colors.text.inverse,\n '--px-text-error': theme.colors.text.error,\n\n /**\n * Buttons – Filled\n * ----------------\n * Filled button colors\n */\n '--px-btn-filled-bg': theme.colors.button.filled.background,\n '--px-btn-filled-label': theme.colors.button.filled.label,\n\n /**\n * Buttons – Outlined\n * ------------------\n * Outlined button colors\n */\n '--px-btn-outlined-border': theme.colors.button.outlined.borderColor,\n '--px-btn-outlined-label': theme.colors.button.outlined.label,\n\n /**\n * Buttons – Ghost\n * --------------\n * Ghost button colors\n */\n '--px-btn-ghost-label': theme.colors.button.ghost.label,\n /**\n * Spacing\n * -------------\n * Numeric spacing tokens (commonly used as px).\n */\n '--px-space-xs': theme.spacing.xs,\n '--px-space-sm': theme.spacing.sm,\n '--px-space-md': theme.spacing.md,\n '--px-space-lg': theme.spacing.lg,\n '--px-space-xl': theme.spacing.xl,\n '--px-space-2xl': theme.spacing['2xl'],\n\n /**\n * Border radius scale\n * -------------------\n * Numeric radius tokens (commonly used as px).\n */\n '--px-radius-none': theme.borderRadius.none,\n '--px-radius-sm': theme.borderRadius.sm,\n '--px-radius-md': theme.borderRadius.md,\n '--px-radius-lg': theme.borderRadius.lg,\n '--px-radius-xl': theme.borderRadius.xl,\n '--px-radius-full': theme.borderRadius.full,\n\n /**\n * Typography scale\n * ----------------\n * Font sizes and font weights.\n */\n '--px-fs-xs': theme.fontSize.xs,\n '--px-fs-sm': theme.fontSize.sm,\n '--px-fs-md': theme.fontSize.md,\n '--px-fs-lg': theme.fontSize.lg,\n '--px-fs-xl': theme.fontSize.xl,\n '--px-fs-2xl': theme.fontSize['2xl'],\n\n '--px-fw-normal': theme.fontWeight.normal,\n '--px-fw-medium': theme.fontWeight.medium,\n '--px-fw-semibold': theme.fontWeight.semibold,\n '--px-fw-bold': theme.fontWeight.bold,\n\n /**\n * Shadows\n * -------\n * CSS shadow strings for elevation.\n */\n '--px-shadow-xs': theme.shadows.xs,\n '--px-shadow-sm': theme.shadows.sm,\n '--px-shadow-md': theme.shadows.md,\n '--px-shadow-lg': theme.shadows.lg,\n '--px-shadow-xl': theme.shadows.xl,\n '--px-shadow-2xl': theme.shadows['2xl'],\n '--px-ring-1': theme.shadows['ring-1']\n }\n}\n","/** biome-ignore-all lint/suspicious/noExplicitAny: <Not needed> */\n\n'use client'\n\n// External Libraries\nimport {\n useMemo,\n useState,\n useEffect,\n useContext,\n createContext,\n useLayoutEffect\n} from 'react'\n\n// Utils\nimport {\n buildTheme,\n isThemeMode,\n resolveName,\n applyCssVars,\n buildRegistry,\n themeToCssVars,\n applyThemeClass,\n watchSystemTheme,\n getLocalStorageSafe\n} from './utils'\n\n// Types\nimport type { ThemeMode, ThemeContextData, ThemeProviderProps } from './types'\n\nexport * from './types'\n\nconst ThemeContext = createContext<ThemeContextData | null>(null)\n\n/**\n * useIsomorphicLayoutEffect\n * - On client: runs before paint (layout effect)\n * - On server: falls back to useEffect (no warnings)\n */\nconst useIsomorphicLayoutEffect =\n typeof window !== 'undefined' ? useLayoutEffect : useEffect\n\nexport const ThemeProvider: React.FC<ThemeProviderProps> = ({\n themes,\n children,\n override,\n persistence,\n persist = false,\n defaultMode = 'system',\n storageKey = 'px-theme',\n fallback = null\n}) => {\n const registry = useMemo(() => buildRegistry(themes), [themes])\n\n function makeInitialMode(): ThemeMode {\n if (persistence) {\n try {\n const saved = persistence.get()\n return (saved ?? defaultMode) as ThemeMode\n } catch {\n return defaultMode\n }\n }\n\n const ls = getLocalStorageSafe()\n if (!ls) return defaultMode\n const raw = ls.getItem(storageKey)?.replaceAll('\"', '')\n return isThemeMode(raw) ? raw : defaultMode\n }\n\n const [mode, setMode] = useState<ThemeMode>(makeInitialMode)\n\n /**\n * Gate: only render children after we applied class + vars at least once.\n * This prevents \"unstyled flash\" for your components.\n */\n const [isReady, setReady] = useState(false)\n\n const resolvedName = useMemo(() => {\n if (typeof window === 'undefined') return mode === 'system' ? 'light' : mode\n return resolveName(mode)\n }, [mode])\n\n const theme = useMemo(\n () => buildTheme(registry, resolvedName, override),\n [registry, resolvedName, override]\n )\n\n // keep in sync with OS when mode === \"system\"\n useEffect(() => {\n if (typeof window === 'undefined') return\n if (mode !== 'system') return\n\n return watchSystemTheme(() => {\n setMode('system')\n })\n }, [mode])\n\n /**\n * Apply theme BEFORE paint (client) and then unlock rendering.\n */\n useIsomorphicLayoutEffect(() => {\n if (typeof window === 'undefined') return\n\n applyThemeClass(resolvedName === 'dark' ? 'dark' : 'light')\n applyCssVars(themeToCssVars(theme))\n\n // unlock after first successful application\n setReady(true)\n }, [resolvedName, theme])\n\n /**\n * Persist mode changes (optional).\n */\n useEffect(() => {\n if (persistence) {\n try {\n persistence.set(mode)\n } catch {}\n return\n }\n\n if (!persist) return\n const ls = getLocalStorageSafe()\n if (!ls) return\n\n try {\n ls.setItem(storageKey, mode)\n } catch {}\n }, [mode, persist, storageKey, persistence])\n\n function setTheme(next: ThemeMode) {\n setMode(next)\n }\n\n function toggleTheme(a: string = 'light', b: string = 'dark') {\n setMode(resolvedName === a ? b : a)\n }\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: <Not needed>\n const ctxValue = useMemo(\n () => ({\n mode,\n resolvedName,\n theme,\n isLoading: !isReady,\n setTheme,\n toggleTheme\n }),\n [mode, resolvedName, theme, isReady]\n )\n\n return (\n <ThemeContext.Provider value={ctxValue}>\n {isReady ? children : fallback}\n </ThemeContext.Provider>\n )\n}\n\nexport function useTheme(): ThemeContextData {\n const ctx = useContext(ThemeContext)\n if (!ctx) throw new Error('useTheme must be used within a ThemeProvider')\n return ctx\n}\n"],"mappings":";;;;AASA,SAAgB,UAAa,MAAS,UAA8B;AAClE,KAAI,aAAa,OAAW,QAAO,MAAM,KAAK;AAE9C,KAAI,CAAC,cAAc,KAAK,IAAI,CAAC,cAAc,SAAS,CAClD,QAAO,MAAM,SAAc;CAG7B,MAAMA,SAAc,MAAM,QAAQ,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yles } from "./useThemedStyles-
|
|
1
|
+
import { n as styled, r as WEIGHTS, t as useThemedStyles } from "./useThemedStyles-MLtE91hE.js";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
|
|
4
|
-
//#region src/components/toolkit/Typography/config.ts
|
|
4
|
+
//#region src/components/commons/toolkit/Typography/config.ts
|
|
5
5
|
const primaryColor = "var(--px-text-primary)";
|
|
6
6
|
const secondaryColor = "var(--px-text-secondary)";
|
|
7
7
|
const typographyVariants = {
|
|
@@ -88,7 +88,7 @@ const alignText = {
|
|
|
88
88
|
};
|
|
89
89
|
|
|
90
90
|
//#endregion
|
|
91
|
-
//#region src/components/toolkit/Typography/style.ts
|
|
91
|
+
//#region src/components/commons/toolkit/Typography/style.ts
|
|
92
92
|
function createTypographyStyles(props) {
|
|
93
93
|
const { isLoading, variant, align = "left", color } = props;
|
|
94
94
|
return styled({
|
|
@@ -116,7 +116,7 @@ function createTypographyStyles(props) {
|
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
//#endregion
|
|
119
|
-
//#region src/components/toolkit/Typography/index.tsx
|
|
119
|
+
//#region src/components/commons/toolkit/Typography/index.tsx
|
|
120
120
|
function Typography(props) {
|
|
121
121
|
const { id, as, href, variant, children, className, placeholder, isLoading = false, styles: styleTypography } = props;
|
|
122
122
|
const { styles } = useThemedStyles(props, createTypographyStyles, {
|
|
@@ -158,4 +158,4 @@ function Typography(props) {
|
|
|
158
158
|
|
|
159
159
|
//#endregion
|
|
160
160
|
export { Typography as t };
|
|
161
|
-
//# sourceMappingURL=Typography-
|
|
161
|
+
//# sourceMappingURL=Typography-j84zoCoZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Typography-j84zoCoZ.js","names":["typographyVariants: Record<TypographyVariant, SlotStyle>","variantToElement: Record<\n TypographyVariant,\n keyof JSX.IntrinsicElements\n>","alignText: Record<TextAlign, SlotStyle>"],"sources":["../src/components/commons/toolkit/Typography/config.ts","../src/components/commons/toolkit/Typography/style.ts","../src/components/commons/toolkit/Typography/index.tsx"],"sourcesContent":["// External Libraries\nimport type { JSX } from 'react'\n\n// Types\nimport type { TextAlign, TypographyVariant } from './types'\nimport { type SlotStyle, WEIGHTS } from '@hooks/useThemedStyles/types'\n\nconst primaryColor = 'var(--px-text-primary)'\nconst secondaryColor = 'var(--px-text-secondary)'\n\nexport const typographyVariants: Record<TypographyVariant, SlotStyle> = {\n h1: {\n fontSize: '3rem',\n fontWeight: '700',\n lineHeight: WEIGHTS.bold,\n color: primaryColor\n },\n h2: {\n fontSize: '2.25rem',\n fontWeight: WEIGHTS.bold,\n lineHeight: 'calc(2.5 / 2.25)',\n color: primaryColor\n },\n h3: {\n fontSize: '1.875rem',\n fontWeight: WEIGHTS.bold,\n lineHeight: 'calc(2.25 / 1.875)',\n color: primaryColor\n },\n h4: {\n fontSize: '1.5rem',\n fontWeight: WEIGHTS.bold,\n lineHeight: 'calc(2 / 1.5)',\n color: primaryColor\n },\n h5: {\n fontSize: '1.25rem',\n fontWeight: WEIGHTS.bold,\n lineHeight: 'calc(1.75 / 1.25)',\n color: primaryColor\n },\n b1: {\n fontSize: '1rem',\n fontWeight: WEIGHTS.medium,\n lineHeight: '1.5',\n color: primaryColor\n },\n b2: {\n fontSize: '0.875rem',\n fontWeight: WEIGHTS.medium,\n lineHeight: 'calc(1.25 / 0.875)',\n color: secondaryColor\n },\n b3: {\n fontSize: '0.75rem',\n fontWeight: WEIGHTS.medium,\n lineHeight: 'calc(1 / 0.75)',\n color: secondaryColor\n },\n caption: {\n fontSize: '0.65rem',\n fontWeight: WEIGHTS.regular,\n lineHeight: 'calc(1 / 0.65)',\n color: secondaryColor\n },\n legal: {\n fontSize: '0.65rem',\n lineHeight: 'calc(1 / 0.65)',\n fontWeight: WEIGHTS.light,\n textTransform: 'uppercase',\n letterSpacing: '0.025em',\n color: secondaryColor\n }\n}\n\nexport const variantToElement: Record<\n TypographyVariant,\n keyof JSX.IntrinsicElements\n> = {\n h1: 'h1',\n h2: 'h2',\n h3: 'h3',\n h4: 'h4',\n h5: 'h5',\n b1: 'p',\n b2: 'p',\n b3: 'p',\n caption: 'span',\n legal: 'span'\n}\n\nexport const alignText: Record<TextAlign, SlotStyle> = {\n left: { textAlign: 'left' },\n center: { textAlign: 'center' },\n right: { textAlign: 'right' },\n justify: { textAlign: 'justify' }\n}\n","// Utils\nimport { alignText, typographyVariants } from './config'\n\n// Types\nimport type { TypographyProps } from './types'\nimport { type SlotStyle, styled } from '@hooks/useThemedStyles/types'\n\nexport function createTypographyStyles(props: TypographyProps) {\n const { isLoading, variant, align = 'left', color } = props\n\n return styled({\n base: {\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n borderBottom: '1px solid var(--pixel-border, #e5e7eb)',\n gap: 0,\n animation: isLoading ? 'animate-pulse 1.5s infinite' : undefined\n },\n\n loading: {\n width: '50%',\n height: '1em',\n display: 'inline-block',\n backgroundColor: 'var(--pixel-gray-300, #d1d5db)',\n borderRadius: '0.25rem'\n },\n\n text: {\n ...alignText[align],\n ...typographyVariants[variant],\n color: color ?? typographyVariants[variant].color\n } as SlotStyle\n })\n}\n","// Utils\nimport { variantToElement } from './config'\n\n// Types\nimport type { TypographyProps } from './types'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Styles\nimport { createTypographyStyles } from './style'\n\nexport function Typography(props: TypographyProps) {\n const {\n id,\n as,\n href,\n variant,\n children,\n className,\n placeholder,\n isLoading = false,\n styles: styleTypography\n } = props\n\n const { styles } = useThemedStyles(props, createTypographyStyles, {\n pick: p => [p.isLoading, p.variant, p.align],\n commonSlot: 'text',\n applyCommonProps: true,\n override: styleTypography\n })\n\n const Component = as ?? variantToElement[variant]\n\n if (isLoading) {\n return (\n <span\n id={id}\n aria-hidden=\"true\"\n role=\"presentation\"\n style={{ ...styles.text, ...styles.loading }}\n />\n )\n }\n\n const sharedProps = {\n id,\n style: styles.text,\n 'aria-label': placeholder,\n className\n }\n\n if (href) {\n return (\n <a href={href} {...sharedProps}>\n {children}\n </a>\n )\n }\n\n return <Component {...sharedProps}>{children}</Component>\n}\n"],"mappings":";;;;AAOA,MAAM,eAAe;AACrB,MAAM,iBAAiB;AAEvB,MAAaA,qBAA2D;CACtE,IAAI;EACF,UAAU;EACV,YAAY;EACZ,YAAY,QAAQ;EACpB,OAAO;EACR;CACD,IAAI;EACF,UAAU;EACV,YAAY,QAAQ;EACpB,YAAY;EACZ,OAAO;EACR;CACD,IAAI;EACF,UAAU;EACV,YAAY,QAAQ;EACpB,YAAY;EACZ,OAAO;EACR;CACD,IAAI;EACF,UAAU;EACV,YAAY,QAAQ;EACpB,YAAY;EACZ,OAAO;EACR;CACD,IAAI;EACF,UAAU;EACV,YAAY,QAAQ;EACpB,YAAY;EACZ,OAAO;EACR;CACD,IAAI;EACF,UAAU;EACV,YAAY,QAAQ;EACpB,YAAY;EACZ,OAAO;EACR;CACD,IAAI;EACF,UAAU;EACV,YAAY,QAAQ;EACpB,YAAY;EACZ,OAAO;EACR;CACD,IAAI;EACF,UAAU;EACV,YAAY,QAAQ;EACpB,YAAY;EACZ,OAAO;EACR;CACD,SAAS;EACP,UAAU;EACV,YAAY,QAAQ;EACpB,YAAY;EACZ,OAAO;EACR;CACD,OAAO;EACL,UAAU;EACV,YAAY;EACZ,YAAY,QAAQ;EACpB,eAAe;EACf,eAAe;EACf,OAAO;EACR;CACF;AAED,MAAaC,mBAGT;CACF,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,SAAS;CACT,OAAO;CACR;AAED,MAAaC,YAA0C;CACrD,MAAM,EAAE,WAAW,QAAQ;CAC3B,QAAQ,EAAE,WAAW,UAAU;CAC/B,OAAO,EAAE,WAAW,SAAS;CAC7B,SAAS,EAAE,WAAW,WAAW;CAClC;;;;ACzFD,SAAgB,uBAAuB,OAAwB;CAC7D,MAAM,EAAE,WAAW,SAAS,QAAQ,QAAQ,UAAU;AAEtD,QAAO,OAAO;EACZ,MAAM;GACJ,SAAS;GACT,eAAe;GACf,YAAY;GACZ,cAAc;GACd,KAAK;GACL,WAAW,YAAY,gCAAgC;GACxD;EAED,SAAS;GACP,OAAO;GACP,QAAQ;GACR,SAAS;GACT,iBAAiB;GACjB,cAAc;GACf;EAED,MAAM;GACJ,GAAG,UAAU;GACb,GAAG,mBAAmB;GACtB,OAAO,SAAS,mBAAmB,SAAS;GAC7C;EACF,CAAC;;;;;ACrBJ,SAAgB,WAAW,OAAwB;CACjD,MAAM,EACJ,IACA,IACA,MACA,SACA,UACA,WACA,aACA,YAAY,OACZ,QAAQ,oBACN;CAEJ,MAAM,EAAE,WAAW,gBAAgB,OAAO,wBAAwB;EAChE,OAAM,MAAK;GAAC,EAAE;GAAW,EAAE;GAAS,EAAE;GAAM;EAC5C,YAAY;EACZ,kBAAkB;EAClB,UAAU;EACX,CAAC;CAEF,MAAM,YAAY,MAAM,iBAAiB;AAEzC,KAAI,UACF,QACE,oBAAC;EACK;EACJ,eAAY;EACZ,MAAK;EACL,OAAO;GAAE,GAAG,OAAO;GAAM,GAAG,OAAO;GAAS;GAC5C;CAIN,MAAM,cAAc;EAClB;EACA,OAAO,OAAO;EACd,cAAc;EACd;EACD;AAED,KAAI,KACF,QACE,oBAAC;EAAQ;EAAM,GAAI;EAChB;GACC;AAIR,QAAO,oBAAC;EAAU,GAAI;EAAc;GAAqB"}
|
package/dist/button.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "./types-
|
|
2
|
-
import { t as Button } from "./index-
|
|
1
|
+
import "./types-ubME1KhJ.js";
|
|
2
|
+
import { t as Button } from "./index-YYjoEwNX.js";
|
|
3
3
|
export { Button };
|
package/dist/button.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./useThemedStyles-
|
|
2
|
-
import "./Typography-
|
|
3
|
-
import { t as Button } from "./Button-
|
|
1
|
+
import "./useThemedStyles-MLtE91hE.js";
|
|
2
|
+
import "./Typography-j84zoCoZ.js";
|
|
3
|
+
import { t as Button } from "./Button-DCVmSier.js";
|
|
4
4
|
|
|
5
5
|
export { Button };
|
package/dist/check-item.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as CheckItem } from "./index-
|
|
1
|
+
import { t as CheckItem } from "./index-8GUY3yRY.js";
|
|
2
2
|
export { CheckItem };
|
package/dist/check-item.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import "./Typography-
|
|
4
|
-
import { t as CheckItem } from "./CheckItem-
|
|
1
|
+
import "./useThemedStyles-MLtE91hE.js";
|
|
2
|
+
import "./Icon-61UaAUrM.js";
|
|
3
|
+
import "./Typography-j84zoCoZ.js";
|
|
4
|
+
import { t as CheckItem } from "./CheckItem-itm2oIeW.js";
|
|
5
5
|
|
|
6
6
|
export { CheckItem };
|
package/dist/checkbox.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "./types-
|
|
2
|
-
import { t as Checkbox } from "./index-
|
|
1
|
+
import "./types-ubME1KhJ.js";
|
|
2
|
+
import { t as Checkbox } from "./index-Cmj1xJBu.js";
|
|
3
3
|
export { Checkbox };
|
package/dist/checkbox.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import "./Typography-
|
|
4
|
-
import { t as Checkbox } from "./Checkbox-
|
|
1
|
+
import "./useThemedStyles-MLtE91hE.js";
|
|
2
|
+
import "./Icon-61UaAUrM.js";
|
|
3
|
+
import "./Typography-j84zoCoZ.js";
|
|
4
|
+
import { t as Checkbox } from "./Checkbox-ly07FlTH.js";
|
|
5
5
|
|
|
6
6
|
export { Checkbox };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "./useThemedStyles-MLtE91hE.js";
|
|
2
|
+
import "./Switch-B4e9qBOu.js";
|
|
3
|
+
import "./useDismiss-DJ1mh-X3.js";
|
|
4
|
+
import "./useFloating--PcINgSt.js";
|
|
5
|
+
import "./Popover-BsDGCJ-f.js";
|
|
6
|
+
import "./Typography-j84zoCoZ.js";
|
|
7
|
+
import { t as ContextMenu } from "./ContextMenu-fSz83oSd.js";
|
|
8
|
+
|
|
9
|
+
export { ContextMenu };
|
package/dist/icon-button.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as IconButton } from "./index-
|
|
1
|
+
import { t as IconButton } from "./index-BHhl7wD8.js";
|
|
2
2
|
export { IconButton };
|
package/dist/icon-button.js
CHANGED
|
@@ -1,12 +1,26 @@
|
|
|
1
|
-
import { t as CommonStyleProps } from "./styleProps-
|
|
2
|
-
import { n as StyleMap } from "./useThemedStyles-B7irjShy.js";
|
|
1
|
+
import { t as CommonStyleProps } from "./styleProps-5iqKZpC1.js";
|
|
3
2
|
import { ReactNode } from "react";
|
|
4
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
4
|
|
|
6
|
-
//#region src/components/toolkit/TabSwitch/styles.d.ts
|
|
7
|
-
declare function createTabSwitchStyles<T>(props: TabSwitchProps<T>):
|
|
5
|
+
//#region src/components/commons/toolkit/TabSwitch/styles.d.ts
|
|
6
|
+
declare function createTabSwitchStyles<T>(props: TabSwitchProps<T>): {
|
|
7
|
+
container: {
|
|
8
|
+
display: "flex";
|
|
9
|
+
flexDirection: "row";
|
|
10
|
+
alignItems: "center";
|
|
11
|
+
color: "var(--px-text-primary, #4b5563)";
|
|
12
|
+
width: string;
|
|
13
|
+
borderBottom: string;
|
|
14
|
+
gap: number;
|
|
15
|
+
__rules: {
|
|
16
|
+
'& svg': {
|
|
17
|
+
zIndex: number;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
};
|
|
8
22
|
//#endregion
|
|
9
|
-
//#region src/components/toolkit/TabSwitch/types.d.ts
|
|
23
|
+
//#region src/components/commons/toolkit/TabSwitch/types.d.ts
|
|
10
24
|
interface SwitchOption<T> {
|
|
11
25
|
value: T;
|
|
12
26
|
label: string;
|
|
@@ -26,8 +40,8 @@ interface TabSwitchProps<T> extends CommonStyleProps {
|
|
|
26
40
|
onChange: (value: T) => void;
|
|
27
41
|
}
|
|
28
42
|
//#endregion
|
|
29
|
-
//#region src/components/toolkit/TabSwitch/index.d.ts
|
|
30
|
-
declare const TabSwitch: <T>(props: TabSwitchProps<T>) =>
|
|
43
|
+
//#region src/components/commons/toolkit/TabSwitch/index.d.ts
|
|
44
|
+
declare const TabSwitch: <T>(props: TabSwitchProps<T>) => react_jsx_runtime0.JSX.Element;
|
|
31
45
|
//#endregion
|
|
32
46
|
export { SwitchOption as n, TabSwitchProps as r, TabSwitch as t };
|
|
33
|
-
//# sourceMappingURL=index-
|
|
47
|
+
//# sourceMappingURL=index-2WYvBk8I.d.ts.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
|
|
3
|
-
//#region src/components/toolkit/CheckItem/types.d.ts
|
|
3
|
+
//#region src/components/commons/toolkit/CheckItem/types.d.ts
|
|
4
4
|
interface CheckItemProps {
|
|
5
5
|
label: string;
|
|
6
6
|
checked: boolean;
|
|
7
7
|
}
|
|
8
8
|
//#endregion
|
|
9
|
-
//#region src/components/toolkit/CheckItem/index.d.ts
|
|
9
|
+
//#region src/components/commons/toolkit/CheckItem/index.d.ts
|
|
10
10
|
declare const CheckItem: React.FC<CheckItemProps>;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { CheckItem as t };
|
|
13
|
-
//# sourceMappingURL=index-
|
|
13
|
+
//# sourceMappingURL=index-8GUY3yRY.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { t as FloatingOptions } from "./types-Dsf33Reg.js";
|
|
2
|
+
import React, { MouseEventHandler, ReactNode, RefObject } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/commons/toolkit/Popover/styles.d.ts
|
|
5
|
+
declare function createPopoverStyles(_props: PopoverProps): {
|
|
6
|
+
popoverNode: {
|
|
7
|
+
position: "fixed";
|
|
8
|
+
left: number;
|
|
9
|
+
top: number;
|
|
10
|
+
zIndex: number;
|
|
11
|
+
padding: string;
|
|
12
|
+
boxShadow: "var(--px-ring-1)";
|
|
13
|
+
backgroundColor: "var(--px-bg)";
|
|
14
|
+
borderRadius: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/components/commons/toolkit/Popover/types.d.ts
|
|
19
|
+
type PopoverTriggerRenderProps = {
|
|
20
|
+
'aria-expanded': boolean;
|
|
21
|
+
ref: RefObject<HTMLElement>;
|
|
22
|
+
onClick: () => void;
|
|
23
|
+
};
|
|
24
|
+
interface PopoverProps {
|
|
25
|
+
open?: boolean;
|
|
26
|
+
closeOnEscape?: boolean;
|
|
27
|
+
closeOnOutsideClick?: boolean;
|
|
28
|
+
floatingOptions?: FloatingOptions;
|
|
29
|
+
anchorRef?: RefObject<HTMLElement>;
|
|
30
|
+
onOpenChange?: (v: boolean) => void;
|
|
31
|
+
onMouseEnter?: MouseEventHandler<HTMLDivElement>;
|
|
32
|
+
onMouseLeave?: MouseEventHandler<HTMLDivElement>;
|
|
33
|
+
content: (ctx: {
|
|
34
|
+
close: () => void;
|
|
35
|
+
}) => ReactNode;
|
|
36
|
+
trigger?: (props: PopoverTriggerRenderProps) => ReactNode;
|
|
37
|
+
styles?: Partial<ReturnType<typeof createPopoverStyles>>;
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region src/components/commons/toolkit/Popover/index.d.ts
|
|
41
|
+
declare const Popover: React.FC<PopoverProps>;
|
|
42
|
+
//#endregion
|
|
43
|
+
export { Popover as t };
|
|
44
|
+
//# sourceMappingURL=index-BANOx3xI.d.ts.map
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { n as StyleMap } from "./useThemedStyles-B7irjShy.js";
|
|
2
1
|
import { MouseEvent, ReactNode } from "react";
|
|
3
2
|
|
|
4
3
|
//#region src/components/commons/buttons/IconButton/styles.d.ts
|
|
5
|
-
declare function createIconButtonStyles(props: IconButtonProps):
|
|
4
|
+
declare function createIconButtonStyles(props: IconButtonProps): {
|
|
5
|
+
button: any;
|
|
6
|
+
};
|
|
6
7
|
//#endregion
|
|
7
8
|
//#region src/components/commons/buttons/IconButton/types.d.ts
|
|
8
9
|
interface IconButtonProps {
|
|
@@ -23,4 +24,4 @@ type IconButtonVariant = 'filled' | 'outlined' | 'ghost';
|
|
|
23
24
|
declare const IconButton: React.FC<IconButtonProps>;
|
|
24
25
|
//#endregion
|
|
25
26
|
export { IconButton as t };
|
|
26
|
-
//# sourceMappingURL=index-
|
|
27
|
+
//# sourceMappingURL=index-BHhl7wD8.d.ts.map
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { n as Placement } from "./types-Dsf33Reg.js";
|
|
2
|
+
import React, { ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/commons/toolkit/ContextMenu/styles.d.ts
|
|
5
|
+
declare function createContextMenuStyles(_props: ContextMenuProps): {
|
|
6
|
+
trigger: {
|
|
7
|
+
width: string;
|
|
8
|
+
height: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/components/commons/toolkit/ContextMenu/types.d.ts
|
|
13
|
+
interface BaseOption {
|
|
14
|
+
id: string;
|
|
15
|
+
icon?: ReactNode;
|
|
16
|
+
label?: ReactNode;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
className?: string;
|
|
19
|
+
shortcut?: ReactNode;
|
|
20
|
+
}
|
|
21
|
+
type MenuActionOption = BaseOption & {
|
|
22
|
+
type: 'action';
|
|
23
|
+
closeOnSelect?: boolean;
|
|
24
|
+
onSelect: () => void;
|
|
25
|
+
};
|
|
26
|
+
type MenuSwitchOption = BaseOption & {
|
|
27
|
+
type: 'switch';
|
|
28
|
+
checked: boolean;
|
|
29
|
+
closeOnSelect?: boolean;
|
|
30
|
+
onCheckedChange: (next: boolean) => void;
|
|
31
|
+
};
|
|
32
|
+
interface MenuDividerOption {
|
|
33
|
+
id: string;
|
|
34
|
+
type: 'divider';
|
|
35
|
+
}
|
|
36
|
+
interface MenuCustomOption extends BaseOption {
|
|
37
|
+
type: 'custom';
|
|
38
|
+
render: (ctx: {
|
|
39
|
+
close: () => void;
|
|
40
|
+
}) => ReactNode;
|
|
41
|
+
}
|
|
42
|
+
interface MenuGroupInput extends BaseOption {
|
|
43
|
+
type?: 'group';
|
|
44
|
+
children: MenuOptionInput[];
|
|
45
|
+
}
|
|
46
|
+
type MenuOptionInput = MenuGroupInput | MenuActionOption | MenuSwitchOption | MenuCustomOption | MenuDividerOption;
|
|
47
|
+
interface ContextMenuProps {
|
|
48
|
+
trigger: ReactNode;
|
|
49
|
+
options: MenuOptionInput[];
|
|
50
|
+
offsetX?: number;
|
|
51
|
+
offsetY?: number;
|
|
52
|
+
columnWidth?: number;
|
|
53
|
+
placement?: Placement;
|
|
54
|
+
styles?: Partial<ReturnType<typeof createContextMenuStyles>>;
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/components/commons/toolkit/ContextMenu/index.d.ts
|
|
58
|
+
declare const ContextMenu: React.FC<ContextMenuProps>;
|
|
59
|
+
//#endregion
|
|
60
|
+
export { ContextMenu as t };
|
|
61
|
+
//# sourceMappingURL=index-BglHC9EI.d.ts.map
|
|
@@ -71,9 +71,10 @@ interface ThemeTokens {
|
|
|
71
71
|
/** Semantic colors (feedback) */
|
|
72
72
|
success: string;
|
|
73
73
|
warning: string;
|
|
74
|
+
info: string;
|
|
74
75
|
error: string;
|
|
75
76
|
invalid: string;
|
|
76
|
-
|
|
77
|
+
destructive: string;
|
|
77
78
|
disabled: string;
|
|
78
79
|
scrollbar: string;
|
|
79
80
|
button: {
|
|
@@ -97,6 +98,7 @@ interface ThemeTokens {
|
|
|
97
98
|
card: {
|
|
98
99
|
primary: string;
|
|
99
100
|
secondary: string;
|
|
101
|
+
hover: string;
|
|
100
102
|
};
|
|
101
103
|
};
|
|
102
104
|
surface: string;
|
|
@@ -117,6 +119,8 @@ interface ThemeTokens {
|
|
|
117
119
|
disabled: string;
|
|
118
120
|
/** Text color to use on top of strong backgrounds (e.g. primary buttons) */
|
|
119
121
|
inverse: string;
|
|
122
|
+
/** Text color to use on error feedback */
|
|
123
|
+
error: string;
|
|
120
124
|
};
|
|
121
125
|
};
|
|
122
126
|
/**
|
|
@@ -127,7 +131,7 @@ interface ThemeTokens {
|
|
|
127
131
|
/**
|
|
128
132
|
* Border radius scale (in px numbers).
|
|
129
133
|
*/
|
|
130
|
-
borderRadius: Record<'none' | 'sm' | 'md' | 'lg' | 'full', number | string>;
|
|
134
|
+
borderRadius: Record<'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full', number | string>;
|
|
131
135
|
/**
|
|
132
136
|
* Font size scale (in px numbers).
|
|
133
137
|
*/
|
|
@@ -139,7 +143,7 @@ interface ThemeTokens {
|
|
|
139
143
|
/**
|
|
140
144
|
* Shadow tokens (CSS shadow strings).
|
|
141
145
|
*/
|
|
142
|
-
shadows: Record<'sm' | 'md' | 'lg' | 'xl', string>;
|
|
146
|
+
shadows: Record<'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'ring-1', string>;
|
|
143
147
|
/**
|
|
144
148
|
* Extension point.
|
|
145
149
|
*
|
|
@@ -288,4 +292,4 @@ declare const ThemeProvider: React.FC<ThemeProviderProps>;
|
|
|
288
292
|
declare function useTheme(): ThemeContextData;
|
|
289
293
|
//#endregion
|
|
290
294
|
export { ThemeName as a, ThemeRegistry as c, ThemeMode as i, ThemeTokens as l, useTheme as n, ThemePersistence as o, ThemeContextData as r, ThemeProviderProps as s, ThemeProvider as t };
|
|
291
|
-
//# sourceMappingURL=index-
|
|
295
|
+
//# sourceMappingURL=index-CCiP7SPG.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as TypographyVariant } from "./types-
|
|
1
|
+
import { n as TypographyVariant } from "./types-ubME1KhJ.js";
|
|
2
2
|
import React$1 from "react";
|
|
3
3
|
|
|
4
|
-
//#region src/components/toolkit/Checkbox/types.d.ts
|
|
4
|
+
//#region src/components/commons/toolkit/Checkbox/types.d.ts
|
|
5
5
|
type CheckboxSize = 'sm' | 'md' | 'lg';
|
|
6
6
|
type CheckboxRadius = 'none' | 'sm' | 'md' | 'lg' | 'full';
|
|
7
7
|
type LabelPlacement = 'left' | 'right';
|
|
@@ -22,8 +22,8 @@ interface CheckboxProps {
|
|
|
22
22
|
onLabelChange?: (text: string) => void;
|
|
23
23
|
}
|
|
24
24
|
//#endregion
|
|
25
|
-
//#region src/components/toolkit/Checkbox/index.d.ts
|
|
25
|
+
//#region src/components/commons/toolkit/Checkbox/index.d.ts
|
|
26
26
|
declare const Checkbox: React$1.FC<CheckboxProps>;
|
|
27
27
|
//#endregion
|
|
28
28
|
export { Checkbox as t };
|
|
29
|
-
//# sourceMappingURL=index-
|
|
29
|
+
//# sourceMappingURL=index-Cmj1xJBu.d.ts.map
|