@marigold/components 6.3.1 → 6.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +61 -71
- package/dist/index.d.ts +61 -71
- package/dist/index.js +913 -1089
- package/dist/index.mjs +928 -1110
- package/package.json +5 -4
package/dist/index.mjs
CHANGED
|
@@ -14,107 +14,30 @@ import { useTreeState } from "@react-stately/tree";
|
|
|
14
14
|
|
|
15
15
|
// src/Accordion/AccordionItem.tsx
|
|
16
16
|
import { useEffect, useRef } from "react";
|
|
17
|
-
import { FocusRing, useFocusRing
|
|
18
|
-
import { mergeProps as
|
|
19
|
-
import { useClassNames as useClassNames2, useStateProps as useStateProps2 } from "@marigold/system";
|
|
20
|
-
|
|
21
|
-
// src/Button/Button.tsx
|
|
22
|
-
import { forwardRef } from "react";
|
|
23
|
-
import { useButton } from "@react-aria/button";
|
|
24
|
-
import { useFocusRing } from "@react-aria/focus";
|
|
25
|
-
import { useHover } from "@react-aria/interactions";
|
|
26
|
-
import { mergeProps, useObjectRef } from "@react-aria/utils";
|
|
17
|
+
import { FocusRing, useFocusRing } from "@react-aria/focus";
|
|
18
|
+
import { mergeProps as mergeProps2 } from "@react-aria/utils";
|
|
27
19
|
import { cn, useClassNames, useStateProps } from "@marigold/system";
|
|
28
|
-
import { jsx } from "react/jsx-runtime";
|
|
29
|
-
var Button = forwardRef(
|
|
30
|
-
({
|
|
31
|
-
as = "button",
|
|
32
|
-
children,
|
|
33
|
-
variant,
|
|
34
|
-
size,
|
|
35
|
-
disabled,
|
|
36
|
-
onPress,
|
|
37
|
-
onPressStart,
|
|
38
|
-
onPressEnd,
|
|
39
|
-
onPressChange,
|
|
40
|
-
onPressUp,
|
|
41
|
-
fullWidth,
|
|
42
|
-
className,
|
|
43
|
-
excludeFromTabOrder,
|
|
44
|
-
...props
|
|
45
|
-
}, ref) => {
|
|
46
|
-
const Component = as;
|
|
47
|
-
const buttonRef = useObjectRef(ref);
|
|
48
|
-
const { hoverProps, isHovered } = useHover({ isDisabled: disabled });
|
|
49
|
-
const { isFocusVisible, focusProps } = useFocusRing({
|
|
50
|
-
autoFocus: props.autoFocus
|
|
51
|
-
});
|
|
52
|
-
const { buttonProps, isPressed } = useButton(
|
|
53
|
-
{
|
|
54
|
-
/**
|
|
55
|
-
* `react-aria` only expected `Element` but we casted
|
|
56
|
-
* it to a `HTMLButtonElement` internally.
|
|
57
|
-
*/
|
|
58
|
-
...props,
|
|
59
|
-
onPress,
|
|
60
|
-
onPressStart,
|
|
61
|
-
onPressEnd,
|
|
62
|
-
onPressChange,
|
|
63
|
-
onPressUp,
|
|
64
|
-
elementType: typeof as === "string" ? as : "span",
|
|
65
|
-
isDisabled: disabled,
|
|
66
|
-
excludeFromTabOrder
|
|
67
|
-
},
|
|
68
|
-
buttonRef
|
|
69
|
-
);
|
|
70
|
-
const classNames2 = useClassNames({
|
|
71
|
-
component: "Button",
|
|
72
|
-
variant,
|
|
73
|
-
size,
|
|
74
|
-
className
|
|
75
|
-
});
|
|
76
|
-
const stateProps = useStateProps({
|
|
77
|
-
active: isPressed,
|
|
78
|
-
focusVisible: isFocusVisible,
|
|
79
|
-
hover: isHovered
|
|
80
|
-
});
|
|
81
|
-
return /* @__PURE__ */ jsx(
|
|
82
|
-
Component,
|
|
83
|
-
{
|
|
84
|
-
...mergeProps(buttonProps, focusProps, hoverProps, props),
|
|
85
|
-
...stateProps,
|
|
86
|
-
ref: buttonRef,
|
|
87
|
-
className: cn(
|
|
88
|
-
"inline-flex items-center justify-center gap-[0.5ch]",
|
|
89
|
-
classNames2,
|
|
90
|
-
fullWidth ? "w-full" : void 0
|
|
91
|
-
),
|
|
92
|
-
children
|
|
93
|
-
}
|
|
94
|
-
);
|
|
95
|
-
}
|
|
96
|
-
);
|
|
97
20
|
|
|
98
21
|
// src/Chevron/ChevronUp.tsx
|
|
99
|
-
import { forwardRef
|
|
22
|
+
import { forwardRef } from "react";
|
|
100
23
|
import { SVG } from "@marigold/system";
|
|
101
|
-
import { jsx
|
|
102
|
-
var ChevronUp =
|
|
103
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
24
|
+
import { jsx } from "react/jsx-runtime";
|
|
25
|
+
var ChevronUp = forwardRef(
|
|
26
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(SVG, { className, ...props, viewBox: "0 0 24 24", ref, children: /* @__PURE__ */ jsx("path", { d: "M5.97563 16.8506L12 10.8394L18.0244 16.8506L19.875 15L12 7.125L4.125 15L5.97563 16.8506Z" }) })
|
|
104
27
|
);
|
|
105
28
|
|
|
106
29
|
// src/Chevron/ChevronDown.tsx
|
|
107
|
-
import { forwardRef as
|
|
30
|
+
import { forwardRef as forwardRef2 } from "react";
|
|
108
31
|
import { SVG as SVG2 } from "@marigold/system";
|
|
109
|
-
import { jsx as
|
|
110
|
-
var ChevronDown =
|
|
111
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
32
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
33
|
+
var ChevronDown = forwardRef2(
|
|
34
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx2(SVG2, { className, ...props, viewBox: "0 0 24 24", ref, children: /* @__PURE__ */ jsx2("path", { d: "M5.97563 7.125L12 13.1363L18.0244 7.125L19.875 8.97563L12 16.8506L4.125 8.97563L5.97563 7.125Z" }) })
|
|
112
35
|
);
|
|
113
36
|
|
|
114
37
|
// src/Accordion/useAccordionItem.ts
|
|
115
|
-
import { useButton
|
|
38
|
+
import { useButton } from "@react-aria/button";
|
|
116
39
|
import { useSelectableItem } from "@react-aria/selection";
|
|
117
|
-
import { mergeProps
|
|
40
|
+
import { mergeProps, useId } from "@react-aria/utils";
|
|
118
41
|
import { isAppleDevice } from "@react-aria/utils";
|
|
119
42
|
import { isMac } from "@react-aria/utils";
|
|
120
43
|
function isNonContiguousSelectionModifier(e) {
|
|
@@ -182,8 +105,8 @@ function useAccordionItem(props, state, ref) {
|
|
|
182
105
|
}
|
|
183
106
|
}
|
|
184
107
|
};
|
|
185
|
-
let { buttonProps } =
|
|
186
|
-
|
|
108
|
+
let { buttonProps } = useButton(
|
|
109
|
+
mergeProps(itemProps, {
|
|
187
110
|
id: buttonId,
|
|
188
111
|
elementType: "button",
|
|
189
112
|
isDisabled,
|
|
@@ -208,7 +131,7 @@ function useAccordionItem(props, state, ref) {
|
|
|
208
131
|
}
|
|
209
132
|
|
|
210
133
|
// src/Accordion/AccordionItem.tsx
|
|
211
|
-
import { jsx as
|
|
134
|
+
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
212
135
|
var AccordionItem = ({
|
|
213
136
|
item,
|
|
214
137
|
state,
|
|
@@ -241,30 +164,33 @@ var AccordionItem = ({
|
|
|
241
164
|
state,
|
|
242
165
|
ref
|
|
243
166
|
);
|
|
244
|
-
const { isFocusVisible, focusProps } =
|
|
245
|
-
const stateProps =
|
|
167
|
+
const { isFocusVisible, focusProps } = useFocusRing();
|
|
168
|
+
const stateProps = useStateProps({
|
|
246
169
|
focus: isFocusVisible,
|
|
247
170
|
expanded: defaultExpanded || expanded
|
|
248
171
|
});
|
|
249
|
-
const classNames2 =
|
|
172
|
+
const classNames2 = useClassNames({ component: "Accordion", variant, size });
|
|
250
173
|
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col", ...props, children: [
|
|
251
|
-
/* @__PURE__ */
|
|
252
|
-
|
|
174
|
+
/* @__PURE__ */ jsx3(FocusRing, { within: true, children: /* @__PURE__ */ jsxs(
|
|
175
|
+
"button",
|
|
253
176
|
{
|
|
254
|
-
className:
|
|
255
|
-
|
|
177
|
+
className: cn(
|
|
178
|
+
"inline-flex items-center justify-center gap-[0.5ch]",
|
|
179
|
+
classNames2.button
|
|
180
|
+
),
|
|
181
|
+
...mergeProps2(buttonProps, stateProps, props),
|
|
256
182
|
ref,
|
|
257
183
|
"aria-label": item.textValue,
|
|
258
184
|
children: [
|
|
259
185
|
title,
|
|
260
|
-
|
|
186
|
+
expanded ? /* @__PURE__ */ jsx3(ChevronUp, { className: "h3 w-6" }) : /* @__PURE__ */ jsx3(ChevronDown, { className: "h3 w-6" })
|
|
261
187
|
]
|
|
262
188
|
}
|
|
263
189
|
) }),
|
|
264
|
-
expanded || defaultExpanded ? /* @__PURE__ */
|
|
190
|
+
expanded || defaultExpanded ? /* @__PURE__ */ jsx3(
|
|
265
191
|
"div",
|
|
266
192
|
{
|
|
267
|
-
...
|
|
193
|
+
...mergeProps2(regionProps, focusProps, stateProps),
|
|
268
194
|
className: classNames2.item,
|
|
269
195
|
children: item.props.children
|
|
270
196
|
}
|
|
@@ -273,7 +199,7 @@ var AccordionItem = ({
|
|
|
273
199
|
};
|
|
274
200
|
|
|
275
201
|
// src/Accordion/Accordion.tsx
|
|
276
|
-
import { jsx as
|
|
202
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
277
203
|
var Accordion = ({ children, ...props }) => {
|
|
278
204
|
const ownProps = {
|
|
279
205
|
...props,
|
|
@@ -298,7 +224,8 @@ var Accordion = ({ children, ...props }) => {
|
|
|
298
224
|
state,
|
|
299
225
|
ref
|
|
300
226
|
);
|
|
301
|
-
|
|
227
|
+
delete accordionProps.onKeyDownCapture;
|
|
228
|
+
return /* @__PURE__ */ jsx4("div", { ...accordionProps, ref, children: [...state.collection].map((item) => /* @__PURE__ */ jsx4(
|
|
302
229
|
AccordionItem,
|
|
303
230
|
{
|
|
304
231
|
title: item.props.title,
|
|
@@ -315,7 +242,7 @@ Accordion.Item = Item;
|
|
|
315
242
|
// src/Aside/Aside.tsx
|
|
316
243
|
import { Children as Children2 } from "react";
|
|
317
244
|
import { cn as cn2, createVar, gapSpace } from "@marigold/system";
|
|
318
|
-
import { jsx as
|
|
245
|
+
import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
319
246
|
var classNames = {
|
|
320
247
|
aside: "grow basis-[--sideWidth]",
|
|
321
248
|
content: "basis-0 grow-[999] [min-inline-size:--wrap]"
|
|
@@ -342,7 +269,7 @@ var Aside = ({
|
|
|
342
269
|
!stretch && "items-start"
|
|
343
270
|
),
|
|
344
271
|
children: [
|
|
345
|
-
/* @__PURE__ */
|
|
272
|
+
/* @__PURE__ */ jsx5(
|
|
346
273
|
"div",
|
|
347
274
|
{
|
|
348
275
|
className: classNames[side === "left" ? "aside" : "content"],
|
|
@@ -350,7 +277,7 @@ var Aside = ({
|
|
|
350
277
|
children: left
|
|
351
278
|
}
|
|
352
279
|
),
|
|
353
|
-
/* @__PURE__ */
|
|
280
|
+
/* @__PURE__ */ jsx5(
|
|
354
281
|
"div",
|
|
355
282
|
{
|
|
356
283
|
className: classNames[side === "right" ? "aside" : "content"],
|
|
@@ -365,13 +292,13 @@ var Aside = ({
|
|
|
365
292
|
|
|
366
293
|
// src/Aspect/Aspect.tsx
|
|
367
294
|
import { aspect, cn as cn3, createVar as createVar2 } from "@marigold/system";
|
|
368
|
-
import { jsx as
|
|
295
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
369
296
|
var Aspect = ({
|
|
370
297
|
ratio = "square",
|
|
371
298
|
maxWidth,
|
|
372
299
|
children
|
|
373
300
|
}) => {
|
|
374
|
-
return /* @__PURE__ */
|
|
301
|
+
return /* @__PURE__ */ jsx6(
|
|
375
302
|
"div",
|
|
376
303
|
{
|
|
377
304
|
className: cn3(
|
|
@@ -396,12 +323,12 @@ import { useComboBoxState } from "@react-stately/combobox";
|
|
|
396
323
|
import {
|
|
397
324
|
cn as cn6,
|
|
398
325
|
width as twWidth,
|
|
399
|
-
useClassNames as
|
|
326
|
+
useClassNames as useClassNames4
|
|
400
327
|
} from "@marigold/system";
|
|
401
328
|
|
|
402
329
|
// src/HelpText/HelpText.tsx
|
|
403
|
-
import { SVG as SVG3, cn as cn4, useClassNames as
|
|
404
|
-
import { Fragment, jsx as
|
|
330
|
+
import { SVG as SVG3, cn as cn4, useClassNames as useClassNames2 } from "@marigold/system";
|
|
331
|
+
import { Fragment, jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
405
332
|
var HelpText = ({
|
|
406
333
|
variant,
|
|
407
334
|
size,
|
|
@@ -414,48 +341,53 @@ var HelpText = ({
|
|
|
414
341
|
...props
|
|
415
342
|
}) => {
|
|
416
343
|
const hasErrorMessage = errorMessage && error;
|
|
417
|
-
const classNames2 =
|
|
344
|
+
const classNames2 = useClassNames2({
|
|
418
345
|
component: "HelpText",
|
|
419
346
|
variant,
|
|
420
347
|
size
|
|
421
348
|
});
|
|
422
|
-
return /* @__PURE__ */
|
|
349
|
+
return /* @__PURE__ */ jsx7(
|
|
423
350
|
"div",
|
|
424
351
|
{
|
|
425
352
|
...props,
|
|
426
353
|
...hasErrorMessage ? errorMessageProps : descriptionProps,
|
|
427
354
|
className: cn4("flex items-center gap-1", classNames2.container),
|
|
428
355
|
children: hasErrorMessage ? /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
429
|
-
/* @__PURE__ */
|
|
356
|
+
/* @__PURE__ */ jsx7(
|
|
430
357
|
SVG3,
|
|
431
358
|
{
|
|
432
359
|
className: cn4("h-4 w-4", classNames2.icon),
|
|
433
360
|
viewBox: "0 0 24 24",
|
|
434
361
|
role: "presentation",
|
|
435
|
-
children: /* @__PURE__ */
|
|
362
|
+
children: /* @__PURE__ */ jsx7("path", { d: "M2.25 20.3097H21.75L12 3.46875L2.25 20.3097ZM12.8864 17.2606H11.1136V15.4879H12.8864V17.2606ZM12.8864 13.7151H11.1136V10.1697H12.8864V13.7151Z" })
|
|
436
363
|
}
|
|
437
364
|
),
|
|
438
365
|
errorMessage
|
|
439
|
-
] }) : /* @__PURE__ */
|
|
366
|
+
] }) : /* @__PURE__ */ jsx7(Fragment, { children: description })
|
|
440
367
|
}
|
|
441
368
|
);
|
|
442
369
|
};
|
|
443
370
|
|
|
444
371
|
// src/Label/Label.tsx
|
|
445
|
-
import {
|
|
372
|
+
import { Label } from "react-aria-components";
|
|
373
|
+
import { SVG as SVG4, cn as cn5, createVar as createVar3, useClassNames as useClassNames3 } from "@marigold/system";
|
|
374
|
+
|
|
375
|
+
// src/FieldBase/FieldGroup.tsx
|
|
376
|
+
import { createContext, useContext } from "react";
|
|
377
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
378
|
+
var FieldGroupContext = createContext({});
|
|
379
|
+
var useFieldGroupContext = () => useContext(FieldGroupContext);
|
|
380
|
+
var FieldGroup = ({ labelWidth, children }) => {
|
|
381
|
+
return /* @__PURE__ */ jsx8(FieldGroupContext.Provider, { value: { labelWidth }, children });
|
|
382
|
+
};
|
|
383
|
+
|
|
384
|
+
// src/Label/Label.tsx
|
|
446
385
|
import { jsx as jsx9, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
447
|
-
var
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
variant,
|
|
451
|
-
size,
|
|
452
|
-
labelWidth,
|
|
453
|
-
...props
|
|
454
|
-
}) => {
|
|
455
|
-
const Component = as;
|
|
456
|
-
const classNames2 = useClassNames4({ component: "Label", size, variant });
|
|
386
|
+
var _Label = ({ size, variant, children, ...props }) => {
|
|
387
|
+
const classNames2 = useClassNames3({ component: "Label", size, variant });
|
|
388
|
+
const { labelWidth } = useFieldGroupContext();
|
|
457
389
|
return /* @__PURE__ */ jsxs4(
|
|
458
|
-
|
|
390
|
+
Label,
|
|
459
391
|
{
|
|
460
392
|
...props,
|
|
461
393
|
className: cn5(classNames2.container, "flex w-[var(--labelWidth)]"),
|
|
@@ -477,17 +409,8 @@ var Label = ({
|
|
|
477
409
|
);
|
|
478
410
|
};
|
|
479
411
|
|
|
480
|
-
// src/FieldBase/FieldGroup.tsx
|
|
481
|
-
import { createContext, useContext } from "react";
|
|
482
|
-
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
483
|
-
var FieldGroupContext = createContext({});
|
|
484
|
-
var useFieldGroupContext = () => useContext(FieldGroupContext);
|
|
485
|
-
var FieldGroup = ({ labelWidth, children }) => {
|
|
486
|
-
return /* @__PURE__ */ jsx10(FieldGroupContext.Provider, { value: { labelWidth }, children });
|
|
487
|
-
};
|
|
488
|
-
|
|
489
412
|
// src/FieldBase/FieldBase.tsx
|
|
490
|
-
import { jsx as
|
|
413
|
+
import { jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
491
414
|
var FieldBase = ({
|
|
492
415
|
children,
|
|
493
416
|
variant,
|
|
@@ -505,8 +428,7 @@ var FieldBase = ({
|
|
|
505
428
|
...props
|
|
506
429
|
}) => {
|
|
507
430
|
const hasHelpText = !!description || errorMessage && error;
|
|
508
|
-
const
|
|
509
|
-
const classNames2 = useClassNames5({
|
|
431
|
+
const classNames2 = useClassNames4({
|
|
510
432
|
component: "Field",
|
|
511
433
|
variant,
|
|
512
434
|
size
|
|
@@ -518,18 +440,9 @@ var FieldBase = ({
|
|
|
518
440
|
...stateProps,
|
|
519
441
|
className: cn6("group/field", twWidth[width], classNames2),
|
|
520
442
|
children: [
|
|
521
|
-
label && /* @__PURE__ */
|
|
522
|
-
Label,
|
|
523
|
-
{
|
|
524
|
-
variant,
|
|
525
|
-
size,
|
|
526
|
-
labelWidth,
|
|
527
|
-
...labelProps,
|
|
528
|
-
children: label
|
|
529
|
-
}
|
|
530
|
-
),
|
|
443
|
+
label && /* @__PURE__ */ jsx10(_Label, { variant, size, ...labelProps, children: label }),
|
|
531
444
|
children,
|
|
532
|
-
hasHelpText && /* @__PURE__ */
|
|
445
|
+
hasHelpText && /* @__PURE__ */ jsx10(
|
|
533
446
|
HelpText,
|
|
534
447
|
{
|
|
535
448
|
variant,
|
|
@@ -550,13 +463,13 @@ var FieldBase = ({
|
|
|
550
463
|
// src/Input/Input.tsx
|
|
551
464
|
import {
|
|
552
465
|
cloneElement as cloneElement2,
|
|
553
|
-
forwardRef as
|
|
466
|
+
forwardRef as forwardRef3
|
|
554
467
|
} from "react";
|
|
555
|
-
import { cn as cn7, useClassNames as
|
|
556
|
-
import { jsx as
|
|
557
|
-
var Input =
|
|
468
|
+
import { cn as cn7, useClassNames as useClassNames5 } from "@marigold/system";
|
|
469
|
+
import { jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
470
|
+
var Input = forwardRef3(
|
|
558
471
|
({ type = "text", icon, action, variant, size, ...props }, ref) => {
|
|
559
|
-
const classNames2 =
|
|
472
|
+
const classNames2 = useClassNames5({
|
|
560
473
|
component: "Input",
|
|
561
474
|
variant,
|
|
562
475
|
size
|
|
@@ -585,12 +498,12 @@ var Input = forwardRef4(
|
|
|
585
498
|
"data-action": action && "",
|
|
586
499
|
children: [
|
|
587
500
|
inputIcon,
|
|
588
|
-
/* @__PURE__ */
|
|
501
|
+
/* @__PURE__ */ jsx11(
|
|
589
502
|
"input",
|
|
590
503
|
{
|
|
591
504
|
...props,
|
|
592
505
|
className: cn7(
|
|
593
|
-
"flex-1",
|
|
506
|
+
"w-full flex-1",
|
|
594
507
|
"disabled:cursor-not-allowed",
|
|
595
508
|
"[&[type=file]]:border-none [&[type=file]]:p-0",
|
|
596
509
|
"[&[type=color]]:ml-0 [&[type=color]]:border-none [&[type=color]]:bg-transparent [&[type=color]]:p-0",
|
|
@@ -608,10 +521,10 @@ var Input = forwardRef4(
|
|
|
608
521
|
);
|
|
609
522
|
|
|
610
523
|
// src/ListBox/ListBox.tsx
|
|
611
|
-
import { forwardRef as
|
|
524
|
+
import { forwardRef as forwardRef4 } from "react";
|
|
612
525
|
import { useListBox } from "@react-aria/listbox";
|
|
613
|
-
import { useObjectRef
|
|
614
|
-
import { cn as cn8, useClassNames as
|
|
526
|
+
import { useObjectRef } from "@react-aria/utils";
|
|
527
|
+
import { cn as cn8, useClassNames as useClassNames6 } from "@marigold/system";
|
|
615
528
|
|
|
616
529
|
// src/ListBox/Context.ts
|
|
617
530
|
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
@@ -621,9 +534,9 @@ var useListBoxContext = () => useContext2(ListBoxContext);
|
|
|
621
534
|
// src/ListBox/ListBoxOption.tsx
|
|
622
535
|
import { useRef as useRef3 } from "react";
|
|
623
536
|
import { useOption } from "@react-aria/listbox";
|
|
624
|
-
import { mergeProps as
|
|
625
|
-
import { useStateProps as
|
|
626
|
-
import { jsx as
|
|
537
|
+
import { mergeProps as mergeProps3 } from "@react-aria/utils";
|
|
538
|
+
import { useStateProps as useStateProps2 } from "@marigold/system";
|
|
539
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
627
540
|
var ListBoxOption = ({ item, state }) => {
|
|
628
541
|
const ref = useRef3(null);
|
|
629
542
|
const { optionProps, isSelected, isDisabled, isFocused } = useOption(
|
|
@@ -635,17 +548,17 @@ var ListBoxOption = ({ item, state }) => {
|
|
|
635
548
|
);
|
|
636
549
|
const { onPointerUp, ...props } = optionProps;
|
|
637
550
|
const { classNames: classNames2 } = useListBoxContext();
|
|
638
|
-
const stateProps =
|
|
551
|
+
const stateProps = useStateProps2({
|
|
639
552
|
selected: isSelected,
|
|
640
553
|
disabled: isDisabled,
|
|
641
554
|
focusVisible: isFocused
|
|
642
555
|
});
|
|
643
|
-
return /* @__PURE__ */
|
|
556
|
+
return /* @__PURE__ */ jsx12(
|
|
644
557
|
"li",
|
|
645
558
|
{
|
|
646
559
|
ref,
|
|
647
560
|
className: classNames2.option,
|
|
648
|
-
...
|
|
561
|
+
...mergeProps3(props, { onPointerDown: onPointerUp }, { ...stateProps }),
|
|
649
562
|
children: item.props.children
|
|
650
563
|
}
|
|
651
564
|
);
|
|
@@ -653,7 +566,7 @@ var ListBoxOption = ({ item, state }) => {
|
|
|
653
566
|
|
|
654
567
|
// src/ListBox/ListBoxSection.tsx
|
|
655
568
|
import { useListBoxSection } from "@react-aria/listbox";
|
|
656
|
-
import { jsx as
|
|
569
|
+
import { jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
657
570
|
var ListBoxSection = ({ section, state }) => {
|
|
658
571
|
const { classNames: classNames2 } = useListBoxContext();
|
|
659
572
|
const { itemProps, headingProps, groupProps } = useListBoxSection({
|
|
@@ -661,19 +574,19 @@ var ListBoxSection = ({ section, state }) => {
|
|
|
661
574
|
"aria-label": section["aria-label"]
|
|
662
575
|
});
|
|
663
576
|
return /* @__PURE__ */ jsxs7("li", { className: classNames2.section, ...itemProps, children: [
|
|
664
|
-
section.rendered && /* @__PURE__ */
|
|
665
|
-
/* @__PURE__ */
|
|
577
|
+
section.rendered && /* @__PURE__ */ jsx13("div", { className: classNames2.sectionTitle, ...headingProps, children: section.rendered }),
|
|
578
|
+
/* @__PURE__ */ jsx13("ul", { className: classNames2.list, ...groupProps, children: [...section.props.children].map((node) => /* @__PURE__ */ jsx13(ListBoxOption, { item: node, state }, node.key)) })
|
|
666
579
|
] });
|
|
667
580
|
};
|
|
668
581
|
|
|
669
582
|
// src/ListBox/ListBox.tsx
|
|
670
|
-
import { jsx as
|
|
671
|
-
var ListBox =
|
|
583
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
584
|
+
var ListBox = forwardRef4(
|
|
672
585
|
({ state, variant, size, ...props }, ref) => {
|
|
673
|
-
const innerRef =
|
|
586
|
+
const innerRef = useObjectRef(ref);
|
|
674
587
|
const { listBoxProps } = useListBox(props, state, innerRef);
|
|
675
|
-
const classNames2 =
|
|
676
|
-
return /* @__PURE__ */
|
|
588
|
+
const classNames2 = useClassNames6({ component: "ListBox", variant, size });
|
|
589
|
+
return /* @__PURE__ */ jsx14(ListBoxContext.Provider, { value: { classNames: classNames2 }, children: /* @__PURE__ */ jsx14("div", { className: classNames2.container, children: /* @__PURE__ */ jsx14(
|
|
677
590
|
"ul",
|
|
678
591
|
{
|
|
679
592
|
className: cn8(
|
|
@@ -683,7 +596,7 @@ var ListBox = forwardRef5(
|
|
|
683
596
|
ref: innerRef,
|
|
684
597
|
...listBoxProps,
|
|
685
598
|
children: [...state.collection].map(
|
|
686
|
-
(item) => item.type === "section" ? /* @__PURE__ */
|
|
599
|
+
(item) => item.type === "section" ? /* @__PURE__ */ jsx14(ListBoxSection, { section: item, state }, item.key) : /* @__PURE__ */ jsx14(ListBoxOption, { item, state }, item.key)
|
|
687
600
|
)
|
|
688
601
|
}
|
|
689
602
|
) }) });
|
|
@@ -691,24 +604,24 @@ var ListBox = forwardRef5(
|
|
|
691
604
|
);
|
|
692
605
|
|
|
693
606
|
// src/Overlay/Modal.tsx
|
|
694
|
-
import { forwardRef as
|
|
607
|
+
import { forwardRef as forwardRef5 } from "react";
|
|
695
608
|
import { FocusScope } from "@react-aria/focus";
|
|
696
609
|
import { useModal, useOverlay, usePreventScroll } from "@react-aria/overlays";
|
|
697
|
-
import { mergeProps as
|
|
610
|
+
import { mergeProps as mergeProps4, useObjectRef as useObjectRef2 } from "@react-aria/utils";
|
|
698
611
|
|
|
699
612
|
// src/Overlay/Underlay.tsx
|
|
700
|
-
import { cn as cn9, useClassNames as
|
|
701
|
-
import { jsx as
|
|
613
|
+
import { cn as cn9, useClassNames as useClassNames7 } from "@marigold/system";
|
|
614
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
702
615
|
var Underlay = ({ size, variant, ...props }) => {
|
|
703
|
-
const classNames2 =
|
|
704
|
-
return /* @__PURE__ */
|
|
616
|
+
const classNames2 = useClassNames7({ component: "Underlay", size, variant });
|
|
617
|
+
return /* @__PURE__ */ jsx15("div", { className: cn9("fixed inset-0 z-40", classNames2), ...props });
|
|
705
618
|
};
|
|
706
619
|
|
|
707
620
|
// src/Overlay/Modal.tsx
|
|
708
|
-
import { jsx as
|
|
709
|
-
var Modal =
|
|
621
|
+
import { jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
622
|
+
var Modal = forwardRef5(
|
|
710
623
|
({ children, open, dismissable, keyboardDismissable, onClose, ...props }, ref) => {
|
|
711
|
-
const modalRef =
|
|
624
|
+
const modalRef = useObjectRef2(ref);
|
|
712
625
|
const { overlayProps, underlayProps } = useOverlay(
|
|
713
626
|
{
|
|
714
627
|
isOpen: open,
|
|
@@ -721,14 +634,14 @@ var Modal = forwardRef6(
|
|
|
721
634
|
usePreventScroll();
|
|
722
635
|
const { modalProps } = useModal({});
|
|
723
636
|
return /* @__PURE__ */ jsxs8(FocusScope, { contain: true, restoreFocus: true, autoFocus: true, children: [
|
|
724
|
-
/* @__PURE__ */
|
|
725
|
-
/* @__PURE__ */
|
|
637
|
+
/* @__PURE__ */ jsx16(Underlay, { ...underlayProps, variant: "modal" }),
|
|
638
|
+
/* @__PURE__ */ jsx16(
|
|
726
639
|
"div",
|
|
727
640
|
{
|
|
728
641
|
className: "pointer-none fixed inset-0 z-50 flex items-center justify-center",
|
|
729
642
|
ref: modalRef,
|
|
730
|
-
...
|
|
731
|
-
children: /* @__PURE__ */
|
|
643
|
+
...mergeProps4(props, overlayProps, modalProps),
|
|
644
|
+
children: /* @__PURE__ */ jsx16("div", { style: { pointerEvents: "auto" }, children })
|
|
732
645
|
}
|
|
733
646
|
)
|
|
734
647
|
] });
|
|
@@ -741,7 +654,7 @@ import {
|
|
|
741
654
|
Overlay as ReactAriaOverlay
|
|
742
655
|
} from "@react-aria/overlays";
|
|
743
656
|
import { useTheme } from "@marigold/system";
|
|
744
|
-
import { jsx as
|
|
657
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
745
658
|
var Overlay = ({ children, container, open }) => {
|
|
746
659
|
const nodeRef = useRef4(null);
|
|
747
660
|
const theme = useTheme();
|
|
@@ -749,7 +662,7 @@ var Overlay = ({ children, container, open }) => {
|
|
|
749
662
|
if (!mountOverlay) {
|
|
750
663
|
return null;
|
|
751
664
|
}
|
|
752
|
-
return /* @__PURE__ */
|
|
665
|
+
return /* @__PURE__ */ jsx17(ReactAriaOverlay, { portalContainer: container, children: /* @__PURE__ */ jsx17(
|
|
753
666
|
"div",
|
|
754
667
|
{
|
|
755
668
|
ref: nodeRef,
|
|
@@ -762,23 +675,23 @@ var Overlay = ({ children, container, open }) => {
|
|
|
762
675
|
};
|
|
763
676
|
|
|
764
677
|
// src/Overlay/Popover.tsx
|
|
765
|
-
import { forwardRef as
|
|
678
|
+
import { forwardRef as forwardRef6, useRef as useRef5 } from "react";
|
|
766
679
|
import { FocusScope as FocusScope2 } from "@react-aria/focus";
|
|
767
680
|
import {
|
|
768
681
|
DismissButton,
|
|
769
682
|
usePopover
|
|
770
683
|
} from "@react-aria/overlays";
|
|
771
|
-
import { useClassNames as
|
|
772
|
-
import { jsx as
|
|
773
|
-
var Popover =
|
|
684
|
+
import { useClassNames as useClassNames8 } from "@marigold/system";
|
|
685
|
+
import { jsx as jsx18, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
686
|
+
var Popover = forwardRef6(
|
|
774
687
|
(props, ref) => {
|
|
775
688
|
const fallbackRef = useRef5(null);
|
|
776
689
|
const popoverRef = ref || fallbackRef;
|
|
777
690
|
let { children, state, ...otherProps } = props;
|
|
778
|
-
return /* @__PURE__ */
|
|
691
|
+
return /* @__PURE__ */ jsx18(Overlay, { open: state.isOpen, ...otherProps, children: /* @__PURE__ */ jsx18(PopoverWrapper, { ref: popoverRef, ...props, children }) });
|
|
779
692
|
}
|
|
780
693
|
);
|
|
781
|
-
var PopoverWrapper =
|
|
694
|
+
var PopoverWrapper = forwardRef6(
|
|
782
695
|
({
|
|
783
696
|
children,
|
|
784
697
|
isNonModal,
|
|
@@ -796,12 +709,12 @@ var PopoverWrapper = forwardRef7(
|
|
|
796
709
|
},
|
|
797
710
|
state
|
|
798
711
|
);
|
|
799
|
-
const classNames2 =
|
|
712
|
+
const classNames2 = useClassNames8({
|
|
800
713
|
component: "Popover",
|
|
801
714
|
variant: placement
|
|
802
715
|
});
|
|
803
716
|
return /* @__PURE__ */ jsxs9(FocusScope2, { restoreFocus: true, children: [
|
|
804
|
-
!isNonModal && /* @__PURE__ */
|
|
717
|
+
!isNonModal && /* @__PURE__ */ jsx18(Underlay, { ...underlayProps }),
|
|
805
718
|
/* @__PURE__ */ jsxs9(
|
|
806
719
|
"div",
|
|
807
720
|
{
|
|
@@ -814,9 +727,9 @@ var PopoverWrapper = forwardRef7(
|
|
|
814
727
|
ref,
|
|
815
728
|
role: "presentation",
|
|
816
729
|
children: [
|
|
817
|
-
!isNonModal && /* @__PURE__ */
|
|
730
|
+
!isNonModal && /* @__PURE__ */ jsx18(DismissButton, { onDismiss: state.close }),
|
|
818
731
|
children,
|
|
819
|
-
/* @__PURE__ */
|
|
732
|
+
/* @__PURE__ */ jsx18(DismissButton, { onDismiss: state.close })
|
|
820
733
|
]
|
|
821
734
|
}
|
|
822
735
|
)
|
|
@@ -825,21 +738,21 @@ var PopoverWrapper = forwardRef7(
|
|
|
825
738
|
);
|
|
826
739
|
|
|
827
740
|
// src/Overlay/Tray.tsx
|
|
828
|
-
import { forwardRef as
|
|
741
|
+
import { forwardRef as forwardRef7 } from "react";
|
|
829
742
|
import { FocusScope as FocusScope3 } from "@react-aria/focus";
|
|
830
743
|
import {
|
|
831
744
|
DismissButton as DismissButton2,
|
|
832
745
|
useModalOverlay
|
|
833
746
|
} from "@react-aria/overlays";
|
|
834
|
-
import { useObjectRef as
|
|
835
|
-
import { jsx as
|
|
836
|
-
var Tray =
|
|
747
|
+
import { useObjectRef as useObjectRef3 } from "@react-aria/utils";
|
|
748
|
+
import { jsx as jsx19, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
749
|
+
var Tray = forwardRef7(
|
|
837
750
|
({ state, children, ...props }, ref) => {
|
|
838
|
-
const trayRef =
|
|
839
|
-
return /* @__PURE__ */
|
|
751
|
+
const trayRef = useObjectRef3(ref);
|
|
752
|
+
return /* @__PURE__ */ jsx19(Overlay, { open: state.isOpen, children: /* @__PURE__ */ jsx19(TrayWrapper, { state, ...props, ref: trayRef, children }) });
|
|
840
753
|
}
|
|
841
754
|
);
|
|
842
|
-
var TrayWrapper =
|
|
755
|
+
var TrayWrapper = forwardRef7(
|
|
843
756
|
({ children, state, ...props }, ref) => {
|
|
844
757
|
let { modalProps, underlayProps } = useModalOverlay(
|
|
845
758
|
{
|
|
@@ -849,7 +762,7 @@ var TrayWrapper = forwardRef8(
|
|
|
849
762
|
state,
|
|
850
763
|
ref
|
|
851
764
|
);
|
|
852
|
-
return /* @__PURE__ */
|
|
765
|
+
return /* @__PURE__ */ jsx19(FocusScope3, { contain: true, restoreFocus: true, autoFocus: true, children: /* @__PURE__ */ jsx19(Underlay, { ...underlayProps, variant: "modal", children: /* @__PURE__ */ jsxs10(
|
|
853
766
|
"div",
|
|
854
767
|
{
|
|
855
768
|
...modalProps,
|
|
@@ -857,9 +770,9 @@ var TrayWrapper = forwardRef8(
|
|
|
857
770
|
className: "absolute bottom-0 w-full",
|
|
858
771
|
"data-testid": "tray",
|
|
859
772
|
children: [
|
|
860
|
-
/* @__PURE__ */
|
|
773
|
+
/* @__PURE__ */ jsx19(DismissButton2, { onDismiss: state.close }),
|
|
861
774
|
children,
|
|
862
|
-
/* @__PURE__ */
|
|
775
|
+
/* @__PURE__ */ jsx19(DismissButton2, { onDismiss: state.close })
|
|
863
776
|
]
|
|
864
777
|
}
|
|
865
778
|
) }) });
|
|
@@ -868,12 +781,12 @@ var TrayWrapper = forwardRef8(
|
|
|
868
781
|
|
|
869
782
|
// src/Autocomplete/ClearButton.tsx
|
|
870
783
|
import { useRef as useRef6 } from "react";
|
|
871
|
-
import { useButton as
|
|
872
|
-
import { useFocusRing as
|
|
873
|
-
import { useHover
|
|
874
|
-
import { mergeProps as
|
|
875
|
-
import { cn as cn10, useStateProps as
|
|
876
|
-
import { jsx as
|
|
784
|
+
import { useButton as useButton2 } from "@react-aria/button";
|
|
785
|
+
import { useFocusRing as useFocusRing2 } from "@react-aria/focus";
|
|
786
|
+
import { useHover } from "@react-aria/interactions";
|
|
787
|
+
import { mergeProps as mergeProps5 } from "@react-aria/utils";
|
|
788
|
+
import { cn as cn10, useStateProps as useStateProps3 } from "@marigold/system";
|
|
789
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
877
790
|
var ClearButton = ({
|
|
878
791
|
preventFocus,
|
|
879
792
|
disabled,
|
|
@@ -889,11 +802,11 @@ var ClearButton = ({
|
|
|
889
802
|
...props
|
|
890
803
|
}) => {
|
|
891
804
|
const buttonRef = useRef6(null);
|
|
892
|
-
const { hoverProps, isHovered } =
|
|
893
|
-
const { isFocusVisible, focusProps } =
|
|
805
|
+
const { hoverProps, isHovered } = useHover({ isDisabled: disabled });
|
|
806
|
+
const { isFocusVisible, focusProps } = useFocusRing2({
|
|
894
807
|
autoFocus: props.autoFocus
|
|
895
808
|
});
|
|
896
|
-
const { buttonProps, isPressed } =
|
|
809
|
+
const { buttonProps, isPressed } = useButton2(
|
|
897
810
|
{
|
|
898
811
|
...props,
|
|
899
812
|
onClick,
|
|
@@ -911,22 +824,22 @@ var ClearButton = ({
|
|
|
911
824
|
if (preventFocus) {
|
|
912
825
|
delete buttonProps.tabIndex;
|
|
913
826
|
}
|
|
914
|
-
const stateProps =
|
|
827
|
+
const stateProps = useStateProps3({
|
|
915
828
|
active: isPressed,
|
|
916
829
|
focusVisible: isFocusVisible,
|
|
917
830
|
hover: isHovered
|
|
918
831
|
});
|
|
919
|
-
return /* @__PURE__ */
|
|
832
|
+
return /* @__PURE__ */ jsx20(
|
|
920
833
|
"button",
|
|
921
834
|
{
|
|
922
|
-
...
|
|
835
|
+
...mergeProps5(buttonProps, focusProps, hoverProps, props),
|
|
923
836
|
...stateProps,
|
|
924
837
|
ref: buttonRef,
|
|
925
838
|
className: cn10(
|
|
926
839
|
"cursor-pointer appearance-none border-none p-0 pr-1",
|
|
927
840
|
className
|
|
928
841
|
),
|
|
929
|
-
children: /* @__PURE__ */
|
|
842
|
+
children: /* @__PURE__ */ jsx20(
|
|
930
843
|
"svg",
|
|
931
844
|
{
|
|
932
845
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -934,7 +847,7 @@ var ClearButton = ({
|
|
|
934
847
|
fill: "currentColor",
|
|
935
848
|
width: 20,
|
|
936
849
|
height: 20,
|
|
937
|
-
children: /* @__PURE__ */
|
|
850
|
+
children: /* @__PURE__ */ jsx20("path", { d: "M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" })
|
|
938
851
|
}
|
|
939
852
|
)
|
|
940
853
|
}
|
|
@@ -942,8 +855,8 @@ var ClearButton = ({
|
|
|
942
855
|
};
|
|
943
856
|
|
|
944
857
|
// src/Autocomplete/Autocomplete.tsx
|
|
945
|
-
import { Fragment as Fragment2, jsx as
|
|
946
|
-
var SearchIcon = (props) => /* @__PURE__ */
|
|
858
|
+
import { Fragment as Fragment2, jsx as jsx21, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
859
|
+
var SearchIcon = (props) => /* @__PURE__ */ jsx21(
|
|
947
860
|
"svg",
|
|
948
861
|
{
|
|
949
862
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -952,7 +865,7 @@ var SearchIcon = (props) => /* @__PURE__ */ jsx22(
|
|
|
952
865
|
width: 24,
|
|
953
866
|
height: 24,
|
|
954
867
|
...props,
|
|
955
|
-
children: /* @__PURE__ */
|
|
868
|
+
children: /* @__PURE__ */ jsx21("path", { d: "M16.1865 14.5142H15.3057L14.9936 14.2131C16.0862 12.9421 16.744 11.292 16.744 9.497C16.744 5.49443 13.4996 2.25 9.497 2.25C5.49443 2.25 2.25 5.49443 2.25 9.497C2.25 13.4996 5.49443 16.744 9.497 16.744C11.292 16.744 12.9421 16.0862 14.2131 14.9936L14.5142 15.3057V16.1865L20.0888 21.75L21.75 20.0888L16.1865 14.5142ZM9.49701 14.5142C6.72085 14.5142 4.47986 12.2732 4.47986 9.49701C4.47986 6.72085 6.72085 4.47986 9.49701 4.47986C12.2732 4.47986 14.5142 6.72085 14.5142 9.49701C14.5142 12.2732 12.2732 14.5142 9.49701 14.5142Z" })
|
|
956
869
|
}
|
|
957
870
|
);
|
|
958
871
|
var Autocomplete = ({
|
|
@@ -1008,7 +921,7 @@ var Autocomplete = ({
|
|
|
1008
921
|
);
|
|
1009
922
|
const { isDisabled, ...restClearButtonProps } = clearButtonProps;
|
|
1010
923
|
return /* @__PURE__ */ jsxs11(Fragment2, { children: [
|
|
1011
|
-
/* @__PURE__ */
|
|
924
|
+
/* @__PURE__ */ jsx21(
|
|
1012
925
|
FieldBase,
|
|
1013
926
|
{
|
|
1014
927
|
label: props.label,
|
|
@@ -1018,13 +931,13 @@ var Autocomplete = ({
|
|
|
1018
931
|
errorMessage: props.errorMessage,
|
|
1019
932
|
disabled,
|
|
1020
933
|
width,
|
|
1021
|
-
children: /* @__PURE__ */
|
|
934
|
+
children: /* @__PURE__ */ jsx21(
|
|
1022
935
|
Input,
|
|
1023
936
|
{
|
|
1024
937
|
...inputProps,
|
|
1025
938
|
ref: inputRef,
|
|
1026
|
-
icon: /* @__PURE__ */
|
|
1027
|
-
action: state.inputValue !== "" ? /* @__PURE__ */
|
|
939
|
+
icon: /* @__PURE__ */ jsx21(SearchIcon, {}),
|
|
940
|
+
action: state.inputValue !== "" ? /* @__PURE__ */ jsx21(
|
|
1028
941
|
ClearButton,
|
|
1029
942
|
{
|
|
1030
943
|
preventFocus: true,
|
|
@@ -1036,7 +949,7 @@ var Autocomplete = ({
|
|
|
1036
949
|
)
|
|
1037
950
|
}
|
|
1038
951
|
),
|
|
1039
|
-
/* @__PURE__ */
|
|
952
|
+
/* @__PURE__ */ jsx21(
|
|
1040
953
|
Popover,
|
|
1041
954
|
{
|
|
1042
955
|
state,
|
|
@@ -1044,7 +957,7 @@ var Autocomplete = ({
|
|
|
1044
957
|
triggerRef: inputRef,
|
|
1045
958
|
scrollRef: listBoxRef,
|
|
1046
959
|
isNonModal: true,
|
|
1047
|
-
children: /* @__PURE__ */
|
|
960
|
+
children: /* @__PURE__ */ jsx21(ListBox, { ref: listBoxRef, state, ...listBoxProps })
|
|
1048
961
|
}
|
|
1049
962
|
)
|
|
1050
963
|
] });
|
|
@@ -1053,11 +966,41 @@ Autocomplete.Item = Item2;
|
|
|
1053
966
|
|
|
1054
967
|
// src/ComboBox/ComboBox.tsx
|
|
1055
968
|
import React from "react";
|
|
1056
|
-
import { useButton as useButton4 } from "@react-aria/button";
|
|
1057
969
|
import { useComboBox } from "@react-aria/combobox";
|
|
1058
970
|
import { useFilter as useFilter2 } from "@react-aria/i18n";
|
|
1059
971
|
import { Item as Item3 } from "@react-stately/collections";
|
|
1060
972
|
import { useComboBoxState as useComboBoxState2 } from "@react-stately/combobox";
|
|
973
|
+
|
|
974
|
+
// src/Button/Button.tsx
|
|
975
|
+
import { forwardRef as forwardRef8 } from "react";
|
|
976
|
+
import { Button } from "react-aria-components";
|
|
977
|
+
import { cn as cn11, useClassNames as useClassNames9 } from "@marigold/system";
|
|
978
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
979
|
+
var _Button = forwardRef8(
|
|
980
|
+
({ children, variant, size, disabled, fullWidth, ...props }, ref) => {
|
|
981
|
+
const classNames2 = useClassNames9({
|
|
982
|
+
component: "Button",
|
|
983
|
+
variant,
|
|
984
|
+
size
|
|
985
|
+
});
|
|
986
|
+
return /* @__PURE__ */ jsx22(
|
|
987
|
+
Button,
|
|
988
|
+
{
|
|
989
|
+
...props,
|
|
990
|
+
ref,
|
|
991
|
+
className: cn11(
|
|
992
|
+
"inline-flex items-center justify-center gap-[0.5ch]",
|
|
993
|
+
classNames2,
|
|
994
|
+
fullWidth ? "w-full" : void 0
|
|
995
|
+
),
|
|
996
|
+
isDisabled: disabled,
|
|
997
|
+
children
|
|
998
|
+
}
|
|
999
|
+
);
|
|
1000
|
+
}
|
|
1001
|
+
);
|
|
1002
|
+
|
|
1003
|
+
// src/ComboBox/ComboBox.tsx
|
|
1061
1004
|
import { Fragment as Fragment3, jsx as jsx23, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1062
1005
|
var ComboBox = ({
|
|
1063
1006
|
error,
|
|
@@ -1097,7 +1040,6 @@ var ComboBox = ({
|
|
|
1097
1040
|
state
|
|
1098
1041
|
);
|
|
1099
1042
|
const errorMessageProps = { "aria-invalid": error };
|
|
1100
|
-
const { buttonProps } = useButton4(triggerProps, buttonRef);
|
|
1101
1043
|
const { label, description, errorMessage } = props;
|
|
1102
1044
|
return /* @__PURE__ */ jsxs12(Fragment3, { children: [
|
|
1103
1045
|
/* @__PURE__ */ jsx23(
|
|
@@ -1116,11 +1058,11 @@ var ComboBox = ({
|
|
|
1116
1058
|
...inputProps,
|
|
1117
1059
|
ref: inputRef,
|
|
1118
1060
|
action: /* @__PURE__ */ jsx23(
|
|
1119
|
-
|
|
1061
|
+
_Button,
|
|
1120
1062
|
{
|
|
1121
1063
|
className: "absolute right-2 h-4 w-4 border-none bg-transparent p-0",
|
|
1122
1064
|
ref: buttonRef,
|
|
1123
|
-
...
|
|
1065
|
+
...triggerProps,
|
|
1124
1066
|
children: /* @__PURE__ */ jsx23(ChevronDown, { className: "h-4 w-4" })
|
|
1125
1067
|
}
|
|
1126
1068
|
)
|
|
@@ -1152,7 +1094,7 @@ var Badge = ({ variant, size, children, ...props }) => {
|
|
|
1152
1094
|
};
|
|
1153
1095
|
|
|
1154
1096
|
// src/Breakout/Breakout.tsx
|
|
1155
|
-
import { alignment, cn as
|
|
1097
|
+
import { alignment, cn as cn12, createVar as createVar4 } from "@marigold/system";
|
|
1156
1098
|
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1157
1099
|
var Breakout = ({
|
|
1158
1100
|
height,
|
|
@@ -1166,7 +1108,7 @@ var Breakout = ({
|
|
|
1166
1108
|
return /* @__PURE__ */ jsx25(
|
|
1167
1109
|
"div",
|
|
1168
1110
|
{
|
|
1169
|
-
className:
|
|
1111
|
+
className: cn12(
|
|
1170
1112
|
"col-start-[1_!important] col-end-[-1_!important] w-full",
|
|
1171
1113
|
alignX && ((_b = (_a = alignment) == null ? void 0 : _a.horizontal) == null ? void 0 : _b.alignmentX[alignX]),
|
|
1172
1114
|
alignY && ((_d = (_c = alignment) == null ? void 0 : _c.horizontal) == null ? void 0 : _d.alignmentY[alignY]),
|
|
@@ -1190,7 +1132,7 @@ var Body = ({ children, variant, size, ...props }) => {
|
|
|
1190
1132
|
|
|
1191
1133
|
// src/Card/Card.tsx
|
|
1192
1134
|
import {
|
|
1193
|
-
cn as
|
|
1135
|
+
cn as cn13,
|
|
1194
1136
|
gapSpace as gapSpace2,
|
|
1195
1137
|
paddingBottom,
|
|
1196
1138
|
paddingLeft,
|
|
@@ -1221,7 +1163,7 @@ var Card = ({
|
|
|
1221
1163
|
"div",
|
|
1222
1164
|
{
|
|
1223
1165
|
...props,
|
|
1224
|
-
className:
|
|
1166
|
+
className: cn13(
|
|
1225
1167
|
"flex flex-col",
|
|
1226
1168
|
classNames2,
|
|
1227
1169
|
gapSpace2[space],
|
|
@@ -1239,7 +1181,7 @@ var Card = ({
|
|
|
1239
1181
|
};
|
|
1240
1182
|
|
|
1241
1183
|
// src/Center/Center.tsx
|
|
1242
|
-
import { cn as
|
|
1184
|
+
import { cn as cn14, createVar as createVar5, gapSpace as gapSpace3 } from "@marigold/system";
|
|
1243
1185
|
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
1244
1186
|
var Center = ({
|
|
1245
1187
|
maxWidth = "100%",
|
|
@@ -1251,7 +1193,7 @@ var Center = ({
|
|
|
1251
1193
|
"div",
|
|
1252
1194
|
{
|
|
1253
1195
|
...props,
|
|
1254
|
-
className:
|
|
1196
|
+
className: cn14(
|
|
1255
1197
|
"me-[auto] ms-[auto] box-content flex flex-col items-center justify-center",
|
|
1256
1198
|
gapSpace3[space],
|
|
1257
1199
|
"max-w-[--maxWidth]"
|
|
@@ -1264,27 +1206,92 @@ var Center = ({
|
|
|
1264
1206
|
|
|
1265
1207
|
// src/Checkbox/Checkbox.tsx
|
|
1266
1208
|
import { forwardRef as forwardRef9 } from "react";
|
|
1267
|
-
import {
|
|
1268
|
-
import {
|
|
1269
|
-
import {
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
}
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1209
|
+
import { Checkbox } from "react-aria-components";
|
|
1210
|
+
import { cn as cn15, useClassNames as useClassNames13 } from "@marigold/system";
|
|
1211
|
+
import { Fragment as Fragment4, jsx as jsx29, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1212
|
+
var CheckMark = () => /* @__PURE__ */ jsx29("svg", { viewBox: "0 0 12 10", children: /* @__PURE__ */ jsx29(
|
|
1213
|
+
"path",
|
|
1214
|
+
{
|
|
1215
|
+
fill: "currentColor",
|
|
1216
|
+
stroke: "none",
|
|
1217
|
+
d: "M11.915 1.548 10.367 0 4.045 6.315 1.557 3.827 0 5.373l4.045 4.046 7.87-7.871Z"
|
|
1218
|
+
}
|
|
1219
|
+
) });
|
|
1220
|
+
var IndeterminateMark = () => /* @__PURE__ */ jsx29("svg", { width: "12", height: "3", viewBox: "0 0 12 3", children: /* @__PURE__ */ jsx29(
|
|
1221
|
+
"path",
|
|
1222
|
+
{
|
|
1223
|
+
fill: "currentColor",
|
|
1224
|
+
stroke: "none",
|
|
1225
|
+
d: "M11.5 2.04018H0.5V0.46875H11.5V2.04018Z"
|
|
1226
|
+
}
|
|
1227
|
+
) });
|
|
1228
|
+
var Icon = ({ className, checked, indeterminate, ...props }) => {
|
|
1229
|
+
return /* @__PURE__ */ jsx29(
|
|
1230
|
+
"div",
|
|
1231
|
+
{
|
|
1232
|
+
"aria-hidden": "true",
|
|
1233
|
+
className: cn15(
|
|
1234
|
+
"flex shrink-0 grow-0 basis-4 items-center justify-center",
|
|
1235
|
+
"h-4 w-4 p-px",
|
|
1236
|
+
"bg-white",
|
|
1237
|
+
"rounded-[3px] border border-solid border-black ",
|
|
1238
|
+
className
|
|
1239
|
+
),
|
|
1240
|
+
...props,
|
|
1241
|
+
children: indeterminate ? /* @__PURE__ */ jsx29(IndeterminateMark, {}) : checked ? /* @__PURE__ */ jsx29(CheckMark, {}) : null
|
|
1242
|
+
}
|
|
1243
|
+
);
|
|
1287
1244
|
};
|
|
1245
|
+
var _Checkbox = forwardRef9(
|
|
1246
|
+
({
|
|
1247
|
+
className,
|
|
1248
|
+
indeterminate,
|
|
1249
|
+
error,
|
|
1250
|
+
disabled,
|
|
1251
|
+
defaultChecked,
|
|
1252
|
+
children,
|
|
1253
|
+
checked,
|
|
1254
|
+
readOnly,
|
|
1255
|
+
required,
|
|
1256
|
+
variant,
|
|
1257
|
+
size,
|
|
1258
|
+
...rest
|
|
1259
|
+
}, ref) => {
|
|
1260
|
+
const props = {
|
|
1261
|
+
isIndeterminate: indeterminate,
|
|
1262
|
+
isDisabled: disabled,
|
|
1263
|
+
isReadOnly: readOnly,
|
|
1264
|
+
isRequired: required,
|
|
1265
|
+
isInvalid: error,
|
|
1266
|
+
defaultSelected: defaultChecked,
|
|
1267
|
+
...rest
|
|
1268
|
+
};
|
|
1269
|
+
const classNames2 = useClassNames13({ component: "Checkbox", variant, size });
|
|
1270
|
+
return /* @__PURE__ */ jsx29(
|
|
1271
|
+
Checkbox,
|
|
1272
|
+
{
|
|
1273
|
+
ref,
|
|
1274
|
+
className: cn15(
|
|
1275
|
+
"group/checkbox flex items-center gap-[0.5rem]",
|
|
1276
|
+
"cursor-pointer data-[disabled]:cursor-not-allowed",
|
|
1277
|
+
classNames2.container
|
|
1278
|
+
),
|
|
1279
|
+
...props,
|
|
1280
|
+
children: ({ isSelected, isIndeterminate }) => /* @__PURE__ */ jsxs13(Fragment4, { children: [
|
|
1281
|
+
/* @__PURE__ */ jsx29(
|
|
1282
|
+
Icon,
|
|
1283
|
+
{
|
|
1284
|
+
checked: isSelected,
|
|
1285
|
+
indeterminate: isIndeterminate,
|
|
1286
|
+
className: classNames2.checkbox
|
|
1287
|
+
}
|
|
1288
|
+
),
|
|
1289
|
+
/* @__PURE__ */ jsx29("div", { className: classNames2.label, children })
|
|
1290
|
+
] })
|
|
1291
|
+
}
|
|
1292
|
+
);
|
|
1293
|
+
}
|
|
1294
|
+
);
|
|
1288
1295
|
|
|
1289
1296
|
// src/Checkbox/CheckboxGroup.tsx
|
|
1290
1297
|
import { createContext as createContext3, useContext as useContext3 } from "react";
|
|
@@ -1292,13 +1299,15 @@ import { useCheckboxGroup } from "@react-aria/checkbox";
|
|
|
1292
1299
|
import {
|
|
1293
1300
|
useCheckboxGroupState
|
|
1294
1301
|
} from "@react-stately/checkbox";
|
|
1295
|
-
import { useStateProps as
|
|
1302
|
+
import { useClassNames as useClassNames14, useStateProps as useStateProps4 } from "@marigold/system";
|
|
1296
1303
|
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
1297
1304
|
var CheckboxGroupContext = createContext3(
|
|
1298
1305
|
null
|
|
1299
1306
|
);
|
|
1300
1307
|
var useCheckboxGroupContext = () => useContext3(CheckboxGroupContext);
|
|
1301
1308
|
var CheckboxGroup = ({
|
|
1309
|
+
variant,
|
|
1310
|
+
size,
|
|
1302
1311
|
children,
|
|
1303
1312
|
required,
|
|
1304
1313
|
disabled,
|
|
@@ -1316,7 +1325,13 @@ var CheckboxGroup = ({
|
|
|
1316
1325
|
};
|
|
1317
1326
|
const state = useCheckboxGroupState(props);
|
|
1318
1327
|
const { groupProps, labelProps, descriptionProps, errorMessageProps } = useCheckboxGroup(props, state);
|
|
1319
|
-
const
|
|
1328
|
+
const classNames2 = useClassNames14({
|
|
1329
|
+
component: "Checkbox",
|
|
1330
|
+
variant,
|
|
1331
|
+
size,
|
|
1332
|
+
className: { group: "flex flex-col items-start gap-[0.5ch]" }
|
|
1333
|
+
});
|
|
1334
|
+
const stateProps = useStateProps4({
|
|
1320
1335
|
disabled,
|
|
1321
1336
|
readOnly,
|
|
1322
1337
|
error
|
|
@@ -1325,7 +1340,7 @@ var CheckboxGroup = ({
|
|
|
1325
1340
|
FieldBase,
|
|
1326
1341
|
{
|
|
1327
1342
|
label: props.label,
|
|
1328
|
-
labelProps: {
|
|
1343
|
+
labelProps: { elementType: "span", ...labelProps },
|
|
1329
1344
|
description: props.description,
|
|
1330
1345
|
descriptionProps,
|
|
1331
1346
|
error,
|
|
@@ -1335,149 +1350,15 @@ var CheckboxGroup = ({
|
|
|
1335
1350
|
stateProps,
|
|
1336
1351
|
width,
|
|
1337
1352
|
...groupProps,
|
|
1338
|
-
children: /* @__PURE__ */ jsx30("div", { role: "presentation", className:
|
|
1339
|
-
}
|
|
1340
|
-
);
|
|
1341
|
-
};
|
|
1342
|
-
|
|
1343
|
-
// src/Checkbox/Checkbox.tsx
|
|
1344
|
-
import { jsx as jsx31, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1345
|
-
var CheckMark = () => /* @__PURE__ */ jsx31("svg", { viewBox: "0 0 12 10", children: /* @__PURE__ */ jsx31(
|
|
1346
|
-
"path",
|
|
1347
|
-
{
|
|
1348
|
-
fill: "currentColor",
|
|
1349
|
-
stroke: "none",
|
|
1350
|
-
d: "M11.915 1.548 10.367 0 4.045 6.315 1.557 3.827 0 5.373l4.045 4.046 7.87-7.871Z"
|
|
1351
|
-
}
|
|
1352
|
-
) });
|
|
1353
|
-
var IndeterminateMark = () => /* @__PURE__ */ jsx31("svg", { width: "12", height: "3", viewBox: "0 0 12 3", children: /* @__PURE__ */ jsx31(
|
|
1354
|
-
"path",
|
|
1355
|
-
{
|
|
1356
|
-
fill: "currentColor",
|
|
1357
|
-
stroke: "none",
|
|
1358
|
-
d: "M11.5 2.04018H0.5V0.46875H11.5V2.04018Z"
|
|
1359
|
-
}
|
|
1360
|
-
) });
|
|
1361
|
-
var Icon = ({ className, checked, indeterminate, ...props }) => {
|
|
1362
|
-
return /* @__PURE__ */ jsx31(
|
|
1363
|
-
"div",
|
|
1364
|
-
{
|
|
1365
|
-
"aria-hidden": "true",
|
|
1366
|
-
className: cn14(
|
|
1367
|
-
"flex shrink-0 grow-0 basis-4 items-center justify-center",
|
|
1368
|
-
"h-4 w-4 p-px",
|
|
1369
|
-
"bg-white",
|
|
1370
|
-
"rounded-[3px] border border-solid border-black",
|
|
1371
|
-
className
|
|
1372
|
-
),
|
|
1373
|
-
...props,
|
|
1374
|
-
children: indeterminate ? /* @__PURE__ */ jsx31(IndeterminateMark, {}) : checked ? /* @__PURE__ */ jsx31(CheckMark, {}) : null
|
|
1353
|
+
children: /* @__PURE__ */ jsx30("div", { role: "presentation", className: classNames2.group, children: /* @__PURE__ */ jsx30(CheckboxGroupContext.Provider, { value: { error, ...state }, children }) })
|
|
1375
1354
|
}
|
|
1376
1355
|
);
|
|
1377
1356
|
};
|
|
1378
|
-
var Checkbox = forwardRef9(
|
|
1379
|
-
({
|
|
1380
|
-
size,
|
|
1381
|
-
variant,
|
|
1382
|
-
disabled,
|
|
1383
|
-
checked,
|
|
1384
|
-
defaultChecked,
|
|
1385
|
-
indeterminate,
|
|
1386
|
-
readOnly,
|
|
1387
|
-
required,
|
|
1388
|
-
error,
|
|
1389
|
-
...props
|
|
1390
|
-
}, ref) => {
|
|
1391
|
-
const inputRef = useObjectRef5(ref);
|
|
1392
|
-
const checkboxProps = {
|
|
1393
|
-
isIndeterminate: indeterminate,
|
|
1394
|
-
isDisabled: disabled,
|
|
1395
|
-
isReadOnly: readOnly,
|
|
1396
|
-
isRequired: required,
|
|
1397
|
-
validationState: error ? "invalid" : "valid"
|
|
1398
|
-
};
|
|
1399
|
-
const groupState = useCheckboxGroupContext();
|
|
1400
|
-
const { inputProps } = groupState ? useCheckboxGroupItem(
|
|
1401
|
-
{
|
|
1402
|
-
...props,
|
|
1403
|
-
...checkboxProps,
|
|
1404
|
-
/**
|
|
1405
|
-
* value is optional for standalone checkboxes, but required when
|
|
1406
|
-
* used inside a group.
|
|
1407
|
-
*/
|
|
1408
|
-
value: props.value
|
|
1409
|
-
},
|
|
1410
|
-
groupState,
|
|
1411
|
-
inputRef
|
|
1412
|
-
) : useCheckbox(
|
|
1413
|
-
{
|
|
1414
|
-
isSelected: checked,
|
|
1415
|
-
defaultSelected: defaultChecked,
|
|
1416
|
-
...checkboxProps,
|
|
1417
|
-
...props
|
|
1418
|
-
},
|
|
1419
|
-
useToggleState({
|
|
1420
|
-
isSelected: checked,
|
|
1421
|
-
defaultSelected: defaultChecked,
|
|
1422
|
-
isReadOnly: readOnly,
|
|
1423
|
-
...props
|
|
1424
|
-
}),
|
|
1425
|
-
inputRef
|
|
1426
|
-
);
|
|
1427
|
-
const classNames2 = useClassNames14({ component: "Checkbox", variant, size });
|
|
1428
|
-
const { hoverProps, isHovered } = useHover3({
|
|
1429
|
-
isDisabled: inputProps.disabled
|
|
1430
|
-
});
|
|
1431
|
-
const { labelWidth } = useFieldGroupContext();
|
|
1432
|
-
const { isFocusVisible, focusProps } = useFocusRing4();
|
|
1433
|
-
const stateProps = useStateProps6({
|
|
1434
|
-
hover: isHovered,
|
|
1435
|
-
focus: isFocusVisible,
|
|
1436
|
-
checked: inputProps.checked,
|
|
1437
|
-
disabled: inputProps.disabled,
|
|
1438
|
-
error: (groupState == null ? void 0 : groupState.error) || error,
|
|
1439
|
-
readOnly,
|
|
1440
|
-
indeterminate
|
|
1441
|
-
});
|
|
1442
|
-
const component = /* @__PURE__ */ jsxs14(
|
|
1443
|
-
"label",
|
|
1444
|
-
{
|
|
1445
|
-
className: cn14(
|
|
1446
|
-
"group/checkbox relative flex items-center gap-[1ch]",
|
|
1447
|
-
classNames2.container
|
|
1448
|
-
),
|
|
1449
|
-
...hoverProps,
|
|
1450
|
-
...stateProps,
|
|
1451
|
-
children: [
|
|
1452
|
-
/* @__PURE__ */ jsx31(
|
|
1453
|
-
"input",
|
|
1454
|
-
{
|
|
1455
|
-
ref: inputRef,
|
|
1456
|
-
className: "z-1 absolute left-0 top-0 h-full w-full cursor-pointer opacity-[0.0001] group-disabled/checkbox:cursor-not-allowed",
|
|
1457
|
-
...inputProps,
|
|
1458
|
-
...focusProps
|
|
1459
|
-
}
|
|
1460
|
-
),
|
|
1461
|
-
/* @__PURE__ */ jsx31(
|
|
1462
|
-
Icon,
|
|
1463
|
-
{
|
|
1464
|
-
checked: inputProps.checked,
|
|
1465
|
-
indeterminate,
|
|
1466
|
-
className: classNames2.checkbox
|
|
1467
|
-
}
|
|
1468
|
-
),
|
|
1469
|
-
props.children && /* @__PURE__ */ jsx31("div", { className: classNames2.label, children: props.children })
|
|
1470
|
-
]
|
|
1471
|
-
}
|
|
1472
|
-
);
|
|
1473
|
-
return !groupState && labelWidth ? /* @__PURE__ */ jsx31(CheckboxField, { labelWidth, children: component }) : component;
|
|
1474
|
-
}
|
|
1475
|
-
);
|
|
1476
1357
|
|
|
1477
1358
|
// src/Columns/Columns.tsx
|
|
1478
1359
|
import { Children as Children3, cloneElement as cloneElement3, isValidElement as isValidElement2 } from "react";
|
|
1479
|
-
import { cn as
|
|
1480
|
-
import { jsx as
|
|
1360
|
+
import { cn as cn16, createVar as createVar6, gapSpace as gapSpace4 } from "@marigold/system";
|
|
1361
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
1481
1362
|
var Columns = ({
|
|
1482
1363
|
space = 0,
|
|
1483
1364
|
columns,
|
|
@@ -1493,22 +1374,22 @@ var Columns = ({
|
|
|
1493
1374
|
)}`
|
|
1494
1375
|
);
|
|
1495
1376
|
}
|
|
1496
|
-
return /* @__PURE__ */
|
|
1377
|
+
return /* @__PURE__ */ jsx31(
|
|
1497
1378
|
"div",
|
|
1498
1379
|
{
|
|
1499
|
-
className:
|
|
1380
|
+
className: cn16(
|
|
1500
1381
|
"flex flex-wrap items-stretch",
|
|
1501
1382
|
stretch && "h-full",
|
|
1502
1383
|
gapSpace4[space]
|
|
1503
1384
|
),
|
|
1504
1385
|
...props,
|
|
1505
|
-
children: Children3.map(children, (child, idx) => /* @__PURE__ */
|
|
1386
|
+
children: Children3.map(children, (child, idx) => /* @__PURE__ */ jsx31(
|
|
1506
1387
|
"div",
|
|
1507
1388
|
{
|
|
1508
|
-
className:
|
|
1389
|
+
className: cn16(
|
|
1509
1390
|
"grow-[--columnSize] basis-[calc((var(--collapseAt)_-_100%)_*_999)]"
|
|
1510
1391
|
),
|
|
1511
|
-
style:
|
|
1392
|
+
style: createVar6({ collapseAt, columnSize: columns[idx] }),
|
|
1512
1393
|
children: isValidElement2(child) ? cloneElement3(child) : child
|
|
1513
1394
|
}
|
|
1514
1395
|
))
|
|
@@ -1518,13 +1399,13 @@ var Columns = ({
|
|
|
1518
1399
|
|
|
1519
1400
|
// src/Container/Container.tsx
|
|
1520
1401
|
import {
|
|
1521
|
-
cn as
|
|
1522
|
-
createVar as
|
|
1402
|
+
cn as cn17,
|
|
1403
|
+
createVar as createVar7,
|
|
1523
1404
|
gridColsAlign,
|
|
1524
1405
|
gridColumn,
|
|
1525
1406
|
placeItems
|
|
1526
1407
|
} from "@marigold/system";
|
|
1527
|
-
import { jsx as
|
|
1408
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
1528
1409
|
var content = {
|
|
1529
1410
|
small: "20ch",
|
|
1530
1411
|
medium: "45ch",
|
|
@@ -1544,17 +1425,17 @@ var Container = ({
|
|
|
1544
1425
|
...props
|
|
1545
1426
|
}) => {
|
|
1546
1427
|
const maxWidth = contentType === "content" ? content[size] : header[size];
|
|
1547
|
-
return /* @__PURE__ */
|
|
1428
|
+
return /* @__PURE__ */ jsx32(
|
|
1548
1429
|
"div",
|
|
1549
1430
|
{
|
|
1550
1431
|
...props,
|
|
1551
|
-
className:
|
|
1432
|
+
className: cn17(
|
|
1552
1433
|
"grid",
|
|
1553
1434
|
placeItems[alignItems],
|
|
1554
1435
|
gridColsAlign[align],
|
|
1555
1436
|
gridColumn[align]
|
|
1556
1437
|
),
|
|
1557
|
-
style:
|
|
1438
|
+
style: createVar7({ maxWidth }),
|
|
1558
1439
|
children
|
|
1559
1440
|
}
|
|
1560
1441
|
);
|
|
@@ -1567,40 +1448,40 @@ import {
|
|
|
1567
1448
|
isValidElement as isValidElement3,
|
|
1568
1449
|
useRef as useRef9
|
|
1569
1450
|
} from "react";
|
|
1570
|
-
import { useButton as
|
|
1451
|
+
import { useButton as useButton3 } from "@react-aria/button";
|
|
1571
1452
|
import { useDialog } from "@react-aria/dialog";
|
|
1572
|
-
import { cn as
|
|
1453
|
+
import { cn as cn20, useClassNames as useClassNames17 } from "@marigold/system";
|
|
1573
1454
|
|
|
1574
1455
|
// src/Header/Header.tsx
|
|
1575
|
-
import { cn as
|
|
1576
|
-
import { jsx as
|
|
1456
|
+
import { cn as cn18, useClassNames as useClassNames15 } from "@marigold/system";
|
|
1457
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
1577
1458
|
var Header = ({ children, variant, size, ...props }) => {
|
|
1578
1459
|
const classNames2 = useClassNames15({
|
|
1579
1460
|
component: "Header",
|
|
1580
1461
|
variant,
|
|
1581
1462
|
size
|
|
1582
1463
|
});
|
|
1583
|
-
return /* @__PURE__ */
|
|
1464
|
+
return /* @__PURE__ */ jsx33("header", { ...props, className: cn18(classNames2), children });
|
|
1584
1465
|
};
|
|
1585
1466
|
|
|
1586
1467
|
// src/Headline/Headline.tsx
|
|
1468
|
+
import { Heading } from "react-aria-components";
|
|
1587
1469
|
import {
|
|
1588
|
-
cn as
|
|
1589
|
-
createVar as
|
|
1470
|
+
cn as cn19,
|
|
1471
|
+
createVar as createVar8,
|
|
1590
1472
|
get,
|
|
1591
1473
|
textAlign,
|
|
1592
1474
|
useClassNames as useClassNames16,
|
|
1593
1475
|
useTheme as useTheme2
|
|
1594
1476
|
} from "@marigold/system";
|
|
1595
|
-
import { jsx as
|
|
1596
|
-
var
|
|
1597
|
-
children,
|
|
1477
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
1478
|
+
var _Headline = ({
|
|
1598
1479
|
variant,
|
|
1599
1480
|
size,
|
|
1481
|
+
children,
|
|
1600
1482
|
align = "left",
|
|
1601
1483
|
color,
|
|
1602
|
-
level =
|
|
1603
|
-
as = `h${level}`,
|
|
1484
|
+
level = 1,
|
|
1604
1485
|
...props
|
|
1605
1486
|
}) => {
|
|
1606
1487
|
const theme = useTheme2();
|
|
@@ -1609,13 +1490,13 @@ var Headline = ({
|
|
|
1609
1490
|
variant,
|
|
1610
1491
|
size: size != null ? size : `level-${level}`
|
|
1611
1492
|
});
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
Component,
|
|
1493
|
+
return /* @__PURE__ */ jsx34(
|
|
1494
|
+
Heading,
|
|
1615
1495
|
{
|
|
1496
|
+
level: Number(level),
|
|
1616
1497
|
...props,
|
|
1617
|
-
className:
|
|
1618
|
-
style:
|
|
1498
|
+
className: cn19(classNames2, "text-[--color]", textAlign[align]),
|
|
1499
|
+
style: createVar8({
|
|
1619
1500
|
color: color && theme.colors && get(
|
|
1620
1501
|
theme.colors,
|
|
1621
1502
|
color.replace("-", "."),
|
|
@@ -1635,7 +1516,7 @@ var useDialogContext = () => useContext4(DialogContext);
|
|
|
1635
1516
|
|
|
1636
1517
|
// src/Dialog/DialogController.tsx
|
|
1637
1518
|
import { useOverlayTriggerState } from "@react-stately/overlays";
|
|
1638
|
-
import { jsx as
|
|
1519
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
1639
1520
|
var DialogController = ({
|
|
1640
1521
|
children,
|
|
1641
1522
|
dismissable = true,
|
|
@@ -1648,7 +1529,7 @@ var DialogController = ({
|
|
|
1648
1529
|
onOpenChange
|
|
1649
1530
|
});
|
|
1650
1531
|
const ctx = { open: state.isOpen, close: state.close };
|
|
1651
|
-
return /* @__PURE__ */
|
|
1532
|
+
return /* @__PURE__ */ jsx35(DialogContext.Provider, { value: ctx, children: /* @__PURE__ */ jsx35(Overlay, { open: state.isOpen, children: /* @__PURE__ */ jsx35(
|
|
1652
1533
|
Modal,
|
|
1653
1534
|
{
|
|
1654
1535
|
open: state.isOpen,
|
|
@@ -1664,7 +1545,7 @@ var DialogController = ({
|
|
|
1664
1545
|
import { Children as Children4, useRef as useRef8 } from "react";
|
|
1665
1546
|
import { PressResponder } from "@react-aria/interactions";
|
|
1666
1547
|
import { useOverlayTriggerState as useOverlayTriggerState2 } from "@react-stately/overlays";
|
|
1667
|
-
import { jsx as
|
|
1548
|
+
import { jsx as jsx36, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1668
1549
|
var DialogTrigger = ({
|
|
1669
1550
|
children,
|
|
1670
1551
|
dismissable = true,
|
|
@@ -1674,8 +1555,8 @@ var DialogTrigger = ({
|
|
|
1674
1555
|
const dialogTriggerRef = useRef8(null);
|
|
1675
1556
|
const state = useOverlayTriggerState2({});
|
|
1676
1557
|
const ctx = { open: state.isOpen, close: state.close };
|
|
1677
|
-
return /* @__PURE__ */
|
|
1678
|
-
/* @__PURE__ */
|
|
1558
|
+
return /* @__PURE__ */ jsxs14(DialogContext.Provider, { value: ctx, children: [
|
|
1559
|
+
/* @__PURE__ */ jsx36(
|
|
1679
1560
|
PressResponder,
|
|
1680
1561
|
{
|
|
1681
1562
|
ref: dialogTriggerRef,
|
|
@@ -1684,7 +1565,7 @@ var DialogTrigger = ({
|
|
|
1684
1565
|
children: dialogTrigger
|
|
1685
1566
|
}
|
|
1686
1567
|
),
|
|
1687
|
-
/* @__PURE__ */
|
|
1568
|
+
/* @__PURE__ */ jsx36(Overlay, { open: state.isOpen, children: /* @__PURE__ */ jsx36(
|
|
1688
1569
|
Modal,
|
|
1689
1570
|
{
|
|
1690
1571
|
open: state.isOpen,
|
|
@@ -1698,26 +1579,26 @@ var DialogTrigger = ({
|
|
|
1698
1579
|
};
|
|
1699
1580
|
|
|
1700
1581
|
// src/Dialog/Dialog.tsx
|
|
1701
|
-
import { jsx as
|
|
1582
|
+
import { jsx as jsx37, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1702
1583
|
var CloseButton = ({ className }) => {
|
|
1703
1584
|
const ref = useRef9(null);
|
|
1704
1585
|
const { close } = useDialogContext();
|
|
1705
|
-
const { buttonProps } =
|
|
1586
|
+
const { buttonProps } = useButton3(
|
|
1706
1587
|
{
|
|
1707
1588
|
onPress: () => close == null ? void 0 : close()
|
|
1708
1589
|
},
|
|
1709
1590
|
ref
|
|
1710
1591
|
);
|
|
1711
|
-
return /* @__PURE__ */
|
|
1592
|
+
return /* @__PURE__ */ jsx37("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx37(
|
|
1712
1593
|
"button",
|
|
1713
1594
|
{
|
|
1714
|
-
className:
|
|
1595
|
+
className: cn20(
|
|
1715
1596
|
"h-4 w-4 cursor-pointer border-none p-0 leading-normal outline-0",
|
|
1716
1597
|
className
|
|
1717
1598
|
),
|
|
1718
1599
|
ref,
|
|
1719
1600
|
...buttonProps,
|
|
1720
|
-
children: /* @__PURE__ */
|
|
1601
|
+
children: /* @__PURE__ */ jsx37("svg", { viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx37(
|
|
1721
1602
|
"path",
|
|
1722
1603
|
{
|
|
1723
1604
|
fillRule: "evenodd",
|
|
@@ -1731,7 +1612,7 @@ var CloseButton = ({ className }) => {
|
|
|
1731
1612
|
var addTitleProps = (children, titleProps) => {
|
|
1732
1613
|
const childs = Children5.toArray(children);
|
|
1733
1614
|
const titleIndex = childs.findIndex(
|
|
1734
|
-
(child) => isValidElement3(child) && (child.type === Header || child.type ===
|
|
1615
|
+
(child) => isValidElement3(child) && (child.type === Header || child.type === _Headline)
|
|
1735
1616
|
);
|
|
1736
1617
|
if (titleIndex < 0) {
|
|
1737
1618
|
console.warn(
|
|
@@ -1757,8 +1638,8 @@ var Dialog = ({
|
|
|
1757
1638
|
const { close } = useDialogContext();
|
|
1758
1639
|
const { dialogProps, titleProps } = useDialog(props, ref);
|
|
1759
1640
|
const classNames2 = useClassNames17({ component: "Dialog", variant, size });
|
|
1760
|
-
return /* @__PURE__ */
|
|
1761
|
-
closeButton && /* @__PURE__ */
|
|
1641
|
+
return /* @__PURE__ */ jsxs15("div", { className: classNames2.container, ...dialogProps, children: [
|
|
1642
|
+
closeButton && /* @__PURE__ */ jsx37(CloseButton, { className: classNames2.closeButton }),
|
|
1762
1643
|
typeof children === "function" ? children({ close, titleProps }) : props["aria-labelledby"] ? children : addTitleProps(children, titleProps)
|
|
1763
1644
|
] });
|
|
1764
1645
|
};
|
|
@@ -1766,31 +1647,30 @@ Dialog.Trigger = DialogTrigger;
|
|
|
1766
1647
|
Dialog.Controller = DialogController;
|
|
1767
1648
|
|
|
1768
1649
|
// src/Divider/Divider.tsx
|
|
1769
|
-
import {
|
|
1650
|
+
import { Separator } from "react-aria-components";
|
|
1770
1651
|
import { useClassNames as useClassNames18 } from "@marigold/system";
|
|
1771
|
-
import { jsx as
|
|
1772
|
-
var
|
|
1773
|
-
const { separatorProps } = useSeparator(props);
|
|
1652
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
1653
|
+
var _Divider = ({ variant, ...props }) => {
|
|
1774
1654
|
const classNames2 = useClassNames18({ component: "Divider", variant });
|
|
1775
|
-
return /* @__PURE__ */
|
|
1655
|
+
return /* @__PURE__ */ jsx38(Separator, { className: classNames2, ...props });
|
|
1776
1656
|
};
|
|
1777
1657
|
|
|
1778
1658
|
// src/Footer/Footer.tsx
|
|
1779
1659
|
import { useClassNames as useClassNames19 } from "@marigold/system";
|
|
1780
|
-
import { jsx as
|
|
1660
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
1781
1661
|
var Footer = ({ children, variant, size, ...props }) => {
|
|
1782
1662
|
const classNames2 = useClassNames19({ component: "Footer", variant, size });
|
|
1783
|
-
return /* @__PURE__ */
|
|
1663
|
+
return /* @__PURE__ */ jsx39("footer", { ...props, className: classNames2, children });
|
|
1784
1664
|
};
|
|
1785
1665
|
|
|
1786
1666
|
// src/Image/Image.tsx
|
|
1787
1667
|
import {
|
|
1788
|
-
cn as
|
|
1668
|
+
cn as cn21,
|
|
1789
1669
|
objectFit,
|
|
1790
1670
|
objectPosition,
|
|
1791
1671
|
useClassNames as useClassNames20
|
|
1792
1672
|
} from "@marigold/system";
|
|
1793
|
-
import { jsx as
|
|
1673
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
1794
1674
|
var Image = ({
|
|
1795
1675
|
variant,
|
|
1796
1676
|
size,
|
|
@@ -1799,12 +1679,12 @@ var Image = ({
|
|
|
1799
1679
|
...props
|
|
1800
1680
|
}) => {
|
|
1801
1681
|
const classNames2 = useClassNames20({ component: "Image", variant, size });
|
|
1802
|
-
return /* @__PURE__ */
|
|
1682
|
+
return /* @__PURE__ */ jsx40(
|
|
1803
1683
|
"img",
|
|
1804
1684
|
{
|
|
1805
1685
|
...props,
|
|
1806
1686
|
alt: props.alt,
|
|
1807
|
-
className:
|
|
1687
|
+
className: cn21(
|
|
1808
1688
|
fit !== "none" && "h-full w-full",
|
|
1809
1689
|
classNames2,
|
|
1810
1690
|
objectFit[fit],
|
|
@@ -1817,10 +1697,10 @@ var Image = ({
|
|
|
1817
1697
|
// src/Inline/Inline.tsx
|
|
1818
1698
|
import {
|
|
1819
1699
|
alignment as alignment2,
|
|
1820
|
-
cn as
|
|
1700
|
+
cn as cn22,
|
|
1821
1701
|
gapSpace as gapSpace5
|
|
1822
1702
|
} from "@marigold/system";
|
|
1823
|
-
import { jsx as
|
|
1703
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
1824
1704
|
var Inline = ({
|
|
1825
1705
|
space = 0,
|
|
1826
1706
|
orientation,
|
|
@@ -1830,11 +1710,11 @@ var Inline = ({
|
|
|
1830
1710
|
...props
|
|
1831
1711
|
}) => {
|
|
1832
1712
|
var _a2, _b2, _c, _d;
|
|
1833
|
-
return /* @__PURE__ */
|
|
1713
|
+
return /* @__PURE__ */ jsx41(
|
|
1834
1714
|
"div",
|
|
1835
1715
|
{
|
|
1836
1716
|
...props,
|
|
1837
|
-
className:
|
|
1717
|
+
className: cn22(
|
|
1838
1718
|
"flex flex-wrap",
|
|
1839
1719
|
gapSpace5[space],
|
|
1840
1720
|
alignX && ((_b2 = (_a2 = alignment2) == null ? void 0 : _a2.horizontal) == null ? void 0 : _b2.alignmentX[alignX]),
|
|
@@ -1849,20 +1729,20 @@ var Inline = ({
|
|
|
1849
1729
|
import { createCalendar } from "@internationalized/date";
|
|
1850
1730
|
import { useRef as useRef11 } from "react";
|
|
1851
1731
|
import { useDateField } from "@react-aria/datepicker";
|
|
1852
|
-
import { useFocusRing as
|
|
1732
|
+
import { useFocusRing as useFocusRing4 } from "@react-aria/focus";
|
|
1853
1733
|
import { useLocale } from "@react-aria/i18n";
|
|
1854
|
-
import { useHover as
|
|
1855
|
-
import { mergeProps as
|
|
1734
|
+
import { useHover as useHover2 } from "@react-aria/interactions";
|
|
1735
|
+
import { mergeProps as mergeProps7 } from "@react-aria/utils";
|
|
1856
1736
|
import { useDateFieldState } from "@react-stately/datepicker";
|
|
1857
|
-
import { cn as
|
|
1737
|
+
import { cn as cn24, useClassNames as useClassNames21, useStateProps as useStateProps6 } from "@marigold/system";
|
|
1858
1738
|
|
|
1859
1739
|
// src/DateField/DateSegment.tsx
|
|
1860
1740
|
import { useRef as useRef10 } from "react";
|
|
1861
1741
|
import { useDateSegment } from "@react-aria/datepicker";
|
|
1862
|
-
import { useFocusRing as
|
|
1863
|
-
import { mergeProps as
|
|
1864
|
-
import { cn as
|
|
1865
|
-
import { jsx as
|
|
1742
|
+
import { useFocusRing as useFocusRing3 } from "@react-aria/focus";
|
|
1743
|
+
import { mergeProps as mergeProps6 } from "@react-aria/utils";
|
|
1744
|
+
import { cn as cn23, useStateProps as useStateProps5 } from "@marigold/system";
|
|
1745
|
+
import { jsx as jsx42, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1866
1746
|
var DateSegment = ({
|
|
1867
1747
|
className,
|
|
1868
1748
|
segment,
|
|
@@ -1871,21 +1751,21 @@ var DateSegment = ({
|
|
|
1871
1751
|
}) => {
|
|
1872
1752
|
const ref = useRef10(null);
|
|
1873
1753
|
const { segmentProps } = useDateSegment(segment, state, ref);
|
|
1874
|
-
const { focusProps, isFocused } =
|
|
1754
|
+
const { focusProps, isFocused } = useFocusRing3({
|
|
1875
1755
|
within: true,
|
|
1876
1756
|
isTextInput: true
|
|
1877
1757
|
});
|
|
1878
|
-
const stateProps =
|
|
1758
|
+
const stateProps = useStateProps5({
|
|
1879
1759
|
disabled: state.isDisabled,
|
|
1880
1760
|
focusVisible: isFocused
|
|
1881
1761
|
});
|
|
1882
1762
|
const { isPlaceholder, placeholder, text, type, maxValue } = segment;
|
|
1883
|
-
return /* @__PURE__ */
|
|
1763
|
+
return /* @__PURE__ */ jsxs16(
|
|
1884
1764
|
"div",
|
|
1885
1765
|
{
|
|
1886
|
-
...
|
|
1766
|
+
...mergeProps6(segmentProps, stateProps, focusProps),
|
|
1887
1767
|
ref,
|
|
1888
|
-
className:
|
|
1768
|
+
className: cn23(
|
|
1889
1769
|
"group/segment",
|
|
1890
1770
|
"text-center leading-none outline-0",
|
|
1891
1771
|
type !== "literal" && "p-0.5",
|
|
@@ -1896,25 +1776,25 @@ var DateSegment = ({
|
|
|
1896
1776
|
minWidth: maxValue != null ? String(maxValue).length + "ch" : void 0
|
|
1897
1777
|
},
|
|
1898
1778
|
children: [
|
|
1899
|
-
/* @__PURE__ */
|
|
1779
|
+
/* @__PURE__ */ jsx42(
|
|
1900
1780
|
"span",
|
|
1901
1781
|
{
|
|
1902
1782
|
"aria-hidden": "true",
|
|
1903
|
-
className:
|
|
1783
|
+
className: cn23(
|
|
1904
1784
|
isPlaceholder ? "visible block" : "invisible hidden",
|
|
1905
1785
|
"pointer-events-none w-full text-center"
|
|
1906
1786
|
),
|
|
1907
1787
|
children: isPlaceholder && (placeholder == null ? void 0 : placeholder.toUpperCase())
|
|
1908
1788
|
}
|
|
1909
1789
|
),
|
|
1910
|
-
/* @__PURE__ */
|
|
1790
|
+
/* @__PURE__ */ jsx42("span", { children: isPlaceholder ? "" : type === "month" || type === "day" ? Number(text) < 10 ? "0" + text : text : text })
|
|
1911
1791
|
]
|
|
1912
1792
|
}
|
|
1913
1793
|
);
|
|
1914
1794
|
};
|
|
1915
1795
|
|
|
1916
1796
|
// src/DateField/DateField.tsx
|
|
1917
|
-
import { jsx as
|
|
1797
|
+
import { jsx as jsx43, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1918
1798
|
var DateField = ({
|
|
1919
1799
|
disabled,
|
|
1920
1800
|
readOnly,
|
|
@@ -1950,13 +1830,13 @@ var DateField = ({
|
|
|
1950
1830
|
ref
|
|
1951
1831
|
);
|
|
1952
1832
|
const classNames2 = useClassNames21({ component: "DateField", variant, size });
|
|
1953
|
-
const { focusProps, isFocused } =
|
|
1833
|
+
const { focusProps, isFocused } = useFocusRing4({
|
|
1954
1834
|
within: true,
|
|
1955
1835
|
isTextInput: true,
|
|
1956
1836
|
autoFocus: props.autoFocus
|
|
1957
1837
|
});
|
|
1958
|
-
const { hoverProps, isHovered } =
|
|
1959
|
-
const stateProps =
|
|
1838
|
+
const { hoverProps, isHovered } = useHover2({ isDisabled: disabled });
|
|
1839
|
+
const stateProps = useStateProps6({
|
|
1960
1840
|
hover: isHovered,
|
|
1961
1841
|
error,
|
|
1962
1842
|
readOnly,
|
|
@@ -1964,7 +1844,7 @@ var DateField = ({
|
|
|
1964
1844
|
required,
|
|
1965
1845
|
focus: isFocused || isPressed
|
|
1966
1846
|
});
|
|
1967
|
-
return /* @__PURE__ */
|
|
1847
|
+
return /* @__PURE__ */ jsx43(
|
|
1968
1848
|
FieldBase,
|
|
1969
1849
|
{
|
|
1970
1850
|
error,
|
|
@@ -1979,11 +1859,11 @@ var DateField = ({
|
|
|
1979
1859
|
variant,
|
|
1980
1860
|
size,
|
|
1981
1861
|
width,
|
|
1982
|
-
children: /* @__PURE__ */
|
|
1862
|
+
children: /* @__PURE__ */ jsxs17(
|
|
1983
1863
|
"div",
|
|
1984
1864
|
{
|
|
1985
|
-
...
|
|
1986
|
-
className:
|
|
1865
|
+
...mergeProps7(fieldProps, focusProps, stateProps, hoverProps),
|
|
1866
|
+
className: cn24(
|
|
1987
1867
|
"relative flex flex-row flex-nowrap",
|
|
1988
1868
|
"cursor-text aria-disabled:cursor-not-allowed",
|
|
1989
1869
|
classNames2.field
|
|
@@ -1991,9 +1871,9 @@ var DateField = ({
|
|
|
1991
1871
|
"data-testid": "date-field",
|
|
1992
1872
|
ref: triggerRef,
|
|
1993
1873
|
children: [
|
|
1994
|
-
/* @__PURE__ */
|
|
1874
|
+
/* @__PURE__ */ jsx43("div", { ref, className: "flex basis-full items-center", children: state.segments.map((segment, i) => {
|
|
1995
1875
|
var _a;
|
|
1996
|
-
return /* @__PURE__ */
|
|
1876
|
+
return /* @__PURE__ */ jsx43(
|
|
1997
1877
|
DateSegment,
|
|
1998
1878
|
{
|
|
1999
1879
|
className: classNames2.segment,
|
|
@@ -2004,15 +1884,15 @@ var DateField = ({
|
|
|
2004
1884
|
i
|
|
2005
1885
|
);
|
|
2006
1886
|
}) }),
|
|
2007
|
-
action ? action : /* @__PURE__ */
|
|
1887
|
+
action ? action : /* @__PURE__ */ jsx43("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx43(
|
|
2008
1888
|
"svg",
|
|
2009
1889
|
{
|
|
2010
1890
|
"data-testid": "action",
|
|
2011
|
-
className:
|
|
1891
|
+
className: cn24(classNames2.action),
|
|
2012
1892
|
viewBox: "0 0 24 24",
|
|
2013
1893
|
width: 24,
|
|
2014
1894
|
height: 24,
|
|
2015
|
-
children: /* @__PURE__ */
|
|
1895
|
+
children: /* @__PURE__ */ jsx43("path", { d: "M20.0906 19.2V6.6C20.0906 5.61 19.2806 4.8 18.2906 4.8H17.3906V3H15.5906V4.8H8.39062V3H6.59062V4.8H5.69063C4.69163 4.8 3.89962 5.61 3.89962 6.6L3.89062 19.2C3.89062 20.19 4.69163 21 5.69063 21H18.2906C19.2806 21 20.0906 20.19 20.0906 19.2ZM9.29062 11.1001H7.49061V12.9001H9.29062V11.1001ZM5.69062 8.40009H18.2906V6.60008H5.69062V8.40009ZM18.2906 10.2V19.2H5.69062V10.2H18.2906ZM14.6906 12.9001H16.4906V11.1001H14.6906V12.9001ZM12.8906 12.9001H11.0906V11.1001H12.8906V12.9001Z" })
|
|
2016
1896
|
}
|
|
2017
1897
|
) })
|
|
2018
1898
|
]
|
|
@@ -2031,7 +1911,7 @@ import {
|
|
|
2031
1911
|
import { useLocale as useLocale3 } from "@react-aria/i18n";
|
|
2032
1912
|
import { useCalendarState } from "@react-stately/calendar";
|
|
2033
1913
|
import { ChevronLeft, ChevronRight } from "@marigold/icons";
|
|
2034
|
-
import { cn as
|
|
1914
|
+
import { cn as cn27, useClassNames as useClassNames24, useStateProps as useStateProps9 } from "@marigold/system";
|
|
2035
1915
|
|
|
2036
1916
|
// src/Calendar/CalendarGrid.tsx
|
|
2037
1917
|
import { getWeeksInMonth, startOfWeek, today } from "@internationalized/date";
|
|
@@ -2043,10 +1923,10 @@ import { useDateFormatter } from "@react-aria/i18n";
|
|
|
2043
1923
|
// src/Calendar/CalendarCell.tsx
|
|
2044
1924
|
import { useRef as useRef12 } from "react";
|
|
2045
1925
|
import { useCalendarCell } from "@react-aria/calendar";
|
|
2046
|
-
import { useHover as
|
|
2047
|
-
import { mergeProps as
|
|
2048
|
-
import { cn as
|
|
2049
|
-
import { jsx as
|
|
1926
|
+
import { useHover as useHover3 } from "@react-aria/interactions";
|
|
1927
|
+
import { mergeProps as mergeProps8 } from "@react-aria/utils";
|
|
1928
|
+
import { cn as cn25, useClassNames as useClassNames22, useStateProps as useStateProps7 } from "@marigold/system";
|
|
1929
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
2050
1930
|
var CalendarCell = (props) => {
|
|
2051
1931
|
const ref = useRef12(null);
|
|
2052
1932
|
const { state } = props;
|
|
@@ -2055,31 +1935,31 @@ var CalendarCell = (props) => {
|
|
|
2055
1935
|
component: "Calendar"
|
|
2056
1936
|
});
|
|
2057
1937
|
const isDisabled = cellProps["aria-disabled"];
|
|
2058
|
-
const { hoverProps, isHovered } =
|
|
1938
|
+
const { hoverProps, isHovered } = useHover3({
|
|
2059
1939
|
isDisabled: isDisabled || cellProps["aria-selected"]
|
|
2060
1940
|
});
|
|
2061
|
-
const stateProps =
|
|
1941
|
+
const stateProps = useStateProps7({
|
|
2062
1942
|
disabled: isDisabled,
|
|
2063
1943
|
hover: isHovered,
|
|
2064
1944
|
selected: cellProps["aria-selected"]
|
|
2065
1945
|
});
|
|
2066
|
-
return /* @__PURE__ */
|
|
1946
|
+
return /* @__PURE__ */ jsx44("td", { className: "group/cell", ...cellProps, children: /* @__PURE__ */ jsx44(
|
|
2067
1947
|
"div",
|
|
2068
1948
|
{
|
|
2069
|
-
className:
|
|
1949
|
+
className: cn25(
|
|
2070
1950
|
"flex h-[30px] w-[30px] cursor-pointer items-center justify-center rounded-full p-[5.3px] text-sm font-normal aria-disabled:cursor-default",
|
|
2071
1951
|
classNames2.calendarCell
|
|
2072
1952
|
),
|
|
2073
1953
|
hidden: isOutsideVisibleRange,
|
|
2074
1954
|
ref,
|
|
2075
|
-
...
|
|
1955
|
+
...mergeProps8(buttonProps, stateProps, hoverProps),
|
|
2076
1956
|
children: formattedDate
|
|
2077
1957
|
}
|
|
2078
1958
|
) });
|
|
2079
1959
|
};
|
|
2080
1960
|
|
|
2081
1961
|
// src/Calendar/CalendarGrid.tsx
|
|
2082
|
-
import { jsx as
|
|
1962
|
+
import { jsx as jsx45, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2083
1963
|
var CalendarGrid = ({ state, ...props }) => {
|
|
2084
1964
|
const { locale } = useLocale2();
|
|
2085
1965
|
const { gridProps, headerProps } = useCalendarGrid(props, state);
|
|
@@ -2099,23 +1979,23 @@ var CalendarGrid = ({ state, ...props }) => {
|
|
|
2099
1979
|
return dayFormatter.format(dateDay);
|
|
2100
1980
|
});
|
|
2101
1981
|
}, [locale, state.timeZone, dayFormatter]);
|
|
2102
|
-
return /* @__PURE__ */
|
|
1982
|
+
return /* @__PURE__ */ jsxs18(
|
|
2103
1983
|
"table",
|
|
2104
1984
|
{
|
|
2105
1985
|
className: "w-full border-spacing-[6px]",
|
|
2106
1986
|
...gridProps,
|
|
2107
1987
|
cellPadding: "8",
|
|
2108
1988
|
children: [
|
|
2109
|
-
/* @__PURE__ */
|
|
2110
|
-
/* @__PURE__ */
|
|
2111
|
-
(date, i) => date ? /* @__PURE__ */
|
|
1989
|
+
/* @__PURE__ */ jsx45("thead", { ...headerProps, children: /* @__PURE__ */ jsx45("tr", { children: weekDays.map((day, index) => /* @__PURE__ */ jsx45("th", { style: { fontWeight: "bolder" }, children: day.substring(0, 2) }, index)) }) }),
|
|
1990
|
+
/* @__PURE__ */ jsx45("tbody", { children: [...new Array(numberOfWeeksInMonth).keys()].map((weekIndex) => /* @__PURE__ */ jsx45("tr", { children: state.getDatesInWeek(weekIndex).map(
|
|
1991
|
+
(date, i) => date ? /* @__PURE__ */ jsx45(
|
|
2112
1992
|
CalendarCell,
|
|
2113
1993
|
{
|
|
2114
1994
|
date,
|
|
2115
1995
|
state
|
|
2116
1996
|
},
|
|
2117
1997
|
i
|
|
2118
|
-
) : /* @__PURE__ */
|
|
1998
|
+
) : /* @__PURE__ */ jsx45("td", {}, i)
|
|
2119
1999
|
) }, weekIndex)) })
|
|
2120
2000
|
]
|
|
2121
2001
|
}
|
|
@@ -2130,18 +2010,18 @@ import {
|
|
|
2130
2010
|
forwardRef as forwardRef10,
|
|
2131
2011
|
useRef as useRef13
|
|
2132
2012
|
} from "react";
|
|
2133
|
-
import { useButton as
|
|
2134
|
-
import { useFocusRing as
|
|
2013
|
+
import { useButton as useButton4 } from "@react-aria/button";
|
|
2014
|
+
import { useFocusRing as useFocusRing5 } from "@react-aria/focus";
|
|
2135
2015
|
import { useLocalizedStringFormatter } from "@react-aria/i18n";
|
|
2136
2016
|
import { HiddenSelect, useSelect } from "@react-aria/select";
|
|
2137
|
-
import { mergeProps as
|
|
2017
|
+
import { mergeProps as mergeProps9, useObjectRef as useObjectRef4 } from "@react-aria/utils";
|
|
2138
2018
|
import { Item as Item4, Section } from "@react-stately/collections";
|
|
2139
2019
|
import { useSelectState } from "@react-stately/select";
|
|
2140
2020
|
import {
|
|
2141
|
-
cn as
|
|
2021
|
+
cn as cn26,
|
|
2142
2022
|
useClassNames as useClassNames23,
|
|
2143
2023
|
useSmallScreen,
|
|
2144
|
-
useStateProps as
|
|
2024
|
+
useStateProps as useStateProps8
|
|
2145
2025
|
} from "@marigold/system";
|
|
2146
2026
|
|
|
2147
2027
|
// src/Select/intl.ts
|
|
@@ -2155,7 +2035,7 @@ var messages = {
|
|
|
2155
2035
|
};
|
|
2156
2036
|
|
|
2157
2037
|
// src/Select/Select.tsx
|
|
2158
|
-
import { jsx as
|
|
2038
|
+
import { jsx as jsx46, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2159
2039
|
var Select = forwardRef10(
|
|
2160
2040
|
({
|
|
2161
2041
|
variant,
|
|
@@ -2178,7 +2058,7 @@ var Select = forwardRef10(
|
|
|
2178
2058
|
onSelectionChange: onChange,
|
|
2179
2059
|
...rest
|
|
2180
2060
|
};
|
|
2181
|
-
const buttonRef =
|
|
2061
|
+
const buttonRef = useObjectRef4(ref);
|
|
2182
2062
|
const listboxRef = useRef13(null);
|
|
2183
2063
|
const state = useSelectState(props);
|
|
2184
2064
|
const {
|
|
@@ -2189,28 +2069,28 @@ var Select = forwardRef10(
|
|
|
2189
2069
|
descriptionProps,
|
|
2190
2070
|
errorMessageProps
|
|
2191
2071
|
} = useSelect(props, state, buttonRef);
|
|
2192
|
-
const { buttonProps } =
|
|
2072
|
+
const { buttonProps } = useButton4(
|
|
2193
2073
|
{ isDisabled: disabled, ...triggerProps },
|
|
2194
2074
|
buttonRef
|
|
2195
2075
|
);
|
|
2196
|
-
const { focusProps, isFocusVisible } =
|
|
2076
|
+
const { focusProps, isFocusVisible } = useFocusRing5();
|
|
2197
2077
|
const classNames2 = useClassNames23({ component: "Select", variant, size });
|
|
2198
2078
|
const isSmallScreen = useSmallScreen();
|
|
2199
|
-
const stateProps =
|
|
2079
|
+
const stateProps = useStateProps8({
|
|
2200
2080
|
disabled,
|
|
2201
2081
|
error,
|
|
2202
2082
|
focusVisible: isFocusVisible,
|
|
2203
2083
|
expanded: state.isOpen,
|
|
2204
2084
|
required
|
|
2205
2085
|
});
|
|
2206
|
-
return /* @__PURE__ */
|
|
2086
|
+
return /* @__PURE__ */ jsxs19(
|
|
2207
2087
|
FieldBase,
|
|
2208
2088
|
{
|
|
2209
2089
|
variant,
|
|
2210
2090
|
size,
|
|
2211
2091
|
width,
|
|
2212
2092
|
label: props.label,
|
|
2213
|
-
labelProps: {
|
|
2093
|
+
labelProps: { elementType: "span", ...labelProps },
|
|
2214
2094
|
description: props.description,
|
|
2215
2095
|
descriptionProps,
|
|
2216
2096
|
error,
|
|
@@ -2219,7 +2099,7 @@ var Select = forwardRef10(
|
|
|
2219
2099
|
stateProps,
|
|
2220
2100
|
disabled,
|
|
2221
2101
|
children: [
|
|
2222
|
-
/* @__PURE__ */
|
|
2102
|
+
/* @__PURE__ */ jsx46(
|
|
2223
2103
|
HiddenSelect,
|
|
2224
2104
|
{
|
|
2225
2105
|
state,
|
|
@@ -2229,23 +2109,23 @@ var Select = forwardRef10(
|
|
|
2229
2109
|
isDisabled: disabled
|
|
2230
2110
|
}
|
|
2231
2111
|
),
|
|
2232
|
-
/* @__PURE__ */
|
|
2112
|
+
/* @__PURE__ */ jsxs19(
|
|
2233
2113
|
"button",
|
|
2234
2114
|
{
|
|
2235
|
-
className:
|
|
2115
|
+
className: cn26(
|
|
2236
2116
|
"flex w-full items-center justify-between gap-1 overflow-hidden",
|
|
2237
2117
|
classNames2.select
|
|
2238
2118
|
),
|
|
2239
2119
|
ref: buttonRef,
|
|
2240
|
-
...
|
|
2120
|
+
...mergeProps9(buttonProps, focusProps),
|
|
2241
2121
|
...stateProps,
|
|
2242
2122
|
children: [
|
|
2243
|
-
/* @__PURE__ */
|
|
2244
|
-
/* @__PURE__ */
|
|
2123
|
+
/* @__PURE__ */ jsx46("div", { className: "overflow-hidden whitespace-nowrap", ...valueProps, children: state.selectedItem ? state.selectedItem.rendered : props.placeholder }),
|
|
2124
|
+
/* @__PURE__ */ jsx46(ChevronDown, { className: "h-4 w-4" })
|
|
2245
2125
|
]
|
|
2246
2126
|
}
|
|
2247
2127
|
),
|
|
2248
|
-
isSmallScreen ? /* @__PURE__ */
|
|
2128
|
+
isSmallScreen ? /* @__PURE__ */ jsx46(Tray, { state, children: /* @__PURE__ */ jsx46(
|
|
2249
2129
|
ListBox,
|
|
2250
2130
|
{
|
|
2251
2131
|
ref: listboxRef,
|
|
@@ -2254,7 +2134,7 @@ var Select = forwardRef10(
|
|
|
2254
2134
|
size,
|
|
2255
2135
|
...menuProps
|
|
2256
2136
|
}
|
|
2257
|
-
) }) : /* @__PURE__ */
|
|
2137
|
+
) }) : /* @__PURE__ */ jsx46(Popover, { state, triggerRef: buttonRef, scrollRef: listboxRef, children: /* @__PURE__ */ jsx46(
|
|
2258
2138
|
ListBox,
|
|
2259
2139
|
{
|
|
2260
2140
|
ref: listboxRef,
|
|
@@ -2273,7 +2153,7 @@ Select.Option = Item4;
|
|
|
2273
2153
|
Select.Section = Section;
|
|
2274
2154
|
|
|
2275
2155
|
// src/Calendar/MonthDropdown.tsx
|
|
2276
|
-
import { jsx as
|
|
2156
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
2277
2157
|
var MonthDropdown = ({ state }) => {
|
|
2278
2158
|
let months = [];
|
|
2279
2159
|
let formatter = useDateFormatter2({
|
|
@@ -2290,7 +2170,7 @@ var MonthDropdown = ({ state }) => {
|
|
|
2290
2170
|
let date = state.focusedDate.set({ month: value });
|
|
2291
2171
|
state.setFocusedDate(date);
|
|
2292
2172
|
};
|
|
2293
|
-
return /* @__PURE__ */
|
|
2173
|
+
return /* @__PURE__ */ jsx47(
|
|
2294
2174
|
Select,
|
|
2295
2175
|
{
|
|
2296
2176
|
"aria-label": "Month",
|
|
@@ -2298,7 +2178,7 @@ var MonthDropdown = ({ state }) => {
|
|
|
2298
2178
|
selectedKey: String(state.focusedDate.month),
|
|
2299
2179
|
"data-testid": "month",
|
|
2300
2180
|
disabled: state.isDisabled,
|
|
2301
|
-
children: months.map((month, i) => /* @__PURE__ */
|
|
2181
|
+
children: months.map((month, i) => /* @__PURE__ */ jsx47(Select.Option, { children: month.substring(0, 3) }, i + 1))
|
|
2302
2182
|
}
|
|
2303
2183
|
);
|
|
2304
2184
|
};
|
|
@@ -2306,7 +2186,7 @@ var MonthDropdown_default = MonthDropdown;
|
|
|
2306
2186
|
|
|
2307
2187
|
// src/Calendar/YearDropdown.tsx
|
|
2308
2188
|
import { useDateFormatter as useDateFormatter3 } from "@react-aria/i18n";
|
|
2309
|
-
import { jsx as
|
|
2189
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
2310
2190
|
var YearDropdown = ({ state }) => {
|
|
2311
2191
|
const years = [];
|
|
2312
2192
|
let formatter = useDateFormatter3({
|
|
@@ -2325,7 +2205,7 @@ var YearDropdown = ({ state }) => {
|
|
|
2325
2205
|
let date = years[index].value;
|
|
2326
2206
|
state.setFocusedDate(date);
|
|
2327
2207
|
};
|
|
2328
|
-
return /* @__PURE__ */
|
|
2208
|
+
return /* @__PURE__ */ jsx48(
|
|
2329
2209
|
Select,
|
|
2330
2210
|
{
|
|
2331
2211
|
"aria-label": "Year",
|
|
@@ -2333,14 +2213,14 @@ var YearDropdown = ({ state }) => {
|
|
|
2333
2213
|
onChange,
|
|
2334
2214
|
"data-testid": "year",
|
|
2335
2215
|
disabled: state.isDisabled,
|
|
2336
|
-
children: years.map((year, i) => /* @__PURE__ */
|
|
2216
|
+
children: years.map((year, i) => /* @__PURE__ */ jsx48(Select.Option, { children: year.formatted }, i))
|
|
2337
2217
|
}
|
|
2338
2218
|
);
|
|
2339
2219
|
};
|
|
2340
2220
|
var YearDropdown_default = YearDropdown;
|
|
2341
2221
|
|
|
2342
2222
|
// src/Calendar/Calendar.tsx
|
|
2343
|
-
import { jsx as
|
|
2223
|
+
import { jsx as jsx49, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2344
2224
|
var Calendar = ({
|
|
2345
2225
|
disabled,
|
|
2346
2226
|
readOnly,
|
|
@@ -2374,16 +2254,16 @@ var Calendar = ({
|
|
|
2374
2254
|
onFocusChange: nextFocusChange,
|
|
2375
2255
|
...nextPropsRest
|
|
2376
2256
|
} = nextButtonProps;
|
|
2377
|
-
const calendarState =
|
|
2257
|
+
const calendarState = useStateProps9({
|
|
2378
2258
|
disabled: state.isDisabled,
|
|
2379
2259
|
focusVisible: state.isFocused
|
|
2380
2260
|
});
|
|
2381
2261
|
const classNames2 = useClassNames24({ component: "Calendar" });
|
|
2382
|
-
return /* @__PURE__ */
|
|
2262
|
+
return /* @__PURE__ */ jsxs20(
|
|
2383
2263
|
"div",
|
|
2384
2264
|
{
|
|
2385
2265
|
tabIndex: -1,
|
|
2386
|
-
className:
|
|
2266
|
+
className: cn27(
|
|
2387
2267
|
"flex w-[360px] flex-col rounded-sm p-4 shadow-[0_4px_4px_rgba(165,165,165,0.25)]",
|
|
2388
2268
|
classNames2.calendar
|
|
2389
2269
|
),
|
|
@@ -2391,33 +2271,33 @@ var Calendar = ({
|
|
|
2391
2271
|
...calendarState,
|
|
2392
2272
|
ref,
|
|
2393
2273
|
children: [
|
|
2394
|
-
/* @__PURE__ */
|
|
2395
|
-
/* @__PURE__ */
|
|
2396
|
-
/* @__PURE__ */
|
|
2397
|
-
/* @__PURE__ */
|
|
2274
|
+
/* @__PURE__ */ jsxs20("div", { className: "mb-4 flex items-center gap-[60px]", children: [
|
|
2275
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex min-w-[170px] gap-[9px] [&_div]:flex", children: [
|
|
2276
|
+
/* @__PURE__ */ jsx49(MonthDropdown_default, { state }),
|
|
2277
|
+
/* @__PURE__ */ jsx49(YearDropdown_default, { state })
|
|
2398
2278
|
] }),
|
|
2399
|
-
/* @__PURE__ */
|
|
2400
|
-
/* @__PURE__ */
|
|
2401
|
-
|
|
2279
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex w-full flex-nowrap justify-end gap-[10px] [&_button:disabled]:cursor-not-allowed [&_button]:px-2 [&_button]:py-1", children: [
|
|
2280
|
+
/* @__PURE__ */ jsx49(
|
|
2281
|
+
_Button,
|
|
2402
2282
|
{
|
|
2403
2283
|
className: classNames2.calendarControllers,
|
|
2404
2284
|
...prevPropsRest,
|
|
2405
2285
|
disabled: prevIsDisabled,
|
|
2406
|
-
children: /* @__PURE__ */
|
|
2286
|
+
children: /* @__PURE__ */ jsx49(ChevronLeft, {})
|
|
2407
2287
|
}
|
|
2408
2288
|
),
|
|
2409
|
-
/* @__PURE__ */
|
|
2410
|
-
|
|
2289
|
+
/* @__PURE__ */ jsx49(
|
|
2290
|
+
_Button,
|
|
2411
2291
|
{
|
|
2412
2292
|
className: classNames2.calendarControllers,
|
|
2413
2293
|
...nextPropsRest,
|
|
2414
2294
|
disabled: nextIsDisabled,
|
|
2415
|
-
children: /* @__PURE__ */
|
|
2295
|
+
children: /* @__PURE__ */ jsx49(ChevronRight, {})
|
|
2416
2296
|
}
|
|
2417
2297
|
)
|
|
2418
2298
|
] })
|
|
2419
2299
|
] }),
|
|
2420
|
-
/* @__PURE__ */
|
|
2300
|
+
/* @__PURE__ */ jsx49(CalendarGrid, { state })
|
|
2421
2301
|
]
|
|
2422
2302
|
}
|
|
2423
2303
|
);
|
|
@@ -2426,10 +2306,10 @@ var Calendar = ({
|
|
|
2426
2306
|
// src/DatePicker/DatePicker.tsx
|
|
2427
2307
|
import { useRef as useRef15 } from "react";
|
|
2428
2308
|
import { useDatePicker } from "@react-aria/datepicker";
|
|
2429
|
-
import { mergeProps as
|
|
2309
|
+
import { mergeProps as mergeProps10 } from "@react-aria/utils";
|
|
2430
2310
|
import { useDatePickerState } from "@react-stately/datepicker";
|
|
2431
|
-
import { cn as
|
|
2432
|
-
import { Fragment as
|
|
2311
|
+
import { cn as cn28, useClassNames as useClassNames25, useStateProps as useStateProps10 } from "@marigold/system";
|
|
2312
|
+
import { Fragment as Fragment5, jsx as jsx50, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2433
2313
|
var DatePicker = ({
|
|
2434
2314
|
disabled,
|
|
2435
2315
|
required,
|
|
@@ -2454,7 +2334,7 @@ var DatePicker = ({
|
|
|
2454
2334
|
...props
|
|
2455
2335
|
});
|
|
2456
2336
|
const ref = useRef15(null);
|
|
2457
|
-
const stateProps =
|
|
2337
|
+
const stateProps = useStateProps10({
|
|
2458
2338
|
focus: state.isOpen
|
|
2459
2339
|
});
|
|
2460
2340
|
const { groupProps, fieldProps, buttonProps, calendarProps } = useDatePicker(
|
|
@@ -2468,8 +2348,8 @@ var DatePicker = ({
|
|
|
2468
2348
|
size,
|
|
2469
2349
|
variant
|
|
2470
2350
|
});
|
|
2471
|
-
return /* @__PURE__ */
|
|
2472
|
-
/* @__PURE__ */
|
|
2351
|
+
return /* @__PURE__ */ jsxs21(Fragment5, { children: [
|
|
2352
|
+
/* @__PURE__ */ jsx50("div", { className: "flex w-full min-w-[300px]", ...groupProps, children: /* @__PURE__ */ jsx50(
|
|
2473
2353
|
DateField,
|
|
2474
2354
|
{
|
|
2475
2355
|
...fieldProps,
|
|
@@ -2482,42 +2362,42 @@ var DatePicker = ({
|
|
|
2482
2362
|
description: !state.isOpen && description,
|
|
2483
2363
|
triggerRef: ref,
|
|
2484
2364
|
width,
|
|
2485
|
-
action: /* @__PURE__ */
|
|
2486
|
-
|
|
2365
|
+
action: /* @__PURE__ */ jsx50("div", { className: classNames2.container, children: /* @__PURE__ */ jsx50(
|
|
2366
|
+
_Button,
|
|
2487
2367
|
{
|
|
2488
|
-
...
|
|
2489
|
-
className:
|
|
2368
|
+
...mergeProps10(buttonProps, stateProps),
|
|
2369
|
+
className: cn28("absolute right-0 top-0", classNames2.button),
|
|
2490
2370
|
disabled: isDisabled,
|
|
2491
|
-
children: /* @__PURE__ */
|
|
2371
|
+
children: /* @__PURE__ */ jsx50(
|
|
2492
2372
|
"svg",
|
|
2493
2373
|
{
|
|
2494
2374
|
width: "24",
|
|
2495
2375
|
height: "24",
|
|
2496
2376
|
viewBox: "0 0 24 24",
|
|
2497
2377
|
fill: "currentColor",
|
|
2498
|
-
children: /* @__PURE__ */
|
|
2378
|
+
children: /* @__PURE__ */ jsx50("path", { d: "M20.0906 19.2V6.6C20.0906 5.61 19.2806 4.8 18.2906 4.8H17.3906V3H15.5906V4.8H8.39062V3H6.59062V4.8H5.69063C4.69163 4.8 3.89962 5.61 3.89962 6.6L3.89062 19.2C3.89062 20.19 4.69163 21 5.69063 21H18.2906C19.2806 21 20.0906 20.19 20.0906 19.2ZM9.29062 11.1001H7.49061V12.9001H9.29062V11.1001ZM5.69062 8.40009H18.2906V6.60008H5.69062V8.40009ZM18.2906 10.2V19.2H5.69062V10.2H18.2906ZM14.6906 12.9001H16.4906V11.1001H14.6906V12.9001ZM12.8906 12.9001H11.0906V11.1001H12.8906V12.9001Z" })
|
|
2499
2379
|
}
|
|
2500
2380
|
)
|
|
2501
2381
|
}
|
|
2502
2382
|
) })
|
|
2503
2383
|
}
|
|
2504
2384
|
) }),
|
|
2505
|
-
state.isOpen && /* @__PURE__ */
|
|
2385
|
+
state.isOpen && /* @__PURE__ */ jsx50(Popover, { triggerRef: ref, state, children: /* @__PURE__ */ jsx50(Calendar, { disabled, ...calendarProps }) })
|
|
2506
2386
|
] });
|
|
2507
2387
|
};
|
|
2508
2388
|
|
|
2509
2389
|
// src/Inset/Inset.tsx
|
|
2510
2390
|
import {
|
|
2511
|
-
cn as
|
|
2391
|
+
cn as cn29,
|
|
2512
2392
|
paddingSpace as paddingSpace2,
|
|
2513
2393
|
paddingSpaceX as paddingSpaceX2,
|
|
2514
2394
|
paddingSpaceY as paddingSpaceY2
|
|
2515
2395
|
} from "@marigold/system";
|
|
2516
|
-
import { jsx as
|
|
2517
|
-
var Inset = ({ space, spaceX, spaceY, children }) => /* @__PURE__ */
|
|
2396
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
2397
|
+
var Inset = ({ space, spaceX, spaceY, children }) => /* @__PURE__ */ jsx51(
|
|
2518
2398
|
"div",
|
|
2519
2399
|
{
|
|
2520
|
-
className:
|
|
2400
|
+
className: cn29(
|
|
2521
2401
|
space && paddingSpace2[space],
|
|
2522
2402
|
!space && spaceX && paddingSpaceX2[spaceX],
|
|
2523
2403
|
!space && spaceY && paddingSpaceY2[spaceY]
|
|
@@ -2528,47 +2408,17 @@ var Inset = ({ space, spaceX, spaceY, children }) => /* @__PURE__ */ jsx52(
|
|
|
2528
2408
|
|
|
2529
2409
|
// src/Link/Link.tsx
|
|
2530
2410
|
import { forwardRef as forwardRef11 } from "react";
|
|
2531
|
-
import {
|
|
2532
|
-
import { useObjectRef as useObjectRef7 } from "@react-aria/utils";
|
|
2411
|
+
import { Link } from "react-aria-components";
|
|
2533
2412
|
import { useClassNames as useClassNames26 } from "@marigold/system";
|
|
2534
|
-
import { jsx as
|
|
2535
|
-
var
|
|
2536
|
-
({
|
|
2537
|
-
as = "a",
|
|
2538
|
-
variant,
|
|
2539
|
-
size,
|
|
2540
|
-
children,
|
|
2541
|
-
disabled,
|
|
2542
|
-
onPress,
|
|
2543
|
-
onPressStart,
|
|
2544
|
-
...props
|
|
2545
|
-
}, ref) => {
|
|
2546
|
-
const linkRef = useObjectRef7(ref);
|
|
2547
|
-
const { linkProps } = useLink(
|
|
2548
|
-
{
|
|
2549
|
-
...props,
|
|
2550
|
-
elementType: typeof as === "string" ? as : "span",
|
|
2551
|
-
isDisabled: disabled
|
|
2552
|
-
},
|
|
2553
|
-
linkRef
|
|
2554
|
-
);
|
|
2555
|
-
const Component = as;
|
|
2413
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
2414
|
+
var _Link = forwardRef11(
|
|
2415
|
+
({ variant, size, disabled, children, ...props }, ref) => {
|
|
2556
2416
|
const classNames2 = useClassNames26({
|
|
2557
2417
|
component: "Link",
|
|
2558
2418
|
variant,
|
|
2559
2419
|
size
|
|
2560
2420
|
});
|
|
2561
|
-
return /* @__PURE__ */
|
|
2562
|
-
Component,
|
|
2563
|
-
{
|
|
2564
|
-
...props,
|
|
2565
|
-
role: "link",
|
|
2566
|
-
className: classNames2,
|
|
2567
|
-
ref: linkRef,
|
|
2568
|
-
...linkProps,
|
|
2569
|
-
children
|
|
2570
|
-
}
|
|
2571
|
-
);
|
|
2421
|
+
return /* @__PURE__ */ jsx52(Link, { ...props, ref, className: classNames2, isDisabled: disabled, children });
|
|
2572
2422
|
}
|
|
2573
2423
|
);
|
|
2574
2424
|
|
|
@@ -2581,14 +2431,14 @@ var ListContext = createContext5({});
|
|
|
2581
2431
|
var useListContext = () => useContext5(ListContext);
|
|
2582
2432
|
|
|
2583
2433
|
// src/List/ListItem.tsx
|
|
2584
|
-
import { jsx as
|
|
2434
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
2585
2435
|
var ListItem = ({ children, ...props }) => {
|
|
2586
2436
|
const { classNames: classNames2 } = useListContext();
|
|
2587
|
-
return /* @__PURE__ */
|
|
2437
|
+
return /* @__PURE__ */ jsx53("li", { ...props, className: classNames2, children });
|
|
2588
2438
|
};
|
|
2589
2439
|
|
|
2590
2440
|
// src/List/List.tsx
|
|
2591
|
-
import { jsx as
|
|
2441
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
2592
2442
|
var List = ({
|
|
2593
2443
|
as = "ul",
|
|
2594
2444
|
children,
|
|
@@ -2598,7 +2448,7 @@ var List = ({
|
|
|
2598
2448
|
}) => {
|
|
2599
2449
|
const Component = as;
|
|
2600
2450
|
const classNames2 = useClassNames27({ component: "List", variant, size });
|
|
2601
|
-
return /* @__PURE__ */
|
|
2451
|
+
return /* @__PURE__ */ jsx54(Component, { ...props, className: classNames2[as], children: /* @__PURE__ */ jsx54(ListContext.Provider, { value: { classNames: classNames2.item }, children }) });
|
|
2602
2452
|
};
|
|
2603
2453
|
List.Item = ListItem;
|
|
2604
2454
|
|
|
@@ -2620,11 +2470,11 @@ var useMenuContext = () => useContext6(MenuContext);
|
|
|
2620
2470
|
|
|
2621
2471
|
// src/Menu/MenuItem.tsx
|
|
2622
2472
|
import { useRef as useRef16 } from "react";
|
|
2623
|
-
import { useFocusRing as
|
|
2473
|
+
import { useFocusRing as useFocusRing6 } from "@react-aria/focus";
|
|
2624
2474
|
import { useMenuItem } from "@react-aria/menu";
|
|
2625
|
-
import { mergeProps as
|
|
2626
|
-
import { useStateProps as
|
|
2627
|
-
import { jsx as
|
|
2475
|
+
import { mergeProps as mergeProps11 } from "@react-aria/utils";
|
|
2476
|
+
import { useStateProps as useStateProps11 } from "@marigold/system";
|
|
2477
|
+
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
2628
2478
|
var MenuItem = ({
|
|
2629
2479
|
item,
|
|
2630
2480
|
state,
|
|
@@ -2642,17 +2492,17 @@ var MenuItem = ({
|
|
|
2642
2492
|
state,
|
|
2643
2493
|
ref
|
|
2644
2494
|
);
|
|
2645
|
-
const { isFocusVisible, focusProps } =
|
|
2646
|
-
const stateProps =
|
|
2495
|
+
const { isFocusVisible, focusProps } = useFocusRing6();
|
|
2496
|
+
const stateProps = useStateProps11({
|
|
2647
2497
|
focus: isFocusVisible
|
|
2648
2498
|
});
|
|
2649
2499
|
const { onPointerUp, ...props } = menuItemProps;
|
|
2650
|
-
return /* @__PURE__ */
|
|
2500
|
+
return /* @__PURE__ */ jsx55(
|
|
2651
2501
|
"li",
|
|
2652
2502
|
{
|
|
2653
2503
|
ref,
|
|
2654
2504
|
className,
|
|
2655
|
-
...
|
|
2505
|
+
...mergeProps11(
|
|
2656
2506
|
props,
|
|
2657
2507
|
{ onPointerDown: onPointerUp },
|
|
2658
2508
|
stateProps,
|
|
@@ -2666,18 +2516,18 @@ var MenuItem = ({
|
|
|
2666
2516
|
// src/Menu/MenuSection.tsx
|
|
2667
2517
|
import { useMenuSection } from "@react-aria/menu";
|
|
2668
2518
|
import { useClassNames as useClassNames28 } from "@marigold/system";
|
|
2669
|
-
import { Fragment as
|
|
2519
|
+
import { Fragment as Fragment6, jsx as jsx56, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2670
2520
|
var MenuSection = ({ onAction, item, state }) => {
|
|
2671
2521
|
let { itemProps, headingProps, groupProps } = useMenuSection({
|
|
2672
2522
|
heading: item.rendered,
|
|
2673
2523
|
"aria-label": item["aria-label"]
|
|
2674
2524
|
});
|
|
2675
2525
|
const className = useClassNames28({ component: "Menu" });
|
|
2676
|
-
return /* @__PURE__ */
|
|
2677
|
-
item.key !== state.collection.getFirstKey() && /* @__PURE__ */
|
|
2678
|
-
/* @__PURE__ */
|
|
2679
|
-
item.rendered && /* @__PURE__ */
|
|
2680
|
-
/* @__PURE__ */
|
|
2526
|
+
return /* @__PURE__ */ jsxs22(Fragment6, { children: [
|
|
2527
|
+
item.key !== state.collection.getFirstKey() && /* @__PURE__ */ jsx56("li", { children: /* @__PURE__ */ jsx56(_Divider, { variant: "section" }) }),
|
|
2528
|
+
/* @__PURE__ */ jsxs22("li", { ...itemProps, children: [
|
|
2529
|
+
item.rendered && /* @__PURE__ */ jsx56("span", { ...headingProps, className: className.section, children: item.rendered }),
|
|
2530
|
+
/* @__PURE__ */ jsx56("ul", { ...groupProps, className: "pb-1", children: [...item.props.children].map((node) => /* @__PURE__ */ jsx56(
|
|
2681
2531
|
MenuItem,
|
|
2682
2532
|
{
|
|
2683
2533
|
item: node,
|
|
@@ -2696,10 +2546,10 @@ var MenuSection_default = MenuSection;
|
|
|
2696
2546
|
import { Children as Children6, useRef as useRef17 } from "react";
|
|
2697
2547
|
import { PressResponder as PressResponder2 } from "@react-aria/interactions";
|
|
2698
2548
|
import { useMenuTrigger } from "@react-aria/menu";
|
|
2699
|
-
import { useObjectRef as
|
|
2549
|
+
import { useObjectRef as useObjectRef5 } from "@react-aria/utils";
|
|
2700
2550
|
import { useMenuTriggerState } from "@react-stately/menu";
|
|
2701
2551
|
import { useSmallScreen as useSmallScreen2 } from "@marigold/system";
|
|
2702
|
-
import { jsx as
|
|
2552
|
+
import { jsx as jsx57, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2703
2553
|
var MenuTrigger = ({
|
|
2704
2554
|
disabled,
|
|
2705
2555
|
open,
|
|
@@ -2708,7 +2558,7 @@ var MenuTrigger = ({
|
|
|
2708
2558
|
}) => {
|
|
2709
2559
|
const [menuTrigger, menu] = Children6.toArray(children);
|
|
2710
2560
|
const menuTriggerRef = useRef17(null);
|
|
2711
|
-
const menuRef =
|
|
2561
|
+
const menuRef = useObjectRef5();
|
|
2712
2562
|
const state = useMenuTriggerState({
|
|
2713
2563
|
isOpen: open,
|
|
2714
2564
|
onOpenChange
|
|
@@ -2726,8 +2576,8 @@ var MenuTrigger = ({
|
|
|
2726
2576
|
autoFocus: state.focusStrategy
|
|
2727
2577
|
};
|
|
2728
2578
|
const isSmallScreen = useSmallScreen2();
|
|
2729
|
-
return /* @__PURE__ */
|
|
2730
|
-
/* @__PURE__ */
|
|
2579
|
+
return /* @__PURE__ */ jsxs23(MenuContext.Provider, { value: menuContext, children: [
|
|
2580
|
+
/* @__PURE__ */ jsx57(
|
|
2731
2581
|
PressResponder2,
|
|
2732
2582
|
{
|
|
2733
2583
|
...menuTriggerProps,
|
|
@@ -2736,12 +2586,12 @@ var MenuTrigger = ({
|
|
|
2736
2586
|
children: menuTrigger
|
|
2737
2587
|
}
|
|
2738
2588
|
),
|
|
2739
|
-
isSmallScreen ? /* @__PURE__ */
|
|
2589
|
+
isSmallScreen ? /* @__PURE__ */ jsx57(Tray, { state, children: menu }) : /* @__PURE__ */ jsx57(Popover, { triggerRef: menuTriggerRef, scrollRef: menuRef, state, children: menu })
|
|
2740
2590
|
] });
|
|
2741
2591
|
};
|
|
2742
2592
|
|
|
2743
2593
|
// src/Menu/Menu.tsx
|
|
2744
|
-
import { jsx as
|
|
2594
|
+
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
2745
2595
|
var Menu = ({ variant, size, ...props }) => {
|
|
2746
2596
|
const { ref: scrollRef, ...menuContext } = useMenuContext();
|
|
2747
2597
|
const ownProps = { ...props, ...menuContext };
|
|
@@ -2750,9 +2600,9 @@ var Menu = ({ variant, size, ...props }) => {
|
|
|
2750
2600
|
const { menuProps } = useMenu(ownProps, state, ref);
|
|
2751
2601
|
useSyncRef({ ref: scrollRef }, ref);
|
|
2752
2602
|
const classNames2 = useClassNames29({ component: "Menu", variant, size });
|
|
2753
|
-
return /* @__PURE__ */
|
|
2603
|
+
return /* @__PURE__ */ jsx58("ul", { ref, className: classNames2.container, ...menuProps, children: [...state.collection].map((item) => {
|
|
2754
2604
|
if (item.type === "section") {
|
|
2755
|
-
return /* @__PURE__ */
|
|
2605
|
+
return /* @__PURE__ */ jsx58(
|
|
2756
2606
|
MenuSection_default,
|
|
2757
2607
|
{
|
|
2758
2608
|
item,
|
|
@@ -2762,7 +2612,7 @@ var Menu = ({ variant, size, ...props }) => {
|
|
|
2762
2612
|
item.key
|
|
2763
2613
|
);
|
|
2764
2614
|
}
|
|
2765
|
-
return /* @__PURE__ */
|
|
2615
|
+
return /* @__PURE__ */ jsx58(
|
|
2766
2616
|
MenuItem,
|
|
2767
2617
|
{
|
|
2768
2618
|
item,
|
|
@@ -2780,25 +2630,25 @@ Menu.Section = Section2;
|
|
|
2780
2630
|
|
|
2781
2631
|
// src/Menu/ActionMenu.tsx
|
|
2782
2632
|
import { SVG as SVG5 } from "@marigold/system";
|
|
2783
|
-
import { jsx as
|
|
2633
|
+
import { jsx as jsx59, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2784
2634
|
var ActionMenu = (props) => {
|
|
2785
|
-
return /* @__PURE__ */
|
|
2786
|
-
/* @__PURE__ */
|
|
2787
|
-
/* @__PURE__ */
|
|
2635
|
+
return /* @__PURE__ */ jsxs24(Menu.Trigger, { children: [
|
|
2636
|
+
/* @__PURE__ */ jsx59(_Button, { variant: "menu", size: "small", children: /* @__PURE__ */ jsx59(SVG5, { viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx59("path", { d: "M12.0117 7.47656C13.2557 7.47656 14.2734 6.45879 14.2734 5.21484C14.2734 3.9709 13.2557 2.95312 12.0117 2.95312C10.7678 2.95312 9.75 3.9709 9.75 5.21484C9.75 6.45879 10.7678 7.47656 12.0117 7.47656ZM12.0117 9.73828C10.7678 9.73828 9.75 10.7561 9.75 12C9.75 13.2439 10.7678 14.2617 12.0117 14.2617C13.2557 14.2617 14.2734 13.2439 14.2734 12C14.2734 10.7561 13.2557 9.73828 12.0117 9.73828ZM12.0117 16.5234C10.7678 16.5234 9.75 17.5412 9.75 18.7852C9.75 20.0291 10.7678 21.0469 12.0117 21.0469C13.2557 21.0469 14.2734 20.0291 14.2734 18.7852C14.2734 17.5412 13.2557 16.5234 12.0117 16.5234Z" }) }) }),
|
|
2637
|
+
/* @__PURE__ */ jsx59(Menu, { ...props })
|
|
2788
2638
|
] });
|
|
2789
2639
|
};
|
|
2790
2640
|
|
|
2791
2641
|
// src/Message/Message.tsx
|
|
2792
|
-
import { cn as
|
|
2793
|
-
import { jsx as
|
|
2642
|
+
import { cn as cn30, useClassNames as useClassNames30 } from "@marigold/system";
|
|
2643
|
+
import { jsx as jsx60, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2794
2644
|
var icons = {
|
|
2795
|
-
info: () => /* @__PURE__ */
|
|
2645
|
+
info: () => /* @__PURE__ */ jsx60(
|
|
2796
2646
|
"svg",
|
|
2797
2647
|
{
|
|
2798
2648
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2799
2649
|
viewBox: "0 0 24 24",
|
|
2800
2650
|
fill: "currentColor",
|
|
2801
|
-
children: /* @__PURE__ */
|
|
2651
|
+
children: /* @__PURE__ */ jsx60(
|
|
2802
2652
|
"path",
|
|
2803
2653
|
{
|
|
2804
2654
|
fillRule: "evenodd",
|
|
@@ -2808,13 +2658,13 @@ var icons = {
|
|
|
2808
2658
|
)
|
|
2809
2659
|
}
|
|
2810
2660
|
),
|
|
2811
|
-
warning: () => /* @__PURE__ */
|
|
2661
|
+
warning: () => /* @__PURE__ */ jsx60(
|
|
2812
2662
|
"svg",
|
|
2813
2663
|
{
|
|
2814
2664
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2815
2665
|
viewBox: "0 0 24 24",
|
|
2816
2666
|
fill: "currentColor",
|
|
2817
|
-
children: /* @__PURE__ */
|
|
2667
|
+
children: /* @__PURE__ */ jsx60(
|
|
2818
2668
|
"path",
|
|
2819
2669
|
{
|
|
2820
2670
|
fillRule: "evenodd",
|
|
@@ -2824,13 +2674,13 @@ var icons = {
|
|
|
2824
2674
|
)
|
|
2825
2675
|
}
|
|
2826
2676
|
),
|
|
2827
|
-
error: () => /* @__PURE__ */
|
|
2677
|
+
error: () => /* @__PURE__ */ jsx60(
|
|
2828
2678
|
"svg",
|
|
2829
2679
|
{
|
|
2830
2680
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2831
2681
|
viewBox: "0 0 24 24",
|
|
2832
2682
|
fill: "currentColor",
|
|
2833
|
-
children: /* @__PURE__ */
|
|
2683
|
+
children: /* @__PURE__ */ jsx60(
|
|
2834
2684
|
"path",
|
|
2835
2685
|
{
|
|
2836
2686
|
fillRule: "evenodd",
|
|
@@ -2850,24 +2700,24 @@ var Message = ({
|
|
|
2850
2700
|
}) => {
|
|
2851
2701
|
const classNames2 = useClassNames30({ component: "Message", variant, size });
|
|
2852
2702
|
const Icon3 = icons[variant];
|
|
2853
|
-
return /* @__PURE__ */
|
|
2703
|
+
return /* @__PURE__ */ jsxs25(
|
|
2854
2704
|
"div",
|
|
2855
2705
|
{
|
|
2856
|
-
className:
|
|
2706
|
+
className: cn30(
|
|
2857
2707
|
"grid auto-rows-min grid-cols-[min-content_auto] gap-1",
|
|
2858
2708
|
classNames2.container
|
|
2859
2709
|
),
|
|
2860
2710
|
...props,
|
|
2861
2711
|
children: [
|
|
2862
|
-
/* @__PURE__ */
|
|
2863
|
-
/* @__PURE__ */
|
|
2712
|
+
/* @__PURE__ */ jsx60("div", { className: cn30("col-span-1 h-5 w-5 self-center", classNames2.icon), children: /* @__PURE__ */ jsx60(Icon3, {}) }),
|
|
2713
|
+
/* @__PURE__ */ jsx60(
|
|
2864
2714
|
"div",
|
|
2865
2715
|
{
|
|
2866
|
-
className:
|
|
2716
|
+
className: cn30("col-start-2 row-start-1 self-center", classNames2.title),
|
|
2867
2717
|
children: messageTitle
|
|
2868
2718
|
}
|
|
2869
2719
|
),
|
|
2870
|
-
/* @__PURE__ */
|
|
2720
|
+
/* @__PURE__ */ jsx60("div", { className: cn30("col-start-2", classNames2.content), children })
|
|
2871
2721
|
]
|
|
2872
2722
|
}
|
|
2873
2723
|
);
|
|
@@ -2875,22 +2725,22 @@ var Message = ({
|
|
|
2875
2725
|
|
|
2876
2726
|
// src/NumberField/NumberField.tsx
|
|
2877
2727
|
import { forwardRef as forwardRef12 } from "react";
|
|
2878
|
-
import { useFocusRing as
|
|
2728
|
+
import { useFocusRing as useFocusRing7 } from "@react-aria/focus";
|
|
2879
2729
|
import { useLocale as useLocale4 } from "@react-aria/i18n";
|
|
2880
|
-
import { useHover as
|
|
2730
|
+
import { useHover as useHover5 } from "@react-aria/interactions";
|
|
2881
2731
|
import { useNumberField } from "@react-aria/numberfield";
|
|
2882
|
-
import { mergeProps as
|
|
2732
|
+
import { mergeProps as mergeProps13, useObjectRef as useObjectRef6 } from "@react-aria/utils";
|
|
2883
2733
|
import { useNumberFieldState } from "@react-stately/numberfield";
|
|
2884
|
-
import { cn as
|
|
2734
|
+
import { cn as cn32, useClassNames as useClassNames31, useStateProps as useStateProps13 } from "@marigold/system";
|
|
2885
2735
|
|
|
2886
2736
|
// src/NumberField/StepButton.tsx
|
|
2887
2737
|
import { useRef as useRef19 } from "react";
|
|
2888
|
-
import { useButton as
|
|
2889
|
-
import { useHover as
|
|
2890
|
-
import { mergeProps as
|
|
2891
|
-
import { cn as
|
|
2892
|
-
import { jsx as
|
|
2893
|
-
var Plus = () => /* @__PURE__ */
|
|
2738
|
+
import { useButton as useButton5 } from "@react-aria/button";
|
|
2739
|
+
import { useHover as useHover4 } from "@react-aria/interactions";
|
|
2740
|
+
import { mergeProps as mergeProps12 } from "@react-aria/utils";
|
|
2741
|
+
import { cn as cn31, useStateProps as useStateProps12 } from "@marigold/system";
|
|
2742
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
2743
|
+
var Plus = () => /* @__PURE__ */ jsx61("svg", { width: 16, height: 16, viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx61(
|
|
2894
2744
|
"path",
|
|
2895
2745
|
{
|
|
2896
2746
|
fillRule: "evenodd",
|
|
@@ -2898,7 +2748,7 @@ var Plus = () => /* @__PURE__ */ jsx62("svg", { width: 16, height: 16, viewBox:
|
|
|
2898
2748
|
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"
|
|
2899
2749
|
}
|
|
2900
2750
|
) });
|
|
2901
|
-
var Minus = () => /* @__PURE__ */
|
|
2751
|
+
var Minus = () => /* @__PURE__ */ jsx61("svg", { width: 16, height: 16, viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx61(
|
|
2902
2752
|
"path",
|
|
2903
2753
|
{
|
|
2904
2754
|
fillRule: "evenodd",
|
|
@@ -2912,36 +2762,36 @@ var StepButton = ({
|
|
|
2912
2762
|
...props
|
|
2913
2763
|
}) => {
|
|
2914
2764
|
const ref = useRef19(null);
|
|
2915
|
-
const { buttonProps, isPressed } =
|
|
2765
|
+
const { buttonProps, isPressed } = useButton5(
|
|
2916
2766
|
{ ...props, elementType: "div" },
|
|
2917
2767
|
ref
|
|
2918
2768
|
);
|
|
2919
|
-
const { hoverProps, isHovered } =
|
|
2920
|
-
const stateProps =
|
|
2769
|
+
const { hoverProps, isHovered } = useHover4(props);
|
|
2770
|
+
const stateProps = useStateProps12({
|
|
2921
2771
|
active: isPressed,
|
|
2922
2772
|
hover: isHovered,
|
|
2923
2773
|
disabled: props.isDisabled
|
|
2924
2774
|
});
|
|
2925
2775
|
const Icon3 = direction === "up" ? Plus : Minus;
|
|
2926
|
-
return /* @__PURE__ */
|
|
2776
|
+
return /* @__PURE__ */ jsx61(
|
|
2927
2777
|
"div",
|
|
2928
2778
|
{
|
|
2929
|
-
className:
|
|
2779
|
+
className: cn31(
|
|
2930
2780
|
[
|
|
2931
2781
|
"flex items-center justify-center",
|
|
2932
2782
|
"cursor-pointer data-[disabled]:cursor-not-allowed"
|
|
2933
2783
|
],
|
|
2934
2784
|
className
|
|
2935
2785
|
),
|
|
2936
|
-
...
|
|
2786
|
+
...mergeProps12(buttonProps, hoverProps),
|
|
2937
2787
|
...stateProps,
|
|
2938
|
-
children: /* @__PURE__ */
|
|
2788
|
+
children: /* @__PURE__ */ jsx61(Icon3, {})
|
|
2939
2789
|
}
|
|
2940
2790
|
);
|
|
2941
2791
|
};
|
|
2942
2792
|
|
|
2943
2793
|
// src/NumberField/NumberField.tsx
|
|
2944
|
-
import { jsx as
|
|
2794
|
+
import { jsx as jsx62, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
2945
2795
|
var NumberField = forwardRef12(
|
|
2946
2796
|
({
|
|
2947
2797
|
variant,
|
|
@@ -2963,7 +2813,7 @@ var NumberField = forwardRef12(
|
|
|
2963
2813
|
};
|
|
2964
2814
|
const showStepper = !hideStepper;
|
|
2965
2815
|
const { locale } = useLocale4();
|
|
2966
|
-
const inputRef =
|
|
2816
|
+
const inputRef = useObjectRef6(ref);
|
|
2967
2817
|
const state = useNumberFieldState({ ...props, locale });
|
|
2968
2818
|
const {
|
|
2969
2819
|
labelProps,
|
|
@@ -2974,13 +2824,13 @@ var NumberField = forwardRef12(
|
|
|
2974
2824
|
incrementButtonProps,
|
|
2975
2825
|
decrementButtonProps
|
|
2976
2826
|
} = useNumberField(props, state, inputRef);
|
|
2977
|
-
const { hoverProps, isHovered } =
|
|
2978
|
-
const { focusProps, isFocused } =
|
|
2827
|
+
const { hoverProps, isHovered } = useHover5({ isDisabled: disabled });
|
|
2828
|
+
const { focusProps, isFocused } = useFocusRing7({
|
|
2979
2829
|
within: true,
|
|
2980
2830
|
isTextInput: true,
|
|
2981
2831
|
autoFocus: props.autoFocus
|
|
2982
2832
|
});
|
|
2983
|
-
const stateProps =
|
|
2833
|
+
const stateProps = useStateProps13({
|
|
2984
2834
|
hover: isHovered,
|
|
2985
2835
|
focus: isFocused,
|
|
2986
2836
|
disabled,
|
|
@@ -2993,7 +2843,7 @@ var NumberField = forwardRef12(
|
|
|
2993
2843
|
size,
|
|
2994
2844
|
variant
|
|
2995
2845
|
});
|
|
2996
|
-
return /* @__PURE__ */
|
|
2846
|
+
return /* @__PURE__ */ jsx62(
|
|
2997
2847
|
FieldBase,
|
|
2998
2848
|
{
|
|
2999
2849
|
label: props.label,
|
|
@@ -3007,16 +2857,16 @@ var NumberField = forwardRef12(
|
|
|
3007
2857
|
variant,
|
|
3008
2858
|
size,
|
|
3009
2859
|
width,
|
|
3010
|
-
children: /* @__PURE__ */
|
|
2860
|
+
children: /* @__PURE__ */ jsxs26(
|
|
3011
2861
|
"div",
|
|
3012
2862
|
{
|
|
3013
2863
|
"data-group": true,
|
|
3014
|
-
className:
|
|
2864
|
+
className: cn32("flex items-stretch", classNames2.group),
|
|
3015
2865
|
"data-testid": "number-field-container",
|
|
3016
|
-
...
|
|
2866
|
+
...mergeProps13(groupProps, focusProps, hoverProps),
|
|
3017
2867
|
...stateProps,
|
|
3018
2868
|
children: [
|
|
3019
|
-
showStepper && /* @__PURE__ */
|
|
2869
|
+
showStepper && /* @__PURE__ */ jsx62(
|
|
3020
2870
|
StepButton,
|
|
3021
2871
|
{
|
|
3022
2872
|
className: classNames2.stepper,
|
|
@@ -3024,20 +2874,17 @@ var NumberField = forwardRef12(
|
|
|
3024
2874
|
...decrementButtonProps
|
|
3025
2875
|
}
|
|
3026
2876
|
),
|
|
3027
|
-
/* @__PURE__ */
|
|
2877
|
+
/* @__PURE__ */ jsx62("div", { className: "flex-1", children: /* @__PURE__ */ jsx62(
|
|
3028
2878
|
Input,
|
|
3029
2879
|
{
|
|
3030
2880
|
ref: inputRef,
|
|
3031
2881
|
variant,
|
|
3032
2882
|
size,
|
|
3033
|
-
className: {
|
|
3034
|
-
input: "min-w-0 items-stretch border-none"
|
|
3035
|
-
},
|
|
3036
2883
|
...inputProps,
|
|
3037
2884
|
...stateProps
|
|
3038
2885
|
}
|
|
3039
2886
|
) }),
|
|
3040
|
-
showStepper && /* @__PURE__ */
|
|
2887
|
+
showStepper && /* @__PURE__ */ jsx62(
|
|
3041
2888
|
StepButton,
|
|
3042
2889
|
{
|
|
3043
2890
|
className: classNames2.stepper,
|
|
@@ -3063,29 +2910,22 @@ import {
|
|
|
3063
2910
|
defaultTheme,
|
|
3064
2911
|
useTheme as useTheme3
|
|
3065
2912
|
} from "@marigold/system";
|
|
3066
|
-
import { jsx as
|
|
2913
|
+
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
3067
2914
|
function MarigoldProvider({
|
|
3068
2915
|
children,
|
|
3069
2916
|
theme
|
|
3070
2917
|
}) {
|
|
3071
2918
|
const outerTheme = useTheme3();
|
|
3072
2919
|
const isTopLevel = outerTheme === defaultTheme;
|
|
3073
|
-
return /* @__PURE__ */
|
|
2920
|
+
return /* @__PURE__ */ jsx63(ThemeProvider, { theme, children: isTopLevel ? /* @__PURE__ */ jsx63(OverlayProvider, { children }) : children });
|
|
3074
2921
|
}
|
|
3075
2922
|
|
|
3076
2923
|
// src/Radio/Radio.tsx
|
|
3077
2924
|
import {
|
|
3078
|
-
forwardRef as
|
|
2925
|
+
forwardRef as forwardRef14
|
|
3079
2926
|
} from "react";
|
|
3080
|
-
import {
|
|
3081
|
-
import {
|
|
3082
|
-
import { useRadio } from "@react-aria/radio";
|
|
3083
|
-
import { mergeProps as mergeProps15, useObjectRef as useObjectRef10 } from "@react-aria/utils";
|
|
3084
|
-
import {
|
|
3085
|
-
cn as cn33,
|
|
3086
|
-
useClassNames as useClassNames32,
|
|
3087
|
-
useStateProps as useStateProps17
|
|
3088
|
-
} from "@marigold/system";
|
|
2927
|
+
import { Radio } from "react-aria-components";
|
|
2928
|
+
import { cn as cn36, useClassNames as useClassNames35 } from "@marigold/system";
|
|
3089
2929
|
|
|
3090
2930
|
// src/Radio/Context.ts
|
|
3091
2931
|
import { createContext as createContext7, useContext as useContext7 } from "react";
|
|
@@ -3095,59 +2935,149 @@ var RadioGroupContext = createContext7(
|
|
|
3095
2935
|
var useRadioGroupContext = () => useContext7(RadioGroupContext);
|
|
3096
2936
|
|
|
3097
2937
|
// src/Radio/RadioGroup.tsx
|
|
3098
|
-
import {
|
|
3099
|
-
import {
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
2938
|
+
import { RadioGroup } from "react-aria-components";
|
|
2939
|
+
import { cn as cn35, useClassNames as useClassNames34 } from "@marigold/system";
|
|
2940
|
+
|
|
2941
|
+
// src/FieldBase/_FieldBase.tsx
|
|
2942
|
+
import { forwardRef as forwardRef13 } from "react";
|
|
2943
|
+
import { cn as cn34, width as twWidth2, useClassNames as useClassNames33 } from "@marigold/system";
|
|
2944
|
+
|
|
2945
|
+
// src/HelpText/_HelpText.tsx
|
|
2946
|
+
import { Text } from "react-aria-components";
|
|
2947
|
+
import { cn as cn33, useClassNames as useClassNames32 } from "@marigold/system";
|
|
2948
|
+
import { Fragment as Fragment7, jsx as jsx64, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2949
|
+
var HelpText2 = ({
|
|
2950
|
+
variant,
|
|
2951
|
+
size,
|
|
2952
|
+
description,
|
|
2953
|
+
error,
|
|
2954
|
+
errorMessage,
|
|
2955
|
+
...props
|
|
2956
|
+
}) => {
|
|
2957
|
+
const hasErrorMessage = errorMessage && error;
|
|
2958
|
+
const classNames2 = useClassNames32({
|
|
2959
|
+
component: "HelpText",
|
|
2960
|
+
variant,
|
|
2961
|
+
size
|
|
2962
|
+
});
|
|
2963
|
+
if (!description && !errorMessage) {
|
|
2964
|
+
return null;
|
|
2965
|
+
}
|
|
2966
|
+
return /* @__PURE__ */ jsx64(
|
|
2967
|
+
Text,
|
|
2968
|
+
{
|
|
2969
|
+
...props,
|
|
2970
|
+
slot: hasErrorMessage ? "errorMessage" : "description",
|
|
2971
|
+
className: cn33("flex items-center gap-1", classNames2.container),
|
|
2972
|
+
children: hasErrorMessage ? /* @__PURE__ */ jsxs27(Fragment7, { children: [
|
|
2973
|
+
/* @__PURE__ */ jsx64(
|
|
2974
|
+
"svg",
|
|
2975
|
+
{
|
|
2976
|
+
className: cn33("h-4 w-4", classNames2.icon),
|
|
2977
|
+
viewBox: "0 0 24 24",
|
|
2978
|
+
role: "presentation",
|
|
2979
|
+
children: /* @__PURE__ */ jsx64("path", { d: "M2.25 20.3097H21.75L12 3.46875L2.25 20.3097ZM12.8864 17.2606H11.1136V15.4879H12.8864V17.2606ZM12.8864 13.7151H11.1136V10.1697H12.8864V13.7151Z" })
|
|
2980
|
+
}
|
|
2981
|
+
),
|
|
2982
|
+
errorMessage
|
|
2983
|
+
] }) : description
|
|
2984
|
+
}
|
|
2985
|
+
);
|
|
2986
|
+
};
|
|
2987
|
+
|
|
2988
|
+
// src/FieldBase/_FieldBase.tsx
|
|
2989
|
+
import { jsx as jsx65, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2990
|
+
var fixedForwardRef = forwardRef13;
|
|
2991
|
+
var _FieldBase = (props, ref) => {
|
|
2992
|
+
const {
|
|
2993
|
+
as: Component = "div",
|
|
2994
|
+
children,
|
|
2995
|
+
label,
|
|
2996
|
+
size,
|
|
2997
|
+
variant,
|
|
2998
|
+
width = "full",
|
|
2999
|
+
description,
|
|
3000
|
+
errorMessage,
|
|
3001
|
+
...rest
|
|
3002
|
+
} = props;
|
|
3003
|
+
const classNames2 = useClassNames33({
|
|
3004
|
+
component: "Field",
|
|
3005
|
+
variant,
|
|
3006
|
+
size
|
|
3007
|
+
});
|
|
3008
|
+
return /* @__PURE__ */ jsxs28(
|
|
3009
|
+
Component,
|
|
3010
|
+
{
|
|
3011
|
+
ref,
|
|
3012
|
+
className: cn34("group/field", twWidth2[width], classNames2),
|
|
3013
|
+
...rest,
|
|
3014
|
+
children: [
|
|
3015
|
+
/* @__PURE__ */ jsx65(_Label, { variant, size, children: label }),
|
|
3016
|
+
children,
|
|
3017
|
+
/* @__PURE__ */ jsx65(
|
|
3018
|
+
HelpText2,
|
|
3019
|
+
{
|
|
3020
|
+
variant,
|
|
3021
|
+
size,
|
|
3022
|
+
description,
|
|
3023
|
+
errorMessage,
|
|
3024
|
+
error: props.isInvalid
|
|
3025
|
+
}
|
|
3026
|
+
)
|
|
3027
|
+
]
|
|
3028
|
+
}
|
|
3029
|
+
);
|
|
3030
|
+
};
|
|
3031
|
+
var FieldBase2 = fixedForwardRef(_FieldBase);
|
|
3032
|
+
|
|
3033
|
+
// src/Radio/RadioGroup.tsx
|
|
3034
|
+
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
3035
|
+
var _RadioGroup = ({
|
|
3036
|
+
variant,
|
|
3037
|
+
size,
|
|
3038
|
+
label,
|
|
3039
|
+
error,
|
|
3107
3040
|
disabled,
|
|
3041
|
+
required,
|
|
3108
3042
|
readOnly,
|
|
3109
|
-
|
|
3043
|
+
description,
|
|
3044
|
+
errorMessage,
|
|
3045
|
+
orientation = "vertical",
|
|
3046
|
+
children,
|
|
3047
|
+
width,
|
|
3110
3048
|
...rest
|
|
3111
3049
|
}) => {
|
|
3050
|
+
const classNames2 = useClassNames34({ component: "Radio", variant, size });
|
|
3112
3051
|
const props = {
|
|
3113
|
-
isRequired: required,
|
|
3114
3052
|
isDisabled: disabled,
|
|
3115
3053
|
isReadOnly: readOnly,
|
|
3116
|
-
|
|
3054
|
+
isRequired: required,
|
|
3055
|
+
isInvalid: error,
|
|
3117
3056
|
...rest
|
|
3118
3057
|
};
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
const stateProps = useStateProps16({
|
|
3122
|
-
disabled,
|
|
3123
|
-
readOnly,
|
|
3124
|
-
error,
|
|
3125
|
-
required
|
|
3126
|
-
});
|
|
3127
|
-
return /* @__PURE__ */ jsx65(
|
|
3128
|
-
FieldBase,
|
|
3058
|
+
return /* @__PURE__ */ jsx66(
|
|
3059
|
+
FieldBase2,
|
|
3129
3060
|
{
|
|
3061
|
+
as: RadioGroup,
|
|
3130
3062
|
width,
|
|
3131
|
-
label
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
disabled,
|
|
3139
|
-
stateProps,
|
|
3140
|
-
...radioGroupProps,
|
|
3141
|
-
children: /* @__PURE__ */ jsx65(
|
|
3063
|
+
label,
|
|
3064
|
+
description,
|
|
3065
|
+
errorMessage,
|
|
3066
|
+
variant,
|
|
3067
|
+
size,
|
|
3068
|
+
...props,
|
|
3069
|
+
children: /* @__PURE__ */ jsx66(
|
|
3142
3070
|
"div",
|
|
3143
3071
|
{
|
|
3144
3072
|
role: "presentation",
|
|
3073
|
+
"data-testid": "group",
|
|
3145
3074
|
"data-orientation": orientation,
|
|
3146
|
-
className:
|
|
3075
|
+
className: cn35(
|
|
3076
|
+
classNames2.group,
|
|
3147
3077
|
"flex items-start",
|
|
3148
3078
|
orientation === "vertical" ? "flex-col gap-[0.5ch]" : "flex-row gap-[1.5ch]"
|
|
3149
3079
|
),
|
|
3150
|
-
children: /* @__PURE__ */
|
|
3080
|
+
children: /* @__PURE__ */ jsx66(RadioGroupContext.Provider, { value: { width, variant, size }, children })
|
|
3151
3081
|
}
|
|
3152
3082
|
)
|
|
3153
3083
|
}
|
|
@@ -3155,208 +3085,118 @@ var RadioGroup = ({
|
|
|
3155
3085
|
};
|
|
3156
3086
|
|
|
3157
3087
|
// src/Radio/Radio.tsx
|
|
3158
|
-
import { jsx as
|
|
3159
|
-
var Dot = () => /* @__PURE__ */
|
|
3160
|
-
var Icon2 = ({ checked, className, ...props }) => /* @__PURE__ */
|
|
3088
|
+
import { Fragment as Fragment8, jsx as jsx67, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
3089
|
+
var Dot = () => /* @__PURE__ */ jsx67("svg", { viewBox: "0 0 6 6", children: /* @__PURE__ */ jsx67("circle", { fill: "currentColor", cx: "3", cy: "3", r: "3" }) });
|
|
3090
|
+
var Icon2 = ({ checked, className, ...props }) => /* @__PURE__ */ jsx67(
|
|
3161
3091
|
"div",
|
|
3162
3092
|
{
|
|
3163
|
-
className:
|
|
3093
|
+
className: cn36(
|
|
3164
3094
|
"bg-secondary-50 flex h-4 w-4 items-center justify-center rounded-[50%] border p-1",
|
|
3165
3095
|
className
|
|
3166
3096
|
),
|
|
3167
3097
|
"aria-hidden": "true",
|
|
3168
3098
|
...props,
|
|
3169
|
-
children: checked ? /* @__PURE__ */
|
|
3099
|
+
children: checked ? /* @__PURE__ */ jsx67(Dot, {}) : null
|
|
3170
3100
|
}
|
|
3171
3101
|
);
|
|
3172
|
-
var
|
|
3173
|
-
({
|
|
3174
|
-
const {
|
|
3175
|
-
|
|
3176
|
-
size,
|
|
3177
|
-
error,
|
|
3178
|
-
width: groupWidth,
|
|
3179
|
-
state
|
|
3180
|
-
} = useRadioGroupContext();
|
|
3181
|
-
const inputRef = useObjectRef10(ref);
|
|
3182
|
-
const { inputProps } = useRadio(
|
|
3183
|
-
{ isDisabled: disabled, ...props },
|
|
3184
|
-
state,
|
|
3185
|
-
inputRef
|
|
3186
|
-
);
|
|
3187
|
-
const classNames2 = useClassNames32({
|
|
3102
|
+
var _Radio = forwardRef14(
|
|
3103
|
+
({ value, disabled, width, children, ...props }, ref) => {
|
|
3104
|
+
const { variant, size, width: groupWidth } = useRadioGroupContext();
|
|
3105
|
+
const classNames2 = useClassNames35({
|
|
3188
3106
|
component: "Radio",
|
|
3189
3107
|
variant: variant || props.variant,
|
|
3190
3108
|
size: size || props.size
|
|
3191
3109
|
});
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
const stateProps = useStateProps17({
|
|
3195
|
-
hover: isHovered,
|
|
3196
|
-
focus: isFocusVisible,
|
|
3197
|
-
checked: inputProps.checked,
|
|
3198
|
-
disabled: inputProps.disabled,
|
|
3199
|
-
readOnly: props.readOnly,
|
|
3200
|
-
error
|
|
3201
|
-
});
|
|
3202
|
-
return /* @__PURE__ */ jsxs28(
|
|
3203
|
-
"label",
|
|
3110
|
+
return /* @__PURE__ */ jsx67(
|
|
3111
|
+
Radio,
|
|
3204
3112
|
{
|
|
3205
|
-
|
|
3113
|
+
ref,
|
|
3114
|
+
className: cn36(
|
|
3206
3115
|
"group/radio",
|
|
3207
3116
|
"relative flex items-center gap-[1ch]",
|
|
3208
3117
|
width || groupWidth || "w-full",
|
|
3209
3118
|
classNames2.container
|
|
3210
3119
|
),
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3120
|
+
value,
|
|
3121
|
+
isDisabled: disabled,
|
|
3122
|
+
...props,
|
|
3123
|
+
children: ({ isSelected }) => /* @__PURE__ */ jsxs29(Fragment8, { children: [
|
|
3124
|
+
/* @__PURE__ */ jsx67(
|
|
3125
|
+
Icon2,
|
|
3215
3126
|
{
|
|
3216
|
-
|
|
3217
|
-
className:
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
)
|
|
3221
|
-
...mergeProps15(inputProps, focusProps)
|
|
3127
|
+
checked: isSelected,
|
|
3128
|
+
className: cn36(
|
|
3129
|
+
disabled ? "cursor-not-allowed" : "cursor-pointer",
|
|
3130
|
+
classNames2.radio
|
|
3131
|
+
)
|
|
3222
3132
|
}
|
|
3223
3133
|
),
|
|
3224
|
-
/* @__PURE__ */
|
|
3225
|
-
|
|
3226
|
-
]
|
|
3134
|
+
/* @__PURE__ */ jsx67("div", { className: classNames2.label, children })
|
|
3135
|
+
] })
|
|
3227
3136
|
}
|
|
3228
3137
|
);
|
|
3229
3138
|
}
|
|
3230
3139
|
);
|
|
3231
|
-
|
|
3140
|
+
_Radio.Group = _RadioGroup;
|
|
3232
3141
|
|
|
3233
3142
|
// src/Slider/Slider.tsx
|
|
3234
|
-
import { forwardRef as
|
|
3235
|
-
import {
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3143
|
+
import { forwardRef as forwardRef15 } from "react";
|
|
3144
|
+
import {
|
|
3145
|
+
Slider,
|
|
3146
|
+
SliderOutput,
|
|
3147
|
+
SliderThumb,
|
|
3148
|
+
SliderTrack
|
|
3149
|
+
} from "react-aria-components";
|
|
3239
3150
|
import {
|
|
3240
|
-
cn as
|
|
3241
|
-
width as
|
|
3242
|
-
useClassNames as
|
|
3243
|
-
useStateProps as useStateProps19
|
|
3151
|
+
cn as cn37,
|
|
3152
|
+
width as twWidth3,
|
|
3153
|
+
useClassNames as useClassNames36
|
|
3244
3154
|
} from "@marigold/system";
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
// src/Slider/Thumb.tsx
|
|
3257
|
-
import { jsx as jsx67 } from "react/jsx-runtime";
|
|
3258
|
-
var Thumb = ({ state, trackRef, className, ...props }) => {
|
|
3259
|
-
const { disabled } = props;
|
|
3260
|
-
const inputRef = useRef20(null);
|
|
3261
|
-
const { isFocusVisible, focusProps, isFocused } = useFocusRing11();
|
|
3262
|
-
const focused = isFocused || isFocusVisible || state.isThumbDragging(0);
|
|
3263
|
-
const stateProps = useStateProps18({
|
|
3264
|
-
focus: focused,
|
|
3265
|
-
disabled
|
|
3266
|
-
});
|
|
3267
|
-
const { thumbProps, inputProps } = useSliderThumb(
|
|
3268
|
-
{
|
|
3269
|
-
index: 0,
|
|
3270
|
-
trackRef,
|
|
3271
|
-
inputRef,
|
|
3272
|
-
isDisabled: disabled
|
|
3273
|
-
},
|
|
3274
|
-
state
|
|
3275
|
-
);
|
|
3276
|
-
useEffect2(() => {
|
|
3277
|
-
state.setThumbEditable(0, !disabled);
|
|
3278
|
-
}, [disabled, state]);
|
|
3279
|
-
return /* @__PURE__ */ jsx67("div", { className: cn34("top-1/2", className), ...thumbProps, ...stateProps, children: /* @__PURE__ */ jsx67(VisuallyHidden, { children: /* @__PURE__ */ jsx67(
|
|
3280
|
-
"input",
|
|
3281
|
-
{
|
|
3282
|
-
type: "range",
|
|
3283
|
-
ref: inputRef,
|
|
3284
|
-
...mergeProps16(inputProps, focusProps)
|
|
3285
|
-
}
|
|
3286
|
-
) }) });
|
|
3287
|
-
};
|
|
3288
|
-
|
|
3289
|
-
// src/Slider/Slider.tsx
|
|
3290
|
-
import { jsx as jsx68, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
3291
|
-
var Slider = forwardRef14(
|
|
3292
|
-
({ variant, size, width = "full", ...props }, ref) => {
|
|
3293
|
-
const { formatOptions } = props;
|
|
3294
|
-
const trackRef = useObjectRef11(ref);
|
|
3295
|
-
const numberFormatter = useNumberFormatter(formatOptions);
|
|
3296
|
-
const state = useSliderState({ ...props, numberFormatter });
|
|
3297
|
-
const { groupProps, trackProps, labelProps, outputProps } = useSlider(
|
|
3298
|
-
{
|
|
3299
|
-
label: props.children,
|
|
3300
|
-
...props
|
|
3301
|
-
},
|
|
3302
|
-
state,
|
|
3303
|
-
trackRef
|
|
3304
|
-
);
|
|
3305
|
-
const classNames2 = useClassNames33({
|
|
3155
|
+
import { jsx as jsx68, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
3156
|
+
var _Slider = forwardRef15(
|
|
3157
|
+
({
|
|
3158
|
+
thumbLabels,
|
|
3159
|
+
variant,
|
|
3160
|
+
size,
|
|
3161
|
+
width = "full",
|
|
3162
|
+
disabled,
|
|
3163
|
+
...rest
|
|
3164
|
+
}, ref) => {
|
|
3165
|
+
const classNames2 = useClassNames36({
|
|
3306
3166
|
component: "Slider",
|
|
3307
3167
|
variant,
|
|
3308
3168
|
size
|
|
3309
3169
|
});
|
|
3310
|
-
const
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3170
|
+
const props = {
|
|
3171
|
+
isDisabled: disabled,
|
|
3172
|
+
...rest
|
|
3173
|
+
};
|
|
3174
|
+
return /* @__PURE__ */ jsxs30(
|
|
3175
|
+
Slider,
|
|
3315
3176
|
{
|
|
3316
|
-
className:
|
|
3317
|
-
|
|
3177
|
+
className: cn37(
|
|
3178
|
+
"grid grid-cols-[auto_1fr] gap-y-1",
|
|
3179
|
+
classNames2.container,
|
|
3180
|
+
twWidth3[width]
|
|
3181
|
+
),
|
|
3182
|
+
ref,
|
|
3183
|
+
...props,
|
|
3318
3184
|
children: [
|
|
3319
|
-
/* @__PURE__ */
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
{
|
|
3324
|
-
className: cn35(
|
|
3325
|
-
"flex flex-shrink-0 flex-grow basis-auto",
|
|
3326
|
-
classNames2.output
|
|
3327
|
-
),
|
|
3328
|
-
...outputProps,
|
|
3329
|
-
children: state.getThumbValueLabel(0)
|
|
3330
|
-
}
|
|
3331
|
-
)
|
|
3332
|
-
] }),
|
|
3333
|
-
/* @__PURE__ */ jsxs29(
|
|
3334
|
-
"div",
|
|
3185
|
+
/* @__PURE__ */ jsx68(_Label, { children: props.children }),
|
|
3186
|
+
/* @__PURE__ */ jsx68(SliderOutput, { className: cn37("flex justify-end", classNames2.output), children: ({ state }) => state.values.map((_, i) => state.getThumbValueLabel(i)).join(" \u2013 ") }),
|
|
3187
|
+
/* @__PURE__ */ jsx68(
|
|
3188
|
+
SliderTrack,
|
|
3335
3189
|
{
|
|
3336
|
-
className: "h-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
"
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
classNames2.track
|
|
3347
|
-
)
|
|
3348
|
-
}
|
|
3349
|
-
),
|
|
3350
|
-
/* @__PURE__ */ jsx68(
|
|
3351
|
-
Thumb,
|
|
3352
|
-
{
|
|
3353
|
-
state,
|
|
3354
|
-
trackRef,
|
|
3355
|
-
disabled: props.disabled,
|
|
3356
|
-
className: classNames2.thumb
|
|
3357
|
-
}
|
|
3358
|
-
)
|
|
3359
|
-
]
|
|
3190
|
+
className: cn37("relative col-span-2 h-2 w-full", classNames2.track),
|
|
3191
|
+
children: ({ state }) => state.values.map((_, i) => /* @__PURE__ */ jsx68(
|
|
3192
|
+
SliderThumb,
|
|
3193
|
+
{
|
|
3194
|
+
className: cn37("top-1/2 cursor-pointer", classNames2.thumb),
|
|
3195
|
+
index: i,
|
|
3196
|
+
"aria-label": thumbLabels == null ? void 0 : thumbLabels[i]
|
|
3197
|
+
},
|
|
3198
|
+
i
|
|
3199
|
+
))
|
|
3360
3200
|
}
|
|
3361
3201
|
)
|
|
3362
3202
|
]
|
|
@@ -3372,7 +3212,7 @@ var Split = (props) => /* @__PURE__ */ jsx69("div", { ...props, role: "separator
|
|
|
3372
3212
|
// src/Stack/Stack.tsx
|
|
3373
3213
|
import {
|
|
3374
3214
|
alignment as alignment3,
|
|
3375
|
-
cn as
|
|
3215
|
+
cn as cn38,
|
|
3376
3216
|
gapSpace as gapSpace6
|
|
3377
3217
|
} from "@marigold/system";
|
|
3378
3218
|
import { jsx as jsx70 } from "react/jsx-runtime";
|
|
@@ -3389,7 +3229,7 @@ var Stack = ({
|
|
|
3389
3229
|
return /* @__PURE__ */ jsx70(
|
|
3390
3230
|
"div",
|
|
3391
3231
|
{
|
|
3392
|
-
className:
|
|
3232
|
+
className: cn38(
|
|
3393
3233
|
"flex flex-col",
|
|
3394
3234
|
gapSpace6[space],
|
|
3395
3235
|
alignX && ((_b = (_a = alignment3) == null ? void 0 : _a.vertical) == null ? void 0 : _b.alignmentX[alignX]),
|
|
@@ -3403,78 +3243,52 @@ var Stack = ({
|
|
|
3403
3243
|
};
|
|
3404
3244
|
|
|
3405
3245
|
// src/Switch/Switch.tsx
|
|
3406
|
-
import { forwardRef as
|
|
3407
|
-
import {
|
|
3408
|
-
import { useSwitch } from "@react-aria/switch";
|
|
3409
|
-
import { useObjectRef as useObjectRef12 } from "@react-aria/utils";
|
|
3410
|
-
import { useToggleState as useToggleState2 } from "@react-stately/toggle";
|
|
3246
|
+
import { forwardRef as forwardRef16 } from "react";
|
|
3247
|
+
import { Switch } from "react-aria-components";
|
|
3411
3248
|
import {
|
|
3412
|
-
cn as
|
|
3413
|
-
width as
|
|
3414
|
-
useClassNames as
|
|
3415
|
-
useStateProps as useStateProps20
|
|
3249
|
+
cn as cn39,
|
|
3250
|
+
width as twWidth4,
|
|
3251
|
+
useClassNames as useClassNames37
|
|
3416
3252
|
} from "@marigold/system";
|
|
3417
|
-
import {
|
|
3418
|
-
var
|
|
3253
|
+
import { jsx as jsx71, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
3254
|
+
var _Switch = forwardRef16(
|
|
3419
3255
|
({
|
|
3420
3256
|
variant,
|
|
3421
3257
|
size,
|
|
3422
3258
|
width = "full",
|
|
3259
|
+
children,
|
|
3423
3260
|
selected,
|
|
3424
3261
|
disabled,
|
|
3425
3262
|
readOnly,
|
|
3426
|
-
|
|
3427
|
-
...rest
|
|
3263
|
+
...props
|
|
3428
3264
|
}, ref) => {
|
|
3429
|
-
const
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
isDisabled: disabled,
|
|
3433
|
-
isReadOnly: readOnly,
|
|
3434
|
-
defaultSelected: defaultChecked,
|
|
3435
|
-
...rest
|
|
3436
|
-
};
|
|
3437
|
-
const state = useToggleState2(props);
|
|
3438
|
-
const { inputProps } = useSwitch(props, state, inputRef);
|
|
3439
|
-
const { isFocusVisible, focusProps } = useFocusRing12();
|
|
3440
|
-
const stateProps = useStateProps20({
|
|
3441
|
-
selected: state.isSelected,
|
|
3442
|
-
disabled,
|
|
3443
|
-
readOnly,
|
|
3444
|
-
focus: isFocusVisible
|
|
3445
|
-
});
|
|
3446
|
-
const classNames2 = useClassNames34({ component: "Switch", size, variant });
|
|
3447
|
-
return /* @__PURE__ */ jsxs30(
|
|
3448
|
-
"label",
|
|
3265
|
+
const classNames2 = useClassNames37({ component: "Switch", size, variant });
|
|
3266
|
+
return /* @__PURE__ */ jsxs31(
|
|
3267
|
+
Switch,
|
|
3449
3268
|
{
|
|
3450
|
-
|
|
3269
|
+
...props,
|
|
3270
|
+
ref,
|
|
3271
|
+
className: cn39(
|
|
3272
|
+
twWidth4[width],
|
|
3451
3273
|
"group/switch",
|
|
3452
|
-
|
|
3453
|
-
|
|
3274
|
+
"flex items-center justify-between gap-[1ch]",
|
|
3275
|
+
classNames2.container
|
|
3454
3276
|
),
|
|
3455
|
-
|
|
3277
|
+
isDisabled: disabled,
|
|
3278
|
+
isReadOnly: readOnly,
|
|
3456
3279
|
children: [
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
{
|
|
3460
|
-
ref: inputRef,
|
|
3461
|
-
className: "absolute left-0 top-0 z-[1] h-full w-full cursor-pointer opacity-[0.0001] disabled:cursor-not-allowed",
|
|
3462
|
-
...inputProps,
|
|
3463
|
-
...focusProps
|
|
3464
|
-
}
|
|
3465
|
-
),
|
|
3466
|
-
props.children && /* @__PURE__ */ jsx71(Fragment6, { children: props.children }),
|
|
3467
|
-
/* @__PURE__ */ jsx71(
|
|
3280
|
+
children,
|
|
3281
|
+
/* @__PURE__ */ jsx71("div", { className: " relative", children: /* @__PURE__ */ jsx71(
|
|
3468
3282
|
"div",
|
|
3469
3283
|
{
|
|
3470
|
-
className:
|
|
3471
|
-
"
|
|
3284
|
+
className: cn39(
|
|
3285
|
+
"h-6 w-12 basis-12 rounded-3xl group-disabled/switch:cursor-not-allowed ",
|
|
3472
3286
|
classNames2.track
|
|
3473
3287
|
),
|
|
3474
3288
|
children: /* @__PURE__ */ jsx71(
|
|
3475
3289
|
"div",
|
|
3476
3290
|
{
|
|
3477
|
-
className:
|
|
3291
|
+
className: cn39(
|
|
3478
3292
|
"h-[22px] w-[22px]",
|
|
3479
3293
|
"cubic-bezier(.7,0,.3,1)",
|
|
3480
3294
|
"absolute left-0 top-px",
|
|
@@ -3485,7 +3299,7 @@ var Switch = forwardRef15(
|
|
|
3485
3299
|
}
|
|
3486
3300
|
)
|
|
3487
3301
|
}
|
|
3488
|
-
)
|
|
3302
|
+
) })
|
|
3489
3303
|
]
|
|
3490
3304
|
}
|
|
3491
3305
|
);
|
|
@@ -3493,7 +3307,7 @@ var Switch = forwardRef15(
|
|
|
3493
3307
|
);
|
|
3494
3308
|
|
|
3495
3309
|
// src/Table/Table.tsx
|
|
3496
|
-
import { useRef as
|
|
3310
|
+
import { useRef as useRef26 } from "react";
|
|
3497
3311
|
import { useTable } from "@react-aria/table";
|
|
3498
3312
|
import {
|
|
3499
3313
|
TableBody as Body2,
|
|
@@ -3503,7 +3317,7 @@ import {
|
|
|
3503
3317
|
Row,
|
|
3504
3318
|
useTableState
|
|
3505
3319
|
} from "@react-stately/table";
|
|
3506
|
-
import { cn as
|
|
3320
|
+
import { cn as cn44, useClassNames as useClassNames39 } from "@marigold/system";
|
|
3507
3321
|
|
|
3508
3322
|
// src/Table/Context.tsx
|
|
3509
3323
|
import { createContext as createContext8, useContext as useContext8 } from "react";
|
|
@@ -3519,14 +3333,14 @@ var TableBody = ({ children }) => {
|
|
|
3519
3333
|
};
|
|
3520
3334
|
|
|
3521
3335
|
// src/Table/TableCell.tsx
|
|
3522
|
-
import { useRef as
|
|
3523
|
-
import { useFocusRing as
|
|
3336
|
+
import { useRef as useRef20 } from "react";
|
|
3337
|
+
import { useFocusRing as useFocusRing8 } from "@react-aria/focus";
|
|
3524
3338
|
import { useTableCell } from "@react-aria/table";
|
|
3525
|
-
import { mergeProps as
|
|
3526
|
-
import { useStateProps as
|
|
3339
|
+
import { mergeProps as mergeProps14 } from "@react-aria/utils";
|
|
3340
|
+
import { useStateProps as useStateProps14 } from "@marigold/system";
|
|
3527
3341
|
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
3528
3342
|
var TableCell = ({ cell }) => {
|
|
3529
|
-
const ref =
|
|
3343
|
+
const ref = useRef20(null);
|
|
3530
3344
|
const { interactive, state, classNames: classNames2 } = useTableContext();
|
|
3531
3345
|
const disabled = state.disabledKeys.has(cell.parentKey);
|
|
3532
3346
|
const { gridCellProps } = useTableCell(
|
|
@@ -3545,14 +3359,14 @@ var TableCell = ({ cell }) => {
|
|
|
3545
3359
|
onMouseDown: (e) => e.stopPropagation(),
|
|
3546
3360
|
onPointerDown: (e) => e.stopPropagation()
|
|
3547
3361
|
};
|
|
3548
|
-
const { focusProps, isFocusVisible } =
|
|
3549
|
-
const stateProps =
|
|
3362
|
+
const { focusProps, isFocusVisible } = useFocusRing8();
|
|
3363
|
+
const stateProps = useStateProps14({ disabled, focusVisible: isFocusVisible });
|
|
3550
3364
|
return /* @__PURE__ */ jsx73(
|
|
3551
3365
|
"td",
|
|
3552
3366
|
{
|
|
3553
3367
|
ref,
|
|
3554
3368
|
className: classNames2 == null ? void 0 : classNames2.cell,
|
|
3555
|
-
...
|
|
3369
|
+
...mergeProps14(cellProps, focusProps),
|
|
3556
3370
|
...stateProps,
|
|
3557
3371
|
children: cell.rendered
|
|
3558
3372
|
}
|
|
@@ -3560,11 +3374,11 @@ var TableCell = ({ cell }) => {
|
|
|
3560
3374
|
};
|
|
3561
3375
|
|
|
3562
3376
|
// src/Table/TableCheckboxCell.tsx
|
|
3563
|
-
import { useRef as
|
|
3564
|
-
import { useFocusRing as
|
|
3377
|
+
import { useRef as useRef21 } from "react";
|
|
3378
|
+
import { useFocusRing as useFocusRing9 } from "@react-aria/focus";
|
|
3565
3379
|
import { useTableCell as useTableCell2, useTableSelectionCheckbox } from "@react-aria/table";
|
|
3566
|
-
import { mergeProps as
|
|
3567
|
-
import { cn as
|
|
3380
|
+
import { mergeProps as mergeProps15 } from "@react-aria/utils";
|
|
3381
|
+
import { cn as cn40, useStateProps as useStateProps15 } from "@marigold/system";
|
|
3568
3382
|
|
|
3569
3383
|
// src/Table/utils.ts
|
|
3570
3384
|
var mapCheckboxProps = ({
|
|
@@ -3589,7 +3403,7 @@ var mapCheckboxProps = ({
|
|
|
3589
3403
|
// src/Table/TableCheckboxCell.tsx
|
|
3590
3404
|
import { jsx as jsx74 } from "react/jsx-runtime";
|
|
3591
3405
|
var TableCheckboxCell = ({ cell }) => {
|
|
3592
|
-
const ref =
|
|
3406
|
+
const ref = useRef21(null);
|
|
3593
3407
|
const { state, classNames: classNames2 } = useTableContext();
|
|
3594
3408
|
const disabled = state.disabledKeys.has(cell.parentKey);
|
|
3595
3409
|
const { gridCellProps } = useTableCell2(
|
|
@@ -3602,36 +3416,36 @@ var TableCheckboxCell = ({ cell }) => {
|
|
|
3602
3416
|
const { checkboxProps } = mapCheckboxProps(
|
|
3603
3417
|
useTableSelectionCheckbox({ key: cell.parentKey }, state)
|
|
3604
3418
|
);
|
|
3605
|
-
const { focusProps, isFocusVisible } =
|
|
3606
|
-
const stateProps =
|
|
3419
|
+
const { focusProps, isFocusVisible } = useFocusRing9();
|
|
3420
|
+
const stateProps = useStateProps15({ disabled, focusVisible: isFocusVisible });
|
|
3607
3421
|
return /* @__PURE__ */ jsx74(
|
|
3608
3422
|
"td",
|
|
3609
3423
|
{
|
|
3610
3424
|
ref,
|
|
3611
|
-
className:
|
|
3612
|
-
...
|
|
3425
|
+
className: cn40("text-center align-middle leading-none", classNames2 == null ? void 0 : classNames2.cell),
|
|
3426
|
+
...mergeProps15(gridCellProps, focusProps),
|
|
3613
3427
|
...stateProps,
|
|
3614
|
-
children: /* @__PURE__ */ jsx74(
|
|
3428
|
+
children: /* @__PURE__ */ jsx74(_Checkbox, { ...checkboxProps })
|
|
3615
3429
|
}
|
|
3616
3430
|
);
|
|
3617
3431
|
};
|
|
3618
3432
|
|
|
3619
3433
|
// src/Table/TableColumnHeader.tsx
|
|
3620
|
-
import { useRef as
|
|
3621
|
-
import { useFocusRing as
|
|
3622
|
-
import { useHover as
|
|
3434
|
+
import { useRef as useRef22 } from "react";
|
|
3435
|
+
import { useFocusRing as useFocusRing10 } from "@react-aria/focus";
|
|
3436
|
+
import { useHover as useHover6 } from "@react-aria/interactions";
|
|
3623
3437
|
import { useTableColumnHeader } from "@react-aria/table";
|
|
3624
|
-
import { mergeProps as
|
|
3438
|
+
import { mergeProps as mergeProps16 } from "@react-aria/utils";
|
|
3625
3439
|
import { SortDown, SortUp } from "@marigold/icons";
|
|
3626
|
-
import { cn as
|
|
3627
|
-
import { width as
|
|
3628
|
-
import { jsx as jsx75, jsxs as
|
|
3440
|
+
import { cn as cn41, useStateProps as useStateProps16 } from "@marigold/system";
|
|
3441
|
+
import { width as twWidth5 } from "@marigold/system";
|
|
3442
|
+
import { jsx as jsx75, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
3629
3443
|
var TableColumnHeader = ({
|
|
3630
3444
|
column,
|
|
3631
3445
|
width = "auto"
|
|
3632
3446
|
}) => {
|
|
3633
3447
|
var _a, _b;
|
|
3634
|
-
const ref =
|
|
3448
|
+
const ref = useRef22(null);
|
|
3635
3449
|
const { state, classNames: classNames2 } = useTableContext();
|
|
3636
3450
|
const { columnHeaderProps } = useTableColumnHeader(
|
|
3637
3451
|
{
|
|
@@ -3640,19 +3454,19 @@ var TableColumnHeader = ({
|
|
|
3640
3454
|
state,
|
|
3641
3455
|
ref
|
|
3642
3456
|
);
|
|
3643
|
-
const { hoverProps, isHovered } =
|
|
3644
|
-
const { focusProps, isFocusVisible } =
|
|
3645
|
-
const stateProps =
|
|
3457
|
+
const { hoverProps, isHovered } = useHover6({});
|
|
3458
|
+
const { focusProps, isFocusVisible } = useFocusRing10();
|
|
3459
|
+
const stateProps = useStateProps16({
|
|
3646
3460
|
hover: isHovered,
|
|
3647
3461
|
focusVisible: isFocusVisible
|
|
3648
3462
|
});
|
|
3649
|
-
return /* @__PURE__ */
|
|
3463
|
+
return /* @__PURE__ */ jsxs32(
|
|
3650
3464
|
"th",
|
|
3651
3465
|
{
|
|
3652
3466
|
colSpan: column.colspan,
|
|
3653
3467
|
ref,
|
|
3654
|
-
className:
|
|
3655
|
-
...
|
|
3468
|
+
className: cn41("cursor-default", twWidth5[width], classNames2 == null ? void 0 : classNames2.header),
|
|
3469
|
+
...mergeProps16(columnHeaderProps, hoverProps, focusProps),
|
|
3656
3470
|
...stateProps,
|
|
3657
3471
|
children: [
|
|
3658
3472
|
column.rendered,
|
|
@@ -3671,29 +3485,29 @@ var TableHeader = ({ children }) => {
|
|
|
3671
3485
|
};
|
|
3672
3486
|
|
|
3673
3487
|
// src/Table/TableHeaderRow.tsx
|
|
3674
|
-
import { useRef as
|
|
3488
|
+
import { useRef as useRef23 } from "react";
|
|
3675
3489
|
import { useTableHeaderRow } from "@react-aria/table";
|
|
3676
3490
|
import { jsx as jsx77 } from "react/jsx-runtime";
|
|
3677
3491
|
var TableHeaderRow = ({ item, children }) => {
|
|
3678
3492
|
const { state } = useTableContext();
|
|
3679
|
-
const ref =
|
|
3493
|
+
const ref = useRef23(null);
|
|
3680
3494
|
const { rowProps } = useTableHeaderRow({ node: item }, state, ref);
|
|
3681
3495
|
return /* @__PURE__ */ jsx77("tr", { ...rowProps, ref, children });
|
|
3682
3496
|
};
|
|
3683
3497
|
|
|
3684
3498
|
// src/Table/TableRow.tsx
|
|
3685
|
-
import { useRef as
|
|
3686
|
-
import { useFocusRing as
|
|
3687
|
-
import { useHover as
|
|
3499
|
+
import { useRef as useRef24 } from "react";
|
|
3500
|
+
import { useFocusRing as useFocusRing11 } from "@react-aria/focus";
|
|
3501
|
+
import { useHover as useHover7 } from "@react-aria/interactions";
|
|
3688
3502
|
import { useTableRow } from "@react-aria/table";
|
|
3689
|
-
import { mergeProps as
|
|
3690
|
-
import { cn as
|
|
3503
|
+
import { mergeProps as mergeProps17 } from "@react-aria/utils";
|
|
3504
|
+
import { cn as cn42, useClassNames as useClassNames38, useStateProps as useStateProps17 } from "@marigold/system";
|
|
3691
3505
|
import { jsx as jsx78 } from "react/jsx-runtime";
|
|
3692
3506
|
var TableRow = ({ children, row }) => {
|
|
3693
|
-
const ref =
|
|
3507
|
+
const ref = useRef24(null);
|
|
3694
3508
|
const { interactive, state, ...ctx } = useTableContext();
|
|
3695
3509
|
const { variant, size } = row.props;
|
|
3696
|
-
const classNames2 =
|
|
3510
|
+
const classNames2 = useClassNames38({
|
|
3697
3511
|
component: "Table",
|
|
3698
3512
|
variant: variant || ctx.variant,
|
|
3699
3513
|
size: size || ctx.size
|
|
@@ -3707,11 +3521,11 @@ var TableRow = ({ children, row }) => {
|
|
|
3707
3521
|
);
|
|
3708
3522
|
const disabled = state.disabledKeys.has(row.key);
|
|
3709
3523
|
const selected = state.selectionManager.isSelected(row.key);
|
|
3710
|
-
const { focusProps, isFocusVisible } =
|
|
3711
|
-
const { hoverProps, isHovered } =
|
|
3524
|
+
const { focusProps, isFocusVisible } = useFocusRing11({ within: true });
|
|
3525
|
+
const { hoverProps, isHovered } = useHover7({
|
|
3712
3526
|
isDisabled: disabled || !interactive
|
|
3713
3527
|
});
|
|
3714
|
-
const stateProps =
|
|
3528
|
+
const stateProps = useStateProps17({
|
|
3715
3529
|
disabled,
|
|
3716
3530
|
selected,
|
|
3717
3531
|
hover: isHovered,
|
|
@@ -3722,13 +3536,13 @@ var TableRow = ({ children, row }) => {
|
|
|
3722
3536
|
"tr",
|
|
3723
3537
|
{
|
|
3724
3538
|
ref,
|
|
3725
|
-
className:
|
|
3539
|
+
className: cn42(
|
|
3726
3540
|
[
|
|
3727
3541
|
!interactive ? "cursor-text" : disabled ? "cursor-default" : "cursor-pointer"
|
|
3728
3542
|
],
|
|
3729
3543
|
classNames2 == null ? void 0 : classNames2.row
|
|
3730
3544
|
),
|
|
3731
|
-
...
|
|
3545
|
+
...mergeProps17(rowProps, focusProps, hoverProps),
|
|
3732
3546
|
...stateProps,
|
|
3733
3547
|
children
|
|
3734
3548
|
}
|
|
@@ -3736,25 +3550,25 @@ var TableRow = ({ children, row }) => {
|
|
|
3736
3550
|
};
|
|
3737
3551
|
|
|
3738
3552
|
// src/Table/TableSelectAllCell.tsx
|
|
3739
|
-
import { useRef as
|
|
3740
|
-
import { useFocusRing as
|
|
3741
|
-
import { useHover as
|
|
3553
|
+
import { useRef as useRef25 } from "react";
|
|
3554
|
+
import { useFocusRing as useFocusRing12 } from "@react-aria/focus";
|
|
3555
|
+
import { useHover as useHover8 } from "@react-aria/interactions";
|
|
3742
3556
|
import {
|
|
3743
3557
|
useTableColumnHeader as useTableColumnHeader2,
|
|
3744
3558
|
useTableSelectAllCheckbox
|
|
3745
3559
|
} from "@react-aria/table";
|
|
3746
|
-
import { mergeProps as
|
|
3560
|
+
import { mergeProps as mergeProps18 } from "@react-aria/utils";
|
|
3747
3561
|
import {
|
|
3748
|
-
cn as
|
|
3749
|
-
width as
|
|
3750
|
-
useStateProps as
|
|
3562
|
+
cn as cn43,
|
|
3563
|
+
width as twWidth6,
|
|
3564
|
+
useStateProps as useStateProps18
|
|
3751
3565
|
} from "@marigold/system";
|
|
3752
3566
|
import { jsx as jsx79 } from "react/jsx-runtime";
|
|
3753
3567
|
var TableSelectAllCell = ({
|
|
3754
3568
|
column,
|
|
3755
3569
|
width = "auto"
|
|
3756
3570
|
}) => {
|
|
3757
|
-
const ref =
|
|
3571
|
+
const ref = useRef25(null);
|
|
3758
3572
|
const { state, classNames: classNames2 } = useTableContext();
|
|
3759
3573
|
const { columnHeaderProps } = useTableColumnHeader2(
|
|
3760
3574
|
{
|
|
@@ -3764,9 +3578,9 @@ var TableSelectAllCell = ({
|
|
|
3764
3578
|
ref
|
|
3765
3579
|
);
|
|
3766
3580
|
const { checkboxProps } = mapCheckboxProps(useTableSelectAllCheckbox(state));
|
|
3767
|
-
const { hoverProps, isHovered } =
|
|
3768
|
-
const { focusProps, isFocusVisible } =
|
|
3769
|
-
const stateProps =
|
|
3581
|
+
const { hoverProps, isHovered } = useHover8({});
|
|
3582
|
+
const { focusProps, isFocusVisible } = useFocusRing12();
|
|
3583
|
+
const stateProps = useStateProps18({
|
|
3770
3584
|
hover: isHovered,
|
|
3771
3585
|
focusVisible: isFocusVisible
|
|
3772
3586
|
});
|
|
@@ -3774,20 +3588,20 @@ var TableSelectAllCell = ({
|
|
|
3774
3588
|
"th",
|
|
3775
3589
|
{
|
|
3776
3590
|
ref,
|
|
3777
|
-
className:
|
|
3778
|
-
|
|
3591
|
+
className: cn43(
|
|
3592
|
+
twWidth6[width],
|
|
3779
3593
|
["text-center align-middle leading-none"],
|
|
3780
3594
|
classNames2 == null ? void 0 : classNames2.header
|
|
3781
3595
|
),
|
|
3782
|
-
...
|
|
3596
|
+
...mergeProps18(columnHeaderProps, hoverProps, focusProps),
|
|
3783
3597
|
...stateProps,
|
|
3784
|
-
children: /* @__PURE__ */ jsx79(
|
|
3598
|
+
children: /* @__PURE__ */ jsx79(_Checkbox, { ...checkboxProps })
|
|
3785
3599
|
}
|
|
3786
3600
|
);
|
|
3787
3601
|
};
|
|
3788
3602
|
|
|
3789
3603
|
// src/Table/Table.tsx
|
|
3790
|
-
import { jsx as jsx80, jsxs as
|
|
3604
|
+
import { jsx as jsx80, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
3791
3605
|
var Table = ({
|
|
3792
3606
|
variant,
|
|
3793
3607
|
size,
|
|
@@ -3796,7 +3610,7 @@ var Table = ({
|
|
|
3796
3610
|
...props
|
|
3797
3611
|
}) => {
|
|
3798
3612
|
const interactive = selectionMode !== "none";
|
|
3799
|
-
const tableRef =
|
|
3613
|
+
const tableRef = useRef26(null);
|
|
3800
3614
|
const state = useTableState({
|
|
3801
3615
|
...props,
|
|
3802
3616
|
selectionMode,
|
|
@@ -3804,7 +3618,7 @@ var Table = ({
|
|
|
3804
3618
|
props.selectionBehavior !== "replace"
|
|
3805
3619
|
});
|
|
3806
3620
|
const { gridProps } = useTable(props, state, tableRef);
|
|
3807
|
-
const classNames2 =
|
|
3621
|
+
const classNames2 = useClassNames39({
|
|
3808
3622
|
component: "Table",
|
|
3809
3623
|
variant,
|
|
3810
3624
|
size
|
|
@@ -3814,11 +3628,11 @@ var Table = ({
|
|
|
3814
3628
|
TableContext.Provider,
|
|
3815
3629
|
{
|
|
3816
3630
|
value: { state, interactive, classNames: classNames2, variant, size },
|
|
3817
|
-
children: /* @__PURE__ */
|
|
3631
|
+
children: /* @__PURE__ */ jsxs33(
|
|
3818
3632
|
"table",
|
|
3819
3633
|
{
|
|
3820
3634
|
ref: tableRef,
|
|
3821
|
-
className:
|
|
3635
|
+
className: cn44(
|
|
3822
3636
|
"group/table",
|
|
3823
3637
|
"border-collapse overflow-auto whitespace-nowrap",
|
|
3824
3638
|
stretch ? "table w-full" : "block",
|
|
@@ -3846,7 +3660,7 @@ var Table = ({
|
|
|
3846
3660
|
);
|
|
3847
3661
|
}
|
|
3848
3662
|
) }, headerRow.key)) }),
|
|
3849
|
-
/* @__PURE__ */
|
|
3663
|
+
/* @__PURE__ */ jsxs33(TableBody, { children: [
|
|
3850
3664
|
...collection.rows.map(
|
|
3851
3665
|
(row) => row.type === "item" && /* @__PURE__ */ jsx80(TableRow, { row, children: [...collection.getChildren(row.key)].map(
|
|
3852
3666
|
(cell) => {
|
|
@@ -3870,19 +3684,19 @@ Table.Row = Row;
|
|
|
3870
3684
|
|
|
3871
3685
|
// src/Text/Text.tsx
|
|
3872
3686
|
import {
|
|
3873
|
-
cn as
|
|
3874
|
-
createVar as
|
|
3687
|
+
cn as cn45,
|
|
3688
|
+
createVar as createVar9,
|
|
3875
3689
|
cursorStyle,
|
|
3876
3690
|
fontWeight,
|
|
3877
3691
|
get as get2,
|
|
3878
3692
|
textAlign as textAlign2,
|
|
3879
3693
|
textSize,
|
|
3880
3694
|
textStyle,
|
|
3881
|
-
useClassNames as
|
|
3695
|
+
useClassNames as useClassNames40,
|
|
3882
3696
|
useTheme as useTheme5
|
|
3883
3697
|
} from "@marigold/system";
|
|
3884
3698
|
import { jsx as jsx81 } from "react/jsx-runtime";
|
|
3885
|
-
var
|
|
3699
|
+
var Text2 = ({
|
|
3886
3700
|
variant,
|
|
3887
3701
|
size,
|
|
3888
3702
|
color,
|
|
@@ -3895,7 +3709,7 @@ var Text = ({
|
|
|
3895
3709
|
...props
|
|
3896
3710
|
}) => {
|
|
3897
3711
|
const theme = useTheme5();
|
|
3898
|
-
const classNames2 =
|
|
3712
|
+
const classNames2 = useClassNames40({
|
|
3899
3713
|
component: "Text",
|
|
3900
3714
|
variant,
|
|
3901
3715
|
size
|
|
@@ -3904,7 +3718,7 @@ var Text = ({
|
|
|
3904
3718
|
"p",
|
|
3905
3719
|
{
|
|
3906
3720
|
...props,
|
|
3907
|
-
className:
|
|
3721
|
+
className: cn45(
|
|
3908
3722
|
classNames2,
|
|
3909
3723
|
"text-[--color] outline-[--outline]",
|
|
3910
3724
|
fontStyle && textStyle[fontStyle],
|
|
@@ -3913,7 +3727,7 @@ var Text = ({
|
|
|
3913
3727
|
weight && fontWeight[weight],
|
|
3914
3728
|
fontSize && textSize[fontSize]
|
|
3915
3729
|
),
|
|
3916
|
-
style:
|
|
3730
|
+
style: createVar9({
|
|
3917
3731
|
color: color && theme.colors && get2(
|
|
3918
3732
|
theme.colors,
|
|
3919
3733
|
color.replace("-", "."),
|
|
@@ -3927,14 +3741,14 @@ var Text = ({
|
|
|
3927
3741
|
};
|
|
3928
3742
|
|
|
3929
3743
|
// src/TextArea/TextArea.tsx
|
|
3930
|
-
import { forwardRef as
|
|
3931
|
-
import { useFocusRing as
|
|
3932
|
-
import { useHover as
|
|
3744
|
+
import { forwardRef as forwardRef17 } from "react";
|
|
3745
|
+
import { useFocusRing as useFocusRing13 } from "@react-aria/focus";
|
|
3746
|
+
import { useHover as useHover9 } from "@react-aria/interactions";
|
|
3933
3747
|
import { useTextField } from "@react-aria/textfield";
|
|
3934
|
-
import { useObjectRef as
|
|
3935
|
-
import { useClassNames as
|
|
3748
|
+
import { useObjectRef as useObjectRef7 } from "@react-aria/utils";
|
|
3749
|
+
import { useClassNames as useClassNames41, useStateProps as useStateProps19 } from "@marigold/system";
|
|
3936
3750
|
import { jsx as jsx82 } from "react/jsx-runtime";
|
|
3937
|
-
var TextArea =
|
|
3751
|
+
var TextArea = forwardRef17(
|
|
3938
3752
|
({
|
|
3939
3753
|
variant,
|
|
3940
3754
|
size,
|
|
@@ -3947,7 +3761,7 @@ var TextArea = forwardRef16(
|
|
|
3947
3761
|
...props
|
|
3948
3762
|
}, ref) => {
|
|
3949
3763
|
const { label, description, errorMessage } = props;
|
|
3950
|
-
const textAreaRef =
|
|
3764
|
+
const textAreaRef = useObjectRef7(ref);
|
|
3951
3765
|
const { labelProps, inputProps, descriptionProps, errorMessageProps } = useTextField(
|
|
3952
3766
|
{
|
|
3953
3767
|
inputElementType: "textarea",
|
|
@@ -3959,9 +3773,9 @@ var TextArea = forwardRef16(
|
|
|
3959
3773
|
},
|
|
3960
3774
|
textAreaRef
|
|
3961
3775
|
);
|
|
3962
|
-
const { hoverProps, isHovered } =
|
|
3963
|
-
const { focusProps, isFocusVisible } =
|
|
3964
|
-
const stateProps =
|
|
3776
|
+
const { hoverProps, isHovered } = useHover9({});
|
|
3777
|
+
const { focusProps, isFocusVisible } = useFocusRing13();
|
|
3778
|
+
const stateProps = useStateProps19({
|
|
3965
3779
|
hover: isHovered,
|
|
3966
3780
|
focus: isFocusVisible,
|
|
3967
3781
|
disabled,
|
|
@@ -3969,7 +3783,7 @@ var TextArea = forwardRef16(
|
|
|
3969
3783
|
required,
|
|
3970
3784
|
error
|
|
3971
3785
|
});
|
|
3972
|
-
const classNames2 =
|
|
3786
|
+
const classNames2 = useClassNames41({ component: "TextArea", variant, size });
|
|
3973
3787
|
return /* @__PURE__ */ jsx82(
|
|
3974
3788
|
FieldBase,
|
|
3975
3789
|
{
|
|
@@ -4001,17 +3815,17 @@ var TextArea = forwardRef16(
|
|
|
4001
3815
|
);
|
|
4002
3816
|
|
|
4003
3817
|
// src/TextField/TextField.tsx
|
|
4004
|
-
import { forwardRef as
|
|
4005
|
-
import { useFocusRing as
|
|
4006
|
-
import { useHover as
|
|
3818
|
+
import { forwardRef as forwardRef18 } from "react";
|
|
3819
|
+
import { useFocusRing as useFocusRing14 } from "@react-aria/focus";
|
|
3820
|
+
import { useHover as useHover10 } from "@react-aria/interactions";
|
|
4007
3821
|
import { useTextField as useTextField2 } from "@react-aria/textfield";
|
|
4008
|
-
import { mergeProps as
|
|
4009
|
-
import { useStateProps as
|
|
3822
|
+
import { mergeProps as mergeProps19, useObjectRef as useObjectRef8 } from "@react-aria/utils";
|
|
3823
|
+
import { useStateProps as useStateProps20 } from "@marigold/system";
|
|
4010
3824
|
import { jsx as jsx83 } from "react/jsx-runtime";
|
|
4011
|
-
var TextField =
|
|
3825
|
+
var TextField = forwardRef18(
|
|
4012
3826
|
({ variant, size, width, disabled, required, readOnly, error, ...props }, ref) => {
|
|
4013
3827
|
const { label, description, errorMessage, autoFocus } = props;
|
|
4014
|
-
const inputRef =
|
|
3828
|
+
const inputRef = useObjectRef8(ref);
|
|
4015
3829
|
const { labelProps, inputProps, descriptionProps, errorMessageProps } = useTextField2(
|
|
4016
3830
|
{
|
|
4017
3831
|
isDisabled: disabled,
|
|
@@ -4022,12 +3836,12 @@ var TextField = forwardRef17(
|
|
|
4022
3836
|
},
|
|
4023
3837
|
inputRef
|
|
4024
3838
|
);
|
|
4025
|
-
const { hoverProps, isHovered } =
|
|
4026
|
-
const { focusProps, isFocused } =
|
|
3839
|
+
const { hoverProps, isHovered } = useHover10({});
|
|
3840
|
+
const { focusProps, isFocused } = useFocusRing14({
|
|
4027
3841
|
isTextInput: true,
|
|
4028
3842
|
autoFocus
|
|
4029
3843
|
});
|
|
4030
|
-
const stateProps =
|
|
3844
|
+
const stateProps = useStateProps20({
|
|
4031
3845
|
hover: isHovered,
|
|
4032
3846
|
focus: isFocused,
|
|
4033
3847
|
disabled,
|
|
@@ -4055,7 +3869,7 @@ var TextField = forwardRef17(
|
|
|
4055
3869
|
ref: inputRef,
|
|
4056
3870
|
variant,
|
|
4057
3871
|
size,
|
|
4058
|
-
...
|
|
3872
|
+
...mergeProps19(focusProps, inputProps, hoverProps)
|
|
4059
3873
|
}
|
|
4060
3874
|
)
|
|
4061
3875
|
}
|
|
@@ -4064,7 +3878,7 @@ var TextField = forwardRef17(
|
|
|
4064
3878
|
);
|
|
4065
3879
|
|
|
4066
3880
|
// src/Tiles/Tiles.tsx
|
|
4067
|
-
import { cn as
|
|
3881
|
+
import { cn as cn46, createVar as createVar10, gapSpace as gapSpace7 } from "@marigold/system";
|
|
4068
3882
|
import { jsx as jsx84 } from "react/jsx-runtime";
|
|
4069
3883
|
var Tiles = ({
|
|
4070
3884
|
space = 0,
|
|
@@ -4082,13 +3896,13 @@ var Tiles = ({
|
|
|
4082
3896
|
"div",
|
|
4083
3897
|
{
|
|
4084
3898
|
...props,
|
|
4085
|
-
className:
|
|
3899
|
+
className: cn46(
|
|
4086
3900
|
"grid",
|
|
4087
3901
|
gapSpace7[space],
|
|
4088
3902
|
"grid-cols-[repeat(auto-fit,var(--column))]",
|
|
4089
3903
|
equalHeight && "auto-rows-[1fr]"
|
|
4090
3904
|
),
|
|
4091
|
-
style:
|
|
3905
|
+
style: createVar10({ column, tilesWidth }),
|
|
4092
3906
|
children
|
|
4093
3907
|
}
|
|
4094
3908
|
);
|
|
@@ -4096,7 +3910,7 @@ var Tiles = ({
|
|
|
4096
3910
|
|
|
4097
3911
|
// src/Tooltip/Tooltip.tsx
|
|
4098
3912
|
import { useTooltip } from "@react-aria/tooltip";
|
|
4099
|
-
import { cn as
|
|
3913
|
+
import { cn as cn47, useClassNames as useClassNames42 } from "@marigold/system";
|
|
4100
3914
|
|
|
4101
3915
|
// src/Tooltip/Context.ts
|
|
4102
3916
|
import { createContext as createContext9, useContext as useContext9 } from "react";
|
|
@@ -4104,12 +3918,12 @@ var TooltipContext = createContext9({});
|
|
|
4104
3918
|
var useTooltipContext = () => useContext9(TooltipContext);
|
|
4105
3919
|
|
|
4106
3920
|
// src/Tooltip/TooltipTrigger.tsx
|
|
4107
|
-
import { Children as Children7, useRef as
|
|
3921
|
+
import { Children as Children7, useRef as useRef27 } from "react";
|
|
4108
3922
|
import { FocusableProvider } from "@react-aria/focus";
|
|
4109
3923
|
import { useOverlayPosition } from "@react-aria/overlays";
|
|
4110
3924
|
import { useTooltipTrigger } from "@react-aria/tooltip";
|
|
4111
3925
|
import { useTooltipTriggerState } from "@react-stately/tooltip";
|
|
4112
|
-
import { jsx as jsx85, jsxs as
|
|
3926
|
+
import { jsx as jsx85, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
4113
3927
|
var TooltipTrigger = ({
|
|
4114
3928
|
disabled,
|
|
4115
3929
|
open,
|
|
@@ -4126,8 +3940,8 @@ var TooltipTrigger = ({
|
|
|
4126
3940
|
delay,
|
|
4127
3941
|
placement
|
|
4128
3942
|
};
|
|
4129
|
-
const tooltipTriggerRef =
|
|
4130
|
-
const overlayRef =
|
|
3943
|
+
const tooltipTriggerRef = useRef27(null);
|
|
3944
|
+
const overlayRef = useRef27(null);
|
|
4131
3945
|
const state = useTooltipTriggerState(props);
|
|
4132
3946
|
const { triggerProps, tooltipProps } = useTooltipTrigger(
|
|
4133
3947
|
props,
|
|
@@ -4146,7 +3960,7 @@ var TooltipTrigger = ({
|
|
|
4146
3960
|
isOpen: state.isOpen,
|
|
4147
3961
|
overlayRef
|
|
4148
3962
|
});
|
|
4149
|
-
return /* @__PURE__ */
|
|
3963
|
+
return /* @__PURE__ */ jsxs34(FocusableProvider, { ref: tooltipTriggerRef, ...triggerProps, children: [
|
|
4150
3964
|
tooltipTrigger,
|
|
4151
3965
|
/* @__PURE__ */ jsx85(
|
|
4152
3966
|
TooltipContext.Provider,
|
|
@@ -4166,18 +3980,18 @@ var TooltipTrigger = ({
|
|
|
4166
3980
|
};
|
|
4167
3981
|
|
|
4168
3982
|
// src/Tooltip/Tooltip.tsx
|
|
4169
|
-
import { jsx as jsx86, jsxs as
|
|
3983
|
+
import { jsx as jsx86, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
4170
3984
|
var Tooltip = ({ children, variant, size }) => {
|
|
4171
3985
|
const { arrowProps, state, overlayRef, placement, ...rest } = useTooltipContext();
|
|
4172
3986
|
const { tooltipProps } = useTooltip({}, state);
|
|
4173
|
-
const classNames2 =
|
|
4174
|
-
return /* @__PURE__ */
|
|
3987
|
+
const classNames2 = useClassNames42({ component: "Tooltip", variant, size });
|
|
3988
|
+
return /* @__PURE__ */ jsxs35(
|
|
4175
3989
|
"div",
|
|
4176
3990
|
{
|
|
4177
3991
|
...tooltipProps,
|
|
4178
3992
|
...rest,
|
|
4179
3993
|
ref: overlayRef,
|
|
4180
|
-
className:
|
|
3994
|
+
className: cn47("group/tooltip", classNames2.container),
|
|
4181
3995
|
"data-placement": placement,
|
|
4182
3996
|
children: [
|
|
4183
3997
|
/* @__PURE__ */ jsx86("div", { children }),
|
|
@@ -4185,7 +3999,7 @@ var Tooltip = ({ children, variant, size }) => {
|
|
|
4185
3999
|
"div",
|
|
4186
4000
|
{
|
|
4187
4001
|
...arrowProps,
|
|
4188
|
-
className:
|
|
4002
|
+
className: cn47("absolute h-0 w-0", classNames2.arrow)
|
|
4189
4003
|
}
|
|
4190
4004
|
)
|
|
4191
4005
|
]
|
|
@@ -4198,22 +4012,22 @@ Tooltip.Trigger = TooltipTrigger;
|
|
|
4198
4012
|
import { Item as Item6 } from "@react-stately/collections";
|
|
4199
4013
|
|
|
4200
4014
|
// src/TagGroup/TagGroup.tsx
|
|
4201
|
-
import { useRef as
|
|
4015
|
+
import { useRef as useRef29 } from "react";
|
|
4202
4016
|
import { useTagGroup } from "@react-aria/tag";
|
|
4203
4017
|
import { useListState } from "@react-stately/list";
|
|
4204
|
-
import { useStateProps as
|
|
4018
|
+
import { useStateProps as useStateProps21 } from "@marigold/system";
|
|
4205
4019
|
|
|
4206
4020
|
// src/TagGroup/Tag.tsx
|
|
4207
|
-
import
|
|
4208
|
-
import { useButton as
|
|
4209
|
-
import { useFocusRing as
|
|
4021
|
+
import React3, { useRef as useRef28 } from "react";
|
|
4022
|
+
import { useButton as useButton6 } from "@react-aria/button";
|
|
4023
|
+
import { useFocusRing as useFocusRing15 } from "@react-aria/focus";
|
|
4210
4024
|
import { useTag } from "@react-aria/tag";
|
|
4211
|
-
import { mergeProps as
|
|
4212
|
-
import { cn as
|
|
4213
|
-
import { jsx as jsx87, jsxs as
|
|
4025
|
+
import { mergeProps as mergeProps20 } from "@react-aria/utils";
|
|
4026
|
+
import { cn as cn48, useClassNames as useClassNames43 } from "@marigold/system";
|
|
4027
|
+
import { jsx as jsx87, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
4214
4028
|
var CloseButton2 = ({ className, ...props }) => {
|
|
4215
|
-
const ref =
|
|
4216
|
-
const { buttonProps } =
|
|
4029
|
+
const ref = useRef28(null);
|
|
4030
|
+
const { buttonProps } = useButton6({ ...props }, ref);
|
|
4217
4031
|
return /* @__PURE__ */ jsx87("button", { className, ...buttonProps, children: /* @__PURE__ */ jsx87("svg", { viewBox: "0 0 20 20", fill: "currentColor", width: 20, height: 20, children: /* @__PURE__ */ jsx87("path", { d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" }) }) });
|
|
4218
4032
|
};
|
|
4219
4033
|
var Tag = ({ variant, size, item, state, ...rest }) => {
|
|
@@ -4221,8 +4035,8 @@ var Tag = ({ variant, size, item, state, ...rest }) => {
|
|
|
4221
4035
|
item,
|
|
4222
4036
|
...rest
|
|
4223
4037
|
};
|
|
4224
|
-
let ref =
|
|
4225
|
-
let { focusProps } =
|
|
4038
|
+
let ref = React3.useRef(null);
|
|
4039
|
+
let { focusProps } = useFocusRing15({ within: true });
|
|
4226
4040
|
const { rowProps, gridCellProps, allowsRemoving, removeButtonProps } = useTag(
|
|
4227
4041
|
{
|
|
4228
4042
|
...props,
|
|
@@ -4231,20 +4045,20 @@ var Tag = ({ variant, size, item, state, ...rest }) => {
|
|
|
4231
4045
|
state,
|
|
4232
4046
|
ref
|
|
4233
4047
|
);
|
|
4234
|
-
const classNames2 =
|
|
4048
|
+
const classNames2 = useClassNames43({ component: "Tag", variant, size });
|
|
4235
4049
|
return /* @__PURE__ */ jsx87(
|
|
4236
4050
|
"span",
|
|
4237
4051
|
{
|
|
4238
4052
|
ref,
|
|
4239
|
-
...
|
|
4053
|
+
...mergeProps20(rowProps, focusProps),
|
|
4240
4054
|
className: classNames2.tag,
|
|
4241
|
-
children: /* @__PURE__ */
|
|
4055
|
+
children: /* @__PURE__ */ jsxs36("div", { ...gridCellProps, className: classNames2.gridCell, children: [
|
|
4242
4056
|
/* @__PURE__ */ jsx87("span", { children: item.rendered }),
|
|
4243
4057
|
allowsRemoving && /* @__PURE__ */ jsx87(
|
|
4244
4058
|
CloseButton2,
|
|
4245
4059
|
{
|
|
4246
4060
|
...removeButtonProps,
|
|
4247
|
-
className:
|
|
4061
|
+
className: cn48("flex items-center", classNames2.closeButton)
|
|
4248
4062
|
}
|
|
4249
4063
|
)
|
|
4250
4064
|
] })
|
|
@@ -4267,10 +4081,10 @@ var TagGroup = ({
|
|
|
4267
4081
|
validationState: error ? "invalid" : "valid",
|
|
4268
4082
|
...rest
|
|
4269
4083
|
};
|
|
4270
|
-
const inputRef =
|
|
4084
|
+
const inputRef = useRef29(null);
|
|
4271
4085
|
const state = useListState(props);
|
|
4272
4086
|
const { gridProps, labelProps, descriptionProps, errorMessageProps } = useTagGroup(props, state, inputRef);
|
|
4273
|
-
const stateProps =
|
|
4087
|
+
const stateProps = useStateProps21({
|
|
4274
4088
|
error,
|
|
4275
4089
|
required
|
|
4276
4090
|
});
|
|
@@ -4315,11 +4129,14 @@ var TagGroup = ({
|
|
|
4315
4129
|
var Tag2 = Item6;
|
|
4316
4130
|
Tag2.Group = TagGroup;
|
|
4317
4131
|
|
|
4132
|
+
// src/VisuallyHidden/VisuallyHidden.tsx
|
|
4133
|
+
import { VisuallyHidden } from "@react-aria/visually-hidden";
|
|
4134
|
+
|
|
4318
4135
|
// src/XLoader/XLoader.tsx
|
|
4319
|
-
import { forwardRef as
|
|
4136
|
+
import { forwardRef as forwardRef19 } from "react";
|
|
4320
4137
|
import { SVG as SVG6 } from "@marigold/system";
|
|
4321
|
-
import { jsx as jsx89, jsxs as
|
|
4322
|
-
var XLoader =
|
|
4138
|
+
import { jsx as jsx89, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
4139
|
+
var XLoader = forwardRef19((props, ref) => /* @__PURE__ */ jsxs37(
|
|
4323
4140
|
SVG6,
|
|
4324
4141
|
{
|
|
4325
4142
|
id: "XLoader",
|
|
@@ -4533,11 +4350,11 @@ var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ jsxs36(
|
|
|
4533
4350
|
));
|
|
4534
4351
|
|
|
4535
4352
|
// src/Tabs/Tabs.tsx
|
|
4536
|
-
import { useRef as
|
|
4353
|
+
import { useRef as useRef32 } from "react";
|
|
4537
4354
|
import { useTabList } from "@react-aria/tabs";
|
|
4538
4355
|
import { Item as Item7 } from "@react-stately/collections";
|
|
4539
4356
|
import { useTabListState } from "@react-stately/tabs";
|
|
4540
|
-
import { cn as
|
|
4357
|
+
import { cn as cn51, gapSpace as gapSpace8, useClassNames as useClassNames44 } from "@marigold/system";
|
|
4541
4358
|
|
|
4542
4359
|
// src/Tabs/Context.ts
|
|
4543
4360
|
import { createContext as createContext10, useContext as useContext10 } from "react";
|
|
@@ -4545,31 +4362,31 @@ var TabContext = createContext10({});
|
|
|
4545
4362
|
var useTabContext = () => useContext10(TabContext);
|
|
4546
4363
|
|
|
4547
4364
|
// src/Tabs/Tab.tsx
|
|
4548
|
-
import { useRef as
|
|
4549
|
-
import { useFocus, useHover as
|
|
4365
|
+
import { useRef as useRef30 } from "react";
|
|
4366
|
+
import { useFocus, useHover as useHover11 } from "@react-aria/interactions";
|
|
4550
4367
|
import { useTab } from "@react-aria/tabs";
|
|
4551
|
-
import { mergeProps as
|
|
4552
|
-
import { cn as
|
|
4368
|
+
import { mergeProps as mergeProps21 } from "@react-aria/utils";
|
|
4369
|
+
import { cn as cn49, useStateProps as useStateProps22 } from "@marigold/system";
|
|
4553
4370
|
import { jsx as jsx90 } from "react/jsx-runtime";
|
|
4554
4371
|
var Tab = ({ item, state }) => {
|
|
4555
4372
|
const { key, rendered } = item;
|
|
4556
|
-
const ref =
|
|
4373
|
+
const ref = useRef30(null);
|
|
4557
4374
|
const { tabProps, isSelected } = useTab({ key }, state, ref);
|
|
4558
4375
|
const disabled = tabProps["aria-disabled"];
|
|
4559
|
-
const { hoverProps, isHovered } =
|
|
4376
|
+
const { hoverProps, isHovered } = useHover11({
|
|
4560
4377
|
isDisabled: disabled || isSelected
|
|
4561
4378
|
});
|
|
4562
4379
|
const { focusProps } = useFocus({});
|
|
4563
|
-
const stateProps =
|
|
4380
|
+
const stateProps = useStateProps22({ active: isSelected, hover: isHovered });
|
|
4564
4381
|
const { classNames: classNames2 } = useTabContext();
|
|
4565
4382
|
return /* @__PURE__ */ jsx90(
|
|
4566
4383
|
"div",
|
|
4567
4384
|
{
|
|
4568
|
-
className:
|
|
4385
|
+
className: cn49(
|
|
4569
4386
|
"flex cursor-pointer justify-center aria-disabled:cursor-not-allowed",
|
|
4570
4387
|
classNames2.tab
|
|
4571
4388
|
),
|
|
4572
|
-
...
|
|
4389
|
+
...mergeProps21(tabProps, stateProps, focusProps, hoverProps),
|
|
4573
4390
|
ref,
|
|
4574
4391
|
children: rendered
|
|
4575
4392
|
}
|
|
@@ -4577,21 +4394,21 @@ var Tab = ({ item, state }) => {
|
|
|
4577
4394
|
};
|
|
4578
4395
|
|
|
4579
4396
|
// src/Tabs/TabPanel.tsx
|
|
4580
|
-
import { useRef as
|
|
4397
|
+
import { useRef as useRef31 } from "react";
|
|
4581
4398
|
import { useTabPanel } from "@react-aria/tabs";
|
|
4582
|
-
import { cn as
|
|
4399
|
+
import { cn as cn50 } from "@marigold/system";
|
|
4583
4400
|
import { jsx as jsx91 } from "react/jsx-runtime";
|
|
4584
4401
|
var TabPanel = ({ state, ...props }) => {
|
|
4585
4402
|
var _a;
|
|
4586
|
-
const ref =
|
|
4403
|
+
const ref = useRef31(null);
|
|
4587
4404
|
const { tabPanelProps } = useTabPanel(props, state, ref);
|
|
4588
4405
|
const selectedItemProps = (_a = state.selectedItem) == null ? void 0 : _a.props;
|
|
4589
4406
|
const { classNames: classNames2 } = useTabContext();
|
|
4590
|
-
return /* @__PURE__ */ jsx91("div", { className:
|
|
4407
|
+
return /* @__PURE__ */ jsx91("div", { className: cn50(classNames2.tabpanel), ref, ...tabPanelProps, children: selectedItemProps == null ? void 0 : selectedItemProps.children });
|
|
4591
4408
|
};
|
|
4592
4409
|
|
|
4593
4410
|
// src/Tabs/Tabs.tsx
|
|
4594
|
-
import { jsx as jsx92, jsxs as
|
|
4411
|
+
import { jsx as jsx92, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
4595
4412
|
var Tabs = ({
|
|
4596
4413
|
space = 2,
|
|
4597
4414
|
size = "medium",
|
|
@@ -4600,23 +4417,23 @@ var Tabs = ({
|
|
|
4600
4417
|
...rest
|
|
4601
4418
|
}) => {
|
|
4602
4419
|
var _a;
|
|
4603
|
-
const ref =
|
|
4420
|
+
const ref = useRef32(null);
|
|
4604
4421
|
const props = {
|
|
4605
4422
|
isDisabled: disabled,
|
|
4606
4423
|
...rest
|
|
4607
4424
|
};
|
|
4608
4425
|
const state = useTabListState(props);
|
|
4609
4426
|
const { tabListProps } = useTabList(props, state, ref);
|
|
4610
|
-
const classNames2 =
|
|
4427
|
+
const classNames2 = useClassNames44({
|
|
4611
4428
|
component: "Tabs",
|
|
4612
4429
|
size,
|
|
4613
4430
|
variant
|
|
4614
4431
|
});
|
|
4615
|
-
return /* @__PURE__ */ jsx92(TabContext.Provider, { value: { classNames: classNames2 }, children: /* @__PURE__ */
|
|
4432
|
+
return /* @__PURE__ */ jsx92(TabContext.Provider, { value: { classNames: classNames2 }, children: /* @__PURE__ */ jsxs38("div", { className: cn51(classNames2.container), children: [
|
|
4616
4433
|
/* @__PURE__ */ jsx92(
|
|
4617
4434
|
"div",
|
|
4618
4435
|
{
|
|
4619
|
-
className:
|
|
4436
|
+
className: cn51("flex", gapSpace8[space], classNames2.tabs),
|
|
4620
4437
|
...tabListProps,
|
|
4621
4438
|
ref,
|
|
4622
4439
|
children: [...state.collection].map((item) => {
|
|
@@ -4638,13 +4455,13 @@ export {
|
|
|
4638
4455
|
Badge,
|
|
4639
4456
|
Body,
|
|
4640
4457
|
Breakout,
|
|
4641
|
-
Button,
|
|
4458
|
+
_Button as Button,
|
|
4642
4459
|
Calendar,
|
|
4643
4460
|
CalendarCell,
|
|
4644
4461
|
CalendarGrid,
|
|
4645
4462
|
Card,
|
|
4646
4463
|
Center,
|
|
4647
|
-
Checkbox,
|
|
4464
|
+
_Checkbox as Checkbox,
|
|
4648
4465
|
CheckboxGroup,
|
|
4649
4466
|
CheckboxGroupContext,
|
|
4650
4467
|
Columns,
|
|
@@ -4653,19 +4470,19 @@ export {
|
|
|
4653
4470
|
DateField,
|
|
4654
4471
|
DatePicker,
|
|
4655
4472
|
Dialog,
|
|
4656
|
-
Divider,
|
|
4473
|
+
_Divider as Divider,
|
|
4657
4474
|
FieldBase,
|
|
4658
4475
|
FieldGroup,
|
|
4659
4476
|
FieldGroupContext,
|
|
4660
4477
|
Footer,
|
|
4661
4478
|
Header,
|
|
4662
|
-
Headline,
|
|
4479
|
+
_Headline as Headline,
|
|
4663
4480
|
Image,
|
|
4664
4481
|
Inline,
|
|
4665
4482
|
Input,
|
|
4666
4483
|
Inset,
|
|
4667
|
-
Label,
|
|
4668
|
-
Link,
|
|
4484
|
+
_Label as Label,
|
|
4485
|
+
_Link as Link,
|
|
4669
4486
|
List,
|
|
4670
4487
|
MarigoldProvider,
|
|
4671
4488
|
Menu,
|
|
@@ -4674,17 +4491,17 @@ export {
|
|
|
4674
4491
|
NumberField,
|
|
4675
4492
|
Overlay,
|
|
4676
4493
|
Popover,
|
|
4677
|
-
Radio,
|
|
4678
|
-
RadioGroup,
|
|
4494
|
+
_Radio as Radio,
|
|
4495
|
+
_RadioGroup as RadioGroup,
|
|
4679
4496
|
Select,
|
|
4680
|
-
Slider,
|
|
4497
|
+
_Slider as Slider,
|
|
4681
4498
|
Split,
|
|
4682
4499
|
Stack,
|
|
4683
|
-
Switch,
|
|
4500
|
+
_Switch as Switch,
|
|
4684
4501
|
Table,
|
|
4685
4502
|
Tabs,
|
|
4686
4503
|
Tag2 as Tag,
|
|
4687
|
-
Text,
|
|
4504
|
+
Text2 as Text,
|
|
4688
4505
|
TextArea,
|
|
4689
4506
|
TextField,
|
|
4690
4507
|
ThemeProvider2 as ThemeProvider,
|
|
@@ -4695,6 +4512,7 @@ export {
|
|
|
4695
4512
|
Underlay,
|
|
4696
4513
|
VisuallyHidden,
|
|
4697
4514
|
XLoader,
|
|
4515
|
+
_Slider,
|
|
4698
4516
|
useAsyncList,
|
|
4699
4517
|
useCheckboxGroupContext,
|
|
4700
4518
|
useFieldGroupContext,
|