@marigold/system 10.2.1 → 11.0.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/dist/index.d.mts +3 -31
- package/dist/index.d.ts +3 -31
- package/dist/index.js +60 -92
- package/dist/index.mjs +49 -77
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -68,9 +68,6 @@ declare const cn: (...inputs: ClassValue[]) => string;
|
|
|
68
68
|
declare const createVar: (o: {
|
|
69
69
|
[key: string]: string | number | undefined;
|
|
70
70
|
}) => React.CSSProperties;
|
|
71
|
-
declare const isObject: (val: any) => val is {
|
|
72
|
-
[key: string]: any;
|
|
73
|
-
};
|
|
74
71
|
/**
|
|
75
72
|
* Safely get a dot-notated path within a nested object, with ability
|
|
76
73
|
* to return a default if the full key path does not exist or
|
|
@@ -79,15 +76,6 @@ declare const isObject: (val: any) => val is {
|
|
|
79
76
|
* Based on: https://github.com/developit/dlv
|
|
80
77
|
*/
|
|
81
78
|
declare const get: (obj: object, path: string, fallback?: any) => any;
|
|
82
|
-
/**
|
|
83
|
-
* Safely get a color value from a Tailwind theme object. This also supports
|
|
84
|
-
* Tailwind's "DEFAULT" fallback.
|
|
85
|
-
*
|
|
86
|
-
* Note: Use the CSS "var name" (e.g. primary-500) not the dot notation.
|
|
87
|
-
*/
|
|
88
|
-
declare const getColor: (theme: {
|
|
89
|
-
colors?: object;
|
|
90
|
-
}, path: string, fallback?: any) => any;
|
|
91
79
|
|
|
92
80
|
interface NestedStringObject {
|
|
93
81
|
[key: string]: NestedStringObject | string;
|
|
@@ -112,7 +100,7 @@ type Theme = {
|
|
|
112
100
|
height?: NestedStringObject;
|
|
113
101
|
root?: ComponentStyleFunction;
|
|
114
102
|
components: {
|
|
115
|
-
Accordion?: Record<'
|
|
103
|
+
Accordion?: Record<'container' | 'item' | 'header' | 'content' | 'icon', ComponentStyleFunction<string, string>>;
|
|
116
104
|
Badge?: ComponentStyleFunction<string, string>;
|
|
117
105
|
Body?: ComponentStyleFunction<string, string>;
|
|
118
106
|
Button?: ComponentStyleFunction<string, string>;
|
|
@@ -216,7 +204,7 @@ type StylesProps = {
|
|
|
216
204
|
};
|
|
217
205
|
declare const extendTheme: (newStyles: StylesProps, theme: Theme) => {
|
|
218
206
|
components: {
|
|
219
|
-
Accordion?: Record<"
|
|
207
|
+
Accordion?: Record<"container" | "item" | "header" | "content" | "icon", ComponentStyleFunction<string, string>>;
|
|
220
208
|
Badge?: ComponentStyleFunction<string, string>;
|
|
221
209
|
Body?: ComponentStyleFunction<string, string>;
|
|
222
210
|
Button?: ComponentStyleFunction<string, string>;
|
|
@@ -777,16 +765,6 @@ declare const textAlign: {
|
|
|
777
765
|
center: string;
|
|
778
766
|
right: string;
|
|
779
767
|
};
|
|
780
|
-
declare const gridColsAlign: {
|
|
781
|
-
left: string;
|
|
782
|
-
center: string;
|
|
783
|
-
right: string;
|
|
784
|
-
};
|
|
785
|
-
declare const gridColumn: {
|
|
786
|
-
left: string;
|
|
787
|
-
center: string;
|
|
788
|
-
right: string;
|
|
789
|
-
};
|
|
790
768
|
declare const aspect: {
|
|
791
769
|
square: string;
|
|
792
770
|
landscape: string;
|
|
@@ -880,12 +858,6 @@ type FontSizeProp = {
|
|
|
880
858
|
*/
|
|
881
859
|
fontSize?: keyof typeof textSize;
|
|
882
860
|
};
|
|
883
|
-
type GridColsAlignProp = {
|
|
884
|
-
/**
|
|
885
|
-
* Set the alignment of grid columns.
|
|
886
|
-
*/
|
|
887
|
-
align?: keyof typeof gridColsAlign;
|
|
888
|
-
};
|
|
889
861
|
type GapSpaceProp = {
|
|
890
862
|
/**
|
|
891
863
|
* The space between the children. You can see allowed tokens [here](../../foundations/design-tokens?theme=core#spacing).
|
|
@@ -971,4 +943,4 @@ type HeightProp = {
|
|
|
971
943
|
height?: keyof typeof height;
|
|
972
944
|
};
|
|
973
945
|
|
|
974
|
-
export { type AlignmentProp, type AspectProp, type ComponentClassNames, type ComponentNames, type ComponentState, type ComponentStyleFunction, type Config, type ConfigSchema, type ConfigVariants, type ConfigVariantsMulti, type CursorProp, DateFormat, type FontSizeProp, type FontStyleProp, type FontWeightProp, type GapSpaceProp, type
|
|
946
|
+
export { type AlignmentProp, type AspectProp, type ComponentClassNames, type ComponentNames, type ComponentState, type ComponentStyleFunction, type Config, type ConfigSchema, type ConfigVariants, type ConfigVariantsMulti, type CursorProp, DateFormat, type FontSizeProp, type FontStyleProp, type FontWeightProp, type GapSpaceProp, type HeightProp, type NestedStringObject, NumericFormat, type ObjectFitProp, type ObjectPositionProp, type PaddingBottomProp, type PaddingLeftProp, type PaddingRightProp, type PaddingSpaceProp, type PaddingSpacePropX, type PaddingSpacePropY, type PaddingTopProp, type PlaceItemsProp, type Props, SVG, type SVGProps, type StateAttrKeyProps, type StateAttrProps, type StylesProps, type TextAlignProp, type Theme, type ThemeComponent, ThemeProvider, type ThemeProviderProps, type UseClassNamesProps, type UseStateProps, type WidthProp, alignment, aspect, cn, createVar, cursorStyle, cva, defaultTheme, extendTheme, fontWeight, gapSpace, get, height, objectFit, objectPosition, paddingBottom, paddingLeft, paddingRight, paddingSpace, paddingSpaceX, paddingSpaceY, paddingTop, placeItems, textAlign, textSize, textStyle, useClassNames, useResponsiveValue, useSmallScreen, useStateProps, useTheme, width };
|
package/dist/index.d.ts
CHANGED
|
@@ -68,9 +68,6 @@ declare const cn: (...inputs: ClassValue[]) => string;
|
|
|
68
68
|
declare const createVar: (o: {
|
|
69
69
|
[key: string]: string | number | undefined;
|
|
70
70
|
}) => React.CSSProperties;
|
|
71
|
-
declare const isObject: (val: any) => val is {
|
|
72
|
-
[key: string]: any;
|
|
73
|
-
};
|
|
74
71
|
/**
|
|
75
72
|
* Safely get a dot-notated path within a nested object, with ability
|
|
76
73
|
* to return a default if the full key path does not exist or
|
|
@@ -79,15 +76,6 @@ declare const isObject: (val: any) => val is {
|
|
|
79
76
|
* Based on: https://github.com/developit/dlv
|
|
80
77
|
*/
|
|
81
78
|
declare const get: (obj: object, path: string, fallback?: any) => any;
|
|
82
|
-
/**
|
|
83
|
-
* Safely get a color value from a Tailwind theme object. This also supports
|
|
84
|
-
* Tailwind's "DEFAULT" fallback.
|
|
85
|
-
*
|
|
86
|
-
* Note: Use the CSS "var name" (e.g. primary-500) not the dot notation.
|
|
87
|
-
*/
|
|
88
|
-
declare const getColor: (theme: {
|
|
89
|
-
colors?: object;
|
|
90
|
-
}, path: string, fallback?: any) => any;
|
|
91
79
|
|
|
92
80
|
interface NestedStringObject {
|
|
93
81
|
[key: string]: NestedStringObject | string;
|
|
@@ -112,7 +100,7 @@ type Theme = {
|
|
|
112
100
|
height?: NestedStringObject;
|
|
113
101
|
root?: ComponentStyleFunction;
|
|
114
102
|
components: {
|
|
115
|
-
Accordion?: Record<'
|
|
103
|
+
Accordion?: Record<'container' | 'item' | 'header' | 'content' | 'icon', ComponentStyleFunction<string, string>>;
|
|
116
104
|
Badge?: ComponentStyleFunction<string, string>;
|
|
117
105
|
Body?: ComponentStyleFunction<string, string>;
|
|
118
106
|
Button?: ComponentStyleFunction<string, string>;
|
|
@@ -216,7 +204,7 @@ type StylesProps = {
|
|
|
216
204
|
};
|
|
217
205
|
declare const extendTheme: (newStyles: StylesProps, theme: Theme) => {
|
|
218
206
|
components: {
|
|
219
|
-
Accordion?: Record<"
|
|
207
|
+
Accordion?: Record<"container" | "item" | "header" | "content" | "icon", ComponentStyleFunction<string, string>>;
|
|
220
208
|
Badge?: ComponentStyleFunction<string, string>;
|
|
221
209
|
Body?: ComponentStyleFunction<string, string>;
|
|
222
210
|
Button?: ComponentStyleFunction<string, string>;
|
|
@@ -777,16 +765,6 @@ declare const textAlign: {
|
|
|
777
765
|
center: string;
|
|
778
766
|
right: string;
|
|
779
767
|
};
|
|
780
|
-
declare const gridColsAlign: {
|
|
781
|
-
left: string;
|
|
782
|
-
center: string;
|
|
783
|
-
right: string;
|
|
784
|
-
};
|
|
785
|
-
declare const gridColumn: {
|
|
786
|
-
left: string;
|
|
787
|
-
center: string;
|
|
788
|
-
right: string;
|
|
789
|
-
};
|
|
790
768
|
declare const aspect: {
|
|
791
769
|
square: string;
|
|
792
770
|
landscape: string;
|
|
@@ -880,12 +858,6 @@ type FontSizeProp = {
|
|
|
880
858
|
*/
|
|
881
859
|
fontSize?: keyof typeof textSize;
|
|
882
860
|
};
|
|
883
|
-
type GridColsAlignProp = {
|
|
884
|
-
/**
|
|
885
|
-
* Set the alignment of grid columns.
|
|
886
|
-
*/
|
|
887
|
-
align?: keyof typeof gridColsAlign;
|
|
888
|
-
};
|
|
889
861
|
type GapSpaceProp = {
|
|
890
862
|
/**
|
|
891
863
|
* The space between the children. You can see allowed tokens [here](../../foundations/design-tokens?theme=core#spacing).
|
|
@@ -971,4 +943,4 @@ type HeightProp = {
|
|
|
971
943
|
height?: keyof typeof height;
|
|
972
944
|
};
|
|
973
945
|
|
|
974
|
-
export { type AlignmentProp, type AspectProp, type ComponentClassNames, type ComponentNames, type ComponentState, type ComponentStyleFunction, type Config, type ConfigSchema, type ConfigVariants, type ConfigVariantsMulti, type CursorProp, DateFormat, type FontSizeProp, type FontStyleProp, type FontWeightProp, type GapSpaceProp, type
|
|
946
|
+
export { type AlignmentProp, type AspectProp, type ComponentClassNames, type ComponentNames, type ComponentState, type ComponentStyleFunction, type Config, type ConfigSchema, type ConfigVariants, type ConfigVariantsMulti, type CursorProp, DateFormat, type FontSizeProp, type FontStyleProp, type FontWeightProp, type GapSpaceProp, type HeightProp, type NestedStringObject, NumericFormat, type ObjectFitProp, type ObjectPositionProp, type PaddingBottomProp, type PaddingLeftProp, type PaddingRightProp, type PaddingSpaceProp, type PaddingSpacePropX, type PaddingSpacePropY, type PaddingTopProp, type PlaceItemsProp, type Props, SVG, type SVGProps, type StateAttrKeyProps, type StateAttrProps, type StylesProps, type TextAlignProp, type Theme, type ThemeComponent, ThemeProvider, type ThemeProviderProps, type UseClassNamesProps, type UseStateProps, type WidthProp, alignment, aspect, cn, createVar, cursorStyle, cva, defaultTheme, extendTheme, fontWeight, gapSpace, get, height, objectFit, objectPosition, paddingBottom, paddingLeft, paddingRight, paddingSpace, paddingSpaceX, paddingSpaceY, paddingTop, placeItems, textAlign, textSize, textStyle, useClassNames, useResponsiveValue, useSmallScreen, useStateProps, useTheme, width };
|
package/dist/index.js
CHANGED
|
@@ -45,11 +45,7 @@ __export(index_exports, {
|
|
|
45
45
|
fontWeight: () => fontWeight,
|
|
46
46
|
gapSpace: () => gapSpace,
|
|
47
47
|
get: () => get,
|
|
48
|
-
getColor: () => getColor,
|
|
49
|
-
gridColsAlign: () => gridColsAlign,
|
|
50
|
-
gridColumn: () => gridColumn,
|
|
51
48
|
height: () => height,
|
|
52
|
-
isObject: () => isObject,
|
|
53
49
|
objectFit: () => objectFit,
|
|
54
50
|
objectPosition: () => objectPosition,
|
|
55
51
|
paddingBottom: () => paddingBottom,
|
|
@@ -73,15 +69,14 @@ __export(index_exports, {
|
|
|
73
69
|
module.exports = __toCommonJS(index_exports);
|
|
74
70
|
|
|
75
71
|
// src/components/SVG/SVG.tsx
|
|
76
|
-
var
|
|
72
|
+
var import_react = __toESM(require("react"));
|
|
77
73
|
|
|
78
74
|
// src/utils.ts
|
|
79
75
|
var import_class_variance_authority = require("class-variance-authority");
|
|
80
|
-
var import_class_variance_authority2 = require("class-variance-authority");
|
|
81
76
|
var import_tailwind_merge = require("tailwind-merge");
|
|
82
77
|
var cva = (base, config) => {
|
|
83
78
|
function styles(props) {
|
|
84
|
-
return (0, import_tailwind_merge.twMerge)((0,
|
|
79
|
+
return (0, import_tailwind_merge.twMerge)((0, import_class_variance_authority.cva)(base, config)(props));
|
|
85
80
|
}
|
|
86
81
|
styles.variants = config == null ? void 0 : config.variants;
|
|
87
82
|
return styles;
|
|
@@ -90,7 +85,6 @@ var cn = (...inputs) => (0, import_tailwind_merge.twMerge)((0, import_class_vari
|
|
|
90
85
|
var createVar = (o) => Object.fromEntries(
|
|
91
86
|
Object.entries(o).map(([name, val]) => [`--${name}`, val])
|
|
92
87
|
);
|
|
93
|
-
var isObject = (val) => val && val.constructor === Object;
|
|
94
88
|
var get = (obj, path, fallback) => {
|
|
95
89
|
const key = path.split(".");
|
|
96
90
|
let result = obj;
|
|
@@ -100,13 +94,51 @@ var get = (obj, path, fallback) => {
|
|
|
100
94
|
}
|
|
101
95
|
return result === void 0 ? fallback : result;
|
|
102
96
|
};
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
97
|
+
|
|
98
|
+
// src/components/SVG/SVG.tsx
|
|
99
|
+
var SVG = (0, import_react.forwardRef)(
|
|
100
|
+
({ size = 24, children, className, color, ...props }, ref) => {
|
|
101
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
102
|
+
"svg",
|
|
103
|
+
{
|
|
104
|
+
...props,
|
|
105
|
+
ref,
|
|
106
|
+
width: `${props.width || size}px`,
|
|
107
|
+
height: `${props.height || size}px`,
|
|
108
|
+
className: cn("flex-none fill-current", className),
|
|
109
|
+
style: { color: color && `var(--color-${color})` }
|
|
110
|
+
},
|
|
111
|
+
children
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
// src/components/Formatters/DateFormat.tsx
|
|
117
|
+
var import_react2 = __toESM(require("react"));
|
|
118
|
+
var import_i18n = require("@react-aria/i18n");
|
|
119
|
+
var DateFormat = ({ value, tabular, ...props }) => {
|
|
120
|
+
const dateFormatter = (0, import_i18n.useDateFormatter)({
|
|
121
|
+
...props
|
|
122
|
+
});
|
|
123
|
+
return /* @__PURE__ */ import_react2.default.createElement("span", { className: tabular ? "tabular-nums" : "" }, dateFormatter.format(value));
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
// src/components/Formatters/NumericFormat.tsx
|
|
127
|
+
var import_react3 = __toESM(require("react"));
|
|
128
|
+
var import_i18n2 = require("@react-aria/i18n");
|
|
129
|
+
var NumericFormat = ({
|
|
130
|
+
value,
|
|
131
|
+
tabular = true,
|
|
132
|
+
...props
|
|
133
|
+
}) => {
|
|
134
|
+
const numberFormatter = (0, import_i18n2.useNumberFormatter)({
|
|
135
|
+
...props
|
|
136
|
+
});
|
|
137
|
+
return /* @__PURE__ */ import_react3.default.createElement("span", { className: tabular ? "tabular-nums" : void 0 }, numberFormatter.format(value));
|
|
106
138
|
};
|
|
107
139
|
|
|
108
140
|
// src/hooks/useTheme.tsx
|
|
109
|
-
var
|
|
141
|
+
var import_react4 = __toESM(require("react"));
|
|
110
142
|
|
|
111
143
|
// src/defaultTheme.ts
|
|
112
144
|
var defaultTheme = {
|
|
@@ -122,9 +154,9 @@ var defaultTheme = {
|
|
|
122
154
|
};
|
|
123
155
|
|
|
124
156
|
// src/hooks/useTheme.tsx
|
|
125
|
-
var InternalContext = (0,
|
|
157
|
+
var InternalContext = (0, import_react4.createContext)(defaultTheme);
|
|
126
158
|
var useTheme = () => {
|
|
127
|
-
const theme = (0,
|
|
159
|
+
const theme = (0, import_react4.useContext)(InternalContext);
|
|
128
160
|
return theme;
|
|
129
161
|
};
|
|
130
162
|
function ThemeProvider({
|
|
@@ -134,7 +166,7 @@ function ThemeProvider({
|
|
|
134
166
|
}) {
|
|
135
167
|
var _a;
|
|
136
168
|
const root = (_a = theme.root) == null ? void 0 : _a.call(theme);
|
|
137
|
-
return /* @__PURE__ */
|
|
169
|
+
return /* @__PURE__ */ import_react4.default.createElement(InternalContext.Provider, { value: theme }, /* @__PURE__ */ import_react4.default.createElement("div", { className: cn(root, className) }, children));
|
|
138
170
|
}
|
|
139
171
|
|
|
140
172
|
// src/hooks/useClassNames.tsx
|
|
@@ -181,7 +213,7 @@ var useClassNames = ({
|
|
|
181
213
|
};
|
|
182
214
|
|
|
183
215
|
// src/hooks/useResponsiveValue.ts
|
|
184
|
-
var
|
|
216
|
+
var import_react5 = require("react");
|
|
185
217
|
var useResponsiveValue = (values, defaultIndex = 0) => {
|
|
186
218
|
const theme = useTheme();
|
|
187
219
|
const screens = theme.screens || defaultTheme.screens;
|
|
@@ -190,8 +222,8 @@ var useResponsiveValue = (values, defaultIndex = 0) => {
|
|
|
190
222
|
`Default breakpoint index is out of bounds. Theme has ${Object.keys(screens).length + 1} breakpoints, default is ${defaultIndex}.`
|
|
191
223
|
);
|
|
192
224
|
}
|
|
193
|
-
const [index, setIndex] = (0,
|
|
194
|
-
(0,
|
|
225
|
+
const [index, setIndex] = (0, import_react5.useState)(defaultIndex);
|
|
226
|
+
(0, import_react5.useEffect)(() => {
|
|
195
227
|
if (typeof window == "undefined") return;
|
|
196
228
|
const getIndex = () => Object.values(screens).filter(
|
|
197
229
|
(breakpoint) => window.matchMedia(`screen and (min-width: ${breakpoint})`).matches
|
|
@@ -210,12 +242,12 @@ var useResponsiveValue = (values, defaultIndex = 0) => {
|
|
|
210
242
|
};
|
|
211
243
|
|
|
212
244
|
// src/hooks/useStateProps.ts
|
|
213
|
-
var
|
|
245
|
+
var import_react6 = require("react");
|
|
214
246
|
var import_react_fast_compare = __toESM(require("react-fast-compare"));
|
|
215
247
|
var KEBAB_REGEX = /[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g;
|
|
216
248
|
var toKebap = (val) => val.replace(KEBAB_REGEX, (match) => `-${match.toLocaleLowerCase()}`);
|
|
217
249
|
var useStateProps = (states) => {
|
|
218
|
-
const statePropsRef = (0,
|
|
250
|
+
const statePropsRef = (0, import_react6.useRef)({});
|
|
219
251
|
let stateProps = {};
|
|
220
252
|
for (let state in states) {
|
|
221
253
|
if (states[state]) {
|
|
@@ -230,7 +262,7 @@ var useStateProps = (states) => {
|
|
|
230
262
|
};
|
|
231
263
|
|
|
232
264
|
// src/hooks/useSmallScreen.ts
|
|
233
|
-
var
|
|
265
|
+
var import_react7 = require("react");
|
|
234
266
|
var useSmallScreen = () => {
|
|
235
267
|
const getMatches = () => {
|
|
236
268
|
if (typeof window == "undefined") {
|
|
@@ -238,11 +270,11 @@ var useSmallScreen = () => {
|
|
|
238
270
|
}
|
|
239
271
|
return window.matchMedia("(max-width: 600px)").matches;
|
|
240
272
|
};
|
|
241
|
-
const [matches, setMatches] = (0,
|
|
242
|
-
const handleResize = (0,
|
|
273
|
+
const [matches, setMatches] = (0, import_react7.useState)(getMatches());
|
|
274
|
+
const handleResize = (0, import_react7.useCallback)(() => {
|
|
243
275
|
setMatches(getMatches());
|
|
244
276
|
}, []);
|
|
245
|
-
(0,
|
|
277
|
+
(0, import_react7.useEffect)(() => {
|
|
246
278
|
handleResize();
|
|
247
279
|
if (typeof window == "undefined") return;
|
|
248
280
|
window.addEventListener("resize", handleResize);
|
|
@@ -305,56 +337,6 @@ var extendTheme = (newStyles, theme) => {
|
|
|
305
337
|
return { ...theme, components: { ...mergedStyles } };
|
|
306
338
|
};
|
|
307
339
|
|
|
308
|
-
// src/components/SVG/SVG.tsx
|
|
309
|
-
var SVG = (0, import_react5.forwardRef)(
|
|
310
|
-
({ size = 24, children, className, color, ...props }, ref) => {
|
|
311
|
-
const theme = useTheme();
|
|
312
|
-
return /* @__PURE__ */ import_react5.default.createElement(
|
|
313
|
-
"svg",
|
|
314
|
-
{
|
|
315
|
-
...props,
|
|
316
|
-
ref,
|
|
317
|
-
width: `${props.width || size}px`,
|
|
318
|
-
height: `${props.height || size}px`,
|
|
319
|
-
className: cn("flex-none fill-current text-[--color]", className),
|
|
320
|
-
style: createVar({
|
|
321
|
-
color: color && getColor(
|
|
322
|
-
theme,
|
|
323
|
-
color,
|
|
324
|
-
color
|
|
325
|
-
/* fallback */
|
|
326
|
-
)
|
|
327
|
-
})
|
|
328
|
-
},
|
|
329
|
-
children
|
|
330
|
-
);
|
|
331
|
-
}
|
|
332
|
-
);
|
|
333
|
-
|
|
334
|
-
// src/components/Formatters/DateFormat.tsx
|
|
335
|
-
var import_react6 = __toESM(require("react"));
|
|
336
|
-
var import_i18n = require("@react-aria/i18n");
|
|
337
|
-
var DateFormat = ({ value, tabular, ...props }) => {
|
|
338
|
-
const dateFormatter = (0, import_i18n.useDateFormatter)({
|
|
339
|
-
...props
|
|
340
|
-
});
|
|
341
|
-
return /* @__PURE__ */ import_react6.default.createElement("span", { className: tabular ? "tabular-nums" : "" }, dateFormatter.format(value));
|
|
342
|
-
};
|
|
343
|
-
|
|
344
|
-
// src/components/Formatters/NumericFormat.tsx
|
|
345
|
-
var import_react7 = __toESM(require("react"));
|
|
346
|
-
var import_i18n2 = require("@react-aria/i18n");
|
|
347
|
-
var NumericFormat = ({
|
|
348
|
-
value,
|
|
349
|
-
tabular = true,
|
|
350
|
-
...props
|
|
351
|
-
}) => {
|
|
352
|
-
const numberFormatter = (0, import_i18n2.useNumberFormatter)({
|
|
353
|
-
...props
|
|
354
|
-
});
|
|
355
|
-
return /* @__PURE__ */ import_react7.default.createElement("span", { className: tabular ? "tabular-nums" : void 0 }, numberFormatter.format(value));
|
|
356
|
-
};
|
|
357
|
-
|
|
358
340
|
// src/style-props.tsx
|
|
359
341
|
var width = {
|
|
360
342
|
auto: "w-auto",
|
|
@@ -854,22 +836,12 @@ var textAlign = {
|
|
|
854
836
|
center: "text-center",
|
|
855
837
|
right: "text-right"
|
|
856
838
|
};
|
|
857
|
-
var gridColsAlign = {
|
|
858
|
-
left: "grid-cols-[minmax(0,_var(--maxWidth))_1fr_1fr]",
|
|
859
|
-
center: "grid-cols-[1fr_minmax(0,_var(--maxWidth))_1fr]",
|
|
860
|
-
right: " grid-cols-[1fr_1fr_minmax(0,_var(--maxWidth))]"
|
|
861
|
-
};
|
|
862
|
-
var gridColumn = {
|
|
863
|
-
left: "[&>*]:col-[1]",
|
|
864
|
-
center: "[&>*]:col-[2]",
|
|
865
|
-
right: "[&>*]:col-[3]"
|
|
866
|
-
};
|
|
867
839
|
var aspect = {
|
|
868
840
|
square: "aspect-[1]",
|
|
869
|
-
landscape: "aspect-
|
|
870
|
-
portrait: "aspect-
|
|
871
|
-
widescreen: "aspect-
|
|
872
|
-
ultrawide: "aspect-
|
|
841
|
+
landscape: "aspect-4/3",
|
|
842
|
+
portrait: "aspect-3/4",
|
|
843
|
+
widescreen: "aspect-16/9",
|
|
844
|
+
ultrawide: "aspect-18/5",
|
|
873
845
|
golden: "aspect-[1.6180/1]"
|
|
874
846
|
};
|
|
875
847
|
var objectFit = {
|
|
@@ -935,11 +907,7 @@ var cursorStyle = {
|
|
|
935
907
|
fontWeight,
|
|
936
908
|
gapSpace,
|
|
937
909
|
get,
|
|
938
|
-
getColor,
|
|
939
|
-
gridColsAlign,
|
|
940
|
-
gridColumn,
|
|
941
910
|
height,
|
|
942
|
-
isObject,
|
|
943
911
|
objectFit,
|
|
944
912
|
objectPosition,
|
|
945
913
|
paddingBottom,
|
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
// src/components/SVG/SVG.tsx
|
|
2
|
-
import
|
|
2
|
+
import React, { forwardRef } from "react";
|
|
3
3
|
|
|
4
4
|
// src/utils.ts
|
|
5
|
-
import { cx } from "class-variance-authority";
|
|
6
|
-
import { cva as _cva } from "class-variance-authority";
|
|
5
|
+
import { cva as _cva, cx } from "class-variance-authority";
|
|
7
6
|
import { twMerge } from "tailwind-merge";
|
|
8
7
|
var cva = (base, config) => {
|
|
9
8
|
function styles(props) {
|
|
@@ -16,7 +15,6 @@ var cn = (...inputs) => twMerge(cx(inputs));
|
|
|
16
15
|
var createVar = (o) => Object.fromEntries(
|
|
17
16
|
Object.entries(o).map(([name, val]) => [`--${name}`, val])
|
|
18
17
|
);
|
|
19
|
-
var isObject = (val) => val && val.constructor === Object;
|
|
20
18
|
var get = (obj, path, fallback) => {
|
|
21
19
|
const key = path.split(".");
|
|
22
20
|
let result = obj;
|
|
@@ -26,13 +24,51 @@ var get = (obj, path, fallback) => {
|
|
|
26
24
|
}
|
|
27
25
|
return result === void 0 ? fallback : result;
|
|
28
26
|
};
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
|
|
28
|
+
// src/components/SVG/SVG.tsx
|
|
29
|
+
var SVG = forwardRef(
|
|
30
|
+
({ size = 24, children, className, color, ...props }, ref) => {
|
|
31
|
+
return /* @__PURE__ */ React.createElement(
|
|
32
|
+
"svg",
|
|
33
|
+
{
|
|
34
|
+
...props,
|
|
35
|
+
ref,
|
|
36
|
+
width: `${props.width || size}px`,
|
|
37
|
+
height: `${props.height || size}px`,
|
|
38
|
+
className: cn("flex-none fill-current", className),
|
|
39
|
+
style: { color: color && `var(--color-${color})` }
|
|
40
|
+
},
|
|
41
|
+
children
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
// src/components/Formatters/DateFormat.tsx
|
|
47
|
+
import React2 from "react";
|
|
48
|
+
import { useDateFormatter } from "@react-aria/i18n";
|
|
49
|
+
var DateFormat = ({ value, tabular, ...props }) => {
|
|
50
|
+
const dateFormatter = useDateFormatter({
|
|
51
|
+
...props
|
|
52
|
+
});
|
|
53
|
+
return /* @__PURE__ */ React2.createElement("span", { className: tabular ? "tabular-nums" : "" }, dateFormatter.format(value));
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
// src/components/Formatters/NumericFormat.tsx
|
|
57
|
+
import React3 from "react";
|
|
58
|
+
import { useNumberFormatter } from "@react-aria/i18n";
|
|
59
|
+
var NumericFormat = ({
|
|
60
|
+
value,
|
|
61
|
+
tabular = true,
|
|
62
|
+
...props
|
|
63
|
+
}) => {
|
|
64
|
+
const numberFormatter = useNumberFormatter({
|
|
65
|
+
...props
|
|
66
|
+
});
|
|
67
|
+
return /* @__PURE__ */ React3.createElement("span", { className: tabular ? "tabular-nums" : void 0 }, numberFormatter.format(value));
|
|
32
68
|
};
|
|
33
69
|
|
|
34
70
|
// src/hooks/useTheme.tsx
|
|
35
|
-
import
|
|
71
|
+
import React4, { createContext, useContext } from "react";
|
|
36
72
|
|
|
37
73
|
// src/defaultTheme.ts
|
|
38
74
|
var defaultTheme = {
|
|
@@ -60,7 +96,7 @@ function ThemeProvider({
|
|
|
60
96
|
}) {
|
|
61
97
|
var _a;
|
|
62
98
|
const root = (_a = theme.root) == null ? void 0 : _a.call(theme);
|
|
63
|
-
return /* @__PURE__ */
|
|
99
|
+
return /* @__PURE__ */ React4.createElement(InternalContext.Provider, { value: theme }, /* @__PURE__ */ React4.createElement("div", { className: cn(root, className) }, children));
|
|
64
100
|
}
|
|
65
101
|
|
|
66
102
|
// src/hooks/useClassNames.tsx
|
|
@@ -231,56 +267,6 @@ var extendTheme = (newStyles, theme) => {
|
|
|
231
267
|
return { ...theme, components: { ...mergedStyles } };
|
|
232
268
|
};
|
|
233
269
|
|
|
234
|
-
// src/components/SVG/SVG.tsx
|
|
235
|
-
var SVG = forwardRef(
|
|
236
|
-
({ size = 24, children, className, color, ...props }, ref) => {
|
|
237
|
-
const theme = useTheme();
|
|
238
|
-
return /* @__PURE__ */ React2.createElement(
|
|
239
|
-
"svg",
|
|
240
|
-
{
|
|
241
|
-
...props,
|
|
242
|
-
ref,
|
|
243
|
-
width: `${props.width || size}px`,
|
|
244
|
-
height: `${props.height || size}px`,
|
|
245
|
-
className: cn("flex-none fill-current text-[--color]", className),
|
|
246
|
-
style: createVar({
|
|
247
|
-
color: color && getColor(
|
|
248
|
-
theme,
|
|
249
|
-
color,
|
|
250
|
-
color
|
|
251
|
-
/* fallback */
|
|
252
|
-
)
|
|
253
|
-
})
|
|
254
|
-
},
|
|
255
|
-
children
|
|
256
|
-
);
|
|
257
|
-
}
|
|
258
|
-
);
|
|
259
|
-
|
|
260
|
-
// src/components/Formatters/DateFormat.tsx
|
|
261
|
-
import React3 from "react";
|
|
262
|
-
import { useDateFormatter } from "@react-aria/i18n";
|
|
263
|
-
var DateFormat = ({ value, tabular, ...props }) => {
|
|
264
|
-
const dateFormatter = useDateFormatter({
|
|
265
|
-
...props
|
|
266
|
-
});
|
|
267
|
-
return /* @__PURE__ */ React3.createElement("span", { className: tabular ? "tabular-nums" : "" }, dateFormatter.format(value));
|
|
268
|
-
};
|
|
269
|
-
|
|
270
|
-
// src/components/Formatters/NumericFormat.tsx
|
|
271
|
-
import React4 from "react";
|
|
272
|
-
import { useNumberFormatter } from "@react-aria/i18n";
|
|
273
|
-
var NumericFormat = ({
|
|
274
|
-
value,
|
|
275
|
-
tabular = true,
|
|
276
|
-
...props
|
|
277
|
-
}) => {
|
|
278
|
-
const numberFormatter = useNumberFormatter({
|
|
279
|
-
...props
|
|
280
|
-
});
|
|
281
|
-
return /* @__PURE__ */ React4.createElement("span", { className: tabular ? "tabular-nums" : void 0 }, numberFormatter.format(value));
|
|
282
|
-
};
|
|
283
|
-
|
|
284
270
|
// src/style-props.tsx
|
|
285
271
|
var width = {
|
|
286
272
|
auto: "w-auto",
|
|
@@ -780,22 +766,12 @@ var textAlign = {
|
|
|
780
766
|
center: "text-center",
|
|
781
767
|
right: "text-right"
|
|
782
768
|
};
|
|
783
|
-
var gridColsAlign = {
|
|
784
|
-
left: "grid-cols-[minmax(0,_var(--maxWidth))_1fr_1fr]",
|
|
785
|
-
center: "grid-cols-[1fr_minmax(0,_var(--maxWidth))_1fr]",
|
|
786
|
-
right: " grid-cols-[1fr_1fr_minmax(0,_var(--maxWidth))]"
|
|
787
|
-
};
|
|
788
|
-
var gridColumn = {
|
|
789
|
-
left: "[&>*]:col-[1]",
|
|
790
|
-
center: "[&>*]:col-[2]",
|
|
791
|
-
right: "[&>*]:col-[3]"
|
|
792
|
-
};
|
|
793
769
|
var aspect = {
|
|
794
770
|
square: "aspect-[1]",
|
|
795
|
-
landscape: "aspect-
|
|
796
|
-
portrait: "aspect-
|
|
797
|
-
widescreen: "aspect-
|
|
798
|
-
ultrawide: "aspect-
|
|
771
|
+
landscape: "aspect-4/3",
|
|
772
|
+
portrait: "aspect-3/4",
|
|
773
|
+
widescreen: "aspect-16/9",
|
|
774
|
+
ultrawide: "aspect-18/5",
|
|
799
775
|
golden: "aspect-[1.6180/1]"
|
|
800
776
|
};
|
|
801
777
|
var objectFit = {
|
|
@@ -860,11 +836,7 @@ export {
|
|
|
860
836
|
fontWeight,
|
|
861
837
|
gapSpace,
|
|
862
838
|
get,
|
|
863
|
-
getColor,
|
|
864
|
-
gridColsAlign,
|
|
865
|
-
gridColumn,
|
|
866
839
|
height,
|
|
867
|
-
isObject,
|
|
868
840
|
objectFit,
|
|
869
841
|
objectPosition,
|
|
870
842
|
paddingBottom,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marigold/system",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.0",
|
|
4
4
|
"description": "Marigold System Library",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@babel/core": "7.26.7",
|
|
40
40
|
"postcss": "8.5.1",
|
|
41
41
|
"react": "19.0.0",
|
|
42
|
-
"tailwindcss": "
|
|
42
|
+
"tailwindcss": "4.0.0",
|
|
43
43
|
"tsup": "8.3.5",
|
|
44
44
|
"@marigold/tsconfig": "0.4.0"
|
|
45
45
|
},
|