@marigold/components 6.0.1 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +4 -2
- package/dist/index.js +101 -70
- package/dist/index.mjs +476 -437
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import { useAsyncList, useListData } from "@react-stately/data";
|
|
3
3
|
|
|
4
4
|
// src/Accordion/Accordion.tsx
|
|
5
|
-
import
|
|
5
|
+
import React6, { Children, useRef as useRef2 } from "react";
|
|
6
6
|
import { useAccordion } from "@react-aria/accordion";
|
|
7
7
|
import { Item } from "@react-stately/collections";
|
|
8
8
|
|
|
9
9
|
// src/Accordion/AccordionItem.tsx
|
|
10
|
-
import
|
|
10
|
+
import React5, { useRef } from "react";
|
|
11
11
|
import { FocusRing, useFocusRing as useFocusRing2 } from "@react-aria/focus";
|
|
12
12
|
import { mergeProps as mergeProps3 } from "@react-aria/utils";
|
|
13
13
|
import { useClassNames as useClassNames2, useStateProps as useStateProps2 } from "@marigold/system";
|
|
@@ -108,7 +108,7 @@ function useAccordionItem(props, state, ref) {
|
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
// src/Button/Button.tsx
|
|
111
|
-
import
|
|
111
|
+
import React2, { forwardRef } from "react";
|
|
112
112
|
import { useButton as useButton2 } from "@react-aria/button";
|
|
113
113
|
import { useFocusRing } from "@react-aria/focus";
|
|
114
114
|
import { useHover } from "@react-aria/interactions";
|
|
@@ -168,7 +168,7 @@ var Button = forwardRef(
|
|
|
168
168
|
focusVisible: isFocusVisible,
|
|
169
169
|
hover: isHovered
|
|
170
170
|
});
|
|
171
|
-
return /* @__PURE__ */
|
|
171
|
+
return /* @__PURE__ */ React2.createElement(
|
|
172
172
|
Component,
|
|
173
173
|
{
|
|
174
174
|
...mergeProps2(buttonProps, focusProps, hoverProps, props),
|
|
@@ -186,17 +186,17 @@ var Button = forwardRef(
|
|
|
186
186
|
);
|
|
187
187
|
|
|
188
188
|
// src/Chevron/ChevronUp.tsx
|
|
189
|
-
import
|
|
189
|
+
import React3, { forwardRef as forwardRef2 } from "react";
|
|
190
190
|
import { SVG } from "@marigold/system";
|
|
191
191
|
var ChevronUp = forwardRef2(
|
|
192
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
192
|
+
({ className, ...props }, ref) => /* @__PURE__ */ React3.createElement(SVG, { className, ...props, viewBox: "0 0 24 24", ref }, /* @__PURE__ */ React3.createElement("path", { d: "M5.97563 16.8506L12 10.8394L18.0244 16.8506L19.875 15L12 7.125L4.125 15L5.97563 16.8506Z" }))
|
|
193
193
|
);
|
|
194
194
|
|
|
195
195
|
// src/Chevron/ChevronDown.tsx
|
|
196
|
-
import
|
|
196
|
+
import React4, { forwardRef as forwardRef3 } from "react";
|
|
197
197
|
import { SVG as SVG2 } from "@marigold/system";
|
|
198
198
|
var ChevronDown = forwardRef3(
|
|
199
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
199
|
+
({ className, ...props }, ref) => /* @__PURE__ */ React4.createElement(SVG2, { className, ...props, viewBox: "0 0 24 24", ref }, /* @__PURE__ */ React4.createElement("path", { d: "M5.97563 7.125L12 13.1363L18.0244 7.125L19.875 8.97563L12 16.8506L4.125 8.97563L5.97563 7.125Z" }))
|
|
200
200
|
);
|
|
201
201
|
|
|
202
202
|
// src/Accordion/AccordionItem.tsx
|
|
@@ -213,7 +213,7 @@ var AccordionItem = ({
|
|
|
213
213
|
item.key.toString().replace(".$", "")
|
|
214
214
|
);
|
|
215
215
|
const expanded = state.selectionManager.isSelected(item.key);
|
|
216
|
-
|
|
216
|
+
React5.useEffect(() => {
|
|
217
217
|
if (defaultExpanded) {
|
|
218
218
|
if (state.selectionManager.selectionMode === "multiple") {
|
|
219
219
|
state.expandedKeys.forEach((key) => {
|
|
@@ -232,7 +232,7 @@ var AccordionItem = ({
|
|
|
232
232
|
expanded: defaultExpanded || expanded
|
|
233
233
|
});
|
|
234
234
|
const classNames2 = useClassNames2({ component: "Accordion", variant, size });
|
|
235
|
-
return /* @__PURE__ */
|
|
235
|
+
return /* @__PURE__ */ React5.createElement("div", { className: "flex flex-col", ...props }, /* @__PURE__ */ React5.createElement(FocusRing, { within: true }, /* @__PURE__ */ React5.createElement(
|
|
236
236
|
Button,
|
|
237
237
|
{
|
|
238
238
|
className: classNames2.button,
|
|
@@ -241,8 +241,8 @@ var AccordionItem = ({
|
|
|
241
241
|
"aria-label": item.textValue
|
|
242
242
|
},
|
|
243
243
|
title,
|
|
244
|
-
!expanded ? /* @__PURE__ */
|
|
245
|
-
)), expanded || defaultExpanded ? /* @__PURE__ */
|
|
244
|
+
!expanded ? /* @__PURE__ */ React5.createElement(ChevronUp, { className: "h3 w-6" }) : /* @__PURE__ */ React5.createElement(ChevronDown, { className: "h3 w-6" })
|
|
245
|
+
)), expanded || defaultExpanded ? /* @__PURE__ */ React5.createElement(
|
|
246
246
|
"div",
|
|
247
247
|
{
|
|
248
248
|
...mergeProps3(regionProps, focusProps, stateProps),
|
|
@@ -259,10 +259,10 @@ var Accordion = ({ children, ...props }) => {
|
|
|
259
259
|
...props,
|
|
260
260
|
// we have to do this because JSX childs are not supported
|
|
261
261
|
children: Children.toArray(children).map((child) => {
|
|
262
|
-
if (!
|
|
262
|
+
if (!React6.isValidElement(child)) {
|
|
263
263
|
return child;
|
|
264
264
|
}
|
|
265
|
-
return
|
|
265
|
+
return React6.cloneElement(child, {
|
|
266
266
|
hasChildItems: false,
|
|
267
267
|
...child.props
|
|
268
268
|
});
|
|
@@ -278,7 +278,7 @@ var Accordion = ({ children, ...props }) => {
|
|
|
278
278
|
state,
|
|
279
279
|
ref
|
|
280
280
|
);
|
|
281
|
-
return /* @__PURE__ */
|
|
281
|
+
return /* @__PURE__ */ React6.createElement("div", { ...accordionProps, ref }, [...state.collection].map((item) => /* @__PURE__ */ React6.createElement(
|
|
282
282
|
AccordionItem,
|
|
283
283
|
{
|
|
284
284
|
key: item.key,
|
|
@@ -293,7 +293,7 @@ var Accordion = ({ children, ...props }) => {
|
|
|
293
293
|
Accordion.Item = Item;
|
|
294
294
|
|
|
295
295
|
// src/Aside/Aside.tsx
|
|
296
|
-
import
|
|
296
|
+
import React7 from "react";
|
|
297
297
|
import { cn as cn2, createVar, gapSpace } from "@marigold/system";
|
|
298
298
|
var classNames = {
|
|
299
299
|
aside: "grow basis-[--sideWidth]",
|
|
@@ -307,12 +307,12 @@ var Aside = ({
|
|
|
307
307
|
stretch = true,
|
|
308
308
|
wrap = "50%"
|
|
309
309
|
}) => {
|
|
310
|
-
const [left, right] =
|
|
310
|
+
const [left, right] = React7.Children.toArray(children);
|
|
311
311
|
const vars = {
|
|
312
312
|
aside: createVar({ sideWidth }),
|
|
313
313
|
content: createVar({ wrap })
|
|
314
314
|
};
|
|
315
|
-
return /* @__PURE__ */
|
|
315
|
+
return /* @__PURE__ */ React7.createElement(
|
|
316
316
|
"div",
|
|
317
317
|
{
|
|
318
318
|
className: cn2(
|
|
@@ -321,7 +321,7 @@ var Aside = ({
|
|
|
321
321
|
!stretch && "items-start"
|
|
322
322
|
)
|
|
323
323
|
},
|
|
324
|
-
/* @__PURE__ */
|
|
324
|
+
/* @__PURE__ */ React7.createElement(
|
|
325
325
|
"div",
|
|
326
326
|
{
|
|
327
327
|
className: classNames[side === "left" ? "aside" : "content"],
|
|
@@ -329,7 +329,7 @@ var Aside = ({
|
|
|
329
329
|
},
|
|
330
330
|
left
|
|
331
331
|
),
|
|
332
|
-
/* @__PURE__ */
|
|
332
|
+
/* @__PURE__ */ React7.createElement(
|
|
333
333
|
"div",
|
|
334
334
|
{
|
|
335
335
|
className: classNames[side === "right" ? "aside" : "content"],
|
|
@@ -341,13 +341,13 @@ var Aside = ({
|
|
|
341
341
|
};
|
|
342
342
|
|
|
343
343
|
// src/Aspect/Aspect.tsx
|
|
344
|
-
import
|
|
344
|
+
import React8 from "react";
|
|
345
345
|
import { cn as cn3, createVar as createVar2, aspect } from "@marigold/system";
|
|
346
346
|
var Aspect = ({
|
|
347
347
|
ratio = "square",
|
|
348
348
|
maxWidth,
|
|
349
349
|
children
|
|
350
|
-
}) => /* @__PURE__ */
|
|
350
|
+
}) => /* @__PURE__ */ React8.createElement(
|
|
351
351
|
"div",
|
|
352
352
|
{
|
|
353
353
|
className: cn3("overflow-hidden", aspect[ratio], "max-w-[var(--maxWidth)]"),
|
|
@@ -357,14 +357,14 @@ var Aspect = ({
|
|
|
357
357
|
);
|
|
358
358
|
|
|
359
359
|
// src/Autocomplete/Autocomplete.tsx
|
|
360
|
-
import
|
|
360
|
+
import React23, { useRef as useRef7 } from "react";
|
|
361
361
|
import { useSearchAutocomplete } from "@react-aria/autocomplete";
|
|
362
362
|
import { useFilter } from "@react-aria/i18n";
|
|
363
363
|
import { useComboBoxState } from "@react-stately/combobox";
|
|
364
364
|
import { Item as Item2 } from "@react-stately/collections";
|
|
365
365
|
|
|
366
366
|
// src/FieldBase/FieldBase.tsx
|
|
367
|
-
import
|
|
367
|
+
import React12 from "react";
|
|
368
368
|
import {
|
|
369
369
|
cn as cn6,
|
|
370
370
|
useClassNames as useClassNames5,
|
|
@@ -372,7 +372,7 @@ import {
|
|
|
372
372
|
} from "@marigold/system";
|
|
373
373
|
|
|
374
374
|
// src/Label/Label.tsx
|
|
375
|
-
import
|
|
375
|
+
import React9 from "react";
|
|
376
376
|
import { SVG as SVG3, cn as cn4, createVar as createVar3, useClassNames as useClassNames3 } from "@marigold/system";
|
|
377
377
|
var Label = ({
|
|
378
378
|
as = "label",
|
|
@@ -384,7 +384,7 @@ var Label = ({
|
|
|
384
384
|
}) => {
|
|
385
385
|
const Component = as;
|
|
386
386
|
const classNames2 = useClassNames3({ component: "Label", size, variant });
|
|
387
|
-
return /* @__PURE__ */
|
|
387
|
+
return /* @__PURE__ */ React9.createElement(
|
|
388
388
|
Component,
|
|
389
389
|
{
|
|
390
390
|
...props,
|
|
@@ -392,7 +392,7 @@ var Label = ({
|
|
|
392
392
|
style: createVar3({ labelWidth })
|
|
393
393
|
},
|
|
394
394
|
children,
|
|
395
|
-
/* @__PURE__ */
|
|
395
|
+
/* @__PURE__ */ React9.createElement(
|
|
396
396
|
SVG3,
|
|
397
397
|
{
|
|
398
398
|
viewBox: "0 0 24 24",
|
|
@@ -400,13 +400,13 @@ var Label = ({
|
|
|
400
400
|
size: 16,
|
|
401
401
|
className: cn4("hidden", classNames2.indicator)
|
|
402
402
|
},
|
|
403
|
-
/* @__PURE__ */
|
|
403
|
+
/* @__PURE__ */ React9.createElement("path", { d: "M10.8 3.84003H13.2V9.85259L18.1543 7.01815L19.3461 9.10132L14.3584 11.9549L19.3371 14.7999L18.1463 16.8836L13.2 14.0572V20.16H10.8V13.9907L5.76116 16.8735L4.56935 14.7903L9.5232 11.9561L4.56 9.12003L5.75073 7.03624L10.8 9.92154V3.84003Z" })
|
|
404
404
|
)
|
|
405
405
|
);
|
|
406
406
|
};
|
|
407
407
|
|
|
408
408
|
// src/HelpText/HelpText.tsx
|
|
409
|
-
import
|
|
409
|
+
import React10 from "react";
|
|
410
410
|
import { SVG as SVG4, cn as cn5, useClassNames as useClassNames4 } from "@marigold/system";
|
|
411
411
|
var HelpText = ({
|
|
412
412
|
variant,
|
|
@@ -427,32 +427,32 @@ var HelpText = ({
|
|
|
427
427
|
size,
|
|
428
428
|
className
|
|
429
429
|
});
|
|
430
|
-
return /* @__PURE__ */
|
|
430
|
+
return /* @__PURE__ */ React10.createElement(
|
|
431
431
|
"div",
|
|
432
432
|
{
|
|
433
433
|
...props,
|
|
434
434
|
...hasErrorMessage ? errorMessageProps : descriptionProps,
|
|
435
435
|
className: cn5("flex items-center gap-1", classNames2.container)
|
|
436
436
|
},
|
|
437
|
-
hasErrorMessage ? /* @__PURE__ */
|
|
437
|
+
hasErrorMessage ? /* @__PURE__ */ React10.createElement(React10.Fragment, null, /* @__PURE__ */ React10.createElement(
|
|
438
438
|
SVG4,
|
|
439
439
|
{
|
|
440
440
|
className: cn5("h-4 w-4", classNames2.icon),
|
|
441
441
|
viewBox: "0 0 24 24",
|
|
442
442
|
role: "presentation"
|
|
443
443
|
},
|
|
444
|
-
/* @__PURE__ */
|
|
445
|
-
), errorMessage) : /* @__PURE__ */
|
|
444
|
+
/* @__PURE__ */ React10.createElement("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" })
|
|
445
|
+
), errorMessage) : /* @__PURE__ */ React10.createElement(React10.Fragment, null, description)
|
|
446
446
|
);
|
|
447
447
|
};
|
|
448
448
|
|
|
449
449
|
// src/FieldBase/FieldGroup.tsx
|
|
450
|
-
import
|
|
450
|
+
import React11 from "react";
|
|
451
451
|
import { createContext, useContext } from "react";
|
|
452
452
|
var FieldGroupContext = createContext({});
|
|
453
453
|
var useFieldGroupContext = () => useContext(FieldGroupContext);
|
|
454
454
|
var FieldGroup = ({ labelWidth, children }) => {
|
|
455
|
-
return /* @__PURE__ */
|
|
455
|
+
return /* @__PURE__ */ React11.createElement(FieldGroupContext.Provider, { value: { labelWidth } }, children);
|
|
456
456
|
};
|
|
457
457
|
|
|
458
458
|
// src/FieldBase/FieldBase.tsx
|
|
@@ -479,14 +479,14 @@ var FieldBase = ({
|
|
|
479
479
|
variant,
|
|
480
480
|
size
|
|
481
481
|
});
|
|
482
|
-
return /* @__PURE__ */
|
|
482
|
+
return /* @__PURE__ */ React12.createElement(
|
|
483
483
|
"div",
|
|
484
484
|
{
|
|
485
485
|
...props,
|
|
486
486
|
...stateProps,
|
|
487
487
|
className: cn6("group/field", twWidth[width], classNames2)
|
|
488
488
|
},
|
|
489
|
-
label && /* @__PURE__ */
|
|
489
|
+
label && /* @__PURE__ */ React12.createElement(
|
|
490
490
|
Label,
|
|
491
491
|
{
|
|
492
492
|
variant,
|
|
@@ -497,7 +497,7 @@ var FieldBase = ({
|
|
|
497
497
|
label
|
|
498
498
|
),
|
|
499
499
|
children,
|
|
500
|
-
hasHelpText && /* @__PURE__ */
|
|
500
|
+
hasHelpText && /* @__PURE__ */ React12.createElement(
|
|
501
501
|
HelpText,
|
|
502
502
|
{
|
|
503
503
|
variant,
|
|
@@ -514,7 +514,7 @@ var FieldBase = ({
|
|
|
514
514
|
};
|
|
515
515
|
|
|
516
516
|
// src/Input/Input.tsx
|
|
517
|
-
import
|
|
517
|
+
import React13, { cloneElement, forwardRef as forwardRef4 } from "react";
|
|
518
518
|
import { cn as cn7, useClassNames as useClassNames6 } from "@marigold/system";
|
|
519
519
|
var Input = forwardRef4(
|
|
520
520
|
({
|
|
@@ -548,7 +548,7 @@ var Input = forwardRef4(
|
|
|
548
548
|
),
|
|
549
549
|
...action.props
|
|
550
550
|
}) : null;
|
|
551
|
-
return /* @__PURE__ */
|
|
551
|
+
return /* @__PURE__ */ React13.createElement(
|
|
552
552
|
"div",
|
|
553
553
|
{
|
|
554
554
|
className: "group/input relative flex items-center",
|
|
@@ -556,7 +556,7 @@ var Input = forwardRef4(
|
|
|
556
556
|
"data-action": action && ""
|
|
557
557
|
},
|
|
558
558
|
inputIcon,
|
|
559
|
-
/* @__PURE__ */
|
|
559
|
+
/* @__PURE__ */ React13.createElement(
|
|
560
560
|
"input",
|
|
561
561
|
{
|
|
562
562
|
...props,
|
|
@@ -578,7 +578,7 @@ var Input = forwardRef4(
|
|
|
578
578
|
);
|
|
579
579
|
|
|
580
580
|
// src/ListBox/ListBox.tsx
|
|
581
|
-
import
|
|
581
|
+
import React16, { forwardRef as forwardRef5 } from "react";
|
|
582
582
|
import { useObjectRef as useObjectRef2 } from "@react-aria/utils";
|
|
583
583
|
import { cn as cn8, useClassNames as useClassNames7 } from "@marigold/system";
|
|
584
584
|
import { useListBox } from "@react-aria/listbox";
|
|
@@ -589,11 +589,11 @@ var ListBoxContext = createContext2({});
|
|
|
589
589
|
var useListBoxContext = () => useContext2(ListBoxContext);
|
|
590
590
|
|
|
591
591
|
// src/ListBox/ListBoxSection.tsx
|
|
592
|
-
import
|
|
592
|
+
import React15 from "react";
|
|
593
593
|
import { useListBoxSection } from "@react-aria/listbox";
|
|
594
594
|
|
|
595
595
|
// src/ListBox/ListBoxOption.tsx
|
|
596
|
-
import
|
|
596
|
+
import React14, { useRef as useRef3 } from "react";
|
|
597
597
|
import { useOption } from "@react-aria/listbox";
|
|
598
598
|
import { mergeProps as mergeProps4 } from "@react-aria/utils";
|
|
599
599
|
import { useStateProps as useStateProps3 } from "@marigold/system";
|
|
@@ -613,7 +613,7 @@ var ListBoxOption = ({ item, state }) => {
|
|
|
613
613
|
disabled: isDisabled,
|
|
614
614
|
focusVisible: isFocused
|
|
615
615
|
});
|
|
616
|
-
return /* @__PURE__ */
|
|
616
|
+
return /* @__PURE__ */ React14.createElement(
|
|
617
617
|
"li",
|
|
618
618
|
{
|
|
619
619
|
ref,
|
|
@@ -631,7 +631,7 @@ var ListBoxSection = ({ section, state }) => {
|
|
|
631
631
|
heading: section.rendered,
|
|
632
632
|
"aria-label": section["aria-label"]
|
|
633
633
|
});
|
|
634
|
-
return /* @__PURE__ */
|
|
634
|
+
return /* @__PURE__ */ React15.createElement("li", { className: classNames2.section, ...itemProps }, section.rendered && /* @__PURE__ */ React15.createElement("div", { className: classNames2.sectionTitle, ...headingProps }, section.rendered), /* @__PURE__ */ React15.createElement("ul", { className: classNames2.list, ...groupProps }, [...section.props.children].map((node) => /* @__PURE__ */ React15.createElement(ListBoxOption, { key: node.key, item: node, state }))));
|
|
635
635
|
};
|
|
636
636
|
|
|
637
637
|
// src/ListBox/ListBox.tsx
|
|
@@ -640,7 +640,7 @@ var ListBox = forwardRef5(
|
|
|
640
640
|
const innerRef = useObjectRef2(ref);
|
|
641
641
|
const { listBoxProps } = useListBox(props, state, innerRef);
|
|
642
642
|
const classNames2 = useClassNames7({ component: "ListBox", variant, size });
|
|
643
|
-
return /* @__PURE__ */
|
|
643
|
+
return /* @__PURE__ */ React16.createElement(ListBoxContext.Provider, { value: { classNames: classNames2 } }, /* @__PURE__ */ React16.createElement("div", { className: classNames2.container }, /* @__PURE__ */ React16.createElement(
|
|
644
644
|
"ul",
|
|
645
645
|
{
|
|
646
646
|
className: cn8(
|
|
@@ -651,24 +651,24 @@ var ListBox = forwardRef5(
|
|
|
651
651
|
...listBoxProps
|
|
652
652
|
},
|
|
653
653
|
[...state.collection].map(
|
|
654
|
-
(item) => item.type === "section" ? /* @__PURE__ */
|
|
654
|
+
(item) => item.type === "section" ? /* @__PURE__ */ React16.createElement(ListBoxSection, { key: item.key, section: item, state }) : /* @__PURE__ */ React16.createElement(ListBoxOption, { key: item.key, item, state })
|
|
655
655
|
)
|
|
656
656
|
)));
|
|
657
657
|
}
|
|
658
658
|
);
|
|
659
659
|
|
|
660
660
|
// src/Overlay/Modal.tsx
|
|
661
|
-
import
|
|
661
|
+
import React18, { forwardRef as forwardRef6 } from "react";
|
|
662
662
|
import { FocusScope } from "@react-aria/focus";
|
|
663
663
|
import { useModal, useOverlay, usePreventScroll } from "@react-aria/overlays";
|
|
664
664
|
import { mergeProps as mergeProps5, useObjectRef as useObjectRef3 } from "@react-aria/utils";
|
|
665
665
|
|
|
666
666
|
// src/Overlay/Underlay.tsx
|
|
667
|
-
import
|
|
667
|
+
import React17 from "react";
|
|
668
668
|
import { cn as cn9, useClassNames as useClassNames8 } from "@marigold/system";
|
|
669
669
|
var Underlay = ({ size, variant, ...props }) => {
|
|
670
670
|
const classNames2 = useClassNames8({ component: "Underlay", size, variant });
|
|
671
|
-
return /* @__PURE__ */
|
|
671
|
+
return /* @__PURE__ */ React17.createElement("div", { className: cn9("fixed inset-0 z-40", classNames2), ...props });
|
|
672
672
|
};
|
|
673
673
|
|
|
674
674
|
// src/Overlay/Modal.tsx
|
|
@@ -686,20 +686,20 @@ var Modal = forwardRef6(
|
|
|
686
686
|
);
|
|
687
687
|
usePreventScroll();
|
|
688
688
|
const { modalProps } = useModal({});
|
|
689
|
-
return /* @__PURE__ */
|
|
689
|
+
return /* @__PURE__ */ React18.createElement(FocusScope, { contain: true, restoreFocus: true, autoFocus: true }, /* @__PURE__ */ React18.createElement(Underlay, { ...underlayProps, variant: "modal" }), /* @__PURE__ */ React18.createElement(
|
|
690
690
|
"div",
|
|
691
691
|
{
|
|
692
692
|
className: "pointer-none fixed inset-0 z-50 flex items-center justify-center",
|
|
693
693
|
ref: modalRef,
|
|
694
694
|
...mergeProps5(props, overlayProps, modalProps)
|
|
695
695
|
},
|
|
696
|
-
/* @__PURE__ */
|
|
696
|
+
/* @__PURE__ */ React18.createElement("div", { style: { pointerEvents: "auto" } }, children)
|
|
697
697
|
));
|
|
698
698
|
}
|
|
699
699
|
);
|
|
700
700
|
|
|
701
701
|
// src/Overlay/Overlay.tsx
|
|
702
|
-
import
|
|
702
|
+
import React19, { useRef as useRef4 } from "react";
|
|
703
703
|
import {
|
|
704
704
|
Overlay as ReactAriaOverlay
|
|
705
705
|
} from "@react-aria/overlays";
|
|
@@ -711,7 +711,7 @@ var Overlay = ({ children, container, open }) => {
|
|
|
711
711
|
if (!mountOverlay) {
|
|
712
712
|
return null;
|
|
713
713
|
}
|
|
714
|
-
return /* @__PURE__ */
|
|
714
|
+
return /* @__PURE__ */ React19.createElement(ReactAriaOverlay, { portalContainer: container }, /* @__PURE__ */ React19.createElement(
|
|
715
715
|
"div",
|
|
716
716
|
{
|
|
717
717
|
ref: nodeRef,
|
|
@@ -724,7 +724,7 @@ var Overlay = ({ children, container, open }) => {
|
|
|
724
724
|
};
|
|
725
725
|
|
|
726
726
|
// src/Overlay/Popover.tsx
|
|
727
|
-
import
|
|
727
|
+
import React20, { forwardRef as forwardRef7, useRef as useRef5 } from "react";
|
|
728
728
|
import {
|
|
729
729
|
DismissButton,
|
|
730
730
|
usePopover
|
|
@@ -736,7 +736,7 @@ var Popover = forwardRef7(
|
|
|
736
736
|
const fallbackRef = useRef5(null);
|
|
737
737
|
const popoverRef = ref || fallbackRef;
|
|
738
738
|
let { children, state, ...otherProps } = props;
|
|
739
|
-
return /* @__PURE__ */
|
|
739
|
+
return /* @__PURE__ */ React20.createElement(Overlay, { open: state.isOpen, ...otherProps }, /* @__PURE__ */ React20.createElement(PopoverWrapper, { ref: popoverRef, ...props }, children));
|
|
740
740
|
}
|
|
741
741
|
);
|
|
742
742
|
var PopoverWrapper = forwardRef7(
|
|
@@ -761,7 +761,7 @@ var PopoverWrapper = forwardRef7(
|
|
|
761
761
|
component: "Popover",
|
|
762
762
|
variant: placement
|
|
763
763
|
});
|
|
764
|
-
return /* @__PURE__ */
|
|
764
|
+
return /* @__PURE__ */ React20.createElement(FocusScope2, { restoreFocus: true }, !isNonModal && /* @__PURE__ */ React20.createElement(Underlay, { ...underlayProps }), /* @__PURE__ */ React20.createElement(
|
|
765
765
|
"div",
|
|
766
766
|
{
|
|
767
767
|
...popoverProps,
|
|
@@ -773,15 +773,15 @@ var PopoverWrapper = forwardRef7(
|
|
|
773
773
|
ref,
|
|
774
774
|
role: "presentation"
|
|
775
775
|
},
|
|
776
|
-
!isNonModal && /* @__PURE__ */
|
|
776
|
+
!isNonModal && /* @__PURE__ */ React20.createElement(DismissButton, { onDismiss: state.close }),
|
|
777
777
|
children,
|
|
778
|
-
/* @__PURE__ */
|
|
778
|
+
/* @__PURE__ */ React20.createElement(DismissButton, { onDismiss: state.close })
|
|
779
779
|
));
|
|
780
780
|
}
|
|
781
781
|
);
|
|
782
782
|
|
|
783
783
|
// src/Overlay/Tray.tsx
|
|
784
|
-
import
|
|
784
|
+
import React21 from "react";
|
|
785
785
|
import { FocusScope as FocusScope3 } from "@react-aria/focus";
|
|
786
786
|
import {
|
|
787
787
|
DismissButton as DismissButton2,
|
|
@@ -792,7 +792,7 @@ import { forwardRef as forwardRef8 } from "react";
|
|
|
792
792
|
var Tray = forwardRef8(
|
|
793
793
|
({ state, children, ...props }, ref) => {
|
|
794
794
|
const trayRef = useObjectRef4(ref);
|
|
795
|
-
return /* @__PURE__ */
|
|
795
|
+
return /* @__PURE__ */ React21.createElement(Overlay, { open: state.isOpen }, /* @__PURE__ */ React21.createElement(TrayWrapper, { state, ...props, ref: trayRef }, children));
|
|
796
796
|
}
|
|
797
797
|
);
|
|
798
798
|
var TrayWrapper = forwardRef8(
|
|
@@ -805,7 +805,7 @@ var TrayWrapper = forwardRef8(
|
|
|
805
805
|
state,
|
|
806
806
|
ref
|
|
807
807
|
);
|
|
808
|
-
return /* @__PURE__ */
|
|
808
|
+
return /* @__PURE__ */ React21.createElement(FocusScope3, { contain: true, restoreFocus: true, autoFocus: true }, /* @__PURE__ */ React21.createElement(Underlay, { ...underlayProps, variant: "modal" }, /* @__PURE__ */ React21.createElement(
|
|
809
809
|
"div",
|
|
810
810
|
{
|
|
811
811
|
...modalProps,
|
|
@@ -813,15 +813,15 @@ var TrayWrapper = forwardRef8(
|
|
|
813
813
|
className: "absolute bottom-0 w-full",
|
|
814
814
|
"data-testid": "tray"
|
|
815
815
|
},
|
|
816
|
-
/* @__PURE__ */
|
|
816
|
+
/* @__PURE__ */ React21.createElement(DismissButton2, { onDismiss: state.close }),
|
|
817
817
|
children,
|
|
818
|
-
/* @__PURE__ */
|
|
818
|
+
/* @__PURE__ */ React21.createElement(DismissButton2, { onDismiss: state.close })
|
|
819
819
|
)));
|
|
820
820
|
}
|
|
821
821
|
);
|
|
822
822
|
|
|
823
823
|
// src/Autocomplete/ClearButton.tsx
|
|
824
|
-
import
|
|
824
|
+
import React22, { useRef as useRef6 } from "react";
|
|
825
825
|
import { useHover as useHover2 } from "@react-aria/interactions";
|
|
826
826
|
import { useFocusRing as useFocusRing3 } from "@react-aria/focus";
|
|
827
827
|
import { useButton as useButton3 } from "@react-aria/button";
|
|
@@ -869,7 +869,7 @@ var ClearButton = ({
|
|
|
869
869
|
focusVisible: isFocusVisible,
|
|
870
870
|
hover: isHovered
|
|
871
871
|
});
|
|
872
|
-
return /* @__PURE__ */
|
|
872
|
+
return /* @__PURE__ */ React22.createElement(
|
|
873
873
|
"button",
|
|
874
874
|
{
|
|
875
875
|
...mergeProps6(buttonProps, focusProps, hoverProps, props),
|
|
@@ -880,7 +880,7 @@ var ClearButton = ({
|
|
|
880
880
|
className
|
|
881
881
|
)
|
|
882
882
|
},
|
|
883
|
-
/* @__PURE__ */
|
|
883
|
+
/* @__PURE__ */ React22.createElement(
|
|
884
884
|
"svg",
|
|
885
885
|
{
|
|
886
886
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -889,13 +889,13 @@ var ClearButton = ({
|
|
|
889
889
|
width: 20,
|
|
890
890
|
height: 20
|
|
891
891
|
},
|
|
892
|
-
/* @__PURE__ */
|
|
892
|
+
/* @__PURE__ */ React22.createElement("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" })
|
|
893
893
|
)
|
|
894
894
|
);
|
|
895
895
|
};
|
|
896
896
|
|
|
897
897
|
// src/Autocomplete/Autocomplete.tsx
|
|
898
|
-
var SearchIcon = (props) => /* @__PURE__ */
|
|
898
|
+
var SearchIcon = (props) => /* @__PURE__ */ React23.createElement(
|
|
899
899
|
"svg",
|
|
900
900
|
{
|
|
901
901
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -905,7 +905,7 @@ var SearchIcon = (props) => /* @__PURE__ */ React22.createElement(
|
|
|
905
905
|
height: 24,
|
|
906
906
|
...props
|
|
907
907
|
},
|
|
908
|
-
/* @__PURE__ */
|
|
908
|
+
/* @__PURE__ */ React23.createElement("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" })
|
|
909
909
|
);
|
|
910
910
|
var Autocomplete = ({
|
|
911
911
|
disabled,
|
|
@@ -959,7 +959,7 @@ var Autocomplete = ({
|
|
|
959
959
|
state
|
|
960
960
|
);
|
|
961
961
|
const { isDisabled, ...restClearButtonProps } = clearButtonProps;
|
|
962
|
-
return /* @__PURE__ */
|
|
962
|
+
return /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement(
|
|
963
963
|
FieldBase,
|
|
964
964
|
{
|
|
965
965
|
label: props.label,
|
|
@@ -970,13 +970,13 @@ var Autocomplete = ({
|
|
|
970
970
|
disabled,
|
|
971
971
|
width
|
|
972
972
|
},
|
|
973
|
-
/* @__PURE__ */
|
|
973
|
+
/* @__PURE__ */ React23.createElement(
|
|
974
974
|
Input,
|
|
975
975
|
{
|
|
976
976
|
...inputProps,
|
|
977
977
|
ref: inputRef,
|
|
978
|
-
icon: /* @__PURE__ */
|
|
979
|
-
action: state.inputValue !== "" ? /* @__PURE__ */
|
|
978
|
+
icon: /* @__PURE__ */ React23.createElement(SearchIcon, null),
|
|
979
|
+
action: state.inputValue !== "" ? /* @__PURE__ */ React23.createElement(
|
|
980
980
|
ClearButton,
|
|
981
981
|
{
|
|
982
982
|
preventFocus: true,
|
|
@@ -986,7 +986,7 @@ var Autocomplete = ({
|
|
|
986
986
|
) : null
|
|
987
987
|
}
|
|
988
988
|
)
|
|
989
|
-
), /* @__PURE__ */
|
|
989
|
+
), /* @__PURE__ */ React23.createElement(
|
|
990
990
|
Popover,
|
|
991
991
|
{
|
|
992
992
|
state,
|
|
@@ -995,13 +995,13 @@ var Autocomplete = ({
|
|
|
995
995
|
scrollRef: listBoxRef,
|
|
996
996
|
isNonModal: true
|
|
997
997
|
},
|
|
998
|
-
/* @__PURE__ */
|
|
998
|
+
/* @__PURE__ */ React23.createElement(ListBox, { ref: listBoxRef, state, ...listBoxProps })
|
|
999
999
|
));
|
|
1000
1000
|
};
|
|
1001
1001
|
Autocomplete.Item = Item2;
|
|
1002
1002
|
|
|
1003
1003
|
// src/ComboBox/ComboBox.tsx
|
|
1004
|
-
import
|
|
1004
|
+
import React24 from "react";
|
|
1005
1005
|
import { useComboBoxState as useComboBoxState2 } from "@react-stately/combobox";
|
|
1006
1006
|
import { useComboBox } from "@react-aria/combobox";
|
|
1007
1007
|
import { useFilter as useFilter2 } from "@react-aria/i18n";
|
|
@@ -1031,10 +1031,10 @@ var ComboBox = ({
|
|
|
1031
1031
|
};
|
|
1032
1032
|
const { contains } = useFilter2({ sensitivity: "base" });
|
|
1033
1033
|
const state = useComboBoxState2({ ...props, defaultFilter: contains });
|
|
1034
|
-
const buttonRef =
|
|
1035
|
-
const inputRef =
|
|
1036
|
-
const listBoxRef =
|
|
1037
|
-
const popoverRef =
|
|
1034
|
+
const buttonRef = React24.useRef(null);
|
|
1035
|
+
const inputRef = React24.useRef(null);
|
|
1036
|
+
const listBoxRef = React24.useRef(null);
|
|
1037
|
+
const popoverRef = React24.useRef(null);
|
|
1038
1038
|
const {
|
|
1039
1039
|
buttonProps: triggerProps,
|
|
1040
1040
|
inputProps,
|
|
@@ -1047,7 +1047,7 @@ var ComboBox = ({
|
|
|
1047
1047
|
const errorMessageProps = { "aria-invalid": error };
|
|
1048
1048
|
const { buttonProps } = useButton4(triggerProps, buttonRef);
|
|
1049
1049
|
const { label, description, errorMessage } = props;
|
|
1050
|
-
return /* @__PURE__ */
|
|
1050
|
+
return /* @__PURE__ */ React24.createElement(React24.Fragment, null, /* @__PURE__ */ React24.createElement(
|
|
1051
1051
|
FieldBase,
|
|
1052
1052
|
{
|
|
1053
1053
|
label,
|
|
@@ -1058,23 +1058,23 @@ var ComboBox = ({
|
|
|
1058
1058
|
errorMessageProps,
|
|
1059
1059
|
width
|
|
1060
1060
|
},
|
|
1061
|
-
/* @__PURE__ */
|
|
1061
|
+
/* @__PURE__ */ React24.createElement(
|
|
1062
1062
|
Input,
|
|
1063
1063
|
{
|
|
1064
1064
|
...inputProps,
|
|
1065
1065
|
ref: inputRef,
|
|
1066
|
-
action: /* @__PURE__ */
|
|
1066
|
+
action: /* @__PURE__ */ React24.createElement(
|
|
1067
1067
|
Button,
|
|
1068
1068
|
{
|
|
1069
1069
|
className: "absolute right-2 h-4 w-4 border-none bg-transparent p-0",
|
|
1070
1070
|
ref: buttonRef,
|
|
1071
1071
|
...buttonProps
|
|
1072
1072
|
},
|
|
1073
|
-
/* @__PURE__ */
|
|
1073
|
+
/* @__PURE__ */ React24.createElement(ChevronDown, { className: "h-4 w-4" })
|
|
1074
1074
|
)
|
|
1075
1075
|
}
|
|
1076
1076
|
)
|
|
1077
|
-
), /* @__PURE__ */
|
|
1077
|
+
), /* @__PURE__ */ React24.createElement(
|
|
1078
1078
|
Popover,
|
|
1079
1079
|
{
|
|
1080
1080
|
state,
|
|
@@ -1083,21 +1083,21 @@ var ComboBox = ({
|
|
|
1083
1083
|
scrollRef: listBoxRef,
|
|
1084
1084
|
isNonModal: true
|
|
1085
1085
|
},
|
|
1086
|
-
/* @__PURE__ */
|
|
1086
|
+
/* @__PURE__ */ React24.createElement(ListBox, { ref: listBoxRef, state, ...listBoxProps })
|
|
1087
1087
|
));
|
|
1088
1088
|
};
|
|
1089
1089
|
ComboBox.Item = Item3;
|
|
1090
1090
|
|
|
1091
1091
|
// src/Badge/Badge.tsx
|
|
1092
|
-
import
|
|
1092
|
+
import React25 from "react";
|
|
1093
1093
|
import { useClassNames as useClassNames10 } from "@marigold/system";
|
|
1094
1094
|
var Badge = ({ variant, size, children, ...props }) => {
|
|
1095
1095
|
const classNames2 = useClassNames10({ component: "Badge", variant, size });
|
|
1096
|
-
return /* @__PURE__ */
|
|
1096
|
+
return /* @__PURE__ */ React25.createElement("div", { ...props, className: classNames2 }, children);
|
|
1097
1097
|
};
|
|
1098
1098
|
|
|
1099
1099
|
// src/Breakout/Breakout.tsx
|
|
1100
|
-
import
|
|
1100
|
+
import React26 from "react";
|
|
1101
1101
|
import { cn as cn11, createVar as createVar4, alignment } from "@marigold/system";
|
|
1102
1102
|
var Breakout = ({
|
|
1103
1103
|
height,
|
|
@@ -1108,7 +1108,7 @@ var Breakout = ({
|
|
|
1108
1108
|
...props
|
|
1109
1109
|
}) => {
|
|
1110
1110
|
var _a, _b, _c, _d;
|
|
1111
|
-
return /* @__PURE__ */
|
|
1111
|
+
return /* @__PURE__ */ React26.createElement(
|
|
1112
1112
|
"div",
|
|
1113
1113
|
{
|
|
1114
1114
|
className: cn11(
|
|
@@ -1126,15 +1126,15 @@ var Breakout = ({
|
|
|
1126
1126
|
};
|
|
1127
1127
|
|
|
1128
1128
|
// src/Body/Body.tsx
|
|
1129
|
-
import
|
|
1129
|
+
import React27 from "react";
|
|
1130
1130
|
import { useClassNames as useClassNames11 } from "@marigold/system";
|
|
1131
1131
|
var Body = ({ children, variant, size, ...props }) => {
|
|
1132
1132
|
const classNames2 = useClassNames11({ component: "Body", variant, size });
|
|
1133
|
-
return /* @__PURE__ */
|
|
1133
|
+
return /* @__PURE__ */ React27.createElement("section", { ...props, className: classNames2 }, children);
|
|
1134
1134
|
};
|
|
1135
1135
|
|
|
1136
1136
|
// src/Card/Card.tsx
|
|
1137
|
-
import
|
|
1137
|
+
import React28 from "react";
|
|
1138
1138
|
import {
|
|
1139
1139
|
cn as cn12,
|
|
1140
1140
|
gapSpace as gapSpace2,
|
|
@@ -1162,7 +1162,7 @@ var Card = ({
|
|
|
1162
1162
|
...props
|
|
1163
1163
|
}) => {
|
|
1164
1164
|
const classNames2 = useClassNames12({ component: "Card", variant, size });
|
|
1165
|
-
return /* @__PURE__ */
|
|
1165
|
+
return /* @__PURE__ */ React28.createElement(
|
|
1166
1166
|
"div",
|
|
1167
1167
|
{
|
|
1168
1168
|
...props,
|
|
@@ -1184,7 +1184,7 @@ var Card = ({
|
|
|
1184
1184
|
};
|
|
1185
1185
|
|
|
1186
1186
|
// src/Center/Center.tsx
|
|
1187
|
-
import
|
|
1187
|
+
import React29 from "react";
|
|
1188
1188
|
import { cn as cn13, createVar as createVar5, gapSpace as gapSpace3 } from "@marigold/system";
|
|
1189
1189
|
var Center = ({
|
|
1190
1190
|
maxWidth = "100%",
|
|
@@ -1192,7 +1192,7 @@ var Center = ({
|
|
|
1192
1192
|
children,
|
|
1193
1193
|
...props
|
|
1194
1194
|
}) => {
|
|
1195
|
-
return /* @__PURE__ */
|
|
1195
|
+
return /* @__PURE__ */ React29.createElement(
|
|
1196
1196
|
"div",
|
|
1197
1197
|
{
|
|
1198
1198
|
className: cn13(
|
|
@@ -1208,16 +1208,27 @@ var Center = ({
|
|
|
1208
1208
|
};
|
|
1209
1209
|
|
|
1210
1210
|
// src/Checkbox/Checkbox.tsx
|
|
1211
|
-
import
|
|
1211
|
+
import React31, { forwardRef as forwardRef9 } from "react";
|
|
1212
1212
|
import { useCheckbox, useCheckboxGroupItem } from "@react-aria/checkbox";
|
|
1213
1213
|
import { useFocusRing as useFocusRing4 } from "@react-aria/focus";
|
|
1214
1214
|
import { useHover as useHover3 } from "@react-aria/interactions";
|
|
1215
1215
|
import { useObjectRef as useObjectRef5 } from "@react-aria/utils";
|
|
1216
1216
|
import { useToggleState } from "@react-stately/toggle";
|
|
1217
|
-
import {
|
|
1217
|
+
import {
|
|
1218
|
+
cn as cn14,
|
|
1219
|
+
useClassNames as useClassNames14,
|
|
1220
|
+
useStateProps as useStateProps6
|
|
1221
|
+
} from "@marigold/system";
|
|
1222
|
+
|
|
1223
|
+
// src/Checkbox/CheckboxField.tsx
|
|
1224
|
+
import { createVar as createVar6, useClassNames as useClassNames13 } from "@marigold/system";
|
|
1225
|
+
var CheckboxField = ({ children, labelWidth }) => {
|
|
1226
|
+
const classNames2 = useClassNames13({ component: "Field" });
|
|
1227
|
+
return /* @__PURE__ */ React.createElement("div", { className: classNames2 }, /* @__PURE__ */ React.createElement("div", { className: "w-[--labelWidth]", style: createVar6({ labelWidth }) }), children);
|
|
1228
|
+
};
|
|
1218
1229
|
|
|
1219
1230
|
// src/Checkbox/CheckboxGroup.tsx
|
|
1220
|
-
import
|
|
1231
|
+
import React30, { createContext as createContext3, useContext as useContext3 } from "react";
|
|
1221
1232
|
import { useCheckboxGroup } from "@react-aria/checkbox";
|
|
1222
1233
|
import {
|
|
1223
1234
|
useCheckboxGroupState
|
|
@@ -1250,7 +1261,7 @@ var CheckboxGroup = ({
|
|
|
1250
1261
|
readOnly,
|
|
1251
1262
|
error
|
|
1252
1263
|
});
|
|
1253
|
-
return /* @__PURE__ */
|
|
1264
|
+
return /* @__PURE__ */ React30.createElement(
|
|
1254
1265
|
FieldBase,
|
|
1255
1266
|
{
|
|
1256
1267
|
label: props.label,
|
|
@@ -1265,13 +1276,12 @@ var CheckboxGroup = ({
|
|
|
1265
1276
|
width,
|
|
1266
1277
|
...groupProps
|
|
1267
1278
|
},
|
|
1268
|
-
/* @__PURE__ */
|
|
1279
|
+
/* @__PURE__ */ React30.createElement("div", { role: "presentation", className: "flex flex-col items-start" }, /* @__PURE__ */ React30.createElement(CheckboxGroupContext.Provider, { value: { error, ...state } }, children))
|
|
1269
1280
|
);
|
|
1270
1281
|
};
|
|
1271
1282
|
|
|
1272
1283
|
// src/Checkbox/Checkbox.tsx
|
|
1273
|
-
|
|
1274
|
-
var CheckMark = () => /* @__PURE__ */ React30.createElement("svg", { viewBox: "0 0 12 10" }, /* @__PURE__ */ React30.createElement(
|
|
1284
|
+
var CheckMark = () => /* @__PURE__ */ React31.createElement("svg", { viewBox: "0 0 12 10" }, /* @__PURE__ */ React31.createElement(
|
|
1275
1285
|
"path",
|
|
1276
1286
|
{
|
|
1277
1287
|
fill: "currentColor",
|
|
@@ -1279,7 +1289,7 @@ var CheckMark = () => /* @__PURE__ */ React30.createElement("svg", { viewBox: "0
|
|
|
1279
1289
|
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"
|
|
1280
1290
|
}
|
|
1281
1291
|
));
|
|
1282
|
-
var IndeterminateMark = () => /* @__PURE__ */
|
|
1292
|
+
var IndeterminateMark = () => /* @__PURE__ */ React31.createElement("svg", { width: "12", height: "3", viewBox: "0 0 12 3" }, /* @__PURE__ */ React31.createElement(
|
|
1283
1293
|
"path",
|
|
1284
1294
|
{
|
|
1285
1295
|
fill: "currentColor",
|
|
@@ -1288,7 +1298,7 @@ var IndeterminateMark = () => /* @__PURE__ */ React30.createElement("svg", { wid
|
|
|
1288
1298
|
}
|
|
1289
1299
|
));
|
|
1290
1300
|
var Icon = ({ className, checked, indeterminate, ...props }) => {
|
|
1291
|
-
return /* @__PURE__ */
|
|
1301
|
+
return /* @__PURE__ */ React31.createElement(
|
|
1292
1302
|
"div",
|
|
1293
1303
|
{
|
|
1294
1304
|
"aria-hidden": "true",
|
|
@@ -1301,7 +1311,7 @@ var Icon = ({ className, checked, indeterminate, ...props }) => {
|
|
|
1301
1311
|
),
|
|
1302
1312
|
...props
|
|
1303
1313
|
},
|
|
1304
|
-
indeterminate ? /* @__PURE__ */
|
|
1314
|
+
indeterminate ? /* @__PURE__ */ React31.createElement(IndeterminateMark, null) : checked ? /* @__PURE__ */ React31.createElement(CheckMark, null) : null
|
|
1305
1315
|
);
|
|
1306
1316
|
};
|
|
1307
1317
|
var Checkbox = forwardRef9(
|
|
@@ -1353,10 +1363,11 @@ var Checkbox = forwardRef9(
|
|
|
1353
1363
|
}),
|
|
1354
1364
|
inputRef
|
|
1355
1365
|
);
|
|
1356
|
-
const classNames2 =
|
|
1366
|
+
const classNames2 = useClassNames14({ component: "Checkbox", variant, size });
|
|
1357
1367
|
const { hoverProps, isHovered } = useHover3({
|
|
1358
1368
|
isDisabled: inputProps.disabled
|
|
1359
1369
|
});
|
|
1370
|
+
const { labelWidth } = useFieldGroupContext();
|
|
1360
1371
|
const { isFocusVisible, focusProps } = useFocusRing4();
|
|
1361
1372
|
const stateProps = useStateProps6({
|
|
1362
1373
|
hover: isHovered,
|
|
@@ -1367,7 +1378,7 @@ var Checkbox = forwardRef9(
|
|
|
1367
1378
|
readOnly,
|
|
1368
1379
|
indeterminate
|
|
1369
1380
|
});
|
|
1370
|
-
|
|
1381
|
+
const component = /* @__PURE__ */ React31.createElement(
|
|
1371
1382
|
"label",
|
|
1372
1383
|
{
|
|
1373
1384
|
className: cn14(
|
|
@@ -1377,7 +1388,7 @@ var Checkbox = forwardRef9(
|
|
|
1377
1388
|
...hoverProps,
|
|
1378
1389
|
...stateProps
|
|
1379
1390
|
},
|
|
1380
|
-
/* @__PURE__ */
|
|
1391
|
+
/* @__PURE__ */ React31.createElement(
|
|
1381
1392
|
"input",
|
|
1382
1393
|
{
|
|
1383
1394
|
ref: inputRef,
|
|
@@ -1386,7 +1397,7 @@ var Checkbox = forwardRef9(
|
|
|
1386
1397
|
...focusProps
|
|
1387
1398
|
}
|
|
1388
1399
|
),
|
|
1389
|
-
/* @__PURE__ */
|
|
1400
|
+
/* @__PURE__ */ React31.createElement(
|
|
1390
1401
|
Icon,
|
|
1391
1402
|
{
|
|
1392
1403
|
checked: inputProps.checked,
|
|
@@ -1394,18 +1405,19 @@ var Checkbox = forwardRef9(
|
|
|
1394
1405
|
className: classNames2.checkbox
|
|
1395
1406
|
}
|
|
1396
1407
|
),
|
|
1397
|
-
props.children && /* @__PURE__ */
|
|
1408
|
+
props.children && /* @__PURE__ */ React31.createElement("div", { className: classNames2.label }, props.children)
|
|
1398
1409
|
);
|
|
1410
|
+
return !groupState && labelWidth ? /* @__PURE__ */ React31.createElement(CheckboxField, { labelWidth }, component) : component;
|
|
1399
1411
|
}
|
|
1400
1412
|
);
|
|
1401
1413
|
|
|
1402
1414
|
// src/Columns/Columns.tsx
|
|
1403
|
-
import
|
|
1415
|
+
import React32, {
|
|
1404
1416
|
Children as Children2,
|
|
1405
1417
|
cloneElement as cloneElement2,
|
|
1406
1418
|
isValidElement
|
|
1407
1419
|
} from "react";
|
|
1408
|
-
import { cn as cn15, createVar as
|
|
1420
|
+
import { cn as cn15, createVar as createVar7, gapSpace as gapSpace4 } from "@marigold/system";
|
|
1409
1421
|
var Columns = ({
|
|
1410
1422
|
space = 0,
|
|
1411
1423
|
columns,
|
|
@@ -1421,7 +1433,7 @@ var Columns = ({
|
|
|
1421
1433
|
)}`
|
|
1422
1434
|
);
|
|
1423
1435
|
}
|
|
1424
|
-
return /* @__PURE__ */
|
|
1436
|
+
return /* @__PURE__ */ React32.createElement(
|
|
1425
1437
|
"div",
|
|
1426
1438
|
{
|
|
1427
1439
|
className: cn15(
|
|
@@ -1431,13 +1443,13 @@ var Columns = ({
|
|
|
1431
1443
|
),
|
|
1432
1444
|
...props
|
|
1433
1445
|
},
|
|
1434
|
-
Children2.map(children, (child, idx) => /* @__PURE__ */
|
|
1446
|
+
Children2.map(children, (child, idx) => /* @__PURE__ */ React32.createElement(
|
|
1435
1447
|
"div",
|
|
1436
1448
|
{
|
|
1437
1449
|
className: cn15(
|
|
1438
1450
|
"grow-[--columnSize] basis-[calc((var(--collapseAt)_-_100%)_*_999)]"
|
|
1439
1451
|
),
|
|
1440
|
-
style:
|
|
1452
|
+
style: createVar7({ collapseAt, columnSize: columns[idx] })
|
|
1441
1453
|
},
|
|
1442
1454
|
isValidElement(child) ? cloneElement2(child) : child
|
|
1443
1455
|
))
|
|
@@ -1445,10 +1457,10 @@ var Columns = ({
|
|
|
1445
1457
|
};
|
|
1446
1458
|
|
|
1447
1459
|
// src/Container/Container.tsx
|
|
1448
|
-
import
|
|
1460
|
+
import React33 from "react";
|
|
1449
1461
|
import {
|
|
1450
1462
|
cn as cn16,
|
|
1451
|
-
createVar as
|
|
1463
|
+
createVar as createVar8,
|
|
1452
1464
|
placeItems,
|
|
1453
1465
|
gridColsAlign,
|
|
1454
1466
|
gridColumn
|
|
@@ -1472,7 +1484,7 @@ var Container = ({
|
|
|
1472
1484
|
...props
|
|
1473
1485
|
}) => {
|
|
1474
1486
|
const maxWidth = contentType === "content" ? content[size] : header[size];
|
|
1475
|
-
return /* @__PURE__ */
|
|
1487
|
+
return /* @__PURE__ */ React33.createElement(
|
|
1476
1488
|
"div",
|
|
1477
1489
|
{
|
|
1478
1490
|
className: cn16(
|
|
@@ -1481,7 +1493,7 @@ var Container = ({
|
|
|
1481
1493
|
gridColsAlign[align],
|
|
1482
1494
|
gridColumn[align]
|
|
1483
1495
|
),
|
|
1484
|
-
style:
|
|
1496
|
+
style: createVar8({ maxWidth }),
|
|
1485
1497
|
...props
|
|
1486
1498
|
},
|
|
1487
1499
|
children
|
|
@@ -1489,14 +1501,14 @@ var Container = ({
|
|
|
1489
1501
|
};
|
|
1490
1502
|
|
|
1491
1503
|
// src/Dialog/Dialog.tsx
|
|
1492
|
-
import
|
|
1504
|
+
import React38, { useRef as useRef9 } from "react";
|
|
1493
1505
|
import { useButton as useButton5 } from "@react-aria/button";
|
|
1494
1506
|
import { useDialog } from "@react-aria/dialog";
|
|
1495
|
-
import { cn as cn19, useClassNames as
|
|
1507
|
+
import { cn as cn19, useClassNames as useClassNames17 } from "@marigold/system";
|
|
1496
1508
|
|
|
1497
1509
|
// src/Header/Header.tsx
|
|
1498
|
-
import
|
|
1499
|
-
import { cn as cn17, useClassNames as
|
|
1510
|
+
import React34 from "react";
|
|
1511
|
+
import { cn as cn17, useClassNames as useClassNames15 } from "@marigold/system";
|
|
1500
1512
|
var Header = ({
|
|
1501
1513
|
children,
|
|
1502
1514
|
variant,
|
|
@@ -1504,21 +1516,21 @@ var Header = ({
|
|
|
1504
1516
|
className,
|
|
1505
1517
|
...props
|
|
1506
1518
|
}) => {
|
|
1507
|
-
const classNames2 =
|
|
1519
|
+
const classNames2 = useClassNames15({
|
|
1508
1520
|
component: "Header",
|
|
1509
1521
|
variant,
|
|
1510
1522
|
size,
|
|
1511
1523
|
className
|
|
1512
1524
|
});
|
|
1513
|
-
return /* @__PURE__ */
|
|
1525
|
+
return /* @__PURE__ */ React34.createElement("header", { ...props, className: cn17(classNames2) }, children);
|
|
1514
1526
|
};
|
|
1515
1527
|
|
|
1516
1528
|
// src/Headline/Headline.tsx
|
|
1517
|
-
import
|
|
1529
|
+
import React35 from "react";
|
|
1518
1530
|
import {
|
|
1519
|
-
useClassNames as
|
|
1531
|
+
useClassNames as useClassNames16,
|
|
1520
1532
|
cn as cn18,
|
|
1521
|
-
createVar as
|
|
1533
|
+
createVar as createVar9,
|
|
1522
1534
|
textAlign,
|
|
1523
1535
|
useTheme as useTheme2,
|
|
1524
1536
|
get
|
|
@@ -1534,18 +1546,18 @@ var Headline = ({
|
|
|
1534
1546
|
...props
|
|
1535
1547
|
}) => {
|
|
1536
1548
|
const theme = useTheme2();
|
|
1537
|
-
const classNames2 =
|
|
1549
|
+
const classNames2 = useClassNames16({
|
|
1538
1550
|
component: "Headline",
|
|
1539
1551
|
variant,
|
|
1540
1552
|
size: size != null ? size : `level-${level}`
|
|
1541
1553
|
});
|
|
1542
1554
|
const Component = as;
|
|
1543
|
-
return /* @__PURE__ */
|
|
1555
|
+
return /* @__PURE__ */ React35.createElement(
|
|
1544
1556
|
Component,
|
|
1545
1557
|
{
|
|
1546
1558
|
...props,
|
|
1547
1559
|
className: cn18(classNames2, "text-[--color]", textAlign[align]),
|
|
1548
|
-
style:
|
|
1560
|
+
style: createVar9({
|
|
1549
1561
|
color: color && theme.colors && get(
|
|
1550
1562
|
theme.colors,
|
|
1551
1563
|
color.replace("-", "."),
|
|
@@ -1564,7 +1576,7 @@ var DialogContext = createContext4({});
|
|
|
1564
1576
|
var useDialogContext = () => useContext4(DialogContext);
|
|
1565
1577
|
|
|
1566
1578
|
// src/Dialog/DialogTrigger.tsx
|
|
1567
|
-
import
|
|
1579
|
+
import React36, { useRef as useRef8 } from "react";
|
|
1568
1580
|
import { PressResponder } from "@react-aria/interactions";
|
|
1569
1581
|
import { useOverlayTriggerState } from "@react-stately/overlays";
|
|
1570
1582
|
var DialogTrigger = ({
|
|
@@ -1572,11 +1584,11 @@ var DialogTrigger = ({
|
|
|
1572
1584
|
dismissable = true,
|
|
1573
1585
|
keyboardDismissable = true
|
|
1574
1586
|
}) => {
|
|
1575
|
-
const [dialogTrigger, dialog] =
|
|
1587
|
+
const [dialogTrigger, dialog] = React36.Children.toArray(children);
|
|
1576
1588
|
const dialogTriggerRef = useRef8(null);
|
|
1577
1589
|
const state = useOverlayTriggerState({});
|
|
1578
1590
|
const ctx = { open: state.isOpen, close: state.close };
|
|
1579
|
-
return /* @__PURE__ */
|
|
1591
|
+
return /* @__PURE__ */ React36.createElement(DialogContext.Provider, { value: ctx }, /* @__PURE__ */ React36.createElement(
|
|
1580
1592
|
PressResponder,
|
|
1581
1593
|
{
|
|
1582
1594
|
ref: dialogTriggerRef,
|
|
@@ -1584,7 +1596,7 @@ var DialogTrigger = ({
|
|
|
1584
1596
|
onPress: state.toggle
|
|
1585
1597
|
},
|
|
1586
1598
|
dialogTrigger
|
|
1587
|
-
), /* @__PURE__ */
|
|
1599
|
+
), /* @__PURE__ */ React36.createElement(Overlay, { open: state.isOpen }, /* @__PURE__ */ React36.createElement(
|
|
1588
1600
|
Modal,
|
|
1589
1601
|
{
|
|
1590
1602
|
open: state.isOpen,
|
|
@@ -1598,7 +1610,7 @@ var DialogTrigger = ({
|
|
|
1598
1610
|
|
|
1599
1611
|
// src/Dialog/DialogController.tsx
|
|
1600
1612
|
import { useOverlayTriggerState as useOverlayTriggerState2 } from "@react-stately/overlays";
|
|
1601
|
-
import
|
|
1613
|
+
import React37 from "react";
|
|
1602
1614
|
var DialogController = ({
|
|
1603
1615
|
children,
|
|
1604
1616
|
dismissable = true,
|
|
@@ -1611,7 +1623,7 @@ var DialogController = ({
|
|
|
1611
1623
|
onOpenChange
|
|
1612
1624
|
});
|
|
1613
1625
|
const ctx = { open: state.isOpen, close: state.close };
|
|
1614
|
-
return /* @__PURE__ */
|
|
1626
|
+
return /* @__PURE__ */ React37.createElement(DialogContext.Provider, { value: ctx }, /* @__PURE__ */ React37.createElement(Overlay, { open: state.isOpen }, /* @__PURE__ */ React37.createElement(
|
|
1615
1627
|
Modal,
|
|
1616
1628
|
{
|
|
1617
1629
|
open: state.isOpen,
|
|
@@ -1633,7 +1645,7 @@ var CloseButton = ({ className }) => {
|
|
|
1633
1645
|
},
|
|
1634
1646
|
ref
|
|
1635
1647
|
);
|
|
1636
|
-
return /* @__PURE__ */
|
|
1648
|
+
return /* @__PURE__ */ React38.createElement("div", { className: "flex justify-end" }, /* @__PURE__ */ React38.createElement(
|
|
1637
1649
|
"button",
|
|
1638
1650
|
{
|
|
1639
1651
|
className: cn19(
|
|
@@ -1643,7 +1655,7 @@ var CloseButton = ({ className }) => {
|
|
|
1643
1655
|
ref,
|
|
1644
1656
|
...buttonProps
|
|
1645
1657
|
},
|
|
1646
|
-
/* @__PURE__ */
|
|
1658
|
+
/* @__PURE__ */ React38.createElement("svg", { viewBox: "0 0 20 20", fill: "currentColor" }, /* @__PURE__ */ React38.createElement(
|
|
1647
1659
|
"path",
|
|
1648
1660
|
{
|
|
1649
1661
|
fillRule: "evenodd",
|
|
@@ -1654,9 +1666,9 @@ var CloseButton = ({ className }) => {
|
|
|
1654
1666
|
));
|
|
1655
1667
|
};
|
|
1656
1668
|
var addTitleProps = (children, titleProps) => {
|
|
1657
|
-
const childs =
|
|
1669
|
+
const childs = React38.Children.toArray(children);
|
|
1658
1670
|
const titleIndex = childs.findIndex(
|
|
1659
|
-
(child) =>
|
|
1671
|
+
(child) => React38.isValidElement(child) && (child.type === Header || child.type === Headline)
|
|
1660
1672
|
);
|
|
1661
1673
|
if (titleIndex < 0) {
|
|
1662
1674
|
console.warn(
|
|
@@ -1664,7 +1676,7 @@ var addTitleProps = (children, titleProps) => {
|
|
|
1664
1676
|
);
|
|
1665
1677
|
return children;
|
|
1666
1678
|
}
|
|
1667
|
-
const titleChild =
|
|
1679
|
+
const titleChild = React38.cloneElement(
|
|
1668
1680
|
childs[titleIndex],
|
|
1669
1681
|
titleProps
|
|
1670
1682
|
);
|
|
@@ -1681,35 +1693,35 @@ var Dialog = ({
|
|
|
1681
1693
|
const ref = useRef9(null);
|
|
1682
1694
|
const { close } = useDialogContext();
|
|
1683
1695
|
const { dialogProps, titleProps } = useDialog(props, ref);
|
|
1684
|
-
const classNames2 =
|
|
1685
|
-
return /* @__PURE__ */
|
|
1696
|
+
const classNames2 = useClassNames17({ component: "Dialog", variant, size });
|
|
1697
|
+
return /* @__PURE__ */ React38.createElement("div", { className: classNames2.container, ...dialogProps }, closeButton && /* @__PURE__ */ React38.createElement(CloseButton, { className: classNames2.closeButton }), typeof children === "function" ? children({ close, titleProps }) : props["aria-labelledby"] ? children : addTitleProps(children, titleProps));
|
|
1686
1698
|
};
|
|
1687
1699
|
Dialog.Trigger = DialogTrigger;
|
|
1688
1700
|
Dialog.Controller = DialogController;
|
|
1689
1701
|
|
|
1690
1702
|
// src/Divider/Divider.tsx
|
|
1691
|
-
import
|
|
1703
|
+
import React39 from "react";
|
|
1692
1704
|
import { useSeparator } from "@react-aria/separator";
|
|
1693
|
-
import { useClassNames as
|
|
1705
|
+
import { useClassNames as useClassNames18 } from "@marigold/system";
|
|
1694
1706
|
var Divider = ({ variant, ...props }) => {
|
|
1695
1707
|
const { separatorProps } = useSeparator(props);
|
|
1696
|
-
const classNames2 =
|
|
1697
|
-
return /* @__PURE__ */
|
|
1708
|
+
const classNames2 = useClassNames18({ component: "Divider", variant });
|
|
1709
|
+
return /* @__PURE__ */ React39.createElement("div", { className: classNames2, ...props, ...separatorProps });
|
|
1698
1710
|
};
|
|
1699
1711
|
|
|
1700
1712
|
// src/Footer/Footer.tsx
|
|
1701
|
-
import
|
|
1702
|
-
import { useClassNames as
|
|
1713
|
+
import React40 from "react";
|
|
1714
|
+
import { useClassNames as useClassNames19 } from "@marigold/system";
|
|
1703
1715
|
var Footer = ({ children, variant, size, ...props }) => {
|
|
1704
|
-
const classNames2 =
|
|
1705
|
-
return /* @__PURE__ */
|
|
1716
|
+
const classNames2 = useClassNames19({ component: "Footer", variant, size });
|
|
1717
|
+
return /* @__PURE__ */ React40.createElement("footer", { ...props, className: classNames2 }, children);
|
|
1706
1718
|
};
|
|
1707
1719
|
|
|
1708
1720
|
// src/Image/Image.tsx
|
|
1709
|
-
import
|
|
1721
|
+
import React41 from "react";
|
|
1710
1722
|
import {
|
|
1711
1723
|
cn as cn20,
|
|
1712
|
-
useClassNames as
|
|
1724
|
+
useClassNames as useClassNames20,
|
|
1713
1725
|
objectFit,
|
|
1714
1726
|
objectPosition
|
|
1715
1727
|
} from "@marigold/system";
|
|
@@ -1720,8 +1732,8 @@ var Image = ({
|
|
|
1720
1732
|
position = "none",
|
|
1721
1733
|
...props
|
|
1722
1734
|
}) => {
|
|
1723
|
-
const classNames2 =
|
|
1724
|
-
return /* @__PURE__ */
|
|
1735
|
+
const classNames2 = useClassNames20({ component: "Image", variant, size });
|
|
1736
|
+
return /* @__PURE__ */ React41.createElement(
|
|
1725
1737
|
"img",
|
|
1726
1738
|
{
|
|
1727
1739
|
...props,
|
|
@@ -1737,7 +1749,7 @@ var Image = ({
|
|
|
1737
1749
|
};
|
|
1738
1750
|
|
|
1739
1751
|
// src/Inline/Inline.tsx
|
|
1740
|
-
import
|
|
1752
|
+
import React42 from "react";
|
|
1741
1753
|
import {
|
|
1742
1754
|
gapSpace as gapSpace5,
|
|
1743
1755
|
alignment as alignment2,
|
|
@@ -1752,7 +1764,7 @@ var Inline = ({
|
|
|
1752
1764
|
...props
|
|
1753
1765
|
}) => {
|
|
1754
1766
|
var _a2, _b2, _c, _d;
|
|
1755
|
-
return /* @__PURE__ */
|
|
1767
|
+
return /* @__PURE__ */ React42.createElement(
|
|
1756
1768
|
"div",
|
|
1757
1769
|
{
|
|
1758
1770
|
className: cn21(
|
|
@@ -1768,15 +1780,15 @@ var Inline = ({
|
|
|
1768
1780
|
};
|
|
1769
1781
|
|
|
1770
1782
|
// src/DateField/DateField.tsx
|
|
1771
|
-
import
|
|
1783
|
+
import React44, { useRef as useRef11 } from "react";
|
|
1772
1784
|
import { useLocale } from "@react-aria/i18n";
|
|
1773
1785
|
import { useDateFieldState } from "@react-stately/datepicker";
|
|
1774
1786
|
import { useDateField } from "@react-aria/datepicker";
|
|
1775
1787
|
import { createCalendar } from "@internationalized/date";
|
|
1776
|
-
import { cn as cn23, useClassNames as
|
|
1788
|
+
import { cn as cn23, useClassNames as useClassNames21, useStateProps as useStateProps8 } from "@marigold/system";
|
|
1777
1789
|
|
|
1778
1790
|
// src/DateField/DateSegment.tsx
|
|
1779
|
-
import
|
|
1791
|
+
import React43, { useRef as useRef10 } from "react";
|
|
1780
1792
|
import { cn as cn22, useStateProps as useStateProps7 } from "@marigold/system";
|
|
1781
1793
|
import { useDateSegment } from "@react-aria/datepicker";
|
|
1782
1794
|
import { useFocusRing as useFocusRing5 } from "@react-aria/focus";
|
|
@@ -1798,7 +1810,7 @@ var DateSegment = ({
|
|
|
1798
1810
|
focusVisible: isFocused
|
|
1799
1811
|
});
|
|
1800
1812
|
const { isPlaceholder, placeholder, text, type, maxValue } = segment;
|
|
1801
|
-
return /* @__PURE__ */
|
|
1813
|
+
return /* @__PURE__ */ React43.createElement(
|
|
1802
1814
|
"div",
|
|
1803
1815
|
{
|
|
1804
1816
|
...mergeProps7(segmentProps, stateProps, focusProps),
|
|
@@ -1814,7 +1826,7 @@ var DateSegment = ({
|
|
|
1814
1826
|
minWidth: maxValue != null ? String(maxValue).length + "ch" : void 0
|
|
1815
1827
|
}
|
|
1816
1828
|
},
|
|
1817
|
-
/* @__PURE__ */
|
|
1829
|
+
/* @__PURE__ */ React43.createElement(
|
|
1818
1830
|
"span",
|
|
1819
1831
|
{
|
|
1820
1832
|
"aria-hidden": "true",
|
|
@@ -1825,7 +1837,7 @@ var DateSegment = ({
|
|
|
1825
1837
|
},
|
|
1826
1838
|
isPlaceholder && (placeholder == null ? void 0 : placeholder.toUpperCase())
|
|
1827
1839
|
),
|
|
1828
|
-
/* @__PURE__ */
|
|
1840
|
+
/* @__PURE__ */ React43.createElement("span", null, isPlaceholder ? "" : type === "month" || type === "day" ? Number(text) < 10 ? "0" + text : text : text)
|
|
1829
1841
|
);
|
|
1830
1842
|
};
|
|
1831
1843
|
|
|
@@ -1867,7 +1879,7 @@ var DateField = ({
|
|
|
1867
1879
|
state,
|
|
1868
1880
|
ref
|
|
1869
1881
|
);
|
|
1870
|
-
const classNames2 =
|
|
1882
|
+
const classNames2 = useClassNames21({ component: "DateField", variant, size });
|
|
1871
1883
|
const { focusProps, isFocused } = useFocusRing6({
|
|
1872
1884
|
within: true,
|
|
1873
1885
|
isTextInput: true,
|
|
@@ -1882,7 +1894,7 @@ var DateField = ({
|
|
|
1882
1894
|
required,
|
|
1883
1895
|
focus: isFocused || isPressed
|
|
1884
1896
|
});
|
|
1885
|
-
return /* @__PURE__ */
|
|
1897
|
+
return /* @__PURE__ */ React44.createElement(
|
|
1886
1898
|
FieldBase,
|
|
1887
1899
|
{
|
|
1888
1900
|
error,
|
|
@@ -1898,7 +1910,7 @@ var DateField = ({
|
|
|
1898
1910
|
size,
|
|
1899
1911
|
width
|
|
1900
1912
|
},
|
|
1901
|
-
/* @__PURE__ */
|
|
1913
|
+
/* @__PURE__ */ React44.createElement(
|
|
1902
1914
|
"div",
|
|
1903
1915
|
{
|
|
1904
1916
|
...mergeProps8(fieldProps, focusProps, stateProps, hoverProps),
|
|
@@ -1910,9 +1922,9 @@ var DateField = ({
|
|
|
1910
1922
|
"data-testid": "date-field",
|
|
1911
1923
|
ref: triggerRef
|
|
1912
1924
|
},
|
|
1913
|
-
/* @__PURE__ */
|
|
1925
|
+
/* @__PURE__ */ React44.createElement("div", { ref, className: "flex basis-full items-center" }, state.segments.map((segment, i) => {
|
|
1914
1926
|
var _a;
|
|
1915
|
-
return /* @__PURE__ */
|
|
1927
|
+
return /* @__PURE__ */ React44.createElement(
|
|
1916
1928
|
DateSegment,
|
|
1917
1929
|
{
|
|
1918
1930
|
className: classNames2.segment,
|
|
@@ -1923,7 +1935,7 @@ var DateField = ({
|
|
|
1923
1935
|
}
|
|
1924
1936
|
);
|
|
1925
1937
|
})),
|
|
1926
|
-
action ? action : /* @__PURE__ */
|
|
1938
|
+
action ? action : /* @__PURE__ */ React44.createElement("div", { className: "flex items-center justify-center" }, /* @__PURE__ */ React44.createElement(
|
|
1927
1939
|
"svg",
|
|
1928
1940
|
{
|
|
1929
1941
|
"data-testid": "action",
|
|
@@ -1932,14 +1944,14 @@ var DateField = ({
|
|
|
1932
1944
|
width: 24,
|
|
1933
1945
|
height: 24
|
|
1934
1946
|
},
|
|
1935
|
-
/* @__PURE__ */
|
|
1947
|
+
/* @__PURE__ */ React44.createElement("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" })
|
|
1936
1948
|
))
|
|
1937
1949
|
)
|
|
1938
1950
|
);
|
|
1939
1951
|
};
|
|
1940
1952
|
|
|
1941
1953
|
// src/Calendar/Calendar.tsx
|
|
1942
|
-
import
|
|
1954
|
+
import React50, { useRef as useRef14 } from "react";
|
|
1943
1955
|
import { useCalendarState } from "@react-stately/calendar";
|
|
1944
1956
|
import {
|
|
1945
1957
|
useCalendar
|
|
@@ -1948,23 +1960,23 @@ import { useLocale as useLocale3 } from "@react-aria/i18n";
|
|
|
1948
1960
|
import { createCalendar as createCalendar2 } from "@internationalized/date";
|
|
1949
1961
|
|
|
1950
1962
|
// src/Calendar/CalendarGrid.tsx
|
|
1951
|
-
import
|
|
1963
|
+
import React46 from "react";
|
|
1952
1964
|
import { useMemo } from "react";
|
|
1953
1965
|
import { useCalendarGrid } from "@react-aria/calendar";
|
|
1954
1966
|
import { useLocale as useLocale2 } from "@react-aria/i18n";
|
|
1955
1967
|
import { getWeeksInMonth, startOfWeek, today } from "@internationalized/date";
|
|
1956
1968
|
|
|
1957
1969
|
// src/Calendar/CalendarCell.tsx
|
|
1958
|
-
import
|
|
1970
|
+
import React45, { useRef as useRef12 } from "react";
|
|
1959
1971
|
import { useCalendarCell } from "@react-aria/calendar";
|
|
1960
1972
|
import { mergeProps as mergeProps9 } from "@react-aria/utils";
|
|
1961
|
-
import { cn as cn24, useClassNames as
|
|
1973
|
+
import { cn as cn24, useClassNames as useClassNames22, useStateProps as useStateProps9 } from "@marigold/system";
|
|
1962
1974
|
import { useHover as useHover5 } from "@react-aria/interactions";
|
|
1963
1975
|
var CalendarCell = (props) => {
|
|
1964
1976
|
const ref = useRef12(null);
|
|
1965
1977
|
const { state } = props;
|
|
1966
1978
|
let { cellProps, buttonProps, formattedDate, isOutsideVisibleRange } = useCalendarCell(props, state, ref);
|
|
1967
|
-
const classNames2 =
|
|
1979
|
+
const classNames2 = useClassNames22({
|
|
1968
1980
|
component: "Calendar"
|
|
1969
1981
|
});
|
|
1970
1982
|
const isDisabled = cellProps["aria-disabled"];
|
|
@@ -1976,7 +1988,7 @@ var CalendarCell = (props) => {
|
|
|
1976
1988
|
hover: isHovered,
|
|
1977
1989
|
selected: cellProps["aria-selected"]
|
|
1978
1990
|
});
|
|
1979
|
-
return /* @__PURE__ */
|
|
1991
|
+
return /* @__PURE__ */ React45.createElement("td", { className: "group/cell", ...cellProps }, /* @__PURE__ */ React45.createElement(
|
|
1980
1992
|
"div",
|
|
1981
1993
|
{
|
|
1982
1994
|
className: cn24(
|
|
@@ -2012,37 +2024,37 @@ var CalendarGrid = ({ state, ...props }) => {
|
|
|
2012
2024
|
return dayFormatter.format(dateDay);
|
|
2013
2025
|
});
|
|
2014
2026
|
}, [locale, state.timeZone, dayFormatter]);
|
|
2015
|
-
return /* @__PURE__ */
|
|
2027
|
+
return /* @__PURE__ */ React46.createElement(
|
|
2016
2028
|
"table",
|
|
2017
2029
|
{
|
|
2018
2030
|
className: "w-full border-spacing-[6px]",
|
|
2019
2031
|
...gridProps,
|
|
2020
2032
|
cellPadding: "8"
|
|
2021
2033
|
},
|
|
2022
|
-
/* @__PURE__ */
|
|
2023
|
-
/* @__PURE__ */
|
|
2024
|
-
(date, i) => date ? /* @__PURE__ */
|
|
2034
|
+
/* @__PURE__ */ React46.createElement("thead", { ...headerProps }, /* @__PURE__ */ React46.createElement("tr", null, weekDays.map((day, index) => /* @__PURE__ */ React46.createElement("th", { style: { fontWeight: "bolder" }, key: index }, day.substring(0, 2))))),
|
|
2035
|
+
/* @__PURE__ */ React46.createElement("tbody", null, [...new Array(numberOfWeeksInMonth).keys()].map((weekIndex) => /* @__PURE__ */ React46.createElement("tr", { key: weekIndex }, state.getDatesInWeek(weekIndex).map(
|
|
2036
|
+
(date, i) => date ? /* @__PURE__ */ React46.createElement(
|
|
2025
2037
|
CalendarCell,
|
|
2026
2038
|
{
|
|
2027
2039
|
key: i,
|
|
2028
2040
|
date,
|
|
2029
2041
|
state
|
|
2030
2042
|
}
|
|
2031
|
-
) : /* @__PURE__ */
|
|
2043
|
+
) : /* @__PURE__ */ React46.createElement("td", { key: i })
|
|
2032
2044
|
))))
|
|
2033
2045
|
);
|
|
2034
2046
|
};
|
|
2035
2047
|
|
|
2036
2048
|
// src/Calendar/Calendar.tsx
|
|
2037
2049
|
import { ChevronRight, ChevronLeft } from "@marigold/icons";
|
|
2038
|
-
import { cn as cn26, useClassNames as
|
|
2050
|
+
import { cn as cn26, useClassNames as useClassNames24, useStateProps as useStateProps11 } from "@marigold/system";
|
|
2039
2051
|
|
|
2040
2052
|
// src/Calendar/MonthDropdown.tsx
|
|
2041
|
-
import
|
|
2053
|
+
import React48 from "react";
|
|
2042
2054
|
import { useDateFormatter as useDateFormatter2 } from "@react-aria/i18n";
|
|
2043
2055
|
|
|
2044
2056
|
// src/Select/Select.tsx
|
|
2045
|
-
import
|
|
2057
|
+
import React47, {
|
|
2046
2058
|
forwardRef as forwardRef10,
|
|
2047
2059
|
useRef as useRef13
|
|
2048
2060
|
} from "react";
|
|
@@ -2055,7 +2067,7 @@ import { Item as Item4, Section } from "@react-stately/collections";
|
|
|
2055
2067
|
import { mergeProps as mergeProps10, useObjectRef as useObjectRef6 } from "@react-aria/utils";
|
|
2056
2068
|
import {
|
|
2057
2069
|
cn as cn25,
|
|
2058
|
-
useClassNames as
|
|
2070
|
+
useClassNames as useClassNames23,
|
|
2059
2071
|
useSmallScreen,
|
|
2060
2072
|
useStateProps as useStateProps10
|
|
2061
2073
|
} from "@marigold/system";
|
|
@@ -2109,7 +2121,7 @@ var Select = forwardRef10(
|
|
|
2109
2121
|
buttonRef
|
|
2110
2122
|
);
|
|
2111
2123
|
const { focusProps, isFocusVisible } = useFocusRing7();
|
|
2112
|
-
const classNames2 =
|
|
2124
|
+
const classNames2 = useClassNames23({ component: "Select", variant, size });
|
|
2113
2125
|
const isSmallScreen = useSmallScreen();
|
|
2114
2126
|
const stateProps = useStateProps10({
|
|
2115
2127
|
disabled,
|
|
@@ -2118,7 +2130,7 @@ var Select = forwardRef10(
|
|
|
2118
2130
|
expanded: state.isOpen,
|
|
2119
2131
|
required
|
|
2120
2132
|
});
|
|
2121
|
-
return /* @__PURE__ */
|
|
2133
|
+
return /* @__PURE__ */ React47.createElement(
|
|
2122
2134
|
FieldBase,
|
|
2123
2135
|
{
|
|
2124
2136
|
variant,
|
|
@@ -2134,7 +2146,7 @@ var Select = forwardRef10(
|
|
|
2134
2146
|
stateProps,
|
|
2135
2147
|
disabled
|
|
2136
2148
|
},
|
|
2137
|
-
/* @__PURE__ */
|
|
2149
|
+
/* @__PURE__ */ React47.createElement(
|
|
2138
2150
|
HiddenSelect,
|
|
2139
2151
|
{
|
|
2140
2152
|
state,
|
|
@@ -2144,7 +2156,7 @@ var Select = forwardRef10(
|
|
|
2144
2156
|
isDisabled: disabled
|
|
2145
2157
|
}
|
|
2146
2158
|
),
|
|
2147
|
-
/* @__PURE__ */
|
|
2159
|
+
/* @__PURE__ */ React47.createElement(
|
|
2148
2160
|
"button",
|
|
2149
2161
|
{
|
|
2150
2162
|
className: cn25(
|
|
@@ -2155,10 +2167,10 @@ var Select = forwardRef10(
|
|
|
2155
2167
|
...mergeProps10(buttonProps, focusProps),
|
|
2156
2168
|
...stateProps
|
|
2157
2169
|
},
|
|
2158
|
-
/* @__PURE__ */
|
|
2159
|
-
/* @__PURE__ */
|
|
2170
|
+
/* @__PURE__ */ React47.createElement("div", { className: "overflow-hidden whitespace-nowrap", ...valueProps }, state.selectedItem ? state.selectedItem.rendered : props.placeholder),
|
|
2171
|
+
/* @__PURE__ */ React47.createElement(ChevronDown, { className: "h-4 w-4" })
|
|
2160
2172
|
),
|
|
2161
|
-
isSmallScreen ? /* @__PURE__ */
|
|
2173
|
+
isSmallScreen ? /* @__PURE__ */ React47.createElement(Tray, { state }, /* @__PURE__ */ React47.createElement(
|
|
2162
2174
|
ListBox,
|
|
2163
2175
|
{
|
|
2164
2176
|
ref: listboxRef,
|
|
@@ -2167,7 +2179,7 @@ var Select = forwardRef10(
|
|
|
2167
2179
|
size,
|
|
2168
2180
|
...menuProps
|
|
2169
2181
|
}
|
|
2170
|
-
)) : /* @__PURE__ */
|
|
2182
|
+
)) : /* @__PURE__ */ React47.createElement(Popover, { state, triggerRef: buttonRef, scrollRef: listboxRef }, /* @__PURE__ */ React47.createElement(
|
|
2171
2183
|
ListBox,
|
|
2172
2184
|
{
|
|
2173
2185
|
ref: listboxRef,
|
|
@@ -2200,7 +2212,7 @@ var MonthDropdown = ({ state }) => {
|
|
|
2200
2212
|
let date = state.focusedDate.set({ month: value });
|
|
2201
2213
|
state.setFocusedDate(date);
|
|
2202
2214
|
};
|
|
2203
|
-
return /* @__PURE__ */
|
|
2215
|
+
return /* @__PURE__ */ React48.createElement(
|
|
2204
2216
|
Select,
|
|
2205
2217
|
{
|
|
2206
2218
|
"aria-label": "Month",
|
|
@@ -2209,13 +2221,13 @@ var MonthDropdown = ({ state }) => {
|
|
|
2209
2221
|
"data-testid": "month",
|
|
2210
2222
|
disabled: state.isDisabled
|
|
2211
2223
|
},
|
|
2212
|
-
months.map((month, i) => /* @__PURE__ */
|
|
2224
|
+
months.map((month, i) => /* @__PURE__ */ React48.createElement(Select.Option, { key: i + 1 }, month.substring(0, 3)))
|
|
2213
2225
|
);
|
|
2214
2226
|
};
|
|
2215
2227
|
var MonthDropdown_default = MonthDropdown;
|
|
2216
2228
|
|
|
2217
2229
|
// src/Calendar/YearDropdown.tsx
|
|
2218
|
-
import
|
|
2230
|
+
import React49 from "react";
|
|
2219
2231
|
import { useDateFormatter as useDateFormatter3 } from "@react-aria/i18n";
|
|
2220
2232
|
var YearDropdown = ({ state }) => {
|
|
2221
2233
|
const years = [];
|
|
@@ -2235,7 +2247,7 @@ var YearDropdown = ({ state }) => {
|
|
|
2235
2247
|
let date = years[index].value;
|
|
2236
2248
|
state.setFocusedDate(date);
|
|
2237
2249
|
};
|
|
2238
|
-
return /* @__PURE__ */
|
|
2250
|
+
return /* @__PURE__ */ React49.createElement(
|
|
2239
2251
|
Select,
|
|
2240
2252
|
{
|
|
2241
2253
|
"aria-label": "Year",
|
|
@@ -2244,7 +2256,7 @@ var YearDropdown = ({ state }) => {
|
|
|
2244
2256
|
"data-testid": "year",
|
|
2245
2257
|
disabled: state.isDisabled
|
|
2246
2258
|
},
|
|
2247
|
-
years.map((year, i) => /* @__PURE__ */
|
|
2259
|
+
years.map((year, i) => /* @__PURE__ */ React49.createElement(Select.Option, { key: i }, year.formatted))
|
|
2248
2260
|
);
|
|
2249
2261
|
};
|
|
2250
2262
|
var YearDropdown_default = YearDropdown;
|
|
@@ -2278,8 +2290,8 @@ var Calendar = ({
|
|
|
2278
2290
|
const calendarState = useStateProps11({
|
|
2279
2291
|
disabled: state.isDisabled
|
|
2280
2292
|
});
|
|
2281
|
-
const classNames2 =
|
|
2282
|
-
return /* @__PURE__ */
|
|
2293
|
+
const classNames2 = useClassNames24({ component: "Calendar" });
|
|
2294
|
+
return /* @__PURE__ */ React50.createElement(
|
|
2283
2295
|
"div",
|
|
2284
2296
|
{
|
|
2285
2297
|
tabIndex: -1,
|
|
@@ -2291,32 +2303,32 @@ var Calendar = ({
|
|
|
2291
2303
|
...calendarState,
|
|
2292
2304
|
ref
|
|
2293
2305
|
},
|
|
2294
|
-
/* @__PURE__ */
|
|
2306
|
+
/* @__PURE__ */ React50.createElement("div", { className: "mb-4 flex items-center gap-[60px]" }, /* @__PURE__ */ React50.createElement("div", { className: "flex min-w-[170px] gap-[9px] [&_div]:flex" }, /* @__PURE__ */ React50.createElement(MonthDropdown_default, { state }), /* @__PURE__ */ React50.createElement(YearDropdown_default, { state })), /* @__PURE__ */ React50.createElement("div", { className: "flex w-full flex-nowrap justify-end gap-[10px] [&_button:disabled]:cursor-not-allowed [&_button]:px-2 [&_button]:py-1" }, /* @__PURE__ */ React50.createElement(
|
|
2295
2307
|
Button,
|
|
2296
2308
|
{
|
|
2297
2309
|
className: classNames2.calendarControllers,
|
|
2298
2310
|
...prevPropsRest,
|
|
2299
2311
|
disabled: prevIsDisabled
|
|
2300
2312
|
},
|
|
2301
|
-
/* @__PURE__ */
|
|
2302
|
-
), /* @__PURE__ */
|
|
2313
|
+
/* @__PURE__ */ React50.createElement(ChevronLeft, null)
|
|
2314
|
+
), /* @__PURE__ */ React50.createElement(
|
|
2303
2315
|
Button,
|
|
2304
2316
|
{
|
|
2305
2317
|
className: classNames2.calendarControllers,
|
|
2306
2318
|
...nextPropsRest,
|
|
2307
2319
|
disabled: nextIsDisabled
|
|
2308
2320
|
},
|
|
2309
|
-
/* @__PURE__ */
|
|
2321
|
+
/* @__PURE__ */ React50.createElement(ChevronRight, null)
|
|
2310
2322
|
))),
|
|
2311
|
-
/* @__PURE__ */
|
|
2323
|
+
/* @__PURE__ */ React50.createElement(CalendarGrid, { state })
|
|
2312
2324
|
);
|
|
2313
2325
|
};
|
|
2314
2326
|
|
|
2315
2327
|
// src/DatePicker/DatePicker.tsx
|
|
2316
|
-
import
|
|
2328
|
+
import React51, { useRef as useRef15 } from "react";
|
|
2317
2329
|
import { useDatePickerState } from "@react-stately/datepicker";
|
|
2318
2330
|
import { useDatePicker } from "@react-aria/datepicker";
|
|
2319
|
-
import { cn as cn27, useClassNames as
|
|
2331
|
+
import { cn as cn27, useClassNames as useClassNames25, useStateProps as useStateProps12 } from "@marigold/system";
|
|
2320
2332
|
import { mergeProps as mergeProps11 } from "@react-aria/utils";
|
|
2321
2333
|
var DatePicker = ({
|
|
2322
2334
|
disabled,
|
|
@@ -2350,12 +2362,12 @@ var DatePicker = ({
|
|
|
2350
2362
|
ref
|
|
2351
2363
|
);
|
|
2352
2364
|
const { isDisabled, errorMessage, description, label } = props;
|
|
2353
|
-
const classNames2 =
|
|
2365
|
+
const classNames2 = useClassNames25({
|
|
2354
2366
|
component: "DatePicker",
|
|
2355
2367
|
size,
|
|
2356
2368
|
variant
|
|
2357
2369
|
});
|
|
2358
|
-
return /* @__PURE__ */
|
|
2370
|
+
return /* @__PURE__ */ React51.createElement(React51.Fragment, null, /* @__PURE__ */ React51.createElement("div", { className: "flex w-full min-w-[300px]", ...groupProps }, /* @__PURE__ */ React51.createElement(
|
|
2359
2371
|
DateField,
|
|
2360
2372
|
{
|
|
2361
2373
|
...fieldProps,
|
|
@@ -2367,14 +2379,14 @@ var DatePicker = ({
|
|
|
2367
2379
|
error,
|
|
2368
2380
|
description: !state.isOpen && description,
|
|
2369
2381
|
triggerRef: ref,
|
|
2370
|
-
action: /* @__PURE__ */
|
|
2382
|
+
action: /* @__PURE__ */ React51.createElement("div", { className: classNames2.container }, /* @__PURE__ */ React51.createElement(
|
|
2371
2383
|
Button,
|
|
2372
2384
|
{
|
|
2373
2385
|
...mergeProps11(buttonProps, stateProps),
|
|
2374
2386
|
className: cn27("absolute right-0 top-0", classNames2.button),
|
|
2375
2387
|
disabled: isDisabled
|
|
2376
2388
|
},
|
|
2377
|
-
/* @__PURE__ */
|
|
2389
|
+
/* @__PURE__ */ React51.createElement(
|
|
2378
2390
|
"svg",
|
|
2379
2391
|
{
|
|
2380
2392
|
width: "24",
|
|
@@ -2382,15 +2394,15 @@ var DatePicker = ({
|
|
|
2382
2394
|
viewBox: "0 0 24 24",
|
|
2383
2395
|
fill: "currentColor"
|
|
2384
2396
|
},
|
|
2385
|
-
/* @__PURE__ */
|
|
2397
|
+
/* @__PURE__ */ React51.createElement("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" })
|
|
2386
2398
|
)
|
|
2387
2399
|
))
|
|
2388
2400
|
}
|
|
2389
|
-
)), state.isOpen && /* @__PURE__ */
|
|
2401
|
+
)), state.isOpen && /* @__PURE__ */ React51.createElement(Popover, { triggerRef: ref, state }, /* @__PURE__ */ React51.createElement(Calendar, { disabled, ...calendarProps })));
|
|
2390
2402
|
};
|
|
2391
2403
|
|
|
2392
2404
|
// src/Inset/Inset.tsx
|
|
2393
|
-
import
|
|
2405
|
+
import React52 from "react";
|
|
2394
2406
|
import {
|
|
2395
2407
|
paddingSpace as paddingSpace2,
|
|
2396
2408
|
paddingSpaceX as paddingSpaceX2,
|
|
@@ -2402,7 +2414,7 @@ var Inset = ({
|
|
|
2402
2414
|
spaceX = 0,
|
|
2403
2415
|
spaceY = 0,
|
|
2404
2416
|
children
|
|
2405
|
-
}) => /* @__PURE__ */
|
|
2417
|
+
}) => /* @__PURE__ */ React52.createElement(
|
|
2406
2418
|
"div",
|
|
2407
2419
|
{
|
|
2408
2420
|
className: cn28(
|
|
@@ -2414,9 +2426,9 @@ var Inset = ({
|
|
|
2414
2426
|
);
|
|
2415
2427
|
|
|
2416
2428
|
// src/Link/Link.tsx
|
|
2417
|
-
import
|
|
2429
|
+
import React53, { forwardRef as forwardRef11 } from "react";
|
|
2418
2430
|
import { useLink } from "@react-aria/link";
|
|
2419
|
-
import { useClassNames as
|
|
2431
|
+
import { useClassNames as useClassNames26 } from "@marigold/system";
|
|
2420
2432
|
import { useObjectRef as useObjectRef7 } from "@react-aria/utils";
|
|
2421
2433
|
var Link = forwardRef11(
|
|
2422
2434
|
({
|
|
@@ -2440,13 +2452,13 @@ var Link = forwardRef11(
|
|
|
2440
2452
|
linkRef
|
|
2441
2453
|
);
|
|
2442
2454
|
const Component = as;
|
|
2443
|
-
const classNames2 =
|
|
2455
|
+
const classNames2 = useClassNames26({
|
|
2444
2456
|
component: "Link",
|
|
2445
2457
|
variant,
|
|
2446
2458
|
size,
|
|
2447
2459
|
className
|
|
2448
2460
|
});
|
|
2449
|
-
return /* @__PURE__ */
|
|
2461
|
+
return /* @__PURE__ */ React53.createElement(
|
|
2450
2462
|
Component,
|
|
2451
2463
|
{
|
|
2452
2464
|
...props,
|
|
@@ -2461,8 +2473,8 @@ var Link = forwardRef11(
|
|
|
2461
2473
|
);
|
|
2462
2474
|
|
|
2463
2475
|
// src/List/List.tsx
|
|
2464
|
-
import
|
|
2465
|
-
import { useClassNames as
|
|
2476
|
+
import React55 from "react";
|
|
2477
|
+
import { useClassNames as useClassNames27 } from "@marigold/system";
|
|
2466
2478
|
|
|
2467
2479
|
// src/List/Context.ts
|
|
2468
2480
|
import { createContext as createContext5, useContext as useContext5 } from "react";
|
|
@@ -2470,10 +2482,10 @@ var ListContext = createContext5({});
|
|
|
2470
2482
|
var useListContext = () => useContext5(ListContext);
|
|
2471
2483
|
|
|
2472
2484
|
// src/List/ListItem.tsx
|
|
2473
|
-
import
|
|
2485
|
+
import React54 from "react";
|
|
2474
2486
|
var ListItem = ({ children, ...props }) => {
|
|
2475
2487
|
const { classNames: classNames2 } = useListContext();
|
|
2476
|
-
return /* @__PURE__ */
|
|
2488
|
+
return /* @__PURE__ */ React54.createElement("li", { ...props, className: classNames2 }, children);
|
|
2477
2489
|
};
|
|
2478
2490
|
|
|
2479
2491
|
// src/List/List.tsx
|
|
@@ -2485,18 +2497,18 @@ var List = ({
|
|
|
2485
2497
|
...props
|
|
2486
2498
|
}) => {
|
|
2487
2499
|
const Component = as;
|
|
2488
|
-
const classNames2 =
|
|
2489
|
-
return /* @__PURE__ */
|
|
2500
|
+
const classNames2 = useClassNames27({ component: "List", variant, size });
|
|
2501
|
+
return /* @__PURE__ */ React55.createElement(Component, { ...props, className: classNames2[as] }, /* @__PURE__ */ React55.createElement(ListContext.Provider, { value: { classNames: classNames2.item } }, children));
|
|
2490
2502
|
};
|
|
2491
2503
|
List.Item = ListItem;
|
|
2492
2504
|
|
|
2493
2505
|
// src/Menu/Menu.tsx
|
|
2494
|
-
import
|
|
2506
|
+
import React59, { useRef as useRef18 } from "react";
|
|
2495
2507
|
import { useMenu } from "@react-aria/menu";
|
|
2496
2508
|
import { Item as Item5, Section as Section2 } from "@react-stately/collections";
|
|
2497
2509
|
import { useTreeState as useTreeState2 } from "@react-stately/tree";
|
|
2498
2510
|
import { useSyncRef } from "@react-aria/utils";
|
|
2499
|
-
import { useClassNames as
|
|
2511
|
+
import { useClassNames as useClassNames29 } from "@marigold/system";
|
|
2500
2512
|
|
|
2501
2513
|
// src/Menu/Context.ts
|
|
2502
2514
|
import {
|
|
@@ -2507,7 +2519,7 @@ var MenuContext = createContext6({});
|
|
|
2507
2519
|
var useMenuContext = () => useContext6(MenuContext);
|
|
2508
2520
|
|
|
2509
2521
|
// src/Menu/MenuTrigger.tsx
|
|
2510
|
-
import
|
|
2522
|
+
import React56, { useRef as useRef16 } from "react";
|
|
2511
2523
|
import { useMenuTriggerState } from "@react-stately/menu";
|
|
2512
2524
|
import { PressResponder as PressResponder2 } from "@react-aria/interactions";
|
|
2513
2525
|
import { useMenuTrigger } from "@react-aria/menu";
|
|
@@ -2519,7 +2531,7 @@ var MenuTrigger = ({
|
|
|
2519
2531
|
onOpenChange,
|
|
2520
2532
|
children
|
|
2521
2533
|
}) => {
|
|
2522
|
-
const [menuTrigger, menu] =
|
|
2534
|
+
const [menuTrigger, menu] = React56.Children.toArray(children);
|
|
2523
2535
|
const menuTriggerRef = useRef16(null);
|
|
2524
2536
|
const menuRef = useObjectRef8();
|
|
2525
2537
|
const state = useMenuTriggerState({
|
|
@@ -2539,7 +2551,7 @@ var MenuTrigger = ({
|
|
|
2539
2551
|
autoFocus: state.focusStrategy
|
|
2540
2552
|
};
|
|
2541
2553
|
const isSmallScreen = useSmallScreen2();
|
|
2542
|
-
return /* @__PURE__ */
|
|
2554
|
+
return /* @__PURE__ */ React56.createElement(MenuContext.Provider, { value: menuContext }, /* @__PURE__ */ React56.createElement(
|
|
2543
2555
|
PressResponder2,
|
|
2544
2556
|
{
|
|
2545
2557
|
...menuTriggerProps,
|
|
@@ -2547,11 +2559,11 @@ var MenuTrigger = ({
|
|
|
2547
2559
|
isPressed: state.isOpen
|
|
2548
2560
|
},
|
|
2549
2561
|
menuTrigger
|
|
2550
|
-
), isSmallScreen ? /* @__PURE__ */
|
|
2562
|
+
), isSmallScreen ? /* @__PURE__ */ React56.createElement(Tray, { state }, menu) : /* @__PURE__ */ React56.createElement(Popover, { triggerRef: menuTriggerRef, scrollRef: menuRef, state }, menu));
|
|
2551
2563
|
};
|
|
2552
2564
|
|
|
2553
2565
|
// src/Menu/MenuItem.tsx
|
|
2554
|
-
import
|
|
2566
|
+
import React57, { useRef as useRef17 } from "react";
|
|
2555
2567
|
import { useFocusRing as useFocusRing8 } from "@react-aria/focus";
|
|
2556
2568
|
import { useMenuItem } from "@react-aria/menu";
|
|
2557
2569
|
import { mergeProps as mergeProps12 } from "@react-aria/utils";
|
|
@@ -2578,7 +2590,7 @@ var MenuItem = ({
|
|
|
2578
2590
|
focus: isFocusVisible
|
|
2579
2591
|
});
|
|
2580
2592
|
const { onPointerUp, ...props } = menuItemProps;
|
|
2581
|
-
return /* @__PURE__ */
|
|
2593
|
+
return /* @__PURE__ */ React57.createElement(
|
|
2582
2594
|
"li",
|
|
2583
2595
|
{
|
|
2584
2596
|
ref,
|
|
@@ -2595,16 +2607,16 @@ var MenuItem = ({
|
|
|
2595
2607
|
};
|
|
2596
2608
|
|
|
2597
2609
|
// src/Menu/MenuSection.tsx
|
|
2598
|
-
import
|
|
2610
|
+
import React58 from "react";
|
|
2599
2611
|
import { useMenuSection } from "@react-aria/menu";
|
|
2600
|
-
import { useClassNames as
|
|
2612
|
+
import { useClassNames as useClassNames28 } from "@marigold/system";
|
|
2601
2613
|
var MenuSection = ({ onAction, item, state }) => {
|
|
2602
2614
|
let { itemProps, headingProps, groupProps } = useMenuSection({
|
|
2603
2615
|
heading: item.rendered,
|
|
2604
2616
|
"aria-label": item["aria-label"]
|
|
2605
2617
|
});
|
|
2606
|
-
const className =
|
|
2607
|
-
return /* @__PURE__ */
|
|
2618
|
+
const className = useClassNames28({ component: "Menu" });
|
|
2619
|
+
return /* @__PURE__ */ React58.createElement(React58.Fragment, null, item.key !== state.collection.getFirstKey() && /* @__PURE__ */ React58.createElement("li", null, /* @__PURE__ */ React58.createElement(Divider, { variant: "section" })), /* @__PURE__ */ React58.createElement("ul", { ...itemProps }, item.rendered && /* @__PURE__ */ React58.createElement("span", { ...headingProps, className: className.section }, item.rendered), /* @__PURE__ */ React58.createElement("li", { ...groupProps, className: "pb-1" }, [...item.props.children].map((node) => /* @__PURE__ */ React58.createElement(
|
|
2608
2620
|
MenuItem,
|
|
2609
2621
|
{
|
|
2610
2622
|
key: node.key,
|
|
@@ -2625,10 +2637,10 @@ var Menu = ({ variant, size, ...props }) => {
|
|
|
2625
2637
|
const state = useTreeState2({ ...ownProps, selectionMode: "none" });
|
|
2626
2638
|
const { menuProps } = useMenu(ownProps, state, ref);
|
|
2627
2639
|
useSyncRef({ ref: scrollRef }, ref);
|
|
2628
|
-
const classNames2 =
|
|
2629
|
-
return /* @__PURE__ */
|
|
2640
|
+
const classNames2 = useClassNames29({ component: "Menu", variant, size });
|
|
2641
|
+
return /* @__PURE__ */ React59.createElement("ul", { ref, className: classNames2.container, ...menuProps }, [...state.collection].map((item) => {
|
|
2630
2642
|
if (item.type === "section") {
|
|
2631
|
-
return /* @__PURE__ */
|
|
2643
|
+
return /* @__PURE__ */ React59.createElement(
|
|
2632
2644
|
MenuSection_default,
|
|
2633
2645
|
{
|
|
2634
2646
|
key: item.key,
|
|
@@ -2638,7 +2650,7 @@ var Menu = ({ variant, size, ...props }) => {
|
|
|
2638
2650
|
}
|
|
2639
2651
|
);
|
|
2640
2652
|
}
|
|
2641
|
-
return /* @__PURE__ */
|
|
2653
|
+
return /* @__PURE__ */ React59.createElement(
|
|
2642
2654
|
MenuItem,
|
|
2643
2655
|
{
|
|
2644
2656
|
key: item.key,
|
|
@@ -2655,24 +2667,24 @@ Menu.Item = Item5;
|
|
|
2655
2667
|
Menu.Section = Section2;
|
|
2656
2668
|
|
|
2657
2669
|
// src/Menu/ActionMenu.tsx
|
|
2658
|
-
import
|
|
2670
|
+
import React60 from "react";
|
|
2659
2671
|
import { SVG as SVG5 } from "@marigold/system";
|
|
2660
2672
|
var ActionMenu = (props) => {
|
|
2661
|
-
return /* @__PURE__ */
|
|
2673
|
+
return /* @__PURE__ */ React60.createElement(Menu.Trigger, null, /* @__PURE__ */ React60.createElement(Button, { variant: "menu", size: "small" }, /* @__PURE__ */ React60.createElement(SVG5, { viewBox: "0 0 24 24" }, /* @__PURE__ */ React60.createElement("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" }))), /* @__PURE__ */ React60.createElement(Menu, { ...props }));
|
|
2662
2674
|
};
|
|
2663
2675
|
|
|
2664
2676
|
// src/Message/Message.tsx
|
|
2665
|
-
import
|
|
2666
|
-
import { cn as cn29, useClassNames as
|
|
2677
|
+
import React61 from "react";
|
|
2678
|
+
import { cn as cn29, useClassNames as useClassNames30 } from "@marigold/system";
|
|
2667
2679
|
var icons = {
|
|
2668
|
-
info: () => /* @__PURE__ */
|
|
2680
|
+
info: () => /* @__PURE__ */ React61.createElement(
|
|
2669
2681
|
"svg",
|
|
2670
2682
|
{
|
|
2671
2683
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2672
2684
|
viewBox: "0 0 24 24",
|
|
2673
2685
|
fill: "currentColor"
|
|
2674
2686
|
},
|
|
2675
|
-
/* @__PURE__ */
|
|
2687
|
+
/* @__PURE__ */ React61.createElement(
|
|
2676
2688
|
"path",
|
|
2677
2689
|
{
|
|
2678
2690
|
fillRule: "evenodd",
|
|
@@ -2681,14 +2693,14 @@ var icons = {
|
|
|
2681
2693
|
}
|
|
2682
2694
|
)
|
|
2683
2695
|
),
|
|
2684
|
-
warning: () => /* @__PURE__ */
|
|
2696
|
+
warning: () => /* @__PURE__ */ React61.createElement(
|
|
2685
2697
|
"svg",
|
|
2686
2698
|
{
|
|
2687
2699
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2688
2700
|
viewBox: "0 0 24 24",
|
|
2689
2701
|
fill: "currentColor"
|
|
2690
2702
|
},
|
|
2691
|
-
/* @__PURE__ */
|
|
2703
|
+
/* @__PURE__ */ React61.createElement(
|
|
2692
2704
|
"path",
|
|
2693
2705
|
{
|
|
2694
2706
|
fillRule: "evenodd",
|
|
@@ -2697,14 +2709,14 @@ var icons = {
|
|
|
2697
2709
|
}
|
|
2698
2710
|
)
|
|
2699
2711
|
),
|
|
2700
|
-
error: () => /* @__PURE__ */
|
|
2712
|
+
error: () => /* @__PURE__ */ React61.createElement(
|
|
2701
2713
|
"svg",
|
|
2702
2714
|
{
|
|
2703
2715
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2704
2716
|
viewBox: "0 0 24 24",
|
|
2705
2717
|
fill: "currentColor"
|
|
2706
2718
|
},
|
|
2707
|
-
/* @__PURE__ */
|
|
2719
|
+
/* @__PURE__ */ React61.createElement(
|
|
2708
2720
|
"path",
|
|
2709
2721
|
{
|
|
2710
2722
|
fillRule: "evenodd",
|
|
@@ -2721,9 +2733,9 @@ var Message = ({
|
|
|
2721
2733
|
children,
|
|
2722
2734
|
...props
|
|
2723
2735
|
}) => {
|
|
2724
|
-
const classNames2 =
|
|
2736
|
+
const classNames2 = useClassNames30({ component: "Message", variant, size });
|
|
2725
2737
|
const Icon3 = icons[variant];
|
|
2726
|
-
return /* @__PURE__ */
|
|
2738
|
+
return /* @__PURE__ */ React61.createElement(
|
|
2727
2739
|
"div",
|
|
2728
2740
|
{
|
|
2729
2741
|
className: cn29(
|
|
@@ -2732,35 +2744,35 @@ var Message = ({
|
|
|
2732
2744
|
),
|
|
2733
2745
|
...props
|
|
2734
2746
|
},
|
|
2735
|
-
/* @__PURE__ */
|
|
2736
|
-
/* @__PURE__ */
|
|
2747
|
+
/* @__PURE__ */ React61.createElement("div", { className: cn29("col-span-1 h-5 w-5 self-center", classNames2.icon) }, /* @__PURE__ */ React61.createElement(Icon3, null)),
|
|
2748
|
+
/* @__PURE__ */ React61.createElement(
|
|
2737
2749
|
"div",
|
|
2738
2750
|
{
|
|
2739
2751
|
className: cn29("col-start-2 row-start-1 self-center", classNames2.title)
|
|
2740
2752
|
},
|
|
2741
2753
|
messageTitle
|
|
2742
2754
|
),
|
|
2743
|
-
/* @__PURE__ */
|
|
2755
|
+
/* @__PURE__ */ React61.createElement("div", { className: cn29("col-start-2", classNames2.content) }, children)
|
|
2744
2756
|
);
|
|
2745
2757
|
};
|
|
2746
2758
|
|
|
2747
2759
|
// src/NumberField/NumberField.tsx
|
|
2748
|
-
import
|
|
2760
|
+
import React63, { forwardRef as forwardRef12 } from "react";
|
|
2749
2761
|
import { useFocusRing as useFocusRing9 } from "@react-aria/focus";
|
|
2750
2762
|
import { useHover as useHover7 } from "@react-aria/interactions";
|
|
2751
2763
|
import { useLocale as useLocale4 } from "@react-aria/i18n";
|
|
2752
2764
|
import { useNumberField } from "@react-aria/numberfield";
|
|
2753
2765
|
import { mergeProps as mergeProps14, useObjectRef as useObjectRef9 } from "@react-aria/utils";
|
|
2754
2766
|
import { useNumberFieldState } from "@react-stately/numberfield";
|
|
2755
|
-
import { cn as cn31, useClassNames as
|
|
2767
|
+
import { cn as cn31, useClassNames as useClassNames31, useStateProps as useStateProps15 } from "@marigold/system";
|
|
2756
2768
|
|
|
2757
2769
|
// src/NumberField/StepButton.tsx
|
|
2758
|
-
import
|
|
2770
|
+
import React62, { useRef as useRef19 } from "react";
|
|
2759
2771
|
import { useButton as useButton7 } from "@react-aria/button";
|
|
2760
2772
|
import { useHover as useHover6 } from "@react-aria/interactions";
|
|
2761
2773
|
import { mergeProps as mergeProps13 } from "@react-aria/utils";
|
|
2762
2774
|
import { cn as cn30, useStateProps as useStateProps14 } from "@marigold/system";
|
|
2763
|
-
var Plus = () => /* @__PURE__ */
|
|
2775
|
+
var Plus = () => /* @__PURE__ */ React62.createElement("svg", { width: 16, height: 16, viewBox: "0 0 20 20", fill: "currentColor" }, /* @__PURE__ */ React62.createElement(
|
|
2764
2776
|
"path",
|
|
2765
2777
|
{
|
|
2766
2778
|
fillRule: "evenodd",
|
|
@@ -2768,7 +2780,7 @@ var Plus = () => /* @__PURE__ */ React61.createElement("svg", { width: 16, heigh
|
|
|
2768
2780
|
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"
|
|
2769
2781
|
}
|
|
2770
2782
|
));
|
|
2771
|
-
var Minus = () => /* @__PURE__ */
|
|
2783
|
+
var Minus = () => /* @__PURE__ */ React62.createElement("svg", { width: 16, height: 16, viewBox: "0 0 20 20", fill: "currentColor" }, /* @__PURE__ */ React62.createElement(
|
|
2772
2784
|
"path",
|
|
2773
2785
|
{
|
|
2774
2786
|
fillRule: "evenodd",
|
|
@@ -2793,7 +2805,7 @@ var StepButton = ({
|
|
|
2793
2805
|
disabled: props.isDisabled
|
|
2794
2806
|
});
|
|
2795
2807
|
const Icon3 = direction === "up" ? Plus : Minus;
|
|
2796
|
-
return /* @__PURE__ */
|
|
2808
|
+
return /* @__PURE__ */ React62.createElement(
|
|
2797
2809
|
"div",
|
|
2798
2810
|
{
|
|
2799
2811
|
className: cn30(
|
|
@@ -2806,7 +2818,7 @@ var StepButton = ({
|
|
|
2806
2818
|
...mergeProps13(buttonProps, hoverProps),
|
|
2807
2819
|
...stateProps
|
|
2808
2820
|
},
|
|
2809
|
-
/* @__PURE__ */
|
|
2821
|
+
/* @__PURE__ */ React62.createElement(Icon3, null)
|
|
2810
2822
|
);
|
|
2811
2823
|
};
|
|
2812
2824
|
|
|
@@ -2857,12 +2869,12 @@ var NumberField = forwardRef12(
|
|
|
2857
2869
|
readOnly,
|
|
2858
2870
|
required
|
|
2859
2871
|
});
|
|
2860
|
-
const classNames2 =
|
|
2872
|
+
const classNames2 = useClassNames31({
|
|
2861
2873
|
component: "NumberField",
|
|
2862
2874
|
size,
|
|
2863
2875
|
variant
|
|
2864
2876
|
});
|
|
2865
|
-
return /* @__PURE__ */
|
|
2877
|
+
return /* @__PURE__ */ React63.createElement(
|
|
2866
2878
|
FieldBase,
|
|
2867
2879
|
{
|
|
2868
2880
|
label: props.label,
|
|
@@ -2877,7 +2889,7 @@ var NumberField = forwardRef12(
|
|
|
2877
2889
|
size,
|
|
2878
2890
|
width
|
|
2879
2891
|
},
|
|
2880
|
-
/* @__PURE__ */
|
|
2892
|
+
/* @__PURE__ */ React63.createElement(
|
|
2881
2893
|
"div",
|
|
2882
2894
|
{
|
|
2883
2895
|
"data-group": true,
|
|
@@ -2886,7 +2898,7 @@ var NumberField = forwardRef12(
|
|
|
2886
2898
|
...mergeProps14(groupProps, focusProps, hoverProps),
|
|
2887
2899
|
...stateProps
|
|
2888
2900
|
},
|
|
2889
|
-
showStepper && /* @__PURE__ */
|
|
2901
|
+
showStepper && /* @__PURE__ */ React63.createElement(
|
|
2890
2902
|
StepButton,
|
|
2891
2903
|
{
|
|
2892
2904
|
className: classNames2.stepper,
|
|
@@ -2894,7 +2906,7 @@ var NumberField = forwardRef12(
|
|
|
2894
2906
|
...decrementButtonProps
|
|
2895
2907
|
}
|
|
2896
2908
|
),
|
|
2897
|
-
/* @__PURE__ */
|
|
2909
|
+
/* @__PURE__ */ React63.createElement("div", { className: "flex-1" }, /* @__PURE__ */ React63.createElement(
|
|
2898
2910
|
Input,
|
|
2899
2911
|
{
|
|
2900
2912
|
ref: inputRef,
|
|
@@ -2907,7 +2919,7 @@ var NumberField = forwardRef12(
|
|
|
2907
2919
|
...stateProps
|
|
2908
2920
|
}
|
|
2909
2921
|
)),
|
|
2910
|
-
showStepper && /* @__PURE__ */
|
|
2922
|
+
showStepper && /* @__PURE__ */ React63.createElement(
|
|
2911
2923
|
StepButton,
|
|
2912
2924
|
{
|
|
2913
2925
|
className: classNames2.stepper,
|
|
@@ -2924,7 +2936,7 @@ var NumberField = forwardRef12(
|
|
|
2924
2936
|
import { useTheme as useTheme4, ThemeProvider as ThemeProvider2 } from "@marigold/system";
|
|
2925
2937
|
|
|
2926
2938
|
// src/Provider/MarigoldProvider.tsx
|
|
2927
|
-
import
|
|
2939
|
+
import React64 from "react";
|
|
2928
2940
|
import { OverlayProvider } from "@react-aria/overlays";
|
|
2929
2941
|
import {
|
|
2930
2942
|
ThemeProvider,
|
|
@@ -2937,11 +2949,11 @@ function MarigoldProvider({
|
|
|
2937
2949
|
}) {
|
|
2938
2950
|
const outerTheme = useTheme3();
|
|
2939
2951
|
const isTopLevel = outerTheme === defaultTheme;
|
|
2940
|
-
return /* @__PURE__ */
|
|
2952
|
+
return /* @__PURE__ */ React64.createElement(ThemeProvider, { theme }, isTopLevel ? /* @__PURE__ */ React64.createElement(OverlayProvider, null, children) : children);
|
|
2941
2953
|
}
|
|
2942
2954
|
|
|
2943
2955
|
// src/Radio/Radio.tsx
|
|
2944
|
-
import
|
|
2956
|
+
import React66, {
|
|
2945
2957
|
forwardRef as forwardRef13
|
|
2946
2958
|
} from "react";
|
|
2947
2959
|
import { useHover as useHover8 } from "@react-aria/interactions";
|
|
@@ -2950,7 +2962,7 @@ import { useRadio } from "@react-aria/radio";
|
|
|
2950
2962
|
import { mergeProps as mergeProps15, useObjectRef as useObjectRef10 } from "@react-aria/utils";
|
|
2951
2963
|
import {
|
|
2952
2964
|
cn as cn33,
|
|
2953
|
-
useClassNames as
|
|
2965
|
+
useClassNames as useClassNames32,
|
|
2954
2966
|
useStateProps as useStateProps17
|
|
2955
2967
|
} from "@marigold/system";
|
|
2956
2968
|
|
|
@@ -2962,7 +2974,7 @@ var RadioGroupContext = createContext7(
|
|
|
2962
2974
|
var useRadioGroupContext = () => useContext7(RadioGroupContext);
|
|
2963
2975
|
|
|
2964
2976
|
// src/Radio/RadioGroup.tsx
|
|
2965
|
-
import
|
|
2977
|
+
import React65 from "react";
|
|
2966
2978
|
import { useRadioGroup } from "@react-aria/radio";
|
|
2967
2979
|
import { useRadioGroupState } from "@react-stately/radio";
|
|
2968
2980
|
import { cn as cn32, useStateProps as useStateProps16 } from "@marigold/system";
|
|
@@ -2991,7 +3003,7 @@ var RadioGroup = ({
|
|
|
2991
3003
|
error,
|
|
2992
3004
|
required
|
|
2993
3005
|
});
|
|
2994
|
-
return /* @__PURE__ */
|
|
3006
|
+
return /* @__PURE__ */ React65.createElement(
|
|
2995
3007
|
FieldBase,
|
|
2996
3008
|
{
|
|
2997
3009
|
width,
|
|
@@ -3006,7 +3018,7 @@ var RadioGroup = ({
|
|
|
3006
3018
|
stateProps,
|
|
3007
3019
|
...radioGroupProps
|
|
3008
3020
|
},
|
|
3009
|
-
/* @__PURE__ */
|
|
3021
|
+
/* @__PURE__ */ React65.createElement(
|
|
3010
3022
|
"div",
|
|
3011
3023
|
{
|
|
3012
3024
|
role: "presentation",
|
|
@@ -3016,14 +3028,14 @@ var RadioGroup = ({
|
|
|
3016
3028
|
orientation === "vertical" ? "flex-col gap-[0.5ch]" : "flex-row gap-[1.5ch]"
|
|
3017
3029
|
)
|
|
3018
3030
|
},
|
|
3019
|
-
/* @__PURE__ */
|
|
3031
|
+
/* @__PURE__ */ React65.createElement(RadioGroupContext.Provider, { value: { width, error, state } }, children)
|
|
3020
3032
|
)
|
|
3021
3033
|
);
|
|
3022
3034
|
};
|
|
3023
3035
|
|
|
3024
3036
|
// src/Radio/Radio.tsx
|
|
3025
|
-
var Dot = () => /* @__PURE__ */
|
|
3026
|
-
var Icon2 = ({ checked, className, ...props }) => /* @__PURE__ */
|
|
3037
|
+
var Dot = () => /* @__PURE__ */ React66.createElement("svg", { viewBox: "0 0 6 6" }, /* @__PURE__ */ React66.createElement("circle", { fill: "currentColor", cx: "3", cy: "3", r: "3" }));
|
|
3038
|
+
var Icon2 = ({ checked, className, ...props }) => /* @__PURE__ */ React66.createElement(
|
|
3027
3039
|
"div",
|
|
3028
3040
|
{
|
|
3029
3041
|
className: cn33(
|
|
@@ -3033,7 +3045,7 @@ var Icon2 = ({ checked, className, ...props }) => /* @__PURE__ */ React65.create
|
|
|
3033
3045
|
"aria-hidden": "true",
|
|
3034
3046
|
...props
|
|
3035
3047
|
},
|
|
3036
|
-
checked ? /* @__PURE__ */
|
|
3048
|
+
checked ? /* @__PURE__ */ React66.createElement(Dot, null) : null
|
|
3037
3049
|
);
|
|
3038
3050
|
var Radio = forwardRef13(
|
|
3039
3051
|
({ width, disabled, ...props }, ref) => {
|
|
@@ -3050,7 +3062,7 @@ var Radio = forwardRef13(
|
|
|
3050
3062
|
state,
|
|
3051
3063
|
inputRef
|
|
3052
3064
|
);
|
|
3053
|
-
const classNames2 =
|
|
3065
|
+
const classNames2 = useClassNames32({
|
|
3054
3066
|
component: "Radio",
|
|
3055
3067
|
variant: variant || props.variant,
|
|
3056
3068
|
size: size || props.size
|
|
@@ -3065,7 +3077,7 @@ var Radio = forwardRef13(
|
|
|
3065
3077
|
readOnly: props.readOnly,
|
|
3066
3078
|
error
|
|
3067
3079
|
});
|
|
3068
|
-
return /* @__PURE__ */
|
|
3080
|
+
return /* @__PURE__ */ React66.createElement(
|
|
3069
3081
|
"label",
|
|
3070
3082
|
{
|
|
3071
3083
|
className: cn33(
|
|
@@ -3076,7 +3088,7 @@ var Radio = forwardRef13(
|
|
|
3076
3088
|
),
|
|
3077
3089
|
...mergeProps15(hoverProps, stateProps)
|
|
3078
3090
|
},
|
|
3079
|
-
/* @__PURE__ */
|
|
3091
|
+
/* @__PURE__ */ React66.createElement(
|
|
3080
3092
|
"input",
|
|
3081
3093
|
{
|
|
3082
3094
|
ref: inputRef,
|
|
@@ -3087,23 +3099,23 @@ var Radio = forwardRef13(
|
|
|
3087
3099
|
...mergeProps15(inputProps, focusProps)
|
|
3088
3100
|
}
|
|
3089
3101
|
),
|
|
3090
|
-
/* @__PURE__ */
|
|
3091
|
-
/* @__PURE__ */
|
|
3102
|
+
/* @__PURE__ */ React66.createElement(Icon2, { checked: inputProps.checked, className: classNames2.radio }),
|
|
3103
|
+
/* @__PURE__ */ React66.createElement("div", { className: classNames2.label }, props.children)
|
|
3092
3104
|
);
|
|
3093
3105
|
}
|
|
3094
3106
|
);
|
|
3095
3107
|
Radio.Group = RadioGroup;
|
|
3096
3108
|
|
|
3097
3109
|
// src/Slider/Slider.tsx
|
|
3098
|
-
import
|
|
3110
|
+
import React68, { forwardRef as forwardRef14 } from "react";
|
|
3099
3111
|
import { useSlider } from "@react-aria/slider";
|
|
3100
3112
|
import { useSliderState } from "@react-stately/slider";
|
|
3101
3113
|
import { useNumberFormatter } from "@react-aria/i18n";
|
|
3102
3114
|
import { useObjectRef as useObjectRef11 } from "@react-aria/utils";
|
|
3103
|
-
import { cn as cn35, createVar as
|
|
3115
|
+
import { cn as cn35, createVar as createVar10, useClassNames as useClassNames33, useStateProps as useStateProps19 } from "@marigold/system";
|
|
3104
3116
|
|
|
3105
3117
|
// src/Slider/Thumb.tsx
|
|
3106
|
-
import
|
|
3118
|
+
import React67, { useEffect } from "react";
|
|
3107
3119
|
import { useSliderThumb } from "@react-aria/slider";
|
|
3108
3120
|
import { mergeProps as mergeProps16 } from "@react-aria/utils";
|
|
3109
3121
|
import { cn as cn34, useStateProps as useStateProps18 } from "@marigold/system";
|
|
@@ -3115,7 +3127,7 @@ import { VisuallyHidden } from "@react-aria/visually-hidden";
|
|
|
3115
3127
|
import { useFocusRing as useFocusRing11 } from "@react-aria/focus";
|
|
3116
3128
|
var Thumb = ({ state, trackRef, className, ...props }) => {
|
|
3117
3129
|
const { disabled } = props;
|
|
3118
|
-
const inputRef =
|
|
3130
|
+
const inputRef = React67.useRef(null);
|
|
3119
3131
|
const { isFocusVisible, focusProps, isFocused } = useFocusRing11();
|
|
3120
3132
|
const focused = isFocused || isFocusVisible || state.isThumbDragging(0);
|
|
3121
3133
|
const stateProps = useStateProps18({
|
|
@@ -3134,7 +3146,7 @@ var Thumb = ({ state, trackRef, className, ...props }) => {
|
|
|
3134
3146
|
useEffect(() => {
|
|
3135
3147
|
state.setThumbEditable(0, !disabled);
|
|
3136
3148
|
}, [disabled, state]);
|
|
3137
|
-
return /* @__PURE__ */
|
|
3149
|
+
return /* @__PURE__ */ React67.createElement("div", { className: cn34("top-1/2", className), ...thumbProps, ...stateProps }, /* @__PURE__ */ React67.createElement(VisuallyHidden, null, /* @__PURE__ */ React67.createElement(
|
|
3138
3150
|
"input",
|
|
3139
3151
|
{
|
|
3140
3152
|
type: "range",
|
|
@@ -3159,7 +3171,7 @@ var Slider = forwardRef14(
|
|
|
3159
3171
|
state,
|
|
3160
3172
|
trackRef
|
|
3161
3173
|
);
|
|
3162
|
-
const classNames2 =
|
|
3174
|
+
const classNames2 = useClassNames33({
|
|
3163
3175
|
component: "Slider",
|
|
3164
3176
|
variant,
|
|
3165
3177
|
size
|
|
@@ -3167,14 +3179,14 @@ var Slider = forwardRef14(
|
|
|
3167
3179
|
const sliderState = useStateProps19({
|
|
3168
3180
|
disabled: props.disabled
|
|
3169
3181
|
});
|
|
3170
|
-
return /* @__PURE__ */
|
|
3182
|
+
return /* @__PURE__ */ React68.createElement(
|
|
3171
3183
|
"div",
|
|
3172
3184
|
{
|
|
3173
3185
|
className: "flex w-[var(--slideWidth)] touch-none flex-col",
|
|
3174
|
-
style:
|
|
3186
|
+
style: createVar10({ slideWidth: width }),
|
|
3175
3187
|
...groupProps
|
|
3176
3188
|
},
|
|
3177
|
-
/* @__PURE__ */
|
|
3189
|
+
/* @__PURE__ */ React68.createElement("div", { className: "flex self-stretch" }, props.children && /* @__PURE__ */ React68.createElement("label", { className: classNames2.label, ...labelProps }, props.children), /* @__PURE__ */ React68.createElement(
|
|
3178
3190
|
"output",
|
|
3179
3191
|
{
|
|
3180
3192
|
className: cn35(
|
|
@@ -3185,7 +3197,7 @@ var Slider = forwardRef14(
|
|
|
3185
3197
|
},
|
|
3186
3198
|
state.getThumbValueLabel(0)
|
|
3187
3199
|
)),
|
|
3188
|
-
/* @__PURE__ */
|
|
3200
|
+
/* @__PURE__ */ React68.createElement(
|
|
3189
3201
|
"div",
|
|
3190
3202
|
{
|
|
3191
3203
|
className: "h-8 w-full cursor-pointer data-[disabled]:cursor-not-allowed",
|
|
@@ -3193,7 +3205,7 @@ var Slider = forwardRef14(
|
|
|
3193
3205
|
...sliderState,
|
|
3194
3206
|
ref: trackRef
|
|
3195
3207
|
},
|
|
3196
|
-
/* @__PURE__ */
|
|
3208
|
+
/* @__PURE__ */ React68.createElement(
|
|
3197
3209
|
"div",
|
|
3198
3210
|
{
|
|
3199
3211
|
className: cn35(
|
|
@@ -3202,7 +3214,7 @@ var Slider = forwardRef14(
|
|
|
3202
3214
|
)
|
|
3203
3215
|
}
|
|
3204
3216
|
),
|
|
3205
|
-
/* @__PURE__ */
|
|
3217
|
+
/* @__PURE__ */ React68.createElement(
|
|
3206
3218
|
Thumb,
|
|
3207
3219
|
{
|
|
3208
3220
|
state,
|
|
@@ -3217,11 +3229,11 @@ var Slider = forwardRef14(
|
|
|
3217
3229
|
);
|
|
3218
3230
|
|
|
3219
3231
|
// src/Split/Split.tsx
|
|
3220
|
-
import
|
|
3221
|
-
var Split = (props) => /* @__PURE__ */
|
|
3232
|
+
import React69 from "react";
|
|
3233
|
+
var Split = (props) => /* @__PURE__ */ React69.createElement("div", { ...props, role: "separator", className: "grow" });
|
|
3222
3234
|
|
|
3223
3235
|
// src/Stack/Stack.tsx
|
|
3224
|
-
import
|
|
3236
|
+
import React70 from "react";
|
|
3225
3237
|
import {
|
|
3226
3238
|
cn as cn36,
|
|
3227
3239
|
gapSpace as gapSpace6,
|
|
@@ -3237,7 +3249,7 @@ var Stack = ({
|
|
|
3237
3249
|
...props
|
|
3238
3250
|
}) => {
|
|
3239
3251
|
var _a, _b, _c, _d;
|
|
3240
|
-
return /* @__PURE__ */
|
|
3252
|
+
return /* @__PURE__ */ React70.createElement(
|
|
3241
3253
|
"div",
|
|
3242
3254
|
{
|
|
3243
3255
|
className: cn36(
|
|
@@ -3254,12 +3266,12 @@ var Stack = ({
|
|
|
3254
3266
|
};
|
|
3255
3267
|
|
|
3256
3268
|
// src/Switch/Switch.tsx
|
|
3257
|
-
import
|
|
3269
|
+
import React71, { forwardRef as forwardRef15 } from "react";
|
|
3258
3270
|
import { useFocusRing as useFocusRing12 } from "@react-aria/focus";
|
|
3259
3271
|
import { useSwitch } from "@react-aria/switch";
|
|
3260
3272
|
import { useObjectRef as useObjectRef12 } from "@react-aria/utils";
|
|
3261
3273
|
import { useToggleState as useToggleState2 } from "@react-stately/toggle";
|
|
3262
|
-
import { cn as cn37, createVar as
|
|
3274
|
+
import { cn as cn37, createVar as createVar11, useStateProps as useStateProps20, useClassNames as useClassNames34 } from "@marigold/system";
|
|
3263
3275
|
var Switch = forwardRef15(
|
|
3264
3276
|
({
|
|
3265
3277
|
variant,
|
|
@@ -3288,8 +3300,8 @@ var Switch = forwardRef15(
|
|
|
3288
3300
|
readOnly,
|
|
3289
3301
|
focus: isFocusVisible
|
|
3290
3302
|
});
|
|
3291
|
-
const classNames2 =
|
|
3292
|
-
return /* @__PURE__ */
|
|
3303
|
+
const classNames2 = useClassNames34({ component: "Switch", size, variant });
|
|
3304
|
+
return /* @__PURE__ */ React71.createElement(
|
|
3293
3305
|
"label",
|
|
3294
3306
|
{
|
|
3295
3307
|
className: cn37(
|
|
@@ -3297,10 +3309,10 @@ var Switch = forwardRef15(
|
|
|
3297
3309
|
"w-[var(--switchWidth)]",
|
|
3298
3310
|
"relative flex items-center justify-between gap-[1ch]"
|
|
3299
3311
|
),
|
|
3300
|
-
style:
|
|
3312
|
+
style: createVar11({ switchWidth: width }),
|
|
3301
3313
|
...stateProps
|
|
3302
3314
|
},
|
|
3303
|
-
/* @__PURE__ */
|
|
3315
|
+
/* @__PURE__ */ React71.createElement(
|
|
3304
3316
|
"input",
|
|
3305
3317
|
{
|
|
3306
3318
|
ref: inputRef,
|
|
@@ -3309,8 +3321,8 @@ var Switch = forwardRef15(
|
|
|
3309
3321
|
...focusProps
|
|
3310
3322
|
}
|
|
3311
3323
|
),
|
|
3312
|
-
props.children && /* @__PURE__ */
|
|
3313
|
-
/* @__PURE__ */
|
|
3324
|
+
props.children && /* @__PURE__ */ React71.createElement(React71.Fragment, null, props.children),
|
|
3325
|
+
/* @__PURE__ */ React71.createElement(
|
|
3314
3326
|
"div",
|
|
3315
3327
|
{
|
|
3316
3328
|
className: cn37(
|
|
@@ -3318,7 +3330,7 @@ var Switch = forwardRef15(
|
|
|
3318
3330
|
classNames2.track
|
|
3319
3331
|
)
|
|
3320
3332
|
},
|
|
3321
|
-
/* @__PURE__ */
|
|
3333
|
+
/* @__PURE__ */ React71.createElement(
|
|
3322
3334
|
"div",
|
|
3323
3335
|
{
|
|
3324
3336
|
className: cn37(
|
|
@@ -3337,17 +3349,17 @@ var Switch = forwardRef15(
|
|
|
3337
3349
|
);
|
|
3338
3350
|
|
|
3339
3351
|
// src/Table/Table.tsx
|
|
3340
|
-
import
|
|
3352
|
+
import React80, { useRef as useRef26 } from "react";
|
|
3341
3353
|
import { useTable } from "@react-aria/table";
|
|
3342
3354
|
import {
|
|
3355
|
+
TableBody as Body2,
|
|
3343
3356
|
Cell,
|
|
3344
3357
|
Column,
|
|
3345
|
-
Row,
|
|
3346
|
-
TableBody as Body2,
|
|
3347
3358
|
TableHeader as Header2,
|
|
3359
|
+
Row,
|
|
3348
3360
|
useTableState
|
|
3349
3361
|
} from "@react-stately/table";
|
|
3350
|
-
import { cn as cn42, useClassNames as
|
|
3362
|
+
import { cn as cn42, useClassNames as useClassNames36 } from "@marigold/system";
|
|
3351
3363
|
|
|
3352
3364
|
// src/Table/Context.tsx
|
|
3353
3365
|
import { createContext as createContext8, useContext as useContext8 } from "react";
|
|
@@ -3355,15 +3367,15 @@ var TableContext = createContext8({});
|
|
|
3355
3367
|
var useTableContext = () => useContext8(TableContext);
|
|
3356
3368
|
|
|
3357
3369
|
// src/Table/TableBody.tsx
|
|
3358
|
-
import
|
|
3370
|
+
import React72 from "react";
|
|
3359
3371
|
import { useTableRowGroup } from "@react-aria/table";
|
|
3360
3372
|
var TableBody = ({ children }) => {
|
|
3361
3373
|
const { rowGroupProps } = useTableRowGroup();
|
|
3362
|
-
return /* @__PURE__ */
|
|
3374
|
+
return /* @__PURE__ */ React72.createElement("tbody", { ...rowGroupProps }, children);
|
|
3363
3375
|
};
|
|
3364
3376
|
|
|
3365
3377
|
// src/Table/TableCell.tsx
|
|
3366
|
-
import
|
|
3378
|
+
import React73, { useRef as useRef20 } from "react";
|
|
3367
3379
|
import { useTableCell } from "@react-aria/table";
|
|
3368
3380
|
import { useFocusRing as useFocusRing13 } from "@react-aria/focus";
|
|
3369
3381
|
import { mergeProps as mergeProps17 } from "@react-aria/utils";
|
|
@@ -3390,7 +3402,7 @@ var TableCell = ({ cell }) => {
|
|
|
3390
3402
|
};
|
|
3391
3403
|
const { focusProps, isFocusVisible } = useFocusRing13();
|
|
3392
3404
|
const stateProps = useStateProps21({ disabled, focusVisible: isFocusVisible });
|
|
3393
|
-
return /* @__PURE__ */
|
|
3405
|
+
return /* @__PURE__ */ React73.createElement(
|
|
3394
3406
|
"td",
|
|
3395
3407
|
{
|
|
3396
3408
|
ref,
|
|
@@ -3403,7 +3415,7 @@ var TableCell = ({ cell }) => {
|
|
|
3403
3415
|
};
|
|
3404
3416
|
|
|
3405
3417
|
// src/Table/TableCheckboxCell.tsx
|
|
3406
|
-
import
|
|
3418
|
+
import React74, { useRef as useRef21 } from "react";
|
|
3407
3419
|
import { useTableCell as useTableCell2, useTableSelectionCheckbox } from "@react-aria/table";
|
|
3408
3420
|
import { useFocusRing as useFocusRing14 } from "@react-aria/focus";
|
|
3409
3421
|
import { mergeProps as mergeProps18 } from "@react-aria/utils";
|
|
@@ -3446,7 +3458,7 @@ var TableCheckboxCell = ({ cell }) => {
|
|
|
3446
3458
|
);
|
|
3447
3459
|
const { focusProps, isFocusVisible } = useFocusRing14();
|
|
3448
3460
|
const stateProps = useStateProps22({ disabled, focusVisible: isFocusVisible });
|
|
3449
|
-
return /* @__PURE__ */
|
|
3461
|
+
return /* @__PURE__ */ React74.createElement(
|
|
3450
3462
|
"td",
|
|
3451
3463
|
{
|
|
3452
3464
|
ref,
|
|
@@ -3454,22 +3466,23 @@ var TableCheckboxCell = ({ cell }) => {
|
|
|
3454
3466
|
...mergeProps18(gridCellProps, focusProps),
|
|
3455
3467
|
...stateProps
|
|
3456
3468
|
},
|
|
3457
|
-
/* @__PURE__ */
|
|
3469
|
+
/* @__PURE__ */ React74.createElement(Checkbox, { ...checkboxProps })
|
|
3458
3470
|
);
|
|
3459
3471
|
};
|
|
3460
3472
|
|
|
3461
3473
|
// src/Table/TableColumnHeader.tsx
|
|
3462
|
-
import
|
|
3474
|
+
import React75, { useRef as useRef22 } from "react";
|
|
3463
3475
|
import { useFocusRing as useFocusRing15 } from "@react-aria/focus";
|
|
3464
3476
|
import { useHover as useHover9 } from "@react-aria/interactions";
|
|
3465
3477
|
import { useTableColumnHeader } from "@react-aria/table";
|
|
3466
3478
|
import { mergeProps as mergeProps19 } from "@react-aria/utils";
|
|
3467
3479
|
import { cn as cn39, useStateProps as useStateProps23 } from "@marigold/system";
|
|
3480
|
+
import { width as twWidth2 } from "@marigold/system";
|
|
3468
3481
|
var SortIndicator = ({
|
|
3469
3482
|
direction = "ascending",
|
|
3470
3483
|
visible
|
|
3471
3484
|
}) => {
|
|
3472
|
-
return /* @__PURE__ */
|
|
3485
|
+
return /* @__PURE__ */ React75.createElement(
|
|
3473
3486
|
"span",
|
|
3474
3487
|
{
|
|
3475
3488
|
role: "presentation",
|
|
@@ -3482,7 +3495,10 @@ var SortIndicator = ({
|
|
|
3482
3495
|
direction === "ascending" ? "\u25B2" : "\u25BC"
|
|
3483
3496
|
);
|
|
3484
3497
|
};
|
|
3485
|
-
var TableColumnHeader = ({
|
|
3498
|
+
var TableColumnHeader = ({
|
|
3499
|
+
column,
|
|
3500
|
+
width = "auto"
|
|
3501
|
+
}) => {
|
|
3486
3502
|
var _a, _b;
|
|
3487
3503
|
const ref = useRef22(null);
|
|
3488
3504
|
const { state, classNames: classNames2 } = useTableContext();
|
|
@@ -3499,17 +3515,17 @@ var TableColumnHeader = ({ column }) => {
|
|
|
3499
3515
|
hover: isHovered,
|
|
3500
3516
|
focusVisible: isFocusVisible
|
|
3501
3517
|
});
|
|
3502
|
-
return /* @__PURE__ */
|
|
3518
|
+
return /* @__PURE__ */ React75.createElement(
|
|
3503
3519
|
"th",
|
|
3504
3520
|
{
|
|
3505
3521
|
colSpan: column.colspan,
|
|
3506
3522
|
ref,
|
|
3507
|
-
className: cn39("cursor-default", classNames2 == null ? void 0 : classNames2.header),
|
|
3523
|
+
className: cn39("cursor-default", twWidth2[width], classNames2 == null ? void 0 : classNames2.header),
|
|
3508
3524
|
...mergeProps19(columnHeaderProps, hoverProps, focusProps),
|
|
3509
3525
|
...stateProps
|
|
3510
3526
|
},
|
|
3511
3527
|
column.rendered,
|
|
3512
|
-
column.props.allowsSorting && /* @__PURE__ */
|
|
3528
|
+
column.props.allowsSorting && /* @__PURE__ */ React75.createElement(
|
|
3513
3529
|
SortIndicator,
|
|
3514
3530
|
{
|
|
3515
3531
|
direction: (_a = state.sortDescriptor) == null ? void 0 : _a.direction,
|
|
@@ -3520,35 +3536,35 @@ var TableColumnHeader = ({ column }) => {
|
|
|
3520
3536
|
};
|
|
3521
3537
|
|
|
3522
3538
|
// src/Table/TableHeader.tsx
|
|
3523
|
-
import
|
|
3539
|
+
import React76 from "react";
|
|
3524
3540
|
import { useTableRowGroup as useTableRowGroup2 } from "@react-aria/table";
|
|
3525
3541
|
var TableHeader = ({ children }) => {
|
|
3526
3542
|
const { rowGroupProps } = useTableRowGroup2();
|
|
3527
|
-
return /* @__PURE__ */
|
|
3543
|
+
return /* @__PURE__ */ React76.createElement("thead", { ...rowGroupProps }, children);
|
|
3528
3544
|
};
|
|
3529
3545
|
|
|
3530
3546
|
// src/Table/TableHeaderRow.tsx
|
|
3531
|
-
import
|
|
3547
|
+
import React77, { useRef as useRef23 } from "react";
|
|
3532
3548
|
import { useTableHeaderRow } from "@react-aria/table";
|
|
3533
3549
|
var TableHeaderRow = ({ item, children }) => {
|
|
3534
3550
|
const { state } = useTableContext();
|
|
3535
3551
|
const ref = useRef23(null);
|
|
3536
3552
|
const { rowProps } = useTableHeaderRow({ node: item }, state, ref);
|
|
3537
|
-
return /* @__PURE__ */
|
|
3553
|
+
return /* @__PURE__ */ React77.createElement("tr", { ...rowProps, ref }, children);
|
|
3538
3554
|
};
|
|
3539
3555
|
|
|
3540
3556
|
// src/Table/TableRow.tsx
|
|
3541
|
-
import
|
|
3557
|
+
import React78, { useRef as useRef24 } from "react";
|
|
3542
3558
|
import { useFocusRing as useFocusRing16 } from "@react-aria/focus";
|
|
3543
3559
|
import { useHover as useHover10 } from "@react-aria/interactions";
|
|
3544
3560
|
import { useTableRow } from "@react-aria/table";
|
|
3545
3561
|
import { mergeProps as mergeProps20 } from "@react-aria/utils";
|
|
3546
|
-
import { cn as cn40, useClassNames as
|
|
3562
|
+
import { cn as cn40, useClassNames as useClassNames35, useStateProps as useStateProps24 } from "@marigold/system";
|
|
3547
3563
|
var TableRow = ({ children, row }) => {
|
|
3548
3564
|
const ref = useRef24(null);
|
|
3549
3565
|
const { interactive, state, ...ctx } = useTableContext();
|
|
3550
3566
|
const { variant, size } = row.props;
|
|
3551
|
-
const classNames2 =
|
|
3567
|
+
const classNames2 = useClassNames35({
|
|
3552
3568
|
component: "Table",
|
|
3553
3569
|
variant: variant || ctx.variant,
|
|
3554
3570
|
size: size || ctx.size
|
|
@@ -3573,7 +3589,7 @@ var TableRow = ({ children, row }) => {
|
|
|
3573
3589
|
focusVisible: isFocusVisible,
|
|
3574
3590
|
active: isPressed
|
|
3575
3591
|
});
|
|
3576
|
-
return /* @__PURE__ */
|
|
3592
|
+
return /* @__PURE__ */ React78.createElement(
|
|
3577
3593
|
"tr",
|
|
3578
3594
|
{
|
|
3579
3595
|
ref,
|
|
@@ -3591,7 +3607,7 @@ var TableRow = ({ children, row }) => {
|
|
|
3591
3607
|
};
|
|
3592
3608
|
|
|
3593
3609
|
// src/Table/TableSelectAllCell.tsx
|
|
3594
|
-
import
|
|
3610
|
+
import React79, { useRef as useRef25 } from "react";
|
|
3595
3611
|
import { useFocusRing as useFocusRing17 } from "@react-aria/focus";
|
|
3596
3612
|
import { useHover as useHover11 } from "@react-aria/interactions";
|
|
3597
3613
|
import {
|
|
@@ -3599,8 +3615,15 @@ import {
|
|
|
3599
3615
|
useTableSelectAllCheckbox
|
|
3600
3616
|
} from "@react-aria/table";
|
|
3601
3617
|
import { mergeProps as mergeProps21 } from "@react-aria/utils";
|
|
3602
|
-
import {
|
|
3603
|
-
|
|
3618
|
+
import {
|
|
3619
|
+
cn as cn41,
|
|
3620
|
+
width as twWidth3,
|
|
3621
|
+
useStateProps as useStateProps25
|
|
3622
|
+
} from "@marigold/system";
|
|
3623
|
+
var TableSelectAllCell = ({
|
|
3624
|
+
column,
|
|
3625
|
+
width = "auto"
|
|
3626
|
+
}) => {
|
|
3604
3627
|
const ref = useRef25(null);
|
|
3605
3628
|
const { state, classNames: classNames2 } = useTableContext();
|
|
3606
3629
|
const { columnHeaderProps } = useTableColumnHeader2(
|
|
@@ -3617,18 +3640,19 @@ var TableSelectAllCell = ({ column }) => {
|
|
|
3617
3640
|
hover: isHovered,
|
|
3618
3641
|
focusVisible: isFocusVisible
|
|
3619
3642
|
});
|
|
3620
|
-
return /* @__PURE__ */
|
|
3643
|
+
return /* @__PURE__ */ React79.createElement(
|
|
3621
3644
|
"th",
|
|
3622
3645
|
{
|
|
3623
3646
|
ref,
|
|
3624
3647
|
className: cn41(
|
|
3648
|
+
twWidth3[width],
|
|
3625
3649
|
["text-center align-middle leading-none"],
|
|
3626
3650
|
classNames2 == null ? void 0 : classNames2.header
|
|
3627
3651
|
),
|
|
3628
3652
|
...mergeProps21(columnHeaderProps, hoverProps, focusProps),
|
|
3629
3653
|
...stateProps
|
|
3630
3654
|
},
|
|
3631
|
-
/* @__PURE__ */
|
|
3655
|
+
/* @__PURE__ */ React79.createElement(Checkbox, { ...checkboxProps })
|
|
3632
3656
|
);
|
|
3633
3657
|
};
|
|
3634
3658
|
|
|
@@ -3649,18 +3673,18 @@ var Table = ({
|
|
|
3649
3673
|
props.selectionBehavior !== "replace"
|
|
3650
3674
|
});
|
|
3651
3675
|
const { gridProps } = useTable(props, state, tableRef);
|
|
3652
|
-
const classNames2 =
|
|
3676
|
+
const classNames2 = useClassNames36({
|
|
3653
3677
|
component: "Table",
|
|
3654
3678
|
variant,
|
|
3655
3679
|
size
|
|
3656
3680
|
});
|
|
3657
3681
|
const { collection } = state;
|
|
3658
|
-
return /* @__PURE__ */
|
|
3682
|
+
return /* @__PURE__ */ React80.createElement(
|
|
3659
3683
|
TableContext.Provider,
|
|
3660
3684
|
{
|
|
3661
3685
|
value: { state, interactive, classNames: classNames2, variant, size }
|
|
3662
3686
|
},
|
|
3663
|
-
/* @__PURE__ */
|
|
3687
|
+
/* @__PURE__ */ React80.createElement(
|
|
3664
3688
|
"table",
|
|
3665
3689
|
{
|
|
3666
3690
|
ref: tableRef,
|
|
@@ -3671,17 +3695,31 @@ var Table = ({
|
|
|
3671
3695
|
),
|
|
3672
3696
|
...gridProps
|
|
3673
3697
|
},
|
|
3674
|
-
/* @__PURE__ */
|
|
3698
|
+
/* @__PURE__ */ React80.createElement(TableHeader, null, collection.headerRows.map((headerRow) => /* @__PURE__ */ React80.createElement(TableHeaderRow, { key: headerRow.key, item: headerRow }, [...collection.getChildren(headerRow.key)].map(
|
|
3675
3699
|
(column) => {
|
|
3676
|
-
var _a;
|
|
3677
|
-
return ((_a = column.props) == null ? void 0 : _a.isSelectionCell) ? /* @__PURE__ */
|
|
3700
|
+
var _a, _b, _c;
|
|
3701
|
+
return ((_a = column.props) == null ? void 0 : _a.isSelectionCell) ? /* @__PURE__ */ React80.createElement(
|
|
3702
|
+
TableSelectAllCell,
|
|
3703
|
+
{
|
|
3704
|
+
width: (_b = column.props) == null ? void 0 : _b.width,
|
|
3705
|
+
key: column.key,
|
|
3706
|
+
column
|
|
3707
|
+
}
|
|
3708
|
+
) : /* @__PURE__ */ React80.createElement(
|
|
3709
|
+
TableColumnHeader,
|
|
3710
|
+
{
|
|
3711
|
+
width: (_c = column.props) == null ? void 0 : _c.width,
|
|
3712
|
+
key: column.key,
|
|
3713
|
+
column
|
|
3714
|
+
}
|
|
3715
|
+
);
|
|
3678
3716
|
}
|
|
3679
3717
|
)))),
|
|
3680
|
-
/* @__PURE__ */
|
|
3681
|
-
(row) => row.type === "item" && /* @__PURE__ */
|
|
3718
|
+
/* @__PURE__ */ React80.createElement(TableBody, null, ...collection.rows.map(
|
|
3719
|
+
(row) => row.type === "item" && /* @__PURE__ */ React80.createElement(TableRow, { key: row.key, row }, [...collection.getChildren(row.key)].map(
|
|
3682
3720
|
(cell) => {
|
|
3683
3721
|
var _a;
|
|
3684
|
-
return ((_a = cell.props) == null ? void 0 : _a.isSelectionCell) ? /* @__PURE__ */
|
|
3722
|
+
return ((_a = cell.props) == null ? void 0 : _a.isSelectionCell) ? /* @__PURE__ */ React80.createElement(TableCheckboxCell, { key: cell.key, cell }) : /* @__PURE__ */ React80.createElement(TableCell, { key: cell.key, cell });
|
|
3685
3723
|
}
|
|
3686
3724
|
))
|
|
3687
3725
|
))
|
|
@@ -3695,15 +3733,15 @@ Table.Header = Header2;
|
|
|
3695
3733
|
Table.Row = Row;
|
|
3696
3734
|
|
|
3697
3735
|
// src/Text/Text.tsx
|
|
3698
|
-
import
|
|
3736
|
+
import React81 from "react";
|
|
3699
3737
|
import {
|
|
3700
3738
|
cn as cn43,
|
|
3701
|
-
createVar as
|
|
3739
|
+
createVar as createVar12,
|
|
3702
3740
|
cursorStyle,
|
|
3703
3741
|
fontWeight,
|
|
3704
3742
|
get as get2,
|
|
3705
3743
|
textAlign as textAlign2,
|
|
3706
|
-
useClassNames as
|
|
3744
|
+
useClassNames as useClassNames37,
|
|
3707
3745
|
useTheme as useTheme5,
|
|
3708
3746
|
textSize,
|
|
3709
3747
|
textStyle
|
|
@@ -3721,12 +3759,12 @@ var Text = ({
|
|
|
3721
3759
|
...props
|
|
3722
3760
|
}) => {
|
|
3723
3761
|
const theme = useTheme5();
|
|
3724
|
-
const classNames2 =
|
|
3762
|
+
const classNames2 = useClassNames37({
|
|
3725
3763
|
component: "Text",
|
|
3726
3764
|
variant,
|
|
3727
3765
|
size
|
|
3728
3766
|
});
|
|
3729
|
-
return /* @__PURE__ */
|
|
3767
|
+
return /* @__PURE__ */ React81.createElement(
|
|
3730
3768
|
"p",
|
|
3731
3769
|
{
|
|
3732
3770
|
...props,
|
|
@@ -3739,7 +3777,7 @@ var Text = ({
|
|
|
3739
3777
|
weight && fontWeight[weight],
|
|
3740
3778
|
fontSize && textSize[fontSize]
|
|
3741
3779
|
),
|
|
3742
|
-
style:
|
|
3780
|
+
style: createVar12({
|
|
3743
3781
|
color: color && theme.colors && get2(
|
|
3744
3782
|
theme.colors,
|
|
3745
3783
|
color.replace("-", "."),
|
|
@@ -3753,12 +3791,12 @@ var Text = ({
|
|
|
3753
3791
|
};
|
|
3754
3792
|
|
|
3755
3793
|
// src/TextArea/TextArea.tsx
|
|
3756
|
-
import
|
|
3794
|
+
import React82, { forwardRef as forwardRef16 } from "react";
|
|
3757
3795
|
import { useHover as useHover12 } from "@react-aria/interactions";
|
|
3758
3796
|
import { useFocusRing as useFocusRing18 } from "@react-aria/focus";
|
|
3759
3797
|
import { useTextField } from "@react-aria/textfield";
|
|
3760
3798
|
import { useObjectRef as useObjectRef13 } from "@react-aria/utils";
|
|
3761
|
-
import { useClassNames as
|
|
3799
|
+
import { useClassNames as useClassNames38, useStateProps as useStateProps26 } from "@marigold/system";
|
|
3762
3800
|
var TextArea = forwardRef16(
|
|
3763
3801
|
({
|
|
3764
3802
|
variant,
|
|
@@ -3794,8 +3832,8 @@ var TextArea = forwardRef16(
|
|
|
3794
3832
|
required,
|
|
3795
3833
|
error
|
|
3796
3834
|
});
|
|
3797
|
-
const classNames2 =
|
|
3798
|
-
return /* @__PURE__ */
|
|
3835
|
+
const classNames2 = useClassNames38({ component: "TextArea", variant, size });
|
|
3836
|
+
return /* @__PURE__ */ React82.createElement(
|
|
3799
3837
|
FieldBase,
|
|
3800
3838
|
{
|
|
3801
3839
|
label,
|
|
@@ -3810,7 +3848,7 @@ var TextArea = forwardRef16(
|
|
|
3810
3848
|
size,
|
|
3811
3849
|
width
|
|
3812
3850
|
},
|
|
3813
|
-
/* @__PURE__ */
|
|
3851
|
+
/* @__PURE__ */ React82.createElement(
|
|
3814
3852
|
"textarea",
|
|
3815
3853
|
{
|
|
3816
3854
|
className: classNames2,
|
|
@@ -3826,7 +3864,7 @@ var TextArea = forwardRef16(
|
|
|
3826
3864
|
);
|
|
3827
3865
|
|
|
3828
3866
|
// src/TextField/TextField.tsx
|
|
3829
|
-
import
|
|
3867
|
+
import React83, { forwardRef as forwardRef17 } from "react";
|
|
3830
3868
|
import { useHover as useHover13 } from "@react-aria/interactions";
|
|
3831
3869
|
import { useFocusRing as useFocusRing19 } from "@react-aria/focus";
|
|
3832
3870
|
import { useTextField as useTextField2 } from "@react-aria/textfield";
|
|
@@ -3859,7 +3897,7 @@ var TextField = forwardRef17(
|
|
|
3859
3897
|
readOnly,
|
|
3860
3898
|
required
|
|
3861
3899
|
});
|
|
3862
|
-
return /* @__PURE__ */
|
|
3900
|
+
return /* @__PURE__ */ React83.createElement(
|
|
3863
3901
|
FieldBase,
|
|
3864
3902
|
{
|
|
3865
3903
|
label,
|
|
@@ -3874,7 +3912,7 @@ var TextField = forwardRef17(
|
|
|
3874
3912
|
size,
|
|
3875
3913
|
width
|
|
3876
3914
|
},
|
|
3877
|
-
/* @__PURE__ */
|
|
3915
|
+
/* @__PURE__ */ React83.createElement(
|
|
3878
3916
|
Input,
|
|
3879
3917
|
{
|
|
3880
3918
|
ref: inputRef,
|
|
@@ -3888,8 +3926,8 @@ var TextField = forwardRef17(
|
|
|
3888
3926
|
);
|
|
3889
3927
|
|
|
3890
3928
|
// src/Tiles/Tiles.tsx
|
|
3891
|
-
import
|
|
3892
|
-
import { gapSpace as gapSpace7, cn as cn44, createVar as
|
|
3929
|
+
import React84 from "react";
|
|
3930
|
+
import { gapSpace as gapSpace7, cn as cn44, createVar as createVar13 } from "@marigold/system";
|
|
3893
3931
|
var Tiles = ({
|
|
3894
3932
|
space = 0,
|
|
3895
3933
|
stretch = false,
|
|
@@ -3902,7 +3940,7 @@ var Tiles = ({
|
|
|
3902
3940
|
if (stretch) {
|
|
3903
3941
|
column = `minmax(${column}, 1fr)`;
|
|
3904
3942
|
}
|
|
3905
|
-
return /* @__PURE__ */
|
|
3943
|
+
return /* @__PURE__ */ React84.createElement(
|
|
3906
3944
|
"div",
|
|
3907
3945
|
{
|
|
3908
3946
|
...props,
|
|
@@ -3912,16 +3950,16 @@ var Tiles = ({
|
|
|
3912
3950
|
"grid-cols-[repeat(auto-fit,var(--column))]",
|
|
3913
3951
|
equalHeight && "auto-rows-[1fr]"
|
|
3914
3952
|
),
|
|
3915
|
-
style:
|
|
3953
|
+
style: createVar13({ column, tilesWidth })
|
|
3916
3954
|
},
|
|
3917
3955
|
children
|
|
3918
3956
|
);
|
|
3919
3957
|
};
|
|
3920
3958
|
|
|
3921
3959
|
// src/Tooltip/Tooltip.tsx
|
|
3922
|
-
import
|
|
3960
|
+
import React86 from "react";
|
|
3923
3961
|
import { useTooltip } from "@react-aria/tooltip";
|
|
3924
|
-
import { cn as cn45, useClassNames as
|
|
3962
|
+
import { cn as cn45, useClassNames as useClassNames39 } from "@marigold/system";
|
|
3925
3963
|
|
|
3926
3964
|
// src/Tooltip/Context.ts
|
|
3927
3965
|
import { createContext as createContext9, useContext as useContext9 } from "react";
|
|
@@ -3929,7 +3967,7 @@ var TooltipContext = createContext9({});
|
|
|
3929
3967
|
var useTooltipContext = () => useContext9(TooltipContext);
|
|
3930
3968
|
|
|
3931
3969
|
// src/Tooltip/TooltipTrigger.tsx
|
|
3932
|
-
import
|
|
3970
|
+
import React85, { useRef as useRef27 } from "react";
|
|
3933
3971
|
import { FocusableProvider } from "@react-aria/focus";
|
|
3934
3972
|
import { useOverlayPosition } from "@react-aria/overlays";
|
|
3935
3973
|
import { useTooltipTrigger } from "@react-aria/tooltip";
|
|
@@ -3942,7 +3980,7 @@ var TooltipTrigger = ({
|
|
|
3942
3980
|
children,
|
|
3943
3981
|
...rest
|
|
3944
3982
|
}) => {
|
|
3945
|
-
const [tooltipTrigger, tooltip] =
|
|
3983
|
+
const [tooltipTrigger, tooltip] = React85.Children.toArray(children);
|
|
3946
3984
|
const props = {
|
|
3947
3985
|
...rest,
|
|
3948
3986
|
isDisabled: disabled,
|
|
@@ -3970,7 +4008,7 @@ var TooltipTrigger = ({
|
|
|
3970
4008
|
isOpen: state.isOpen,
|
|
3971
4009
|
overlayRef
|
|
3972
4010
|
});
|
|
3973
|
-
return /* @__PURE__ */
|
|
4011
|
+
return /* @__PURE__ */ React85.createElement(FocusableProvider, { ref: tooltipTriggerRef, ...triggerProps }, tooltipTrigger, /* @__PURE__ */ React85.createElement(
|
|
3974
4012
|
TooltipContext.Provider,
|
|
3975
4013
|
{
|
|
3976
4014
|
value: {
|
|
@@ -3982,7 +4020,7 @@ var TooltipTrigger = ({
|
|
|
3982
4020
|
...positionProps
|
|
3983
4021
|
}
|
|
3984
4022
|
},
|
|
3985
|
-
/* @__PURE__ */
|
|
4023
|
+
/* @__PURE__ */ React85.createElement(Overlay, { open: state.isOpen }, tooltip)
|
|
3986
4024
|
));
|
|
3987
4025
|
};
|
|
3988
4026
|
|
|
@@ -3990,8 +4028,8 @@ var TooltipTrigger = ({
|
|
|
3990
4028
|
var Tooltip = ({ children, variant, size }) => {
|
|
3991
4029
|
const { arrowProps, state, overlayRef, placement, ...rest } = useTooltipContext();
|
|
3992
4030
|
const { tooltipProps } = useTooltip({}, state);
|
|
3993
|
-
const classNames2 =
|
|
3994
|
-
return /* @__PURE__ */
|
|
4031
|
+
const classNames2 = useClassNames39({ component: "Tooltip", variant, size });
|
|
4032
|
+
return /* @__PURE__ */ React86.createElement(
|
|
3995
4033
|
"div",
|
|
3996
4034
|
{
|
|
3997
4035
|
...tooltipProps,
|
|
@@ -4000,8 +4038,8 @@ var Tooltip = ({ children, variant, size }) => {
|
|
|
4000
4038
|
className: cn45("group/tooltip", classNames2.container),
|
|
4001
4039
|
"data-placement": placement
|
|
4002
4040
|
},
|
|
4003
|
-
/* @__PURE__ */
|
|
4004
|
-
/* @__PURE__ */
|
|
4041
|
+
/* @__PURE__ */ React86.createElement("div", null, children),
|
|
4042
|
+
/* @__PURE__ */ React86.createElement(
|
|
4005
4043
|
"div",
|
|
4006
4044
|
{
|
|
4007
4045
|
...arrowProps,
|
|
@@ -4016,23 +4054,23 @@ Tooltip.Trigger = TooltipTrigger;
|
|
|
4016
4054
|
import { Item as Item6 } from "@react-stately/collections";
|
|
4017
4055
|
|
|
4018
4056
|
// src/TagGroup/TagGroup.tsx
|
|
4019
|
-
import
|
|
4057
|
+
import React88, { useRef as useRef28 } from "react";
|
|
4020
4058
|
import { useTagGroup } from "@react-aria/tag";
|
|
4021
4059
|
import { useListState } from "@react-stately/list";
|
|
4022
4060
|
import { useStateProps as useStateProps28 } from "@marigold/system";
|
|
4023
4061
|
|
|
4024
4062
|
// src/TagGroup/Tag.tsx
|
|
4025
|
-
import
|
|
4063
|
+
import React87 from "react";
|
|
4026
4064
|
import { useTag } from "@react-aria/tag";
|
|
4027
4065
|
import { useFocusRing as useFocusRing20 } from "@react-aria/focus";
|
|
4028
|
-
import { cn as cn46, useClassNames as
|
|
4066
|
+
import { cn as cn46, useClassNames as useClassNames40 } from "@marigold/system";
|
|
4029
4067
|
import { mergeProps as mergeProps23 } from "@react-aria/utils";
|
|
4030
4068
|
var Tag = ({ variant, size, item, state, ...rest }) => {
|
|
4031
4069
|
const props = {
|
|
4032
4070
|
item,
|
|
4033
4071
|
...rest
|
|
4034
4072
|
};
|
|
4035
|
-
let ref =
|
|
4073
|
+
let ref = React87.useRef(null);
|
|
4036
4074
|
let { focusProps } = useFocusRing20({ within: true });
|
|
4037
4075
|
const { rowProps, gridCellProps, allowsRemoving, removeButtonProps } = useTag(
|
|
4038
4076
|
{
|
|
@@ -4042,22 +4080,22 @@ var Tag = ({ variant, size, item, state, ...rest }) => {
|
|
|
4042
4080
|
state,
|
|
4043
4081
|
ref
|
|
4044
4082
|
);
|
|
4045
|
-
const classNames2 =
|
|
4046
|
-
return /* @__PURE__ */
|
|
4083
|
+
const classNames2 = useClassNames40({ component: "Tag", variant, size });
|
|
4084
|
+
return /* @__PURE__ */ React87.createElement(
|
|
4047
4085
|
"span",
|
|
4048
4086
|
{
|
|
4049
4087
|
ref,
|
|
4050
4088
|
...mergeProps23(rowProps, focusProps),
|
|
4051
4089
|
className: classNames2.tag
|
|
4052
4090
|
},
|
|
4053
|
-
/* @__PURE__ */
|
|
4091
|
+
/* @__PURE__ */ React87.createElement("div", { ...gridCellProps, className: classNames2.gridCell }, /* @__PURE__ */ React87.createElement("span", null, item.rendered), allowsRemoving && /* @__PURE__ */ React87.createElement(
|
|
4054
4092
|
Button,
|
|
4055
4093
|
{
|
|
4056
4094
|
...removeButtonProps,
|
|
4057
4095
|
className: cn46("flex items-center", classNames2.closeButton),
|
|
4058
4096
|
role: "button"
|
|
4059
4097
|
},
|
|
4060
|
-
/* @__PURE__ */
|
|
4098
|
+
/* @__PURE__ */ React87.createElement("svg", { viewBox: "0 0 20 20", fill: "currentColor", width: 20, height: 20 }, /* @__PURE__ */ React87.createElement("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" }))
|
|
4061
4099
|
))
|
|
4062
4100
|
);
|
|
4063
4101
|
};
|
|
@@ -4082,7 +4120,7 @@ var TagGroup = ({
|
|
|
4082
4120
|
error,
|
|
4083
4121
|
required
|
|
4084
4122
|
});
|
|
4085
|
-
return /* @__PURE__ */
|
|
4123
|
+
return /* @__PURE__ */ React88.createElement(
|
|
4086
4124
|
FieldBase,
|
|
4087
4125
|
{
|
|
4088
4126
|
width,
|
|
@@ -4096,14 +4134,14 @@ var TagGroup = ({
|
|
|
4096
4134
|
stateProps,
|
|
4097
4135
|
...gridProps
|
|
4098
4136
|
},
|
|
4099
|
-
/* @__PURE__ */
|
|
4137
|
+
/* @__PURE__ */ React88.createElement(
|
|
4100
4138
|
"div",
|
|
4101
4139
|
{
|
|
4102
4140
|
role: "presentation",
|
|
4103
4141
|
ref: inputRef,
|
|
4104
4142
|
className: "flex flex-wrap items-start gap-1"
|
|
4105
4143
|
},
|
|
4106
|
-
[...state.collection].map((item) => /* @__PURE__ */
|
|
4144
|
+
[...state.collection].map((item) => /* @__PURE__ */ React88.createElement(
|
|
4107
4145
|
Tag,
|
|
4108
4146
|
{
|
|
4109
4147
|
...item.props,
|
|
@@ -4125,8 +4163,8 @@ Tag2.Group = TagGroup;
|
|
|
4125
4163
|
|
|
4126
4164
|
// src/XLoader/XLoader.tsx
|
|
4127
4165
|
import { SVG as SVG6 } from "@marigold/system";
|
|
4128
|
-
import
|
|
4129
|
-
var XLoader = forwardRef18((props, ref) => /* @__PURE__ */
|
|
4166
|
+
import React89, { forwardRef as forwardRef18 } from "react";
|
|
4167
|
+
var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ React89.createElement(
|
|
4130
4168
|
SVG6,
|
|
4131
4169
|
{
|
|
4132
4170
|
id: "XLoader",
|
|
@@ -4136,14 +4174,14 @@ var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ React88.createElement
|
|
|
4136
4174
|
...props,
|
|
4137
4175
|
...ref
|
|
4138
4176
|
},
|
|
4139
|
-
/* @__PURE__ */
|
|
4140
|
-
/* @__PURE__ */
|
|
4177
|
+
/* @__PURE__ */ React89.createElement("path", { id: "XMLID_1_", d: "M35.3 27h26.5l54 74.1H88.7z" }),
|
|
4178
|
+
/* @__PURE__ */ React89.createElement(
|
|
4141
4179
|
"path",
|
|
4142
4180
|
{
|
|
4143
4181
|
id: "XMLID_5_",
|
|
4144
4182
|
d: "M124.3 12.8h-.7c-2.7 0-4.9-2.2-4.9-4.9v-.7c0-2.7 2.2-4.9 4.9-4.9h.7c2.7 0 4.9 2.2 4.9 4.9v.7c0 2.7-2.2 4.9-4.9 4.9z"
|
|
4145
4183
|
},
|
|
4146
|
-
/* @__PURE__ */
|
|
4184
|
+
/* @__PURE__ */ React89.createElement(
|
|
4147
4185
|
"animate",
|
|
4148
4186
|
{
|
|
4149
4187
|
attributeName: "opacity",
|
|
@@ -4155,13 +4193,13 @@ var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ React88.createElement
|
|
|
4155
4193
|
}
|
|
4156
4194
|
)
|
|
4157
4195
|
),
|
|
4158
|
-
/* @__PURE__ */
|
|
4196
|
+
/* @__PURE__ */ React89.createElement(
|
|
4159
4197
|
"path",
|
|
4160
4198
|
{
|
|
4161
4199
|
id: "XMLID_18_",
|
|
4162
4200
|
d: "M115.9 24.4h-.7c-2.7 0-4.9-2.2-4.9-4.9v-.7c0-2.7 2.2-4.9 4.9-4.9h.7c2.7 0 4.9 2.2 4.9 4.9v.7c0 2.7-2.2 4.9-4.9 4.9z"
|
|
4163
4201
|
},
|
|
4164
|
-
/* @__PURE__ */
|
|
4202
|
+
/* @__PURE__ */ React89.createElement(
|
|
4165
4203
|
"animate",
|
|
4166
4204
|
{
|
|
4167
4205
|
attributeName: "opacity",
|
|
@@ -4173,13 +4211,13 @@ var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ React88.createElement
|
|
|
4173
4211
|
}
|
|
4174
4212
|
)
|
|
4175
4213
|
),
|
|
4176
|
-
/* @__PURE__ */
|
|
4214
|
+
/* @__PURE__ */ React89.createElement(
|
|
4177
4215
|
"path",
|
|
4178
4216
|
{
|
|
4179
4217
|
id: "XMLID_19_",
|
|
4180
4218
|
d: "M107.5 35.9h-.7c-2.7 0-4.9-2.2-4.9-4.9v-.7c0-2.7 2.2-4.9 4.9-4.9h.7c2.7 0 4.9 2.2 4.9 4.9v.7c0 2.7-2.2 4.9-4.9 4.9z"
|
|
4181
4219
|
},
|
|
4182
|
-
/* @__PURE__ */
|
|
4220
|
+
/* @__PURE__ */ React89.createElement(
|
|
4183
4221
|
"animate",
|
|
4184
4222
|
{
|
|
4185
4223
|
attributeName: "opacity",
|
|
@@ -4191,13 +4229,13 @@ var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ React88.createElement
|
|
|
4191
4229
|
}
|
|
4192
4230
|
)
|
|
4193
4231
|
),
|
|
4194
|
-
/* @__PURE__ */
|
|
4232
|
+
/* @__PURE__ */ React89.createElement(
|
|
4195
4233
|
"path",
|
|
4196
4234
|
{
|
|
4197
4235
|
id: "XMLID_20_",
|
|
4198
4236
|
d: "M99.1 47.5h-.7c-2.7 0-4.9-2.2-4.9-4.9v-.7c0-2.7 2.2-4.9 4.9-4.9h.7c2.7 0 4.9 2.2 4.9 4.9v.7c0 2.7-2.2 4.9-4.9 4.9z"
|
|
4199
4237
|
},
|
|
4200
|
-
/* @__PURE__ */
|
|
4238
|
+
/* @__PURE__ */ React89.createElement(
|
|
4201
4239
|
"animate",
|
|
4202
4240
|
{
|
|
4203
4241
|
attributeName: "opacity",
|
|
@@ -4209,13 +4247,13 @@ var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ React88.createElement
|
|
|
4209
4247
|
}
|
|
4210
4248
|
)
|
|
4211
4249
|
),
|
|
4212
|
-
/* @__PURE__ */
|
|
4250
|
+
/* @__PURE__ */ React89.createElement(
|
|
4213
4251
|
"path",
|
|
4214
4252
|
{
|
|
4215
4253
|
id: "XMLID_21_",
|
|
4216
4254
|
d: "M90.7 59H90c-2.7 0-4.9-2.2-4.9-4.9v-.7c0-2.7 2.2-4.9 4.9-4.9h.7c2.7 0 4.9 2.2 4.9 4.9v.7c0 2.8-2.2 4.9-4.9 4.9z"
|
|
4217
4255
|
},
|
|
4218
|
-
/* @__PURE__ */
|
|
4256
|
+
/* @__PURE__ */ React89.createElement(
|
|
4219
4257
|
"animate",
|
|
4220
4258
|
{
|
|
4221
4259
|
attributeName: "opacity",
|
|
@@ -4227,13 +4265,13 @@ var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ React88.createElement
|
|
|
4227
4265
|
}
|
|
4228
4266
|
)
|
|
4229
4267
|
),
|
|
4230
|
-
/* @__PURE__ */
|
|
4268
|
+
/* @__PURE__ */ React89.createElement(
|
|
4231
4269
|
"path",
|
|
4232
4270
|
{
|
|
4233
4271
|
id: "XMLID_22_",
|
|
4234
4272
|
d: "M68 89.8h-.7c-2.7 0-4.9-2.2-4.9-4.9v-.7c0-2.7 2.2-4.9 4.9-4.9h.7c2.7 0 4.9 2.2 4.9 4.9v.8c0 2.6-2.2 4.8-4.9 4.8z"
|
|
4235
4273
|
},
|
|
4236
|
-
/* @__PURE__ */
|
|
4274
|
+
/* @__PURE__ */ React89.createElement(
|
|
4237
4275
|
"animate",
|
|
4238
4276
|
{
|
|
4239
4277
|
attributeName: "opacity",
|
|
@@ -4245,13 +4283,13 @@ var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ React88.createElement
|
|
|
4245
4283
|
}
|
|
4246
4284
|
)
|
|
4247
4285
|
),
|
|
4248
|
-
/* @__PURE__ */
|
|
4286
|
+
/* @__PURE__ */ React89.createElement(
|
|
4249
4287
|
"path",
|
|
4250
4288
|
{
|
|
4251
4289
|
id: "XMLID_23_",
|
|
4252
4290
|
d: "M59.6 101.4h-.7c-2.7 0-4.9-2.2-4.9-4.9v-.7c0-2.7 2.2-4.9 4.9-4.9h.7c2.7 0 4.9 2.2 4.9 4.9v.7c0 2.7-2.2 4.9-4.9 4.9z"
|
|
4253
4291
|
},
|
|
4254
|
-
/* @__PURE__ */
|
|
4292
|
+
/* @__PURE__ */ React89.createElement(
|
|
4255
4293
|
"animate",
|
|
4256
4294
|
{
|
|
4257
4295
|
attributeName: "opacity",
|
|
@@ -4263,13 +4301,13 @@ var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ React88.createElement
|
|
|
4263
4301
|
}
|
|
4264
4302
|
)
|
|
4265
4303
|
),
|
|
4266
|
-
/* @__PURE__ */
|
|
4304
|
+
/* @__PURE__ */ React89.createElement(
|
|
4267
4305
|
"path",
|
|
4268
4306
|
{
|
|
4269
4307
|
id: "XMLID_24_",
|
|
4270
4308
|
d: "M51.2 112.9h-.7c-2.7 0-4.9-2.2-4.9-4.9v-.7c0-2.7 2.2-4.9 4.9-4.9h.7c2.7 0 4.9 2.2 4.9 4.9v.7c-.1 2.8-2.2 4.9-4.9 4.9z"
|
|
4271
4309
|
},
|
|
4272
|
-
/* @__PURE__ */
|
|
4310
|
+
/* @__PURE__ */ React89.createElement(
|
|
4273
4311
|
"animate",
|
|
4274
4312
|
{
|
|
4275
4313
|
attributeName: "opacity",
|
|
@@ -4281,13 +4319,13 @@ var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ React88.createElement
|
|
|
4281
4319
|
}
|
|
4282
4320
|
)
|
|
4283
4321
|
),
|
|
4284
|
-
/* @__PURE__ */
|
|
4322
|
+
/* @__PURE__ */ React89.createElement(
|
|
4285
4323
|
"path",
|
|
4286
4324
|
{
|
|
4287
4325
|
id: "XMLID_25_",
|
|
4288
4326
|
d: "M42.8 124.5h-.7c-2.7 0-4.9-2.2-4.9-4.9v-.7c0-2.7 2.2-4.9 4.9-4.9h.7c2.7 0 4.9 2.2 4.9 4.9v.7c-.1 2.7-2.2 4.9-4.9 4.9z"
|
|
4289
4327
|
},
|
|
4290
|
-
/* @__PURE__ */
|
|
4328
|
+
/* @__PURE__ */ React89.createElement(
|
|
4291
4329
|
"animate",
|
|
4292
4330
|
{
|
|
4293
4331
|
attributeName: "opacity",
|
|
@@ -4299,13 +4337,13 @@ var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ React88.createElement
|
|
|
4299
4337
|
}
|
|
4300
4338
|
)
|
|
4301
4339
|
),
|
|
4302
|
-
/* @__PURE__ */
|
|
4340
|
+
/* @__PURE__ */ React89.createElement(
|
|
4303
4341
|
"path",
|
|
4304
4342
|
{
|
|
4305
4343
|
id: "XMLID_26_",
|
|
4306
4344
|
d: "M34.4 136h-.7c-2.7 0-4.9-2.2-4.9-4.9v-.7c0-2.7 2.2-4.9 4.9-4.9h.7c2.7 0 4.9 2.2 4.9 4.9v.7c-.1 2.7-2.2 4.9-4.9 4.9z"
|
|
4307
4345
|
},
|
|
4308
|
-
/* @__PURE__ */
|
|
4346
|
+
/* @__PURE__ */ React89.createElement(
|
|
4309
4347
|
"animate",
|
|
4310
4348
|
{
|
|
4311
4349
|
attributeName: "opacity",
|
|
@@ -4317,13 +4355,13 @@ var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ React88.createElement
|
|
|
4317
4355
|
}
|
|
4318
4356
|
)
|
|
4319
4357
|
),
|
|
4320
|
-
/* @__PURE__ */
|
|
4358
|
+
/* @__PURE__ */ React89.createElement(
|
|
4321
4359
|
"path",
|
|
4322
4360
|
{
|
|
4323
4361
|
id: "XMLID_27_",
|
|
4324
4362
|
d: "M26 147.6h-.7c-2.7 0-4.9-2.2-4.9-4.9v-.7c0-2.7 2.2-4.9 4.9-4.9h.7c2.7 0 4.9 2.2 4.9 4.9v.7c-.1 2.8-2.2 4.9-4.9 4.9z"
|
|
4325
4363
|
},
|
|
4326
|
-
/* @__PURE__ */
|
|
4364
|
+
/* @__PURE__ */ React89.createElement(
|
|
4327
4365
|
"animate",
|
|
4328
4366
|
{
|
|
4329
4367
|
attributeName: "opacity",
|
|
@@ -4338,19 +4376,12 @@ var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ React88.createElement
|
|
|
4338
4376
|
));
|
|
4339
4377
|
|
|
4340
4378
|
// src/Tabs/Tabs.tsx
|
|
4341
|
-
import
|
|
4379
|
+
import React92 from "react";
|
|
4380
|
+
import { useRef as useRef31 } from "react";
|
|
4342
4381
|
import { useTabList } from "@react-aria/tabs";
|
|
4343
|
-
import {
|
|
4382
|
+
import { Item as Item7 } from "@react-stately/collections";
|
|
4344
4383
|
import { useTabListState } from "@react-stately/tabs";
|
|
4345
|
-
import {
|
|
4346
|
-
|
|
4347
|
-
// src/Tabs/Tab.tsx
|
|
4348
|
-
import React89 from "react";
|
|
4349
|
-
import { useRef as useRef29 } from "react";
|
|
4350
|
-
import { cn as cn47, useStateProps as useStateProps29 } from "@marigold/system";
|
|
4351
|
-
import { useTab } from "@react-aria/tabs";
|
|
4352
|
-
import { useFocus, useHover as useHover14 } from "@react-aria/interactions";
|
|
4353
|
-
import { mergeProps as mergeProps24 } from "@react-aria/utils";
|
|
4384
|
+
import { cn as cn49, gapSpace as gapSpace8, useClassNames as useClassNames41 } from "@marigold/system";
|
|
4354
4385
|
|
|
4355
4386
|
// src/Tabs/Context.ts
|
|
4356
4387
|
import { createContext as createContext10, useContext as useContext10 } from "react";
|
|
@@ -4358,6 +4389,12 @@ var TabContext = createContext10({});
|
|
|
4358
4389
|
var useTabContext = () => useContext10(TabContext);
|
|
4359
4390
|
|
|
4360
4391
|
// src/Tabs/Tab.tsx
|
|
4392
|
+
import React90 from "react";
|
|
4393
|
+
import { useRef as useRef29 } from "react";
|
|
4394
|
+
import { cn as cn47, useStateProps as useStateProps29 } from "@marigold/system";
|
|
4395
|
+
import { useTab } from "@react-aria/tabs";
|
|
4396
|
+
import { useFocus, useHover as useHover14 } from "@react-aria/interactions";
|
|
4397
|
+
import { mergeProps as mergeProps24 } from "@react-aria/utils";
|
|
4361
4398
|
var Tab = ({ item, state }) => {
|
|
4362
4399
|
const { key, rendered } = item;
|
|
4363
4400
|
const ref = useRef29(null);
|
|
@@ -4369,7 +4406,7 @@ var Tab = ({ item, state }) => {
|
|
|
4369
4406
|
const { focusProps } = useFocus({});
|
|
4370
4407
|
const stateProps = useStateProps29({ active: isSelected, hover: isHovered });
|
|
4371
4408
|
const { classNames: classNames2 } = useTabContext();
|
|
4372
|
-
return /* @__PURE__ */
|
|
4409
|
+
return /* @__PURE__ */ React90.createElement(
|
|
4373
4410
|
"div",
|
|
4374
4411
|
{
|
|
4375
4412
|
className: cn47(
|
|
@@ -4384,18 +4421,20 @@ var Tab = ({ item, state }) => {
|
|
|
4384
4421
|
};
|
|
4385
4422
|
|
|
4386
4423
|
// src/Tabs/TabPanel.tsx
|
|
4387
|
-
import
|
|
4424
|
+
import React91 from "react";
|
|
4388
4425
|
import { useRef as useRef30 } from "react";
|
|
4389
4426
|
import { useTabPanel } from "@react-aria/tabs";
|
|
4427
|
+
import { cn as cn48 } from "@marigold/system";
|
|
4390
4428
|
var TabPanel = ({ state, ...props }) => {
|
|
4391
4429
|
var _a;
|
|
4392
4430
|
const ref = useRef30(null);
|
|
4393
4431
|
const { tabPanelProps } = useTabPanel(props, state, ref);
|
|
4394
|
-
|
|
4432
|
+
const selectedItemProps = (_a = state.selectedItem) == null ? void 0 : _a.props;
|
|
4433
|
+
const { classNames: classNames2 } = useTabContext();
|
|
4434
|
+
return /* @__PURE__ */ React91.createElement("div", { className: cn48(classNames2.tabpanel), ref, ...tabPanelProps }, selectedItemProps == null ? void 0 : selectedItemProps.children);
|
|
4395
4435
|
};
|
|
4396
4436
|
|
|
4397
4437
|
// src/Tabs/Tabs.tsx
|
|
4398
|
-
import { Item as Item7 } from "@react-stately/collections";
|
|
4399
4438
|
var Tabs = ({
|
|
4400
4439
|
space = 2,
|
|
4401
4440
|
size = "medium",
|
|
@@ -4411,22 +4450,22 @@ var Tabs = ({
|
|
|
4411
4450
|
};
|
|
4412
4451
|
const state = useTabListState(props);
|
|
4413
4452
|
const { tabListProps } = useTabList(props, state, ref);
|
|
4414
|
-
const classNames2 =
|
|
4453
|
+
const classNames2 = useClassNames41({
|
|
4415
4454
|
component: "Tabs",
|
|
4416
4455
|
size,
|
|
4417
4456
|
variant
|
|
4418
4457
|
});
|
|
4419
|
-
return /* @__PURE__ */
|
|
4458
|
+
return /* @__PURE__ */ React92.createElement(TabContext.Provider, { value: { classNames: classNames2 } }, /* @__PURE__ */ React92.createElement("div", { className: cn49(classNames2.container) }, /* @__PURE__ */ React92.createElement(
|
|
4420
4459
|
"div",
|
|
4421
4460
|
{
|
|
4422
|
-
className:
|
|
4461
|
+
className: cn49("flex", gapSpace8[space], classNames2.tabs),
|
|
4423
4462
|
...tabListProps,
|
|
4424
4463
|
ref
|
|
4425
4464
|
},
|
|
4426
4465
|
[...state.collection].map((item) => {
|
|
4427
|
-
return /* @__PURE__ */
|
|
4466
|
+
return /* @__PURE__ */ React92.createElement(Tab, { key: item.key, item, state });
|
|
4428
4467
|
})
|
|
4429
|
-
), /* @__PURE__ */
|
|
4468
|
+
), /* @__PURE__ */ React92.createElement(TabPanel, { key: (_a = state.selectedItem) == null ? void 0 : _a.key, state })));
|
|
4430
4469
|
};
|
|
4431
4470
|
Tabs.Item = Item7;
|
|
4432
4471
|
export {
|