@marigold/components 6.1.0 → 6.2.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 +74 -81
- package/dist/index.js +677 -727
- package/dist/index.mjs +621 -663
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -2,20 +2,116 @@
|
|
|
2
2
|
import { useAsyncList, useListData } from "@react-stately/data";
|
|
3
3
|
|
|
4
4
|
// src/Accordion/Accordion.tsx
|
|
5
|
-
import
|
|
5
|
+
import {
|
|
6
|
+
Children,
|
|
7
|
+
cloneElement,
|
|
8
|
+
isValidElement,
|
|
9
|
+
useRef as useRef2
|
|
10
|
+
} from "react";
|
|
6
11
|
import { useAccordion } from "@react-aria/accordion";
|
|
7
12
|
import { Item } from "@react-stately/collections";
|
|
13
|
+
import { useTreeState } from "@react-stately/tree";
|
|
8
14
|
|
|
9
15
|
// src/Accordion/AccordionItem.tsx
|
|
10
|
-
import
|
|
16
|
+
import { useEffect, useRef } from "react";
|
|
11
17
|
import { FocusRing, useFocusRing as useFocusRing2 } from "@react-aria/focus";
|
|
12
18
|
import { mergeProps as mergeProps3 } from "@react-aria/utils";
|
|
13
19
|
import { useClassNames as useClassNames2, useStateProps as useStateProps2 } from "@marigold/system";
|
|
14
20
|
|
|
15
|
-
// src/
|
|
16
|
-
import {
|
|
21
|
+
// src/Button/Button.tsx
|
|
22
|
+
import { forwardRef } from "react";
|
|
17
23
|
import { useButton } from "@react-aria/button";
|
|
24
|
+
import { useFocusRing } from "@react-aria/focus";
|
|
25
|
+
import { useHover } from "@react-aria/interactions";
|
|
26
|
+
import { mergeProps, useObjectRef } from "@react-aria/utils";
|
|
27
|
+
import { cn, useClassNames, useStateProps } from "@marigold/system";
|
|
28
|
+
var Button = forwardRef(
|
|
29
|
+
({
|
|
30
|
+
as = "button",
|
|
31
|
+
children,
|
|
32
|
+
variant,
|
|
33
|
+
size,
|
|
34
|
+
disabled,
|
|
35
|
+
onPress,
|
|
36
|
+
onPressStart,
|
|
37
|
+
onPressEnd,
|
|
38
|
+
onPressChange,
|
|
39
|
+
onPressUp,
|
|
40
|
+
fullWidth,
|
|
41
|
+
excludeFromTabOrder,
|
|
42
|
+
className,
|
|
43
|
+
...props
|
|
44
|
+
}, ref) => {
|
|
45
|
+
const Component = as;
|
|
46
|
+
const buttonRef = useObjectRef(ref);
|
|
47
|
+
const { hoverProps, isHovered } = useHover({ isDisabled: disabled });
|
|
48
|
+
const { isFocusVisible, focusProps } = useFocusRing({
|
|
49
|
+
autoFocus: props.autoFocus
|
|
50
|
+
});
|
|
51
|
+
const { buttonProps, isPressed } = useButton(
|
|
52
|
+
{
|
|
53
|
+
/**
|
|
54
|
+
* `react-aria` only expected `Element` but we casted
|
|
55
|
+
* it to a `HTMLButtonElement` internally.
|
|
56
|
+
*/
|
|
57
|
+
...props,
|
|
58
|
+
onPress,
|
|
59
|
+
onPressStart,
|
|
60
|
+
onPressEnd,
|
|
61
|
+
onPressChange,
|
|
62
|
+
onPressUp,
|
|
63
|
+
elementType: typeof as === "string" ? as : "span",
|
|
64
|
+
isDisabled: disabled,
|
|
65
|
+
excludeFromTabOrder
|
|
66
|
+
},
|
|
67
|
+
buttonRef
|
|
68
|
+
);
|
|
69
|
+
const classNames2 = useClassNames({
|
|
70
|
+
component: "Button",
|
|
71
|
+
variant,
|
|
72
|
+
size,
|
|
73
|
+
className
|
|
74
|
+
});
|
|
75
|
+
const stateProps = useStateProps({
|
|
76
|
+
active: isPressed,
|
|
77
|
+
focusVisible: isFocusVisible,
|
|
78
|
+
hover: isHovered
|
|
79
|
+
});
|
|
80
|
+
return /* @__PURE__ */ React.createElement(
|
|
81
|
+
Component,
|
|
82
|
+
{
|
|
83
|
+
...mergeProps(buttonProps, focusProps, hoverProps, props),
|
|
84
|
+
...stateProps,
|
|
85
|
+
ref: buttonRef,
|
|
86
|
+
className: cn(
|
|
87
|
+
"inline-flex items-center justify-center gap-[0.5ch]",
|
|
88
|
+
classNames2,
|
|
89
|
+
fullWidth ? "w-full" : void 0
|
|
90
|
+
)
|
|
91
|
+
},
|
|
92
|
+
children
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
// src/Chevron/ChevronUp.tsx
|
|
98
|
+
import { forwardRef as forwardRef2 } from "react";
|
|
99
|
+
import { SVG } from "@marigold/system";
|
|
100
|
+
var ChevronUp = forwardRef2(
|
|
101
|
+
({ className, ...props }, ref) => /* @__PURE__ */ React.createElement(SVG, { className, ...props, viewBox: "0 0 24 24", ref }, /* @__PURE__ */ React.createElement("path", { d: "M5.97563 16.8506L12 10.8394L18.0244 16.8506L19.875 15L12 7.125L4.125 15L5.97563 16.8506Z" }))
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
// src/Chevron/ChevronDown.tsx
|
|
105
|
+
import { forwardRef as forwardRef3 } from "react";
|
|
106
|
+
import { SVG as SVG2 } from "@marigold/system";
|
|
107
|
+
var ChevronDown = forwardRef3(
|
|
108
|
+
({ className, ...props }, ref) => /* @__PURE__ */ React.createElement(SVG2, { className, ...props, viewBox: "0 0 24 24", ref }, /* @__PURE__ */ React.createElement("path", { d: "M5.97563 7.125L12 13.1363L18.0244 7.125L19.875 8.97563L12 16.8506L4.125 8.97563L5.97563 7.125Z" }))
|
|
109
|
+
);
|
|
110
|
+
|
|
111
|
+
// src/Accordion/useAccordionItem.ts
|
|
112
|
+
import { useButton as useButton2 } from "@react-aria/button";
|
|
18
113
|
import { useSelectableItem } from "@react-aria/selection";
|
|
114
|
+
import { mergeProps as mergeProps2, useId } from "@react-aria/utils";
|
|
19
115
|
import { isAppleDevice } from "@react-aria/utils";
|
|
20
116
|
import { isMac } from "@react-aria/utils";
|
|
21
117
|
function isNonContiguousSelectionModifier(e) {
|
|
@@ -83,11 +179,12 @@ function useAccordionItem(props, state, ref) {
|
|
|
83
179
|
}
|
|
84
180
|
}
|
|
85
181
|
};
|
|
86
|
-
let { buttonProps } =
|
|
87
|
-
|
|
182
|
+
let { buttonProps } = useButton2(
|
|
183
|
+
mergeProps2(itemProps, {
|
|
88
184
|
id: buttonId,
|
|
89
185
|
elementType: "button",
|
|
90
186
|
isDisabled,
|
|
187
|
+
// if remove than everything click
|
|
91
188
|
onPress: onSelect
|
|
92
189
|
}),
|
|
93
190
|
ref
|
|
@@ -107,98 +204,6 @@ function useAccordionItem(props, state, ref) {
|
|
|
107
204
|
};
|
|
108
205
|
}
|
|
109
206
|
|
|
110
|
-
// src/Button/Button.tsx
|
|
111
|
-
import React2, { forwardRef } from "react";
|
|
112
|
-
import { useButton as useButton2 } from "@react-aria/button";
|
|
113
|
-
import { useFocusRing } from "@react-aria/focus";
|
|
114
|
-
import { useHover } from "@react-aria/interactions";
|
|
115
|
-
import { mergeProps as mergeProps2, useObjectRef } from "@react-aria/utils";
|
|
116
|
-
import { cn, useClassNames, useStateProps } from "@marigold/system";
|
|
117
|
-
var Button = forwardRef(
|
|
118
|
-
({
|
|
119
|
-
as = "button",
|
|
120
|
-
children,
|
|
121
|
-
variant,
|
|
122
|
-
size,
|
|
123
|
-
disabled,
|
|
124
|
-
onClick,
|
|
125
|
-
onPress,
|
|
126
|
-
onPressStart,
|
|
127
|
-
onPressEnd,
|
|
128
|
-
onPressChange,
|
|
129
|
-
onPressUp,
|
|
130
|
-
fullWidth,
|
|
131
|
-
excludeFromTabOrder,
|
|
132
|
-
className,
|
|
133
|
-
...props
|
|
134
|
-
}, ref) => {
|
|
135
|
-
const Component = as;
|
|
136
|
-
const buttonRef = useObjectRef(ref);
|
|
137
|
-
const { hoverProps, isHovered } = useHover({ isDisabled: disabled });
|
|
138
|
-
const { isFocusVisible, focusProps } = useFocusRing({
|
|
139
|
-
autoFocus: props.autoFocus
|
|
140
|
-
});
|
|
141
|
-
const { buttonProps, isPressed } = useButton2(
|
|
142
|
-
{
|
|
143
|
-
/**
|
|
144
|
-
* `react-aria` only expected `Element` but we casted
|
|
145
|
-
* it to a `HTMLButtonElement` internally.
|
|
146
|
-
*/
|
|
147
|
-
...props,
|
|
148
|
-
onClick,
|
|
149
|
-
onPress,
|
|
150
|
-
onPressStart,
|
|
151
|
-
onPressEnd,
|
|
152
|
-
onPressChange,
|
|
153
|
-
onPressUp,
|
|
154
|
-
elementType: typeof as === "string" ? as : "span",
|
|
155
|
-
isDisabled: disabled,
|
|
156
|
-
excludeFromTabOrder
|
|
157
|
-
},
|
|
158
|
-
buttonRef
|
|
159
|
-
);
|
|
160
|
-
const classNames2 = useClassNames({
|
|
161
|
-
component: "Button",
|
|
162
|
-
variant,
|
|
163
|
-
size,
|
|
164
|
-
className
|
|
165
|
-
});
|
|
166
|
-
const stateProps = useStateProps({
|
|
167
|
-
active: isPressed,
|
|
168
|
-
focusVisible: isFocusVisible,
|
|
169
|
-
hover: isHovered
|
|
170
|
-
});
|
|
171
|
-
return /* @__PURE__ */ React2.createElement(
|
|
172
|
-
Component,
|
|
173
|
-
{
|
|
174
|
-
...mergeProps2(buttonProps, focusProps, hoverProps, props),
|
|
175
|
-
...stateProps,
|
|
176
|
-
ref: buttonRef,
|
|
177
|
-
className: cn(
|
|
178
|
-
"inline-flex items-center justify-center gap-[0.5ch]",
|
|
179
|
-
classNames2,
|
|
180
|
-
fullWidth ? "w-full" : void 0
|
|
181
|
-
)
|
|
182
|
-
},
|
|
183
|
-
children
|
|
184
|
-
);
|
|
185
|
-
}
|
|
186
|
-
);
|
|
187
|
-
|
|
188
|
-
// src/Chevron/ChevronUp.tsx
|
|
189
|
-
import React3, { forwardRef as forwardRef2 } from "react";
|
|
190
|
-
import { SVG } from "@marigold/system";
|
|
191
|
-
var ChevronUp = forwardRef2(
|
|
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
|
-
);
|
|
194
|
-
|
|
195
|
-
// src/Chevron/ChevronDown.tsx
|
|
196
|
-
import React4, { forwardRef as forwardRef3 } from "react";
|
|
197
|
-
import { SVG as SVG2 } from "@marigold/system";
|
|
198
|
-
var ChevronDown = forwardRef3(
|
|
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
|
-
);
|
|
201
|
-
|
|
202
207
|
// src/Accordion/AccordionItem.tsx
|
|
203
208
|
var AccordionItem = ({
|
|
204
209
|
item,
|
|
@@ -213,7 +218,7 @@ var AccordionItem = ({
|
|
|
213
218
|
item.key.toString().replace(".$", "")
|
|
214
219
|
);
|
|
215
220
|
const expanded = state.selectionManager.isSelected(item.key);
|
|
216
|
-
|
|
221
|
+
useEffect(() => {
|
|
217
222
|
if (defaultExpanded) {
|
|
218
223
|
if (state.selectionManager.selectionMode === "multiple") {
|
|
219
224
|
state.expandedKeys.forEach((key) => {
|
|
@@ -225,14 +230,20 @@ var AccordionItem = ({
|
|
|
225
230
|
}
|
|
226
231
|
}
|
|
227
232
|
}, [defaultExpanded, item.key, state.expandedKeys, state.selectionManager]);
|
|
228
|
-
const { buttonProps, regionProps } = useAccordionItem(
|
|
233
|
+
const { buttonProps, regionProps } = useAccordionItem(
|
|
234
|
+
{
|
|
235
|
+
item
|
|
236
|
+
},
|
|
237
|
+
state,
|
|
238
|
+
ref
|
|
239
|
+
);
|
|
229
240
|
const { isFocusVisible, focusProps } = useFocusRing2();
|
|
230
241
|
const stateProps = useStateProps2({
|
|
231
242
|
focus: isFocusVisible,
|
|
232
243
|
expanded: defaultExpanded || expanded
|
|
233
244
|
});
|
|
234
245
|
const classNames2 = useClassNames2({ component: "Accordion", variant, size });
|
|
235
|
-
return /* @__PURE__ */
|
|
246
|
+
return /* @__PURE__ */ React.createElement("div", { className: "flex flex-col", ...props }, /* @__PURE__ */ React.createElement(FocusRing, { within: true }, /* @__PURE__ */ React.createElement(
|
|
236
247
|
Button,
|
|
237
248
|
{
|
|
238
249
|
className: classNames2.button,
|
|
@@ -241,8 +252,8 @@ var AccordionItem = ({
|
|
|
241
252
|
"aria-label": item.textValue
|
|
242
253
|
},
|
|
243
254
|
title,
|
|
244
|
-
!expanded ? /* @__PURE__ */
|
|
245
|
-
)), expanded || defaultExpanded ? /* @__PURE__ */
|
|
255
|
+
!expanded ? /* @__PURE__ */ React.createElement(ChevronUp, { className: "h3 w-6" }) : /* @__PURE__ */ React.createElement(ChevronDown, { className: "h3 w-6" })
|
|
256
|
+
)), expanded || defaultExpanded ? /* @__PURE__ */ React.createElement(
|
|
246
257
|
"div",
|
|
247
258
|
{
|
|
248
259
|
...mergeProps3(regionProps, focusProps, stateProps),
|
|
@@ -253,16 +264,15 @@ var AccordionItem = ({
|
|
|
253
264
|
};
|
|
254
265
|
|
|
255
266
|
// src/Accordion/Accordion.tsx
|
|
256
|
-
import { useTreeState } from "@react-stately/tree";
|
|
257
267
|
var Accordion = ({ children, ...props }) => {
|
|
258
268
|
const ownProps = {
|
|
259
269
|
...props,
|
|
260
270
|
// we have to do this because JSX childs are not supported
|
|
261
271
|
children: Children.toArray(children).map((child) => {
|
|
262
|
-
if (!
|
|
272
|
+
if (!isValidElement(child)) {
|
|
263
273
|
return child;
|
|
264
274
|
}
|
|
265
|
-
return
|
|
275
|
+
return cloneElement(child, {
|
|
266
276
|
hasChildItems: false,
|
|
267
277
|
...child.props
|
|
268
278
|
});
|
|
@@ -278,7 +288,7 @@ var Accordion = ({ children, ...props }) => {
|
|
|
278
288
|
state,
|
|
279
289
|
ref
|
|
280
290
|
);
|
|
281
|
-
return /* @__PURE__ */
|
|
291
|
+
return /* @__PURE__ */ React.createElement("div", { ...accordionProps, ref }, [...state.collection].map((item) => /* @__PURE__ */ React.createElement(
|
|
282
292
|
AccordionItem,
|
|
283
293
|
{
|
|
284
294
|
key: item.key,
|
|
@@ -293,7 +303,7 @@ var Accordion = ({ children, ...props }) => {
|
|
|
293
303
|
Accordion.Item = Item;
|
|
294
304
|
|
|
295
305
|
// src/Aside/Aside.tsx
|
|
296
|
-
import
|
|
306
|
+
import { Children as Children2 } from "react";
|
|
297
307
|
import { cn as cn2, createVar, gapSpace } from "@marigold/system";
|
|
298
308
|
var classNames = {
|
|
299
309
|
aside: "grow basis-[--sideWidth]",
|
|
@@ -307,12 +317,12 @@ var Aside = ({
|
|
|
307
317
|
stretch = true,
|
|
308
318
|
wrap = "50%"
|
|
309
319
|
}) => {
|
|
310
|
-
const [left, right] =
|
|
320
|
+
const [left, right] = Children2.toArray(children);
|
|
311
321
|
const vars = {
|
|
312
322
|
aside: createVar({ sideWidth }),
|
|
313
323
|
content: createVar({ wrap })
|
|
314
324
|
};
|
|
315
|
-
return /* @__PURE__ */
|
|
325
|
+
return /* @__PURE__ */ React.createElement(
|
|
316
326
|
"div",
|
|
317
327
|
{
|
|
318
328
|
className: cn2(
|
|
@@ -321,7 +331,7 @@ var Aside = ({
|
|
|
321
331
|
!stretch && "items-start"
|
|
322
332
|
)
|
|
323
333
|
},
|
|
324
|
-
/* @__PURE__ */
|
|
334
|
+
/* @__PURE__ */ React.createElement(
|
|
325
335
|
"div",
|
|
326
336
|
{
|
|
327
337
|
className: classNames[side === "left" ? "aside" : "content"],
|
|
@@ -329,7 +339,7 @@ var Aside = ({
|
|
|
329
339
|
},
|
|
330
340
|
left
|
|
331
341
|
),
|
|
332
|
-
/* @__PURE__ */
|
|
342
|
+
/* @__PURE__ */ React.createElement(
|
|
333
343
|
"div",
|
|
334
344
|
{
|
|
335
345
|
className: classNames[side === "right" ? "aside" : "content"],
|
|
@@ -341,13 +351,12 @@ var Aside = ({
|
|
|
341
351
|
};
|
|
342
352
|
|
|
343
353
|
// src/Aspect/Aspect.tsx
|
|
344
|
-
import
|
|
345
|
-
import { cn as cn3, createVar as createVar2, aspect } from "@marigold/system";
|
|
354
|
+
import { aspect, cn as cn3, createVar as createVar2 } from "@marigold/system";
|
|
346
355
|
var Aspect = ({
|
|
347
356
|
ratio = "square",
|
|
348
357
|
maxWidth,
|
|
349
358
|
children
|
|
350
|
-
}) => /* @__PURE__ */
|
|
359
|
+
}) => /* @__PURE__ */ React.createElement(
|
|
351
360
|
"div",
|
|
352
361
|
{
|
|
353
362
|
className: cn3("overflow-hidden", aspect[ratio], "max-w-[var(--maxWidth)]"),
|
|
@@ -357,57 +366,21 @@ var Aspect = ({
|
|
|
357
366
|
);
|
|
358
367
|
|
|
359
368
|
// src/Autocomplete/Autocomplete.tsx
|
|
360
|
-
import
|
|
369
|
+
import { useRef as useRef7 } from "react";
|
|
361
370
|
import { useSearchAutocomplete } from "@react-aria/autocomplete";
|
|
362
371
|
import { useFilter } from "@react-aria/i18n";
|
|
363
|
-
import { useComboBoxState } from "@react-stately/combobox";
|
|
364
372
|
import { Item as Item2 } from "@react-stately/collections";
|
|
373
|
+
import { useComboBoxState } from "@react-stately/combobox";
|
|
365
374
|
|
|
366
375
|
// src/FieldBase/FieldBase.tsx
|
|
367
|
-
import React12 from "react";
|
|
368
376
|
import {
|
|
369
377
|
cn as cn6,
|
|
370
|
-
|
|
371
|
-
|
|
378
|
+
width as twWidth,
|
|
379
|
+
useClassNames as useClassNames5
|
|
372
380
|
} from "@marigold/system";
|
|
373
381
|
|
|
374
|
-
// src/Label/Label.tsx
|
|
375
|
-
import React9 from "react";
|
|
376
|
-
import { SVG as SVG3, cn as cn4, createVar as createVar3, useClassNames as useClassNames3 } from "@marigold/system";
|
|
377
|
-
var Label = ({
|
|
378
|
-
as = "label",
|
|
379
|
-
children,
|
|
380
|
-
variant,
|
|
381
|
-
size,
|
|
382
|
-
labelWidth,
|
|
383
|
-
...props
|
|
384
|
-
}) => {
|
|
385
|
-
const Component = as;
|
|
386
|
-
const classNames2 = useClassNames3({ component: "Label", size, variant });
|
|
387
|
-
return /* @__PURE__ */ React9.createElement(
|
|
388
|
-
Component,
|
|
389
|
-
{
|
|
390
|
-
...props,
|
|
391
|
-
className: cn4(classNames2.container, "flex w-[var(--labelWidth)]"),
|
|
392
|
-
style: createVar3({ labelWidth })
|
|
393
|
-
},
|
|
394
|
-
children,
|
|
395
|
-
/* @__PURE__ */ React9.createElement(
|
|
396
|
-
SVG3,
|
|
397
|
-
{
|
|
398
|
-
viewBox: "0 0 24 24",
|
|
399
|
-
role: "presentation",
|
|
400
|
-
size: 16,
|
|
401
|
-
className: cn4("hidden", classNames2.indicator)
|
|
402
|
-
},
|
|
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
|
-
)
|
|
405
|
-
);
|
|
406
|
-
};
|
|
407
|
-
|
|
408
382
|
// src/HelpText/HelpText.tsx
|
|
409
|
-
import
|
|
410
|
-
import { SVG as SVG4, cn as cn5, useClassNames as useClassNames4 } from "@marigold/system";
|
|
383
|
+
import { SVG as SVG3, cn as cn4, useClassNames as useClassNames3 } from "@marigold/system";
|
|
411
384
|
var HelpText = ({
|
|
412
385
|
variant,
|
|
413
386
|
size,
|
|
@@ -421,38 +394,70 @@ var HelpText = ({
|
|
|
421
394
|
...props
|
|
422
395
|
}) => {
|
|
423
396
|
const hasErrorMessage = errorMessage && error;
|
|
424
|
-
const classNames2 =
|
|
397
|
+
const classNames2 = useClassNames3({
|
|
425
398
|
component: "HelpText",
|
|
426
399
|
variant,
|
|
427
400
|
size,
|
|
428
401
|
className
|
|
429
402
|
});
|
|
430
|
-
return /* @__PURE__ */
|
|
403
|
+
return /* @__PURE__ */ React.createElement(
|
|
431
404
|
"div",
|
|
432
405
|
{
|
|
433
406
|
...props,
|
|
434
407
|
...hasErrorMessage ? errorMessageProps : descriptionProps,
|
|
435
|
-
className:
|
|
408
|
+
className: cn4("flex items-center gap-1", classNames2.container)
|
|
436
409
|
},
|
|
437
|
-
hasErrorMessage ? /* @__PURE__ */
|
|
438
|
-
|
|
410
|
+
hasErrorMessage ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
411
|
+
SVG3,
|
|
439
412
|
{
|
|
440
|
-
className:
|
|
413
|
+
className: cn4("h-4 w-4", classNames2.icon),
|
|
441
414
|
viewBox: "0 0 24 24",
|
|
442
415
|
role: "presentation"
|
|
443
416
|
},
|
|
444
|
-
/* @__PURE__ */
|
|
445
|
-
), errorMessage) : /* @__PURE__ */
|
|
417
|
+
/* @__PURE__ */ React.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" })
|
|
418
|
+
), errorMessage) : /* @__PURE__ */ React.createElement(React.Fragment, null, description)
|
|
419
|
+
);
|
|
420
|
+
};
|
|
421
|
+
|
|
422
|
+
// src/Label/Label.tsx
|
|
423
|
+
import { SVG as SVG4, cn as cn5, createVar as createVar3, useClassNames as useClassNames4 } from "@marigold/system";
|
|
424
|
+
var Label = ({
|
|
425
|
+
as = "label",
|
|
426
|
+
children,
|
|
427
|
+
variant,
|
|
428
|
+
size,
|
|
429
|
+
labelWidth,
|
|
430
|
+
...props
|
|
431
|
+
}) => {
|
|
432
|
+
const Component = as;
|
|
433
|
+
const classNames2 = useClassNames4({ component: "Label", size, variant });
|
|
434
|
+
return /* @__PURE__ */ React.createElement(
|
|
435
|
+
Component,
|
|
436
|
+
{
|
|
437
|
+
...props,
|
|
438
|
+
className: cn5(classNames2.container, "flex w-[var(--labelWidth)]"),
|
|
439
|
+
style: createVar3({ labelWidth })
|
|
440
|
+
},
|
|
441
|
+
children,
|
|
442
|
+
/* @__PURE__ */ React.createElement(
|
|
443
|
+
SVG4,
|
|
444
|
+
{
|
|
445
|
+
viewBox: "0 0 24 24",
|
|
446
|
+
role: "presentation",
|
|
447
|
+
size: 16,
|
|
448
|
+
className: cn5("hidden", classNames2.indicator)
|
|
449
|
+
},
|
|
450
|
+
/* @__PURE__ */ React.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" })
|
|
451
|
+
)
|
|
446
452
|
);
|
|
447
453
|
};
|
|
448
454
|
|
|
449
455
|
// src/FieldBase/FieldGroup.tsx
|
|
450
|
-
import React11 from "react";
|
|
451
456
|
import { createContext, useContext } from "react";
|
|
452
457
|
var FieldGroupContext = createContext({});
|
|
453
458
|
var useFieldGroupContext = () => useContext(FieldGroupContext);
|
|
454
459
|
var FieldGroup = ({ labelWidth, children }) => {
|
|
455
|
-
return /* @__PURE__ */
|
|
460
|
+
return /* @__PURE__ */ React.createElement(FieldGroupContext.Provider, { value: { labelWidth } }, children);
|
|
456
461
|
};
|
|
457
462
|
|
|
458
463
|
// src/FieldBase/FieldBase.tsx
|
|
@@ -479,14 +484,14 @@ var FieldBase = ({
|
|
|
479
484
|
variant,
|
|
480
485
|
size
|
|
481
486
|
});
|
|
482
|
-
return /* @__PURE__ */
|
|
487
|
+
return /* @__PURE__ */ React.createElement(
|
|
483
488
|
"div",
|
|
484
489
|
{
|
|
485
490
|
...props,
|
|
486
491
|
...stateProps,
|
|
487
492
|
className: cn6("group/field", twWidth[width], classNames2)
|
|
488
493
|
},
|
|
489
|
-
label && /* @__PURE__ */
|
|
494
|
+
label && /* @__PURE__ */ React.createElement(
|
|
490
495
|
Label,
|
|
491
496
|
{
|
|
492
497
|
variant,
|
|
@@ -497,7 +502,7 @@ var FieldBase = ({
|
|
|
497
502
|
label
|
|
498
503
|
),
|
|
499
504
|
children,
|
|
500
|
-
hasHelpText && /* @__PURE__ */
|
|
505
|
+
hasHelpText && /* @__PURE__ */ React.createElement(
|
|
501
506
|
HelpText,
|
|
502
507
|
{
|
|
503
508
|
variant,
|
|
@@ -514,7 +519,10 @@ var FieldBase = ({
|
|
|
514
519
|
};
|
|
515
520
|
|
|
516
521
|
// src/Input/Input.tsx
|
|
517
|
-
import
|
|
522
|
+
import {
|
|
523
|
+
cloneElement as cloneElement2,
|
|
524
|
+
forwardRef as forwardRef4
|
|
525
|
+
} from "react";
|
|
518
526
|
import { cn as cn7, useClassNames as useClassNames6 } from "@marigold/system";
|
|
519
527
|
var Input = forwardRef4(
|
|
520
528
|
({
|
|
@@ -532,7 +540,7 @@ var Input = forwardRef4(
|
|
|
532
540
|
size,
|
|
533
541
|
className
|
|
534
542
|
});
|
|
535
|
-
const inputIcon = icon ?
|
|
543
|
+
const inputIcon = icon ? cloneElement2(icon, {
|
|
536
544
|
className: cn7(
|
|
537
545
|
"pointer-events-none absolute",
|
|
538
546
|
classNames2.icon,
|
|
@@ -540,7 +548,7 @@ var Input = forwardRef4(
|
|
|
540
548
|
),
|
|
541
549
|
...icon.props
|
|
542
550
|
}) : null;
|
|
543
|
-
const inputAction = action && !props.readOnly ?
|
|
551
|
+
const inputAction = action && !props.readOnly ? cloneElement2(action, {
|
|
544
552
|
className: cn7(
|
|
545
553
|
"absolute",
|
|
546
554
|
classNames2.action,
|
|
@@ -548,7 +556,7 @@ var Input = forwardRef4(
|
|
|
548
556
|
),
|
|
549
557
|
...action.props
|
|
550
558
|
}) : null;
|
|
551
|
-
return /* @__PURE__ */
|
|
559
|
+
return /* @__PURE__ */ React.createElement(
|
|
552
560
|
"div",
|
|
553
561
|
{
|
|
554
562
|
className: "group/input relative flex items-center",
|
|
@@ -556,7 +564,7 @@ var Input = forwardRef4(
|
|
|
556
564
|
"data-action": action && ""
|
|
557
565
|
},
|
|
558
566
|
inputIcon,
|
|
559
|
-
/* @__PURE__ */
|
|
567
|
+
/* @__PURE__ */ React.createElement(
|
|
560
568
|
"input",
|
|
561
569
|
{
|
|
562
570
|
...props,
|
|
@@ -578,22 +586,18 @@ var Input = forwardRef4(
|
|
|
578
586
|
);
|
|
579
587
|
|
|
580
588
|
// src/ListBox/ListBox.tsx
|
|
581
|
-
import
|
|
589
|
+
import { forwardRef as forwardRef5 } from "react";
|
|
590
|
+
import { useListBox } from "@react-aria/listbox";
|
|
582
591
|
import { useObjectRef as useObjectRef2 } from "@react-aria/utils";
|
|
583
592
|
import { cn as cn8, useClassNames as useClassNames7 } from "@marigold/system";
|
|
584
|
-
import { useListBox } from "@react-aria/listbox";
|
|
585
593
|
|
|
586
594
|
// src/ListBox/Context.ts
|
|
587
595
|
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
588
596
|
var ListBoxContext = createContext2({});
|
|
589
597
|
var useListBoxContext = () => useContext2(ListBoxContext);
|
|
590
598
|
|
|
591
|
-
// src/ListBox/ListBoxSection.tsx
|
|
592
|
-
import React15 from "react";
|
|
593
|
-
import { useListBoxSection } from "@react-aria/listbox";
|
|
594
|
-
|
|
595
599
|
// src/ListBox/ListBoxOption.tsx
|
|
596
|
-
import
|
|
600
|
+
import { useRef as useRef3 } from "react";
|
|
597
601
|
import { useOption } from "@react-aria/listbox";
|
|
598
602
|
import { mergeProps as mergeProps4 } from "@react-aria/utils";
|
|
599
603
|
import { useStateProps as useStateProps3 } from "@marigold/system";
|
|
@@ -613,7 +617,7 @@ var ListBoxOption = ({ item, state }) => {
|
|
|
613
617
|
disabled: isDisabled,
|
|
614
618
|
focusVisible: isFocused
|
|
615
619
|
});
|
|
616
|
-
return /* @__PURE__ */
|
|
620
|
+
return /* @__PURE__ */ React.createElement(
|
|
617
621
|
"li",
|
|
618
622
|
{
|
|
619
623
|
ref,
|
|
@@ -625,13 +629,14 @@ var ListBoxOption = ({ item, state }) => {
|
|
|
625
629
|
};
|
|
626
630
|
|
|
627
631
|
// src/ListBox/ListBoxSection.tsx
|
|
632
|
+
import { useListBoxSection } from "@react-aria/listbox";
|
|
628
633
|
var ListBoxSection = ({ section, state }) => {
|
|
629
634
|
const { classNames: classNames2 } = useListBoxContext();
|
|
630
635
|
const { itemProps, headingProps, groupProps } = useListBoxSection({
|
|
631
636
|
heading: section.rendered,
|
|
632
637
|
"aria-label": section["aria-label"]
|
|
633
638
|
});
|
|
634
|
-
return /* @__PURE__ */
|
|
639
|
+
return /* @__PURE__ */ React.createElement("li", { className: classNames2.section, ...itemProps }, section.rendered && /* @__PURE__ */ React.createElement("div", { className: classNames2.sectionTitle, ...headingProps }, section.rendered), /* @__PURE__ */ React.createElement("ul", { className: classNames2.list, ...groupProps }, [...section.props.children].map((node) => /* @__PURE__ */ React.createElement(ListBoxOption, { key: node.key, item: node, state }))));
|
|
635
640
|
};
|
|
636
641
|
|
|
637
642
|
// src/ListBox/ListBox.tsx
|
|
@@ -640,7 +645,7 @@ var ListBox = forwardRef5(
|
|
|
640
645
|
const innerRef = useObjectRef2(ref);
|
|
641
646
|
const { listBoxProps } = useListBox(props, state, innerRef);
|
|
642
647
|
const classNames2 = useClassNames7({ component: "ListBox", variant, size });
|
|
643
|
-
return /* @__PURE__ */
|
|
648
|
+
return /* @__PURE__ */ React.createElement(ListBoxContext.Provider, { value: { classNames: classNames2 } }, /* @__PURE__ */ React.createElement("div", { className: classNames2.container }, /* @__PURE__ */ React.createElement(
|
|
644
649
|
"ul",
|
|
645
650
|
{
|
|
646
651
|
className: cn8(
|
|
@@ -651,24 +656,23 @@ var ListBox = forwardRef5(
|
|
|
651
656
|
...listBoxProps
|
|
652
657
|
},
|
|
653
658
|
[...state.collection].map(
|
|
654
|
-
(item) => item.type === "section" ? /* @__PURE__ */
|
|
659
|
+
(item) => item.type === "section" ? /* @__PURE__ */ React.createElement(ListBoxSection, { key: item.key, section: item, state }) : /* @__PURE__ */ React.createElement(ListBoxOption, { key: item.key, item, state })
|
|
655
660
|
)
|
|
656
661
|
)));
|
|
657
662
|
}
|
|
658
663
|
);
|
|
659
664
|
|
|
660
665
|
// src/Overlay/Modal.tsx
|
|
661
|
-
import
|
|
666
|
+
import { forwardRef as forwardRef6 } from "react";
|
|
662
667
|
import { FocusScope } from "@react-aria/focus";
|
|
663
668
|
import { useModal, useOverlay, usePreventScroll } from "@react-aria/overlays";
|
|
664
669
|
import { mergeProps as mergeProps5, useObjectRef as useObjectRef3 } from "@react-aria/utils";
|
|
665
670
|
|
|
666
671
|
// src/Overlay/Underlay.tsx
|
|
667
|
-
import React17 from "react";
|
|
668
672
|
import { cn as cn9, useClassNames as useClassNames8 } from "@marigold/system";
|
|
669
673
|
var Underlay = ({ size, variant, ...props }) => {
|
|
670
674
|
const classNames2 = useClassNames8({ component: "Underlay", size, variant });
|
|
671
|
-
return /* @__PURE__ */
|
|
675
|
+
return /* @__PURE__ */ React.createElement("div", { className: cn9("fixed inset-0 z-40", classNames2), ...props });
|
|
672
676
|
};
|
|
673
677
|
|
|
674
678
|
// src/Overlay/Modal.tsx
|
|
@@ -686,20 +690,20 @@ var Modal = forwardRef6(
|
|
|
686
690
|
);
|
|
687
691
|
usePreventScroll();
|
|
688
692
|
const { modalProps } = useModal({});
|
|
689
|
-
return /* @__PURE__ */
|
|
693
|
+
return /* @__PURE__ */ React.createElement(FocusScope, { contain: true, restoreFocus: true, autoFocus: true }, /* @__PURE__ */ React.createElement(Underlay, { ...underlayProps, variant: "modal" }), /* @__PURE__ */ React.createElement(
|
|
690
694
|
"div",
|
|
691
695
|
{
|
|
692
696
|
className: "pointer-none fixed inset-0 z-50 flex items-center justify-center",
|
|
693
697
|
ref: modalRef,
|
|
694
698
|
...mergeProps5(props, overlayProps, modalProps)
|
|
695
699
|
},
|
|
696
|
-
/* @__PURE__ */
|
|
700
|
+
/* @__PURE__ */ React.createElement("div", { style: { pointerEvents: "auto" } }, children)
|
|
697
701
|
));
|
|
698
702
|
}
|
|
699
703
|
);
|
|
700
704
|
|
|
701
705
|
// src/Overlay/Overlay.tsx
|
|
702
|
-
import
|
|
706
|
+
import { useRef as useRef4 } from "react";
|
|
703
707
|
import {
|
|
704
708
|
Overlay as ReactAriaOverlay
|
|
705
709
|
} from "@react-aria/overlays";
|
|
@@ -711,7 +715,7 @@ var Overlay = ({ children, container, open }) => {
|
|
|
711
715
|
if (!mountOverlay) {
|
|
712
716
|
return null;
|
|
713
717
|
}
|
|
714
|
-
return /* @__PURE__ */
|
|
718
|
+
return /* @__PURE__ */ React.createElement(ReactAriaOverlay, { portalContainer: container }, /* @__PURE__ */ React.createElement(
|
|
715
719
|
"div",
|
|
716
720
|
{
|
|
717
721
|
ref: nodeRef,
|
|
@@ -724,19 +728,19 @@ var Overlay = ({ children, container, open }) => {
|
|
|
724
728
|
};
|
|
725
729
|
|
|
726
730
|
// src/Overlay/Popover.tsx
|
|
727
|
-
import
|
|
731
|
+
import { forwardRef as forwardRef7, useRef as useRef5 } from "react";
|
|
732
|
+
import { FocusScope as FocusScope2 } from "@react-aria/focus";
|
|
728
733
|
import {
|
|
729
734
|
DismissButton,
|
|
730
735
|
usePopover
|
|
731
736
|
} from "@react-aria/overlays";
|
|
732
|
-
import { FocusScope as FocusScope2 } from "@react-aria/focus";
|
|
733
737
|
import { useClassNames as useClassNames9 } from "@marigold/system";
|
|
734
738
|
var Popover = forwardRef7(
|
|
735
739
|
(props, ref) => {
|
|
736
740
|
const fallbackRef = useRef5(null);
|
|
737
741
|
const popoverRef = ref || fallbackRef;
|
|
738
742
|
let { children, state, ...otherProps } = props;
|
|
739
|
-
return /* @__PURE__ */
|
|
743
|
+
return /* @__PURE__ */ React.createElement(Overlay, { open: state.isOpen, ...otherProps }, /* @__PURE__ */ React.createElement(PopoverWrapper, { ref: popoverRef, ...props }, children));
|
|
740
744
|
}
|
|
741
745
|
);
|
|
742
746
|
var PopoverWrapper = forwardRef7(
|
|
@@ -761,7 +765,7 @@ var PopoverWrapper = forwardRef7(
|
|
|
761
765
|
component: "Popover",
|
|
762
766
|
variant: placement
|
|
763
767
|
});
|
|
764
|
-
return /* @__PURE__ */
|
|
768
|
+
return /* @__PURE__ */ React.createElement(FocusScope2, { restoreFocus: true }, !isNonModal && /* @__PURE__ */ React.createElement(Underlay, { ...underlayProps }), /* @__PURE__ */ React.createElement(
|
|
765
769
|
"div",
|
|
766
770
|
{
|
|
767
771
|
...popoverProps,
|
|
@@ -773,26 +777,25 @@ var PopoverWrapper = forwardRef7(
|
|
|
773
777
|
ref,
|
|
774
778
|
role: "presentation"
|
|
775
779
|
},
|
|
776
|
-
!isNonModal && /* @__PURE__ */
|
|
780
|
+
!isNonModal && /* @__PURE__ */ React.createElement(DismissButton, { onDismiss: state.close }),
|
|
777
781
|
children,
|
|
778
|
-
/* @__PURE__ */
|
|
782
|
+
/* @__PURE__ */ React.createElement(DismissButton, { onDismiss: state.close })
|
|
779
783
|
));
|
|
780
784
|
}
|
|
781
785
|
);
|
|
782
786
|
|
|
783
787
|
// src/Overlay/Tray.tsx
|
|
784
|
-
import
|
|
788
|
+
import { forwardRef as forwardRef8 } from "react";
|
|
785
789
|
import { FocusScope as FocusScope3 } from "@react-aria/focus";
|
|
786
790
|
import {
|
|
787
791
|
DismissButton as DismissButton2,
|
|
788
792
|
useModalOverlay
|
|
789
793
|
} from "@react-aria/overlays";
|
|
790
794
|
import { useObjectRef as useObjectRef4 } from "@react-aria/utils";
|
|
791
|
-
import { forwardRef as forwardRef8 } from "react";
|
|
792
795
|
var Tray = forwardRef8(
|
|
793
796
|
({ state, children, ...props }, ref) => {
|
|
794
797
|
const trayRef = useObjectRef4(ref);
|
|
795
|
-
return /* @__PURE__ */
|
|
798
|
+
return /* @__PURE__ */ React.createElement(Overlay, { open: state.isOpen }, /* @__PURE__ */ React.createElement(TrayWrapper, { state, ...props, ref: trayRef }, children));
|
|
796
799
|
}
|
|
797
800
|
);
|
|
798
801
|
var TrayWrapper = forwardRef8(
|
|
@@ -805,7 +808,7 @@ var TrayWrapper = forwardRef8(
|
|
|
805
808
|
state,
|
|
806
809
|
ref
|
|
807
810
|
);
|
|
808
|
-
return /* @__PURE__ */
|
|
811
|
+
return /* @__PURE__ */ React.createElement(FocusScope3, { contain: true, restoreFocus: true, autoFocus: true }, /* @__PURE__ */ React.createElement(Underlay, { ...underlayProps, variant: "modal" }, /* @__PURE__ */ React.createElement(
|
|
809
812
|
"div",
|
|
810
813
|
{
|
|
811
814
|
...modalProps,
|
|
@@ -813,18 +816,18 @@ var TrayWrapper = forwardRef8(
|
|
|
813
816
|
className: "absolute bottom-0 w-full",
|
|
814
817
|
"data-testid": "tray"
|
|
815
818
|
},
|
|
816
|
-
/* @__PURE__ */
|
|
819
|
+
/* @__PURE__ */ React.createElement(DismissButton2, { onDismiss: state.close }),
|
|
817
820
|
children,
|
|
818
|
-
/* @__PURE__ */
|
|
821
|
+
/* @__PURE__ */ React.createElement(DismissButton2, { onDismiss: state.close })
|
|
819
822
|
)));
|
|
820
823
|
}
|
|
821
824
|
);
|
|
822
825
|
|
|
823
826
|
// src/Autocomplete/ClearButton.tsx
|
|
824
|
-
import
|
|
825
|
-
import { useHover as useHover2 } from "@react-aria/interactions";
|
|
826
|
-
import { useFocusRing as useFocusRing3 } from "@react-aria/focus";
|
|
827
|
+
import { useRef as useRef6 } from "react";
|
|
827
828
|
import { useButton as useButton3 } from "@react-aria/button";
|
|
829
|
+
import { useFocusRing as useFocusRing3 } from "@react-aria/focus";
|
|
830
|
+
import { useHover as useHover2 } from "@react-aria/interactions";
|
|
828
831
|
import { mergeProps as mergeProps6 } from "@react-aria/utils";
|
|
829
832
|
import { cn as cn10, useStateProps as useStateProps4 } from "@marigold/system";
|
|
830
833
|
var ClearButton = ({
|
|
@@ -869,7 +872,7 @@ var ClearButton = ({
|
|
|
869
872
|
focusVisible: isFocusVisible,
|
|
870
873
|
hover: isHovered
|
|
871
874
|
});
|
|
872
|
-
return /* @__PURE__ */
|
|
875
|
+
return /* @__PURE__ */ React.createElement(
|
|
873
876
|
"button",
|
|
874
877
|
{
|
|
875
878
|
...mergeProps6(buttonProps, focusProps, hoverProps, props),
|
|
@@ -880,7 +883,7 @@ var ClearButton = ({
|
|
|
880
883
|
className
|
|
881
884
|
)
|
|
882
885
|
},
|
|
883
|
-
/* @__PURE__ */
|
|
886
|
+
/* @__PURE__ */ React.createElement(
|
|
884
887
|
"svg",
|
|
885
888
|
{
|
|
886
889
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -889,13 +892,13 @@ var ClearButton = ({
|
|
|
889
892
|
width: 20,
|
|
890
893
|
height: 20
|
|
891
894
|
},
|
|
892
|
-
/* @__PURE__ */
|
|
895
|
+
/* @__PURE__ */ React.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
896
|
)
|
|
894
897
|
);
|
|
895
898
|
};
|
|
896
899
|
|
|
897
900
|
// src/Autocomplete/Autocomplete.tsx
|
|
898
|
-
var SearchIcon = (props) => /* @__PURE__ */
|
|
901
|
+
var SearchIcon = (props) => /* @__PURE__ */ React.createElement(
|
|
899
902
|
"svg",
|
|
900
903
|
{
|
|
901
904
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -905,7 +908,7 @@ var SearchIcon = (props) => /* @__PURE__ */ React23.createElement(
|
|
|
905
908
|
height: 24,
|
|
906
909
|
...props
|
|
907
910
|
},
|
|
908
|
-
/* @__PURE__ */
|
|
911
|
+
/* @__PURE__ */ React.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
912
|
);
|
|
910
913
|
var Autocomplete = ({
|
|
911
914
|
disabled,
|
|
@@ -959,7 +962,7 @@ var Autocomplete = ({
|
|
|
959
962
|
state
|
|
960
963
|
);
|
|
961
964
|
const { isDisabled, ...restClearButtonProps } = clearButtonProps;
|
|
962
|
-
return /* @__PURE__ */
|
|
965
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
963
966
|
FieldBase,
|
|
964
967
|
{
|
|
965
968
|
label: props.label,
|
|
@@ -970,13 +973,13 @@ var Autocomplete = ({
|
|
|
970
973
|
disabled,
|
|
971
974
|
width
|
|
972
975
|
},
|
|
973
|
-
/* @__PURE__ */
|
|
976
|
+
/* @__PURE__ */ React.createElement(
|
|
974
977
|
Input,
|
|
975
978
|
{
|
|
976
979
|
...inputProps,
|
|
977
980
|
ref: inputRef,
|
|
978
|
-
icon: /* @__PURE__ */
|
|
979
|
-
action: state.inputValue !== "" ? /* @__PURE__ */
|
|
981
|
+
icon: /* @__PURE__ */ React.createElement(SearchIcon, null),
|
|
982
|
+
action: state.inputValue !== "" ? /* @__PURE__ */ React.createElement(
|
|
980
983
|
ClearButton,
|
|
981
984
|
{
|
|
982
985
|
preventFocus: true,
|
|
@@ -986,7 +989,7 @@ var Autocomplete = ({
|
|
|
986
989
|
) : null
|
|
987
990
|
}
|
|
988
991
|
)
|
|
989
|
-
), /* @__PURE__ */
|
|
992
|
+
), /* @__PURE__ */ React.createElement(
|
|
990
993
|
Popover,
|
|
991
994
|
{
|
|
992
995
|
state,
|
|
@@ -995,18 +998,18 @@ var Autocomplete = ({
|
|
|
995
998
|
scrollRef: listBoxRef,
|
|
996
999
|
isNonModal: true
|
|
997
1000
|
},
|
|
998
|
-
/* @__PURE__ */
|
|
1001
|
+
/* @__PURE__ */ React.createElement(ListBox, { ref: listBoxRef, state, ...listBoxProps })
|
|
999
1002
|
));
|
|
1000
1003
|
};
|
|
1001
1004
|
Autocomplete.Item = Item2;
|
|
1002
1005
|
|
|
1003
1006
|
// src/ComboBox/ComboBox.tsx
|
|
1004
|
-
import
|
|
1005
|
-
import {
|
|
1007
|
+
import React2 from "react";
|
|
1008
|
+
import { useButton as useButton4 } from "@react-aria/button";
|
|
1006
1009
|
import { useComboBox } from "@react-aria/combobox";
|
|
1007
1010
|
import { useFilter as useFilter2 } from "@react-aria/i18n";
|
|
1008
|
-
import { useButton as useButton4 } from "@react-aria/button";
|
|
1009
1011
|
import { Item as Item3 } from "@react-stately/collections";
|
|
1012
|
+
import { useComboBoxState as useComboBoxState2 } from "@react-stately/combobox";
|
|
1010
1013
|
var ComboBox = ({
|
|
1011
1014
|
error,
|
|
1012
1015
|
width,
|
|
@@ -1031,10 +1034,10 @@ var ComboBox = ({
|
|
|
1031
1034
|
};
|
|
1032
1035
|
const { contains } = useFilter2({ sensitivity: "base" });
|
|
1033
1036
|
const state = useComboBoxState2({ ...props, defaultFilter: contains });
|
|
1034
|
-
const buttonRef =
|
|
1035
|
-
const inputRef =
|
|
1036
|
-
const listBoxRef =
|
|
1037
|
-
const popoverRef =
|
|
1037
|
+
const buttonRef = React2.useRef(null);
|
|
1038
|
+
const inputRef = React2.useRef(null);
|
|
1039
|
+
const listBoxRef = React2.useRef(null);
|
|
1040
|
+
const popoverRef = React2.useRef(null);
|
|
1038
1041
|
const {
|
|
1039
1042
|
buttonProps: triggerProps,
|
|
1040
1043
|
inputProps,
|
|
@@ -1047,7 +1050,7 @@ var ComboBox = ({
|
|
|
1047
1050
|
const errorMessageProps = { "aria-invalid": error };
|
|
1048
1051
|
const { buttonProps } = useButton4(triggerProps, buttonRef);
|
|
1049
1052
|
const { label, description, errorMessage } = props;
|
|
1050
|
-
return /* @__PURE__ */
|
|
1053
|
+
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(
|
|
1051
1054
|
FieldBase,
|
|
1052
1055
|
{
|
|
1053
1056
|
label,
|
|
@@ -1058,23 +1061,23 @@ var ComboBox = ({
|
|
|
1058
1061
|
errorMessageProps,
|
|
1059
1062
|
width
|
|
1060
1063
|
},
|
|
1061
|
-
/* @__PURE__ */
|
|
1064
|
+
/* @__PURE__ */ React2.createElement(
|
|
1062
1065
|
Input,
|
|
1063
1066
|
{
|
|
1064
1067
|
...inputProps,
|
|
1065
1068
|
ref: inputRef,
|
|
1066
|
-
action: /* @__PURE__ */
|
|
1069
|
+
action: /* @__PURE__ */ React2.createElement(
|
|
1067
1070
|
Button,
|
|
1068
1071
|
{
|
|
1069
1072
|
className: "absolute right-2 h-4 w-4 border-none bg-transparent p-0",
|
|
1070
1073
|
ref: buttonRef,
|
|
1071
1074
|
...buttonProps
|
|
1072
1075
|
},
|
|
1073
|
-
/* @__PURE__ */
|
|
1076
|
+
/* @__PURE__ */ React2.createElement(ChevronDown, { className: "h-4 w-4" })
|
|
1074
1077
|
)
|
|
1075
1078
|
}
|
|
1076
1079
|
)
|
|
1077
|
-
), /* @__PURE__ */
|
|
1080
|
+
), /* @__PURE__ */ React2.createElement(
|
|
1078
1081
|
Popover,
|
|
1079
1082
|
{
|
|
1080
1083
|
state,
|
|
@@ -1083,22 +1086,20 @@ var ComboBox = ({
|
|
|
1083
1086
|
scrollRef: listBoxRef,
|
|
1084
1087
|
isNonModal: true
|
|
1085
1088
|
},
|
|
1086
|
-
/* @__PURE__ */
|
|
1089
|
+
/* @__PURE__ */ React2.createElement(ListBox, { ref: listBoxRef, state, ...listBoxProps })
|
|
1087
1090
|
));
|
|
1088
1091
|
};
|
|
1089
1092
|
ComboBox.Item = Item3;
|
|
1090
1093
|
|
|
1091
1094
|
// src/Badge/Badge.tsx
|
|
1092
|
-
import React25 from "react";
|
|
1093
1095
|
import { useClassNames as useClassNames10 } from "@marigold/system";
|
|
1094
1096
|
var Badge = ({ variant, size, children, ...props }) => {
|
|
1095
1097
|
const classNames2 = useClassNames10({ component: "Badge", variant, size });
|
|
1096
|
-
return /* @__PURE__ */
|
|
1098
|
+
return /* @__PURE__ */ React.createElement("div", { ...props, className: classNames2 }, children);
|
|
1097
1099
|
};
|
|
1098
1100
|
|
|
1099
1101
|
// src/Breakout/Breakout.tsx
|
|
1100
|
-
import
|
|
1101
|
-
import { cn as cn11, createVar as createVar4, alignment } from "@marigold/system";
|
|
1102
|
+
import { alignment, cn as cn11, createVar as createVar4 } from "@marigold/system";
|
|
1102
1103
|
var Breakout = ({
|
|
1103
1104
|
height,
|
|
1104
1105
|
children,
|
|
@@ -1108,7 +1109,7 @@ var Breakout = ({
|
|
|
1108
1109
|
...props
|
|
1109
1110
|
}) => {
|
|
1110
1111
|
var _a, _b, _c, _d;
|
|
1111
|
-
return /* @__PURE__ */
|
|
1112
|
+
return /* @__PURE__ */ React.createElement(
|
|
1112
1113
|
"div",
|
|
1113
1114
|
{
|
|
1114
1115
|
className: cn11(
|
|
@@ -1126,15 +1127,13 @@ var Breakout = ({
|
|
|
1126
1127
|
};
|
|
1127
1128
|
|
|
1128
1129
|
// src/Body/Body.tsx
|
|
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__ */ React.createElement("section", { ...props, className: classNames2 }, children);
|
|
1134
1134
|
};
|
|
1135
1135
|
|
|
1136
1136
|
// src/Card/Card.tsx
|
|
1137
|
-
import React28 from "react";
|
|
1138
1137
|
import {
|
|
1139
1138
|
cn as cn12,
|
|
1140
1139
|
gapSpace as gapSpace2,
|
|
@@ -1162,7 +1161,7 @@ var Card = ({
|
|
|
1162
1161
|
...props
|
|
1163
1162
|
}) => {
|
|
1164
1163
|
const classNames2 = useClassNames12({ component: "Card", variant, size });
|
|
1165
|
-
return /* @__PURE__ */
|
|
1164
|
+
return /* @__PURE__ */ React.createElement(
|
|
1166
1165
|
"div",
|
|
1167
1166
|
{
|
|
1168
1167
|
...props,
|
|
@@ -1184,7 +1183,6 @@ var Card = ({
|
|
|
1184
1183
|
};
|
|
1185
1184
|
|
|
1186
1185
|
// src/Center/Center.tsx
|
|
1187
|
-
import React29 from "react";
|
|
1188
1186
|
import { cn as cn13, createVar as createVar5, gapSpace as gapSpace3 } from "@marigold/system";
|
|
1189
1187
|
var Center = ({
|
|
1190
1188
|
maxWidth = "100%",
|
|
@@ -1192,7 +1190,7 @@ var Center = ({
|
|
|
1192
1190
|
children,
|
|
1193
1191
|
...props
|
|
1194
1192
|
}) => {
|
|
1195
|
-
return /* @__PURE__ */
|
|
1193
|
+
return /* @__PURE__ */ React.createElement(
|
|
1196
1194
|
"div",
|
|
1197
1195
|
{
|
|
1198
1196
|
className: cn13(
|
|
@@ -1208,7 +1206,7 @@ var Center = ({
|
|
|
1208
1206
|
};
|
|
1209
1207
|
|
|
1210
1208
|
// src/Checkbox/Checkbox.tsx
|
|
1211
|
-
import
|
|
1209
|
+
import { forwardRef as forwardRef9 } from "react";
|
|
1212
1210
|
import { useCheckbox, useCheckboxGroupItem } from "@react-aria/checkbox";
|
|
1213
1211
|
import { useFocusRing as useFocusRing4 } from "@react-aria/focus";
|
|
1214
1212
|
import { useHover as useHover3 } from "@react-aria/interactions";
|
|
@@ -1228,7 +1226,7 @@ var CheckboxField = ({ children, labelWidth }) => {
|
|
|
1228
1226
|
};
|
|
1229
1227
|
|
|
1230
1228
|
// src/Checkbox/CheckboxGroup.tsx
|
|
1231
|
-
import
|
|
1229
|
+
import { createContext as createContext3, useContext as useContext3 } from "react";
|
|
1232
1230
|
import { useCheckboxGroup } from "@react-aria/checkbox";
|
|
1233
1231
|
import {
|
|
1234
1232
|
useCheckboxGroupState
|
|
@@ -1261,7 +1259,7 @@ var CheckboxGroup = ({
|
|
|
1261
1259
|
readOnly,
|
|
1262
1260
|
error
|
|
1263
1261
|
});
|
|
1264
|
-
return /* @__PURE__ */
|
|
1262
|
+
return /* @__PURE__ */ React.createElement(
|
|
1265
1263
|
FieldBase,
|
|
1266
1264
|
{
|
|
1267
1265
|
label: props.label,
|
|
@@ -1276,12 +1274,12 @@ var CheckboxGroup = ({
|
|
|
1276
1274
|
width,
|
|
1277
1275
|
...groupProps
|
|
1278
1276
|
},
|
|
1279
|
-
/* @__PURE__ */
|
|
1277
|
+
/* @__PURE__ */ React.createElement("div", { role: "presentation", className: "flex flex-col items-start" }, /* @__PURE__ */ React.createElement(CheckboxGroupContext.Provider, { value: { error, ...state } }, children))
|
|
1280
1278
|
);
|
|
1281
1279
|
};
|
|
1282
1280
|
|
|
1283
1281
|
// src/Checkbox/Checkbox.tsx
|
|
1284
|
-
var CheckMark = () => /* @__PURE__ */
|
|
1282
|
+
var CheckMark = () => /* @__PURE__ */ React.createElement("svg", { viewBox: "0 0 12 10" }, /* @__PURE__ */ React.createElement(
|
|
1285
1283
|
"path",
|
|
1286
1284
|
{
|
|
1287
1285
|
fill: "currentColor",
|
|
@@ -1289,7 +1287,7 @@ var CheckMark = () => /* @__PURE__ */ React31.createElement("svg", { viewBox: "0
|
|
|
1289
1287
|
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"
|
|
1290
1288
|
}
|
|
1291
1289
|
));
|
|
1292
|
-
var IndeterminateMark = () => /* @__PURE__ */
|
|
1290
|
+
var IndeterminateMark = () => /* @__PURE__ */ React.createElement("svg", { width: "12", height: "3", viewBox: "0 0 12 3" }, /* @__PURE__ */ React.createElement(
|
|
1293
1291
|
"path",
|
|
1294
1292
|
{
|
|
1295
1293
|
fill: "currentColor",
|
|
@@ -1298,7 +1296,7 @@ var IndeterminateMark = () => /* @__PURE__ */ React31.createElement("svg", { wid
|
|
|
1298
1296
|
}
|
|
1299
1297
|
));
|
|
1300
1298
|
var Icon = ({ className, checked, indeterminate, ...props }) => {
|
|
1301
|
-
return /* @__PURE__ */
|
|
1299
|
+
return /* @__PURE__ */ React.createElement(
|
|
1302
1300
|
"div",
|
|
1303
1301
|
{
|
|
1304
1302
|
"aria-hidden": "true",
|
|
@@ -1311,7 +1309,7 @@ var Icon = ({ className, checked, indeterminate, ...props }) => {
|
|
|
1311
1309
|
),
|
|
1312
1310
|
...props
|
|
1313
1311
|
},
|
|
1314
|
-
indeterminate ? /* @__PURE__ */
|
|
1312
|
+
indeterminate ? /* @__PURE__ */ React.createElement(IndeterminateMark, null) : checked ? /* @__PURE__ */ React.createElement(CheckMark, null) : null
|
|
1315
1313
|
);
|
|
1316
1314
|
};
|
|
1317
1315
|
var Checkbox = forwardRef9(
|
|
@@ -1378,7 +1376,7 @@ var Checkbox = forwardRef9(
|
|
|
1378
1376
|
readOnly,
|
|
1379
1377
|
indeterminate
|
|
1380
1378
|
});
|
|
1381
|
-
const component = /* @__PURE__ */
|
|
1379
|
+
const component = /* @__PURE__ */ React.createElement(
|
|
1382
1380
|
"label",
|
|
1383
1381
|
{
|
|
1384
1382
|
className: cn14(
|
|
@@ -1388,7 +1386,7 @@ var Checkbox = forwardRef9(
|
|
|
1388
1386
|
...hoverProps,
|
|
1389
1387
|
...stateProps
|
|
1390
1388
|
},
|
|
1391
|
-
/* @__PURE__ */
|
|
1389
|
+
/* @__PURE__ */ React.createElement(
|
|
1392
1390
|
"input",
|
|
1393
1391
|
{
|
|
1394
1392
|
ref: inputRef,
|
|
@@ -1397,7 +1395,7 @@ var Checkbox = forwardRef9(
|
|
|
1397
1395
|
...focusProps
|
|
1398
1396
|
}
|
|
1399
1397
|
),
|
|
1400
|
-
/* @__PURE__ */
|
|
1398
|
+
/* @__PURE__ */ React.createElement(
|
|
1401
1399
|
Icon,
|
|
1402
1400
|
{
|
|
1403
1401
|
checked: inputProps.checked,
|
|
@@ -1405,18 +1403,14 @@ var Checkbox = forwardRef9(
|
|
|
1405
1403
|
className: classNames2.checkbox
|
|
1406
1404
|
}
|
|
1407
1405
|
),
|
|
1408
|
-
props.children && /* @__PURE__ */
|
|
1406
|
+
props.children && /* @__PURE__ */ React.createElement("div", { className: classNames2.label }, props.children)
|
|
1409
1407
|
);
|
|
1410
|
-
return !groupState && labelWidth ? /* @__PURE__ */
|
|
1408
|
+
return !groupState && labelWidth ? /* @__PURE__ */ React.createElement(CheckboxField, { labelWidth }, component) : component;
|
|
1411
1409
|
}
|
|
1412
1410
|
);
|
|
1413
1411
|
|
|
1414
1412
|
// src/Columns/Columns.tsx
|
|
1415
|
-
import
|
|
1416
|
-
Children as Children2,
|
|
1417
|
-
cloneElement as cloneElement2,
|
|
1418
|
-
isValidElement
|
|
1419
|
-
} from "react";
|
|
1413
|
+
import { Children as Children3, cloneElement as cloneElement3, isValidElement as isValidElement2 } from "react";
|
|
1420
1414
|
import { cn as cn15, createVar as createVar7, gapSpace as gapSpace4 } from "@marigold/system";
|
|
1421
1415
|
var Columns = ({
|
|
1422
1416
|
space = 0,
|
|
@@ -1426,14 +1420,14 @@ var Columns = ({
|
|
|
1426
1420
|
children,
|
|
1427
1421
|
...props
|
|
1428
1422
|
}) => {
|
|
1429
|
-
if (
|
|
1423
|
+
if (Children3.count(children) !== columns.length) {
|
|
1430
1424
|
throw new Error(
|
|
1431
|
-
`Columns: expected ${columns.length} children, got ${
|
|
1425
|
+
`Columns: expected ${columns.length} children, got ${Children3.count(
|
|
1432
1426
|
children
|
|
1433
1427
|
)}`
|
|
1434
1428
|
);
|
|
1435
1429
|
}
|
|
1436
|
-
return /* @__PURE__ */
|
|
1430
|
+
return /* @__PURE__ */ React.createElement(
|
|
1437
1431
|
"div",
|
|
1438
1432
|
{
|
|
1439
1433
|
className: cn15(
|
|
@@ -1443,7 +1437,7 @@ var Columns = ({
|
|
|
1443
1437
|
),
|
|
1444
1438
|
...props
|
|
1445
1439
|
},
|
|
1446
|
-
|
|
1440
|
+
Children3.map(children, (child, idx) => /* @__PURE__ */ React.createElement(
|
|
1447
1441
|
"div",
|
|
1448
1442
|
{
|
|
1449
1443
|
className: cn15(
|
|
@@ -1451,19 +1445,18 @@ var Columns = ({
|
|
|
1451
1445
|
),
|
|
1452
1446
|
style: createVar7({ collapseAt, columnSize: columns[idx] })
|
|
1453
1447
|
},
|
|
1454
|
-
|
|
1448
|
+
isValidElement2(child) ? cloneElement3(child) : child
|
|
1455
1449
|
))
|
|
1456
1450
|
);
|
|
1457
1451
|
};
|
|
1458
1452
|
|
|
1459
1453
|
// src/Container/Container.tsx
|
|
1460
|
-
import React33 from "react";
|
|
1461
1454
|
import {
|
|
1462
1455
|
cn as cn16,
|
|
1463
1456
|
createVar as createVar8,
|
|
1464
|
-
placeItems,
|
|
1465
1457
|
gridColsAlign,
|
|
1466
|
-
gridColumn
|
|
1458
|
+
gridColumn,
|
|
1459
|
+
placeItems
|
|
1467
1460
|
} from "@marigold/system";
|
|
1468
1461
|
var content = {
|
|
1469
1462
|
small: "20ch",
|
|
@@ -1484,7 +1477,7 @@ var Container = ({
|
|
|
1484
1477
|
...props
|
|
1485
1478
|
}) => {
|
|
1486
1479
|
const maxWidth = contentType === "content" ? content[size] : header[size];
|
|
1487
|
-
return /* @__PURE__ */
|
|
1480
|
+
return /* @__PURE__ */ React.createElement(
|
|
1488
1481
|
"div",
|
|
1489
1482
|
{
|
|
1490
1483
|
className: cn16(
|
|
@@ -1501,13 +1494,17 @@ var Container = ({
|
|
|
1501
1494
|
};
|
|
1502
1495
|
|
|
1503
1496
|
// src/Dialog/Dialog.tsx
|
|
1504
|
-
import
|
|
1497
|
+
import {
|
|
1498
|
+
Children as Children5,
|
|
1499
|
+
cloneElement as cloneElement4,
|
|
1500
|
+
isValidElement as isValidElement3,
|
|
1501
|
+
useRef as useRef9
|
|
1502
|
+
} from "react";
|
|
1505
1503
|
import { useButton as useButton5 } from "@react-aria/button";
|
|
1506
1504
|
import { useDialog } from "@react-aria/dialog";
|
|
1507
1505
|
import { cn as cn19, useClassNames as useClassNames17 } from "@marigold/system";
|
|
1508
1506
|
|
|
1509
1507
|
// src/Header/Header.tsx
|
|
1510
|
-
import React34 from "react";
|
|
1511
1508
|
import { cn as cn17, useClassNames as useClassNames15 } from "@marigold/system";
|
|
1512
1509
|
var Header = ({
|
|
1513
1510
|
children,
|
|
@@ -1522,18 +1519,17 @@ var Header = ({
|
|
|
1522
1519
|
size,
|
|
1523
1520
|
className
|
|
1524
1521
|
});
|
|
1525
|
-
return /* @__PURE__ */
|
|
1522
|
+
return /* @__PURE__ */ React.createElement("header", { ...props, className: cn17(classNames2) }, children);
|
|
1526
1523
|
};
|
|
1527
1524
|
|
|
1528
1525
|
// src/Headline/Headline.tsx
|
|
1529
|
-
import React35 from "react";
|
|
1530
1526
|
import {
|
|
1531
|
-
useClassNames as useClassNames16,
|
|
1532
1527
|
cn as cn18,
|
|
1533
1528
|
createVar as createVar9,
|
|
1529
|
+
get,
|
|
1534
1530
|
textAlign,
|
|
1535
|
-
|
|
1536
|
-
|
|
1531
|
+
useClassNames as useClassNames16,
|
|
1532
|
+
useTheme as useTheme2
|
|
1537
1533
|
} from "@marigold/system";
|
|
1538
1534
|
var Headline = ({
|
|
1539
1535
|
children,
|
|
@@ -1552,7 +1548,7 @@ var Headline = ({
|
|
|
1552
1548
|
size: size != null ? size : `level-${level}`
|
|
1553
1549
|
});
|
|
1554
1550
|
const Component = as;
|
|
1555
|
-
return /* @__PURE__ */
|
|
1551
|
+
return /* @__PURE__ */ React.createElement(
|
|
1556
1552
|
Component,
|
|
1557
1553
|
{
|
|
1558
1554
|
...props,
|
|
@@ -1575,28 +1571,22 @@ import { createContext as createContext4, useContext as useContext4 } from "reac
|
|
|
1575
1571
|
var DialogContext = createContext4({});
|
|
1576
1572
|
var useDialogContext = () => useContext4(DialogContext);
|
|
1577
1573
|
|
|
1578
|
-
// src/Dialog/
|
|
1579
|
-
import
|
|
1580
|
-
import { PressResponder } from "@react-aria/interactions";
|
|
1574
|
+
// src/Dialog/DialogController.tsx
|
|
1575
|
+
import React3 from "react";
|
|
1581
1576
|
import { useOverlayTriggerState } from "@react-stately/overlays";
|
|
1582
|
-
var
|
|
1577
|
+
var DialogController = ({
|
|
1583
1578
|
children,
|
|
1584
1579
|
dismissable = true,
|
|
1585
|
-
keyboardDismissable = true
|
|
1580
|
+
keyboardDismissable = true,
|
|
1581
|
+
open,
|
|
1582
|
+
onOpenChange
|
|
1586
1583
|
}) => {
|
|
1587
|
-
const
|
|
1588
|
-
|
|
1589
|
-
|
|
1584
|
+
const state = useOverlayTriggerState({
|
|
1585
|
+
isOpen: open,
|
|
1586
|
+
onOpenChange
|
|
1587
|
+
});
|
|
1590
1588
|
const ctx = { open: state.isOpen, close: state.close };
|
|
1591
|
-
return /* @__PURE__ */
|
|
1592
|
-
PressResponder,
|
|
1593
|
-
{
|
|
1594
|
-
ref: dialogTriggerRef,
|
|
1595
|
-
isPressed: state.isOpen,
|
|
1596
|
-
onPress: state.toggle
|
|
1597
|
-
},
|
|
1598
|
-
dialogTrigger
|
|
1599
|
-
), /* @__PURE__ */ React36.createElement(Overlay, { open: state.isOpen }, /* @__PURE__ */ React36.createElement(
|
|
1589
|
+
return /* @__PURE__ */ React3.createElement(DialogContext.Provider, { value: ctx }, /* @__PURE__ */ React3.createElement(Overlay, { open: state.isOpen }, /* @__PURE__ */ React3.createElement(
|
|
1600
1590
|
Modal,
|
|
1601
1591
|
{
|
|
1602
1592
|
open: state.isOpen,
|
|
@@ -1604,26 +1594,32 @@ var DialogTrigger = ({
|
|
|
1604
1594
|
dismissable,
|
|
1605
1595
|
keyboardDismissable
|
|
1606
1596
|
},
|
|
1607
|
-
|
|
1597
|
+
children
|
|
1608
1598
|
)));
|
|
1609
1599
|
};
|
|
1610
1600
|
|
|
1611
|
-
// src/Dialog/
|
|
1601
|
+
// src/Dialog/DialogTrigger.tsx
|
|
1602
|
+
import { Children as Children4, useRef as useRef8 } from "react";
|
|
1603
|
+
import { PressResponder } from "@react-aria/interactions";
|
|
1612
1604
|
import { useOverlayTriggerState as useOverlayTriggerState2 } from "@react-stately/overlays";
|
|
1613
|
-
|
|
1614
|
-
var DialogController = ({
|
|
1605
|
+
var DialogTrigger = ({
|
|
1615
1606
|
children,
|
|
1616
1607
|
dismissable = true,
|
|
1617
|
-
keyboardDismissable = true
|
|
1618
|
-
open,
|
|
1619
|
-
onOpenChange
|
|
1608
|
+
keyboardDismissable = true
|
|
1620
1609
|
}) => {
|
|
1621
|
-
const
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
});
|
|
1610
|
+
const [dialogTrigger, dialog] = Children4.toArray(children);
|
|
1611
|
+
const dialogTriggerRef = useRef8(null);
|
|
1612
|
+
const state = useOverlayTriggerState2({});
|
|
1625
1613
|
const ctx = { open: state.isOpen, close: state.close };
|
|
1626
|
-
return /* @__PURE__ */
|
|
1614
|
+
return /* @__PURE__ */ React.createElement(DialogContext.Provider, { value: ctx }, /* @__PURE__ */ React.createElement(
|
|
1615
|
+
PressResponder,
|
|
1616
|
+
{
|
|
1617
|
+
ref: dialogTriggerRef,
|
|
1618
|
+
isPressed: state.isOpen,
|
|
1619
|
+
onPress: state.toggle
|
|
1620
|
+
},
|
|
1621
|
+
dialogTrigger
|
|
1622
|
+
), /* @__PURE__ */ React.createElement(Overlay, { open: state.isOpen }, /* @__PURE__ */ React.createElement(
|
|
1627
1623
|
Modal,
|
|
1628
1624
|
{
|
|
1629
1625
|
open: state.isOpen,
|
|
@@ -1631,7 +1627,7 @@ var DialogController = ({
|
|
|
1631
1627
|
dismissable,
|
|
1632
1628
|
keyboardDismissable
|
|
1633
1629
|
},
|
|
1634
|
-
|
|
1630
|
+
dialog
|
|
1635
1631
|
)));
|
|
1636
1632
|
};
|
|
1637
1633
|
|
|
@@ -1645,7 +1641,7 @@ var CloseButton = ({ className }) => {
|
|
|
1645
1641
|
},
|
|
1646
1642
|
ref
|
|
1647
1643
|
);
|
|
1648
|
-
return /* @__PURE__ */
|
|
1644
|
+
return /* @__PURE__ */ React.createElement("div", { className: "flex justify-end" }, /* @__PURE__ */ React.createElement(
|
|
1649
1645
|
"button",
|
|
1650
1646
|
{
|
|
1651
1647
|
className: cn19(
|
|
@@ -1655,7 +1651,7 @@ var CloseButton = ({ className }) => {
|
|
|
1655
1651
|
ref,
|
|
1656
1652
|
...buttonProps
|
|
1657
1653
|
},
|
|
1658
|
-
/* @__PURE__ */
|
|
1654
|
+
/* @__PURE__ */ React.createElement("svg", { viewBox: "0 0 20 20", fill: "currentColor" }, /* @__PURE__ */ React.createElement(
|
|
1659
1655
|
"path",
|
|
1660
1656
|
{
|
|
1661
1657
|
fillRule: "evenodd",
|
|
@@ -1666,9 +1662,9 @@ var CloseButton = ({ className }) => {
|
|
|
1666
1662
|
));
|
|
1667
1663
|
};
|
|
1668
1664
|
var addTitleProps = (children, titleProps) => {
|
|
1669
|
-
const childs =
|
|
1665
|
+
const childs = Children5.toArray(children);
|
|
1670
1666
|
const titleIndex = childs.findIndex(
|
|
1671
|
-
(child) =>
|
|
1667
|
+
(child) => isValidElement3(child) && (child.type === Header || child.type === Headline)
|
|
1672
1668
|
);
|
|
1673
1669
|
if (titleIndex < 0) {
|
|
1674
1670
|
console.warn(
|
|
@@ -1676,7 +1672,7 @@ var addTitleProps = (children, titleProps) => {
|
|
|
1676
1672
|
);
|
|
1677
1673
|
return children;
|
|
1678
1674
|
}
|
|
1679
|
-
const titleChild =
|
|
1675
|
+
const titleChild = cloneElement4(
|
|
1680
1676
|
childs[titleIndex],
|
|
1681
1677
|
titleProps
|
|
1682
1678
|
);
|
|
@@ -1694,36 +1690,33 @@ var Dialog = ({
|
|
|
1694
1690
|
const { close } = useDialogContext();
|
|
1695
1691
|
const { dialogProps, titleProps } = useDialog(props, ref);
|
|
1696
1692
|
const classNames2 = useClassNames17({ component: "Dialog", variant, size });
|
|
1697
|
-
return /* @__PURE__ */
|
|
1693
|
+
return /* @__PURE__ */ React.createElement("div", { className: classNames2.container, ...dialogProps }, closeButton && /* @__PURE__ */ React.createElement(CloseButton, { className: classNames2.closeButton }), typeof children === "function" ? children({ close, titleProps }) : props["aria-labelledby"] ? children : addTitleProps(children, titleProps));
|
|
1698
1694
|
};
|
|
1699
1695
|
Dialog.Trigger = DialogTrigger;
|
|
1700
1696
|
Dialog.Controller = DialogController;
|
|
1701
1697
|
|
|
1702
1698
|
// src/Divider/Divider.tsx
|
|
1703
|
-
import React39 from "react";
|
|
1704
1699
|
import { useSeparator } from "@react-aria/separator";
|
|
1705
1700
|
import { useClassNames as useClassNames18 } from "@marigold/system";
|
|
1706
1701
|
var Divider = ({ variant, ...props }) => {
|
|
1707
1702
|
const { separatorProps } = useSeparator(props);
|
|
1708
1703
|
const classNames2 = useClassNames18({ component: "Divider", variant });
|
|
1709
|
-
return /* @__PURE__ */
|
|
1704
|
+
return /* @__PURE__ */ React.createElement("div", { className: classNames2, ...props, ...separatorProps });
|
|
1710
1705
|
};
|
|
1711
1706
|
|
|
1712
1707
|
// src/Footer/Footer.tsx
|
|
1713
|
-
import React40 from "react";
|
|
1714
1708
|
import { useClassNames as useClassNames19 } from "@marigold/system";
|
|
1715
1709
|
var Footer = ({ children, variant, size, ...props }) => {
|
|
1716
1710
|
const classNames2 = useClassNames19({ component: "Footer", variant, size });
|
|
1717
|
-
return /* @__PURE__ */
|
|
1711
|
+
return /* @__PURE__ */ React.createElement("footer", { ...props, className: classNames2 }, children);
|
|
1718
1712
|
};
|
|
1719
1713
|
|
|
1720
1714
|
// src/Image/Image.tsx
|
|
1721
|
-
import React41 from "react";
|
|
1722
1715
|
import {
|
|
1723
1716
|
cn as cn20,
|
|
1724
|
-
useClassNames as useClassNames20,
|
|
1725
1717
|
objectFit,
|
|
1726
|
-
objectPosition
|
|
1718
|
+
objectPosition,
|
|
1719
|
+
useClassNames as useClassNames20
|
|
1727
1720
|
} from "@marigold/system";
|
|
1728
1721
|
var Image = ({
|
|
1729
1722
|
variant,
|
|
@@ -1733,7 +1726,7 @@ var Image = ({
|
|
|
1733
1726
|
...props
|
|
1734
1727
|
}) => {
|
|
1735
1728
|
const classNames2 = useClassNames20({ component: "Image", variant, size });
|
|
1736
|
-
return /* @__PURE__ */
|
|
1729
|
+
return /* @__PURE__ */ React.createElement(
|
|
1737
1730
|
"img",
|
|
1738
1731
|
{
|
|
1739
1732
|
...props,
|
|
@@ -1749,11 +1742,10 @@ var Image = ({
|
|
|
1749
1742
|
};
|
|
1750
1743
|
|
|
1751
1744
|
// src/Inline/Inline.tsx
|
|
1752
|
-
import React42 from "react";
|
|
1753
1745
|
import {
|
|
1754
|
-
gapSpace as gapSpace5,
|
|
1755
1746
|
alignment as alignment2,
|
|
1756
|
-
cn as cn21
|
|
1747
|
+
cn as cn21,
|
|
1748
|
+
gapSpace as gapSpace5
|
|
1757
1749
|
} from "@marigold/system";
|
|
1758
1750
|
var Inline = ({
|
|
1759
1751
|
space = 0,
|
|
@@ -1764,7 +1756,7 @@ var Inline = ({
|
|
|
1764
1756
|
...props
|
|
1765
1757
|
}) => {
|
|
1766
1758
|
var _a2, _b2, _c, _d;
|
|
1767
|
-
return /* @__PURE__ */
|
|
1759
|
+
return /* @__PURE__ */ React.createElement(
|
|
1768
1760
|
"div",
|
|
1769
1761
|
{
|
|
1770
1762
|
className: cn21(
|
|
@@ -1780,19 +1772,22 @@ var Inline = ({
|
|
|
1780
1772
|
};
|
|
1781
1773
|
|
|
1782
1774
|
// src/DateField/DateField.tsx
|
|
1783
|
-
import
|
|
1775
|
+
import { createCalendar } from "@internationalized/date";
|
|
1776
|
+
import { useRef as useRef11 } from "react";
|
|
1777
|
+
import { useDateField } from "@react-aria/datepicker";
|
|
1778
|
+
import { useFocusRing as useFocusRing6 } from "@react-aria/focus";
|
|
1784
1779
|
import { useLocale } from "@react-aria/i18n";
|
|
1780
|
+
import { useHover as useHover4 } from "@react-aria/interactions";
|
|
1781
|
+
import { mergeProps as mergeProps8 } from "@react-aria/utils";
|
|
1785
1782
|
import { useDateFieldState } from "@react-stately/datepicker";
|
|
1786
|
-
import { useDateField } from "@react-aria/datepicker";
|
|
1787
|
-
import { createCalendar } from "@internationalized/date";
|
|
1788
1783
|
import { cn as cn23, useClassNames as useClassNames21, useStateProps as useStateProps8 } from "@marigold/system";
|
|
1789
1784
|
|
|
1790
1785
|
// src/DateField/DateSegment.tsx
|
|
1791
|
-
import
|
|
1792
|
-
import { cn as cn22, useStateProps as useStateProps7 } from "@marigold/system";
|
|
1786
|
+
import { useRef as useRef10 } from "react";
|
|
1793
1787
|
import { useDateSegment } from "@react-aria/datepicker";
|
|
1794
1788
|
import { useFocusRing as useFocusRing5 } from "@react-aria/focus";
|
|
1795
1789
|
import { mergeProps as mergeProps7 } from "@react-aria/utils";
|
|
1790
|
+
import { cn as cn22, useStateProps as useStateProps7 } from "@marigold/system";
|
|
1796
1791
|
var DateSegment = ({
|
|
1797
1792
|
className,
|
|
1798
1793
|
segment,
|
|
@@ -1810,7 +1805,7 @@ var DateSegment = ({
|
|
|
1810
1805
|
focusVisible: isFocused
|
|
1811
1806
|
});
|
|
1812
1807
|
const { isPlaceholder, placeholder, text, type, maxValue } = segment;
|
|
1813
|
-
return /* @__PURE__ */
|
|
1808
|
+
return /* @__PURE__ */ React.createElement(
|
|
1814
1809
|
"div",
|
|
1815
1810
|
{
|
|
1816
1811
|
...mergeProps7(segmentProps, stateProps, focusProps),
|
|
@@ -1826,7 +1821,7 @@ var DateSegment = ({
|
|
|
1826
1821
|
minWidth: maxValue != null ? String(maxValue).length + "ch" : void 0
|
|
1827
1822
|
}
|
|
1828
1823
|
},
|
|
1829
|
-
/* @__PURE__ */
|
|
1824
|
+
/* @__PURE__ */ React.createElement(
|
|
1830
1825
|
"span",
|
|
1831
1826
|
{
|
|
1832
1827
|
"aria-hidden": "true",
|
|
@@ -1837,14 +1832,11 @@ var DateSegment = ({
|
|
|
1837
1832
|
},
|
|
1838
1833
|
isPlaceholder && (placeholder == null ? void 0 : placeholder.toUpperCase())
|
|
1839
1834
|
),
|
|
1840
|
-
/* @__PURE__ */
|
|
1835
|
+
/* @__PURE__ */ React.createElement("span", null, isPlaceholder ? "" : type === "month" || type === "day" ? Number(text) < 10 ? "0" + text : text : text)
|
|
1841
1836
|
);
|
|
1842
1837
|
};
|
|
1843
1838
|
|
|
1844
1839
|
// src/DateField/DateField.tsx
|
|
1845
|
-
import { mergeProps as mergeProps8 } from "@react-aria/utils";
|
|
1846
|
-
import { useHover as useHover4 } from "@react-aria/interactions";
|
|
1847
|
-
import { useFocusRing as useFocusRing6 } from "@react-aria/focus";
|
|
1848
1840
|
var DateField = ({
|
|
1849
1841
|
disabled,
|
|
1850
1842
|
readOnly,
|
|
@@ -1894,7 +1886,7 @@ var DateField = ({
|
|
|
1894
1886
|
required,
|
|
1895
1887
|
focus: isFocused || isPressed
|
|
1896
1888
|
});
|
|
1897
|
-
return /* @__PURE__ */
|
|
1889
|
+
return /* @__PURE__ */ React.createElement(
|
|
1898
1890
|
FieldBase,
|
|
1899
1891
|
{
|
|
1900
1892
|
error,
|
|
@@ -1910,7 +1902,7 @@ var DateField = ({
|
|
|
1910
1902
|
size,
|
|
1911
1903
|
width
|
|
1912
1904
|
},
|
|
1913
|
-
/* @__PURE__ */
|
|
1905
|
+
/* @__PURE__ */ React.createElement(
|
|
1914
1906
|
"div",
|
|
1915
1907
|
{
|
|
1916
1908
|
...mergeProps8(fieldProps, focusProps, stateProps, hoverProps),
|
|
@@ -1922,9 +1914,9 @@ var DateField = ({
|
|
|
1922
1914
|
"data-testid": "date-field",
|
|
1923
1915
|
ref: triggerRef
|
|
1924
1916
|
},
|
|
1925
|
-
/* @__PURE__ */
|
|
1917
|
+
/* @__PURE__ */ React.createElement("div", { ref, className: "flex basis-full items-center" }, state.segments.map((segment, i) => {
|
|
1926
1918
|
var _a;
|
|
1927
|
-
return /* @__PURE__ */
|
|
1919
|
+
return /* @__PURE__ */ React.createElement(
|
|
1928
1920
|
DateSegment,
|
|
1929
1921
|
{
|
|
1930
1922
|
className: classNames2.segment,
|
|
@@ -1935,7 +1927,7 @@ var DateField = ({
|
|
|
1935
1927
|
}
|
|
1936
1928
|
);
|
|
1937
1929
|
})),
|
|
1938
|
-
action ? action : /* @__PURE__ */
|
|
1930
|
+
action ? action : /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-center" }, /* @__PURE__ */ React.createElement(
|
|
1939
1931
|
"svg",
|
|
1940
1932
|
{
|
|
1941
1933
|
"data-testid": "action",
|
|
@@ -1944,34 +1936,36 @@ var DateField = ({
|
|
|
1944
1936
|
width: 24,
|
|
1945
1937
|
height: 24
|
|
1946
1938
|
},
|
|
1947
|
-
/* @__PURE__ */
|
|
1939
|
+
/* @__PURE__ */ React.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" })
|
|
1948
1940
|
))
|
|
1949
1941
|
)
|
|
1950
1942
|
);
|
|
1951
1943
|
};
|
|
1952
1944
|
|
|
1953
1945
|
// src/Calendar/Calendar.tsx
|
|
1954
|
-
import
|
|
1955
|
-
import {
|
|
1946
|
+
import { createCalendar as createCalendar2 } from "@internationalized/date";
|
|
1947
|
+
import { useRef as useRef14 } from "react";
|
|
1956
1948
|
import {
|
|
1957
1949
|
useCalendar
|
|
1958
1950
|
} from "@react-aria/calendar";
|
|
1959
1951
|
import { useLocale as useLocale3 } from "@react-aria/i18n";
|
|
1960
|
-
import {
|
|
1952
|
+
import { useCalendarState } from "@react-stately/calendar";
|
|
1953
|
+
import { ChevronLeft, ChevronRight } from "@marigold/icons";
|
|
1954
|
+
import { cn as cn26, useClassNames as useClassNames24, useStateProps as useStateProps11 } from "@marigold/system";
|
|
1961
1955
|
|
|
1962
1956
|
// src/Calendar/CalendarGrid.tsx
|
|
1963
|
-
import
|
|
1957
|
+
import { getWeeksInMonth, startOfWeek, today } from "@internationalized/date";
|
|
1964
1958
|
import { useMemo } from "react";
|
|
1965
1959
|
import { useCalendarGrid } from "@react-aria/calendar";
|
|
1966
1960
|
import { useLocale as useLocale2 } from "@react-aria/i18n";
|
|
1967
|
-
import {
|
|
1961
|
+
import { useDateFormatter } from "@react-aria/i18n";
|
|
1968
1962
|
|
|
1969
1963
|
// src/Calendar/CalendarCell.tsx
|
|
1970
|
-
import
|
|
1964
|
+
import { useRef as useRef12 } from "react";
|
|
1971
1965
|
import { useCalendarCell } from "@react-aria/calendar";
|
|
1966
|
+
import { useHover as useHover5 } from "@react-aria/interactions";
|
|
1972
1967
|
import { mergeProps as mergeProps9 } from "@react-aria/utils";
|
|
1973
1968
|
import { cn as cn24, useClassNames as useClassNames22, useStateProps as useStateProps9 } from "@marigold/system";
|
|
1974
|
-
import { useHover as useHover5 } from "@react-aria/interactions";
|
|
1975
1969
|
var CalendarCell = (props) => {
|
|
1976
1970
|
const ref = useRef12(null);
|
|
1977
1971
|
const { state } = props;
|
|
@@ -1988,7 +1982,7 @@ var CalendarCell = (props) => {
|
|
|
1988
1982
|
hover: isHovered,
|
|
1989
1983
|
selected: cellProps["aria-selected"]
|
|
1990
1984
|
});
|
|
1991
|
-
return /* @__PURE__ */
|
|
1985
|
+
return /* @__PURE__ */ React.createElement("td", { className: "group/cell", ...cellProps }, /* @__PURE__ */ React.createElement(
|
|
1992
1986
|
"div",
|
|
1993
1987
|
{
|
|
1994
1988
|
className: cn24(
|
|
@@ -2004,7 +1998,6 @@ var CalendarCell = (props) => {
|
|
|
2004
1998
|
};
|
|
2005
1999
|
|
|
2006
2000
|
// src/Calendar/CalendarGrid.tsx
|
|
2007
|
-
import { useDateFormatter } from "@react-aria/i18n";
|
|
2008
2001
|
var CalendarGrid = ({ state, ...props }) => {
|
|
2009
2002
|
const { locale } = useLocale2();
|
|
2010
2003
|
const { gridProps, headerProps } = useCalendarGrid(props, state);
|
|
@@ -2024,37 +2017,32 @@ var CalendarGrid = ({ state, ...props }) => {
|
|
|
2024
2017
|
return dayFormatter.format(dateDay);
|
|
2025
2018
|
});
|
|
2026
2019
|
}, [locale, state.timeZone, dayFormatter]);
|
|
2027
|
-
return /* @__PURE__ */
|
|
2020
|
+
return /* @__PURE__ */ React.createElement(
|
|
2028
2021
|
"table",
|
|
2029
2022
|
{
|
|
2030
2023
|
className: "w-full border-spacing-[6px]",
|
|
2031
2024
|
...gridProps,
|
|
2032
2025
|
cellPadding: "8"
|
|
2033
2026
|
},
|
|
2034
|
-
/* @__PURE__ */
|
|
2035
|
-
/* @__PURE__ */
|
|
2036
|
-
(date, i) => date ? /* @__PURE__ */
|
|
2027
|
+
/* @__PURE__ */ React.createElement("thead", { ...headerProps }, /* @__PURE__ */ React.createElement("tr", null, weekDays.map((day, index) => /* @__PURE__ */ React.createElement("th", { style: { fontWeight: "bolder" }, key: index }, day.substring(0, 2))))),
|
|
2028
|
+
/* @__PURE__ */ React.createElement("tbody", null, [...new Array(numberOfWeeksInMonth).keys()].map((weekIndex) => /* @__PURE__ */ React.createElement("tr", { key: weekIndex }, state.getDatesInWeek(weekIndex).map(
|
|
2029
|
+
(date, i) => date ? /* @__PURE__ */ React.createElement(
|
|
2037
2030
|
CalendarCell,
|
|
2038
2031
|
{
|
|
2039
2032
|
key: i,
|
|
2040
2033
|
date,
|
|
2041
2034
|
state
|
|
2042
2035
|
}
|
|
2043
|
-
) : /* @__PURE__ */
|
|
2036
|
+
) : /* @__PURE__ */ React.createElement("td", { key: i })
|
|
2044
2037
|
))))
|
|
2045
2038
|
);
|
|
2046
2039
|
};
|
|
2047
2040
|
|
|
2048
|
-
// src/Calendar/Calendar.tsx
|
|
2049
|
-
import { ChevronRight, ChevronLeft } from "@marigold/icons";
|
|
2050
|
-
import { cn as cn26, useClassNames as useClassNames24, useStateProps as useStateProps11 } from "@marigold/system";
|
|
2051
|
-
|
|
2052
2041
|
// src/Calendar/MonthDropdown.tsx
|
|
2053
|
-
import React48 from "react";
|
|
2054
2042
|
import { useDateFormatter as useDateFormatter2 } from "@react-aria/i18n";
|
|
2055
2043
|
|
|
2056
2044
|
// src/Select/Select.tsx
|
|
2057
|
-
import
|
|
2045
|
+
import {
|
|
2058
2046
|
forwardRef as forwardRef10,
|
|
2059
2047
|
useRef as useRef13
|
|
2060
2048
|
} from "react";
|
|
@@ -2062,9 +2050,9 @@ import { useButton as useButton6 } from "@react-aria/button";
|
|
|
2062
2050
|
import { useFocusRing as useFocusRing7 } from "@react-aria/focus";
|
|
2063
2051
|
import { useLocalizedStringFormatter } from "@react-aria/i18n";
|
|
2064
2052
|
import { HiddenSelect, useSelect } from "@react-aria/select";
|
|
2065
|
-
import { useSelectState } from "@react-stately/select";
|
|
2066
|
-
import { Item as Item4, Section } from "@react-stately/collections";
|
|
2067
2053
|
import { mergeProps as mergeProps10, useObjectRef as useObjectRef6 } from "@react-aria/utils";
|
|
2054
|
+
import { Item as Item4, Section } from "@react-stately/collections";
|
|
2055
|
+
import { useSelectState } from "@react-stately/select";
|
|
2068
2056
|
import {
|
|
2069
2057
|
cn as cn25,
|
|
2070
2058
|
useClassNames as useClassNames23,
|
|
@@ -2130,7 +2118,7 @@ var Select = forwardRef10(
|
|
|
2130
2118
|
expanded: state.isOpen,
|
|
2131
2119
|
required
|
|
2132
2120
|
});
|
|
2133
|
-
return /* @__PURE__ */
|
|
2121
|
+
return /* @__PURE__ */ React.createElement(
|
|
2134
2122
|
FieldBase,
|
|
2135
2123
|
{
|
|
2136
2124
|
variant,
|
|
@@ -2146,7 +2134,7 @@ var Select = forwardRef10(
|
|
|
2146
2134
|
stateProps,
|
|
2147
2135
|
disabled
|
|
2148
2136
|
},
|
|
2149
|
-
/* @__PURE__ */
|
|
2137
|
+
/* @__PURE__ */ React.createElement(
|
|
2150
2138
|
HiddenSelect,
|
|
2151
2139
|
{
|
|
2152
2140
|
state,
|
|
@@ -2156,7 +2144,7 @@ var Select = forwardRef10(
|
|
|
2156
2144
|
isDisabled: disabled
|
|
2157
2145
|
}
|
|
2158
2146
|
),
|
|
2159
|
-
/* @__PURE__ */
|
|
2147
|
+
/* @__PURE__ */ React.createElement(
|
|
2160
2148
|
"button",
|
|
2161
2149
|
{
|
|
2162
2150
|
className: cn25(
|
|
@@ -2167,10 +2155,10 @@ var Select = forwardRef10(
|
|
|
2167
2155
|
...mergeProps10(buttonProps, focusProps),
|
|
2168
2156
|
...stateProps
|
|
2169
2157
|
},
|
|
2170
|
-
/* @__PURE__ */
|
|
2171
|
-
/* @__PURE__ */
|
|
2158
|
+
/* @__PURE__ */ React.createElement("div", { className: "overflow-hidden whitespace-nowrap", ...valueProps }, state.selectedItem ? state.selectedItem.rendered : props.placeholder),
|
|
2159
|
+
/* @__PURE__ */ React.createElement(ChevronDown, { className: "h-4 w-4" })
|
|
2172
2160
|
),
|
|
2173
|
-
isSmallScreen ? /* @__PURE__ */
|
|
2161
|
+
isSmallScreen ? /* @__PURE__ */ React.createElement(Tray, { state }, /* @__PURE__ */ React.createElement(
|
|
2174
2162
|
ListBox,
|
|
2175
2163
|
{
|
|
2176
2164
|
ref: listboxRef,
|
|
@@ -2179,7 +2167,7 @@ var Select = forwardRef10(
|
|
|
2179
2167
|
size,
|
|
2180
2168
|
...menuProps
|
|
2181
2169
|
}
|
|
2182
|
-
)) : /* @__PURE__ */
|
|
2170
|
+
)) : /* @__PURE__ */ React.createElement(Popover, { state, triggerRef: buttonRef, scrollRef: listboxRef }, /* @__PURE__ */ React.createElement(
|
|
2183
2171
|
ListBox,
|
|
2184
2172
|
{
|
|
2185
2173
|
ref: listboxRef,
|
|
@@ -2212,7 +2200,7 @@ var MonthDropdown = ({ state }) => {
|
|
|
2212
2200
|
let date = state.focusedDate.set({ month: value });
|
|
2213
2201
|
state.setFocusedDate(date);
|
|
2214
2202
|
};
|
|
2215
|
-
return /* @__PURE__ */
|
|
2203
|
+
return /* @__PURE__ */ React.createElement(
|
|
2216
2204
|
Select,
|
|
2217
2205
|
{
|
|
2218
2206
|
"aria-label": "Month",
|
|
@@ -2221,13 +2209,12 @@ var MonthDropdown = ({ state }) => {
|
|
|
2221
2209
|
"data-testid": "month",
|
|
2222
2210
|
disabled: state.isDisabled
|
|
2223
2211
|
},
|
|
2224
|
-
months.map((month, i) => /* @__PURE__ */
|
|
2212
|
+
months.map((month, i) => /* @__PURE__ */ React.createElement(Select.Option, { key: i + 1 }, month.substring(0, 3)))
|
|
2225
2213
|
);
|
|
2226
2214
|
};
|
|
2227
2215
|
var MonthDropdown_default = MonthDropdown;
|
|
2228
2216
|
|
|
2229
2217
|
// src/Calendar/YearDropdown.tsx
|
|
2230
|
-
import React49 from "react";
|
|
2231
2218
|
import { useDateFormatter as useDateFormatter3 } from "@react-aria/i18n";
|
|
2232
2219
|
var YearDropdown = ({ state }) => {
|
|
2233
2220
|
const years = [];
|
|
@@ -2247,7 +2234,7 @@ var YearDropdown = ({ state }) => {
|
|
|
2247
2234
|
let date = years[index].value;
|
|
2248
2235
|
state.setFocusedDate(date);
|
|
2249
2236
|
};
|
|
2250
|
-
return /* @__PURE__ */
|
|
2237
|
+
return /* @__PURE__ */ React.createElement(
|
|
2251
2238
|
Select,
|
|
2252
2239
|
{
|
|
2253
2240
|
"aria-label": "Year",
|
|
@@ -2256,7 +2243,7 @@ var YearDropdown = ({ state }) => {
|
|
|
2256
2243
|
"data-testid": "year",
|
|
2257
2244
|
disabled: state.isDisabled
|
|
2258
2245
|
},
|
|
2259
|
-
years.map((year, i) => /* @__PURE__ */
|
|
2246
|
+
years.map((year, i) => /* @__PURE__ */ React.createElement(Select.Option, { key: i }, year.formatted))
|
|
2260
2247
|
);
|
|
2261
2248
|
};
|
|
2262
2249
|
var YearDropdown_default = YearDropdown;
|
|
@@ -2285,13 +2272,22 @@ var Calendar = ({
|
|
|
2285
2272
|
props,
|
|
2286
2273
|
state
|
|
2287
2274
|
);
|
|
2288
|
-
const {
|
|
2289
|
-
|
|
2275
|
+
const {
|
|
2276
|
+
isDisabled: prevIsDisabled,
|
|
2277
|
+
onFocusChange: prevFocusChange,
|
|
2278
|
+
...prevPropsRest
|
|
2279
|
+
} = prevButtonProps;
|
|
2280
|
+
const {
|
|
2281
|
+
isDisabled: nextIsDisabled,
|
|
2282
|
+
onFocusChange: nextFocusChange,
|
|
2283
|
+
...nextPropsRest
|
|
2284
|
+
} = nextButtonProps;
|
|
2290
2285
|
const calendarState = useStateProps11({
|
|
2291
|
-
disabled: state.isDisabled
|
|
2286
|
+
disabled: state.isDisabled,
|
|
2287
|
+
focusVisible: state.isFocused
|
|
2292
2288
|
});
|
|
2293
2289
|
const classNames2 = useClassNames24({ component: "Calendar" });
|
|
2294
|
-
return /* @__PURE__ */
|
|
2290
|
+
return /* @__PURE__ */ React.createElement(
|
|
2295
2291
|
"div",
|
|
2296
2292
|
{
|
|
2297
2293
|
tabIndex: -1,
|
|
@@ -2303,33 +2299,33 @@ var Calendar = ({
|
|
|
2303
2299
|
...calendarState,
|
|
2304
2300
|
ref
|
|
2305
2301
|
},
|
|
2306
|
-
/* @__PURE__ */
|
|
2302
|
+
/* @__PURE__ */ React.createElement("div", { className: "mb-4 flex items-center gap-[60px]" }, /* @__PURE__ */ React.createElement("div", { className: "flex min-w-[170px] gap-[9px] [&_div]:flex" }, /* @__PURE__ */ React.createElement(MonthDropdown_default, { state }), /* @__PURE__ */ React.createElement(YearDropdown_default, { state })), /* @__PURE__ */ React.createElement("div", { className: "flex w-full flex-nowrap justify-end gap-[10px] [&_button:disabled]:cursor-not-allowed [&_button]:px-2 [&_button]:py-1" }, /* @__PURE__ */ React.createElement(
|
|
2307
2303
|
Button,
|
|
2308
2304
|
{
|
|
2309
2305
|
className: classNames2.calendarControllers,
|
|
2310
2306
|
...prevPropsRest,
|
|
2311
2307
|
disabled: prevIsDisabled
|
|
2312
2308
|
},
|
|
2313
|
-
/* @__PURE__ */
|
|
2314
|
-
), /* @__PURE__ */
|
|
2309
|
+
/* @__PURE__ */ React.createElement(ChevronLeft, null)
|
|
2310
|
+
), /* @__PURE__ */ React.createElement(
|
|
2315
2311
|
Button,
|
|
2316
2312
|
{
|
|
2317
2313
|
className: classNames2.calendarControllers,
|
|
2318
2314
|
...nextPropsRest,
|
|
2319
2315
|
disabled: nextIsDisabled
|
|
2320
2316
|
},
|
|
2321
|
-
/* @__PURE__ */
|
|
2317
|
+
/* @__PURE__ */ React.createElement(ChevronRight, null)
|
|
2322
2318
|
))),
|
|
2323
|
-
/* @__PURE__ */
|
|
2319
|
+
/* @__PURE__ */ React.createElement(CalendarGrid, { state })
|
|
2324
2320
|
);
|
|
2325
2321
|
};
|
|
2326
2322
|
|
|
2327
2323
|
// src/DatePicker/DatePicker.tsx
|
|
2328
|
-
import
|
|
2329
|
-
import { useDatePickerState } from "@react-stately/datepicker";
|
|
2324
|
+
import { useRef as useRef15 } from "react";
|
|
2330
2325
|
import { useDatePicker } from "@react-aria/datepicker";
|
|
2331
|
-
import { cn as cn27, useClassNames as useClassNames25, useStateProps as useStateProps12 } from "@marigold/system";
|
|
2332
2326
|
import { mergeProps as mergeProps11 } from "@react-aria/utils";
|
|
2327
|
+
import { useDatePickerState } from "@react-stately/datepicker";
|
|
2328
|
+
import { cn as cn27, useClassNames as useClassNames25, useStateProps as useStateProps12 } from "@marigold/system";
|
|
2333
2329
|
var DatePicker = ({
|
|
2334
2330
|
disabled,
|
|
2335
2331
|
required,
|
|
@@ -2367,7 +2363,7 @@ var DatePicker = ({
|
|
|
2367
2363
|
size,
|
|
2368
2364
|
variant
|
|
2369
2365
|
});
|
|
2370
|
-
return /* @__PURE__ */
|
|
2366
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: "flex w-full min-w-[300px]", ...groupProps }, /* @__PURE__ */ React.createElement(
|
|
2371
2367
|
DateField,
|
|
2372
2368
|
{
|
|
2373
2369
|
...fieldProps,
|
|
@@ -2379,14 +2375,14 @@ var DatePicker = ({
|
|
|
2379
2375
|
error,
|
|
2380
2376
|
description: !state.isOpen && description,
|
|
2381
2377
|
triggerRef: ref,
|
|
2382
|
-
action: /* @__PURE__ */
|
|
2378
|
+
action: /* @__PURE__ */ React.createElement("div", { className: classNames2.container }, /* @__PURE__ */ React.createElement(
|
|
2383
2379
|
Button,
|
|
2384
2380
|
{
|
|
2385
2381
|
...mergeProps11(buttonProps, stateProps),
|
|
2386
2382
|
className: cn27("absolute right-0 top-0", classNames2.button),
|
|
2387
2383
|
disabled: isDisabled
|
|
2388
2384
|
},
|
|
2389
|
-
/* @__PURE__ */
|
|
2385
|
+
/* @__PURE__ */ React.createElement(
|
|
2390
2386
|
"svg",
|
|
2391
2387
|
{
|
|
2392
2388
|
width: "24",
|
|
@@ -2394,27 +2390,26 @@ var DatePicker = ({
|
|
|
2394
2390
|
viewBox: "0 0 24 24",
|
|
2395
2391
|
fill: "currentColor"
|
|
2396
2392
|
},
|
|
2397
|
-
/* @__PURE__ */
|
|
2393
|
+
/* @__PURE__ */ React.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" })
|
|
2398
2394
|
)
|
|
2399
2395
|
))
|
|
2400
2396
|
}
|
|
2401
|
-
)), state.isOpen && /* @__PURE__ */
|
|
2397
|
+
)), state.isOpen && /* @__PURE__ */ React.createElement(Popover, { triggerRef: ref, state }, /* @__PURE__ */ React.createElement(Calendar, { disabled, ...calendarProps })));
|
|
2402
2398
|
};
|
|
2403
2399
|
|
|
2404
2400
|
// src/Inset/Inset.tsx
|
|
2405
|
-
import React52 from "react";
|
|
2406
2401
|
import {
|
|
2402
|
+
cn as cn28,
|
|
2407
2403
|
paddingSpace as paddingSpace2,
|
|
2408
2404
|
paddingSpaceX as paddingSpaceX2,
|
|
2409
|
-
paddingSpaceY as paddingSpaceY2
|
|
2410
|
-
cn as cn28
|
|
2405
|
+
paddingSpaceY as paddingSpaceY2
|
|
2411
2406
|
} from "@marigold/system";
|
|
2412
2407
|
var Inset = ({
|
|
2413
2408
|
space = 0,
|
|
2414
2409
|
spaceX = 0,
|
|
2415
2410
|
spaceY = 0,
|
|
2416
2411
|
children
|
|
2417
|
-
}) => /* @__PURE__ */
|
|
2412
|
+
}) => /* @__PURE__ */ React.createElement(
|
|
2418
2413
|
"div",
|
|
2419
2414
|
{
|
|
2420
2415
|
className: cn28(
|
|
@@ -2426,10 +2421,10 @@ var Inset = ({
|
|
|
2426
2421
|
);
|
|
2427
2422
|
|
|
2428
2423
|
// src/Link/Link.tsx
|
|
2429
|
-
import
|
|
2424
|
+
import { forwardRef as forwardRef11 } from "react";
|
|
2430
2425
|
import { useLink } from "@react-aria/link";
|
|
2431
|
-
import { useClassNames as useClassNames26 } from "@marigold/system";
|
|
2432
2426
|
import { useObjectRef as useObjectRef7 } from "@react-aria/utils";
|
|
2427
|
+
import { useClassNames as useClassNames26 } from "@marigold/system";
|
|
2433
2428
|
var Link = forwardRef11(
|
|
2434
2429
|
({
|
|
2435
2430
|
as = "a",
|
|
@@ -2458,7 +2453,7 @@ var Link = forwardRef11(
|
|
|
2458
2453
|
size,
|
|
2459
2454
|
className
|
|
2460
2455
|
});
|
|
2461
|
-
return /* @__PURE__ */
|
|
2456
|
+
return /* @__PURE__ */ React.createElement(
|
|
2462
2457
|
Component,
|
|
2463
2458
|
{
|
|
2464
2459
|
...props,
|
|
@@ -2473,7 +2468,6 @@ var Link = forwardRef11(
|
|
|
2473
2468
|
);
|
|
2474
2469
|
|
|
2475
2470
|
// src/List/List.tsx
|
|
2476
|
-
import React55 from "react";
|
|
2477
2471
|
import { useClassNames as useClassNames27 } from "@marigold/system";
|
|
2478
2472
|
|
|
2479
2473
|
// src/List/Context.ts
|
|
@@ -2482,10 +2476,9 @@ var ListContext = createContext5({});
|
|
|
2482
2476
|
var useListContext = () => useContext5(ListContext);
|
|
2483
2477
|
|
|
2484
2478
|
// src/List/ListItem.tsx
|
|
2485
|
-
import React54 from "react";
|
|
2486
2479
|
var ListItem = ({ children, ...props }) => {
|
|
2487
2480
|
const { classNames: classNames2 } = useListContext();
|
|
2488
|
-
return /* @__PURE__ */
|
|
2481
|
+
return /* @__PURE__ */ React.createElement("li", { ...props, className: classNames2 }, children);
|
|
2489
2482
|
};
|
|
2490
2483
|
|
|
2491
2484
|
// src/List/List.tsx
|
|
@@ -2498,16 +2491,16 @@ var List = ({
|
|
|
2498
2491
|
}) => {
|
|
2499
2492
|
const Component = as;
|
|
2500
2493
|
const classNames2 = useClassNames27({ component: "List", variant, size });
|
|
2501
|
-
return /* @__PURE__ */
|
|
2494
|
+
return /* @__PURE__ */ React.createElement(Component, { ...props, className: classNames2[as] }, /* @__PURE__ */ React.createElement(ListContext.Provider, { value: { classNames: classNames2.item } }, children));
|
|
2502
2495
|
};
|
|
2503
2496
|
List.Item = ListItem;
|
|
2504
2497
|
|
|
2505
2498
|
// src/Menu/Menu.tsx
|
|
2506
|
-
import
|
|
2499
|
+
import { useRef as useRef18 } from "react";
|
|
2507
2500
|
import { useMenu } from "@react-aria/menu";
|
|
2501
|
+
import { useSyncRef } from "@react-aria/utils";
|
|
2508
2502
|
import { Item as Item5, Section as Section2 } from "@react-stately/collections";
|
|
2509
2503
|
import { useTreeState as useTreeState2 } from "@react-stately/tree";
|
|
2510
|
-
import { useSyncRef } from "@react-aria/utils";
|
|
2511
2504
|
import { useClassNames as useClassNames29 } from "@marigold/system";
|
|
2512
2505
|
|
|
2513
2506
|
// src/Menu/Context.ts
|
|
@@ -2518,52 +2511,8 @@ import {
|
|
|
2518
2511
|
var MenuContext = createContext6({});
|
|
2519
2512
|
var useMenuContext = () => useContext6(MenuContext);
|
|
2520
2513
|
|
|
2521
|
-
// src/Menu/MenuTrigger.tsx
|
|
2522
|
-
import React56, { useRef as useRef16 } from "react";
|
|
2523
|
-
import { useMenuTriggerState } from "@react-stately/menu";
|
|
2524
|
-
import { PressResponder as PressResponder2 } from "@react-aria/interactions";
|
|
2525
|
-
import { useMenuTrigger } from "@react-aria/menu";
|
|
2526
|
-
import { useObjectRef as useObjectRef8 } from "@react-aria/utils";
|
|
2527
|
-
import { useSmallScreen as useSmallScreen2 } from "@marigold/system";
|
|
2528
|
-
var MenuTrigger = ({
|
|
2529
|
-
disabled,
|
|
2530
|
-
open,
|
|
2531
|
-
onOpenChange,
|
|
2532
|
-
children
|
|
2533
|
-
}) => {
|
|
2534
|
-
const [menuTrigger, menu] = React56.Children.toArray(children);
|
|
2535
|
-
const menuTriggerRef = useRef16(null);
|
|
2536
|
-
const menuRef = useObjectRef8();
|
|
2537
|
-
const state = useMenuTriggerState({
|
|
2538
|
-
isOpen: open,
|
|
2539
|
-
onOpenChange
|
|
2540
|
-
});
|
|
2541
|
-
const { menuTriggerProps, menuProps } = useMenuTrigger(
|
|
2542
|
-
{ trigger: "press", isDisabled: disabled },
|
|
2543
|
-
state,
|
|
2544
|
-
menuTriggerRef
|
|
2545
|
-
);
|
|
2546
|
-
const menuContext = {
|
|
2547
|
-
...menuProps,
|
|
2548
|
-
ref: menuRef,
|
|
2549
|
-
open: state.isOpen,
|
|
2550
|
-
onClose: state.close,
|
|
2551
|
-
autoFocus: state.focusStrategy
|
|
2552
|
-
};
|
|
2553
|
-
const isSmallScreen = useSmallScreen2();
|
|
2554
|
-
return /* @__PURE__ */ React56.createElement(MenuContext.Provider, { value: menuContext }, /* @__PURE__ */ React56.createElement(
|
|
2555
|
-
PressResponder2,
|
|
2556
|
-
{
|
|
2557
|
-
...menuTriggerProps,
|
|
2558
|
-
ref: menuTriggerRef,
|
|
2559
|
-
isPressed: state.isOpen
|
|
2560
|
-
},
|
|
2561
|
-
menuTrigger
|
|
2562
|
-
), isSmallScreen ? /* @__PURE__ */ React56.createElement(Tray, { state }, menu) : /* @__PURE__ */ React56.createElement(Popover, { triggerRef: menuTriggerRef, scrollRef: menuRef, state }, menu));
|
|
2563
|
-
};
|
|
2564
|
-
|
|
2565
2514
|
// src/Menu/MenuItem.tsx
|
|
2566
|
-
import
|
|
2515
|
+
import { useRef as useRef16 } from "react";
|
|
2567
2516
|
import { useFocusRing as useFocusRing8 } from "@react-aria/focus";
|
|
2568
2517
|
import { useMenuItem } from "@react-aria/menu";
|
|
2569
2518
|
import { mergeProps as mergeProps12 } from "@react-aria/utils";
|
|
@@ -2574,7 +2523,7 @@ var MenuItem = ({
|
|
|
2574
2523
|
onAction,
|
|
2575
2524
|
className
|
|
2576
2525
|
}) => {
|
|
2577
|
-
const ref =
|
|
2526
|
+
const ref = useRef16(null);
|
|
2578
2527
|
const { onClose } = useMenuContext();
|
|
2579
2528
|
const { menuItemProps } = useMenuItem(
|
|
2580
2529
|
{
|
|
@@ -2590,7 +2539,7 @@ var MenuItem = ({
|
|
|
2590
2539
|
focus: isFocusVisible
|
|
2591
2540
|
});
|
|
2592
2541
|
const { onPointerUp, ...props } = menuItemProps;
|
|
2593
|
-
return /* @__PURE__ */
|
|
2542
|
+
return /* @__PURE__ */ React.createElement(
|
|
2594
2543
|
"li",
|
|
2595
2544
|
{
|
|
2596
2545
|
ref,
|
|
@@ -2607,7 +2556,6 @@ var MenuItem = ({
|
|
|
2607
2556
|
};
|
|
2608
2557
|
|
|
2609
2558
|
// src/Menu/MenuSection.tsx
|
|
2610
|
-
import React58 from "react";
|
|
2611
2559
|
import { useMenuSection } from "@react-aria/menu";
|
|
2612
2560
|
import { useClassNames as useClassNames28 } from "@marigold/system";
|
|
2613
2561
|
var MenuSection = ({ onAction, item, state }) => {
|
|
@@ -2616,7 +2564,7 @@ var MenuSection = ({ onAction, item, state }) => {
|
|
|
2616
2564
|
"aria-label": item["aria-label"]
|
|
2617
2565
|
});
|
|
2618
2566
|
const className = useClassNames28({ component: "Menu" });
|
|
2619
|
-
return /* @__PURE__ */
|
|
2567
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, item.key !== state.collection.getFirstKey() && /* @__PURE__ */ React.createElement("li", null, /* @__PURE__ */ React.createElement(Divider, { variant: "section" })), /* @__PURE__ */ React.createElement("li", { ...itemProps }, item.rendered && /* @__PURE__ */ React.createElement("span", { ...headingProps, className: className.section }, item.rendered), /* @__PURE__ */ React.createElement("ul", { ...groupProps, className: "pb-1" }, [...item.props.children].map((node) => /* @__PURE__ */ React.createElement(
|
|
2620
2568
|
MenuItem,
|
|
2621
2569
|
{
|
|
2622
2570
|
key: node.key,
|
|
@@ -2629,6 +2577,50 @@ var MenuSection = ({ onAction, item, state }) => {
|
|
|
2629
2577
|
};
|
|
2630
2578
|
var MenuSection_default = MenuSection;
|
|
2631
2579
|
|
|
2580
|
+
// src/Menu/MenuTrigger.tsx
|
|
2581
|
+
import { Children as Children6, useRef as useRef17 } from "react";
|
|
2582
|
+
import { PressResponder as PressResponder2 } from "@react-aria/interactions";
|
|
2583
|
+
import { useMenuTrigger } from "@react-aria/menu";
|
|
2584
|
+
import { useObjectRef as useObjectRef8 } from "@react-aria/utils";
|
|
2585
|
+
import { useMenuTriggerState } from "@react-stately/menu";
|
|
2586
|
+
import { useSmallScreen as useSmallScreen2 } from "@marigold/system";
|
|
2587
|
+
var MenuTrigger = ({
|
|
2588
|
+
disabled,
|
|
2589
|
+
open,
|
|
2590
|
+
onOpenChange,
|
|
2591
|
+
children
|
|
2592
|
+
}) => {
|
|
2593
|
+
const [menuTrigger, menu] = Children6.toArray(children);
|
|
2594
|
+
const menuTriggerRef = useRef17(null);
|
|
2595
|
+
const menuRef = useObjectRef8();
|
|
2596
|
+
const state = useMenuTriggerState({
|
|
2597
|
+
isOpen: open,
|
|
2598
|
+
onOpenChange
|
|
2599
|
+
});
|
|
2600
|
+
const { menuTriggerProps, menuProps } = useMenuTrigger(
|
|
2601
|
+
{ trigger: "press", isDisabled: disabled },
|
|
2602
|
+
state,
|
|
2603
|
+
menuTriggerRef
|
|
2604
|
+
);
|
|
2605
|
+
const menuContext = {
|
|
2606
|
+
...menuProps,
|
|
2607
|
+
ref: menuRef,
|
|
2608
|
+
open: state.isOpen,
|
|
2609
|
+
onClose: state.close,
|
|
2610
|
+
autoFocus: state.focusStrategy
|
|
2611
|
+
};
|
|
2612
|
+
const isSmallScreen = useSmallScreen2();
|
|
2613
|
+
return /* @__PURE__ */ React.createElement(MenuContext.Provider, { value: menuContext }, /* @__PURE__ */ React.createElement(
|
|
2614
|
+
PressResponder2,
|
|
2615
|
+
{
|
|
2616
|
+
...menuTriggerProps,
|
|
2617
|
+
ref: menuTriggerRef,
|
|
2618
|
+
isPressed: state.isOpen
|
|
2619
|
+
},
|
|
2620
|
+
menuTrigger
|
|
2621
|
+
), isSmallScreen ? /* @__PURE__ */ React.createElement(Tray, { state }, menu) : /* @__PURE__ */ React.createElement(Popover, { triggerRef: menuTriggerRef, scrollRef: menuRef, state }, menu));
|
|
2622
|
+
};
|
|
2623
|
+
|
|
2632
2624
|
// src/Menu/Menu.tsx
|
|
2633
2625
|
var Menu = ({ variant, size, ...props }) => {
|
|
2634
2626
|
const { ref: scrollRef, ...menuContext } = useMenuContext();
|
|
@@ -2638,9 +2630,9 @@ var Menu = ({ variant, size, ...props }) => {
|
|
|
2638
2630
|
const { menuProps } = useMenu(ownProps, state, ref);
|
|
2639
2631
|
useSyncRef({ ref: scrollRef }, ref);
|
|
2640
2632
|
const classNames2 = useClassNames29({ component: "Menu", variant, size });
|
|
2641
|
-
return /* @__PURE__ */
|
|
2633
|
+
return /* @__PURE__ */ React.createElement("ul", { ref, className: classNames2.container, ...menuProps }, [...state.collection].map((item) => {
|
|
2642
2634
|
if (item.type === "section") {
|
|
2643
|
-
return /* @__PURE__ */
|
|
2635
|
+
return /* @__PURE__ */ React.createElement(
|
|
2644
2636
|
MenuSection_default,
|
|
2645
2637
|
{
|
|
2646
2638
|
key: item.key,
|
|
@@ -2650,7 +2642,7 @@ var Menu = ({ variant, size, ...props }) => {
|
|
|
2650
2642
|
}
|
|
2651
2643
|
);
|
|
2652
2644
|
}
|
|
2653
|
-
return /* @__PURE__ */
|
|
2645
|
+
return /* @__PURE__ */ React.createElement(
|
|
2654
2646
|
MenuItem,
|
|
2655
2647
|
{
|
|
2656
2648
|
key: item.key,
|
|
@@ -2667,24 +2659,22 @@ Menu.Item = Item5;
|
|
|
2667
2659
|
Menu.Section = Section2;
|
|
2668
2660
|
|
|
2669
2661
|
// src/Menu/ActionMenu.tsx
|
|
2670
|
-
import React60 from "react";
|
|
2671
2662
|
import { SVG as SVG5 } from "@marigold/system";
|
|
2672
2663
|
var ActionMenu = (props) => {
|
|
2673
|
-
return /* @__PURE__ */
|
|
2664
|
+
return /* @__PURE__ */ React.createElement(Menu.Trigger, null, /* @__PURE__ */ React.createElement(Button, { variant: "menu", size: "small" }, /* @__PURE__ */ React.createElement(SVG5, { viewBox: "0 0 24 24" }, /* @__PURE__ */ React.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__ */ React.createElement(Menu, { ...props }));
|
|
2674
2665
|
};
|
|
2675
2666
|
|
|
2676
2667
|
// src/Message/Message.tsx
|
|
2677
|
-
import React61 from "react";
|
|
2678
2668
|
import { cn as cn29, useClassNames as useClassNames30 } from "@marigold/system";
|
|
2679
2669
|
var icons = {
|
|
2680
|
-
info: () => /* @__PURE__ */
|
|
2670
|
+
info: () => /* @__PURE__ */ React.createElement(
|
|
2681
2671
|
"svg",
|
|
2682
2672
|
{
|
|
2683
2673
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2684
2674
|
viewBox: "0 0 24 24",
|
|
2685
2675
|
fill: "currentColor"
|
|
2686
2676
|
},
|
|
2687
|
-
/* @__PURE__ */
|
|
2677
|
+
/* @__PURE__ */ React.createElement(
|
|
2688
2678
|
"path",
|
|
2689
2679
|
{
|
|
2690
2680
|
fillRule: "evenodd",
|
|
@@ -2693,14 +2683,14 @@ var icons = {
|
|
|
2693
2683
|
}
|
|
2694
2684
|
)
|
|
2695
2685
|
),
|
|
2696
|
-
warning: () => /* @__PURE__ */
|
|
2686
|
+
warning: () => /* @__PURE__ */ React.createElement(
|
|
2697
2687
|
"svg",
|
|
2698
2688
|
{
|
|
2699
2689
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2700
2690
|
viewBox: "0 0 24 24",
|
|
2701
2691
|
fill: "currentColor"
|
|
2702
2692
|
},
|
|
2703
|
-
/* @__PURE__ */
|
|
2693
|
+
/* @__PURE__ */ React.createElement(
|
|
2704
2694
|
"path",
|
|
2705
2695
|
{
|
|
2706
2696
|
fillRule: "evenodd",
|
|
@@ -2709,14 +2699,14 @@ var icons = {
|
|
|
2709
2699
|
}
|
|
2710
2700
|
)
|
|
2711
2701
|
),
|
|
2712
|
-
error: () => /* @__PURE__ */
|
|
2702
|
+
error: () => /* @__PURE__ */ React.createElement(
|
|
2713
2703
|
"svg",
|
|
2714
2704
|
{
|
|
2715
2705
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2716
2706
|
viewBox: "0 0 24 24",
|
|
2717
2707
|
fill: "currentColor"
|
|
2718
2708
|
},
|
|
2719
|
-
/* @__PURE__ */
|
|
2709
|
+
/* @__PURE__ */ React.createElement(
|
|
2720
2710
|
"path",
|
|
2721
2711
|
{
|
|
2722
2712
|
fillRule: "evenodd",
|
|
@@ -2735,7 +2725,7 @@ var Message = ({
|
|
|
2735
2725
|
}) => {
|
|
2736
2726
|
const classNames2 = useClassNames30({ component: "Message", variant, size });
|
|
2737
2727
|
const Icon3 = icons[variant];
|
|
2738
|
-
return /* @__PURE__ */
|
|
2728
|
+
return /* @__PURE__ */ React.createElement(
|
|
2739
2729
|
"div",
|
|
2740
2730
|
{
|
|
2741
2731
|
className: cn29(
|
|
@@ -2744,35 +2734,35 @@ var Message = ({
|
|
|
2744
2734
|
),
|
|
2745
2735
|
...props
|
|
2746
2736
|
},
|
|
2747
|
-
/* @__PURE__ */
|
|
2748
|
-
/* @__PURE__ */
|
|
2737
|
+
/* @__PURE__ */ React.createElement("div", { className: cn29("col-span-1 h-5 w-5 self-center", classNames2.icon) }, /* @__PURE__ */ React.createElement(Icon3, null)),
|
|
2738
|
+
/* @__PURE__ */ React.createElement(
|
|
2749
2739
|
"div",
|
|
2750
2740
|
{
|
|
2751
2741
|
className: cn29("col-start-2 row-start-1 self-center", classNames2.title)
|
|
2752
2742
|
},
|
|
2753
2743
|
messageTitle
|
|
2754
2744
|
),
|
|
2755
|
-
/* @__PURE__ */
|
|
2745
|
+
/* @__PURE__ */ React.createElement("div", { className: cn29("col-start-2", classNames2.content) }, children)
|
|
2756
2746
|
);
|
|
2757
2747
|
};
|
|
2758
2748
|
|
|
2759
2749
|
// src/NumberField/NumberField.tsx
|
|
2760
|
-
import
|
|
2750
|
+
import { forwardRef as forwardRef12 } from "react";
|
|
2761
2751
|
import { useFocusRing as useFocusRing9 } from "@react-aria/focus";
|
|
2762
|
-
import { useHover as useHover7 } from "@react-aria/interactions";
|
|
2763
2752
|
import { useLocale as useLocale4 } from "@react-aria/i18n";
|
|
2753
|
+
import { useHover as useHover7 } from "@react-aria/interactions";
|
|
2764
2754
|
import { useNumberField } from "@react-aria/numberfield";
|
|
2765
2755
|
import { mergeProps as mergeProps14, useObjectRef as useObjectRef9 } from "@react-aria/utils";
|
|
2766
2756
|
import { useNumberFieldState } from "@react-stately/numberfield";
|
|
2767
2757
|
import { cn as cn31, useClassNames as useClassNames31, useStateProps as useStateProps15 } from "@marigold/system";
|
|
2768
2758
|
|
|
2769
2759
|
// src/NumberField/StepButton.tsx
|
|
2770
|
-
import
|
|
2760
|
+
import { useRef as useRef19 } from "react";
|
|
2771
2761
|
import { useButton as useButton7 } from "@react-aria/button";
|
|
2772
2762
|
import { useHover as useHover6 } from "@react-aria/interactions";
|
|
2773
2763
|
import { mergeProps as mergeProps13 } from "@react-aria/utils";
|
|
2774
2764
|
import { cn as cn30, useStateProps as useStateProps14 } from "@marigold/system";
|
|
2775
|
-
var Plus = () => /* @__PURE__ */
|
|
2765
|
+
var Plus = () => /* @__PURE__ */ React.createElement("svg", { width: 16, height: 16, viewBox: "0 0 20 20", fill: "currentColor" }, /* @__PURE__ */ React.createElement(
|
|
2776
2766
|
"path",
|
|
2777
2767
|
{
|
|
2778
2768
|
fillRule: "evenodd",
|
|
@@ -2780,7 +2770,7 @@ var Plus = () => /* @__PURE__ */ React62.createElement("svg", { width: 16, heigh
|
|
|
2780
2770
|
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"
|
|
2781
2771
|
}
|
|
2782
2772
|
));
|
|
2783
|
-
var Minus = () => /* @__PURE__ */
|
|
2773
|
+
var Minus = () => /* @__PURE__ */ React.createElement("svg", { width: 16, height: 16, viewBox: "0 0 20 20", fill: "currentColor" }, /* @__PURE__ */ React.createElement(
|
|
2784
2774
|
"path",
|
|
2785
2775
|
{
|
|
2786
2776
|
fillRule: "evenodd",
|
|
@@ -2805,7 +2795,7 @@ var StepButton = ({
|
|
|
2805
2795
|
disabled: props.isDisabled
|
|
2806
2796
|
});
|
|
2807
2797
|
const Icon3 = direction === "up" ? Plus : Minus;
|
|
2808
|
-
return /* @__PURE__ */
|
|
2798
|
+
return /* @__PURE__ */ React.createElement(
|
|
2809
2799
|
"div",
|
|
2810
2800
|
{
|
|
2811
2801
|
className: cn30(
|
|
@@ -2818,7 +2808,7 @@ var StepButton = ({
|
|
|
2818
2808
|
...mergeProps13(buttonProps, hoverProps),
|
|
2819
2809
|
...stateProps
|
|
2820
2810
|
},
|
|
2821
|
-
/* @__PURE__ */
|
|
2811
|
+
/* @__PURE__ */ React.createElement(Icon3, null)
|
|
2822
2812
|
);
|
|
2823
2813
|
};
|
|
2824
2814
|
|
|
@@ -2874,7 +2864,7 @@ var NumberField = forwardRef12(
|
|
|
2874
2864
|
size,
|
|
2875
2865
|
variant
|
|
2876
2866
|
});
|
|
2877
|
-
return /* @__PURE__ */
|
|
2867
|
+
return /* @__PURE__ */ React.createElement(
|
|
2878
2868
|
FieldBase,
|
|
2879
2869
|
{
|
|
2880
2870
|
label: props.label,
|
|
@@ -2889,7 +2879,7 @@ var NumberField = forwardRef12(
|
|
|
2889
2879
|
size,
|
|
2890
2880
|
width
|
|
2891
2881
|
},
|
|
2892
|
-
/* @__PURE__ */
|
|
2882
|
+
/* @__PURE__ */ React.createElement(
|
|
2893
2883
|
"div",
|
|
2894
2884
|
{
|
|
2895
2885
|
"data-group": true,
|
|
@@ -2898,7 +2888,7 @@ var NumberField = forwardRef12(
|
|
|
2898
2888
|
...mergeProps14(groupProps, focusProps, hoverProps),
|
|
2899
2889
|
...stateProps
|
|
2900
2890
|
},
|
|
2901
|
-
showStepper && /* @__PURE__ */
|
|
2891
|
+
showStepper && /* @__PURE__ */ React.createElement(
|
|
2902
2892
|
StepButton,
|
|
2903
2893
|
{
|
|
2904
2894
|
className: classNames2.stepper,
|
|
@@ -2906,7 +2896,7 @@ var NumberField = forwardRef12(
|
|
|
2906
2896
|
...decrementButtonProps
|
|
2907
2897
|
}
|
|
2908
2898
|
),
|
|
2909
|
-
/* @__PURE__ */
|
|
2899
|
+
/* @__PURE__ */ React.createElement("div", { className: "flex-1" }, /* @__PURE__ */ React.createElement(
|
|
2910
2900
|
Input,
|
|
2911
2901
|
{
|
|
2912
2902
|
ref: inputRef,
|
|
@@ -2919,7 +2909,7 @@ var NumberField = forwardRef12(
|
|
|
2919
2909
|
...stateProps
|
|
2920
2910
|
}
|
|
2921
2911
|
)),
|
|
2922
|
-
showStepper && /* @__PURE__ */
|
|
2912
|
+
showStepper && /* @__PURE__ */ React.createElement(
|
|
2923
2913
|
StepButton,
|
|
2924
2914
|
{
|
|
2925
2915
|
className: classNames2.stepper,
|
|
@@ -2936,7 +2926,6 @@ var NumberField = forwardRef12(
|
|
|
2936
2926
|
import { useTheme as useTheme4, ThemeProvider as ThemeProvider2 } from "@marigold/system";
|
|
2937
2927
|
|
|
2938
2928
|
// src/Provider/MarigoldProvider.tsx
|
|
2939
|
-
import React64 from "react";
|
|
2940
2929
|
import { OverlayProvider } from "@react-aria/overlays";
|
|
2941
2930
|
import {
|
|
2942
2931
|
ThemeProvider,
|
|
@@ -2949,15 +2938,15 @@ function MarigoldProvider({
|
|
|
2949
2938
|
}) {
|
|
2950
2939
|
const outerTheme = useTheme3();
|
|
2951
2940
|
const isTopLevel = outerTheme === defaultTheme;
|
|
2952
|
-
return /* @__PURE__ */
|
|
2941
|
+
return /* @__PURE__ */ React.createElement(ThemeProvider, { theme }, isTopLevel ? /* @__PURE__ */ React.createElement(OverlayProvider, null, children) : children);
|
|
2953
2942
|
}
|
|
2954
2943
|
|
|
2955
2944
|
// src/Radio/Radio.tsx
|
|
2956
|
-
import
|
|
2945
|
+
import {
|
|
2957
2946
|
forwardRef as forwardRef13
|
|
2958
2947
|
} from "react";
|
|
2959
|
-
import { useHover as useHover8 } from "@react-aria/interactions";
|
|
2960
2948
|
import { useFocusRing as useFocusRing10 } from "@react-aria/focus";
|
|
2949
|
+
import { useHover as useHover8 } from "@react-aria/interactions";
|
|
2961
2950
|
import { useRadio } from "@react-aria/radio";
|
|
2962
2951
|
import { mergeProps as mergeProps15, useObjectRef as useObjectRef10 } from "@react-aria/utils";
|
|
2963
2952
|
import {
|
|
@@ -2974,7 +2963,6 @@ var RadioGroupContext = createContext7(
|
|
|
2974
2963
|
var useRadioGroupContext = () => useContext7(RadioGroupContext);
|
|
2975
2964
|
|
|
2976
2965
|
// src/Radio/RadioGroup.tsx
|
|
2977
|
-
import React65 from "react";
|
|
2978
2966
|
import { useRadioGroup } from "@react-aria/radio";
|
|
2979
2967
|
import { useRadioGroupState } from "@react-stately/radio";
|
|
2980
2968
|
import { cn as cn32, useStateProps as useStateProps16 } from "@marigold/system";
|
|
@@ -3003,7 +2991,7 @@ var RadioGroup = ({
|
|
|
3003
2991
|
error,
|
|
3004
2992
|
required
|
|
3005
2993
|
});
|
|
3006
|
-
return /* @__PURE__ */
|
|
2994
|
+
return /* @__PURE__ */ React.createElement(
|
|
3007
2995
|
FieldBase,
|
|
3008
2996
|
{
|
|
3009
2997
|
width,
|
|
@@ -3018,7 +3006,7 @@ var RadioGroup = ({
|
|
|
3018
3006
|
stateProps,
|
|
3019
3007
|
...radioGroupProps
|
|
3020
3008
|
},
|
|
3021
|
-
/* @__PURE__ */
|
|
3009
|
+
/* @__PURE__ */ React.createElement(
|
|
3022
3010
|
"div",
|
|
3023
3011
|
{
|
|
3024
3012
|
role: "presentation",
|
|
@@ -3028,14 +3016,14 @@ var RadioGroup = ({
|
|
|
3028
3016
|
orientation === "vertical" ? "flex-col gap-[0.5ch]" : "flex-row gap-[1.5ch]"
|
|
3029
3017
|
)
|
|
3030
3018
|
},
|
|
3031
|
-
/* @__PURE__ */
|
|
3019
|
+
/* @__PURE__ */ React.createElement(RadioGroupContext.Provider, { value: { width, error, state } }, children)
|
|
3032
3020
|
)
|
|
3033
3021
|
);
|
|
3034
3022
|
};
|
|
3035
3023
|
|
|
3036
3024
|
// src/Radio/Radio.tsx
|
|
3037
|
-
var Dot = () => /* @__PURE__ */
|
|
3038
|
-
var Icon2 = ({ checked, className, ...props }) => /* @__PURE__ */
|
|
3025
|
+
var Dot = () => /* @__PURE__ */ React.createElement("svg", { viewBox: "0 0 6 6" }, /* @__PURE__ */ React.createElement("circle", { fill: "currentColor", cx: "3", cy: "3", r: "3" }));
|
|
3026
|
+
var Icon2 = ({ checked, className, ...props }) => /* @__PURE__ */ React.createElement(
|
|
3039
3027
|
"div",
|
|
3040
3028
|
{
|
|
3041
3029
|
className: cn33(
|
|
@@ -3045,7 +3033,7 @@ var Icon2 = ({ checked, className, ...props }) => /* @__PURE__ */ React66.create
|
|
|
3045
3033
|
"aria-hidden": "true",
|
|
3046
3034
|
...props
|
|
3047
3035
|
},
|
|
3048
|
-
checked ? /* @__PURE__ */
|
|
3036
|
+
checked ? /* @__PURE__ */ React.createElement(Dot, null) : null
|
|
3049
3037
|
);
|
|
3050
3038
|
var Radio = forwardRef13(
|
|
3051
3039
|
({ width, disabled, ...props }, ref) => {
|
|
@@ -3077,7 +3065,7 @@ var Radio = forwardRef13(
|
|
|
3077
3065
|
readOnly: props.readOnly,
|
|
3078
3066
|
error
|
|
3079
3067
|
});
|
|
3080
|
-
return /* @__PURE__ */
|
|
3068
|
+
return /* @__PURE__ */ React.createElement(
|
|
3081
3069
|
"label",
|
|
3082
3070
|
{
|
|
3083
3071
|
className: cn33(
|
|
@@ -3088,7 +3076,7 @@ var Radio = forwardRef13(
|
|
|
3088
3076
|
),
|
|
3089
3077
|
...mergeProps15(hoverProps, stateProps)
|
|
3090
3078
|
},
|
|
3091
|
-
/* @__PURE__ */
|
|
3079
|
+
/* @__PURE__ */ React.createElement(
|
|
3092
3080
|
"input",
|
|
3093
3081
|
{
|
|
3094
3082
|
ref: inputRef,
|
|
@@ -3099,23 +3087,24 @@ var Radio = forwardRef13(
|
|
|
3099
3087
|
...mergeProps15(inputProps, focusProps)
|
|
3100
3088
|
}
|
|
3101
3089
|
),
|
|
3102
|
-
/* @__PURE__ */
|
|
3103
|
-
/* @__PURE__ */
|
|
3090
|
+
/* @__PURE__ */ React.createElement(Icon2, { checked: inputProps.checked, className: classNames2.radio }),
|
|
3091
|
+
/* @__PURE__ */ React.createElement("div", { className: classNames2.label }, props.children)
|
|
3104
3092
|
);
|
|
3105
3093
|
}
|
|
3106
3094
|
);
|
|
3107
3095
|
Radio.Group = RadioGroup;
|
|
3108
3096
|
|
|
3109
3097
|
// src/Slider/Slider.tsx
|
|
3110
|
-
import
|
|
3111
|
-
import { useSlider } from "@react-aria/slider";
|
|
3112
|
-
import { useSliderState } from "@react-stately/slider";
|
|
3098
|
+
import { forwardRef as forwardRef14 } from "react";
|
|
3113
3099
|
import { useNumberFormatter } from "@react-aria/i18n";
|
|
3100
|
+
import { useSlider } from "@react-aria/slider";
|
|
3114
3101
|
import { useObjectRef as useObjectRef11 } from "@react-aria/utils";
|
|
3102
|
+
import { useSliderState } from "@react-stately/slider";
|
|
3115
3103
|
import { cn as cn35, createVar as createVar10, useClassNames as useClassNames33, useStateProps as useStateProps19 } from "@marigold/system";
|
|
3116
3104
|
|
|
3117
3105
|
// src/Slider/Thumb.tsx
|
|
3118
|
-
import
|
|
3106
|
+
import { useEffect as useEffect2, useRef as useRef20 } from "react";
|
|
3107
|
+
import { useFocusRing as useFocusRing11 } from "@react-aria/focus";
|
|
3119
3108
|
import { useSliderThumb } from "@react-aria/slider";
|
|
3120
3109
|
import { mergeProps as mergeProps16 } from "@react-aria/utils";
|
|
3121
3110
|
import { cn as cn34, useStateProps as useStateProps18 } from "@marigold/system";
|
|
@@ -3124,10 +3113,9 @@ import { cn as cn34, useStateProps as useStateProps18 } from "@marigold/system";
|
|
|
3124
3113
|
import { VisuallyHidden } from "@react-aria/visually-hidden";
|
|
3125
3114
|
|
|
3126
3115
|
// src/Slider/Thumb.tsx
|
|
3127
|
-
import { useFocusRing as useFocusRing11 } from "@react-aria/focus";
|
|
3128
3116
|
var Thumb = ({ state, trackRef, className, ...props }) => {
|
|
3129
3117
|
const { disabled } = props;
|
|
3130
|
-
const inputRef =
|
|
3118
|
+
const inputRef = useRef20(null);
|
|
3131
3119
|
const { isFocusVisible, focusProps, isFocused } = useFocusRing11();
|
|
3132
3120
|
const focused = isFocused || isFocusVisible || state.isThumbDragging(0);
|
|
3133
3121
|
const stateProps = useStateProps18({
|
|
@@ -3143,10 +3131,10 @@ var Thumb = ({ state, trackRef, className, ...props }) => {
|
|
|
3143
3131
|
},
|
|
3144
3132
|
state
|
|
3145
3133
|
);
|
|
3146
|
-
|
|
3134
|
+
useEffect2(() => {
|
|
3147
3135
|
state.setThumbEditable(0, !disabled);
|
|
3148
3136
|
}, [disabled, state]);
|
|
3149
|
-
return /* @__PURE__ */
|
|
3137
|
+
return /* @__PURE__ */ React.createElement("div", { className: cn34("top-1/2", className), ...thumbProps, ...stateProps }, /* @__PURE__ */ React.createElement(VisuallyHidden, null, /* @__PURE__ */ React.createElement(
|
|
3150
3138
|
"input",
|
|
3151
3139
|
{
|
|
3152
3140
|
type: "range",
|
|
@@ -3179,14 +3167,14 @@ var Slider = forwardRef14(
|
|
|
3179
3167
|
const sliderState = useStateProps19({
|
|
3180
3168
|
disabled: props.disabled
|
|
3181
3169
|
});
|
|
3182
|
-
return /* @__PURE__ */
|
|
3170
|
+
return /* @__PURE__ */ React.createElement(
|
|
3183
3171
|
"div",
|
|
3184
3172
|
{
|
|
3185
3173
|
className: "flex w-[var(--slideWidth)] touch-none flex-col",
|
|
3186
3174
|
style: createVar10({ slideWidth: width }),
|
|
3187
3175
|
...groupProps
|
|
3188
3176
|
},
|
|
3189
|
-
/* @__PURE__ */
|
|
3177
|
+
/* @__PURE__ */ React.createElement("div", { className: "flex self-stretch" }, props.children && /* @__PURE__ */ React.createElement("label", { className: classNames2.label, ...labelProps }, props.children), /* @__PURE__ */ React.createElement(
|
|
3190
3178
|
"output",
|
|
3191
3179
|
{
|
|
3192
3180
|
className: cn35(
|
|
@@ -3197,7 +3185,7 @@ var Slider = forwardRef14(
|
|
|
3197
3185
|
},
|
|
3198
3186
|
state.getThumbValueLabel(0)
|
|
3199
3187
|
)),
|
|
3200
|
-
/* @__PURE__ */
|
|
3188
|
+
/* @__PURE__ */ React.createElement(
|
|
3201
3189
|
"div",
|
|
3202
3190
|
{
|
|
3203
3191
|
className: "h-8 w-full cursor-pointer data-[disabled]:cursor-not-allowed",
|
|
@@ -3205,7 +3193,7 @@ var Slider = forwardRef14(
|
|
|
3205
3193
|
...sliderState,
|
|
3206
3194
|
ref: trackRef
|
|
3207
3195
|
},
|
|
3208
|
-
/* @__PURE__ */
|
|
3196
|
+
/* @__PURE__ */ React.createElement(
|
|
3209
3197
|
"div",
|
|
3210
3198
|
{
|
|
3211
3199
|
className: cn35(
|
|
@@ -3214,7 +3202,7 @@ var Slider = forwardRef14(
|
|
|
3214
3202
|
)
|
|
3215
3203
|
}
|
|
3216
3204
|
),
|
|
3217
|
-
/* @__PURE__ */
|
|
3205
|
+
/* @__PURE__ */ React.createElement(
|
|
3218
3206
|
Thumb,
|
|
3219
3207
|
{
|
|
3220
3208
|
state,
|
|
@@ -3229,15 +3217,13 @@ var Slider = forwardRef14(
|
|
|
3229
3217
|
);
|
|
3230
3218
|
|
|
3231
3219
|
// src/Split/Split.tsx
|
|
3232
|
-
|
|
3233
|
-
var Split = (props) => /* @__PURE__ */ React69.createElement("div", { ...props, role: "separator", className: "grow" });
|
|
3220
|
+
var Split = (props) => /* @__PURE__ */ React.createElement("div", { ...props, role: "separator", className: "grow" });
|
|
3234
3221
|
|
|
3235
3222
|
// src/Stack/Stack.tsx
|
|
3236
|
-
import React70 from "react";
|
|
3237
3223
|
import {
|
|
3224
|
+
alignment as alignment3,
|
|
3238
3225
|
cn as cn36,
|
|
3239
|
-
gapSpace as gapSpace6
|
|
3240
|
-
alignment as alignment3
|
|
3226
|
+
gapSpace as gapSpace6
|
|
3241
3227
|
} from "@marigold/system";
|
|
3242
3228
|
var Stack = ({
|
|
3243
3229
|
children,
|
|
@@ -3249,7 +3235,7 @@ var Stack = ({
|
|
|
3249
3235
|
...props
|
|
3250
3236
|
}) => {
|
|
3251
3237
|
var _a, _b, _c, _d;
|
|
3252
|
-
return /* @__PURE__ */
|
|
3238
|
+
return /* @__PURE__ */ React.createElement(
|
|
3253
3239
|
"div",
|
|
3254
3240
|
{
|
|
3255
3241
|
className: cn36(
|
|
@@ -3266,12 +3252,12 @@ var Stack = ({
|
|
|
3266
3252
|
};
|
|
3267
3253
|
|
|
3268
3254
|
// src/Switch/Switch.tsx
|
|
3269
|
-
import
|
|
3255
|
+
import { forwardRef as forwardRef15 } from "react";
|
|
3270
3256
|
import { useFocusRing as useFocusRing12 } from "@react-aria/focus";
|
|
3271
3257
|
import { useSwitch } from "@react-aria/switch";
|
|
3272
3258
|
import { useObjectRef as useObjectRef12 } from "@react-aria/utils";
|
|
3273
3259
|
import { useToggleState as useToggleState2 } from "@react-stately/toggle";
|
|
3274
|
-
import { cn as cn37, createVar as createVar11,
|
|
3260
|
+
import { cn as cn37, createVar as createVar11, useClassNames as useClassNames34, useStateProps as useStateProps20 } from "@marigold/system";
|
|
3275
3261
|
var Switch = forwardRef15(
|
|
3276
3262
|
({
|
|
3277
3263
|
variant,
|
|
@@ -3301,7 +3287,7 @@ var Switch = forwardRef15(
|
|
|
3301
3287
|
focus: isFocusVisible
|
|
3302
3288
|
});
|
|
3303
3289
|
const classNames2 = useClassNames34({ component: "Switch", size, variant });
|
|
3304
|
-
return /* @__PURE__ */
|
|
3290
|
+
return /* @__PURE__ */ React.createElement(
|
|
3305
3291
|
"label",
|
|
3306
3292
|
{
|
|
3307
3293
|
className: cn37(
|
|
@@ -3312,7 +3298,7 @@ var Switch = forwardRef15(
|
|
|
3312
3298
|
style: createVar11({ switchWidth: width }),
|
|
3313
3299
|
...stateProps
|
|
3314
3300
|
},
|
|
3315
|
-
/* @__PURE__ */
|
|
3301
|
+
/* @__PURE__ */ React.createElement(
|
|
3316
3302
|
"input",
|
|
3317
3303
|
{
|
|
3318
3304
|
ref: inputRef,
|
|
@@ -3321,8 +3307,8 @@ var Switch = forwardRef15(
|
|
|
3321
3307
|
...focusProps
|
|
3322
3308
|
}
|
|
3323
3309
|
),
|
|
3324
|
-
props.children && /* @__PURE__ */
|
|
3325
|
-
/* @__PURE__ */
|
|
3310
|
+
props.children && /* @__PURE__ */ React.createElement(React.Fragment, null, props.children),
|
|
3311
|
+
/* @__PURE__ */ React.createElement(
|
|
3326
3312
|
"div",
|
|
3327
3313
|
{
|
|
3328
3314
|
className: cn37(
|
|
@@ -3330,7 +3316,7 @@ var Switch = forwardRef15(
|
|
|
3330
3316
|
classNames2.track
|
|
3331
3317
|
)
|
|
3332
3318
|
},
|
|
3333
|
-
/* @__PURE__ */
|
|
3319
|
+
/* @__PURE__ */ React.createElement(
|
|
3334
3320
|
"div",
|
|
3335
3321
|
{
|
|
3336
3322
|
className: cn37(
|
|
@@ -3349,7 +3335,7 @@ var Switch = forwardRef15(
|
|
|
3349
3335
|
);
|
|
3350
3336
|
|
|
3351
3337
|
// src/Table/Table.tsx
|
|
3352
|
-
import
|
|
3338
|
+
import { useRef as useRef27 } from "react";
|
|
3353
3339
|
import { useTable } from "@react-aria/table";
|
|
3354
3340
|
import {
|
|
3355
3341
|
TableBody as Body2,
|
|
@@ -3367,21 +3353,20 @@ var TableContext = createContext8({});
|
|
|
3367
3353
|
var useTableContext = () => useContext8(TableContext);
|
|
3368
3354
|
|
|
3369
3355
|
// src/Table/TableBody.tsx
|
|
3370
|
-
import React72 from "react";
|
|
3371
3356
|
import { useTableRowGroup } from "@react-aria/table";
|
|
3372
3357
|
var TableBody = ({ children }) => {
|
|
3373
3358
|
const { rowGroupProps } = useTableRowGroup();
|
|
3374
|
-
return /* @__PURE__ */
|
|
3359
|
+
return /* @__PURE__ */ React.createElement("tbody", { ...rowGroupProps }, children);
|
|
3375
3360
|
};
|
|
3376
3361
|
|
|
3377
3362
|
// src/Table/TableCell.tsx
|
|
3378
|
-
import
|
|
3379
|
-
import { useTableCell } from "@react-aria/table";
|
|
3363
|
+
import { useRef as useRef21 } from "react";
|
|
3380
3364
|
import { useFocusRing as useFocusRing13 } from "@react-aria/focus";
|
|
3365
|
+
import { useTableCell } from "@react-aria/table";
|
|
3381
3366
|
import { mergeProps as mergeProps17 } from "@react-aria/utils";
|
|
3382
3367
|
import { useStateProps as useStateProps21 } from "@marigold/system";
|
|
3383
3368
|
var TableCell = ({ cell }) => {
|
|
3384
|
-
const ref =
|
|
3369
|
+
const ref = useRef21(null);
|
|
3385
3370
|
const { interactive, state, classNames: classNames2 } = useTableContext();
|
|
3386
3371
|
const disabled = state.disabledKeys.has(cell.parentKey);
|
|
3387
3372
|
const { gridCellProps } = useTableCell(
|
|
@@ -3402,7 +3387,7 @@ var TableCell = ({ cell }) => {
|
|
|
3402
3387
|
};
|
|
3403
3388
|
const { focusProps, isFocusVisible } = useFocusRing13();
|
|
3404
3389
|
const stateProps = useStateProps21({ disabled, focusVisible: isFocusVisible });
|
|
3405
|
-
return /* @__PURE__ */
|
|
3390
|
+
return /* @__PURE__ */ React.createElement(
|
|
3406
3391
|
"td",
|
|
3407
3392
|
{
|
|
3408
3393
|
ref,
|
|
@@ -3415,9 +3400,9 @@ var TableCell = ({ cell }) => {
|
|
|
3415
3400
|
};
|
|
3416
3401
|
|
|
3417
3402
|
// src/Table/TableCheckboxCell.tsx
|
|
3418
|
-
import
|
|
3419
|
-
import { useTableCell as useTableCell2, useTableSelectionCheckbox } from "@react-aria/table";
|
|
3403
|
+
import { useRef as useRef22 } from "react";
|
|
3420
3404
|
import { useFocusRing as useFocusRing14 } from "@react-aria/focus";
|
|
3405
|
+
import { useTableCell as useTableCell2, useTableSelectionCheckbox } from "@react-aria/table";
|
|
3421
3406
|
import { mergeProps as mergeProps18 } from "@react-aria/utils";
|
|
3422
3407
|
import { cn as cn38, useStateProps as useStateProps22 } from "@marigold/system";
|
|
3423
3408
|
|
|
@@ -3443,7 +3428,7 @@ var mapCheckboxProps = ({
|
|
|
3443
3428
|
|
|
3444
3429
|
// src/Table/TableCheckboxCell.tsx
|
|
3445
3430
|
var TableCheckboxCell = ({ cell }) => {
|
|
3446
|
-
const ref =
|
|
3431
|
+
const ref = useRef22(null);
|
|
3447
3432
|
const { state, classNames: classNames2 } = useTableContext();
|
|
3448
3433
|
const disabled = state.disabledKeys.has(cell.parentKey);
|
|
3449
3434
|
const { gridCellProps } = useTableCell2(
|
|
@@ -3458,7 +3443,7 @@ var TableCheckboxCell = ({ cell }) => {
|
|
|
3458
3443
|
);
|
|
3459
3444
|
const { focusProps, isFocusVisible } = useFocusRing14();
|
|
3460
3445
|
const stateProps = useStateProps22({ disabled, focusVisible: isFocusVisible });
|
|
3461
|
-
return /* @__PURE__ */
|
|
3446
|
+
return /* @__PURE__ */ React.createElement(
|
|
3462
3447
|
"td",
|
|
3463
3448
|
{
|
|
3464
3449
|
ref,
|
|
@@ -3466,41 +3451,25 @@ var TableCheckboxCell = ({ cell }) => {
|
|
|
3466
3451
|
...mergeProps18(gridCellProps, focusProps),
|
|
3467
3452
|
...stateProps
|
|
3468
3453
|
},
|
|
3469
|
-
/* @__PURE__ */
|
|
3454
|
+
/* @__PURE__ */ React.createElement(Checkbox, { ...checkboxProps })
|
|
3470
3455
|
);
|
|
3471
3456
|
};
|
|
3472
3457
|
|
|
3473
3458
|
// src/Table/TableColumnHeader.tsx
|
|
3474
|
-
import
|
|
3459
|
+
import { useRef as useRef23 } from "react";
|
|
3475
3460
|
import { useFocusRing as useFocusRing15 } from "@react-aria/focus";
|
|
3476
3461
|
import { useHover as useHover9 } from "@react-aria/interactions";
|
|
3477
3462
|
import { useTableColumnHeader } from "@react-aria/table";
|
|
3478
3463
|
import { mergeProps as mergeProps19 } from "@react-aria/utils";
|
|
3464
|
+
import { SortDown, SortUp } from "@marigold/icons";
|
|
3479
3465
|
import { cn as cn39, useStateProps as useStateProps23 } from "@marigold/system";
|
|
3480
3466
|
import { width as twWidth2 } from "@marigold/system";
|
|
3481
|
-
var SortIndicator = ({
|
|
3482
|
-
direction = "ascending",
|
|
3483
|
-
visible
|
|
3484
|
-
}) => {
|
|
3485
|
-
return /* @__PURE__ */ React75.createElement(
|
|
3486
|
-
"span",
|
|
3487
|
-
{
|
|
3488
|
-
role: "presentation",
|
|
3489
|
-
"aria-hidden": "true",
|
|
3490
|
-
className: cn39(
|
|
3491
|
-
"ps-[0.5ch] text-current",
|
|
3492
|
-
visible ? "visible" : "invisible"
|
|
3493
|
-
)
|
|
3494
|
-
},
|
|
3495
|
-
direction === "ascending" ? "\u25B2" : "\u25BC"
|
|
3496
|
-
);
|
|
3497
|
-
};
|
|
3498
3467
|
var TableColumnHeader = ({
|
|
3499
3468
|
column,
|
|
3500
3469
|
width = "auto"
|
|
3501
3470
|
}) => {
|
|
3502
3471
|
var _a, _b;
|
|
3503
|
-
const ref =
|
|
3472
|
+
const ref = useRef23(null);
|
|
3504
3473
|
const { state, classNames: classNames2 } = useTableContext();
|
|
3505
3474
|
const { columnHeaderProps } = useTableColumnHeader(
|
|
3506
3475
|
{
|
|
@@ -3515,7 +3484,7 @@ var TableColumnHeader = ({
|
|
|
3515
3484
|
hover: isHovered,
|
|
3516
3485
|
focusVisible: isFocusVisible
|
|
3517
3486
|
});
|
|
3518
|
-
return /* @__PURE__ */
|
|
3487
|
+
return /* @__PURE__ */ React.createElement(
|
|
3519
3488
|
"th",
|
|
3520
3489
|
{
|
|
3521
3490
|
colSpan: column.colspan,
|
|
@@ -3525,43 +3494,36 @@ var TableColumnHeader = ({
|
|
|
3525
3494
|
...stateProps
|
|
3526
3495
|
},
|
|
3527
3496
|
column.rendered,
|
|
3528
|
-
column.props.allowsSorting && /* @__PURE__ */
|
|
3529
|
-
SortIndicator,
|
|
3530
|
-
{
|
|
3531
|
-
direction: (_a = state.sortDescriptor) == null ? void 0 : _a.direction,
|
|
3532
|
-
visible: ((_b = state.sortDescriptor) == null ? void 0 : _b.column) === column.key
|
|
3533
|
-
}
|
|
3534
|
-
)
|
|
3497
|
+
column.props.allowsSorting && (((_a = state.sortDescriptor) == null ? void 0 : _a.column) === column.key ? ((_b = state.sortDescriptor) == null ? void 0 : _b.direction) === "ascending" ? /* @__PURE__ */ React.createElement(SortUp, { className: "inline-block" }) : /* @__PURE__ */ React.createElement(SortDown, { className: "inline-block" }) : /* @__PURE__ */ React.createElement(SortDown, { className: "inline-block" }))
|
|
3535
3498
|
);
|
|
3536
3499
|
};
|
|
3537
3500
|
|
|
3538
3501
|
// src/Table/TableHeader.tsx
|
|
3539
|
-
import React76 from "react";
|
|
3540
3502
|
import { useTableRowGroup as useTableRowGroup2 } from "@react-aria/table";
|
|
3541
3503
|
var TableHeader = ({ children }) => {
|
|
3542
3504
|
const { rowGroupProps } = useTableRowGroup2();
|
|
3543
|
-
return /* @__PURE__ */
|
|
3505
|
+
return /* @__PURE__ */ React.createElement("thead", { ...rowGroupProps }, children);
|
|
3544
3506
|
};
|
|
3545
3507
|
|
|
3546
3508
|
// src/Table/TableHeaderRow.tsx
|
|
3547
|
-
import
|
|
3509
|
+
import { useRef as useRef24 } from "react";
|
|
3548
3510
|
import { useTableHeaderRow } from "@react-aria/table";
|
|
3549
3511
|
var TableHeaderRow = ({ item, children }) => {
|
|
3550
3512
|
const { state } = useTableContext();
|
|
3551
|
-
const ref =
|
|
3513
|
+
const ref = useRef24(null);
|
|
3552
3514
|
const { rowProps } = useTableHeaderRow({ node: item }, state, ref);
|
|
3553
|
-
return /* @__PURE__ */
|
|
3515
|
+
return /* @__PURE__ */ React.createElement("tr", { ...rowProps, ref }, children);
|
|
3554
3516
|
};
|
|
3555
3517
|
|
|
3556
3518
|
// src/Table/TableRow.tsx
|
|
3557
|
-
import
|
|
3519
|
+
import { useRef as useRef25 } from "react";
|
|
3558
3520
|
import { useFocusRing as useFocusRing16 } from "@react-aria/focus";
|
|
3559
3521
|
import { useHover as useHover10 } from "@react-aria/interactions";
|
|
3560
3522
|
import { useTableRow } from "@react-aria/table";
|
|
3561
3523
|
import { mergeProps as mergeProps20 } from "@react-aria/utils";
|
|
3562
3524
|
import { cn as cn40, useClassNames as useClassNames35, useStateProps as useStateProps24 } from "@marigold/system";
|
|
3563
3525
|
var TableRow = ({ children, row }) => {
|
|
3564
|
-
const ref =
|
|
3526
|
+
const ref = useRef25(null);
|
|
3565
3527
|
const { interactive, state, ...ctx } = useTableContext();
|
|
3566
3528
|
const { variant, size } = row.props;
|
|
3567
3529
|
const classNames2 = useClassNames35({
|
|
@@ -3589,7 +3551,7 @@ var TableRow = ({ children, row }) => {
|
|
|
3589
3551
|
focusVisible: isFocusVisible,
|
|
3590
3552
|
active: isPressed
|
|
3591
3553
|
});
|
|
3592
|
-
return /* @__PURE__ */
|
|
3554
|
+
return /* @__PURE__ */ React.createElement(
|
|
3593
3555
|
"tr",
|
|
3594
3556
|
{
|
|
3595
3557
|
ref,
|
|
@@ -3607,7 +3569,7 @@ var TableRow = ({ children, row }) => {
|
|
|
3607
3569
|
};
|
|
3608
3570
|
|
|
3609
3571
|
// src/Table/TableSelectAllCell.tsx
|
|
3610
|
-
import
|
|
3572
|
+
import { useRef as useRef26 } from "react";
|
|
3611
3573
|
import { useFocusRing as useFocusRing17 } from "@react-aria/focus";
|
|
3612
3574
|
import { useHover as useHover11 } from "@react-aria/interactions";
|
|
3613
3575
|
import {
|
|
@@ -3624,7 +3586,7 @@ var TableSelectAllCell = ({
|
|
|
3624
3586
|
column,
|
|
3625
3587
|
width = "auto"
|
|
3626
3588
|
}) => {
|
|
3627
|
-
const ref =
|
|
3589
|
+
const ref = useRef26(null);
|
|
3628
3590
|
const { state, classNames: classNames2 } = useTableContext();
|
|
3629
3591
|
const { columnHeaderProps } = useTableColumnHeader2(
|
|
3630
3592
|
{
|
|
@@ -3640,7 +3602,7 @@ var TableSelectAllCell = ({
|
|
|
3640
3602
|
hover: isHovered,
|
|
3641
3603
|
focusVisible: isFocusVisible
|
|
3642
3604
|
});
|
|
3643
|
-
return /* @__PURE__ */
|
|
3605
|
+
return /* @__PURE__ */ React.createElement(
|
|
3644
3606
|
"th",
|
|
3645
3607
|
{
|
|
3646
3608
|
ref,
|
|
@@ -3652,7 +3614,7 @@ var TableSelectAllCell = ({
|
|
|
3652
3614
|
...mergeProps21(columnHeaderProps, hoverProps, focusProps),
|
|
3653
3615
|
...stateProps
|
|
3654
3616
|
},
|
|
3655
|
-
/* @__PURE__ */
|
|
3617
|
+
/* @__PURE__ */ React.createElement(Checkbox, { ...checkboxProps })
|
|
3656
3618
|
);
|
|
3657
3619
|
};
|
|
3658
3620
|
|
|
@@ -3665,7 +3627,7 @@ var Table = ({
|
|
|
3665
3627
|
...props
|
|
3666
3628
|
}) => {
|
|
3667
3629
|
const interactive = selectionMode !== "none";
|
|
3668
|
-
const tableRef =
|
|
3630
|
+
const tableRef = useRef27(null);
|
|
3669
3631
|
const state = useTableState({
|
|
3670
3632
|
...props,
|
|
3671
3633
|
selectionMode,
|
|
@@ -3679,33 +3641,34 @@ var Table = ({
|
|
|
3679
3641
|
size
|
|
3680
3642
|
});
|
|
3681
3643
|
const { collection } = state;
|
|
3682
|
-
return /* @__PURE__ */
|
|
3644
|
+
return /* @__PURE__ */ React.createElement(
|
|
3683
3645
|
TableContext.Provider,
|
|
3684
3646
|
{
|
|
3685
3647
|
value: { state, interactive, classNames: classNames2, variant, size }
|
|
3686
3648
|
},
|
|
3687
|
-
/* @__PURE__ */
|
|
3649
|
+
/* @__PURE__ */ React.createElement(
|
|
3688
3650
|
"table",
|
|
3689
3651
|
{
|
|
3690
3652
|
ref: tableRef,
|
|
3691
3653
|
className: cn42(
|
|
3654
|
+
"group/table",
|
|
3692
3655
|
"border-collapse overflow-auto whitespace-nowrap",
|
|
3693
3656
|
stretch ? "table w-full" : "block",
|
|
3694
3657
|
classNames2.table
|
|
3695
3658
|
),
|
|
3696
3659
|
...gridProps
|
|
3697
3660
|
},
|
|
3698
|
-
/* @__PURE__ */
|
|
3661
|
+
/* @__PURE__ */ React.createElement(TableHeader, null, collection.headerRows.map((headerRow) => /* @__PURE__ */ React.createElement(TableHeaderRow, { key: headerRow.key, item: headerRow }, [...collection.getChildren(headerRow.key)].map(
|
|
3699
3662
|
(column) => {
|
|
3700
3663
|
var _a, _b, _c;
|
|
3701
|
-
return ((_a = column.props) == null ? void 0 : _a.isSelectionCell) ? /* @__PURE__ */
|
|
3664
|
+
return ((_a = column.props) == null ? void 0 : _a.isSelectionCell) ? /* @__PURE__ */ React.createElement(
|
|
3702
3665
|
TableSelectAllCell,
|
|
3703
3666
|
{
|
|
3704
3667
|
width: (_b = column.props) == null ? void 0 : _b.width,
|
|
3705
3668
|
key: column.key,
|
|
3706
3669
|
column
|
|
3707
3670
|
}
|
|
3708
|
-
) : /* @__PURE__ */
|
|
3671
|
+
) : /* @__PURE__ */ React.createElement(
|
|
3709
3672
|
TableColumnHeader,
|
|
3710
3673
|
{
|
|
3711
3674
|
width: (_c = column.props) == null ? void 0 : _c.width,
|
|
@@ -3715,11 +3678,11 @@ var Table = ({
|
|
|
3715
3678
|
);
|
|
3716
3679
|
}
|
|
3717
3680
|
)))),
|
|
3718
|
-
/* @__PURE__ */
|
|
3719
|
-
(row) => row.type === "item" && /* @__PURE__ */
|
|
3681
|
+
/* @__PURE__ */ React.createElement(TableBody, null, ...collection.rows.map(
|
|
3682
|
+
(row) => row.type === "item" && /* @__PURE__ */ React.createElement(TableRow, { key: row.key, row }, [...collection.getChildren(row.key)].map(
|
|
3720
3683
|
(cell) => {
|
|
3721
3684
|
var _a;
|
|
3722
|
-
return ((_a = cell.props) == null ? void 0 : _a.isSelectionCell) ? /* @__PURE__ */
|
|
3685
|
+
return ((_a = cell.props) == null ? void 0 : _a.isSelectionCell) ? /* @__PURE__ */ React.createElement(TableCheckboxCell, { key: cell.key, cell }) : /* @__PURE__ */ React.createElement(TableCell, { key: cell.key, cell });
|
|
3723
3686
|
}
|
|
3724
3687
|
))
|
|
3725
3688
|
))
|
|
@@ -3733,7 +3696,6 @@ Table.Header = Header2;
|
|
|
3733
3696
|
Table.Row = Row;
|
|
3734
3697
|
|
|
3735
3698
|
// src/Text/Text.tsx
|
|
3736
|
-
import React81 from "react";
|
|
3737
3699
|
import {
|
|
3738
3700
|
cn as cn43,
|
|
3739
3701
|
createVar as createVar12,
|
|
@@ -3741,10 +3703,10 @@ import {
|
|
|
3741
3703
|
fontWeight,
|
|
3742
3704
|
get as get2,
|
|
3743
3705
|
textAlign as textAlign2,
|
|
3744
|
-
useClassNames as useClassNames37,
|
|
3745
|
-
useTheme as useTheme5,
|
|
3746
3706
|
textSize,
|
|
3747
|
-
textStyle
|
|
3707
|
+
textStyle,
|
|
3708
|
+
useClassNames as useClassNames37,
|
|
3709
|
+
useTheme as useTheme5
|
|
3748
3710
|
} from "@marigold/system";
|
|
3749
3711
|
var Text = ({
|
|
3750
3712
|
variant,
|
|
@@ -3764,7 +3726,7 @@ var Text = ({
|
|
|
3764
3726
|
variant,
|
|
3765
3727
|
size
|
|
3766
3728
|
});
|
|
3767
|
-
return /* @__PURE__ */
|
|
3729
|
+
return /* @__PURE__ */ React.createElement(
|
|
3768
3730
|
"p",
|
|
3769
3731
|
{
|
|
3770
3732
|
...props,
|
|
@@ -3791,9 +3753,9 @@ var Text = ({
|
|
|
3791
3753
|
};
|
|
3792
3754
|
|
|
3793
3755
|
// src/TextArea/TextArea.tsx
|
|
3794
|
-
import
|
|
3795
|
-
import { useHover as useHover12 } from "@react-aria/interactions";
|
|
3756
|
+
import { forwardRef as forwardRef16 } from "react";
|
|
3796
3757
|
import { useFocusRing as useFocusRing18 } from "@react-aria/focus";
|
|
3758
|
+
import { useHover as useHover12 } from "@react-aria/interactions";
|
|
3797
3759
|
import { useTextField } from "@react-aria/textfield";
|
|
3798
3760
|
import { useObjectRef as useObjectRef13 } from "@react-aria/utils";
|
|
3799
3761
|
import { useClassNames as useClassNames38, useStateProps as useStateProps26 } from "@marigold/system";
|
|
@@ -3833,7 +3795,7 @@ var TextArea = forwardRef16(
|
|
|
3833
3795
|
error
|
|
3834
3796
|
});
|
|
3835
3797
|
const classNames2 = useClassNames38({ component: "TextArea", variant, size });
|
|
3836
|
-
return /* @__PURE__ */
|
|
3798
|
+
return /* @__PURE__ */ React.createElement(
|
|
3837
3799
|
FieldBase,
|
|
3838
3800
|
{
|
|
3839
3801
|
label,
|
|
@@ -3848,7 +3810,7 @@ var TextArea = forwardRef16(
|
|
|
3848
3810
|
size,
|
|
3849
3811
|
width
|
|
3850
3812
|
},
|
|
3851
|
-
/* @__PURE__ */
|
|
3813
|
+
/* @__PURE__ */ React.createElement(
|
|
3852
3814
|
"textarea",
|
|
3853
3815
|
{
|
|
3854
3816
|
className: classNames2,
|
|
@@ -3864,9 +3826,9 @@ var TextArea = forwardRef16(
|
|
|
3864
3826
|
);
|
|
3865
3827
|
|
|
3866
3828
|
// src/TextField/TextField.tsx
|
|
3867
|
-
import
|
|
3868
|
-
import { useHover as useHover13 } from "@react-aria/interactions";
|
|
3829
|
+
import { forwardRef as forwardRef17 } from "react";
|
|
3869
3830
|
import { useFocusRing as useFocusRing19 } from "@react-aria/focus";
|
|
3831
|
+
import { useHover as useHover13 } from "@react-aria/interactions";
|
|
3870
3832
|
import { useTextField as useTextField2 } from "@react-aria/textfield";
|
|
3871
3833
|
import { mergeProps as mergeProps22, useObjectRef as useObjectRef14 } from "@react-aria/utils";
|
|
3872
3834
|
import { useStateProps as useStateProps27 } from "@marigold/system";
|
|
@@ -3897,7 +3859,7 @@ var TextField = forwardRef17(
|
|
|
3897
3859
|
readOnly,
|
|
3898
3860
|
required
|
|
3899
3861
|
});
|
|
3900
|
-
return /* @__PURE__ */
|
|
3862
|
+
return /* @__PURE__ */ React.createElement(
|
|
3901
3863
|
FieldBase,
|
|
3902
3864
|
{
|
|
3903
3865
|
label,
|
|
@@ -3912,7 +3874,7 @@ var TextField = forwardRef17(
|
|
|
3912
3874
|
size,
|
|
3913
3875
|
width
|
|
3914
3876
|
},
|
|
3915
|
-
/* @__PURE__ */
|
|
3877
|
+
/* @__PURE__ */ React.createElement(
|
|
3916
3878
|
Input,
|
|
3917
3879
|
{
|
|
3918
3880
|
ref: inputRef,
|
|
@@ -3926,8 +3888,7 @@ var TextField = forwardRef17(
|
|
|
3926
3888
|
);
|
|
3927
3889
|
|
|
3928
3890
|
// src/Tiles/Tiles.tsx
|
|
3929
|
-
import
|
|
3930
|
-
import { gapSpace as gapSpace7, cn as cn44, createVar as createVar13 } from "@marigold/system";
|
|
3891
|
+
import { cn as cn44, createVar as createVar13, gapSpace as gapSpace7 } from "@marigold/system";
|
|
3931
3892
|
var Tiles = ({
|
|
3932
3893
|
space = 0,
|
|
3933
3894
|
stretch = false,
|
|
@@ -3940,7 +3901,7 @@ var Tiles = ({
|
|
|
3940
3901
|
if (stretch) {
|
|
3941
3902
|
column = `minmax(${column}, 1fr)`;
|
|
3942
3903
|
}
|
|
3943
|
-
return /* @__PURE__ */
|
|
3904
|
+
return /* @__PURE__ */ React.createElement(
|
|
3944
3905
|
"div",
|
|
3945
3906
|
{
|
|
3946
3907
|
...props,
|
|
@@ -3957,7 +3918,6 @@ var Tiles = ({
|
|
|
3957
3918
|
};
|
|
3958
3919
|
|
|
3959
3920
|
// src/Tooltip/Tooltip.tsx
|
|
3960
|
-
import React86 from "react";
|
|
3961
3921
|
import { useTooltip } from "@react-aria/tooltip";
|
|
3962
3922
|
import { cn as cn45, useClassNames as useClassNames39 } from "@marigold/system";
|
|
3963
3923
|
|
|
@@ -3967,7 +3927,7 @@ var TooltipContext = createContext9({});
|
|
|
3967
3927
|
var useTooltipContext = () => useContext9(TooltipContext);
|
|
3968
3928
|
|
|
3969
3929
|
// src/Tooltip/TooltipTrigger.tsx
|
|
3970
|
-
import
|
|
3930
|
+
import { Children as Children7, useRef as useRef28 } from "react";
|
|
3971
3931
|
import { FocusableProvider } from "@react-aria/focus";
|
|
3972
3932
|
import { useOverlayPosition } from "@react-aria/overlays";
|
|
3973
3933
|
import { useTooltipTrigger } from "@react-aria/tooltip";
|
|
@@ -3980,7 +3940,7 @@ var TooltipTrigger = ({
|
|
|
3980
3940
|
children,
|
|
3981
3941
|
...rest
|
|
3982
3942
|
}) => {
|
|
3983
|
-
const [tooltipTrigger, tooltip] =
|
|
3943
|
+
const [tooltipTrigger, tooltip] = Children7.toArray(children);
|
|
3984
3944
|
const props = {
|
|
3985
3945
|
...rest,
|
|
3986
3946
|
isDisabled: disabled,
|
|
@@ -3988,8 +3948,8 @@ var TooltipTrigger = ({
|
|
|
3988
3948
|
delay,
|
|
3989
3949
|
placement
|
|
3990
3950
|
};
|
|
3991
|
-
const tooltipTriggerRef =
|
|
3992
|
-
const overlayRef =
|
|
3951
|
+
const tooltipTriggerRef = useRef28(null);
|
|
3952
|
+
const overlayRef = useRef28(null);
|
|
3993
3953
|
const state = useTooltipTriggerState(props);
|
|
3994
3954
|
const { triggerProps, tooltipProps } = useTooltipTrigger(
|
|
3995
3955
|
props,
|
|
@@ -4008,7 +3968,7 @@ var TooltipTrigger = ({
|
|
|
4008
3968
|
isOpen: state.isOpen,
|
|
4009
3969
|
overlayRef
|
|
4010
3970
|
});
|
|
4011
|
-
return /* @__PURE__ */
|
|
3971
|
+
return /* @__PURE__ */ React.createElement(FocusableProvider, { ref: tooltipTriggerRef, ...triggerProps }, tooltipTrigger, /* @__PURE__ */ React.createElement(
|
|
4012
3972
|
TooltipContext.Provider,
|
|
4013
3973
|
{
|
|
4014
3974
|
value: {
|
|
@@ -4020,7 +3980,7 @@ var TooltipTrigger = ({
|
|
|
4020
3980
|
...positionProps
|
|
4021
3981
|
}
|
|
4022
3982
|
},
|
|
4023
|
-
/* @__PURE__ */
|
|
3983
|
+
/* @__PURE__ */ React.createElement(Overlay, { open: state.isOpen }, tooltip)
|
|
4024
3984
|
));
|
|
4025
3985
|
};
|
|
4026
3986
|
|
|
@@ -4029,7 +3989,7 @@ var Tooltip = ({ children, variant, size }) => {
|
|
|
4029
3989
|
const { arrowProps, state, overlayRef, placement, ...rest } = useTooltipContext();
|
|
4030
3990
|
const { tooltipProps } = useTooltip({}, state);
|
|
4031
3991
|
const classNames2 = useClassNames39({ component: "Tooltip", variant, size });
|
|
4032
|
-
return /* @__PURE__ */
|
|
3992
|
+
return /* @__PURE__ */ React.createElement(
|
|
4033
3993
|
"div",
|
|
4034
3994
|
{
|
|
4035
3995
|
...tooltipProps,
|
|
@@ -4038,8 +3998,8 @@ var Tooltip = ({ children, variant, size }) => {
|
|
|
4038
3998
|
className: cn45("group/tooltip", classNames2.container),
|
|
4039
3999
|
"data-placement": placement
|
|
4040
4000
|
},
|
|
4041
|
-
/* @__PURE__ */
|
|
4042
|
-
/* @__PURE__ */
|
|
4001
|
+
/* @__PURE__ */ React.createElement("div", null, children),
|
|
4002
|
+
/* @__PURE__ */ React.createElement(
|
|
4043
4003
|
"div",
|
|
4044
4004
|
{
|
|
4045
4005
|
...arrowProps,
|
|
@@ -4054,23 +4014,23 @@ Tooltip.Trigger = TooltipTrigger;
|
|
|
4054
4014
|
import { Item as Item6 } from "@react-stately/collections";
|
|
4055
4015
|
|
|
4056
4016
|
// src/TagGroup/TagGroup.tsx
|
|
4057
|
-
import
|
|
4017
|
+
import { useRef as useRef29 } from "react";
|
|
4058
4018
|
import { useTagGroup } from "@react-aria/tag";
|
|
4059
4019
|
import { useListState } from "@react-stately/list";
|
|
4060
4020
|
import { useStateProps as useStateProps28 } from "@marigold/system";
|
|
4061
4021
|
|
|
4062
4022
|
// src/TagGroup/Tag.tsx
|
|
4063
|
-
import
|
|
4064
|
-
import { useTag } from "@react-aria/tag";
|
|
4023
|
+
import React4 from "react";
|
|
4065
4024
|
import { useFocusRing as useFocusRing20 } from "@react-aria/focus";
|
|
4066
|
-
import {
|
|
4025
|
+
import { useTag } from "@react-aria/tag";
|
|
4067
4026
|
import { mergeProps as mergeProps23 } from "@react-aria/utils";
|
|
4027
|
+
import { cn as cn46, useClassNames as useClassNames40 } from "@marigold/system";
|
|
4068
4028
|
var Tag = ({ variant, size, item, state, ...rest }) => {
|
|
4069
4029
|
const props = {
|
|
4070
4030
|
item,
|
|
4071
4031
|
...rest
|
|
4072
4032
|
};
|
|
4073
|
-
let ref =
|
|
4033
|
+
let ref = React4.useRef(null);
|
|
4074
4034
|
let { focusProps } = useFocusRing20({ within: true });
|
|
4075
4035
|
const { rowProps, gridCellProps, allowsRemoving, removeButtonProps } = useTag(
|
|
4076
4036
|
{
|
|
@@ -4081,21 +4041,21 @@ var Tag = ({ variant, size, item, state, ...rest }) => {
|
|
|
4081
4041
|
ref
|
|
4082
4042
|
);
|
|
4083
4043
|
const classNames2 = useClassNames40({ component: "Tag", variant, size });
|
|
4084
|
-
return /* @__PURE__ */
|
|
4044
|
+
return /* @__PURE__ */ React4.createElement(
|
|
4085
4045
|
"span",
|
|
4086
4046
|
{
|
|
4087
4047
|
ref,
|
|
4088
4048
|
...mergeProps23(rowProps, focusProps),
|
|
4089
4049
|
className: classNames2.tag
|
|
4090
4050
|
},
|
|
4091
|
-
/* @__PURE__ */
|
|
4051
|
+
/* @__PURE__ */ React4.createElement("div", { ...gridCellProps, className: classNames2.gridCell }, /* @__PURE__ */ React4.createElement("span", null, item.rendered), allowsRemoving && /* @__PURE__ */ React4.createElement(
|
|
4092
4052
|
Button,
|
|
4093
4053
|
{
|
|
4094
4054
|
...removeButtonProps,
|
|
4095
4055
|
className: cn46("flex items-center", classNames2.closeButton),
|
|
4096
4056
|
role: "button"
|
|
4097
4057
|
},
|
|
4098
|
-
/* @__PURE__ */
|
|
4058
|
+
/* @__PURE__ */ React4.createElement("svg", { viewBox: "0 0 20 20", fill: "currentColor", width: 20, height: 20 }, /* @__PURE__ */ React4.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" }))
|
|
4099
4059
|
))
|
|
4100
4060
|
);
|
|
4101
4061
|
};
|
|
@@ -4113,14 +4073,14 @@ var TagGroup = ({
|
|
|
4113
4073
|
validationState: error ? "invalid" : "valid",
|
|
4114
4074
|
...rest
|
|
4115
4075
|
};
|
|
4116
|
-
const inputRef =
|
|
4076
|
+
const inputRef = useRef29(null);
|
|
4117
4077
|
const state = useListState(props);
|
|
4118
4078
|
const { gridProps, labelProps, descriptionProps, errorMessageProps } = useTagGroup(props, state, inputRef);
|
|
4119
4079
|
const stateProps = useStateProps28({
|
|
4120
4080
|
error,
|
|
4121
4081
|
required
|
|
4122
4082
|
});
|
|
4123
|
-
return /* @__PURE__ */
|
|
4083
|
+
return /* @__PURE__ */ React.createElement(
|
|
4124
4084
|
FieldBase,
|
|
4125
4085
|
{
|
|
4126
4086
|
width,
|
|
@@ -4134,14 +4094,14 @@ var TagGroup = ({
|
|
|
4134
4094
|
stateProps,
|
|
4135
4095
|
...gridProps
|
|
4136
4096
|
},
|
|
4137
|
-
/* @__PURE__ */
|
|
4097
|
+
/* @__PURE__ */ React.createElement(
|
|
4138
4098
|
"div",
|
|
4139
4099
|
{
|
|
4140
4100
|
role: "presentation",
|
|
4141
4101
|
ref: inputRef,
|
|
4142
4102
|
className: "flex flex-wrap items-start gap-1"
|
|
4143
4103
|
},
|
|
4144
|
-
[...state.collection].map((item) => /* @__PURE__ */
|
|
4104
|
+
[...state.collection].map((item) => /* @__PURE__ */ React.createElement(
|
|
4145
4105
|
Tag,
|
|
4146
4106
|
{
|
|
4147
4107
|
...item.props,
|
|
@@ -4162,9 +4122,9 @@ var Tag2 = Item6;
|
|
|
4162
4122
|
Tag2.Group = TagGroup;
|
|
4163
4123
|
|
|
4164
4124
|
// src/XLoader/XLoader.tsx
|
|
4125
|
+
import { forwardRef as forwardRef18 } from "react";
|
|
4165
4126
|
import { SVG as SVG6 } from "@marigold/system";
|
|
4166
|
-
|
|
4167
|
-
var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ React89.createElement(
|
|
4127
|
+
var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ React.createElement(
|
|
4168
4128
|
SVG6,
|
|
4169
4129
|
{
|
|
4170
4130
|
id: "XLoader",
|
|
@@ -4174,14 +4134,14 @@ var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ React89.createElement
|
|
|
4174
4134
|
...props,
|
|
4175
4135
|
...ref
|
|
4176
4136
|
},
|
|
4177
|
-
/* @__PURE__ */
|
|
4178
|
-
/* @__PURE__ */
|
|
4137
|
+
/* @__PURE__ */ React.createElement("path", { id: "XMLID_1_", d: "M35.3 27h26.5l54 74.1H88.7z" }),
|
|
4138
|
+
/* @__PURE__ */ React.createElement(
|
|
4179
4139
|
"path",
|
|
4180
4140
|
{
|
|
4181
4141
|
id: "XMLID_5_",
|
|
4182
4142
|
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"
|
|
4183
4143
|
},
|
|
4184
|
-
/* @__PURE__ */
|
|
4144
|
+
/* @__PURE__ */ React.createElement(
|
|
4185
4145
|
"animate",
|
|
4186
4146
|
{
|
|
4187
4147
|
attributeName: "opacity",
|
|
@@ -4193,13 +4153,13 @@ var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ React89.createElement
|
|
|
4193
4153
|
}
|
|
4194
4154
|
)
|
|
4195
4155
|
),
|
|
4196
|
-
/* @__PURE__ */
|
|
4156
|
+
/* @__PURE__ */ React.createElement(
|
|
4197
4157
|
"path",
|
|
4198
4158
|
{
|
|
4199
4159
|
id: "XMLID_18_",
|
|
4200
4160
|
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"
|
|
4201
4161
|
},
|
|
4202
|
-
/* @__PURE__ */
|
|
4162
|
+
/* @__PURE__ */ React.createElement(
|
|
4203
4163
|
"animate",
|
|
4204
4164
|
{
|
|
4205
4165
|
attributeName: "opacity",
|
|
@@ -4211,13 +4171,13 @@ var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ React89.createElement
|
|
|
4211
4171
|
}
|
|
4212
4172
|
)
|
|
4213
4173
|
),
|
|
4214
|
-
/* @__PURE__ */
|
|
4174
|
+
/* @__PURE__ */ React.createElement(
|
|
4215
4175
|
"path",
|
|
4216
4176
|
{
|
|
4217
4177
|
id: "XMLID_19_",
|
|
4218
4178
|
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"
|
|
4219
4179
|
},
|
|
4220
|
-
/* @__PURE__ */
|
|
4180
|
+
/* @__PURE__ */ React.createElement(
|
|
4221
4181
|
"animate",
|
|
4222
4182
|
{
|
|
4223
4183
|
attributeName: "opacity",
|
|
@@ -4229,13 +4189,13 @@ var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ React89.createElement
|
|
|
4229
4189
|
}
|
|
4230
4190
|
)
|
|
4231
4191
|
),
|
|
4232
|
-
/* @__PURE__ */
|
|
4192
|
+
/* @__PURE__ */ React.createElement(
|
|
4233
4193
|
"path",
|
|
4234
4194
|
{
|
|
4235
4195
|
id: "XMLID_20_",
|
|
4236
4196
|
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"
|
|
4237
4197
|
},
|
|
4238
|
-
/* @__PURE__ */
|
|
4198
|
+
/* @__PURE__ */ React.createElement(
|
|
4239
4199
|
"animate",
|
|
4240
4200
|
{
|
|
4241
4201
|
attributeName: "opacity",
|
|
@@ -4247,13 +4207,13 @@ var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ React89.createElement
|
|
|
4247
4207
|
}
|
|
4248
4208
|
)
|
|
4249
4209
|
),
|
|
4250
|
-
/* @__PURE__ */
|
|
4210
|
+
/* @__PURE__ */ React.createElement(
|
|
4251
4211
|
"path",
|
|
4252
4212
|
{
|
|
4253
4213
|
id: "XMLID_21_",
|
|
4254
4214
|
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"
|
|
4255
4215
|
},
|
|
4256
|
-
/* @__PURE__ */
|
|
4216
|
+
/* @__PURE__ */ React.createElement(
|
|
4257
4217
|
"animate",
|
|
4258
4218
|
{
|
|
4259
4219
|
attributeName: "opacity",
|
|
@@ -4265,13 +4225,13 @@ var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ React89.createElement
|
|
|
4265
4225
|
}
|
|
4266
4226
|
)
|
|
4267
4227
|
),
|
|
4268
|
-
/* @__PURE__ */
|
|
4228
|
+
/* @__PURE__ */ React.createElement(
|
|
4269
4229
|
"path",
|
|
4270
4230
|
{
|
|
4271
4231
|
id: "XMLID_22_",
|
|
4272
4232
|
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"
|
|
4273
4233
|
},
|
|
4274
|
-
/* @__PURE__ */
|
|
4234
|
+
/* @__PURE__ */ React.createElement(
|
|
4275
4235
|
"animate",
|
|
4276
4236
|
{
|
|
4277
4237
|
attributeName: "opacity",
|
|
@@ -4283,13 +4243,13 @@ var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ React89.createElement
|
|
|
4283
4243
|
}
|
|
4284
4244
|
)
|
|
4285
4245
|
),
|
|
4286
|
-
/* @__PURE__ */
|
|
4246
|
+
/* @__PURE__ */ React.createElement(
|
|
4287
4247
|
"path",
|
|
4288
4248
|
{
|
|
4289
4249
|
id: "XMLID_23_",
|
|
4290
4250
|
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"
|
|
4291
4251
|
},
|
|
4292
|
-
/* @__PURE__ */
|
|
4252
|
+
/* @__PURE__ */ React.createElement(
|
|
4293
4253
|
"animate",
|
|
4294
4254
|
{
|
|
4295
4255
|
attributeName: "opacity",
|
|
@@ -4301,13 +4261,13 @@ var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ React89.createElement
|
|
|
4301
4261
|
}
|
|
4302
4262
|
)
|
|
4303
4263
|
),
|
|
4304
|
-
/* @__PURE__ */
|
|
4264
|
+
/* @__PURE__ */ React.createElement(
|
|
4305
4265
|
"path",
|
|
4306
4266
|
{
|
|
4307
4267
|
id: "XMLID_24_",
|
|
4308
4268
|
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"
|
|
4309
4269
|
},
|
|
4310
|
-
/* @__PURE__ */
|
|
4270
|
+
/* @__PURE__ */ React.createElement(
|
|
4311
4271
|
"animate",
|
|
4312
4272
|
{
|
|
4313
4273
|
attributeName: "opacity",
|
|
@@ -4319,13 +4279,13 @@ var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ React89.createElement
|
|
|
4319
4279
|
}
|
|
4320
4280
|
)
|
|
4321
4281
|
),
|
|
4322
|
-
/* @__PURE__ */
|
|
4282
|
+
/* @__PURE__ */ React.createElement(
|
|
4323
4283
|
"path",
|
|
4324
4284
|
{
|
|
4325
4285
|
id: "XMLID_25_",
|
|
4326
4286
|
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"
|
|
4327
4287
|
},
|
|
4328
|
-
/* @__PURE__ */
|
|
4288
|
+
/* @__PURE__ */ React.createElement(
|
|
4329
4289
|
"animate",
|
|
4330
4290
|
{
|
|
4331
4291
|
attributeName: "opacity",
|
|
@@ -4337,13 +4297,13 @@ var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ React89.createElement
|
|
|
4337
4297
|
}
|
|
4338
4298
|
)
|
|
4339
4299
|
),
|
|
4340
|
-
/* @__PURE__ */
|
|
4300
|
+
/* @__PURE__ */ React.createElement(
|
|
4341
4301
|
"path",
|
|
4342
4302
|
{
|
|
4343
4303
|
id: "XMLID_26_",
|
|
4344
4304
|
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"
|
|
4345
4305
|
},
|
|
4346
|
-
/* @__PURE__ */
|
|
4306
|
+
/* @__PURE__ */ React.createElement(
|
|
4347
4307
|
"animate",
|
|
4348
4308
|
{
|
|
4349
4309
|
attributeName: "opacity",
|
|
@@ -4355,13 +4315,13 @@ var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ React89.createElement
|
|
|
4355
4315
|
}
|
|
4356
4316
|
)
|
|
4357
4317
|
),
|
|
4358
|
-
/* @__PURE__ */
|
|
4318
|
+
/* @__PURE__ */ React.createElement(
|
|
4359
4319
|
"path",
|
|
4360
4320
|
{
|
|
4361
4321
|
id: "XMLID_27_",
|
|
4362
4322
|
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"
|
|
4363
4323
|
},
|
|
4364
|
-
/* @__PURE__ */
|
|
4324
|
+
/* @__PURE__ */ React.createElement(
|
|
4365
4325
|
"animate",
|
|
4366
4326
|
{
|
|
4367
4327
|
attributeName: "opacity",
|
|
@@ -4376,8 +4336,7 @@ var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ React89.createElement
|
|
|
4376
4336
|
));
|
|
4377
4337
|
|
|
4378
4338
|
// src/Tabs/Tabs.tsx
|
|
4379
|
-
import
|
|
4380
|
-
import { useRef as useRef31 } from "react";
|
|
4339
|
+
import { useRef as useRef32 } from "react";
|
|
4381
4340
|
import { useTabList } from "@react-aria/tabs";
|
|
4382
4341
|
import { Item as Item7 } from "@react-stately/collections";
|
|
4383
4342
|
import { useTabListState } from "@react-stately/tabs";
|
|
@@ -4389,15 +4348,14 @@ var TabContext = createContext10({});
|
|
|
4389
4348
|
var useTabContext = () => useContext10(TabContext);
|
|
4390
4349
|
|
|
4391
4350
|
// src/Tabs/Tab.tsx
|
|
4392
|
-
import
|
|
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";
|
|
4351
|
+
import { useRef as useRef30 } from "react";
|
|
4396
4352
|
import { useFocus, useHover as useHover14 } from "@react-aria/interactions";
|
|
4353
|
+
import { useTab } from "@react-aria/tabs";
|
|
4397
4354
|
import { mergeProps as mergeProps24 } from "@react-aria/utils";
|
|
4355
|
+
import { cn as cn47, useStateProps as useStateProps29 } from "@marigold/system";
|
|
4398
4356
|
var Tab = ({ item, state }) => {
|
|
4399
4357
|
const { key, rendered } = item;
|
|
4400
|
-
const ref =
|
|
4358
|
+
const ref = useRef30(null);
|
|
4401
4359
|
const { tabProps, isSelected } = useTab({ key }, state, ref);
|
|
4402
4360
|
const disabled = tabProps["aria-disabled"];
|
|
4403
4361
|
const { hoverProps, isHovered } = useHover14({
|
|
@@ -4406,7 +4364,7 @@ var Tab = ({ item, state }) => {
|
|
|
4406
4364
|
const { focusProps } = useFocus({});
|
|
4407
4365
|
const stateProps = useStateProps29({ active: isSelected, hover: isHovered });
|
|
4408
4366
|
const { classNames: classNames2 } = useTabContext();
|
|
4409
|
-
return /* @__PURE__ */
|
|
4367
|
+
return /* @__PURE__ */ React.createElement(
|
|
4410
4368
|
"div",
|
|
4411
4369
|
{
|
|
4412
4370
|
className: cn47(
|
|
@@ -4421,17 +4379,16 @@ var Tab = ({ item, state }) => {
|
|
|
4421
4379
|
};
|
|
4422
4380
|
|
|
4423
4381
|
// src/Tabs/TabPanel.tsx
|
|
4424
|
-
import
|
|
4425
|
-
import { useRef as useRef30 } from "react";
|
|
4382
|
+
import { useRef as useRef31 } from "react";
|
|
4426
4383
|
import { useTabPanel } from "@react-aria/tabs";
|
|
4427
4384
|
import { cn as cn48 } from "@marigold/system";
|
|
4428
4385
|
var TabPanel = ({ state, ...props }) => {
|
|
4429
4386
|
var _a;
|
|
4430
|
-
const ref =
|
|
4387
|
+
const ref = useRef31(null);
|
|
4431
4388
|
const { tabPanelProps } = useTabPanel(props, state, ref);
|
|
4432
4389
|
const selectedItemProps = (_a = state.selectedItem) == null ? void 0 : _a.props;
|
|
4433
4390
|
const { classNames: classNames2 } = useTabContext();
|
|
4434
|
-
return /* @__PURE__ */
|
|
4391
|
+
return /* @__PURE__ */ React.createElement("div", { className: cn48(classNames2.tabpanel), ref, ...tabPanelProps }, selectedItemProps == null ? void 0 : selectedItemProps.children);
|
|
4435
4392
|
};
|
|
4436
4393
|
|
|
4437
4394
|
// src/Tabs/Tabs.tsx
|
|
@@ -4443,7 +4400,7 @@ var Tabs = ({
|
|
|
4443
4400
|
...rest
|
|
4444
4401
|
}) => {
|
|
4445
4402
|
var _a;
|
|
4446
|
-
const ref =
|
|
4403
|
+
const ref = useRef32(null);
|
|
4447
4404
|
const props = {
|
|
4448
4405
|
isDisabled: disabled,
|
|
4449
4406
|
...rest
|
|
@@ -4455,7 +4412,7 @@ var Tabs = ({
|
|
|
4455
4412
|
size,
|
|
4456
4413
|
variant
|
|
4457
4414
|
});
|
|
4458
|
-
return /* @__PURE__ */
|
|
4415
|
+
return /* @__PURE__ */ React.createElement(TabContext.Provider, { value: { classNames: classNames2 } }, /* @__PURE__ */ React.createElement("div", { className: cn49(classNames2.container) }, /* @__PURE__ */ React.createElement(
|
|
4459
4416
|
"div",
|
|
4460
4417
|
{
|
|
4461
4418
|
className: cn49("flex", gapSpace8[space], classNames2.tabs),
|
|
@@ -4463,9 +4420,9 @@ var Tabs = ({
|
|
|
4463
4420
|
ref
|
|
4464
4421
|
},
|
|
4465
4422
|
[...state.collection].map((item) => {
|
|
4466
|
-
return /* @__PURE__ */
|
|
4423
|
+
return /* @__PURE__ */ React.createElement(Tab, { key: item.key, item, state });
|
|
4467
4424
|
})
|
|
4468
|
-
), /* @__PURE__ */
|
|
4425
|
+
), /* @__PURE__ */ React.createElement(TabPanel, { key: (_a = state.selectedItem) == null ? void 0 : _a.key, state })));
|
|
4469
4426
|
};
|
|
4470
4427
|
Tabs.Item = Item7;
|
|
4471
4428
|
export {
|
|
@@ -4515,6 +4472,7 @@ export {
|
|
|
4515
4472
|
Overlay,
|
|
4516
4473
|
Popover,
|
|
4517
4474
|
Radio,
|
|
4475
|
+
RadioGroup,
|
|
4518
4476
|
Select,
|
|
4519
4477
|
Slider,
|
|
4520
4478
|
Split,
|