@marigold/components 1.2.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/dist/index.d.ts +32 -13
  2. package/dist/index.js +1657 -1469
  3. package/dist/index.mjs +1646 -1469
  4. package/package.json +51 -51
package/dist/index.mjs CHANGED
@@ -1,34 +1,5 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- var __objRest = (source, exclude) => {
21
- var target = {};
22
- for (var prop in source)
23
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
- target[prop] = source[prop];
25
- if (source != null && __getOwnPropSymbols)
26
- for (var prop of __getOwnPropSymbols(source)) {
27
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
- target[prop] = source[prop];
29
- }
30
- return target;
31
- };
1
+ // src/hooks.ts
2
+ import { useAsyncList, useListData } from "@react-stately/data";
32
3
 
33
4
  // src/Aside/Aside.tsx
34
5
  import React from "react";
@@ -87,12 +58,12 @@ var Aspect = ({
87
58
  // src/Badge/Badge.tsx
88
59
  import React3 from "react";
89
60
  import { useComponentStyles } from "@marigold/system";
90
- var Badge = (_a) => {
91
- var _b = _a, { variant, size, children } = _b, props = __objRest(_b, ["variant", "size", "children"]);
61
+ var Badge = ({ variant, size, children, ...props }) => {
92
62
  const styles = useComponentStyles("Badge", { variant, size });
93
- return /* @__PURE__ */ React3.createElement(Box, __spreadProps(__spreadValues({}, props), {
63
+ return /* @__PURE__ */ React3.createElement(Box, {
64
+ ...props,
94
65
  css: styles
95
- }), children);
66
+ }, children);
96
67
  };
97
68
 
98
69
  // src/Breakout/Breakout.tsx
@@ -108,81 +79,97 @@ var useAlignment = (direction) => {
108
79
  }
109
80
  return "flex-start";
110
81
  };
111
- var Breakout = (_a) => {
112
- var _b = _a, {
113
- horizontalAlign,
114
- verticalAlign,
115
- children
116
- } = _b, props = __objRest(_b, [
117
- "horizontalAlign",
118
- "verticalAlign",
119
- "children"
120
- ]);
82
+ var Breakout = ({
83
+ horizontalAlign,
84
+ verticalAlign,
85
+ children,
86
+ ...props
87
+ }) => {
121
88
  const alignItems = useAlignment(horizontalAlign);
122
89
  const justifyContent = useAlignment(verticalAlign);
123
- return /* @__PURE__ */ React4.createElement(Box, __spreadValues({
90
+ return /* @__PURE__ */ React4.createElement(Box, {
124
91
  alignItems,
125
92
  justifyContent,
126
93
  width: "100%",
127
94
  display: verticalAlign || horizontalAlign ? "flex" : "block",
128
95
  css: {
129
96
  gridColumn: "1 / -1"
130
- }
131
- }, props), children);
97
+ },
98
+ ...props
99
+ }, children);
132
100
  };
133
101
 
134
102
  // src/Button/Button.tsx
135
- import React5, {
136
- forwardRef,
137
- useImperativeHandle,
138
- useRef
139
- } from "react";
103
+ import React5, { forwardRef } from "react";
140
104
  import { useButton } from "@react-aria/button";
141
105
  import { useFocusRing } from "@react-aria/focus";
142
- import { mergeProps } from "@react-aria/utils";
106
+ import { useHover } from "@react-aria/interactions";
107
+ import { mergeProps, useObjectRef } from "@react-aria/utils";
143
108
  import {
144
109
  Box as Box2,
145
110
  useComponentStyles as useComponentStyles2,
146
111
  useStateProps
147
112
  } from "@marigold/system";
148
- var Button = forwardRef((_a, ref) => {
149
- var _b = _a, {
113
+ var Button = forwardRef(
114
+ ({
150
115
  as = "button",
151
116
  children,
152
117
  variant,
153
118
  size,
154
- disabled
155
- } = _b, props = __objRest(_b, [
156
- "as",
157
- "children",
158
- "variant",
159
- "size",
160
- "disabled"
161
- ]);
162
- const buttonRef = useRef(null);
163
- useImperativeHandle(ref, () => buttonRef.current);
164
- const { buttonProps, isPressed } = useButton(__spreadProps(__spreadValues({}, props), {
165
- elementType: typeof as === "string" ? as : "span",
166
- isDisabled: disabled
167
- }), buttonRef);
168
- const { isFocusVisible, focusProps } = useFocusRing();
169
- const styles = useComponentStyles2("Button", { variant, size });
170
- const stateProps = useStateProps({
171
- active: isPressed,
172
- focus: isFocusVisible
173
- });
174
- return /* @__PURE__ */ React5.createElement(Box2, __spreadProps(__spreadValues(__spreadValues({}, mergeProps(buttonProps, focusProps)), stateProps), {
175
- as,
176
- ref: buttonRef,
177
- __baseCSS: {
178
- display: "inline-flex",
179
- alignItems: "center",
180
- gap: "0.5ch",
181
- cursor: disabled ? "not-allowed" : "pointer"
182
- },
183
- css: styles
184
- }), children);
185
- });
119
+ disabled,
120
+ onClick,
121
+ onPress,
122
+ onPressStart,
123
+ onPressEnd,
124
+ onPressChange,
125
+ onPressUp,
126
+ fullWidth,
127
+ ...props
128
+ }, ref) => {
129
+ const buttonRef = useObjectRef(ref);
130
+ const { hoverProps, isHovered } = useHover({ isDisabled: disabled });
131
+ const { isFocusVisible, focusProps } = useFocusRing({
132
+ autoFocus: props.autoFocus
133
+ });
134
+ const { buttonProps, isPressed } = useButton(
135
+ {
136
+ ...props,
137
+ onClick,
138
+ onPress,
139
+ onPressStart,
140
+ onPressEnd,
141
+ onPressChange,
142
+ onPressUp,
143
+ elementType: typeof as === "string" ? as : "span",
144
+ isDisabled: disabled
145
+ },
146
+ buttonRef
147
+ );
148
+ const styles = useComponentStyles2("Button", { variant, size });
149
+ const stateProps = useStateProps({
150
+ active: isPressed,
151
+ focusVisible: isFocusVisible,
152
+ hover: isHovered
153
+ });
154
+ return /* @__PURE__ */ React5.createElement(Box2, {
155
+ ...mergeProps(buttonProps, focusProps, hoverProps, props),
156
+ ...stateProps,
157
+ as,
158
+ ref: buttonRef,
159
+ __baseCSS: {
160
+ display: "inline-flex",
161
+ alignItems: "center",
162
+ gap: "0.5ch",
163
+ cursor: disabled ? "not-allowed" : "pointer",
164
+ width: fullWidth ? "100%" : void 0,
165
+ "&:focus": {
166
+ outline: 0
167
+ }
168
+ },
169
+ css: styles
170
+ }, children);
171
+ }
172
+ );
186
173
 
187
174
  // src/Card/Card.tsx
188
175
  import React6 from "react";
@@ -190,46 +177,41 @@ import {
190
177
  Box as Box3,
191
178
  useComponentStyles as useComponentStyles3
192
179
  } from "@marigold/system";
193
- var Card = (_a) => {
194
- var _b = _a, { children, variant, size } = _b, props = __objRest(_b, ["children", "variant", "size"]);
180
+ var Card = ({ children, variant, size, ...props }) => {
195
181
  const styles = useComponentStyles3("Card", { variant, size });
196
- return /* @__PURE__ */ React6.createElement(Box3, __spreadProps(__spreadValues({}, props), {
182
+ return /* @__PURE__ */ React6.createElement(Box3, {
183
+ ...props,
197
184
  css: styles
198
- }), children);
185
+ }, children);
199
186
  };
200
187
 
201
188
  // src/Center/Center.tsx
202
189
  import React7 from "react";
203
- var Center = (_a) => {
204
- var _b = _a, {
205
- maxWidth,
206
- space = "none",
207
- children
208
- } = _b, props = __objRest(_b, [
209
- "maxWidth",
210
- "space",
211
- "children"
212
- ]);
213
- return /* @__PURE__ */ React7.createElement(Box, __spreadValues({
214
- css: {
215
- boxSizing: "content-box",
216
- display: "flex",
217
- flexDirection: "column",
218
- alignItems: "center",
219
- justifyContent: "center",
220
- marginInline: "auto",
221
- maxInlineSize: maxWidth,
222
- gap: space
223
- }
224
- }, props), children);
225
- };
190
+ var Center = ({
191
+ maxWidth,
192
+ space = "none",
193
+ children,
194
+ ...props
195
+ }) => /* @__PURE__ */ React7.createElement(Box, {
196
+ css: {
197
+ boxSizing: "content-box",
198
+ display: "flex",
199
+ flexDirection: "column",
200
+ alignItems: "center",
201
+ justifyContent: "center",
202
+ marginInline: "auto",
203
+ maxInlineSize: maxWidth,
204
+ gap: space
205
+ },
206
+ ...props
207
+ }, children);
226
208
 
227
209
  // src/Checkbox/Checkbox.tsx
228
210
  import React10, { forwardRef as forwardRef2 } from "react";
229
211
  import { useCheckbox, useCheckboxGroupItem } from "@react-aria/checkbox";
230
212
  import { useFocusRing as useFocusRing2 } from "@react-aria/focus";
231
- import { useHover } from "@react-aria/interactions";
232
- import { useObjectRef } from "@react-aria/utils";
213
+ import { useHover as useHover2 } from "@react-aria/interactions";
214
+ import { useObjectRef as useObjectRef2 } from "@react-aria/utils";
233
215
  import { useToggleState } from "@react-stately/toggle";
234
216
  import {
235
217
  Box as Box6,
@@ -252,26 +234,21 @@ import {
252
234
  import React8 from "react";
253
235
  import { Required } from "@marigold/icons";
254
236
  import { Box as Box4, useComponentStyles as useComponentStyles4 } from "@marigold/system";
255
- var Label = (_a) => {
256
- var _b = _a, {
257
- as = "label",
258
- required,
259
- children,
260
- variant,
261
- size
262
- } = _b, props = __objRest(_b, [
263
- "as",
264
- "required",
265
- "children",
266
- "variant",
267
- "size"
268
- ]);
237
+ var Label = ({
238
+ as = "label",
239
+ required,
240
+ children,
241
+ variant,
242
+ size,
243
+ ...props
244
+ }) => {
269
245
  const styles = useComponentStyles4("Label", { size, variant });
270
- return /* @__PURE__ */ React8.createElement(Box4, __spreadProps(__spreadValues({}, props), {
246
+ return /* @__PURE__ */ React8.createElement(Box4, {
247
+ ...props,
271
248
  as,
272
249
  __baseCSS: { display: "flex", alignItems: "center", gap: 4 },
273
250
  css: styles
274
- }), children, required && /* @__PURE__ */ React8.createElement(Required, {
251
+ }, children, required && /* @__PURE__ */ React8.createElement(Required, {
275
252
  role: "presentation",
276
253
  size: 16,
277
254
  fill: "error"
@@ -279,41 +256,42 @@ var Label = (_a) => {
279
256
  };
280
257
 
281
258
  // src/Checkbox/CheckboxGroup.tsx
282
- var CheckboxGroupContext = createContext(null);
259
+ var CheckboxGroupContext = createContext(
260
+ null
261
+ );
283
262
  var useCheckboxGroupContext = () => useContext(CheckboxGroupContext);
284
- var CheckboxGroup = (_a) => {
285
- var _b = _a, {
286
- children,
287
- variant,
288
- size,
289
- required,
290
- disabled,
291
- readOnly,
292
- error
293
- } = _b, rest = __objRest(_b, [
294
- "children",
295
- "variant",
296
- "size",
297
- "required",
298
- "disabled",
299
- "readOnly",
300
- "error"
301
- ]);
302
- const props = __spreadValues({
263
+ var CheckboxGroup = ({
264
+ children,
265
+ variant,
266
+ size,
267
+ required,
268
+ disabled,
269
+ readOnly,
270
+ error,
271
+ ...rest
272
+ }) => {
273
+ const props = {
303
274
  isRequired: required,
304
275
  isDisabled: disabled,
305
276
  isReadOnly: readOnly,
306
- validationState: error ? "invalid" : "valid"
307
- }, rest);
277
+ validationState: error ? "invalid" : "valid",
278
+ ...rest
279
+ };
308
280
  const state = useCheckboxGroupState(props);
309
281
  const { groupProps, labelProps } = useCheckboxGroup(props, state);
310
- const styles = useComponentStyles5("CheckboxGroup", { variant, size }, { parts: ["container", "group"] });
311
- return /* @__PURE__ */ React9.createElement(Box5, __spreadProps(__spreadValues({}, groupProps), {
282
+ const styles = useComponentStyles5(
283
+ "CheckboxGroup",
284
+ { variant, size },
285
+ { parts: ["container", "group"] }
286
+ );
287
+ return /* @__PURE__ */ React9.createElement(Box5, {
288
+ ...groupProps,
312
289
  css: styles.container
313
- }), props.label && /* @__PURE__ */ React9.createElement(Label, __spreadValues({
290
+ }, props.label && /* @__PURE__ */ React9.createElement(Label, {
314
291
  as: "span",
315
- required
316
- }, labelProps), props.label), /* @__PURE__ */ React9.createElement(Box5, {
292
+ required,
293
+ ...labelProps
294
+ }, props.label), /* @__PURE__ */ React9.createElement(Box5, {
317
295
  role: "presentation",
318
296
  __baseCSS: {
319
297
  display: "flex",
@@ -322,7 +300,7 @@ var CheckboxGroup = (_a) => {
322
300
  },
323
301
  css: styles.group
324
302
  }, /* @__PURE__ */ React9.createElement(CheckboxGroupContext.Provider, {
325
- value: __spreadValues({ variant, size, error }, state)
303
+ value: { variant, size, error, ...state }
326
304
  }, children)));
327
305
  };
328
306
 
@@ -343,26 +321,24 @@ var IndeterminateMark = () => /* @__PURE__ */ React10.createElement("svg", {
343
321
  stroke: "none",
344
322
  d: "M11.5 2.04018H0.5V0.46875H11.5V2.04018Z"
345
323
  }));
346
- var Icon = (_a) => {
347
- var _b = _a, { css, checked, indeterminate } = _b, props = __objRest(_b, ["css", "checked", "indeterminate"]);
348
- return /* @__PURE__ */ React10.createElement(Box6, __spreadValues({
349
- "aria-hidden": "true",
350
- __baseCSS: {
351
- width: 16,
352
- height: 16,
353
- bg: "#fff",
354
- border: "1px solid #000",
355
- borderRadius: 3,
356
- display: "flex",
357
- alignItems: "center",
358
- justifyContent: "center",
359
- p: 1
360
- },
361
- css
362
- }, props), indeterminate ? /* @__PURE__ */ React10.createElement(IndeterminateMark, null) : checked ? /* @__PURE__ */ React10.createElement(CheckMark, null) : null);
363
- };
364
- var Checkbox = forwardRef2((_a, ref) => {
365
- var _b = _a, {
324
+ var Icon = ({ css, checked, indeterminate, ...props }) => /* @__PURE__ */ React10.createElement(Box6, {
325
+ "aria-hidden": "true",
326
+ __baseCSS: {
327
+ width: 16,
328
+ height: 16,
329
+ bg: "#fff",
330
+ border: "1px solid #000",
331
+ borderRadius: 3,
332
+ display: "flex",
333
+ alignItems: "center",
334
+ justifyContent: "center",
335
+ p: 1
336
+ },
337
+ css,
338
+ ...props
339
+ }, indeterminate ? /* @__PURE__ */ React10.createElement(IndeterminateMark, null) : checked ? /* @__PURE__ */ React10.createElement(CheckMark, null) : null);
340
+ var Checkbox = forwardRef2(
341
+ ({
366
342
  size,
367
343
  variant,
368
344
  disabled,
@@ -371,98 +347,112 @@ var Checkbox = forwardRef2((_a, ref) => {
371
347
  indeterminate,
372
348
  readOnly,
373
349
  required,
374
- error
375
- } = _b, props = __objRest(_b, [
376
- "size",
377
- "variant",
378
- "disabled",
379
- "checked",
380
- "defaultChecked",
381
- "indeterminate",
382
- "readOnly",
383
- "required",
384
- "error"
385
- ]);
386
- const inputRef = useObjectRef(ref);
387
- const checkboxProps = {
388
- isIndeterminate: indeterminate,
389
- isDisabled: disabled,
390
- isReadOnly: readOnly,
391
- isRequired: required,
392
- validationState: error ? "invalid" : "valid"
393
- };
394
- const groupState = useCheckboxGroupContext();
395
- const { inputProps } = groupState ? useCheckboxGroupItem(__spreadProps(__spreadValues(__spreadValues({}, props), checkboxProps), {
396
- value: props.value
397
- }), groupState, inputRef) : useCheckbox(__spreadValues(__spreadValues({
398
- isSelected: checked,
399
- defaultSelected: defaultChecked
400
- }, checkboxProps), props), useToggleState(__spreadValues({
401
- isSelected: checked,
402
- defaultSelected: defaultChecked
403
- }, props)), inputRef);
404
- const styles = useComponentStyles6("Checkbox", {
405
- variant: (groupState == null ? void 0 : groupState.variant) || variant,
406
- size: (groupState == null ? void 0 : groupState.size) || size
407
- }, { parts: ["container", "label", "checkbox"] });
408
- const { hoverProps, isHovered } = useHover({});
409
- const { isFocusVisible, focusProps } = useFocusRing2();
410
- const stateProps = useStateProps2({
411
- hover: isHovered,
412
- focus: isFocusVisible,
413
- checked: inputProps.checked,
414
- disabled: inputProps.disabled,
415
- error: (groupState == null ? void 0 : groupState.error) || error,
416
- readOnly,
417
- indeterminate
418
- });
419
- return /* @__PURE__ */ React10.createElement(Box6, __spreadValues(__spreadValues({
420
- as: "label",
421
- __baseCSS: {
422
- display: "flex",
423
- alignItems: "center",
424
- gap: "1ch",
425
- position: "relative"
426
- },
427
- css: styles.container
428
- }, hoverProps), stateProps), /* @__PURE__ */ React10.createElement(Box6, __spreadValues(__spreadValues({
429
- as: "input",
430
- ref: inputRef,
431
- css: {
432
- position: "absolute",
433
- width: "100%",
434
- height: "100%",
435
- top: 0,
436
- left: 0,
437
- zIndex: 1,
438
- opacity: 1e-4,
439
- cursor: inputProps.disabled ? "not-allowed" : "pointer"
440
- }
441
- }, inputProps), focusProps)), /* @__PURE__ */ React10.createElement(Icon, __spreadValues({
442
- checked: inputProps.checked,
443
- indeterminate,
444
- css: styles.checkbox
445
- }, stateProps)), props.children && /* @__PURE__ */ React10.createElement(Box6, __spreadValues({
446
- css: styles.label
447
- }, stateProps), props.children));
448
- });
350
+ error,
351
+ ...props
352
+ }, ref) => {
353
+ const inputRef = useObjectRef2(ref);
354
+ const checkboxProps = {
355
+ isIndeterminate: indeterminate,
356
+ isDisabled: disabled,
357
+ isReadOnly: readOnly,
358
+ isRequired: required,
359
+ validationState: error ? "invalid" : "valid"
360
+ };
361
+ const groupState = useCheckboxGroupContext();
362
+ const { inputProps } = groupState ? useCheckboxGroupItem(
363
+ {
364
+ ...props,
365
+ ...checkboxProps,
366
+ value: props.value
367
+ },
368
+ groupState,
369
+ inputRef
370
+ ) : useCheckbox(
371
+ {
372
+ isSelected: checked,
373
+ defaultSelected: defaultChecked,
374
+ ...checkboxProps,
375
+ ...props
376
+ },
377
+ useToggleState({
378
+ isSelected: checked,
379
+ defaultSelected: defaultChecked,
380
+ ...props
381
+ }),
382
+ inputRef
383
+ );
384
+ const styles = useComponentStyles6(
385
+ "Checkbox",
386
+ {
387
+ variant: (groupState == null ? void 0 : groupState.variant) || variant,
388
+ size: (groupState == null ? void 0 : groupState.size) || size
389
+ },
390
+ { parts: ["container", "label", "checkbox"] }
391
+ );
392
+ const { hoverProps, isHovered } = useHover2({});
393
+ const { isFocusVisible, focusProps } = useFocusRing2();
394
+ const stateProps = useStateProps2({
395
+ hover: isHovered,
396
+ focus: isFocusVisible,
397
+ checked: inputProps.checked,
398
+ disabled: inputProps.disabled,
399
+ error: (groupState == null ? void 0 : groupState.error) || error,
400
+ readOnly,
401
+ indeterminate
402
+ });
403
+ return /* @__PURE__ */ React10.createElement(Box6, {
404
+ as: "label",
405
+ __baseCSS: {
406
+ display: "flex",
407
+ alignItems: "center",
408
+ gap: "1ch",
409
+ position: "relative"
410
+ },
411
+ css: styles.container,
412
+ ...hoverProps,
413
+ ...stateProps
414
+ }, /* @__PURE__ */ React10.createElement(Box6, {
415
+ as: "input",
416
+ ref: inputRef,
417
+ css: {
418
+ position: "absolute",
419
+ width: "100%",
420
+ height: "100%",
421
+ top: 0,
422
+ left: 0,
423
+ zIndex: 1,
424
+ opacity: 1e-4,
425
+ cursor: inputProps.disabled ? "not-allowed" : "pointer"
426
+ },
427
+ ...inputProps,
428
+ ...focusProps
429
+ }), /* @__PURE__ */ React10.createElement(Icon, {
430
+ checked: inputProps.checked,
431
+ indeterminate,
432
+ css: styles.checkbox,
433
+ ...stateProps
434
+ }), props.children && /* @__PURE__ */ React10.createElement(Box6, {
435
+ css: styles.label,
436
+ ...stateProps
437
+ }, props.children));
438
+ }
439
+ );
449
440
 
450
441
  // src/Columns/Columns.tsx
451
442
  import React11, { Children } from "react";
452
- var Columns = (_a) => {
453
- var _b = _a, {
454
- space = "none",
455
- columns,
456
- collapseAt = "40em",
457
- children
458
- } = _b, props = __objRest(_b, [
459
- "space",
460
- "columns",
461
- "collapseAt",
462
- "children"
463
- ]);
443
+ var Columns = ({
444
+ space = "none",
445
+ columns,
446
+ collapseAt = "40em",
447
+ children,
448
+ ...props
449
+ }) => {
464
450
  if (Children.count(children) !== columns.length) {
465
- throw new Error(`Columns: expected ${columns.length} children, got ${Children.count(children)}`);
451
+ throw new Error(
452
+ `Columns: expected ${columns.length} children, got ${Children.count(
453
+ children
454
+ )}`
455
+ );
466
456
  }
467
457
  const getColumnWidths = columns.map((column, index) => {
468
458
  return {
@@ -471,16 +461,20 @@ var Columns = (_a) => {
471
461
  }
472
462
  };
473
463
  });
474
- return /* @__PURE__ */ React11.createElement(Box, __spreadValues({
464
+ return /* @__PURE__ */ React11.createElement(Box, {
475
465
  display: "flex",
476
- css: Object.assign({
477
- flexWrap: "wrap",
478
- gap: space,
479
- "> *": {
480
- flexBasis: `calc(( ${collapseAt} - 100%) * 999)`
481
- }
482
- }, ...getColumnWidths)
483
- }, props), children);
466
+ css: Object.assign(
467
+ {
468
+ flexWrap: "wrap",
469
+ gap: space,
470
+ "> *": {
471
+ flexBasis: `calc(( ${collapseAt} - 100%) * 999)`
472
+ }
473
+ },
474
+ ...getColumnWidths
475
+ ),
476
+ ...props
477
+ }, children);
484
478
  };
485
479
 
486
480
  // src/Container/Container.tsx
@@ -491,20 +485,14 @@ var ALIGNMENT = {
491
485
  center: "center",
492
486
  right: "flex-end"
493
487
  };
494
- var Container = (_a) => {
495
- var _b = _a, {
496
- contentType = "content",
497
- size = "medium",
498
- align = "left",
499
- alignContainer = "left",
500
- children
501
- } = _b, props = __objRest(_b, [
502
- "contentType",
503
- "size",
504
- "align",
505
- "alignContainer",
506
- "children"
507
- ]);
488
+ var Container = ({
489
+ contentType = "content",
490
+ size = "medium",
491
+ align = "left",
492
+ alignContainer = "left",
493
+ children,
494
+ ...props
495
+ }) => {
508
496
  const maxWidth = tokenSize[contentType][size];
509
497
  let gridTemplateColumns = `${maxWidth} 1fr 1fr`;
510
498
  let gridColumn = 1;
@@ -516,7 +504,7 @@ var Container = (_a) => {
516
504
  gridTemplateColumns = `1fr 1fr ${maxWidth}`;
517
505
  gridColumn = 3;
518
506
  }
519
- return /* @__PURE__ */ React12.createElement(Box, __spreadValues({
507
+ return /* @__PURE__ */ React12.createElement(Box, {
520
508
  display: "grid",
521
509
  css: {
522
510
  gridTemplateColumns,
@@ -524,8 +512,9 @@ var Container = (_a) => {
524
512
  "> *": {
525
513
  gridColumn
526
514
  }
527
- }
528
- }, props), children);
515
+ },
516
+ ...props
517
+ }, children);
529
518
  };
530
519
 
531
520
  // src/Content/Content.tsx
@@ -534,26 +523,22 @@ import {
534
523
  Box as Box7,
535
524
  useComponentStyles as useComponentStyles7
536
525
  } from "@marigold/system";
537
- var Content = (_a) => {
538
- var _b = _a, {
539
- children,
540
- variant,
541
- size
542
- } = _b, props = __objRest(_b, [
543
- "children",
544
- "variant",
545
- "size"
546
- ]);
526
+ var Content = ({
527
+ children,
528
+ variant,
529
+ size,
530
+ ...props
531
+ }) => {
547
532
  const styles = useComponentStyles7("Content", { variant, size });
548
- return /* @__PURE__ */ React13.createElement(Box7, __spreadProps(__spreadValues({
549
- as: "section"
550
- }, props), {
533
+ return /* @__PURE__ */ React13.createElement(Box7, {
534
+ as: "section",
535
+ ...props,
551
536
  css: styles
552
- }), children);
537
+ }, children);
553
538
  };
554
539
 
555
540
  // src/Dialog/Dialog.tsx
556
- import React21, { useRef as useRef4 } from "react";
541
+ import React21, { useRef as useRef3 } from "react";
557
542
  import { useButton as useButton2 } from "@react-aria/button";
558
543
  import { useDialog } from "@react-aria/dialog";
559
544
  import {
@@ -566,14 +551,13 @@ import React14 from "react";
566
551
  import {
567
552
  useComponentStyles as useComponentStyles8
568
553
  } from "@marigold/system";
569
- var Header = (_a) => {
570
- var _b = _a, { children, variant, size } = _b, props = __objRest(_b, ["children", "variant", "size"]);
554
+ var Header = ({ children, variant, size, ...props }) => {
571
555
  const styles = useComponentStyles8("Header", { variant, size });
572
- return /* @__PURE__ */ React14.createElement(Box, __spreadProps(__spreadValues({
573
- as: "header"
574
- }, props), {
556
+ return /* @__PURE__ */ React14.createElement(Box, {
557
+ as: "header",
558
+ ...props,
575
559
  css: styles
576
- }), children);
560
+ }, children);
577
561
  };
578
562
 
579
563
  // src/Headline/Headline.tsx
@@ -582,27 +566,22 @@ import {
582
566
  Box as Box8,
583
567
  useComponentStyles as useComponentStyles9
584
568
  } from "@marigold/system";
585
- var Headline = (_a) => {
586
- var _b = _a, {
587
- children,
588
- variant,
589
- size,
590
- level = "1"
591
- } = _b, props = __objRest(_b, [
592
- "children",
593
- "variant",
594
- "size",
595
- "level"
596
- ]);
569
+ var Headline = ({
570
+ children,
571
+ variant,
572
+ size,
573
+ level = "1",
574
+ ...props
575
+ }) => {
597
576
  const styles = useComponentStyles9("Headline", {
598
577
  variant,
599
578
  size: size ?? `level-${level}`
600
579
  });
601
- return /* @__PURE__ */ React15.createElement(Box8, __spreadProps(__spreadValues({
602
- as: `h${level}`
603
- }, props), {
580
+ return /* @__PURE__ */ React15.createElement(Box8, {
581
+ as: `h${level}`,
582
+ ...props,
604
583
  css: styles
605
- }), children);
584
+ }, children);
606
585
  };
607
586
 
608
587
  // src/Dialog/Context.ts
@@ -611,7 +590,7 @@ var DialogContext = createContext2({});
611
590
  var useDialogContext = () => useContext2(DialogContext);
612
591
 
613
592
  // src/Dialog/DialogTrigger.tsx
614
- import React20, { useRef as useRef3 } from "react";
593
+ import React20, { useRef as useRef2 } from "react";
615
594
  import { PressResponder } from "@react-aria/interactions";
616
595
  import { useOverlayTriggerState } from "@react-stately/overlays";
617
596
 
@@ -619,114 +598,119 @@ import { useOverlayTriggerState } from "@react-stately/overlays";
619
598
  import React17, { forwardRef as forwardRef3 } from "react";
620
599
  import { FocusScope } from "@react-aria/focus";
621
600
  import { useModal, useOverlay, usePreventScroll } from "@react-aria/overlays";
622
- import { mergeProps as mergeProps2, useObjectRef as useObjectRef2 } from "@react-aria/utils";
601
+ import { mergeProps as mergeProps2, useObjectRef as useObjectRef3 } from "@react-aria/utils";
623
602
 
624
603
  // src/Overlay/Underlay.tsx
625
604
  import React16 from "react";
626
605
  import { Box as Box9, useComponentStyles as useComponentStyles10 } from "@marigold/system";
627
- var Underlay = (_a) => {
628
- var _b = _a, { size, variant } = _b, props = __objRest(_b, ["size", "variant"]);
606
+ var Underlay = ({ size, variant, ...props }) => {
629
607
  const styles = useComponentStyles10("Underlay", { size, variant });
630
- return /* @__PURE__ */ React16.createElement(Box9, __spreadValues({
608
+ return /* @__PURE__ */ React16.createElement(Box9, {
631
609
  __baseCSS: {
632
610
  position: "fixed",
633
611
  inset: 0,
634
612
  zIndex: 1
635
613
  },
636
- css: styles
637
- }, props));
614
+ css: styles,
615
+ ...props
616
+ });
638
617
  };
639
618
 
640
619
  // src/Overlay/Modal.tsx
641
- var Modal = forwardRef3((_a, ref) => {
642
- var _b = _a, { children, open, dismissable, keyboardDismissable, onClose } = _b, props = __objRest(_b, ["children", "open", "dismissable", "keyboardDismissable", "onClose"]);
643
- const modalRef = useObjectRef2(ref);
644
- const { overlayProps, underlayProps } = useOverlay({
645
- isOpen: open,
646
- onClose,
647
- isDismissable: dismissable,
648
- isKeyboardDismissDisabled: !keyboardDismissable
649
- }, modalRef);
650
- usePreventScroll();
651
- const { modalProps } = useModal({});
652
- return /* @__PURE__ */ React17.createElement(FocusScope, {
653
- contain: true,
654
- restoreFocus: true,
655
- autoFocus: true
656
- }, /* @__PURE__ */ React17.createElement(Underlay, __spreadValues({}, underlayProps)), /* @__PURE__ */ React17.createElement("div", __spreadValues({
657
- style: {
658
- display: "flex",
659
- alignItems: "center",
660
- justifyContent: "center",
661
- position: "fixed",
662
- inset: 0,
663
- zIndex: 2,
664
- pointerEvents: "none"
665
- },
666
- ref: modalRef
667
- }, mergeProps2(props, overlayProps, modalProps)), /* @__PURE__ */ React17.createElement("div", {
668
- style: { pointerEvents: "auto" }
669
- }, children)));
670
- });
620
+ var Modal = forwardRef3(
621
+ ({ children, open, dismissable, keyboardDismissable, onClose, ...props }, ref) => {
622
+ const modalRef = useObjectRef3(ref);
623
+ const { overlayProps, underlayProps } = useOverlay(
624
+ {
625
+ isOpen: open,
626
+ onClose,
627
+ isDismissable: dismissable,
628
+ isKeyboardDismissDisabled: !keyboardDismissable
629
+ },
630
+ modalRef
631
+ );
632
+ usePreventScroll();
633
+ const { modalProps } = useModal({});
634
+ return /* @__PURE__ */ React17.createElement(FocusScope, {
635
+ contain: true,
636
+ restoreFocus: true,
637
+ autoFocus: true
638
+ }, /* @__PURE__ */ React17.createElement(Underlay, {
639
+ ...underlayProps
640
+ }), /* @__PURE__ */ React17.createElement("div", {
641
+ style: {
642
+ display: "flex",
643
+ alignItems: "center",
644
+ justifyContent: "center",
645
+ position: "fixed",
646
+ inset: 0,
647
+ zIndex: 2,
648
+ pointerEvents: "none"
649
+ },
650
+ ref: modalRef,
651
+ ...mergeProps2(props, overlayProps, modalProps)
652
+ }, /* @__PURE__ */ React17.createElement("div", {
653
+ style: { pointerEvents: "auto" }
654
+ }, children)));
655
+ }
656
+ );
671
657
 
672
658
  // src/Overlay/Overlay.tsx
673
659
  import React18 from "react";
674
660
  import { OverlayContainer } from "@react-aria/overlays";
675
- var Overlay = (_a) => {
676
- var _b = _a, {
677
- children,
678
- open = false,
679
- container
680
- } = _b, props = __objRest(_b, [
681
- "children",
682
- "open",
683
- "container"
684
- ]);
661
+ var Overlay = ({
662
+ children,
663
+ open = false,
664
+ container,
665
+ ...props
666
+ }) => {
685
667
  if (!open) {
686
668
  return null;
687
669
  }
688
670
  return /* @__PURE__ */ React18.createElement(OverlayContainer, {
689
671
  portalContainer: container
690
- }, /* @__PURE__ */ React18.createElement(Box, __spreadValues({}, props), children));
672
+ }, /* @__PURE__ */ React18.createElement(Box, {
673
+ ...props
674
+ }, children));
691
675
  };
692
676
 
693
677
  // src/Overlay/Popover.tsx
694
- import React19, { forwardRef as forwardRef4, useRef as useRef2 } from "react";
678
+ import React19, { forwardRef as forwardRef4, useRef } from "react";
695
679
  import { useModal as useModal2, useOverlay as useOverlay2 } from "@react-aria/overlays";
696
680
  import { mergeProps as mergeProps3 } from "@react-aria/utils";
697
- var Popover = forwardRef4((_a, ref) => {
698
- var _b = _a, {
681
+ var Popover = forwardRef4(
682
+ ({
699
683
  children,
700
684
  open,
701
685
  dismissable,
702
686
  keyboardDismissDisabled,
703
687
  shouldCloseOnBlur,
704
- minWidth = 0
705
- } = _b, props = __objRest(_b, [
706
- "children",
707
- "open",
708
- "dismissable",
709
- "keyboardDismissDisabled",
710
- "shouldCloseOnBlur",
711
- "minWidth"
712
- ]);
713
- const fallbackRef = useRef2(null);
714
- const popoverRef = ref || fallbackRef;
715
- const { overlayProps } = useOverlay2(__spreadValues({
716
- isOpen: open,
717
- isDismissable: dismissable,
718
- isKeyboardDismissDisabled: keyboardDismissDisabled,
719
- shouldCloseOnBlur
720
- }, props), popoverRef);
721
- const { modalProps } = useModal2({});
722
- const style = { minWidth };
723
- return /* @__PURE__ */ React19.createElement(Overlay, {
724
- open
725
- }, /* @__PURE__ */ React19.createElement(Box, __spreadValues({
726
- ref: popoverRef,
727
- role: "presentation"
728
- }, mergeProps3(props, overlayProps, modalProps, style)), children));
729
- });
688
+ minWidth = 0,
689
+ ...props
690
+ }, ref) => {
691
+ const fallbackRef = useRef(null);
692
+ const popoverRef = ref || fallbackRef;
693
+ const { overlayProps } = useOverlay2(
694
+ {
695
+ isOpen: open,
696
+ isDismissable: dismissable,
697
+ isKeyboardDismissDisabled: keyboardDismissDisabled,
698
+ shouldCloseOnBlur,
699
+ ...props
700
+ },
701
+ popoverRef
702
+ );
703
+ const { modalProps } = useModal2({});
704
+ const style = { minWidth };
705
+ return /* @__PURE__ */ React19.createElement(Overlay, {
706
+ open
707
+ }, /* @__PURE__ */ React19.createElement(Box, {
708
+ ref: popoverRef,
709
+ role: "presentation",
710
+ ...mergeProps3(props, overlayProps, modalProps, style)
711
+ }, children));
712
+ }
713
+ );
730
714
 
731
715
  // src/Dialog/DialogTrigger.tsx
732
716
  var DialogTrigger = ({
@@ -735,7 +719,7 @@ var DialogTrigger = ({
735
719
  keyboardDismissable = true
736
720
  }) => {
737
721
  const [dialogTrigger, dialog] = React20.Children.toArray(children);
738
- const dialogTriggerRef = useRef3(null);
722
+ const dialogTriggerRef = useRef2(null);
739
723
  const state = useOverlayTriggerState({});
740
724
  const ctx = { open: state.isOpen, close: state.close };
741
725
  return /* @__PURE__ */ React20.createElement(DialogContext.Provider, {
@@ -756,14 +740,17 @@ var DialogTrigger = ({
756
740
 
757
741
  // src/Dialog/Dialog.tsx
758
742
  var CloseButton = ({ css }) => {
759
- const ref = useRef4(null);
743
+ const ref = useRef3(null);
760
744
  const { close } = useDialogContext();
761
- const { buttonProps } = useButton2({
762
- onPress: () => close == null ? void 0 : close()
763
- }, ref);
745
+ const { buttonProps } = useButton2(
746
+ {
747
+ onPress: () => close == null ? void 0 : close()
748
+ },
749
+ ref
750
+ );
764
751
  return /* @__PURE__ */ React21.createElement(Box10, {
765
752
  css: { display: "flex", justifyContent: "flex-end" }
766
- }, /* @__PURE__ */ React21.createElement(Box10, __spreadValues({
753
+ }, /* @__PURE__ */ React21.createElement(Box10, {
767
754
  as: "button",
768
755
  __baseCSS: {
769
756
  outline: "none",
@@ -775,8 +762,9 @@ var CloseButton = ({ css }) => {
775
762
  p: 0
776
763
  },
777
764
  css,
778
- ref
779
- }, buttonProps), /* @__PURE__ */ React21.createElement("svg", {
765
+ ref,
766
+ ...buttonProps
767
+ }, /* @__PURE__ */ React21.createElement("svg", {
780
768
  viewBox: "0 0 20 20",
781
769
  fill: "currentColor"
782
770
  }, /* @__PURE__ */ React21.createElement("path", {
@@ -787,35 +775,42 @@ var CloseButton = ({ css }) => {
787
775
  };
788
776
  var addTitleProps = (children, titleProps) => {
789
777
  const childs = React21.Children.toArray(children);
790
- const titleIndex = childs.findIndex((child) => React21.isValidElement(child) && (child.type === Header || child.type === Headline));
778
+ const titleIndex = childs.findIndex(
779
+ (child) => React21.isValidElement(child) && (child.type === Header || child.type === Headline)
780
+ );
791
781
  if (titleIndex < 0) {
792
- console.warn("No child in <Dialog> found that can act as title for accessibility. Please add a <Header> or <Headline> as direct child.");
782
+ console.warn(
783
+ "No child in <Dialog> found that can act as title for accessibility. Please add a <Header> or <Headline> as direct child."
784
+ );
793
785
  return children;
794
786
  }
795
- const titleChild = React21.cloneElement(childs[titleIndex], titleProps);
787
+ const titleChild = React21.cloneElement(
788
+ childs[titleIndex],
789
+ titleProps
790
+ );
796
791
  childs.splice(titleIndex, 1, titleChild);
797
792
  return childs;
798
793
  };
799
- var Dialog = (_a) => {
800
- var _b = _a, {
801
- children,
802
- variant,
803
- size,
804
- closeButton
805
- } = _b, props = __objRest(_b, [
806
- "children",
807
- "variant",
808
- "size",
809
- "closeButton"
810
- ]);
811
- const ref = useRef4(null);
794
+ var Dialog = ({
795
+ children,
796
+ variant,
797
+ size,
798
+ closeButton,
799
+ ...props
800
+ }) => {
801
+ const ref = useRef3(null);
812
802
  const { close } = useDialogContext();
813
803
  const { dialogProps, titleProps } = useDialog(props, ref);
814
- const styles = useComponentStyles11("Dialog", { variant, size }, { parts: ["container", "closeButton"] });
815
- return /* @__PURE__ */ React21.createElement(Box10, __spreadValues({
804
+ const styles = useComponentStyles11(
805
+ "Dialog",
806
+ { variant, size },
807
+ { parts: ["container", "closeButton"] }
808
+ );
809
+ return /* @__PURE__ */ React21.createElement(Box10, {
816
810
  __baseCSS: { bg: "#fff" },
817
- css: styles.container
818
- }, dialogProps), closeButton && /* @__PURE__ */ React21.createElement(CloseButton, {
811
+ css: styles.container,
812
+ ...dialogProps
813
+ }, closeButton && /* @__PURE__ */ React21.createElement(CloseButton, {
819
814
  css: styles.closeButton
820
815
  }), typeof children === "function" ? children({ close, titleProps }) : props["aria-labelledby"] ? children : addTitleProps(children, titleProps));
821
816
  };
@@ -825,13 +820,14 @@ Dialog.Trigger = DialogTrigger;
825
820
  import React22 from "react";
826
821
  import { useSeparator } from "@react-aria/separator";
827
822
  import { Box as Box11, useComponentStyles as useComponentStyles12 } from "@marigold/system";
828
- var Divider = (_a) => {
829
- var _b = _a, { variant } = _b, props = __objRest(_b, ["variant"]);
823
+ var Divider = ({ variant, ...props }) => {
830
824
  const { separatorProps } = useSeparator(props);
831
825
  const styles = useComponentStyles12("Divider", { variant });
832
- return /* @__PURE__ */ React22.createElement(Box11, __spreadValues(__spreadValues({
833
- css: styles
834
- }, props), separatorProps));
826
+ return /* @__PURE__ */ React22.createElement(Box11, {
827
+ css: styles,
828
+ ...props,
829
+ ...separatorProps
830
+ });
835
831
  };
836
832
 
837
833
  // src/Footer/Footer.tsx
@@ -839,26 +835,25 @@ import React23 from "react";
839
835
  import {
840
836
  useComponentStyles as useComponentStyles13
841
837
  } from "@marigold/system";
842
- var Footer = (_a) => {
843
- var _b = _a, { children, variant, size } = _b, props = __objRest(_b, ["children", "variant", "size"]);
838
+ var Footer = ({ children, variant, size, ...props }) => {
844
839
  const styles = useComponentStyles13("Footer", { variant, size });
845
- return /* @__PURE__ */ React23.createElement(Box, __spreadProps(__spreadValues({
846
- as: "footer"
847
- }, props), {
840
+ return /* @__PURE__ */ React23.createElement(Box, {
841
+ as: "footer",
842
+ ...props,
848
843
  css: styles
849
- }), children);
844
+ }, children);
850
845
  };
851
846
 
852
847
  // src/Image/Image.tsx
853
848
  import React24 from "react";
854
849
  import { useComponentStyles as useComponentStyles14 } from "@marigold/system";
855
- var Image = (_a) => {
856
- var _b = _a, { variant } = _b, props = __objRest(_b, ["variant"]);
850
+ var Image = ({ variant, ...props }) => {
857
851
  const styles = useComponentStyles14("Image", { variant });
858
- return /* @__PURE__ */ React24.createElement(Box, __spreadProps(__spreadValues({}, props), {
852
+ return /* @__PURE__ */ React24.createElement(Box, {
853
+ ...props,
859
854
  as: "img",
860
855
  css: styles
861
- }));
856
+ });
862
857
  };
863
858
 
864
859
  // src/Inline/Inline.tsx
@@ -873,147 +868,206 @@ var ALIGNMENT_Y = {
873
868
  center: "center",
874
869
  bottom: "flex-end"
875
870
  };
876
- var Inline = (_a) => {
877
- var _b = _a, {
878
- space = "none",
879
- alignX = "left",
880
- alignY = "center",
881
- children
882
- } = _b, props = __objRest(_b, [
883
- "space",
884
- "alignX",
885
- "alignY",
886
- "children"
887
- ]);
888
- return /* @__PURE__ */ React25.createElement(Box, __spreadValues({
889
- css: {
890
- display: "flex",
891
- flexWrap: "wrap",
892
- gap: space,
893
- alignItems: ALIGNMENT_Y[alignY],
894
- justifyContent: ALIGNMENT_X[alignX]
895
- }
896
- }, props), children);
897
- };
871
+ var Inline = ({
872
+ space = "none",
873
+ alignX = "left",
874
+ alignY = "center",
875
+ children,
876
+ ...props
877
+ }) => /* @__PURE__ */ React25.createElement(Box, {
878
+ css: {
879
+ display: "flex",
880
+ flexWrap: "wrap",
881
+ gap: space,
882
+ alignItems: ALIGNMENT_Y[alignY],
883
+ justifyContent: ALIGNMENT_X[alignX]
884
+ },
885
+ ...props
886
+ }, children);
898
887
 
899
888
  // src/Input/Input.tsx
900
889
  import React26, { forwardRef as forwardRef5 } from "react";
901
890
  import { Box as Box12, useComponentStyles as useComponentStyles15 } from "@marigold/system";
902
- var Input = forwardRef5((_a, ref) => {
903
- var _b = _a, { variant, size, type = "text" } = _b, props = __objRest(_b, ["variant", "size", "type"]);
904
- const styles = useComponentStyles15("Input", { variant, size });
905
- return /* @__PURE__ */ React26.createElement(Box12, __spreadProps(__spreadValues({}, props), {
906
- ref,
907
- as: "input",
908
- type,
909
- css: styles
910
- }));
911
- });
891
+ var Input = forwardRef5(
892
+ ({ variant, size, type = "text", ...props }, ref) => {
893
+ const styles = useComponentStyles15("Input", { variant, size });
894
+ return /* @__PURE__ */ React26.createElement(Box12, {
895
+ ...props,
896
+ ref,
897
+ as: "input",
898
+ type,
899
+ css: styles
900
+ });
901
+ }
902
+ );
912
903
 
913
904
  // src/Link/Link.tsx
914
- import React27, { useRef as useRef5 } from "react";
905
+ import React27, { forwardRef as forwardRef6 } from "react";
915
906
  import { useLink } from "@react-aria/link";
916
907
  import { useComponentStyles as useComponentStyles16 } from "@marigold/system";
917
- var Link = (_a) => {
918
- var _b = _a, {
908
+ import { useObjectRef as useObjectRef4 } from "@react-aria/utils";
909
+ var Link = forwardRef6(
910
+ ({
919
911
  as = "a",
920
912
  variant,
921
913
  size,
922
914
  children,
923
- disabled
924
- } = _b, props = __objRest(_b, [
925
- "as",
926
- "variant",
927
- "size",
928
- "children",
929
- "disabled"
930
- ]);
931
- const ref = useRef5(null);
932
- const { linkProps } = useLink(__spreadProps(__spreadValues({}, props), {
933
- elementType: typeof as === "string" ? as : "span",
934
- isDisabled: disabled
935
- }), ref);
936
- const styles = useComponentStyles16("Link", { variant, size });
937
- return /* @__PURE__ */ React27.createElement(Box, __spreadValues(__spreadValues({
915
+ disabled,
916
+ onPress,
917
+ onPressStart,
918
+ ...props
919
+ }, ref) => {
920
+ const linkRef = useObjectRef4(ref);
921
+ const { linkProps } = useLink(
922
+ {
923
+ ...props,
924
+ elementType: typeof as === "string" ? as : "span",
925
+ isDisabled: disabled
926
+ },
927
+ linkRef
928
+ );
929
+ const styles = useComponentStyles16("Link", { variant, size });
930
+ return /* @__PURE__ */ React27.createElement(Box, {
931
+ as,
932
+ css: styles,
933
+ ref: linkRef,
934
+ ...props,
935
+ ...linkProps
936
+ }, children);
937
+ }
938
+ );
939
+
940
+ // src/List/List.tsx
941
+ import React29 from "react";
942
+ import {
943
+ Box as Box14,
944
+ useComponentStyles as useComponentStyles17
945
+ } from "@marigold/system";
946
+
947
+ // src/List/Context.ts
948
+ import { createContext as createContext3, useContext as useContext3 } from "react";
949
+ var ListContext = createContext3({});
950
+ var useListContext = () => useContext3(ListContext);
951
+
952
+ // src/List/ListItem.tsx
953
+ import React28 from "react";
954
+ import { Box as Box13 } from "@marigold/system";
955
+ var ListItem = ({ children, ...props }) => {
956
+ const { styles } = useListContext();
957
+ return /* @__PURE__ */ React28.createElement(Box13, {
958
+ ...props,
959
+ as: "li",
960
+ css: styles
961
+ }, children);
962
+ };
963
+
964
+ // src/List/List.tsx
965
+ var List = ({
966
+ as = "ul",
967
+ children,
968
+ variant,
969
+ size,
970
+ ...props
971
+ }) => {
972
+ const styles = useComponentStyles17(
973
+ "List",
974
+ { variant, size },
975
+ { parts: ["ul", "ol", "item"] }
976
+ );
977
+ return /* @__PURE__ */ React29.createElement(Box14, {
978
+ ...props,
938
979
  as,
939
- css: styles,
940
- ref
941
- }, props), linkProps), children);
980
+ css: styles[as]
981
+ }, /* @__PURE__ */ React29.createElement(ListContext.Provider, {
982
+ value: { styles: styles.item }
983
+ }, children));
942
984
  };
985
+ List.Item = ListItem;
943
986
 
944
987
  // src/Menu/Menu.tsx
945
- import React30, { useRef as useRef8 } from "react";
988
+ import React32, { useRef as useRef6 } from "react";
946
989
  import { FocusScope as FocusScope2 } from "@react-aria/focus";
947
990
  import { useMenu } from "@react-aria/menu";
948
991
  import { DismissButton } from "@react-aria/overlays";
949
992
  import { Item } from "@react-stately/collections";
950
993
  import { useTreeState } from "@react-stately/tree";
951
994
  import {
952
- Box as Box14,
953
- useComponentStyles as useComponentStyles17
995
+ Box as Box16,
996
+ useComponentStyles as useComponentStyles18
954
997
  } from "@marigold/system";
955
998
 
956
999
  // src/Menu/Context.ts
957
- import { createContext as createContext3, useContext as useContext3 } from "react";
958
- var MenuContext = createContext3({});
959
- var useMenuContext = () => useContext3(MenuContext);
1000
+ import { createContext as createContext4, useContext as useContext4 } from "react";
1001
+ var MenuContext = createContext4({});
1002
+ var useMenuContext = () => useContext4(MenuContext);
960
1003
 
961
1004
  // src/Menu/MenuTrigger.tsx
962
- import React28, { useRef as useRef6 } from "react";
1005
+ import React30, { useRef as useRef4 } from "react";
963
1006
  import { useMenuTriggerState } from "@react-stately/menu";
964
1007
  import { useMenuTrigger } from "@react-aria/menu";
965
1008
  import { useOverlayPosition } from "@react-aria/overlays";
966
1009
  import { PressResponder as PressResponder2 } from "@react-aria/interactions";
967
1010
  var MenuTrigger = ({ disabled, children }) => {
968
- const [menuTrigger, menu] = React28.Children.toArray(children);
969
- const menuTriggerRef = useRef6(null);
970
- const overlayRef = useRef6(null);
1011
+ const [menuTrigger, menu] = React30.Children.toArray(children);
1012
+ const menuTriggerRef = useRef4(null);
1013
+ const overlayRef = useRef4(null);
971
1014
  const state = useMenuTriggerState({});
972
- const { menuTriggerProps, menuProps } = useMenuTrigger({ trigger: "press", isDisabled: disabled }, state, menuTriggerRef);
1015
+ const { menuTriggerProps, menuProps } = useMenuTrigger(
1016
+ { trigger: "press", isDisabled: disabled },
1017
+ state,
1018
+ menuTriggerRef
1019
+ );
973
1020
  const { overlayProps: positionProps } = useOverlayPosition({
974
1021
  targetRef: menuTriggerRef,
975
1022
  overlayRef,
976
1023
  isOpen: state.isOpen
977
1024
  });
978
- const menuContext = __spreadProps(__spreadValues({}, menuProps), {
1025
+ const menuContext = {
1026
+ ...menuProps,
979
1027
  open: state.isOpen,
980
1028
  onClose: state.close,
981
1029
  autoFocus: state.focusStrategy,
982
1030
  triggerWidth: menuTriggerRef.current ? menuTriggerRef.current.offsetWidth : void 0
983
- });
984
- return /* @__PURE__ */ React28.createElement(MenuContext.Provider, {
1031
+ };
1032
+ return /* @__PURE__ */ React30.createElement(MenuContext.Provider, {
985
1033
  value: menuContext
986
- }, /* @__PURE__ */ React28.createElement(PressResponder2, __spreadProps(__spreadValues({}, menuTriggerProps), {
1034
+ }, /* @__PURE__ */ React30.createElement(PressResponder2, {
1035
+ ...menuTriggerProps,
987
1036
  ref: menuTriggerRef,
988
1037
  isPressed: state.isOpen
989
- }), menuTrigger), /* @__PURE__ */ React28.createElement(Popover, __spreadValues({
1038
+ }, menuTrigger), /* @__PURE__ */ React30.createElement(Popover, {
990
1039
  open: state.isOpen,
991
1040
  onClose: state.close,
992
1041
  dismissable: true,
993
1042
  shouldCloseOnBlur: true,
994
- ref: overlayRef
995
- }, positionProps), menu));
1043
+ ref: overlayRef,
1044
+ ...positionProps
1045
+ }, menu));
996
1046
  };
997
1047
 
998
1048
  // src/Menu/MenuItem.tsx
999
- import React29, { useRef as useRef7 } from "react";
1049
+ import React31, { useRef as useRef5 } from "react";
1000
1050
  import { useFocusRing as useFocusRing3 } from "@react-aria/focus";
1001
1051
  import { useMenuItem } from "@react-aria/menu";
1002
1052
  import { mergeProps as mergeProps4 } from "@react-aria/utils";
1003
- import { Box as Box13, useStateProps as useStateProps3 } from "@marigold/system";
1053
+ import { Box as Box15, useStateProps as useStateProps3 } from "@marigold/system";
1004
1054
  var MenuItem = ({ item, state, onAction, css }) => {
1005
- const ref = useRef7(null);
1055
+ const ref = useRef5(null);
1006
1056
  const { onClose } = useMenuContext();
1007
- const { menuItemProps } = useMenuItem({
1008
- key: item.key,
1009
- onAction,
1010
- onClose
1011
- }, state, ref);
1057
+ const { menuItemProps } = useMenuItem(
1058
+ {
1059
+ key: item.key,
1060
+ onAction,
1061
+ onClose
1062
+ },
1063
+ state,
1064
+ ref
1065
+ );
1012
1066
  const { isFocusVisible, focusProps } = useFocusRing3();
1013
1067
  const stateProps = useStateProps3({
1014
1068
  focus: isFocusVisible
1015
1069
  });
1016
- return /* @__PURE__ */ React29.createElement(Box13, __spreadValues(__spreadValues({
1070
+ return /* @__PURE__ */ React31.createElement(Box15, {
1017
1071
  as: "li",
1018
1072
  ref,
1019
1073
  __baseCSS: {
@@ -1021,24 +1075,29 @@ var MenuItem = ({ item, state, onAction, css }) => {
1021
1075
  outline: 0
1022
1076
  }
1023
1077
  },
1024
- css
1025
- }, mergeProps4(menuItemProps, focusProps)), stateProps), item.rendered);
1078
+ css,
1079
+ ...mergeProps4(menuItemProps, focusProps),
1080
+ ...stateProps
1081
+ }, item.rendered);
1026
1082
  };
1027
1083
 
1028
1084
  // src/Menu/Menu.tsx
1029
- var Menu = (_a) => {
1030
- var _b = _a, { variant, size } = _b, props = __objRest(_b, ["variant", "size"]);
1031
- const _a2 = useMenuContext(), { triggerWidth } = _a2, menuContext = __objRest(_a2, ["triggerWidth"]);
1032
- const ownProps = __spreadValues(__spreadValues({}, props), menuContext);
1033
- const ref = useRef8(null);
1034
- const state = useTreeState(__spreadProps(__spreadValues({}, ownProps), { selectionMode: "none" }));
1085
+ var Menu = ({ variant, size, ...props }) => {
1086
+ const { triggerWidth, ...menuContext } = useMenuContext();
1087
+ const ownProps = { ...props, ...menuContext };
1088
+ const ref = useRef6(null);
1089
+ const state = useTreeState({ ...ownProps, selectionMode: "none" });
1035
1090
  const { menuProps } = useMenu(ownProps, state, ref);
1036
- const styles = useComponentStyles17("Menu", { variant, size }, { parts: ["container", "item"] });
1037
- return /* @__PURE__ */ React30.createElement(FocusScope2, {
1091
+ const styles = useComponentStyles18(
1092
+ "Menu",
1093
+ { variant, size },
1094
+ { parts: ["container", "item"] }
1095
+ );
1096
+ return /* @__PURE__ */ React32.createElement(FocusScope2, {
1038
1097
  restoreFocus: true
1039
- }, /* @__PURE__ */ React30.createElement("div", null, /* @__PURE__ */ React30.createElement(DismissButton, {
1098
+ }, /* @__PURE__ */ React32.createElement("div", null, /* @__PURE__ */ React32.createElement(DismissButton, {
1040
1099
  onDismiss: ownProps.onClose
1041
- }), /* @__PURE__ */ React30.createElement(Box14, __spreadValues({
1100
+ }), /* @__PURE__ */ React32.createElement(Box16, {
1042
1101
  as: "ul",
1043
1102
  ref,
1044
1103
  style: { width: triggerWidth },
@@ -1047,14 +1106,15 @@ var Menu = (_a) => {
1047
1106
  p: 0,
1048
1107
  overflowWrap: "break-word"
1049
1108
  },
1050
- css: styles.container
1051
- }, menuProps), [...state.collection].map((item) => /* @__PURE__ */ React30.createElement(MenuItem, {
1109
+ css: styles.container,
1110
+ ...menuProps
1111
+ }, [...state.collection].map((item) => /* @__PURE__ */ React32.createElement(MenuItem, {
1052
1112
  key: item.key,
1053
1113
  item,
1054
1114
  state,
1055
1115
  onAction: props.onSelect,
1056
1116
  css: styles.item
1057
- }))), /* @__PURE__ */ React30.createElement(DismissButton, {
1117
+ }))), /* @__PURE__ */ React32.createElement(DismissButton, {
1058
1118
  onDismiss: ownProps.onClose
1059
1119
  })));
1060
1120
  };
@@ -1062,101 +1122,98 @@ Menu.Trigger = MenuTrigger;
1062
1122
  Menu.Item = Item;
1063
1123
 
1064
1124
  // src/Message/Message.tsx
1065
- import React31 from "react";
1125
+ import React33 from "react";
1066
1126
  import { Exclamation, Info, Notification } from "@marigold/icons";
1067
- import { useComponentStyles as useComponentStyles18 } from "@marigold/system";
1068
- var Message = (_a) => {
1069
- var _b = _a, {
1070
- messageTitle,
1071
- variant = "info",
1072
- size,
1073
- children
1074
- } = _b, props = __objRest(_b, [
1075
- "messageTitle",
1076
- "variant",
1077
- "size",
1078
- "children"
1079
- ]);
1080
- const styles = useComponentStyles18("Message", {
1081
- variant,
1082
- size
1083
- }, { parts: ["container", "icon", "title", "content"] });
1084
- var icon = /* @__PURE__ */ React31.createElement(Info, null);
1127
+ import { useComponentStyles as useComponentStyles19 } from "@marigold/system";
1128
+ var Message = ({
1129
+ messageTitle,
1130
+ variant = "info",
1131
+ size,
1132
+ children,
1133
+ ...props
1134
+ }) => {
1135
+ const styles = useComponentStyles19(
1136
+ "Message",
1137
+ {
1138
+ variant,
1139
+ size
1140
+ },
1141
+ { parts: ["container", "icon", "title", "content"] }
1142
+ );
1143
+ var icon = /* @__PURE__ */ React33.createElement(Info, null);
1085
1144
  if (variant === "warning") {
1086
- icon = /* @__PURE__ */ React31.createElement(Notification, null);
1145
+ icon = /* @__PURE__ */ React33.createElement(Notification, null);
1087
1146
  }
1088
1147
  if (variant === "error") {
1089
- icon = /* @__PURE__ */ React31.createElement(Exclamation, null);
1148
+ icon = /* @__PURE__ */ React33.createElement(Exclamation, null);
1090
1149
  }
1091
- return /* @__PURE__ */ React31.createElement(Box, __spreadValues({
1092
- css: styles.container
1093
- }, props), /* @__PURE__ */ React31.createElement(Box, {
1150
+ return /* @__PURE__ */ React33.createElement(Box, {
1151
+ css: styles.container,
1152
+ ...props
1153
+ }, /* @__PURE__ */ React33.createElement(Box, {
1094
1154
  __baseCSS: { display: "flex", alignItems: "center", gap: 4 }
1095
- }, /* @__PURE__ */ React31.createElement(Box, {
1155
+ }, /* @__PURE__ */ React33.createElement(Box, {
1096
1156
  role: "presentation",
1097
1157
  css: styles.icon
1098
- }, icon), /* @__PURE__ */ React31.createElement(Box, {
1158
+ }, icon), /* @__PURE__ */ React33.createElement(Box, {
1099
1159
  css: styles.title
1100
- }, messageTitle)), /* @__PURE__ */ React31.createElement(Box, {
1160
+ }, messageTitle)), /* @__PURE__ */ React33.createElement(Box, {
1101
1161
  css: styles.content
1102
1162
  }, children));
1103
1163
  };
1104
1164
 
1105
1165
  // src/NumberField/NumberField.tsx
1106
- import React35, { forwardRef as forwardRef6 } from "react";
1166
+ import React37, { forwardRef as forwardRef7 } from "react";
1107
1167
  import { useFocusRing as useFocusRing4 } from "@react-aria/focus";
1108
- import { useHover as useHover3 } from "@react-aria/interactions";
1168
+ import { useHover as useHover4 } from "@react-aria/interactions";
1109
1169
  import { useLocale } from "@react-aria/i18n";
1110
1170
  import { useNumberField } from "@react-aria/numberfield";
1111
- import { mergeProps as mergeProps6, useObjectRef as useObjectRef3 } from "@react-aria/utils";
1171
+ import { mergeProps as mergeProps6, useObjectRef as useObjectRef5 } from "@react-aria/utils";
1112
1172
  import { useNumberFieldState } from "@react-stately/numberfield";
1113
1173
  import {
1114
- Box as Box18,
1115
- useComponentStyles as useComponentStyles20,
1174
+ Box as Box20,
1175
+ useComponentStyles as useComponentStyles21,
1116
1176
  useStateProps as useStateProps5
1117
1177
  } from "@marigold/system";
1118
1178
 
1119
1179
  // src/FieldBase/FieldBase.tsx
1120
- import React33 from "react";
1121
- import { Box as Box16 } from "@marigold/system";
1180
+ import React35 from "react";
1181
+ import { Box as Box18 } from "@marigold/system";
1122
1182
 
1123
1183
  // src/HelpText/HelpText.tsx
1124
- import React32 from "react";
1184
+ import React34 from "react";
1125
1185
  import { Exclamation as Exclamation2 } from "@marigold/icons";
1126
1186
  import {
1127
- Box as Box15,
1128
- useComponentStyles as useComponentStyles19
1187
+ Box as Box17,
1188
+ useComponentStyles as useComponentStyles20
1129
1189
  } from "@marigold/system";
1130
- var HelpText = (_a) => {
1131
- var _b = _a, {
1132
- variant,
1133
- size,
1134
- disabled,
1135
- description,
1136
- descriptionProps,
1137
- error,
1138
- errorMessage,
1139
- errorMessageProps
1140
- } = _b, props = __objRest(_b, [
1141
- "variant",
1142
- "size",
1143
- "disabled",
1144
- "description",
1145
- "descriptionProps",
1146
- "error",
1147
- "errorMessage",
1148
- "errorMessageProps"
1149
- ]);
1150
- var _a2;
1190
+ var HelpText = ({
1191
+ variant,
1192
+ size,
1193
+ disabled,
1194
+ description,
1195
+ descriptionProps,
1196
+ error,
1197
+ errorMessage,
1198
+ errorMessageProps,
1199
+ ...props
1200
+ }) => {
1201
+ var _a;
1151
1202
  const hasErrorMessage = errorMessage && error;
1152
- const styles = useComponentStyles19("HelpText", { variant, size }, { parts: ["container", "icon"] });
1153
- return /* @__PURE__ */ React32.createElement(Box15, __spreadProps(__spreadValues(__spreadValues({}, hasErrorMessage ? errorMessageProps : descriptionProps), props), {
1203
+ const styles = useComponentStyles20(
1204
+ "HelpText",
1205
+ { variant, size },
1206
+ { parts: ["container", "icon"] }
1207
+ );
1208
+ return /* @__PURE__ */ React34.createElement(Box17, {
1209
+ ...hasErrorMessage ? errorMessageProps : descriptionProps,
1210
+ ...props,
1154
1211
  __baseCSS: { display: "flex", alignItems: "center", gap: 4 },
1155
1212
  css: styles.container
1156
- }), hasErrorMessage ? /* @__PURE__ */ React32.createElement(React32.Fragment, null, /* @__PURE__ */ React32.createElement(Exclamation2, {
1213
+ }, hasErrorMessage ? /* @__PURE__ */ React34.createElement(React34.Fragment, null, /* @__PURE__ */ React34.createElement(Exclamation2, {
1157
1214
  role: "presentation",
1158
- size: ((_a2 = styles == null ? void 0 : styles.icon) == null ? void 0 : _a2.size) || 16
1159
- }), errorMessage) : /* @__PURE__ */ React32.createElement(React32.Fragment, null, description));
1215
+ size: ((_a = styles == null ? void 0 : styles.icon) == null ? void 0 : _a.size) || 16
1216
+ }), errorMessage) : /* @__PURE__ */ React34.createElement(React34.Fragment, null, description));
1160
1217
  };
1161
1218
 
1162
1219
  // src/FieldBase/FieldBase.tsx
@@ -1177,13 +1234,16 @@ var FieldBase = ({
1177
1234
  stateProps
1178
1235
  }) => {
1179
1236
  const hasHelpText = !!description || errorMessage && error;
1180
- return /* @__PURE__ */ React33.createElement(Box16, {
1237
+ return /* @__PURE__ */ React35.createElement(Box18, {
1181
1238
  css: { display: "flex", flexDirection: "column", width }
1182
- }, label && /* @__PURE__ */ React33.createElement(Label, __spreadValues(__spreadValues({
1239
+ }, label && /* @__PURE__ */ React35.createElement(Label, {
1183
1240
  required,
1184
1241
  variant,
1185
- size
1186
- }, labelProps), stateProps), label), children, hasHelpText && /* @__PURE__ */ React33.createElement(HelpText, __spreadProps(__spreadValues({}, stateProps), {
1242
+ size,
1243
+ ...labelProps,
1244
+ ...stateProps
1245
+ }, label), children, hasHelpText && /* @__PURE__ */ React35.createElement(HelpText, {
1246
+ ...stateProps,
1187
1247
  variant,
1188
1248
  size,
1189
1249
  disabled,
@@ -1192,60 +1252,64 @@ var FieldBase = ({
1192
1252
  error,
1193
1253
  errorMessage,
1194
1254
  errorMessageProps
1195
- })));
1255
+ }));
1196
1256
  };
1197
1257
 
1198
1258
  // src/NumberField/StepButton.tsx
1199
- import React34, { useRef as useRef9 } from "react";
1259
+ import React36, { useRef as useRef7 } from "react";
1200
1260
  import { useButton as useButton3 } from "@react-aria/button";
1201
- import { useHover as useHover2 } from "@react-aria/interactions";
1261
+ import { useHover as useHover3 } from "@react-aria/interactions";
1202
1262
  import { mergeProps as mergeProps5 } from "@react-aria/utils";
1203
- import { Box as Box17, useStateProps as useStateProps4 } from "@marigold/system";
1204
- var Plus = () => /* @__PURE__ */ React34.createElement(Box17, {
1263
+ import { Box as Box19, useStateProps as useStateProps4 } from "@marigold/system";
1264
+ var Plus = () => /* @__PURE__ */ React36.createElement(Box19, {
1205
1265
  as: "svg",
1206
1266
  __baseCSS: { width: 16, height: 16 },
1207
1267
  viewBox: "0 0 20 20",
1208
1268
  fill: "currentColor"
1209
- }, /* @__PURE__ */ React34.createElement("path", {
1269
+ }, /* @__PURE__ */ React36.createElement("path", {
1210
1270
  fillRule: "evenodd",
1211
1271
  clipRule: "evenodd",
1212
1272
  d: "M10 3a1 1 0 011 1v5h5a1 1 0 110 2h-5v5a1 1 0 11-2 0v-5H4a1 1 0 110-2h5V4a1 1 0 011-1z"
1213
1273
  }));
1214
- var Minus = () => /* @__PURE__ */ React34.createElement(Box17, {
1274
+ var Minus = () => /* @__PURE__ */ React36.createElement(Box19, {
1215
1275
  as: "svg",
1216
1276
  __baseCSS: { width: 16, height: 16 },
1217
1277
  viewBox: "0 0 20 20",
1218
1278
  fill: "currentColor"
1219
- }, /* @__PURE__ */ React34.createElement("path", {
1279
+ }, /* @__PURE__ */ React36.createElement("path", {
1220
1280
  fillRule: "evenodd",
1221
1281
  clipRule: "evenodd",
1222
1282
  d: "M3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z"
1223
1283
  }));
1224
- var StepButton = (_a) => {
1225
- var _b = _a, { direction, css } = _b, props = __objRest(_b, ["direction", "css"]);
1226
- const ref = useRef9(null);
1227
- const { buttonProps, isPressed } = useButton3(__spreadProps(__spreadValues({}, props), { elementType: "div" }), ref);
1228
- const { hoverProps, isHovered } = useHover2(props);
1284
+ var StepButton = ({ direction, css, ...props }) => {
1285
+ const ref = useRef7(null);
1286
+ const { buttonProps, isPressed } = useButton3(
1287
+ { ...props, elementType: "div" },
1288
+ ref
1289
+ );
1290
+ const { hoverProps, isHovered } = useHover3(props);
1229
1291
  const stateProps = useStateProps4({
1230
1292
  active: isPressed,
1231
1293
  hover: isHovered,
1232
1294
  disabled: props.isDisabled
1233
1295
  });
1234
1296
  const Icon3 = direction === "up" ? Plus : Minus;
1235
- return /* @__PURE__ */ React34.createElement(Box17, __spreadValues(__spreadValues({
1297
+ return /* @__PURE__ */ React36.createElement(Box19, {
1236
1298
  __baseCSS: {
1237
1299
  display: "flex",
1238
1300
  alignItems: "center",
1239
1301
  justifyContent: "center",
1240
1302
  cursor: props.isDisabled ? "not-allowed" : "pointer"
1241
1303
  },
1242
- css
1243
- }, mergeProps5(buttonProps, hoverProps)), stateProps), /* @__PURE__ */ React34.createElement(Icon3, null));
1304
+ css,
1305
+ ...mergeProps5(buttonProps, hoverProps),
1306
+ ...stateProps
1307
+ }, /* @__PURE__ */ React36.createElement(Icon3, null));
1244
1308
  };
1245
1309
 
1246
1310
  // src/NumberField/NumberField.tsx
1247
- var NumberField = forwardRef6((_a, ref) => {
1248
- var _b = _a, {
1311
+ var NumberField = forwardRef7(
1312
+ ({
1249
1313
  variant,
1250
1314
  size,
1251
1315
  width,
@@ -1253,92 +1317,96 @@ var NumberField = forwardRef6((_a, ref) => {
1253
1317
  required,
1254
1318
  readOnly,
1255
1319
  error,
1256
- hideStepper
1257
- } = _b, rest = __objRest(_b, [
1258
- "variant",
1259
- "size",
1260
- "width",
1261
- "disabled",
1262
- "required",
1263
- "readOnly",
1264
- "error",
1265
- "hideStepper"
1266
- ]);
1267
- const props = __spreadValues({
1268
- isDisabled: disabled,
1269
- isRequired: required,
1270
- isReadOnly: readOnly,
1271
- validationState: error ? "invalid" : "valid"
1272
- }, rest);
1273
- const showStepper = !hideStepper;
1274
- const { locale } = useLocale();
1275
- const inputRef = useObjectRef3(ref);
1276
- const state = useNumberFieldState(__spreadProps(__spreadValues({}, props), { locale }));
1277
- const {
1278
- labelProps,
1279
- groupProps,
1280
- inputProps,
1281
- descriptionProps,
1282
- errorMessageProps,
1283
- incrementButtonProps,
1284
- decrementButtonProps
1285
- } = useNumberField(props, state, inputRef);
1286
- const { hoverProps, isHovered } = useHover3({ isDisabled: disabled });
1287
- const { focusProps, isFocused } = useFocusRing4({
1288
- within: true,
1289
- isTextInput: true,
1290
- autoFocus: props.autoFocus
1291
- });
1292
- const styles = useComponentStyles20("NumberField", { variant, size }, { parts: ["group", "stepper"] });
1293
- const stateProps = useStateProps5({
1294
- hover: isHovered,
1295
- focus: isFocused,
1296
- disabled,
1297
- readOnly,
1298
- error
1299
- });
1300
- return /* @__PURE__ */ React35.createElement(FieldBase, {
1301
- label: props.label,
1302
- labelProps,
1303
- required,
1304
- description: props.description,
1305
- descriptionProps,
1306
- error,
1307
- errorMessage: props.errorMessage,
1308
- errorMessageProps,
1309
- stateProps,
1310
- variant,
1311
- size,
1312
- width
1313
- }, /* @__PURE__ */ React35.createElement(Box18, __spreadValues(__spreadValues({
1314
- "data-group": true,
1315
- __baseCSS: {
1316
- display: "flex",
1317
- alignItems: "stretch",
1318
- "> input": {
1319
- flexGrow: 1
1320
- }
1321
- },
1322
- css: styles.group
1323
- }, mergeProps6(groupProps, focusProps, hoverProps)), stateProps), showStepper && /* @__PURE__ */ React35.createElement(StepButton, __spreadValues({
1324
- direction: "down",
1325
- css: styles.stepper
1326
- }, decrementButtonProps)), /* @__PURE__ */ React35.createElement(Input, __spreadValues(__spreadValues({
1327
- ref: inputRef,
1328
- variant,
1329
- size
1330
- }, inputProps), stateProps)), showStepper && /* @__PURE__ */ React35.createElement(StepButton, __spreadValues({
1331
- direction: "up",
1332
- css: styles.stepper
1333
- }, incrementButtonProps))));
1334
- });
1320
+ hideStepper,
1321
+ ...rest
1322
+ }, ref) => {
1323
+ const props = {
1324
+ isDisabled: disabled,
1325
+ isRequired: required,
1326
+ isReadOnly: readOnly,
1327
+ validationState: error ? "invalid" : "valid",
1328
+ ...rest
1329
+ };
1330
+ const showStepper = !hideStepper;
1331
+ const { locale } = useLocale();
1332
+ const inputRef = useObjectRef5(ref);
1333
+ const state = useNumberFieldState({ ...props, locale });
1334
+ const {
1335
+ labelProps,
1336
+ groupProps,
1337
+ inputProps,
1338
+ descriptionProps,
1339
+ errorMessageProps,
1340
+ incrementButtonProps,
1341
+ decrementButtonProps
1342
+ } = useNumberField(props, state, inputRef);
1343
+ const { hoverProps, isHovered } = useHover4({ isDisabled: disabled });
1344
+ const { focusProps, isFocused } = useFocusRing4({
1345
+ within: true,
1346
+ isTextInput: true,
1347
+ autoFocus: props.autoFocus
1348
+ });
1349
+ const styles = useComponentStyles21(
1350
+ "NumberField",
1351
+ { variant, size },
1352
+ { parts: ["group", "stepper"] }
1353
+ );
1354
+ const stateProps = useStateProps5({
1355
+ hover: isHovered,
1356
+ focus: isFocused,
1357
+ disabled,
1358
+ readOnly,
1359
+ error
1360
+ });
1361
+ return /* @__PURE__ */ React37.createElement(FieldBase, {
1362
+ label: props.label,
1363
+ labelProps,
1364
+ required,
1365
+ description: props.description,
1366
+ descriptionProps,
1367
+ error,
1368
+ errorMessage: props.errorMessage,
1369
+ errorMessageProps,
1370
+ stateProps,
1371
+ variant,
1372
+ size,
1373
+ width
1374
+ }, /* @__PURE__ */ React37.createElement(Box20, {
1375
+ "data-group": true,
1376
+ __baseCSS: {
1377
+ display: "flex",
1378
+ alignItems: "stretch",
1379
+ "> input": {
1380
+ flexGrow: 1
1381
+ }
1382
+ },
1383
+ css: styles.group,
1384
+ ...mergeProps6(groupProps, focusProps, hoverProps),
1385
+ ...stateProps
1386
+ }, showStepper && /* @__PURE__ */ React37.createElement(StepButton, {
1387
+ direction: "down",
1388
+ css: styles.stepper,
1389
+ ...decrementButtonProps
1390
+ }), /* @__PURE__ */ React37.createElement(Input, {
1391
+ ref: inputRef,
1392
+ variant,
1393
+ size,
1394
+ ...inputProps,
1395
+ ...stateProps
1396
+ }), showStepper && /* @__PURE__ */ React37.createElement(StepButton, {
1397
+ direction: "up",
1398
+ css: styles.stepper,
1399
+ ...incrementButtonProps
1400
+ })));
1401
+ }
1402
+ );
1335
1403
 
1336
1404
  // src/Provider/index.ts
1337
1405
  import { useTheme as useTheme2, ThemeProvider as ThemeProvider2 } from "@marigold/system";
1338
1406
  import { SSRProvider } from "@react-aria/ssr";
1339
1407
 
1340
1408
  // src/Provider/MarigoldProvider.tsx
1341
- import React36 from "react";
1409
+ import React38 from "react";
1342
1410
  import { OverlayProvider } from "@react-aria/overlays";
1343
1411
  import {
1344
1412
  Global,
@@ -1356,81 +1424,82 @@ function MarigoldProvider({
1356
1424
  const outer = useTheme();
1357
1425
  const isTopLevel = outer.theme === __defaultTheme;
1358
1426
  if (((_a = outer.theme) == null ? void 0 : _a.root) && !isTopLevel && !selector) {
1359
- throw new Error(`[MarigoldProvider] You cannot nest a MarigoldProvider inside another MarigoldProvider without a "selector"!
1360
- Nested themes with a "root" property must specify a "selector" to prevent accidentally overriding global CSS`);
1427
+ throw new Error(
1428
+ `[MarigoldProvider] You cannot nest a MarigoldProvider inside another MarigoldProvider without a "selector"!
1429
+ Nested themes with a "root" property must specify a "selector" to prevent accidentally overriding global CSS`
1430
+ );
1361
1431
  }
1362
- return /* @__PURE__ */ React36.createElement(ThemeProvider, {
1432
+ return /* @__PURE__ */ React38.createElement(ThemeProvider, {
1363
1433
  theme
1364
- }, /* @__PURE__ */ React36.createElement(Global, {
1434
+ }, /* @__PURE__ */ React38.createElement(Global, {
1365
1435
  normalizeDocument: isTopLevel && normalizeDocument,
1366
1436
  selector
1367
- }), isTopLevel ? /* @__PURE__ */ React36.createElement(OverlayProvider, null, children) : children);
1437
+ }), isTopLevel ? /* @__PURE__ */ React38.createElement(OverlayProvider, null, children) : children);
1368
1438
  }
1369
1439
 
1370
1440
  // src/Radio/Radio.tsx
1371
- import React38, {
1372
- forwardRef as forwardRef7
1441
+ import React40, {
1442
+ forwardRef as forwardRef8
1373
1443
  } from "react";
1374
- import { useHover as useHover4 } from "@react-aria/interactions";
1444
+ import { useHover as useHover5 } from "@react-aria/interactions";
1375
1445
  import { useFocusRing as useFocusRing5 } from "@react-aria/focus";
1376
1446
  import { useRadio } from "@react-aria/radio";
1377
- import { useObjectRef as useObjectRef4 } from "@react-aria/utils";
1447
+ import { useObjectRef as useObjectRef6 } from "@react-aria/utils";
1378
1448
  import {
1379
- Box as Box20,
1380
- useComponentStyles as useComponentStyles22,
1449
+ Box as Box22,
1450
+ useComponentStyles as useComponentStyles23,
1381
1451
  useStateProps as useStateProps6
1382
1452
  } from "@marigold/system";
1383
1453
 
1384
1454
  // src/Radio/Context.ts
1385
- import { createContext as createContext4, useContext as useContext4 } from "react";
1386
- var RadioGroupContext = createContext4(null);
1387
- var useRadioGroupContext = () => useContext4(RadioGroupContext);
1455
+ import { createContext as createContext5, useContext as useContext5 } from "react";
1456
+ var RadioGroupContext = createContext5(
1457
+ null
1458
+ );
1459
+ var useRadioGroupContext = () => useContext5(RadioGroupContext);
1388
1460
 
1389
1461
  // src/Radio/RadioGroup.tsx
1390
- import React37 from "react";
1462
+ import React39 from "react";
1391
1463
  import { useRadioGroup } from "@react-aria/radio";
1392
1464
  import { useRadioGroupState } from "@react-stately/radio";
1393
1465
  import {
1394
- Box as Box19,
1395
- useComponentStyles as useComponentStyles21
1466
+ Box as Box21,
1467
+ useComponentStyles as useComponentStyles22
1396
1468
  } from "@marigold/system";
1397
- var RadioGroup = (_a) => {
1398
- var _b = _a, {
1399
- children,
1400
- orientation = "vertical",
1401
- size,
1402
- variant,
1403
- width,
1404
- required,
1405
- disabled,
1406
- readOnly,
1407
- error
1408
- } = _b, rest = __objRest(_b, [
1409
- "children",
1410
- "orientation",
1411
- "size",
1412
- "variant",
1413
- "width",
1414
- "required",
1415
- "disabled",
1416
- "readOnly",
1417
- "error"
1418
- ]);
1419
- const props = __spreadValues({
1469
+ var RadioGroup = ({
1470
+ children,
1471
+ orientation = "vertical",
1472
+ size,
1473
+ variant,
1474
+ width,
1475
+ required,
1476
+ disabled,
1477
+ readOnly,
1478
+ error,
1479
+ ...rest
1480
+ }) => {
1481
+ const props = {
1420
1482
  isRequired: required,
1421
1483
  isDisabled: disabled,
1422
1484
  isReadOnly: readOnly,
1423
- validationState: error ? "invalid" : "valid"
1424
- }, rest);
1485
+ validationState: error ? "invalid" : "valid",
1486
+ ...rest
1487
+ };
1425
1488
  const state = useRadioGroupState(props);
1426
1489
  const { radioGroupProps, labelProps } = useRadioGroup(props, state);
1427
- const styles = useComponentStyles21("RadioGroup", { variant, size }, { parts: ["container", "group"] });
1428
- return /* @__PURE__ */ React37.createElement(Box19, __spreadProps(__spreadValues({}, radioGroupProps), {
1490
+ const styles = useComponentStyles22(
1491
+ "RadioGroup",
1492
+ { variant, size },
1493
+ { parts: ["container", "group"] }
1494
+ );
1495
+ return /* @__PURE__ */ React39.createElement(Box21, {
1496
+ ...radioGroupProps,
1429
1497
  css: styles.container
1430
- }), props.label && /* @__PURE__ */ React37.createElement(Label, __spreadValues({
1498
+ }, props.label && /* @__PURE__ */ React39.createElement(Label, {
1431
1499
  as: "span",
1432
- required
1433
- }, labelProps), props.label), /* @__PURE__ */ React37.createElement(Box19, {
1500
+ required,
1501
+ ...labelProps
1502
+ }, props.label), /* @__PURE__ */ React39.createElement(Box21, {
1434
1503
  role: "presentation",
1435
1504
  "data-orientation": orientation,
1436
1505
  __baseCSS: {
@@ -1440,100 +1509,109 @@ var RadioGroup = (_a) => {
1440
1509
  gap: orientation === "vertical" ? "0.5ch" : "1.5ch"
1441
1510
  },
1442
1511
  css: styles.group
1443
- }, /* @__PURE__ */ React37.createElement(RadioGroupContext.Provider, {
1444
- value: __spreadValues({ variant, size, width, error }, state)
1512
+ }, /* @__PURE__ */ React39.createElement(RadioGroupContext.Provider, {
1513
+ value: { variant, size, width, error, ...state }
1445
1514
  }, children)));
1446
1515
  };
1447
1516
 
1448
1517
  // src/Radio/Radio.tsx
1449
- var Dot = () => /* @__PURE__ */ React38.createElement("svg", {
1518
+ var Dot = () => /* @__PURE__ */ React40.createElement("svg", {
1450
1519
  viewBox: "0 0 6 6"
1451
- }, /* @__PURE__ */ React38.createElement("circle", {
1520
+ }, /* @__PURE__ */ React40.createElement("circle", {
1452
1521
  fill: "currentColor",
1453
1522
  cx: "3",
1454
1523
  cy: "3",
1455
1524
  r: "3"
1456
1525
  }));
1457
- var Icon2 = (_a) => {
1458
- var _b = _a, { checked, css } = _b, props = __objRest(_b, ["checked", "css"]);
1459
- return /* @__PURE__ */ React38.createElement(Box20, __spreadValues({
1460
- "aria-hidden": "true",
1461
- __baseCSS: {
1462
- width: 16,
1463
- height: 16,
1464
- bg: "#fff",
1465
- border: "1px solid #000",
1466
- borderRadius: "50%",
1467
- display: "flex",
1468
- alignItems: "center",
1469
- justifyContent: "center",
1470
- p: 4
1471
- },
1472
- css
1473
- }, props), checked ? /* @__PURE__ */ React38.createElement(Dot, null) : null);
1474
- };
1475
- var Radio = forwardRef7((_a, ref) => {
1476
- var _b = _a, { width, disabled } = _b, props = __objRest(_b, ["width", "disabled"]);
1477
- const _a2 = useRadioGroupContext(), {
1478
- variant,
1479
- size,
1480
- error,
1481
- width: groupWidth
1482
- } = _a2, state = __objRest(_a2, [
1483
- "variant",
1484
- "size",
1485
- "error",
1486
- "width"
1487
- ]);
1488
- const inputRef = useObjectRef4(ref);
1489
- const { inputProps } = useRadio(__spreadValues({ isDisabled: disabled }, props), state, inputRef);
1490
- const styles = useComponentStyles22("Radio", { variant: variant || props.variant, size: size || props.size }, { parts: ["container", "label", "radio"] });
1491
- const { hoverProps, isHovered } = useHover4({});
1492
- const { isFocusVisible, focusProps } = useFocusRing5();
1493
- const stateProps = useStateProps6({
1494
- hover: isHovered,
1495
- focus: isFocusVisible,
1496
- checked: inputProps.checked,
1497
- disabled: inputProps.disabled,
1498
- readOnly: props.readOnly,
1499
- error
1500
- });
1501
- return /* @__PURE__ */ React38.createElement(Box20, __spreadValues(__spreadValues({
1502
- as: "label",
1503
- __baseCSS: {
1504
- display: "flex",
1505
- alignItems: "center",
1506
- gap: "1ch",
1507
- position: "relative",
1508
- width: width || groupWidth || "100%"
1509
- },
1510
- css: styles.container
1511
- }, hoverProps), stateProps), /* @__PURE__ */ React38.createElement(Box20, __spreadValues(__spreadValues({
1512
- as: "input",
1513
- ref: inputRef,
1514
- css: {
1515
- position: "absolute",
1516
- width: "100%",
1517
- height: "100%",
1518
- top: 0,
1519
- left: 0,
1520
- zIndex: 1,
1521
- opacity: 1e-4,
1522
- cursor: inputProps.disabled ? "not-allowed" : "pointer"
1523
- }
1524
- }, inputProps), focusProps)), /* @__PURE__ */ React38.createElement(Icon2, __spreadValues({
1525
- checked: inputProps.checked,
1526
- css: styles.radio
1527
- }, stateProps)), /* @__PURE__ */ React38.createElement(Box20, __spreadValues({
1528
- css: styles.label
1529
- }, stateProps), props.children));
1530
- });
1526
+ var Icon2 = ({ checked, css, ...props }) => /* @__PURE__ */ React40.createElement(Box22, {
1527
+ "aria-hidden": "true",
1528
+ __baseCSS: {
1529
+ width: 16,
1530
+ height: 16,
1531
+ bg: "#fff",
1532
+ border: "1px solid #000",
1533
+ borderRadius: "50%",
1534
+ display: "flex",
1535
+ alignItems: "center",
1536
+ justifyContent: "center",
1537
+ p: 4
1538
+ },
1539
+ css,
1540
+ ...props
1541
+ }, checked ? /* @__PURE__ */ React40.createElement(Dot, null) : null);
1542
+ var Radio = forwardRef8(
1543
+ ({ width, disabled, ...props }, ref) => {
1544
+ const {
1545
+ variant,
1546
+ size,
1547
+ error,
1548
+ width: groupWidth,
1549
+ ...state
1550
+ } = useRadioGroupContext();
1551
+ const inputRef = useObjectRef6(ref);
1552
+ const { inputProps } = useRadio(
1553
+ { isDisabled: disabled, ...props },
1554
+ state,
1555
+ inputRef
1556
+ );
1557
+ const styles = useComponentStyles23(
1558
+ "Radio",
1559
+ { variant: variant || props.variant, size: size || props.size },
1560
+ { parts: ["container", "label", "radio"] }
1561
+ );
1562
+ const { hoverProps, isHovered } = useHover5({});
1563
+ const { isFocusVisible, focusProps } = useFocusRing5();
1564
+ const stateProps = useStateProps6({
1565
+ hover: isHovered,
1566
+ focus: isFocusVisible,
1567
+ checked: inputProps.checked,
1568
+ disabled: inputProps.disabled,
1569
+ readOnly: props.readOnly,
1570
+ error
1571
+ });
1572
+ return /* @__PURE__ */ React40.createElement(Box22, {
1573
+ as: "label",
1574
+ __baseCSS: {
1575
+ display: "flex",
1576
+ alignItems: "center",
1577
+ gap: "1ch",
1578
+ position: "relative",
1579
+ width: width || groupWidth || "100%"
1580
+ },
1581
+ css: styles.container,
1582
+ ...hoverProps,
1583
+ ...stateProps
1584
+ }, /* @__PURE__ */ React40.createElement(Box22, {
1585
+ as: "input",
1586
+ ref: inputRef,
1587
+ css: {
1588
+ position: "absolute",
1589
+ width: "100%",
1590
+ height: "100%",
1591
+ top: 0,
1592
+ left: 0,
1593
+ zIndex: 1,
1594
+ opacity: 1e-4,
1595
+ cursor: inputProps.disabled ? "not-allowed" : "pointer"
1596
+ },
1597
+ ...inputProps,
1598
+ ...focusProps
1599
+ }), /* @__PURE__ */ React40.createElement(Icon2, {
1600
+ checked: inputProps.checked,
1601
+ css: styles.radio,
1602
+ ...stateProps
1603
+ }), /* @__PURE__ */ React40.createElement(Box22, {
1604
+ css: styles.label,
1605
+ ...stateProps
1606
+ }, props.children));
1607
+ }
1608
+ );
1531
1609
  Radio.Group = RadioGroup;
1532
1610
 
1533
1611
  // src/Select/Select.tsx
1534
- import React42, {
1535
- forwardRef as forwardRef9,
1536
- useRef as useRef11
1612
+ import React44, {
1613
+ forwardRef as forwardRef10,
1614
+ useRef as useRef9
1537
1615
  } from "react";
1538
1616
  import { useButton as useButton4 } from "@react-aria/button";
1539
1617
  import { FocusScope as FocusScope3, useFocusRing as useFocusRing6 } from "@react-aria/focus";
@@ -1542,52 +1620,58 @@ import { DismissButton as DismissButton2, useOverlayPosition as useOverlayPositi
1542
1620
  import { HiddenSelect, useSelect } from "@react-aria/select";
1543
1621
  import { useSelectState } from "@react-stately/select";
1544
1622
  import { Item as Item2, Section } from "@react-stately/collections";
1545
- import { mergeProps as mergeProps7, useObjectRef as useObjectRef6 } from "@react-aria/utils";
1623
+ import { mergeProps as mergeProps7, useObjectRef as useObjectRef8 } from "@react-aria/utils";
1546
1624
  import {
1547
- Box as Box24,
1548
- useComponentStyles as useComponentStyles24,
1625
+ Box as Box26,
1626
+ useComponentStyles as useComponentStyles25,
1549
1627
  useStateProps as useStateProps8
1550
1628
  } from "@marigold/system";
1551
1629
 
1552
1630
  // src/ListBox/ListBox.tsx
1553
- import React41, { forwardRef as forwardRef8 } from "react";
1554
- import { useObjectRef as useObjectRef5 } from "@react-aria/utils";
1631
+ import React43, { forwardRef as forwardRef9 } from "react";
1632
+ import { useObjectRef as useObjectRef7 } from "@react-aria/utils";
1555
1633
  import {
1556
- Box as Box23,
1557
- useComponentStyles as useComponentStyles23
1634
+ Box as Box25,
1635
+ useComponentStyles as useComponentStyles24
1558
1636
  } from "@marigold/system";
1559
1637
  import { useListBox } from "@react-aria/listbox";
1560
1638
 
1561
1639
  // src/ListBox/Context.ts
1562
- import { createContext as createContext5, useContext as useContext5 } from "react";
1563
- var ListBoxContext = createContext5({});
1564
- var useListBoxContext = () => useContext5(ListBoxContext);
1640
+ import { createContext as createContext6, useContext as useContext6 } from "react";
1641
+ var ListBoxContext = createContext6({});
1642
+ var useListBoxContext = () => useContext6(ListBoxContext);
1565
1643
 
1566
1644
  // src/ListBox/ListBoxSection.tsx
1567
- import React40 from "react";
1645
+ import React42 from "react";
1568
1646
  import { useListBoxSection } from "@react-aria/listbox";
1569
- import { Box as Box22 } from "@marigold/system";
1647
+ import { Box as Box24 } from "@marigold/system";
1570
1648
 
1571
1649
  // src/ListBox/ListBoxOption.tsx
1572
- import React39, { useRef as useRef10 } from "react";
1650
+ import React41, { useRef as useRef8 } from "react";
1573
1651
  import { useOption } from "@react-aria/listbox";
1574
- import { Box as Box21, useStateProps as useStateProps7 } from "@marigold/system";
1652
+ import { Box as Box23, useStateProps as useStateProps7 } from "@marigold/system";
1575
1653
  var ListBoxOption = ({ item, state }) => {
1576
- const ref = useRef10(null);
1577
- const { optionProps, isSelected, isDisabled, isFocused } = useOption({
1578
- key: item.key
1579
- }, state, ref);
1654
+ const ref = useRef8(null);
1655
+ const { optionProps, isSelected, isDisabled, isFocused } = useOption(
1656
+ {
1657
+ key: item.key
1658
+ },
1659
+ state,
1660
+ ref
1661
+ );
1580
1662
  const { styles } = useListBoxContext();
1581
1663
  const stateProps = useStateProps7({
1582
1664
  selected: isSelected,
1583
1665
  disabled: isDisabled,
1584
1666
  focusVisible: isFocused
1585
1667
  });
1586
- return /* @__PURE__ */ React39.createElement(Box21, __spreadValues(__spreadValues({
1668
+ return /* @__PURE__ */ React41.createElement(Box23, {
1587
1669
  as: "li",
1588
1670
  ref,
1589
- css: styles.option
1590
- }, optionProps), stateProps), item.rendered);
1671
+ css: styles.option,
1672
+ ...optionProps,
1673
+ ...stateProps
1674
+ }, item.rendered);
1591
1675
  };
1592
1676
 
1593
1677
  // src/ListBox/ListBoxSection.tsx
@@ -1597,16 +1681,19 @@ var ListBoxSection = ({ section, state }) => {
1597
1681
  "aria-label": section["aria-label"]
1598
1682
  });
1599
1683
  const { styles } = useListBoxContext();
1600
- return /* @__PURE__ */ React40.createElement(Box22, __spreadValues({
1684
+ return /* @__PURE__ */ React42.createElement(Box24, {
1601
1685
  as: "li",
1602
- css: styles.section
1603
- }, itemProps), section.rendered && /* @__PURE__ */ React40.createElement(Box22, __spreadValues({
1604
- css: styles.sectionTitle
1605
- }, headingProps), section.rendered), /* @__PURE__ */ React40.createElement(Box22, __spreadValues({
1686
+ css: styles.section,
1687
+ ...itemProps
1688
+ }, section.rendered && /* @__PURE__ */ React42.createElement(Box24, {
1689
+ css: styles.sectionTitle,
1690
+ ...headingProps
1691
+ }, section.rendered), /* @__PURE__ */ React42.createElement(Box24, {
1606
1692
  as: "ul",
1607
1693
  __baseCSS: { listStyle: "none", p: 0 },
1608
- css: styles.list
1609
- }, groupProps), [...section.childNodes].map((node) => /* @__PURE__ */ React40.createElement(ListBoxOption, {
1694
+ css: styles.list,
1695
+ ...groupProps
1696
+ }, [...section.childNodes].map((node) => /* @__PURE__ */ React42.createElement(ListBoxOption, {
1610
1697
  key: node.key,
1611
1698
  item: node,
1612
1699
  state
@@ -1614,30 +1701,38 @@ var ListBoxSection = ({ section, state }) => {
1614
1701
  };
1615
1702
 
1616
1703
  // src/ListBox/ListBox.tsx
1617
- var ListBox = forwardRef8((_a, ref) => {
1618
- var _b = _a, { state, variant, size } = _b, props = __objRest(_b, ["state", "variant", "size"]);
1619
- const innerRef = useObjectRef5(ref);
1620
- const { listBoxProps } = useListBox(props, state, innerRef);
1621
- const styles = useComponentStyles23("ListBox", { variant, size }, { parts: ["container", "list", "option", "section", "sectionTitle"] });
1622
- return /* @__PURE__ */ React41.createElement(ListBoxContext.Provider, {
1623
- value: { styles }
1624
- }, /* @__PURE__ */ React41.createElement(Box23, {
1625
- css: styles.container
1626
- }, /* @__PURE__ */ React41.createElement(Box23, __spreadValues({
1627
- as: "ul",
1628
- ref: innerRef,
1629
- __baseCSS: { listStyle: "none", p: 0 },
1630
- css: styles.list
1631
- }, listBoxProps), [...state.collection].map((item) => item.type === "section" ? /* @__PURE__ */ React41.createElement(ListBoxSection, {
1632
- key: item.key,
1633
- section: item,
1634
- state
1635
- }) : /* @__PURE__ */ React41.createElement(ListBoxOption, {
1636
- key: item.key,
1637
- item,
1638
- state
1639
- })))));
1640
- });
1704
+ var ListBox = forwardRef9(
1705
+ ({ state, variant, size, ...props }, ref) => {
1706
+ const innerRef = useObjectRef7(ref);
1707
+ const { listBoxProps } = useListBox(props, state, innerRef);
1708
+ const styles = useComponentStyles24(
1709
+ "ListBox",
1710
+ { variant, size },
1711
+ { parts: ["container", "list", "option", "section", "sectionTitle"] }
1712
+ );
1713
+ return /* @__PURE__ */ React43.createElement(ListBoxContext.Provider, {
1714
+ value: { styles }
1715
+ }, /* @__PURE__ */ React43.createElement(Box25, {
1716
+ css: styles.container
1717
+ }, /* @__PURE__ */ React43.createElement(Box25, {
1718
+ as: "ul",
1719
+ ref: innerRef,
1720
+ __baseCSS: { listStyle: "none", p: 0 },
1721
+ css: styles.list,
1722
+ ...listBoxProps
1723
+ }, [...state.collection].map(
1724
+ (item) => item.type === "section" ? /* @__PURE__ */ React43.createElement(ListBoxSection, {
1725
+ key: item.key,
1726
+ section: item,
1727
+ state
1728
+ }) : /* @__PURE__ */ React43.createElement(ListBoxOption, {
1729
+ key: item.key,
1730
+ item,
1731
+ state
1732
+ })
1733
+ ))));
1734
+ }
1735
+ );
1641
1736
 
1642
1737
  // src/Select/intl.ts
1643
1738
  var messages = {
@@ -1650,7 +1745,7 @@ var messages = {
1650
1745
  };
1651
1746
 
1652
1747
  // src/Select/Select.tsx
1653
- var Chevron = ({ css }) => /* @__PURE__ */ React42.createElement(Box24, {
1748
+ var Chevron = ({ css }) => /* @__PURE__ */ React44.createElement(Box26, {
1654
1749
  as: "svg",
1655
1750
  __baseCSS: { width: 16, height: 16 },
1656
1751
  css,
@@ -1658,117 +1753,131 @@ var Chevron = ({ css }) => /* @__PURE__ */ React42.createElement(Box24, {
1658
1753
  viewBox: "0 0 24 24",
1659
1754
  stroke: "currentColor",
1660
1755
  strokeWidth: 2
1661
- }, /* @__PURE__ */ React42.createElement("path", {
1756
+ }, /* @__PURE__ */ React44.createElement("path", {
1662
1757
  strokeLinecap: "round",
1663
1758
  strokeLinejoin: "round",
1664
1759
  d: "M19 9l-7 7-7-7"
1665
1760
  }));
1666
- var Select = forwardRef9((_a, ref) => {
1667
- var _b = _a, { variant, size, width, open, disabled, required, error } = _b, rest = __objRest(_b, ["variant", "size", "width", "open", "disabled", "required", "error"]);
1668
- const formatMessage = useMessageFormatter(messages);
1669
- const buttonRef = useObjectRef6(ref);
1670
- const props = __spreadValues({
1671
- isOpen: open,
1672
- isDisabled: disabled,
1673
- isRequired: required,
1674
- validationState: error ? "invalid" : "valid",
1675
- placeholder: rest.placeholder || formatMessage("placeholder")
1676
- }, rest);
1677
- const state = useSelectState(props);
1678
- const {
1679
- labelProps,
1680
- triggerProps,
1681
- valueProps,
1682
- menuProps,
1683
- descriptionProps,
1684
- errorMessageProps
1685
- } = useSelect(props, state, buttonRef);
1686
- const { buttonProps } = useButton4(__spreadValues({ isDisabled: disabled }, triggerProps), buttonRef);
1687
- const { focusProps, isFocusVisible } = useFocusRing6();
1688
- const overlayRef = useRef11(null);
1689
- const { overlayProps: positionProps } = useOverlayPosition2({
1690
- targetRef: buttonRef,
1691
- overlayRef,
1692
- isOpen: state.isOpen,
1693
- placement: "bottom left"
1694
- });
1695
- const styles = useComponentStyles24("Select", { variant, size }, { parts: ["container", "button", "icon"] });
1696
- const stateProps = useStateProps8({
1697
- disabled,
1698
- error,
1699
- focusVisible: isFocusVisible,
1700
- expanded: state.isOpen
1701
- });
1702
- return /* @__PURE__ */ React42.createElement(FieldBase, {
1703
- variant,
1704
- size,
1705
- width,
1706
- label: props.label,
1707
- labelProps: __spreadValues({ as: "span" }, labelProps),
1708
- description: props.description,
1709
- descriptionProps,
1710
- error,
1711
- errorMessage: props.errorMessage,
1712
- errorMessageProps,
1713
- stateProps,
1714
- disabled,
1715
- required
1716
- }, /* @__PURE__ */ React42.createElement(HiddenSelect, {
1717
- state,
1718
- triggerRef: buttonRef,
1719
- label: props.label,
1720
- name: props.name,
1721
- isDisabled: disabled
1722
- }), /* @__PURE__ */ React42.createElement(Box24, __spreadValues(__spreadValues({
1723
- as: "button",
1724
- __baseCSS: {
1725
- display: "flex",
1726
- position: "relative",
1727
- alignItems: "center",
1728
- justifyContent: "space-between",
1729
- width: "100%"
1730
- },
1731
- css: styles.button,
1732
- ref: buttonRef
1733
- }, mergeProps7(buttonProps, focusProps)), stateProps), /* @__PURE__ */ React42.createElement(Box24, __spreadValues({
1734
- css: {
1735
- overflow: "hidden",
1736
- whiteSpace: "nowrap"
1737
- }
1738
- }, valueProps), state.selectedItem ? state.selectedItem.rendered : props.placeholder), /* @__PURE__ */ React42.createElement(Chevron, {
1739
- css: styles.icon
1740
- })), /* @__PURE__ */ React42.createElement(Popover, __spreadValues({
1741
- open: state.isOpen,
1742
- onClose: state.close,
1743
- dismissable: true,
1744
- shouldCloseOnBlur: true,
1745
- minWidth: buttonRef.current ? buttonRef.current.offsetWidth : void 0,
1746
- ref: overlayRef
1747
- }, positionProps), /* @__PURE__ */ React42.createElement(FocusScope3, {
1748
- restoreFocus: true
1749
- }, /* @__PURE__ */ React42.createElement(DismissButton2, {
1750
- onDismiss: state.close
1751
- }), /* @__PURE__ */ React42.createElement(ListBox, __spreadValues({
1752
- state,
1753
- variant,
1754
- size
1755
- }, menuProps)), /* @__PURE__ */ React42.createElement(DismissButton2, {
1756
- onDismiss: state.close
1757
- }))));
1758
- });
1761
+ var Select = forwardRef10(
1762
+ ({ variant, size, width, open, disabled, required, error, ...rest }, ref) => {
1763
+ const formatMessage = useMessageFormatter(messages);
1764
+ const buttonRef = useObjectRef8(ref);
1765
+ const props = {
1766
+ isOpen: open,
1767
+ isDisabled: disabled,
1768
+ isRequired: required,
1769
+ validationState: error ? "invalid" : "valid",
1770
+ placeholder: rest.placeholder || formatMessage("placeholder"),
1771
+ ...rest
1772
+ };
1773
+ const state = useSelectState(props);
1774
+ const {
1775
+ labelProps,
1776
+ triggerProps,
1777
+ valueProps,
1778
+ menuProps,
1779
+ descriptionProps,
1780
+ errorMessageProps
1781
+ } = useSelect(props, state, buttonRef);
1782
+ const { buttonProps } = useButton4(
1783
+ { isDisabled: disabled, ...triggerProps },
1784
+ buttonRef
1785
+ );
1786
+ const { focusProps, isFocusVisible } = useFocusRing6();
1787
+ const overlayRef = useRef9(null);
1788
+ const { overlayProps: positionProps } = useOverlayPosition2({
1789
+ targetRef: buttonRef,
1790
+ overlayRef,
1791
+ isOpen: state.isOpen,
1792
+ placement: "bottom left"
1793
+ });
1794
+ const styles = useComponentStyles25(
1795
+ "Select",
1796
+ { variant, size },
1797
+ { parts: ["container", "button", "icon"] }
1798
+ );
1799
+ const stateProps = useStateProps8({
1800
+ disabled,
1801
+ error,
1802
+ focusVisible: isFocusVisible,
1803
+ expanded: state.isOpen
1804
+ });
1805
+ return /* @__PURE__ */ React44.createElement(FieldBase, {
1806
+ variant,
1807
+ size,
1808
+ width,
1809
+ label: props.label,
1810
+ labelProps: { as: "span", ...labelProps },
1811
+ description: props.description,
1812
+ descriptionProps,
1813
+ error,
1814
+ errorMessage: props.errorMessage,
1815
+ errorMessageProps,
1816
+ stateProps,
1817
+ disabled,
1818
+ required
1819
+ }, /* @__PURE__ */ React44.createElement(HiddenSelect, {
1820
+ state,
1821
+ triggerRef: buttonRef,
1822
+ label: props.label,
1823
+ name: props.name,
1824
+ isDisabled: disabled
1825
+ }), /* @__PURE__ */ React44.createElement(Box26, {
1826
+ as: "button",
1827
+ __baseCSS: {
1828
+ display: "flex",
1829
+ position: "relative",
1830
+ alignItems: "center",
1831
+ justifyContent: "space-between",
1832
+ width: "100%"
1833
+ },
1834
+ css: styles.button,
1835
+ ref: buttonRef,
1836
+ ...mergeProps7(buttonProps, focusProps),
1837
+ ...stateProps
1838
+ }, /* @__PURE__ */ React44.createElement(Box26, {
1839
+ css: {
1840
+ overflow: "hidden",
1841
+ whiteSpace: "nowrap"
1842
+ },
1843
+ ...valueProps
1844
+ }, state.selectedItem ? state.selectedItem.rendered : props.placeholder), /* @__PURE__ */ React44.createElement(Chevron, {
1845
+ css: styles.icon
1846
+ })), /* @__PURE__ */ React44.createElement(Popover, {
1847
+ open: state.isOpen,
1848
+ onClose: state.close,
1849
+ dismissable: true,
1850
+ shouldCloseOnBlur: true,
1851
+ minWidth: buttonRef.current ? buttonRef.current.offsetWidth : void 0,
1852
+ ref: overlayRef,
1853
+ ...positionProps
1854
+ }, /* @__PURE__ */ React44.createElement(FocusScope3, {
1855
+ restoreFocus: true
1856
+ }, /* @__PURE__ */ React44.createElement(DismissButton2, {
1857
+ onDismiss: state.close
1858
+ }), /* @__PURE__ */ React44.createElement(ListBox, {
1859
+ state,
1860
+ variant,
1861
+ size,
1862
+ ...menuProps
1863
+ }), /* @__PURE__ */ React44.createElement(DismissButton2, {
1864
+ onDismiss: state.close
1865
+ }))));
1866
+ }
1867
+ );
1759
1868
  Select.Option = Item2;
1760
1869
  Select.Section = Section;
1761
1870
 
1762
1871
  // src/Slider/Slider.tsx
1763
- import React44, { forwardRef as forwardRef10 } from "react";
1872
+ import React46, { forwardRef as forwardRef11 } from "react";
1764
1873
  import { useSlider } from "@react-aria/slider";
1765
1874
  import { useSliderState } from "@react-stately/slider";
1766
1875
  import { useNumberFormatter } from "@react-aria/i18n";
1767
- import { useObjectRef as useObjectRef7 } from "@react-aria/utils";
1768
- import { useComponentStyles as useComponentStyles25 } from "@marigold/system";
1876
+ import { useObjectRef as useObjectRef9 } from "@react-aria/utils";
1877
+ import { useComponentStyles as useComponentStyles26 } from "@marigold/system";
1769
1878
 
1770
1879
  // src/Slider/Thumb.tsx
1771
- import React43, { useEffect } from "react";
1880
+ import React45, { useEffect } from "react";
1772
1881
  import { useSliderThumb } from "@react-aria/slider";
1773
1882
  import { mergeProps as mergeProps8 } from "@react-aria/utils";
1774
1883
  import { useStateProps as useStateProps9 } from "@marigold/system";
@@ -1778,97 +1887,113 @@ import { VisuallyHidden } from "@react-aria/visually-hidden";
1778
1887
 
1779
1888
  // src/Slider/Thumb.tsx
1780
1889
  import { useFocusRing as useFocusRing7 } from "@react-aria/focus";
1781
- var Thumb = (_a) => {
1782
- var _b = _a, { state, trackRef, styles } = _b, props = __objRest(_b, ["state", "trackRef", "styles"]);
1890
+ var Thumb = ({ state, trackRef, styles, ...props }) => {
1783
1891
  const { disabled } = props;
1784
- const inputRef = React43.useRef(null);
1892
+ const inputRef = React45.useRef(null);
1785
1893
  const { isFocusVisible, focusProps, isFocused } = useFocusRing7();
1786
1894
  const focused = isFocused || isFocusVisible || state.isThumbDragging(0);
1787
1895
  const stateProps = useStateProps9({
1788
1896
  focus: focused,
1789
1897
  disabled
1790
1898
  });
1791
- const { thumbProps, inputProps } = useSliderThumb({
1792
- index: 0,
1793
- trackRef,
1794
- inputRef,
1795
- isDisabled: disabled
1796
- }, state);
1899
+ const { thumbProps, inputProps } = useSliderThumb(
1900
+ {
1901
+ index: 0,
1902
+ trackRef,
1903
+ inputRef,
1904
+ isDisabled: disabled
1905
+ },
1906
+ state
1907
+ );
1797
1908
  useEffect(() => {
1798
1909
  state.setThumbEditable(0, !disabled);
1799
1910
  }, [disabled, state]);
1800
- return /* @__PURE__ */ React43.createElement(Box, {
1801
- __baseCSS: {
1802
- position: "absolute",
1803
- top: 16,
1804
- transform: "translateX(-50%)",
1805
- left: `${state.getThumbPercent(0) * 100}%`
1806
- }
1807
- }, /* @__PURE__ */ React43.createElement(Box, __spreadValues(__spreadProps(__spreadValues({}, thumbProps), {
1808
- __baseCSS: styles
1809
- }), stateProps), /* @__PURE__ */ React43.createElement(VisuallyHidden, null, /* @__PURE__ */ React43.createElement(Box, __spreadValues({
1911
+ return /* @__PURE__ */ React45.createElement(Box, {
1912
+ __baseCSS: { top: "50%" },
1913
+ css: styles,
1914
+ ...thumbProps,
1915
+ ...stateProps
1916
+ }, /* @__PURE__ */ React45.createElement(VisuallyHidden, null, /* @__PURE__ */ React45.createElement(Box, {
1810
1917
  as: "input",
1811
1918
  type: "range",
1812
- ref: inputRef
1813
- }, mergeProps8(inputProps, focusProps))))));
1919
+ ref: inputRef,
1920
+ ...mergeProps8(inputProps, focusProps)
1921
+ })));
1814
1922
  };
1815
1923
 
1816
1924
  // src/Slider/Slider.tsx
1817
- var Slider = forwardRef10((_a, ref) => {
1818
- var _b = _a, { variant, size, width = "100%" } = _b, props = __objRest(_b, ["variant", "size", "width"]);
1819
- const { formatOptions } = props;
1820
- const trackRef = useObjectRef7(ref);
1821
- const numberFormatter = useNumberFormatter(formatOptions);
1822
- const state = useSliderState(__spreadProps(__spreadValues({}, props), { numberFormatter }));
1823
- const { groupProps, trackProps, labelProps, outputProps } = useSlider(__spreadValues({
1824
- label: props.children
1825
- }, props), state, trackRef);
1826
- const styles = useComponentStyles25("Slider", { variant, size }, { parts: ["track", "thumb", "label", "output"] });
1827
- return /* @__PURE__ */ React44.createElement(Box, __spreadValues({
1828
- __baseCSS: {
1829
- display: "flex",
1830
- flexDirection: "column",
1831
- touchAction: "none",
1832
- width
1833
- }
1834
- }, groupProps), /* @__PURE__ */ React44.createElement(Box, {
1835
- __baseCSS: { display: "flex", alignSelf: "stretch" }
1836
- }, props.children && /* @__PURE__ */ React44.createElement(Box, __spreadValues({
1837
- as: "label",
1838
- __baseCSS: styles.label
1839
- }, labelProps), props.children), /* @__PURE__ */ React44.createElement(Box, __spreadProps(__spreadValues({
1840
- as: "output"
1841
- }, outputProps), {
1842
- __baseCSS: { flex: "1 0 auto", textAlign: "end" },
1843
- css: styles.output
1844
- }), state.getThumbValueLabel(0))), /* @__PURE__ */ React44.createElement(Box, __spreadProps(__spreadValues({}, trackProps), {
1845
- ref: trackRef,
1846
- __baseCSS: {
1847
- position: "relative",
1848
- height: 32,
1849
- width: "100%",
1850
- cursor: props.disabled ? "not-allowed" : "pointer"
1851
- }
1852
- }), /* @__PURE__ */ React44.createElement(Box, {
1853
- __baseCSS: styles.track
1854
- }), /* @__PURE__ */ React44.createElement(Thumb, {
1855
- state,
1856
- trackRef,
1857
- disabled: props.disabled,
1858
- styles: styles.thumb
1859
- })));
1860
- });
1925
+ var Slider = forwardRef11(
1926
+ ({ variant, size, width = "100%", ...props }, ref) => {
1927
+ const { formatOptions } = props;
1928
+ const trackRef = useObjectRef9(ref);
1929
+ const numberFormatter = useNumberFormatter(formatOptions);
1930
+ const state = useSliderState({ ...props, numberFormatter });
1931
+ const { groupProps, trackProps, labelProps, outputProps } = useSlider(
1932
+ {
1933
+ label: props.children,
1934
+ ...props
1935
+ },
1936
+ state,
1937
+ trackRef
1938
+ );
1939
+ const styles = useComponentStyles26(
1940
+ "Slider",
1941
+ { variant, size },
1942
+ { parts: ["track", "thumb", "label", "output"] }
1943
+ );
1944
+ return /* @__PURE__ */ React46.createElement(Box, {
1945
+ __baseCSS: {
1946
+ display: "flex",
1947
+ flexDirection: "column",
1948
+ touchAction: "none",
1949
+ width
1950
+ },
1951
+ ...groupProps
1952
+ }, /* @__PURE__ */ React46.createElement(Box, {
1953
+ __baseCSS: { display: "flex", alignSelf: "stretch" }
1954
+ }, props.children && /* @__PURE__ */ React46.createElement(Box, {
1955
+ as: "label",
1956
+ __baseCSS: styles.label,
1957
+ ...labelProps
1958
+ }, props.children), /* @__PURE__ */ React46.createElement(Box, {
1959
+ as: "output",
1960
+ ...outputProps,
1961
+ __baseCSS: { flex: "1 0 auto", textAlign: "end" },
1962
+ css: styles.output
1963
+ }, state.getThumbValueLabel(0))), /* @__PURE__ */ React46.createElement(Box, {
1964
+ ...trackProps,
1965
+ ref: trackRef,
1966
+ __baseCSS: {
1967
+ height: 32,
1968
+ width: "100%",
1969
+ cursor: props.disabled ? "not-allowed" : "pointer"
1970
+ }
1971
+ }, /* @__PURE__ */ React46.createElement(Box, {
1972
+ __baseCSS: {
1973
+ top: "50%",
1974
+ transform: "translateY(-50%)"
1975
+ },
1976
+ css: styles.track
1977
+ }), /* @__PURE__ */ React46.createElement(Thumb, {
1978
+ state,
1979
+ trackRef,
1980
+ disabled: props.disabled,
1981
+ styles: styles.thumb
1982
+ })));
1983
+ }
1984
+ );
1861
1985
 
1862
1986
  // src/Split/Split.tsx
1863
- import React45 from "react";
1864
- import { Box as Box25 } from "@marigold/system";
1865
- var Split = (props) => /* @__PURE__ */ React45.createElement(Box25, __spreadProps(__spreadValues({}, props), {
1987
+ import React47 from "react";
1988
+ import { Box as Box27 } from "@marigold/system";
1989
+ var Split = (props) => /* @__PURE__ */ React47.createElement(Box27, {
1990
+ ...props,
1866
1991
  role: "separator",
1867
1992
  css: { flexGrow: 1 }
1868
- }));
1993
+ });
1869
1994
 
1870
1995
  // src/Stack/Stack.tsx
1871
- import React46 from "react";
1996
+ import React48 from "react";
1872
1997
  var ALIGNMENT_X2 = {
1873
1998
  left: "flex-start",
1874
1999
  center: "center",
@@ -1879,136 +2004,132 @@ var ALIGNMENT_Y2 = {
1879
2004
  center: "center",
1880
2005
  bottom: "flex-end"
1881
2006
  };
1882
- var Stack = (_a) => {
1883
- var _b = _a, {
1884
- children,
1885
- space = "none",
1886
- alignX = "left",
1887
- alignY = "top",
1888
- stretch = false
1889
- } = _b, props = __objRest(_b, [
1890
- "children",
1891
- "space",
1892
- "alignX",
1893
- "alignY",
1894
- "stretch"
1895
- ]);
1896
- return /* @__PURE__ */ React46.createElement(Box, __spreadValues({
1897
- css: {
1898
- display: "flex",
1899
- flexDirection: "column",
1900
- p: 0,
1901
- gap: space,
1902
- alignItems: ALIGNMENT_X2[alignX],
1903
- justifyContent: ALIGNMENT_Y2[alignY],
1904
- blockSize: stretch ? "100%" : "auto"
1905
- }
1906
- }, props), children);
1907
- };
2007
+ var Stack = ({
2008
+ children,
2009
+ space = "none",
2010
+ alignX = "left",
2011
+ alignY = "top",
2012
+ stretch = false,
2013
+ ...props
2014
+ }) => /* @__PURE__ */ React48.createElement(Box, {
2015
+ css: {
2016
+ display: "flex",
2017
+ flexDirection: "column",
2018
+ p: 0,
2019
+ gap: space,
2020
+ alignItems: ALIGNMENT_X2[alignX],
2021
+ justifyContent: ALIGNMENT_Y2[alignY],
2022
+ blockSize: stretch ? "100%" : "auto"
2023
+ },
2024
+ ...props
2025
+ }, children);
1908
2026
 
1909
2027
  // src/Switch/Switch.tsx
1910
- import React47, { forwardRef as forwardRef11 } from "react";
2028
+ import React49, { forwardRef as forwardRef12 } from "react";
1911
2029
  import { useFocusRing as useFocusRing8 } from "@react-aria/focus";
1912
2030
  import { useSwitch } from "@react-aria/switch";
1913
- import { useObjectRef as useObjectRef8 } from "@react-aria/utils";
2031
+ import { useObjectRef as useObjectRef10 } from "@react-aria/utils";
1914
2032
  import { useToggleState as useToggleState2 } from "@react-stately/toggle";
1915
2033
  import {
1916
- useComponentStyles as useComponentStyles26,
2034
+ useComponentStyles as useComponentStyles27,
1917
2035
  useStateProps as useStateProps10
1918
2036
  } from "@marigold/system";
1919
- var Switch = forwardRef11((_a, ref) => {
1920
- var _b = _a, {
2037
+ var Switch = forwardRef12(
2038
+ ({
1921
2039
  variant,
1922
2040
  size,
1923
2041
  width = "100%",
1924
2042
  checked,
1925
2043
  disabled,
1926
2044
  readOnly,
1927
- defaultChecked
1928
- } = _b, rest = __objRest(_b, [
1929
- "variant",
1930
- "size",
1931
- "width",
1932
- "checked",
1933
- "disabled",
1934
- "readOnly",
1935
- "defaultChecked"
1936
- ]);
1937
- const inputRef = useObjectRef8(ref);
1938
- const props = __spreadValues({
1939
- isSelected: checked,
1940
- isDisabled: disabled,
1941
- isReadOnly: readOnly,
1942
- defaultSelected: defaultChecked
1943
- }, rest);
1944
- const state = useToggleState2(props);
1945
- const { inputProps } = useSwitch(props, state, inputRef);
1946
- const { isFocusVisible, focusProps } = useFocusRing8();
1947
- const stateProps = useStateProps10({
1948
- checked: state.isSelected,
1949
- disabled,
1950
- readOnly,
1951
- focus: isFocusVisible
1952
- });
1953
- const styles = useComponentStyles26("Switch", { variant, size }, { parts: ["container", "label", "track", "thumb"] });
1954
- return /* @__PURE__ */ React47.createElement(Box, {
1955
- as: "label",
1956
- __baseCSS: {
1957
- display: "flex",
1958
- alignItems: "center",
1959
- justifyContent: "space-between",
1960
- gap: "1ch",
1961
- position: "relative",
1962
- width
1963
- },
1964
- css: styles.container
1965
- }, /* @__PURE__ */ React47.createElement(Box, __spreadValues(__spreadValues({
1966
- as: "input",
1967
- ref: inputRef,
1968
- css: {
1969
- position: "absolute",
1970
- width: "100%",
1971
- height: "100%",
1972
- top: 0,
1973
- left: 0,
1974
- zIndex: 1,
1975
- opacity: 1e-4,
1976
- cursor: inputProps.disabled ? "not-allowed" : "pointer"
1977
- }
1978
- }, inputProps), focusProps)), props.children && /* @__PURE__ */ React47.createElement(Box, {
1979
- css: styles.label
1980
- }, props.children), /* @__PURE__ */ React47.createElement(Box, __spreadValues({
1981
- __baseCSS: {
1982
- position: "relative",
1983
- width: 48,
1984
- height: 24,
1985
- bg: "#dee2e6",
1986
- borderRadius: 20
1987
- },
1988
- css: styles.track
1989
- }, stateProps), /* @__PURE__ */ React47.createElement(Box, __spreadValues({
1990
- __baseCSS: {
1991
- display: "block",
1992
- position: "absolute",
1993
- top: 1,
1994
- left: 0,
1995
- willChange: "transform",
1996
- transform: "translateX(1px)",
1997
- transition: "all 0.1s cubic-bezier(.7, 0, .3, 1)",
1998
- height: 22,
1999
- width: 22,
2000
- borderRadius: 9999,
2001
- bg: "#fff",
2002
- "&:checked": {
2003
- transform: "translateX(calc(47px - 100%))"
2004
- }
2005
- },
2006
- css: styles.thumb
2007
- }, stateProps))));
2008
- });
2045
+ defaultChecked,
2046
+ ...rest
2047
+ }, ref) => {
2048
+ const inputRef = useObjectRef10(ref);
2049
+ const props = {
2050
+ isSelected: checked,
2051
+ isDisabled: disabled,
2052
+ isReadOnly: readOnly,
2053
+ defaultSelected: defaultChecked,
2054
+ ...rest
2055
+ };
2056
+ const state = useToggleState2(props);
2057
+ const { inputProps } = useSwitch(props, state, inputRef);
2058
+ const { isFocusVisible, focusProps } = useFocusRing8();
2059
+ const stateProps = useStateProps10({
2060
+ checked: state.isSelected,
2061
+ disabled,
2062
+ readOnly,
2063
+ focus: isFocusVisible
2064
+ });
2065
+ const styles = useComponentStyles27(
2066
+ "Switch",
2067
+ { variant, size },
2068
+ { parts: ["container", "label", "track", "thumb"] }
2069
+ );
2070
+ return /* @__PURE__ */ React49.createElement(Box, {
2071
+ as: "label",
2072
+ __baseCSS: {
2073
+ display: "flex",
2074
+ alignItems: "center",
2075
+ justifyContent: "space-between",
2076
+ gap: "1ch",
2077
+ position: "relative",
2078
+ width
2079
+ },
2080
+ css: styles.container
2081
+ }, /* @__PURE__ */ React49.createElement(Box, {
2082
+ as: "input",
2083
+ ref: inputRef,
2084
+ css: {
2085
+ position: "absolute",
2086
+ width: "100%",
2087
+ height: "100%",
2088
+ top: 0,
2089
+ left: 0,
2090
+ zIndex: 1,
2091
+ opacity: 1e-4,
2092
+ cursor: inputProps.disabled ? "not-allowed" : "pointer"
2093
+ },
2094
+ ...inputProps,
2095
+ ...focusProps
2096
+ }), props.children && /* @__PURE__ */ React49.createElement(Box, {
2097
+ css: styles.label
2098
+ }, props.children), /* @__PURE__ */ React49.createElement(Box, {
2099
+ __baseCSS: {
2100
+ position: "relative",
2101
+ width: 48,
2102
+ height: 24,
2103
+ bg: "#dee2e6",
2104
+ borderRadius: 20
2105
+ },
2106
+ css: styles.track,
2107
+ ...stateProps
2108
+ }, /* @__PURE__ */ React49.createElement(Box, {
2109
+ __baseCSS: {
2110
+ display: "block",
2111
+ position: "absolute",
2112
+ top: 1,
2113
+ left: 0,
2114
+ willChange: "transform",
2115
+ transform: "translateX(1px)",
2116
+ transition: "all 0.1s cubic-bezier(.7, 0, .3, 1)",
2117
+ height: 22,
2118
+ width: 22,
2119
+ borderRadius: 9999,
2120
+ bg: "#fff",
2121
+ "&:checked": {
2122
+ transform: "translateX(calc(47px - 100%))"
2123
+ }
2124
+ },
2125
+ css: styles.thumb,
2126
+ ...stateProps
2127
+ })));
2128
+ }
2129
+ );
2009
2130
 
2010
2131
  // src/Table/Table.tsx
2011
- import React56, { useRef as useRef18 } from "react";
2132
+ import React58, { useRef as useRef16 } from "react";
2012
2133
  import { useTable } from "@react-aria/table";
2013
2134
  import {
2014
2135
  Cell,
@@ -2019,88 +2140,98 @@ import {
2019
2140
  useTableState
2020
2141
  } from "@react-stately/table";
2021
2142
  import {
2022
- Box as Box31,
2023
- useComponentStyles as useComponentStyles27
2143
+ Box as Box33,
2144
+ useComponentStyles as useComponentStyles28
2024
2145
  } from "@marigold/system";
2025
2146
 
2026
2147
  // src/Table/Context.tsx
2027
- import { createContext as createContext6, useContext as useContext6 } from "react";
2028
- var TableContext = createContext6({});
2029
- var useTableContext = () => useContext6(TableContext);
2148
+ import { createContext as createContext7, useContext as useContext7 } from "react";
2149
+ var TableContext = createContext7({});
2150
+ var useTableContext = () => useContext7(TableContext);
2030
2151
 
2031
2152
  // src/Table/TableBody.tsx
2032
- import React48 from "react";
2153
+ import React50 from "react";
2033
2154
  import { useTableRowGroup } from "@react-aria/table";
2034
2155
  var TableBody = ({ children }) => {
2035
2156
  const { rowGroupProps } = useTableRowGroup();
2036
- return /* @__PURE__ */ React48.createElement("tbody", __spreadValues({}, rowGroupProps), children);
2157
+ return /* @__PURE__ */ React50.createElement("tbody", {
2158
+ ...rowGroupProps
2159
+ }, children);
2037
2160
  };
2038
2161
 
2039
2162
  // src/Table/TableCell.tsx
2040
- import React49, { useRef as useRef12 } from "react";
2163
+ import React51, { useRef as useRef10 } from "react";
2041
2164
  import { useTableCell } from "@react-aria/table";
2042
2165
  import { useFocusRing as useFocusRing9 } from "@react-aria/focus";
2043
2166
  import { mergeProps as mergeProps9 } from "@react-aria/utils";
2044
- import { Box as Box26, useStateProps as useStateProps11 } from "@marigold/system";
2167
+ import { Box as Box28, useStateProps as useStateProps11 } from "@marigold/system";
2045
2168
  var TableCell = ({ cell }) => {
2046
- const ref = useRef12(null);
2169
+ const ref = useRef10(null);
2047
2170
  const { state, styles } = useTableContext();
2048
2171
  const disabled = state.disabledKeys.has(cell.parentKey);
2049
- const { gridCellProps } = useTableCell({
2050
- node: cell
2051
- }, state, ref);
2172
+ const { gridCellProps } = useTableCell(
2173
+ {
2174
+ node: cell
2175
+ },
2176
+ state,
2177
+ ref
2178
+ );
2052
2179
  const { focusProps, isFocusVisible } = useFocusRing9();
2053
2180
  const stateProps = useStateProps11({ disabled, focusVisible: isFocusVisible });
2054
- return /* @__PURE__ */ React49.createElement(Box26, __spreadValues(__spreadValues({
2181
+ return /* @__PURE__ */ React51.createElement(Box28, {
2055
2182
  as: "td",
2056
2183
  ref,
2057
- css: styles.cell
2058
- }, mergeProps9(gridCellProps, focusProps)), stateProps), cell.rendered);
2184
+ css: styles.cell,
2185
+ ...mergeProps9(gridCellProps, focusProps),
2186
+ ...stateProps
2187
+ }, cell.rendered);
2059
2188
  };
2060
2189
 
2061
2190
  // src/Table/TableCheckboxCell.tsx
2062
- import React50, { useRef as useRef13 } from "react";
2191
+ import React52, { useRef as useRef11 } from "react";
2063
2192
  import { useTableCell as useTableCell2, useTableSelectionCheckbox } from "@react-aria/table";
2064
2193
  import { useFocusRing as useFocusRing10 } from "@react-aria/focus";
2065
2194
  import { mergeProps as mergeProps10 } from "@react-aria/utils";
2066
- import { Box as Box27, useStateProps as useStateProps12 } from "@marigold/system";
2195
+ import { Box as Box29, useStateProps as useStateProps12 } from "@marigold/system";
2067
2196
 
2068
2197
  // src/Table/utils.ts
2069
- var mapCheckboxProps = (_a) => {
2070
- var {
2071
- checkboxProps: _b
2072
- } = _a, _c = _b, {
2198
+ var mapCheckboxProps = ({
2199
+ checkboxProps: {
2073
2200
  isIndeterminate,
2074
2201
  isSelected,
2075
2202
  isDisabled,
2076
- defaultSelected
2077
- } = _c, rest = __objRest(_c, [
2078
- "isIndeterminate",
2079
- "isSelected",
2080
- "isDisabled",
2081
- "defaultSelected"
2082
- ]);
2083
- const checkboxProps = __spreadValues({
2203
+ defaultSelected,
2204
+ ...rest
2205
+ }
2206
+ }) => {
2207
+ const checkboxProps = {
2084
2208
  disabled: isDisabled,
2085
2209
  checked: isSelected,
2086
2210
  defaultChecked: defaultSelected,
2087
- indeterminate: isIndeterminate
2088
- }, rest);
2211
+ indeterminate: isIndeterminate,
2212
+ ...rest
2213
+ };
2089
2214
  return { checkboxProps };
2090
2215
  };
2091
2216
 
2092
2217
  // src/Table/TableCheckboxCell.tsx
2093
2218
  var TableCheckboxCell = ({ cell }) => {
2094
- const ref = useRef13(null);
2219
+ const ref = useRef11(null);
2095
2220
  const { state, styles } = useTableContext();
2096
2221
  const disabled = state.disabledKeys.has(cell.parentKey);
2097
- const { gridCellProps } = useTableCell2({
2098
- node: cell
2099
- }, state, ref);
2100
- const { checkboxProps } = mapCheckboxProps(useTableSelectionCheckbox({ key: cell.parentKey }, state));
2222
+ const { gridCellProps } = useTableCell2(
2223
+ {
2224
+ node: cell
2225
+ },
2226
+ state,
2227
+ ref
2228
+ );
2229
+ const { checkboxProps } = mapCheckboxProps(
2230
+ useTableSelectionCheckbox({ key: cell.parentKey }, state)
2231
+ );
2101
2232
  const { focusProps, isFocusVisible } = useFocusRing10();
2102
2233
  const stateProps = useStateProps12({ disabled, focusVisible: isFocusVisible });
2103
- return /* @__PURE__ */ React50.createElement(Box27, __spreadValues(__spreadValues({
2234
+ return /* @__PURE__ */ React52.createElement(Box29, {
2104
2235
  as: "td",
2105
2236
  ref,
2106
2237
  __baseCSS: {
@@ -2108,21 +2239,25 @@ var TableCheckboxCell = ({ cell }) => {
2108
2239
  verticalAlign: "middle",
2109
2240
  lineHeight: 1
2110
2241
  },
2111
- css: styles.cell
2112
- }, mergeProps10(gridCellProps, focusProps)), stateProps), /* @__PURE__ */ React50.createElement(Checkbox, __spreadValues({}, checkboxProps)));
2242
+ css: styles.cell,
2243
+ ...mergeProps10(gridCellProps, focusProps),
2244
+ ...stateProps
2245
+ }, /* @__PURE__ */ React52.createElement(Checkbox, {
2246
+ ...checkboxProps
2247
+ }));
2113
2248
  };
2114
2249
 
2115
2250
  // src/Table/TableColumnHeader.tsx
2116
- import React51, { useRef as useRef14 } from "react";
2251
+ import React53, { useRef as useRef12 } from "react";
2117
2252
  import { useFocusRing as useFocusRing11 } from "@react-aria/focus";
2118
- import { useHover as useHover5 } from "@react-aria/interactions";
2253
+ import { useHover as useHover6 } from "@react-aria/interactions";
2119
2254
  import { useTableColumnHeader } from "@react-aria/table";
2120
2255
  import { mergeProps as mergeProps11 } from "@react-aria/utils";
2121
- import { Box as Box28, useStateProps as useStateProps13 } from "@marigold/system";
2256
+ import { Box as Box30, useStateProps as useStateProps13 } from "@marigold/system";
2122
2257
  var SortIndicator = ({
2123
2258
  direction = "ascending",
2124
2259
  visible
2125
- }) => /* @__PURE__ */ React51.createElement(Box28, {
2260
+ }) => /* @__PURE__ */ React53.createElement(Box30, {
2126
2261
  as: "span",
2127
2262
  role: "presentation",
2128
2263
  "aria-hidden": "true",
@@ -2134,65 +2269,78 @@ var SortIndicator = ({
2134
2269
  }, direction === "ascending" ? "\u25B2" : "\u25BC");
2135
2270
  var TableColumnHeader = ({ column }) => {
2136
2271
  var _a, _b;
2137
- const ref = useRef14(null);
2272
+ const ref = useRef12(null);
2138
2273
  const { state, styles } = useTableContext();
2139
- const { columnHeaderProps } = useTableColumnHeader({
2140
- node: column
2141
- }, state, ref);
2142
- const { hoverProps, isHovered } = useHover5({});
2274
+ const { columnHeaderProps } = useTableColumnHeader(
2275
+ {
2276
+ node: column
2277
+ },
2278
+ state,
2279
+ ref
2280
+ );
2281
+ const { hoverProps, isHovered } = useHover6({});
2143
2282
  const { focusProps, isFocusVisible } = useFocusRing11();
2144
2283
  const stateProps = useStateProps13({
2145
2284
  hover: isHovered,
2146
2285
  focusVisible: isFocusVisible
2147
2286
  });
2148
- return /* @__PURE__ */ React51.createElement(Box28, __spreadValues(__spreadValues({
2287
+ return /* @__PURE__ */ React53.createElement(Box30, {
2149
2288
  as: "th",
2150
2289
  colSpan: column.colspan,
2151
2290
  ref,
2152
- css: styles.header
2153
- }, mergeProps11(columnHeaderProps, hoverProps, focusProps)), stateProps), column.rendered, column.props.allowsSorting && /* @__PURE__ */ React51.createElement(SortIndicator, {
2291
+ css: styles.header,
2292
+ ...mergeProps11(columnHeaderProps, hoverProps, focusProps),
2293
+ ...stateProps
2294
+ }, column.rendered, column.props.allowsSorting && /* @__PURE__ */ React53.createElement(SortIndicator, {
2154
2295
  direction: (_a = state.sortDescriptor) == null ? void 0 : _a.direction,
2155
2296
  visible: ((_b = state.sortDescriptor) == null ? void 0 : _b.column) === column.key
2156
2297
  }));
2157
2298
  };
2158
2299
 
2159
2300
  // src/Table/TableHeader.tsx
2160
- import React52 from "react";
2301
+ import React54 from "react";
2161
2302
  import { useTableRowGroup as useTableRowGroup2 } from "@react-aria/table";
2162
2303
  var TableHeader = ({ children }) => {
2163
2304
  const { rowGroupProps } = useTableRowGroup2();
2164
- return /* @__PURE__ */ React52.createElement("thead", __spreadValues({}, rowGroupProps), children);
2305
+ return /* @__PURE__ */ React54.createElement("thead", {
2306
+ ...rowGroupProps
2307
+ }, children);
2165
2308
  };
2166
2309
 
2167
2310
  // src/Table/TableHeaderRow.tsx
2168
- import React53, { useRef as useRef15 } from "react";
2311
+ import React55, { useRef as useRef13 } from "react";
2169
2312
  import { useTableHeaderRow } from "@react-aria/table";
2170
2313
  var TableHeaderRow = ({ item, children }) => {
2171
2314
  const { state } = useTableContext();
2172
- const ref = useRef15(null);
2315
+ const ref = useRef13(null);
2173
2316
  const { rowProps } = useTableHeaderRow({ node: item }, state, ref);
2174
- return /* @__PURE__ */ React53.createElement("tr", __spreadProps(__spreadValues({}, rowProps), {
2317
+ return /* @__PURE__ */ React55.createElement("tr", {
2318
+ ...rowProps,
2175
2319
  ref
2176
- }), children);
2320
+ }, children);
2177
2321
  };
2178
2322
 
2179
2323
  // src/Table/TableRow.tsx
2180
- import React54, { useRef as useRef16 } from "react";
2324
+ import React56, { useRef as useRef14 } from "react";
2181
2325
  import { useFocusRing as useFocusRing12 } from "@react-aria/focus";
2182
- import { useHover as useHover6 } from "@react-aria/interactions";
2326
+ import { useHover as useHover7 } from "@react-aria/interactions";
2183
2327
  import { useTableRow } from "@react-aria/table";
2184
2328
  import { mergeProps as mergeProps12 } from "@react-aria/utils";
2185
- import { Box as Box29, useStateProps as useStateProps14 } from "@marigold/system";
2329
+ import { Box as Box31, useStateProps as useStateProps14 } from "@marigold/system";
2186
2330
  var TableRow = ({ children, row }) => {
2187
- const ref = useRef16(null);
2331
+ const ref = useRef14(null);
2188
2332
  const { state, styles } = useTableContext();
2189
- const { rowProps, isPressed } = useTableRow({
2190
- node: row
2191
- }, state, ref);
2333
+ const { rowProps, isPressed } = useTableRow(
2334
+ {
2335
+ node: row
2336
+ },
2337
+ state,
2338
+ ref
2339
+ );
2192
2340
  const disabled = state.disabledKeys.has(row.key);
2193
2341
  const selected = state.selectionManager.isSelected(row.key);
2194
2342
  const { focusProps, isFocusVisible } = useFocusRing12({ within: true });
2195
- const { hoverProps, isHovered } = useHover6({ isDisabled: disabled });
2343
+ const { hoverProps, isHovered } = useHover7({ isDisabled: disabled });
2196
2344
  const stateProps = useStateProps14({
2197
2345
  disabled,
2198
2346
  selected,
@@ -2200,37 +2348,43 @@ var TableRow = ({ children, row }) => {
2200
2348
  focusVisible: isFocusVisible,
2201
2349
  active: isPressed
2202
2350
  });
2203
- return /* @__PURE__ */ React54.createElement(Box29, __spreadValues(__spreadValues({
2351
+ return /* @__PURE__ */ React56.createElement(Box31, {
2204
2352
  as: "tr",
2205
2353
  ref,
2206
- css: styles.row
2207
- }, mergeProps12(rowProps, focusProps, hoverProps)), stateProps), children);
2354
+ css: styles.row,
2355
+ ...mergeProps12(rowProps, focusProps, hoverProps),
2356
+ ...stateProps
2357
+ }, children);
2208
2358
  };
2209
2359
 
2210
2360
  // src/Table/TableSelectAllCell.tsx
2211
- import React55, { useRef as useRef17 } from "react";
2361
+ import React57, { useRef as useRef15 } from "react";
2212
2362
  import { useFocusRing as useFocusRing13 } from "@react-aria/focus";
2213
- import { useHover as useHover7 } from "@react-aria/interactions";
2363
+ import { useHover as useHover8 } from "@react-aria/interactions";
2214
2364
  import {
2215
2365
  useTableColumnHeader as useTableColumnHeader2,
2216
2366
  useTableSelectAllCheckbox
2217
2367
  } from "@react-aria/table";
2218
2368
  import { mergeProps as mergeProps13 } from "@react-aria/utils";
2219
- import { Box as Box30, useStateProps as useStateProps15 } from "@marigold/system";
2369
+ import { Box as Box32, useStateProps as useStateProps15 } from "@marigold/system";
2220
2370
  var TableSelectAllCell = ({ column }) => {
2221
- const ref = useRef17(null);
2371
+ const ref = useRef15(null);
2222
2372
  const { state, styles } = useTableContext();
2223
- const { columnHeaderProps } = useTableColumnHeader2({
2224
- node: column
2225
- }, state, ref);
2373
+ const { columnHeaderProps } = useTableColumnHeader2(
2374
+ {
2375
+ node: column
2376
+ },
2377
+ state,
2378
+ ref
2379
+ );
2226
2380
  const { checkboxProps } = mapCheckboxProps(useTableSelectAllCheckbox(state));
2227
- const { hoverProps, isHovered } = useHover7({});
2381
+ const { hoverProps, isHovered } = useHover8({});
2228
2382
  const { focusProps, isFocusVisible } = useFocusRing13();
2229
2383
  const stateProps = useStateProps15({
2230
2384
  hover: isHovered,
2231
2385
  focusVisible: isFocusVisible
2232
2386
  });
2233
- return /* @__PURE__ */ React55.createElement(Box30, __spreadValues(__spreadValues({
2387
+ return /* @__PURE__ */ React57.createElement(Box32, {
2234
2388
  as: "th",
2235
2389
  ref,
2236
2390
  __baseCSS: {
@@ -2238,63 +2392,73 @@ var TableSelectAllCell = ({ column }) => {
2238
2392
  verticalAlign: "middle",
2239
2393
  lineHeight: 1
2240
2394
  },
2241
- css: styles.header
2242
- }, mergeProps13(columnHeaderProps, hoverProps, focusProps)), stateProps), /* @__PURE__ */ React55.createElement(Checkbox, __spreadValues({}, checkboxProps)));
2395
+ css: styles.header,
2396
+ ...mergeProps13(columnHeaderProps, hoverProps, focusProps),
2397
+ ...stateProps
2398
+ }, /* @__PURE__ */ React57.createElement(Checkbox, {
2399
+ ...checkboxProps
2400
+ }));
2243
2401
  };
2244
2402
 
2245
2403
  // src/Table/Table.tsx
2246
- var Table = (_a) => {
2247
- var _b = _a, {
2248
- variant,
2249
- size,
2250
- stretch
2251
- } = _b, props = __objRest(_b, [
2252
- "variant",
2253
- "size",
2254
- "stretch"
2255
- ]);
2256
- const tableRef = useRef18(null);
2257
- const state = useTableState(__spreadProps(__spreadValues({}, props), {
2404
+ var Table = ({
2405
+ variant,
2406
+ size,
2407
+ stretch,
2408
+ ...props
2409
+ }) => {
2410
+ const tableRef = useRef16(null);
2411
+ const state = useTableState({
2412
+ ...props,
2258
2413
  showSelectionCheckboxes: props.selectionMode === "multiple" && props.selectionBehavior !== "replace"
2259
- }));
2414
+ });
2260
2415
  const { gridProps } = useTable(props, state, tableRef);
2261
- const styles = useComponentStyles27("Table", { variant, size }, { parts: ["table", "header", "row", "cell"] });
2416
+ const styles = useComponentStyles28(
2417
+ "Table",
2418
+ { variant, size },
2419
+ { parts: ["table", "header", "row", "cell"] }
2420
+ );
2262
2421
  const { collection } = state;
2263
- return /* @__PURE__ */ React56.createElement(TableContext.Provider, {
2422
+ return /* @__PURE__ */ React58.createElement(TableContext.Provider, {
2264
2423
  value: { state, styles }
2265
- }, /* @__PURE__ */ React56.createElement(Box31, __spreadValues({
2424
+ }, /* @__PURE__ */ React58.createElement(Box33, {
2266
2425
  as: "table",
2267
2426
  ref: tableRef,
2268
2427
  __baseCSS: {
2269
2428
  borderCollapse: "collapse",
2270
2429
  width: stretch ? "100%" : void 0
2271
2430
  },
2272
- css: styles.table
2273
- }, gridProps), /* @__PURE__ */ React56.createElement(TableHeader, null, collection.headerRows.map((headerRow) => /* @__PURE__ */ React56.createElement(TableHeaderRow, {
2431
+ css: styles.table,
2432
+ ...gridProps
2433
+ }, /* @__PURE__ */ React58.createElement(TableHeader, null, collection.headerRows.map((headerRow) => /* @__PURE__ */ React58.createElement(TableHeaderRow, {
2274
2434
  key: headerRow.key,
2275
2435
  item: headerRow
2276
- }, [...headerRow.childNodes].map((column) => {
2277
- var _a2;
2278
- return ((_a2 = column.props) == null ? void 0 : _a2.isSelectionCell) ? /* @__PURE__ */ React56.createElement(TableSelectAllCell, {
2279
- key: column.key,
2280
- column
2281
- }) : /* @__PURE__ */ React56.createElement(TableColumnHeader, {
2282
- key: column.key,
2283
- column
2284
- });
2285
- })))), /* @__PURE__ */ React56.createElement(TableBody, null, [...collection.body.childNodes].map((row) => /* @__PURE__ */ React56.createElement(TableRow, {
2436
+ }, [...headerRow.childNodes].map(
2437
+ (column) => {
2438
+ var _a;
2439
+ return ((_a = column.props) == null ? void 0 : _a.isSelectionCell) ? /* @__PURE__ */ React58.createElement(TableSelectAllCell, {
2440
+ key: column.key,
2441
+ column
2442
+ }) : /* @__PURE__ */ React58.createElement(TableColumnHeader, {
2443
+ key: column.key,
2444
+ column
2445
+ });
2446
+ }
2447
+ )))), /* @__PURE__ */ React58.createElement(TableBody, null, [...collection.body.childNodes].map((row) => /* @__PURE__ */ React58.createElement(TableRow, {
2286
2448
  key: row.key,
2287
2449
  row
2288
- }, [...row.childNodes].map((cell) => {
2289
- var _a2;
2290
- return ((_a2 = cell.props) == null ? void 0 : _a2.isSelectionCell) ? /* @__PURE__ */ React56.createElement(TableCheckboxCell, {
2291
- key: cell.key,
2292
- cell
2293
- }) : /* @__PURE__ */ React56.createElement(TableCell, {
2294
- key: cell.key,
2295
- cell
2296
- });
2297
- }))))));
2450
+ }, [...row.childNodes].map(
2451
+ (cell) => {
2452
+ var _a;
2453
+ return ((_a = cell.props) == null ? void 0 : _a.isSelectionCell) ? /* @__PURE__ */ React58.createElement(TableCheckboxCell, {
2454
+ key: cell.key,
2455
+ cell
2456
+ }) : /* @__PURE__ */ React58.createElement(TableCell, {
2457
+ key: cell.key,
2458
+ cell
2459
+ });
2460
+ }
2461
+ ))))));
2298
2462
  };
2299
2463
  Table.Body = Body;
2300
2464
  Table.Cell = Cell;
@@ -2303,55 +2467,46 @@ Table.Header = Header2;
2303
2467
  Table.Row = Row;
2304
2468
 
2305
2469
  // src/Text/Text.tsx
2306
- import React57 from "react";
2470
+ import React59 from "react";
2307
2471
  import {
2308
- useComponentStyles as useComponentStyles28
2472
+ useComponentStyles as useComponentStyles29
2309
2473
  } from "@marigold/system";
2310
- import { Box as Box32 } from "@marigold/system";
2311
- var Text = (_a) => {
2312
- var _b = _a, {
2313
- variant,
2314
- size,
2315
- align,
2316
- color,
2317
- fontSize,
2318
- cursor,
2319
- outline,
2320
- children
2321
- } = _b, props = __objRest(_b, [
2322
- "variant",
2323
- "size",
2324
- "align",
2325
- "color",
2326
- "fontSize",
2327
- "cursor",
2328
- "outline",
2329
- "children"
2330
- ]);
2331
- const styles = useComponentStyles28("Text", {
2474
+ import { Box as Box34 } from "@marigold/system";
2475
+ var Text = ({
2476
+ variant,
2477
+ size,
2478
+ align,
2479
+ color,
2480
+ fontSize,
2481
+ cursor,
2482
+ outline,
2483
+ children,
2484
+ ...props
2485
+ }) => {
2486
+ const styles = useComponentStyles29("Text", {
2332
2487
  variant,
2333
2488
  size
2334
2489
  });
2335
- return /* @__PURE__ */ React57.createElement(Box32, __spreadProps(__spreadValues({
2336
- as: "p"
2337
- }, props), {
2338
- css: __spreadValues({ color, cursor, outline, fontSize, textAlign: align }, styles)
2339
- }), children);
2490
+ return /* @__PURE__ */ React59.createElement(Box34, {
2491
+ as: "p",
2492
+ ...props,
2493
+ css: { color, cursor, outline, fontSize, textAlign: align, ...styles }
2494
+ }, children);
2340
2495
  };
2341
2496
 
2342
2497
  // src/TextArea/TextArea.tsx
2343
- import React58, { forwardRef as forwardRef12 } from "react";
2344
- import { useHover as useHover8 } from "@react-aria/interactions";
2498
+ import React60, { forwardRef as forwardRef13 } from "react";
2499
+ import { useHover as useHover9 } from "@react-aria/interactions";
2345
2500
  import { useFocusRing as useFocusRing14 } from "@react-aria/focus";
2346
2501
  import { useTextField } from "@react-aria/textfield";
2347
- import { useObjectRef as useObjectRef9 } from "@react-aria/utils";
2502
+ import { useObjectRef as useObjectRef11 } from "@react-aria/utils";
2348
2503
  import {
2349
- Box as Box33,
2350
- useComponentStyles as useComponentStyles29,
2504
+ Box as Box35,
2505
+ useComponentStyles as useComponentStyles30,
2351
2506
  useStateProps as useStateProps16
2352
2507
  } from "@marigold/system";
2353
- var TextArea = forwardRef12((_a, ref) => {
2354
- var _b = _a, {
2508
+ var TextArea = forwardRef13(
2509
+ ({
2355
2510
  variant,
2356
2511
  size,
2357
2512
  width,
@@ -2359,164 +2514,173 @@ var TextArea = forwardRef12((_a, ref) => {
2359
2514
  required,
2360
2515
  readOnly,
2361
2516
  error,
2362
- rows
2363
- } = _b, props = __objRest(_b, [
2364
- "variant",
2365
- "size",
2366
- "width",
2367
- "disabled",
2368
- "required",
2369
- "readOnly",
2370
- "error",
2371
- "rows"
2372
- ]);
2373
- const { label, description, errorMessage } = props;
2374
- const textAreaRef = useObjectRef9(ref);
2375
- const { labelProps, inputProps, descriptionProps, errorMessageProps } = useTextField(__spreadValues({
2376
- inputElementType: "textarea",
2377
- isDisabled: disabled,
2378
- isRequired: required,
2379
- isReadOnly: readOnly,
2380
- validationState: error ? "invalid" : "valid"
2381
- }, props), textAreaRef);
2382
- const { hoverProps, isHovered } = useHover8({});
2383
- const { focusProps, isFocusVisible } = useFocusRing14();
2384
- const stateProps = useStateProps16({
2385
- hover: isHovered,
2386
- focus: isFocusVisible,
2387
- disabled,
2388
- readOnly,
2389
- error
2390
- });
2391
- const styles = useComponentStyles29("TextArea", { variant, size });
2392
- return /* @__PURE__ */ React58.createElement(FieldBase, {
2393
- label,
2394
- labelProps,
2395
- required,
2396
- description,
2397
- descriptionProps,
2398
- error,
2399
- errorMessage,
2400
- errorMessageProps,
2401
- stateProps,
2402
- variant,
2403
- size,
2404
- width
2405
- }, /* @__PURE__ */ React58.createElement(Box33, __spreadValues(__spreadValues(__spreadValues(__spreadValues({
2406
- as: "textarea",
2407
- css: styles,
2408
- ref: textAreaRef,
2409
- rows
2410
- }, inputProps), focusProps), hoverProps), stateProps)));
2411
- });
2517
+ rows,
2518
+ ...props
2519
+ }, ref) => {
2520
+ const { label, description, errorMessage } = props;
2521
+ const textAreaRef = useObjectRef11(ref);
2522
+ const { labelProps, inputProps, descriptionProps, errorMessageProps } = useTextField(
2523
+ {
2524
+ inputElementType: "textarea",
2525
+ isDisabled: disabled,
2526
+ isRequired: required,
2527
+ isReadOnly: readOnly,
2528
+ validationState: error ? "invalid" : "valid",
2529
+ ...props
2530
+ },
2531
+ textAreaRef
2532
+ );
2533
+ const { hoverProps, isHovered } = useHover9({});
2534
+ const { focusProps, isFocusVisible } = useFocusRing14();
2535
+ const stateProps = useStateProps16({
2536
+ hover: isHovered,
2537
+ focus: isFocusVisible,
2538
+ disabled,
2539
+ readOnly,
2540
+ error
2541
+ });
2542
+ const styles = useComponentStyles30("TextArea", { variant, size });
2543
+ return /* @__PURE__ */ React60.createElement(FieldBase, {
2544
+ label,
2545
+ labelProps,
2546
+ required,
2547
+ description,
2548
+ descriptionProps,
2549
+ error,
2550
+ errorMessage,
2551
+ errorMessageProps,
2552
+ stateProps,
2553
+ variant,
2554
+ size,
2555
+ width
2556
+ }, /* @__PURE__ */ React60.createElement(Box35, {
2557
+ as: "textarea",
2558
+ css: styles,
2559
+ ref: textAreaRef,
2560
+ rows,
2561
+ ...inputProps,
2562
+ ...focusProps,
2563
+ ...hoverProps,
2564
+ ...stateProps
2565
+ }));
2566
+ }
2567
+ );
2412
2568
 
2413
2569
  // src/TextField/TextField.tsx
2414
- import React59, { forwardRef as forwardRef13 } from "react";
2415
- import { useHover as useHover9 } from "@react-aria/interactions";
2570
+ import React61, { forwardRef as forwardRef14 } from "react";
2571
+ import { useHover as useHover10 } from "@react-aria/interactions";
2416
2572
  import { useFocusRing as useFocusRing15 } from "@react-aria/focus";
2417
2573
  import { useTextField as useTextField2 } from "@react-aria/textfield";
2418
- import { useObjectRef as useObjectRef10 } from "@react-aria/utils";
2574
+ import { useObjectRef as useObjectRef12 } from "@react-aria/utils";
2419
2575
  import { useStateProps as useStateProps17 } from "@marigold/system";
2420
- var TextField = forwardRef13((_a, ref) => {
2421
- var _b = _a, { variant, size, width, disabled, required, readOnly, error } = _b, props = __objRest(_b, ["variant", "size", "width", "disabled", "required", "readOnly", "error"]);
2422
- const { label, description, errorMessage, autoFocus } = props;
2423
- const inputRef = useObjectRef10(ref);
2424
- const { labelProps, inputProps, descriptionProps, errorMessageProps } = useTextField2(__spreadValues({
2425
- isDisabled: disabled,
2426
- isRequired: required,
2427
- isReadOnly: readOnly,
2428
- validationState: error ? "invalid" : "valid"
2429
- }, props), inputRef);
2430
- const { hoverProps, isHovered } = useHover9({});
2431
- const { focusProps, isFocusVisible } = useFocusRing15({
2432
- isTextInput: true,
2433
- autoFocus
2434
- });
2435
- const stateProps = useStateProps17({
2436
- hover: isHovered,
2437
- focus: isFocusVisible,
2438
- disabled,
2439
- readOnly,
2440
- error
2441
- });
2442
- return /* @__PURE__ */ React59.createElement(FieldBase, {
2443
- label,
2444
- labelProps,
2445
- required,
2446
- description,
2447
- descriptionProps,
2448
- error,
2449
- errorMessage,
2450
- errorMessageProps,
2451
- stateProps,
2452
- variant,
2453
- size,
2454
- width
2455
- }, /* @__PURE__ */ React59.createElement(Input, __spreadValues(__spreadValues(__spreadValues(__spreadValues({
2456
- ref: inputRef,
2457
- variant,
2458
- size
2459
- }, inputProps), focusProps), hoverProps), stateProps)));
2460
- });
2576
+ var TextField = forwardRef14(
2577
+ ({ variant, size, width, disabled, required, readOnly, error, ...props }, ref) => {
2578
+ const { label, description, errorMessage, autoFocus } = props;
2579
+ const inputRef = useObjectRef12(ref);
2580
+ const { labelProps, inputProps, descriptionProps, errorMessageProps } = useTextField2(
2581
+ {
2582
+ isDisabled: disabled,
2583
+ isRequired: required,
2584
+ isReadOnly: readOnly,
2585
+ validationState: error ? "invalid" : "valid",
2586
+ ...props
2587
+ },
2588
+ inputRef
2589
+ );
2590
+ const { hoverProps, isHovered } = useHover10({});
2591
+ const { focusProps, isFocusVisible } = useFocusRing15({
2592
+ isTextInput: true,
2593
+ autoFocus
2594
+ });
2595
+ const stateProps = useStateProps17({
2596
+ hover: isHovered,
2597
+ focus: isFocusVisible,
2598
+ disabled,
2599
+ readOnly,
2600
+ error
2601
+ });
2602
+ return /* @__PURE__ */ React61.createElement(FieldBase, {
2603
+ label,
2604
+ labelProps,
2605
+ required,
2606
+ description,
2607
+ descriptionProps,
2608
+ error,
2609
+ errorMessage,
2610
+ errorMessageProps,
2611
+ stateProps,
2612
+ variant,
2613
+ size,
2614
+ width
2615
+ }, /* @__PURE__ */ React61.createElement(Input, {
2616
+ ref: inputRef,
2617
+ variant,
2618
+ size,
2619
+ ...inputProps,
2620
+ ...focusProps,
2621
+ ...hoverProps,
2622
+ ...stateProps
2623
+ }));
2624
+ }
2625
+ );
2461
2626
 
2462
2627
  // src/Tiles/Tiles.tsx
2463
- import React60 from "react";
2464
- var Tiles = React60.forwardRef((_a, ref) => {
2465
- var _b = _a, { space = "none", itemMinWidth = "250px", children } = _b, props = __objRest(_b, ["space", "itemMinWidth", "children"]);
2466
- return /* @__PURE__ */ React60.createElement(Box, __spreadValues({
2628
+ import React62 from "react";
2629
+ var Tiles = React62.forwardRef(
2630
+ ({ space = "none", itemMinWidth = "250px", children, ...props }, ref) => /* @__PURE__ */ React62.createElement(Box, {
2467
2631
  ref,
2468
2632
  display: "grid",
2469
2633
  __baseCSS: {
2470
2634
  gap: space,
2471
2635
  gridTemplateColumns: `repeat(auto-fit, minmax(min(${itemMinWidth}, 100%), 1fr))`
2472
- }
2473
- }, props), children);
2474
- });
2636
+ },
2637
+ ...props
2638
+ }, children)
2639
+ );
2475
2640
 
2476
2641
  // src/Tooltip/Tooltip.tsx
2477
- import React62 from "react";
2642
+ import React64 from "react";
2478
2643
  import { useTooltip } from "@react-aria/tooltip";
2479
2644
  import {
2480
- Box as Box34,
2481
- useComponentStyles as useComponentStyles30
2645
+ Box as Box36,
2646
+ useComponentStyles as useComponentStyles31
2482
2647
  } from "@marigold/system";
2483
2648
 
2484
2649
  // src/Tooltip/Context.ts
2485
- import { createContext as createContext7, useContext as useContext7 } from "react";
2486
- var TooltipContext = createContext7({});
2487
- var useTooltipContext = () => useContext7(TooltipContext);
2650
+ import { createContext as createContext8, useContext as useContext8 } from "react";
2651
+ var TooltipContext = createContext8({});
2652
+ var useTooltipContext = () => useContext8(TooltipContext);
2488
2653
 
2489
2654
  // src/Tooltip/TooltipTrigger.tsx
2490
- import React61, { useRef as useRef19 } from "react";
2655
+ import React63, { useRef as useRef17 } from "react";
2491
2656
  import { FocusableProvider } from "@react-aria/focus";
2492
2657
  import { useOverlayPosition as useOverlayPosition3 } from "@react-aria/overlays";
2493
2658
  import { useTooltipTrigger } from "@react-aria/tooltip";
2494
2659
  import { useTooltipTriggerState } from "@react-stately/tooltip";
2495
- var TooltipTrigger = (_a) => {
2496
- var _b = _a, {
2497
- disabled,
2498
- open,
2499
- delay = 1e3,
2500
- placement = "top",
2501
- children
2502
- } = _b, rest = __objRest(_b, [
2503
- "disabled",
2504
- "open",
2505
- "delay",
2506
- "placement",
2507
- "children"
2508
- ]);
2509
- const [tooltipTrigger, tooltip] = React61.Children.toArray(children);
2510
- const props = __spreadProps(__spreadValues({}, rest), {
2660
+ var TooltipTrigger = ({
2661
+ disabled,
2662
+ open,
2663
+ delay = 1e3,
2664
+ placement = "top",
2665
+ children,
2666
+ ...rest
2667
+ }) => {
2668
+ const [tooltipTrigger, tooltip] = React63.Children.toArray(children);
2669
+ const props = {
2670
+ ...rest,
2511
2671
  isDisabled: disabled,
2512
2672
  isOpen: open,
2513
2673
  delay,
2514
2674
  placement
2515
- });
2516
- const tooltipTriggerRef = useRef19(null);
2517
- const overlayRef = useRef19(null);
2675
+ };
2676
+ const tooltipTriggerRef = useRef17(null);
2677
+ const overlayRef = useRef17(null);
2518
2678
  const state = useTooltipTriggerState(props);
2519
- const { triggerProps, tooltipProps } = useTooltipTrigger(props, state, tooltipTriggerRef);
2679
+ const { triggerProps, tooltipProps } = useTooltipTrigger(
2680
+ props,
2681
+ state,
2682
+ tooltipTriggerRef
2683
+ );
2520
2684
  const {
2521
2685
  overlayProps: positionProps,
2522
2686
  placement: overlayPlacement,
@@ -2529,30 +2693,40 @@ var TooltipTrigger = (_a) => {
2529
2693
  isOpen: state.isOpen,
2530
2694
  overlayRef
2531
2695
  });
2532
- return /* @__PURE__ */ React61.createElement(FocusableProvider, __spreadValues({
2533
- ref: tooltipTriggerRef
2534
- }, triggerProps), tooltipTrigger, /* @__PURE__ */ React61.createElement(TooltipContext.Provider, {
2535
- value: __spreadValues(__spreadValues({
2696
+ return /* @__PURE__ */ React63.createElement(FocusableProvider, {
2697
+ ref: tooltipTriggerRef,
2698
+ ...triggerProps
2699
+ }, tooltipTrigger, /* @__PURE__ */ React63.createElement(TooltipContext.Provider, {
2700
+ value: {
2536
2701
  state,
2537
2702
  overlayRef,
2538
2703
  arrowProps,
2539
- placement: overlayPlacement
2540
- }, tooltipProps), positionProps)
2541
- }, /* @__PURE__ */ React61.createElement(Overlay, {
2704
+ placement: overlayPlacement,
2705
+ ...tooltipProps,
2706
+ ...positionProps
2707
+ }
2708
+ }, /* @__PURE__ */ React63.createElement(Overlay, {
2542
2709
  open: state.isOpen
2543
2710
  }, tooltip)));
2544
2711
  };
2545
2712
 
2546
2713
  // src/Tooltip/Tooltip.tsx
2547
2714
  var Tooltip = ({ children, variant, size }) => {
2548
- const _a = useTooltipContext(), { arrowProps, state, overlayRef, placement } = _a, rest = __objRest(_a, ["arrowProps", "state", "overlayRef", "placement"]);
2715
+ const { arrowProps, state, overlayRef, placement, ...rest } = useTooltipContext();
2549
2716
  const { tooltipProps } = useTooltip({}, state);
2550
- const styles = useComponentStyles30("Tooltip", { variant, size }, { parts: ["container", "arrow"] });
2551
- return /* @__PURE__ */ React62.createElement(Box34, __spreadProps(__spreadValues(__spreadValues({}, tooltipProps), rest), {
2717
+ const styles = useComponentStyles31(
2718
+ "Tooltip",
2719
+ { variant, size },
2720
+ { parts: ["container", "arrow"] }
2721
+ );
2722
+ return /* @__PURE__ */ React64.createElement(Box36, {
2723
+ ...tooltipProps,
2724
+ ...rest,
2552
2725
  ref: overlayRef,
2553
2726
  css: styles.container,
2554
2727
  "data-placement": placement
2555
- }), /* @__PURE__ */ React62.createElement("div", null, children), /* @__PURE__ */ React62.createElement(Box34, __spreadProps(__spreadValues({}, arrowProps), {
2728
+ }, /* @__PURE__ */ React64.createElement("div", null, children), /* @__PURE__ */ React64.createElement(Box36, {
2729
+ ...arrowProps,
2556
2730
  __baseCSS: {
2557
2731
  position: "absolute",
2558
2732
  height: 0,
@@ -2563,7 +2737,7 @@ var Tooltip = ({ children, variant, size }) => {
2563
2737
  borderBottomColor: "transparent"
2564
2738
  },
2565
2739
  css: styles.arrow
2566
- })));
2740
+ }));
2567
2741
  };
2568
2742
  Tooltip.Trigger = TooltipTrigger;
2569
2743
  export {
@@ -2591,6 +2765,7 @@ export {
2591
2765
  Input,
2592
2766
  Label,
2593
2767
  Link,
2768
+ List,
2594
2769
  MarigoldProvider,
2595
2770
  Menu,
2596
2771
  Message,
@@ -2613,6 +2788,8 @@ export {
2613
2788
  Tooltip,
2614
2789
  Underlay,
2615
2790
  VisuallyHidden,
2791
+ useAsyncList,
2616
2792
  useCheckboxGroupContext,
2793
+ useListData,
2617
2794
  useTheme2 as useTheme
2618
2795
  };