@marigold/components 2.2.0 → 3.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.ts +22 -15
- package/dist/index.js +91 -82
- package/dist/index.mjs +89 -81
- package/package.json +6 -5
package/dist/index.d.ts
CHANGED
|
@@ -34,6 +34,13 @@ interface BadgeProps extends ComponentProps<'div'> {
|
|
|
34
34
|
}
|
|
35
35
|
declare const Badge: ({ variant, size, children, ...props }: BadgeProps) => JSX.Element;
|
|
36
36
|
|
|
37
|
+
interface BodyThemeExtension extends ThemeExtension<'Body'> {
|
|
38
|
+
}
|
|
39
|
+
interface BodyProps extends ThemeComponentProps, ComponentProps<'section'> {
|
|
40
|
+
children?: ReactNode;
|
|
41
|
+
}
|
|
42
|
+
declare const Body: ({ children, variant, size, ...props }: BodyProps) => JSX.Element;
|
|
43
|
+
|
|
37
44
|
interface ButtonThemeExtension extends ThemeExtension<'Button'> {
|
|
38
45
|
}
|
|
39
46
|
interface ButtonOwnProps extends PressEvents, ComponentProps<'button'> {
|
|
@@ -106,13 +113,6 @@ interface CheckboxGroupProps extends Omit<ComponentProps<'div'>, 'onChange'>, Ar
|
|
|
106
113
|
}
|
|
107
114
|
declare const CheckboxGroup: ({ children, variant, size, required, disabled, readOnly, error, ...rest }: CheckboxGroupProps) => JSX.Element;
|
|
108
115
|
|
|
109
|
-
interface ContentThemeExtension extends ThemeExtension<'Content'> {
|
|
110
|
-
}
|
|
111
|
-
interface ContentProps extends ThemeComponentProps, ComponentProps<'section'> {
|
|
112
|
-
children?: ReactNode;
|
|
113
|
-
}
|
|
114
|
-
declare const Content: ({ children, variant, size, ...props }: ContentProps) => JSX.Element;
|
|
115
|
-
|
|
116
116
|
interface DialogTriggerProps {
|
|
117
117
|
children: [trigger: ReactNode, menu: ReactNode];
|
|
118
118
|
dismissable?: boolean;
|
|
@@ -505,11 +505,15 @@ declare const Tooltip: {
|
|
|
505
505
|
Trigger: ({ disabled, open, delay, placement, children, ...rest }: TooltipTriggerProps) => JSX.Element;
|
|
506
506
|
};
|
|
507
507
|
|
|
508
|
-
interface ComponentStyles extends BadgeThemeExtension, ButtonThemeExtension, CardThemeExtension, CheckboxThemeExtension, CheckboxGroupThemeExtension,
|
|
508
|
+
interface ComponentStyles extends BadgeThemeExtension, ButtonThemeExtension, CardThemeExtension, CheckboxThemeExtension, CheckboxGroupThemeExtension, BodyThemeExtension, DialogThemeExtension, DividerThemeExtension, FooterThemeExtension, HeaderThemeExtension, HeadlineThemeExtension, HelpTextThemeExtension, ImageThemeExtension, InputThemeExtension, LabelThemeExtension, LinkThemeExtension, ListThemeExtension, ListBoxThemeExtension, MenuThemeExtension, MessageThemeExtension, NumberFieldThemeExtension, RadioThemeExtension, RadioGroupThemeExtension, SelectThemeExtension, SliderThemeExtension, SwitchThemeExtension, TableThemeExtension, TextThemeExtension, TextAreaThemeExtension, TooltipThemeExtension, UnderlayThemeExtension {
|
|
509
509
|
}
|
|
510
510
|
interface Theme extends Theme$1 {
|
|
511
511
|
components: ComponentStyles;
|
|
512
512
|
}
|
|
513
|
+
interface CustomizedTheme extends Theme$1 {
|
|
514
|
+
components?: Partial<ComponentStyles>;
|
|
515
|
+
}
|
|
516
|
+
declare const extendTheme: (baseTheme: Theme, extendTheme: CustomizedTheme) => Theme;
|
|
513
517
|
|
|
514
518
|
interface AsideProps {
|
|
515
519
|
children: [ReactElement, ReactElement];
|
|
@@ -534,10 +538,11 @@ declare const Aspect: ({ ratio, maxWidth, children, }: AspectProps) => JSX.Eleme
|
|
|
534
538
|
|
|
535
539
|
interface BreakoutProps extends ComponentProps<'div'> {
|
|
536
540
|
children?: ReactNode;
|
|
537
|
-
|
|
538
|
-
|
|
541
|
+
alignY?: 'top' | 'bottom' | 'center';
|
|
542
|
+
alignX?: 'left' | 'right' | 'center';
|
|
543
|
+
height?: string;
|
|
539
544
|
}
|
|
540
|
-
declare const Breakout: ({
|
|
545
|
+
declare const Breakout: ({ alignX, alignY, height, children, ...props }: BreakoutProps) => JSX.Element;
|
|
541
546
|
|
|
542
547
|
interface CenterProps extends ComponentProps<'div'> {
|
|
543
548
|
children?: ReactNode;
|
|
@@ -551,9 +556,10 @@ interface ColumnsProps {
|
|
|
551
556
|
columns: Array<number>;
|
|
552
557
|
space?: ResponsiveStyleValue<string>;
|
|
553
558
|
columnLimit?: number;
|
|
554
|
-
collapseAt?: string;
|
|
559
|
+
collapseAt?: string | 0;
|
|
560
|
+
stretch?: boolean;
|
|
555
561
|
}
|
|
556
|
-
declare const Columns: ({ space, columns, collapseAt, children, ...props }: ColumnsProps) => JSX.Element;
|
|
562
|
+
declare const Columns: ({ space, columns, collapseAt, stretch, children, ...props }: ColumnsProps) => JSX.Element;
|
|
557
563
|
|
|
558
564
|
interface ContainerProps extends ComponentProps<'div'> {
|
|
559
565
|
children?: ReactNode;
|
|
@@ -591,17 +597,18 @@ interface SplitProps extends ComponentProps<'div'> {
|
|
|
591
597
|
declare const Split: (props: SplitProps) => JSX.Element;
|
|
592
598
|
|
|
593
599
|
declare const ALIGNMENT_X: {
|
|
600
|
+
none: string;
|
|
594
601
|
left: string;
|
|
595
602
|
center: string;
|
|
596
603
|
right: string;
|
|
597
604
|
};
|
|
598
605
|
declare const ALIGNMENT_Y: {
|
|
606
|
+
none: string;
|
|
599
607
|
top: string;
|
|
600
608
|
center: string;
|
|
601
609
|
bottom: string;
|
|
602
610
|
};
|
|
603
611
|
interface StackProps {
|
|
604
|
-
as?: 'div' | 'ul' | 'ol';
|
|
605
612
|
children?: ReactNode;
|
|
606
613
|
space?: ResponsiveStyleValue<string>;
|
|
607
614
|
alignX?: keyof typeof ALIGNMENT_X;
|
|
@@ -636,4 +643,4 @@ interface TilesProps {
|
|
|
636
643
|
}
|
|
637
644
|
declare const Tiles: React.ForwardRefExoticComponent<TilesProps & React.RefAttributes<HTMLDivElement>>;
|
|
638
645
|
|
|
639
|
-
export { Aside, AsideProps, Aspect, AspectProps, Badge, BadgeProps, BadgeThemeExtension, Breakout, BreakoutProps, Button, ButtonOwnProps, ButtonProps, ButtonThemeExtension, Card, CardProps, CardThemeExtension, Center, CenterProps, Checkbox, CheckboxGroup, CheckboxGroupContext, CheckboxGroupContextProps, CheckboxGroupThemeExtension, CheckboxProps, CheckboxThemeExtension, Columns, ColumnsProps, Container, ContainerProps,
|
|
646
|
+
export { Aside, AsideProps, Aspect, AspectProps, Badge, BadgeProps, BadgeThemeExtension, Body, BodyProps, BodyThemeExtension, Breakout, BreakoutProps, Button, ButtonOwnProps, ButtonProps, ButtonThemeExtension, Card, CardProps, CardThemeExtension, Center, CenterProps, Checkbox, CheckboxGroup, CheckboxGroupContext, CheckboxGroupContextProps, CheckboxGroupThemeExtension, CheckboxProps, CheckboxThemeExtension, Columns, ColumnsProps, Container, ContainerProps, CustomCheckboxProps, CustomRadioProps, CustomSwitchProps, CustomTextAreaEvents, CustomTextFieldEvents, CustomizedTheme, Dialog, DialogChildProps, DialogProps, DialogThemeExtension, Divider, DividerProps, DividerThemeExtension, Footer, FooterProps, FooterThemeExtension, Header, HeaderProps, HeaderThemeExtension, Headline, HeadlineProps, HeadlineThemeExtension, Image, ImageProps, ImageThemeExtension, Inline, InlineProps, Input, InputOwnProps, InputProps, InputThemeExtension, Label, LabelProps, LabelThemeExtension, Link, LinkOwnProps, LinkProps, LinkThemeExtension, List, ListProps, ListThemeExtension, MarigoldProvider, MarigoldProviderProps, Menu, MenuProps, MenuThemeExtension, Message, MessageProps, MessageThemeExtension, NumberField, NumberFieldProps, NumberFieldThemeExtension, Overlay, OverlayProps, Popover, PopoverProps, Radio, RadioComponent, RadioGroupProps, RadioGroupThemeExtension, RadioProps, RadioThemeExtension, Select, SelectComponent, SelectProps, SelectThemeExtension, Slider, SliderProps, SliderThemeExtension, Split, SplitProps, Stack, StackProps, Switch, SwitchProps, SwitchThemeExtension, Table, TableProps, TableThemeExtension, Text, TextArea, TextAreaProps, TextAreaThemeExtension, TextField, TextFieldProps, TextProps, TextThemeExtension, Theme, Tiles, TilesProps, Tooltip, TooltipProps, TooltipThemeExtension, Underlay, UnderlayProps, UnderlayThemeExtension, extendTheme, useCheckboxGroupContext };
|
package/dist/index.js
CHANGED
|
@@ -29,6 +29,7 @@ __export(src_exports, {
|
|
|
29
29
|
Aside: () => Aside,
|
|
30
30
|
Aspect: () => Aspect,
|
|
31
31
|
Badge: () => Badge,
|
|
32
|
+
Body: () => Body,
|
|
32
33
|
Box: () => import_system.Box,
|
|
33
34
|
Breakout: () => Breakout,
|
|
34
35
|
Button: () => Button,
|
|
@@ -39,7 +40,6 @@ __export(src_exports, {
|
|
|
39
40
|
CheckboxGroupContext: () => CheckboxGroupContext,
|
|
40
41
|
Columns: () => Columns,
|
|
41
42
|
Container: () => Container,
|
|
42
|
-
Content: () => Content,
|
|
43
43
|
Dialog: () => Dialog,
|
|
44
44
|
Divider: () => Divider,
|
|
45
45
|
Footer: () => Footer,
|
|
@@ -73,6 +73,7 @@ __export(src_exports, {
|
|
|
73
73
|
Tooltip: () => Tooltip,
|
|
74
74
|
Underlay: () => Underlay,
|
|
75
75
|
VisuallyHidden: () => import_visually_hidden.VisuallyHidden,
|
|
76
|
+
extendTheme: () => extendTheme,
|
|
76
77
|
useAsyncList: () => import_data.useAsyncList,
|
|
77
78
|
useCheckboxGroupContext: () => useCheckboxGroupContext,
|
|
78
79
|
useListData: () => import_data.useListData,
|
|
@@ -83,6 +84,10 @@ module.exports = __toCommonJS(src_exports);
|
|
|
83
84
|
// src/hooks.ts
|
|
84
85
|
var import_data = require("@react-stately/data");
|
|
85
86
|
|
|
87
|
+
// src/theme.ts
|
|
88
|
+
var import_deepmerge = __toESM(require("deepmerge"));
|
|
89
|
+
var extendTheme = (baseTheme, extendTheme2) => (0, import_deepmerge.default)(baseTheme, extendTheme2);
|
|
90
|
+
|
|
86
91
|
// src/Aside/Aside.tsx
|
|
87
92
|
var import_react = __toESM(require("react"));
|
|
88
93
|
|
|
@@ -162,33 +167,47 @@ var useAlignment = (direction) => {
|
|
|
162
167
|
return "flex-start";
|
|
163
168
|
};
|
|
164
169
|
var Breakout = ({
|
|
165
|
-
|
|
166
|
-
|
|
170
|
+
alignX,
|
|
171
|
+
alignY,
|
|
172
|
+
height,
|
|
167
173
|
children,
|
|
168
174
|
...props
|
|
169
175
|
}) => {
|
|
170
|
-
const alignItems = useAlignment(
|
|
171
|
-
const justifyContent = useAlignment(
|
|
176
|
+
const alignItems = useAlignment(alignY);
|
|
177
|
+
const justifyContent = useAlignment(alignX);
|
|
172
178
|
return /* @__PURE__ */ import_react4.default.createElement(import_system.Box, {
|
|
173
179
|
alignItems,
|
|
174
180
|
justifyContent,
|
|
175
181
|
width: "100%",
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
182
|
+
height,
|
|
183
|
+
display: alignY || alignX ? "flex" : "block",
|
|
184
|
+
__baseCSS: {
|
|
185
|
+
gridColumn: "1 / -1 !important"
|
|
179
186
|
},
|
|
180
187
|
...props
|
|
181
188
|
}, children);
|
|
182
189
|
};
|
|
183
190
|
|
|
184
|
-
// src/
|
|
191
|
+
// src/Body/Body.tsx
|
|
185
192
|
var import_react5 = __toESM(require("react"));
|
|
193
|
+
var import_system3 = require("@marigold/system");
|
|
194
|
+
var Body = ({ children, variant, size, ...props }) => {
|
|
195
|
+
const styles = (0, import_system3.useComponentStyles)("Body", { variant, size });
|
|
196
|
+
return /* @__PURE__ */ import_react5.default.createElement(import_system3.Box, {
|
|
197
|
+
as: "section",
|
|
198
|
+
...props,
|
|
199
|
+
css: styles
|
|
200
|
+
}, children);
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
// src/Button/Button.tsx
|
|
204
|
+
var import_react6 = __toESM(require("react"));
|
|
186
205
|
var import_button = require("@react-aria/button");
|
|
187
206
|
var import_focus = require("@react-aria/focus");
|
|
188
207
|
var import_interactions = require("@react-aria/interactions");
|
|
189
208
|
var import_utils = require("@react-aria/utils");
|
|
190
|
-
var
|
|
191
|
-
var Button = (0,
|
|
209
|
+
var import_system4 = require("@marigold/system");
|
|
210
|
+
var Button = (0, import_react6.forwardRef)(
|
|
192
211
|
({
|
|
193
212
|
as = "button",
|
|
194
213
|
children,
|
|
@@ -223,13 +242,13 @@ var Button = (0, import_react5.forwardRef)(
|
|
|
223
242
|
},
|
|
224
243
|
buttonRef
|
|
225
244
|
);
|
|
226
|
-
const styles = (0,
|
|
227
|
-
const stateProps = (0,
|
|
245
|
+
const styles = (0, import_system4.useComponentStyles)("Button", { variant, size });
|
|
246
|
+
const stateProps = (0, import_system4.useStateProps)({
|
|
228
247
|
active: isPressed,
|
|
229
248
|
focusVisible: isFocusVisible,
|
|
230
249
|
hover: isHovered
|
|
231
250
|
});
|
|
232
|
-
return /* @__PURE__ */
|
|
251
|
+
return /* @__PURE__ */ import_react6.default.createElement(import_system4.Box, {
|
|
233
252
|
...(0, import_utils.mergeProps)(buttonProps, focusProps, hoverProps, props),
|
|
234
253
|
...stateProps,
|
|
235
254
|
as,
|
|
@@ -251,8 +270,8 @@ var Button = (0, import_react5.forwardRef)(
|
|
|
251
270
|
);
|
|
252
271
|
|
|
253
272
|
// src/Card/Card.tsx
|
|
254
|
-
var
|
|
255
|
-
var
|
|
273
|
+
var import_react7 = __toESM(require("react"));
|
|
274
|
+
var import_system5 = require("@marigold/system");
|
|
256
275
|
var Card = ({
|
|
257
276
|
children,
|
|
258
277
|
variant,
|
|
@@ -266,21 +285,21 @@ var Card = ({
|
|
|
266
285
|
pr,
|
|
267
286
|
...props
|
|
268
287
|
}) => {
|
|
269
|
-
const styles = (0,
|
|
270
|
-
return /* @__PURE__ */
|
|
288
|
+
const styles = (0, import_system5.useComponentStyles)("Card", { variant, size });
|
|
289
|
+
return /* @__PURE__ */ import_react7.default.createElement(import_system5.Box, {
|
|
271
290
|
...props,
|
|
272
291
|
css: [styles, { p, px, py, pt, pb, pl, pr }]
|
|
273
292
|
}, children);
|
|
274
293
|
};
|
|
275
294
|
|
|
276
295
|
// src/Center/Center.tsx
|
|
277
|
-
var
|
|
296
|
+
var import_react8 = __toESM(require("react"));
|
|
278
297
|
var Center = ({
|
|
279
298
|
maxWidth,
|
|
280
299
|
space = "none",
|
|
281
300
|
children,
|
|
282
301
|
...props
|
|
283
|
-
}) => /* @__PURE__ */
|
|
302
|
+
}) => /* @__PURE__ */ import_react8.default.createElement(import_system.Box, {
|
|
284
303
|
css: {
|
|
285
304
|
boxSizing: "content-box",
|
|
286
305
|
display: "flex",
|
|
@@ -295,24 +314,24 @@ var Center = ({
|
|
|
295
314
|
}, children);
|
|
296
315
|
|
|
297
316
|
// src/Checkbox/Checkbox.tsx
|
|
298
|
-
var
|
|
317
|
+
var import_react11 = __toESM(require("react"));
|
|
299
318
|
var import_checkbox3 = require("@react-aria/checkbox");
|
|
300
319
|
var import_focus2 = require("@react-aria/focus");
|
|
301
320
|
var import_interactions2 = require("@react-aria/interactions");
|
|
302
321
|
var import_utils2 = require("@react-aria/utils");
|
|
303
322
|
var import_toggle = require("@react-stately/toggle");
|
|
304
|
-
var
|
|
323
|
+
var import_system8 = require("@marigold/system");
|
|
305
324
|
|
|
306
325
|
// src/Checkbox/CheckboxGroup.tsx
|
|
307
|
-
var
|
|
326
|
+
var import_react10 = __toESM(require("react"));
|
|
308
327
|
var import_checkbox = require("@react-aria/checkbox");
|
|
309
328
|
var import_checkbox2 = require("@react-stately/checkbox");
|
|
310
|
-
var
|
|
329
|
+
var import_system7 = require("@marigold/system");
|
|
311
330
|
|
|
312
331
|
// src/Label/Label.tsx
|
|
313
|
-
var
|
|
332
|
+
var import_react9 = __toESM(require("react"));
|
|
314
333
|
var import_icons = require("@marigold/icons");
|
|
315
|
-
var
|
|
334
|
+
var import_system6 = require("@marigold/system");
|
|
316
335
|
var Label = ({
|
|
317
336
|
as = "label",
|
|
318
337
|
required,
|
|
@@ -321,13 +340,13 @@ var Label = ({
|
|
|
321
340
|
size,
|
|
322
341
|
...props
|
|
323
342
|
}) => {
|
|
324
|
-
const styles = (0,
|
|
325
|
-
return /* @__PURE__ */
|
|
343
|
+
const styles = (0, import_system6.useComponentStyles)("Label", { size, variant });
|
|
344
|
+
return /* @__PURE__ */ import_react9.default.createElement(import_system6.Box, {
|
|
326
345
|
...props,
|
|
327
346
|
as,
|
|
328
347
|
__baseCSS: { display: "flex", alignItems: "center", gap: 4 },
|
|
329
348
|
css: styles
|
|
330
|
-
}, children, required && /* @__PURE__ */
|
|
349
|
+
}, children, required && /* @__PURE__ */ import_react9.default.createElement(import_icons.Required, {
|
|
331
350
|
role: "presentation",
|
|
332
351
|
size: 16,
|
|
333
352
|
fill: "error"
|
|
@@ -335,10 +354,10 @@ var Label = ({
|
|
|
335
354
|
};
|
|
336
355
|
|
|
337
356
|
// src/Checkbox/CheckboxGroup.tsx
|
|
338
|
-
var CheckboxGroupContext = (0,
|
|
357
|
+
var CheckboxGroupContext = (0, import_react10.createContext)(
|
|
339
358
|
null
|
|
340
359
|
);
|
|
341
|
-
var useCheckboxGroupContext = () => (0,
|
|
360
|
+
var useCheckboxGroupContext = () => (0, import_react10.useContext)(CheckboxGroupContext);
|
|
342
361
|
var CheckboxGroup = ({
|
|
343
362
|
children,
|
|
344
363
|
variant,
|
|
@@ -358,19 +377,19 @@ var CheckboxGroup = ({
|
|
|
358
377
|
};
|
|
359
378
|
const state = (0, import_checkbox2.useCheckboxGroupState)(props);
|
|
360
379
|
const { groupProps, labelProps } = (0, import_checkbox.useCheckboxGroup)(props, state);
|
|
361
|
-
const styles = (0,
|
|
380
|
+
const styles = (0, import_system7.useComponentStyles)(
|
|
362
381
|
"CheckboxGroup",
|
|
363
382
|
{ variant, size },
|
|
364
383
|
{ parts: ["container", "group"] }
|
|
365
384
|
);
|
|
366
|
-
return /* @__PURE__ */
|
|
385
|
+
return /* @__PURE__ */ import_react10.default.createElement(import_system7.Box, {
|
|
367
386
|
...groupProps,
|
|
368
387
|
css: styles.container
|
|
369
|
-
}, props.label && /* @__PURE__ */
|
|
388
|
+
}, props.label && /* @__PURE__ */ import_react10.default.createElement(Label, {
|
|
370
389
|
as: "span",
|
|
371
390
|
required,
|
|
372
391
|
...labelProps
|
|
373
|
-
}, props.label), /* @__PURE__ */
|
|
392
|
+
}, props.label), /* @__PURE__ */ import_react10.default.createElement(import_system7.Box, {
|
|
374
393
|
role: "presentation",
|
|
375
394
|
__baseCSS: {
|
|
376
395
|
display: "flex",
|
|
@@ -378,29 +397,29 @@ var CheckboxGroup = ({
|
|
|
378
397
|
alignItems: "start"
|
|
379
398
|
},
|
|
380
399
|
css: styles.group
|
|
381
|
-
}, /* @__PURE__ */
|
|
400
|
+
}, /* @__PURE__ */ import_react10.default.createElement(CheckboxGroupContext.Provider, {
|
|
382
401
|
value: { variant, size, error, ...state }
|
|
383
402
|
}, children)));
|
|
384
403
|
};
|
|
385
404
|
|
|
386
405
|
// src/Checkbox/Checkbox.tsx
|
|
387
|
-
var CheckMark = () => /* @__PURE__ */
|
|
406
|
+
var CheckMark = () => /* @__PURE__ */ import_react11.default.createElement("svg", {
|
|
388
407
|
viewBox: "0 0 12 10"
|
|
389
|
-
}, /* @__PURE__ */
|
|
408
|
+
}, /* @__PURE__ */ import_react11.default.createElement("path", {
|
|
390
409
|
fill: "currentColor",
|
|
391
410
|
stroke: "none",
|
|
392
411
|
d: "M11.915 1.548 10.367 0 4.045 6.315 1.557 3.827 0 5.373l4.045 4.046 7.87-7.871Z"
|
|
393
412
|
}));
|
|
394
|
-
var IndeterminateMark = () => /* @__PURE__ */
|
|
413
|
+
var IndeterminateMark = () => /* @__PURE__ */ import_react11.default.createElement("svg", {
|
|
395
414
|
width: "12",
|
|
396
415
|
height: "3",
|
|
397
416
|
viewBox: "0 0 12 3"
|
|
398
|
-
}, /* @__PURE__ */
|
|
417
|
+
}, /* @__PURE__ */ import_react11.default.createElement("path", {
|
|
399
418
|
fill: "currentColor",
|
|
400
419
|
stroke: "none",
|
|
401
420
|
d: "M11.5 2.04018H0.5V0.46875H11.5V2.04018Z"
|
|
402
421
|
}));
|
|
403
|
-
var Icon = ({ css, checked, indeterminate, ...props }) => /* @__PURE__ */
|
|
422
|
+
var Icon = ({ css, checked, indeterminate, ...props }) => /* @__PURE__ */ import_react11.default.createElement(import_system8.Box, {
|
|
404
423
|
"aria-hidden": "true",
|
|
405
424
|
__baseCSS: {
|
|
406
425
|
width: 16,
|
|
@@ -415,8 +434,8 @@ var Icon = ({ css, checked, indeterminate, ...props }) => /* @__PURE__ */ import
|
|
|
415
434
|
},
|
|
416
435
|
css,
|
|
417
436
|
...props
|
|
418
|
-
}, indeterminate ? /* @__PURE__ */
|
|
419
|
-
var Checkbox = (0,
|
|
437
|
+
}, indeterminate ? /* @__PURE__ */ import_react11.default.createElement(IndeterminateMark, null) : checked ? /* @__PURE__ */ import_react11.default.createElement(CheckMark, null) : null);
|
|
438
|
+
var Checkbox = (0, import_react11.forwardRef)(
|
|
420
439
|
({
|
|
421
440
|
size,
|
|
422
441
|
variant,
|
|
@@ -461,7 +480,7 @@ var Checkbox = (0, import_react10.forwardRef)(
|
|
|
461
480
|
}),
|
|
462
481
|
inputRef
|
|
463
482
|
);
|
|
464
|
-
const styles = (0,
|
|
483
|
+
const styles = (0, import_system8.useComponentStyles)(
|
|
465
484
|
"Checkbox",
|
|
466
485
|
{
|
|
467
486
|
variant: (groupState == null ? void 0 : groupState.variant) || variant,
|
|
@@ -471,7 +490,7 @@ var Checkbox = (0, import_react10.forwardRef)(
|
|
|
471
490
|
);
|
|
472
491
|
const { hoverProps, isHovered } = (0, import_interactions2.useHover)({});
|
|
473
492
|
const { isFocusVisible, focusProps } = (0, import_focus2.useFocusRing)();
|
|
474
|
-
const stateProps = (0,
|
|
493
|
+
const stateProps = (0, import_system8.useStateProps)({
|
|
475
494
|
hover: isHovered,
|
|
476
495
|
focus: isFocusVisible,
|
|
477
496
|
checked: inputProps.checked,
|
|
@@ -480,7 +499,7 @@ var Checkbox = (0, import_react10.forwardRef)(
|
|
|
480
499
|
readOnly,
|
|
481
500
|
indeterminate
|
|
482
501
|
});
|
|
483
|
-
return /* @__PURE__ */
|
|
502
|
+
return /* @__PURE__ */ import_react11.default.createElement(import_system8.Box, {
|
|
484
503
|
as: "label",
|
|
485
504
|
__baseCSS: {
|
|
486
505
|
display: "flex",
|
|
@@ -491,7 +510,7 @@ var Checkbox = (0, import_react10.forwardRef)(
|
|
|
491
510
|
css: styles.container,
|
|
492
511
|
...hoverProps,
|
|
493
512
|
...stateProps
|
|
494
|
-
}, /* @__PURE__ */
|
|
513
|
+
}, /* @__PURE__ */ import_react11.default.createElement(import_system8.Box, {
|
|
495
514
|
as: "input",
|
|
496
515
|
ref: inputRef,
|
|
497
516
|
css: {
|
|
@@ -506,12 +525,12 @@ var Checkbox = (0, import_react10.forwardRef)(
|
|
|
506
525
|
},
|
|
507
526
|
...inputProps,
|
|
508
527
|
...focusProps
|
|
509
|
-
}), /* @__PURE__ */
|
|
528
|
+
}), /* @__PURE__ */ import_react11.default.createElement(Icon, {
|
|
510
529
|
checked: inputProps.checked,
|
|
511
530
|
indeterminate,
|
|
512
531
|
css: styles.checkbox,
|
|
513
532
|
...stateProps
|
|
514
|
-
}), props.children && /* @__PURE__ */
|
|
533
|
+
}), props.children && /* @__PURE__ */ import_react11.default.createElement(import_system8.Box, {
|
|
515
534
|
css: styles.label,
|
|
516
535
|
...stateProps
|
|
517
536
|
}, props.children));
|
|
@@ -519,46 +538,49 @@ var Checkbox = (0, import_react10.forwardRef)(
|
|
|
519
538
|
);
|
|
520
539
|
|
|
521
540
|
// src/Columns/Columns.tsx
|
|
522
|
-
var
|
|
541
|
+
var import_react12 = __toESM(require("react"));
|
|
523
542
|
var Columns = ({
|
|
524
543
|
space = "none",
|
|
525
544
|
columns,
|
|
526
|
-
collapseAt = "
|
|
545
|
+
collapseAt = "0em",
|
|
546
|
+
stretch,
|
|
527
547
|
children,
|
|
528
548
|
...props
|
|
529
549
|
}) => {
|
|
530
|
-
if (
|
|
550
|
+
if (import_react12.Children.count(children) !== columns.length) {
|
|
531
551
|
throw new Error(
|
|
532
|
-
`Columns: expected ${columns.length} children, got ${
|
|
552
|
+
`Columns: expected ${columns.length} children, got ${import_react12.Children.count(
|
|
533
553
|
children
|
|
534
554
|
)}`
|
|
535
555
|
);
|
|
536
556
|
}
|
|
537
|
-
return /* @__PURE__ */
|
|
538
|
-
display: "flex",
|
|
557
|
+
return /* @__PURE__ */ import_react12.default.createElement(import_system.Box, {
|
|
539
558
|
css: {
|
|
559
|
+
display: "flex",
|
|
540
560
|
flexWrap: "wrap",
|
|
561
|
+
alignItems: "stretch",
|
|
562
|
+
height: stretch ? "100%" : void 0,
|
|
541
563
|
gap: space,
|
|
542
564
|
"> *": {
|
|
543
565
|
flexBasis: `calc(( ${collapseAt} - 100%) * 999)`
|
|
544
566
|
}
|
|
545
567
|
},
|
|
546
568
|
...props
|
|
547
|
-
},
|
|
569
|
+
}, import_react12.Children.map(children, (child, idx) => /* @__PURE__ */ import_react12.default.createElement(import_system.Box, {
|
|
548
570
|
css: {
|
|
549
571
|
flexGrow: columns[idx]
|
|
550
572
|
}
|
|
551
|
-
}, (0,
|
|
573
|
+
}, (0, import_react12.isValidElement)(child) ? (0, import_react12.cloneElement)(child) : null)));
|
|
552
574
|
};
|
|
553
575
|
|
|
554
576
|
// src/Container/Container.tsx
|
|
555
|
-
var
|
|
577
|
+
var import_react13 = __toESM(require("react"));
|
|
556
578
|
var import_tokens2 = require("@marigold/tokens");
|
|
557
579
|
var ALIGN_ITEMS = {
|
|
558
580
|
left: "start",
|
|
559
581
|
center: "center",
|
|
560
582
|
right: "end",
|
|
561
|
-
none: "
|
|
583
|
+
none: "initial"
|
|
562
584
|
};
|
|
563
585
|
var ALIGN = {
|
|
564
586
|
left: (maxWidth) => ({
|
|
@@ -583,7 +605,7 @@ var Container = ({
|
|
|
583
605
|
...props
|
|
584
606
|
}) => {
|
|
585
607
|
const maxWidth = import_tokens2.size[contentType][size];
|
|
586
|
-
return /* @__PURE__ */
|
|
608
|
+
return /* @__PURE__ */ import_react13.default.createElement(import_system.Box, {
|
|
587
609
|
display: "grid",
|
|
588
610
|
css: {
|
|
589
611
|
gridTemplateColumns: ALIGN[align](maxWidth).gridTemplateColumns,
|
|
@@ -596,23 +618,6 @@ var Container = ({
|
|
|
596
618
|
}, children);
|
|
597
619
|
};
|
|
598
620
|
|
|
599
|
-
// src/Content/Content.tsx
|
|
600
|
-
var import_react13 = __toESM(require("react"));
|
|
601
|
-
var import_system8 = require("@marigold/system");
|
|
602
|
-
var Content = ({
|
|
603
|
-
children,
|
|
604
|
-
variant,
|
|
605
|
-
size,
|
|
606
|
-
...props
|
|
607
|
-
}) => {
|
|
608
|
-
const styles = (0, import_system8.useComponentStyles)("Content", { variant, size });
|
|
609
|
-
return /* @__PURE__ */ import_react13.default.createElement(import_system8.Box, {
|
|
610
|
-
as: "section",
|
|
611
|
-
...props,
|
|
612
|
-
css: styles
|
|
613
|
-
}, children);
|
|
614
|
-
};
|
|
615
|
-
|
|
616
621
|
// src/Dialog/Dialog.tsx
|
|
617
622
|
var import_react22 = __toESM(require("react"));
|
|
618
623
|
var import_button2 = require("@react-aria/button");
|
|
@@ -930,6 +935,7 @@ var Image = ({
|
|
|
930
935
|
return /* @__PURE__ */ import_react25.default.createElement(import_system15.Box, {
|
|
931
936
|
...props,
|
|
932
937
|
as: "img",
|
|
938
|
+
__baseCSS: fit ? { width: " 100%", height: "100%" } : {},
|
|
933
939
|
css
|
|
934
940
|
});
|
|
935
941
|
};
|
|
@@ -2037,11 +2043,13 @@ var Split = (props) => /* @__PURE__ */ import_react52.default.createElement(impo
|
|
|
2037
2043
|
// src/Stack/Stack.tsx
|
|
2038
2044
|
var import_react53 = __toESM(require("react"));
|
|
2039
2045
|
var ALIGNMENT_X2 = {
|
|
2046
|
+
none: "initial",
|
|
2040
2047
|
left: "flex-start",
|
|
2041
2048
|
center: "center",
|
|
2042
2049
|
right: "flex-end"
|
|
2043
2050
|
};
|
|
2044
2051
|
var ALIGNMENT_Y2 = {
|
|
2052
|
+
none: "initial",
|
|
2045
2053
|
top: "flex-start",
|
|
2046
2054
|
center: "center",
|
|
2047
2055
|
bottom: "flex-end"
|
|
@@ -2049,8 +2057,8 @@ var ALIGNMENT_Y2 = {
|
|
|
2049
2057
|
var Stack = ({
|
|
2050
2058
|
children,
|
|
2051
2059
|
space = "none",
|
|
2052
|
-
alignX = "
|
|
2053
|
-
alignY = "
|
|
2060
|
+
alignX = "none",
|
|
2061
|
+
alignY = "none",
|
|
2054
2062
|
stretch = false,
|
|
2055
2063
|
...props
|
|
2056
2064
|
}) => /* @__PURE__ */ import_react53.default.createElement(import_system.Box, {
|
|
@@ -2061,7 +2069,7 @@ var Stack = ({
|
|
|
2061
2069
|
gap: space,
|
|
2062
2070
|
alignItems: ALIGNMENT_X2[alignX],
|
|
2063
2071
|
justifyContent: ALIGNMENT_Y2[alignY],
|
|
2064
|
-
blockSize: stretch ? "100%" : "
|
|
2072
|
+
blockSize: stretch ? "100%" : "initial"
|
|
2065
2073
|
},
|
|
2066
2074
|
...props
|
|
2067
2075
|
}, children);
|
|
@@ -2531,7 +2539,7 @@ var Text = ({
|
|
|
2531
2539
|
return /* @__PURE__ */ import_react65.default.createElement(import_system47.Box, {
|
|
2532
2540
|
as: "p",
|
|
2533
2541
|
...props,
|
|
2534
|
-
css: { color, cursor, outline, fontSize, textAlign: align
|
|
2542
|
+
css: [styles, { color, cursor, outline, fontSize, textAlign: align }]
|
|
2535
2543
|
}, children);
|
|
2536
2544
|
};
|
|
2537
2545
|
|
|
@@ -2779,6 +2787,7 @@ Tooltip.Trigger = TooltipTrigger;
|
|
|
2779
2787
|
Aside,
|
|
2780
2788
|
Aspect,
|
|
2781
2789
|
Badge,
|
|
2790
|
+
Body,
|
|
2782
2791
|
Box,
|
|
2783
2792
|
Breakout,
|
|
2784
2793
|
Button,
|
|
@@ -2789,7 +2798,6 @@ Tooltip.Trigger = TooltipTrigger;
|
|
|
2789
2798
|
CheckboxGroupContext,
|
|
2790
2799
|
Columns,
|
|
2791
2800
|
Container,
|
|
2792
|
-
Content,
|
|
2793
2801
|
Dialog,
|
|
2794
2802
|
Divider,
|
|
2795
2803
|
Footer,
|
|
@@ -2823,6 +2831,7 @@ Tooltip.Trigger = TooltipTrigger;
|
|
|
2823
2831
|
Tooltip,
|
|
2824
2832
|
Underlay,
|
|
2825
2833
|
VisuallyHidden,
|
|
2834
|
+
extendTheme,
|
|
2826
2835
|
useAsyncList,
|
|
2827
2836
|
useCheckboxGroupContext,
|
|
2828
2837
|
useListData,
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
// src/hooks.ts
|
|
2
2
|
import { useAsyncList, useListData } from "@react-stately/data";
|
|
3
3
|
|
|
4
|
+
// src/theme.ts
|
|
5
|
+
import merge from "deepmerge";
|
|
6
|
+
var extendTheme = (baseTheme, extendTheme2) => merge(baseTheme, extendTheme2);
|
|
7
|
+
|
|
4
8
|
// src/Aside/Aside.tsx
|
|
5
9
|
import React from "react";
|
|
6
10
|
|
|
@@ -80,34 +84,51 @@ var useAlignment = (direction) => {
|
|
|
80
84
|
return "flex-start";
|
|
81
85
|
};
|
|
82
86
|
var Breakout = ({
|
|
83
|
-
|
|
84
|
-
|
|
87
|
+
alignX,
|
|
88
|
+
alignY,
|
|
89
|
+
height,
|
|
85
90
|
children,
|
|
86
91
|
...props
|
|
87
92
|
}) => {
|
|
88
|
-
const alignItems = useAlignment(
|
|
89
|
-
const justifyContent = useAlignment(
|
|
93
|
+
const alignItems = useAlignment(alignY);
|
|
94
|
+
const justifyContent = useAlignment(alignX);
|
|
90
95
|
return /* @__PURE__ */ React4.createElement(Box, {
|
|
91
96
|
alignItems,
|
|
92
97
|
justifyContent,
|
|
93
98
|
width: "100%",
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
99
|
+
height,
|
|
100
|
+
display: alignY || alignX ? "flex" : "block",
|
|
101
|
+
__baseCSS: {
|
|
102
|
+
gridColumn: "1 / -1 !important"
|
|
97
103
|
},
|
|
98
104
|
...props
|
|
99
105
|
}, children);
|
|
100
106
|
};
|
|
101
107
|
|
|
108
|
+
// src/Body/Body.tsx
|
|
109
|
+
import React5 from "react";
|
|
110
|
+
import {
|
|
111
|
+
Box as Box2,
|
|
112
|
+
useComponentStyles as useComponentStyles2
|
|
113
|
+
} from "@marigold/system";
|
|
114
|
+
var Body = ({ children, variant, size, ...props }) => {
|
|
115
|
+
const styles = useComponentStyles2("Body", { variant, size });
|
|
116
|
+
return /* @__PURE__ */ React5.createElement(Box2, {
|
|
117
|
+
as: "section",
|
|
118
|
+
...props,
|
|
119
|
+
css: styles
|
|
120
|
+
}, children);
|
|
121
|
+
};
|
|
122
|
+
|
|
102
123
|
// src/Button/Button.tsx
|
|
103
|
-
import
|
|
124
|
+
import React6, { forwardRef } from "react";
|
|
104
125
|
import { useButton } from "@react-aria/button";
|
|
105
126
|
import { useFocusRing } from "@react-aria/focus";
|
|
106
127
|
import { useHover } from "@react-aria/interactions";
|
|
107
128
|
import { mergeProps, useObjectRef } from "@react-aria/utils";
|
|
108
129
|
import {
|
|
109
|
-
Box as
|
|
110
|
-
useComponentStyles as
|
|
130
|
+
Box as Box3,
|
|
131
|
+
useComponentStyles as useComponentStyles3,
|
|
111
132
|
useStateProps
|
|
112
133
|
} from "@marigold/system";
|
|
113
134
|
var Button = forwardRef(
|
|
@@ -145,13 +166,13 @@ var Button = forwardRef(
|
|
|
145
166
|
},
|
|
146
167
|
buttonRef
|
|
147
168
|
);
|
|
148
|
-
const styles =
|
|
169
|
+
const styles = useComponentStyles3("Button", { variant, size });
|
|
149
170
|
const stateProps = useStateProps({
|
|
150
171
|
active: isPressed,
|
|
151
172
|
focusVisible: isFocusVisible,
|
|
152
173
|
hover: isHovered
|
|
153
174
|
});
|
|
154
|
-
return /* @__PURE__ */
|
|
175
|
+
return /* @__PURE__ */ React6.createElement(Box3, {
|
|
155
176
|
...mergeProps(buttonProps, focusProps, hoverProps, props),
|
|
156
177
|
...stateProps,
|
|
157
178
|
as,
|
|
@@ -173,10 +194,10 @@ var Button = forwardRef(
|
|
|
173
194
|
);
|
|
174
195
|
|
|
175
196
|
// src/Card/Card.tsx
|
|
176
|
-
import
|
|
197
|
+
import React7 from "react";
|
|
177
198
|
import {
|
|
178
|
-
Box as
|
|
179
|
-
useComponentStyles as
|
|
199
|
+
Box as Box4,
|
|
200
|
+
useComponentStyles as useComponentStyles4
|
|
180
201
|
} from "@marigold/system";
|
|
181
202
|
var Card = ({
|
|
182
203
|
children,
|
|
@@ -191,21 +212,21 @@ var Card = ({
|
|
|
191
212
|
pr,
|
|
192
213
|
...props
|
|
193
214
|
}) => {
|
|
194
|
-
const styles =
|
|
195
|
-
return /* @__PURE__ */
|
|
215
|
+
const styles = useComponentStyles4("Card", { variant, size });
|
|
216
|
+
return /* @__PURE__ */ React7.createElement(Box4, {
|
|
196
217
|
...props,
|
|
197
218
|
css: [styles, { p, px, py, pt, pb, pl, pr }]
|
|
198
219
|
}, children);
|
|
199
220
|
};
|
|
200
221
|
|
|
201
222
|
// src/Center/Center.tsx
|
|
202
|
-
import
|
|
223
|
+
import React8 from "react";
|
|
203
224
|
var Center = ({
|
|
204
225
|
maxWidth,
|
|
205
226
|
space = "none",
|
|
206
227
|
children,
|
|
207
228
|
...props
|
|
208
|
-
}) => /* @__PURE__ */
|
|
229
|
+
}) => /* @__PURE__ */ React8.createElement(Box, {
|
|
209
230
|
css: {
|
|
210
231
|
boxSizing: "content-box",
|
|
211
232
|
display: "flex",
|
|
@@ -220,33 +241,33 @@ var Center = ({
|
|
|
220
241
|
}, children);
|
|
221
242
|
|
|
222
243
|
// src/Checkbox/Checkbox.tsx
|
|
223
|
-
import
|
|
244
|
+
import React11, { forwardRef as forwardRef2 } from "react";
|
|
224
245
|
import { useCheckbox, useCheckboxGroupItem } from "@react-aria/checkbox";
|
|
225
246
|
import { useFocusRing as useFocusRing2 } from "@react-aria/focus";
|
|
226
247
|
import { useHover as useHover2 } from "@react-aria/interactions";
|
|
227
248
|
import { useObjectRef as useObjectRef2 } from "@react-aria/utils";
|
|
228
249
|
import { useToggleState } from "@react-stately/toggle";
|
|
229
250
|
import {
|
|
230
|
-
Box as
|
|
231
|
-
useComponentStyles as
|
|
251
|
+
Box as Box7,
|
|
252
|
+
useComponentStyles as useComponentStyles7,
|
|
232
253
|
useStateProps as useStateProps2
|
|
233
254
|
} from "@marigold/system";
|
|
234
255
|
|
|
235
256
|
// src/Checkbox/CheckboxGroup.tsx
|
|
236
|
-
import
|
|
257
|
+
import React10, { createContext, useContext } from "react";
|
|
237
258
|
import { useCheckboxGroup } from "@react-aria/checkbox";
|
|
238
259
|
import {
|
|
239
260
|
useCheckboxGroupState
|
|
240
261
|
} from "@react-stately/checkbox";
|
|
241
262
|
import {
|
|
242
|
-
Box as
|
|
243
|
-
useComponentStyles as
|
|
263
|
+
Box as Box6,
|
|
264
|
+
useComponentStyles as useComponentStyles6
|
|
244
265
|
} from "@marigold/system";
|
|
245
266
|
|
|
246
267
|
// src/Label/Label.tsx
|
|
247
|
-
import
|
|
268
|
+
import React9 from "react";
|
|
248
269
|
import { Required } from "@marigold/icons";
|
|
249
|
-
import { Box as
|
|
270
|
+
import { Box as Box5, useComponentStyles as useComponentStyles5 } from "@marigold/system";
|
|
250
271
|
var Label = ({
|
|
251
272
|
as = "label",
|
|
252
273
|
required,
|
|
@@ -255,13 +276,13 @@ var Label = ({
|
|
|
255
276
|
size,
|
|
256
277
|
...props
|
|
257
278
|
}) => {
|
|
258
|
-
const styles =
|
|
259
|
-
return /* @__PURE__ */
|
|
279
|
+
const styles = useComponentStyles5("Label", { size, variant });
|
|
280
|
+
return /* @__PURE__ */ React9.createElement(Box5, {
|
|
260
281
|
...props,
|
|
261
282
|
as,
|
|
262
283
|
__baseCSS: { display: "flex", alignItems: "center", gap: 4 },
|
|
263
284
|
css: styles
|
|
264
|
-
}, children, required && /* @__PURE__ */
|
|
285
|
+
}, children, required && /* @__PURE__ */ React9.createElement(Required, {
|
|
265
286
|
role: "presentation",
|
|
266
287
|
size: 16,
|
|
267
288
|
fill: "error"
|
|
@@ -292,19 +313,19 @@ var CheckboxGroup = ({
|
|
|
292
313
|
};
|
|
293
314
|
const state = useCheckboxGroupState(props);
|
|
294
315
|
const { groupProps, labelProps } = useCheckboxGroup(props, state);
|
|
295
|
-
const styles =
|
|
316
|
+
const styles = useComponentStyles6(
|
|
296
317
|
"CheckboxGroup",
|
|
297
318
|
{ variant, size },
|
|
298
319
|
{ parts: ["container", "group"] }
|
|
299
320
|
);
|
|
300
|
-
return /* @__PURE__ */
|
|
321
|
+
return /* @__PURE__ */ React10.createElement(Box6, {
|
|
301
322
|
...groupProps,
|
|
302
323
|
css: styles.container
|
|
303
|
-
}, props.label && /* @__PURE__ */
|
|
324
|
+
}, props.label && /* @__PURE__ */ React10.createElement(Label, {
|
|
304
325
|
as: "span",
|
|
305
326
|
required,
|
|
306
327
|
...labelProps
|
|
307
|
-
}, props.label), /* @__PURE__ */
|
|
328
|
+
}, props.label), /* @__PURE__ */ React10.createElement(Box6, {
|
|
308
329
|
role: "presentation",
|
|
309
330
|
__baseCSS: {
|
|
310
331
|
display: "flex",
|
|
@@ -312,29 +333,29 @@ var CheckboxGroup = ({
|
|
|
312
333
|
alignItems: "start"
|
|
313
334
|
},
|
|
314
335
|
css: styles.group
|
|
315
|
-
}, /* @__PURE__ */
|
|
336
|
+
}, /* @__PURE__ */ React10.createElement(CheckboxGroupContext.Provider, {
|
|
316
337
|
value: { variant, size, error, ...state }
|
|
317
338
|
}, children)));
|
|
318
339
|
};
|
|
319
340
|
|
|
320
341
|
// src/Checkbox/Checkbox.tsx
|
|
321
|
-
var CheckMark = () => /* @__PURE__ */
|
|
342
|
+
var CheckMark = () => /* @__PURE__ */ React11.createElement("svg", {
|
|
322
343
|
viewBox: "0 0 12 10"
|
|
323
|
-
}, /* @__PURE__ */
|
|
344
|
+
}, /* @__PURE__ */ React11.createElement("path", {
|
|
324
345
|
fill: "currentColor",
|
|
325
346
|
stroke: "none",
|
|
326
347
|
d: "M11.915 1.548 10.367 0 4.045 6.315 1.557 3.827 0 5.373l4.045 4.046 7.87-7.871Z"
|
|
327
348
|
}));
|
|
328
|
-
var IndeterminateMark = () => /* @__PURE__ */
|
|
349
|
+
var IndeterminateMark = () => /* @__PURE__ */ React11.createElement("svg", {
|
|
329
350
|
width: "12",
|
|
330
351
|
height: "3",
|
|
331
352
|
viewBox: "0 0 12 3"
|
|
332
|
-
}, /* @__PURE__ */
|
|
353
|
+
}, /* @__PURE__ */ React11.createElement("path", {
|
|
333
354
|
fill: "currentColor",
|
|
334
355
|
stroke: "none",
|
|
335
356
|
d: "M11.5 2.04018H0.5V0.46875H11.5V2.04018Z"
|
|
336
357
|
}));
|
|
337
|
-
var Icon = ({ css, checked, indeterminate, ...props }) => /* @__PURE__ */
|
|
358
|
+
var Icon = ({ css, checked, indeterminate, ...props }) => /* @__PURE__ */ React11.createElement(Box7, {
|
|
338
359
|
"aria-hidden": "true",
|
|
339
360
|
__baseCSS: {
|
|
340
361
|
width: 16,
|
|
@@ -349,7 +370,7 @@ var Icon = ({ css, checked, indeterminate, ...props }) => /* @__PURE__ */ React1
|
|
|
349
370
|
},
|
|
350
371
|
css,
|
|
351
372
|
...props
|
|
352
|
-
}, indeterminate ? /* @__PURE__ */
|
|
373
|
+
}, indeterminate ? /* @__PURE__ */ React11.createElement(IndeterminateMark, null) : checked ? /* @__PURE__ */ React11.createElement(CheckMark, null) : null);
|
|
353
374
|
var Checkbox = forwardRef2(
|
|
354
375
|
({
|
|
355
376
|
size,
|
|
@@ -395,7 +416,7 @@ var Checkbox = forwardRef2(
|
|
|
395
416
|
}),
|
|
396
417
|
inputRef
|
|
397
418
|
);
|
|
398
|
-
const styles =
|
|
419
|
+
const styles = useComponentStyles7(
|
|
399
420
|
"Checkbox",
|
|
400
421
|
{
|
|
401
422
|
variant: (groupState == null ? void 0 : groupState.variant) || variant,
|
|
@@ -414,7 +435,7 @@ var Checkbox = forwardRef2(
|
|
|
414
435
|
readOnly,
|
|
415
436
|
indeterminate
|
|
416
437
|
});
|
|
417
|
-
return /* @__PURE__ */
|
|
438
|
+
return /* @__PURE__ */ React11.createElement(Box7, {
|
|
418
439
|
as: "label",
|
|
419
440
|
__baseCSS: {
|
|
420
441
|
display: "flex",
|
|
@@ -425,7 +446,7 @@ var Checkbox = forwardRef2(
|
|
|
425
446
|
css: styles.container,
|
|
426
447
|
...hoverProps,
|
|
427
448
|
...stateProps
|
|
428
|
-
}, /* @__PURE__ */
|
|
449
|
+
}, /* @__PURE__ */ React11.createElement(Box7, {
|
|
429
450
|
as: "input",
|
|
430
451
|
ref: inputRef,
|
|
431
452
|
css: {
|
|
@@ -440,12 +461,12 @@ var Checkbox = forwardRef2(
|
|
|
440
461
|
},
|
|
441
462
|
...inputProps,
|
|
442
463
|
...focusProps
|
|
443
|
-
}), /* @__PURE__ */
|
|
464
|
+
}), /* @__PURE__ */ React11.createElement(Icon, {
|
|
444
465
|
checked: inputProps.checked,
|
|
445
466
|
indeterminate,
|
|
446
467
|
css: styles.checkbox,
|
|
447
468
|
...stateProps
|
|
448
|
-
}), props.children && /* @__PURE__ */
|
|
469
|
+
}), props.children && /* @__PURE__ */ React11.createElement(Box7, {
|
|
449
470
|
css: styles.label,
|
|
450
471
|
...stateProps
|
|
451
472
|
}, props.children));
|
|
@@ -453,7 +474,7 @@ var Checkbox = forwardRef2(
|
|
|
453
474
|
);
|
|
454
475
|
|
|
455
476
|
// src/Columns/Columns.tsx
|
|
456
|
-
import
|
|
477
|
+
import React12, {
|
|
457
478
|
Children,
|
|
458
479
|
cloneElement,
|
|
459
480
|
isValidElement
|
|
@@ -461,7 +482,8 @@ import React11, {
|
|
|
461
482
|
var Columns = ({
|
|
462
483
|
space = "none",
|
|
463
484
|
columns,
|
|
464
|
-
collapseAt = "
|
|
485
|
+
collapseAt = "0em",
|
|
486
|
+
stretch,
|
|
465
487
|
children,
|
|
466
488
|
...props
|
|
467
489
|
}) => {
|
|
@@ -472,17 +494,19 @@ var Columns = ({
|
|
|
472
494
|
)}`
|
|
473
495
|
);
|
|
474
496
|
}
|
|
475
|
-
return /* @__PURE__ */
|
|
476
|
-
display: "flex",
|
|
497
|
+
return /* @__PURE__ */ React12.createElement(Box, {
|
|
477
498
|
css: {
|
|
499
|
+
display: "flex",
|
|
478
500
|
flexWrap: "wrap",
|
|
501
|
+
alignItems: "stretch",
|
|
502
|
+
height: stretch ? "100%" : void 0,
|
|
479
503
|
gap: space,
|
|
480
504
|
"> *": {
|
|
481
505
|
flexBasis: `calc(( ${collapseAt} - 100%) * 999)`
|
|
482
506
|
}
|
|
483
507
|
},
|
|
484
508
|
...props
|
|
485
|
-
}, Children.map(children, (child, idx) => /* @__PURE__ */
|
|
509
|
+
}, Children.map(children, (child, idx) => /* @__PURE__ */ React12.createElement(Box, {
|
|
486
510
|
css: {
|
|
487
511
|
flexGrow: columns[idx]
|
|
488
512
|
}
|
|
@@ -490,13 +514,13 @@ var Columns = ({
|
|
|
490
514
|
};
|
|
491
515
|
|
|
492
516
|
// src/Container/Container.tsx
|
|
493
|
-
import
|
|
517
|
+
import React13 from "react";
|
|
494
518
|
import { size as tokenSize } from "@marigold/tokens";
|
|
495
519
|
var ALIGN_ITEMS = {
|
|
496
520
|
left: "start",
|
|
497
521
|
center: "center",
|
|
498
522
|
right: "end",
|
|
499
|
-
none: "
|
|
523
|
+
none: "initial"
|
|
500
524
|
};
|
|
501
525
|
var ALIGN = {
|
|
502
526
|
left: (maxWidth) => ({
|
|
@@ -521,7 +545,7 @@ var Container = ({
|
|
|
521
545
|
...props
|
|
522
546
|
}) => {
|
|
523
547
|
const maxWidth = tokenSize[contentType][size];
|
|
524
|
-
return /* @__PURE__ */
|
|
548
|
+
return /* @__PURE__ */ React13.createElement(Box, {
|
|
525
549
|
display: "grid",
|
|
526
550
|
css: {
|
|
527
551
|
gridTemplateColumns: ALIGN[align](maxWidth).gridTemplateColumns,
|
|
@@ -534,26 +558,6 @@ var Container = ({
|
|
|
534
558
|
}, children);
|
|
535
559
|
};
|
|
536
560
|
|
|
537
|
-
// src/Content/Content.tsx
|
|
538
|
-
import React13 from "react";
|
|
539
|
-
import {
|
|
540
|
-
Box as Box7,
|
|
541
|
-
useComponentStyles as useComponentStyles7
|
|
542
|
-
} from "@marigold/system";
|
|
543
|
-
var Content = ({
|
|
544
|
-
children,
|
|
545
|
-
variant,
|
|
546
|
-
size,
|
|
547
|
-
...props
|
|
548
|
-
}) => {
|
|
549
|
-
const styles = useComponentStyles7("Content", { variant, size });
|
|
550
|
-
return /* @__PURE__ */ React13.createElement(Box7, {
|
|
551
|
-
as: "section",
|
|
552
|
-
...props,
|
|
553
|
-
css: styles
|
|
554
|
-
}, children);
|
|
555
|
-
};
|
|
556
|
-
|
|
557
561
|
// src/Dialog/Dialog.tsx
|
|
558
562
|
import React21, { useRef as useRef3 } from "react";
|
|
559
563
|
import { useButton as useButton2 } from "@react-aria/button";
|
|
@@ -881,6 +885,7 @@ var Image = ({
|
|
|
881
885
|
return /* @__PURE__ */ React24.createElement(Box12, {
|
|
882
886
|
...props,
|
|
883
887
|
as: "img",
|
|
888
|
+
__baseCSS: fit ? { width: " 100%", height: "100%" } : {},
|
|
884
889
|
css
|
|
885
890
|
});
|
|
886
891
|
};
|
|
@@ -2025,11 +2030,13 @@ var Split = (props) => /* @__PURE__ */ React47.createElement(Box28, {
|
|
|
2025
2030
|
// src/Stack/Stack.tsx
|
|
2026
2031
|
import React48 from "react";
|
|
2027
2032
|
var ALIGNMENT_X2 = {
|
|
2033
|
+
none: "initial",
|
|
2028
2034
|
left: "flex-start",
|
|
2029
2035
|
center: "center",
|
|
2030
2036
|
right: "flex-end"
|
|
2031
2037
|
};
|
|
2032
2038
|
var ALIGNMENT_Y2 = {
|
|
2039
|
+
none: "initial",
|
|
2033
2040
|
top: "flex-start",
|
|
2034
2041
|
center: "center",
|
|
2035
2042
|
bottom: "flex-end"
|
|
@@ -2037,8 +2044,8 @@ var ALIGNMENT_Y2 = {
|
|
|
2037
2044
|
var Stack = ({
|
|
2038
2045
|
children,
|
|
2039
2046
|
space = "none",
|
|
2040
|
-
alignX = "
|
|
2041
|
-
alignY = "
|
|
2047
|
+
alignX = "none",
|
|
2048
|
+
alignY = "none",
|
|
2042
2049
|
stretch = false,
|
|
2043
2050
|
...props
|
|
2044
2051
|
}) => /* @__PURE__ */ React48.createElement(Box, {
|
|
@@ -2049,7 +2056,7 @@ var Stack = ({
|
|
|
2049
2056
|
gap: space,
|
|
2050
2057
|
alignItems: ALIGNMENT_X2[alignX],
|
|
2051
2058
|
justifyContent: ALIGNMENT_Y2[alignY],
|
|
2052
|
-
blockSize: stretch ? "100%" : "
|
|
2059
|
+
blockSize: stretch ? "100%" : "initial"
|
|
2053
2060
|
},
|
|
2054
2061
|
...props
|
|
2055
2062
|
}, children);
|
|
@@ -2165,7 +2172,7 @@ import {
|
|
|
2165
2172
|
Cell,
|
|
2166
2173
|
Column,
|
|
2167
2174
|
Row,
|
|
2168
|
-
TableBody as
|
|
2175
|
+
TableBody as Body2,
|
|
2169
2176
|
TableHeader as Header2,
|
|
2170
2177
|
useTableState
|
|
2171
2178
|
} from "@react-stately/table";
|
|
@@ -2507,7 +2514,7 @@ var Table = ({
|
|
|
2507
2514
|
}
|
|
2508
2515
|
))))));
|
|
2509
2516
|
};
|
|
2510
|
-
Table.Body =
|
|
2517
|
+
Table.Body = Body2;
|
|
2511
2518
|
Table.Cell = Cell;
|
|
2512
2519
|
Table.Column = Column;
|
|
2513
2520
|
Table.Header = Header2;
|
|
@@ -2537,7 +2544,7 @@ var Text = ({
|
|
|
2537
2544
|
return /* @__PURE__ */ React59.createElement(Box35, {
|
|
2538
2545
|
as: "p",
|
|
2539
2546
|
...props,
|
|
2540
|
-
css: { color, cursor, outline, fontSize, textAlign: align
|
|
2547
|
+
css: [styles, { color, cursor, outline, fontSize, textAlign: align }]
|
|
2541
2548
|
}, children);
|
|
2542
2549
|
};
|
|
2543
2550
|
|
|
@@ -2791,6 +2798,7 @@ export {
|
|
|
2791
2798
|
Aside,
|
|
2792
2799
|
Aspect,
|
|
2793
2800
|
Badge,
|
|
2801
|
+
Body,
|
|
2794
2802
|
Box,
|
|
2795
2803
|
Breakout,
|
|
2796
2804
|
Button,
|
|
@@ -2801,7 +2809,6 @@ export {
|
|
|
2801
2809
|
CheckboxGroupContext,
|
|
2802
2810
|
Columns,
|
|
2803
2811
|
Container,
|
|
2804
|
-
Content,
|
|
2805
2812
|
Dialog,
|
|
2806
2813
|
Divider,
|
|
2807
2814
|
Footer,
|
|
@@ -2835,6 +2842,7 @@ export {
|
|
|
2835
2842
|
Tooltip,
|
|
2836
2843
|
Underlay,
|
|
2837
2844
|
VisuallyHidden,
|
|
2845
|
+
extendTheme,
|
|
2838
2846
|
useAsyncList,
|
|
2839
2847
|
useCheckboxGroupContext,
|
|
2840
2848
|
useListData,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marigold/components",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "Components for the Marigold Design System",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -23,14 +23,14 @@
|
|
|
23
23
|
"directory": "packages/components"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@marigold/icons": "1.
|
|
27
|
-
"@marigold/system": "
|
|
26
|
+
"@marigold/icons": "1.1.1",
|
|
27
|
+
"@marigold/system": "3.0.1",
|
|
28
28
|
"@marigold/tokens": "3.1.0",
|
|
29
|
-
"@marigold/types": "0.5.
|
|
29
|
+
"@marigold/types": "0.5.4",
|
|
30
30
|
"@react-aria/button": "3.6.1",
|
|
31
31
|
"@react-aria/checkbox": "3.5.1",
|
|
32
32
|
"@react-aria/dialog": "3.3.1",
|
|
33
|
-
"@react-aria/focus": "3.
|
|
33
|
+
"@react-aria/focus": "3.8.0",
|
|
34
34
|
"@react-aria/i18n": "3.6.0",
|
|
35
35
|
"@react-aria/interactions": "3.11.0",
|
|
36
36
|
"@react-aria/link": "3.3.3",
|
|
@@ -69,6 +69,7 @@
|
|
|
69
69
|
"@react-types/radio": "3.2.3",
|
|
70
70
|
"@react-types/shared": "3.14.1",
|
|
71
71
|
"@react-types/tooltip": "3.2.3",
|
|
72
|
+
"deepmerge": "^4.2.2",
|
|
72
73
|
"react-is": "18.2.0"
|
|
73
74
|
},
|
|
74
75
|
"peerDependencies": {
|