xyne-components 0.1.0 → 0.1.2
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/Badge/index.cjs +9 -0
- package/dist/Badge/index.cjs.map +1 -0
- package/dist/Badge/index.d.cts +24 -0
- package/dist/Badge/index.d.ts +24 -0
- package/dist/Badge/index.js +9 -0
- package/dist/Badge/index.js.map +1 -0
- package/dist/Directory/index.cjs +9 -0
- package/dist/Directory/index.cjs.map +1 -0
- package/dist/Directory/index.d.cts +34 -0
- package/dist/Directory/index.d.ts +34 -0
- package/dist/Directory/index.js +9 -0
- package/dist/Directory/index.js.map +1 -0
- package/dist/Label/index.cjs +9 -0
- package/dist/Label/index.cjs.map +1 -0
- package/dist/Label/index.d.cts +28 -0
- package/dist/Label/index.d.ts +28 -0
- package/dist/Label/index.js +9 -0
- package/dist/Label/index.js.map +1 -0
- package/dist/ListItem/index.cjs +9 -0
- package/dist/ListItem/index.cjs.map +1 -0
- package/dist/ListItem/index.d.cts +34 -0
- package/dist/ListItem/index.d.ts +34 -0
- package/dist/ListItem/index.js +9 -0
- package/dist/ListItem/index.js.map +1 -0
- package/dist/chunk-2452BBK4.js +219 -0
- package/dist/chunk-2452BBK4.js.map +1 -0
- package/dist/chunk-2JYR6C3L.cjs +219 -0
- package/dist/chunk-2JYR6C3L.cjs.map +1 -0
- package/dist/chunk-54N4ZTTL.js +173 -0
- package/dist/chunk-54N4ZTTL.js.map +1 -0
- package/dist/chunk-73U3B3WX.cjs +23 -0
- package/dist/chunk-73U3B3WX.cjs.map +1 -0
- package/dist/chunk-CNEANQ6B.js +23 -0
- package/dist/chunk-CNEANQ6B.js.map +1 -0
- package/dist/chunk-EJ4BXCSG.js +55 -0
- package/dist/chunk-EJ4BXCSG.js.map +1 -0
- package/dist/chunk-HAG5EYQ5.cjs +87 -0
- package/dist/chunk-HAG5EYQ5.cjs.map +1 -0
- package/dist/chunk-JKYZDOSJ.cjs +55 -0
- package/dist/chunk-JKYZDOSJ.cjs.map +1 -0
- package/dist/chunk-RVNFEWBE.js +87 -0
- package/dist/chunk-RVNFEWBE.js.map +1 -0
- package/dist/chunk-RXHOBQUJ.cjs +65 -0
- package/dist/chunk-RXHOBQUJ.cjs.map +1 -0
- package/dist/chunk-SEFQF2DQ.js +91 -0
- package/dist/chunk-SEFQF2DQ.js.map +1 -0
- package/dist/chunk-SRXGVBJ5.cjs +133 -0
- package/dist/chunk-SRXGVBJ5.cjs.map +1 -0
- package/dist/chunk-WUV742E6.cjs +173 -0
- package/dist/chunk-WUV742E6.cjs.map +1 -0
- package/dist/chunk-XF7A3MNW.cjs +91 -0
- package/dist/chunk-XF7A3MNW.cjs.map +1 -0
- package/dist/chunk-ZJ3XTUYJ.js +65 -0
- package/dist/chunk-ZJ3XTUYJ.js.map +1 -0
- package/dist/chunk-ZS6WGFYT.js +133 -0
- package/dist/chunk-ZS6WGFYT.js.map +1 -0
- package/dist/colorScheme.types-CqDRrNL0.d.cts +54 -0
- package/dist/colorScheme.types-CqDRrNL0.d.ts +54 -0
- package/dist/hooks/index.cjs +11 -0
- package/dist/hooks/index.cjs.map +1 -0
- package/dist/hooks/index.d.cts +20 -0
- package/dist/hooks/index.d.ts +20 -0
- package/dist/hooks/index.js +11 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/index.cjs +26 -560
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -176
- package/dist/index.d.ts +10 -176
- package/dist/index.js +29 -517
- package/dist/index.js.map +1 -1
- package/dist/polymorphic-BpYm1AeE.d.cts +115 -0
- package/dist/polymorphic-BpYm1AeE.d.ts +115 -0
- package/dist/styles/index.css +23 -8
- package/dist/theme/index.cjs +16 -0
- package/dist/theme/index.cjs.map +1 -0
- package/dist/theme/index.d.cts +56 -0
- package/dist/theme/index.d.ts +56 -0
- package/dist/theme/index.js +16 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/utils/index.cjs +8 -0
- package/dist/utils/index.cjs.map +1 -0
- package/dist/utils/index.d.cts +7 -0
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/index.js +8 -0
- package/dist/utils/index.js.map +1 -0
- package/package.json +39 -3
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import React, { CSSProperties } from 'react';
|
|
2
|
+
|
|
3
|
+
type SxValue = string | number | null | undefined;
|
|
4
|
+
type SxProp = {
|
|
5
|
+
m?: SxValue;
|
|
6
|
+
mt?: SxValue;
|
|
7
|
+
mr?: SxValue;
|
|
8
|
+
mb?: SxValue;
|
|
9
|
+
ml?: SxValue;
|
|
10
|
+
mx?: SxValue;
|
|
11
|
+
my?: SxValue;
|
|
12
|
+
p?: SxValue;
|
|
13
|
+
pt?: SxValue;
|
|
14
|
+
pr?: SxValue;
|
|
15
|
+
pb?: SxValue;
|
|
16
|
+
pl?: SxValue;
|
|
17
|
+
px?: SxValue;
|
|
18
|
+
py?: SxValue;
|
|
19
|
+
gap?: SxValue;
|
|
20
|
+
rowGap?: SxValue;
|
|
21
|
+
columnGap?: SxValue;
|
|
22
|
+
width?: SxValue;
|
|
23
|
+
height?: SxValue;
|
|
24
|
+
minWidth?: SxValue;
|
|
25
|
+
maxWidth?: SxValue;
|
|
26
|
+
minHeight?: SxValue;
|
|
27
|
+
maxHeight?: SxValue;
|
|
28
|
+
display?: CSSProperties['display'];
|
|
29
|
+
flexDirection?: CSSProperties['flexDirection'];
|
|
30
|
+
flexWrap?: CSSProperties['flexWrap'];
|
|
31
|
+
flex?: CSSProperties['flex'];
|
|
32
|
+
flexShrink?: CSSProperties['flexShrink'];
|
|
33
|
+
flexGrow?: CSSProperties['flexGrow'];
|
|
34
|
+
alignItems?: CSSProperties['alignItems'];
|
|
35
|
+
alignSelf?: CSSProperties['alignSelf'];
|
|
36
|
+
justifyContent?: CSSProperties['justifyContent'];
|
|
37
|
+
justifySelf?: CSSProperties['justifySelf'];
|
|
38
|
+
position?: CSSProperties['position'];
|
|
39
|
+
top?: SxValue;
|
|
40
|
+
right?: SxValue;
|
|
41
|
+
bottom?: SxValue;
|
|
42
|
+
left?: SxValue;
|
|
43
|
+
zIndex?: CSSProperties['zIndex'];
|
|
44
|
+
overflow?: CSSProperties['overflow'];
|
|
45
|
+
overflowX?: CSSProperties['overflowX'];
|
|
46
|
+
overflowY?: CSSProperties['overflowY'];
|
|
47
|
+
color?: string;
|
|
48
|
+
backgroundColor?: string;
|
|
49
|
+
background?: string;
|
|
50
|
+
opacity?: number;
|
|
51
|
+
visibility?: CSSProperties['visibility'];
|
|
52
|
+
fontSize?: SxValue;
|
|
53
|
+
/** CSS font-weight — pass a number (400, 500, 700) or string ('bold'). NOT scaled. */
|
|
54
|
+
fontWeight?: CSSProperties['fontWeight'];
|
|
55
|
+
/** CSS line-height — pass a number (1.5), px string ('20px'), or unitless ('1'). NOT scaled. */
|
|
56
|
+
lineHeight?: CSSProperties['lineHeight'];
|
|
57
|
+
fontFamily?: string;
|
|
58
|
+
textAlign?: CSSProperties['textAlign'];
|
|
59
|
+
textDecoration?: CSSProperties['textDecoration'];
|
|
60
|
+
textTransform?: CSSProperties['textTransform'];
|
|
61
|
+
whiteSpace?: CSSProperties['whiteSpace'];
|
|
62
|
+
letterSpacing?: SxValue;
|
|
63
|
+
aspectRatio?: CSSProperties['aspectRatio'];
|
|
64
|
+
border?: string;
|
|
65
|
+
borderTop?: string;
|
|
66
|
+
borderRight?: string;
|
|
67
|
+
borderBottom?: string;
|
|
68
|
+
borderLeft?: string;
|
|
69
|
+
borderColor?: string;
|
|
70
|
+
borderRadius?: SxValue;
|
|
71
|
+
borderWidth?: SxValue;
|
|
72
|
+
boxShadow?: string;
|
|
73
|
+
outline?: string;
|
|
74
|
+
cursor?: CSSProperties['cursor'];
|
|
75
|
+
pointerEvents?: CSSProperties['pointerEvents'];
|
|
76
|
+
userSelect?: CSSProperties['userSelect'];
|
|
77
|
+
transition?: string;
|
|
78
|
+
transform?: string;
|
|
79
|
+
};
|
|
80
|
+
declare function resolveSx(sx?: SxProp): CSSProperties;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Polymorphic component utilities for xyne-components.
|
|
84
|
+
*
|
|
85
|
+
* Allows components to render as any HTML element or React component
|
|
86
|
+
* via the `component` prop, while preserving full type-safety.
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* // Render a Label as an anchor tag
|
|
90
|
+
* <Label component="a" href="/dashboard">Go to dashboard</Label>
|
|
91
|
+
*
|
|
92
|
+
* // Render a ListItem as a React Router Link
|
|
93
|
+
* <ListItem component={RouterLink} to="/settings" label="Settings" />
|
|
94
|
+
*/
|
|
95
|
+
|
|
96
|
+
/** Props for injecting the `component` override */
|
|
97
|
+
type AsProp<C extends React.ElementType> = {
|
|
98
|
+
/** Render as a different element or component. @default varies per component */
|
|
99
|
+
component?: C;
|
|
100
|
+
};
|
|
101
|
+
/** Keys to omit from the host element's native props (already covered by our own props) */
|
|
102
|
+
type PropsToOmit<C extends React.ElementType, P> = keyof (AsProp<C> & P);
|
|
103
|
+
/**
|
|
104
|
+
* Merge component-own props with native props of the chosen element.
|
|
105
|
+
* Any native prop that conflicts with our own props is omitted.
|
|
106
|
+
*/
|
|
107
|
+
type PolymorphicComponentProps<C extends React.ElementType, OwnProps = Record<string, never>> = React.PropsWithChildren<OwnProps & AsProp<C>> & Omit<React.ComponentPropsWithoutRef<C>, PropsToOmit<C, OwnProps>>;
|
|
108
|
+
/** Extract the ref type for the chosen element */
|
|
109
|
+
type PolymorphicRef<C extends React.ElementType> = React.ComponentPropsWithRef<C>['ref'];
|
|
110
|
+
/** PolymorphicComponentProps + ref */
|
|
111
|
+
type PolymorphicComponentPropsWithRef<C extends React.ElementType, OwnProps = Record<string, never>> = PolymorphicComponentProps<C, OwnProps> & {
|
|
112
|
+
ref?: PolymorphicRef<C>;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export { type AsProp as A, type PolymorphicComponentProps as P, type SxProp as S, type PolymorphicComponentPropsWithRef as a, type PolymorphicRef as b, resolveSx as r };
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import React, { CSSProperties } from 'react';
|
|
2
|
+
|
|
3
|
+
type SxValue = string | number | null | undefined;
|
|
4
|
+
type SxProp = {
|
|
5
|
+
m?: SxValue;
|
|
6
|
+
mt?: SxValue;
|
|
7
|
+
mr?: SxValue;
|
|
8
|
+
mb?: SxValue;
|
|
9
|
+
ml?: SxValue;
|
|
10
|
+
mx?: SxValue;
|
|
11
|
+
my?: SxValue;
|
|
12
|
+
p?: SxValue;
|
|
13
|
+
pt?: SxValue;
|
|
14
|
+
pr?: SxValue;
|
|
15
|
+
pb?: SxValue;
|
|
16
|
+
pl?: SxValue;
|
|
17
|
+
px?: SxValue;
|
|
18
|
+
py?: SxValue;
|
|
19
|
+
gap?: SxValue;
|
|
20
|
+
rowGap?: SxValue;
|
|
21
|
+
columnGap?: SxValue;
|
|
22
|
+
width?: SxValue;
|
|
23
|
+
height?: SxValue;
|
|
24
|
+
minWidth?: SxValue;
|
|
25
|
+
maxWidth?: SxValue;
|
|
26
|
+
minHeight?: SxValue;
|
|
27
|
+
maxHeight?: SxValue;
|
|
28
|
+
display?: CSSProperties['display'];
|
|
29
|
+
flexDirection?: CSSProperties['flexDirection'];
|
|
30
|
+
flexWrap?: CSSProperties['flexWrap'];
|
|
31
|
+
flex?: CSSProperties['flex'];
|
|
32
|
+
flexShrink?: CSSProperties['flexShrink'];
|
|
33
|
+
flexGrow?: CSSProperties['flexGrow'];
|
|
34
|
+
alignItems?: CSSProperties['alignItems'];
|
|
35
|
+
alignSelf?: CSSProperties['alignSelf'];
|
|
36
|
+
justifyContent?: CSSProperties['justifyContent'];
|
|
37
|
+
justifySelf?: CSSProperties['justifySelf'];
|
|
38
|
+
position?: CSSProperties['position'];
|
|
39
|
+
top?: SxValue;
|
|
40
|
+
right?: SxValue;
|
|
41
|
+
bottom?: SxValue;
|
|
42
|
+
left?: SxValue;
|
|
43
|
+
zIndex?: CSSProperties['zIndex'];
|
|
44
|
+
overflow?: CSSProperties['overflow'];
|
|
45
|
+
overflowX?: CSSProperties['overflowX'];
|
|
46
|
+
overflowY?: CSSProperties['overflowY'];
|
|
47
|
+
color?: string;
|
|
48
|
+
backgroundColor?: string;
|
|
49
|
+
background?: string;
|
|
50
|
+
opacity?: number;
|
|
51
|
+
visibility?: CSSProperties['visibility'];
|
|
52
|
+
fontSize?: SxValue;
|
|
53
|
+
/** CSS font-weight — pass a number (400, 500, 700) or string ('bold'). NOT scaled. */
|
|
54
|
+
fontWeight?: CSSProperties['fontWeight'];
|
|
55
|
+
/** CSS line-height — pass a number (1.5), px string ('20px'), or unitless ('1'). NOT scaled. */
|
|
56
|
+
lineHeight?: CSSProperties['lineHeight'];
|
|
57
|
+
fontFamily?: string;
|
|
58
|
+
textAlign?: CSSProperties['textAlign'];
|
|
59
|
+
textDecoration?: CSSProperties['textDecoration'];
|
|
60
|
+
textTransform?: CSSProperties['textTransform'];
|
|
61
|
+
whiteSpace?: CSSProperties['whiteSpace'];
|
|
62
|
+
letterSpacing?: SxValue;
|
|
63
|
+
aspectRatio?: CSSProperties['aspectRatio'];
|
|
64
|
+
border?: string;
|
|
65
|
+
borderTop?: string;
|
|
66
|
+
borderRight?: string;
|
|
67
|
+
borderBottom?: string;
|
|
68
|
+
borderLeft?: string;
|
|
69
|
+
borderColor?: string;
|
|
70
|
+
borderRadius?: SxValue;
|
|
71
|
+
borderWidth?: SxValue;
|
|
72
|
+
boxShadow?: string;
|
|
73
|
+
outline?: string;
|
|
74
|
+
cursor?: CSSProperties['cursor'];
|
|
75
|
+
pointerEvents?: CSSProperties['pointerEvents'];
|
|
76
|
+
userSelect?: CSSProperties['userSelect'];
|
|
77
|
+
transition?: string;
|
|
78
|
+
transform?: string;
|
|
79
|
+
};
|
|
80
|
+
declare function resolveSx(sx?: SxProp): CSSProperties;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Polymorphic component utilities for xyne-components.
|
|
84
|
+
*
|
|
85
|
+
* Allows components to render as any HTML element or React component
|
|
86
|
+
* via the `component` prop, while preserving full type-safety.
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* // Render a Label as an anchor tag
|
|
90
|
+
* <Label component="a" href="/dashboard">Go to dashboard</Label>
|
|
91
|
+
*
|
|
92
|
+
* // Render a ListItem as a React Router Link
|
|
93
|
+
* <ListItem component={RouterLink} to="/settings" label="Settings" />
|
|
94
|
+
*/
|
|
95
|
+
|
|
96
|
+
/** Props for injecting the `component` override */
|
|
97
|
+
type AsProp<C extends React.ElementType> = {
|
|
98
|
+
/** Render as a different element or component. @default varies per component */
|
|
99
|
+
component?: C;
|
|
100
|
+
};
|
|
101
|
+
/** Keys to omit from the host element's native props (already covered by our own props) */
|
|
102
|
+
type PropsToOmit<C extends React.ElementType, P> = keyof (AsProp<C> & P);
|
|
103
|
+
/**
|
|
104
|
+
* Merge component-own props with native props of the chosen element.
|
|
105
|
+
* Any native prop that conflicts with our own props is omitted.
|
|
106
|
+
*/
|
|
107
|
+
type PolymorphicComponentProps<C extends React.ElementType, OwnProps = Record<string, never>> = React.PropsWithChildren<OwnProps & AsProp<C>> & Omit<React.ComponentPropsWithoutRef<C>, PropsToOmit<C, OwnProps>>;
|
|
108
|
+
/** Extract the ref type for the chosen element */
|
|
109
|
+
type PolymorphicRef<C extends React.ElementType> = React.ComponentPropsWithRef<C>['ref'];
|
|
110
|
+
/** PolymorphicComponentProps + ref */
|
|
111
|
+
type PolymorphicComponentPropsWithRef<C extends React.ElementType, OwnProps = Record<string, never>> = PolymorphicComponentProps<C, OwnProps> & {
|
|
112
|
+
ref?: PolymorphicRef<C>;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export { type AsProp as A, type PolymorphicComponentProps as P, type SxProp as S, type PolymorphicComponentPropsWithRef as a, type PolymorphicRef as b, resolveSx as r };
|
package/dist/styles/index.css
CHANGED
|
@@ -217,6 +217,7 @@
|
|
|
217
217
|
/* ─── Backgrounds ──────────────────────────────────────────── */
|
|
218
218
|
--xc-color-bg-white: #0e121b;
|
|
219
219
|
--xc-color-bg-subtle: #181b25;
|
|
220
|
+
--xc-color-bg-surface-hover: #1d2126;
|
|
220
221
|
--xc-color-bg-brand: #2d1505;
|
|
221
222
|
--xc-color-bg-error: #2a0d0a;
|
|
222
223
|
--xc-color-bg-success: #052e16;
|
|
@@ -269,7 +270,7 @@
|
|
|
269
270
|
|
|
270
271
|
/* Dot sub-component defaults */
|
|
271
272
|
--xc-badge-dot-fill: var(--xc-color-orange-600, #e8601a);
|
|
272
|
-
--xc-badge-dot-stroke:
|
|
273
|
+
--xc-badge-dot-stroke: var(--xc-color-bg-white);
|
|
273
274
|
--xc-badge-dot-stroke-width: 1.5px;
|
|
274
275
|
--xc-badge-dot-size: 6px;
|
|
275
276
|
}
|
|
@@ -286,8 +287,8 @@
|
|
|
286
287
|
justify-content: center;
|
|
287
288
|
gap: var(--xc-space-2); /* 4px — Figma gap */
|
|
288
289
|
|
|
289
|
-
/* Box — Figma: min-h
|
|
290
|
-
min-height:
|
|
290
|
+
/* Box — Figma: min-h 20, min-w 16, px badge/padding-x, py badge/padding-y */
|
|
291
|
+
min-height: 20px;
|
|
291
292
|
min-width: 16px;
|
|
292
293
|
padding-left: var(--xc-badge-padding-x); /* 4px */
|
|
293
294
|
padding-right: var(--xc-badge-padding-x); /* 4px */
|
|
@@ -312,6 +313,11 @@
|
|
|
312
313
|
|
|
313
314
|
/* ── Icon slot — Figma: 12×12, flex-shrink 0 ─────────────────── */
|
|
314
315
|
|
|
316
|
+
.xc-badge:focus-visible {
|
|
317
|
+
outline: 2px solid var(--xc-color-border-brand);
|
|
318
|
+
outline-offset: 2px;
|
|
319
|
+
}
|
|
320
|
+
|
|
315
321
|
.xc-badge__icon {
|
|
316
322
|
display: flex;
|
|
317
323
|
align-items: center;
|
|
@@ -438,8 +444,8 @@
|
|
|
438
444
|
flex-direction: column;
|
|
439
445
|
align-items: flex-start;
|
|
440
446
|
justify-content: center;
|
|
441
|
-
flex
|
|
442
|
-
|
|
447
|
+
flex: 1;
|
|
448
|
+
min-width: 0;
|
|
443
449
|
}
|
|
444
450
|
|
|
445
451
|
/* Label text — Figma: Inter Medium 500, 14px/20px, letter-spacing 0, max-w 264, ellipsis */
|
|
@@ -567,8 +573,8 @@
|
|
|
567
573
|
flex-direction: column;
|
|
568
574
|
align-items: flex-start;
|
|
569
575
|
justify-content: center;
|
|
570
|
-
flex
|
|
571
|
-
|
|
576
|
+
flex: 1;
|
|
577
|
+
min-width: 0;
|
|
572
578
|
}
|
|
573
579
|
|
|
574
580
|
/* Label text — Figma: Inter Medium 500, 14px/20px, letter-spacing 0, max-w 264, ellipsis */
|
|
@@ -696,7 +702,6 @@
|
|
|
696
702
|
flex-direction: column;
|
|
697
703
|
flex: 1;
|
|
698
704
|
min-width: 0;
|
|
699
|
-
max-width: 240px;
|
|
700
705
|
padding-top: var(--xc-space-2); /* 4px */
|
|
701
706
|
padding-bottom: var(--xc-space-2); /* 4px */
|
|
702
707
|
}
|
|
@@ -795,7 +800,17 @@
|
|
|
795
800
|
|
|
796
801
|
/* ── Active [data-active] — keyboard highlight ───────────────── */
|
|
797
802
|
|
|
803
|
+
.xc-list-item[data-active]:not([data-selected]) {
|
|
804
|
+
background-color: var(--xc-color-bg-surface-hover);
|
|
805
|
+
}
|
|
806
|
+
|
|
798
807
|
.xc-list-item[data-active]:not([data-selected]) .xc-list-item__label {
|
|
799
808
|
color: var(--xc-color-text-primary); /* #101828 */
|
|
800
809
|
font-weight: var(--xc-font-weight-medium); /* 500 */
|
|
801
810
|
}
|
|
811
|
+
|
|
812
|
+
.xc-list-item[data-active]:not([data-selected]) .xc-list-item__bar {
|
|
813
|
+
align-self: auto;
|
|
814
|
+
height: 20px;
|
|
815
|
+
background-color: var(--xc-color-border-subtle);
|
|
816
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunk2JYR6C3Lcjs = require('../chunk-2JYR6C3L.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
var _chunkWUV742E6cjs = require('../chunk-WUV742E6.cjs');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
exports.ColorSchemeProvider = _chunk2JYR6C3Lcjs.ColorSchemeProvider; exports.DEFAULT_THEME = _chunkWUV742E6cjs.DEFAULT_THEME; exports.ThemeProvider = _chunk2JYR6C3Lcjs.ThemeProvider; exports.createTheme = _chunk2JYR6C3Lcjs.createTheme;
|
|
16
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/Users/harshpreet.singh/Desktop/Juspay/xyne-spaces/components/dist/theme/index.cjs"],"names":[],"mappings":"AAAA,qFAAY;AACZ;AACE;AACA;AACA;AACF,yDAA8B;AAC9B;AACE;AACF,yDAA8B;AAC9B;AACE;AACA;AACA;AACA;AACF,2OAAC","file":"/Users/harshpreet.singh/Desktop/Juspay/xyne-spaces/components/dist/theme/index.cjs"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { b as XyneTheme, c as XyneThemeOverride, C as ColorScheme, R as ResolvedColorScheme } from '../colorScheme.types-CqDRrNL0.cjs';
|
|
2
|
+
export { a as ColorSchemeContextValue, X as XyneComponentTheme } from '../colorScheme.types-CqDRrNL0.cjs';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Default theme — values match tokens.css (light mode).
|
|
8
|
+
* Used as the base for createTheme() deep-merge.
|
|
9
|
+
*/
|
|
10
|
+
declare const DEFAULT_THEME: XyneTheme;
|
|
11
|
+
|
|
12
|
+
/** Deep-merge a partial override with DEFAULT_THEME to produce a full theme. */
|
|
13
|
+
declare function createTheme(override: XyneThemeOverride): XyneTheme;
|
|
14
|
+
|
|
15
|
+
interface ThemeProviderProps {
|
|
16
|
+
/** Theme override — deep-merged with DEFAULT_THEME */
|
|
17
|
+
theme?: XyneThemeOverride;
|
|
18
|
+
/** CSS selector for variable injection. @default ':root' */
|
|
19
|
+
cssVariablesSelector?: string;
|
|
20
|
+
/** Initial color scheme if nothing is stored. @default 'light' */
|
|
21
|
+
defaultColorScheme?: ColorScheme;
|
|
22
|
+
/** Force a specific color scheme — ignores storage and user toggle. */
|
|
23
|
+
forceColorScheme?: ResolvedColorScheme;
|
|
24
|
+
/** localStorage key for color scheme persistence. @default 'xc-color-scheme' */
|
|
25
|
+
colorSchemeStorageKey?: string;
|
|
26
|
+
/** Return the element to set `data-theme` on. @default () => document.documentElement */
|
|
27
|
+
getRootElement?: () => HTMLElement | undefined;
|
|
28
|
+
children: React.ReactNode;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Provides theme context and injects CSS variable overrides via a <style> tag.
|
|
32
|
+
* Wrap your app (or a subtree) to customise design tokens.
|
|
33
|
+
*
|
|
34
|
+
* @important Pass a stable reference (from `createTheme()` or `useMemo`) to the `theme` prop.
|
|
35
|
+
* Inline object literals recreate a new reference every render, causing unnecessary CSS
|
|
36
|
+
* recalculations. Example: `const theme = createTheme({ text: { brand: '#0066ff' } })` outside
|
|
37
|
+
* your component, then `<ThemeProvider theme={theme}>`.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```tsx
|
|
41
|
+
* const theme = createTheme({ text: { brand: '#0066ff' } })
|
|
42
|
+
* <ThemeProvider theme={theme}>{children}</ThemeProvider>
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
declare function ThemeProvider({ theme: themeOverride, cssVariablesSelector, defaultColorScheme, forceColorScheme, colorSchemeStorageKey, getRootElement, children, }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
|
|
46
|
+
|
|
47
|
+
interface ColorSchemeProviderProps {
|
|
48
|
+
defaultColorScheme?: ColorScheme;
|
|
49
|
+
forceColorScheme?: ResolvedColorScheme;
|
|
50
|
+
storageKey?: string;
|
|
51
|
+
getRootElement?: () => HTMLElement | undefined;
|
|
52
|
+
children: React.ReactNode;
|
|
53
|
+
}
|
|
54
|
+
declare function ColorSchemeProvider({ defaultColorScheme, forceColorScheme, storageKey, getRootElement, children, }: ColorSchemeProviderProps): react_jsx_runtime.JSX.Element;
|
|
55
|
+
|
|
56
|
+
export { ColorScheme, ColorSchemeProvider, type ColorSchemeProviderProps, DEFAULT_THEME, ResolvedColorScheme, ThemeProvider, type ThemeProviderProps, XyneTheme, XyneThemeOverride, createTheme };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { b as XyneTheme, c as XyneThemeOverride, C as ColorScheme, R as ResolvedColorScheme } from '../colorScheme.types-CqDRrNL0.js';
|
|
2
|
+
export { a as ColorSchemeContextValue, X as XyneComponentTheme } from '../colorScheme.types-CqDRrNL0.js';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Default theme — values match tokens.css (light mode).
|
|
8
|
+
* Used as the base for createTheme() deep-merge.
|
|
9
|
+
*/
|
|
10
|
+
declare const DEFAULT_THEME: XyneTheme;
|
|
11
|
+
|
|
12
|
+
/** Deep-merge a partial override with DEFAULT_THEME to produce a full theme. */
|
|
13
|
+
declare function createTheme(override: XyneThemeOverride): XyneTheme;
|
|
14
|
+
|
|
15
|
+
interface ThemeProviderProps {
|
|
16
|
+
/** Theme override — deep-merged with DEFAULT_THEME */
|
|
17
|
+
theme?: XyneThemeOverride;
|
|
18
|
+
/** CSS selector for variable injection. @default ':root' */
|
|
19
|
+
cssVariablesSelector?: string;
|
|
20
|
+
/** Initial color scheme if nothing is stored. @default 'light' */
|
|
21
|
+
defaultColorScheme?: ColorScheme;
|
|
22
|
+
/** Force a specific color scheme — ignores storage and user toggle. */
|
|
23
|
+
forceColorScheme?: ResolvedColorScheme;
|
|
24
|
+
/** localStorage key for color scheme persistence. @default 'xc-color-scheme' */
|
|
25
|
+
colorSchemeStorageKey?: string;
|
|
26
|
+
/** Return the element to set `data-theme` on. @default () => document.documentElement */
|
|
27
|
+
getRootElement?: () => HTMLElement | undefined;
|
|
28
|
+
children: React.ReactNode;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Provides theme context and injects CSS variable overrides via a <style> tag.
|
|
32
|
+
* Wrap your app (or a subtree) to customise design tokens.
|
|
33
|
+
*
|
|
34
|
+
* @important Pass a stable reference (from `createTheme()` or `useMemo`) to the `theme` prop.
|
|
35
|
+
* Inline object literals recreate a new reference every render, causing unnecessary CSS
|
|
36
|
+
* recalculations. Example: `const theme = createTheme({ text: { brand: '#0066ff' } })` outside
|
|
37
|
+
* your component, then `<ThemeProvider theme={theme}>`.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```tsx
|
|
41
|
+
* const theme = createTheme({ text: { brand: '#0066ff' } })
|
|
42
|
+
* <ThemeProvider theme={theme}>{children}</ThemeProvider>
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
declare function ThemeProvider({ theme: themeOverride, cssVariablesSelector, defaultColorScheme, forceColorScheme, colorSchemeStorageKey, getRootElement, children, }: ThemeProviderProps): react_jsx_runtime.JSX.Element;
|
|
46
|
+
|
|
47
|
+
interface ColorSchemeProviderProps {
|
|
48
|
+
defaultColorScheme?: ColorScheme;
|
|
49
|
+
forceColorScheme?: ResolvedColorScheme;
|
|
50
|
+
storageKey?: string;
|
|
51
|
+
getRootElement?: () => HTMLElement | undefined;
|
|
52
|
+
children: React.ReactNode;
|
|
53
|
+
}
|
|
54
|
+
declare function ColorSchemeProvider({ defaultColorScheme, forceColorScheme, storageKey, getRootElement, children, }: ColorSchemeProviderProps): react_jsx_runtime.JSX.Element;
|
|
55
|
+
|
|
56
|
+
export { ColorScheme, ColorSchemeProvider, type ColorSchemeProviderProps, DEFAULT_THEME, ResolvedColorScheme, ThemeProvider, type ThemeProviderProps, XyneTheme, XyneThemeOverride, createTheme };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
ColorSchemeProvider,
|
|
4
|
+
ThemeProvider,
|
|
5
|
+
createTheme
|
|
6
|
+
} from "../chunk-2452BBK4.js";
|
|
7
|
+
import {
|
|
8
|
+
DEFAULT_THEME
|
|
9
|
+
} from "../chunk-54N4ZTTL.js";
|
|
10
|
+
export {
|
|
11
|
+
ColorSchemeProvider,
|
|
12
|
+
DEFAULT_THEME,
|
|
13
|
+
ThemeProvider,
|
|
14
|
+
createTheme
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/Users/harshpreet.singh/Desktop/Juspay/xyne-spaces/components/dist/utils/index.cjs"],"names":[],"mappings":"AAAA,qFAAY;AACZ;AACE;AACF,yDAA8B;AAC9B;AACE;AACF,gDAAC","file":"/Users/harshpreet.singh/Desktop/Juspay/xyne-spaces/components/dist/utils/index.cjs"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { A as AsProp, P as PolymorphicComponentProps, a as PolymorphicComponentPropsWithRef, b as PolymorphicRef, S as SxProp, r as resolveSx } from '../polymorphic-BpYm1AeE.cjs';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
type SlotComponent = React.ElementType;
|
|
5
|
+
type SlotProps<T extends React.ElementType = 'div'> = Partial<React.ComponentPropsWithoutRef<T>>;
|
|
6
|
+
|
|
7
|
+
export type { SlotComponent, SlotProps };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { A as AsProp, P as PolymorphicComponentProps, a as PolymorphicComponentPropsWithRef, b as PolymorphicRef, S as SxProp, r as resolveSx } from '../polymorphic-BpYm1AeE.js';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
type SlotComponent = React.ElementType;
|
|
5
|
+
type SlotProps<T extends React.ElementType = 'div'> = Partial<React.ComponentPropsWithoutRef<T>>;
|
|
6
|
+
|
|
7
|
+
export type { SlotComponent, SlotProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xyne-components",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Xyne Design System — React component library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -12,6 +12,41 @@
|
|
|
12
12
|
"import": "./dist/index.js",
|
|
13
13
|
"require": "./dist/index.cjs"
|
|
14
14
|
},
|
|
15
|
+
"./Badge": {
|
|
16
|
+
"types": "./dist/Badge/index.d.ts",
|
|
17
|
+
"import": "./dist/Badge/index.js",
|
|
18
|
+
"require": "./dist/Badge/index.cjs"
|
|
19
|
+
},
|
|
20
|
+
"./Label": {
|
|
21
|
+
"types": "./dist/Label/index.d.ts",
|
|
22
|
+
"import": "./dist/Label/index.js",
|
|
23
|
+
"require": "./dist/Label/index.cjs"
|
|
24
|
+
},
|
|
25
|
+
"./Directory": {
|
|
26
|
+
"types": "./dist/Directory/index.d.ts",
|
|
27
|
+
"import": "./dist/Directory/index.js",
|
|
28
|
+
"require": "./dist/Directory/index.cjs"
|
|
29
|
+
},
|
|
30
|
+
"./ListItem": {
|
|
31
|
+
"types": "./dist/ListItem/index.d.ts",
|
|
32
|
+
"import": "./dist/ListItem/index.js",
|
|
33
|
+
"require": "./dist/ListItem/index.cjs"
|
|
34
|
+
},
|
|
35
|
+
"./theme": {
|
|
36
|
+
"types": "./dist/theme/index.d.ts",
|
|
37
|
+
"import": "./dist/theme/index.js",
|
|
38
|
+
"require": "./dist/theme/index.cjs"
|
|
39
|
+
},
|
|
40
|
+
"./hooks": {
|
|
41
|
+
"types": "./dist/hooks/index.d.ts",
|
|
42
|
+
"import": "./dist/hooks/index.js",
|
|
43
|
+
"require": "./dist/hooks/index.cjs"
|
|
44
|
+
},
|
|
45
|
+
"./utils": {
|
|
46
|
+
"types": "./dist/utils/index.d.ts",
|
|
47
|
+
"import": "./dist/utils/index.js",
|
|
48
|
+
"require": "./dist/utils/index.cjs"
|
|
49
|
+
},
|
|
15
50
|
"./styles": "./dist/styles/index.css"
|
|
16
51
|
},
|
|
17
52
|
"files": [
|
|
@@ -25,9 +60,10 @@
|
|
|
25
60
|
"typecheck": "tsc --noEmit",
|
|
26
61
|
"lint": "eslint src --ext .ts,.tsx"
|
|
27
62
|
},
|
|
63
|
+
"sideEffects": false,
|
|
28
64
|
"peerDependencies": {
|
|
29
|
-
"react": "
|
|
30
|
-
"react-dom": "
|
|
65
|
+
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
66
|
+
"react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
31
67
|
},
|
|
32
68
|
"devDependencies": {
|
|
33
69
|
"@storybook/addon-docs": "^10.3.4",
|