@marigold/components 9.0.0 → 9.0.2
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 +59 -26
- package/dist/index.d.ts +59 -26
- package/dist/index.js +198 -179
- package/dist/index.mjs +46 -31
- package/package.json +24 -24
package/dist/index.mjs
CHANGED
|
@@ -306,10 +306,9 @@ var Aspect = ({
|
|
|
306
306
|
};
|
|
307
307
|
|
|
308
308
|
// src/Autocomplete/Autocomplete.tsx
|
|
309
|
-
import {
|
|
309
|
+
import React, {
|
|
310
310
|
forwardRef as forwardRef8
|
|
311
311
|
} from "react";
|
|
312
|
-
import React from "react";
|
|
313
312
|
import { ComboBox, ComboBoxStateContext } from "react-aria-components";
|
|
314
313
|
import { cn as cn13, useClassNames as useClassNames9 } from "@marigold/system";
|
|
315
314
|
|
|
@@ -600,10 +599,10 @@ import { createContext as createContext2, useContext as useContext3 } from "reac
|
|
|
600
599
|
var ListBoxContext = createContext2({});
|
|
601
600
|
var useListBoxContext = () => useContext3(ListBoxContext);
|
|
602
601
|
|
|
603
|
-
// src/ListBox/
|
|
602
|
+
// src/ListBox/ListBoxItem.tsx
|
|
604
603
|
import { ListBoxItem } from "react-aria-components";
|
|
605
604
|
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
606
|
-
var _ListBoxItem = (props) => {
|
|
605
|
+
var _ListBoxItem = ({ ...props }) => {
|
|
607
606
|
const { classNames: classNames2 } = useListBoxContext();
|
|
608
607
|
return /* @__PURE__ */ jsx13(ListBoxItem, { ...props, className: classNames2.option });
|
|
609
608
|
};
|
|
@@ -705,7 +704,7 @@ var Underlay = ({
|
|
|
705
704
|
ModalOverlay,
|
|
706
705
|
{
|
|
707
706
|
className: ({ isEntering, isExiting }) => cn11(
|
|
708
|
-
"fixed inset-0 z-40 flex min-h-full items-center justify-center overflow-y-auto backdrop-blur
|
|
707
|
+
"fixed inset-0 z-40 flex min-h-full items-center justify-center overflow-y-auto backdrop-blur",
|
|
709
708
|
isEntering ? "animate-in fade-in duration-300 ease-out" : "",
|
|
710
709
|
isExiting ? "animate-out fade-out duration-200 ease-in" : "",
|
|
711
710
|
classNames2
|
|
@@ -779,7 +778,10 @@ var AutocompleteInput = ({
|
|
|
779
778
|
{
|
|
780
779
|
ref,
|
|
781
780
|
className: {
|
|
782
|
-
action: cn13(
|
|
781
|
+
action: cn13(
|
|
782
|
+
(state == null ? void 0 : state.inputValue) === "" ? "invisible" : "visible",
|
|
783
|
+
classNames2
|
|
784
|
+
)
|
|
783
785
|
},
|
|
784
786
|
onKeyDown: (e) => {
|
|
785
787
|
if (e.key === "Enter" || e.key === "Escape") {
|
|
@@ -825,7 +827,7 @@ var _Autocomplete = forwardRef8(
|
|
|
825
827
|
isRequired: required,
|
|
826
828
|
...rest
|
|
827
829
|
};
|
|
828
|
-
return /* @__PURE__ */ jsxs8(FieldBase, { as: ComboBox, ...props, children: [
|
|
830
|
+
return /* @__PURE__ */ jsxs8(FieldBase, { as: ComboBox, ref, ...props, children: [
|
|
829
831
|
/* @__PURE__ */ jsx19(AutocompleteInput, { onSubmit, onClear, ref }),
|
|
830
832
|
/* @__PURE__ */ jsx19(_Popover, { children: /* @__PURE__ */ jsx19(_ListBox, { children }) })
|
|
831
833
|
] });
|
|
@@ -1106,7 +1108,6 @@ var _Checkbox = forwardRef11(
|
|
|
1106
1108
|
};
|
|
1107
1109
|
const { labelWidth } = useFieldGroupContext();
|
|
1108
1110
|
const group = useCheckboxGroupContext();
|
|
1109
|
-
console.log(group);
|
|
1110
1111
|
const classNames2 = useClassNames16({
|
|
1111
1112
|
component: "Checkbox",
|
|
1112
1113
|
variant: variant || (group == null ? void 0 : group.variant),
|
|
@@ -1539,21 +1540,16 @@ var Image = ({
|
|
|
1539
1540
|
};
|
|
1540
1541
|
|
|
1541
1542
|
// src/Inline/Inline.tsx
|
|
1542
|
-
import {
|
|
1543
|
-
alignment as alignment2,
|
|
1544
|
-
cn as cn27,
|
|
1545
|
-
gapSpace as gapSpace6
|
|
1546
|
-
} from "@marigold/system";
|
|
1543
|
+
import { alignment as alignment2, cn as cn27, gapSpace as gapSpace6 } from "@marigold/system";
|
|
1547
1544
|
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
1548
1545
|
var Inline = ({
|
|
1549
1546
|
space = 0,
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
alignY = ((_b) => (_b = orientation == null ? void 0 : orientation.horizontal) == null ? void 0 : _b.alignY)(),
|
|
1547
|
+
alignX,
|
|
1548
|
+
alignY,
|
|
1553
1549
|
children,
|
|
1554
1550
|
...props
|
|
1555
1551
|
}) => {
|
|
1556
|
-
var
|
|
1552
|
+
var _a, _b, _c, _d;
|
|
1557
1553
|
return /* @__PURE__ */ jsx42(
|
|
1558
1554
|
"div",
|
|
1559
1555
|
{
|
|
@@ -1561,7 +1557,7 @@ var Inline = ({
|
|
|
1561
1557
|
className: cn27(
|
|
1562
1558
|
"flex flex-wrap",
|
|
1563
1559
|
gapSpace6[space],
|
|
1564
|
-
alignX && ((
|
|
1560
|
+
alignX && ((_b = (_a = alignment2) == null ? void 0 : _a.horizontal) == null ? void 0 : _b.alignmentX[alignX]),
|
|
1565
1561
|
alignY && ((_d = (_c = alignment2) == null ? void 0 : _c.horizontal) == null ? void 0 : _d.alignmentY[alignY])
|
|
1566
1562
|
),
|
|
1567
1563
|
children
|
|
@@ -2736,7 +2732,7 @@ var _Select = forwardRef18(
|
|
|
2736
2732
|
classNames2.select
|
|
2737
2733
|
),
|
|
2738
2734
|
children: [
|
|
2739
|
-
/* @__PURE__ */ jsx73(SelectValue, {}),
|
|
2735
|
+
/* @__PURE__ */ jsx73(SelectValue, { className: "[&>[slot=description]]:hidden" }),
|
|
2740
2736
|
/* @__PURE__ */ jsx73(ChevronDown, { className: cn42("size-4", classNames2.icon) })
|
|
2741
2737
|
]
|
|
2742
2738
|
}
|
|
@@ -2778,7 +2774,10 @@ var _SelectListItem = forwardRef19(
|
|
|
2778
2774
|
{
|
|
2779
2775
|
textValue,
|
|
2780
2776
|
...props,
|
|
2781
|
-
className: cn43(
|
|
2777
|
+
className: cn43(
|
|
2778
|
+
"items-center group-data-[layout=grid]/list:flex-row",
|
|
2779
|
+
classNames2 == null ? void 0 : classNames2.option
|
|
2780
|
+
),
|
|
2782
2781
|
ref,
|
|
2783
2782
|
children: ({ selectionMode }) => /* @__PURE__ */ jsxs30(Fragment8, { children: [
|
|
2784
2783
|
selectionMode === "multiple" && /* @__PURE__ */ jsx74(FieldGroup, { children: /* @__PURE__ */ jsx74(_Checkbox, { slot: "selection" }) }),
|
|
@@ -2802,9 +2801,10 @@ var _SelectList = forwardRef20(
|
|
|
2802
2801
|
SelectList,
|
|
2803
2802
|
{
|
|
2804
2803
|
...props,
|
|
2804
|
+
layout: "grid",
|
|
2805
2805
|
ref,
|
|
2806
2806
|
className: cn44(
|
|
2807
|
-
"overflow-y-auto sm:max-h-[75vh] lg:max-h-[45vh]",
|
|
2807
|
+
"group/list overflow-y-auto sm:max-h-[75vh] lg:max-h-[45vh]",
|
|
2808
2808
|
classNames2.list
|
|
2809
2809
|
),
|
|
2810
2810
|
children: props.children
|
|
@@ -2974,7 +2974,7 @@ var _Switch = forwardRef22(
|
|
|
2974
2974
|
"div",
|
|
2975
2975
|
{
|
|
2976
2976
|
className: cn48(
|
|
2977
|
-
"h-6 w-12 basis-12 rounded-3xl group-disabled/switch:cursor-not-allowed
|
|
2977
|
+
"h-6 w-12 basis-12 rounded-3xl group-disabled/switch:cursor-not-allowed",
|
|
2978
2978
|
classNames2.track
|
|
2979
2979
|
),
|
|
2980
2980
|
children: /* @__PURE__ */ jsx80(
|
|
@@ -3019,8 +3019,20 @@ var useTableContext = () => useContext15(TableContext);
|
|
|
3019
3019
|
// src/Table/TableBody.tsx
|
|
3020
3020
|
import { useTableRowGroup } from "@react-aria/table";
|
|
3021
3021
|
import { jsx as jsx81 } from "react/jsx-runtime";
|
|
3022
|
-
var TableBody = ({ children }) => {
|
|
3022
|
+
var TableBody = ({ children, emptyState }) => {
|
|
3023
3023
|
const { rowGroupProps } = useTableRowGroup();
|
|
3024
|
+
const { state, classNames: classNames2 } = useTableContext();
|
|
3025
|
+
if (state.collection.size === 0 && emptyState) {
|
|
3026
|
+
return /* @__PURE__ */ jsx81("tbody", { children: /* @__PURE__ */ jsx81("tr", { className: classNames2 == null ? void 0 : classNames2.row, role: "row", children: /* @__PURE__ */ jsx81(
|
|
3027
|
+
"td",
|
|
3028
|
+
{
|
|
3029
|
+
className: classNames2 == null ? void 0 : classNames2.cell,
|
|
3030
|
+
colSpan: state.collection.size,
|
|
3031
|
+
role: "rowheader",
|
|
3032
|
+
children: emptyState()
|
|
3033
|
+
}
|
|
3034
|
+
) }) });
|
|
3035
|
+
}
|
|
3024
3036
|
return /* @__PURE__ */ jsx81("tbody", { ...rowGroupProps, children });
|
|
3025
3037
|
};
|
|
3026
3038
|
|
|
@@ -3130,8 +3142,7 @@ import { useHover } from "@react-aria/interactions";
|
|
|
3130
3142
|
import { useTableColumnHeader } from "@react-aria/table";
|
|
3131
3143
|
import { mergeProps as mergeProps5 } from "@react-aria/utils";
|
|
3132
3144
|
import { SortDown, SortUp } from "@marigold/icons";
|
|
3133
|
-
import { cn as cn51, useStateProps as useStateProps4 } from "@marigold/system";
|
|
3134
|
-
import { width as twWidth5 } from "@marigold/system";
|
|
3145
|
+
import { cn as cn51, width as twWidth5, useStateProps as useStateProps4 } from "@marigold/system";
|
|
3135
3146
|
import { jsx as jsx84, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
3136
3147
|
var TableColumnHeader = ({
|
|
3137
3148
|
column,
|
|
@@ -3165,7 +3176,7 @@ var TableColumnHeader = ({
|
|
|
3165
3176
|
align,
|
|
3166
3177
|
children: [
|
|
3167
3178
|
column.rendered,
|
|
3168
|
-
column.props.allowsSorting && (((_a = state.sortDescriptor) == null ? void 0 : _a.column) === column.key ? ((_b = state.sortDescriptor) == null ? void 0 : _b.direction) === "ascending" ? /* @__PURE__ */ jsx84(SortUp, { className: "inline-block" }) : /* @__PURE__ */ jsx84(SortDown, { className: "inline-block" }) : /* @__PURE__ */ jsx84(SortDown, { className: "inline-block" }))
|
|
3179
|
+
column.props.allowsSorting && (((_a = state.sortDescriptor) == null ? void 0 : _a.column) === column.key ? ((_b = state.sortDescriptor) == null ? void 0 : _b.direction) === "ascending" ? /* @__PURE__ */ jsx84(SortUp, { className: "inline-block" }) : /* @__PURE__ */ jsx84(SortDown, { className: "inline-block" }) : /* @__PURE__ */ jsx84("span", { className: "invisible", children: /* @__PURE__ */ jsx84(SortDown, { className: "inline-block" }) }))
|
|
3169
3180
|
]
|
|
3170
3181
|
}
|
|
3171
3182
|
);
|
|
@@ -3291,7 +3302,7 @@ var TableSelectAllCell = ({
|
|
|
3291
3302
|
"th",
|
|
3292
3303
|
{
|
|
3293
3304
|
ref,
|
|
3294
|
-
className: cn53(twWidth6[width], ["
|
|
3305
|
+
className: cn53(twWidth6[width], ["leading-none"], classNames2 == null ? void 0 : classNames2.header),
|
|
3295
3306
|
...mergeProps7(columnHeaderProps, hoverProps, focusProps),
|
|
3296
3307
|
...stateProps,
|
|
3297
3308
|
align,
|
|
@@ -3309,6 +3320,7 @@ var Table = ({
|
|
|
3309
3320
|
selectionMode = "none",
|
|
3310
3321
|
disableKeyboardNavigation = false,
|
|
3311
3322
|
stickyHeader,
|
|
3323
|
+
emptyState,
|
|
3312
3324
|
...props
|
|
3313
3325
|
}) => {
|
|
3314
3326
|
const interactive = selectionMode !== "none";
|
|
@@ -3367,7 +3379,7 @@ var Table = ({
|
|
|
3367
3379
|
);
|
|
3368
3380
|
}
|
|
3369
3381
|
) }, headerRow.key)) }),
|
|
3370
|
-
/* @__PURE__ */ jsxs34(TableBody, { children: [
|
|
3382
|
+
/* @__PURE__ */ jsxs34(TableBody, { emptyState, children: [
|
|
3371
3383
|
...collection.rows.map(
|
|
3372
3384
|
(row) => row.type === "item" && /* @__PURE__ */ jsx89(TableRow, { row, children: [...collection.getChildren(row.key)].map((cell, index) => {
|
|
3373
3385
|
var _a, _b;
|
|
@@ -3396,6 +3408,7 @@ Table.Header = Header2;
|
|
|
3396
3408
|
Table.Row = Row;
|
|
3397
3409
|
|
|
3398
3410
|
// src/Text/Text.tsx
|
|
3411
|
+
import { Text as Text2 } from "react-aria-components";
|
|
3399
3412
|
import {
|
|
3400
3413
|
cn as cn55,
|
|
3401
3414
|
createVar as createVar11,
|
|
@@ -3409,7 +3422,7 @@ import {
|
|
|
3409
3422
|
useTheme as useTheme3
|
|
3410
3423
|
} from "@marigold/system";
|
|
3411
3424
|
import { jsx as jsx90 } from "react/jsx-runtime";
|
|
3412
|
-
var
|
|
3425
|
+
var _Text = ({
|
|
3413
3426
|
variant,
|
|
3414
3427
|
size,
|
|
3415
3428
|
color,
|
|
@@ -3419,6 +3432,7 @@ var Text2 = ({
|
|
|
3419
3432
|
fontSize,
|
|
3420
3433
|
fontStyle,
|
|
3421
3434
|
children,
|
|
3435
|
+
as = "div",
|
|
3422
3436
|
...props
|
|
3423
3437
|
}) => {
|
|
3424
3438
|
const theme = useTheme3();
|
|
@@ -3428,9 +3442,10 @@ var Text2 = ({
|
|
|
3428
3442
|
size
|
|
3429
3443
|
});
|
|
3430
3444
|
return /* @__PURE__ */ jsx90(
|
|
3431
|
-
|
|
3445
|
+
Text2,
|
|
3432
3446
|
{
|
|
3433
3447
|
...props,
|
|
3448
|
+
elementType: as,
|
|
3434
3449
|
className: cn55(
|
|
3435
3450
|
"text-[--color] outline-[--outline]",
|
|
3436
3451
|
classNames2,
|
|
@@ -3930,7 +3945,7 @@ export {
|
|
|
3930
3945
|
Table,
|
|
3931
3946
|
_Tabs as Tabs,
|
|
3932
3947
|
_Tag as Tag,
|
|
3933
|
-
|
|
3948
|
+
_Text as Text,
|
|
3934
3949
|
_TextArea as TextArea,
|
|
3935
3950
|
_TextField as TextField,
|
|
3936
3951
|
ThemeProvider2 as ThemeProvider,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marigold/components",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.2",
|
|
4
4
|
"description": "Components for the Marigold Design System",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -23,28 +23,28 @@
|
|
|
23
23
|
"directory": "packages/components"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@internationalized/date": "3.5.
|
|
27
|
-
"@react-aria/accordion": "3.0.0-alpha.
|
|
28
|
-
"@react-aria/button": "3.9.
|
|
29
|
-
"@react-aria/calendar": "3.5.
|
|
30
|
-
"@react-aria/focus": "3.
|
|
31
|
-
"@react-aria/i18n": "3.
|
|
32
|
-
"@react-aria/interactions": "3.
|
|
33
|
-
"@react-aria/overlays": "3.
|
|
34
|
-
"@react-aria/selection": "3.
|
|
35
|
-
"@react-aria/ssr": "3.9.
|
|
36
|
-
"@react-aria/table": "3.
|
|
37
|
-
"@react-aria/utils": "3.
|
|
38
|
-
"@react-aria/visually-hidden": "3.8.
|
|
39
|
-
"@react-stately/collections": "3.10.
|
|
40
|
-
"@react-stately/data": "3.11.
|
|
41
|
-
"@react-stately/table": "3.
|
|
42
|
-
"@react-stately/tree": "3.8.
|
|
43
|
-
"@react-types/shared": "3.
|
|
44
|
-
"@react-types/table": "3.
|
|
45
|
-
"react-aria-components": "1.
|
|
46
|
-
"@marigold/icons": "1.2.
|
|
47
|
-
"@marigold/system": "9.0.
|
|
26
|
+
"@internationalized/date": "3.5.5",
|
|
27
|
+
"@react-aria/accordion": "3.0.0-alpha.33",
|
|
28
|
+
"@react-aria/button": "3.9.8",
|
|
29
|
+
"@react-aria/calendar": "3.5.11",
|
|
30
|
+
"@react-aria/focus": "3.18.2",
|
|
31
|
+
"@react-aria/i18n": "3.12.2",
|
|
32
|
+
"@react-aria/interactions": "3.22.2",
|
|
33
|
+
"@react-aria/overlays": "3.23.2",
|
|
34
|
+
"@react-aria/selection": "3.19.3",
|
|
35
|
+
"@react-aria/ssr": "3.9.5",
|
|
36
|
+
"@react-aria/table": "3.15.3",
|
|
37
|
+
"@react-aria/utils": "3.25.2",
|
|
38
|
+
"@react-aria/visually-hidden": "3.8.15",
|
|
39
|
+
"@react-stately/collections": "3.10.9",
|
|
40
|
+
"@react-stately/data": "3.11.6",
|
|
41
|
+
"@react-stately/table": "3.12.2",
|
|
42
|
+
"@react-stately/tree": "3.8.4",
|
|
43
|
+
"@react-types/shared": "3.24.1",
|
|
44
|
+
"@react-types/table": "3.10.1",
|
|
45
|
+
"react-aria-components": "1.3.3",
|
|
46
|
+
"@marigold/icons": "1.2.57",
|
|
47
|
+
"@marigold/system": "9.0.2",
|
|
48
48
|
"@marigold/types": "1.1.1"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"react-dom": "18.x"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@types/react": "18.3.
|
|
55
|
+
"@types/react": "18.3.5",
|
|
56
56
|
"react": "18.3.1",
|
|
57
57
|
"react-dom": "18.3.1",
|
|
58
58
|
"tsup": "8.1.0",
|