@marigold/components 1.0.1 → 1.1.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 +6 -1
- package/dist/index.js +137 -98
- package/dist/index.mjs +103 -65
- package/package.json +6 -5
package/dist/index.d.ts
CHANGED
|
@@ -414,6 +414,7 @@ interface TableThemeExtension extends ThemeExtensionsWithParts<'Table', [
|
|
|
414
414
|
interface TableProps extends Pick<TableProps$1<object>, 'focusMode' | 'onRowAction' | 'onCellAction'>, Omit<TableStateProps<object>, 'showSelectionCheckboxes'> {
|
|
415
415
|
variant?: string;
|
|
416
416
|
size?: string;
|
|
417
|
+
stretch?: boolean;
|
|
417
418
|
}
|
|
418
419
|
declare const Table: Table;
|
|
419
420
|
/**
|
|
@@ -552,6 +553,10 @@ interface InlineProps {
|
|
|
552
553
|
}
|
|
553
554
|
declare const Inline: ({ space, alignX, alignY, children, ...props }: InlineProps) => JSX.Element;
|
|
554
555
|
|
|
556
|
+
interface SplitProps extends ComponentProps<'div'> {
|
|
557
|
+
}
|
|
558
|
+
declare const Split: (props: SplitProps) => JSX.Element;
|
|
559
|
+
|
|
555
560
|
declare const ALIGNMENT_X: {
|
|
556
561
|
left: string;
|
|
557
562
|
center: string;
|
|
@@ -593,4 +598,4 @@ interface TilesProps {
|
|
|
593
598
|
}
|
|
594
599
|
declare const Tiles: React.ForwardRefExoticComponent<TilesProps & React.RefAttributes<HTMLDivElement>>;
|
|
595
600
|
|
|
596
|
-
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, CustomTextAreEvents, 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, MarigoldProvider, MarigoldProviderProps, Menu, MenuProps, MenuThemeExtension, Message, MessageProps, MessageThemeExtension, NumberField, NumberFieldProps, NumberFieldThemeExtension, Overlay, OverlayProps, Popover, PopoverProps, Radio, RadioGroupProps, RadioGroupThemeExtension, RadioProps, RadioThemeExtension, RootThemeExtension, Select, SelectProps, SelectThemeExtension, Slider, SliderProps, SliderThemeExtension, 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 };
|
|
601
|
+
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, CustomTextAreEvents, 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, MarigoldProvider, MarigoldProviderProps, Menu, MenuProps, MenuThemeExtension, Message, MessageProps, MessageThemeExtension, NumberField, NumberFieldProps, NumberFieldThemeExtension, Overlay, OverlayProps, Popover, PopoverProps, Radio, RadioGroupProps, RadioGroupThemeExtension, RadioProps, RadioThemeExtension, RootThemeExtension, Select, 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
|
@@ -85,6 +85,7 @@ __export(src_exports, {
|
|
|
85
85
|
SSRProvider: () => import_ssr.SSRProvider,
|
|
86
86
|
Select: () => Select,
|
|
87
87
|
Slider: () => Slider,
|
|
88
|
+
Split: () => Split,
|
|
88
89
|
Stack: () => Stack,
|
|
89
90
|
Switch: () => Switch,
|
|
90
91
|
Table: () => Table,
|
|
@@ -1871,8 +1872,16 @@ var Slider = (_a) => {
|
|
|
1871
1872
|
})));
|
|
1872
1873
|
};
|
|
1873
1874
|
|
|
1874
|
-
// src/
|
|
1875
|
+
// src/Split/Split.tsx
|
|
1875
1876
|
var import_react49 = __toESM(require("react"));
|
|
1877
|
+
var import_system35 = require("@marigold/system");
|
|
1878
|
+
var Split = (props) => /* @__PURE__ */ import_react49.default.createElement(import_system35.Box, __spreadProps(__spreadValues({}, props), {
|
|
1879
|
+
role: "separator",
|
|
1880
|
+
css: { flexGrow: 1 }
|
|
1881
|
+
}));
|
|
1882
|
+
|
|
1883
|
+
// src/Stack/Stack.tsx
|
|
1884
|
+
var import_react50 = __toESM(require("react"));
|
|
1876
1885
|
var ALIGNMENT_X2 = {
|
|
1877
1886
|
left: "flex-start",
|
|
1878
1887
|
center: "center",
|
|
@@ -1897,7 +1906,7 @@ var Stack = (_a) => {
|
|
|
1897
1906
|
"alignY",
|
|
1898
1907
|
"stretch"
|
|
1899
1908
|
]);
|
|
1900
|
-
return /* @__PURE__ */
|
|
1909
|
+
return /* @__PURE__ */ import_react50.default.createElement(import_system.Box, __spreadValues({
|
|
1901
1910
|
css: {
|
|
1902
1911
|
display: "flex",
|
|
1903
1912
|
flexDirection: "column",
|
|
@@ -1911,11 +1920,11 @@ var Stack = (_a) => {
|
|
|
1911
1920
|
};
|
|
1912
1921
|
|
|
1913
1922
|
// src/Switch/Switch.tsx
|
|
1914
|
-
var
|
|
1923
|
+
var import_react51 = __toESM(require("react"));
|
|
1915
1924
|
var import_focus10 = require("@react-aria/focus");
|
|
1916
1925
|
var import_switch = require("@react-aria/switch");
|
|
1917
1926
|
var import_toggle2 = require("@react-stately/toggle");
|
|
1918
|
-
var
|
|
1927
|
+
var import_system36 = require("@marigold/system");
|
|
1919
1928
|
var Switch = (_a) => {
|
|
1920
1929
|
var _b = _a, {
|
|
1921
1930
|
variant,
|
|
@@ -1934,7 +1943,7 @@ var Switch = (_a) => {
|
|
|
1934
1943
|
"readOnly",
|
|
1935
1944
|
"defaultChecked"
|
|
1936
1945
|
]);
|
|
1937
|
-
const ref = (0,
|
|
1946
|
+
const ref = (0, import_react51.useRef)(null);
|
|
1938
1947
|
const props = __spreadValues({
|
|
1939
1948
|
isSelected: checked,
|
|
1940
1949
|
isDisabled: disabled,
|
|
@@ -1944,14 +1953,14 @@ var Switch = (_a) => {
|
|
|
1944
1953
|
const state = (0, import_toggle2.useToggleState)(props);
|
|
1945
1954
|
const { inputProps } = (0, import_switch.useSwitch)(props, state, ref);
|
|
1946
1955
|
const { isFocusVisible, focusProps } = (0, import_focus10.useFocusRing)();
|
|
1947
|
-
const stateProps = (0,
|
|
1956
|
+
const stateProps = (0, import_system36.useStateProps)({
|
|
1948
1957
|
checked: state.isSelected,
|
|
1949
1958
|
disabled,
|
|
1950
1959
|
readOnly,
|
|
1951
1960
|
focus: isFocusVisible
|
|
1952
1961
|
});
|
|
1953
|
-
const styles = (0,
|
|
1954
|
-
return /* @__PURE__ */
|
|
1962
|
+
const styles = (0, import_system36.useComponentStyles)("Switch", { variant, size }, { parts: ["container", "label", "track", "thumb"] });
|
|
1963
|
+
return /* @__PURE__ */ import_react51.default.createElement(import_system.Box, {
|
|
1955
1964
|
as: "label",
|
|
1956
1965
|
__baseCSS: {
|
|
1957
1966
|
display: "flex",
|
|
@@ -1962,7 +1971,7 @@ var Switch = (_a) => {
|
|
|
1962
1971
|
width
|
|
1963
1972
|
},
|
|
1964
1973
|
css: styles.container
|
|
1965
|
-
}, /* @__PURE__ */
|
|
1974
|
+
}, /* @__PURE__ */ import_react51.default.createElement(import_system.Box, __spreadValues(__spreadValues({
|
|
1966
1975
|
as: "input",
|
|
1967
1976
|
ref,
|
|
1968
1977
|
css: {
|
|
@@ -1975,9 +1984,9 @@ var Switch = (_a) => {
|
|
|
1975
1984
|
opacity: 1e-4,
|
|
1976
1985
|
cursor: inputProps.disabled ? "not-allowed" : "pointer"
|
|
1977
1986
|
}
|
|
1978
|
-
}, inputProps), focusProps)), props.children && /* @__PURE__ */
|
|
1987
|
+
}, inputProps), focusProps)), props.children && /* @__PURE__ */ import_react51.default.createElement(import_system.Box, {
|
|
1979
1988
|
css: styles.label
|
|
1980
|
-
}, props.children), /* @__PURE__ */
|
|
1989
|
+
}, props.children), /* @__PURE__ */ import_react51.default.createElement(import_system.Box, __spreadValues({
|
|
1981
1990
|
__baseCSS: {
|
|
1982
1991
|
position: "relative",
|
|
1983
1992
|
width: 48,
|
|
@@ -1986,7 +1995,7 @@ var Switch = (_a) => {
|
|
|
1986
1995
|
borderRadius: 20
|
|
1987
1996
|
},
|
|
1988
1997
|
css: styles.track
|
|
1989
|
-
}, stateProps), /* @__PURE__ */
|
|
1998
|
+
}, stateProps), /* @__PURE__ */ import_react51.default.createElement(import_system.Box, __spreadValues({
|
|
1990
1999
|
__baseCSS: {
|
|
1991
2000
|
display: "block",
|
|
1992
2001
|
position: "absolute",
|
|
@@ -2008,40 +2017,40 @@ var Switch = (_a) => {
|
|
|
2008
2017
|
};
|
|
2009
2018
|
|
|
2010
2019
|
// src/Table/Table.tsx
|
|
2011
|
-
var
|
|
2020
|
+
var import_react61 = __toESM(require("react"));
|
|
2012
2021
|
var import_table9 = require("@react-aria/table");
|
|
2013
2022
|
var import_table10 = require("@react-stately/table");
|
|
2014
|
-
var
|
|
2023
|
+
var import_system42 = require("@marigold/system");
|
|
2015
2024
|
|
|
2016
2025
|
// src/Table/Context.tsx
|
|
2017
|
-
var
|
|
2018
|
-
var TableContext = (0,
|
|
2019
|
-
var useTableContext = () => (0,
|
|
2026
|
+
var import_react52 = require("react");
|
|
2027
|
+
var TableContext = (0, import_react52.createContext)({});
|
|
2028
|
+
var useTableContext = () => (0, import_react52.useContext)(TableContext);
|
|
2020
2029
|
|
|
2021
2030
|
// src/Table/TableBody.tsx
|
|
2022
|
-
var
|
|
2031
|
+
var import_react53 = __toESM(require("react"));
|
|
2023
2032
|
var import_table = require("@react-aria/table");
|
|
2024
2033
|
var TableBody = ({ children }) => {
|
|
2025
2034
|
const { rowGroupProps } = (0, import_table.useTableRowGroup)();
|
|
2026
|
-
return /* @__PURE__ */
|
|
2035
|
+
return /* @__PURE__ */ import_react53.default.createElement("tbody", __spreadValues({}, rowGroupProps), children);
|
|
2027
2036
|
};
|
|
2028
2037
|
|
|
2029
2038
|
// src/Table/TableCell.tsx
|
|
2030
|
-
var
|
|
2039
|
+
var import_react54 = __toESM(require("react"));
|
|
2031
2040
|
var import_table2 = require("@react-aria/table");
|
|
2032
2041
|
var import_focus11 = require("@react-aria/focus");
|
|
2033
2042
|
var import_utils10 = require("@react-aria/utils");
|
|
2034
|
-
var
|
|
2043
|
+
var import_system37 = require("@marigold/system");
|
|
2035
2044
|
var TableCell = ({ cell }) => {
|
|
2036
|
-
const ref = (0,
|
|
2045
|
+
const ref = (0, import_react54.useRef)(null);
|
|
2037
2046
|
const { state, styles } = useTableContext();
|
|
2038
2047
|
const disabled = state.disabledKeys.has(cell.parentKey);
|
|
2039
2048
|
const { gridCellProps } = (0, import_table2.useTableCell)({
|
|
2040
2049
|
node: cell
|
|
2041
2050
|
}, state, ref);
|
|
2042
2051
|
const { focusProps, isFocusVisible } = (0, import_focus11.useFocusRing)();
|
|
2043
|
-
const stateProps = (0,
|
|
2044
|
-
return /* @__PURE__ */
|
|
2052
|
+
const stateProps = (0, import_system37.useStateProps)({ disabled, focusVisible: isFocusVisible });
|
|
2053
|
+
return /* @__PURE__ */ import_react54.default.createElement(import_system37.Box, __spreadValues(__spreadValues({
|
|
2045
2054
|
as: "td",
|
|
2046
2055
|
ref,
|
|
2047
2056
|
css: styles.cell
|
|
@@ -2049,11 +2058,11 @@ var TableCell = ({ cell }) => {
|
|
|
2049
2058
|
};
|
|
2050
2059
|
|
|
2051
2060
|
// src/Table/TableCheckboxCell.tsx
|
|
2052
|
-
var
|
|
2061
|
+
var import_react55 = __toESM(require("react"));
|
|
2053
2062
|
var import_table3 = require("@react-aria/table");
|
|
2054
2063
|
var import_focus12 = require("@react-aria/focus");
|
|
2055
2064
|
var import_utils11 = require("@react-aria/utils");
|
|
2056
|
-
var
|
|
2065
|
+
var import_system38 = require("@marigold/system");
|
|
2057
2066
|
|
|
2058
2067
|
// src/Table/utils.ts
|
|
2059
2068
|
var mapCheckboxProps = (_a) => {
|
|
@@ -2081,7 +2090,7 @@ var mapCheckboxProps = (_a) => {
|
|
|
2081
2090
|
|
|
2082
2091
|
// src/Table/TableCheckboxCell.tsx
|
|
2083
2092
|
var TableCheckboxCell = ({ cell }) => {
|
|
2084
|
-
const ref = (0,
|
|
2093
|
+
const ref = (0, import_react55.useRef)(null);
|
|
2085
2094
|
const { state, styles } = useTableContext();
|
|
2086
2095
|
const disabled = state.disabledKeys.has(cell.parentKey);
|
|
2087
2096
|
const { gridCellProps } = (0, import_table3.useTableCell)({
|
|
@@ -2089,8 +2098,8 @@ var TableCheckboxCell = ({ cell }) => {
|
|
|
2089
2098
|
}, state, ref);
|
|
2090
2099
|
const { checkboxProps } = mapCheckboxProps((0, import_table3.useTableSelectionCheckbox)({ key: cell.parentKey }, state));
|
|
2091
2100
|
const { focusProps, isFocusVisible } = (0, import_focus12.useFocusRing)();
|
|
2092
|
-
const stateProps = (0,
|
|
2093
|
-
return /* @__PURE__ */
|
|
2101
|
+
const stateProps = (0, import_system38.useStateProps)({ disabled, focusVisible: isFocusVisible });
|
|
2102
|
+
return /* @__PURE__ */ import_react55.default.createElement(import_system38.Box, __spreadValues(__spreadValues({
|
|
2094
2103
|
as: "td",
|
|
2095
2104
|
ref,
|
|
2096
2105
|
__baseCSS: {
|
|
@@ -2099,65 +2108,82 @@ var TableCheckboxCell = ({ cell }) => {
|
|
|
2099
2108
|
lineHeight: 1
|
|
2100
2109
|
},
|
|
2101
2110
|
css: styles.cell
|
|
2102
|
-
}, (0, import_utils11.mergeProps)(gridCellProps, focusProps)), stateProps), /* @__PURE__ */
|
|
2111
|
+
}, (0, import_utils11.mergeProps)(gridCellProps, focusProps)), stateProps), /* @__PURE__ */ import_react55.default.createElement(Checkbox, __spreadValues({}, checkboxProps)));
|
|
2103
2112
|
};
|
|
2104
2113
|
|
|
2105
2114
|
// src/Table/TableColumnHeader.tsx
|
|
2106
|
-
var
|
|
2115
|
+
var import_react56 = __toESM(require("react"));
|
|
2107
2116
|
var import_focus13 = require("@react-aria/focus");
|
|
2108
2117
|
var import_interactions7 = require("@react-aria/interactions");
|
|
2109
2118
|
var import_table4 = require("@react-aria/table");
|
|
2110
2119
|
var import_utils13 = require("@react-aria/utils");
|
|
2111
|
-
var
|
|
2120
|
+
var import_system39 = require("@marigold/system");
|
|
2121
|
+
var SortIndicator = ({
|
|
2122
|
+
direction = "ascending",
|
|
2123
|
+
visible
|
|
2124
|
+
}) => /* @__PURE__ */ import_react56.default.createElement(import_system39.Box, {
|
|
2125
|
+
as: "span",
|
|
2126
|
+
role: "presentation",
|
|
2127
|
+
"aria-hidden": "true",
|
|
2128
|
+
css: {
|
|
2129
|
+
color: "currentColor",
|
|
2130
|
+
paddingInlineStart: "0.5ch",
|
|
2131
|
+
visibility: visible ? "visible" : "hidden"
|
|
2132
|
+
}
|
|
2133
|
+
}, direction === "ascending" ? "\u25B2" : "\u25BC");
|
|
2112
2134
|
var TableColumnHeader = ({ column }) => {
|
|
2113
|
-
|
|
2135
|
+
var _a, _b;
|
|
2136
|
+
const ref = (0, import_react56.useRef)(null);
|
|
2114
2137
|
const { state, styles } = useTableContext();
|
|
2115
2138
|
const { columnHeaderProps } = (0, import_table4.useTableColumnHeader)({
|
|
2116
2139
|
node: column
|
|
2117
2140
|
}, state, ref);
|
|
2118
2141
|
const { hoverProps, isHovered } = (0, import_interactions7.useHover)({});
|
|
2119
2142
|
const { focusProps, isFocusVisible } = (0, import_focus13.useFocusRing)();
|
|
2120
|
-
const stateProps = (0,
|
|
2143
|
+
const stateProps = (0, import_system39.useStateProps)({
|
|
2121
2144
|
hover: isHovered,
|
|
2122
2145
|
focusVisible: isFocusVisible
|
|
2123
2146
|
});
|
|
2124
|
-
return /* @__PURE__ */
|
|
2147
|
+
return /* @__PURE__ */ import_react56.default.createElement(import_system39.Box, __spreadValues(__spreadValues({
|
|
2125
2148
|
as: "th",
|
|
2126
2149
|
colSpan: column.colspan,
|
|
2127
2150
|
ref,
|
|
2128
2151
|
css: styles.header
|
|
2129
|
-
}, (0, import_utils13.mergeProps)(columnHeaderProps, hoverProps, focusProps)), stateProps), column.rendered
|
|
2152
|
+
}, (0, import_utils13.mergeProps)(columnHeaderProps, hoverProps, focusProps)), stateProps), column.rendered, column.props.allowsSorting && /* @__PURE__ */ import_react56.default.createElement(SortIndicator, {
|
|
2153
|
+
direction: (_a = state.sortDescriptor) == null ? void 0 : _a.direction,
|
|
2154
|
+
visible: ((_b = state.sortDescriptor) == null ? void 0 : _b.column) === column.key
|
|
2155
|
+
}));
|
|
2130
2156
|
};
|
|
2131
2157
|
|
|
2132
2158
|
// src/Table/TableHeader.tsx
|
|
2133
|
-
var
|
|
2159
|
+
var import_react57 = __toESM(require("react"));
|
|
2134
2160
|
var import_table5 = require("@react-aria/table");
|
|
2135
2161
|
var TableHeader = ({ children }) => {
|
|
2136
2162
|
const { rowGroupProps } = (0, import_table5.useTableRowGroup)();
|
|
2137
|
-
return /* @__PURE__ */
|
|
2163
|
+
return /* @__PURE__ */ import_react57.default.createElement("thead", __spreadValues({}, rowGroupProps), children);
|
|
2138
2164
|
};
|
|
2139
2165
|
|
|
2140
2166
|
// src/Table/TableHeaderRow.tsx
|
|
2141
|
-
var
|
|
2167
|
+
var import_react58 = __toESM(require("react"));
|
|
2142
2168
|
var import_table6 = require("@react-aria/table");
|
|
2143
2169
|
var TableHeaderRow = ({ item, children }) => {
|
|
2144
2170
|
const { state } = useTableContext();
|
|
2145
|
-
const ref = (0,
|
|
2171
|
+
const ref = (0, import_react58.useRef)(null);
|
|
2146
2172
|
const { rowProps } = (0, import_table6.useTableHeaderRow)({ node: item }, state, ref);
|
|
2147
|
-
return /* @__PURE__ */
|
|
2173
|
+
return /* @__PURE__ */ import_react58.default.createElement("tr", __spreadProps(__spreadValues({}, rowProps), {
|
|
2148
2174
|
ref
|
|
2149
2175
|
}), children);
|
|
2150
2176
|
};
|
|
2151
2177
|
|
|
2152
2178
|
// src/Table/TableRow.tsx
|
|
2153
|
-
var
|
|
2179
|
+
var import_react59 = __toESM(require("react"));
|
|
2154
2180
|
var import_focus14 = require("@react-aria/focus");
|
|
2155
2181
|
var import_interactions8 = require("@react-aria/interactions");
|
|
2156
2182
|
var import_table7 = require("@react-aria/table");
|
|
2157
2183
|
var import_utils14 = require("@react-aria/utils");
|
|
2158
|
-
var
|
|
2184
|
+
var import_system40 = require("@marigold/system");
|
|
2159
2185
|
var TableRow = ({ children, row }) => {
|
|
2160
|
-
const ref = (0,
|
|
2186
|
+
const ref = (0, import_react59.useRef)(null);
|
|
2161
2187
|
const { state, styles } = useTableContext();
|
|
2162
2188
|
const { rowProps, isPressed } = (0, import_table7.useTableRow)({
|
|
2163
2189
|
node: row
|
|
@@ -2166,14 +2192,14 @@ var TableRow = ({ children, row }) => {
|
|
|
2166
2192
|
const selected = state.selectionManager.isSelected(row.key);
|
|
2167
2193
|
const { focusProps, isFocusVisible } = (0, import_focus14.useFocusRing)({ within: true });
|
|
2168
2194
|
const { hoverProps, isHovered } = (0, import_interactions8.useHover)({ isDisabled: disabled });
|
|
2169
|
-
const stateProps = (0,
|
|
2195
|
+
const stateProps = (0, import_system40.useStateProps)({
|
|
2170
2196
|
disabled,
|
|
2171
2197
|
selected,
|
|
2172
2198
|
hover: isHovered,
|
|
2173
2199
|
focusVisible: isFocusVisible,
|
|
2174
2200
|
active: isPressed
|
|
2175
2201
|
});
|
|
2176
|
-
return /* @__PURE__ */
|
|
2202
|
+
return /* @__PURE__ */ import_react59.default.createElement(import_system40.Box, __spreadValues(__spreadValues({
|
|
2177
2203
|
as: "tr",
|
|
2178
2204
|
ref,
|
|
2179
2205
|
css: styles.row
|
|
@@ -2181,14 +2207,14 @@ var TableRow = ({ children, row }) => {
|
|
|
2181
2207
|
};
|
|
2182
2208
|
|
|
2183
2209
|
// src/Table/TableSelectAllCell.tsx
|
|
2184
|
-
var
|
|
2210
|
+
var import_react60 = __toESM(require("react"));
|
|
2185
2211
|
var import_focus15 = require("@react-aria/focus");
|
|
2186
2212
|
var import_interactions9 = require("@react-aria/interactions");
|
|
2187
2213
|
var import_table8 = require("@react-aria/table");
|
|
2188
2214
|
var import_utils15 = require("@react-aria/utils");
|
|
2189
|
-
var
|
|
2215
|
+
var import_system41 = require("@marigold/system");
|
|
2190
2216
|
var TableSelectAllCell = ({ column }) => {
|
|
2191
|
-
const ref = (0,
|
|
2217
|
+
const ref = (0, import_react60.useRef)(null);
|
|
2192
2218
|
const { state, styles } = useTableContext();
|
|
2193
2219
|
const { columnHeaderProps } = (0, import_table8.useTableColumnHeader)({
|
|
2194
2220
|
node: column
|
|
@@ -2196,11 +2222,11 @@ var TableSelectAllCell = ({ column }) => {
|
|
|
2196
2222
|
const { checkboxProps } = mapCheckboxProps((0, import_table8.useTableSelectAllCheckbox)(state));
|
|
2197
2223
|
const { hoverProps, isHovered } = (0, import_interactions9.useHover)({});
|
|
2198
2224
|
const { focusProps, isFocusVisible } = (0, import_focus15.useFocusRing)();
|
|
2199
|
-
const stateProps = (0,
|
|
2225
|
+
const stateProps = (0, import_system41.useStateProps)({
|
|
2200
2226
|
hover: isHovered,
|
|
2201
2227
|
focusVisible: isFocusVisible
|
|
2202
2228
|
});
|
|
2203
|
-
return /* @__PURE__ */
|
|
2229
|
+
return /* @__PURE__ */ import_react60.default.createElement(import_system41.Box, __spreadValues(__spreadValues({
|
|
2204
2230
|
as: "th",
|
|
2205
2231
|
ref,
|
|
2206
2232
|
__baseCSS: {
|
|
@@ -2209,46 +2235,58 @@ var TableSelectAllCell = ({ column }) => {
|
|
|
2209
2235
|
lineHeight: 1
|
|
2210
2236
|
},
|
|
2211
2237
|
css: styles.header
|
|
2212
|
-
}, (0, import_utils15.mergeProps)(columnHeaderProps, hoverProps, focusProps)), stateProps), /* @__PURE__ */
|
|
2238
|
+
}, (0, import_utils15.mergeProps)(columnHeaderProps, hoverProps, focusProps)), stateProps), /* @__PURE__ */ import_react60.default.createElement(Checkbox, __spreadValues({}, checkboxProps)));
|
|
2213
2239
|
};
|
|
2214
2240
|
|
|
2215
2241
|
// src/Table/Table.tsx
|
|
2216
2242
|
var Table = (_a) => {
|
|
2217
|
-
var _b = _a, {
|
|
2218
|
-
|
|
2243
|
+
var _b = _a, {
|
|
2244
|
+
variant,
|
|
2245
|
+
size,
|
|
2246
|
+
stretch
|
|
2247
|
+
} = _b, props = __objRest(_b, [
|
|
2248
|
+
"variant",
|
|
2249
|
+
"size",
|
|
2250
|
+
"stretch"
|
|
2251
|
+
]);
|
|
2252
|
+
const tableRef = (0, import_react61.useRef)(null);
|
|
2219
2253
|
const state = (0, import_table10.useTableState)(__spreadProps(__spreadValues({}, props), {
|
|
2220
2254
|
showSelectionCheckboxes: props.selectionMode === "multiple" && props.selectionBehavior !== "replace"
|
|
2221
2255
|
}));
|
|
2222
2256
|
const { gridProps } = (0, import_table9.useTable)(props, state, tableRef);
|
|
2223
|
-
const styles = (0,
|
|
2257
|
+
const styles = (0, import_system42.useComponentStyles)("Table", { variant, size }, { parts: ["table", "header", "row", "cell"] });
|
|
2224
2258
|
const { collection } = state;
|
|
2225
|
-
return /* @__PURE__ */
|
|
2259
|
+
return /* @__PURE__ */ import_react61.default.createElement(TableContext.Provider, {
|
|
2226
2260
|
value: { state, styles }
|
|
2227
|
-
}, /* @__PURE__ */
|
|
2261
|
+
}, /* @__PURE__ */ import_react61.default.createElement(import_system42.Box, __spreadValues({
|
|
2228
2262
|
as: "table",
|
|
2229
2263
|
ref: tableRef,
|
|
2264
|
+
__baseCSS: {
|
|
2265
|
+
borderCollapse: "collapse",
|
|
2266
|
+
width: stretch ? "100%" : void 0
|
|
2267
|
+
},
|
|
2230
2268
|
css: styles.table
|
|
2231
|
-
}, gridProps), /* @__PURE__ */
|
|
2269
|
+
}, gridProps), /* @__PURE__ */ import_react61.default.createElement(TableHeader, null, collection.headerRows.map((headerRow) => /* @__PURE__ */ import_react61.default.createElement(TableHeaderRow, {
|
|
2232
2270
|
key: headerRow.key,
|
|
2233
2271
|
item: headerRow
|
|
2234
2272
|
}, [...headerRow.childNodes].map((column) => {
|
|
2235
2273
|
var _a2;
|
|
2236
|
-
return ((_a2 = column.props) == null ? void 0 : _a2.isSelectionCell) ? /* @__PURE__ */
|
|
2274
|
+
return ((_a2 = column.props) == null ? void 0 : _a2.isSelectionCell) ? /* @__PURE__ */ import_react61.default.createElement(TableSelectAllCell, {
|
|
2237
2275
|
key: column.key,
|
|
2238
2276
|
column
|
|
2239
|
-
}) : /* @__PURE__ */
|
|
2277
|
+
}) : /* @__PURE__ */ import_react61.default.createElement(TableColumnHeader, {
|
|
2240
2278
|
key: column.key,
|
|
2241
2279
|
column
|
|
2242
2280
|
});
|
|
2243
|
-
})))), /* @__PURE__ */
|
|
2281
|
+
})))), /* @__PURE__ */ import_react61.default.createElement(TableBody, null, [...collection.body.childNodes].map((row) => /* @__PURE__ */ import_react61.default.createElement(TableRow, {
|
|
2244
2282
|
key: row.key,
|
|
2245
2283
|
row
|
|
2246
2284
|
}, [...row.childNodes].map((cell) => {
|
|
2247
2285
|
var _a2;
|
|
2248
|
-
return ((_a2 = cell.props) == null ? void 0 : _a2.isSelectionCell) ? /* @__PURE__ */
|
|
2286
|
+
return ((_a2 = cell.props) == null ? void 0 : _a2.isSelectionCell) ? /* @__PURE__ */ import_react61.default.createElement(TableCheckboxCell, {
|
|
2249
2287
|
key: cell.key,
|
|
2250
2288
|
cell
|
|
2251
|
-
}) : /* @__PURE__ */
|
|
2289
|
+
}) : /* @__PURE__ */ import_react61.default.createElement(TableCell, {
|
|
2252
2290
|
key: cell.key,
|
|
2253
2291
|
cell
|
|
2254
2292
|
});
|
|
@@ -2261,9 +2299,9 @@ Table.Header = import_table10.TableHeader;
|
|
|
2261
2299
|
Table.Row = import_table10.Row;
|
|
2262
2300
|
|
|
2263
2301
|
// src/Text/Text.tsx
|
|
2264
|
-
var
|
|
2265
|
-
var import_system42 = require("@marigold/system");
|
|
2302
|
+
var import_react62 = __toESM(require("react"));
|
|
2266
2303
|
var import_system43 = require("@marigold/system");
|
|
2304
|
+
var import_system44 = require("@marigold/system");
|
|
2267
2305
|
var Text = (_a) => {
|
|
2268
2306
|
var _b = _a, {
|
|
2269
2307
|
variant,
|
|
@@ -2284,11 +2322,11 @@ var Text = (_a) => {
|
|
|
2284
2322
|
"outline",
|
|
2285
2323
|
"children"
|
|
2286
2324
|
]);
|
|
2287
|
-
const styles = (0,
|
|
2325
|
+
const styles = (0, import_system43.useComponentStyles)("Text", {
|
|
2288
2326
|
variant,
|
|
2289
2327
|
size
|
|
2290
2328
|
});
|
|
2291
|
-
return /* @__PURE__ */
|
|
2329
|
+
return /* @__PURE__ */ import_react62.default.createElement(import_system44.Box, __spreadProps(__spreadValues({
|
|
2292
2330
|
as: "p"
|
|
2293
2331
|
}, props), {
|
|
2294
2332
|
css: __spreadValues({ color, cursor, outline, fontSize, textAlign: align }, styles)
|
|
@@ -2296,9 +2334,9 @@ var Text = (_a) => {
|
|
|
2296
2334
|
};
|
|
2297
2335
|
|
|
2298
2336
|
// src/TextArea/TextArea.tsx
|
|
2299
|
-
var
|
|
2337
|
+
var import_react63 = __toESM(require("react"));
|
|
2300
2338
|
var import_textfield = require("@react-aria/textfield");
|
|
2301
|
-
var
|
|
2339
|
+
var import_system45 = require("@marigold/system");
|
|
2302
2340
|
var import_interactions10 = require("@react-aria/interactions");
|
|
2303
2341
|
var import_focus16 = require("@react-aria/focus");
|
|
2304
2342
|
var TextArea = (_a) => {
|
|
@@ -2322,7 +2360,7 @@ var TextArea = (_a) => {
|
|
|
2322
2360
|
"rows"
|
|
2323
2361
|
]);
|
|
2324
2362
|
const { label, description, errorMessage } = props;
|
|
2325
|
-
const ref = (0,
|
|
2363
|
+
const ref = (0, import_react63.useRef)(null);
|
|
2326
2364
|
const { labelProps, inputProps, descriptionProps, errorMessageProps } = (0, import_textfield.useTextField)(__spreadValues({
|
|
2327
2365
|
inputElementType: "textarea",
|
|
2328
2366
|
isDisabled: disabled,
|
|
@@ -2332,15 +2370,15 @@ var TextArea = (_a) => {
|
|
|
2332
2370
|
}, props), ref);
|
|
2333
2371
|
const { hoverProps, isHovered } = (0, import_interactions10.useHover)({});
|
|
2334
2372
|
const { focusProps, isFocusVisible } = (0, import_focus16.useFocusRing)();
|
|
2335
|
-
const stateProps = (0,
|
|
2373
|
+
const stateProps = (0, import_system45.useStateProps)({
|
|
2336
2374
|
hover: isHovered,
|
|
2337
2375
|
focus: isFocusVisible,
|
|
2338
2376
|
disabled,
|
|
2339
2377
|
readOnly,
|
|
2340
2378
|
error
|
|
2341
2379
|
});
|
|
2342
|
-
const styles = (0,
|
|
2343
|
-
return /* @__PURE__ */
|
|
2380
|
+
const styles = (0, import_system45.useComponentStyles)("TextArea", { variant, size });
|
|
2381
|
+
return /* @__PURE__ */ import_react63.default.createElement(FieldBase, {
|
|
2344
2382
|
label,
|
|
2345
2383
|
labelProps,
|
|
2346
2384
|
required,
|
|
@@ -2353,7 +2391,7 @@ var TextArea = (_a) => {
|
|
|
2353
2391
|
variant,
|
|
2354
2392
|
size,
|
|
2355
2393
|
width
|
|
2356
|
-
}, /* @__PURE__ */
|
|
2394
|
+
}, /* @__PURE__ */ import_react63.default.createElement(import_system45.Box, __spreadValues(__spreadValues(__spreadValues(__spreadValues({
|
|
2357
2395
|
as: "textarea",
|
|
2358
2396
|
css: styles,
|
|
2359
2397
|
ref,
|
|
@@ -2362,11 +2400,11 @@ var TextArea = (_a) => {
|
|
|
2362
2400
|
};
|
|
2363
2401
|
|
|
2364
2402
|
// src/TextField/TextField.tsx
|
|
2365
|
-
var
|
|
2403
|
+
var import_react64 = __toESM(require("react"));
|
|
2366
2404
|
var import_interactions11 = require("@react-aria/interactions");
|
|
2367
2405
|
var import_focus17 = require("@react-aria/focus");
|
|
2368
2406
|
var import_textfield2 = require("@react-aria/textfield");
|
|
2369
|
-
var
|
|
2407
|
+
var import_system46 = require("@marigold/system");
|
|
2370
2408
|
var TextField = (_a) => {
|
|
2371
2409
|
var _b = _a, {
|
|
2372
2410
|
variant,
|
|
@@ -2386,7 +2424,7 @@ var TextField = (_a) => {
|
|
|
2386
2424
|
"error"
|
|
2387
2425
|
]);
|
|
2388
2426
|
const { label, description, errorMessage, autoFocus } = props;
|
|
2389
|
-
const ref = (0,
|
|
2427
|
+
const ref = (0, import_react64.useRef)(null);
|
|
2390
2428
|
const { labelProps, inputProps, descriptionProps, errorMessageProps } = (0, import_textfield2.useTextField)(__spreadValues({
|
|
2391
2429
|
isDisabled: disabled,
|
|
2392
2430
|
isRequired: required,
|
|
@@ -2398,14 +2436,14 @@ var TextField = (_a) => {
|
|
|
2398
2436
|
isTextInput: true,
|
|
2399
2437
|
autoFocus
|
|
2400
2438
|
});
|
|
2401
|
-
const stateProps = (0,
|
|
2439
|
+
const stateProps = (0, import_system46.useStateProps)({
|
|
2402
2440
|
hover: isHovered,
|
|
2403
2441
|
focus: isFocusVisible,
|
|
2404
2442
|
disabled,
|
|
2405
2443
|
readOnly,
|
|
2406
2444
|
error
|
|
2407
2445
|
});
|
|
2408
|
-
return /* @__PURE__ */
|
|
2446
|
+
return /* @__PURE__ */ import_react64.default.createElement(FieldBase, {
|
|
2409
2447
|
label,
|
|
2410
2448
|
labelProps,
|
|
2411
2449
|
required,
|
|
@@ -2418,7 +2456,7 @@ var TextField = (_a) => {
|
|
|
2418
2456
|
variant,
|
|
2419
2457
|
size,
|
|
2420
2458
|
width
|
|
2421
|
-
}, /* @__PURE__ */
|
|
2459
|
+
}, /* @__PURE__ */ import_react64.default.createElement(Input, __spreadValues(__spreadValues(__spreadValues(__spreadValues({
|
|
2422
2460
|
ref,
|
|
2423
2461
|
variant,
|
|
2424
2462
|
size
|
|
@@ -2426,10 +2464,10 @@ var TextField = (_a) => {
|
|
|
2426
2464
|
};
|
|
2427
2465
|
|
|
2428
2466
|
// src/Tiles/Tiles.tsx
|
|
2429
|
-
var
|
|
2430
|
-
var Tiles =
|
|
2467
|
+
var import_react65 = __toESM(require("react"));
|
|
2468
|
+
var Tiles = import_react65.default.forwardRef((_a, ref) => {
|
|
2431
2469
|
var _b = _a, { space = "none", itemMinWidth = "250px", children } = _b, props = __objRest(_b, ["space", "itemMinWidth", "children"]);
|
|
2432
|
-
return /* @__PURE__ */
|
|
2470
|
+
return /* @__PURE__ */ import_react65.default.createElement(import_system.Box, __spreadValues({
|
|
2433
2471
|
ref,
|
|
2434
2472
|
display: "grid",
|
|
2435
2473
|
__baseCSS: {
|
|
@@ -2440,17 +2478,17 @@ var Tiles = import_react64.default.forwardRef((_a, ref) => {
|
|
|
2440
2478
|
});
|
|
2441
2479
|
|
|
2442
2480
|
// src/Tooltip/Tooltip.tsx
|
|
2443
|
-
var
|
|
2481
|
+
var import_react68 = __toESM(require("react"));
|
|
2444
2482
|
var import_tooltip3 = require("@react-aria/tooltip");
|
|
2445
|
-
var
|
|
2483
|
+
var import_system47 = require("@marigold/system");
|
|
2446
2484
|
|
|
2447
2485
|
// src/Tooltip/Context.ts
|
|
2448
|
-
var
|
|
2449
|
-
var TooltipContext = (0,
|
|
2450
|
-
var useTooltipContext = () => (0,
|
|
2486
|
+
var import_react66 = require("react");
|
|
2487
|
+
var TooltipContext = (0, import_react66.createContext)({});
|
|
2488
|
+
var useTooltipContext = () => (0, import_react66.useContext)(TooltipContext);
|
|
2451
2489
|
|
|
2452
2490
|
// src/Tooltip/TooltipTrigger.tsx
|
|
2453
|
-
var
|
|
2491
|
+
var import_react67 = __toESM(require("react"));
|
|
2454
2492
|
var import_focus18 = require("@react-aria/focus");
|
|
2455
2493
|
var import_overlays9 = require("@react-aria/overlays");
|
|
2456
2494
|
var import_tooltip = require("@react-aria/tooltip");
|
|
@@ -2469,15 +2507,15 @@ var TooltipTrigger = (_a) => {
|
|
|
2469
2507
|
"placement",
|
|
2470
2508
|
"children"
|
|
2471
2509
|
]);
|
|
2472
|
-
const [tooltipTrigger, tooltip] =
|
|
2510
|
+
const [tooltipTrigger, tooltip] = import_react67.default.Children.toArray(children);
|
|
2473
2511
|
const props = __spreadProps(__spreadValues({}, rest), {
|
|
2474
2512
|
isDisabled: disabled,
|
|
2475
2513
|
isOpen: open,
|
|
2476
2514
|
delay,
|
|
2477
2515
|
placement
|
|
2478
2516
|
});
|
|
2479
|
-
const tooltipTriggerRef = (0,
|
|
2480
|
-
const overlayRef = (0,
|
|
2517
|
+
const tooltipTriggerRef = (0, import_react67.useRef)(null);
|
|
2518
|
+
const overlayRef = (0, import_react67.useRef)(null);
|
|
2481
2519
|
const state = (0, import_tooltip2.useTooltipTriggerState)(props);
|
|
2482
2520
|
const { triggerProps, tooltipProps } = (0, import_tooltip.useTooltipTrigger)(props, state, tooltipTriggerRef);
|
|
2483
2521
|
const {
|
|
@@ -2492,16 +2530,16 @@ var TooltipTrigger = (_a) => {
|
|
|
2492
2530
|
isOpen: state.isOpen,
|
|
2493
2531
|
overlayRef
|
|
2494
2532
|
});
|
|
2495
|
-
return /* @__PURE__ */
|
|
2533
|
+
return /* @__PURE__ */ import_react67.default.createElement(import_focus18.FocusableProvider, __spreadValues({
|
|
2496
2534
|
ref: tooltipTriggerRef
|
|
2497
|
-
}, triggerProps), tooltipTrigger, /* @__PURE__ */
|
|
2535
|
+
}, triggerProps), tooltipTrigger, /* @__PURE__ */ import_react67.default.createElement(TooltipContext.Provider, {
|
|
2498
2536
|
value: __spreadValues(__spreadValues({
|
|
2499
2537
|
state,
|
|
2500
2538
|
overlayRef,
|
|
2501
2539
|
arrowProps,
|
|
2502
2540
|
placement: overlayPlacement
|
|
2503
2541
|
}, tooltipProps), positionProps)
|
|
2504
|
-
}, /* @__PURE__ */
|
|
2542
|
+
}, /* @__PURE__ */ import_react67.default.createElement(Overlay, {
|
|
2505
2543
|
open: state.isOpen
|
|
2506
2544
|
}, tooltip)));
|
|
2507
2545
|
};
|
|
@@ -2510,12 +2548,12 @@ var TooltipTrigger = (_a) => {
|
|
|
2510
2548
|
var Tooltip = ({ children, variant, size }) => {
|
|
2511
2549
|
const _a = useTooltipContext(), { arrowProps, state, overlayRef, placement } = _a, rest = __objRest(_a, ["arrowProps", "state", "overlayRef", "placement"]);
|
|
2512
2550
|
const { tooltipProps } = (0, import_tooltip3.useTooltip)({}, state);
|
|
2513
|
-
const styles = (0,
|
|
2514
|
-
return /* @__PURE__ */
|
|
2551
|
+
const styles = (0, import_system47.useComponentStyles)("Tooltip", { variant, size }, { parts: ["container", "arrow"] });
|
|
2552
|
+
return /* @__PURE__ */ import_react68.default.createElement(import_system47.Box, __spreadProps(__spreadValues(__spreadValues({}, tooltipProps), rest), {
|
|
2515
2553
|
ref: overlayRef,
|
|
2516
2554
|
css: styles.container,
|
|
2517
2555
|
"data-placement": placement
|
|
2518
|
-
}), /* @__PURE__ */
|
|
2556
|
+
}), /* @__PURE__ */ import_react68.default.createElement("div", null, children), /* @__PURE__ */ import_react68.default.createElement(import_system47.Box, __spreadProps(__spreadValues({}, arrowProps), {
|
|
2519
2557
|
__baseCSS: {
|
|
2520
2558
|
position: "absolute",
|
|
2521
2559
|
height: 0,
|
|
@@ -2565,6 +2603,7 @@ Tooltip.Trigger = TooltipTrigger;
|
|
|
2565
2603
|
SSRProvider,
|
|
2566
2604
|
Select,
|
|
2567
2605
|
Slider,
|
|
2606
|
+
Split,
|
|
2568
2607
|
Stack,
|
|
2569
2608
|
Switch,
|
|
2570
2609
|
Table,
|
package/dist/index.mjs
CHANGED
|
@@ -1862,8 +1862,16 @@ var Slider = (_a) => {
|
|
|
1862
1862
|
})));
|
|
1863
1863
|
};
|
|
1864
1864
|
|
|
1865
|
-
// src/
|
|
1865
|
+
// src/Split/Split.tsx
|
|
1866
1866
|
import React45 from "react";
|
|
1867
|
+
import { Box as Box25 } from "@marigold/system";
|
|
1868
|
+
var Split = (props) => /* @__PURE__ */ React45.createElement(Box25, __spreadProps(__spreadValues({}, props), {
|
|
1869
|
+
role: "separator",
|
|
1870
|
+
css: { flexGrow: 1 }
|
|
1871
|
+
}));
|
|
1872
|
+
|
|
1873
|
+
// src/Stack/Stack.tsx
|
|
1874
|
+
import React46 from "react";
|
|
1867
1875
|
var ALIGNMENT_X2 = {
|
|
1868
1876
|
left: "flex-start",
|
|
1869
1877
|
center: "center",
|
|
@@ -1888,7 +1896,7 @@ var Stack = (_a) => {
|
|
|
1888
1896
|
"alignY",
|
|
1889
1897
|
"stretch"
|
|
1890
1898
|
]);
|
|
1891
|
-
return /* @__PURE__ */
|
|
1899
|
+
return /* @__PURE__ */ React46.createElement(Box, __spreadValues({
|
|
1892
1900
|
css: {
|
|
1893
1901
|
display: "flex",
|
|
1894
1902
|
flexDirection: "column",
|
|
@@ -1902,7 +1910,7 @@ var Stack = (_a) => {
|
|
|
1902
1910
|
};
|
|
1903
1911
|
|
|
1904
1912
|
// src/Switch/Switch.tsx
|
|
1905
|
-
import
|
|
1913
|
+
import React47, { useRef as useRef14 } from "react";
|
|
1906
1914
|
import { useFocusRing as useFocusRing8 } from "@react-aria/focus";
|
|
1907
1915
|
import { useSwitch } from "@react-aria/switch";
|
|
1908
1916
|
import { useToggleState as useToggleState2 } from "@react-stately/toggle";
|
|
@@ -1945,7 +1953,7 @@ var Switch = (_a) => {
|
|
|
1945
1953
|
focus: isFocusVisible
|
|
1946
1954
|
});
|
|
1947
1955
|
const styles = useComponentStyles26("Switch", { variant, size }, { parts: ["container", "label", "track", "thumb"] });
|
|
1948
|
-
return /* @__PURE__ */
|
|
1956
|
+
return /* @__PURE__ */ React47.createElement(Box, {
|
|
1949
1957
|
as: "label",
|
|
1950
1958
|
__baseCSS: {
|
|
1951
1959
|
display: "flex",
|
|
@@ -1956,7 +1964,7 @@ var Switch = (_a) => {
|
|
|
1956
1964
|
width
|
|
1957
1965
|
},
|
|
1958
1966
|
css: styles.container
|
|
1959
|
-
}, /* @__PURE__ */
|
|
1967
|
+
}, /* @__PURE__ */ React47.createElement(Box, __spreadValues(__spreadValues({
|
|
1960
1968
|
as: "input",
|
|
1961
1969
|
ref,
|
|
1962
1970
|
css: {
|
|
@@ -1969,9 +1977,9 @@ var Switch = (_a) => {
|
|
|
1969
1977
|
opacity: 1e-4,
|
|
1970
1978
|
cursor: inputProps.disabled ? "not-allowed" : "pointer"
|
|
1971
1979
|
}
|
|
1972
|
-
}, inputProps), focusProps)), props.children && /* @__PURE__ */
|
|
1980
|
+
}, inputProps), focusProps)), props.children && /* @__PURE__ */ React47.createElement(Box, {
|
|
1973
1981
|
css: styles.label
|
|
1974
|
-
}, props.children), /* @__PURE__ */
|
|
1982
|
+
}, props.children), /* @__PURE__ */ React47.createElement(Box, __spreadValues({
|
|
1975
1983
|
__baseCSS: {
|
|
1976
1984
|
position: "relative",
|
|
1977
1985
|
width: 48,
|
|
@@ -1980,7 +1988,7 @@ var Switch = (_a) => {
|
|
|
1980
1988
|
borderRadius: 20
|
|
1981
1989
|
},
|
|
1982
1990
|
css: styles.track
|
|
1983
|
-
}, stateProps), /* @__PURE__ */
|
|
1991
|
+
}, stateProps), /* @__PURE__ */ React47.createElement(Box, __spreadValues({
|
|
1984
1992
|
__baseCSS: {
|
|
1985
1993
|
display: "block",
|
|
1986
1994
|
position: "absolute",
|
|
@@ -2002,7 +2010,7 @@ var Switch = (_a) => {
|
|
|
2002
2010
|
};
|
|
2003
2011
|
|
|
2004
2012
|
// src/Table/Table.tsx
|
|
2005
|
-
import
|
|
2013
|
+
import React56, { useRef as useRef21 } from "react";
|
|
2006
2014
|
import { useTable } from "@react-aria/table";
|
|
2007
2015
|
import {
|
|
2008
2016
|
Cell,
|
|
@@ -2013,7 +2021,7 @@ import {
|
|
|
2013
2021
|
useTableState
|
|
2014
2022
|
} from "@react-stately/table";
|
|
2015
2023
|
import {
|
|
2016
|
-
Box as
|
|
2024
|
+
Box as Box31,
|
|
2017
2025
|
useComponentStyles as useComponentStyles27
|
|
2018
2026
|
} from "@marigold/system";
|
|
2019
2027
|
|
|
@@ -2023,19 +2031,19 @@ var TableContext = createContext6({});
|
|
|
2023
2031
|
var useTableContext = () => useContext6(TableContext);
|
|
2024
2032
|
|
|
2025
2033
|
// src/Table/TableBody.tsx
|
|
2026
|
-
import
|
|
2034
|
+
import React48 from "react";
|
|
2027
2035
|
import { useTableRowGroup } from "@react-aria/table";
|
|
2028
2036
|
var TableBody = ({ children }) => {
|
|
2029
2037
|
const { rowGroupProps } = useTableRowGroup();
|
|
2030
|
-
return /* @__PURE__ */
|
|
2038
|
+
return /* @__PURE__ */ React48.createElement("tbody", __spreadValues({}, rowGroupProps), children);
|
|
2031
2039
|
};
|
|
2032
2040
|
|
|
2033
2041
|
// src/Table/TableCell.tsx
|
|
2034
|
-
import
|
|
2042
|
+
import React49, { useRef as useRef15 } from "react";
|
|
2035
2043
|
import { useTableCell } from "@react-aria/table";
|
|
2036
2044
|
import { useFocusRing as useFocusRing9 } from "@react-aria/focus";
|
|
2037
2045
|
import { mergeProps as mergeProps9 } from "@react-aria/utils";
|
|
2038
|
-
import { Box as
|
|
2046
|
+
import { Box as Box26, useStateProps as useStateProps11 } from "@marigold/system";
|
|
2039
2047
|
var TableCell = ({ cell }) => {
|
|
2040
2048
|
const ref = useRef15(null);
|
|
2041
2049
|
const { state, styles } = useTableContext();
|
|
@@ -2045,7 +2053,7 @@ var TableCell = ({ cell }) => {
|
|
|
2045
2053
|
}, state, ref);
|
|
2046
2054
|
const { focusProps, isFocusVisible } = useFocusRing9();
|
|
2047
2055
|
const stateProps = useStateProps11({ disabled, focusVisible: isFocusVisible });
|
|
2048
|
-
return /* @__PURE__ */
|
|
2056
|
+
return /* @__PURE__ */ React49.createElement(Box26, __spreadValues(__spreadValues({
|
|
2049
2057
|
as: "td",
|
|
2050
2058
|
ref,
|
|
2051
2059
|
css: styles.cell
|
|
@@ -2053,11 +2061,11 @@ var TableCell = ({ cell }) => {
|
|
|
2053
2061
|
};
|
|
2054
2062
|
|
|
2055
2063
|
// src/Table/TableCheckboxCell.tsx
|
|
2056
|
-
import
|
|
2064
|
+
import React50, { useRef as useRef16 } from "react";
|
|
2057
2065
|
import { useTableCell as useTableCell2, useTableSelectionCheckbox } from "@react-aria/table";
|
|
2058
2066
|
import { useFocusRing as useFocusRing10 } from "@react-aria/focus";
|
|
2059
2067
|
import { mergeProps as mergeProps10 } from "@react-aria/utils";
|
|
2060
|
-
import { Box as
|
|
2068
|
+
import { Box as Box27, useStateProps as useStateProps12 } from "@marigold/system";
|
|
2061
2069
|
|
|
2062
2070
|
// src/Table/utils.ts
|
|
2063
2071
|
var mapCheckboxProps = (_a) => {
|
|
@@ -2094,7 +2102,7 @@ var TableCheckboxCell = ({ cell }) => {
|
|
|
2094
2102
|
const { checkboxProps } = mapCheckboxProps(useTableSelectionCheckbox({ key: cell.parentKey }, state));
|
|
2095
2103
|
const { focusProps, isFocusVisible } = useFocusRing10();
|
|
2096
2104
|
const stateProps = useStateProps12({ disabled, focusVisible: isFocusVisible });
|
|
2097
|
-
return /* @__PURE__ */
|
|
2105
|
+
return /* @__PURE__ */ React50.createElement(Box27, __spreadValues(__spreadValues({
|
|
2098
2106
|
as: "td",
|
|
2099
2107
|
ref,
|
|
2100
2108
|
__baseCSS: {
|
|
@@ -2103,17 +2111,31 @@ var TableCheckboxCell = ({ cell }) => {
|
|
|
2103
2111
|
lineHeight: 1
|
|
2104
2112
|
},
|
|
2105
2113
|
css: styles.cell
|
|
2106
|
-
}, mergeProps10(gridCellProps, focusProps)), stateProps), /* @__PURE__ */
|
|
2114
|
+
}, mergeProps10(gridCellProps, focusProps)), stateProps), /* @__PURE__ */ React50.createElement(Checkbox, __spreadValues({}, checkboxProps)));
|
|
2107
2115
|
};
|
|
2108
2116
|
|
|
2109
2117
|
// src/Table/TableColumnHeader.tsx
|
|
2110
|
-
import
|
|
2118
|
+
import React51, { useRef as useRef17 } from "react";
|
|
2111
2119
|
import { useFocusRing as useFocusRing11 } from "@react-aria/focus";
|
|
2112
2120
|
import { useHover as useHover5 } from "@react-aria/interactions";
|
|
2113
2121
|
import { useTableColumnHeader } from "@react-aria/table";
|
|
2114
2122
|
import { mergeProps as mergeProps11 } from "@react-aria/utils";
|
|
2115
|
-
import { Box as
|
|
2123
|
+
import { Box as Box28, useStateProps as useStateProps13 } from "@marigold/system";
|
|
2124
|
+
var SortIndicator = ({
|
|
2125
|
+
direction = "ascending",
|
|
2126
|
+
visible
|
|
2127
|
+
}) => /* @__PURE__ */ React51.createElement(Box28, {
|
|
2128
|
+
as: "span",
|
|
2129
|
+
role: "presentation",
|
|
2130
|
+
"aria-hidden": "true",
|
|
2131
|
+
css: {
|
|
2132
|
+
color: "currentColor",
|
|
2133
|
+
paddingInlineStart: "0.5ch",
|
|
2134
|
+
visibility: visible ? "visible" : "hidden"
|
|
2135
|
+
}
|
|
2136
|
+
}, direction === "ascending" ? "\u25B2" : "\u25BC");
|
|
2116
2137
|
var TableColumnHeader = ({ column }) => {
|
|
2138
|
+
var _a, _b;
|
|
2117
2139
|
const ref = useRef17(null);
|
|
2118
2140
|
const { state, styles } = useTableContext();
|
|
2119
2141
|
const { columnHeaderProps } = useTableColumnHeader({
|
|
@@ -2125,41 +2147,44 @@ var TableColumnHeader = ({ column }) => {
|
|
|
2125
2147
|
hover: isHovered,
|
|
2126
2148
|
focusVisible: isFocusVisible
|
|
2127
2149
|
});
|
|
2128
|
-
return /* @__PURE__ */
|
|
2150
|
+
return /* @__PURE__ */ React51.createElement(Box28, __spreadValues(__spreadValues({
|
|
2129
2151
|
as: "th",
|
|
2130
2152
|
colSpan: column.colspan,
|
|
2131
2153
|
ref,
|
|
2132
2154
|
css: styles.header
|
|
2133
|
-
}, mergeProps11(columnHeaderProps, hoverProps, focusProps)), stateProps), column.rendered
|
|
2155
|
+
}, mergeProps11(columnHeaderProps, hoverProps, focusProps)), stateProps), column.rendered, column.props.allowsSorting && /* @__PURE__ */ React51.createElement(SortIndicator, {
|
|
2156
|
+
direction: (_a = state.sortDescriptor) == null ? void 0 : _a.direction,
|
|
2157
|
+
visible: ((_b = state.sortDescriptor) == null ? void 0 : _b.column) === column.key
|
|
2158
|
+
}));
|
|
2134
2159
|
};
|
|
2135
2160
|
|
|
2136
2161
|
// src/Table/TableHeader.tsx
|
|
2137
|
-
import
|
|
2162
|
+
import React52 from "react";
|
|
2138
2163
|
import { useTableRowGroup as useTableRowGroup2 } from "@react-aria/table";
|
|
2139
2164
|
var TableHeader = ({ children }) => {
|
|
2140
2165
|
const { rowGroupProps } = useTableRowGroup2();
|
|
2141
|
-
return /* @__PURE__ */
|
|
2166
|
+
return /* @__PURE__ */ React52.createElement("thead", __spreadValues({}, rowGroupProps), children);
|
|
2142
2167
|
};
|
|
2143
2168
|
|
|
2144
2169
|
// src/Table/TableHeaderRow.tsx
|
|
2145
|
-
import
|
|
2170
|
+
import React53, { useRef as useRef18 } from "react";
|
|
2146
2171
|
import { useTableHeaderRow } from "@react-aria/table";
|
|
2147
2172
|
var TableHeaderRow = ({ item, children }) => {
|
|
2148
2173
|
const { state } = useTableContext();
|
|
2149
2174
|
const ref = useRef18(null);
|
|
2150
2175
|
const { rowProps } = useTableHeaderRow({ node: item }, state, ref);
|
|
2151
|
-
return /* @__PURE__ */
|
|
2176
|
+
return /* @__PURE__ */ React53.createElement("tr", __spreadProps(__spreadValues({}, rowProps), {
|
|
2152
2177
|
ref
|
|
2153
2178
|
}), children);
|
|
2154
2179
|
};
|
|
2155
2180
|
|
|
2156
2181
|
// src/Table/TableRow.tsx
|
|
2157
|
-
import
|
|
2182
|
+
import React54, { useRef as useRef19 } from "react";
|
|
2158
2183
|
import { useFocusRing as useFocusRing12 } from "@react-aria/focus";
|
|
2159
2184
|
import { useHover as useHover6 } from "@react-aria/interactions";
|
|
2160
2185
|
import { useTableRow } from "@react-aria/table";
|
|
2161
2186
|
import { mergeProps as mergeProps12 } from "@react-aria/utils";
|
|
2162
|
-
import { Box as
|
|
2187
|
+
import { Box as Box29, useStateProps as useStateProps14 } from "@marigold/system";
|
|
2163
2188
|
var TableRow = ({ children, row }) => {
|
|
2164
2189
|
const ref = useRef19(null);
|
|
2165
2190
|
const { state, styles } = useTableContext();
|
|
@@ -2177,7 +2202,7 @@ var TableRow = ({ children, row }) => {
|
|
|
2177
2202
|
focusVisible: isFocusVisible,
|
|
2178
2203
|
active: isPressed
|
|
2179
2204
|
});
|
|
2180
|
-
return /* @__PURE__ */
|
|
2205
|
+
return /* @__PURE__ */ React54.createElement(Box29, __spreadValues(__spreadValues({
|
|
2181
2206
|
as: "tr",
|
|
2182
2207
|
ref,
|
|
2183
2208
|
css: styles.row
|
|
@@ -2185,7 +2210,7 @@ var TableRow = ({ children, row }) => {
|
|
|
2185
2210
|
};
|
|
2186
2211
|
|
|
2187
2212
|
// src/Table/TableSelectAllCell.tsx
|
|
2188
|
-
import
|
|
2213
|
+
import React55, { useRef as useRef20 } from "react";
|
|
2189
2214
|
import { useFocusRing as useFocusRing13 } from "@react-aria/focus";
|
|
2190
2215
|
import { useHover as useHover7 } from "@react-aria/interactions";
|
|
2191
2216
|
import {
|
|
@@ -2193,7 +2218,7 @@ import {
|
|
|
2193
2218
|
useTableSelectAllCheckbox
|
|
2194
2219
|
} from "@react-aria/table";
|
|
2195
2220
|
import { mergeProps as mergeProps13 } from "@react-aria/utils";
|
|
2196
|
-
import { Box as
|
|
2221
|
+
import { Box as Box30, useStateProps as useStateProps15 } from "@marigold/system";
|
|
2197
2222
|
var TableSelectAllCell = ({ column }) => {
|
|
2198
2223
|
const ref = useRef20(null);
|
|
2199
2224
|
const { state, styles } = useTableContext();
|
|
@@ -2207,7 +2232,7 @@ var TableSelectAllCell = ({ column }) => {
|
|
|
2207
2232
|
hover: isHovered,
|
|
2208
2233
|
focusVisible: isFocusVisible
|
|
2209
2234
|
});
|
|
2210
|
-
return /* @__PURE__ */
|
|
2235
|
+
return /* @__PURE__ */ React55.createElement(Box30, __spreadValues(__spreadValues({
|
|
2211
2236
|
as: "th",
|
|
2212
2237
|
ref,
|
|
2213
2238
|
__baseCSS: {
|
|
@@ -2216,12 +2241,20 @@ var TableSelectAllCell = ({ column }) => {
|
|
|
2216
2241
|
lineHeight: 1
|
|
2217
2242
|
},
|
|
2218
2243
|
css: styles.header
|
|
2219
|
-
}, mergeProps13(columnHeaderProps, hoverProps, focusProps)), stateProps), /* @__PURE__ */
|
|
2244
|
+
}, mergeProps13(columnHeaderProps, hoverProps, focusProps)), stateProps), /* @__PURE__ */ React55.createElement(Checkbox, __spreadValues({}, checkboxProps)));
|
|
2220
2245
|
};
|
|
2221
2246
|
|
|
2222
2247
|
// src/Table/Table.tsx
|
|
2223
2248
|
var Table = (_a) => {
|
|
2224
|
-
var _b = _a, {
|
|
2249
|
+
var _b = _a, {
|
|
2250
|
+
variant,
|
|
2251
|
+
size,
|
|
2252
|
+
stretch
|
|
2253
|
+
} = _b, props = __objRest(_b, [
|
|
2254
|
+
"variant",
|
|
2255
|
+
"size",
|
|
2256
|
+
"stretch"
|
|
2257
|
+
]);
|
|
2225
2258
|
const tableRef = useRef21(null);
|
|
2226
2259
|
const state = useTableState(__spreadProps(__spreadValues({}, props), {
|
|
2227
2260
|
showSelectionCheckboxes: props.selectionMode === "multiple" && props.selectionBehavior !== "replace"
|
|
@@ -2229,33 +2262,37 @@ var Table = (_a) => {
|
|
|
2229
2262
|
const { gridProps } = useTable(props, state, tableRef);
|
|
2230
2263
|
const styles = useComponentStyles27("Table", { variant, size }, { parts: ["table", "header", "row", "cell"] });
|
|
2231
2264
|
const { collection } = state;
|
|
2232
|
-
return /* @__PURE__ */
|
|
2265
|
+
return /* @__PURE__ */ React56.createElement(TableContext.Provider, {
|
|
2233
2266
|
value: { state, styles }
|
|
2234
|
-
}, /* @__PURE__ */
|
|
2267
|
+
}, /* @__PURE__ */ React56.createElement(Box31, __spreadValues({
|
|
2235
2268
|
as: "table",
|
|
2236
2269
|
ref: tableRef,
|
|
2270
|
+
__baseCSS: {
|
|
2271
|
+
borderCollapse: "collapse",
|
|
2272
|
+
width: stretch ? "100%" : void 0
|
|
2273
|
+
},
|
|
2237
2274
|
css: styles.table
|
|
2238
|
-
}, gridProps), /* @__PURE__ */
|
|
2275
|
+
}, gridProps), /* @__PURE__ */ React56.createElement(TableHeader, null, collection.headerRows.map((headerRow) => /* @__PURE__ */ React56.createElement(TableHeaderRow, {
|
|
2239
2276
|
key: headerRow.key,
|
|
2240
2277
|
item: headerRow
|
|
2241
2278
|
}, [...headerRow.childNodes].map((column) => {
|
|
2242
2279
|
var _a2;
|
|
2243
|
-
return ((_a2 = column.props) == null ? void 0 : _a2.isSelectionCell) ? /* @__PURE__ */
|
|
2280
|
+
return ((_a2 = column.props) == null ? void 0 : _a2.isSelectionCell) ? /* @__PURE__ */ React56.createElement(TableSelectAllCell, {
|
|
2244
2281
|
key: column.key,
|
|
2245
2282
|
column
|
|
2246
|
-
}) : /* @__PURE__ */
|
|
2283
|
+
}) : /* @__PURE__ */ React56.createElement(TableColumnHeader, {
|
|
2247
2284
|
key: column.key,
|
|
2248
2285
|
column
|
|
2249
2286
|
});
|
|
2250
|
-
})))), /* @__PURE__ */
|
|
2287
|
+
})))), /* @__PURE__ */ React56.createElement(TableBody, null, [...collection.body.childNodes].map((row) => /* @__PURE__ */ React56.createElement(TableRow, {
|
|
2251
2288
|
key: row.key,
|
|
2252
2289
|
row
|
|
2253
2290
|
}, [...row.childNodes].map((cell) => {
|
|
2254
2291
|
var _a2;
|
|
2255
|
-
return ((_a2 = cell.props) == null ? void 0 : _a2.isSelectionCell) ? /* @__PURE__ */
|
|
2292
|
+
return ((_a2 = cell.props) == null ? void 0 : _a2.isSelectionCell) ? /* @__PURE__ */ React56.createElement(TableCheckboxCell, {
|
|
2256
2293
|
key: cell.key,
|
|
2257
2294
|
cell
|
|
2258
|
-
}) : /* @__PURE__ */
|
|
2295
|
+
}) : /* @__PURE__ */ React56.createElement(TableCell, {
|
|
2259
2296
|
key: cell.key,
|
|
2260
2297
|
cell
|
|
2261
2298
|
});
|
|
@@ -2268,11 +2305,11 @@ Table.Header = Header2;
|
|
|
2268
2305
|
Table.Row = Row;
|
|
2269
2306
|
|
|
2270
2307
|
// src/Text/Text.tsx
|
|
2271
|
-
import
|
|
2308
|
+
import React57 from "react";
|
|
2272
2309
|
import {
|
|
2273
2310
|
useComponentStyles as useComponentStyles28
|
|
2274
2311
|
} from "@marigold/system";
|
|
2275
|
-
import { Box as
|
|
2312
|
+
import { Box as Box32 } from "@marigold/system";
|
|
2276
2313
|
var Text = (_a) => {
|
|
2277
2314
|
var _b = _a, {
|
|
2278
2315
|
variant,
|
|
@@ -2297,7 +2334,7 @@ var Text = (_a) => {
|
|
|
2297
2334
|
variant,
|
|
2298
2335
|
size
|
|
2299
2336
|
});
|
|
2300
|
-
return /* @__PURE__ */
|
|
2337
|
+
return /* @__PURE__ */ React57.createElement(Box32, __spreadProps(__spreadValues({
|
|
2301
2338
|
as: "p"
|
|
2302
2339
|
}, props), {
|
|
2303
2340
|
css: __spreadValues({ color, cursor, outline, fontSize, textAlign: align }, styles)
|
|
@@ -2305,10 +2342,10 @@ var Text = (_a) => {
|
|
|
2305
2342
|
};
|
|
2306
2343
|
|
|
2307
2344
|
// src/TextArea/TextArea.tsx
|
|
2308
|
-
import
|
|
2345
|
+
import React58, { useRef as useRef22 } from "react";
|
|
2309
2346
|
import { useTextField } from "@react-aria/textfield";
|
|
2310
2347
|
import {
|
|
2311
|
-
Box as
|
|
2348
|
+
Box as Box33,
|
|
2312
2349
|
useComponentStyles as useComponentStyles29,
|
|
2313
2350
|
useStateProps as useStateProps16
|
|
2314
2351
|
} from "@marigold/system";
|
|
@@ -2353,7 +2390,7 @@ var TextArea = (_a) => {
|
|
|
2353
2390
|
error
|
|
2354
2391
|
});
|
|
2355
2392
|
const styles = useComponentStyles29("TextArea", { variant, size });
|
|
2356
|
-
return /* @__PURE__ */
|
|
2393
|
+
return /* @__PURE__ */ React58.createElement(FieldBase, {
|
|
2357
2394
|
label,
|
|
2358
2395
|
labelProps,
|
|
2359
2396
|
required,
|
|
@@ -2366,7 +2403,7 @@ var TextArea = (_a) => {
|
|
|
2366
2403
|
variant,
|
|
2367
2404
|
size,
|
|
2368
2405
|
width
|
|
2369
|
-
}, /* @__PURE__ */
|
|
2406
|
+
}, /* @__PURE__ */ React58.createElement(Box33, __spreadValues(__spreadValues(__spreadValues(__spreadValues({
|
|
2370
2407
|
as: "textarea",
|
|
2371
2408
|
css: styles,
|
|
2372
2409
|
ref,
|
|
@@ -2375,7 +2412,7 @@ var TextArea = (_a) => {
|
|
|
2375
2412
|
};
|
|
2376
2413
|
|
|
2377
2414
|
// src/TextField/TextField.tsx
|
|
2378
|
-
import
|
|
2415
|
+
import React59, { useRef as useRef23 } from "react";
|
|
2379
2416
|
import { useHover as useHover9 } from "@react-aria/interactions";
|
|
2380
2417
|
import { useFocusRing as useFocusRing15 } from "@react-aria/focus";
|
|
2381
2418
|
import { useTextField as useTextField2 } from "@react-aria/textfield";
|
|
@@ -2418,7 +2455,7 @@ var TextField = (_a) => {
|
|
|
2418
2455
|
readOnly,
|
|
2419
2456
|
error
|
|
2420
2457
|
});
|
|
2421
|
-
return /* @__PURE__ */
|
|
2458
|
+
return /* @__PURE__ */ React59.createElement(FieldBase, {
|
|
2422
2459
|
label,
|
|
2423
2460
|
labelProps,
|
|
2424
2461
|
required,
|
|
@@ -2431,7 +2468,7 @@ var TextField = (_a) => {
|
|
|
2431
2468
|
variant,
|
|
2432
2469
|
size,
|
|
2433
2470
|
width
|
|
2434
|
-
}, /* @__PURE__ */
|
|
2471
|
+
}, /* @__PURE__ */ React59.createElement(Input, __spreadValues(__spreadValues(__spreadValues(__spreadValues({
|
|
2435
2472
|
ref,
|
|
2436
2473
|
variant,
|
|
2437
2474
|
size
|
|
@@ -2439,10 +2476,10 @@ var TextField = (_a) => {
|
|
|
2439
2476
|
};
|
|
2440
2477
|
|
|
2441
2478
|
// src/Tiles/Tiles.tsx
|
|
2442
|
-
import
|
|
2443
|
-
var Tiles =
|
|
2479
|
+
import React60 from "react";
|
|
2480
|
+
var Tiles = React60.forwardRef((_a, ref) => {
|
|
2444
2481
|
var _b = _a, { space = "none", itemMinWidth = "250px", children } = _b, props = __objRest(_b, ["space", "itemMinWidth", "children"]);
|
|
2445
|
-
return /* @__PURE__ */
|
|
2482
|
+
return /* @__PURE__ */ React60.createElement(Box, __spreadValues({
|
|
2446
2483
|
ref,
|
|
2447
2484
|
display: "grid",
|
|
2448
2485
|
__baseCSS: {
|
|
@@ -2453,10 +2490,10 @@ var Tiles = React59.forwardRef((_a, ref) => {
|
|
|
2453
2490
|
});
|
|
2454
2491
|
|
|
2455
2492
|
// src/Tooltip/Tooltip.tsx
|
|
2456
|
-
import
|
|
2493
|
+
import React62 from "react";
|
|
2457
2494
|
import { useTooltip } from "@react-aria/tooltip";
|
|
2458
2495
|
import {
|
|
2459
|
-
Box as
|
|
2496
|
+
Box as Box34,
|
|
2460
2497
|
useComponentStyles as useComponentStyles30
|
|
2461
2498
|
} from "@marigold/system";
|
|
2462
2499
|
|
|
@@ -2466,7 +2503,7 @@ var TooltipContext = createContext7({});
|
|
|
2466
2503
|
var useTooltipContext = () => useContext7(TooltipContext);
|
|
2467
2504
|
|
|
2468
2505
|
// src/Tooltip/TooltipTrigger.tsx
|
|
2469
|
-
import
|
|
2506
|
+
import React61, { useRef as useRef24 } from "react";
|
|
2470
2507
|
import { FocusableProvider } from "@react-aria/focus";
|
|
2471
2508
|
import { useOverlayPosition as useOverlayPosition3 } from "@react-aria/overlays";
|
|
2472
2509
|
import { useTooltipTrigger } from "@react-aria/tooltip";
|
|
@@ -2485,7 +2522,7 @@ var TooltipTrigger = (_a) => {
|
|
|
2485
2522
|
"placement",
|
|
2486
2523
|
"children"
|
|
2487
2524
|
]);
|
|
2488
|
-
const [tooltipTrigger, tooltip] =
|
|
2525
|
+
const [tooltipTrigger, tooltip] = React61.Children.toArray(children);
|
|
2489
2526
|
const props = __spreadProps(__spreadValues({}, rest), {
|
|
2490
2527
|
isDisabled: disabled,
|
|
2491
2528
|
isOpen: open,
|
|
@@ -2508,16 +2545,16 @@ var TooltipTrigger = (_a) => {
|
|
|
2508
2545
|
isOpen: state.isOpen,
|
|
2509
2546
|
overlayRef
|
|
2510
2547
|
});
|
|
2511
|
-
return /* @__PURE__ */
|
|
2548
|
+
return /* @__PURE__ */ React61.createElement(FocusableProvider, __spreadValues({
|
|
2512
2549
|
ref: tooltipTriggerRef
|
|
2513
|
-
}, triggerProps), tooltipTrigger, /* @__PURE__ */
|
|
2550
|
+
}, triggerProps), tooltipTrigger, /* @__PURE__ */ React61.createElement(TooltipContext.Provider, {
|
|
2514
2551
|
value: __spreadValues(__spreadValues({
|
|
2515
2552
|
state,
|
|
2516
2553
|
overlayRef,
|
|
2517
2554
|
arrowProps,
|
|
2518
2555
|
placement: overlayPlacement
|
|
2519
2556
|
}, tooltipProps), positionProps)
|
|
2520
|
-
}, /* @__PURE__ */
|
|
2557
|
+
}, /* @__PURE__ */ React61.createElement(Overlay, {
|
|
2521
2558
|
open: state.isOpen
|
|
2522
2559
|
}, tooltip)));
|
|
2523
2560
|
};
|
|
@@ -2527,11 +2564,11 @@ var Tooltip = ({ children, variant, size }) => {
|
|
|
2527
2564
|
const _a = useTooltipContext(), { arrowProps, state, overlayRef, placement } = _a, rest = __objRest(_a, ["arrowProps", "state", "overlayRef", "placement"]);
|
|
2528
2565
|
const { tooltipProps } = useTooltip({}, state);
|
|
2529
2566
|
const styles = useComponentStyles30("Tooltip", { variant, size }, { parts: ["container", "arrow"] });
|
|
2530
|
-
return /* @__PURE__ */
|
|
2567
|
+
return /* @__PURE__ */ React62.createElement(Box34, __spreadProps(__spreadValues(__spreadValues({}, tooltipProps), rest), {
|
|
2531
2568
|
ref: overlayRef,
|
|
2532
2569
|
css: styles.container,
|
|
2533
2570
|
"data-placement": placement
|
|
2534
|
-
}), /* @__PURE__ */
|
|
2571
|
+
}), /* @__PURE__ */ React62.createElement("div", null, children), /* @__PURE__ */ React62.createElement(Box34, __spreadProps(__spreadValues({}, arrowProps), {
|
|
2535
2572
|
__baseCSS: {
|
|
2536
2573
|
position: "absolute",
|
|
2537
2574
|
height: 0,
|
|
@@ -2580,6 +2617,7 @@ export {
|
|
|
2580
2617
|
SSRProvider,
|
|
2581
2618
|
Select,
|
|
2582
2619
|
Slider,
|
|
2620
|
+
Split,
|
|
2583
2621
|
Stack,
|
|
2584
2622
|
Switch,
|
|
2585
2623
|
Table,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marigold/components",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Components for the Marigold Design System",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"directory": "packages/components"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@marigold/icons": "0.7.
|
|
27
|
-
"@marigold/system": "1.0
|
|
26
|
+
"@marigold/icons": "0.7.2",
|
|
27
|
+
"@marigold/system": "1.1.0",
|
|
28
28
|
"@marigold/tokens": "3.0.0",
|
|
29
29
|
"@marigold/types": "0.5.1",
|
|
30
30
|
"@react-aria/button": "^3.3.3",
|
|
@@ -78,11 +78,12 @@
|
|
|
78
78
|
"@marigold/tsconfig": "0.3.0",
|
|
79
79
|
"react": "17.0.2",
|
|
80
80
|
"react-dom": "17.0.2",
|
|
81
|
-
"tsup": "5.12.
|
|
81
|
+
"tsup": "5.12.9"
|
|
82
82
|
},
|
|
83
83
|
"scripts": {
|
|
84
84
|
"build": "tsup src/index.ts",
|
|
85
85
|
"watch": "tsup src/index.ts --watch",
|
|
86
86
|
"clean": "rm -rf node_modules && rm -rf dist"
|
|
87
|
-
}
|
|
87
|
+
},
|
|
88
|
+
"readme": "# `@marigold/components`\n\n> Marigold components\n"
|
|
88
89
|
}
|