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