@marigold/system 15.4.3 → 16.0.1
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 +34 -30
- package/dist/index.d.ts +34 -30
- package/dist/index.js +21 -6
- package/dist/index.mjs +21 -7
- package/package.json +6 -6
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as react0 from "react";
|
|
2
|
+
import { CSSProperties, Context, ReactNode } from "react";
|
|
2
3
|
import { VariantProps } from "class-variance-authority";
|
|
4
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
5
|
import { DateFormatterOptions, useNumberFormatter } from "@react-aria/i18n";
|
|
4
6
|
import { HtmlProps, KebabCase } from "@marigold/types";
|
|
5
7
|
import { ClassProp, ClassValue, StringToBoolean } from "class-variance-authority/dist/types";
|
|
@@ -15,7 +17,7 @@ interface SVGProps extends Omit<HtmlProps<'svg'>, 'fill' | 'style'> {
|
|
|
15
17
|
*/
|
|
16
18
|
className?: string;
|
|
17
19
|
}
|
|
18
|
-
declare const SVG:
|
|
20
|
+
declare const SVG: react0.ForwardRefExoticComponent<SVGProps & react0.RefAttributes<SVGSVGElement>>;
|
|
19
21
|
//#endregion
|
|
20
22
|
//#region src/components/Formatters/DateFormat.d.ts
|
|
21
23
|
interface DateFormatProps extends DateFormatterOptions {
|
|
@@ -33,7 +35,7 @@ declare const DateFormat: ({
|
|
|
33
35
|
value,
|
|
34
36
|
tabular,
|
|
35
37
|
...props
|
|
36
|
-
}: DateFormatProps) =>
|
|
38
|
+
}: DateFormatProps) => react_jsx_runtime0.JSX.Element;
|
|
37
39
|
//#endregion
|
|
38
40
|
//#region src/components/Formatters/NumericFormat.d.ts
|
|
39
41
|
type NumerFormatterOptions = NonNullable<Parameters<typeof useNumberFormatter>[0]>;
|
|
@@ -57,18 +59,18 @@ declare const NumericFormat: ({
|
|
|
57
59
|
value,
|
|
58
60
|
tabular,
|
|
59
61
|
...props
|
|
60
|
-
}: NumericFormatProps) =>
|
|
62
|
+
}: NumericFormatProps) => react_jsx_runtime0.JSX.Element;
|
|
61
63
|
//#endregion
|
|
62
64
|
//#region src/utils.d.ts
|
|
63
65
|
type ConfigSchema = Record<string, Record<string, ClassValue>>;
|
|
64
|
-
type ConfigVariants<T extends ConfigSchema> = { [Variant in keyof T]?: StringToBoolean<keyof T[Variant]> | null | undefined };
|
|
65
|
-
type ConfigVariantsMulti<T extends ConfigSchema> = { [Variant in keyof T]?: StringToBoolean<keyof T[Variant]> | StringToBoolean<keyof T[Variant]>[] | undefined };
|
|
66
|
-
type Config<T> = T extends ConfigSchema ? {
|
|
67
|
-
variants?: T;
|
|
68
|
-
defaultVariants?: ConfigVariants<T>;
|
|
69
|
-
compoundVariants?: (T extends ConfigSchema ? (ConfigVariants<T> | ConfigVariantsMulti<T>) & ClassProp : ClassProp)[];
|
|
66
|
+
type ConfigVariants<T$1 extends ConfigSchema> = { [Variant in keyof T$1]?: StringToBoolean<keyof T$1[Variant]> | null | undefined };
|
|
67
|
+
type ConfigVariantsMulti<T$1 extends ConfigSchema> = { [Variant in keyof T$1]?: StringToBoolean<keyof T$1[Variant]> | StringToBoolean<keyof T$1[Variant]>[] | undefined };
|
|
68
|
+
type Config<T$1> = T$1 extends ConfigSchema ? {
|
|
69
|
+
variants?: T$1;
|
|
70
|
+
defaultVariants?: ConfigVariants<T$1>;
|
|
71
|
+
compoundVariants?: (T$1 extends ConfigSchema ? (ConfigVariants<T$1> | ConfigVariantsMulti<T$1>) & ClassProp : ClassProp)[];
|
|
70
72
|
} : never;
|
|
71
|
-
type Props<T> = T extends ConfigSchema ? ConfigVariants<T> & ClassProp : ClassProp;
|
|
73
|
+
type Props<T$1> = T$1 extends ConfigSchema ? ConfigVariants<T$1> & ClassProp : ClassProp;
|
|
72
74
|
declare const cva: <T>(base?: ClassValue, config?: Config<T>) => {
|
|
73
75
|
(props?: Props<T>): string;
|
|
74
76
|
variants: T | undefined;
|
|
@@ -76,7 +78,7 @@ declare const cva: <T>(base?: ClassValue, config?: Config<T>) => {
|
|
|
76
78
|
declare const cn: (...inputs: ClassValue[]) => string;
|
|
77
79
|
declare const createVar: (o: {
|
|
78
80
|
[key: string]: string | number | undefined;
|
|
79
|
-
}) =>
|
|
81
|
+
}) => CSSProperties;
|
|
80
82
|
/**
|
|
81
83
|
* Safely get a dot-notated path within a nested object, with ability
|
|
82
84
|
* to return a default if the full key path does not exist or
|
|
@@ -129,7 +131,7 @@ type Theme = {
|
|
|
129
131
|
height?: NestedStringObject;
|
|
130
132
|
root?: ComponentStyleFunction;
|
|
131
133
|
components: {
|
|
132
|
-
Accordion?: Record<'container' | 'item' | 'header' | 'content' | 'icon', ComponentStyleFunction<string, string>>;
|
|
134
|
+
Accordion?: Record<'container' | 'item' | 'header' | 'panel' | 'content' | 'icon', ComponentStyleFunction<string, string>>;
|
|
133
135
|
Badge?: ComponentStyleFunction<string, string>;
|
|
134
136
|
Breadcrumbs?: Record<'container' | 'item' | 'link' | 'current', ComponentStyleFunction<string, string>>;
|
|
135
137
|
Button?: ComponentStyleFunction<string, string>;
|
|
@@ -149,7 +151,7 @@ type Theme = {
|
|
|
149
151
|
Checkbox?: Record<'container' | 'label' | 'checkbox' | 'group', ComponentStyleFunction<string, string>>;
|
|
150
152
|
Switch?: Record<'container' | 'track' | 'thumb', ComponentStyleFunction<string, string>>;
|
|
151
153
|
Input?: Record<'input' | 'icon' | 'action', ComponentStyleFunction<string, string>>;
|
|
152
|
-
Label?:
|
|
154
|
+
Label?: ComponentStyleFunction<string, string>;
|
|
153
155
|
List?: Record<'ol' | 'ul' | 'item', ComponentStyleFunction<string, string>>;
|
|
154
156
|
Link?: ComponentStyleFunction<string, string>;
|
|
155
157
|
ListBox?: Record<'container' | 'list' | 'item' | 'section' | 'header', ComponentStyleFunction<string, string>>;
|
|
@@ -157,7 +159,7 @@ type Theme = {
|
|
|
157
159
|
Modal?: ComponentStyleFunction<string, string>;
|
|
158
160
|
MultiSelect?: Record<'container' | 'closeButton' | 'field' | 'input' | 'icon' | 'listContainer' | 'list' | 'option' | 'tag' | 'valueContainer', ComponentStyleFunction<string, string>>;
|
|
159
161
|
Pagination?: Record<'container' | 'navigationButton' | 'pageButton' | 'icon' | 'ellipsis', ComponentStyleFunction<string, string>>;
|
|
160
|
-
|
|
162
|
+
ProgressCircle?: Record<'container' | 'loader' | 'label', ComponentStyleFunction<string, string>>;
|
|
161
163
|
Radio?: Record<'container' | 'label' | 'radio' | 'group', ComponentStyleFunction<string, string>>;
|
|
162
164
|
Slider?: Record<'container' | 'track' | 'thumb' | 'output' | 'selectedTrack', ComponentStyleFunction<string, string>>;
|
|
163
165
|
Select?: Record<'select' | 'icon', ComponentStyleFunction<string, string>>;
|
|
@@ -174,12 +176,13 @@ type Theme = {
|
|
|
174
176
|
Calendar?: Record<'calendar' | 'calendarListboxButton' | 'calendarCell' | 'calendarControllers' | 'calendarHeader' | 'calendarGrid' | 'select', ComponentStyleFunction<string, string>>;
|
|
175
177
|
DatePicker?: ComponentStyleFunction<string, string>;
|
|
176
178
|
ComboBox?: ComponentStyleFunction<string, string>;
|
|
177
|
-
|
|
179
|
+
Loader?: Record<'container' | 'loader' | 'label', ComponentStyleFunction<string, string>>;
|
|
180
|
+
FileField?: Record<'container' | 'dropZone' | 'dropZoneContent' | 'dropZoneLabel' | 'item' | 'itemLabel' | 'itemDescription', ComponentStyleFunction<string, string>>;
|
|
178
181
|
};
|
|
179
182
|
};
|
|
180
183
|
type ComponentNames = keyof Theme['components'];
|
|
181
|
-
type ThemeComponent<C extends ComponentNames> = NonNullable<Theme['components'][C]>;
|
|
182
|
-
type ThemeComponentParts<C extends ComponentNames> = keyof ThemeComponent<C>;
|
|
184
|
+
type ThemeComponent<C$1 extends ComponentNames> = NonNullable<Theme['components'][C$1]>;
|
|
185
|
+
type ThemeComponentParts<C$1 extends ComponentNames> = keyof ThemeComponent<C$1>;
|
|
183
186
|
//#endregion
|
|
184
187
|
//#region src/hooks/useClassNames.d.ts
|
|
185
188
|
interface ComponentContextProps {
|
|
@@ -187,14 +190,14 @@ interface ComponentContextProps {
|
|
|
187
190
|
variant?: string;
|
|
188
191
|
[key: string]: any;
|
|
189
192
|
}
|
|
190
|
-
interface UseClassNamesProps<C extends ComponentNames> {
|
|
191
|
-
component: C;
|
|
193
|
+
interface UseClassNamesProps<C$1 extends ComponentNames> {
|
|
194
|
+
component: C$1;
|
|
192
195
|
variant?: string;
|
|
193
196
|
size?: string;
|
|
194
|
-
className?: ThemeComponent<C> extends ((...args: any) => any) ? string : { [slot in keyof ThemeComponent<C>]?: string };
|
|
197
|
+
className?: ThemeComponent<C$1> extends ((...args: any) => any) ? string : { [slot in keyof ThemeComponent<C$1>]?: string };
|
|
195
198
|
context?: Context<ComponentContextProps>;
|
|
196
199
|
}
|
|
197
|
-
type ComponentClassNames<C extends ComponentNames> = ThemeComponent<C> extends ((...args: any) => any) ? string : { [slot in keyof ThemeComponent<C>]: string };
|
|
200
|
+
type ComponentClassNames<C$1 extends ComponentNames> = ThemeComponent<C$1> extends ((...args: any) => any) ? string : { [slot in keyof ThemeComponent<C$1>]: string };
|
|
198
201
|
declare const useClassNames: <C extends ComponentNames>({
|
|
199
202
|
component,
|
|
200
203
|
className,
|
|
@@ -225,11 +228,11 @@ declare const useStateProps: (states: UseStateProps) => StateAttrProps;
|
|
|
225
228
|
//#endregion
|
|
226
229
|
//#region src/hooks/useTheme.d.ts
|
|
227
230
|
declare const useTheme: () => Theme;
|
|
228
|
-
interface ThemeProviderProps<T extends Theme> {
|
|
231
|
+
interface ThemeProviderProps<T$1 extends Theme> {
|
|
229
232
|
/**
|
|
230
233
|
* The theme that should be used within the provider context.
|
|
231
234
|
*/
|
|
232
|
-
theme: T;
|
|
235
|
+
theme: T$1;
|
|
233
236
|
/**
|
|
234
237
|
* The children of the component.
|
|
235
238
|
*/
|
|
@@ -239,11 +242,11 @@ interface ThemeProviderProps<T extends Theme> {
|
|
|
239
242
|
*/
|
|
240
243
|
className?: string;
|
|
241
244
|
}
|
|
242
|
-
declare function ThemeProvider<T extends Theme>({
|
|
245
|
+
declare function ThemeProvider<T$1 extends Theme>({
|
|
243
246
|
theme,
|
|
244
247
|
children,
|
|
245
248
|
className
|
|
246
|
-
}: ThemeProviderProps<T>):
|
|
249
|
+
}: ThemeProviderProps<T$1>): react_jsx_runtime0.JSX.Element;
|
|
247
250
|
//#endregion
|
|
248
251
|
//#region src/hooks/useSmallScreen.d.ts
|
|
249
252
|
declare const useSmallScreen: () => boolean;
|
|
@@ -252,7 +255,7 @@ declare const useSmallScreen: () => boolean;
|
|
|
252
255
|
type StylesProps = { [K in keyof Theme['components']]: Partial<Theme['components'][K]> };
|
|
253
256
|
declare const extendTheme: (newStyles: StylesProps, theme: Theme) => {
|
|
254
257
|
components: {
|
|
255
|
-
Accordion?: Record<"container" | "item" | "header" | "content" | "icon", ComponentStyleFunction<string, string>>;
|
|
258
|
+
Accordion?: Record<"container" | "item" | "header" | "panel" | "content" | "icon", ComponentStyleFunction<string, string>>;
|
|
256
259
|
Badge?: ComponentStyleFunction<string, string>;
|
|
257
260
|
Breadcrumbs?: Record<"container" | "item" | "link" | "current", ComponentStyleFunction<string, string>>;
|
|
258
261
|
Button?: ComponentStyleFunction<string, string>;
|
|
@@ -272,7 +275,7 @@ declare const extendTheme: (newStyles: StylesProps, theme: Theme) => {
|
|
|
272
275
|
Checkbox?: Record<"container" | "label" | "checkbox" | "group", ComponentStyleFunction<string, string>>;
|
|
273
276
|
Switch?: Record<"container" | "track" | "thumb", ComponentStyleFunction<string, string>>;
|
|
274
277
|
Input?: Record<"input" | "icon" | "action", ComponentStyleFunction<string, string>>;
|
|
275
|
-
Label?:
|
|
278
|
+
Label?: ComponentStyleFunction<string, string>;
|
|
276
279
|
List?: Record<"ol" | "ul" | "item", ComponentStyleFunction<string, string>>;
|
|
277
280
|
Link?: ComponentStyleFunction<string, string>;
|
|
278
281
|
ListBox?: Record<"container" | "list" | "item" | "section" | "header", ComponentStyleFunction<string, string>>;
|
|
@@ -280,7 +283,7 @@ declare const extendTheme: (newStyles: StylesProps, theme: Theme) => {
|
|
|
280
283
|
Modal?: ComponentStyleFunction<string, string>;
|
|
281
284
|
MultiSelect?: Record<"container" | "closeButton" | "field" | "input" | "icon" | "listContainer" | "list" | "option" | "tag" | "valueContainer", ComponentStyleFunction<string, string>>;
|
|
282
285
|
Pagination?: Record<"container" | "navigationButton" | "pageButton" | "icon" | "ellipsis", ComponentStyleFunction<string, string>>;
|
|
283
|
-
|
|
286
|
+
ProgressCircle?: Record<"container" | "loader" | "label", ComponentStyleFunction<string, string>>;
|
|
284
287
|
Radio?: Record<"container" | "label" | "radio" | "group", ComponentStyleFunction<string, string>>;
|
|
285
288
|
Slider?: Record<"container" | "track" | "thumb" | "output" | "selectedTrack", ComponentStyleFunction<string, string>>;
|
|
286
289
|
Select?: Record<"select" | "icon", ComponentStyleFunction<string, string>>;
|
|
@@ -297,7 +300,8 @@ declare const extendTheme: (newStyles: StylesProps, theme: Theme) => {
|
|
|
297
300
|
Calendar?: Record<"calendar" | "calendarListboxButton" | "calendarCell" | "calendarControllers" | "calendarHeader" | "calendarGrid" | "select", ComponentStyleFunction<string, string>>;
|
|
298
301
|
DatePicker?: ComponentStyleFunction<string, string>;
|
|
299
302
|
ComboBox?: ComponentStyleFunction<string, string>;
|
|
300
|
-
|
|
303
|
+
Loader?: Record<"container" | "loader" | "label", ComponentStyleFunction<string, string>>;
|
|
304
|
+
FileField?: Record<"container" | "dropZone" | "dropZoneContent" | "dropZoneLabel" | "item" | "itemLabel" | "itemDescription", ComponentStyleFunction<string, string>>;
|
|
301
305
|
};
|
|
302
306
|
name: string;
|
|
303
307
|
screens?: {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as react0 from "react";
|
|
2
|
+
import { CSSProperties, Context, ReactNode } from "react";
|
|
2
3
|
import { HtmlProps, KebabCase } from "@marigold/types";
|
|
4
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
5
|
import { DateFormatterOptions, useNumberFormatter } from "@react-aria/i18n";
|
|
4
6
|
import { ClassProp, ClassValue, StringToBoolean } from "class-variance-authority/dist/types";
|
|
5
7
|
import { VariantProps } from "class-variance-authority";
|
|
@@ -15,7 +17,7 @@ interface SVGProps extends Omit<HtmlProps<'svg'>, 'fill' | 'style'> {
|
|
|
15
17
|
*/
|
|
16
18
|
className?: string;
|
|
17
19
|
}
|
|
18
|
-
declare const SVG:
|
|
20
|
+
declare const SVG: react0.ForwardRefExoticComponent<SVGProps & react0.RefAttributes<SVGSVGElement>>;
|
|
19
21
|
//#endregion
|
|
20
22
|
//#region src/components/Formatters/DateFormat.d.ts
|
|
21
23
|
interface DateFormatProps extends DateFormatterOptions {
|
|
@@ -33,7 +35,7 @@ declare const DateFormat: ({
|
|
|
33
35
|
value,
|
|
34
36
|
tabular,
|
|
35
37
|
...props
|
|
36
|
-
}: DateFormatProps) =>
|
|
38
|
+
}: DateFormatProps) => react_jsx_runtime0.JSX.Element;
|
|
37
39
|
//#endregion
|
|
38
40
|
//#region src/components/Formatters/NumericFormat.d.ts
|
|
39
41
|
type NumerFormatterOptions = NonNullable<Parameters<typeof useNumberFormatter>[0]>;
|
|
@@ -57,18 +59,18 @@ declare const NumericFormat: ({
|
|
|
57
59
|
value,
|
|
58
60
|
tabular,
|
|
59
61
|
...props
|
|
60
|
-
}: NumericFormatProps) =>
|
|
62
|
+
}: NumericFormatProps) => react_jsx_runtime0.JSX.Element;
|
|
61
63
|
//#endregion
|
|
62
64
|
//#region src/utils.d.ts
|
|
63
65
|
type ConfigSchema = Record<string, Record<string, ClassValue>>;
|
|
64
|
-
type ConfigVariants<T extends ConfigSchema> = { [Variant in keyof T]?: StringToBoolean<keyof T[Variant]> | null | undefined };
|
|
65
|
-
type ConfigVariantsMulti<T extends ConfigSchema> = { [Variant in keyof T]?: StringToBoolean<keyof T[Variant]> | StringToBoolean<keyof T[Variant]>[] | undefined };
|
|
66
|
-
type Config<T> = T extends ConfigSchema ? {
|
|
67
|
-
variants?: T;
|
|
68
|
-
defaultVariants?: ConfigVariants<T>;
|
|
69
|
-
compoundVariants?: (T extends ConfigSchema ? (ConfigVariants<T> | ConfigVariantsMulti<T>) & ClassProp : ClassProp)[];
|
|
66
|
+
type ConfigVariants<T$1 extends ConfigSchema> = { [Variant in keyof T$1]?: StringToBoolean<keyof T$1[Variant]> | null | undefined };
|
|
67
|
+
type ConfigVariantsMulti<T$1 extends ConfigSchema> = { [Variant in keyof T$1]?: StringToBoolean<keyof T$1[Variant]> | StringToBoolean<keyof T$1[Variant]>[] | undefined };
|
|
68
|
+
type Config<T$1> = T$1 extends ConfigSchema ? {
|
|
69
|
+
variants?: T$1;
|
|
70
|
+
defaultVariants?: ConfigVariants<T$1>;
|
|
71
|
+
compoundVariants?: (T$1 extends ConfigSchema ? (ConfigVariants<T$1> | ConfigVariantsMulti<T$1>) & ClassProp : ClassProp)[];
|
|
70
72
|
} : never;
|
|
71
|
-
type Props<T> = T extends ConfigSchema ? ConfigVariants<T> & ClassProp : ClassProp;
|
|
73
|
+
type Props<T$1> = T$1 extends ConfigSchema ? ConfigVariants<T$1> & ClassProp : ClassProp;
|
|
72
74
|
declare const cva: <T>(base?: ClassValue, config?: Config<T>) => {
|
|
73
75
|
(props?: Props<T>): string;
|
|
74
76
|
variants: T | undefined;
|
|
@@ -76,7 +78,7 @@ declare const cva: <T>(base?: ClassValue, config?: Config<T>) => {
|
|
|
76
78
|
declare const cn: (...inputs: ClassValue[]) => string;
|
|
77
79
|
declare const createVar: (o: {
|
|
78
80
|
[key: string]: string | number | undefined;
|
|
79
|
-
}) =>
|
|
81
|
+
}) => CSSProperties;
|
|
80
82
|
/**
|
|
81
83
|
* Safely get a dot-notated path within a nested object, with ability
|
|
82
84
|
* to return a default if the full key path does not exist or
|
|
@@ -129,7 +131,7 @@ type Theme = {
|
|
|
129
131
|
height?: NestedStringObject;
|
|
130
132
|
root?: ComponentStyleFunction;
|
|
131
133
|
components: {
|
|
132
|
-
Accordion?: Record<'container' | 'item' | 'header' | 'content' | 'icon', ComponentStyleFunction<string, string>>;
|
|
134
|
+
Accordion?: Record<'container' | 'item' | 'header' | 'panel' | 'content' | 'icon', ComponentStyleFunction<string, string>>;
|
|
133
135
|
Badge?: ComponentStyleFunction<string, string>;
|
|
134
136
|
Breadcrumbs?: Record<'container' | 'item' | 'link' | 'current', ComponentStyleFunction<string, string>>;
|
|
135
137
|
Button?: ComponentStyleFunction<string, string>;
|
|
@@ -149,7 +151,7 @@ type Theme = {
|
|
|
149
151
|
Checkbox?: Record<'container' | 'label' | 'checkbox' | 'group', ComponentStyleFunction<string, string>>;
|
|
150
152
|
Switch?: Record<'container' | 'track' | 'thumb', ComponentStyleFunction<string, string>>;
|
|
151
153
|
Input?: Record<'input' | 'icon' | 'action', ComponentStyleFunction<string, string>>;
|
|
152
|
-
Label?:
|
|
154
|
+
Label?: ComponentStyleFunction<string, string>;
|
|
153
155
|
List?: Record<'ol' | 'ul' | 'item', ComponentStyleFunction<string, string>>;
|
|
154
156
|
Link?: ComponentStyleFunction<string, string>;
|
|
155
157
|
ListBox?: Record<'container' | 'list' | 'item' | 'section' | 'header', ComponentStyleFunction<string, string>>;
|
|
@@ -157,7 +159,7 @@ type Theme = {
|
|
|
157
159
|
Modal?: ComponentStyleFunction<string, string>;
|
|
158
160
|
MultiSelect?: Record<'container' | 'closeButton' | 'field' | 'input' | 'icon' | 'listContainer' | 'list' | 'option' | 'tag' | 'valueContainer', ComponentStyleFunction<string, string>>;
|
|
159
161
|
Pagination?: Record<'container' | 'navigationButton' | 'pageButton' | 'icon' | 'ellipsis', ComponentStyleFunction<string, string>>;
|
|
160
|
-
|
|
162
|
+
ProgressCircle?: Record<'container' | 'loader' | 'label', ComponentStyleFunction<string, string>>;
|
|
161
163
|
Radio?: Record<'container' | 'label' | 'radio' | 'group', ComponentStyleFunction<string, string>>;
|
|
162
164
|
Slider?: Record<'container' | 'track' | 'thumb' | 'output' | 'selectedTrack', ComponentStyleFunction<string, string>>;
|
|
163
165
|
Select?: Record<'select' | 'icon', ComponentStyleFunction<string, string>>;
|
|
@@ -174,12 +176,13 @@ type Theme = {
|
|
|
174
176
|
Calendar?: Record<'calendar' | 'calendarListboxButton' | 'calendarCell' | 'calendarControllers' | 'calendarHeader' | 'calendarGrid' | 'select', ComponentStyleFunction<string, string>>;
|
|
175
177
|
DatePicker?: ComponentStyleFunction<string, string>;
|
|
176
178
|
ComboBox?: ComponentStyleFunction<string, string>;
|
|
177
|
-
|
|
179
|
+
Loader?: Record<'container' | 'loader' | 'label', ComponentStyleFunction<string, string>>;
|
|
180
|
+
FileField?: Record<'container' | 'dropZone' | 'dropZoneContent' | 'dropZoneLabel' | 'item' | 'itemLabel' | 'itemDescription', ComponentStyleFunction<string, string>>;
|
|
178
181
|
};
|
|
179
182
|
};
|
|
180
183
|
type ComponentNames = keyof Theme['components'];
|
|
181
|
-
type ThemeComponent<C extends ComponentNames> = NonNullable<Theme['components'][C]>;
|
|
182
|
-
type ThemeComponentParts<C extends ComponentNames> = keyof ThemeComponent<C>;
|
|
184
|
+
type ThemeComponent<C$1 extends ComponentNames> = NonNullable<Theme['components'][C$1]>;
|
|
185
|
+
type ThemeComponentParts<C$1 extends ComponentNames> = keyof ThemeComponent<C$1>;
|
|
183
186
|
//#endregion
|
|
184
187
|
//#region src/hooks/useClassNames.d.ts
|
|
185
188
|
interface ComponentContextProps {
|
|
@@ -187,14 +190,14 @@ interface ComponentContextProps {
|
|
|
187
190
|
variant?: string;
|
|
188
191
|
[key: string]: any;
|
|
189
192
|
}
|
|
190
|
-
interface UseClassNamesProps<C extends ComponentNames> {
|
|
191
|
-
component: C;
|
|
193
|
+
interface UseClassNamesProps<C$1 extends ComponentNames> {
|
|
194
|
+
component: C$1;
|
|
192
195
|
variant?: string;
|
|
193
196
|
size?: string;
|
|
194
|
-
className?: ThemeComponent<C> extends ((...args: any) => any) ? string : { [slot in keyof ThemeComponent<C>]?: string };
|
|
197
|
+
className?: ThemeComponent<C$1> extends ((...args: any) => any) ? string : { [slot in keyof ThemeComponent<C$1>]?: string };
|
|
195
198
|
context?: Context<ComponentContextProps>;
|
|
196
199
|
}
|
|
197
|
-
type ComponentClassNames<C extends ComponentNames> = ThemeComponent<C> extends ((...args: any) => any) ? string : { [slot in keyof ThemeComponent<C>]: string };
|
|
200
|
+
type ComponentClassNames<C$1 extends ComponentNames> = ThemeComponent<C$1> extends ((...args: any) => any) ? string : { [slot in keyof ThemeComponent<C$1>]: string };
|
|
198
201
|
declare const useClassNames: <C extends ComponentNames>({
|
|
199
202
|
component,
|
|
200
203
|
className,
|
|
@@ -225,11 +228,11 @@ declare const useStateProps: (states: UseStateProps) => StateAttrProps;
|
|
|
225
228
|
//#endregion
|
|
226
229
|
//#region src/hooks/useTheme.d.ts
|
|
227
230
|
declare const useTheme: () => Theme;
|
|
228
|
-
interface ThemeProviderProps<T extends Theme> {
|
|
231
|
+
interface ThemeProviderProps<T$1 extends Theme> {
|
|
229
232
|
/**
|
|
230
233
|
* The theme that should be used within the provider context.
|
|
231
234
|
*/
|
|
232
|
-
theme: T;
|
|
235
|
+
theme: T$1;
|
|
233
236
|
/**
|
|
234
237
|
* The children of the component.
|
|
235
238
|
*/
|
|
@@ -239,11 +242,11 @@ interface ThemeProviderProps<T extends Theme> {
|
|
|
239
242
|
*/
|
|
240
243
|
className?: string;
|
|
241
244
|
}
|
|
242
|
-
declare function ThemeProvider<T extends Theme>({
|
|
245
|
+
declare function ThemeProvider<T$1 extends Theme>({
|
|
243
246
|
theme,
|
|
244
247
|
children,
|
|
245
248
|
className
|
|
246
|
-
}: ThemeProviderProps<T>):
|
|
249
|
+
}: ThemeProviderProps<T$1>): react_jsx_runtime0.JSX.Element;
|
|
247
250
|
//#endregion
|
|
248
251
|
//#region src/hooks/useSmallScreen.d.ts
|
|
249
252
|
declare const useSmallScreen: () => boolean;
|
|
@@ -252,7 +255,7 @@ declare const useSmallScreen: () => boolean;
|
|
|
252
255
|
type StylesProps = { [K in keyof Theme['components']]: Partial<Theme['components'][K]> };
|
|
253
256
|
declare const extendTheme: (newStyles: StylesProps, theme: Theme) => {
|
|
254
257
|
components: {
|
|
255
|
-
Accordion?: Record<"container" | "item" | "header" | "content" | "icon", ComponentStyleFunction<string, string>>;
|
|
258
|
+
Accordion?: Record<"container" | "item" | "header" | "panel" | "content" | "icon", ComponentStyleFunction<string, string>>;
|
|
256
259
|
Badge?: ComponentStyleFunction<string, string>;
|
|
257
260
|
Breadcrumbs?: Record<"container" | "item" | "link" | "current", ComponentStyleFunction<string, string>>;
|
|
258
261
|
Button?: ComponentStyleFunction<string, string>;
|
|
@@ -272,7 +275,7 @@ declare const extendTheme: (newStyles: StylesProps, theme: Theme) => {
|
|
|
272
275
|
Checkbox?: Record<"container" | "label" | "checkbox" | "group", ComponentStyleFunction<string, string>>;
|
|
273
276
|
Switch?: Record<"container" | "track" | "thumb", ComponentStyleFunction<string, string>>;
|
|
274
277
|
Input?: Record<"input" | "icon" | "action", ComponentStyleFunction<string, string>>;
|
|
275
|
-
Label?:
|
|
278
|
+
Label?: ComponentStyleFunction<string, string>;
|
|
276
279
|
List?: Record<"ol" | "ul" | "item", ComponentStyleFunction<string, string>>;
|
|
277
280
|
Link?: ComponentStyleFunction<string, string>;
|
|
278
281
|
ListBox?: Record<"container" | "list" | "item" | "section" | "header", ComponentStyleFunction<string, string>>;
|
|
@@ -280,7 +283,7 @@ declare const extendTheme: (newStyles: StylesProps, theme: Theme) => {
|
|
|
280
283
|
Modal?: ComponentStyleFunction<string, string>;
|
|
281
284
|
MultiSelect?: Record<"container" | "closeButton" | "field" | "input" | "icon" | "listContainer" | "list" | "option" | "tag" | "valueContainer", ComponentStyleFunction<string, string>>;
|
|
282
285
|
Pagination?: Record<"container" | "navigationButton" | "pageButton" | "icon" | "ellipsis", ComponentStyleFunction<string, string>>;
|
|
283
|
-
|
|
286
|
+
ProgressCircle?: Record<"container" | "loader" | "label", ComponentStyleFunction<string, string>>;
|
|
284
287
|
Radio?: Record<"container" | "label" | "radio" | "group", ComponentStyleFunction<string, string>>;
|
|
285
288
|
Slider?: Record<"container" | "track" | "thumb" | "output" | "selectedTrack", ComponentStyleFunction<string, string>>;
|
|
286
289
|
Select?: Record<"select" | "icon", ComponentStyleFunction<string, string>>;
|
|
@@ -297,7 +300,8 @@ declare const extendTheme: (newStyles: StylesProps, theme: Theme) => {
|
|
|
297
300
|
Calendar?: Record<"calendar" | "calendarListboxButton" | "calendarCell" | "calendarControllers" | "calendarHeader" | "calendarGrid" | "select", ComponentStyleFunction<string, string>>;
|
|
298
301
|
DatePicker?: ComponentStyleFunction<string, string>;
|
|
299
302
|
ComboBox?: ComponentStyleFunction<string, string>;
|
|
300
|
-
|
|
303
|
+
Loader?: Record<"container" | "loader" | "label", ComponentStyleFunction<string, string>>;
|
|
304
|
+
FileField?: Record<"container" | "dropZone" | "dropZoneContent" | "dropZoneLabel" | "item" | "itemLabel" | "itemDescription", ComponentStyleFunction<string, string>>;
|
|
301
305
|
};
|
|
302
306
|
name: string;
|
|
303
307
|
screens?: {
|
package/dist/index.js
CHANGED
|
@@ -27,6 +27,8 @@ let class_variance_authority = require("class-variance-authority");
|
|
|
27
27
|
class_variance_authority = __toESM(class_variance_authority);
|
|
28
28
|
let tailwind_merge = require("tailwind-merge");
|
|
29
29
|
tailwind_merge = __toESM(tailwind_merge);
|
|
30
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
31
|
+
react_jsx_runtime = __toESM(react_jsx_runtime);
|
|
30
32
|
let __react_aria_i18n = require("@react-aria/i18n");
|
|
31
33
|
__react_aria_i18n = __toESM(__react_aria_i18n);
|
|
32
34
|
let react_fast_compare = require("react-fast-compare");
|
|
@@ -81,28 +83,35 @@ const ensureCssVar = (val, prefix) => isValidCssCustomPropertyName(val) ? `var(-
|
|
|
81
83
|
//#endregion
|
|
82
84
|
//#region src/components/SVG/SVG.tsx
|
|
83
85
|
const SVG = (0, react.forwardRef)(({ size = 24, children, className, color,...props }, ref) => {
|
|
84
|
-
return /* @__PURE__ */
|
|
86
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
|
|
85
87
|
...props,
|
|
86
88
|
ref,
|
|
87
89
|
width: `${props.width || size}px`,
|
|
88
90
|
height: `${props.height || size}px`,
|
|
89
91
|
className: cn("flex-none fill-current", className),
|
|
90
|
-
style: { color: color && ensureCssVar(color, "color") }
|
|
91
|
-
|
|
92
|
+
style: { color: color && ensureCssVar(color, "color") },
|
|
93
|
+
children
|
|
94
|
+
});
|
|
92
95
|
});
|
|
93
96
|
|
|
94
97
|
//#endregion
|
|
95
98
|
//#region src/components/Formatters/DateFormat.tsx
|
|
96
99
|
const DateFormat = ({ value, tabular,...props }) => {
|
|
97
100
|
const formatter = (0, __react_aria_i18n.useDateFormatter)({ ...props });
|
|
98
|
-
return /* @__PURE__ */
|
|
101
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
102
|
+
className: tabular ? "tabular-nums" : "",
|
|
103
|
+
children: Array.isArray(value) ? formatter.formatRange(value[0], value[1]) : formatter.format(value)
|
|
104
|
+
});
|
|
99
105
|
};
|
|
100
106
|
|
|
101
107
|
//#endregion
|
|
102
108
|
//#region src/components/Formatters/NumericFormat.tsx
|
|
103
109
|
const NumericFormat = ({ value, tabular = true,...props }) => {
|
|
104
110
|
const formatter = (0, __react_aria_i18n.useNumberFormatter)({ ...props });
|
|
105
|
-
return /* @__PURE__ */
|
|
111
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
112
|
+
className: tabular ? "tabular-nums" : void 0,
|
|
113
|
+
children: Array.isArray(value) ? formatter.formatRange(value[0], value[1]) : formatter.format(value)
|
|
114
|
+
});
|
|
106
115
|
};
|
|
107
116
|
|
|
108
117
|
//#endregion
|
|
@@ -126,7 +135,13 @@ const useTheme = () => {
|
|
|
126
135
|
return (0, react.useContext)(InternalContext);
|
|
127
136
|
};
|
|
128
137
|
function ThemeProvider({ theme, children, className }) {
|
|
129
|
-
return /* @__PURE__ */
|
|
138
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InternalContext.Provider, {
|
|
139
|
+
value: theme,
|
|
140
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
141
|
+
className,
|
|
142
|
+
children
|
|
143
|
+
})
|
|
144
|
+
});
|
|
130
145
|
}
|
|
131
146
|
|
|
132
147
|
//#endregion
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { createContext, forwardRef, useCallback, useContext, useEffect, useRef, useState } from "react";
|
|
2
2
|
import { cva as cva$1, cx } from "class-variance-authority";
|
|
3
3
|
import { twMerge } from "tailwind-merge";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
5
|
import { useDateFormatter, useNumberFormatter } from "@react-aria/i18n";
|
|
5
6
|
import isEqual from "react-fast-compare";
|
|
6
7
|
|
|
@@ -53,28 +54,35 @@ const ensureCssVar = (val, prefix) => isValidCssCustomPropertyName(val) ? `var(-
|
|
|
53
54
|
//#endregion
|
|
54
55
|
//#region src/components/SVG/SVG.tsx
|
|
55
56
|
const SVG = forwardRef(({ size = 24, children, className, color,...props }, ref) => {
|
|
56
|
-
return /* @__PURE__ */
|
|
57
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
57
58
|
...props,
|
|
58
59
|
ref,
|
|
59
60
|
width: `${props.width || size}px`,
|
|
60
61
|
height: `${props.height || size}px`,
|
|
61
62
|
className: cn("flex-none fill-current", className),
|
|
62
|
-
style: { color: color && ensureCssVar(color, "color") }
|
|
63
|
-
|
|
63
|
+
style: { color: color && ensureCssVar(color, "color") },
|
|
64
|
+
children
|
|
65
|
+
});
|
|
64
66
|
});
|
|
65
67
|
|
|
66
68
|
//#endregion
|
|
67
69
|
//#region src/components/Formatters/DateFormat.tsx
|
|
68
70
|
const DateFormat = ({ value, tabular,...props }) => {
|
|
69
71
|
const formatter = useDateFormatter({ ...props });
|
|
70
|
-
return /* @__PURE__ */
|
|
72
|
+
return /* @__PURE__ */ jsx("span", {
|
|
73
|
+
className: tabular ? "tabular-nums" : "",
|
|
74
|
+
children: Array.isArray(value) ? formatter.formatRange(value[0], value[1]) : formatter.format(value)
|
|
75
|
+
});
|
|
71
76
|
};
|
|
72
77
|
|
|
73
78
|
//#endregion
|
|
74
79
|
//#region src/components/Formatters/NumericFormat.tsx
|
|
75
80
|
const NumericFormat = ({ value, tabular = true,...props }) => {
|
|
76
81
|
const formatter = useNumberFormatter({ ...props });
|
|
77
|
-
return /* @__PURE__ */
|
|
82
|
+
return /* @__PURE__ */ jsx("span", {
|
|
83
|
+
className: tabular ? "tabular-nums" : void 0,
|
|
84
|
+
children: Array.isArray(value) ? formatter.formatRange(value[0], value[1]) : formatter.format(value)
|
|
85
|
+
});
|
|
78
86
|
};
|
|
79
87
|
|
|
80
88
|
//#endregion
|
|
@@ -98,7 +106,13 @@ const useTheme = () => {
|
|
|
98
106
|
return useContext(InternalContext);
|
|
99
107
|
};
|
|
100
108
|
function ThemeProvider({ theme, children, className }) {
|
|
101
|
-
return /* @__PURE__ */
|
|
109
|
+
return /* @__PURE__ */ jsx(InternalContext.Provider, {
|
|
110
|
+
value: theme,
|
|
111
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
112
|
+
className,
|
|
113
|
+
children
|
|
114
|
+
})
|
|
115
|
+
});
|
|
102
116
|
}
|
|
103
117
|
|
|
104
118
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marigold/system",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "16.0.1",
|
|
4
4
|
"description": "Marigold System Library",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"class-variance-authority": "0.7.1",
|
|
39
39
|
"deepmerge": "4.3.1",
|
|
40
40
|
"react-fast-compare": "3.2.2",
|
|
41
|
-
"tailwind-merge": "3.
|
|
41
|
+
"tailwind-merge": "3.4.0",
|
|
42
42
|
"@marigold/types": "1.4.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
@@ -46,13 +46,13 @@
|
|
|
46
46
|
"react-dom": ">=17.0.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@babel/core": "7.28.
|
|
49
|
+
"@babel/core": "7.28.5",
|
|
50
50
|
"@types/react": "19.2.2",
|
|
51
51
|
"postcss": "8.5.6",
|
|
52
52
|
"react": "19.2.0",
|
|
53
|
-
"tailwindcss": "4.1.
|
|
54
|
-
"tsdown": "0.15.
|
|
55
|
-
"@marigold/tsconfig": "0.4.
|
|
53
|
+
"tailwindcss": "4.1.17",
|
|
54
|
+
"tsdown": "0.15.9",
|
|
55
|
+
"@marigold/tsconfig": "0.4.2"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|
|
58
58
|
"build": "tsdown src/index.ts",
|