@marigold/components 2.1.3 → 2.2.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.ts +22 -10
- package/dist/index.js +55 -47
- package/dist/index.mjs +61 -49
- package/package.json +44 -44
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { useAsyncList, useListData } from '@react-stately/data';
|
|
2
|
-
import { ThemeExtension, ThemeComponentProps, ThemeExtensionsWithParts, CSSObject, BoxOwnProps, StateAttrProps, Theme as Theme$1,
|
|
2
|
+
import { ThemeExtension, ThemeComponentProps, ResponsiveStyleValue, ThemeExtensionsWithParts, CSSObject, BoxOwnProps, StateAttrProps, Theme as Theme$1, ThemeProviderProps, GlobalProps } from '@marigold/system';
|
|
3
3
|
export { Box, BoxOwnProps, BoxProps, StyleProps, ThemeProvider, useTheme } from '@marigold/system';
|
|
4
4
|
import React, { ReactNode, HTMLAttributes, Key, LabelHTMLAttributes, ForwardRefExoticComponent, RefAttributes, ReactElement } from 'react';
|
|
5
5
|
import { ComponentProps, PolymorphicPropsWithRef, PolymorphicComponentWithRef, NonZeroPercentage } from '@marigold/types';
|
|
@@ -50,8 +50,15 @@ interface CardThemeExtension extends ThemeExtension<'Card'> {
|
|
|
50
50
|
}
|
|
51
51
|
interface CardProps extends ThemeComponentProps, ComponentProps<'div'> {
|
|
52
52
|
children?: ReactNode;
|
|
53
|
+
p?: ResponsiveStyleValue<string>;
|
|
54
|
+
px?: ResponsiveStyleValue<string>;
|
|
55
|
+
py?: ResponsiveStyleValue<string>;
|
|
56
|
+
pt?: ResponsiveStyleValue<string>;
|
|
57
|
+
pb?: ResponsiveStyleValue<string>;
|
|
58
|
+
pl?: ResponsiveStyleValue<string>;
|
|
59
|
+
pr?: ResponsiveStyleValue<string>;
|
|
53
60
|
}
|
|
54
|
-
declare const Card: ({ children, variant, size, ...props }: CardProps) => JSX.Element;
|
|
61
|
+
declare const Card: ({ children, variant, size, p, px, py, pt, pb, pl, pr, ...props }: CardProps) => JSX.Element;
|
|
55
62
|
|
|
56
63
|
interface CheckboxThemeExtension extends ThemeExtensionsWithParts<'Checkbox', [
|
|
57
64
|
'container',
|
|
@@ -63,7 +70,7 @@ interface CheckboxThemeExtension extends ThemeExtensionsWithParts<'Checkbox', [
|
|
|
63
70
|
* `react-aria` has a slightly different API for the above events.
|
|
64
71
|
* Thus, we adjust our regular props to match them.
|
|
65
72
|
*/
|
|
66
|
-
declare type CustomCheckboxProps = 'value' | 'onChange' | 'onFocus' | 'onBlur';
|
|
73
|
+
declare type CustomCheckboxProps = 'value' | 'onChange' | 'onFocus' | 'onBlur' | 'onKeyDown' | 'onKeyUp';
|
|
67
74
|
interface CheckboxProps extends ThemeComponentProps, Omit<ComponentProps<'input'>, 'size' | 'type' | 'defaultValue' | CustomCheckboxProps>, Pick<AriaCheckboxProps, CustomCheckboxProps> {
|
|
68
75
|
children?: ReactNode;
|
|
69
76
|
indeterminate?: boolean;
|
|
@@ -470,8 +477,8 @@ interface TextAreaThemeExtension extends ThemeExtension<'TextArea'> {
|
|
|
470
477
|
* `react-aria` has a slightly different API for the above events.
|
|
471
478
|
* Thus, we adjust our regular props to match them.
|
|
472
479
|
*/
|
|
473
|
-
declare type
|
|
474
|
-
interface TextAreaProps extends Omit<ComponentProps<'textarea'>, 'value' | 'defaultValue' | 'size' |
|
|
480
|
+
declare type CustomTextAreaEvents = 'onChange' | 'onFocus' | 'onBlur' | 'onCopy' | 'onSelect' | 'onPaste' | 'onCut' | 'onCompositionStart' | 'onCompositionUpdate' | 'onCompositionEnd' | 'onBeforeInput' | 'onInput' | 'onKeyDown' | 'onKeyUp';
|
|
481
|
+
interface TextAreaProps extends Omit<ComponentProps<'textarea'>, 'value' | 'defaultValue' | 'size' | CustomTextAreaEvents>, Pick<AriaTextFieldProps, CustomTextAreaEvents>, Pick<FieldBaseProps, 'label' | 'description' | 'error' | 'errorMessage'> {
|
|
475
482
|
variant?: string;
|
|
476
483
|
size?: string;
|
|
477
484
|
width?: string;
|
|
@@ -553,9 +560,9 @@ interface ContainerProps extends ComponentProps<'div'> {
|
|
|
553
560
|
contentType?: 'content' | 'header';
|
|
554
561
|
size?: keyof typeof size.content | keyof typeof size.header;
|
|
555
562
|
align?: 'left' | 'right' | 'center';
|
|
556
|
-
|
|
563
|
+
alignItems?: 'left' | 'right' | 'center' | 'none';
|
|
557
564
|
}
|
|
558
|
-
declare const Container: ({ contentType, size, align,
|
|
565
|
+
declare const Container: ({ contentType, size, align, alignItems, children, ...props }: ContainerProps) => JSX.Element;
|
|
559
566
|
|
|
560
567
|
declare const ALIGNMENT_X$1: {
|
|
561
568
|
left: string;
|
|
@@ -603,12 +610,17 @@ interface StackProps {
|
|
|
603
610
|
}
|
|
604
611
|
declare const Stack: ({ children, space, alignX, alignY, stretch, ...props }: StackProps) => JSX.Element;
|
|
605
612
|
|
|
606
|
-
|
|
613
|
+
/**
|
|
614
|
+
* `react-aria` has a slightly different API for the above events.
|
|
615
|
+
* Thus, we adjust our regular props to match them.
|
|
616
|
+
*/
|
|
617
|
+
declare type CustomTextFieldEvents = 'onChange' | 'onFocus' | 'onBlur' | 'onKeyDown' | 'onKeyUp';
|
|
618
|
+
interface TextFieldProps extends Omit<ComponentProps<'input'>, 'value' | 'defaultValue' | 'size' | 'width' | CustomTextFieldEvents>,
|
|
607
619
|
/**
|
|
608
620
|
* `react-aria` has a slightly different API for `onChange`, `onFocus`
|
|
609
621
|
* and `onBlur` events. Thus, we adjust our regular props to match them.
|
|
610
622
|
*/
|
|
611
|
-
Pick<AriaTextFieldProps,
|
|
623
|
+
Pick<AriaTextFieldProps, CustomTextFieldEvents>, Pick<FieldBaseProps, 'label' | 'description' | 'error' | 'errorMessage'> {
|
|
612
624
|
variant?: string;
|
|
613
625
|
size?: string;
|
|
614
626
|
width?: string;
|
|
@@ -624,4 +636,4 @@ interface TilesProps {
|
|
|
624
636
|
}
|
|
625
637
|
declare const Tiles: React.ForwardRefExoticComponent<TilesProps & React.RefAttributes<HTMLDivElement>>;
|
|
626
638
|
|
|
627
|
-
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, Content, ContentProps, ContentThemeExtension, CustomCheckboxProps, CustomRadioProps, CustomSwitchProps,
|
|
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, Content, ContentProps, ContentThemeExtension, CustomCheckboxProps, CustomRadioProps, CustomSwitchProps, CustomTextAreaEvents, CustomTextFieldEvents, 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, useCheckboxGroupContext };
|
package/dist/index.js
CHANGED
|
@@ -253,11 +253,23 @@ var Button = (0, import_react5.forwardRef)(
|
|
|
253
253
|
// src/Card/Card.tsx
|
|
254
254
|
var import_react6 = __toESM(require("react"));
|
|
255
255
|
var import_system4 = require("@marigold/system");
|
|
256
|
-
var Card = ({
|
|
256
|
+
var Card = ({
|
|
257
|
+
children,
|
|
258
|
+
variant,
|
|
259
|
+
size,
|
|
260
|
+
p,
|
|
261
|
+
px,
|
|
262
|
+
py,
|
|
263
|
+
pt,
|
|
264
|
+
pb,
|
|
265
|
+
pl,
|
|
266
|
+
pr,
|
|
267
|
+
...props
|
|
268
|
+
}) => {
|
|
257
269
|
const styles = (0, import_system4.useComponentStyles)("Card", { variant, size });
|
|
258
270
|
return /* @__PURE__ */ import_react6.default.createElement(import_system4.Box, {
|
|
259
271
|
...props,
|
|
260
|
-
css: styles
|
|
272
|
+
css: [styles, { p, px, py, pt, pb, pl, pr }]
|
|
261
273
|
}, children);
|
|
262
274
|
};
|
|
263
275
|
|
|
@@ -522,63 +534,62 @@ var Columns = ({
|
|
|
522
534
|
)}`
|
|
523
535
|
);
|
|
524
536
|
}
|
|
525
|
-
const getColumnWidths = columns.map((column, index) => {
|
|
526
|
-
return {
|
|
527
|
-
[`> :nth-of-type(${index + 1})`]: {
|
|
528
|
-
flexGrow: column
|
|
529
|
-
}
|
|
530
|
-
};
|
|
531
|
-
});
|
|
532
537
|
return /* @__PURE__ */ import_react11.default.createElement(import_system.Box, {
|
|
533
538
|
display: "flex",
|
|
534
|
-
css:
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
},
|
|
542
|
-
...getColumnWidths
|
|
543
|
-
),
|
|
539
|
+
css: {
|
|
540
|
+
flexWrap: "wrap",
|
|
541
|
+
gap: space,
|
|
542
|
+
"> *": {
|
|
543
|
+
flexBasis: `calc(( ${collapseAt} - 100%) * 999)`
|
|
544
|
+
}
|
|
545
|
+
},
|
|
544
546
|
...props
|
|
545
|
-
}, children)
|
|
547
|
+
}, import_react11.Children.map(children, (child, idx) => /* @__PURE__ */ import_react11.default.createElement(import_system.Box, {
|
|
548
|
+
css: {
|
|
549
|
+
flexGrow: columns[idx]
|
|
550
|
+
}
|
|
551
|
+
}, (0, import_react11.isValidElement)(child) ? (0, import_react11.cloneElement)(child) : null)));
|
|
546
552
|
};
|
|
547
553
|
|
|
548
554
|
// src/Container/Container.tsx
|
|
549
555
|
var import_react12 = __toESM(require("react"));
|
|
550
556
|
var import_tokens2 = require("@marigold/tokens");
|
|
551
|
-
var
|
|
552
|
-
left: "
|
|
557
|
+
var ALIGN_ITEMS = {
|
|
558
|
+
left: "start",
|
|
553
559
|
center: "center",
|
|
554
|
-
right: "
|
|
560
|
+
right: "end",
|
|
561
|
+
none: "undefined"
|
|
562
|
+
};
|
|
563
|
+
var ALIGN = {
|
|
564
|
+
left: (maxWidth) => ({
|
|
565
|
+
gridTemplateColumns: `minmax(0, ${maxWidth}) 1fr 1fr`,
|
|
566
|
+
gridColumn: 1
|
|
567
|
+
}),
|
|
568
|
+
center: (maxWidth) => ({
|
|
569
|
+
gridTemplateColumns: `1fr minmax(0, ${maxWidth}) 1fr`,
|
|
570
|
+
gridColumn: 2
|
|
571
|
+
}),
|
|
572
|
+
right: (maxWidth) => ({
|
|
573
|
+
gridTemplateColumns: `1fr 1fr minmax(0, ${maxWidth})`,
|
|
574
|
+
gridColumn: 3
|
|
575
|
+
})
|
|
555
576
|
};
|
|
556
577
|
var Container = ({
|
|
557
578
|
contentType = "content",
|
|
558
579
|
size = "medium",
|
|
559
580
|
align = "left",
|
|
560
|
-
|
|
581
|
+
alignItems = "none",
|
|
561
582
|
children,
|
|
562
583
|
...props
|
|
563
584
|
}) => {
|
|
564
585
|
const maxWidth = import_tokens2.size[contentType][size];
|
|
565
|
-
let gridTemplateColumns = `${maxWidth} 1fr 1fr`;
|
|
566
|
-
let gridColumn = 1;
|
|
567
|
-
if (alignContainer === "center") {
|
|
568
|
-
gridTemplateColumns = `1fr ${maxWidth} 1fr`;
|
|
569
|
-
gridColumn = 2;
|
|
570
|
-
}
|
|
571
|
-
if (alignContainer === "right") {
|
|
572
|
-
gridTemplateColumns = `1fr 1fr ${maxWidth}`;
|
|
573
|
-
gridColumn = 3;
|
|
574
|
-
}
|
|
575
586
|
return /* @__PURE__ */ import_react12.default.createElement(import_system.Box, {
|
|
576
587
|
display: "grid",
|
|
577
588
|
css: {
|
|
578
|
-
gridTemplateColumns,
|
|
579
|
-
placeItems:
|
|
589
|
+
gridTemplateColumns: ALIGN[align](maxWidth).gridTemplateColumns,
|
|
590
|
+
placeItems: ALIGN_ITEMS[alignItems],
|
|
580
591
|
"> *": {
|
|
581
|
-
gridColumn
|
|
592
|
+
gridColumn: ALIGN[align](maxWidth).gridColumn
|
|
582
593
|
}
|
|
583
594
|
},
|
|
584
595
|
...props
|
|
@@ -1791,14 +1802,14 @@ var Chevron = ({ css }) => /* @__PURE__ */ import_react49.default.createElement(
|
|
|
1791
1802
|
}));
|
|
1792
1803
|
var Select = (0, import_react49.forwardRef)(
|
|
1793
1804
|
({ variant, size, width, open, disabled, required, error, ...rest }, ref) => {
|
|
1794
|
-
const formatMessage = (0, import_i18n2.
|
|
1805
|
+
const formatMessage = (0, import_i18n2.useLocalizedStringFormatter)(messages);
|
|
1795
1806
|
const buttonRef = (0, import_utils11.useObjectRef)(ref);
|
|
1796
1807
|
const props = {
|
|
1797
1808
|
isOpen: open,
|
|
1798
1809
|
isDisabled: disabled,
|
|
1799
1810
|
isRequired: required,
|
|
1800
1811
|
validationState: error ? "invalid" : "valid",
|
|
1801
|
-
placeholder: rest.placeholder || formatMessage("placeholder"),
|
|
1812
|
+
placeholder: rest.placeholder || formatMessage.format("placeholder"),
|
|
1802
1813
|
...rest
|
|
1803
1814
|
};
|
|
1804
1815
|
const state = (0, import_select2.useSelectState)(props);
|
|
@@ -2450,18 +2461,15 @@ var Table = ({
|
|
|
2450
2461
|
const { collection } = state;
|
|
2451
2462
|
return /* @__PURE__ */ import_react64.default.createElement(TableContext.Provider, {
|
|
2452
2463
|
value: { state, interactive, styles }
|
|
2453
|
-
}, /* @__PURE__ */ import_react64.default.createElement(import_system45.Box, {
|
|
2454
|
-
__baseCSS: {
|
|
2455
|
-
overflow: ["scroll", "unset"],
|
|
2456
|
-
whiteSpace: ["nowrap", "unset"]
|
|
2457
|
-
}
|
|
2458
2464
|
}, /* @__PURE__ */ import_react64.default.createElement(import_system45.Box, {
|
|
2459
2465
|
as: "table",
|
|
2460
2466
|
ref: tableRef,
|
|
2461
2467
|
__baseCSS: {
|
|
2468
|
+
display: "block",
|
|
2462
2469
|
borderCollapse: "collapse",
|
|
2463
|
-
|
|
2464
|
-
|
|
2470
|
+
overflow: "auto",
|
|
2471
|
+
whiteSpace: "nowrap",
|
|
2472
|
+
width: stretch ? "100%" : void 0
|
|
2465
2473
|
},
|
|
2466
2474
|
css: styles.table,
|
|
2467
2475
|
...gridProps
|
|
@@ -2493,7 +2501,7 @@ var Table = ({
|
|
|
2493
2501
|
cell
|
|
2494
2502
|
});
|
|
2495
2503
|
}
|
|
2496
|
-
))))))
|
|
2504
|
+
))))));
|
|
2497
2505
|
};
|
|
2498
2506
|
Table.Body = import_table10.TableBody;
|
|
2499
2507
|
Table.Cell = import_table10.Cell;
|
package/dist/index.mjs
CHANGED
|
@@ -178,11 +178,23 @@ import {
|
|
|
178
178
|
Box as Box3,
|
|
179
179
|
useComponentStyles as useComponentStyles3
|
|
180
180
|
} from "@marigold/system";
|
|
181
|
-
var Card = ({
|
|
181
|
+
var Card = ({
|
|
182
|
+
children,
|
|
183
|
+
variant,
|
|
184
|
+
size,
|
|
185
|
+
p,
|
|
186
|
+
px,
|
|
187
|
+
py,
|
|
188
|
+
pt,
|
|
189
|
+
pb,
|
|
190
|
+
pl,
|
|
191
|
+
pr,
|
|
192
|
+
...props
|
|
193
|
+
}) => {
|
|
182
194
|
const styles = useComponentStyles3("Card", { variant, size });
|
|
183
195
|
return /* @__PURE__ */ React6.createElement(Box3, {
|
|
184
196
|
...props,
|
|
185
|
-
css: styles
|
|
197
|
+
css: [styles, { p, px, py, pt, pb, pl, pr }]
|
|
186
198
|
}, children);
|
|
187
199
|
};
|
|
188
200
|
|
|
@@ -441,7 +453,11 @@ var Checkbox = forwardRef2(
|
|
|
441
453
|
);
|
|
442
454
|
|
|
443
455
|
// src/Columns/Columns.tsx
|
|
444
|
-
import React11, {
|
|
456
|
+
import React11, {
|
|
457
|
+
Children,
|
|
458
|
+
cloneElement,
|
|
459
|
+
isValidElement
|
|
460
|
+
} from "react";
|
|
445
461
|
var Columns = ({
|
|
446
462
|
space = "none",
|
|
447
463
|
columns,
|
|
@@ -456,63 +472,62 @@ var Columns = ({
|
|
|
456
472
|
)}`
|
|
457
473
|
);
|
|
458
474
|
}
|
|
459
|
-
const getColumnWidths = columns.map((column, index) => {
|
|
460
|
-
return {
|
|
461
|
-
[`> :nth-of-type(${index + 1})`]: {
|
|
462
|
-
flexGrow: column
|
|
463
|
-
}
|
|
464
|
-
};
|
|
465
|
-
});
|
|
466
475
|
return /* @__PURE__ */ React11.createElement(Box, {
|
|
467
476
|
display: "flex",
|
|
468
|
-
css:
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
},
|
|
476
|
-
...getColumnWidths
|
|
477
|
-
),
|
|
477
|
+
css: {
|
|
478
|
+
flexWrap: "wrap",
|
|
479
|
+
gap: space,
|
|
480
|
+
"> *": {
|
|
481
|
+
flexBasis: `calc(( ${collapseAt} - 100%) * 999)`
|
|
482
|
+
}
|
|
483
|
+
},
|
|
478
484
|
...props
|
|
479
|
-
}, children)
|
|
485
|
+
}, Children.map(children, (child, idx) => /* @__PURE__ */ React11.createElement(Box, {
|
|
486
|
+
css: {
|
|
487
|
+
flexGrow: columns[idx]
|
|
488
|
+
}
|
|
489
|
+
}, isValidElement(child) ? cloneElement(child) : null)));
|
|
480
490
|
};
|
|
481
491
|
|
|
482
492
|
// src/Container/Container.tsx
|
|
483
493
|
import React12 from "react";
|
|
484
494
|
import { size as tokenSize } from "@marigold/tokens";
|
|
485
|
-
var
|
|
486
|
-
left: "
|
|
495
|
+
var ALIGN_ITEMS = {
|
|
496
|
+
left: "start",
|
|
487
497
|
center: "center",
|
|
488
|
-
right: "
|
|
498
|
+
right: "end",
|
|
499
|
+
none: "undefined"
|
|
500
|
+
};
|
|
501
|
+
var ALIGN = {
|
|
502
|
+
left: (maxWidth) => ({
|
|
503
|
+
gridTemplateColumns: `minmax(0, ${maxWidth}) 1fr 1fr`,
|
|
504
|
+
gridColumn: 1
|
|
505
|
+
}),
|
|
506
|
+
center: (maxWidth) => ({
|
|
507
|
+
gridTemplateColumns: `1fr minmax(0, ${maxWidth}) 1fr`,
|
|
508
|
+
gridColumn: 2
|
|
509
|
+
}),
|
|
510
|
+
right: (maxWidth) => ({
|
|
511
|
+
gridTemplateColumns: `1fr 1fr minmax(0, ${maxWidth})`,
|
|
512
|
+
gridColumn: 3
|
|
513
|
+
})
|
|
489
514
|
};
|
|
490
515
|
var Container = ({
|
|
491
516
|
contentType = "content",
|
|
492
517
|
size = "medium",
|
|
493
518
|
align = "left",
|
|
494
|
-
|
|
519
|
+
alignItems = "none",
|
|
495
520
|
children,
|
|
496
521
|
...props
|
|
497
522
|
}) => {
|
|
498
523
|
const maxWidth = tokenSize[contentType][size];
|
|
499
|
-
let gridTemplateColumns = `${maxWidth} 1fr 1fr`;
|
|
500
|
-
let gridColumn = 1;
|
|
501
|
-
if (alignContainer === "center") {
|
|
502
|
-
gridTemplateColumns = `1fr ${maxWidth} 1fr`;
|
|
503
|
-
gridColumn = 2;
|
|
504
|
-
}
|
|
505
|
-
if (alignContainer === "right") {
|
|
506
|
-
gridTemplateColumns = `1fr 1fr ${maxWidth}`;
|
|
507
|
-
gridColumn = 3;
|
|
508
|
-
}
|
|
509
524
|
return /* @__PURE__ */ React12.createElement(Box, {
|
|
510
525
|
display: "grid",
|
|
511
526
|
css: {
|
|
512
|
-
gridTemplateColumns,
|
|
513
|
-
placeItems:
|
|
527
|
+
gridTemplateColumns: ALIGN[align](maxWidth).gridTemplateColumns,
|
|
528
|
+
placeItems: ALIGN_ITEMS[alignItems],
|
|
514
529
|
"> *": {
|
|
515
|
-
gridColumn
|
|
530
|
+
gridColumn: ALIGN[align](maxWidth).gridColumn
|
|
516
531
|
}
|
|
517
532
|
},
|
|
518
533
|
...props
|
|
@@ -1630,7 +1645,7 @@ import React44, {
|
|
|
1630
1645
|
} from "react";
|
|
1631
1646
|
import { useButton as useButton4 } from "@react-aria/button";
|
|
1632
1647
|
import { FocusScope as FocusScope3, useFocusRing as useFocusRing6 } from "@react-aria/focus";
|
|
1633
|
-
import {
|
|
1648
|
+
import { useLocalizedStringFormatter } from "@react-aria/i18n";
|
|
1634
1649
|
import { DismissButton as DismissButton2, useOverlayPosition as useOverlayPosition2 } from "@react-aria/overlays";
|
|
1635
1650
|
import { HiddenSelect, useSelect } from "@react-aria/select";
|
|
1636
1651
|
import { useSelectState } from "@react-stately/select";
|
|
@@ -1775,14 +1790,14 @@ var Chevron = ({ css }) => /* @__PURE__ */ React44.createElement(Box27, {
|
|
|
1775
1790
|
}));
|
|
1776
1791
|
var Select = forwardRef10(
|
|
1777
1792
|
({ variant, size, width, open, disabled, required, error, ...rest }, ref) => {
|
|
1778
|
-
const formatMessage =
|
|
1793
|
+
const formatMessage = useLocalizedStringFormatter(messages);
|
|
1779
1794
|
const buttonRef = useObjectRef8(ref);
|
|
1780
1795
|
const props = {
|
|
1781
1796
|
isOpen: open,
|
|
1782
1797
|
isDisabled: disabled,
|
|
1783
1798
|
isRequired: required,
|
|
1784
1799
|
validationState: error ? "invalid" : "valid",
|
|
1785
|
-
placeholder: rest.placeholder || formatMessage("placeholder"),
|
|
1800
|
+
placeholder: rest.placeholder || formatMessage.format("placeholder"),
|
|
1786
1801
|
...rest
|
|
1787
1802
|
};
|
|
1788
1803
|
const state = useSelectState(props);
|
|
@@ -2450,18 +2465,15 @@ var Table = ({
|
|
|
2450
2465
|
const { collection } = state;
|
|
2451
2466
|
return /* @__PURE__ */ React58.createElement(TableContext.Provider, {
|
|
2452
2467
|
value: { state, interactive, styles }
|
|
2453
|
-
}, /* @__PURE__ */ React58.createElement(Box34, {
|
|
2454
|
-
__baseCSS: {
|
|
2455
|
-
overflow: ["scroll", "unset"],
|
|
2456
|
-
whiteSpace: ["nowrap", "unset"]
|
|
2457
|
-
}
|
|
2458
2468
|
}, /* @__PURE__ */ React58.createElement(Box34, {
|
|
2459
2469
|
as: "table",
|
|
2460
2470
|
ref: tableRef,
|
|
2461
2471
|
__baseCSS: {
|
|
2472
|
+
display: "block",
|
|
2462
2473
|
borderCollapse: "collapse",
|
|
2463
|
-
|
|
2464
|
-
|
|
2474
|
+
overflow: "auto",
|
|
2475
|
+
whiteSpace: "nowrap",
|
|
2476
|
+
width: stretch ? "100%" : void 0
|
|
2465
2477
|
},
|
|
2466
2478
|
css: styles.table,
|
|
2467
2479
|
...gridProps
|
|
@@ -2493,7 +2505,7 @@ var Table = ({
|
|
|
2493
2505
|
cell
|
|
2494
2506
|
});
|
|
2495
2507
|
}
|
|
2496
|
-
))))))
|
|
2508
|
+
))))));
|
|
2497
2509
|
};
|
|
2498
2510
|
Table.Body = Body;
|
|
2499
2511
|
Table.Cell = Cell;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marigold/components",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "Components for the Marigold Design System",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -23,52 +23,52 @@
|
|
|
23
23
|
"directory": "packages/components"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@marigold/icons": "1.0.
|
|
27
|
-
"@marigold/system": "2.
|
|
26
|
+
"@marigold/icons": "1.0.5",
|
|
27
|
+
"@marigold/system": "2.2.0",
|
|
28
28
|
"@marigold/tokens": "3.1.0",
|
|
29
|
-
"@marigold/types": "0.5.
|
|
30
|
-
"@react-aria/button": "3.6.
|
|
31
|
-
"@react-aria/checkbox": "3.5.
|
|
32
|
-
"@react-aria/dialog": "3.3.
|
|
29
|
+
"@marigold/types": "0.5.3",
|
|
30
|
+
"@react-aria/button": "3.6.1",
|
|
31
|
+
"@react-aria/checkbox": "3.5.1",
|
|
32
|
+
"@react-aria/dialog": "3.3.1",
|
|
33
33
|
"@react-aria/focus": "3.7.0",
|
|
34
|
-
"@react-aria/i18n": "3.
|
|
35
|
-
"@react-aria/interactions": "3.
|
|
36
|
-
"@react-aria/link": "3.3.
|
|
37
|
-
"@react-aria/listbox": "3.6.
|
|
38
|
-
"@react-aria/menu": "3.6.
|
|
39
|
-
"@react-aria/numberfield": "3.3.
|
|
40
|
-
"@react-aria/overlays": "3.10.
|
|
41
|
-
"@react-aria/radio": "3.3.
|
|
42
|
-
"@react-aria/select": "3.8.
|
|
43
|
-
"@react-aria/separator": "3.2.
|
|
44
|
-
"@react-aria/slider": "3.2.
|
|
34
|
+
"@react-aria/i18n": "3.6.0",
|
|
35
|
+
"@react-aria/interactions": "3.11.0",
|
|
36
|
+
"@react-aria/link": "3.3.3",
|
|
37
|
+
"@react-aria/listbox": "3.6.1",
|
|
38
|
+
"@react-aria/menu": "3.6.1",
|
|
39
|
+
"@react-aria/numberfield": "3.3.1",
|
|
40
|
+
"@react-aria/overlays": "3.10.1",
|
|
41
|
+
"@react-aria/radio": "3.3.1",
|
|
42
|
+
"@react-aria/select": "3.8.1",
|
|
43
|
+
"@react-aria/separator": "3.2.3",
|
|
44
|
+
"@react-aria/slider": "3.2.1",
|
|
45
45
|
"@react-aria/ssr": "3.3.0",
|
|
46
|
-
"@react-aria/switch": "3.2.
|
|
47
|
-
"@react-aria/table": "3.4.
|
|
48
|
-
"@react-aria/textfield": "3.7.
|
|
49
|
-
"@react-aria/tooltip": "3.3.
|
|
50
|
-
"@react-aria/utils": "3.13.
|
|
51
|
-
"@react-aria/visually-hidden": "3.4.
|
|
52
|
-
"@react-stately/checkbox": "3.2.
|
|
53
|
-
"@react-stately/collections": "3.4.
|
|
46
|
+
"@react-aria/switch": "3.2.3",
|
|
47
|
+
"@react-aria/table": "3.4.1",
|
|
48
|
+
"@react-aria/textfield": "3.7.1",
|
|
49
|
+
"@react-aria/tooltip": "3.3.1",
|
|
50
|
+
"@react-aria/utils": "3.13.3",
|
|
51
|
+
"@react-aria/visually-hidden": "3.4.1",
|
|
52
|
+
"@react-stately/checkbox": "3.2.1",
|
|
53
|
+
"@react-stately/collections": "3.4.3",
|
|
54
54
|
"@react-stately/data": "^3.6.0",
|
|
55
|
-
"@react-stately/list": "3.5.
|
|
56
|
-
"@react-stately/menu": "3.4.
|
|
57
|
-
"@react-stately/numberfield": "3.2.
|
|
58
|
-
"@react-stately/overlays": "3.4.
|
|
59
|
-
"@react-stately/radio": "3.5.
|
|
60
|
-
"@react-stately/select": "3.3.
|
|
61
|
-
"@react-stately/slider": "3.2.
|
|
62
|
-
"@react-stately/table": "3.
|
|
63
|
-
"@react-stately/toggle": "3.4.
|
|
64
|
-
"@react-stately/tooltip": "3.2.
|
|
65
|
-
"@react-stately/tree": "3.3.
|
|
66
|
-
"@react-types/checkbox": "3.3.
|
|
67
|
-
"@react-types/dialog": "3.4.
|
|
68
|
-
"@react-types/numberfield": "3.3.
|
|
69
|
-
"@react-types/radio": "3.2.
|
|
70
|
-
"@react-types/shared": "3.14.
|
|
71
|
-
"@react-types/tooltip": "3.2.
|
|
55
|
+
"@react-stately/list": "3.5.3",
|
|
56
|
+
"@react-stately/menu": "3.4.1",
|
|
57
|
+
"@react-stately/numberfield": "3.2.1",
|
|
58
|
+
"@react-stately/overlays": "3.4.1",
|
|
59
|
+
"@react-stately/radio": "3.5.1",
|
|
60
|
+
"@react-stately/select": "3.3.1",
|
|
61
|
+
"@react-stately/slider": "3.2.1",
|
|
62
|
+
"@react-stately/table": "3.4.0",
|
|
63
|
+
"@react-stately/toggle": "3.4.1",
|
|
64
|
+
"@react-stately/tooltip": "3.2.1",
|
|
65
|
+
"@react-stately/tree": "3.3.3",
|
|
66
|
+
"@react-types/checkbox": "3.3.3",
|
|
67
|
+
"@react-types/dialog": "3.4.3",
|
|
68
|
+
"@react-types/numberfield": "3.3.3",
|
|
69
|
+
"@react-types/radio": "3.2.3",
|
|
70
|
+
"@react-types/shared": "3.14.1",
|
|
71
|
+
"@react-types/tooltip": "3.2.3",
|
|
72
72
|
"react-is": "18.2.0"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"@marigold/tsconfig": "0.3.0",
|
|
80
80
|
"react": "18.2.0",
|
|
81
81
|
"react-dom": "18.2.0",
|
|
82
|
-
"tsup": "6.2.
|
|
82
|
+
"tsup": "6.2.3"
|
|
83
83
|
},
|
|
84
84
|
"scripts": {
|
|
85
85
|
"build": "tsup src/index.ts",
|