@marigold/components 6.0.1 → 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 +78 -83
- package/dist/index.js +764 -783
- package/dist/index.mjs +730 -733
- 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 React, { 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__ */ React.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 React2, { forwardRef as forwardRef2 } from "react";
|
|
190
|
-
import { SVG } from "@marigold/system";
|
|
191
|
-
var ChevronUp = forwardRef2(
|
|
192
|
-
({ className, ...props }, ref) => /* @__PURE__ */ React2.createElement(SVG, { className, ...props, viewBox: "0 0 24 24", ref }, /* @__PURE__ */ React2.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 React3, { forwardRef as forwardRef3 } from "react";
|
|
197
|
-
import { SVG as SVG2 } from "@marigold/system";
|
|
198
|
-
var ChevronDown = forwardRef3(
|
|
199
|
-
({ className, ...props }, ref) => /* @__PURE__ */ React3.createElement(SVG2, { className, ...props, viewBox: "0 0 24 24", ref }, /* @__PURE__ */ React3.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 React11 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 React8 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__ */ React8.createElement(
|
|
388
|
-
Component,
|
|
389
|
-
{
|
|
390
|
-
...props,
|
|
391
|
-
className: cn4(classNames2.container, "flex w-[var(--labelWidth)]"),
|
|
392
|
-
style: createVar3({ labelWidth })
|
|
393
|
-
},
|
|
394
|
-
children,
|
|
395
|
-
/* @__PURE__ */ React8.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__ */ React8.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 React10 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 React14 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 React16 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__ */ React22.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 React24 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 React26 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 React27 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 React28 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,16 +1206,27 @@ 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";
|
|
1215
1213
|
import { useObjectRef as useObjectRef5 } from "@react-aria/utils";
|
|
1216
1214
|
import { useToggleState } from "@react-stately/toggle";
|
|
1217
|
-
import {
|
|
1215
|
+
import {
|
|
1216
|
+
cn as cn14,
|
|
1217
|
+
useClassNames as useClassNames14,
|
|
1218
|
+
useStateProps as useStateProps6
|
|
1219
|
+
} from "@marigold/system";
|
|
1220
|
+
|
|
1221
|
+
// src/Checkbox/CheckboxField.tsx
|
|
1222
|
+
import { createVar as createVar6, useClassNames as useClassNames13 } from "@marigold/system";
|
|
1223
|
+
var CheckboxField = ({ children, labelWidth }) => {
|
|
1224
|
+
const classNames2 = useClassNames13({ component: "Field" });
|
|
1225
|
+
return /* @__PURE__ */ React.createElement("div", { className: classNames2 }, /* @__PURE__ */ React.createElement("div", { className: "w-[--labelWidth]", style: createVar6({ labelWidth }) }), children);
|
|
1226
|
+
};
|
|
1218
1227
|
|
|
1219
1228
|
// src/Checkbox/CheckboxGroup.tsx
|
|
1220
|
-
import
|
|
1229
|
+
import { createContext as createContext3, useContext as useContext3 } from "react";
|
|
1221
1230
|
import { useCheckboxGroup } from "@react-aria/checkbox";
|
|
1222
1231
|
import {
|
|
1223
1232
|
useCheckboxGroupState
|
|
@@ -1250,7 +1259,7 @@ var CheckboxGroup = ({
|
|
|
1250
1259
|
readOnly,
|
|
1251
1260
|
error
|
|
1252
1261
|
});
|
|
1253
|
-
return /* @__PURE__ */
|
|
1262
|
+
return /* @__PURE__ */ React.createElement(
|
|
1254
1263
|
FieldBase,
|
|
1255
1264
|
{
|
|
1256
1265
|
label: props.label,
|
|
@@ -1265,13 +1274,12 @@ var CheckboxGroup = ({
|
|
|
1265
1274
|
width,
|
|
1266
1275
|
...groupProps
|
|
1267
1276
|
},
|
|
1268
|
-
/* @__PURE__ */
|
|
1277
|
+
/* @__PURE__ */ React.createElement("div", { role: "presentation", className: "flex flex-col items-start" }, /* @__PURE__ */ React.createElement(CheckboxGroupContext.Provider, { value: { error, ...state } }, children))
|
|
1269
1278
|
);
|
|
1270
1279
|
};
|
|
1271
1280
|
|
|
1272
1281
|
// src/Checkbox/Checkbox.tsx
|
|
1273
|
-
|
|
1274
|
-
var CheckMark = () => /* @__PURE__ */ React30.createElement("svg", { viewBox: "0 0 12 10" }, /* @__PURE__ */ React30.createElement(
|
|
1282
|
+
var CheckMark = () => /* @__PURE__ */ React.createElement("svg", { viewBox: "0 0 12 10" }, /* @__PURE__ */ React.createElement(
|
|
1275
1283
|
"path",
|
|
1276
1284
|
{
|
|
1277
1285
|
fill: "currentColor",
|
|
@@ -1279,7 +1287,7 @@ var CheckMark = () => /* @__PURE__ */ React30.createElement("svg", { viewBox: "0
|
|
|
1279
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"
|
|
1280
1288
|
}
|
|
1281
1289
|
));
|
|
1282
|
-
var IndeterminateMark = () => /* @__PURE__ */
|
|
1290
|
+
var IndeterminateMark = () => /* @__PURE__ */ React.createElement("svg", { width: "12", height: "3", viewBox: "0 0 12 3" }, /* @__PURE__ */ React.createElement(
|
|
1283
1291
|
"path",
|
|
1284
1292
|
{
|
|
1285
1293
|
fill: "currentColor",
|
|
@@ -1288,7 +1296,7 @@ var IndeterminateMark = () => /* @__PURE__ */ React30.createElement("svg", { wid
|
|
|
1288
1296
|
}
|
|
1289
1297
|
));
|
|
1290
1298
|
var Icon = ({ className, checked, indeterminate, ...props }) => {
|
|
1291
|
-
return /* @__PURE__ */
|
|
1299
|
+
return /* @__PURE__ */ React.createElement(
|
|
1292
1300
|
"div",
|
|
1293
1301
|
{
|
|
1294
1302
|
"aria-hidden": "true",
|
|
@@ -1301,7 +1309,7 @@ var Icon = ({ className, checked, indeterminate, ...props }) => {
|
|
|
1301
1309
|
),
|
|
1302
1310
|
...props
|
|
1303
1311
|
},
|
|
1304
|
-
indeterminate ? /* @__PURE__ */
|
|
1312
|
+
indeterminate ? /* @__PURE__ */ React.createElement(IndeterminateMark, null) : checked ? /* @__PURE__ */ React.createElement(CheckMark, null) : null
|
|
1305
1313
|
);
|
|
1306
1314
|
};
|
|
1307
1315
|
var Checkbox = forwardRef9(
|
|
@@ -1353,10 +1361,11 @@ var Checkbox = forwardRef9(
|
|
|
1353
1361
|
}),
|
|
1354
1362
|
inputRef
|
|
1355
1363
|
);
|
|
1356
|
-
const classNames2 =
|
|
1364
|
+
const classNames2 = useClassNames14({ component: "Checkbox", variant, size });
|
|
1357
1365
|
const { hoverProps, isHovered } = useHover3({
|
|
1358
1366
|
isDisabled: inputProps.disabled
|
|
1359
1367
|
});
|
|
1368
|
+
const { labelWidth } = useFieldGroupContext();
|
|
1360
1369
|
const { isFocusVisible, focusProps } = useFocusRing4();
|
|
1361
1370
|
const stateProps = useStateProps6({
|
|
1362
1371
|
hover: isHovered,
|
|
@@ -1367,7 +1376,7 @@ var Checkbox = forwardRef9(
|
|
|
1367
1376
|
readOnly,
|
|
1368
1377
|
indeterminate
|
|
1369
1378
|
});
|
|
1370
|
-
|
|
1379
|
+
const component = /* @__PURE__ */ React.createElement(
|
|
1371
1380
|
"label",
|
|
1372
1381
|
{
|
|
1373
1382
|
className: cn14(
|
|
@@ -1377,7 +1386,7 @@ var Checkbox = forwardRef9(
|
|
|
1377
1386
|
...hoverProps,
|
|
1378
1387
|
...stateProps
|
|
1379
1388
|
},
|
|
1380
|
-
/* @__PURE__ */
|
|
1389
|
+
/* @__PURE__ */ React.createElement(
|
|
1381
1390
|
"input",
|
|
1382
1391
|
{
|
|
1383
1392
|
ref: inputRef,
|
|
@@ -1386,7 +1395,7 @@ var Checkbox = forwardRef9(
|
|
|
1386
1395
|
...focusProps
|
|
1387
1396
|
}
|
|
1388
1397
|
),
|
|
1389
|
-
/* @__PURE__ */
|
|
1398
|
+
/* @__PURE__ */ React.createElement(
|
|
1390
1399
|
Icon,
|
|
1391
1400
|
{
|
|
1392
1401
|
checked: inputProps.checked,
|
|
@@ -1394,18 +1403,15 @@ var Checkbox = forwardRef9(
|
|
|
1394
1403
|
className: classNames2.checkbox
|
|
1395
1404
|
}
|
|
1396
1405
|
),
|
|
1397
|
-
props.children && /* @__PURE__ */
|
|
1406
|
+
props.children && /* @__PURE__ */ React.createElement("div", { className: classNames2.label }, props.children)
|
|
1398
1407
|
);
|
|
1408
|
+
return !groupState && labelWidth ? /* @__PURE__ */ React.createElement(CheckboxField, { labelWidth }, component) : component;
|
|
1399
1409
|
}
|
|
1400
1410
|
);
|
|
1401
1411
|
|
|
1402
1412
|
// src/Columns/Columns.tsx
|
|
1403
|
-
import
|
|
1404
|
-
|
|
1405
|
-
cloneElement as cloneElement2,
|
|
1406
|
-
isValidElement
|
|
1407
|
-
} from "react";
|
|
1408
|
-
import { cn as cn15, createVar as createVar6, gapSpace as gapSpace4 } from "@marigold/system";
|
|
1413
|
+
import { Children as Children3, cloneElement as cloneElement3, isValidElement as isValidElement2 } from "react";
|
|
1414
|
+
import { cn as cn15, createVar as createVar7, gapSpace as gapSpace4 } from "@marigold/system";
|
|
1409
1415
|
var Columns = ({
|
|
1410
1416
|
space = 0,
|
|
1411
1417
|
columns,
|
|
@@ -1414,14 +1420,14 @@ var Columns = ({
|
|
|
1414
1420
|
children,
|
|
1415
1421
|
...props
|
|
1416
1422
|
}) => {
|
|
1417
|
-
if (
|
|
1423
|
+
if (Children3.count(children) !== columns.length) {
|
|
1418
1424
|
throw new Error(
|
|
1419
|
-
`Columns: expected ${columns.length} children, got ${
|
|
1425
|
+
`Columns: expected ${columns.length} children, got ${Children3.count(
|
|
1420
1426
|
children
|
|
1421
1427
|
)}`
|
|
1422
1428
|
);
|
|
1423
1429
|
}
|
|
1424
|
-
return /* @__PURE__ */
|
|
1430
|
+
return /* @__PURE__ */ React.createElement(
|
|
1425
1431
|
"div",
|
|
1426
1432
|
{
|
|
1427
1433
|
className: cn15(
|
|
@@ -1431,27 +1437,26 @@ var Columns = ({
|
|
|
1431
1437
|
),
|
|
1432
1438
|
...props
|
|
1433
1439
|
},
|
|
1434
|
-
|
|
1440
|
+
Children3.map(children, (child, idx) => /* @__PURE__ */ React.createElement(
|
|
1435
1441
|
"div",
|
|
1436
1442
|
{
|
|
1437
1443
|
className: cn15(
|
|
1438
1444
|
"grow-[--columnSize] basis-[calc((var(--collapseAt)_-_100%)_*_999)]"
|
|
1439
1445
|
),
|
|
1440
|
-
style:
|
|
1446
|
+
style: createVar7({ collapseAt, columnSize: columns[idx] })
|
|
1441
1447
|
},
|
|
1442
|
-
|
|
1448
|
+
isValidElement2(child) ? cloneElement3(child) : child
|
|
1443
1449
|
))
|
|
1444
1450
|
);
|
|
1445
1451
|
};
|
|
1446
1452
|
|
|
1447
1453
|
// src/Container/Container.tsx
|
|
1448
|
-
import React32 from "react";
|
|
1449
1454
|
import {
|
|
1450
1455
|
cn as cn16,
|
|
1451
|
-
createVar as
|
|
1452
|
-
placeItems,
|
|
1456
|
+
createVar as createVar8,
|
|
1453
1457
|
gridColsAlign,
|
|
1454
|
-
gridColumn
|
|
1458
|
+
gridColumn,
|
|
1459
|
+
placeItems
|
|
1455
1460
|
} from "@marigold/system";
|
|
1456
1461
|
var content = {
|
|
1457
1462
|
small: "20ch",
|
|
@@ -1472,7 +1477,7 @@ var Container = ({
|
|
|
1472
1477
|
...props
|
|
1473
1478
|
}) => {
|
|
1474
1479
|
const maxWidth = contentType === "content" ? content[size] : header[size];
|
|
1475
|
-
return /* @__PURE__ */
|
|
1480
|
+
return /* @__PURE__ */ React.createElement(
|
|
1476
1481
|
"div",
|
|
1477
1482
|
{
|
|
1478
1483
|
className: cn16(
|
|
@@ -1481,7 +1486,7 @@ var Container = ({
|
|
|
1481
1486
|
gridColsAlign[align],
|
|
1482
1487
|
gridColumn[align]
|
|
1483
1488
|
),
|
|
1484
|
-
style:
|
|
1489
|
+
style: createVar8({ maxWidth }),
|
|
1485
1490
|
...props
|
|
1486
1491
|
},
|
|
1487
1492
|
children
|
|
@@ -1489,14 +1494,18 @@ var Container = ({
|
|
|
1489
1494
|
};
|
|
1490
1495
|
|
|
1491
1496
|
// src/Dialog/Dialog.tsx
|
|
1492
|
-
import
|
|
1497
|
+
import {
|
|
1498
|
+
Children as Children5,
|
|
1499
|
+
cloneElement as cloneElement4,
|
|
1500
|
+
isValidElement as isValidElement3,
|
|
1501
|
+
useRef as useRef9
|
|
1502
|
+
} from "react";
|
|
1493
1503
|
import { useButton as useButton5 } from "@react-aria/button";
|
|
1494
1504
|
import { useDialog } from "@react-aria/dialog";
|
|
1495
|
-
import { cn as cn19, useClassNames as
|
|
1505
|
+
import { cn as cn19, useClassNames as useClassNames17 } from "@marigold/system";
|
|
1496
1506
|
|
|
1497
1507
|
// src/Header/Header.tsx
|
|
1498
|
-
import
|
|
1499
|
-
import { cn as cn17, useClassNames as useClassNames14 } from "@marigold/system";
|
|
1508
|
+
import { cn as cn17, useClassNames as useClassNames15 } from "@marigold/system";
|
|
1500
1509
|
var Header = ({
|
|
1501
1510
|
children,
|
|
1502
1511
|
variant,
|
|
@@ -1504,24 +1513,23 @@ var Header = ({
|
|
|
1504
1513
|
className,
|
|
1505
1514
|
...props
|
|
1506
1515
|
}) => {
|
|
1507
|
-
const classNames2 =
|
|
1516
|
+
const classNames2 = useClassNames15({
|
|
1508
1517
|
component: "Header",
|
|
1509
1518
|
variant,
|
|
1510
1519
|
size,
|
|
1511
1520
|
className
|
|
1512
1521
|
});
|
|
1513
|
-
return /* @__PURE__ */
|
|
1522
|
+
return /* @__PURE__ */ React.createElement("header", { ...props, className: cn17(classNames2) }, children);
|
|
1514
1523
|
};
|
|
1515
1524
|
|
|
1516
1525
|
// src/Headline/Headline.tsx
|
|
1517
|
-
import React34 from "react";
|
|
1518
1526
|
import {
|
|
1519
|
-
useClassNames as useClassNames15,
|
|
1520
1527
|
cn as cn18,
|
|
1521
|
-
createVar as
|
|
1528
|
+
createVar as createVar9,
|
|
1529
|
+
get,
|
|
1522
1530
|
textAlign,
|
|
1523
|
-
|
|
1524
|
-
|
|
1531
|
+
useClassNames as useClassNames16,
|
|
1532
|
+
useTheme as useTheme2
|
|
1525
1533
|
} from "@marigold/system";
|
|
1526
1534
|
var Headline = ({
|
|
1527
1535
|
children,
|
|
@@ -1534,18 +1542,18 @@ var Headline = ({
|
|
|
1534
1542
|
...props
|
|
1535
1543
|
}) => {
|
|
1536
1544
|
const theme = useTheme2();
|
|
1537
|
-
const classNames2 =
|
|
1545
|
+
const classNames2 = useClassNames16({
|
|
1538
1546
|
component: "Headline",
|
|
1539
1547
|
variant,
|
|
1540
1548
|
size: size != null ? size : `level-${level}`
|
|
1541
1549
|
});
|
|
1542
1550
|
const Component = as;
|
|
1543
|
-
return /* @__PURE__ */
|
|
1551
|
+
return /* @__PURE__ */ React.createElement(
|
|
1544
1552
|
Component,
|
|
1545
1553
|
{
|
|
1546
1554
|
...props,
|
|
1547
1555
|
className: cn18(classNames2, "text-[--color]", textAlign[align]),
|
|
1548
|
-
style:
|
|
1556
|
+
style: createVar9({
|
|
1549
1557
|
color: color && theme.colors && get(
|
|
1550
1558
|
theme.colors,
|
|
1551
1559
|
color.replace("-", "."),
|
|
@@ -1563,28 +1571,22 @@ import { createContext as createContext4, useContext as useContext4 } from "reac
|
|
|
1563
1571
|
var DialogContext = createContext4({});
|
|
1564
1572
|
var useDialogContext = () => useContext4(DialogContext);
|
|
1565
1573
|
|
|
1566
|
-
// src/Dialog/
|
|
1567
|
-
import
|
|
1568
|
-
import { PressResponder } from "@react-aria/interactions";
|
|
1574
|
+
// src/Dialog/DialogController.tsx
|
|
1575
|
+
import React3 from "react";
|
|
1569
1576
|
import { useOverlayTriggerState } from "@react-stately/overlays";
|
|
1570
|
-
var
|
|
1577
|
+
var DialogController = ({
|
|
1571
1578
|
children,
|
|
1572
1579
|
dismissable = true,
|
|
1573
|
-
keyboardDismissable = true
|
|
1580
|
+
keyboardDismissable = true,
|
|
1581
|
+
open,
|
|
1582
|
+
onOpenChange
|
|
1574
1583
|
}) => {
|
|
1575
|
-
const
|
|
1576
|
-
|
|
1577
|
-
|
|
1584
|
+
const state = useOverlayTriggerState({
|
|
1585
|
+
isOpen: open,
|
|
1586
|
+
onOpenChange
|
|
1587
|
+
});
|
|
1578
1588
|
const ctx = { open: state.isOpen, close: state.close };
|
|
1579
|
-
return /* @__PURE__ */
|
|
1580
|
-
PressResponder,
|
|
1581
|
-
{
|
|
1582
|
-
ref: dialogTriggerRef,
|
|
1583
|
-
isPressed: state.isOpen,
|
|
1584
|
-
onPress: state.toggle
|
|
1585
|
-
},
|
|
1586
|
-
dialogTrigger
|
|
1587
|
-
), /* @__PURE__ */ React35.createElement(Overlay, { open: state.isOpen }, /* @__PURE__ */ React35.createElement(
|
|
1589
|
+
return /* @__PURE__ */ React3.createElement(DialogContext.Provider, { value: ctx }, /* @__PURE__ */ React3.createElement(Overlay, { open: state.isOpen }, /* @__PURE__ */ React3.createElement(
|
|
1588
1590
|
Modal,
|
|
1589
1591
|
{
|
|
1590
1592
|
open: state.isOpen,
|
|
@@ -1592,26 +1594,32 @@ var DialogTrigger = ({
|
|
|
1592
1594
|
dismissable,
|
|
1593
1595
|
keyboardDismissable
|
|
1594
1596
|
},
|
|
1595
|
-
|
|
1597
|
+
children
|
|
1596
1598
|
)));
|
|
1597
1599
|
};
|
|
1598
1600
|
|
|
1599
|
-
// src/Dialog/
|
|
1601
|
+
// src/Dialog/DialogTrigger.tsx
|
|
1602
|
+
import { Children as Children4, useRef as useRef8 } from "react";
|
|
1603
|
+
import { PressResponder } from "@react-aria/interactions";
|
|
1600
1604
|
import { useOverlayTriggerState as useOverlayTriggerState2 } from "@react-stately/overlays";
|
|
1601
|
-
|
|
1602
|
-
var DialogController = ({
|
|
1605
|
+
var DialogTrigger = ({
|
|
1603
1606
|
children,
|
|
1604
1607
|
dismissable = true,
|
|
1605
|
-
keyboardDismissable = true
|
|
1606
|
-
open,
|
|
1607
|
-
onOpenChange
|
|
1608
|
+
keyboardDismissable = true
|
|
1608
1609
|
}) => {
|
|
1609
|
-
const
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
});
|
|
1610
|
+
const [dialogTrigger, dialog] = Children4.toArray(children);
|
|
1611
|
+
const dialogTriggerRef = useRef8(null);
|
|
1612
|
+
const state = useOverlayTriggerState2({});
|
|
1613
1613
|
const ctx = { open: state.isOpen, close: state.close };
|
|
1614
|
-
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(
|
|
1615
1623
|
Modal,
|
|
1616
1624
|
{
|
|
1617
1625
|
open: state.isOpen,
|
|
@@ -1619,7 +1627,7 @@ var DialogController = ({
|
|
|
1619
1627
|
dismissable,
|
|
1620
1628
|
keyboardDismissable
|
|
1621
1629
|
},
|
|
1622
|
-
|
|
1630
|
+
dialog
|
|
1623
1631
|
)));
|
|
1624
1632
|
};
|
|
1625
1633
|
|
|
@@ -1633,7 +1641,7 @@ var CloseButton = ({ className }) => {
|
|
|
1633
1641
|
},
|
|
1634
1642
|
ref
|
|
1635
1643
|
);
|
|
1636
|
-
return /* @__PURE__ */
|
|
1644
|
+
return /* @__PURE__ */ React.createElement("div", { className: "flex justify-end" }, /* @__PURE__ */ React.createElement(
|
|
1637
1645
|
"button",
|
|
1638
1646
|
{
|
|
1639
1647
|
className: cn19(
|
|
@@ -1643,7 +1651,7 @@ var CloseButton = ({ className }) => {
|
|
|
1643
1651
|
ref,
|
|
1644
1652
|
...buttonProps
|
|
1645
1653
|
},
|
|
1646
|
-
/* @__PURE__ */
|
|
1654
|
+
/* @__PURE__ */ React.createElement("svg", { viewBox: "0 0 20 20", fill: "currentColor" }, /* @__PURE__ */ React.createElement(
|
|
1647
1655
|
"path",
|
|
1648
1656
|
{
|
|
1649
1657
|
fillRule: "evenodd",
|
|
@@ -1654,9 +1662,9 @@ var CloseButton = ({ className }) => {
|
|
|
1654
1662
|
));
|
|
1655
1663
|
};
|
|
1656
1664
|
var addTitleProps = (children, titleProps) => {
|
|
1657
|
-
const childs =
|
|
1665
|
+
const childs = Children5.toArray(children);
|
|
1658
1666
|
const titleIndex = childs.findIndex(
|
|
1659
|
-
(child) =>
|
|
1667
|
+
(child) => isValidElement3(child) && (child.type === Header || child.type === Headline)
|
|
1660
1668
|
);
|
|
1661
1669
|
if (titleIndex < 0) {
|
|
1662
1670
|
console.warn(
|
|
@@ -1664,7 +1672,7 @@ var addTitleProps = (children, titleProps) => {
|
|
|
1664
1672
|
);
|
|
1665
1673
|
return children;
|
|
1666
1674
|
}
|
|
1667
|
-
const titleChild =
|
|
1675
|
+
const titleChild = cloneElement4(
|
|
1668
1676
|
childs[titleIndex],
|
|
1669
1677
|
titleProps
|
|
1670
1678
|
);
|
|
@@ -1681,37 +1689,34 @@ var Dialog = ({
|
|
|
1681
1689
|
const ref = useRef9(null);
|
|
1682
1690
|
const { close } = useDialogContext();
|
|
1683
1691
|
const { dialogProps, titleProps } = useDialog(props, ref);
|
|
1684
|
-
const classNames2 =
|
|
1685
|
-
return /* @__PURE__ */
|
|
1692
|
+
const classNames2 = useClassNames17({ component: "Dialog", variant, size });
|
|
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));
|
|
1686
1694
|
};
|
|
1687
1695
|
Dialog.Trigger = DialogTrigger;
|
|
1688
1696
|
Dialog.Controller = DialogController;
|
|
1689
1697
|
|
|
1690
1698
|
// src/Divider/Divider.tsx
|
|
1691
|
-
import React38 from "react";
|
|
1692
1699
|
import { useSeparator } from "@react-aria/separator";
|
|
1693
|
-
import { useClassNames as
|
|
1700
|
+
import { useClassNames as useClassNames18 } from "@marigold/system";
|
|
1694
1701
|
var Divider = ({ variant, ...props }) => {
|
|
1695
1702
|
const { separatorProps } = useSeparator(props);
|
|
1696
|
-
const classNames2 =
|
|
1697
|
-
return /* @__PURE__ */
|
|
1703
|
+
const classNames2 = useClassNames18({ component: "Divider", variant });
|
|
1704
|
+
return /* @__PURE__ */ React.createElement("div", { className: classNames2, ...props, ...separatorProps });
|
|
1698
1705
|
};
|
|
1699
1706
|
|
|
1700
1707
|
// src/Footer/Footer.tsx
|
|
1701
|
-
import
|
|
1702
|
-
import { useClassNames as useClassNames18 } from "@marigold/system";
|
|
1708
|
+
import { useClassNames as useClassNames19 } from "@marigold/system";
|
|
1703
1709
|
var Footer = ({ children, variant, size, ...props }) => {
|
|
1704
|
-
const classNames2 =
|
|
1705
|
-
return /* @__PURE__ */
|
|
1710
|
+
const classNames2 = useClassNames19({ component: "Footer", variant, size });
|
|
1711
|
+
return /* @__PURE__ */ React.createElement("footer", { ...props, className: classNames2 }, children);
|
|
1706
1712
|
};
|
|
1707
1713
|
|
|
1708
1714
|
// src/Image/Image.tsx
|
|
1709
|
-
import React40 from "react";
|
|
1710
1715
|
import {
|
|
1711
1716
|
cn as cn20,
|
|
1712
|
-
useClassNames as useClassNames19,
|
|
1713
1717
|
objectFit,
|
|
1714
|
-
objectPosition
|
|
1718
|
+
objectPosition,
|
|
1719
|
+
useClassNames as useClassNames20
|
|
1715
1720
|
} from "@marigold/system";
|
|
1716
1721
|
var Image = ({
|
|
1717
1722
|
variant,
|
|
@@ -1720,8 +1725,8 @@ var Image = ({
|
|
|
1720
1725
|
position = "none",
|
|
1721
1726
|
...props
|
|
1722
1727
|
}) => {
|
|
1723
|
-
const classNames2 =
|
|
1724
|
-
return /* @__PURE__ */
|
|
1728
|
+
const classNames2 = useClassNames20({ component: "Image", variant, size });
|
|
1729
|
+
return /* @__PURE__ */ React.createElement(
|
|
1725
1730
|
"img",
|
|
1726
1731
|
{
|
|
1727
1732
|
...props,
|
|
@@ -1737,11 +1742,10 @@ var Image = ({
|
|
|
1737
1742
|
};
|
|
1738
1743
|
|
|
1739
1744
|
// src/Inline/Inline.tsx
|
|
1740
|
-
import React41 from "react";
|
|
1741
1745
|
import {
|
|
1742
|
-
gapSpace as gapSpace5,
|
|
1743
1746
|
alignment as alignment2,
|
|
1744
|
-
cn as cn21
|
|
1747
|
+
cn as cn21,
|
|
1748
|
+
gapSpace as gapSpace5
|
|
1745
1749
|
} from "@marigold/system";
|
|
1746
1750
|
var Inline = ({
|
|
1747
1751
|
space = 0,
|
|
@@ -1752,7 +1756,7 @@ var Inline = ({
|
|
|
1752
1756
|
...props
|
|
1753
1757
|
}) => {
|
|
1754
1758
|
var _a2, _b2, _c, _d;
|
|
1755
|
-
return /* @__PURE__ */
|
|
1759
|
+
return /* @__PURE__ */ React.createElement(
|
|
1756
1760
|
"div",
|
|
1757
1761
|
{
|
|
1758
1762
|
className: cn21(
|
|
@@ -1768,19 +1772,22 @@ var Inline = ({
|
|
|
1768
1772
|
};
|
|
1769
1773
|
|
|
1770
1774
|
// src/DateField/DateField.tsx
|
|
1771
|
-
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";
|
|
1772
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";
|
|
1773
1782
|
import { useDateFieldState } from "@react-stately/datepicker";
|
|
1774
|
-
import {
|
|
1775
|
-
import { createCalendar } from "@internationalized/date";
|
|
1776
|
-
import { cn as cn23, useClassNames as useClassNames20, useStateProps as useStateProps8 } from "@marigold/system";
|
|
1783
|
+
import { cn as cn23, useClassNames as useClassNames21, useStateProps as useStateProps8 } from "@marigold/system";
|
|
1777
1784
|
|
|
1778
1785
|
// src/DateField/DateSegment.tsx
|
|
1779
|
-
import
|
|
1780
|
-
import { cn as cn22, useStateProps as useStateProps7 } from "@marigold/system";
|
|
1786
|
+
import { useRef as useRef10 } from "react";
|
|
1781
1787
|
import { useDateSegment } from "@react-aria/datepicker";
|
|
1782
1788
|
import { useFocusRing as useFocusRing5 } from "@react-aria/focus";
|
|
1783
1789
|
import { mergeProps as mergeProps7 } from "@react-aria/utils";
|
|
1790
|
+
import { cn as cn22, useStateProps as useStateProps7 } from "@marigold/system";
|
|
1784
1791
|
var DateSegment = ({
|
|
1785
1792
|
className,
|
|
1786
1793
|
segment,
|
|
@@ -1798,7 +1805,7 @@ var DateSegment = ({
|
|
|
1798
1805
|
focusVisible: isFocused
|
|
1799
1806
|
});
|
|
1800
1807
|
const { isPlaceholder, placeholder, text, type, maxValue } = segment;
|
|
1801
|
-
return /* @__PURE__ */
|
|
1808
|
+
return /* @__PURE__ */ React.createElement(
|
|
1802
1809
|
"div",
|
|
1803
1810
|
{
|
|
1804
1811
|
...mergeProps7(segmentProps, stateProps, focusProps),
|
|
@@ -1814,7 +1821,7 @@ var DateSegment = ({
|
|
|
1814
1821
|
minWidth: maxValue != null ? String(maxValue).length + "ch" : void 0
|
|
1815
1822
|
}
|
|
1816
1823
|
},
|
|
1817
|
-
/* @__PURE__ */
|
|
1824
|
+
/* @__PURE__ */ React.createElement(
|
|
1818
1825
|
"span",
|
|
1819
1826
|
{
|
|
1820
1827
|
"aria-hidden": "true",
|
|
@@ -1825,14 +1832,11 @@ var DateSegment = ({
|
|
|
1825
1832
|
},
|
|
1826
1833
|
isPlaceholder && (placeholder == null ? void 0 : placeholder.toUpperCase())
|
|
1827
1834
|
),
|
|
1828
|
-
/* @__PURE__ */
|
|
1835
|
+
/* @__PURE__ */ React.createElement("span", null, isPlaceholder ? "" : type === "month" || type === "day" ? Number(text) < 10 ? "0" + text : text : text)
|
|
1829
1836
|
);
|
|
1830
1837
|
};
|
|
1831
1838
|
|
|
1832
1839
|
// src/DateField/DateField.tsx
|
|
1833
|
-
import { mergeProps as mergeProps8 } from "@react-aria/utils";
|
|
1834
|
-
import { useHover as useHover4 } from "@react-aria/interactions";
|
|
1835
|
-
import { useFocusRing as useFocusRing6 } from "@react-aria/focus";
|
|
1836
1840
|
var DateField = ({
|
|
1837
1841
|
disabled,
|
|
1838
1842
|
readOnly,
|
|
@@ -1867,7 +1871,7 @@ var DateField = ({
|
|
|
1867
1871
|
state,
|
|
1868
1872
|
ref
|
|
1869
1873
|
);
|
|
1870
|
-
const classNames2 =
|
|
1874
|
+
const classNames2 = useClassNames21({ component: "DateField", variant, size });
|
|
1871
1875
|
const { focusProps, isFocused } = useFocusRing6({
|
|
1872
1876
|
within: true,
|
|
1873
1877
|
isTextInput: true,
|
|
@@ -1882,7 +1886,7 @@ var DateField = ({
|
|
|
1882
1886
|
required,
|
|
1883
1887
|
focus: isFocused || isPressed
|
|
1884
1888
|
});
|
|
1885
|
-
return /* @__PURE__ */
|
|
1889
|
+
return /* @__PURE__ */ React.createElement(
|
|
1886
1890
|
FieldBase,
|
|
1887
1891
|
{
|
|
1888
1892
|
error,
|
|
@@ -1898,7 +1902,7 @@ var DateField = ({
|
|
|
1898
1902
|
size,
|
|
1899
1903
|
width
|
|
1900
1904
|
},
|
|
1901
|
-
/* @__PURE__ */
|
|
1905
|
+
/* @__PURE__ */ React.createElement(
|
|
1902
1906
|
"div",
|
|
1903
1907
|
{
|
|
1904
1908
|
...mergeProps8(fieldProps, focusProps, stateProps, hoverProps),
|
|
@@ -1910,9 +1914,9 @@ var DateField = ({
|
|
|
1910
1914
|
"data-testid": "date-field",
|
|
1911
1915
|
ref: triggerRef
|
|
1912
1916
|
},
|
|
1913
|
-
/* @__PURE__ */
|
|
1917
|
+
/* @__PURE__ */ React.createElement("div", { ref, className: "flex basis-full items-center" }, state.segments.map((segment, i) => {
|
|
1914
1918
|
var _a;
|
|
1915
|
-
return /* @__PURE__ */
|
|
1919
|
+
return /* @__PURE__ */ React.createElement(
|
|
1916
1920
|
DateSegment,
|
|
1917
1921
|
{
|
|
1918
1922
|
className: classNames2.segment,
|
|
@@ -1923,7 +1927,7 @@ var DateField = ({
|
|
|
1923
1927
|
}
|
|
1924
1928
|
);
|
|
1925
1929
|
})),
|
|
1926
|
-
action ? action : /* @__PURE__ */
|
|
1930
|
+
action ? action : /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-center" }, /* @__PURE__ */ React.createElement(
|
|
1927
1931
|
"svg",
|
|
1928
1932
|
{
|
|
1929
1933
|
"data-testid": "action",
|
|
@@ -1932,39 +1936,41 @@ var DateField = ({
|
|
|
1932
1936
|
width: 24,
|
|
1933
1937
|
height: 24
|
|
1934
1938
|
},
|
|
1935
|
-
/* @__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" })
|
|
1936
1940
|
))
|
|
1937
1941
|
)
|
|
1938
1942
|
);
|
|
1939
1943
|
};
|
|
1940
1944
|
|
|
1941
1945
|
// src/Calendar/Calendar.tsx
|
|
1942
|
-
import
|
|
1943
|
-
import {
|
|
1946
|
+
import { createCalendar as createCalendar2 } from "@internationalized/date";
|
|
1947
|
+
import { useRef as useRef14 } from "react";
|
|
1944
1948
|
import {
|
|
1945
1949
|
useCalendar
|
|
1946
1950
|
} from "@react-aria/calendar";
|
|
1947
1951
|
import { useLocale as useLocale3 } from "@react-aria/i18n";
|
|
1948
|
-
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";
|
|
1949
1955
|
|
|
1950
1956
|
// src/Calendar/CalendarGrid.tsx
|
|
1951
|
-
import
|
|
1957
|
+
import { getWeeksInMonth, startOfWeek, today } from "@internationalized/date";
|
|
1952
1958
|
import { useMemo } from "react";
|
|
1953
1959
|
import { useCalendarGrid } from "@react-aria/calendar";
|
|
1954
1960
|
import { useLocale as useLocale2 } from "@react-aria/i18n";
|
|
1955
|
-
import {
|
|
1961
|
+
import { useDateFormatter } from "@react-aria/i18n";
|
|
1956
1962
|
|
|
1957
1963
|
// src/Calendar/CalendarCell.tsx
|
|
1958
|
-
import
|
|
1964
|
+
import { useRef as useRef12 } from "react";
|
|
1959
1965
|
import { useCalendarCell } from "@react-aria/calendar";
|
|
1960
|
-
import { mergeProps as mergeProps9 } from "@react-aria/utils";
|
|
1961
|
-
import { cn as cn24, useClassNames as useClassNames21, useStateProps as useStateProps9 } from "@marigold/system";
|
|
1962
1966
|
import { useHover as useHover5 } from "@react-aria/interactions";
|
|
1967
|
+
import { mergeProps as mergeProps9 } from "@react-aria/utils";
|
|
1968
|
+
import { cn as cn24, useClassNames as useClassNames22, useStateProps as useStateProps9 } from "@marigold/system";
|
|
1963
1969
|
var CalendarCell = (props) => {
|
|
1964
1970
|
const ref = useRef12(null);
|
|
1965
1971
|
const { state } = props;
|
|
1966
1972
|
let { cellProps, buttonProps, formattedDate, isOutsideVisibleRange } = useCalendarCell(props, state, ref);
|
|
1967
|
-
const classNames2 =
|
|
1973
|
+
const classNames2 = useClassNames22({
|
|
1968
1974
|
component: "Calendar"
|
|
1969
1975
|
});
|
|
1970
1976
|
const isDisabled = cellProps["aria-disabled"];
|
|
@@ -1976,7 +1982,7 @@ var CalendarCell = (props) => {
|
|
|
1976
1982
|
hover: isHovered,
|
|
1977
1983
|
selected: cellProps["aria-selected"]
|
|
1978
1984
|
});
|
|
1979
|
-
return /* @__PURE__ */
|
|
1985
|
+
return /* @__PURE__ */ React.createElement("td", { className: "group/cell", ...cellProps }, /* @__PURE__ */ React.createElement(
|
|
1980
1986
|
"div",
|
|
1981
1987
|
{
|
|
1982
1988
|
className: cn24(
|
|
@@ -1992,7 +1998,6 @@ var CalendarCell = (props) => {
|
|
|
1992
1998
|
};
|
|
1993
1999
|
|
|
1994
2000
|
// src/Calendar/CalendarGrid.tsx
|
|
1995
|
-
import { useDateFormatter } from "@react-aria/i18n";
|
|
1996
2001
|
var CalendarGrid = ({ state, ...props }) => {
|
|
1997
2002
|
const { locale } = useLocale2();
|
|
1998
2003
|
const { gridProps, headerProps } = useCalendarGrid(props, state);
|
|
@@ -2012,37 +2017,32 @@ var CalendarGrid = ({ state, ...props }) => {
|
|
|
2012
2017
|
return dayFormatter.format(dateDay);
|
|
2013
2018
|
});
|
|
2014
2019
|
}, [locale, state.timeZone, dayFormatter]);
|
|
2015
|
-
return /* @__PURE__ */
|
|
2020
|
+
return /* @__PURE__ */ React.createElement(
|
|
2016
2021
|
"table",
|
|
2017
2022
|
{
|
|
2018
2023
|
className: "w-full border-spacing-[6px]",
|
|
2019
2024
|
...gridProps,
|
|
2020
2025
|
cellPadding: "8"
|
|
2021
2026
|
},
|
|
2022
|
-
/* @__PURE__ */
|
|
2023
|
-
/* @__PURE__ */
|
|
2024
|
-
(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(
|
|
2025
2030
|
CalendarCell,
|
|
2026
2031
|
{
|
|
2027
2032
|
key: i,
|
|
2028
2033
|
date,
|
|
2029
2034
|
state
|
|
2030
2035
|
}
|
|
2031
|
-
) : /* @__PURE__ */
|
|
2036
|
+
) : /* @__PURE__ */ React.createElement("td", { key: i })
|
|
2032
2037
|
))))
|
|
2033
2038
|
);
|
|
2034
2039
|
};
|
|
2035
2040
|
|
|
2036
|
-
// src/Calendar/Calendar.tsx
|
|
2037
|
-
import { ChevronRight, ChevronLeft } from "@marigold/icons";
|
|
2038
|
-
import { cn as cn26, useClassNames as useClassNames23, useStateProps as useStateProps11 } from "@marigold/system";
|
|
2039
|
-
|
|
2040
2041
|
// src/Calendar/MonthDropdown.tsx
|
|
2041
|
-
import React47 from "react";
|
|
2042
2042
|
import { useDateFormatter as useDateFormatter2 } from "@react-aria/i18n";
|
|
2043
2043
|
|
|
2044
2044
|
// src/Select/Select.tsx
|
|
2045
|
-
import
|
|
2045
|
+
import {
|
|
2046
2046
|
forwardRef as forwardRef10,
|
|
2047
2047
|
useRef as useRef13
|
|
2048
2048
|
} from "react";
|
|
@@ -2050,12 +2050,12 @@ import { useButton as useButton6 } from "@react-aria/button";
|
|
|
2050
2050
|
import { useFocusRing as useFocusRing7 } from "@react-aria/focus";
|
|
2051
2051
|
import { useLocalizedStringFormatter } from "@react-aria/i18n";
|
|
2052
2052
|
import { HiddenSelect, useSelect } from "@react-aria/select";
|
|
2053
|
-
import { useSelectState } from "@react-stately/select";
|
|
2054
|
-
import { Item as Item4, Section } from "@react-stately/collections";
|
|
2055
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";
|
|
2056
2056
|
import {
|
|
2057
2057
|
cn as cn25,
|
|
2058
|
-
useClassNames as
|
|
2058
|
+
useClassNames as useClassNames23,
|
|
2059
2059
|
useSmallScreen,
|
|
2060
2060
|
useStateProps as useStateProps10
|
|
2061
2061
|
} from "@marigold/system";
|
|
@@ -2109,7 +2109,7 @@ var Select = forwardRef10(
|
|
|
2109
2109
|
buttonRef
|
|
2110
2110
|
);
|
|
2111
2111
|
const { focusProps, isFocusVisible } = useFocusRing7();
|
|
2112
|
-
const classNames2 =
|
|
2112
|
+
const classNames2 = useClassNames23({ component: "Select", variant, size });
|
|
2113
2113
|
const isSmallScreen = useSmallScreen();
|
|
2114
2114
|
const stateProps = useStateProps10({
|
|
2115
2115
|
disabled,
|
|
@@ -2118,7 +2118,7 @@ var Select = forwardRef10(
|
|
|
2118
2118
|
expanded: state.isOpen,
|
|
2119
2119
|
required
|
|
2120
2120
|
});
|
|
2121
|
-
return /* @__PURE__ */
|
|
2121
|
+
return /* @__PURE__ */ React.createElement(
|
|
2122
2122
|
FieldBase,
|
|
2123
2123
|
{
|
|
2124
2124
|
variant,
|
|
@@ -2134,7 +2134,7 @@ var Select = forwardRef10(
|
|
|
2134
2134
|
stateProps,
|
|
2135
2135
|
disabled
|
|
2136
2136
|
},
|
|
2137
|
-
/* @__PURE__ */
|
|
2137
|
+
/* @__PURE__ */ React.createElement(
|
|
2138
2138
|
HiddenSelect,
|
|
2139
2139
|
{
|
|
2140
2140
|
state,
|
|
@@ -2144,7 +2144,7 @@ var Select = forwardRef10(
|
|
|
2144
2144
|
isDisabled: disabled
|
|
2145
2145
|
}
|
|
2146
2146
|
),
|
|
2147
|
-
/* @__PURE__ */
|
|
2147
|
+
/* @__PURE__ */ React.createElement(
|
|
2148
2148
|
"button",
|
|
2149
2149
|
{
|
|
2150
2150
|
className: cn25(
|
|
@@ -2155,10 +2155,10 @@ var Select = forwardRef10(
|
|
|
2155
2155
|
...mergeProps10(buttonProps, focusProps),
|
|
2156
2156
|
...stateProps
|
|
2157
2157
|
},
|
|
2158
|
-
/* @__PURE__ */
|
|
2159
|
-
/* @__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" })
|
|
2160
2160
|
),
|
|
2161
|
-
isSmallScreen ? /* @__PURE__ */
|
|
2161
|
+
isSmallScreen ? /* @__PURE__ */ React.createElement(Tray, { state }, /* @__PURE__ */ React.createElement(
|
|
2162
2162
|
ListBox,
|
|
2163
2163
|
{
|
|
2164
2164
|
ref: listboxRef,
|
|
@@ -2167,7 +2167,7 @@ var Select = forwardRef10(
|
|
|
2167
2167
|
size,
|
|
2168
2168
|
...menuProps
|
|
2169
2169
|
}
|
|
2170
|
-
)) : /* @__PURE__ */
|
|
2170
|
+
)) : /* @__PURE__ */ React.createElement(Popover, { state, triggerRef: buttonRef, scrollRef: listboxRef }, /* @__PURE__ */ React.createElement(
|
|
2171
2171
|
ListBox,
|
|
2172
2172
|
{
|
|
2173
2173
|
ref: listboxRef,
|
|
@@ -2200,7 +2200,7 @@ var MonthDropdown = ({ state }) => {
|
|
|
2200
2200
|
let date = state.focusedDate.set({ month: value });
|
|
2201
2201
|
state.setFocusedDate(date);
|
|
2202
2202
|
};
|
|
2203
|
-
return /* @__PURE__ */
|
|
2203
|
+
return /* @__PURE__ */ React.createElement(
|
|
2204
2204
|
Select,
|
|
2205
2205
|
{
|
|
2206
2206
|
"aria-label": "Month",
|
|
@@ -2209,13 +2209,12 @@ var MonthDropdown = ({ state }) => {
|
|
|
2209
2209
|
"data-testid": "month",
|
|
2210
2210
|
disabled: state.isDisabled
|
|
2211
2211
|
},
|
|
2212
|
-
months.map((month, i) => /* @__PURE__ */
|
|
2212
|
+
months.map((month, i) => /* @__PURE__ */ React.createElement(Select.Option, { key: i + 1 }, month.substring(0, 3)))
|
|
2213
2213
|
);
|
|
2214
2214
|
};
|
|
2215
2215
|
var MonthDropdown_default = MonthDropdown;
|
|
2216
2216
|
|
|
2217
2217
|
// src/Calendar/YearDropdown.tsx
|
|
2218
|
-
import React48 from "react";
|
|
2219
2218
|
import { useDateFormatter as useDateFormatter3 } from "@react-aria/i18n";
|
|
2220
2219
|
var YearDropdown = ({ state }) => {
|
|
2221
2220
|
const years = [];
|
|
@@ -2235,7 +2234,7 @@ var YearDropdown = ({ state }) => {
|
|
|
2235
2234
|
let date = years[index].value;
|
|
2236
2235
|
state.setFocusedDate(date);
|
|
2237
2236
|
};
|
|
2238
|
-
return /* @__PURE__ */
|
|
2237
|
+
return /* @__PURE__ */ React.createElement(
|
|
2239
2238
|
Select,
|
|
2240
2239
|
{
|
|
2241
2240
|
"aria-label": "Year",
|
|
@@ -2244,7 +2243,7 @@ var YearDropdown = ({ state }) => {
|
|
|
2244
2243
|
"data-testid": "year",
|
|
2245
2244
|
disabled: state.isDisabled
|
|
2246
2245
|
},
|
|
2247
|
-
years.map((year, i) => /* @__PURE__ */
|
|
2246
|
+
years.map((year, i) => /* @__PURE__ */ React.createElement(Select.Option, { key: i }, year.formatted))
|
|
2248
2247
|
);
|
|
2249
2248
|
};
|
|
2250
2249
|
var YearDropdown_default = YearDropdown;
|
|
@@ -2273,13 +2272,22 @@ var Calendar = ({
|
|
|
2273
2272
|
props,
|
|
2274
2273
|
state
|
|
2275
2274
|
);
|
|
2276
|
-
const {
|
|
2277
|
-
|
|
2275
|
+
const {
|
|
2276
|
+
isDisabled: prevIsDisabled,
|
|
2277
|
+
onFocusChange: prevFocusChange,
|
|
2278
|
+
...prevPropsRest
|
|
2279
|
+
} = prevButtonProps;
|
|
2280
|
+
const {
|
|
2281
|
+
isDisabled: nextIsDisabled,
|
|
2282
|
+
onFocusChange: nextFocusChange,
|
|
2283
|
+
...nextPropsRest
|
|
2284
|
+
} = nextButtonProps;
|
|
2278
2285
|
const calendarState = useStateProps11({
|
|
2279
|
-
disabled: state.isDisabled
|
|
2286
|
+
disabled: state.isDisabled,
|
|
2287
|
+
focusVisible: state.isFocused
|
|
2280
2288
|
});
|
|
2281
|
-
const classNames2 =
|
|
2282
|
-
return /* @__PURE__ */
|
|
2289
|
+
const classNames2 = useClassNames24({ component: "Calendar" });
|
|
2290
|
+
return /* @__PURE__ */ React.createElement(
|
|
2283
2291
|
"div",
|
|
2284
2292
|
{
|
|
2285
2293
|
tabIndex: -1,
|
|
@@ -2291,33 +2299,33 @@ var Calendar = ({
|
|
|
2291
2299
|
...calendarState,
|
|
2292
2300
|
ref
|
|
2293
2301
|
},
|
|
2294
|
-
/* @__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(
|
|
2295
2303
|
Button,
|
|
2296
2304
|
{
|
|
2297
2305
|
className: classNames2.calendarControllers,
|
|
2298
2306
|
...prevPropsRest,
|
|
2299
2307
|
disabled: prevIsDisabled
|
|
2300
2308
|
},
|
|
2301
|
-
/* @__PURE__ */
|
|
2302
|
-
), /* @__PURE__ */
|
|
2309
|
+
/* @__PURE__ */ React.createElement(ChevronLeft, null)
|
|
2310
|
+
), /* @__PURE__ */ React.createElement(
|
|
2303
2311
|
Button,
|
|
2304
2312
|
{
|
|
2305
2313
|
className: classNames2.calendarControllers,
|
|
2306
2314
|
...nextPropsRest,
|
|
2307
2315
|
disabled: nextIsDisabled
|
|
2308
2316
|
},
|
|
2309
|
-
/* @__PURE__ */
|
|
2317
|
+
/* @__PURE__ */ React.createElement(ChevronRight, null)
|
|
2310
2318
|
))),
|
|
2311
|
-
/* @__PURE__ */
|
|
2319
|
+
/* @__PURE__ */ React.createElement(CalendarGrid, { state })
|
|
2312
2320
|
);
|
|
2313
2321
|
};
|
|
2314
2322
|
|
|
2315
2323
|
// src/DatePicker/DatePicker.tsx
|
|
2316
|
-
import
|
|
2317
|
-
import { useDatePickerState } from "@react-stately/datepicker";
|
|
2324
|
+
import { useRef as useRef15 } from "react";
|
|
2318
2325
|
import { useDatePicker } from "@react-aria/datepicker";
|
|
2319
|
-
import { cn as cn27, useClassNames as useClassNames24, useStateProps as useStateProps12 } from "@marigold/system";
|
|
2320
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";
|
|
2321
2329
|
var DatePicker = ({
|
|
2322
2330
|
disabled,
|
|
2323
2331
|
required,
|
|
@@ -2350,12 +2358,12 @@ var DatePicker = ({
|
|
|
2350
2358
|
ref
|
|
2351
2359
|
);
|
|
2352
2360
|
const { isDisabled, errorMessage, description, label } = props;
|
|
2353
|
-
const classNames2 =
|
|
2361
|
+
const classNames2 = useClassNames25({
|
|
2354
2362
|
component: "DatePicker",
|
|
2355
2363
|
size,
|
|
2356
2364
|
variant
|
|
2357
2365
|
});
|
|
2358
|
-
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(
|
|
2359
2367
|
DateField,
|
|
2360
2368
|
{
|
|
2361
2369
|
...fieldProps,
|
|
@@ -2367,14 +2375,14 @@ var DatePicker = ({
|
|
|
2367
2375
|
error,
|
|
2368
2376
|
description: !state.isOpen && description,
|
|
2369
2377
|
triggerRef: ref,
|
|
2370
|
-
action: /* @__PURE__ */
|
|
2378
|
+
action: /* @__PURE__ */ React.createElement("div", { className: classNames2.container }, /* @__PURE__ */ React.createElement(
|
|
2371
2379
|
Button,
|
|
2372
2380
|
{
|
|
2373
2381
|
...mergeProps11(buttonProps, stateProps),
|
|
2374
2382
|
className: cn27("absolute right-0 top-0", classNames2.button),
|
|
2375
2383
|
disabled: isDisabled
|
|
2376
2384
|
},
|
|
2377
|
-
/* @__PURE__ */
|
|
2385
|
+
/* @__PURE__ */ React.createElement(
|
|
2378
2386
|
"svg",
|
|
2379
2387
|
{
|
|
2380
2388
|
width: "24",
|
|
@@ -2382,27 +2390,26 @@ var DatePicker = ({
|
|
|
2382
2390
|
viewBox: "0 0 24 24",
|
|
2383
2391
|
fill: "currentColor"
|
|
2384
2392
|
},
|
|
2385
|
-
/* @__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" })
|
|
2386
2394
|
)
|
|
2387
2395
|
))
|
|
2388
2396
|
}
|
|
2389
|
-
)), state.isOpen && /* @__PURE__ */
|
|
2397
|
+
)), state.isOpen && /* @__PURE__ */ React.createElement(Popover, { triggerRef: ref, state }, /* @__PURE__ */ React.createElement(Calendar, { disabled, ...calendarProps })));
|
|
2390
2398
|
};
|
|
2391
2399
|
|
|
2392
2400
|
// src/Inset/Inset.tsx
|
|
2393
|
-
import React51 from "react";
|
|
2394
2401
|
import {
|
|
2402
|
+
cn as cn28,
|
|
2395
2403
|
paddingSpace as paddingSpace2,
|
|
2396
2404
|
paddingSpaceX as paddingSpaceX2,
|
|
2397
|
-
paddingSpaceY as paddingSpaceY2
|
|
2398
|
-
cn as cn28
|
|
2405
|
+
paddingSpaceY as paddingSpaceY2
|
|
2399
2406
|
} from "@marigold/system";
|
|
2400
2407
|
var Inset = ({
|
|
2401
2408
|
space = 0,
|
|
2402
2409
|
spaceX = 0,
|
|
2403
2410
|
spaceY = 0,
|
|
2404
2411
|
children
|
|
2405
|
-
}) => /* @__PURE__ */
|
|
2412
|
+
}) => /* @__PURE__ */ React.createElement(
|
|
2406
2413
|
"div",
|
|
2407
2414
|
{
|
|
2408
2415
|
className: cn28(
|
|
@@ -2414,10 +2421,10 @@ var Inset = ({
|
|
|
2414
2421
|
);
|
|
2415
2422
|
|
|
2416
2423
|
// src/Link/Link.tsx
|
|
2417
|
-
import
|
|
2424
|
+
import { forwardRef as forwardRef11 } from "react";
|
|
2418
2425
|
import { useLink } from "@react-aria/link";
|
|
2419
|
-
import { useClassNames as useClassNames25 } from "@marigold/system";
|
|
2420
2426
|
import { useObjectRef as useObjectRef7 } from "@react-aria/utils";
|
|
2427
|
+
import { useClassNames as useClassNames26 } from "@marigold/system";
|
|
2421
2428
|
var Link = forwardRef11(
|
|
2422
2429
|
({
|
|
2423
2430
|
as = "a",
|
|
@@ -2440,13 +2447,13 @@ var Link = forwardRef11(
|
|
|
2440
2447
|
linkRef
|
|
2441
2448
|
);
|
|
2442
2449
|
const Component = as;
|
|
2443
|
-
const classNames2 =
|
|
2450
|
+
const classNames2 = useClassNames26({
|
|
2444
2451
|
component: "Link",
|
|
2445
2452
|
variant,
|
|
2446
2453
|
size,
|
|
2447
2454
|
className
|
|
2448
2455
|
});
|
|
2449
|
-
return /* @__PURE__ */
|
|
2456
|
+
return /* @__PURE__ */ React.createElement(
|
|
2450
2457
|
Component,
|
|
2451
2458
|
{
|
|
2452
2459
|
...props,
|
|
@@ -2461,8 +2468,7 @@ var Link = forwardRef11(
|
|
|
2461
2468
|
);
|
|
2462
2469
|
|
|
2463
2470
|
// src/List/List.tsx
|
|
2464
|
-
import
|
|
2465
|
-
import { useClassNames as useClassNames26 } from "@marigold/system";
|
|
2471
|
+
import { useClassNames as useClassNames27 } from "@marigold/system";
|
|
2466
2472
|
|
|
2467
2473
|
// src/List/Context.ts
|
|
2468
2474
|
import { createContext as createContext5, useContext as useContext5 } from "react";
|
|
@@ -2470,10 +2476,9 @@ var ListContext = createContext5({});
|
|
|
2470
2476
|
var useListContext = () => useContext5(ListContext);
|
|
2471
2477
|
|
|
2472
2478
|
// src/List/ListItem.tsx
|
|
2473
|
-
import React53 from "react";
|
|
2474
2479
|
var ListItem = ({ children, ...props }) => {
|
|
2475
2480
|
const { classNames: classNames2 } = useListContext();
|
|
2476
|
-
return /* @__PURE__ */
|
|
2481
|
+
return /* @__PURE__ */ React.createElement("li", { ...props, className: classNames2 }, children);
|
|
2477
2482
|
};
|
|
2478
2483
|
|
|
2479
2484
|
// src/List/List.tsx
|
|
@@ -2485,18 +2490,18 @@ var List = ({
|
|
|
2485
2490
|
...props
|
|
2486
2491
|
}) => {
|
|
2487
2492
|
const Component = as;
|
|
2488
|
-
const classNames2 =
|
|
2489
|
-
return /* @__PURE__ */
|
|
2493
|
+
const classNames2 = useClassNames27({ component: "List", variant, size });
|
|
2494
|
+
return /* @__PURE__ */ React.createElement(Component, { ...props, className: classNames2[as] }, /* @__PURE__ */ React.createElement(ListContext.Provider, { value: { classNames: classNames2.item } }, children));
|
|
2490
2495
|
};
|
|
2491
2496
|
List.Item = ListItem;
|
|
2492
2497
|
|
|
2493
2498
|
// src/Menu/Menu.tsx
|
|
2494
|
-
import
|
|
2499
|
+
import { useRef as useRef18 } from "react";
|
|
2495
2500
|
import { useMenu } from "@react-aria/menu";
|
|
2501
|
+
import { useSyncRef } from "@react-aria/utils";
|
|
2496
2502
|
import { Item as Item5, Section as Section2 } from "@react-stately/collections";
|
|
2497
2503
|
import { useTreeState as useTreeState2 } from "@react-stately/tree";
|
|
2498
|
-
import {
|
|
2499
|
-
import { useClassNames as useClassNames28 } from "@marigold/system";
|
|
2504
|
+
import { useClassNames as useClassNames29 } from "@marigold/system";
|
|
2500
2505
|
|
|
2501
2506
|
// src/Menu/Context.ts
|
|
2502
2507
|
import {
|
|
@@ -2506,52 +2511,8 @@ import {
|
|
|
2506
2511
|
var MenuContext = createContext6({});
|
|
2507
2512
|
var useMenuContext = () => useContext6(MenuContext);
|
|
2508
2513
|
|
|
2509
|
-
// src/Menu/MenuTrigger.tsx
|
|
2510
|
-
import React55, { useRef as useRef16 } from "react";
|
|
2511
|
-
import { useMenuTriggerState } from "@react-stately/menu";
|
|
2512
|
-
import { PressResponder as PressResponder2 } from "@react-aria/interactions";
|
|
2513
|
-
import { useMenuTrigger } from "@react-aria/menu";
|
|
2514
|
-
import { useObjectRef as useObjectRef8 } from "@react-aria/utils";
|
|
2515
|
-
import { useSmallScreen as useSmallScreen2 } from "@marigold/system";
|
|
2516
|
-
var MenuTrigger = ({
|
|
2517
|
-
disabled,
|
|
2518
|
-
open,
|
|
2519
|
-
onOpenChange,
|
|
2520
|
-
children
|
|
2521
|
-
}) => {
|
|
2522
|
-
const [menuTrigger, menu] = React55.Children.toArray(children);
|
|
2523
|
-
const menuTriggerRef = useRef16(null);
|
|
2524
|
-
const menuRef = useObjectRef8();
|
|
2525
|
-
const state = useMenuTriggerState({
|
|
2526
|
-
isOpen: open,
|
|
2527
|
-
onOpenChange
|
|
2528
|
-
});
|
|
2529
|
-
const { menuTriggerProps, menuProps } = useMenuTrigger(
|
|
2530
|
-
{ trigger: "press", isDisabled: disabled },
|
|
2531
|
-
state,
|
|
2532
|
-
menuTriggerRef
|
|
2533
|
-
);
|
|
2534
|
-
const menuContext = {
|
|
2535
|
-
...menuProps,
|
|
2536
|
-
ref: menuRef,
|
|
2537
|
-
open: state.isOpen,
|
|
2538
|
-
onClose: state.close,
|
|
2539
|
-
autoFocus: state.focusStrategy
|
|
2540
|
-
};
|
|
2541
|
-
const isSmallScreen = useSmallScreen2();
|
|
2542
|
-
return /* @__PURE__ */ React55.createElement(MenuContext.Provider, { value: menuContext }, /* @__PURE__ */ React55.createElement(
|
|
2543
|
-
PressResponder2,
|
|
2544
|
-
{
|
|
2545
|
-
...menuTriggerProps,
|
|
2546
|
-
ref: menuTriggerRef,
|
|
2547
|
-
isPressed: state.isOpen
|
|
2548
|
-
},
|
|
2549
|
-
menuTrigger
|
|
2550
|
-
), isSmallScreen ? /* @__PURE__ */ React55.createElement(Tray, { state }, menu) : /* @__PURE__ */ React55.createElement(Popover, { triggerRef: menuTriggerRef, scrollRef: menuRef, state }, menu));
|
|
2551
|
-
};
|
|
2552
|
-
|
|
2553
2514
|
// src/Menu/MenuItem.tsx
|
|
2554
|
-
import
|
|
2515
|
+
import { useRef as useRef16 } from "react";
|
|
2555
2516
|
import { useFocusRing as useFocusRing8 } from "@react-aria/focus";
|
|
2556
2517
|
import { useMenuItem } from "@react-aria/menu";
|
|
2557
2518
|
import { mergeProps as mergeProps12 } from "@react-aria/utils";
|
|
@@ -2562,7 +2523,7 @@ var MenuItem = ({
|
|
|
2562
2523
|
onAction,
|
|
2563
2524
|
className
|
|
2564
2525
|
}) => {
|
|
2565
|
-
const ref =
|
|
2526
|
+
const ref = useRef16(null);
|
|
2566
2527
|
const { onClose } = useMenuContext();
|
|
2567
2528
|
const { menuItemProps } = useMenuItem(
|
|
2568
2529
|
{
|
|
@@ -2578,7 +2539,7 @@ var MenuItem = ({
|
|
|
2578
2539
|
focus: isFocusVisible
|
|
2579
2540
|
});
|
|
2580
2541
|
const { onPointerUp, ...props } = menuItemProps;
|
|
2581
|
-
return /* @__PURE__ */
|
|
2542
|
+
return /* @__PURE__ */ React.createElement(
|
|
2582
2543
|
"li",
|
|
2583
2544
|
{
|
|
2584
2545
|
ref,
|
|
@@ -2595,16 +2556,15 @@ var MenuItem = ({
|
|
|
2595
2556
|
};
|
|
2596
2557
|
|
|
2597
2558
|
// src/Menu/MenuSection.tsx
|
|
2598
|
-
import React57 from "react";
|
|
2599
2559
|
import { useMenuSection } from "@react-aria/menu";
|
|
2600
|
-
import { useClassNames as
|
|
2560
|
+
import { useClassNames as useClassNames28 } from "@marigold/system";
|
|
2601
2561
|
var MenuSection = ({ onAction, item, state }) => {
|
|
2602
2562
|
let { itemProps, headingProps, groupProps } = useMenuSection({
|
|
2603
2563
|
heading: item.rendered,
|
|
2604
2564
|
"aria-label": item["aria-label"]
|
|
2605
2565
|
});
|
|
2606
|
-
const className =
|
|
2607
|
-
return /* @__PURE__ */
|
|
2566
|
+
const className = useClassNames28({ component: "Menu" });
|
|
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(
|
|
2608
2568
|
MenuItem,
|
|
2609
2569
|
{
|
|
2610
2570
|
key: node.key,
|
|
@@ -2617,6 +2577,50 @@ var MenuSection = ({ onAction, item, state }) => {
|
|
|
2617
2577
|
};
|
|
2618
2578
|
var MenuSection_default = MenuSection;
|
|
2619
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
|
+
|
|
2620
2624
|
// src/Menu/Menu.tsx
|
|
2621
2625
|
var Menu = ({ variant, size, ...props }) => {
|
|
2622
2626
|
const { ref: scrollRef, ...menuContext } = useMenuContext();
|
|
@@ -2625,10 +2629,10 @@ var Menu = ({ variant, size, ...props }) => {
|
|
|
2625
2629
|
const state = useTreeState2({ ...ownProps, selectionMode: "none" });
|
|
2626
2630
|
const { menuProps } = useMenu(ownProps, state, ref);
|
|
2627
2631
|
useSyncRef({ ref: scrollRef }, ref);
|
|
2628
|
-
const classNames2 =
|
|
2629
|
-
return /* @__PURE__ */
|
|
2632
|
+
const classNames2 = useClassNames29({ component: "Menu", variant, size });
|
|
2633
|
+
return /* @__PURE__ */ React.createElement("ul", { ref, className: classNames2.container, ...menuProps }, [...state.collection].map((item) => {
|
|
2630
2634
|
if (item.type === "section") {
|
|
2631
|
-
return /* @__PURE__ */
|
|
2635
|
+
return /* @__PURE__ */ React.createElement(
|
|
2632
2636
|
MenuSection_default,
|
|
2633
2637
|
{
|
|
2634
2638
|
key: item.key,
|
|
@@ -2638,7 +2642,7 @@ var Menu = ({ variant, size, ...props }) => {
|
|
|
2638
2642
|
}
|
|
2639
2643
|
);
|
|
2640
2644
|
}
|
|
2641
|
-
return /* @__PURE__ */
|
|
2645
|
+
return /* @__PURE__ */ React.createElement(
|
|
2642
2646
|
MenuItem,
|
|
2643
2647
|
{
|
|
2644
2648
|
key: item.key,
|
|
@@ -2655,24 +2659,22 @@ Menu.Item = Item5;
|
|
|
2655
2659
|
Menu.Section = Section2;
|
|
2656
2660
|
|
|
2657
2661
|
// src/Menu/ActionMenu.tsx
|
|
2658
|
-
import React59 from "react";
|
|
2659
2662
|
import { SVG as SVG5 } from "@marigold/system";
|
|
2660
2663
|
var ActionMenu = (props) => {
|
|
2661
|
-
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 }));
|
|
2662
2665
|
};
|
|
2663
2666
|
|
|
2664
2667
|
// src/Message/Message.tsx
|
|
2665
|
-
import
|
|
2666
|
-
import { cn as cn29, useClassNames as useClassNames29 } from "@marigold/system";
|
|
2668
|
+
import { cn as cn29, useClassNames as useClassNames30 } from "@marigold/system";
|
|
2667
2669
|
var icons = {
|
|
2668
|
-
info: () => /* @__PURE__ */
|
|
2670
|
+
info: () => /* @__PURE__ */ React.createElement(
|
|
2669
2671
|
"svg",
|
|
2670
2672
|
{
|
|
2671
2673
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2672
2674
|
viewBox: "0 0 24 24",
|
|
2673
2675
|
fill: "currentColor"
|
|
2674
2676
|
},
|
|
2675
|
-
/* @__PURE__ */
|
|
2677
|
+
/* @__PURE__ */ React.createElement(
|
|
2676
2678
|
"path",
|
|
2677
2679
|
{
|
|
2678
2680
|
fillRule: "evenodd",
|
|
@@ -2681,14 +2683,14 @@ var icons = {
|
|
|
2681
2683
|
}
|
|
2682
2684
|
)
|
|
2683
2685
|
),
|
|
2684
|
-
warning: () => /* @__PURE__ */
|
|
2686
|
+
warning: () => /* @__PURE__ */ React.createElement(
|
|
2685
2687
|
"svg",
|
|
2686
2688
|
{
|
|
2687
2689
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2688
2690
|
viewBox: "0 0 24 24",
|
|
2689
2691
|
fill: "currentColor"
|
|
2690
2692
|
},
|
|
2691
|
-
/* @__PURE__ */
|
|
2693
|
+
/* @__PURE__ */ React.createElement(
|
|
2692
2694
|
"path",
|
|
2693
2695
|
{
|
|
2694
2696
|
fillRule: "evenodd",
|
|
@@ -2697,14 +2699,14 @@ var icons = {
|
|
|
2697
2699
|
}
|
|
2698
2700
|
)
|
|
2699
2701
|
),
|
|
2700
|
-
error: () => /* @__PURE__ */
|
|
2702
|
+
error: () => /* @__PURE__ */ React.createElement(
|
|
2701
2703
|
"svg",
|
|
2702
2704
|
{
|
|
2703
2705
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2704
2706
|
viewBox: "0 0 24 24",
|
|
2705
2707
|
fill: "currentColor"
|
|
2706
2708
|
},
|
|
2707
|
-
/* @__PURE__ */
|
|
2709
|
+
/* @__PURE__ */ React.createElement(
|
|
2708
2710
|
"path",
|
|
2709
2711
|
{
|
|
2710
2712
|
fillRule: "evenodd",
|
|
@@ -2721,9 +2723,9 @@ var Message = ({
|
|
|
2721
2723
|
children,
|
|
2722
2724
|
...props
|
|
2723
2725
|
}) => {
|
|
2724
|
-
const classNames2 =
|
|
2726
|
+
const classNames2 = useClassNames30({ component: "Message", variant, size });
|
|
2725
2727
|
const Icon3 = icons[variant];
|
|
2726
|
-
return /* @__PURE__ */
|
|
2728
|
+
return /* @__PURE__ */ React.createElement(
|
|
2727
2729
|
"div",
|
|
2728
2730
|
{
|
|
2729
2731
|
className: cn29(
|
|
@@ -2732,35 +2734,35 @@ var Message = ({
|
|
|
2732
2734
|
),
|
|
2733
2735
|
...props
|
|
2734
2736
|
},
|
|
2735
|
-
/* @__PURE__ */
|
|
2736
|
-
/* @__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(
|
|
2737
2739
|
"div",
|
|
2738
2740
|
{
|
|
2739
2741
|
className: cn29("col-start-2 row-start-1 self-center", classNames2.title)
|
|
2740
2742
|
},
|
|
2741
2743
|
messageTitle
|
|
2742
2744
|
),
|
|
2743
|
-
/* @__PURE__ */
|
|
2745
|
+
/* @__PURE__ */ React.createElement("div", { className: cn29("col-start-2", classNames2.content) }, children)
|
|
2744
2746
|
);
|
|
2745
2747
|
};
|
|
2746
2748
|
|
|
2747
2749
|
// src/NumberField/NumberField.tsx
|
|
2748
|
-
import
|
|
2750
|
+
import { forwardRef as forwardRef12 } from "react";
|
|
2749
2751
|
import { useFocusRing as useFocusRing9 } from "@react-aria/focus";
|
|
2750
|
-
import { useHover as useHover7 } from "@react-aria/interactions";
|
|
2751
2752
|
import { useLocale as useLocale4 } from "@react-aria/i18n";
|
|
2753
|
+
import { useHover as useHover7 } from "@react-aria/interactions";
|
|
2752
2754
|
import { useNumberField } from "@react-aria/numberfield";
|
|
2753
2755
|
import { mergeProps as mergeProps14, useObjectRef as useObjectRef9 } from "@react-aria/utils";
|
|
2754
2756
|
import { useNumberFieldState } from "@react-stately/numberfield";
|
|
2755
|
-
import { cn as cn31, useClassNames as
|
|
2757
|
+
import { cn as cn31, useClassNames as useClassNames31, useStateProps as useStateProps15 } from "@marigold/system";
|
|
2756
2758
|
|
|
2757
2759
|
// src/NumberField/StepButton.tsx
|
|
2758
|
-
import
|
|
2760
|
+
import { useRef as useRef19 } from "react";
|
|
2759
2761
|
import { useButton as useButton7 } from "@react-aria/button";
|
|
2760
2762
|
import { useHover as useHover6 } from "@react-aria/interactions";
|
|
2761
2763
|
import { mergeProps as mergeProps13 } from "@react-aria/utils";
|
|
2762
2764
|
import { cn as cn30, useStateProps as useStateProps14 } from "@marigold/system";
|
|
2763
|
-
var Plus = () => /* @__PURE__ */
|
|
2765
|
+
var Plus = () => /* @__PURE__ */ React.createElement("svg", { width: 16, height: 16, viewBox: "0 0 20 20", fill: "currentColor" }, /* @__PURE__ */ React.createElement(
|
|
2764
2766
|
"path",
|
|
2765
2767
|
{
|
|
2766
2768
|
fillRule: "evenodd",
|
|
@@ -2768,7 +2770,7 @@ var Plus = () => /* @__PURE__ */ React61.createElement("svg", { width: 16, heigh
|
|
|
2768
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"
|
|
2769
2771
|
}
|
|
2770
2772
|
));
|
|
2771
|
-
var Minus = () => /* @__PURE__ */
|
|
2773
|
+
var Minus = () => /* @__PURE__ */ React.createElement("svg", { width: 16, height: 16, viewBox: "0 0 20 20", fill: "currentColor" }, /* @__PURE__ */ React.createElement(
|
|
2772
2774
|
"path",
|
|
2773
2775
|
{
|
|
2774
2776
|
fillRule: "evenodd",
|
|
@@ -2793,7 +2795,7 @@ var StepButton = ({
|
|
|
2793
2795
|
disabled: props.isDisabled
|
|
2794
2796
|
});
|
|
2795
2797
|
const Icon3 = direction === "up" ? Plus : Minus;
|
|
2796
|
-
return /* @__PURE__ */
|
|
2798
|
+
return /* @__PURE__ */ React.createElement(
|
|
2797
2799
|
"div",
|
|
2798
2800
|
{
|
|
2799
2801
|
className: cn30(
|
|
@@ -2806,7 +2808,7 @@ var StepButton = ({
|
|
|
2806
2808
|
...mergeProps13(buttonProps, hoverProps),
|
|
2807
2809
|
...stateProps
|
|
2808
2810
|
},
|
|
2809
|
-
/* @__PURE__ */
|
|
2811
|
+
/* @__PURE__ */ React.createElement(Icon3, null)
|
|
2810
2812
|
);
|
|
2811
2813
|
};
|
|
2812
2814
|
|
|
@@ -2857,12 +2859,12 @@ var NumberField = forwardRef12(
|
|
|
2857
2859
|
readOnly,
|
|
2858
2860
|
required
|
|
2859
2861
|
});
|
|
2860
|
-
const classNames2 =
|
|
2862
|
+
const classNames2 = useClassNames31({
|
|
2861
2863
|
component: "NumberField",
|
|
2862
2864
|
size,
|
|
2863
2865
|
variant
|
|
2864
2866
|
});
|
|
2865
|
-
return /* @__PURE__ */
|
|
2867
|
+
return /* @__PURE__ */ React.createElement(
|
|
2866
2868
|
FieldBase,
|
|
2867
2869
|
{
|
|
2868
2870
|
label: props.label,
|
|
@@ -2877,7 +2879,7 @@ var NumberField = forwardRef12(
|
|
|
2877
2879
|
size,
|
|
2878
2880
|
width
|
|
2879
2881
|
},
|
|
2880
|
-
/* @__PURE__ */
|
|
2882
|
+
/* @__PURE__ */ React.createElement(
|
|
2881
2883
|
"div",
|
|
2882
2884
|
{
|
|
2883
2885
|
"data-group": true,
|
|
@@ -2886,7 +2888,7 @@ var NumberField = forwardRef12(
|
|
|
2886
2888
|
...mergeProps14(groupProps, focusProps, hoverProps),
|
|
2887
2889
|
...stateProps
|
|
2888
2890
|
},
|
|
2889
|
-
showStepper && /* @__PURE__ */
|
|
2891
|
+
showStepper && /* @__PURE__ */ React.createElement(
|
|
2890
2892
|
StepButton,
|
|
2891
2893
|
{
|
|
2892
2894
|
className: classNames2.stepper,
|
|
@@ -2894,7 +2896,7 @@ var NumberField = forwardRef12(
|
|
|
2894
2896
|
...decrementButtonProps
|
|
2895
2897
|
}
|
|
2896
2898
|
),
|
|
2897
|
-
/* @__PURE__ */
|
|
2899
|
+
/* @__PURE__ */ React.createElement("div", { className: "flex-1" }, /* @__PURE__ */ React.createElement(
|
|
2898
2900
|
Input,
|
|
2899
2901
|
{
|
|
2900
2902
|
ref: inputRef,
|
|
@@ -2907,7 +2909,7 @@ var NumberField = forwardRef12(
|
|
|
2907
2909
|
...stateProps
|
|
2908
2910
|
}
|
|
2909
2911
|
)),
|
|
2910
|
-
showStepper && /* @__PURE__ */
|
|
2912
|
+
showStepper && /* @__PURE__ */ React.createElement(
|
|
2911
2913
|
StepButton,
|
|
2912
2914
|
{
|
|
2913
2915
|
className: classNames2.stepper,
|
|
@@ -2924,7 +2926,6 @@ var NumberField = forwardRef12(
|
|
|
2924
2926
|
import { useTheme as useTheme4, ThemeProvider as ThemeProvider2 } from "@marigold/system";
|
|
2925
2927
|
|
|
2926
2928
|
// src/Provider/MarigoldProvider.tsx
|
|
2927
|
-
import React63 from "react";
|
|
2928
2929
|
import { OverlayProvider } from "@react-aria/overlays";
|
|
2929
2930
|
import {
|
|
2930
2931
|
ThemeProvider,
|
|
@@ -2937,20 +2938,20 @@ function MarigoldProvider({
|
|
|
2937
2938
|
}) {
|
|
2938
2939
|
const outerTheme = useTheme3();
|
|
2939
2940
|
const isTopLevel = outerTheme === defaultTheme;
|
|
2940
|
-
return /* @__PURE__ */
|
|
2941
|
+
return /* @__PURE__ */ React.createElement(ThemeProvider, { theme }, isTopLevel ? /* @__PURE__ */ React.createElement(OverlayProvider, null, children) : children);
|
|
2941
2942
|
}
|
|
2942
2943
|
|
|
2943
2944
|
// src/Radio/Radio.tsx
|
|
2944
|
-
import
|
|
2945
|
+
import {
|
|
2945
2946
|
forwardRef as forwardRef13
|
|
2946
2947
|
} from "react";
|
|
2947
|
-
import { useHover as useHover8 } from "@react-aria/interactions";
|
|
2948
2948
|
import { useFocusRing as useFocusRing10 } from "@react-aria/focus";
|
|
2949
|
+
import { useHover as useHover8 } from "@react-aria/interactions";
|
|
2949
2950
|
import { useRadio } from "@react-aria/radio";
|
|
2950
2951
|
import { mergeProps as mergeProps15, useObjectRef as useObjectRef10 } from "@react-aria/utils";
|
|
2951
2952
|
import {
|
|
2952
2953
|
cn as cn33,
|
|
2953
|
-
useClassNames as
|
|
2954
|
+
useClassNames as useClassNames32,
|
|
2954
2955
|
useStateProps as useStateProps17
|
|
2955
2956
|
} from "@marigold/system";
|
|
2956
2957
|
|
|
@@ -2962,7 +2963,6 @@ var RadioGroupContext = createContext7(
|
|
|
2962
2963
|
var useRadioGroupContext = () => useContext7(RadioGroupContext);
|
|
2963
2964
|
|
|
2964
2965
|
// src/Radio/RadioGroup.tsx
|
|
2965
|
-
import React64 from "react";
|
|
2966
2966
|
import { useRadioGroup } from "@react-aria/radio";
|
|
2967
2967
|
import { useRadioGroupState } from "@react-stately/radio";
|
|
2968
2968
|
import { cn as cn32, useStateProps as useStateProps16 } from "@marigold/system";
|
|
@@ -2991,7 +2991,7 @@ var RadioGroup = ({
|
|
|
2991
2991
|
error,
|
|
2992
2992
|
required
|
|
2993
2993
|
});
|
|
2994
|
-
return /* @__PURE__ */
|
|
2994
|
+
return /* @__PURE__ */ React.createElement(
|
|
2995
2995
|
FieldBase,
|
|
2996
2996
|
{
|
|
2997
2997
|
width,
|
|
@@ -3006,7 +3006,7 @@ var RadioGroup = ({
|
|
|
3006
3006
|
stateProps,
|
|
3007
3007
|
...radioGroupProps
|
|
3008
3008
|
},
|
|
3009
|
-
/* @__PURE__ */
|
|
3009
|
+
/* @__PURE__ */ React.createElement(
|
|
3010
3010
|
"div",
|
|
3011
3011
|
{
|
|
3012
3012
|
role: "presentation",
|
|
@@ -3016,14 +3016,14 @@ var RadioGroup = ({
|
|
|
3016
3016
|
orientation === "vertical" ? "flex-col gap-[0.5ch]" : "flex-row gap-[1.5ch]"
|
|
3017
3017
|
)
|
|
3018
3018
|
},
|
|
3019
|
-
/* @__PURE__ */
|
|
3019
|
+
/* @__PURE__ */ React.createElement(RadioGroupContext.Provider, { value: { width, error, state } }, children)
|
|
3020
3020
|
)
|
|
3021
3021
|
);
|
|
3022
3022
|
};
|
|
3023
3023
|
|
|
3024
3024
|
// src/Radio/Radio.tsx
|
|
3025
|
-
var Dot = () => /* @__PURE__ */
|
|
3026
|
-
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(
|
|
3027
3027
|
"div",
|
|
3028
3028
|
{
|
|
3029
3029
|
className: cn33(
|
|
@@ -3033,7 +3033,7 @@ var Icon2 = ({ checked, className, ...props }) => /* @__PURE__ */ React65.create
|
|
|
3033
3033
|
"aria-hidden": "true",
|
|
3034
3034
|
...props
|
|
3035
3035
|
},
|
|
3036
|
-
checked ? /* @__PURE__ */
|
|
3036
|
+
checked ? /* @__PURE__ */ React.createElement(Dot, null) : null
|
|
3037
3037
|
);
|
|
3038
3038
|
var Radio = forwardRef13(
|
|
3039
3039
|
({ width, disabled, ...props }, ref) => {
|
|
@@ -3050,7 +3050,7 @@ var Radio = forwardRef13(
|
|
|
3050
3050
|
state,
|
|
3051
3051
|
inputRef
|
|
3052
3052
|
);
|
|
3053
|
-
const classNames2 =
|
|
3053
|
+
const classNames2 = useClassNames32({
|
|
3054
3054
|
component: "Radio",
|
|
3055
3055
|
variant: variant || props.variant,
|
|
3056
3056
|
size: size || props.size
|
|
@@ -3065,7 +3065,7 @@ var Radio = forwardRef13(
|
|
|
3065
3065
|
readOnly: props.readOnly,
|
|
3066
3066
|
error
|
|
3067
3067
|
});
|
|
3068
|
-
return /* @__PURE__ */
|
|
3068
|
+
return /* @__PURE__ */ React.createElement(
|
|
3069
3069
|
"label",
|
|
3070
3070
|
{
|
|
3071
3071
|
className: cn33(
|
|
@@ -3076,7 +3076,7 @@ var Radio = forwardRef13(
|
|
|
3076
3076
|
),
|
|
3077
3077
|
...mergeProps15(hoverProps, stateProps)
|
|
3078
3078
|
},
|
|
3079
|
-
/* @__PURE__ */
|
|
3079
|
+
/* @__PURE__ */ React.createElement(
|
|
3080
3080
|
"input",
|
|
3081
3081
|
{
|
|
3082
3082
|
ref: inputRef,
|
|
@@ -3087,23 +3087,24 @@ var Radio = forwardRef13(
|
|
|
3087
3087
|
...mergeProps15(inputProps, focusProps)
|
|
3088
3088
|
}
|
|
3089
3089
|
),
|
|
3090
|
-
/* @__PURE__ */
|
|
3091
|
-
/* @__PURE__ */
|
|
3090
|
+
/* @__PURE__ */ React.createElement(Icon2, { checked: inputProps.checked, className: classNames2.radio }),
|
|
3091
|
+
/* @__PURE__ */ React.createElement("div", { className: classNames2.label }, props.children)
|
|
3092
3092
|
);
|
|
3093
3093
|
}
|
|
3094
3094
|
);
|
|
3095
3095
|
Radio.Group = RadioGroup;
|
|
3096
3096
|
|
|
3097
3097
|
// src/Slider/Slider.tsx
|
|
3098
|
-
import
|
|
3099
|
-
import { useSlider } from "@react-aria/slider";
|
|
3100
|
-
import { useSliderState } from "@react-stately/slider";
|
|
3098
|
+
import { forwardRef as forwardRef14 } from "react";
|
|
3101
3099
|
import { useNumberFormatter } from "@react-aria/i18n";
|
|
3100
|
+
import { useSlider } from "@react-aria/slider";
|
|
3102
3101
|
import { useObjectRef as useObjectRef11 } from "@react-aria/utils";
|
|
3103
|
-
import {
|
|
3102
|
+
import { useSliderState } from "@react-stately/slider";
|
|
3103
|
+
import { cn as cn35, createVar as createVar10, useClassNames as useClassNames33, useStateProps as useStateProps19 } from "@marigold/system";
|
|
3104
3104
|
|
|
3105
3105
|
// src/Slider/Thumb.tsx
|
|
3106
|
-
import
|
|
3106
|
+
import { useEffect as useEffect2, useRef as useRef20 } from "react";
|
|
3107
|
+
import { useFocusRing as useFocusRing11 } from "@react-aria/focus";
|
|
3107
3108
|
import { useSliderThumb } from "@react-aria/slider";
|
|
3108
3109
|
import { mergeProps as mergeProps16 } from "@react-aria/utils";
|
|
3109
3110
|
import { cn as cn34, useStateProps as useStateProps18 } from "@marigold/system";
|
|
@@ -3112,10 +3113,9 @@ import { cn as cn34, useStateProps as useStateProps18 } from "@marigold/system";
|
|
|
3112
3113
|
import { VisuallyHidden } from "@react-aria/visually-hidden";
|
|
3113
3114
|
|
|
3114
3115
|
// src/Slider/Thumb.tsx
|
|
3115
|
-
import { useFocusRing as useFocusRing11 } from "@react-aria/focus";
|
|
3116
3116
|
var Thumb = ({ state, trackRef, className, ...props }) => {
|
|
3117
3117
|
const { disabled } = props;
|
|
3118
|
-
const inputRef =
|
|
3118
|
+
const inputRef = useRef20(null);
|
|
3119
3119
|
const { isFocusVisible, focusProps, isFocused } = useFocusRing11();
|
|
3120
3120
|
const focused = isFocused || isFocusVisible || state.isThumbDragging(0);
|
|
3121
3121
|
const stateProps = useStateProps18({
|
|
@@ -3131,10 +3131,10 @@ var Thumb = ({ state, trackRef, className, ...props }) => {
|
|
|
3131
3131
|
},
|
|
3132
3132
|
state
|
|
3133
3133
|
);
|
|
3134
|
-
|
|
3134
|
+
useEffect2(() => {
|
|
3135
3135
|
state.setThumbEditable(0, !disabled);
|
|
3136
3136
|
}, [disabled, state]);
|
|
3137
|
-
return /* @__PURE__ */
|
|
3137
|
+
return /* @__PURE__ */ React.createElement("div", { className: cn34("top-1/2", className), ...thumbProps, ...stateProps }, /* @__PURE__ */ React.createElement(VisuallyHidden, null, /* @__PURE__ */ React.createElement(
|
|
3138
3138
|
"input",
|
|
3139
3139
|
{
|
|
3140
3140
|
type: "range",
|
|
@@ -3159,7 +3159,7 @@ var Slider = forwardRef14(
|
|
|
3159
3159
|
state,
|
|
3160
3160
|
trackRef
|
|
3161
3161
|
);
|
|
3162
|
-
const classNames2 =
|
|
3162
|
+
const classNames2 = useClassNames33({
|
|
3163
3163
|
component: "Slider",
|
|
3164
3164
|
variant,
|
|
3165
3165
|
size
|
|
@@ -3167,14 +3167,14 @@ var Slider = forwardRef14(
|
|
|
3167
3167
|
const sliderState = useStateProps19({
|
|
3168
3168
|
disabled: props.disabled
|
|
3169
3169
|
});
|
|
3170
|
-
return /* @__PURE__ */
|
|
3170
|
+
return /* @__PURE__ */ React.createElement(
|
|
3171
3171
|
"div",
|
|
3172
3172
|
{
|
|
3173
3173
|
className: "flex w-[var(--slideWidth)] touch-none flex-col",
|
|
3174
|
-
style:
|
|
3174
|
+
style: createVar10({ slideWidth: width }),
|
|
3175
3175
|
...groupProps
|
|
3176
3176
|
},
|
|
3177
|
-
/* @__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(
|
|
3178
3178
|
"output",
|
|
3179
3179
|
{
|
|
3180
3180
|
className: cn35(
|
|
@@ -3185,7 +3185,7 @@ var Slider = forwardRef14(
|
|
|
3185
3185
|
},
|
|
3186
3186
|
state.getThumbValueLabel(0)
|
|
3187
3187
|
)),
|
|
3188
|
-
/* @__PURE__ */
|
|
3188
|
+
/* @__PURE__ */ React.createElement(
|
|
3189
3189
|
"div",
|
|
3190
3190
|
{
|
|
3191
3191
|
className: "h-8 w-full cursor-pointer data-[disabled]:cursor-not-allowed",
|
|
@@ -3193,7 +3193,7 @@ var Slider = forwardRef14(
|
|
|
3193
3193
|
...sliderState,
|
|
3194
3194
|
ref: trackRef
|
|
3195
3195
|
},
|
|
3196
|
-
/* @__PURE__ */
|
|
3196
|
+
/* @__PURE__ */ React.createElement(
|
|
3197
3197
|
"div",
|
|
3198
3198
|
{
|
|
3199
3199
|
className: cn35(
|
|
@@ -3202,7 +3202,7 @@ var Slider = forwardRef14(
|
|
|
3202
3202
|
)
|
|
3203
3203
|
}
|
|
3204
3204
|
),
|
|
3205
|
-
/* @__PURE__ */
|
|
3205
|
+
/* @__PURE__ */ React.createElement(
|
|
3206
3206
|
Thumb,
|
|
3207
3207
|
{
|
|
3208
3208
|
state,
|
|
@@ -3217,15 +3217,13 @@ var Slider = forwardRef14(
|
|
|
3217
3217
|
);
|
|
3218
3218
|
|
|
3219
3219
|
// src/Split/Split.tsx
|
|
3220
|
-
|
|
3221
|
-
var Split = (props) => /* @__PURE__ */ React68.createElement("div", { ...props, role: "separator", className: "grow" });
|
|
3220
|
+
var Split = (props) => /* @__PURE__ */ React.createElement("div", { ...props, role: "separator", className: "grow" });
|
|
3222
3221
|
|
|
3223
3222
|
// src/Stack/Stack.tsx
|
|
3224
|
-
import React69 from "react";
|
|
3225
3223
|
import {
|
|
3224
|
+
alignment as alignment3,
|
|
3226
3225
|
cn as cn36,
|
|
3227
|
-
gapSpace as gapSpace6
|
|
3228
|
-
alignment as alignment3
|
|
3226
|
+
gapSpace as gapSpace6
|
|
3229
3227
|
} from "@marigold/system";
|
|
3230
3228
|
var Stack = ({
|
|
3231
3229
|
children,
|
|
@@ -3237,7 +3235,7 @@ var Stack = ({
|
|
|
3237
3235
|
...props
|
|
3238
3236
|
}) => {
|
|
3239
3237
|
var _a, _b, _c, _d;
|
|
3240
|
-
return /* @__PURE__ */
|
|
3238
|
+
return /* @__PURE__ */ React.createElement(
|
|
3241
3239
|
"div",
|
|
3242
3240
|
{
|
|
3243
3241
|
className: cn36(
|
|
@@ -3254,12 +3252,12 @@ var Stack = ({
|
|
|
3254
3252
|
};
|
|
3255
3253
|
|
|
3256
3254
|
// src/Switch/Switch.tsx
|
|
3257
|
-
import
|
|
3255
|
+
import { forwardRef as forwardRef15 } from "react";
|
|
3258
3256
|
import { useFocusRing as useFocusRing12 } from "@react-aria/focus";
|
|
3259
3257
|
import { useSwitch } from "@react-aria/switch";
|
|
3260
3258
|
import { useObjectRef as useObjectRef12 } from "@react-aria/utils";
|
|
3261
3259
|
import { useToggleState as useToggleState2 } from "@react-stately/toggle";
|
|
3262
|
-
import { cn as cn37, createVar as
|
|
3260
|
+
import { cn as cn37, createVar as createVar11, useClassNames as useClassNames34, useStateProps as useStateProps20 } from "@marigold/system";
|
|
3263
3261
|
var Switch = forwardRef15(
|
|
3264
3262
|
({
|
|
3265
3263
|
variant,
|
|
@@ -3288,8 +3286,8 @@ var Switch = forwardRef15(
|
|
|
3288
3286
|
readOnly,
|
|
3289
3287
|
focus: isFocusVisible
|
|
3290
3288
|
});
|
|
3291
|
-
const classNames2 =
|
|
3292
|
-
return /* @__PURE__ */
|
|
3289
|
+
const classNames2 = useClassNames34({ component: "Switch", size, variant });
|
|
3290
|
+
return /* @__PURE__ */ React.createElement(
|
|
3293
3291
|
"label",
|
|
3294
3292
|
{
|
|
3295
3293
|
className: cn37(
|
|
@@ -3297,10 +3295,10 @@ var Switch = forwardRef15(
|
|
|
3297
3295
|
"w-[var(--switchWidth)]",
|
|
3298
3296
|
"relative flex items-center justify-between gap-[1ch]"
|
|
3299
3297
|
),
|
|
3300
|
-
style:
|
|
3298
|
+
style: createVar11({ switchWidth: width }),
|
|
3301
3299
|
...stateProps
|
|
3302
3300
|
},
|
|
3303
|
-
/* @__PURE__ */
|
|
3301
|
+
/* @__PURE__ */ React.createElement(
|
|
3304
3302
|
"input",
|
|
3305
3303
|
{
|
|
3306
3304
|
ref: inputRef,
|
|
@@ -3309,8 +3307,8 @@ var Switch = forwardRef15(
|
|
|
3309
3307
|
...focusProps
|
|
3310
3308
|
}
|
|
3311
3309
|
),
|
|
3312
|
-
props.children && /* @__PURE__ */
|
|
3313
|
-
/* @__PURE__ */
|
|
3310
|
+
props.children && /* @__PURE__ */ React.createElement(React.Fragment, null, props.children),
|
|
3311
|
+
/* @__PURE__ */ React.createElement(
|
|
3314
3312
|
"div",
|
|
3315
3313
|
{
|
|
3316
3314
|
className: cn37(
|
|
@@ -3318,7 +3316,7 @@ var Switch = forwardRef15(
|
|
|
3318
3316
|
classNames2.track
|
|
3319
3317
|
)
|
|
3320
3318
|
},
|
|
3321
|
-
/* @__PURE__ */
|
|
3319
|
+
/* @__PURE__ */ React.createElement(
|
|
3322
3320
|
"div",
|
|
3323
3321
|
{
|
|
3324
3322
|
className: cn37(
|
|
@@ -3337,17 +3335,17 @@ var Switch = forwardRef15(
|
|
|
3337
3335
|
);
|
|
3338
3336
|
|
|
3339
3337
|
// src/Table/Table.tsx
|
|
3340
|
-
import
|
|
3338
|
+
import { useRef as useRef27 } from "react";
|
|
3341
3339
|
import { useTable } from "@react-aria/table";
|
|
3342
3340
|
import {
|
|
3341
|
+
TableBody as Body2,
|
|
3343
3342
|
Cell,
|
|
3344
3343
|
Column,
|
|
3345
|
-
Row,
|
|
3346
|
-
TableBody as Body2,
|
|
3347
3344
|
TableHeader as Header2,
|
|
3345
|
+
Row,
|
|
3348
3346
|
useTableState
|
|
3349
3347
|
} from "@react-stately/table";
|
|
3350
|
-
import { cn as cn42, useClassNames as
|
|
3348
|
+
import { cn as cn42, useClassNames as useClassNames36 } from "@marigold/system";
|
|
3351
3349
|
|
|
3352
3350
|
// src/Table/Context.tsx
|
|
3353
3351
|
import { createContext as createContext8, useContext as useContext8 } from "react";
|
|
@@ -3355,21 +3353,20 @@ var TableContext = createContext8({});
|
|
|
3355
3353
|
var useTableContext = () => useContext8(TableContext);
|
|
3356
3354
|
|
|
3357
3355
|
// src/Table/TableBody.tsx
|
|
3358
|
-
import React71 from "react";
|
|
3359
3356
|
import { useTableRowGroup } from "@react-aria/table";
|
|
3360
3357
|
var TableBody = ({ children }) => {
|
|
3361
3358
|
const { rowGroupProps } = useTableRowGroup();
|
|
3362
|
-
return /* @__PURE__ */
|
|
3359
|
+
return /* @__PURE__ */ React.createElement("tbody", { ...rowGroupProps }, children);
|
|
3363
3360
|
};
|
|
3364
3361
|
|
|
3365
3362
|
// src/Table/TableCell.tsx
|
|
3366
|
-
import
|
|
3367
|
-
import { useTableCell } from "@react-aria/table";
|
|
3363
|
+
import { useRef as useRef21 } from "react";
|
|
3368
3364
|
import { useFocusRing as useFocusRing13 } from "@react-aria/focus";
|
|
3365
|
+
import { useTableCell } from "@react-aria/table";
|
|
3369
3366
|
import { mergeProps as mergeProps17 } from "@react-aria/utils";
|
|
3370
3367
|
import { useStateProps as useStateProps21 } from "@marigold/system";
|
|
3371
3368
|
var TableCell = ({ cell }) => {
|
|
3372
|
-
const ref =
|
|
3369
|
+
const ref = useRef21(null);
|
|
3373
3370
|
const { interactive, state, classNames: classNames2 } = useTableContext();
|
|
3374
3371
|
const disabled = state.disabledKeys.has(cell.parentKey);
|
|
3375
3372
|
const { gridCellProps } = useTableCell(
|
|
@@ -3390,7 +3387,7 @@ var TableCell = ({ cell }) => {
|
|
|
3390
3387
|
};
|
|
3391
3388
|
const { focusProps, isFocusVisible } = useFocusRing13();
|
|
3392
3389
|
const stateProps = useStateProps21({ disabled, focusVisible: isFocusVisible });
|
|
3393
|
-
return /* @__PURE__ */
|
|
3390
|
+
return /* @__PURE__ */ React.createElement(
|
|
3394
3391
|
"td",
|
|
3395
3392
|
{
|
|
3396
3393
|
ref,
|
|
@@ -3403,9 +3400,9 @@ var TableCell = ({ cell }) => {
|
|
|
3403
3400
|
};
|
|
3404
3401
|
|
|
3405
3402
|
// src/Table/TableCheckboxCell.tsx
|
|
3406
|
-
import
|
|
3407
|
-
import { useTableCell as useTableCell2, useTableSelectionCheckbox } from "@react-aria/table";
|
|
3403
|
+
import { useRef as useRef22 } from "react";
|
|
3408
3404
|
import { useFocusRing as useFocusRing14 } from "@react-aria/focus";
|
|
3405
|
+
import { useTableCell as useTableCell2, useTableSelectionCheckbox } from "@react-aria/table";
|
|
3409
3406
|
import { mergeProps as mergeProps18 } from "@react-aria/utils";
|
|
3410
3407
|
import { cn as cn38, useStateProps as useStateProps22 } from "@marigold/system";
|
|
3411
3408
|
|
|
@@ -3431,7 +3428,7 @@ var mapCheckboxProps = ({
|
|
|
3431
3428
|
|
|
3432
3429
|
// src/Table/TableCheckboxCell.tsx
|
|
3433
3430
|
var TableCheckboxCell = ({ cell }) => {
|
|
3434
|
-
const ref =
|
|
3431
|
+
const ref = useRef22(null);
|
|
3435
3432
|
const { state, classNames: classNames2 } = useTableContext();
|
|
3436
3433
|
const disabled = state.disabledKeys.has(cell.parentKey);
|
|
3437
3434
|
const { gridCellProps } = useTableCell2(
|
|
@@ -3446,7 +3443,7 @@ var TableCheckboxCell = ({ cell }) => {
|
|
|
3446
3443
|
);
|
|
3447
3444
|
const { focusProps, isFocusVisible } = useFocusRing14();
|
|
3448
3445
|
const stateProps = useStateProps22({ disabled, focusVisible: isFocusVisible });
|
|
3449
|
-
return /* @__PURE__ */
|
|
3446
|
+
return /* @__PURE__ */ React.createElement(
|
|
3450
3447
|
"td",
|
|
3451
3448
|
{
|
|
3452
3449
|
ref,
|
|
@@ -3454,37 +3451,25 @@ var TableCheckboxCell = ({ cell }) => {
|
|
|
3454
3451
|
...mergeProps18(gridCellProps, focusProps),
|
|
3455
3452
|
...stateProps
|
|
3456
3453
|
},
|
|
3457
|
-
/* @__PURE__ */
|
|
3454
|
+
/* @__PURE__ */ React.createElement(Checkbox, { ...checkboxProps })
|
|
3458
3455
|
);
|
|
3459
3456
|
};
|
|
3460
3457
|
|
|
3461
3458
|
// src/Table/TableColumnHeader.tsx
|
|
3462
|
-
import
|
|
3459
|
+
import { useRef as useRef23 } from "react";
|
|
3463
3460
|
import { useFocusRing as useFocusRing15 } from "@react-aria/focus";
|
|
3464
3461
|
import { useHover as useHover9 } from "@react-aria/interactions";
|
|
3465
3462
|
import { useTableColumnHeader } from "@react-aria/table";
|
|
3466
3463
|
import { mergeProps as mergeProps19 } from "@react-aria/utils";
|
|
3464
|
+
import { SortDown, SortUp } from "@marigold/icons";
|
|
3467
3465
|
import { cn as cn39, useStateProps as useStateProps23 } from "@marigold/system";
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3466
|
+
import { width as twWidth2 } from "@marigold/system";
|
|
3467
|
+
var TableColumnHeader = ({
|
|
3468
|
+
column,
|
|
3469
|
+
width = "auto"
|
|
3471
3470
|
}) => {
|
|
3472
|
-
return /* @__PURE__ */ React74.createElement(
|
|
3473
|
-
"span",
|
|
3474
|
-
{
|
|
3475
|
-
role: "presentation",
|
|
3476
|
-
"aria-hidden": "true",
|
|
3477
|
-
className: cn39(
|
|
3478
|
-
"ps-[0.5ch] text-current",
|
|
3479
|
-
visible ? "visible" : "invisible"
|
|
3480
|
-
)
|
|
3481
|
-
},
|
|
3482
|
-
direction === "ascending" ? "\u25B2" : "\u25BC"
|
|
3483
|
-
);
|
|
3484
|
-
};
|
|
3485
|
-
var TableColumnHeader = ({ column }) => {
|
|
3486
3471
|
var _a, _b;
|
|
3487
|
-
const ref =
|
|
3472
|
+
const ref = useRef23(null);
|
|
3488
3473
|
const { state, classNames: classNames2 } = useTableContext();
|
|
3489
3474
|
const { columnHeaderProps } = useTableColumnHeader(
|
|
3490
3475
|
{
|
|
@@ -3499,56 +3484,49 @@ var TableColumnHeader = ({ column }) => {
|
|
|
3499
3484
|
hover: isHovered,
|
|
3500
3485
|
focusVisible: isFocusVisible
|
|
3501
3486
|
});
|
|
3502
|
-
return /* @__PURE__ */
|
|
3487
|
+
return /* @__PURE__ */ React.createElement(
|
|
3503
3488
|
"th",
|
|
3504
3489
|
{
|
|
3505
3490
|
colSpan: column.colspan,
|
|
3506
3491
|
ref,
|
|
3507
|
-
className: cn39("cursor-default", classNames2 == null ? void 0 : classNames2.header),
|
|
3492
|
+
className: cn39("cursor-default", twWidth2[width], classNames2 == null ? void 0 : classNames2.header),
|
|
3508
3493
|
...mergeProps19(columnHeaderProps, hoverProps, focusProps),
|
|
3509
3494
|
...stateProps
|
|
3510
3495
|
},
|
|
3511
3496
|
column.rendered,
|
|
3512
|
-
column.props.allowsSorting && /* @__PURE__ */
|
|
3513
|
-
SortIndicator,
|
|
3514
|
-
{
|
|
3515
|
-
direction: (_a = state.sortDescriptor) == null ? void 0 : _a.direction,
|
|
3516
|
-
visible: ((_b = state.sortDescriptor) == null ? void 0 : _b.column) === column.key
|
|
3517
|
-
}
|
|
3518
|
-
)
|
|
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" }))
|
|
3519
3498
|
);
|
|
3520
3499
|
};
|
|
3521
3500
|
|
|
3522
3501
|
// src/Table/TableHeader.tsx
|
|
3523
|
-
import React75 from "react";
|
|
3524
3502
|
import { useTableRowGroup as useTableRowGroup2 } from "@react-aria/table";
|
|
3525
3503
|
var TableHeader = ({ children }) => {
|
|
3526
3504
|
const { rowGroupProps } = useTableRowGroup2();
|
|
3527
|
-
return /* @__PURE__ */
|
|
3505
|
+
return /* @__PURE__ */ React.createElement("thead", { ...rowGroupProps }, children);
|
|
3528
3506
|
};
|
|
3529
3507
|
|
|
3530
3508
|
// src/Table/TableHeaderRow.tsx
|
|
3531
|
-
import
|
|
3509
|
+
import { useRef as useRef24 } from "react";
|
|
3532
3510
|
import { useTableHeaderRow } from "@react-aria/table";
|
|
3533
3511
|
var TableHeaderRow = ({ item, children }) => {
|
|
3534
3512
|
const { state } = useTableContext();
|
|
3535
|
-
const ref =
|
|
3513
|
+
const ref = useRef24(null);
|
|
3536
3514
|
const { rowProps } = useTableHeaderRow({ node: item }, state, ref);
|
|
3537
|
-
return /* @__PURE__ */
|
|
3515
|
+
return /* @__PURE__ */ React.createElement("tr", { ...rowProps, ref }, children);
|
|
3538
3516
|
};
|
|
3539
3517
|
|
|
3540
3518
|
// src/Table/TableRow.tsx
|
|
3541
|
-
import
|
|
3519
|
+
import { useRef as useRef25 } from "react";
|
|
3542
3520
|
import { useFocusRing as useFocusRing16 } from "@react-aria/focus";
|
|
3543
3521
|
import { useHover as useHover10 } from "@react-aria/interactions";
|
|
3544
3522
|
import { useTableRow } from "@react-aria/table";
|
|
3545
3523
|
import { mergeProps as mergeProps20 } from "@react-aria/utils";
|
|
3546
|
-
import { cn as cn40, useClassNames as
|
|
3524
|
+
import { cn as cn40, useClassNames as useClassNames35, useStateProps as useStateProps24 } from "@marigold/system";
|
|
3547
3525
|
var TableRow = ({ children, row }) => {
|
|
3548
|
-
const ref =
|
|
3526
|
+
const ref = useRef25(null);
|
|
3549
3527
|
const { interactive, state, ...ctx } = useTableContext();
|
|
3550
3528
|
const { variant, size } = row.props;
|
|
3551
|
-
const classNames2 =
|
|
3529
|
+
const classNames2 = useClassNames35({
|
|
3552
3530
|
component: "Table",
|
|
3553
3531
|
variant: variant || ctx.variant,
|
|
3554
3532
|
size: size || ctx.size
|
|
@@ -3573,7 +3551,7 @@ var TableRow = ({ children, row }) => {
|
|
|
3573
3551
|
focusVisible: isFocusVisible,
|
|
3574
3552
|
active: isPressed
|
|
3575
3553
|
});
|
|
3576
|
-
return /* @__PURE__ */
|
|
3554
|
+
return /* @__PURE__ */ React.createElement(
|
|
3577
3555
|
"tr",
|
|
3578
3556
|
{
|
|
3579
3557
|
ref,
|
|
@@ -3591,7 +3569,7 @@ var TableRow = ({ children, row }) => {
|
|
|
3591
3569
|
};
|
|
3592
3570
|
|
|
3593
3571
|
// src/Table/TableSelectAllCell.tsx
|
|
3594
|
-
import
|
|
3572
|
+
import { useRef as useRef26 } from "react";
|
|
3595
3573
|
import { useFocusRing as useFocusRing17 } from "@react-aria/focus";
|
|
3596
3574
|
import { useHover as useHover11 } from "@react-aria/interactions";
|
|
3597
3575
|
import {
|
|
@@ -3599,9 +3577,16 @@ import {
|
|
|
3599
3577
|
useTableSelectAllCheckbox
|
|
3600
3578
|
} from "@react-aria/table";
|
|
3601
3579
|
import { mergeProps as mergeProps21 } from "@react-aria/utils";
|
|
3602
|
-
import {
|
|
3603
|
-
|
|
3604
|
-
|
|
3580
|
+
import {
|
|
3581
|
+
cn as cn41,
|
|
3582
|
+
width as twWidth3,
|
|
3583
|
+
useStateProps as useStateProps25
|
|
3584
|
+
} from "@marigold/system";
|
|
3585
|
+
var TableSelectAllCell = ({
|
|
3586
|
+
column,
|
|
3587
|
+
width = "auto"
|
|
3588
|
+
}) => {
|
|
3589
|
+
const ref = useRef26(null);
|
|
3605
3590
|
const { state, classNames: classNames2 } = useTableContext();
|
|
3606
3591
|
const { columnHeaderProps } = useTableColumnHeader2(
|
|
3607
3592
|
{
|
|
@@ -3617,18 +3602,19 @@ var TableSelectAllCell = ({ column }) => {
|
|
|
3617
3602
|
hover: isHovered,
|
|
3618
3603
|
focusVisible: isFocusVisible
|
|
3619
3604
|
});
|
|
3620
|
-
return /* @__PURE__ */
|
|
3605
|
+
return /* @__PURE__ */ React.createElement(
|
|
3621
3606
|
"th",
|
|
3622
3607
|
{
|
|
3623
3608
|
ref,
|
|
3624
3609
|
className: cn41(
|
|
3610
|
+
twWidth3[width],
|
|
3625
3611
|
["text-center align-middle leading-none"],
|
|
3626
3612
|
classNames2 == null ? void 0 : classNames2.header
|
|
3627
3613
|
),
|
|
3628
3614
|
...mergeProps21(columnHeaderProps, hoverProps, focusProps),
|
|
3629
3615
|
...stateProps
|
|
3630
3616
|
},
|
|
3631
|
-
/* @__PURE__ */
|
|
3617
|
+
/* @__PURE__ */ React.createElement(Checkbox, { ...checkboxProps })
|
|
3632
3618
|
);
|
|
3633
3619
|
};
|
|
3634
3620
|
|
|
@@ -3641,7 +3627,7 @@ var Table = ({
|
|
|
3641
3627
|
...props
|
|
3642
3628
|
}) => {
|
|
3643
3629
|
const interactive = selectionMode !== "none";
|
|
3644
|
-
const tableRef =
|
|
3630
|
+
const tableRef = useRef27(null);
|
|
3645
3631
|
const state = useTableState({
|
|
3646
3632
|
...props,
|
|
3647
3633
|
selectionMode,
|
|
@@ -3649,39 +3635,54 @@ var Table = ({
|
|
|
3649
3635
|
props.selectionBehavior !== "replace"
|
|
3650
3636
|
});
|
|
3651
3637
|
const { gridProps } = useTable(props, state, tableRef);
|
|
3652
|
-
const classNames2 =
|
|
3638
|
+
const classNames2 = useClassNames36({
|
|
3653
3639
|
component: "Table",
|
|
3654
3640
|
variant,
|
|
3655
3641
|
size
|
|
3656
3642
|
});
|
|
3657
3643
|
const { collection } = state;
|
|
3658
|
-
return /* @__PURE__ */
|
|
3644
|
+
return /* @__PURE__ */ React.createElement(
|
|
3659
3645
|
TableContext.Provider,
|
|
3660
3646
|
{
|
|
3661
3647
|
value: { state, interactive, classNames: classNames2, variant, size }
|
|
3662
3648
|
},
|
|
3663
|
-
/* @__PURE__ */
|
|
3649
|
+
/* @__PURE__ */ React.createElement(
|
|
3664
3650
|
"table",
|
|
3665
3651
|
{
|
|
3666
3652
|
ref: tableRef,
|
|
3667
3653
|
className: cn42(
|
|
3654
|
+
"group/table",
|
|
3668
3655
|
"border-collapse overflow-auto whitespace-nowrap",
|
|
3669
3656
|
stretch ? "table w-full" : "block",
|
|
3670
3657
|
classNames2.table
|
|
3671
3658
|
),
|
|
3672
3659
|
...gridProps
|
|
3673
3660
|
},
|
|
3674
|
-
/* @__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(
|
|
3675
3662
|
(column) => {
|
|
3676
|
-
var _a;
|
|
3677
|
-
return ((_a = column.props) == null ? void 0 : _a.isSelectionCell) ? /* @__PURE__ */
|
|
3663
|
+
var _a, _b, _c;
|
|
3664
|
+
return ((_a = column.props) == null ? void 0 : _a.isSelectionCell) ? /* @__PURE__ */ React.createElement(
|
|
3665
|
+
TableSelectAllCell,
|
|
3666
|
+
{
|
|
3667
|
+
width: (_b = column.props) == null ? void 0 : _b.width,
|
|
3668
|
+
key: column.key,
|
|
3669
|
+
column
|
|
3670
|
+
}
|
|
3671
|
+
) : /* @__PURE__ */ React.createElement(
|
|
3672
|
+
TableColumnHeader,
|
|
3673
|
+
{
|
|
3674
|
+
width: (_c = column.props) == null ? void 0 : _c.width,
|
|
3675
|
+
key: column.key,
|
|
3676
|
+
column
|
|
3677
|
+
}
|
|
3678
|
+
);
|
|
3678
3679
|
}
|
|
3679
3680
|
)))),
|
|
3680
|
-
/* @__PURE__ */
|
|
3681
|
-
(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(
|
|
3682
3683
|
(cell) => {
|
|
3683
3684
|
var _a;
|
|
3684
|
-
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 });
|
|
3685
3686
|
}
|
|
3686
3687
|
))
|
|
3687
3688
|
))
|
|
@@ -3695,18 +3696,17 @@ Table.Header = Header2;
|
|
|
3695
3696
|
Table.Row = Row;
|
|
3696
3697
|
|
|
3697
3698
|
// src/Text/Text.tsx
|
|
3698
|
-
import React80 from "react";
|
|
3699
3699
|
import {
|
|
3700
3700
|
cn as cn43,
|
|
3701
|
-
createVar as
|
|
3701
|
+
createVar as createVar12,
|
|
3702
3702
|
cursorStyle,
|
|
3703
3703
|
fontWeight,
|
|
3704
3704
|
get as get2,
|
|
3705
3705
|
textAlign as textAlign2,
|
|
3706
|
-
useClassNames as useClassNames36,
|
|
3707
|
-
useTheme as useTheme5,
|
|
3708
3706
|
textSize,
|
|
3709
|
-
textStyle
|
|
3707
|
+
textStyle,
|
|
3708
|
+
useClassNames as useClassNames37,
|
|
3709
|
+
useTheme as useTheme5
|
|
3710
3710
|
} from "@marigold/system";
|
|
3711
3711
|
var Text = ({
|
|
3712
3712
|
variant,
|
|
@@ -3721,12 +3721,12 @@ var Text = ({
|
|
|
3721
3721
|
...props
|
|
3722
3722
|
}) => {
|
|
3723
3723
|
const theme = useTheme5();
|
|
3724
|
-
const classNames2 =
|
|
3724
|
+
const classNames2 = useClassNames37({
|
|
3725
3725
|
component: "Text",
|
|
3726
3726
|
variant,
|
|
3727
3727
|
size
|
|
3728
3728
|
});
|
|
3729
|
-
return /* @__PURE__ */
|
|
3729
|
+
return /* @__PURE__ */ React.createElement(
|
|
3730
3730
|
"p",
|
|
3731
3731
|
{
|
|
3732
3732
|
...props,
|
|
@@ -3739,7 +3739,7 @@ var Text = ({
|
|
|
3739
3739
|
weight && fontWeight[weight],
|
|
3740
3740
|
fontSize && textSize[fontSize]
|
|
3741
3741
|
),
|
|
3742
|
-
style:
|
|
3742
|
+
style: createVar12({
|
|
3743
3743
|
color: color && theme.colors && get2(
|
|
3744
3744
|
theme.colors,
|
|
3745
3745
|
color.replace("-", "."),
|
|
@@ -3753,12 +3753,12 @@ var Text = ({
|
|
|
3753
3753
|
};
|
|
3754
3754
|
|
|
3755
3755
|
// src/TextArea/TextArea.tsx
|
|
3756
|
-
import
|
|
3757
|
-
import { useHover as useHover12 } from "@react-aria/interactions";
|
|
3756
|
+
import { forwardRef as forwardRef16 } from "react";
|
|
3758
3757
|
import { useFocusRing as useFocusRing18 } from "@react-aria/focus";
|
|
3758
|
+
import { useHover as useHover12 } from "@react-aria/interactions";
|
|
3759
3759
|
import { useTextField } from "@react-aria/textfield";
|
|
3760
3760
|
import { useObjectRef as useObjectRef13 } from "@react-aria/utils";
|
|
3761
|
-
import { useClassNames as
|
|
3761
|
+
import { useClassNames as useClassNames38, useStateProps as useStateProps26 } from "@marigold/system";
|
|
3762
3762
|
var TextArea = forwardRef16(
|
|
3763
3763
|
({
|
|
3764
3764
|
variant,
|
|
@@ -3794,8 +3794,8 @@ var TextArea = forwardRef16(
|
|
|
3794
3794
|
required,
|
|
3795
3795
|
error
|
|
3796
3796
|
});
|
|
3797
|
-
const classNames2 =
|
|
3798
|
-
return /* @__PURE__ */
|
|
3797
|
+
const classNames2 = useClassNames38({ component: "TextArea", variant, size });
|
|
3798
|
+
return /* @__PURE__ */ React.createElement(
|
|
3799
3799
|
FieldBase,
|
|
3800
3800
|
{
|
|
3801
3801
|
label,
|
|
@@ -3810,7 +3810,7 @@ var TextArea = forwardRef16(
|
|
|
3810
3810
|
size,
|
|
3811
3811
|
width
|
|
3812
3812
|
},
|
|
3813
|
-
/* @__PURE__ */
|
|
3813
|
+
/* @__PURE__ */ React.createElement(
|
|
3814
3814
|
"textarea",
|
|
3815
3815
|
{
|
|
3816
3816
|
className: classNames2,
|
|
@@ -3826,9 +3826,9 @@ var TextArea = forwardRef16(
|
|
|
3826
3826
|
);
|
|
3827
3827
|
|
|
3828
3828
|
// src/TextField/TextField.tsx
|
|
3829
|
-
import
|
|
3830
|
-
import { useHover as useHover13 } from "@react-aria/interactions";
|
|
3829
|
+
import { forwardRef as forwardRef17 } from "react";
|
|
3831
3830
|
import { useFocusRing as useFocusRing19 } from "@react-aria/focus";
|
|
3831
|
+
import { useHover as useHover13 } from "@react-aria/interactions";
|
|
3832
3832
|
import { useTextField as useTextField2 } from "@react-aria/textfield";
|
|
3833
3833
|
import { mergeProps as mergeProps22, useObjectRef as useObjectRef14 } from "@react-aria/utils";
|
|
3834
3834
|
import { useStateProps as useStateProps27 } from "@marigold/system";
|
|
@@ -3859,7 +3859,7 @@ var TextField = forwardRef17(
|
|
|
3859
3859
|
readOnly,
|
|
3860
3860
|
required
|
|
3861
3861
|
});
|
|
3862
|
-
return /* @__PURE__ */
|
|
3862
|
+
return /* @__PURE__ */ React.createElement(
|
|
3863
3863
|
FieldBase,
|
|
3864
3864
|
{
|
|
3865
3865
|
label,
|
|
@@ -3874,7 +3874,7 @@ var TextField = forwardRef17(
|
|
|
3874
3874
|
size,
|
|
3875
3875
|
width
|
|
3876
3876
|
},
|
|
3877
|
-
/* @__PURE__ */
|
|
3877
|
+
/* @__PURE__ */ React.createElement(
|
|
3878
3878
|
Input,
|
|
3879
3879
|
{
|
|
3880
3880
|
ref: inputRef,
|
|
@@ -3888,8 +3888,7 @@ var TextField = forwardRef17(
|
|
|
3888
3888
|
);
|
|
3889
3889
|
|
|
3890
3890
|
// src/Tiles/Tiles.tsx
|
|
3891
|
-
import
|
|
3892
|
-
import { gapSpace as gapSpace7, cn as cn44, createVar as createVar12 } from "@marigold/system";
|
|
3891
|
+
import { cn as cn44, createVar as createVar13, gapSpace as gapSpace7 } from "@marigold/system";
|
|
3893
3892
|
var Tiles = ({
|
|
3894
3893
|
space = 0,
|
|
3895
3894
|
stretch = false,
|
|
@@ -3902,7 +3901,7 @@ var Tiles = ({
|
|
|
3902
3901
|
if (stretch) {
|
|
3903
3902
|
column = `minmax(${column}, 1fr)`;
|
|
3904
3903
|
}
|
|
3905
|
-
return /* @__PURE__ */
|
|
3904
|
+
return /* @__PURE__ */ React.createElement(
|
|
3906
3905
|
"div",
|
|
3907
3906
|
{
|
|
3908
3907
|
...props,
|
|
@@ -3912,16 +3911,15 @@ var Tiles = ({
|
|
|
3912
3911
|
"grid-cols-[repeat(auto-fit,var(--column))]",
|
|
3913
3912
|
equalHeight && "auto-rows-[1fr]"
|
|
3914
3913
|
),
|
|
3915
|
-
style:
|
|
3914
|
+
style: createVar13({ column, tilesWidth })
|
|
3916
3915
|
},
|
|
3917
3916
|
children
|
|
3918
3917
|
);
|
|
3919
3918
|
};
|
|
3920
3919
|
|
|
3921
3920
|
// src/Tooltip/Tooltip.tsx
|
|
3922
|
-
import React85 from "react";
|
|
3923
3921
|
import { useTooltip } from "@react-aria/tooltip";
|
|
3924
|
-
import { cn as cn45, useClassNames as
|
|
3922
|
+
import { cn as cn45, useClassNames as useClassNames39 } from "@marigold/system";
|
|
3925
3923
|
|
|
3926
3924
|
// src/Tooltip/Context.ts
|
|
3927
3925
|
import { createContext as createContext9, useContext as useContext9 } from "react";
|
|
@@ -3929,7 +3927,7 @@ var TooltipContext = createContext9({});
|
|
|
3929
3927
|
var useTooltipContext = () => useContext9(TooltipContext);
|
|
3930
3928
|
|
|
3931
3929
|
// src/Tooltip/TooltipTrigger.tsx
|
|
3932
|
-
import
|
|
3930
|
+
import { Children as Children7, useRef as useRef28 } from "react";
|
|
3933
3931
|
import { FocusableProvider } from "@react-aria/focus";
|
|
3934
3932
|
import { useOverlayPosition } from "@react-aria/overlays";
|
|
3935
3933
|
import { useTooltipTrigger } from "@react-aria/tooltip";
|
|
@@ -3942,7 +3940,7 @@ var TooltipTrigger = ({
|
|
|
3942
3940
|
children,
|
|
3943
3941
|
...rest
|
|
3944
3942
|
}) => {
|
|
3945
|
-
const [tooltipTrigger, tooltip] =
|
|
3943
|
+
const [tooltipTrigger, tooltip] = Children7.toArray(children);
|
|
3946
3944
|
const props = {
|
|
3947
3945
|
...rest,
|
|
3948
3946
|
isDisabled: disabled,
|
|
@@ -3950,8 +3948,8 @@ var TooltipTrigger = ({
|
|
|
3950
3948
|
delay,
|
|
3951
3949
|
placement
|
|
3952
3950
|
};
|
|
3953
|
-
const tooltipTriggerRef =
|
|
3954
|
-
const overlayRef =
|
|
3951
|
+
const tooltipTriggerRef = useRef28(null);
|
|
3952
|
+
const overlayRef = useRef28(null);
|
|
3955
3953
|
const state = useTooltipTriggerState(props);
|
|
3956
3954
|
const { triggerProps, tooltipProps } = useTooltipTrigger(
|
|
3957
3955
|
props,
|
|
@@ -3970,7 +3968,7 @@ var TooltipTrigger = ({
|
|
|
3970
3968
|
isOpen: state.isOpen,
|
|
3971
3969
|
overlayRef
|
|
3972
3970
|
});
|
|
3973
|
-
return /* @__PURE__ */
|
|
3971
|
+
return /* @__PURE__ */ React.createElement(FocusableProvider, { ref: tooltipTriggerRef, ...triggerProps }, tooltipTrigger, /* @__PURE__ */ React.createElement(
|
|
3974
3972
|
TooltipContext.Provider,
|
|
3975
3973
|
{
|
|
3976
3974
|
value: {
|
|
@@ -3982,7 +3980,7 @@ var TooltipTrigger = ({
|
|
|
3982
3980
|
...positionProps
|
|
3983
3981
|
}
|
|
3984
3982
|
},
|
|
3985
|
-
/* @__PURE__ */
|
|
3983
|
+
/* @__PURE__ */ React.createElement(Overlay, { open: state.isOpen }, tooltip)
|
|
3986
3984
|
));
|
|
3987
3985
|
};
|
|
3988
3986
|
|
|
@@ -3990,8 +3988,8 @@ var TooltipTrigger = ({
|
|
|
3990
3988
|
var Tooltip = ({ children, variant, size }) => {
|
|
3991
3989
|
const { arrowProps, state, overlayRef, placement, ...rest } = useTooltipContext();
|
|
3992
3990
|
const { tooltipProps } = useTooltip({}, state);
|
|
3993
|
-
const classNames2 =
|
|
3994
|
-
return /* @__PURE__ */
|
|
3991
|
+
const classNames2 = useClassNames39({ component: "Tooltip", variant, size });
|
|
3992
|
+
return /* @__PURE__ */ React.createElement(
|
|
3995
3993
|
"div",
|
|
3996
3994
|
{
|
|
3997
3995
|
...tooltipProps,
|
|
@@ -4000,8 +3998,8 @@ var Tooltip = ({ children, variant, size }) => {
|
|
|
4000
3998
|
className: cn45("group/tooltip", classNames2.container),
|
|
4001
3999
|
"data-placement": placement
|
|
4002
4000
|
},
|
|
4003
|
-
/* @__PURE__ */
|
|
4004
|
-
/* @__PURE__ */
|
|
4001
|
+
/* @__PURE__ */ React.createElement("div", null, children),
|
|
4002
|
+
/* @__PURE__ */ React.createElement(
|
|
4005
4003
|
"div",
|
|
4006
4004
|
{
|
|
4007
4005
|
...arrowProps,
|
|
@@ -4016,23 +4014,23 @@ Tooltip.Trigger = TooltipTrigger;
|
|
|
4016
4014
|
import { Item as Item6 } from "@react-stately/collections";
|
|
4017
4015
|
|
|
4018
4016
|
// src/TagGroup/TagGroup.tsx
|
|
4019
|
-
import
|
|
4017
|
+
import { useRef as useRef29 } from "react";
|
|
4020
4018
|
import { useTagGroup } from "@react-aria/tag";
|
|
4021
4019
|
import { useListState } from "@react-stately/list";
|
|
4022
4020
|
import { useStateProps as useStateProps28 } from "@marigold/system";
|
|
4023
4021
|
|
|
4024
4022
|
// src/TagGroup/Tag.tsx
|
|
4025
|
-
import
|
|
4026
|
-
import { useTag } from "@react-aria/tag";
|
|
4023
|
+
import React4 from "react";
|
|
4027
4024
|
import { useFocusRing as useFocusRing20 } from "@react-aria/focus";
|
|
4028
|
-
import {
|
|
4025
|
+
import { useTag } from "@react-aria/tag";
|
|
4029
4026
|
import { mergeProps as mergeProps23 } from "@react-aria/utils";
|
|
4027
|
+
import { cn as cn46, useClassNames as useClassNames40 } from "@marigold/system";
|
|
4030
4028
|
var Tag = ({ variant, size, item, state, ...rest }) => {
|
|
4031
4029
|
const props = {
|
|
4032
4030
|
item,
|
|
4033
4031
|
...rest
|
|
4034
4032
|
};
|
|
4035
|
-
let ref =
|
|
4033
|
+
let ref = React4.useRef(null);
|
|
4036
4034
|
let { focusProps } = useFocusRing20({ within: true });
|
|
4037
4035
|
const { rowProps, gridCellProps, allowsRemoving, removeButtonProps } = useTag(
|
|
4038
4036
|
{
|
|
@@ -4042,22 +4040,22 @@ var Tag = ({ variant, size, item, state, ...rest }) => {
|
|
|
4042
4040
|
state,
|
|
4043
4041
|
ref
|
|
4044
4042
|
);
|
|
4045
|
-
const classNames2 =
|
|
4046
|
-
return /* @__PURE__ */
|
|
4043
|
+
const classNames2 = useClassNames40({ component: "Tag", variant, size });
|
|
4044
|
+
return /* @__PURE__ */ React4.createElement(
|
|
4047
4045
|
"span",
|
|
4048
4046
|
{
|
|
4049
4047
|
ref,
|
|
4050
4048
|
...mergeProps23(rowProps, focusProps),
|
|
4051
4049
|
className: classNames2.tag
|
|
4052
4050
|
},
|
|
4053
|
-
/* @__PURE__ */
|
|
4051
|
+
/* @__PURE__ */ React4.createElement("div", { ...gridCellProps, className: classNames2.gridCell }, /* @__PURE__ */ React4.createElement("span", null, item.rendered), allowsRemoving && /* @__PURE__ */ React4.createElement(
|
|
4054
4052
|
Button,
|
|
4055
4053
|
{
|
|
4056
4054
|
...removeButtonProps,
|
|
4057
4055
|
className: cn46("flex items-center", classNames2.closeButton),
|
|
4058
4056
|
role: "button"
|
|
4059
4057
|
},
|
|
4060
|
-
/* @__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" }))
|
|
4061
4059
|
))
|
|
4062
4060
|
);
|
|
4063
4061
|
};
|
|
@@ -4075,14 +4073,14 @@ var TagGroup = ({
|
|
|
4075
4073
|
validationState: error ? "invalid" : "valid",
|
|
4076
4074
|
...rest
|
|
4077
4075
|
};
|
|
4078
|
-
const inputRef =
|
|
4076
|
+
const inputRef = useRef29(null);
|
|
4079
4077
|
const state = useListState(props);
|
|
4080
4078
|
const { gridProps, labelProps, descriptionProps, errorMessageProps } = useTagGroup(props, state, inputRef);
|
|
4081
4079
|
const stateProps = useStateProps28({
|
|
4082
4080
|
error,
|
|
4083
4081
|
required
|
|
4084
4082
|
});
|
|
4085
|
-
return /* @__PURE__ */
|
|
4083
|
+
return /* @__PURE__ */ React.createElement(
|
|
4086
4084
|
FieldBase,
|
|
4087
4085
|
{
|
|
4088
4086
|
width,
|
|
@@ -4096,14 +4094,14 @@ var TagGroup = ({
|
|
|
4096
4094
|
stateProps,
|
|
4097
4095
|
...gridProps
|
|
4098
4096
|
},
|
|
4099
|
-
/* @__PURE__ */
|
|
4097
|
+
/* @__PURE__ */ React.createElement(
|
|
4100
4098
|
"div",
|
|
4101
4099
|
{
|
|
4102
4100
|
role: "presentation",
|
|
4103
4101
|
ref: inputRef,
|
|
4104
4102
|
className: "flex flex-wrap items-start gap-1"
|
|
4105
4103
|
},
|
|
4106
|
-
[...state.collection].map((item) => /* @__PURE__ */
|
|
4104
|
+
[...state.collection].map((item) => /* @__PURE__ */ React.createElement(
|
|
4107
4105
|
Tag,
|
|
4108
4106
|
{
|
|
4109
4107
|
...item.props,
|
|
@@ -4124,9 +4122,9 @@ var Tag2 = Item6;
|
|
|
4124
4122
|
Tag2.Group = TagGroup;
|
|
4125
4123
|
|
|
4126
4124
|
// src/XLoader/XLoader.tsx
|
|
4125
|
+
import { forwardRef as forwardRef18 } from "react";
|
|
4127
4126
|
import { SVG as SVG6 } from "@marigold/system";
|
|
4128
|
-
|
|
4129
|
-
var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ React88.createElement(
|
|
4127
|
+
var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ React.createElement(
|
|
4130
4128
|
SVG6,
|
|
4131
4129
|
{
|
|
4132
4130
|
id: "XLoader",
|
|
@@ -4136,14 +4134,14 @@ var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ React88.createElement
|
|
|
4136
4134
|
...props,
|
|
4137
4135
|
...ref
|
|
4138
4136
|
},
|
|
4139
|
-
/* @__PURE__ */
|
|
4140
|
-
/* @__PURE__ */
|
|
4137
|
+
/* @__PURE__ */ React.createElement("path", { id: "XMLID_1_", d: "M35.3 27h26.5l54 74.1H88.7z" }),
|
|
4138
|
+
/* @__PURE__ */ React.createElement(
|
|
4141
4139
|
"path",
|
|
4142
4140
|
{
|
|
4143
4141
|
id: "XMLID_5_",
|
|
4144
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"
|
|
4145
4143
|
},
|
|
4146
|
-
/* @__PURE__ */
|
|
4144
|
+
/* @__PURE__ */ React.createElement(
|
|
4147
4145
|
"animate",
|
|
4148
4146
|
{
|
|
4149
4147
|
attributeName: "opacity",
|
|
@@ -4155,13 +4153,13 @@ var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ React88.createElement
|
|
|
4155
4153
|
}
|
|
4156
4154
|
)
|
|
4157
4155
|
),
|
|
4158
|
-
/* @__PURE__ */
|
|
4156
|
+
/* @__PURE__ */ React.createElement(
|
|
4159
4157
|
"path",
|
|
4160
4158
|
{
|
|
4161
4159
|
id: "XMLID_18_",
|
|
4162
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"
|
|
4163
4161
|
},
|
|
4164
|
-
/* @__PURE__ */
|
|
4162
|
+
/* @__PURE__ */ React.createElement(
|
|
4165
4163
|
"animate",
|
|
4166
4164
|
{
|
|
4167
4165
|
attributeName: "opacity",
|
|
@@ -4173,13 +4171,13 @@ var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ React88.createElement
|
|
|
4173
4171
|
}
|
|
4174
4172
|
)
|
|
4175
4173
|
),
|
|
4176
|
-
/* @__PURE__ */
|
|
4174
|
+
/* @__PURE__ */ React.createElement(
|
|
4177
4175
|
"path",
|
|
4178
4176
|
{
|
|
4179
4177
|
id: "XMLID_19_",
|
|
4180
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"
|
|
4181
4179
|
},
|
|
4182
|
-
/* @__PURE__ */
|
|
4180
|
+
/* @__PURE__ */ React.createElement(
|
|
4183
4181
|
"animate",
|
|
4184
4182
|
{
|
|
4185
4183
|
attributeName: "opacity",
|
|
@@ -4191,13 +4189,13 @@ var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ React88.createElement
|
|
|
4191
4189
|
}
|
|
4192
4190
|
)
|
|
4193
4191
|
),
|
|
4194
|
-
/* @__PURE__ */
|
|
4192
|
+
/* @__PURE__ */ React.createElement(
|
|
4195
4193
|
"path",
|
|
4196
4194
|
{
|
|
4197
4195
|
id: "XMLID_20_",
|
|
4198
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"
|
|
4199
4197
|
},
|
|
4200
|
-
/* @__PURE__ */
|
|
4198
|
+
/* @__PURE__ */ React.createElement(
|
|
4201
4199
|
"animate",
|
|
4202
4200
|
{
|
|
4203
4201
|
attributeName: "opacity",
|
|
@@ -4209,13 +4207,13 @@ var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ React88.createElement
|
|
|
4209
4207
|
}
|
|
4210
4208
|
)
|
|
4211
4209
|
),
|
|
4212
|
-
/* @__PURE__ */
|
|
4210
|
+
/* @__PURE__ */ React.createElement(
|
|
4213
4211
|
"path",
|
|
4214
4212
|
{
|
|
4215
4213
|
id: "XMLID_21_",
|
|
4216
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"
|
|
4217
4215
|
},
|
|
4218
|
-
/* @__PURE__ */
|
|
4216
|
+
/* @__PURE__ */ React.createElement(
|
|
4219
4217
|
"animate",
|
|
4220
4218
|
{
|
|
4221
4219
|
attributeName: "opacity",
|
|
@@ -4227,13 +4225,13 @@ var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ React88.createElement
|
|
|
4227
4225
|
}
|
|
4228
4226
|
)
|
|
4229
4227
|
),
|
|
4230
|
-
/* @__PURE__ */
|
|
4228
|
+
/* @__PURE__ */ React.createElement(
|
|
4231
4229
|
"path",
|
|
4232
4230
|
{
|
|
4233
4231
|
id: "XMLID_22_",
|
|
4234
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"
|
|
4235
4233
|
},
|
|
4236
|
-
/* @__PURE__ */
|
|
4234
|
+
/* @__PURE__ */ React.createElement(
|
|
4237
4235
|
"animate",
|
|
4238
4236
|
{
|
|
4239
4237
|
attributeName: "opacity",
|
|
@@ -4245,13 +4243,13 @@ var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ React88.createElement
|
|
|
4245
4243
|
}
|
|
4246
4244
|
)
|
|
4247
4245
|
),
|
|
4248
|
-
/* @__PURE__ */
|
|
4246
|
+
/* @__PURE__ */ React.createElement(
|
|
4249
4247
|
"path",
|
|
4250
4248
|
{
|
|
4251
4249
|
id: "XMLID_23_",
|
|
4252
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"
|
|
4253
4251
|
},
|
|
4254
|
-
/* @__PURE__ */
|
|
4252
|
+
/* @__PURE__ */ React.createElement(
|
|
4255
4253
|
"animate",
|
|
4256
4254
|
{
|
|
4257
4255
|
attributeName: "opacity",
|
|
@@ -4263,13 +4261,13 @@ var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ React88.createElement
|
|
|
4263
4261
|
}
|
|
4264
4262
|
)
|
|
4265
4263
|
),
|
|
4266
|
-
/* @__PURE__ */
|
|
4264
|
+
/* @__PURE__ */ React.createElement(
|
|
4267
4265
|
"path",
|
|
4268
4266
|
{
|
|
4269
4267
|
id: "XMLID_24_",
|
|
4270
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"
|
|
4271
4269
|
},
|
|
4272
|
-
/* @__PURE__ */
|
|
4270
|
+
/* @__PURE__ */ React.createElement(
|
|
4273
4271
|
"animate",
|
|
4274
4272
|
{
|
|
4275
4273
|
attributeName: "opacity",
|
|
@@ -4281,13 +4279,13 @@ var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ React88.createElement
|
|
|
4281
4279
|
}
|
|
4282
4280
|
)
|
|
4283
4281
|
),
|
|
4284
|
-
/* @__PURE__ */
|
|
4282
|
+
/* @__PURE__ */ React.createElement(
|
|
4285
4283
|
"path",
|
|
4286
4284
|
{
|
|
4287
4285
|
id: "XMLID_25_",
|
|
4288
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"
|
|
4289
4287
|
},
|
|
4290
|
-
/* @__PURE__ */
|
|
4288
|
+
/* @__PURE__ */ React.createElement(
|
|
4291
4289
|
"animate",
|
|
4292
4290
|
{
|
|
4293
4291
|
attributeName: "opacity",
|
|
@@ -4299,13 +4297,13 @@ var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ React88.createElement
|
|
|
4299
4297
|
}
|
|
4300
4298
|
)
|
|
4301
4299
|
),
|
|
4302
|
-
/* @__PURE__ */
|
|
4300
|
+
/* @__PURE__ */ React.createElement(
|
|
4303
4301
|
"path",
|
|
4304
4302
|
{
|
|
4305
4303
|
id: "XMLID_26_",
|
|
4306
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"
|
|
4307
4305
|
},
|
|
4308
|
-
/* @__PURE__ */
|
|
4306
|
+
/* @__PURE__ */ React.createElement(
|
|
4309
4307
|
"animate",
|
|
4310
4308
|
{
|
|
4311
4309
|
attributeName: "opacity",
|
|
@@ -4317,13 +4315,13 @@ var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ React88.createElement
|
|
|
4317
4315
|
}
|
|
4318
4316
|
)
|
|
4319
4317
|
),
|
|
4320
|
-
/* @__PURE__ */
|
|
4318
|
+
/* @__PURE__ */ React.createElement(
|
|
4321
4319
|
"path",
|
|
4322
4320
|
{
|
|
4323
4321
|
id: "XMLID_27_",
|
|
4324
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"
|
|
4325
4323
|
},
|
|
4326
|
-
/* @__PURE__ */
|
|
4324
|
+
/* @__PURE__ */ React.createElement(
|
|
4327
4325
|
"animate",
|
|
4328
4326
|
{
|
|
4329
4327
|
attributeName: "opacity",
|
|
@@ -4338,19 +4336,11 @@ var XLoader = forwardRef18((props, ref) => /* @__PURE__ */ React88.createElement
|
|
|
4338
4336
|
));
|
|
4339
4337
|
|
|
4340
4338
|
// src/Tabs/Tabs.tsx
|
|
4341
|
-
import
|
|
4339
|
+
import { useRef as useRef32 } from "react";
|
|
4342
4340
|
import { useTabList } from "@react-aria/tabs";
|
|
4343
|
-
import {
|
|
4341
|
+
import { Item as Item7 } from "@react-stately/collections";
|
|
4344
4342
|
import { useTabListState } from "@react-stately/tabs";
|
|
4345
|
-
import {
|
|
4346
|
-
|
|
4347
|
-
// src/Tabs/Tab.tsx
|
|
4348
|
-
import React89 from "react";
|
|
4349
|
-
import { useRef as useRef29 } from "react";
|
|
4350
|
-
import { cn as cn47, useStateProps as useStateProps29 } from "@marigold/system";
|
|
4351
|
-
import { useTab } from "@react-aria/tabs";
|
|
4352
|
-
import { useFocus, useHover as useHover14 } from "@react-aria/interactions";
|
|
4353
|
-
import { mergeProps as mergeProps24 } from "@react-aria/utils";
|
|
4343
|
+
import { cn as cn49, gapSpace as gapSpace8, useClassNames as useClassNames41 } from "@marigold/system";
|
|
4354
4344
|
|
|
4355
4345
|
// src/Tabs/Context.ts
|
|
4356
4346
|
import { createContext as createContext10, useContext as useContext10 } from "react";
|
|
@@ -4358,9 +4348,14 @@ var TabContext = createContext10({});
|
|
|
4358
4348
|
var useTabContext = () => useContext10(TabContext);
|
|
4359
4349
|
|
|
4360
4350
|
// src/Tabs/Tab.tsx
|
|
4351
|
+
import { useRef as useRef30 } from "react";
|
|
4352
|
+
import { useFocus, useHover as useHover14 } from "@react-aria/interactions";
|
|
4353
|
+
import { useTab } from "@react-aria/tabs";
|
|
4354
|
+
import { mergeProps as mergeProps24 } from "@react-aria/utils";
|
|
4355
|
+
import { cn as cn47, useStateProps as useStateProps29 } from "@marigold/system";
|
|
4361
4356
|
var Tab = ({ item, state }) => {
|
|
4362
4357
|
const { key, rendered } = item;
|
|
4363
|
-
const ref =
|
|
4358
|
+
const ref = useRef30(null);
|
|
4364
4359
|
const { tabProps, isSelected } = useTab({ key }, state, ref);
|
|
4365
4360
|
const disabled = tabProps["aria-disabled"];
|
|
4366
4361
|
const { hoverProps, isHovered } = useHover14({
|
|
@@ -4369,7 +4364,7 @@ var Tab = ({ item, state }) => {
|
|
|
4369
4364
|
const { focusProps } = useFocus({});
|
|
4370
4365
|
const stateProps = useStateProps29({ active: isSelected, hover: isHovered });
|
|
4371
4366
|
const { classNames: classNames2 } = useTabContext();
|
|
4372
|
-
return /* @__PURE__ */
|
|
4367
|
+
return /* @__PURE__ */ React.createElement(
|
|
4373
4368
|
"div",
|
|
4374
4369
|
{
|
|
4375
4370
|
className: cn47(
|
|
@@ -4384,18 +4379,19 @@ var Tab = ({ item, state }) => {
|
|
|
4384
4379
|
};
|
|
4385
4380
|
|
|
4386
4381
|
// src/Tabs/TabPanel.tsx
|
|
4387
|
-
import
|
|
4388
|
-
import { useRef as useRef30 } from "react";
|
|
4382
|
+
import { useRef as useRef31 } from "react";
|
|
4389
4383
|
import { useTabPanel } from "@react-aria/tabs";
|
|
4384
|
+
import { cn as cn48 } from "@marigold/system";
|
|
4390
4385
|
var TabPanel = ({ state, ...props }) => {
|
|
4391
4386
|
var _a;
|
|
4392
|
-
const ref =
|
|
4387
|
+
const ref = useRef31(null);
|
|
4393
4388
|
const { tabPanelProps } = useTabPanel(props, state, ref);
|
|
4394
|
-
|
|
4389
|
+
const selectedItemProps = (_a = state.selectedItem) == null ? void 0 : _a.props;
|
|
4390
|
+
const { classNames: classNames2 } = useTabContext();
|
|
4391
|
+
return /* @__PURE__ */ React.createElement("div", { className: cn48(classNames2.tabpanel), ref, ...tabPanelProps }, selectedItemProps == null ? void 0 : selectedItemProps.children);
|
|
4395
4392
|
};
|
|
4396
4393
|
|
|
4397
4394
|
// src/Tabs/Tabs.tsx
|
|
4398
|
-
import { Item as Item7 } from "@react-stately/collections";
|
|
4399
4395
|
var Tabs = ({
|
|
4400
4396
|
space = 2,
|
|
4401
4397
|
size = "medium",
|
|
@@ -4404,29 +4400,29 @@ var Tabs = ({
|
|
|
4404
4400
|
...rest
|
|
4405
4401
|
}) => {
|
|
4406
4402
|
var _a;
|
|
4407
|
-
const ref =
|
|
4403
|
+
const ref = useRef32(null);
|
|
4408
4404
|
const props = {
|
|
4409
4405
|
isDisabled: disabled,
|
|
4410
4406
|
...rest
|
|
4411
4407
|
};
|
|
4412
4408
|
const state = useTabListState(props);
|
|
4413
4409
|
const { tabListProps } = useTabList(props, state, ref);
|
|
4414
|
-
const classNames2 =
|
|
4410
|
+
const classNames2 = useClassNames41({
|
|
4415
4411
|
component: "Tabs",
|
|
4416
4412
|
size,
|
|
4417
4413
|
variant
|
|
4418
4414
|
});
|
|
4419
|
-
return /* @__PURE__ */
|
|
4415
|
+
return /* @__PURE__ */ React.createElement(TabContext.Provider, { value: { classNames: classNames2 } }, /* @__PURE__ */ React.createElement("div", { className: cn49(classNames2.container) }, /* @__PURE__ */ React.createElement(
|
|
4420
4416
|
"div",
|
|
4421
4417
|
{
|
|
4422
|
-
className:
|
|
4418
|
+
className: cn49("flex", gapSpace8[space], classNames2.tabs),
|
|
4423
4419
|
...tabListProps,
|
|
4424
4420
|
ref
|
|
4425
4421
|
},
|
|
4426
4422
|
[...state.collection].map((item) => {
|
|
4427
|
-
return /* @__PURE__ */
|
|
4423
|
+
return /* @__PURE__ */ React.createElement(Tab, { key: item.key, item, state });
|
|
4428
4424
|
})
|
|
4429
|
-
), /* @__PURE__ */
|
|
4425
|
+
), /* @__PURE__ */ React.createElement(TabPanel, { key: (_a = state.selectedItem) == null ? void 0 : _a.key, state })));
|
|
4430
4426
|
};
|
|
4431
4427
|
Tabs.Item = Item7;
|
|
4432
4428
|
export {
|
|
@@ -4476,6 +4472,7 @@ export {
|
|
|
4476
4472
|
Overlay,
|
|
4477
4473
|
Popover,
|
|
4478
4474
|
Radio,
|
|
4475
|
+
RadioGroup,
|
|
4479
4476
|
Select,
|
|
4480
4477
|
Slider,
|
|
4481
4478
|
Split,
|