@marigold/system 7.8.1 → 8.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 +120 -53
- package/dist/index.d.ts +120 -53
- package/dist/index.js +6 -12
- package/dist/index.mjs +6 -12
- package/package.json +8 -8
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import React__default, { ReactNode } from 'react';
|
|
1
|
+
import React$1, { ReactNode } from 'react';
|
|
3
2
|
import { HtmlProps, KebabCase } from '@marigold/types';
|
|
4
3
|
import { DateFormatterOptions } from '@react-aria/i18n';
|
|
5
4
|
import { StringToBoolean, ClassProp } from 'class-variance-authority/dist/types';
|
|
@@ -9,21 +8,20 @@ interface SVGProps extends Omit<HtmlProps<'svg'>, 'fill' | 'style'> {
|
|
|
9
8
|
size?: number | string | number[] | string[];
|
|
10
9
|
className?: string;
|
|
11
10
|
}
|
|
12
|
-
declare const SVG:
|
|
11
|
+
declare const SVG: React$1.ForwardRefExoticComponent<SVGProps & React$1.RefAttributes<SVGSVGElement>>;
|
|
13
12
|
|
|
14
13
|
interface DateFormatProps extends DateFormatterOptions {
|
|
15
14
|
value: Date;
|
|
16
15
|
tabular?: boolean;
|
|
17
16
|
}
|
|
18
|
-
declare const DateFormat: ({ value, tabular, ...props }: DateFormatProps) =>
|
|
17
|
+
declare const DateFormat: ({ value, tabular, ...props }: DateFormatProps) => React$1.JSX.Element;
|
|
19
18
|
|
|
20
|
-
interface NumericFormatProps extends
|
|
19
|
+
interface NumericFormatProps extends Intl.NumberFormatOptions {
|
|
21
20
|
value: number | bigint;
|
|
22
21
|
numberingSystem?: string;
|
|
23
22
|
tabular?: boolean;
|
|
24
|
-
styleFormat?: string;
|
|
25
23
|
}
|
|
26
|
-
declare const NumericFormat: ({ value,
|
|
24
|
+
declare const NumericFormat: ({ value, tabular, ...props }: NumericFormatProps) => React$1.JSX.Element;
|
|
27
25
|
|
|
28
26
|
type ConfigSchema = Record<string, Record<string, ClassValue>>;
|
|
29
27
|
type ConfigVariants<T extends ConfigSchema> = {
|
|
@@ -120,7 +118,7 @@ type Theme = {
|
|
|
120
118
|
Slider?: Record<'container' | 'track' | 'thumb' | 'output', ComponentStyleFunction<string, string>>;
|
|
121
119
|
Select?: Record<'select' | 'icon', ComponentStyleFunction<string, string>>;
|
|
122
120
|
NumberField?: Record<'group' | 'stepper' | 'input', ComponentStyleFunction<string, string>>;
|
|
123
|
-
|
|
121
|
+
SectionMessage?: Record<'container' | 'icon' | 'title' | 'content', ComponentStyleFunction<string, string>>;
|
|
124
122
|
Table?: Record<'table' | 'header' | 'row' | 'cell', ComponentStyleFunction<string, string>>;
|
|
125
123
|
Tag?: Record<'tag' | 'listItems' | 'closeButton', ComponentStyleFunction<string, string>>;
|
|
126
124
|
Text?: ComponentStyleFunction<string, string>;
|
|
@@ -147,7 +145,7 @@ interface UseClassNamesProps<C extends ComponentNames> {
|
|
|
147
145
|
type ComponentClassNames<C extends ComponentNames> = ThemeComponent<C> extends (...args: any) => any ? string : {
|
|
148
146
|
[slot in keyof ThemeComponent<C>]: string;
|
|
149
147
|
};
|
|
150
|
-
declare const useClassNames: <C extends
|
|
148
|
+
declare const useClassNames: <C extends ComponentNames>({ component, className, variant, size, }: UseClassNamesProps<C>) => ComponentClassNames<C>;
|
|
151
149
|
|
|
152
150
|
/**
|
|
153
151
|
* Hook that can be used to return values based on the current screen size,
|
|
@@ -173,11 +171,20 @@ declare const useStateProps: (states: UseStateProps) => StateAttrProps;
|
|
|
173
171
|
|
|
174
172
|
declare const useTheme: () => Theme;
|
|
175
173
|
interface ThemeProviderProps<T extends Theme> {
|
|
174
|
+
/**
|
|
175
|
+
* The theme that should be used within the provider context.
|
|
176
|
+
*/
|
|
176
177
|
theme: T;
|
|
178
|
+
/**
|
|
179
|
+
* The children of the component.
|
|
180
|
+
*/
|
|
177
181
|
children: ReactNode;
|
|
182
|
+
/**
|
|
183
|
+
* Additional class names to apply to the root element of the provider.
|
|
184
|
+
*/
|
|
178
185
|
className?: string;
|
|
179
186
|
}
|
|
180
|
-
declare function ThemeProvider<T extends Theme>({ theme, children, className, }: ThemeProviderProps<T>):
|
|
187
|
+
declare function ThemeProvider<T extends Theme>({ theme, children, className, }: ThemeProviderProps<T>): React$1.JSX.Element;
|
|
181
188
|
|
|
182
189
|
declare const useSmallScreen: () => boolean;
|
|
183
190
|
|
|
@@ -186,53 +193,53 @@ type StylesProps = {
|
|
|
186
193
|
};
|
|
187
194
|
declare const extendTheme: (newStyles: StylesProps, theme: Theme) => {
|
|
188
195
|
components: {
|
|
189
|
-
Accordion?: Record<"button" | "item", ComponentStyleFunction<string, string
|
|
190
|
-
Badge?: ComponentStyleFunction<string, string
|
|
191
|
-
Body?: ComponentStyleFunction<string, string
|
|
192
|
-
Button?: ComponentStyleFunction<string, string
|
|
193
|
-
Card?: ComponentStyleFunction<string, string
|
|
194
|
-
DateField?: Record<"segment" | "field" | "action", ComponentStyleFunction<string, string
|
|
195
|
-
Dialog?: Record<"closeButton" | "container", ComponentStyleFunction<string, string
|
|
196
|
-
Divider?: ComponentStyleFunction<string, string
|
|
197
|
-
Field?: ComponentStyleFunction<string, string
|
|
198
|
-
Footer?: ComponentStyleFunction<string, string
|
|
199
|
-
Header?: ComponentStyleFunction<string, string
|
|
200
|
-
Headline?: ComponentStyleFunction<string, string
|
|
201
|
-
Popover?: ComponentStyleFunction<string, string
|
|
202
|
-
HelpText?: Record<"container" | "icon", ComponentStyleFunction<string, string
|
|
203
|
-
Image?: ComponentStyleFunction<string, string
|
|
204
|
-
Checkbox?: Record<"
|
|
205
|
-
Switch?: Record<"
|
|
206
|
-
Input?: Record<"input" | "
|
|
207
|
-
Label?: Record<"container" | "indicator", ComponentStyleFunction<string, string
|
|
208
|
-
List?: Record<"ol" | "ul" | "item", ComponentStyleFunction<string, string
|
|
209
|
-
Link?: ComponentStyleFunction<string, string
|
|
210
|
-
ListBox?: Record<"
|
|
211
|
-
Menu?: Record<"
|
|
212
|
-
Radio?: Record<"
|
|
213
|
-
Slider?: Record<"
|
|
214
|
-
Select?: Record<"select" | "icon", ComponentStyleFunction<string, string
|
|
215
|
-
NumberField?: Record<"
|
|
216
|
-
|
|
217
|
-
Table?: Record<"
|
|
218
|
-
Tag?: Record<"
|
|
219
|
-
Text?: ComponentStyleFunction<string, string
|
|
220
|
-
TextArea?: ComponentStyleFunction<string, string
|
|
221
|
-
Tooltip?: Record<"container" | "arrow", ComponentStyleFunction<string, string
|
|
222
|
-
Tabs?: Record<"container" | "tabsList" | "tabpanel" | "tab", ComponentStyleFunction<string, string
|
|
223
|
-
Underlay?: ComponentStyleFunction<string, string
|
|
224
|
-
Calendar?: Record<"calendar" | "calendarCell" | "calendarControllers" | "calendarHeader" | "calendarGrid", ComponentStyleFunction<string, string
|
|
225
|
-
DatePicker?: Record<"
|
|
226
|
-
ComboBox?: ComponentStyleFunction<string, string
|
|
196
|
+
Accordion?: Record<"button" | "item", ComponentStyleFunction<string, string>>;
|
|
197
|
+
Badge?: ComponentStyleFunction<string, string>;
|
|
198
|
+
Body?: ComponentStyleFunction<string, string>;
|
|
199
|
+
Button?: ComponentStyleFunction<string, string>;
|
|
200
|
+
Card?: ComponentStyleFunction<string, string>;
|
|
201
|
+
DateField?: Record<"segment" | "field" | "action", ComponentStyleFunction<string, string>>;
|
|
202
|
+
Dialog?: Record<"closeButton" | "container", ComponentStyleFunction<string, string>>;
|
|
203
|
+
Divider?: ComponentStyleFunction<string, string>;
|
|
204
|
+
Field?: ComponentStyleFunction<string, string>;
|
|
205
|
+
Footer?: ComponentStyleFunction<string, string>;
|
|
206
|
+
Header?: ComponentStyleFunction<string, string>;
|
|
207
|
+
Headline?: ComponentStyleFunction<string, string>;
|
|
208
|
+
Popover?: ComponentStyleFunction<string, string>;
|
|
209
|
+
HelpText?: Record<"container" | "icon", ComponentStyleFunction<string, string>>;
|
|
210
|
+
Image?: ComponentStyleFunction<string, string>;
|
|
211
|
+
Checkbox?: Record<"container" | "label" | "checkbox" | "group", ComponentStyleFunction<string, string>>;
|
|
212
|
+
Switch?: Record<"container" | "track" | "thumb", ComponentStyleFunction<string, string>>;
|
|
213
|
+
Input?: Record<"input" | "icon" | "action", ComponentStyleFunction<string, string>>;
|
|
214
|
+
Label?: Record<"container" | "indicator", ComponentStyleFunction<string, string>>;
|
|
215
|
+
List?: Record<"ol" | "ul" | "item", ComponentStyleFunction<string, string>>;
|
|
216
|
+
Link?: ComponentStyleFunction<string, string>;
|
|
217
|
+
ListBox?: Record<"container" | "list" | "option" | "section" | "sectionTitle", ComponentStyleFunction<string, string>>;
|
|
218
|
+
Menu?: Record<"container" | "section" | "item", ComponentStyleFunction<string, string>>;
|
|
219
|
+
Radio?: Record<"container" | "label" | "radio" | "group", ComponentStyleFunction<string, string>>;
|
|
220
|
+
Slider?: Record<"container" | "track" | "thumb" | "output", ComponentStyleFunction<string, string>>;
|
|
221
|
+
Select?: Record<"select" | "icon", ComponentStyleFunction<string, string>>;
|
|
222
|
+
NumberField?: Record<"group" | "stepper" | "input", ComponentStyleFunction<string, string>>;
|
|
223
|
+
SectionMessage?: Record<"container" | "icon" | "title" | "content", ComponentStyleFunction<string, string>>;
|
|
224
|
+
Table?: Record<"table" | "header" | "row" | "cell", ComponentStyleFunction<string, string>>;
|
|
225
|
+
Tag?: Record<"tag" | "listItems" | "closeButton", ComponentStyleFunction<string, string>>;
|
|
226
|
+
Text?: ComponentStyleFunction<string, string>;
|
|
227
|
+
TextArea?: ComponentStyleFunction<string, string>;
|
|
228
|
+
Tooltip?: Record<"container" | "arrow", ComponentStyleFunction<string, string>>;
|
|
229
|
+
Tabs?: Record<"container" | "tabsList" | "tabpanel" | "tab", ComponentStyleFunction<string, string>>;
|
|
230
|
+
Underlay?: ComponentStyleFunction<string, string>;
|
|
231
|
+
Calendar?: Record<"calendar" | "calendarCell" | "calendarControllers" | "calendarHeader" | "calendarGrid", ComponentStyleFunction<string, string>>;
|
|
232
|
+
DatePicker?: Record<"container" | "button", ComponentStyleFunction<string, string>>;
|
|
233
|
+
ComboBox?: ComponentStyleFunction<string, string>;
|
|
227
234
|
};
|
|
228
235
|
name: string;
|
|
229
236
|
screens?: {
|
|
230
237
|
[key: string]: string;
|
|
231
|
-
}
|
|
232
|
-
colors?: NestedStringObject
|
|
233
|
-
shadow?: NestedStringObject
|
|
234
|
-
height?: NestedStringObject
|
|
235
|
-
root?: ComponentStyleFunction
|
|
238
|
+
};
|
|
239
|
+
colors?: NestedStringObject;
|
|
240
|
+
shadow?: NestedStringObject;
|
|
241
|
+
height?: NestedStringObject;
|
|
242
|
+
root?: ComponentStyleFunction;
|
|
236
243
|
};
|
|
237
244
|
|
|
238
245
|
declare const defaultTheme: {
|
|
@@ -829,63 +836,123 @@ type AlignmentProp = {
|
|
|
829
836
|
};
|
|
830
837
|
};
|
|
831
838
|
type CursorProp = {
|
|
839
|
+
/**
|
|
840
|
+
* Set the cursor for the element.
|
|
841
|
+
*/
|
|
832
842
|
cursor?: keyof typeof cursorStyle;
|
|
833
843
|
};
|
|
834
844
|
type FontStyleProp = {
|
|
845
|
+
/**
|
|
846
|
+
* Set the font style for the text element.
|
|
847
|
+
*/
|
|
835
848
|
fontStyle?: keyof typeof textStyle;
|
|
836
849
|
};
|
|
837
850
|
type FontWeightProp = {
|
|
851
|
+
/**
|
|
852
|
+
* Set the font weight for the text element.
|
|
853
|
+
*/
|
|
838
854
|
weight?: keyof typeof fontWeight;
|
|
839
855
|
};
|
|
840
856
|
type FontSizeProp = {
|
|
857
|
+
/**
|
|
858
|
+
* Set the font size for the text element.
|
|
859
|
+
*/
|
|
841
860
|
fontSize?: keyof typeof textSize;
|
|
842
861
|
};
|
|
843
862
|
type GridColsAlignProp = {
|
|
863
|
+
/**
|
|
864
|
+
* Set the alignment of grid columns.
|
|
865
|
+
*/
|
|
844
866
|
align?: keyof typeof gridColsAlign;
|
|
845
867
|
};
|
|
846
868
|
type GridColumn = {
|
|
869
|
+
/**
|
|
870
|
+
* Set the alignment of a grid column.
|
|
871
|
+
*/
|
|
847
872
|
align?: keyof typeof gridColumn;
|
|
848
873
|
};
|
|
849
874
|
type GapSpaceProp = {
|
|
875
|
+
/**
|
|
876
|
+
* The space between the children.
|
|
877
|
+
*/
|
|
850
878
|
space?: keyof typeof gapSpace;
|
|
851
879
|
};
|
|
852
880
|
type ObjectFitProp = {
|
|
881
|
+
/**
|
|
882
|
+
* Set the object-fit property for the element.
|
|
883
|
+
*/
|
|
853
884
|
fit?: keyof typeof objectFit;
|
|
854
885
|
};
|
|
855
886
|
type ObjectPositionProp = {
|
|
887
|
+
/**
|
|
888
|
+
* Set the object-position property for the element.
|
|
889
|
+
*/
|
|
856
890
|
position?: keyof typeof objectPosition;
|
|
857
891
|
};
|
|
858
892
|
type PaddingSpaceProp = {
|
|
893
|
+
/**
|
|
894
|
+
* Set the padding space for the element.
|
|
895
|
+
*/
|
|
859
896
|
space?: keyof typeof paddingSpace;
|
|
860
897
|
};
|
|
861
898
|
type PaddingSpacePropX = {
|
|
899
|
+
/**
|
|
900
|
+
* Set the horizontal padding space for the element.
|
|
901
|
+
*/
|
|
862
902
|
spaceX?: keyof typeof paddingSpaceX;
|
|
863
903
|
};
|
|
864
904
|
type PaddingSpacePropY = {
|
|
905
|
+
/**
|
|
906
|
+
* Set the vertical padding space for the element.
|
|
907
|
+
*/
|
|
865
908
|
spaceY?: keyof typeof paddingSpaceY;
|
|
866
909
|
};
|
|
867
910
|
type PaddingRightProp = {
|
|
911
|
+
/**
|
|
912
|
+
* Set the right padding for the element.
|
|
913
|
+
*/
|
|
868
914
|
pr?: keyof typeof paddingRight;
|
|
869
915
|
};
|
|
870
916
|
type PaddingLeftProp = {
|
|
917
|
+
/**
|
|
918
|
+
* Set the left padding for the element.
|
|
919
|
+
*/
|
|
871
920
|
pl?: keyof typeof paddingLeft;
|
|
872
921
|
};
|
|
873
922
|
type PaddingTopProp = {
|
|
923
|
+
/**
|
|
924
|
+
* Set the top padding for the element.
|
|
925
|
+
*/
|
|
874
926
|
pt?: keyof typeof paddingTop;
|
|
875
927
|
};
|
|
876
928
|
type PaddingBottomProp = {
|
|
929
|
+
/**
|
|
930
|
+
* Set the bottom padding for the element.
|
|
931
|
+
*/
|
|
877
932
|
pb?: keyof typeof paddingBottom;
|
|
878
933
|
};
|
|
879
934
|
type PlaceItemsProp = {
|
|
935
|
+
/**
|
|
936
|
+
* Set the alignment of place-items property for the element.
|
|
937
|
+
*/
|
|
880
938
|
align?: keyof typeof placeItems;
|
|
881
939
|
};
|
|
882
940
|
type TextAlignProp = {
|
|
941
|
+
/**
|
|
942
|
+
* Set the text alignment for the element.
|
|
943
|
+
*/
|
|
883
944
|
align?: keyof typeof textAlign;
|
|
884
945
|
};
|
|
885
946
|
type WidthProp = {
|
|
947
|
+
/**
|
|
948
|
+
* Set the width of the element.
|
|
949
|
+
*/
|
|
886
950
|
width?: keyof typeof width;
|
|
887
951
|
};
|
|
888
952
|
type HeightProp = {
|
|
953
|
+
/**
|
|
954
|
+
* Set the height of the element.
|
|
955
|
+
*/
|
|
889
956
|
height?: keyof typeof height;
|
|
890
957
|
};
|
|
891
958
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import React__default, { ReactNode } from 'react';
|
|
1
|
+
import React$1, { ReactNode } from 'react';
|
|
3
2
|
import { HtmlProps, KebabCase } from '@marigold/types';
|
|
4
3
|
import { DateFormatterOptions } from '@react-aria/i18n';
|
|
5
4
|
import { StringToBoolean, ClassProp } from 'class-variance-authority/dist/types';
|
|
@@ -9,21 +8,20 @@ interface SVGProps extends Omit<HtmlProps<'svg'>, 'fill' | 'style'> {
|
|
|
9
8
|
size?: number | string | number[] | string[];
|
|
10
9
|
className?: string;
|
|
11
10
|
}
|
|
12
|
-
declare const SVG:
|
|
11
|
+
declare const SVG: React$1.ForwardRefExoticComponent<SVGProps & React$1.RefAttributes<SVGSVGElement>>;
|
|
13
12
|
|
|
14
13
|
interface DateFormatProps extends DateFormatterOptions {
|
|
15
14
|
value: Date;
|
|
16
15
|
tabular?: boolean;
|
|
17
16
|
}
|
|
18
|
-
declare const DateFormat: ({ value, tabular, ...props }: DateFormatProps) =>
|
|
17
|
+
declare const DateFormat: ({ value, tabular, ...props }: DateFormatProps) => React$1.JSX.Element;
|
|
19
18
|
|
|
20
|
-
interface NumericFormatProps extends
|
|
19
|
+
interface NumericFormatProps extends Intl.NumberFormatOptions {
|
|
21
20
|
value: number | bigint;
|
|
22
21
|
numberingSystem?: string;
|
|
23
22
|
tabular?: boolean;
|
|
24
|
-
styleFormat?: string;
|
|
25
23
|
}
|
|
26
|
-
declare const NumericFormat: ({ value,
|
|
24
|
+
declare const NumericFormat: ({ value, tabular, ...props }: NumericFormatProps) => React$1.JSX.Element;
|
|
27
25
|
|
|
28
26
|
type ConfigSchema = Record<string, Record<string, ClassValue>>;
|
|
29
27
|
type ConfigVariants<T extends ConfigSchema> = {
|
|
@@ -120,7 +118,7 @@ type Theme = {
|
|
|
120
118
|
Slider?: Record<'container' | 'track' | 'thumb' | 'output', ComponentStyleFunction<string, string>>;
|
|
121
119
|
Select?: Record<'select' | 'icon', ComponentStyleFunction<string, string>>;
|
|
122
120
|
NumberField?: Record<'group' | 'stepper' | 'input', ComponentStyleFunction<string, string>>;
|
|
123
|
-
|
|
121
|
+
SectionMessage?: Record<'container' | 'icon' | 'title' | 'content', ComponentStyleFunction<string, string>>;
|
|
124
122
|
Table?: Record<'table' | 'header' | 'row' | 'cell', ComponentStyleFunction<string, string>>;
|
|
125
123
|
Tag?: Record<'tag' | 'listItems' | 'closeButton', ComponentStyleFunction<string, string>>;
|
|
126
124
|
Text?: ComponentStyleFunction<string, string>;
|
|
@@ -147,7 +145,7 @@ interface UseClassNamesProps<C extends ComponentNames> {
|
|
|
147
145
|
type ComponentClassNames<C extends ComponentNames> = ThemeComponent<C> extends (...args: any) => any ? string : {
|
|
148
146
|
[slot in keyof ThemeComponent<C>]: string;
|
|
149
147
|
};
|
|
150
|
-
declare const useClassNames: <C extends
|
|
148
|
+
declare const useClassNames: <C extends ComponentNames>({ component, className, variant, size, }: UseClassNamesProps<C>) => ComponentClassNames<C>;
|
|
151
149
|
|
|
152
150
|
/**
|
|
153
151
|
* Hook that can be used to return values based on the current screen size,
|
|
@@ -173,11 +171,20 @@ declare const useStateProps: (states: UseStateProps) => StateAttrProps;
|
|
|
173
171
|
|
|
174
172
|
declare const useTheme: () => Theme;
|
|
175
173
|
interface ThemeProviderProps<T extends Theme> {
|
|
174
|
+
/**
|
|
175
|
+
* The theme that should be used within the provider context.
|
|
176
|
+
*/
|
|
176
177
|
theme: T;
|
|
178
|
+
/**
|
|
179
|
+
* The children of the component.
|
|
180
|
+
*/
|
|
177
181
|
children: ReactNode;
|
|
182
|
+
/**
|
|
183
|
+
* Additional class names to apply to the root element of the provider.
|
|
184
|
+
*/
|
|
178
185
|
className?: string;
|
|
179
186
|
}
|
|
180
|
-
declare function ThemeProvider<T extends Theme>({ theme, children, className, }: ThemeProviderProps<T>):
|
|
187
|
+
declare function ThemeProvider<T extends Theme>({ theme, children, className, }: ThemeProviderProps<T>): React$1.JSX.Element;
|
|
181
188
|
|
|
182
189
|
declare const useSmallScreen: () => boolean;
|
|
183
190
|
|
|
@@ -186,53 +193,53 @@ type StylesProps = {
|
|
|
186
193
|
};
|
|
187
194
|
declare const extendTheme: (newStyles: StylesProps, theme: Theme) => {
|
|
188
195
|
components: {
|
|
189
|
-
Accordion?: Record<"button" | "item", ComponentStyleFunction<string, string
|
|
190
|
-
Badge?: ComponentStyleFunction<string, string
|
|
191
|
-
Body?: ComponentStyleFunction<string, string
|
|
192
|
-
Button?: ComponentStyleFunction<string, string
|
|
193
|
-
Card?: ComponentStyleFunction<string, string
|
|
194
|
-
DateField?: Record<"segment" | "field" | "action", ComponentStyleFunction<string, string
|
|
195
|
-
Dialog?: Record<"closeButton" | "container", ComponentStyleFunction<string, string
|
|
196
|
-
Divider?: ComponentStyleFunction<string, string
|
|
197
|
-
Field?: ComponentStyleFunction<string, string
|
|
198
|
-
Footer?: ComponentStyleFunction<string, string
|
|
199
|
-
Header?: ComponentStyleFunction<string, string
|
|
200
|
-
Headline?: ComponentStyleFunction<string, string
|
|
201
|
-
Popover?: ComponentStyleFunction<string, string
|
|
202
|
-
HelpText?: Record<"container" | "icon", ComponentStyleFunction<string, string
|
|
203
|
-
Image?: ComponentStyleFunction<string, string
|
|
204
|
-
Checkbox?: Record<"
|
|
205
|
-
Switch?: Record<"
|
|
206
|
-
Input?: Record<"input" | "
|
|
207
|
-
Label?: Record<"container" | "indicator", ComponentStyleFunction<string, string
|
|
208
|
-
List?: Record<"ol" | "ul" | "item", ComponentStyleFunction<string, string
|
|
209
|
-
Link?: ComponentStyleFunction<string, string
|
|
210
|
-
ListBox?: Record<"
|
|
211
|
-
Menu?: Record<"
|
|
212
|
-
Radio?: Record<"
|
|
213
|
-
Slider?: Record<"
|
|
214
|
-
Select?: Record<"select" | "icon", ComponentStyleFunction<string, string
|
|
215
|
-
NumberField?: Record<"
|
|
216
|
-
|
|
217
|
-
Table?: Record<"
|
|
218
|
-
Tag?: Record<"
|
|
219
|
-
Text?: ComponentStyleFunction<string, string
|
|
220
|
-
TextArea?: ComponentStyleFunction<string, string
|
|
221
|
-
Tooltip?: Record<"container" | "arrow", ComponentStyleFunction<string, string
|
|
222
|
-
Tabs?: Record<"container" | "tabsList" | "tabpanel" | "tab", ComponentStyleFunction<string, string
|
|
223
|
-
Underlay?: ComponentStyleFunction<string, string
|
|
224
|
-
Calendar?: Record<"calendar" | "calendarCell" | "calendarControllers" | "calendarHeader" | "calendarGrid", ComponentStyleFunction<string, string
|
|
225
|
-
DatePicker?: Record<"
|
|
226
|
-
ComboBox?: ComponentStyleFunction<string, string
|
|
196
|
+
Accordion?: Record<"button" | "item", ComponentStyleFunction<string, string>>;
|
|
197
|
+
Badge?: ComponentStyleFunction<string, string>;
|
|
198
|
+
Body?: ComponentStyleFunction<string, string>;
|
|
199
|
+
Button?: ComponentStyleFunction<string, string>;
|
|
200
|
+
Card?: ComponentStyleFunction<string, string>;
|
|
201
|
+
DateField?: Record<"segment" | "field" | "action", ComponentStyleFunction<string, string>>;
|
|
202
|
+
Dialog?: Record<"closeButton" | "container", ComponentStyleFunction<string, string>>;
|
|
203
|
+
Divider?: ComponentStyleFunction<string, string>;
|
|
204
|
+
Field?: ComponentStyleFunction<string, string>;
|
|
205
|
+
Footer?: ComponentStyleFunction<string, string>;
|
|
206
|
+
Header?: ComponentStyleFunction<string, string>;
|
|
207
|
+
Headline?: ComponentStyleFunction<string, string>;
|
|
208
|
+
Popover?: ComponentStyleFunction<string, string>;
|
|
209
|
+
HelpText?: Record<"container" | "icon", ComponentStyleFunction<string, string>>;
|
|
210
|
+
Image?: ComponentStyleFunction<string, string>;
|
|
211
|
+
Checkbox?: Record<"container" | "label" | "checkbox" | "group", ComponentStyleFunction<string, string>>;
|
|
212
|
+
Switch?: Record<"container" | "track" | "thumb", ComponentStyleFunction<string, string>>;
|
|
213
|
+
Input?: Record<"input" | "icon" | "action", ComponentStyleFunction<string, string>>;
|
|
214
|
+
Label?: Record<"container" | "indicator", ComponentStyleFunction<string, string>>;
|
|
215
|
+
List?: Record<"ol" | "ul" | "item", ComponentStyleFunction<string, string>>;
|
|
216
|
+
Link?: ComponentStyleFunction<string, string>;
|
|
217
|
+
ListBox?: Record<"container" | "list" | "option" | "section" | "sectionTitle", ComponentStyleFunction<string, string>>;
|
|
218
|
+
Menu?: Record<"container" | "section" | "item", ComponentStyleFunction<string, string>>;
|
|
219
|
+
Radio?: Record<"container" | "label" | "radio" | "group", ComponentStyleFunction<string, string>>;
|
|
220
|
+
Slider?: Record<"container" | "track" | "thumb" | "output", ComponentStyleFunction<string, string>>;
|
|
221
|
+
Select?: Record<"select" | "icon", ComponentStyleFunction<string, string>>;
|
|
222
|
+
NumberField?: Record<"group" | "stepper" | "input", ComponentStyleFunction<string, string>>;
|
|
223
|
+
SectionMessage?: Record<"container" | "icon" | "title" | "content", ComponentStyleFunction<string, string>>;
|
|
224
|
+
Table?: Record<"table" | "header" | "row" | "cell", ComponentStyleFunction<string, string>>;
|
|
225
|
+
Tag?: Record<"tag" | "listItems" | "closeButton", ComponentStyleFunction<string, string>>;
|
|
226
|
+
Text?: ComponentStyleFunction<string, string>;
|
|
227
|
+
TextArea?: ComponentStyleFunction<string, string>;
|
|
228
|
+
Tooltip?: Record<"container" | "arrow", ComponentStyleFunction<string, string>>;
|
|
229
|
+
Tabs?: Record<"container" | "tabsList" | "tabpanel" | "tab", ComponentStyleFunction<string, string>>;
|
|
230
|
+
Underlay?: ComponentStyleFunction<string, string>;
|
|
231
|
+
Calendar?: Record<"calendar" | "calendarCell" | "calendarControllers" | "calendarHeader" | "calendarGrid", ComponentStyleFunction<string, string>>;
|
|
232
|
+
DatePicker?: Record<"container" | "button", ComponentStyleFunction<string, string>>;
|
|
233
|
+
ComboBox?: ComponentStyleFunction<string, string>;
|
|
227
234
|
};
|
|
228
235
|
name: string;
|
|
229
236
|
screens?: {
|
|
230
237
|
[key: string]: string;
|
|
231
|
-
}
|
|
232
|
-
colors?: NestedStringObject
|
|
233
|
-
shadow?: NestedStringObject
|
|
234
|
-
height?: NestedStringObject
|
|
235
|
-
root?: ComponentStyleFunction
|
|
238
|
+
};
|
|
239
|
+
colors?: NestedStringObject;
|
|
240
|
+
shadow?: NestedStringObject;
|
|
241
|
+
height?: NestedStringObject;
|
|
242
|
+
root?: ComponentStyleFunction;
|
|
236
243
|
};
|
|
237
244
|
|
|
238
245
|
declare const defaultTheme: {
|
|
@@ -829,63 +836,123 @@ type AlignmentProp = {
|
|
|
829
836
|
};
|
|
830
837
|
};
|
|
831
838
|
type CursorProp = {
|
|
839
|
+
/**
|
|
840
|
+
* Set the cursor for the element.
|
|
841
|
+
*/
|
|
832
842
|
cursor?: keyof typeof cursorStyle;
|
|
833
843
|
};
|
|
834
844
|
type FontStyleProp = {
|
|
845
|
+
/**
|
|
846
|
+
* Set the font style for the text element.
|
|
847
|
+
*/
|
|
835
848
|
fontStyle?: keyof typeof textStyle;
|
|
836
849
|
};
|
|
837
850
|
type FontWeightProp = {
|
|
851
|
+
/**
|
|
852
|
+
* Set the font weight for the text element.
|
|
853
|
+
*/
|
|
838
854
|
weight?: keyof typeof fontWeight;
|
|
839
855
|
};
|
|
840
856
|
type FontSizeProp = {
|
|
857
|
+
/**
|
|
858
|
+
* Set the font size for the text element.
|
|
859
|
+
*/
|
|
841
860
|
fontSize?: keyof typeof textSize;
|
|
842
861
|
};
|
|
843
862
|
type GridColsAlignProp = {
|
|
863
|
+
/**
|
|
864
|
+
* Set the alignment of grid columns.
|
|
865
|
+
*/
|
|
844
866
|
align?: keyof typeof gridColsAlign;
|
|
845
867
|
};
|
|
846
868
|
type GridColumn = {
|
|
869
|
+
/**
|
|
870
|
+
* Set the alignment of a grid column.
|
|
871
|
+
*/
|
|
847
872
|
align?: keyof typeof gridColumn;
|
|
848
873
|
};
|
|
849
874
|
type GapSpaceProp = {
|
|
875
|
+
/**
|
|
876
|
+
* The space between the children.
|
|
877
|
+
*/
|
|
850
878
|
space?: keyof typeof gapSpace;
|
|
851
879
|
};
|
|
852
880
|
type ObjectFitProp = {
|
|
881
|
+
/**
|
|
882
|
+
* Set the object-fit property for the element.
|
|
883
|
+
*/
|
|
853
884
|
fit?: keyof typeof objectFit;
|
|
854
885
|
};
|
|
855
886
|
type ObjectPositionProp = {
|
|
887
|
+
/**
|
|
888
|
+
* Set the object-position property for the element.
|
|
889
|
+
*/
|
|
856
890
|
position?: keyof typeof objectPosition;
|
|
857
891
|
};
|
|
858
892
|
type PaddingSpaceProp = {
|
|
893
|
+
/**
|
|
894
|
+
* Set the padding space for the element.
|
|
895
|
+
*/
|
|
859
896
|
space?: keyof typeof paddingSpace;
|
|
860
897
|
};
|
|
861
898
|
type PaddingSpacePropX = {
|
|
899
|
+
/**
|
|
900
|
+
* Set the horizontal padding space for the element.
|
|
901
|
+
*/
|
|
862
902
|
spaceX?: keyof typeof paddingSpaceX;
|
|
863
903
|
};
|
|
864
904
|
type PaddingSpacePropY = {
|
|
905
|
+
/**
|
|
906
|
+
* Set the vertical padding space for the element.
|
|
907
|
+
*/
|
|
865
908
|
spaceY?: keyof typeof paddingSpaceY;
|
|
866
909
|
};
|
|
867
910
|
type PaddingRightProp = {
|
|
911
|
+
/**
|
|
912
|
+
* Set the right padding for the element.
|
|
913
|
+
*/
|
|
868
914
|
pr?: keyof typeof paddingRight;
|
|
869
915
|
};
|
|
870
916
|
type PaddingLeftProp = {
|
|
917
|
+
/**
|
|
918
|
+
* Set the left padding for the element.
|
|
919
|
+
*/
|
|
871
920
|
pl?: keyof typeof paddingLeft;
|
|
872
921
|
};
|
|
873
922
|
type PaddingTopProp = {
|
|
923
|
+
/**
|
|
924
|
+
* Set the top padding for the element.
|
|
925
|
+
*/
|
|
874
926
|
pt?: keyof typeof paddingTop;
|
|
875
927
|
};
|
|
876
928
|
type PaddingBottomProp = {
|
|
929
|
+
/**
|
|
930
|
+
* Set the bottom padding for the element.
|
|
931
|
+
*/
|
|
877
932
|
pb?: keyof typeof paddingBottom;
|
|
878
933
|
};
|
|
879
934
|
type PlaceItemsProp = {
|
|
935
|
+
/**
|
|
936
|
+
* Set the alignment of place-items property for the element.
|
|
937
|
+
*/
|
|
880
938
|
align?: keyof typeof placeItems;
|
|
881
939
|
};
|
|
882
940
|
type TextAlignProp = {
|
|
941
|
+
/**
|
|
942
|
+
* Set the text alignment for the element.
|
|
943
|
+
*/
|
|
883
944
|
align?: keyof typeof textAlign;
|
|
884
945
|
};
|
|
885
946
|
type WidthProp = {
|
|
947
|
+
/**
|
|
948
|
+
* Set the width of the element.
|
|
949
|
+
*/
|
|
886
950
|
width?: keyof typeof width;
|
|
887
951
|
};
|
|
888
952
|
type HeightProp = {
|
|
953
|
+
/**
|
|
954
|
+
* Set the height of the element.
|
|
955
|
+
*/
|
|
889
956
|
height?: keyof typeof height;
|
|
890
957
|
};
|
|
891
958
|
|
package/dist/index.js
CHANGED
|
@@ -95,8 +95,7 @@ var get = (obj, path, fallback) => {
|
|
|
95
95
|
const key = path.split(".");
|
|
96
96
|
let result = obj;
|
|
97
97
|
for (let i = 0, length = key.length; i < length; i++) {
|
|
98
|
-
if (!result)
|
|
99
|
-
break;
|
|
98
|
+
if (!result) break;
|
|
100
99
|
result = result[key[i]];
|
|
101
100
|
}
|
|
102
101
|
return result === void 0 ? fallback : result;
|
|
@@ -193,8 +192,7 @@ var useResponsiveValue = (values, defaultIndex = 0) => {
|
|
|
193
192
|
}
|
|
194
193
|
const [index, setIndex] = (0, import_react2.useState)(defaultIndex);
|
|
195
194
|
(0, import_react2.useEffect)(() => {
|
|
196
|
-
if (typeof window == "undefined")
|
|
197
|
-
return;
|
|
195
|
+
if (typeof window == "undefined") return;
|
|
198
196
|
const getIndex = () => Object.values(screens).filter(
|
|
199
197
|
(breakpoint) => window.matchMedia(`screen and (min-width: ${breakpoint})`).matches
|
|
200
198
|
).length;
|
|
@@ -246,8 +244,7 @@ var useSmallScreen = () => {
|
|
|
246
244
|
}, []);
|
|
247
245
|
(0, import_react4.useEffect)(() => {
|
|
248
246
|
handleResize();
|
|
249
|
-
if (typeof window == "undefined")
|
|
250
|
-
return;
|
|
247
|
+
if (typeof window == "undefined") return;
|
|
251
248
|
window.addEventListener("resize", handleResize);
|
|
252
249
|
return () => window.removeEventListener("resize", handleResize);
|
|
253
250
|
}, [handleResize]);
|
|
@@ -260,8 +257,7 @@ var extendTheme = (newStyles, theme) => {
|
|
|
260
257
|
Object.keys(newStyles).forEach((component) => {
|
|
261
258
|
const componentStyles = newStyles[component];
|
|
262
259
|
const mergedComponentStyles = mergedStyles[component];
|
|
263
|
-
if (!mergedComponentStyles)
|
|
264
|
-
return mergedStyles;
|
|
260
|
+
if (!mergedComponentStyles) return mergedStyles;
|
|
265
261
|
if (typeof newStyles[component] !== "function") {
|
|
266
262
|
const mergeSlotStyles = Object.keys(componentStyles).reduce(
|
|
267
263
|
(acc, slot) => {
|
|
@@ -271,7 +267,7 @@ var extendTheme = (newStyles, theme) => {
|
|
|
271
267
|
var _a, _b;
|
|
272
268
|
acc2[variantItem] = {
|
|
273
269
|
...(_a = newSlot == null ? void 0 : newSlot.variants) == null ? void 0 : _a[variantItem],
|
|
274
|
-
...(_b = mergedSlot == null ? void 0 : mergedSlot.variants) == null ? void 0 : _b
|
|
270
|
+
...(_b = mergedSlot == null ? void 0 : mergedSlot.variants) == null ? void 0 : _b[variantItem]
|
|
275
271
|
};
|
|
276
272
|
return acc2;
|
|
277
273
|
}, {});
|
|
@@ -350,15 +346,13 @@ var import_react7 = __toESM(require("react"));
|
|
|
350
346
|
var import_i18n2 = require("@react-aria/i18n");
|
|
351
347
|
var NumericFormat = ({
|
|
352
348
|
value,
|
|
353
|
-
styleFormat,
|
|
354
349
|
tabular = true,
|
|
355
350
|
...props
|
|
356
351
|
}) => {
|
|
357
352
|
const numberFormatter = (0, import_i18n2.useNumberFormatter)({
|
|
358
|
-
style: styleFormat,
|
|
359
353
|
...props
|
|
360
354
|
});
|
|
361
|
-
return /* @__PURE__ */ import_react7.default.createElement("span", { className: tabular ? "tabular-nums" :
|
|
355
|
+
return /* @__PURE__ */ import_react7.default.createElement("span", { className: tabular ? "tabular-nums" : void 0 }, numberFormatter.format(value));
|
|
362
356
|
};
|
|
363
357
|
|
|
364
358
|
// src/style-props.tsx
|
package/dist/index.mjs
CHANGED
|
@@ -21,8 +21,7 @@ var get = (obj, path, fallback) => {
|
|
|
21
21
|
const key = path.split(".");
|
|
22
22
|
let result = obj;
|
|
23
23
|
for (let i = 0, length = key.length; i < length; i++) {
|
|
24
|
-
if (!result)
|
|
25
|
-
break;
|
|
24
|
+
if (!result) break;
|
|
26
25
|
result = result[key[i]];
|
|
27
26
|
}
|
|
28
27
|
return result === void 0 ? fallback : result;
|
|
@@ -119,8 +118,7 @@ var useResponsiveValue = (values, defaultIndex = 0) => {
|
|
|
119
118
|
}
|
|
120
119
|
const [index, setIndex] = useState(defaultIndex);
|
|
121
120
|
useEffect(() => {
|
|
122
|
-
if (typeof window == "undefined")
|
|
123
|
-
return;
|
|
121
|
+
if (typeof window == "undefined") return;
|
|
124
122
|
const getIndex = () => Object.values(screens).filter(
|
|
125
123
|
(breakpoint) => window.matchMedia(`screen and (min-width: ${breakpoint})`).matches
|
|
126
124
|
).length;
|
|
@@ -172,8 +170,7 @@ var useSmallScreen = () => {
|
|
|
172
170
|
}, []);
|
|
173
171
|
useEffect2(() => {
|
|
174
172
|
handleResize();
|
|
175
|
-
if (typeof window == "undefined")
|
|
176
|
-
return;
|
|
173
|
+
if (typeof window == "undefined") return;
|
|
177
174
|
window.addEventListener("resize", handleResize);
|
|
178
175
|
return () => window.removeEventListener("resize", handleResize);
|
|
179
176
|
}, [handleResize]);
|
|
@@ -186,8 +183,7 @@ var extendTheme = (newStyles, theme) => {
|
|
|
186
183
|
Object.keys(newStyles).forEach((component) => {
|
|
187
184
|
const componentStyles = newStyles[component];
|
|
188
185
|
const mergedComponentStyles = mergedStyles[component];
|
|
189
|
-
if (!mergedComponentStyles)
|
|
190
|
-
return mergedStyles;
|
|
186
|
+
if (!mergedComponentStyles) return mergedStyles;
|
|
191
187
|
if (typeof newStyles[component] !== "function") {
|
|
192
188
|
const mergeSlotStyles = Object.keys(componentStyles).reduce(
|
|
193
189
|
(acc, slot) => {
|
|
@@ -197,7 +193,7 @@ var extendTheme = (newStyles, theme) => {
|
|
|
197
193
|
var _a, _b;
|
|
198
194
|
acc2[variantItem] = {
|
|
199
195
|
...(_a = newSlot == null ? void 0 : newSlot.variants) == null ? void 0 : _a[variantItem],
|
|
200
|
-
...(_b = mergedSlot == null ? void 0 : mergedSlot.variants) == null ? void 0 : _b
|
|
196
|
+
...(_b = mergedSlot == null ? void 0 : mergedSlot.variants) == null ? void 0 : _b[variantItem]
|
|
201
197
|
};
|
|
202
198
|
return acc2;
|
|
203
199
|
}, {});
|
|
@@ -276,15 +272,13 @@ import React4 from "react";
|
|
|
276
272
|
import { useNumberFormatter } from "@react-aria/i18n";
|
|
277
273
|
var NumericFormat = ({
|
|
278
274
|
value,
|
|
279
|
-
styleFormat,
|
|
280
275
|
tabular = true,
|
|
281
276
|
...props
|
|
282
277
|
}) => {
|
|
283
278
|
const numberFormatter = useNumberFormatter({
|
|
284
|
-
style: styleFormat,
|
|
285
279
|
...props
|
|
286
280
|
});
|
|
287
|
-
return /* @__PURE__ */ React4.createElement("span", { className: tabular ? "tabular-nums" :
|
|
281
|
+
return /* @__PURE__ */ React4.createElement("span", { className: tabular ? "tabular-nums" : void 0 }, numberFormatter.format(value));
|
|
288
282
|
};
|
|
289
283
|
|
|
290
284
|
// src/style-props.tsx
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marigold/system",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"description": "Marigold System Library",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -27,20 +27,20 @@
|
|
|
27
27
|
"@react-aria/i18n": "3.11.1",
|
|
28
28
|
"class-variance-authority": "0.7.0",
|
|
29
29
|
"deepmerge": "4.2.2",
|
|
30
|
-
"react-fast-compare": "3.2.
|
|
31
|
-
"tailwind-merge": "2.
|
|
32
|
-
"@marigold/types": "1.1.
|
|
30
|
+
"react-fast-compare": "3.2.2",
|
|
31
|
+
"tailwind-merge": "2.3.0",
|
|
32
|
+
"@marigold/types": "1.1.1"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"react": "18.x",
|
|
36
36
|
"react-dom": "18.x"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@babel/core": "7.24.
|
|
40
|
-
"postcss": "8.4.
|
|
39
|
+
"@babel/core": "7.24.7",
|
|
40
|
+
"postcss": "8.4.38",
|
|
41
41
|
"react": "18.3.1",
|
|
42
|
-
"tailwindcss": "3.4.
|
|
43
|
-
"tsup": "8.0
|
|
42
|
+
"tailwindcss": "3.4.4",
|
|
43
|
+
"tsup": "8.1.0",
|
|
44
44
|
"@marigold/tsconfig": "0.4.0"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|