@marigold/components 6.3.1 → 6.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +44 -60
- package/dist/index.d.ts +44 -60
- package/dist/index.js +1001 -1240
- package/dist/index.mjs +846 -1087
- package/package.json +5 -4
package/dist/index.js
CHANGED
|
@@ -39,13 +39,13 @@ __export(src_exports, {
|
|
|
39
39
|
Badge: () => Badge,
|
|
40
40
|
Body: () => Body,
|
|
41
41
|
Breakout: () => Breakout,
|
|
42
|
-
Button: () =>
|
|
42
|
+
Button: () => _Button,
|
|
43
43
|
Calendar: () => Calendar,
|
|
44
44
|
CalendarCell: () => CalendarCell,
|
|
45
45
|
CalendarGrid: () => CalendarGrid,
|
|
46
46
|
Card: () => Card,
|
|
47
47
|
Center: () => Center,
|
|
48
|
-
Checkbox: () =>
|
|
48
|
+
Checkbox: () => _Checkbox,
|
|
49
49
|
CheckboxGroup: () => CheckboxGroup,
|
|
50
50
|
CheckboxGroupContext: () => CheckboxGroupContext,
|
|
51
51
|
Columns: () => Columns,
|
|
@@ -54,19 +54,19 @@ __export(src_exports, {
|
|
|
54
54
|
DateField: () => DateField,
|
|
55
55
|
DatePicker: () => DatePicker,
|
|
56
56
|
Dialog: () => Dialog,
|
|
57
|
-
Divider: () =>
|
|
57
|
+
Divider: () => _Divider,
|
|
58
58
|
FieldBase: () => FieldBase,
|
|
59
59
|
FieldGroup: () => FieldGroup,
|
|
60
60
|
FieldGroupContext: () => FieldGroupContext,
|
|
61
61
|
Footer: () => Footer,
|
|
62
62
|
Header: () => Header,
|
|
63
|
-
Headline: () =>
|
|
63
|
+
Headline: () => _Headline,
|
|
64
64
|
Image: () => Image,
|
|
65
65
|
Inline: () => Inline,
|
|
66
66
|
Input: () => Input,
|
|
67
67
|
Inset: () => Inset,
|
|
68
|
-
Label: () =>
|
|
69
|
-
Link: () =>
|
|
68
|
+
Label: () => _Label,
|
|
69
|
+
Link: () => _Link,
|
|
70
70
|
List: () => List,
|
|
71
71
|
MarigoldProvider: () => MarigoldProvider,
|
|
72
72
|
Menu: () => Menu,
|
|
@@ -78,17 +78,17 @@ __export(src_exports, {
|
|
|
78
78
|
Radio: () => Radio,
|
|
79
79
|
RadioGroup: () => RadioGroup,
|
|
80
80
|
Select: () => Select,
|
|
81
|
-
Slider: () =>
|
|
81
|
+
Slider: () => _Slider,
|
|
82
82
|
Split: () => Split,
|
|
83
83
|
Stack: () => Stack,
|
|
84
|
-
Switch: () =>
|
|
84
|
+
Switch: () => _Switch,
|
|
85
85
|
Table: () => Table,
|
|
86
86
|
Tabs: () => Tabs,
|
|
87
87
|
Tag: () => Tag2,
|
|
88
88
|
Text: () => Text,
|
|
89
89
|
TextArea: () => TextArea,
|
|
90
90
|
TextField: () => TextField,
|
|
91
|
-
ThemeProvider: () =>
|
|
91
|
+
ThemeProvider: () => import_system51.ThemeProvider,
|
|
92
92
|
Tiles: () => Tiles,
|
|
93
93
|
Tooltip: () => Tooltip,
|
|
94
94
|
Tray: () => Tray,
|
|
@@ -96,11 +96,12 @@ __export(src_exports, {
|
|
|
96
96
|
Underlay: () => Underlay,
|
|
97
97
|
VisuallyHidden: () => import_visually_hidden.VisuallyHidden,
|
|
98
98
|
XLoader: () => XLoader,
|
|
99
|
+
_Slider: () => _Slider,
|
|
99
100
|
useAsyncList: () => import_data.useAsyncList,
|
|
100
101
|
useCheckboxGroupContext: () => useCheckboxGroupContext,
|
|
101
102
|
useFieldGroupContext: () => useFieldGroupContext,
|
|
102
103
|
useListData: () => import_data.useListData,
|
|
103
|
-
useTheme: () =>
|
|
104
|
+
useTheme: () => import_system51.useTheme
|
|
104
105
|
});
|
|
105
106
|
module.exports = __toCommonJS(src_exports);
|
|
106
107
|
|
|
@@ -108,121 +109,44 @@ module.exports = __toCommonJS(src_exports);
|
|
|
108
109
|
var import_data = require("@react-stately/data");
|
|
109
110
|
|
|
110
111
|
// src/Accordion/Accordion.tsx
|
|
111
|
-
var
|
|
112
|
+
var import_react4 = require("react");
|
|
112
113
|
var import_accordion = require("@react-aria/accordion");
|
|
113
114
|
var import_collections = require("@react-stately/collections");
|
|
114
115
|
var import_tree = require("@react-stately/tree");
|
|
115
116
|
|
|
116
117
|
// src/Accordion/AccordionItem.tsx
|
|
117
|
-
var
|
|
118
|
-
var
|
|
119
|
-
var
|
|
120
|
-
var
|
|
118
|
+
var import_react3 = require("react");
|
|
119
|
+
var import_focus = require("@react-aria/focus");
|
|
120
|
+
var import_utils4 = require("@react-aria/utils");
|
|
121
|
+
var import_system3 = require("@marigold/system");
|
|
121
122
|
|
|
122
|
-
// src/
|
|
123
|
+
// src/Chevron/ChevronUp.tsx
|
|
123
124
|
var import_react = require("react");
|
|
124
|
-
var import_button = require("@react-aria/button");
|
|
125
|
-
var import_focus = require("@react-aria/focus");
|
|
126
|
-
var import_interactions = require("@react-aria/interactions");
|
|
127
|
-
var import_utils = require("@react-aria/utils");
|
|
128
125
|
var import_system = require("@marigold/system");
|
|
129
126
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
130
|
-
var
|
|
131
|
-
({
|
|
132
|
-
as = "button",
|
|
133
|
-
children,
|
|
134
|
-
variant,
|
|
135
|
-
size,
|
|
136
|
-
disabled,
|
|
137
|
-
onPress,
|
|
138
|
-
onPressStart,
|
|
139
|
-
onPressEnd,
|
|
140
|
-
onPressChange,
|
|
141
|
-
onPressUp,
|
|
142
|
-
fullWidth,
|
|
143
|
-
className,
|
|
144
|
-
excludeFromTabOrder,
|
|
145
|
-
...props
|
|
146
|
-
}, ref) => {
|
|
147
|
-
const Component = as;
|
|
148
|
-
const buttonRef = (0, import_utils.useObjectRef)(ref);
|
|
149
|
-
const { hoverProps, isHovered } = (0, import_interactions.useHover)({ isDisabled: disabled });
|
|
150
|
-
const { isFocusVisible, focusProps } = (0, import_focus.useFocusRing)({
|
|
151
|
-
autoFocus: props.autoFocus
|
|
152
|
-
});
|
|
153
|
-
const { buttonProps, isPressed } = (0, import_button.useButton)(
|
|
154
|
-
{
|
|
155
|
-
/**
|
|
156
|
-
* `react-aria` only expected `Element` but we casted
|
|
157
|
-
* it to a `HTMLButtonElement` internally.
|
|
158
|
-
*/
|
|
159
|
-
...props,
|
|
160
|
-
onPress,
|
|
161
|
-
onPressStart,
|
|
162
|
-
onPressEnd,
|
|
163
|
-
onPressChange,
|
|
164
|
-
onPressUp,
|
|
165
|
-
elementType: typeof as === "string" ? as : "span",
|
|
166
|
-
isDisabled: disabled,
|
|
167
|
-
excludeFromTabOrder
|
|
168
|
-
},
|
|
169
|
-
buttonRef
|
|
170
|
-
);
|
|
171
|
-
const classNames2 = (0, import_system.useClassNames)({
|
|
172
|
-
component: "Button",
|
|
173
|
-
variant,
|
|
174
|
-
size,
|
|
175
|
-
className
|
|
176
|
-
});
|
|
177
|
-
const stateProps = (0, import_system.useStateProps)({
|
|
178
|
-
active: isPressed,
|
|
179
|
-
focusVisible: isFocusVisible,
|
|
180
|
-
hover: isHovered
|
|
181
|
-
});
|
|
182
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
183
|
-
Component,
|
|
184
|
-
{
|
|
185
|
-
...(0, import_utils.mergeProps)(buttonProps, focusProps, hoverProps, props),
|
|
186
|
-
...stateProps,
|
|
187
|
-
ref: buttonRef,
|
|
188
|
-
className: (0, import_system.cn)(
|
|
189
|
-
"inline-flex items-center justify-center gap-[0.5ch]",
|
|
190
|
-
classNames2,
|
|
191
|
-
fullWidth ? "w-full" : void 0
|
|
192
|
-
),
|
|
193
|
-
children
|
|
194
|
-
}
|
|
195
|
-
);
|
|
196
|
-
}
|
|
127
|
+
var ChevronUp = (0, import_react.forwardRef)(
|
|
128
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_system.SVG, { className, ...props, viewBox: "0 0 24 24", ref, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M5.97563 16.8506L12 10.8394L18.0244 16.8506L19.875 15L12 7.125L4.125 15L5.97563 16.8506Z" }) })
|
|
197
129
|
);
|
|
198
130
|
|
|
199
|
-
// src/Chevron/
|
|
131
|
+
// src/Chevron/ChevronDown.tsx
|
|
200
132
|
var import_react2 = require("react");
|
|
201
133
|
var import_system2 = require("@marigold/system");
|
|
202
134
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
203
|
-
var
|
|
204
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_system2.SVG, { className, ...props, viewBox: "0 0 24 24", ref, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M5.97563
|
|
205
|
-
);
|
|
206
|
-
|
|
207
|
-
// src/Chevron/ChevronDown.tsx
|
|
208
|
-
var import_react3 = require("react");
|
|
209
|
-
var import_system3 = require("@marigold/system");
|
|
210
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
211
|
-
var ChevronDown = (0, import_react3.forwardRef)(
|
|
212
|
-
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_system3.SVG, { className, ...props, viewBox: "0 0 24 24", ref, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M5.97563 7.125L12 13.1363L18.0244 7.125L19.875 8.97563L12 16.8506L4.125 8.97563L5.97563 7.125Z" }) })
|
|
135
|
+
var ChevronDown = (0, import_react2.forwardRef)(
|
|
136
|
+
({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_system2.SVG, { className, ...props, viewBox: "0 0 24 24", ref, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M5.97563 7.125L12 13.1363L18.0244 7.125L19.875 8.97563L12 16.8506L4.125 8.97563L5.97563 7.125Z" }) })
|
|
213
137
|
);
|
|
214
138
|
|
|
215
139
|
// src/Accordion/useAccordionItem.ts
|
|
216
|
-
var
|
|
140
|
+
var import_button = require("@react-aria/button");
|
|
217
141
|
var import_selection = require("@react-aria/selection");
|
|
142
|
+
var import_utils = require("@react-aria/utils");
|
|
218
143
|
var import_utils2 = require("@react-aria/utils");
|
|
219
144
|
var import_utils3 = require("@react-aria/utils");
|
|
220
|
-
var import_utils4 = require("@react-aria/utils");
|
|
221
145
|
function isNonContiguousSelectionModifier(e) {
|
|
222
|
-
return (0,
|
|
146
|
+
return (0, import_utils2.isAppleDevice)() ? e.altKey : e.ctrlKey;
|
|
223
147
|
}
|
|
224
148
|
function isCtrlKeyPressed(e) {
|
|
225
|
-
if ((0,
|
|
149
|
+
if ((0, import_utils3.isMac)()) {
|
|
226
150
|
return e.metaKey;
|
|
227
151
|
}
|
|
228
152
|
return e.ctrlKey;
|
|
@@ -231,8 +155,8 @@ function useAccordionItem(props, state, ref) {
|
|
|
231
155
|
let { item } = props;
|
|
232
156
|
let key = item.key;
|
|
233
157
|
let manager = state.selectionManager;
|
|
234
|
-
let buttonId = (0,
|
|
235
|
-
let regionId = (0,
|
|
158
|
+
let buttonId = (0, import_utils.useId)();
|
|
159
|
+
let regionId = (0, import_utils.useId)();
|
|
236
160
|
let isDisabled = state.disabledKeys.has(item.key);
|
|
237
161
|
let { itemProps } = (0, import_selection.useSelectableItem)({
|
|
238
162
|
selectionManager: manager,
|
|
@@ -283,8 +207,8 @@ function useAccordionItem(props, state, ref) {
|
|
|
283
207
|
}
|
|
284
208
|
}
|
|
285
209
|
};
|
|
286
|
-
let { buttonProps } = (0,
|
|
287
|
-
(0,
|
|
210
|
+
let { buttonProps } = (0, import_button.useButton)(
|
|
211
|
+
(0, import_utils.mergeProps)(itemProps, {
|
|
288
212
|
id: buttonId,
|
|
289
213
|
elementType: "button",
|
|
290
214
|
isDisabled,
|
|
@@ -309,7 +233,7 @@ function useAccordionItem(props, state, ref) {
|
|
|
309
233
|
}
|
|
310
234
|
|
|
311
235
|
// src/Accordion/AccordionItem.tsx
|
|
312
|
-
var
|
|
236
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
313
237
|
var AccordionItem = ({
|
|
314
238
|
item,
|
|
315
239
|
state,
|
|
@@ -318,12 +242,12 @@ var AccordionItem = ({
|
|
|
318
242
|
size,
|
|
319
243
|
...props
|
|
320
244
|
}) => {
|
|
321
|
-
const ref = (0,
|
|
245
|
+
const ref = (0, import_react3.useRef)(null);
|
|
322
246
|
const defaultExpanded = state.expandedKeys.has(
|
|
323
247
|
item.key.toString().replace(".$", "")
|
|
324
248
|
);
|
|
325
249
|
const expanded = state.selectionManager.isSelected(item.key);
|
|
326
|
-
(0,
|
|
250
|
+
(0, import_react3.useEffect)(() => {
|
|
327
251
|
if (defaultExpanded) {
|
|
328
252
|
if (state.selectionManager.selectionMode === "multiple") {
|
|
329
253
|
state.expandedKeys.forEach((key) => {
|
|
@@ -342,30 +266,33 @@ var AccordionItem = ({
|
|
|
342
266
|
state,
|
|
343
267
|
ref
|
|
344
268
|
);
|
|
345
|
-
const { isFocusVisible, focusProps } = (0,
|
|
346
|
-
const stateProps = (0,
|
|
269
|
+
const { isFocusVisible, focusProps } = (0, import_focus.useFocusRing)();
|
|
270
|
+
const stateProps = (0, import_system3.useStateProps)({
|
|
347
271
|
focus: isFocusVisible,
|
|
348
272
|
expanded: defaultExpanded || expanded
|
|
349
273
|
});
|
|
350
|
-
const classNames2 = (0,
|
|
351
|
-
return /* @__PURE__ */ (0,
|
|
352
|
-
/* @__PURE__ */ (0,
|
|
353
|
-
|
|
274
|
+
const classNames2 = (0, import_system3.useClassNames)({ component: "Accordion", variant, size });
|
|
275
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex flex-col", ...props, children: [
|
|
276
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_focus.FocusRing, { within: true, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
277
|
+
"button",
|
|
354
278
|
{
|
|
355
|
-
className:
|
|
356
|
-
|
|
279
|
+
className: (0, import_system3.cn)(
|
|
280
|
+
"inline-flex items-center justify-center gap-[0.5ch]",
|
|
281
|
+
classNames2.button
|
|
282
|
+
),
|
|
283
|
+
...(0, import_utils4.mergeProps)(buttonProps, stateProps, props),
|
|
357
284
|
ref,
|
|
358
285
|
"aria-label": item.textValue,
|
|
359
286
|
children: [
|
|
360
287
|
title,
|
|
361
|
-
|
|
288
|
+
expanded ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ChevronUp, { className: "h3 w-6" }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ChevronDown, { className: "h3 w-6" })
|
|
362
289
|
]
|
|
363
290
|
}
|
|
364
291
|
) }),
|
|
365
|
-
expanded || defaultExpanded ? /* @__PURE__ */ (0,
|
|
292
|
+
expanded || defaultExpanded ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
366
293
|
"div",
|
|
367
294
|
{
|
|
368
|
-
...(0,
|
|
295
|
+
...(0, import_utils4.mergeProps)(regionProps, focusProps, stateProps),
|
|
369
296
|
className: classNames2.item,
|
|
370
297
|
children: item.props.children
|
|
371
298
|
}
|
|
@@ -374,22 +301,22 @@ var AccordionItem = ({
|
|
|
374
301
|
};
|
|
375
302
|
|
|
376
303
|
// src/Accordion/Accordion.tsx
|
|
377
|
-
var
|
|
304
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
378
305
|
var Accordion = ({ children, ...props }) => {
|
|
379
306
|
const ownProps = {
|
|
380
307
|
...props,
|
|
381
308
|
// we have to do this because JSX childs are not supported
|
|
382
|
-
children:
|
|
383
|
-
if (!(0,
|
|
309
|
+
children: import_react4.Children.toArray(children).map((child) => {
|
|
310
|
+
if (!(0, import_react4.isValidElement)(child)) {
|
|
384
311
|
return child;
|
|
385
312
|
}
|
|
386
|
-
return (0,
|
|
313
|
+
return (0, import_react4.cloneElement)(child, {
|
|
387
314
|
hasChildItems: false,
|
|
388
315
|
...child.props
|
|
389
316
|
});
|
|
390
317
|
})
|
|
391
318
|
};
|
|
392
|
-
const ref = (0,
|
|
319
|
+
const ref = (0, import_react4.useRef)(null);
|
|
393
320
|
const state = (0, import_tree.useTreeState)({
|
|
394
321
|
selectionMode: "single",
|
|
395
322
|
...ownProps
|
|
@@ -399,7 +326,7 @@ var Accordion = ({ children, ...props }) => {
|
|
|
399
326
|
state,
|
|
400
327
|
ref
|
|
401
328
|
);
|
|
402
|
-
return /* @__PURE__ */ (0,
|
|
329
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { ...accordionProps, ref, children: [...state.collection].map((item) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
403
330
|
AccordionItem,
|
|
404
331
|
{
|
|
405
332
|
title: item.props.title,
|
|
@@ -414,9 +341,9 @@ var Accordion = ({ children, ...props }) => {
|
|
|
414
341
|
Accordion.Item = import_collections.Item;
|
|
415
342
|
|
|
416
343
|
// src/Aside/Aside.tsx
|
|
417
|
-
var
|
|
418
|
-
var
|
|
419
|
-
var
|
|
344
|
+
var import_react5 = require("react");
|
|
345
|
+
var import_system4 = require("@marigold/system");
|
|
346
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
420
347
|
var classNames = {
|
|
421
348
|
aside: "grow basis-[--sideWidth]",
|
|
422
349
|
content: "basis-0 grow-[999] [min-inline-size:--wrap]"
|
|
@@ -429,21 +356,21 @@ var Aside = ({
|
|
|
429
356
|
stretch = true,
|
|
430
357
|
wrap = "50%"
|
|
431
358
|
}) => {
|
|
432
|
-
const [left, right] =
|
|
359
|
+
const [left, right] = import_react5.Children.toArray(children);
|
|
433
360
|
const vars = {
|
|
434
|
-
aside: (0,
|
|
435
|
-
content: (0,
|
|
361
|
+
aside: (0, import_system4.createVar)({ sideWidth }),
|
|
362
|
+
content: (0, import_system4.createVar)({ wrap })
|
|
436
363
|
};
|
|
437
|
-
return /* @__PURE__ */ (0,
|
|
364
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
438
365
|
"div",
|
|
439
366
|
{
|
|
440
|
-
className: (0,
|
|
367
|
+
className: (0, import_system4.cn)(
|
|
441
368
|
"flex flex-wrap",
|
|
442
|
-
|
|
369
|
+
import_system4.gapSpace[space],
|
|
443
370
|
!stretch && "items-start"
|
|
444
371
|
),
|
|
445
372
|
children: [
|
|
446
|
-
/* @__PURE__ */ (0,
|
|
373
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
447
374
|
"div",
|
|
448
375
|
{
|
|
449
376
|
className: classNames[side === "left" ? "aside" : "content"],
|
|
@@ -451,7 +378,7 @@ var Aside = ({
|
|
|
451
378
|
children: left
|
|
452
379
|
}
|
|
453
380
|
),
|
|
454
|
-
/* @__PURE__ */ (0,
|
|
381
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
455
382
|
"div",
|
|
456
383
|
{
|
|
457
384
|
className: classNames[side === "right" ? "aside" : "content"],
|
|
@@ -465,40 +392,40 @@ var Aside = ({
|
|
|
465
392
|
};
|
|
466
393
|
|
|
467
394
|
// src/Aspect/Aspect.tsx
|
|
468
|
-
var
|
|
469
|
-
var
|
|
395
|
+
var import_system5 = require("@marigold/system");
|
|
396
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
470
397
|
var Aspect = ({
|
|
471
398
|
ratio = "square",
|
|
472
399
|
maxWidth,
|
|
473
400
|
children
|
|
474
401
|
}) => {
|
|
475
|
-
return /* @__PURE__ */ (0,
|
|
402
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
476
403
|
"div",
|
|
477
404
|
{
|
|
478
|
-
className: (0,
|
|
405
|
+
className: (0, import_system5.cn)(
|
|
479
406
|
"overflow-hidden",
|
|
480
|
-
|
|
407
|
+
import_system5.aspect[ratio],
|
|
481
408
|
"max-w-[var(--maxWidth)]"
|
|
482
409
|
),
|
|
483
|
-
style: (0,
|
|
410
|
+
style: (0, import_system5.createVar)({ maxWidth }),
|
|
484
411
|
children
|
|
485
412
|
}
|
|
486
413
|
);
|
|
487
414
|
};
|
|
488
415
|
|
|
489
416
|
// src/Autocomplete/Autocomplete.tsx
|
|
490
|
-
var
|
|
417
|
+
var import_react16 = require("react");
|
|
491
418
|
var import_autocomplete = require("@react-aria/autocomplete");
|
|
492
419
|
var import_i18n = require("@react-aria/i18n");
|
|
493
420
|
var import_collections2 = require("@react-stately/collections");
|
|
494
421
|
var import_combobox = require("@react-stately/combobox");
|
|
495
422
|
|
|
496
423
|
// src/FieldBase/FieldBase.tsx
|
|
497
|
-
var
|
|
424
|
+
var import_system8 = require("@marigold/system");
|
|
498
425
|
|
|
499
426
|
// src/HelpText/HelpText.tsx
|
|
500
|
-
var
|
|
501
|
-
var
|
|
427
|
+
var import_system6 = require("@marigold/system");
|
|
428
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
502
429
|
var HelpText = ({
|
|
503
430
|
variant,
|
|
504
431
|
size,
|
|
@@ -511,61 +438,66 @@ var HelpText = ({
|
|
|
511
438
|
...props
|
|
512
439
|
}) => {
|
|
513
440
|
const hasErrorMessage = errorMessage && error;
|
|
514
|
-
const classNames2 = (0,
|
|
441
|
+
const classNames2 = (0, import_system6.useClassNames)({
|
|
515
442
|
component: "HelpText",
|
|
516
443
|
variant,
|
|
517
444
|
size
|
|
518
445
|
});
|
|
519
|
-
return /* @__PURE__ */ (0,
|
|
446
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
520
447
|
"div",
|
|
521
448
|
{
|
|
522
449
|
...props,
|
|
523
450
|
...hasErrorMessage ? errorMessageProps : descriptionProps,
|
|
524
|
-
className: (0,
|
|
525
|
-
children: hasErrorMessage ? /* @__PURE__ */ (0,
|
|
526
|
-
/* @__PURE__ */ (0,
|
|
527
|
-
|
|
451
|
+
className: (0, import_system6.cn)("flex items-center gap-1", classNames2.container),
|
|
452
|
+
children: hasErrorMessage ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
453
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
454
|
+
import_system6.SVG,
|
|
528
455
|
{
|
|
529
|
-
className: (0,
|
|
456
|
+
className: (0, import_system6.cn)("h-4 w-4", classNames2.icon),
|
|
530
457
|
viewBox: "0 0 24 24",
|
|
531
458
|
role: "presentation",
|
|
532
|
-
children: /* @__PURE__ */ (0,
|
|
459
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("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" })
|
|
533
460
|
}
|
|
534
461
|
),
|
|
535
462
|
errorMessage
|
|
536
|
-
] }) : /* @__PURE__ */ (0,
|
|
463
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, { children: description })
|
|
537
464
|
}
|
|
538
465
|
);
|
|
539
466
|
};
|
|
540
467
|
|
|
541
468
|
// src/Label/Label.tsx
|
|
542
|
-
var
|
|
469
|
+
var import_react_aria_components = require("react-aria-components");
|
|
470
|
+
var import_system7 = require("@marigold/system");
|
|
471
|
+
|
|
472
|
+
// src/FieldBase/FieldGroup.tsx
|
|
473
|
+
var import_react6 = require("react");
|
|
474
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
475
|
+
var FieldGroupContext = (0, import_react6.createContext)({});
|
|
476
|
+
var useFieldGroupContext = () => (0, import_react6.useContext)(FieldGroupContext);
|
|
477
|
+
var FieldGroup = ({ labelWidth, children }) => {
|
|
478
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(FieldGroupContext.Provider, { value: { labelWidth }, children });
|
|
479
|
+
};
|
|
480
|
+
|
|
481
|
+
// src/Label/Label.tsx
|
|
543
482
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
544
|
-
var
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
variant,
|
|
548
|
-
size,
|
|
549
|
-
labelWidth,
|
|
550
|
-
...props
|
|
551
|
-
}) => {
|
|
552
|
-
const Component = as;
|
|
553
|
-
const classNames2 = (0, import_system8.useClassNames)({ component: "Label", size, variant });
|
|
483
|
+
var _Label = ({ size, variant, children, ...props }) => {
|
|
484
|
+
const classNames2 = (0, import_system7.useClassNames)({ component: "Label", size, variant });
|
|
485
|
+
const { labelWidth } = useFieldGroupContext();
|
|
554
486
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
555
|
-
|
|
487
|
+
import_react_aria_components.Label,
|
|
556
488
|
{
|
|
557
489
|
...props,
|
|
558
|
-
className: (0,
|
|
559
|
-
style: (0,
|
|
490
|
+
className: (0, import_system7.cn)(classNames2.container, "flex w-[var(--labelWidth)]"),
|
|
491
|
+
style: (0, import_system7.createVar)({ labelWidth }),
|
|
560
492
|
children: [
|
|
561
493
|
children,
|
|
562
494
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
563
|
-
|
|
495
|
+
import_system7.SVG,
|
|
564
496
|
{
|
|
565
497
|
viewBox: "0 0 24 24",
|
|
566
498
|
role: "presentation",
|
|
567
499
|
size: 16,
|
|
568
|
-
className: (0,
|
|
500
|
+
className: (0, import_system7.cn)("hidden", classNames2.indicator),
|
|
569
501
|
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("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" })
|
|
570
502
|
}
|
|
571
503
|
)
|
|
@@ -574,17 +506,8 @@ var Label = ({
|
|
|
574
506
|
);
|
|
575
507
|
};
|
|
576
508
|
|
|
577
|
-
// src/FieldBase/FieldGroup.tsx
|
|
578
|
-
var import_react7 = require("react");
|
|
579
|
-
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
580
|
-
var FieldGroupContext = (0, import_react7.createContext)({});
|
|
581
|
-
var useFieldGroupContext = () => (0, import_react7.useContext)(FieldGroupContext);
|
|
582
|
-
var FieldGroup = ({ labelWidth, children }) => {
|
|
583
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FieldGroupContext.Provider, { value: { labelWidth }, children });
|
|
584
|
-
};
|
|
585
|
-
|
|
586
509
|
// src/FieldBase/FieldBase.tsx
|
|
587
|
-
var
|
|
510
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
588
511
|
var FieldBase = ({
|
|
589
512
|
children,
|
|
590
513
|
variant,
|
|
@@ -602,31 +525,21 @@ var FieldBase = ({
|
|
|
602
525
|
...props
|
|
603
526
|
}) => {
|
|
604
527
|
const hasHelpText = !!description || errorMessage && error;
|
|
605
|
-
const
|
|
606
|
-
const classNames2 = (0, import_system9.useClassNames)({
|
|
528
|
+
const classNames2 = (0, import_system8.useClassNames)({
|
|
607
529
|
component: "Field",
|
|
608
530
|
variant,
|
|
609
531
|
size
|
|
610
532
|
});
|
|
611
|
-
return /* @__PURE__ */ (0,
|
|
533
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
612
534
|
"div",
|
|
613
535
|
{
|
|
614
536
|
...props,
|
|
615
537
|
...stateProps,
|
|
616
|
-
className: (0,
|
|
538
|
+
className: (0, import_system8.cn)("group/field", import_system8.width[width], classNames2),
|
|
617
539
|
children: [
|
|
618
|
-
label && /* @__PURE__ */ (0,
|
|
619
|
-
Label,
|
|
620
|
-
{
|
|
621
|
-
variant,
|
|
622
|
-
size,
|
|
623
|
-
labelWidth,
|
|
624
|
-
...labelProps,
|
|
625
|
-
children: label
|
|
626
|
-
}
|
|
627
|
-
),
|
|
540
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(_Label, { variant, size, ...labelProps, children: label }),
|
|
628
541
|
children,
|
|
629
|
-
hasHelpText && /* @__PURE__ */ (0,
|
|
542
|
+
hasHelpText && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
630
543
|
HelpText,
|
|
631
544
|
{
|
|
632
545
|
variant,
|
|
@@ -645,33 +558,33 @@ var FieldBase = ({
|
|
|
645
558
|
};
|
|
646
559
|
|
|
647
560
|
// src/Input/Input.tsx
|
|
648
|
-
var
|
|
649
|
-
var
|
|
650
|
-
var
|
|
651
|
-
var Input = (0,
|
|
561
|
+
var import_react7 = require("react");
|
|
562
|
+
var import_system9 = require("@marigold/system");
|
|
563
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
564
|
+
var Input = (0, import_react7.forwardRef)(
|
|
652
565
|
({ type = "text", icon, action, variant, size, ...props }, ref) => {
|
|
653
|
-
const classNames2 = (0,
|
|
566
|
+
const classNames2 = (0, import_system9.useClassNames)({
|
|
654
567
|
component: "Input",
|
|
655
568
|
variant,
|
|
656
569
|
size
|
|
657
570
|
});
|
|
658
|
-
const inputIcon = icon ? (0,
|
|
659
|
-
className: (0,
|
|
571
|
+
const inputIcon = icon ? (0, import_react7.cloneElement)(icon, {
|
|
572
|
+
className: (0, import_system9.cn)(
|
|
660
573
|
"pointer-events-none absolute",
|
|
661
574
|
classNames2.icon,
|
|
662
575
|
icon.props.className
|
|
663
576
|
),
|
|
664
577
|
...icon.props
|
|
665
578
|
}) : null;
|
|
666
|
-
const inputAction = action && !props.readOnly ? (0,
|
|
667
|
-
className: (0,
|
|
579
|
+
const inputAction = action && !props.readOnly ? (0, import_react7.cloneElement)(action, {
|
|
580
|
+
className: (0, import_system9.cn)(
|
|
668
581
|
"absolute",
|
|
669
582
|
classNames2.action,
|
|
670
583
|
action.props.className
|
|
671
584
|
),
|
|
672
585
|
...action.props
|
|
673
586
|
}) : null;
|
|
674
|
-
return /* @__PURE__ */ (0,
|
|
587
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
675
588
|
"div",
|
|
676
589
|
{
|
|
677
590
|
className: "group/input relative flex items-center",
|
|
@@ -679,12 +592,12 @@ var Input = (0, import_react8.forwardRef)(
|
|
|
679
592
|
"data-action": action && "",
|
|
680
593
|
children: [
|
|
681
594
|
inputIcon,
|
|
682
|
-
/* @__PURE__ */ (0,
|
|
595
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
683
596
|
"input",
|
|
684
597
|
{
|
|
685
598
|
...props,
|
|
686
|
-
className: (0,
|
|
687
|
-
"flex-1",
|
|
599
|
+
className: (0, import_system9.cn)(
|
|
600
|
+
"w-full flex-1",
|
|
688
601
|
"disabled:cursor-not-allowed",
|
|
689
602
|
"[&[type=file]]:border-none [&[type=file]]:p-0",
|
|
690
603
|
"[&[type=color]]:ml-0 [&[type=color]]:border-none [&[type=color]]:bg-transparent [&[type=color]]:p-0",
|
|
@@ -702,24 +615,24 @@ var Input = (0, import_react8.forwardRef)(
|
|
|
702
615
|
);
|
|
703
616
|
|
|
704
617
|
// src/ListBox/ListBox.tsx
|
|
705
|
-
var
|
|
618
|
+
var import_react10 = require("react");
|
|
706
619
|
var import_listbox3 = require("@react-aria/listbox");
|
|
707
|
-
var
|
|
708
|
-
var
|
|
620
|
+
var import_utils6 = require("@react-aria/utils");
|
|
621
|
+
var import_system11 = require("@marigold/system");
|
|
709
622
|
|
|
710
623
|
// src/ListBox/Context.ts
|
|
711
|
-
var
|
|
712
|
-
var ListBoxContext = (0,
|
|
713
|
-
var useListBoxContext = () => (0,
|
|
624
|
+
var import_react8 = require("react");
|
|
625
|
+
var ListBoxContext = (0, import_react8.createContext)({});
|
|
626
|
+
var useListBoxContext = () => (0, import_react8.useContext)(ListBoxContext);
|
|
714
627
|
|
|
715
628
|
// src/ListBox/ListBoxOption.tsx
|
|
716
|
-
var
|
|
629
|
+
var import_react9 = require("react");
|
|
717
630
|
var import_listbox = require("@react-aria/listbox");
|
|
718
|
-
var
|
|
719
|
-
var
|
|
720
|
-
var
|
|
631
|
+
var import_utils5 = require("@react-aria/utils");
|
|
632
|
+
var import_system10 = require("@marigold/system");
|
|
633
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
721
634
|
var ListBoxOption = ({ item, state }) => {
|
|
722
|
-
const ref = (0,
|
|
635
|
+
const ref = (0, import_react9.useRef)(null);
|
|
723
636
|
const { optionProps, isSelected, isDisabled, isFocused } = (0, import_listbox.useOption)(
|
|
724
637
|
{
|
|
725
638
|
key: item.key
|
|
@@ -729,17 +642,17 @@ var ListBoxOption = ({ item, state }) => {
|
|
|
729
642
|
);
|
|
730
643
|
const { onPointerUp, ...props } = optionProps;
|
|
731
644
|
const { classNames: classNames2 } = useListBoxContext();
|
|
732
|
-
const stateProps = (0,
|
|
645
|
+
const stateProps = (0, import_system10.useStateProps)({
|
|
733
646
|
selected: isSelected,
|
|
734
647
|
disabled: isDisabled,
|
|
735
648
|
focusVisible: isFocused
|
|
736
649
|
});
|
|
737
|
-
return /* @__PURE__ */ (0,
|
|
650
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
738
651
|
"li",
|
|
739
652
|
{
|
|
740
653
|
ref,
|
|
741
654
|
className: classNames2.option,
|
|
742
|
-
...(0,
|
|
655
|
+
...(0, import_utils5.mergeProps)(props, { onPointerDown: onPointerUp }, { ...stateProps }),
|
|
743
656
|
children: item.props.children
|
|
744
657
|
}
|
|
745
658
|
);
|
|
@@ -747,37 +660,37 @@ var ListBoxOption = ({ item, state }) => {
|
|
|
747
660
|
|
|
748
661
|
// src/ListBox/ListBoxSection.tsx
|
|
749
662
|
var import_listbox2 = require("@react-aria/listbox");
|
|
750
|
-
var
|
|
663
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
751
664
|
var ListBoxSection = ({ section, state }) => {
|
|
752
665
|
const { classNames: classNames2 } = useListBoxContext();
|
|
753
666
|
const { itemProps, headingProps, groupProps } = (0, import_listbox2.useListBoxSection)({
|
|
754
667
|
heading: section.rendered,
|
|
755
668
|
"aria-label": section["aria-label"]
|
|
756
669
|
});
|
|
757
|
-
return /* @__PURE__ */ (0,
|
|
758
|
-
section.rendered && /* @__PURE__ */ (0,
|
|
759
|
-
/* @__PURE__ */ (0,
|
|
670
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("li", { className: classNames2.section, ...itemProps, children: [
|
|
671
|
+
section.rendered && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: classNames2.sectionTitle, ...headingProps, children: section.rendered }),
|
|
672
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("ul", { className: classNames2.list, ...groupProps, children: [...section.props.children].map((node) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ListBoxOption, { item: node, state }, node.key)) })
|
|
760
673
|
] });
|
|
761
674
|
};
|
|
762
675
|
|
|
763
676
|
// src/ListBox/ListBox.tsx
|
|
764
|
-
var
|
|
765
|
-
var ListBox = (0,
|
|
677
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
678
|
+
var ListBox = (0, import_react10.forwardRef)(
|
|
766
679
|
({ state, variant, size, ...props }, ref) => {
|
|
767
|
-
const innerRef = (0,
|
|
680
|
+
const innerRef = (0, import_utils6.useObjectRef)(ref);
|
|
768
681
|
const { listBoxProps } = (0, import_listbox3.useListBox)(props, state, innerRef);
|
|
769
|
-
const classNames2 = (0,
|
|
770
|
-
return /* @__PURE__ */ (0,
|
|
682
|
+
const classNames2 = (0, import_system11.useClassNames)({ component: "ListBox", variant, size });
|
|
683
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ListBoxContext.Provider, { value: { classNames: classNames2 }, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: classNames2.container, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
771
684
|
"ul",
|
|
772
685
|
{
|
|
773
|
-
className: (0,
|
|
686
|
+
className: (0, import_system11.cn)(
|
|
774
687
|
"overflow-y-auto sm:max-h-[75vh] lg:max-h-[45vh]",
|
|
775
688
|
classNames2.list
|
|
776
689
|
),
|
|
777
690
|
ref: innerRef,
|
|
778
691
|
...listBoxProps,
|
|
779
692
|
children: [...state.collection].map(
|
|
780
|
-
(item) => item.type === "section" ? /* @__PURE__ */ (0,
|
|
693
|
+
(item) => item.type === "section" ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ListBoxSection, { section: item, state }, item.key) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ListBoxOption, { item, state }, item.key)
|
|
781
694
|
)
|
|
782
695
|
}
|
|
783
696
|
) }) });
|
|
@@ -785,24 +698,24 @@ var ListBox = (0, import_react11.forwardRef)(
|
|
|
785
698
|
);
|
|
786
699
|
|
|
787
700
|
// src/Overlay/Modal.tsx
|
|
788
|
-
var
|
|
789
|
-
var
|
|
701
|
+
var import_react11 = require("react");
|
|
702
|
+
var import_focus2 = require("@react-aria/focus");
|
|
790
703
|
var import_overlays = require("@react-aria/overlays");
|
|
791
|
-
var
|
|
704
|
+
var import_utils7 = require("@react-aria/utils");
|
|
792
705
|
|
|
793
706
|
// src/Overlay/Underlay.tsx
|
|
794
|
-
var
|
|
795
|
-
var
|
|
707
|
+
var import_system12 = require("@marigold/system");
|
|
708
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
796
709
|
var Underlay = ({ size, variant, ...props }) => {
|
|
797
|
-
const classNames2 = (0,
|
|
798
|
-
return /* @__PURE__ */ (0,
|
|
710
|
+
const classNames2 = (0, import_system12.useClassNames)({ component: "Underlay", size, variant });
|
|
711
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: (0, import_system12.cn)("fixed inset-0 z-40", classNames2), ...props });
|
|
799
712
|
};
|
|
800
713
|
|
|
801
714
|
// src/Overlay/Modal.tsx
|
|
802
|
-
var
|
|
803
|
-
var Modal = (0,
|
|
715
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
716
|
+
var Modal = (0, import_react11.forwardRef)(
|
|
804
717
|
({ children, open, dismissable, keyboardDismissable, onClose, ...props }, ref) => {
|
|
805
|
-
const modalRef = (0,
|
|
718
|
+
const modalRef = (0, import_utils7.useObjectRef)(ref);
|
|
806
719
|
const { overlayProps, underlayProps } = (0, import_overlays.useOverlay)(
|
|
807
720
|
{
|
|
808
721
|
isOpen: open,
|
|
@@ -814,15 +727,15 @@ var Modal = (0, import_react12.forwardRef)(
|
|
|
814
727
|
);
|
|
815
728
|
(0, import_overlays.usePreventScroll)();
|
|
816
729
|
const { modalProps } = (0, import_overlays.useModal)({});
|
|
817
|
-
return /* @__PURE__ */ (0,
|
|
818
|
-
/* @__PURE__ */ (0,
|
|
819
|
-
/* @__PURE__ */ (0,
|
|
730
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_focus2.FocusScope, { contain: true, restoreFocus: true, autoFocus: true, children: [
|
|
731
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Underlay, { ...underlayProps, variant: "modal" }),
|
|
732
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
820
733
|
"div",
|
|
821
734
|
{
|
|
822
735
|
className: "pointer-none fixed inset-0 z-50 flex items-center justify-center",
|
|
823
736
|
ref: modalRef,
|
|
824
|
-
...(0,
|
|
825
|
-
children: /* @__PURE__ */ (0,
|
|
737
|
+
...(0, import_utils7.mergeProps)(props, overlayProps, modalProps),
|
|
738
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { pointerEvents: "auto" }, children })
|
|
826
739
|
}
|
|
827
740
|
)
|
|
828
741
|
] });
|
|
@@ -830,18 +743,18 @@ var Modal = (0, import_react12.forwardRef)(
|
|
|
830
743
|
);
|
|
831
744
|
|
|
832
745
|
// src/Overlay/Overlay.tsx
|
|
833
|
-
var
|
|
746
|
+
var import_react12 = require("react");
|
|
834
747
|
var import_overlays2 = require("@react-aria/overlays");
|
|
835
|
-
var
|
|
836
|
-
var
|
|
748
|
+
var import_system13 = require("@marigold/system");
|
|
749
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
837
750
|
var Overlay = ({ children, container, open }) => {
|
|
838
|
-
const nodeRef = (0,
|
|
839
|
-
const theme = (0,
|
|
751
|
+
const nodeRef = (0, import_react12.useRef)(null);
|
|
752
|
+
const theme = (0, import_system13.useTheme)();
|
|
840
753
|
let mountOverlay = open;
|
|
841
754
|
if (!mountOverlay) {
|
|
842
755
|
return null;
|
|
843
756
|
}
|
|
844
|
-
return /* @__PURE__ */ (0,
|
|
757
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_overlays2.Overlay, { portalContainer: container, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
845
758
|
"div",
|
|
846
759
|
{
|
|
847
760
|
ref: nodeRef,
|
|
@@ -854,20 +767,20 @@ var Overlay = ({ children, container, open }) => {
|
|
|
854
767
|
};
|
|
855
768
|
|
|
856
769
|
// src/Overlay/Popover.tsx
|
|
857
|
-
var
|
|
858
|
-
var
|
|
770
|
+
var import_react13 = require("react");
|
|
771
|
+
var import_focus3 = require("@react-aria/focus");
|
|
859
772
|
var import_overlays3 = require("@react-aria/overlays");
|
|
860
|
-
var
|
|
861
|
-
var
|
|
862
|
-
var Popover = (0,
|
|
773
|
+
var import_system14 = require("@marigold/system");
|
|
774
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
775
|
+
var Popover = (0, import_react13.forwardRef)(
|
|
863
776
|
(props, ref) => {
|
|
864
|
-
const fallbackRef = (0,
|
|
777
|
+
const fallbackRef = (0, import_react13.useRef)(null);
|
|
865
778
|
const popoverRef = ref || fallbackRef;
|
|
866
779
|
let { children, state, ...otherProps } = props;
|
|
867
|
-
return /* @__PURE__ */ (0,
|
|
780
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Overlay, { open: state.isOpen, ...otherProps, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(PopoverWrapper, { ref: popoverRef, ...props, children }) });
|
|
868
781
|
}
|
|
869
782
|
);
|
|
870
|
-
var PopoverWrapper = (0,
|
|
783
|
+
var PopoverWrapper = (0, import_react13.forwardRef)(
|
|
871
784
|
({
|
|
872
785
|
children,
|
|
873
786
|
isNonModal,
|
|
@@ -885,13 +798,13 @@ var PopoverWrapper = (0, import_react14.forwardRef)(
|
|
|
885
798
|
},
|
|
886
799
|
state
|
|
887
800
|
);
|
|
888
|
-
const classNames2 = (0,
|
|
801
|
+
const classNames2 = (0, import_system14.useClassNames)({
|
|
889
802
|
component: "Popover",
|
|
890
803
|
variant: placement
|
|
891
804
|
});
|
|
892
|
-
return /* @__PURE__ */ (0,
|
|
893
|
-
!isNonModal && /* @__PURE__ */ (0,
|
|
894
|
-
/* @__PURE__ */ (0,
|
|
805
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_focus3.FocusScope, { restoreFocus: true, children: [
|
|
806
|
+
!isNonModal && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Underlay, { ...underlayProps }),
|
|
807
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
895
808
|
"div",
|
|
896
809
|
{
|
|
897
810
|
...popoverProps,
|
|
@@ -903,9 +816,9 @@ var PopoverWrapper = (0, import_react14.forwardRef)(
|
|
|
903
816
|
ref,
|
|
904
817
|
role: "presentation",
|
|
905
818
|
children: [
|
|
906
|
-
!isNonModal && /* @__PURE__ */ (0,
|
|
819
|
+
!isNonModal && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_overlays3.DismissButton, { onDismiss: state.close }),
|
|
907
820
|
children,
|
|
908
|
-
/* @__PURE__ */ (0,
|
|
821
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_overlays3.DismissButton, { onDismiss: state.close })
|
|
909
822
|
]
|
|
910
823
|
}
|
|
911
824
|
)
|
|
@@ -914,18 +827,18 @@ var PopoverWrapper = (0, import_react14.forwardRef)(
|
|
|
914
827
|
);
|
|
915
828
|
|
|
916
829
|
// src/Overlay/Tray.tsx
|
|
917
|
-
var
|
|
918
|
-
var
|
|
830
|
+
var import_react14 = require("react");
|
|
831
|
+
var import_focus4 = require("@react-aria/focus");
|
|
919
832
|
var import_overlays4 = require("@react-aria/overlays");
|
|
920
|
-
var
|
|
921
|
-
var
|
|
922
|
-
var Tray = (0,
|
|
833
|
+
var import_utils8 = require("@react-aria/utils");
|
|
834
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
835
|
+
var Tray = (0, import_react14.forwardRef)(
|
|
923
836
|
({ state, children, ...props }, ref) => {
|
|
924
|
-
const trayRef = (0,
|
|
925
|
-
return /* @__PURE__ */ (0,
|
|
837
|
+
const trayRef = (0, import_utils8.useObjectRef)(ref);
|
|
838
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Overlay, { open: state.isOpen, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(TrayWrapper, { state, ...props, ref: trayRef, children }) });
|
|
926
839
|
}
|
|
927
840
|
);
|
|
928
|
-
var TrayWrapper = (0,
|
|
841
|
+
var TrayWrapper = (0, import_react14.forwardRef)(
|
|
929
842
|
({ children, state, ...props }, ref) => {
|
|
930
843
|
let { modalProps, underlayProps } = (0, import_overlays4.useModalOverlay)(
|
|
931
844
|
{
|
|
@@ -935,7 +848,7 @@ var TrayWrapper = (0, import_react15.forwardRef)(
|
|
|
935
848
|
state,
|
|
936
849
|
ref
|
|
937
850
|
);
|
|
938
|
-
return /* @__PURE__ */ (0,
|
|
851
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_focus4.FocusScope, { contain: true, restoreFocus: true, autoFocus: true, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Underlay, { ...underlayProps, variant: "modal", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
939
852
|
"div",
|
|
940
853
|
{
|
|
941
854
|
...modalProps,
|
|
@@ -943,9 +856,9 @@ var TrayWrapper = (0, import_react15.forwardRef)(
|
|
|
943
856
|
className: "absolute bottom-0 w-full",
|
|
944
857
|
"data-testid": "tray",
|
|
945
858
|
children: [
|
|
946
|
-
/* @__PURE__ */ (0,
|
|
859
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_overlays4.DismissButton, { onDismiss: state.close }),
|
|
947
860
|
children,
|
|
948
|
-
/* @__PURE__ */ (0,
|
|
861
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_overlays4.DismissButton, { onDismiss: state.close })
|
|
949
862
|
]
|
|
950
863
|
}
|
|
951
864
|
) }) });
|
|
@@ -953,13 +866,13 @@ var TrayWrapper = (0, import_react15.forwardRef)(
|
|
|
953
866
|
);
|
|
954
867
|
|
|
955
868
|
// src/Autocomplete/ClearButton.tsx
|
|
956
|
-
var
|
|
957
|
-
var
|
|
958
|
-
var
|
|
959
|
-
var
|
|
960
|
-
var
|
|
961
|
-
var
|
|
962
|
-
var
|
|
869
|
+
var import_react15 = require("react");
|
|
870
|
+
var import_button2 = require("@react-aria/button");
|
|
871
|
+
var import_focus5 = require("@react-aria/focus");
|
|
872
|
+
var import_interactions = require("@react-aria/interactions");
|
|
873
|
+
var import_utils9 = require("@react-aria/utils");
|
|
874
|
+
var import_system15 = require("@marigold/system");
|
|
875
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
963
876
|
var ClearButton = ({
|
|
964
877
|
preventFocus,
|
|
965
878
|
disabled,
|
|
@@ -974,12 +887,12 @@ var ClearButton = ({
|
|
|
974
887
|
className,
|
|
975
888
|
...props
|
|
976
889
|
}) => {
|
|
977
|
-
const buttonRef = (0,
|
|
978
|
-
const { hoverProps, isHovered } = (0,
|
|
979
|
-
const { isFocusVisible, focusProps } = (0,
|
|
890
|
+
const buttonRef = (0, import_react15.useRef)(null);
|
|
891
|
+
const { hoverProps, isHovered } = (0, import_interactions.useHover)({ isDisabled: disabled });
|
|
892
|
+
const { isFocusVisible, focusProps } = (0, import_focus5.useFocusRing)({
|
|
980
893
|
autoFocus: props.autoFocus
|
|
981
894
|
});
|
|
982
|
-
const { buttonProps, isPressed } = (0,
|
|
895
|
+
const { buttonProps, isPressed } = (0, import_button2.useButton)(
|
|
983
896
|
{
|
|
984
897
|
...props,
|
|
985
898
|
onClick,
|
|
@@ -997,22 +910,22 @@ var ClearButton = ({
|
|
|
997
910
|
if (preventFocus) {
|
|
998
911
|
delete buttonProps.tabIndex;
|
|
999
912
|
}
|
|
1000
|
-
const stateProps = (0,
|
|
913
|
+
const stateProps = (0, import_system15.useStateProps)({
|
|
1001
914
|
active: isPressed,
|
|
1002
915
|
focusVisible: isFocusVisible,
|
|
1003
916
|
hover: isHovered
|
|
1004
917
|
});
|
|
1005
|
-
return /* @__PURE__ */ (0,
|
|
918
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1006
919
|
"button",
|
|
1007
920
|
{
|
|
1008
|
-
...(0,
|
|
921
|
+
...(0, import_utils9.mergeProps)(buttonProps, focusProps, hoverProps, props),
|
|
1009
922
|
...stateProps,
|
|
1010
923
|
ref: buttonRef,
|
|
1011
|
-
className: (0,
|
|
924
|
+
className: (0, import_system15.cn)(
|
|
1012
925
|
"cursor-pointer appearance-none border-none p-0 pr-1",
|
|
1013
926
|
className
|
|
1014
927
|
),
|
|
1015
|
-
children: /* @__PURE__ */ (0,
|
|
928
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1016
929
|
"svg",
|
|
1017
930
|
{
|
|
1018
931
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1020,7 +933,7 @@ var ClearButton = ({
|
|
|
1020
933
|
fill: "currentColor",
|
|
1021
934
|
width: 20,
|
|
1022
935
|
height: 20,
|
|
1023
|
-
children: /* @__PURE__ */ (0,
|
|
936
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("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" })
|
|
1024
937
|
}
|
|
1025
938
|
)
|
|
1026
939
|
}
|
|
@@ -1028,8 +941,8 @@ var ClearButton = ({
|
|
|
1028
941
|
};
|
|
1029
942
|
|
|
1030
943
|
// src/Autocomplete/Autocomplete.tsx
|
|
1031
|
-
var
|
|
1032
|
-
var SearchIcon = (props) => /* @__PURE__ */ (0,
|
|
944
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
945
|
+
var SearchIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1033
946
|
"svg",
|
|
1034
947
|
{
|
|
1035
948
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1038,7 +951,7 @@ var SearchIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
|
1038
951
|
width: 24,
|
|
1039
952
|
height: 24,
|
|
1040
953
|
...props,
|
|
1041
|
-
children: /* @__PURE__ */ (0,
|
|
954
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("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" })
|
|
1042
955
|
}
|
|
1043
956
|
);
|
|
1044
957
|
var Autocomplete = ({
|
|
@@ -1076,9 +989,9 @@ var Autocomplete = ({
|
|
|
1076
989
|
selectedKey: void 0,
|
|
1077
990
|
defaultSelectedKey: void 0
|
|
1078
991
|
});
|
|
1079
|
-
const inputRef = (0,
|
|
1080
|
-
const listBoxRef = (0,
|
|
1081
|
-
const popoverRef = (0,
|
|
992
|
+
const inputRef = (0, import_react16.useRef)(null);
|
|
993
|
+
const listBoxRef = (0, import_react16.useRef)(null);
|
|
994
|
+
const popoverRef = (0, import_react16.useRef)(null);
|
|
1082
995
|
const { inputProps, listBoxProps, labelProps, clearButtonProps } = (0, import_autocomplete.useSearchAutocomplete)(
|
|
1083
996
|
{
|
|
1084
997
|
...props,
|
|
@@ -1093,8 +1006,8 @@ var Autocomplete = ({
|
|
|
1093
1006
|
state
|
|
1094
1007
|
);
|
|
1095
1008
|
const { isDisabled, ...restClearButtonProps } = clearButtonProps;
|
|
1096
|
-
return /* @__PURE__ */ (0,
|
|
1097
|
-
/* @__PURE__ */ (0,
|
|
1009
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
1010
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1098
1011
|
FieldBase,
|
|
1099
1012
|
{
|
|
1100
1013
|
label: props.label,
|
|
@@ -1104,13 +1017,13 @@ var Autocomplete = ({
|
|
|
1104
1017
|
errorMessage: props.errorMessage,
|
|
1105
1018
|
disabled,
|
|
1106
1019
|
width,
|
|
1107
|
-
children: /* @__PURE__ */ (0,
|
|
1020
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1108
1021
|
Input,
|
|
1109
1022
|
{
|
|
1110
1023
|
...inputProps,
|
|
1111
1024
|
ref: inputRef,
|
|
1112
|
-
icon: /* @__PURE__ */ (0,
|
|
1113
|
-
action: state.inputValue !== "" ? /* @__PURE__ */ (0,
|
|
1025
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(SearchIcon, {}),
|
|
1026
|
+
action: state.inputValue !== "" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1114
1027
|
ClearButton,
|
|
1115
1028
|
{
|
|
1116
1029
|
preventFocus: true,
|
|
@@ -1122,7 +1035,7 @@ var Autocomplete = ({
|
|
|
1122
1035
|
)
|
|
1123
1036
|
}
|
|
1124
1037
|
),
|
|
1125
|
-
/* @__PURE__ */ (0,
|
|
1038
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1126
1039
|
Popover,
|
|
1127
1040
|
{
|
|
1128
1041
|
state,
|
|
@@ -1130,7 +1043,7 @@ var Autocomplete = ({
|
|
|
1130
1043
|
triggerRef: inputRef,
|
|
1131
1044
|
scrollRef: listBoxRef,
|
|
1132
1045
|
isNonModal: true,
|
|
1133
|
-
children: /* @__PURE__ */ (0,
|
|
1046
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ListBox, { ref: listBoxRef, state, ...listBoxProps })
|
|
1134
1047
|
}
|
|
1135
1048
|
)
|
|
1136
1049
|
] });
|
|
@@ -1139,11 +1052,41 @@ Autocomplete.Item = import_collections2.Item;
|
|
|
1139
1052
|
|
|
1140
1053
|
// src/ComboBox/ComboBox.tsx
|
|
1141
1054
|
var import_react18 = __toESM(require("react"));
|
|
1142
|
-
var import_button4 = require("@react-aria/button");
|
|
1143
1055
|
var import_combobox2 = require("@react-aria/combobox");
|
|
1144
1056
|
var import_i18n2 = require("@react-aria/i18n");
|
|
1145
1057
|
var import_collections3 = require("@react-stately/collections");
|
|
1146
1058
|
var import_combobox3 = require("@react-stately/combobox");
|
|
1059
|
+
|
|
1060
|
+
// src/Button/Button.tsx
|
|
1061
|
+
var import_react17 = require("react");
|
|
1062
|
+
var import_react_aria_components2 = require("react-aria-components");
|
|
1063
|
+
var import_system16 = require("@marigold/system");
|
|
1064
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1065
|
+
var _Button = (0, import_react17.forwardRef)(
|
|
1066
|
+
({ children, variant, size, disabled, fullWidth, ...props }, ref) => {
|
|
1067
|
+
const classNames2 = (0, import_system16.useClassNames)({
|
|
1068
|
+
component: "Button",
|
|
1069
|
+
variant,
|
|
1070
|
+
size
|
|
1071
|
+
});
|
|
1072
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1073
|
+
import_react_aria_components2.Button,
|
|
1074
|
+
{
|
|
1075
|
+
...props,
|
|
1076
|
+
ref,
|
|
1077
|
+
className: (0, import_system16.cn)(
|
|
1078
|
+
"inline-flex items-center justify-center gap-[0.5ch]",
|
|
1079
|
+
classNames2,
|
|
1080
|
+
fullWidth ? "w-full" : void 0
|
|
1081
|
+
),
|
|
1082
|
+
isDisabled: disabled,
|
|
1083
|
+
children
|
|
1084
|
+
}
|
|
1085
|
+
);
|
|
1086
|
+
}
|
|
1087
|
+
);
|
|
1088
|
+
|
|
1089
|
+
// src/ComboBox/ComboBox.tsx
|
|
1147
1090
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1148
1091
|
var ComboBox = ({
|
|
1149
1092
|
error,
|
|
@@ -1183,7 +1126,6 @@ var ComboBox = ({
|
|
|
1183
1126
|
state
|
|
1184
1127
|
);
|
|
1185
1128
|
const errorMessageProps = { "aria-invalid": error };
|
|
1186
|
-
const { buttonProps } = (0, import_button4.useButton)(triggerProps, buttonRef);
|
|
1187
1129
|
const { label, description, errorMessage } = props;
|
|
1188
1130
|
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
|
|
1189
1131
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
@@ -1202,11 +1144,11 @@ var ComboBox = ({
|
|
|
1202
1144
|
...inputProps,
|
|
1203
1145
|
ref: inputRef,
|
|
1204
1146
|
action: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1205
|
-
|
|
1147
|
+
_Button,
|
|
1206
1148
|
{
|
|
1207
1149
|
className: "absolute right-2 h-4 w-4 border-none bg-transparent p-0",
|
|
1208
1150
|
ref: buttonRef,
|
|
1209
|
-
...
|
|
1151
|
+
...triggerProps,
|
|
1210
1152
|
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ChevronDown, { className: "h-4 w-4" })
|
|
1211
1153
|
}
|
|
1212
1154
|
)
|
|
@@ -1338,80 +1280,11 @@ var Center = ({
|
|
|
1338
1280
|
};
|
|
1339
1281
|
|
|
1340
1282
|
// src/Checkbox/Checkbox.tsx
|
|
1341
|
-
var
|
|
1342
|
-
var
|
|
1343
|
-
var import_focus7 = require("@react-aria/focus");
|
|
1344
|
-
var import_interactions3 = require("@react-aria/interactions");
|
|
1345
|
-
var import_utils11 = require("@react-aria/utils");
|
|
1346
|
-
var import_toggle = require("@react-stately/toggle");
|
|
1347
|
-
var import_system24 = require("@marigold/system");
|
|
1348
|
-
|
|
1349
|
-
// src/Checkbox/CheckboxField.tsx
|
|
1283
|
+
var import_react19 = require("react");
|
|
1284
|
+
var import_react_aria_components3 = require("react-aria-components");
|
|
1350
1285
|
var import_system22 = require("@marigold/system");
|
|
1351
1286
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1352
|
-
var
|
|
1353
|
-
const classNames2 = (0, import_system22.useClassNames)({ component: "Field" });
|
|
1354
|
-
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: classNames2, children: [
|
|
1355
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "w-[--labelWidth]", style: (0, import_system22.createVar)({ labelWidth }) }),
|
|
1356
|
-
children
|
|
1357
|
-
] });
|
|
1358
|
-
};
|
|
1359
|
-
|
|
1360
|
-
// src/Checkbox/CheckboxGroup.tsx
|
|
1361
|
-
var import_react19 = require("react");
|
|
1362
|
-
var import_checkbox = require("@react-aria/checkbox");
|
|
1363
|
-
var import_checkbox2 = require("@react-stately/checkbox");
|
|
1364
|
-
var import_system23 = require("@marigold/system");
|
|
1365
|
-
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1366
|
-
var CheckboxGroupContext = (0, import_react19.createContext)(
|
|
1367
|
-
null
|
|
1368
|
-
);
|
|
1369
|
-
var useCheckboxGroupContext = () => (0, import_react19.useContext)(CheckboxGroupContext);
|
|
1370
|
-
var CheckboxGroup = ({
|
|
1371
|
-
children,
|
|
1372
|
-
required,
|
|
1373
|
-
disabled,
|
|
1374
|
-
readOnly,
|
|
1375
|
-
error,
|
|
1376
|
-
width,
|
|
1377
|
-
...rest
|
|
1378
|
-
}) => {
|
|
1379
|
-
const props = {
|
|
1380
|
-
isRequired: required,
|
|
1381
|
-
isDisabled: disabled,
|
|
1382
|
-
isReadOnly: readOnly,
|
|
1383
|
-
validationState: error ? "invalid" : "valid",
|
|
1384
|
-
...rest
|
|
1385
|
-
};
|
|
1386
|
-
const state = (0, import_checkbox2.useCheckboxGroupState)(props);
|
|
1387
|
-
const { groupProps, labelProps, descriptionProps, errorMessageProps } = (0, import_checkbox.useCheckboxGroup)(props, state);
|
|
1388
|
-
const stateProps = (0, import_system23.useStateProps)({
|
|
1389
|
-
disabled,
|
|
1390
|
-
readOnly,
|
|
1391
|
-
error
|
|
1392
|
-
});
|
|
1393
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1394
|
-
FieldBase,
|
|
1395
|
-
{
|
|
1396
|
-
label: props.label,
|
|
1397
|
-
labelProps: { as: "span", ...labelProps },
|
|
1398
|
-
description: props.description,
|
|
1399
|
-
descriptionProps,
|
|
1400
|
-
error,
|
|
1401
|
-
errorMessage: props.errorMessage,
|
|
1402
|
-
errorMessageProps,
|
|
1403
|
-
disabled,
|
|
1404
|
-
stateProps,
|
|
1405
|
-
width,
|
|
1406
|
-
...groupProps,
|
|
1407
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { role: "presentation", className: "flex flex-col items-start", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CheckboxGroupContext.Provider, { value: { error, ...state }, children }) })
|
|
1408
|
-
}
|
|
1409
|
-
);
|
|
1410
|
-
};
|
|
1411
|
-
|
|
1412
|
-
// src/Checkbox/Checkbox.tsx
|
|
1413
|
-
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1414
|
-
var CheckMark = () => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("svg", { viewBox: "0 0 12 10", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1287
|
+
var CheckMark = () => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("svg", { viewBox: "0 0 12 10", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1415
1288
|
"path",
|
|
1416
1289
|
{
|
|
1417
1290
|
fill: "currentColor",
|
|
@@ -1419,7 +1292,7 @@ var CheckMark = () => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("svg", { vie
|
|
|
1419
1292
|
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"
|
|
1420
1293
|
}
|
|
1421
1294
|
) });
|
|
1422
|
-
var IndeterminateMark = () => /* @__PURE__ */ (0,
|
|
1295
|
+
var IndeterminateMark = () => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("svg", { width: "12", height: "3", viewBox: "0 0 12 3", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1423
1296
|
"path",
|
|
1424
1297
|
{
|
|
1425
1298
|
fill: "currentColor",
|
|
@@ -1428,125 +1301,137 @@ var IndeterminateMark = () => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("svg
|
|
|
1428
1301
|
}
|
|
1429
1302
|
) });
|
|
1430
1303
|
var Icon = ({ className, checked, indeterminate, ...props }) => {
|
|
1431
|
-
return /* @__PURE__ */ (0,
|
|
1304
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1432
1305
|
"div",
|
|
1433
1306
|
{
|
|
1434
1307
|
"aria-hidden": "true",
|
|
1435
|
-
className: (0,
|
|
1308
|
+
className: (0, import_system22.cn)(
|
|
1436
1309
|
"flex shrink-0 grow-0 basis-4 items-center justify-center",
|
|
1437
1310
|
"h-4 w-4 p-px",
|
|
1438
1311
|
"bg-white",
|
|
1439
|
-
"rounded-[3px] border border-solid border-black",
|
|
1312
|
+
"rounded-[3px] border border-solid border-black ",
|
|
1440
1313
|
className
|
|
1441
1314
|
),
|
|
1442
1315
|
...props,
|
|
1443
|
-
children: indeterminate ? /* @__PURE__ */ (0,
|
|
1316
|
+
children: indeterminate ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(IndeterminateMark, {}) : checked ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(CheckMark, {}) : null
|
|
1444
1317
|
}
|
|
1445
1318
|
);
|
|
1446
1319
|
};
|
|
1447
|
-
var
|
|
1320
|
+
var _Checkbox = (0, import_react19.forwardRef)(
|
|
1448
1321
|
({
|
|
1449
|
-
|
|
1450
|
-
|
|
1322
|
+
className,
|
|
1323
|
+
indeterminate,
|
|
1324
|
+
error,
|
|
1451
1325
|
disabled,
|
|
1452
|
-
checked,
|
|
1453
1326
|
defaultChecked,
|
|
1454
|
-
|
|
1327
|
+
children,
|
|
1328
|
+
checked,
|
|
1455
1329
|
readOnly,
|
|
1456
1330
|
required,
|
|
1457
|
-
|
|
1458
|
-
|
|
1331
|
+
variant,
|
|
1332
|
+
size,
|
|
1333
|
+
...rest
|
|
1459
1334
|
}, ref) => {
|
|
1460
|
-
const
|
|
1461
|
-
const checkboxProps = {
|
|
1335
|
+
const props = {
|
|
1462
1336
|
isIndeterminate: indeterminate,
|
|
1463
1337
|
isDisabled: disabled,
|
|
1464
1338
|
isReadOnly: readOnly,
|
|
1465
1339
|
isRequired: required,
|
|
1466
|
-
|
|
1340
|
+
isInvalid: error,
|
|
1341
|
+
defaultSelected: defaultChecked,
|
|
1342
|
+
...rest
|
|
1467
1343
|
};
|
|
1468
|
-
const
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
...props,
|
|
1472
|
-
...checkboxProps,
|
|
1473
|
-
/**
|
|
1474
|
-
* value is optional for standalone checkboxes, but required when
|
|
1475
|
-
* used inside a group.
|
|
1476
|
-
*/
|
|
1477
|
-
value: props.value
|
|
1478
|
-
},
|
|
1479
|
-
groupState,
|
|
1480
|
-
inputRef
|
|
1481
|
-
) : (0, import_checkbox3.useCheckbox)(
|
|
1344
|
+
const classNames2 = (0, import_system22.useClassNames)({ component: "Checkbox", variant, size });
|
|
1345
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1346
|
+
import_react_aria_components3.Checkbox,
|
|
1482
1347
|
{
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
},
|
|
1488
|
-
(0, import_toggle.useToggleState)({
|
|
1489
|
-
isSelected: checked,
|
|
1490
|
-
defaultSelected: defaultChecked,
|
|
1491
|
-
isReadOnly: readOnly,
|
|
1492
|
-
...props
|
|
1493
|
-
}),
|
|
1494
|
-
inputRef
|
|
1495
|
-
);
|
|
1496
|
-
const classNames2 = (0, import_system24.useClassNames)({ component: "Checkbox", variant, size });
|
|
1497
|
-
const { hoverProps, isHovered } = (0, import_interactions3.useHover)({
|
|
1498
|
-
isDisabled: inputProps.disabled
|
|
1499
|
-
});
|
|
1500
|
-
const { labelWidth } = useFieldGroupContext();
|
|
1501
|
-
const { isFocusVisible, focusProps } = (0, import_focus7.useFocusRing)();
|
|
1502
|
-
const stateProps = (0, import_system24.useStateProps)({
|
|
1503
|
-
hover: isHovered,
|
|
1504
|
-
focus: isFocusVisible,
|
|
1505
|
-
checked: inputProps.checked,
|
|
1506
|
-
disabled: inputProps.disabled,
|
|
1507
|
-
error: (groupState == null ? void 0 : groupState.error) || error,
|
|
1508
|
-
readOnly,
|
|
1509
|
-
indeterminate
|
|
1510
|
-
});
|
|
1511
|
-
const component = /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
1512
|
-
"label",
|
|
1513
|
-
{
|
|
1514
|
-
className: (0, import_system24.cn)(
|
|
1515
|
-
"group/checkbox relative flex items-center gap-[1ch]",
|
|
1348
|
+
ref,
|
|
1349
|
+
className: (0, import_system22.cn)(
|
|
1350
|
+
"group/checkbox flex items-center gap-[0.5rem]",
|
|
1351
|
+
"cursor-pointer data-[disabled]:cursor-not-allowed",
|
|
1516
1352
|
classNames2.container
|
|
1517
1353
|
),
|
|
1518
|
-
...
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1522
|
-
"input",
|
|
1523
|
-
{
|
|
1524
|
-
ref: inputRef,
|
|
1525
|
-
className: "z-1 absolute left-0 top-0 h-full w-full cursor-pointer opacity-[0.0001] group-disabled/checkbox:cursor-not-allowed",
|
|
1526
|
-
...inputProps,
|
|
1527
|
-
...focusProps
|
|
1528
|
-
}
|
|
1529
|
-
),
|
|
1530
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1354
|
+
...props,
|
|
1355
|
+
children: ({ isSelected, isIndeterminate }) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
|
|
1356
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1531
1357
|
Icon,
|
|
1532
1358
|
{
|
|
1533
|
-
checked:
|
|
1534
|
-
indeterminate,
|
|
1359
|
+
checked: isSelected,
|
|
1360
|
+
indeterminate: isIndeterminate,
|
|
1535
1361
|
className: classNames2.checkbox
|
|
1536
1362
|
}
|
|
1537
1363
|
),
|
|
1538
|
-
|
|
1539
|
-
]
|
|
1364
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: classNames2.label, children })
|
|
1365
|
+
] })
|
|
1540
1366
|
}
|
|
1541
1367
|
);
|
|
1542
|
-
return !groupState && labelWidth ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(CheckboxField, { labelWidth, children: component }) : component;
|
|
1543
1368
|
}
|
|
1544
1369
|
);
|
|
1545
1370
|
|
|
1371
|
+
// src/Checkbox/CheckboxGroup.tsx
|
|
1372
|
+
var import_react20 = require("react");
|
|
1373
|
+
var import_checkbox = require("@react-aria/checkbox");
|
|
1374
|
+
var import_checkbox2 = require("@react-stately/checkbox");
|
|
1375
|
+
var import_system23 = require("@marigold/system");
|
|
1376
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1377
|
+
var CheckboxGroupContext = (0, import_react20.createContext)(
|
|
1378
|
+
null
|
|
1379
|
+
);
|
|
1380
|
+
var useCheckboxGroupContext = () => (0, import_react20.useContext)(CheckboxGroupContext);
|
|
1381
|
+
var CheckboxGroup = ({
|
|
1382
|
+
variant,
|
|
1383
|
+
size,
|
|
1384
|
+
children,
|
|
1385
|
+
required,
|
|
1386
|
+
disabled,
|
|
1387
|
+
readOnly,
|
|
1388
|
+
error,
|
|
1389
|
+
width,
|
|
1390
|
+
...rest
|
|
1391
|
+
}) => {
|
|
1392
|
+
const props = {
|
|
1393
|
+
isRequired: required,
|
|
1394
|
+
isDisabled: disabled,
|
|
1395
|
+
isReadOnly: readOnly,
|
|
1396
|
+
validationState: error ? "invalid" : "valid",
|
|
1397
|
+
...rest
|
|
1398
|
+
};
|
|
1399
|
+
const state = (0, import_checkbox2.useCheckboxGroupState)(props);
|
|
1400
|
+
const { groupProps, labelProps, descriptionProps, errorMessageProps } = (0, import_checkbox.useCheckboxGroup)(props, state);
|
|
1401
|
+
const classNames2 = (0, import_system23.useClassNames)({
|
|
1402
|
+
component: "Checkbox",
|
|
1403
|
+
variant,
|
|
1404
|
+
size,
|
|
1405
|
+
className: { group: "flex flex-col items-start gap-[0.5ch]" }
|
|
1406
|
+
});
|
|
1407
|
+
const stateProps = (0, import_system23.useStateProps)({
|
|
1408
|
+
disabled,
|
|
1409
|
+
readOnly,
|
|
1410
|
+
error
|
|
1411
|
+
});
|
|
1412
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1413
|
+
FieldBase,
|
|
1414
|
+
{
|
|
1415
|
+
label: props.label,
|
|
1416
|
+
labelProps: { elementType: "span", ...labelProps },
|
|
1417
|
+
description: props.description,
|
|
1418
|
+
descriptionProps,
|
|
1419
|
+
error,
|
|
1420
|
+
errorMessage: props.errorMessage,
|
|
1421
|
+
errorMessageProps,
|
|
1422
|
+
disabled,
|
|
1423
|
+
stateProps,
|
|
1424
|
+
width,
|
|
1425
|
+
...groupProps,
|
|
1426
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { role: "presentation", className: classNames2.group, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CheckboxGroupContext.Provider, { value: { error, ...state }, children }) })
|
|
1427
|
+
}
|
|
1428
|
+
);
|
|
1429
|
+
};
|
|
1430
|
+
|
|
1546
1431
|
// src/Columns/Columns.tsx
|
|
1547
1432
|
var import_react21 = require("react");
|
|
1548
|
-
var
|
|
1549
|
-
var
|
|
1433
|
+
var import_system24 = require("@marigold/system");
|
|
1434
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1550
1435
|
var Columns = ({
|
|
1551
1436
|
space = 0,
|
|
1552
1437
|
columns,
|
|
@@ -1562,22 +1447,22 @@ var Columns = ({
|
|
|
1562
1447
|
)}`
|
|
1563
1448
|
);
|
|
1564
1449
|
}
|
|
1565
|
-
return /* @__PURE__ */ (0,
|
|
1450
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1566
1451
|
"div",
|
|
1567
1452
|
{
|
|
1568
|
-
className: (0,
|
|
1453
|
+
className: (0, import_system24.cn)(
|
|
1569
1454
|
"flex flex-wrap items-stretch",
|
|
1570
1455
|
stretch && "h-full",
|
|
1571
|
-
|
|
1456
|
+
import_system24.gapSpace[space]
|
|
1572
1457
|
),
|
|
1573
1458
|
...props,
|
|
1574
|
-
children: import_react21.Children.map(children, (child, idx) => /* @__PURE__ */ (0,
|
|
1459
|
+
children: import_react21.Children.map(children, (child, idx) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1575
1460
|
"div",
|
|
1576
1461
|
{
|
|
1577
|
-
className: (0,
|
|
1462
|
+
className: (0, import_system24.cn)(
|
|
1578
1463
|
"grow-[--columnSize] basis-[calc((var(--collapseAt)_-_100%)_*_999)]"
|
|
1579
1464
|
),
|
|
1580
|
-
style: (0,
|
|
1465
|
+
style: (0, import_system24.createVar)({ collapseAt, columnSize: columns[idx] }),
|
|
1581
1466
|
children: (0, import_react21.isValidElement)(child) ? (0, import_react21.cloneElement)(child) : child
|
|
1582
1467
|
}
|
|
1583
1468
|
))
|
|
@@ -1586,8 +1471,8 @@ var Columns = ({
|
|
|
1586
1471
|
};
|
|
1587
1472
|
|
|
1588
1473
|
// src/Container/Container.tsx
|
|
1589
|
-
var
|
|
1590
|
-
var
|
|
1474
|
+
var import_system25 = require("@marigold/system");
|
|
1475
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1591
1476
|
var content = {
|
|
1592
1477
|
small: "20ch",
|
|
1593
1478
|
medium: "45ch",
|
|
@@ -1607,17 +1492,17 @@ var Container = ({
|
|
|
1607
1492
|
...props
|
|
1608
1493
|
}) => {
|
|
1609
1494
|
const maxWidth = contentType === "content" ? content[size] : header[size];
|
|
1610
|
-
return /* @__PURE__ */ (0,
|
|
1495
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1611
1496
|
"div",
|
|
1612
1497
|
{
|
|
1613
1498
|
...props,
|
|
1614
|
-
className: (0,
|
|
1499
|
+
className: (0, import_system25.cn)(
|
|
1615
1500
|
"grid",
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1501
|
+
import_system25.placeItems[alignItems],
|
|
1502
|
+
import_system25.gridColsAlign[align],
|
|
1503
|
+
import_system25.gridColumn[align]
|
|
1619
1504
|
),
|
|
1620
|
-
style: (0,
|
|
1505
|
+
style: (0, import_system25.createVar)({ maxWidth }),
|
|
1621
1506
|
children
|
|
1622
1507
|
}
|
|
1623
1508
|
);
|
|
@@ -1625,49 +1510,49 @@ var Container = ({
|
|
|
1625
1510
|
|
|
1626
1511
|
// src/Dialog/Dialog.tsx
|
|
1627
1512
|
var import_react24 = require("react");
|
|
1628
|
-
var
|
|
1513
|
+
var import_button3 = require("@react-aria/button");
|
|
1629
1514
|
var import_dialog = require("@react-aria/dialog");
|
|
1630
|
-
var
|
|
1515
|
+
var import_system28 = require("@marigold/system");
|
|
1631
1516
|
|
|
1632
1517
|
// src/Header/Header.tsx
|
|
1633
|
-
var
|
|
1634
|
-
var
|
|
1518
|
+
var import_system26 = require("@marigold/system");
|
|
1519
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1635
1520
|
var Header = ({ children, variant, size, ...props }) => {
|
|
1636
|
-
const classNames2 = (0,
|
|
1521
|
+
const classNames2 = (0, import_system26.useClassNames)({
|
|
1637
1522
|
component: "Header",
|
|
1638
1523
|
variant,
|
|
1639
1524
|
size
|
|
1640
1525
|
});
|
|
1641
|
-
return /* @__PURE__ */ (0,
|
|
1526
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("header", { ...props, className: (0, import_system26.cn)(classNames2), children });
|
|
1642
1527
|
};
|
|
1643
1528
|
|
|
1644
1529
|
// src/Headline/Headline.tsx
|
|
1645
|
-
var
|
|
1646
|
-
var
|
|
1647
|
-
var
|
|
1648
|
-
|
|
1530
|
+
var import_react_aria_components4 = require("react-aria-components");
|
|
1531
|
+
var import_system27 = require("@marigold/system");
|
|
1532
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1533
|
+
var _Headline = ({
|
|
1649
1534
|
variant,
|
|
1650
1535
|
size,
|
|
1536
|
+
children,
|
|
1651
1537
|
align = "left",
|
|
1652
1538
|
color,
|
|
1653
|
-
level =
|
|
1654
|
-
as = `h${level}`,
|
|
1539
|
+
level = 1,
|
|
1655
1540
|
...props
|
|
1656
1541
|
}) => {
|
|
1657
|
-
const theme = (0,
|
|
1658
|
-
const classNames2 = (0,
|
|
1542
|
+
const theme = (0, import_system27.useTheme)();
|
|
1543
|
+
const classNames2 = (0, import_system27.useClassNames)({
|
|
1659
1544
|
component: "Headline",
|
|
1660
1545
|
variant,
|
|
1661
1546
|
size: size != null ? size : `level-${level}`
|
|
1662
1547
|
});
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
Component,
|
|
1548
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1549
|
+
import_react_aria_components4.Heading,
|
|
1666
1550
|
{
|
|
1551
|
+
level: Number(level),
|
|
1667
1552
|
...props,
|
|
1668
|
-
className: (0,
|
|
1669
|
-
style: (0,
|
|
1670
|
-
color: color && theme.colors && (0,
|
|
1553
|
+
className: (0, import_system27.cn)(classNames2, "text-[--color]", import_system27.textAlign[align]),
|
|
1554
|
+
style: (0, import_system27.createVar)({
|
|
1555
|
+
color: color && theme.colors && (0, import_system27.get)(
|
|
1671
1556
|
theme.colors,
|
|
1672
1557
|
color.replace("-", "."),
|
|
1673
1558
|
color
|
|
@@ -1686,7 +1571,7 @@ var useDialogContext = () => (0, import_react22.useContext)(DialogContext);
|
|
|
1686
1571
|
|
|
1687
1572
|
// src/Dialog/DialogController.tsx
|
|
1688
1573
|
var import_overlays5 = require("@react-stately/overlays");
|
|
1689
|
-
var
|
|
1574
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1690
1575
|
var DialogController = ({
|
|
1691
1576
|
children,
|
|
1692
1577
|
dismissable = true,
|
|
@@ -1699,7 +1584,7 @@ var DialogController = ({
|
|
|
1699
1584
|
onOpenChange
|
|
1700
1585
|
});
|
|
1701
1586
|
const ctx = { open: state.isOpen, close: state.close };
|
|
1702
|
-
return /* @__PURE__ */ (0,
|
|
1587
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(DialogContext.Provider, { value: ctx, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Overlay, { open: state.isOpen, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1703
1588
|
Modal,
|
|
1704
1589
|
{
|
|
1705
1590
|
open: state.isOpen,
|
|
@@ -1713,9 +1598,9 @@ var DialogController = ({
|
|
|
1713
1598
|
|
|
1714
1599
|
// src/Dialog/DialogTrigger.tsx
|
|
1715
1600
|
var import_react23 = require("react");
|
|
1716
|
-
var
|
|
1601
|
+
var import_interactions2 = require("@react-aria/interactions");
|
|
1717
1602
|
var import_overlays6 = require("@react-stately/overlays");
|
|
1718
|
-
var
|
|
1603
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
1719
1604
|
var DialogTrigger = ({
|
|
1720
1605
|
children,
|
|
1721
1606
|
dismissable = true,
|
|
@@ -1725,9 +1610,9 @@ var DialogTrigger = ({
|
|
|
1725
1610
|
const dialogTriggerRef = (0, import_react23.useRef)(null);
|
|
1726
1611
|
const state = (0, import_overlays6.useOverlayTriggerState)({});
|
|
1727
1612
|
const ctx = { open: state.isOpen, close: state.close };
|
|
1728
|
-
return /* @__PURE__ */ (0,
|
|
1729
|
-
/* @__PURE__ */ (0,
|
|
1730
|
-
|
|
1613
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(DialogContext.Provider, { value: ctx, children: [
|
|
1614
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
1615
|
+
import_interactions2.PressResponder,
|
|
1731
1616
|
{
|
|
1732
1617
|
ref: dialogTriggerRef,
|
|
1733
1618
|
isPressed: state.isOpen,
|
|
@@ -1735,7 +1620,7 @@ var DialogTrigger = ({
|
|
|
1735
1620
|
children: dialogTrigger
|
|
1736
1621
|
}
|
|
1737
1622
|
),
|
|
1738
|
-
/* @__PURE__ */ (0,
|
|
1623
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Overlay, { open: state.isOpen, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
1739
1624
|
Modal,
|
|
1740
1625
|
{
|
|
1741
1626
|
open: state.isOpen,
|
|
@@ -1749,26 +1634,26 @@ var DialogTrigger = ({
|
|
|
1749
1634
|
};
|
|
1750
1635
|
|
|
1751
1636
|
// src/Dialog/Dialog.tsx
|
|
1752
|
-
var
|
|
1637
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
1753
1638
|
var CloseButton = ({ className }) => {
|
|
1754
1639
|
const ref = (0, import_react24.useRef)(null);
|
|
1755
1640
|
const { close } = useDialogContext();
|
|
1756
|
-
const { buttonProps } = (0,
|
|
1641
|
+
const { buttonProps } = (0, import_button3.useButton)(
|
|
1757
1642
|
{
|
|
1758
1643
|
onPress: () => close == null ? void 0 : close()
|
|
1759
1644
|
},
|
|
1760
1645
|
ref
|
|
1761
1646
|
);
|
|
1762
|
-
return /* @__PURE__ */ (0,
|
|
1647
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "flex justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
1763
1648
|
"button",
|
|
1764
1649
|
{
|
|
1765
|
-
className: (0,
|
|
1650
|
+
className: (0, import_system28.cn)(
|
|
1766
1651
|
"h-4 w-4 cursor-pointer border-none p-0 leading-normal outline-0",
|
|
1767
1652
|
className
|
|
1768
1653
|
),
|
|
1769
1654
|
ref,
|
|
1770
1655
|
...buttonProps,
|
|
1771
|
-
children: /* @__PURE__ */ (0,
|
|
1656
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("svg", { viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
1772
1657
|
"path",
|
|
1773
1658
|
{
|
|
1774
1659
|
fillRule: "evenodd",
|
|
@@ -1782,7 +1667,7 @@ var CloseButton = ({ className }) => {
|
|
|
1782
1667
|
var addTitleProps = (children, titleProps) => {
|
|
1783
1668
|
const childs = import_react24.Children.toArray(children);
|
|
1784
1669
|
const titleIndex = childs.findIndex(
|
|
1785
|
-
(child) => (0, import_react24.isValidElement)(child) && (child.type === Header || child.type ===
|
|
1670
|
+
(child) => (0, import_react24.isValidElement)(child) && (child.type === Header || child.type === _Headline)
|
|
1786
1671
|
);
|
|
1787
1672
|
if (titleIndex < 0) {
|
|
1788
1673
|
console.warn(
|
|
@@ -1807,9 +1692,9 @@ var Dialog = ({
|
|
|
1807
1692
|
const ref = (0, import_react24.useRef)(null);
|
|
1808
1693
|
const { close } = useDialogContext();
|
|
1809
1694
|
const { dialogProps, titleProps } = (0, import_dialog.useDialog)(props, ref);
|
|
1810
|
-
const classNames2 = (0,
|
|
1811
|
-
return /* @__PURE__ */ (0,
|
|
1812
|
-
closeButton && /* @__PURE__ */ (0,
|
|
1695
|
+
const classNames2 = (0, import_system28.useClassNames)({ component: "Dialog", variant, size });
|
|
1696
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: classNames2.container, ...dialogProps, children: [
|
|
1697
|
+
closeButton && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(CloseButton, { className: classNames2.closeButton }),
|
|
1813
1698
|
typeof children === "function" ? children({ close, titleProps }) : props["aria-labelledby"] ? children : addTitleProps(children, titleProps)
|
|
1814
1699
|
] });
|
|
1815
1700
|
};
|
|
@@ -1817,26 +1702,25 @@ Dialog.Trigger = DialogTrigger;
|
|
|
1817
1702
|
Dialog.Controller = DialogController;
|
|
1818
1703
|
|
|
1819
1704
|
// src/Divider/Divider.tsx
|
|
1820
|
-
var
|
|
1821
|
-
var
|
|
1822
|
-
var
|
|
1823
|
-
var
|
|
1824
|
-
const
|
|
1825
|
-
|
|
1826
|
-
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: classNames2, ...props, ...separatorProps });
|
|
1705
|
+
var import_react_aria_components5 = require("react-aria-components");
|
|
1706
|
+
var import_system29 = require("@marigold/system");
|
|
1707
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
1708
|
+
var _Divider = ({ variant, ...props }) => {
|
|
1709
|
+
const classNames2 = (0, import_system29.useClassNames)({ component: "Divider", variant });
|
|
1710
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react_aria_components5.Separator, { className: classNames2, ...props });
|
|
1827
1711
|
};
|
|
1828
1712
|
|
|
1829
1713
|
// src/Footer/Footer.tsx
|
|
1830
|
-
var
|
|
1831
|
-
var
|
|
1714
|
+
var import_system30 = require("@marigold/system");
|
|
1715
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
1832
1716
|
var Footer = ({ children, variant, size, ...props }) => {
|
|
1833
|
-
const classNames2 = (0,
|
|
1834
|
-
return /* @__PURE__ */ (0,
|
|
1717
|
+
const classNames2 = (0, import_system30.useClassNames)({ component: "Footer", variant, size });
|
|
1718
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("footer", { ...props, className: classNames2, children });
|
|
1835
1719
|
};
|
|
1836
1720
|
|
|
1837
1721
|
// src/Image/Image.tsx
|
|
1838
|
-
var
|
|
1839
|
-
var
|
|
1722
|
+
var import_system31 = require("@marigold/system");
|
|
1723
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
1840
1724
|
var Image = ({
|
|
1841
1725
|
variant,
|
|
1842
1726
|
size,
|
|
@@ -1844,25 +1728,25 @@ var Image = ({
|
|
|
1844
1728
|
position = "none",
|
|
1845
1729
|
...props
|
|
1846
1730
|
}) => {
|
|
1847
|
-
const classNames2 = (0,
|
|
1848
|
-
return /* @__PURE__ */ (0,
|
|
1731
|
+
const classNames2 = (0, import_system31.useClassNames)({ component: "Image", variant, size });
|
|
1732
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
1849
1733
|
"img",
|
|
1850
1734
|
{
|
|
1851
1735
|
...props,
|
|
1852
1736
|
alt: props.alt,
|
|
1853
|
-
className: (0,
|
|
1737
|
+
className: (0, import_system31.cn)(
|
|
1854
1738
|
fit !== "none" && "h-full w-full",
|
|
1855
1739
|
classNames2,
|
|
1856
|
-
|
|
1857
|
-
|
|
1740
|
+
import_system31.objectFit[fit],
|
|
1741
|
+
import_system31.objectPosition[position]
|
|
1858
1742
|
)
|
|
1859
1743
|
}
|
|
1860
1744
|
);
|
|
1861
1745
|
};
|
|
1862
1746
|
|
|
1863
1747
|
// src/Inline/Inline.tsx
|
|
1864
|
-
var
|
|
1865
|
-
var
|
|
1748
|
+
var import_system32 = require("@marigold/system");
|
|
1749
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
1866
1750
|
var Inline = ({
|
|
1867
1751
|
space = 0,
|
|
1868
1752
|
orientation,
|
|
@@ -1872,15 +1756,15 @@ var Inline = ({
|
|
|
1872
1756
|
...props
|
|
1873
1757
|
}) => {
|
|
1874
1758
|
var _a2, _b2, _c, _d;
|
|
1875
|
-
return /* @__PURE__ */ (0,
|
|
1759
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
1876
1760
|
"div",
|
|
1877
1761
|
{
|
|
1878
1762
|
...props,
|
|
1879
|
-
className: (0,
|
|
1763
|
+
className: (0, import_system32.cn)(
|
|
1880
1764
|
"flex flex-wrap",
|
|
1881
|
-
|
|
1882
|
-
alignX && ((_b2 = (_a2 =
|
|
1883
|
-
alignY && ((_d = (_c =
|
|
1765
|
+
import_system32.gapSpace[space],
|
|
1766
|
+
alignX && ((_b2 = (_a2 = import_system32.alignment) == null ? void 0 : _a2.horizontal) == null ? void 0 : _b2.alignmentX[alignX]),
|
|
1767
|
+
alignY && ((_d = (_c = import_system32.alignment) == null ? void 0 : _c.horizontal) == null ? void 0 : _d.alignmentY[alignY])
|
|
1884
1768
|
),
|
|
1885
1769
|
children
|
|
1886
1770
|
}
|
|
@@ -1891,20 +1775,20 @@ var Inline = ({
|
|
|
1891
1775
|
var import_date = require("@internationalized/date");
|
|
1892
1776
|
var import_react26 = require("react");
|
|
1893
1777
|
var import_datepicker2 = require("@react-aria/datepicker");
|
|
1894
|
-
var
|
|
1778
|
+
var import_focus7 = require("@react-aria/focus");
|
|
1895
1779
|
var import_i18n3 = require("@react-aria/i18n");
|
|
1896
|
-
var
|
|
1897
|
-
var
|
|
1780
|
+
var import_interactions3 = require("@react-aria/interactions");
|
|
1781
|
+
var import_utils11 = require("@react-aria/utils");
|
|
1898
1782
|
var import_datepicker3 = require("@react-stately/datepicker");
|
|
1899
|
-
var
|
|
1783
|
+
var import_system34 = require("@marigold/system");
|
|
1900
1784
|
|
|
1901
1785
|
// src/DateField/DateSegment.tsx
|
|
1902
1786
|
var import_react25 = require("react");
|
|
1903
1787
|
var import_datepicker = require("@react-aria/datepicker");
|
|
1904
|
-
var
|
|
1905
|
-
var
|
|
1906
|
-
var
|
|
1907
|
-
var
|
|
1788
|
+
var import_focus6 = require("@react-aria/focus");
|
|
1789
|
+
var import_utils10 = require("@react-aria/utils");
|
|
1790
|
+
var import_system33 = require("@marigold/system");
|
|
1791
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
1908
1792
|
var DateSegment = ({
|
|
1909
1793
|
className,
|
|
1910
1794
|
segment,
|
|
@@ -1913,21 +1797,21 @@ var DateSegment = ({
|
|
|
1913
1797
|
}) => {
|
|
1914
1798
|
const ref = (0, import_react25.useRef)(null);
|
|
1915
1799
|
const { segmentProps } = (0, import_datepicker.useDateSegment)(segment, state, ref);
|
|
1916
|
-
const { focusProps, isFocused } = (0,
|
|
1800
|
+
const { focusProps, isFocused } = (0, import_focus6.useFocusRing)({
|
|
1917
1801
|
within: true,
|
|
1918
1802
|
isTextInput: true
|
|
1919
1803
|
});
|
|
1920
|
-
const stateProps = (0,
|
|
1804
|
+
const stateProps = (0, import_system33.useStateProps)({
|
|
1921
1805
|
disabled: state.isDisabled,
|
|
1922
1806
|
focusVisible: isFocused
|
|
1923
1807
|
});
|
|
1924
1808
|
const { isPlaceholder, placeholder, text, type, maxValue } = segment;
|
|
1925
|
-
return /* @__PURE__ */ (0,
|
|
1809
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
1926
1810
|
"div",
|
|
1927
1811
|
{
|
|
1928
|
-
...(0,
|
|
1812
|
+
...(0, import_utils10.mergeProps)(segmentProps, stateProps, focusProps),
|
|
1929
1813
|
ref,
|
|
1930
|
-
className: (0,
|
|
1814
|
+
className: (0, import_system33.cn)(
|
|
1931
1815
|
"group/segment",
|
|
1932
1816
|
"text-center leading-none outline-0",
|
|
1933
1817
|
type !== "literal" && "p-0.5",
|
|
@@ -1938,25 +1822,25 @@ var DateSegment = ({
|
|
|
1938
1822
|
minWidth: maxValue != null ? String(maxValue).length + "ch" : void 0
|
|
1939
1823
|
},
|
|
1940
1824
|
children: [
|
|
1941
|
-
/* @__PURE__ */ (0,
|
|
1825
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
1942
1826
|
"span",
|
|
1943
1827
|
{
|
|
1944
1828
|
"aria-hidden": "true",
|
|
1945
|
-
className: (0,
|
|
1829
|
+
className: (0, import_system33.cn)(
|
|
1946
1830
|
isPlaceholder ? "visible block" : "invisible hidden",
|
|
1947
1831
|
"pointer-events-none w-full text-center"
|
|
1948
1832
|
),
|
|
1949
1833
|
children: isPlaceholder && (placeholder == null ? void 0 : placeholder.toUpperCase())
|
|
1950
1834
|
}
|
|
1951
1835
|
),
|
|
1952
|
-
/* @__PURE__ */ (0,
|
|
1836
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { children: isPlaceholder ? "" : type === "month" || type === "day" ? Number(text) < 10 ? "0" + text : text : text })
|
|
1953
1837
|
]
|
|
1954
1838
|
}
|
|
1955
1839
|
);
|
|
1956
1840
|
};
|
|
1957
1841
|
|
|
1958
1842
|
// src/DateField/DateField.tsx
|
|
1959
|
-
var
|
|
1843
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
1960
1844
|
var DateField = ({
|
|
1961
1845
|
disabled,
|
|
1962
1846
|
readOnly,
|
|
@@ -1991,14 +1875,14 @@ var DateField = ({
|
|
|
1991
1875
|
state,
|
|
1992
1876
|
ref
|
|
1993
1877
|
);
|
|
1994
|
-
const classNames2 = (0,
|
|
1995
|
-
const { focusProps, isFocused } = (0,
|
|
1878
|
+
const classNames2 = (0, import_system34.useClassNames)({ component: "DateField", variant, size });
|
|
1879
|
+
const { focusProps, isFocused } = (0, import_focus7.useFocusRing)({
|
|
1996
1880
|
within: true,
|
|
1997
1881
|
isTextInput: true,
|
|
1998
1882
|
autoFocus: props.autoFocus
|
|
1999
1883
|
});
|
|
2000
|
-
const { hoverProps, isHovered } = (0,
|
|
2001
|
-
const stateProps = (0,
|
|
1884
|
+
const { hoverProps, isHovered } = (0, import_interactions3.useHover)({ isDisabled: disabled });
|
|
1885
|
+
const stateProps = (0, import_system34.useStateProps)({
|
|
2002
1886
|
hover: isHovered,
|
|
2003
1887
|
error,
|
|
2004
1888
|
readOnly,
|
|
@@ -2006,7 +1890,7 @@ var DateField = ({
|
|
|
2006
1890
|
required,
|
|
2007
1891
|
focus: isFocused || isPressed
|
|
2008
1892
|
});
|
|
2009
|
-
return /* @__PURE__ */ (0,
|
|
1893
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
2010
1894
|
FieldBase,
|
|
2011
1895
|
{
|
|
2012
1896
|
error,
|
|
@@ -2021,11 +1905,11 @@ var DateField = ({
|
|
|
2021
1905
|
variant,
|
|
2022
1906
|
size,
|
|
2023
1907
|
width,
|
|
2024
|
-
children: /* @__PURE__ */ (0,
|
|
1908
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
2025
1909
|
"div",
|
|
2026
1910
|
{
|
|
2027
|
-
...(0,
|
|
2028
|
-
className: (0,
|
|
1911
|
+
...(0, import_utils11.mergeProps)(fieldProps, focusProps, stateProps, hoverProps),
|
|
1912
|
+
className: (0, import_system34.cn)(
|
|
2029
1913
|
"relative flex flex-row flex-nowrap",
|
|
2030
1914
|
"cursor-text aria-disabled:cursor-not-allowed",
|
|
2031
1915
|
classNames2.field
|
|
@@ -2033,9 +1917,9 @@ var DateField = ({
|
|
|
2033
1917
|
"data-testid": "date-field",
|
|
2034
1918
|
ref: triggerRef,
|
|
2035
1919
|
children: [
|
|
2036
|
-
/* @__PURE__ */ (0,
|
|
1920
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { ref, className: "flex basis-full items-center", children: state.segments.map((segment, i) => {
|
|
2037
1921
|
var _a;
|
|
2038
|
-
return /* @__PURE__ */ (0,
|
|
1922
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
2039
1923
|
DateSegment,
|
|
2040
1924
|
{
|
|
2041
1925
|
className: classNames2.segment,
|
|
@@ -2046,15 +1930,15 @@ var DateField = ({
|
|
|
2046
1930
|
i
|
|
2047
1931
|
);
|
|
2048
1932
|
}) }),
|
|
2049
|
-
action ? action : /* @__PURE__ */ (0,
|
|
1933
|
+
action ? action : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
2050
1934
|
"svg",
|
|
2051
1935
|
{
|
|
2052
1936
|
"data-testid": "action",
|
|
2053
|
-
className: (0,
|
|
1937
|
+
className: (0, import_system34.cn)(classNames2.action),
|
|
2054
1938
|
viewBox: "0 0 24 24",
|
|
2055
1939
|
width: 24,
|
|
2056
1940
|
height: 24,
|
|
2057
|
-
children: /* @__PURE__ */ (0,
|
|
1941
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("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" })
|
|
2058
1942
|
}
|
|
2059
1943
|
) })
|
|
2060
1944
|
]
|
|
@@ -2071,7 +1955,7 @@ var import_calendar3 = require("@react-aria/calendar");
|
|
|
2071
1955
|
var import_i18n9 = require("@react-aria/i18n");
|
|
2072
1956
|
var import_calendar4 = require("@react-stately/calendar");
|
|
2073
1957
|
var import_icons = require("@marigold/icons");
|
|
2074
|
-
var
|
|
1958
|
+
var import_system37 = require("@marigold/system");
|
|
2075
1959
|
|
|
2076
1960
|
// src/Calendar/CalendarGrid.tsx
|
|
2077
1961
|
var import_date2 = require("@internationalized/date");
|
|
@@ -2083,43 +1967,43 @@ var import_i18n5 = require("@react-aria/i18n");
|
|
|
2083
1967
|
// src/Calendar/CalendarCell.tsx
|
|
2084
1968
|
var import_react27 = require("react");
|
|
2085
1969
|
var import_calendar = require("@react-aria/calendar");
|
|
2086
|
-
var
|
|
2087
|
-
var
|
|
2088
|
-
var
|
|
2089
|
-
var
|
|
1970
|
+
var import_interactions4 = require("@react-aria/interactions");
|
|
1971
|
+
var import_utils12 = require("@react-aria/utils");
|
|
1972
|
+
var import_system35 = require("@marigold/system");
|
|
1973
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
2090
1974
|
var CalendarCell = (props) => {
|
|
2091
1975
|
const ref = (0, import_react27.useRef)(null);
|
|
2092
1976
|
const { state } = props;
|
|
2093
1977
|
let { cellProps, buttonProps, formattedDate, isOutsideVisibleRange } = (0, import_calendar.useCalendarCell)(props, state, ref);
|
|
2094
|
-
const classNames2 = (0,
|
|
1978
|
+
const classNames2 = (0, import_system35.useClassNames)({
|
|
2095
1979
|
component: "Calendar"
|
|
2096
1980
|
});
|
|
2097
1981
|
const isDisabled = cellProps["aria-disabled"];
|
|
2098
|
-
const { hoverProps, isHovered } = (0,
|
|
1982
|
+
const { hoverProps, isHovered } = (0, import_interactions4.useHover)({
|
|
2099
1983
|
isDisabled: isDisabled || cellProps["aria-selected"]
|
|
2100
1984
|
});
|
|
2101
|
-
const stateProps = (0,
|
|
1985
|
+
const stateProps = (0, import_system35.useStateProps)({
|
|
2102
1986
|
disabled: isDisabled,
|
|
2103
1987
|
hover: isHovered,
|
|
2104
1988
|
selected: cellProps["aria-selected"]
|
|
2105
1989
|
});
|
|
2106
|
-
return /* @__PURE__ */ (0,
|
|
1990
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("td", { className: "group/cell", ...cellProps, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
2107
1991
|
"div",
|
|
2108
1992
|
{
|
|
2109
|
-
className: (0,
|
|
1993
|
+
className: (0, import_system35.cn)(
|
|
2110
1994
|
"flex h-[30px] w-[30px] cursor-pointer items-center justify-center rounded-full p-[5.3px] text-sm font-normal aria-disabled:cursor-default",
|
|
2111
1995
|
classNames2.calendarCell
|
|
2112
1996
|
),
|
|
2113
1997
|
hidden: isOutsideVisibleRange,
|
|
2114
1998
|
ref,
|
|
2115
|
-
...(0,
|
|
1999
|
+
...(0, import_utils12.mergeProps)(buttonProps, stateProps, hoverProps),
|
|
2116
2000
|
children: formattedDate
|
|
2117
2001
|
}
|
|
2118
2002
|
) });
|
|
2119
2003
|
};
|
|
2120
2004
|
|
|
2121
2005
|
// src/Calendar/CalendarGrid.tsx
|
|
2122
|
-
var
|
|
2006
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
2123
2007
|
var CalendarGrid = ({ state, ...props }) => {
|
|
2124
2008
|
const { locale } = (0, import_i18n4.useLocale)();
|
|
2125
2009
|
const { gridProps, headerProps } = (0, import_calendar2.useCalendarGrid)(props, state);
|
|
@@ -2139,23 +2023,23 @@ var CalendarGrid = ({ state, ...props }) => {
|
|
|
2139
2023
|
return dayFormatter.format(dateDay);
|
|
2140
2024
|
});
|
|
2141
2025
|
}, [locale, state.timeZone, dayFormatter]);
|
|
2142
|
-
return /* @__PURE__ */ (0,
|
|
2026
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
2143
2027
|
"table",
|
|
2144
2028
|
{
|
|
2145
2029
|
className: "w-full border-spacing-[6px]",
|
|
2146
2030
|
...gridProps,
|
|
2147
2031
|
cellPadding: "8",
|
|
2148
2032
|
children: [
|
|
2149
|
-
/* @__PURE__ */ (0,
|
|
2150
|
-
/* @__PURE__ */ (0,
|
|
2151
|
-
(date, i) => date ? /* @__PURE__ */ (0,
|
|
2033
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("thead", { ...headerProps, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("tr", { children: weekDays.map((day, index) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("th", { style: { fontWeight: "bolder" }, children: day.substring(0, 2) }, index)) }) }),
|
|
2034
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("tbody", { children: [...new Array(numberOfWeeksInMonth).keys()].map((weekIndex) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("tr", { children: state.getDatesInWeek(weekIndex).map(
|
|
2035
|
+
(date, i) => date ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
2152
2036
|
CalendarCell,
|
|
2153
2037
|
{
|
|
2154
2038
|
date,
|
|
2155
2039
|
state
|
|
2156
2040
|
},
|
|
2157
2041
|
i
|
|
2158
|
-
) : /* @__PURE__ */ (0,
|
|
2042
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("td", {}, i)
|
|
2159
2043
|
) }, weekIndex)) })
|
|
2160
2044
|
]
|
|
2161
2045
|
}
|
|
@@ -2167,14 +2051,14 @@ var import_i18n7 = require("@react-aria/i18n");
|
|
|
2167
2051
|
|
|
2168
2052
|
// src/Select/Select.tsx
|
|
2169
2053
|
var import_react29 = require("react");
|
|
2170
|
-
var
|
|
2171
|
-
var
|
|
2054
|
+
var import_button4 = require("@react-aria/button");
|
|
2055
|
+
var import_focus8 = require("@react-aria/focus");
|
|
2172
2056
|
var import_i18n6 = require("@react-aria/i18n");
|
|
2173
2057
|
var import_select = require("@react-aria/select");
|
|
2174
|
-
var
|
|
2058
|
+
var import_utils13 = require("@react-aria/utils");
|
|
2175
2059
|
var import_collections4 = require("@react-stately/collections");
|
|
2176
2060
|
var import_select2 = require("@react-stately/select");
|
|
2177
|
-
var
|
|
2061
|
+
var import_system36 = require("@marigold/system");
|
|
2178
2062
|
|
|
2179
2063
|
// src/Select/intl.ts
|
|
2180
2064
|
var messages = {
|
|
@@ -2187,7 +2071,7 @@ var messages = {
|
|
|
2187
2071
|
};
|
|
2188
2072
|
|
|
2189
2073
|
// src/Select/Select.tsx
|
|
2190
|
-
var
|
|
2074
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
2191
2075
|
var Select = (0, import_react29.forwardRef)(
|
|
2192
2076
|
({
|
|
2193
2077
|
variant,
|
|
@@ -2210,7 +2094,7 @@ var Select = (0, import_react29.forwardRef)(
|
|
|
2210
2094
|
onSelectionChange: onChange,
|
|
2211
2095
|
...rest
|
|
2212
2096
|
};
|
|
2213
|
-
const buttonRef = (0,
|
|
2097
|
+
const buttonRef = (0, import_utils13.useObjectRef)(ref);
|
|
2214
2098
|
const listboxRef = (0, import_react29.useRef)(null);
|
|
2215
2099
|
const state = (0, import_select2.useSelectState)(props);
|
|
2216
2100
|
const {
|
|
@@ -2221,28 +2105,28 @@ var Select = (0, import_react29.forwardRef)(
|
|
|
2221
2105
|
descriptionProps,
|
|
2222
2106
|
errorMessageProps
|
|
2223
2107
|
} = (0, import_select.useSelect)(props, state, buttonRef);
|
|
2224
|
-
const { buttonProps } = (0,
|
|
2108
|
+
const { buttonProps } = (0, import_button4.useButton)(
|
|
2225
2109
|
{ isDisabled: disabled, ...triggerProps },
|
|
2226
2110
|
buttonRef
|
|
2227
2111
|
);
|
|
2228
|
-
const { focusProps, isFocusVisible } = (0,
|
|
2229
|
-
const classNames2 = (0,
|
|
2230
|
-
const isSmallScreen = (0,
|
|
2231
|
-
const stateProps = (0,
|
|
2112
|
+
const { focusProps, isFocusVisible } = (0, import_focus8.useFocusRing)();
|
|
2113
|
+
const classNames2 = (0, import_system36.useClassNames)({ component: "Select", variant, size });
|
|
2114
|
+
const isSmallScreen = (0, import_system36.useSmallScreen)();
|
|
2115
|
+
const stateProps = (0, import_system36.useStateProps)({
|
|
2232
2116
|
disabled,
|
|
2233
2117
|
error,
|
|
2234
2118
|
focusVisible: isFocusVisible,
|
|
2235
2119
|
expanded: state.isOpen,
|
|
2236
2120
|
required
|
|
2237
2121
|
});
|
|
2238
|
-
return /* @__PURE__ */ (0,
|
|
2122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
2239
2123
|
FieldBase,
|
|
2240
2124
|
{
|
|
2241
2125
|
variant,
|
|
2242
2126
|
size,
|
|
2243
2127
|
width,
|
|
2244
2128
|
label: props.label,
|
|
2245
|
-
labelProps: {
|
|
2129
|
+
labelProps: { elementType: "span", ...labelProps },
|
|
2246
2130
|
description: props.description,
|
|
2247
2131
|
descriptionProps,
|
|
2248
2132
|
error,
|
|
@@ -2251,7 +2135,7 @@ var Select = (0, import_react29.forwardRef)(
|
|
|
2251
2135
|
stateProps,
|
|
2252
2136
|
disabled,
|
|
2253
2137
|
children: [
|
|
2254
|
-
/* @__PURE__ */ (0,
|
|
2138
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
2255
2139
|
import_select.HiddenSelect,
|
|
2256
2140
|
{
|
|
2257
2141
|
state,
|
|
@@ -2261,23 +2145,23 @@ var Select = (0, import_react29.forwardRef)(
|
|
|
2261
2145
|
isDisabled: disabled
|
|
2262
2146
|
}
|
|
2263
2147
|
),
|
|
2264
|
-
/* @__PURE__ */ (0,
|
|
2148
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
2265
2149
|
"button",
|
|
2266
2150
|
{
|
|
2267
|
-
className: (0,
|
|
2151
|
+
className: (0, import_system36.cn)(
|
|
2268
2152
|
"flex w-full items-center justify-between gap-1 overflow-hidden",
|
|
2269
2153
|
classNames2.select
|
|
2270
2154
|
),
|
|
2271
2155
|
ref: buttonRef,
|
|
2272
|
-
...(0,
|
|
2156
|
+
...(0, import_utils13.mergeProps)(buttonProps, focusProps),
|
|
2273
2157
|
...stateProps,
|
|
2274
2158
|
children: [
|
|
2275
|
-
/* @__PURE__ */ (0,
|
|
2276
|
-
/* @__PURE__ */ (0,
|
|
2159
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "overflow-hidden whitespace-nowrap", ...valueProps, children: state.selectedItem ? state.selectedItem.rendered : props.placeholder }),
|
|
2160
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(ChevronDown, { className: "h-4 w-4" })
|
|
2277
2161
|
]
|
|
2278
2162
|
}
|
|
2279
2163
|
),
|
|
2280
|
-
isSmallScreen ? /* @__PURE__ */ (0,
|
|
2164
|
+
isSmallScreen ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Tray, { state, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
2281
2165
|
ListBox,
|
|
2282
2166
|
{
|
|
2283
2167
|
ref: listboxRef,
|
|
@@ -2286,7 +2170,7 @@ var Select = (0, import_react29.forwardRef)(
|
|
|
2286
2170
|
size,
|
|
2287
2171
|
...menuProps
|
|
2288
2172
|
}
|
|
2289
|
-
) }) : /* @__PURE__ */ (0,
|
|
2173
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(Popover, { state, triggerRef: buttonRef, scrollRef: listboxRef, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
2290
2174
|
ListBox,
|
|
2291
2175
|
{
|
|
2292
2176
|
ref: listboxRef,
|
|
@@ -2305,7 +2189,7 @@ Select.Option = import_collections4.Item;
|
|
|
2305
2189
|
Select.Section = import_collections4.Section;
|
|
2306
2190
|
|
|
2307
2191
|
// src/Calendar/MonthDropdown.tsx
|
|
2308
|
-
var
|
|
2192
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
2309
2193
|
var MonthDropdown = ({ state }) => {
|
|
2310
2194
|
let months = [];
|
|
2311
2195
|
let formatter = (0, import_i18n7.useDateFormatter)({
|
|
@@ -2322,7 +2206,7 @@ var MonthDropdown = ({ state }) => {
|
|
|
2322
2206
|
let date = state.focusedDate.set({ month: value });
|
|
2323
2207
|
state.setFocusedDate(date);
|
|
2324
2208
|
};
|
|
2325
|
-
return /* @__PURE__ */ (0,
|
|
2209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
2326
2210
|
Select,
|
|
2327
2211
|
{
|
|
2328
2212
|
"aria-label": "Month",
|
|
@@ -2330,7 +2214,7 @@ var MonthDropdown = ({ state }) => {
|
|
|
2330
2214
|
selectedKey: String(state.focusedDate.month),
|
|
2331
2215
|
"data-testid": "month",
|
|
2332
2216
|
disabled: state.isDisabled,
|
|
2333
|
-
children: months.map((month, i) => /* @__PURE__ */ (0,
|
|
2217
|
+
children: months.map((month, i) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Select.Option, { children: month.substring(0, 3) }, i + 1))
|
|
2334
2218
|
}
|
|
2335
2219
|
);
|
|
2336
2220
|
};
|
|
@@ -2338,7 +2222,7 @@ var MonthDropdown_default = MonthDropdown;
|
|
|
2338
2222
|
|
|
2339
2223
|
// src/Calendar/YearDropdown.tsx
|
|
2340
2224
|
var import_i18n8 = require("@react-aria/i18n");
|
|
2341
|
-
var
|
|
2225
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
2342
2226
|
var YearDropdown = ({ state }) => {
|
|
2343
2227
|
const years = [];
|
|
2344
2228
|
let formatter = (0, import_i18n8.useDateFormatter)({
|
|
@@ -2357,7 +2241,7 @@ var YearDropdown = ({ state }) => {
|
|
|
2357
2241
|
let date = years[index].value;
|
|
2358
2242
|
state.setFocusedDate(date);
|
|
2359
2243
|
};
|
|
2360
|
-
return /* @__PURE__ */ (0,
|
|
2244
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
2361
2245
|
Select,
|
|
2362
2246
|
{
|
|
2363
2247
|
"aria-label": "Year",
|
|
@@ -2365,14 +2249,14 @@ var YearDropdown = ({ state }) => {
|
|
|
2365
2249
|
onChange,
|
|
2366
2250
|
"data-testid": "year",
|
|
2367
2251
|
disabled: state.isDisabled,
|
|
2368
|
-
children: years.map((year, i) => /* @__PURE__ */ (0,
|
|
2252
|
+
children: years.map((year, i) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Select.Option, { children: year.formatted }, i))
|
|
2369
2253
|
}
|
|
2370
2254
|
);
|
|
2371
2255
|
};
|
|
2372
2256
|
var YearDropdown_default = YearDropdown;
|
|
2373
2257
|
|
|
2374
2258
|
// src/Calendar/Calendar.tsx
|
|
2375
|
-
var
|
|
2259
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
2376
2260
|
var Calendar = ({
|
|
2377
2261
|
disabled,
|
|
2378
2262
|
readOnly,
|
|
@@ -2406,16 +2290,16 @@ var Calendar = ({
|
|
|
2406
2290
|
onFocusChange: nextFocusChange,
|
|
2407
2291
|
...nextPropsRest
|
|
2408
2292
|
} = nextButtonProps;
|
|
2409
|
-
const calendarState = (0,
|
|
2293
|
+
const calendarState = (0, import_system37.useStateProps)({
|
|
2410
2294
|
disabled: state.isDisabled,
|
|
2411
2295
|
focusVisible: state.isFocused
|
|
2412
2296
|
});
|
|
2413
|
-
const classNames2 = (0,
|
|
2414
|
-
return /* @__PURE__ */ (0,
|
|
2297
|
+
const classNames2 = (0, import_system37.useClassNames)({ component: "Calendar" });
|
|
2298
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
2415
2299
|
"div",
|
|
2416
2300
|
{
|
|
2417
2301
|
tabIndex: -1,
|
|
2418
|
-
className: (0,
|
|
2302
|
+
className: (0, import_system37.cn)(
|
|
2419
2303
|
"flex w-[360px] flex-col rounded-sm p-4 shadow-[0_4px_4px_rgba(165,165,165,0.25)]",
|
|
2420
2304
|
classNames2.calendar
|
|
2421
2305
|
),
|
|
@@ -2423,33 +2307,33 @@ var Calendar = ({
|
|
|
2423
2307
|
...calendarState,
|
|
2424
2308
|
ref,
|
|
2425
2309
|
children: [
|
|
2426
|
-
/* @__PURE__ */ (0,
|
|
2427
|
-
/* @__PURE__ */ (0,
|
|
2428
|
-
/* @__PURE__ */ (0,
|
|
2429
|
-
/* @__PURE__ */ (0,
|
|
2310
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "mb-4 flex items-center gap-[60px]", children: [
|
|
2311
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex min-w-[170px] gap-[9px] [&_div]:flex", children: [
|
|
2312
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(MonthDropdown_default, { state }),
|
|
2313
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(YearDropdown_default, { state })
|
|
2430
2314
|
] }),
|
|
2431
|
-
/* @__PURE__ */ (0,
|
|
2432
|
-
/* @__PURE__ */ (0,
|
|
2433
|
-
|
|
2315
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex w-full flex-nowrap justify-end gap-[10px] [&_button:disabled]:cursor-not-allowed [&_button]:px-2 [&_button]:py-1", children: [
|
|
2316
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
2317
|
+
_Button,
|
|
2434
2318
|
{
|
|
2435
2319
|
className: classNames2.calendarControllers,
|
|
2436
2320
|
...prevPropsRest,
|
|
2437
2321
|
disabled: prevIsDisabled,
|
|
2438
|
-
children: /* @__PURE__ */ (0,
|
|
2322
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_icons.ChevronLeft, {})
|
|
2439
2323
|
}
|
|
2440
2324
|
),
|
|
2441
|
-
/* @__PURE__ */ (0,
|
|
2442
|
-
|
|
2325
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
2326
|
+
_Button,
|
|
2443
2327
|
{
|
|
2444
2328
|
className: classNames2.calendarControllers,
|
|
2445
2329
|
...nextPropsRest,
|
|
2446
2330
|
disabled: nextIsDisabled,
|
|
2447
|
-
children: /* @__PURE__ */ (0,
|
|
2331
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_icons.ChevronRight, {})
|
|
2448
2332
|
}
|
|
2449
2333
|
)
|
|
2450
2334
|
] })
|
|
2451
2335
|
] }),
|
|
2452
|
-
/* @__PURE__ */ (0,
|
|
2336
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(CalendarGrid, { state })
|
|
2453
2337
|
]
|
|
2454
2338
|
}
|
|
2455
2339
|
);
|
|
@@ -2458,10 +2342,10 @@ var Calendar = ({
|
|
|
2458
2342
|
// src/DatePicker/DatePicker.tsx
|
|
2459
2343
|
var import_react31 = require("react");
|
|
2460
2344
|
var import_datepicker4 = require("@react-aria/datepicker");
|
|
2461
|
-
var
|
|
2345
|
+
var import_utils14 = require("@react-aria/utils");
|
|
2462
2346
|
var import_datepicker5 = require("@react-stately/datepicker");
|
|
2463
|
-
var
|
|
2464
|
-
var
|
|
2347
|
+
var import_system38 = require("@marigold/system");
|
|
2348
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
2465
2349
|
var DatePicker = ({
|
|
2466
2350
|
disabled,
|
|
2467
2351
|
required,
|
|
@@ -2486,7 +2370,7 @@ var DatePicker = ({
|
|
|
2486
2370
|
...props
|
|
2487
2371
|
});
|
|
2488
2372
|
const ref = (0, import_react31.useRef)(null);
|
|
2489
|
-
const stateProps = (0,
|
|
2373
|
+
const stateProps = (0, import_system38.useStateProps)({
|
|
2490
2374
|
focus: state.isOpen
|
|
2491
2375
|
});
|
|
2492
2376
|
const { groupProps, fieldProps, buttonProps, calendarProps } = (0, import_datepicker4.useDatePicker)(
|
|
@@ -2495,13 +2379,13 @@ var DatePicker = ({
|
|
|
2495
2379
|
ref
|
|
2496
2380
|
);
|
|
2497
2381
|
const { isDisabled, errorMessage, description, label } = props;
|
|
2498
|
-
const classNames2 = (0,
|
|
2382
|
+
const classNames2 = (0, import_system38.useClassNames)({
|
|
2499
2383
|
component: "DatePicker",
|
|
2500
2384
|
size,
|
|
2501
2385
|
variant
|
|
2502
2386
|
});
|
|
2503
|
-
return /* @__PURE__ */ (0,
|
|
2504
|
-
/* @__PURE__ */ (0,
|
|
2387
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
|
|
2388
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "flex w-full min-w-[300px]", ...groupProps, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
2505
2389
|
DateField,
|
|
2506
2390
|
{
|
|
2507
2391
|
...fieldProps,
|
|
@@ -2514,40 +2398,40 @@ var DatePicker = ({
|
|
|
2514
2398
|
description: !state.isOpen && description,
|
|
2515
2399
|
triggerRef: ref,
|
|
2516
2400
|
width,
|
|
2517
|
-
action: /* @__PURE__ */ (0,
|
|
2518
|
-
|
|
2401
|
+
action: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: classNames2.container, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
2402
|
+
_Button,
|
|
2519
2403
|
{
|
|
2520
|
-
...(0,
|
|
2521
|
-
className: (0,
|
|
2404
|
+
...(0, import_utils14.mergeProps)(buttonProps, stateProps),
|
|
2405
|
+
className: (0, import_system38.cn)("absolute right-0 top-0", classNames2.button),
|
|
2522
2406
|
disabled: isDisabled,
|
|
2523
|
-
children: /* @__PURE__ */ (0,
|
|
2407
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
2524
2408
|
"svg",
|
|
2525
2409
|
{
|
|
2526
2410
|
width: "24",
|
|
2527
2411
|
height: "24",
|
|
2528
2412
|
viewBox: "0 0 24 24",
|
|
2529
2413
|
fill: "currentColor",
|
|
2530
|
-
children: /* @__PURE__ */ (0,
|
|
2414
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("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" })
|
|
2531
2415
|
}
|
|
2532
2416
|
)
|
|
2533
2417
|
}
|
|
2534
2418
|
) })
|
|
2535
2419
|
}
|
|
2536
2420
|
) }),
|
|
2537
|
-
state.isOpen && /* @__PURE__ */ (0,
|
|
2421
|
+
state.isOpen && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Popover, { triggerRef: ref, state, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Calendar, { disabled, ...calendarProps }) })
|
|
2538
2422
|
] });
|
|
2539
2423
|
};
|
|
2540
2424
|
|
|
2541
2425
|
// src/Inset/Inset.tsx
|
|
2542
|
-
var
|
|
2543
|
-
var
|
|
2544
|
-
var Inset = ({ space, spaceX, spaceY, children }) => /* @__PURE__ */ (0,
|
|
2426
|
+
var import_system39 = require("@marigold/system");
|
|
2427
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
2428
|
+
var Inset = ({ space, spaceX, spaceY, children }) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
2545
2429
|
"div",
|
|
2546
2430
|
{
|
|
2547
|
-
className: (0,
|
|
2548
|
-
space &&
|
|
2549
|
-
!space && spaceX &&
|
|
2550
|
-
!space && spaceY &&
|
|
2431
|
+
className: (0, import_system39.cn)(
|
|
2432
|
+
space && import_system39.paddingSpace[space],
|
|
2433
|
+
!space && spaceX && import_system39.paddingSpaceX[spaceX],
|
|
2434
|
+
!space && spaceY && import_system39.paddingSpaceY[spaceY]
|
|
2551
2435
|
),
|
|
2552
2436
|
children
|
|
2553
2437
|
}
|
|
@@ -2555,52 +2439,22 @@ var Inset = ({ space, spaceX, spaceY, children }) => /* @__PURE__ */ (0, import_
|
|
|
2555
2439
|
|
|
2556
2440
|
// src/Link/Link.tsx
|
|
2557
2441
|
var import_react32 = require("react");
|
|
2558
|
-
var
|
|
2559
|
-
var
|
|
2560
|
-
var
|
|
2561
|
-
var
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
as = "a",
|
|
2565
|
-
variant,
|
|
2566
|
-
size,
|
|
2567
|
-
children,
|
|
2568
|
-
disabled,
|
|
2569
|
-
onPress,
|
|
2570
|
-
onPressStart,
|
|
2571
|
-
...props
|
|
2572
|
-
}, ref) => {
|
|
2573
|
-
const linkRef = (0, import_utils17.useObjectRef)(ref);
|
|
2574
|
-
const { linkProps } = (0, import_link.useLink)(
|
|
2575
|
-
{
|
|
2576
|
-
...props,
|
|
2577
|
-
elementType: typeof as === "string" ? as : "span",
|
|
2578
|
-
isDisabled: disabled
|
|
2579
|
-
},
|
|
2580
|
-
linkRef
|
|
2581
|
-
);
|
|
2582
|
-
const Component = as;
|
|
2583
|
-
const classNames2 = (0, import_system41.useClassNames)({
|
|
2442
|
+
var import_react_aria_components6 = require("react-aria-components");
|
|
2443
|
+
var import_system40 = require("@marigold/system");
|
|
2444
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
2445
|
+
var _Link = (0, import_react32.forwardRef)(
|
|
2446
|
+
({ variant, size, disabled, children, ...props }, ref) => {
|
|
2447
|
+
const classNames2 = (0, import_system40.useClassNames)({
|
|
2584
2448
|
component: "Link",
|
|
2585
2449
|
variant,
|
|
2586
2450
|
size
|
|
2587
2451
|
});
|
|
2588
|
-
return /* @__PURE__ */ (0,
|
|
2589
|
-
Component,
|
|
2590
|
-
{
|
|
2591
|
-
...props,
|
|
2592
|
-
role: "link",
|
|
2593
|
-
className: classNames2,
|
|
2594
|
-
ref: linkRef,
|
|
2595
|
-
...linkProps,
|
|
2596
|
-
children
|
|
2597
|
-
}
|
|
2598
|
-
);
|
|
2452
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react_aria_components6.Link, { ...props, ref, className: classNames2, isDisabled: disabled, children });
|
|
2599
2453
|
}
|
|
2600
2454
|
);
|
|
2601
2455
|
|
|
2602
2456
|
// src/List/List.tsx
|
|
2603
|
-
var
|
|
2457
|
+
var import_system41 = require("@marigold/system");
|
|
2604
2458
|
|
|
2605
2459
|
// src/List/Context.ts
|
|
2606
2460
|
var import_react33 = require("react");
|
|
@@ -2608,14 +2462,14 @@ var ListContext = (0, import_react33.createContext)({});
|
|
|
2608
2462
|
var useListContext = () => (0, import_react33.useContext)(ListContext);
|
|
2609
2463
|
|
|
2610
2464
|
// src/List/ListItem.tsx
|
|
2611
|
-
var
|
|
2465
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
2612
2466
|
var ListItem = ({ children, ...props }) => {
|
|
2613
2467
|
const { classNames: classNames2 } = useListContext();
|
|
2614
|
-
return /* @__PURE__ */ (0,
|
|
2468
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("li", { ...props, className: classNames2, children });
|
|
2615
2469
|
};
|
|
2616
2470
|
|
|
2617
2471
|
// src/List/List.tsx
|
|
2618
|
-
var
|
|
2472
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
2619
2473
|
var List = ({
|
|
2620
2474
|
as = "ul",
|
|
2621
2475
|
children,
|
|
@@ -2624,18 +2478,18 @@ var List = ({
|
|
|
2624
2478
|
...props
|
|
2625
2479
|
}) => {
|
|
2626
2480
|
const Component = as;
|
|
2627
|
-
const classNames2 = (0,
|
|
2628
|
-
return /* @__PURE__ */ (0,
|
|
2481
|
+
const classNames2 = (0, import_system41.useClassNames)({ component: "List", variant, size });
|
|
2482
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Component, { ...props, className: classNames2[as], children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ListContext.Provider, { value: { classNames: classNames2.item }, children }) });
|
|
2629
2483
|
};
|
|
2630
2484
|
List.Item = ListItem;
|
|
2631
2485
|
|
|
2632
2486
|
// src/Menu/Menu.tsx
|
|
2633
2487
|
var import_react37 = require("react");
|
|
2634
2488
|
var import_menu5 = require("@react-aria/menu");
|
|
2635
|
-
var
|
|
2489
|
+
var import_utils17 = require("@react-aria/utils");
|
|
2636
2490
|
var import_collections5 = require("@react-stately/collections");
|
|
2637
2491
|
var import_tree2 = require("@react-stately/tree");
|
|
2638
|
-
var
|
|
2492
|
+
var import_system45 = require("@marigold/system");
|
|
2639
2493
|
|
|
2640
2494
|
// src/Menu/Context.ts
|
|
2641
2495
|
var import_react34 = require("react");
|
|
@@ -2644,11 +2498,11 @@ var useMenuContext = () => (0, import_react34.useContext)(MenuContext);
|
|
|
2644
2498
|
|
|
2645
2499
|
// src/Menu/MenuItem.tsx
|
|
2646
2500
|
var import_react35 = require("react");
|
|
2647
|
-
var
|
|
2501
|
+
var import_focus9 = require("@react-aria/focus");
|
|
2648
2502
|
var import_menu = require("@react-aria/menu");
|
|
2649
|
-
var
|
|
2650
|
-
var
|
|
2651
|
-
var
|
|
2503
|
+
var import_utils15 = require("@react-aria/utils");
|
|
2504
|
+
var import_system42 = require("@marigold/system");
|
|
2505
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
2652
2506
|
var MenuItem = ({
|
|
2653
2507
|
item,
|
|
2654
2508
|
state,
|
|
@@ -2666,17 +2520,17 @@ var MenuItem = ({
|
|
|
2666
2520
|
state,
|
|
2667
2521
|
ref
|
|
2668
2522
|
);
|
|
2669
|
-
const { isFocusVisible, focusProps } = (0,
|
|
2670
|
-
const stateProps = (0,
|
|
2523
|
+
const { isFocusVisible, focusProps } = (0, import_focus9.useFocusRing)();
|
|
2524
|
+
const stateProps = (0, import_system42.useStateProps)({
|
|
2671
2525
|
focus: isFocusVisible
|
|
2672
2526
|
});
|
|
2673
2527
|
const { onPointerUp, ...props } = menuItemProps;
|
|
2674
|
-
return /* @__PURE__ */ (0,
|
|
2528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
2675
2529
|
"li",
|
|
2676
2530
|
{
|
|
2677
2531
|
ref,
|
|
2678
2532
|
className,
|
|
2679
|
-
...(0,
|
|
2533
|
+
...(0, import_utils15.mergeProps)(
|
|
2680
2534
|
props,
|
|
2681
2535
|
{ onPointerDown: onPointerUp },
|
|
2682
2536
|
stateProps,
|
|
@@ -2689,19 +2543,19 @@ var MenuItem = ({
|
|
|
2689
2543
|
|
|
2690
2544
|
// src/Menu/MenuSection.tsx
|
|
2691
2545
|
var import_menu2 = require("@react-aria/menu");
|
|
2692
|
-
var
|
|
2693
|
-
var
|
|
2546
|
+
var import_system43 = require("@marigold/system");
|
|
2547
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
2694
2548
|
var MenuSection = ({ onAction, item, state }) => {
|
|
2695
2549
|
let { itemProps, headingProps, groupProps } = (0, import_menu2.useMenuSection)({
|
|
2696
2550
|
heading: item.rendered,
|
|
2697
2551
|
"aria-label": item["aria-label"]
|
|
2698
2552
|
});
|
|
2699
|
-
const className = (0,
|
|
2700
|
-
return /* @__PURE__ */ (0,
|
|
2701
|
-
item.key !== state.collection.getFirstKey() && /* @__PURE__ */ (0,
|
|
2702
|
-
/* @__PURE__ */ (0,
|
|
2703
|
-
item.rendered && /* @__PURE__ */ (0,
|
|
2704
|
-
/* @__PURE__ */ (0,
|
|
2553
|
+
const className = (0, import_system43.useClassNames)({ component: "Menu" });
|
|
2554
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
|
|
2555
|
+
item.key !== state.collection.getFirstKey() && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(_Divider, { variant: "section" }) }),
|
|
2556
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("li", { ...itemProps, children: [
|
|
2557
|
+
item.rendered && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { ...headingProps, className: className.section, children: item.rendered }),
|
|
2558
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("ul", { ...groupProps, className: "pb-1", children: [...item.props.children].map((node) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
2705
2559
|
MenuItem,
|
|
2706
2560
|
{
|
|
2707
2561
|
item: node,
|
|
@@ -2718,12 +2572,12 @@ var MenuSection_default = MenuSection;
|
|
|
2718
2572
|
|
|
2719
2573
|
// src/Menu/MenuTrigger.tsx
|
|
2720
2574
|
var import_react36 = require("react");
|
|
2721
|
-
var
|
|
2575
|
+
var import_interactions5 = require("@react-aria/interactions");
|
|
2722
2576
|
var import_menu3 = require("@react-aria/menu");
|
|
2723
|
-
var
|
|
2577
|
+
var import_utils16 = require("@react-aria/utils");
|
|
2724
2578
|
var import_menu4 = require("@react-stately/menu");
|
|
2725
|
-
var
|
|
2726
|
-
var
|
|
2579
|
+
var import_system44 = require("@marigold/system");
|
|
2580
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
2727
2581
|
var MenuTrigger = ({
|
|
2728
2582
|
disabled,
|
|
2729
2583
|
open,
|
|
@@ -2732,7 +2586,7 @@ var MenuTrigger = ({
|
|
|
2732
2586
|
}) => {
|
|
2733
2587
|
const [menuTrigger, menu] = import_react36.Children.toArray(children);
|
|
2734
2588
|
const menuTriggerRef = (0, import_react36.useRef)(null);
|
|
2735
|
-
const menuRef = (0,
|
|
2589
|
+
const menuRef = (0, import_utils16.useObjectRef)();
|
|
2736
2590
|
const state = (0, import_menu4.useMenuTriggerState)({
|
|
2737
2591
|
isOpen: open,
|
|
2738
2592
|
onOpenChange
|
|
@@ -2749,10 +2603,10 @@ var MenuTrigger = ({
|
|
|
2749
2603
|
onClose: state.close,
|
|
2750
2604
|
autoFocus: state.focusStrategy
|
|
2751
2605
|
};
|
|
2752
|
-
const isSmallScreen = (0,
|
|
2753
|
-
return /* @__PURE__ */ (0,
|
|
2754
|
-
/* @__PURE__ */ (0,
|
|
2755
|
-
|
|
2606
|
+
const isSmallScreen = (0, import_system44.useSmallScreen)();
|
|
2607
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(MenuContext.Provider, { value: menuContext, children: [
|
|
2608
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
2609
|
+
import_interactions5.PressResponder,
|
|
2756
2610
|
{
|
|
2757
2611
|
...menuTriggerProps,
|
|
2758
2612
|
ref: menuTriggerRef,
|
|
@@ -2760,23 +2614,23 @@ var MenuTrigger = ({
|
|
|
2760
2614
|
children: menuTrigger
|
|
2761
2615
|
}
|
|
2762
2616
|
),
|
|
2763
|
-
isSmallScreen ? /* @__PURE__ */ (0,
|
|
2617
|
+
isSmallScreen ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Tray, { state, children: menu }) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Popover, { triggerRef: menuTriggerRef, scrollRef: menuRef, state, children: menu })
|
|
2764
2618
|
] });
|
|
2765
2619
|
};
|
|
2766
2620
|
|
|
2767
2621
|
// src/Menu/Menu.tsx
|
|
2768
|
-
var
|
|
2622
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
2769
2623
|
var Menu = ({ variant, size, ...props }) => {
|
|
2770
2624
|
const { ref: scrollRef, ...menuContext } = useMenuContext();
|
|
2771
2625
|
const ownProps = { ...props, ...menuContext };
|
|
2772
2626
|
const ref = (0, import_react37.useRef)(null);
|
|
2773
2627
|
const state = (0, import_tree2.useTreeState)({ ...ownProps, selectionMode: "none" });
|
|
2774
2628
|
const { menuProps } = (0, import_menu5.useMenu)(ownProps, state, ref);
|
|
2775
|
-
(0,
|
|
2776
|
-
const classNames2 = (0,
|
|
2777
|
-
return /* @__PURE__ */ (0,
|
|
2629
|
+
(0, import_utils17.useSyncRef)({ ref: scrollRef }, ref);
|
|
2630
|
+
const classNames2 = (0, import_system45.useClassNames)({ component: "Menu", variant, size });
|
|
2631
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("ul", { ref, className: classNames2.container, ...menuProps, children: [...state.collection].map((item) => {
|
|
2778
2632
|
if (item.type === "section") {
|
|
2779
|
-
return /* @__PURE__ */ (0,
|
|
2633
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
2780
2634
|
MenuSection_default,
|
|
2781
2635
|
{
|
|
2782
2636
|
item,
|
|
@@ -2786,7 +2640,7 @@ var Menu = ({ variant, size, ...props }) => {
|
|
|
2786
2640
|
item.key
|
|
2787
2641
|
);
|
|
2788
2642
|
}
|
|
2789
|
-
return /* @__PURE__ */ (0,
|
|
2643
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
2790
2644
|
MenuItem,
|
|
2791
2645
|
{
|
|
2792
2646
|
item,
|
|
@@ -2803,26 +2657,26 @@ Menu.Item = import_collections5.Item;
|
|
|
2803
2657
|
Menu.Section = import_collections5.Section;
|
|
2804
2658
|
|
|
2805
2659
|
// src/Menu/ActionMenu.tsx
|
|
2806
|
-
var
|
|
2807
|
-
var
|
|
2660
|
+
var import_system46 = require("@marigold/system");
|
|
2661
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
2808
2662
|
var ActionMenu = (props) => {
|
|
2809
|
-
return /* @__PURE__ */ (0,
|
|
2810
|
-
/* @__PURE__ */ (0,
|
|
2811
|
-
/* @__PURE__ */ (0,
|
|
2663
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(Menu.Trigger, { children: [
|
|
2664
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(_Button, { variant: "menu", size: "small", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_system46.SVG, { viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("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" }) }) }),
|
|
2665
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Menu, { ...props })
|
|
2812
2666
|
] });
|
|
2813
2667
|
};
|
|
2814
2668
|
|
|
2815
2669
|
// src/Message/Message.tsx
|
|
2816
|
-
var
|
|
2817
|
-
var
|
|
2670
|
+
var import_system47 = require("@marigold/system");
|
|
2671
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
2818
2672
|
var icons = {
|
|
2819
|
-
info: () => /* @__PURE__ */ (0,
|
|
2673
|
+
info: () => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
2820
2674
|
"svg",
|
|
2821
2675
|
{
|
|
2822
2676
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2823
2677
|
viewBox: "0 0 24 24",
|
|
2824
2678
|
fill: "currentColor",
|
|
2825
|
-
children: /* @__PURE__ */ (0,
|
|
2679
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
2826
2680
|
"path",
|
|
2827
2681
|
{
|
|
2828
2682
|
fillRule: "evenodd",
|
|
@@ -2832,13 +2686,13 @@ var icons = {
|
|
|
2832
2686
|
)
|
|
2833
2687
|
}
|
|
2834
2688
|
),
|
|
2835
|
-
warning: () => /* @__PURE__ */ (0,
|
|
2689
|
+
warning: () => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
2836
2690
|
"svg",
|
|
2837
2691
|
{
|
|
2838
2692
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2839
2693
|
viewBox: "0 0 24 24",
|
|
2840
2694
|
fill: "currentColor",
|
|
2841
|
-
children: /* @__PURE__ */ (0,
|
|
2695
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
2842
2696
|
"path",
|
|
2843
2697
|
{
|
|
2844
2698
|
fillRule: "evenodd",
|
|
@@ -2848,13 +2702,13 @@ var icons = {
|
|
|
2848
2702
|
)
|
|
2849
2703
|
}
|
|
2850
2704
|
),
|
|
2851
|
-
error: () => /* @__PURE__ */ (0,
|
|
2705
|
+
error: () => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
2852
2706
|
"svg",
|
|
2853
2707
|
{
|
|
2854
2708
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2855
2709
|
viewBox: "0 0 24 24",
|
|
2856
2710
|
fill: "currentColor",
|
|
2857
|
-
children: /* @__PURE__ */ (0,
|
|
2711
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
2858
2712
|
"path",
|
|
2859
2713
|
{
|
|
2860
2714
|
fillRule: "evenodd",
|
|
@@ -2872,26 +2726,26 @@ var Message = ({
|
|
|
2872
2726
|
children,
|
|
2873
2727
|
...props
|
|
2874
2728
|
}) => {
|
|
2875
|
-
const classNames2 = (0,
|
|
2729
|
+
const classNames2 = (0, import_system47.useClassNames)({ component: "Message", variant, size });
|
|
2876
2730
|
const Icon3 = icons[variant];
|
|
2877
|
-
return /* @__PURE__ */ (0,
|
|
2731
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
2878
2732
|
"div",
|
|
2879
2733
|
{
|
|
2880
|
-
className: (0,
|
|
2734
|
+
className: (0, import_system47.cn)(
|
|
2881
2735
|
"grid auto-rows-min grid-cols-[min-content_auto] gap-1",
|
|
2882
2736
|
classNames2.container
|
|
2883
2737
|
),
|
|
2884
2738
|
...props,
|
|
2885
2739
|
children: [
|
|
2886
|
-
/* @__PURE__ */ (0,
|
|
2887
|
-
/* @__PURE__ */ (0,
|
|
2740
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: (0, import_system47.cn)("col-span-1 h-5 w-5 self-center", classNames2.icon), children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Icon3, {}) }),
|
|
2741
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
2888
2742
|
"div",
|
|
2889
2743
|
{
|
|
2890
|
-
className: (0,
|
|
2744
|
+
className: (0, import_system47.cn)("col-start-2 row-start-1 self-center", classNames2.title),
|
|
2891
2745
|
children: messageTitle
|
|
2892
2746
|
}
|
|
2893
2747
|
),
|
|
2894
|
-
/* @__PURE__ */ (0,
|
|
2748
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: (0, import_system47.cn)("col-start-2", classNames2.content), children })
|
|
2895
2749
|
]
|
|
2896
2750
|
}
|
|
2897
2751
|
);
|
|
@@ -2899,22 +2753,22 @@ var Message = ({
|
|
|
2899
2753
|
|
|
2900
2754
|
// src/NumberField/NumberField.tsx
|
|
2901
2755
|
var import_react39 = require("react");
|
|
2902
|
-
var
|
|
2756
|
+
var import_focus10 = require("@react-aria/focus");
|
|
2903
2757
|
var import_i18n10 = require("@react-aria/i18n");
|
|
2904
|
-
var
|
|
2758
|
+
var import_interactions7 = require("@react-aria/interactions");
|
|
2905
2759
|
var import_numberfield = require("@react-aria/numberfield");
|
|
2906
|
-
var
|
|
2760
|
+
var import_utils19 = require("@react-aria/utils");
|
|
2907
2761
|
var import_numberfield2 = require("@react-stately/numberfield");
|
|
2908
|
-
var
|
|
2762
|
+
var import_system49 = require("@marigold/system");
|
|
2909
2763
|
|
|
2910
2764
|
// src/NumberField/StepButton.tsx
|
|
2911
2765
|
var import_react38 = require("react");
|
|
2912
|
-
var
|
|
2913
|
-
var
|
|
2914
|
-
var
|
|
2915
|
-
var
|
|
2916
|
-
var
|
|
2917
|
-
var Plus = () => /* @__PURE__ */ (0,
|
|
2766
|
+
var import_button5 = require("@react-aria/button");
|
|
2767
|
+
var import_interactions6 = require("@react-aria/interactions");
|
|
2768
|
+
var import_utils18 = require("@react-aria/utils");
|
|
2769
|
+
var import_system48 = require("@marigold/system");
|
|
2770
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
2771
|
+
var Plus = () => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("svg", { width: 16, height: 16, viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
2918
2772
|
"path",
|
|
2919
2773
|
{
|
|
2920
2774
|
fillRule: "evenodd",
|
|
@@ -2922,7 +2776,7 @@ var Plus = () => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("svg", { width: 1
|
|
|
2922
2776
|
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"
|
|
2923
2777
|
}
|
|
2924
2778
|
) });
|
|
2925
|
-
var Minus = () => /* @__PURE__ */ (0,
|
|
2779
|
+
var Minus = () => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("svg", { width: 16, height: 16, viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
2926
2780
|
"path",
|
|
2927
2781
|
{
|
|
2928
2782
|
fillRule: "evenodd",
|
|
@@ -2936,36 +2790,36 @@ var StepButton = ({
|
|
|
2936
2790
|
...props
|
|
2937
2791
|
}) => {
|
|
2938
2792
|
const ref = (0, import_react38.useRef)(null);
|
|
2939
|
-
const { buttonProps, isPressed } = (0,
|
|
2793
|
+
const { buttonProps, isPressed } = (0, import_button5.useButton)(
|
|
2940
2794
|
{ ...props, elementType: "div" },
|
|
2941
2795
|
ref
|
|
2942
2796
|
);
|
|
2943
|
-
const { hoverProps, isHovered } = (0,
|
|
2944
|
-
const stateProps = (0,
|
|
2797
|
+
const { hoverProps, isHovered } = (0, import_interactions6.useHover)(props);
|
|
2798
|
+
const stateProps = (0, import_system48.useStateProps)({
|
|
2945
2799
|
active: isPressed,
|
|
2946
2800
|
hover: isHovered,
|
|
2947
2801
|
disabled: props.isDisabled
|
|
2948
2802
|
});
|
|
2949
2803
|
const Icon3 = direction === "up" ? Plus : Minus;
|
|
2950
|
-
return /* @__PURE__ */ (0,
|
|
2804
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
2951
2805
|
"div",
|
|
2952
2806
|
{
|
|
2953
|
-
className: (0,
|
|
2807
|
+
className: (0, import_system48.cn)(
|
|
2954
2808
|
[
|
|
2955
2809
|
"flex items-center justify-center",
|
|
2956
2810
|
"cursor-pointer data-[disabled]:cursor-not-allowed"
|
|
2957
2811
|
],
|
|
2958
2812
|
className
|
|
2959
2813
|
),
|
|
2960
|
-
...(0,
|
|
2814
|
+
...(0, import_utils18.mergeProps)(buttonProps, hoverProps),
|
|
2961
2815
|
...stateProps,
|
|
2962
|
-
children: /* @__PURE__ */ (0,
|
|
2816
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Icon3, {})
|
|
2963
2817
|
}
|
|
2964
2818
|
);
|
|
2965
2819
|
};
|
|
2966
2820
|
|
|
2967
2821
|
// src/NumberField/NumberField.tsx
|
|
2968
|
-
var
|
|
2822
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
2969
2823
|
var NumberField = (0, import_react39.forwardRef)(
|
|
2970
2824
|
({
|
|
2971
2825
|
variant,
|
|
@@ -2987,7 +2841,7 @@ var NumberField = (0, import_react39.forwardRef)(
|
|
|
2987
2841
|
};
|
|
2988
2842
|
const showStepper = !hideStepper;
|
|
2989
2843
|
const { locale } = (0, import_i18n10.useLocale)();
|
|
2990
|
-
const inputRef = (0,
|
|
2844
|
+
const inputRef = (0, import_utils19.useObjectRef)(ref);
|
|
2991
2845
|
const state = (0, import_numberfield2.useNumberFieldState)({ ...props, locale });
|
|
2992
2846
|
const {
|
|
2993
2847
|
labelProps,
|
|
@@ -2998,13 +2852,13 @@ var NumberField = (0, import_react39.forwardRef)(
|
|
|
2998
2852
|
incrementButtonProps,
|
|
2999
2853
|
decrementButtonProps
|
|
3000
2854
|
} = (0, import_numberfield.useNumberField)(props, state, inputRef);
|
|
3001
|
-
const { hoverProps, isHovered } = (0,
|
|
3002
|
-
const { focusProps, isFocused } = (0,
|
|
2855
|
+
const { hoverProps, isHovered } = (0, import_interactions7.useHover)({ isDisabled: disabled });
|
|
2856
|
+
const { focusProps, isFocused } = (0, import_focus10.useFocusRing)({
|
|
3003
2857
|
within: true,
|
|
3004
2858
|
isTextInput: true,
|
|
3005
2859
|
autoFocus: props.autoFocus
|
|
3006
2860
|
});
|
|
3007
|
-
const stateProps = (0,
|
|
2861
|
+
const stateProps = (0, import_system49.useStateProps)({
|
|
3008
2862
|
hover: isHovered,
|
|
3009
2863
|
focus: isFocused,
|
|
3010
2864
|
disabled,
|
|
@@ -3012,12 +2866,12 @@ var NumberField = (0, import_react39.forwardRef)(
|
|
|
3012
2866
|
readOnly,
|
|
3013
2867
|
required
|
|
3014
2868
|
});
|
|
3015
|
-
const classNames2 = (0,
|
|
2869
|
+
const classNames2 = (0, import_system49.useClassNames)({
|
|
3016
2870
|
component: "NumberField",
|
|
3017
2871
|
size,
|
|
3018
2872
|
variant
|
|
3019
2873
|
});
|
|
3020
|
-
return /* @__PURE__ */ (0,
|
|
2874
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
3021
2875
|
FieldBase,
|
|
3022
2876
|
{
|
|
3023
2877
|
label: props.label,
|
|
@@ -3031,16 +2885,16 @@ var NumberField = (0, import_react39.forwardRef)(
|
|
|
3031
2885
|
variant,
|
|
3032
2886
|
size,
|
|
3033
2887
|
width,
|
|
3034
|
-
children: /* @__PURE__ */ (0,
|
|
2888
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
3035
2889
|
"div",
|
|
3036
2890
|
{
|
|
3037
2891
|
"data-group": true,
|
|
3038
|
-
className: (0,
|
|
2892
|
+
className: (0, import_system49.cn)("flex items-stretch", classNames2.group),
|
|
3039
2893
|
"data-testid": "number-field-container",
|
|
3040
|
-
...(0,
|
|
2894
|
+
...(0, import_utils19.mergeProps)(groupProps, focusProps, hoverProps),
|
|
3041
2895
|
...stateProps,
|
|
3042
2896
|
children: [
|
|
3043
|
-
showStepper && /* @__PURE__ */ (0,
|
|
2897
|
+
showStepper && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
3044
2898
|
StepButton,
|
|
3045
2899
|
{
|
|
3046
2900
|
className: classNames2.stepper,
|
|
@@ -3048,20 +2902,17 @@ var NumberField = (0, import_react39.forwardRef)(
|
|
|
3048
2902
|
...decrementButtonProps
|
|
3049
2903
|
}
|
|
3050
2904
|
),
|
|
3051
|
-
/* @__PURE__ */ (0,
|
|
2905
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
3052
2906
|
Input,
|
|
3053
2907
|
{
|
|
3054
2908
|
ref: inputRef,
|
|
3055
2909
|
variant,
|
|
3056
2910
|
size,
|
|
3057
|
-
className: {
|
|
3058
|
-
input: "min-w-0 items-stretch border-none"
|
|
3059
|
-
},
|
|
3060
2911
|
...inputProps,
|
|
3061
2912
|
...stateProps
|
|
3062
2913
|
}
|
|
3063
2914
|
) }),
|
|
3064
|
-
showStepper && /* @__PURE__ */ (0,
|
|
2915
|
+
showStepper && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
3065
2916
|
StepButton,
|
|
3066
2917
|
{
|
|
3067
2918
|
className: classNames2.stepper,
|
|
@@ -3078,28 +2929,28 @@ var NumberField = (0, import_react39.forwardRef)(
|
|
|
3078
2929
|
);
|
|
3079
2930
|
|
|
3080
2931
|
// src/Provider/index.ts
|
|
3081
|
-
var
|
|
2932
|
+
var import_system51 = require("@marigold/system");
|
|
3082
2933
|
|
|
3083
2934
|
// src/Provider/MarigoldProvider.tsx
|
|
3084
2935
|
var import_overlays7 = require("@react-aria/overlays");
|
|
3085
|
-
var
|
|
3086
|
-
var
|
|
2936
|
+
var import_system50 = require("@marigold/system");
|
|
2937
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
3087
2938
|
function MarigoldProvider({
|
|
3088
2939
|
children,
|
|
3089
2940
|
theme
|
|
3090
2941
|
}) {
|
|
3091
|
-
const outerTheme = (0,
|
|
3092
|
-
const isTopLevel = outerTheme ===
|
|
3093
|
-
return /* @__PURE__ */ (0,
|
|
2942
|
+
const outerTheme = (0, import_system50.useTheme)();
|
|
2943
|
+
const isTopLevel = outerTheme === import_system50.defaultTheme;
|
|
2944
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_system50.ThemeProvider, { theme, children: isTopLevel ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_overlays7.OverlayProvider, { children }) : children });
|
|
3094
2945
|
}
|
|
3095
2946
|
|
|
3096
2947
|
// src/Radio/Radio.tsx
|
|
3097
2948
|
var import_react41 = require("react");
|
|
3098
|
-
var
|
|
3099
|
-
var
|
|
2949
|
+
var import_focus11 = require("@react-aria/focus");
|
|
2950
|
+
var import_interactions8 = require("@react-aria/interactions");
|
|
3100
2951
|
var import_radio3 = require("@react-aria/radio");
|
|
3101
|
-
var
|
|
3102
|
-
var
|
|
2952
|
+
var import_utils20 = require("@react-aria/utils");
|
|
2953
|
+
var import_system53 = require("@marigold/system");
|
|
3103
2954
|
|
|
3104
2955
|
// src/Radio/Context.ts
|
|
3105
2956
|
var import_react40 = require("react");
|
|
@@ -3111,9 +2962,11 @@ var useRadioGroupContext = () => (0, import_react40.useContext)(RadioGroupContex
|
|
|
3111
2962
|
// src/Radio/RadioGroup.tsx
|
|
3112
2963
|
var import_radio = require("@react-aria/radio");
|
|
3113
2964
|
var import_radio2 = require("@react-stately/radio");
|
|
3114
|
-
var
|
|
3115
|
-
var
|
|
2965
|
+
var import_system52 = require("@marigold/system");
|
|
2966
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
3116
2967
|
var RadioGroup = ({
|
|
2968
|
+
variant,
|
|
2969
|
+
size,
|
|
3117
2970
|
children,
|
|
3118
2971
|
orientation = "vertical",
|
|
3119
2972
|
width,
|
|
@@ -3132,18 +2985,19 @@ var RadioGroup = ({
|
|
|
3132
2985
|
};
|
|
3133
2986
|
const state = (0, import_radio2.useRadioGroupState)(props);
|
|
3134
2987
|
const { radioGroupProps, labelProps, errorMessageProps, descriptionProps } = (0, import_radio.useRadioGroup)(props, state);
|
|
3135
|
-
const
|
|
2988
|
+
const classNames2 = (0, import_system52.useClassNames)({ component: "Radio", variant, size });
|
|
2989
|
+
const stateProps = (0, import_system52.useStateProps)({
|
|
3136
2990
|
disabled,
|
|
3137
2991
|
readOnly,
|
|
3138
2992
|
error,
|
|
3139
2993
|
required
|
|
3140
2994
|
});
|
|
3141
|
-
return /* @__PURE__ */ (0,
|
|
2995
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
3142
2996
|
FieldBase,
|
|
3143
2997
|
{
|
|
3144
2998
|
width,
|
|
3145
2999
|
label: props.label,
|
|
3146
|
-
labelProps: {
|
|
3000
|
+
labelProps: { elementType: "span", ...labelProps },
|
|
3147
3001
|
description: props.description,
|
|
3148
3002
|
descriptionProps,
|
|
3149
3003
|
error,
|
|
@@ -3152,16 +3006,17 @@ var RadioGroup = ({
|
|
|
3152
3006
|
disabled,
|
|
3153
3007
|
stateProps,
|
|
3154
3008
|
...radioGroupProps,
|
|
3155
|
-
children: /* @__PURE__ */ (0,
|
|
3009
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
3156
3010
|
"div",
|
|
3157
3011
|
{
|
|
3158
3012
|
role: "presentation",
|
|
3159
3013
|
"data-orientation": orientation,
|
|
3160
|
-
className: (0,
|
|
3014
|
+
className: (0, import_system52.cn)(
|
|
3015
|
+
classNames2.group,
|
|
3161
3016
|
"flex items-start",
|
|
3162
3017
|
orientation === "vertical" ? "flex-col gap-[0.5ch]" : "flex-row gap-[1.5ch]"
|
|
3163
3018
|
),
|
|
3164
|
-
children: /* @__PURE__ */ (0,
|
|
3019
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(RadioGroupContext.Provider, { value: { width, error, state }, children })
|
|
3165
3020
|
}
|
|
3166
3021
|
)
|
|
3167
3022
|
}
|
|
@@ -3169,18 +3024,18 @@ var RadioGroup = ({
|
|
|
3169
3024
|
};
|
|
3170
3025
|
|
|
3171
3026
|
// src/Radio/Radio.tsx
|
|
3172
|
-
var
|
|
3173
|
-
var Dot = () => /* @__PURE__ */ (0,
|
|
3174
|
-
var Icon2 = ({ checked, className, ...props }) => /* @__PURE__ */ (0,
|
|
3027
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
3028
|
+
var Dot = () => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("svg", { viewBox: "0 0 6 6", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("circle", { fill: "currentColor", cx: "3", cy: "3", r: "3" }) });
|
|
3029
|
+
var Icon2 = ({ checked, className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
3175
3030
|
"div",
|
|
3176
3031
|
{
|
|
3177
|
-
className: (0,
|
|
3032
|
+
className: (0, import_system53.cn)(
|
|
3178
3033
|
"bg-secondary-50 flex h-4 w-4 items-center justify-center rounded-[50%] border p-1",
|
|
3179
3034
|
className
|
|
3180
3035
|
),
|
|
3181
3036
|
"aria-hidden": "true",
|
|
3182
3037
|
...props,
|
|
3183
|
-
children: checked ? /* @__PURE__ */ (0,
|
|
3038
|
+
children: checked ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Dot, {}) : null
|
|
3184
3039
|
}
|
|
3185
3040
|
);
|
|
3186
3041
|
var Radio = (0, import_react41.forwardRef)(
|
|
@@ -3192,20 +3047,20 @@ var Radio = (0, import_react41.forwardRef)(
|
|
|
3192
3047
|
width: groupWidth,
|
|
3193
3048
|
state
|
|
3194
3049
|
} = useRadioGroupContext();
|
|
3195
|
-
const inputRef = (0,
|
|
3050
|
+
const inputRef = (0, import_utils20.useObjectRef)(ref);
|
|
3196
3051
|
const { inputProps } = (0, import_radio3.useRadio)(
|
|
3197
3052
|
{ isDisabled: disabled, ...props },
|
|
3198
3053
|
state,
|
|
3199
3054
|
inputRef
|
|
3200
3055
|
);
|
|
3201
|
-
const classNames2 = (0,
|
|
3056
|
+
const classNames2 = (0, import_system53.useClassNames)({
|
|
3202
3057
|
component: "Radio",
|
|
3203
3058
|
variant: variant || props.variant,
|
|
3204
3059
|
size: size || props.size
|
|
3205
3060
|
});
|
|
3206
|
-
const { hoverProps, isHovered } = (0,
|
|
3207
|
-
const { isFocusVisible, focusProps } = (0,
|
|
3208
|
-
const stateProps = (0,
|
|
3061
|
+
const { hoverProps, isHovered } = (0, import_interactions8.useHover)({ isDisabled: disabled });
|
|
3062
|
+
const { isFocusVisible, focusProps } = (0, import_focus11.useFocusRing)();
|
|
3063
|
+
const stateProps = (0, import_system53.useStateProps)({
|
|
3209
3064
|
hover: isHovered,
|
|
3210
3065
|
focus: isFocusVisible,
|
|
3211
3066
|
checked: inputProps.checked,
|
|
@@ -3213,30 +3068,30 @@ var Radio = (0, import_react41.forwardRef)(
|
|
|
3213
3068
|
readOnly: props.readOnly,
|
|
3214
3069
|
error
|
|
3215
3070
|
});
|
|
3216
|
-
return /* @__PURE__ */ (0,
|
|
3071
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
3217
3072
|
"label",
|
|
3218
3073
|
{
|
|
3219
|
-
className: (0,
|
|
3074
|
+
className: (0, import_system53.cn)(
|
|
3220
3075
|
"group/radio",
|
|
3221
3076
|
"relative flex items-center gap-[1ch]",
|
|
3222
3077
|
width || groupWidth || "w-full",
|
|
3223
3078
|
classNames2.container
|
|
3224
3079
|
),
|
|
3225
|
-
...(0,
|
|
3080
|
+
...(0, import_utils20.mergeProps)(hoverProps, stateProps),
|
|
3226
3081
|
children: [
|
|
3227
|
-
/* @__PURE__ */ (0,
|
|
3082
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
3228
3083
|
"input",
|
|
3229
3084
|
{
|
|
3230
3085
|
ref: inputRef,
|
|
3231
|
-
className: (0,
|
|
3086
|
+
className: (0, import_system53.cn)(
|
|
3232
3087
|
"absolute left-0 top-0 z-[1] h-full w-full opacity-[0.0001]",
|
|
3233
3088
|
inputProps.disabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
3234
3089
|
),
|
|
3235
|
-
...(0,
|
|
3090
|
+
...(0, import_utils20.mergeProps)(inputProps, focusProps)
|
|
3236
3091
|
}
|
|
3237
3092
|
),
|
|
3238
|
-
/* @__PURE__ */ (0,
|
|
3239
|
-
/* @__PURE__ */ (0,
|
|
3093
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Icon2, { checked: inputProps.checked, className: classNames2.radio }),
|
|
3094
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: classNames2.label, children: props.children })
|
|
3240
3095
|
]
|
|
3241
3096
|
}
|
|
3242
3097
|
);
|
|
@@ -3245,127 +3100,54 @@ var Radio = (0, import_react41.forwardRef)(
|
|
|
3245
3100
|
Radio.Group = RadioGroup;
|
|
3246
3101
|
|
|
3247
3102
|
// src/Slider/Slider.tsx
|
|
3248
|
-
var
|
|
3249
|
-
var
|
|
3250
|
-
var
|
|
3251
|
-
var
|
|
3252
|
-
var
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
// src/VisuallyHidden/VisuallyHidden.tsx
|
|
3263
|
-
var import_visually_hidden = require("@react-aria/visually-hidden");
|
|
3264
|
-
|
|
3265
|
-
// src/Slider/Thumb.tsx
|
|
3266
|
-
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
3267
|
-
var Thumb = ({ state, trackRef, className, ...props }) => {
|
|
3268
|
-
const { disabled } = props;
|
|
3269
|
-
const inputRef = (0, import_react42.useRef)(null);
|
|
3270
|
-
const { isFocusVisible, focusProps, isFocused } = (0, import_focus14.useFocusRing)();
|
|
3271
|
-
const focused = isFocused || isFocusVisible || state.isThumbDragging(0);
|
|
3272
|
-
const stateProps = (0, import_system55.useStateProps)({
|
|
3273
|
-
focus: focused,
|
|
3274
|
-
disabled
|
|
3275
|
-
});
|
|
3276
|
-
const { thumbProps, inputProps } = (0, import_slider.useSliderThumb)(
|
|
3277
|
-
{
|
|
3278
|
-
index: 0,
|
|
3279
|
-
trackRef,
|
|
3280
|
-
inputRef,
|
|
3281
|
-
isDisabled: disabled
|
|
3282
|
-
},
|
|
3283
|
-
state
|
|
3284
|
-
);
|
|
3285
|
-
(0, import_react42.useEffect)(() => {
|
|
3286
|
-
state.setThumbEditable(0, !disabled);
|
|
3287
|
-
}, [disabled, state]);
|
|
3288
|
-
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: (0, import_system55.cn)("top-1/2", className), ...thumbProps, ...stateProps, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_visually_hidden.VisuallyHidden, { children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
3289
|
-
"input",
|
|
3290
|
-
{
|
|
3291
|
-
type: "range",
|
|
3292
|
-
ref: inputRef,
|
|
3293
|
-
...(0, import_utils24.mergeProps)(inputProps, focusProps)
|
|
3294
|
-
}
|
|
3295
|
-
) }) });
|
|
3296
|
-
};
|
|
3297
|
-
|
|
3298
|
-
// src/Slider/Slider.tsx
|
|
3299
|
-
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
3300
|
-
var Slider = (0, import_react43.forwardRef)(
|
|
3301
|
-
({ variant, size, width = "full", ...props }, ref) => {
|
|
3302
|
-
const { formatOptions } = props;
|
|
3303
|
-
const trackRef = (0, import_utils25.useObjectRef)(ref);
|
|
3304
|
-
const numberFormatter = (0, import_i18n11.useNumberFormatter)(formatOptions);
|
|
3305
|
-
const state = (0, import_slider3.useSliderState)({ ...props, numberFormatter });
|
|
3306
|
-
const { groupProps, trackProps, labelProps, outputProps } = (0, import_slider2.useSlider)(
|
|
3307
|
-
{
|
|
3308
|
-
label: props.children,
|
|
3309
|
-
...props
|
|
3310
|
-
},
|
|
3311
|
-
state,
|
|
3312
|
-
trackRef
|
|
3313
|
-
);
|
|
3314
|
-
const classNames2 = (0, import_system56.useClassNames)({
|
|
3103
|
+
var import_react42 = require("react");
|
|
3104
|
+
var import_react_aria_components7 = require("react-aria-components");
|
|
3105
|
+
var import_system54 = require("@marigold/system");
|
|
3106
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
3107
|
+
var _Slider = (0, import_react42.forwardRef)(
|
|
3108
|
+
({
|
|
3109
|
+
thumbLabels,
|
|
3110
|
+
variant,
|
|
3111
|
+
size,
|
|
3112
|
+
width = "full",
|
|
3113
|
+
disabled,
|
|
3114
|
+
...rest
|
|
3115
|
+
}, ref) => {
|
|
3116
|
+
const classNames2 = (0, import_system54.useClassNames)({
|
|
3315
3117
|
component: "Slider",
|
|
3316
3118
|
variant,
|
|
3317
3119
|
size
|
|
3318
3120
|
});
|
|
3319
|
-
const
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3121
|
+
const props = {
|
|
3122
|
+
isDisabled: disabled,
|
|
3123
|
+
...rest
|
|
3124
|
+
};
|
|
3125
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
|
|
3126
|
+
import_react_aria_components7.Slider,
|
|
3324
3127
|
{
|
|
3325
|
-
className: (0,
|
|
3326
|
-
|
|
3128
|
+
className: (0, import_system54.cn)(
|
|
3129
|
+
"grid grid-cols-[auto_1fr] gap-y-1",
|
|
3130
|
+
classNames2.container,
|
|
3131
|
+
import_system54.width[width]
|
|
3132
|
+
),
|
|
3133
|
+
ref,
|
|
3134
|
+
...props,
|
|
3327
3135
|
children: [
|
|
3328
|
-
/* @__PURE__ */ (0,
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
{
|
|
3333
|
-
className: (0, import_system56.cn)(
|
|
3334
|
-
"flex flex-shrink-0 flex-grow basis-auto",
|
|
3335
|
-
classNames2.output
|
|
3336
|
-
),
|
|
3337
|
-
...outputProps,
|
|
3338
|
-
children: state.getThumbValueLabel(0)
|
|
3339
|
-
}
|
|
3340
|
-
)
|
|
3341
|
-
] }),
|
|
3342
|
-
/* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
|
|
3343
|
-
"div",
|
|
3136
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(_Label, { children: props.children }),
|
|
3137
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_react_aria_components7.SliderOutput, { className: (0, import_system54.cn)("flex justify-end", classNames2.output), children: ({ state }) => state.values.map((_, i) => state.getThumbValueLabel(i)).join(" \u2013 ") }),
|
|
3138
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
3139
|
+
import_react_aria_components7.SliderTrack,
|
|
3344
3140
|
{
|
|
3345
|
-
className: "h-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
"
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
classNames2.track
|
|
3356
|
-
)
|
|
3357
|
-
}
|
|
3358
|
-
),
|
|
3359
|
-
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
3360
|
-
Thumb,
|
|
3361
|
-
{
|
|
3362
|
-
state,
|
|
3363
|
-
trackRef,
|
|
3364
|
-
disabled: props.disabled,
|
|
3365
|
-
className: classNames2.thumb
|
|
3366
|
-
}
|
|
3367
|
-
)
|
|
3368
|
-
]
|
|
3141
|
+
className: (0, import_system54.cn)("relative col-span-2 h-2 w-full", classNames2.track),
|
|
3142
|
+
children: ({ state }) => state.values.map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
3143
|
+
import_react_aria_components7.SliderThumb,
|
|
3144
|
+
{
|
|
3145
|
+
className: (0, import_system54.cn)("top-1/2 cursor-pointer", classNames2.thumb),
|
|
3146
|
+
index: i,
|
|
3147
|
+
"aria-label": thumbLabels == null ? void 0 : thumbLabels[i]
|
|
3148
|
+
},
|
|
3149
|
+
i
|
|
3150
|
+
))
|
|
3369
3151
|
}
|
|
3370
3152
|
)
|
|
3371
3153
|
]
|
|
@@ -3375,12 +3157,12 @@ var Slider = (0, import_react43.forwardRef)(
|
|
|
3375
3157
|
);
|
|
3376
3158
|
|
|
3377
3159
|
// src/Split/Split.tsx
|
|
3378
|
-
var
|
|
3379
|
-
var Split = (props) => /* @__PURE__ */ (0,
|
|
3160
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
3161
|
+
var Split = (props) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { ...props, role: "separator", className: "grow" });
|
|
3380
3162
|
|
|
3381
3163
|
// src/Stack/Stack.tsx
|
|
3382
|
-
var
|
|
3383
|
-
var
|
|
3164
|
+
var import_system55 = require("@marigold/system");
|
|
3165
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
3384
3166
|
var Stack = ({
|
|
3385
3167
|
children,
|
|
3386
3168
|
space = 0,
|
|
@@ -3391,14 +3173,14 @@ var Stack = ({
|
|
|
3391
3173
|
...props
|
|
3392
3174
|
}) => {
|
|
3393
3175
|
var _a, _b, _c, _d;
|
|
3394
|
-
return /* @__PURE__ */ (0,
|
|
3176
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
3395
3177
|
"div",
|
|
3396
3178
|
{
|
|
3397
|
-
className: (0,
|
|
3179
|
+
className: (0, import_system55.cn)(
|
|
3398
3180
|
"flex flex-col",
|
|
3399
|
-
|
|
3400
|
-
alignX && ((_b = (_a =
|
|
3401
|
-
alignY && ((_d = (_c =
|
|
3181
|
+
import_system55.gapSpace[space],
|
|
3182
|
+
alignX && ((_b = (_a = import_system55.alignment) == null ? void 0 : _a.vertical) == null ? void 0 : _b.alignmentX[alignX]),
|
|
3183
|
+
alignY && ((_d = (_c = import_system55.alignment) == null ? void 0 : _c.vertical) == null ? void 0 : _d.alignmentY[alignY]),
|
|
3402
3184
|
stretch && "h-full w-full"
|
|
3403
3185
|
),
|
|
3404
3186
|
...props,
|
|
@@ -3408,73 +3190,48 @@ var Stack = ({
|
|
|
3408
3190
|
};
|
|
3409
3191
|
|
|
3410
3192
|
// src/Switch/Switch.tsx
|
|
3411
|
-
var
|
|
3412
|
-
var
|
|
3413
|
-
var
|
|
3414
|
-
var
|
|
3415
|
-
var
|
|
3416
|
-
var import_system58 = require("@marigold/system");
|
|
3417
|
-
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
3418
|
-
var Switch = (0, import_react44.forwardRef)(
|
|
3193
|
+
var import_react43 = require("react");
|
|
3194
|
+
var import_react_aria_components8 = require("react-aria-components");
|
|
3195
|
+
var import_system56 = require("@marigold/system");
|
|
3196
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
3197
|
+
var _Switch = (0, import_react43.forwardRef)(
|
|
3419
3198
|
({
|
|
3420
3199
|
variant,
|
|
3421
3200
|
size,
|
|
3422
3201
|
width = "full",
|
|
3202
|
+
children,
|
|
3423
3203
|
selected,
|
|
3424
3204
|
disabled,
|
|
3425
3205
|
readOnly,
|
|
3426
|
-
|
|
3427
|
-
...rest
|
|
3206
|
+
...props
|
|
3428
3207
|
}, ref) => {
|
|
3429
|
-
const
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
isDisabled: disabled,
|
|
3433
|
-
isReadOnly: readOnly,
|
|
3434
|
-
defaultSelected: defaultChecked,
|
|
3435
|
-
...rest
|
|
3436
|
-
};
|
|
3437
|
-
const state = (0, import_toggle2.useToggleState)(props);
|
|
3438
|
-
const { inputProps } = (0, import_switch.useSwitch)(props, state, inputRef);
|
|
3439
|
-
const { isFocusVisible, focusProps } = (0, import_focus15.useFocusRing)();
|
|
3440
|
-
const stateProps = (0, import_system58.useStateProps)({
|
|
3441
|
-
selected: state.isSelected,
|
|
3442
|
-
disabled,
|
|
3443
|
-
readOnly,
|
|
3444
|
-
focus: isFocusVisible
|
|
3445
|
-
});
|
|
3446
|
-
const classNames2 = (0, import_system58.useClassNames)({ component: "Switch", size, variant });
|
|
3447
|
-
return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
|
|
3448
|
-
"label",
|
|
3208
|
+
const classNames2 = (0, import_system56.useClassNames)({ component: "Switch", size, variant });
|
|
3209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
3210
|
+
import_react_aria_components8.Switch,
|
|
3449
3211
|
{
|
|
3450
|
-
|
|
3212
|
+
...props,
|
|
3213
|
+
ref,
|
|
3214
|
+
className: (0, import_system56.cn)(
|
|
3215
|
+
import_system56.width[width],
|
|
3451
3216
|
"group/switch",
|
|
3452
|
-
|
|
3453
|
-
|
|
3217
|
+
"flex items-center justify-between gap-[1ch]",
|
|
3218
|
+
classNames2.container
|
|
3454
3219
|
),
|
|
3455
|
-
|
|
3220
|
+
isDisabled: disabled,
|
|
3221
|
+
isReadOnly: readOnly,
|
|
3456
3222
|
children: [
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
{
|
|
3460
|
-
ref: inputRef,
|
|
3461
|
-
className: "absolute left-0 top-0 z-[1] h-full w-full cursor-pointer opacity-[0.0001] disabled:cursor-not-allowed",
|
|
3462
|
-
...inputProps,
|
|
3463
|
-
...focusProps
|
|
3464
|
-
}
|
|
3465
|
-
),
|
|
3466
|
-
props.children && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_jsx_runtime71.Fragment, { children: props.children }),
|
|
3467
|
-
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
3223
|
+
children,
|
|
3224
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: " relative", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
3468
3225
|
"div",
|
|
3469
3226
|
{
|
|
3470
|
-
className: (0,
|
|
3471
|
-
"
|
|
3227
|
+
className: (0, import_system56.cn)(
|
|
3228
|
+
"h-6 w-12 basis-12 rounded-3xl group-disabled/switch:cursor-not-allowed ",
|
|
3472
3229
|
classNames2.track
|
|
3473
3230
|
),
|
|
3474
|
-
children: /* @__PURE__ */ (0,
|
|
3231
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
3475
3232
|
"div",
|
|
3476
3233
|
{
|
|
3477
|
-
className: (0,
|
|
3234
|
+
className: (0, import_system56.cn)(
|
|
3478
3235
|
"h-[22px] w-[22px]",
|
|
3479
3236
|
"cubic-bezier(.7,0,.3,1)",
|
|
3480
3237
|
"absolute left-0 top-px",
|
|
@@ -3485,7 +3242,7 @@ var Switch = (0, import_react44.forwardRef)(
|
|
|
3485
3242
|
}
|
|
3486
3243
|
)
|
|
3487
3244
|
}
|
|
3488
|
-
)
|
|
3245
|
+
) })
|
|
3489
3246
|
]
|
|
3490
3247
|
}
|
|
3491
3248
|
);
|
|
@@ -3493,33 +3250,33 @@ var Switch = (0, import_react44.forwardRef)(
|
|
|
3493
3250
|
);
|
|
3494
3251
|
|
|
3495
3252
|
// src/Table/Table.tsx
|
|
3496
|
-
var
|
|
3253
|
+
var import_react51 = require("react");
|
|
3497
3254
|
var import_table9 = require("@react-aria/table");
|
|
3498
3255
|
var import_table10 = require("@react-stately/table");
|
|
3499
|
-
var
|
|
3256
|
+
var import_system63 = require("@marigold/system");
|
|
3500
3257
|
|
|
3501
3258
|
// src/Table/Context.tsx
|
|
3502
|
-
var
|
|
3503
|
-
var TableContext = (0,
|
|
3504
|
-
var useTableContext = () => (0,
|
|
3259
|
+
var import_react44 = require("react");
|
|
3260
|
+
var TableContext = (0, import_react44.createContext)({});
|
|
3261
|
+
var useTableContext = () => (0, import_react44.useContext)(TableContext);
|
|
3505
3262
|
|
|
3506
3263
|
// src/Table/TableBody.tsx
|
|
3507
3264
|
var import_table = require("@react-aria/table");
|
|
3508
|
-
var
|
|
3265
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
3509
3266
|
var TableBody = ({ children }) => {
|
|
3510
3267
|
const { rowGroupProps } = (0, import_table.useTableRowGroup)();
|
|
3511
|
-
return /* @__PURE__ */ (0,
|
|
3268
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("tbody", { ...rowGroupProps, children });
|
|
3512
3269
|
};
|
|
3513
3270
|
|
|
3514
3271
|
// src/Table/TableCell.tsx
|
|
3515
|
-
var
|
|
3516
|
-
var
|
|
3272
|
+
var import_react45 = require("react");
|
|
3273
|
+
var import_focus12 = require("@react-aria/focus");
|
|
3517
3274
|
var import_table2 = require("@react-aria/table");
|
|
3518
|
-
var
|
|
3519
|
-
var
|
|
3520
|
-
var
|
|
3275
|
+
var import_utils21 = require("@react-aria/utils");
|
|
3276
|
+
var import_system57 = require("@marigold/system");
|
|
3277
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
3521
3278
|
var TableCell = ({ cell }) => {
|
|
3522
|
-
const ref = (0,
|
|
3279
|
+
const ref = (0, import_react45.useRef)(null);
|
|
3523
3280
|
const { interactive, state, classNames: classNames2 } = useTableContext();
|
|
3524
3281
|
const disabled = state.disabledKeys.has(cell.parentKey);
|
|
3525
3282
|
const { gridCellProps } = (0, import_table2.useTableCell)(
|
|
@@ -3538,14 +3295,14 @@ var TableCell = ({ cell }) => {
|
|
|
3538
3295
|
onMouseDown: (e) => e.stopPropagation(),
|
|
3539
3296
|
onPointerDown: (e) => e.stopPropagation()
|
|
3540
3297
|
};
|
|
3541
|
-
const { focusProps, isFocusVisible } = (0,
|
|
3542
|
-
const stateProps = (0,
|
|
3543
|
-
return /* @__PURE__ */ (0,
|
|
3298
|
+
const { focusProps, isFocusVisible } = (0, import_focus12.useFocusRing)();
|
|
3299
|
+
const stateProps = (0, import_system57.useStateProps)({ disabled, focusVisible: isFocusVisible });
|
|
3300
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
3544
3301
|
"td",
|
|
3545
3302
|
{
|
|
3546
3303
|
ref,
|
|
3547
3304
|
className: classNames2 == null ? void 0 : classNames2.cell,
|
|
3548
|
-
...(0,
|
|
3305
|
+
...(0, import_utils21.mergeProps)(cellProps, focusProps),
|
|
3549
3306
|
...stateProps,
|
|
3550
3307
|
children: cell.rendered
|
|
3551
3308
|
}
|
|
@@ -3553,11 +3310,11 @@ var TableCell = ({ cell }) => {
|
|
|
3553
3310
|
};
|
|
3554
3311
|
|
|
3555
3312
|
// src/Table/TableCheckboxCell.tsx
|
|
3556
|
-
var
|
|
3557
|
-
var
|
|
3313
|
+
var import_react46 = require("react");
|
|
3314
|
+
var import_focus13 = require("@react-aria/focus");
|
|
3558
3315
|
var import_table3 = require("@react-aria/table");
|
|
3559
|
-
var
|
|
3560
|
-
var
|
|
3316
|
+
var import_utils22 = require("@react-aria/utils");
|
|
3317
|
+
var import_system58 = require("@marigold/system");
|
|
3561
3318
|
|
|
3562
3319
|
// src/Table/utils.ts
|
|
3563
3320
|
var mapCheckboxProps = ({
|
|
@@ -3580,9 +3337,9 @@ var mapCheckboxProps = ({
|
|
|
3580
3337
|
};
|
|
3581
3338
|
|
|
3582
3339
|
// src/Table/TableCheckboxCell.tsx
|
|
3583
|
-
var
|
|
3340
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
3584
3341
|
var TableCheckboxCell = ({ cell }) => {
|
|
3585
|
-
const ref = (0,
|
|
3342
|
+
const ref = (0, import_react46.useRef)(null);
|
|
3586
3343
|
const { state, classNames: classNames2 } = useTableContext();
|
|
3587
3344
|
const disabled = state.disabledKeys.has(cell.parentKey);
|
|
3588
3345
|
const { gridCellProps } = (0, import_table3.useTableCell)(
|
|
@@ -3595,36 +3352,36 @@ var TableCheckboxCell = ({ cell }) => {
|
|
|
3595
3352
|
const { checkboxProps } = mapCheckboxProps(
|
|
3596
3353
|
(0, import_table3.useTableSelectionCheckbox)({ key: cell.parentKey }, state)
|
|
3597
3354
|
);
|
|
3598
|
-
const { focusProps, isFocusVisible } = (0,
|
|
3599
|
-
const stateProps = (0,
|
|
3600
|
-
return /* @__PURE__ */ (0,
|
|
3355
|
+
const { focusProps, isFocusVisible } = (0, import_focus13.useFocusRing)();
|
|
3356
|
+
const stateProps = (0, import_system58.useStateProps)({ disabled, focusVisible: isFocusVisible });
|
|
3357
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
3601
3358
|
"td",
|
|
3602
3359
|
{
|
|
3603
3360
|
ref,
|
|
3604
|
-
className: (0,
|
|
3605
|
-
...(0,
|
|
3361
|
+
className: (0, import_system58.cn)("text-center align-middle leading-none", classNames2 == null ? void 0 : classNames2.cell),
|
|
3362
|
+
...(0, import_utils22.mergeProps)(gridCellProps, focusProps),
|
|
3606
3363
|
...stateProps,
|
|
3607
|
-
children: /* @__PURE__ */ (0,
|
|
3364
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(_Checkbox, { ...checkboxProps })
|
|
3608
3365
|
}
|
|
3609
3366
|
);
|
|
3610
3367
|
};
|
|
3611
3368
|
|
|
3612
3369
|
// src/Table/TableColumnHeader.tsx
|
|
3613
|
-
var
|
|
3614
|
-
var
|
|
3615
|
-
var
|
|
3370
|
+
var import_react47 = require("react");
|
|
3371
|
+
var import_focus14 = require("@react-aria/focus");
|
|
3372
|
+
var import_interactions9 = require("@react-aria/interactions");
|
|
3616
3373
|
var import_table4 = require("@react-aria/table");
|
|
3617
|
-
var
|
|
3374
|
+
var import_utils24 = require("@react-aria/utils");
|
|
3618
3375
|
var import_icons2 = require("@marigold/icons");
|
|
3619
|
-
var
|
|
3620
|
-
var
|
|
3621
|
-
var
|
|
3376
|
+
var import_system59 = require("@marigold/system");
|
|
3377
|
+
var import_system60 = require("@marigold/system");
|
|
3378
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
3622
3379
|
var TableColumnHeader = ({
|
|
3623
3380
|
column,
|
|
3624
3381
|
width = "auto"
|
|
3625
3382
|
}) => {
|
|
3626
3383
|
var _a, _b;
|
|
3627
|
-
const ref = (0,
|
|
3384
|
+
const ref = (0, import_react47.useRef)(null);
|
|
3628
3385
|
const { state, classNames: classNames2 } = useTableContext();
|
|
3629
3386
|
const { columnHeaderProps } = (0, import_table4.useTableColumnHeader)(
|
|
3630
3387
|
{
|
|
@@ -3633,23 +3390,23 @@ var TableColumnHeader = ({
|
|
|
3633
3390
|
state,
|
|
3634
3391
|
ref
|
|
3635
3392
|
);
|
|
3636
|
-
const { hoverProps, isHovered } = (0,
|
|
3637
|
-
const { focusProps, isFocusVisible } = (0,
|
|
3638
|
-
const stateProps = (0,
|
|
3393
|
+
const { hoverProps, isHovered } = (0, import_interactions9.useHover)({});
|
|
3394
|
+
const { focusProps, isFocusVisible } = (0, import_focus14.useFocusRing)();
|
|
3395
|
+
const stateProps = (0, import_system59.useStateProps)({
|
|
3639
3396
|
hover: isHovered,
|
|
3640
3397
|
focusVisible: isFocusVisible
|
|
3641
3398
|
});
|
|
3642
|
-
return /* @__PURE__ */ (0,
|
|
3399
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
|
|
3643
3400
|
"th",
|
|
3644
3401
|
{
|
|
3645
3402
|
colSpan: column.colspan,
|
|
3646
3403
|
ref,
|
|
3647
|
-
className: (0,
|
|
3648
|
-
...(0,
|
|
3404
|
+
className: (0, import_system59.cn)("cursor-default", import_system60.width[width], classNames2 == null ? void 0 : classNames2.header),
|
|
3405
|
+
...(0, import_utils24.mergeProps)(columnHeaderProps, hoverProps, focusProps),
|
|
3649
3406
|
...stateProps,
|
|
3650
3407
|
children: [
|
|
3651
3408
|
column.rendered,
|
|
3652
|
-
column.props.allowsSorting && (((_a = state.sortDescriptor) == null ? void 0 : _a.column) === column.key ? ((_b = state.sortDescriptor) == null ? void 0 : _b.direction) === "ascending" ? /* @__PURE__ */ (0,
|
|
3409
|
+
column.props.allowsSorting && (((_a = state.sortDescriptor) == null ? void 0 : _a.column) === column.key ? ((_b = state.sortDescriptor) == null ? void 0 : _b.direction) === "ascending" ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_icons2.SortUp, { className: "inline-block" }) : /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_icons2.SortDown, { className: "inline-block" }) : /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_icons2.SortDown, { className: "inline-block" }))
|
|
3653
3410
|
]
|
|
3654
3411
|
}
|
|
3655
3412
|
);
|
|
@@ -3657,36 +3414,36 @@ var TableColumnHeader = ({
|
|
|
3657
3414
|
|
|
3658
3415
|
// src/Table/TableHeader.tsx
|
|
3659
3416
|
var import_table5 = require("@react-aria/table");
|
|
3660
|
-
var
|
|
3417
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
3661
3418
|
var TableHeader = ({ children }) => {
|
|
3662
3419
|
const { rowGroupProps } = (0, import_table5.useTableRowGroup)();
|
|
3663
|
-
return /* @__PURE__ */ (0,
|
|
3420
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("thead", { ...rowGroupProps, children });
|
|
3664
3421
|
};
|
|
3665
3422
|
|
|
3666
3423
|
// src/Table/TableHeaderRow.tsx
|
|
3667
|
-
var
|
|
3424
|
+
var import_react48 = require("react");
|
|
3668
3425
|
var import_table6 = require("@react-aria/table");
|
|
3669
|
-
var
|
|
3426
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
3670
3427
|
var TableHeaderRow = ({ item, children }) => {
|
|
3671
3428
|
const { state } = useTableContext();
|
|
3672
|
-
const ref = (0,
|
|
3429
|
+
const ref = (0, import_react48.useRef)(null);
|
|
3673
3430
|
const { rowProps } = (0, import_table6.useTableHeaderRow)({ node: item }, state, ref);
|
|
3674
|
-
return /* @__PURE__ */ (0,
|
|
3431
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("tr", { ...rowProps, ref, children });
|
|
3675
3432
|
};
|
|
3676
3433
|
|
|
3677
3434
|
// src/Table/TableRow.tsx
|
|
3678
|
-
var
|
|
3679
|
-
var
|
|
3680
|
-
var
|
|
3435
|
+
var import_react49 = require("react");
|
|
3436
|
+
var import_focus15 = require("@react-aria/focus");
|
|
3437
|
+
var import_interactions10 = require("@react-aria/interactions");
|
|
3681
3438
|
var import_table7 = require("@react-aria/table");
|
|
3682
|
-
var
|
|
3683
|
-
var
|
|
3684
|
-
var
|
|
3439
|
+
var import_utils25 = require("@react-aria/utils");
|
|
3440
|
+
var import_system61 = require("@marigold/system");
|
|
3441
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
3685
3442
|
var TableRow = ({ children, row }) => {
|
|
3686
|
-
const ref = (0,
|
|
3443
|
+
const ref = (0, import_react49.useRef)(null);
|
|
3687
3444
|
const { interactive, state, ...ctx } = useTableContext();
|
|
3688
3445
|
const { variant, size } = row.props;
|
|
3689
|
-
const classNames2 = (0,
|
|
3446
|
+
const classNames2 = (0, import_system61.useClassNames)({
|
|
3690
3447
|
component: "Table",
|
|
3691
3448
|
variant: variant || ctx.variant,
|
|
3692
3449
|
size: size || ctx.size
|
|
@@ -3700,28 +3457,28 @@ var TableRow = ({ children, row }) => {
|
|
|
3700
3457
|
);
|
|
3701
3458
|
const disabled = state.disabledKeys.has(row.key);
|
|
3702
3459
|
const selected = state.selectionManager.isSelected(row.key);
|
|
3703
|
-
const { focusProps, isFocusVisible } = (0,
|
|
3704
|
-
const { hoverProps, isHovered } = (0,
|
|
3460
|
+
const { focusProps, isFocusVisible } = (0, import_focus15.useFocusRing)({ within: true });
|
|
3461
|
+
const { hoverProps, isHovered } = (0, import_interactions10.useHover)({
|
|
3705
3462
|
isDisabled: disabled || !interactive
|
|
3706
3463
|
});
|
|
3707
|
-
const stateProps = (0,
|
|
3464
|
+
const stateProps = (0, import_system61.useStateProps)({
|
|
3708
3465
|
disabled,
|
|
3709
3466
|
selected,
|
|
3710
3467
|
hover: isHovered,
|
|
3711
3468
|
focusVisible: isFocusVisible,
|
|
3712
3469
|
active: isPressed
|
|
3713
3470
|
});
|
|
3714
|
-
return /* @__PURE__ */ (0,
|
|
3471
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
3715
3472
|
"tr",
|
|
3716
3473
|
{
|
|
3717
3474
|
ref,
|
|
3718
|
-
className: (0,
|
|
3475
|
+
className: (0, import_system61.cn)(
|
|
3719
3476
|
[
|
|
3720
3477
|
!interactive ? "cursor-text" : disabled ? "cursor-default" : "cursor-pointer"
|
|
3721
3478
|
],
|
|
3722
3479
|
classNames2 == null ? void 0 : classNames2.row
|
|
3723
3480
|
),
|
|
3724
|
-
...(0,
|
|
3481
|
+
...(0, import_utils25.mergeProps)(rowProps, focusProps, hoverProps),
|
|
3725
3482
|
...stateProps,
|
|
3726
3483
|
children
|
|
3727
3484
|
}
|
|
@@ -3729,18 +3486,18 @@ var TableRow = ({ children, row }) => {
|
|
|
3729
3486
|
};
|
|
3730
3487
|
|
|
3731
3488
|
// src/Table/TableSelectAllCell.tsx
|
|
3732
|
-
var
|
|
3733
|
-
var
|
|
3734
|
-
var
|
|
3489
|
+
var import_react50 = require("react");
|
|
3490
|
+
var import_focus16 = require("@react-aria/focus");
|
|
3491
|
+
var import_interactions11 = require("@react-aria/interactions");
|
|
3735
3492
|
var import_table8 = require("@react-aria/table");
|
|
3736
|
-
var
|
|
3737
|
-
var
|
|
3738
|
-
var
|
|
3493
|
+
var import_utils26 = require("@react-aria/utils");
|
|
3494
|
+
var import_system62 = require("@marigold/system");
|
|
3495
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
3739
3496
|
var TableSelectAllCell = ({
|
|
3740
3497
|
column,
|
|
3741
3498
|
width = "auto"
|
|
3742
3499
|
}) => {
|
|
3743
|
-
const ref = (0,
|
|
3500
|
+
const ref = (0, import_react50.useRef)(null);
|
|
3744
3501
|
const { state, classNames: classNames2 } = useTableContext();
|
|
3745
3502
|
const { columnHeaderProps } = (0, import_table8.useTableColumnHeader)(
|
|
3746
3503
|
{
|
|
@@ -3750,30 +3507,30 @@ var TableSelectAllCell = ({
|
|
|
3750
3507
|
ref
|
|
3751
3508
|
);
|
|
3752
3509
|
const { checkboxProps } = mapCheckboxProps((0, import_table8.useTableSelectAllCheckbox)(state));
|
|
3753
|
-
const { hoverProps, isHovered } = (0,
|
|
3754
|
-
const { focusProps, isFocusVisible } = (0,
|
|
3755
|
-
const stateProps = (0,
|
|
3510
|
+
const { hoverProps, isHovered } = (0, import_interactions11.useHover)({});
|
|
3511
|
+
const { focusProps, isFocusVisible } = (0, import_focus16.useFocusRing)();
|
|
3512
|
+
const stateProps = (0, import_system62.useStateProps)({
|
|
3756
3513
|
hover: isHovered,
|
|
3757
3514
|
focusVisible: isFocusVisible
|
|
3758
3515
|
});
|
|
3759
|
-
return /* @__PURE__ */ (0,
|
|
3516
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
3760
3517
|
"th",
|
|
3761
3518
|
{
|
|
3762
3519
|
ref,
|
|
3763
|
-
className: (0,
|
|
3764
|
-
|
|
3520
|
+
className: (0, import_system62.cn)(
|
|
3521
|
+
import_system62.width[width],
|
|
3765
3522
|
["text-center align-middle leading-none"],
|
|
3766
3523
|
classNames2 == null ? void 0 : classNames2.header
|
|
3767
3524
|
),
|
|
3768
|
-
...(0,
|
|
3525
|
+
...(0, import_utils26.mergeProps)(columnHeaderProps, hoverProps, focusProps),
|
|
3769
3526
|
...stateProps,
|
|
3770
|
-
children: /* @__PURE__ */ (0,
|
|
3527
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(_Checkbox, { ...checkboxProps })
|
|
3771
3528
|
}
|
|
3772
3529
|
);
|
|
3773
3530
|
};
|
|
3774
3531
|
|
|
3775
3532
|
// src/Table/Table.tsx
|
|
3776
|
-
var
|
|
3533
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
3777
3534
|
var Table = ({
|
|
3778
3535
|
variant,
|
|
3779
3536
|
size,
|
|
@@ -3782,7 +3539,7 @@ var Table = ({
|
|
|
3782
3539
|
...props
|
|
3783
3540
|
}) => {
|
|
3784
3541
|
const interactive = selectionMode !== "none";
|
|
3785
|
-
const tableRef = (0,
|
|
3542
|
+
const tableRef = (0, import_react51.useRef)(null);
|
|
3786
3543
|
const state = (0, import_table10.useTableState)({
|
|
3787
3544
|
...props,
|
|
3788
3545
|
selectionMode,
|
|
@@ -3790,21 +3547,21 @@ var Table = ({
|
|
|
3790
3547
|
props.selectionBehavior !== "replace"
|
|
3791
3548
|
});
|
|
3792
3549
|
const { gridProps } = (0, import_table9.useTable)(props, state, tableRef);
|
|
3793
|
-
const classNames2 = (0,
|
|
3550
|
+
const classNames2 = (0, import_system63.useClassNames)({
|
|
3794
3551
|
component: "Table",
|
|
3795
3552
|
variant,
|
|
3796
3553
|
size
|
|
3797
3554
|
});
|
|
3798
3555
|
const { collection } = state;
|
|
3799
|
-
return /* @__PURE__ */ (0,
|
|
3556
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
3800
3557
|
TableContext.Provider,
|
|
3801
3558
|
{
|
|
3802
3559
|
value: { state, interactive, classNames: classNames2, variant, size },
|
|
3803
|
-
children: /* @__PURE__ */ (0,
|
|
3560
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
3804
3561
|
"table",
|
|
3805
3562
|
{
|
|
3806
3563
|
ref: tableRef,
|
|
3807
|
-
className: (0,
|
|
3564
|
+
className: (0, import_system63.cn)(
|
|
3808
3565
|
"group/table",
|
|
3809
3566
|
"border-collapse overflow-auto whitespace-nowrap",
|
|
3810
3567
|
stretch ? "table w-full" : "block",
|
|
@@ -3812,17 +3569,17 @@ var Table = ({
|
|
|
3812
3569
|
),
|
|
3813
3570
|
...gridProps,
|
|
3814
3571
|
children: [
|
|
3815
|
-
/* @__PURE__ */ (0,
|
|
3572
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(TableHeader, { children: collection.headerRows.map((headerRow) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(TableHeaderRow, { item: headerRow, children: [...collection.getChildren(headerRow.key)].map(
|
|
3816
3573
|
(column) => {
|
|
3817
3574
|
var _a, _b, _c;
|
|
3818
|
-
return ((_a = column.props) == null ? void 0 : _a.isSelectionCell) ? /* @__PURE__ */ (0,
|
|
3575
|
+
return ((_a = column.props) == null ? void 0 : _a.isSelectionCell) ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
3819
3576
|
TableSelectAllCell,
|
|
3820
3577
|
{
|
|
3821
3578
|
width: (_b = column.props) == null ? void 0 : _b.width,
|
|
3822
3579
|
column
|
|
3823
3580
|
},
|
|
3824
3581
|
column.key
|
|
3825
|
-
) : /* @__PURE__ */ (0,
|
|
3582
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
3826
3583
|
TableColumnHeader,
|
|
3827
3584
|
{
|
|
3828
3585
|
width: (_c = column.props) == null ? void 0 : _c.width,
|
|
@@ -3832,12 +3589,12 @@ var Table = ({
|
|
|
3832
3589
|
);
|
|
3833
3590
|
}
|
|
3834
3591
|
) }, headerRow.key)) }),
|
|
3835
|
-
/* @__PURE__ */ (0,
|
|
3592
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(TableBody, { children: [
|
|
3836
3593
|
...collection.rows.map(
|
|
3837
|
-
(row) => row.type === "item" && /* @__PURE__ */ (0,
|
|
3594
|
+
(row) => row.type === "item" && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(TableRow, { row, children: [...collection.getChildren(row.key)].map(
|
|
3838
3595
|
(cell) => {
|
|
3839
3596
|
var _a;
|
|
3840
|
-
return ((_a = cell.props) == null ? void 0 : _a.isSelectionCell) ? /* @__PURE__ */ (0,
|
|
3597
|
+
return ((_a = cell.props) == null ? void 0 : _a.isSelectionCell) ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(TableCheckboxCell, { cell }, cell.key) : /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(TableCell, { cell }, cell.key);
|
|
3841
3598
|
}
|
|
3842
3599
|
) }, row.key)
|
|
3843
3600
|
)
|
|
@@ -3855,8 +3612,8 @@ Table.Header = import_table10.TableHeader;
|
|
|
3855
3612
|
Table.Row = import_table10.Row;
|
|
3856
3613
|
|
|
3857
3614
|
// src/Text/Text.tsx
|
|
3858
|
-
var
|
|
3859
|
-
var
|
|
3615
|
+
var import_system64 = require("@marigold/system");
|
|
3616
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
3860
3617
|
var Text = ({
|
|
3861
3618
|
variant,
|
|
3862
3619
|
size,
|
|
@@ -3869,27 +3626,27 @@ var Text = ({
|
|
|
3869
3626
|
children,
|
|
3870
3627
|
...props
|
|
3871
3628
|
}) => {
|
|
3872
|
-
const theme = (0,
|
|
3873
|
-
const classNames2 = (0,
|
|
3629
|
+
const theme = (0, import_system64.useTheme)();
|
|
3630
|
+
const classNames2 = (0, import_system64.useClassNames)({
|
|
3874
3631
|
component: "Text",
|
|
3875
3632
|
variant,
|
|
3876
3633
|
size
|
|
3877
3634
|
});
|
|
3878
|
-
return /* @__PURE__ */ (0,
|
|
3635
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
3879
3636
|
"p",
|
|
3880
3637
|
{
|
|
3881
3638
|
...props,
|
|
3882
|
-
className: (0,
|
|
3639
|
+
className: (0, import_system64.cn)(
|
|
3883
3640
|
classNames2,
|
|
3884
3641
|
"text-[--color] outline-[--outline]",
|
|
3885
|
-
fontStyle &&
|
|
3886
|
-
align &&
|
|
3887
|
-
cursor &&
|
|
3888
|
-
weight &&
|
|
3889
|
-
fontSize &&
|
|
3642
|
+
fontStyle && import_system64.textStyle[fontStyle],
|
|
3643
|
+
align && import_system64.textAlign[align],
|
|
3644
|
+
cursor && import_system64.cursorStyle[cursor],
|
|
3645
|
+
weight && import_system64.fontWeight[weight],
|
|
3646
|
+
fontSize && import_system64.textSize[fontSize]
|
|
3890
3647
|
),
|
|
3891
|
-
style: (0,
|
|
3892
|
-
color: color && theme.colors && (0,
|
|
3648
|
+
style: (0, import_system64.createVar)({
|
|
3649
|
+
color: color && theme.colors && (0, import_system64.get)(
|
|
3893
3650
|
theme.colors,
|
|
3894
3651
|
color.replace("-", "."),
|
|
3895
3652
|
color
|
|
@@ -3902,14 +3659,14 @@ var Text = ({
|
|
|
3902
3659
|
};
|
|
3903
3660
|
|
|
3904
3661
|
// src/TextArea/TextArea.tsx
|
|
3905
|
-
var
|
|
3906
|
-
var
|
|
3907
|
-
var
|
|
3662
|
+
var import_react52 = require("react");
|
|
3663
|
+
var import_focus17 = require("@react-aria/focus");
|
|
3664
|
+
var import_interactions12 = require("@react-aria/interactions");
|
|
3908
3665
|
var import_textfield = require("@react-aria/textfield");
|
|
3909
|
-
var
|
|
3910
|
-
var
|
|
3911
|
-
var
|
|
3912
|
-
var TextArea = (0,
|
|
3666
|
+
var import_utils28 = require("@react-aria/utils");
|
|
3667
|
+
var import_system65 = require("@marigold/system");
|
|
3668
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
3669
|
+
var TextArea = (0, import_react52.forwardRef)(
|
|
3913
3670
|
({
|
|
3914
3671
|
variant,
|
|
3915
3672
|
size,
|
|
@@ -3922,7 +3679,7 @@ var TextArea = (0, import_react53.forwardRef)(
|
|
|
3922
3679
|
...props
|
|
3923
3680
|
}, ref) => {
|
|
3924
3681
|
const { label, description, errorMessage } = props;
|
|
3925
|
-
const textAreaRef = (0,
|
|
3682
|
+
const textAreaRef = (0, import_utils28.useObjectRef)(ref);
|
|
3926
3683
|
const { labelProps, inputProps, descriptionProps, errorMessageProps } = (0, import_textfield.useTextField)(
|
|
3927
3684
|
{
|
|
3928
3685
|
inputElementType: "textarea",
|
|
@@ -3934,9 +3691,9 @@ var TextArea = (0, import_react53.forwardRef)(
|
|
|
3934
3691
|
},
|
|
3935
3692
|
textAreaRef
|
|
3936
3693
|
);
|
|
3937
|
-
const { hoverProps, isHovered } = (0,
|
|
3938
|
-
const { focusProps, isFocusVisible } = (0,
|
|
3939
|
-
const stateProps = (0,
|
|
3694
|
+
const { hoverProps, isHovered } = (0, import_interactions12.useHover)({});
|
|
3695
|
+
const { focusProps, isFocusVisible } = (0, import_focus17.useFocusRing)();
|
|
3696
|
+
const stateProps = (0, import_system65.useStateProps)({
|
|
3940
3697
|
hover: isHovered,
|
|
3941
3698
|
focus: isFocusVisible,
|
|
3942
3699
|
disabled,
|
|
@@ -3944,8 +3701,8 @@ var TextArea = (0, import_react53.forwardRef)(
|
|
|
3944
3701
|
required,
|
|
3945
3702
|
error
|
|
3946
3703
|
});
|
|
3947
|
-
const classNames2 = (0,
|
|
3948
|
-
return /* @__PURE__ */ (0,
|
|
3704
|
+
const classNames2 = (0, import_system65.useClassNames)({ component: "TextArea", variant, size });
|
|
3705
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
3949
3706
|
FieldBase,
|
|
3950
3707
|
{
|
|
3951
3708
|
label,
|
|
@@ -3959,7 +3716,7 @@ var TextArea = (0, import_react53.forwardRef)(
|
|
|
3959
3716
|
variant,
|
|
3960
3717
|
size,
|
|
3961
3718
|
width,
|
|
3962
|
-
children: /* @__PURE__ */ (0,
|
|
3719
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
3963
3720
|
"textarea",
|
|
3964
3721
|
{
|
|
3965
3722
|
className: classNames2,
|
|
@@ -3976,17 +3733,17 @@ var TextArea = (0, import_react53.forwardRef)(
|
|
|
3976
3733
|
);
|
|
3977
3734
|
|
|
3978
3735
|
// src/TextField/TextField.tsx
|
|
3979
|
-
var
|
|
3980
|
-
var
|
|
3981
|
-
var
|
|
3736
|
+
var import_react53 = require("react");
|
|
3737
|
+
var import_focus18 = require("@react-aria/focus");
|
|
3738
|
+
var import_interactions13 = require("@react-aria/interactions");
|
|
3982
3739
|
var import_textfield2 = require("@react-aria/textfield");
|
|
3983
|
-
var
|
|
3984
|
-
var
|
|
3985
|
-
var
|
|
3986
|
-
var TextField = (0,
|
|
3740
|
+
var import_utils29 = require("@react-aria/utils");
|
|
3741
|
+
var import_system66 = require("@marigold/system");
|
|
3742
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
3743
|
+
var TextField = (0, import_react53.forwardRef)(
|
|
3987
3744
|
({ variant, size, width, disabled, required, readOnly, error, ...props }, ref) => {
|
|
3988
3745
|
const { label, description, errorMessage, autoFocus } = props;
|
|
3989
|
-
const inputRef = (0,
|
|
3746
|
+
const inputRef = (0, import_utils29.useObjectRef)(ref);
|
|
3990
3747
|
const { labelProps, inputProps, descriptionProps, errorMessageProps } = (0, import_textfield2.useTextField)(
|
|
3991
3748
|
{
|
|
3992
3749
|
isDisabled: disabled,
|
|
@@ -3997,12 +3754,12 @@ var TextField = (0, import_react54.forwardRef)(
|
|
|
3997
3754
|
},
|
|
3998
3755
|
inputRef
|
|
3999
3756
|
);
|
|
4000
|
-
const { hoverProps, isHovered } = (0,
|
|
4001
|
-
const { focusProps, isFocused } = (0,
|
|
3757
|
+
const { hoverProps, isHovered } = (0, import_interactions13.useHover)({});
|
|
3758
|
+
const { focusProps, isFocused } = (0, import_focus18.useFocusRing)({
|
|
4002
3759
|
isTextInput: true,
|
|
4003
3760
|
autoFocus
|
|
4004
3761
|
});
|
|
4005
|
-
const stateProps = (0,
|
|
3762
|
+
const stateProps = (0, import_system66.useStateProps)({
|
|
4006
3763
|
hover: isHovered,
|
|
4007
3764
|
focus: isFocused,
|
|
4008
3765
|
disabled,
|
|
@@ -4010,7 +3767,7 @@ var TextField = (0, import_react54.forwardRef)(
|
|
|
4010
3767
|
readOnly,
|
|
4011
3768
|
required
|
|
4012
3769
|
});
|
|
4013
|
-
return /* @__PURE__ */ (0,
|
|
3770
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
4014
3771
|
FieldBase,
|
|
4015
3772
|
{
|
|
4016
3773
|
label,
|
|
@@ -4024,13 +3781,13 @@ var TextField = (0, import_react54.forwardRef)(
|
|
|
4024
3781
|
variant,
|
|
4025
3782
|
size,
|
|
4026
3783
|
width,
|
|
4027
|
-
children: /* @__PURE__ */ (0,
|
|
3784
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
4028
3785
|
Input,
|
|
4029
3786
|
{
|
|
4030
3787
|
ref: inputRef,
|
|
4031
3788
|
variant,
|
|
4032
3789
|
size,
|
|
4033
|
-
...(0,
|
|
3790
|
+
...(0, import_utils29.mergeProps)(focusProps, inputProps, hoverProps)
|
|
4034
3791
|
}
|
|
4035
3792
|
)
|
|
4036
3793
|
}
|
|
@@ -4039,8 +3796,8 @@ var TextField = (0, import_react54.forwardRef)(
|
|
|
4039
3796
|
);
|
|
4040
3797
|
|
|
4041
3798
|
// src/Tiles/Tiles.tsx
|
|
4042
|
-
var
|
|
4043
|
-
var
|
|
3799
|
+
var import_system67 = require("@marigold/system");
|
|
3800
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
4044
3801
|
var Tiles = ({
|
|
4045
3802
|
space = 0,
|
|
4046
3803
|
stretch = false,
|
|
@@ -4053,17 +3810,17 @@ var Tiles = ({
|
|
|
4053
3810
|
if (stretch) {
|
|
4054
3811
|
column = `minmax(${column}, 1fr)`;
|
|
4055
3812
|
}
|
|
4056
|
-
return /* @__PURE__ */ (0,
|
|
3813
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
4057
3814
|
"div",
|
|
4058
3815
|
{
|
|
4059
3816
|
...props,
|
|
4060
|
-
className: (0,
|
|
3817
|
+
className: (0, import_system67.cn)(
|
|
4061
3818
|
"grid",
|
|
4062
|
-
|
|
3819
|
+
import_system67.gapSpace[space],
|
|
4063
3820
|
"grid-cols-[repeat(auto-fit,var(--column))]",
|
|
4064
3821
|
equalHeight && "auto-rows-[1fr]"
|
|
4065
3822
|
),
|
|
4066
|
-
style: (0,
|
|
3823
|
+
style: (0, import_system67.createVar)({ column, tilesWidth }),
|
|
4067
3824
|
children
|
|
4068
3825
|
}
|
|
4069
3826
|
);
|
|
@@ -4071,20 +3828,20 @@ var Tiles = ({
|
|
|
4071
3828
|
|
|
4072
3829
|
// src/Tooltip/Tooltip.tsx
|
|
4073
3830
|
var import_tooltip3 = require("@react-aria/tooltip");
|
|
4074
|
-
var
|
|
3831
|
+
var import_system68 = require("@marigold/system");
|
|
4075
3832
|
|
|
4076
3833
|
// src/Tooltip/Context.ts
|
|
4077
|
-
var
|
|
4078
|
-
var TooltipContext = (0,
|
|
4079
|
-
var useTooltipContext = () => (0,
|
|
3834
|
+
var import_react54 = require("react");
|
|
3835
|
+
var TooltipContext = (0, import_react54.createContext)({});
|
|
3836
|
+
var useTooltipContext = () => (0, import_react54.useContext)(TooltipContext);
|
|
4080
3837
|
|
|
4081
3838
|
// src/Tooltip/TooltipTrigger.tsx
|
|
4082
|
-
var
|
|
4083
|
-
var
|
|
3839
|
+
var import_react55 = require("react");
|
|
3840
|
+
var import_focus19 = require("@react-aria/focus");
|
|
4084
3841
|
var import_overlays8 = require("@react-aria/overlays");
|
|
4085
3842
|
var import_tooltip = require("@react-aria/tooltip");
|
|
4086
3843
|
var import_tooltip2 = require("@react-stately/tooltip");
|
|
4087
|
-
var
|
|
3844
|
+
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
4088
3845
|
var TooltipTrigger = ({
|
|
4089
3846
|
disabled,
|
|
4090
3847
|
open,
|
|
@@ -4093,7 +3850,7 @@ var TooltipTrigger = ({
|
|
|
4093
3850
|
children,
|
|
4094
3851
|
...rest
|
|
4095
3852
|
}) => {
|
|
4096
|
-
const [tooltipTrigger, tooltip] =
|
|
3853
|
+
const [tooltipTrigger, tooltip] = import_react55.Children.toArray(children);
|
|
4097
3854
|
const props = {
|
|
4098
3855
|
...rest,
|
|
4099
3856
|
isDisabled: disabled,
|
|
@@ -4101,8 +3858,8 @@ var TooltipTrigger = ({
|
|
|
4101
3858
|
delay,
|
|
4102
3859
|
placement
|
|
4103
3860
|
};
|
|
4104
|
-
const tooltipTriggerRef = (0,
|
|
4105
|
-
const overlayRef = (0,
|
|
3861
|
+
const tooltipTriggerRef = (0, import_react55.useRef)(null);
|
|
3862
|
+
const overlayRef = (0, import_react55.useRef)(null);
|
|
4106
3863
|
const state = (0, import_tooltip2.useTooltipTriggerState)(props);
|
|
4107
3864
|
const { triggerProps, tooltipProps } = (0, import_tooltip.useTooltipTrigger)(
|
|
4108
3865
|
props,
|
|
@@ -4121,9 +3878,9 @@ var TooltipTrigger = ({
|
|
|
4121
3878
|
isOpen: state.isOpen,
|
|
4122
3879
|
overlayRef
|
|
4123
3880
|
});
|
|
4124
|
-
return /* @__PURE__ */ (0,
|
|
3881
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(import_focus19.FocusableProvider, { ref: tooltipTriggerRef, ...triggerProps, children: [
|
|
4125
3882
|
tooltipTrigger,
|
|
4126
|
-
/* @__PURE__ */ (0,
|
|
3883
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
4127
3884
|
TooltipContext.Provider,
|
|
4128
3885
|
{
|
|
4129
3886
|
value: {
|
|
@@ -4134,33 +3891,33 @@ var TooltipTrigger = ({
|
|
|
4134
3891
|
...tooltipProps,
|
|
4135
3892
|
...positionProps
|
|
4136
3893
|
},
|
|
4137
|
-
children: /* @__PURE__ */ (0,
|
|
3894
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Overlay, { open: state.isOpen, children: tooltip })
|
|
4138
3895
|
}
|
|
4139
3896
|
)
|
|
4140
3897
|
] });
|
|
4141
3898
|
};
|
|
4142
3899
|
|
|
4143
3900
|
// src/Tooltip/Tooltip.tsx
|
|
4144
|
-
var
|
|
3901
|
+
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
4145
3902
|
var Tooltip = ({ children, variant, size }) => {
|
|
4146
3903
|
const { arrowProps, state, overlayRef, placement, ...rest } = useTooltipContext();
|
|
4147
3904
|
const { tooltipProps } = (0, import_tooltip3.useTooltip)({}, state);
|
|
4148
|
-
const classNames2 = (0,
|
|
4149
|
-
return /* @__PURE__ */ (0,
|
|
3905
|
+
const classNames2 = (0, import_system68.useClassNames)({ component: "Tooltip", variant, size });
|
|
3906
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(
|
|
4150
3907
|
"div",
|
|
4151
3908
|
{
|
|
4152
3909
|
...tooltipProps,
|
|
4153
3910
|
...rest,
|
|
4154
3911
|
ref: overlayRef,
|
|
4155
|
-
className: (0,
|
|
3912
|
+
className: (0, import_system68.cn)("group/tooltip", classNames2.container),
|
|
4156
3913
|
"data-placement": placement,
|
|
4157
3914
|
children: [
|
|
4158
|
-
/* @__PURE__ */ (0,
|
|
4159
|
-
/* @__PURE__ */ (0,
|
|
3915
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { children }),
|
|
3916
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
4160
3917
|
"div",
|
|
4161
3918
|
{
|
|
4162
3919
|
...arrowProps,
|
|
4163
|
-
className: (0,
|
|
3920
|
+
className: (0, import_system68.cn)("absolute h-0 w-0", classNames2.arrow)
|
|
4164
3921
|
}
|
|
4165
3922
|
)
|
|
4166
3923
|
]
|
|
@@ -4173,31 +3930,31 @@ Tooltip.Trigger = TooltipTrigger;
|
|
|
4173
3930
|
var import_collections6 = require("@react-stately/collections");
|
|
4174
3931
|
|
|
4175
3932
|
// src/TagGroup/TagGroup.tsx
|
|
4176
|
-
var
|
|
3933
|
+
var import_react57 = require("react");
|
|
4177
3934
|
var import_tag2 = require("@react-aria/tag");
|
|
4178
3935
|
var import_list = require("@react-stately/list");
|
|
4179
|
-
var
|
|
3936
|
+
var import_system70 = require("@marigold/system");
|
|
4180
3937
|
|
|
4181
3938
|
// src/TagGroup/Tag.tsx
|
|
4182
|
-
var
|
|
4183
|
-
var
|
|
4184
|
-
var
|
|
3939
|
+
var import_react56 = __toESM(require("react"));
|
|
3940
|
+
var import_button6 = require("@react-aria/button");
|
|
3941
|
+
var import_focus20 = require("@react-aria/focus");
|
|
4185
3942
|
var import_tag = require("@react-aria/tag");
|
|
4186
|
-
var
|
|
4187
|
-
var
|
|
4188
|
-
var
|
|
3943
|
+
var import_utils30 = require("@react-aria/utils");
|
|
3944
|
+
var import_system69 = require("@marigold/system");
|
|
3945
|
+
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
4189
3946
|
var CloseButton2 = ({ className, ...props }) => {
|
|
4190
|
-
const ref = (0,
|
|
4191
|
-
const { buttonProps } = (0,
|
|
4192
|
-
return /* @__PURE__ */ (0,
|
|
3947
|
+
const ref = (0, import_react56.useRef)(null);
|
|
3948
|
+
const { buttonProps } = (0, import_button6.useButton)({ ...props }, ref);
|
|
3949
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("button", { className, ...buttonProps, children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("svg", { viewBox: "0 0 20 20", fill: "currentColor", width: 20, height: 20, children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("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" }) }) });
|
|
4193
3950
|
};
|
|
4194
3951
|
var Tag = ({ variant, size, item, state, ...rest }) => {
|
|
4195
3952
|
const props = {
|
|
4196
3953
|
item,
|
|
4197
3954
|
...rest
|
|
4198
3955
|
};
|
|
4199
|
-
let ref =
|
|
4200
|
-
let { focusProps } = (0,
|
|
3956
|
+
let ref = import_react56.default.useRef(null);
|
|
3957
|
+
let { focusProps } = (0, import_focus20.useFocusRing)({ within: true });
|
|
4201
3958
|
const { rowProps, gridCellProps, allowsRemoving, removeButtonProps } = (0, import_tag.useTag)(
|
|
4202
3959
|
{
|
|
4203
3960
|
...props,
|
|
@@ -4206,20 +3963,20 @@ var Tag = ({ variant, size, item, state, ...rest }) => {
|
|
|
4206
3963
|
state,
|
|
4207
3964
|
ref
|
|
4208
3965
|
);
|
|
4209
|
-
const classNames2 = (0,
|
|
4210
|
-
return /* @__PURE__ */ (0,
|
|
3966
|
+
const classNames2 = (0, import_system69.useClassNames)({ component: "Tag", variant, size });
|
|
3967
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
4211
3968
|
"span",
|
|
4212
3969
|
{
|
|
4213
3970
|
ref,
|
|
4214
|
-
...(0,
|
|
3971
|
+
...(0, import_utils30.mergeProps)(rowProps, focusProps),
|
|
4215
3972
|
className: classNames2.tag,
|
|
4216
|
-
children: /* @__PURE__ */ (0,
|
|
4217
|
-
/* @__PURE__ */ (0,
|
|
4218
|
-
allowsRemoving && /* @__PURE__ */ (0,
|
|
3973
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { ...gridCellProps, className: classNames2.gridCell, children: [
|
|
3974
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { children: item.rendered }),
|
|
3975
|
+
allowsRemoving && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
4219
3976
|
CloseButton2,
|
|
4220
3977
|
{
|
|
4221
3978
|
...removeButtonProps,
|
|
4222
|
-
className: (0,
|
|
3979
|
+
className: (0, import_system69.cn)("flex items-center", classNames2.closeButton)
|
|
4223
3980
|
}
|
|
4224
3981
|
)
|
|
4225
3982
|
] })
|
|
@@ -4228,8 +3985,8 @@ var Tag = ({ variant, size, item, state, ...rest }) => {
|
|
|
4228
3985
|
};
|
|
4229
3986
|
|
|
4230
3987
|
// src/TagGroup/TagGroup.tsx
|
|
4231
|
-
var
|
|
4232
|
-
var
|
|
3988
|
+
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
3989
|
+
var import_react58 = require("react");
|
|
4233
3990
|
var TagGroup = ({
|
|
4234
3991
|
width,
|
|
4235
3992
|
required,
|
|
@@ -4242,14 +3999,14 @@ var TagGroup = ({
|
|
|
4242
3999
|
validationState: error ? "invalid" : "valid",
|
|
4243
4000
|
...rest
|
|
4244
4001
|
};
|
|
4245
|
-
const inputRef = (0,
|
|
4002
|
+
const inputRef = (0, import_react57.useRef)(null);
|
|
4246
4003
|
const state = (0, import_list.useListState)(props);
|
|
4247
4004
|
const { gridProps, labelProps, descriptionProps, errorMessageProps } = (0, import_tag2.useTagGroup)(props, state, inputRef);
|
|
4248
|
-
const stateProps = (0,
|
|
4005
|
+
const stateProps = (0, import_system70.useStateProps)({
|
|
4249
4006
|
error,
|
|
4250
4007
|
required
|
|
4251
4008
|
});
|
|
4252
|
-
return /* @__PURE__ */ (0,
|
|
4009
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
4253
4010
|
FieldBase,
|
|
4254
4011
|
{
|
|
4255
4012
|
width,
|
|
@@ -4262,13 +4019,13 @@ var TagGroup = ({
|
|
|
4262
4019
|
errorMessageProps,
|
|
4263
4020
|
stateProps,
|
|
4264
4021
|
...gridProps,
|
|
4265
|
-
children: /* @__PURE__ */ (0,
|
|
4022
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
4266
4023
|
"div",
|
|
4267
4024
|
{
|
|
4268
4025
|
role: "presentation",
|
|
4269
4026
|
ref: inputRef,
|
|
4270
4027
|
className: "flex flex-wrap items-start gap-1",
|
|
4271
|
-
children: [...state.collection].map((item) => /* @__PURE__ */ (0,
|
|
4028
|
+
children: [...state.collection].map((item) => /* @__PURE__ */ (0, import_react58.createElement)(
|
|
4272
4029
|
Tag,
|
|
4273
4030
|
{
|
|
4274
4031
|
...item.props,
|
|
@@ -4290,12 +4047,15 @@ var TagGroup = ({
|
|
|
4290
4047
|
var Tag2 = import_collections6.Item;
|
|
4291
4048
|
Tag2.Group = TagGroup;
|
|
4292
4049
|
|
|
4050
|
+
// src/VisuallyHidden/VisuallyHidden.tsx
|
|
4051
|
+
var import_visually_hidden = require("@react-aria/visually-hidden");
|
|
4052
|
+
|
|
4293
4053
|
// src/XLoader/XLoader.tsx
|
|
4294
|
-
var
|
|
4295
|
-
var
|
|
4296
|
-
var
|
|
4297
|
-
var XLoader = (0,
|
|
4298
|
-
|
|
4054
|
+
var import_react59 = require("react");
|
|
4055
|
+
var import_system71 = require("@marigold/system");
|
|
4056
|
+
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
4057
|
+
var XLoader = (0, import_react59.forwardRef)((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
|
|
4058
|
+
import_system71.SVG,
|
|
4299
4059
|
{
|
|
4300
4060
|
id: "XLoader",
|
|
4301
4061
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -4304,13 +4064,13 @@ var XLoader = (0, import_react60.forwardRef)((props, ref) => /* @__PURE__ */ (0,
|
|
|
4304
4064
|
...props,
|
|
4305
4065
|
...ref,
|
|
4306
4066
|
children: [
|
|
4307
|
-
/* @__PURE__ */ (0,
|
|
4308
|
-
/* @__PURE__ */ (0,
|
|
4067
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("path", { id: "XMLID_1_", d: "M35.3 27h26.5l54 74.1H88.7z" }),
|
|
4068
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4309
4069
|
"path",
|
|
4310
4070
|
{
|
|
4311
4071
|
id: "XMLID_5_",
|
|
4312
4072
|
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",
|
|
4313
|
-
children: /* @__PURE__ */ (0,
|
|
4073
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4314
4074
|
"animate",
|
|
4315
4075
|
{
|
|
4316
4076
|
attributeName: "opacity",
|
|
@@ -4323,12 +4083,12 @@ var XLoader = (0, import_react60.forwardRef)((props, ref) => /* @__PURE__ */ (0,
|
|
|
4323
4083
|
)
|
|
4324
4084
|
}
|
|
4325
4085
|
),
|
|
4326
|
-
/* @__PURE__ */ (0,
|
|
4086
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4327
4087
|
"path",
|
|
4328
4088
|
{
|
|
4329
4089
|
id: "XMLID_18_",
|
|
4330
4090
|
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",
|
|
4331
|
-
children: /* @__PURE__ */ (0,
|
|
4091
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4332
4092
|
"animate",
|
|
4333
4093
|
{
|
|
4334
4094
|
attributeName: "opacity",
|
|
@@ -4341,12 +4101,12 @@ var XLoader = (0, import_react60.forwardRef)((props, ref) => /* @__PURE__ */ (0,
|
|
|
4341
4101
|
)
|
|
4342
4102
|
}
|
|
4343
4103
|
),
|
|
4344
|
-
/* @__PURE__ */ (0,
|
|
4104
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4345
4105
|
"path",
|
|
4346
4106
|
{
|
|
4347
4107
|
id: "XMLID_19_",
|
|
4348
4108
|
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",
|
|
4349
|
-
children: /* @__PURE__ */ (0,
|
|
4109
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4350
4110
|
"animate",
|
|
4351
4111
|
{
|
|
4352
4112
|
attributeName: "opacity",
|
|
@@ -4359,12 +4119,12 @@ var XLoader = (0, import_react60.forwardRef)((props, ref) => /* @__PURE__ */ (0,
|
|
|
4359
4119
|
)
|
|
4360
4120
|
}
|
|
4361
4121
|
),
|
|
4362
|
-
/* @__PURE__ */ (0,
|
|
4122
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4363
4123
|
"path",
|
|
4364
4124
|
{
|
|
4365
4125
|
id: "XMLID_20_",
|
|
4366
4126
|
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",
|
|
4367
|
-
children: /* @__PURE__ */ (0,
|
|
4127
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4368
4128
|
"animate",
|
|
4369
4129
|
{
|
|
4370
4130
|
attributeName: "opacity",
|
|
@@ -4377,12 +4137,12 @@ var XLoader = (0, import_react60.forwardRef)((props, ref) => /* @__PURE__ */ (0,
|
|
|
4377
4137
|
)
|
|
4378
4138
|
}
|
|
4379
4139
|
),
|
|
4380
|
-
/* @__PURE__ */ (0,
|
|
4140
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4381
4141
|
"path",
|
|
4382
4142
|
{
|
|
4383
4143
|
id: "XMLID_21_",
|
|
4384
4144
|
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",
|
|
4385
|
-
children: /* @__PURE__ */ (0,
|
|
4145
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4386
4146
|
"animate",
|
|
4387
4147
|
{
|
|
4388
4148
|
attributeName: "opacity",
|
|
@@ -4395,12 +4155,12 @@ var XLoader = (0, import_react60.forwardRef)((props, ref) => /* @__PURE__ */ (0,
|
|
|
4395
4155
|
)
|
|
4396
4156
|
}
|
|
4397
4157
|
),
|
|
4398
|
-
/* @__PURE__ */ (0,
|
|
4158
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4399
4159
|
"path",
|
|
4400
4160
|
{
|
|
4401
4161
|
id: "XMLID_22_",
|
|
4402
4162
|
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",
|
|
4403
|
-
children: /* @__PURE__ */ (0,
|
|
4163
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4404
4164
|
"animate",
|
|
4405
4165
|
{
|
|
4406
4166
|
attributeName: "opacity",
|
|
@@ -4413,12 +4173,12 @@ var XLoader = (0, import_react60.forwardRef)((props, ref) => /* @__PURE__ */ (0,
|
|
|
4413
4173
|
)
|
|
4414
4174
|
}
|
|
4415
4175
|
),
|
|
4416
|
-
/* @__PURE__ */ (0,
|
|
4176
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4417
4177
|
"path",
|
|
4418
4178
|
{
|
|
4419
4179
|
id: "XMLID_23_",
|
|
4420
4180
|
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",
|
|
4421
|
-
children: /* @__PURE__ */ (0,
|
|
4181
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4422
4182
|
"animate",
|
|
4423
4183
|
{
|
|
4424
4184
|
attributeName: "opacity",
|
|
@@ -4431,12 +4191,12 @@ var XLoader = (0, import_react60.forwardRef)((props, ref) => /* @__PURE__ */ (0,
|
|
|
4431
4191
|
)
|
|
4432
4192
|
}
|
|
4433
4193
|
),
|
|
4434
|
-
/* @__PURE__ */ (0,
|
|
4194
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4435
4195
|
"path",
|
|
4436
4196
|
{
|
|
4437
4197
|
id: "XMLID_24_",
|
|
4438
4198
|
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",
|
|
4439
|
-
children: /* @__PURE__ */ (0,
|
|
4199
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4440
4200
|
"animate",
|
|
4441
4201
|
{
|
|
4442
4202
|
attributeName: "opacity",
|
|
@@ -4449,12 +4209,12 @@ var XLoader = (0, import_react60.forwardRef)((props, ref) => /* @__PURE__ */ (0,
|
|
|
4449
4209
|
)
|
|
4450
4210
|
}
|
|
4451
4211
|
),
|
|
4452
|
-
/* @__PURE__ */ (0,
|
|
4212
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4453
4213
|
"path",
|
|
4454
4214
|
{
|
|
4455
4215
|
id: "XMLID_25_",
|
|
4456
4216
|
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",
|
|
4457
|
-
children: /* @__PURE__ */ (0,
|
|
4217
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4458
4218
|
"animate",
|
|
4459
4219
|
{
|
|
4460
4220
|
attributeName: "opacity",
|
|
@@ -4467,12 +4227,12 @@ var XLoader = (0, import_react60.forwardRef)((props, ref) => /* @__PURE__ */ (0,
|
|
|
4467
4227
|
)
|
|
4468
4228
|
}
|
|
4469
4229
|
),
|
|
4470
|
-
/* @__PURE__ */ (0,
|
|
4230
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4471
4231
|
"path",
|
|
4472
4232
|
{
|
|
4473
4233
|
id: "XMLID_26_",
|
|
4474
4234
|
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",
|
|
4475
|
-
children: /* @__PURE__ */ (0,
|
|
4235
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4476
4236
|
"animate",
|
|
4477
4237
|
{
|
|
4478
4238
|
attributeName: "opacity",
|
|
@@ -4485,12 +4245,12 @@ var XLoader = (0, import_react60.forwardRef)((props, ref) => /* @__PURE__ */ (0,
|
|
|
4485
4245
|
)
|
|
4486
4246
|
}
|
|
4487
4247
|
),
|
|
4488
|
-
/* @__PURE__ */ (0,
|
|
4248
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4489
4249
|
"path",
|
|
4490
4250
|
{
|
|
4491
4251
|
id: "XMLID_27_",
|
|
4492
4252
|
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",
|
|
4493
|
-
children: /* @__PURE__ */ (0,
|
|
4253
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4494
4254
|
"animate",
|
|
4495
4255
|
{
|
|
4496
4256
|
attributeName: "opacity",
|
|
@@ -4508,43 +4268,43 @@ var XLoader = (0, import_react60.forwardRef)((props, ref) => /* @__PURE__ */ (0,
|
|
|
4508
4268
|
));
|
|
4509
4269
|
|
|
4510
4270
|
// src/Tabs/Tabs.tsx
|
|
4511
|
-
var
|
|
4271
|
+
var import_react63 = require("react");
|
|
4512
4272
|
var import_tabs3 = require("@react-aria/tabs");
|
|
4513
4273
|
var import_collections7 = require("@react-stately/collections");
|
|
4514
4274
|
var import_tabs4 = require("@react-stately/tabs");
|
|
4515
|
-
var
|
|
4275
|
+
var import_system74 = require("@marigold/system");
|
|
4516
4276
|
|
|
4517
4277
|
// src/Tabs/Context.ts
|
|
4518
|
-
var
|
|
4519
|
-
var TabContext = (0,
|
|
4520
|
-
var useTabContext = () => (0,
|
|
4278
|
+
var import_react60 = require("react");
|
|
4279
|
+
var TabContext = (0, import_react60.createContext)({});
|
|
4280
|
+
var useTabContext = () => (0, import_react60.useContext)(TabContext);
|
|
4521
4281
|
|
|
4522
4282
|
// src/Tabs/Tab.tsx
|
|
4523
|
-
var
|
|
4524
|
-
var
|
|
4283
|
+
var import_react61 = require("react");
|
|
4284
|
+
var import_interactions14 = require("@react-aria/interactions");
|
|
4525
4285
|
var import_tabs = require("@react-aria/tabs");
|
|
4526
|
-
var
|
|
4527
|
-
var
|
|
4528
|
-
var
|
|
4286
|
+
var import_utils31 = require("@react-aria/utils");
|
|
4287
|
+
var import_system72 = require("@marigold/system");
|
|
4288
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
4529
4289
|
var Tab = ({ item, state }) => {
|
|
4530
4290
|
const { key, rendered } = item;
|
|
4531
|
-
const ref = (0,
|
|
4291
|
+
const ref = (0, import_react61.useRef)(null);
|
|
4532
4292
|
const { tabProps, isSelected } = (0, import_tabs.useTab)({ key }, state, ref);
|
|
4533
4293
|
const disabled = tabProps["aria-disabled"];
|
|
4534
|
-
const { hoverProps, isHovered } = (0,
|
|
4294
|
+
const { hoverProps, isHovered } = (0, import_interactions14.useHover)({
|
|
4535
4295
|
isDisabled: disabled || isSelected
|
|
4536
4296
|
});
|
|
4537
|
-
const { focusProps } = (0,
|
|
4538
|
-
const stateProps = (0,
|
|
4297
|
+
const { focusProps } = (0, import_interactions14.useFocus)({});
|
|
4298
|
+
const stateProps = (0, import_system72.useStateProps)({ active: isSelected, hover: isHovered });
|
|
4539
4299
|
const { classNames: classNames2 } = useTabContext();
|
|
4540
|
-
return /* @__PURE__ */ (0,
|
|
4300
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
4541
4301
|
"div",
|
|
4542
4302
|
{
|
|
4543
|
-
className: (0,
|
|
4303
|
+
className: (0, import_system72.cn)(
|
|
4544
4304
|
"flex cursor-pointer justify-center aria-disabled:cursor-not-allowed",
|
|
4545
4305
|
classNames2.tab
|
|
4546
4306
|
),
|
|
4547
|
-
...(0,
|
|
4307
|
+
...(0, import_utils31.mergeProps)(tabProps, stateProps, focusProps, hoverProps),
|
|
4548
4308
|
ref,
|
|
4549
4309
|
children: rendered
|
|
4550
4310
|
}
|
|
@@ -4552,21 +4312,21 @@ var Tab = ({ item, state }) => {
|
|
|
4552
4312
|
};
|
|
4553
4313
|
|
|
4554
4314
|
// src/Tabs/TabPanel.tsx
|
|
4555
|
-
var
|
|
4315
|
+
var import_react62 = require("react");
|
|
4556
4316
|
var import_tabs2 = require("@react-aria/tabs");
|
|
4557
|
-
var
|
|
4558
|
-
var
|
|
4317
|
+
var import_system73 = require("@marigold/system");
|
|
4318
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
4559
4319
|
var TabPanel = ({ state, ...props }) => {
|
|
4560
4320
|
var _a;
|
|
4561
|
-
const ref = (0,
|
|
4321
|
+
const ref = (0, import_react62.useRef)(null);
|
|
4562
4322
|
const { tabPanelProps } = (0, import_tabs2.useTabPanel)(props, state, ref);
|
|
4563
4323
|
const selectedItemProps = (_a = state.selectedItem) == null ? void 0 : _a.props;
|
|
4564
4324
|
const { classNames: classNames2 } = useTabContext();
|
|
4565
|
-
return /* @__PURE__ */ (0,
|
|
4325
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: (0, import_system73.cn)(classNames2.tabpanel), ref, ...tabPanelProps, children: selectedItemProps == null ? void 0 : selectedItemProps.children });
|
|
4566
4326
|
};
|
|
4567
4327
|
|
|
4568
4328
|
// src/Tabs/Tabs.tsx
|
|
4569
|
-
var
|
|
4329
|
+
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
4570
4330
|
var Tabs = ({
|
|
4571
4331
|
space = 2,
|
|
4572
4332
|
size = "medium",
|
|
@@ -4575,31 +4335,31 @@ var Tabs = ({
|
|
|
4575
4335
|
...rest
|
|
4576
4336
|
}) => {
|
|
4577
4337
|
var _a;
|
|
4578
|
-
const ref = (0,
|
|
4338
|
+
const ref = (0, import_react63.useRef)(null);
|
|
4579
4339
|
const props = {
|
|
4580
4340
|
isDisabled: disabled,
|
|
4581
4341
|
...rest
|
|
4582
4342
|
};
|
|
4583
4343
|
const state = (0, import_tabs4.useTabListState)(props);
|
|
4584
4344
|
const { tabListProps } = (0, import_tabs3.useTabList)(props, state, ref);
|
|
4585
|
-
const classNames2 = (0,
|
|
4345
|
+
const classNames2 = (0, import_system74.useClassNames)({
|
|
4586
4346
|
component: "Tabs",
|
|
4587
4347
|
size,
|
|
4588
4348
|
variant
|
|
4589
4349
|
});
|
|
4590
|
-
return /* @__PURE__ */ (0,
|
|
4591
|
-
/* @__PURE__ */ (0,
|
|
4350
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(TabContext.Provider, { value: { classNames: classNames2 }, children: /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: (0, import_system74.cn)(classNames2.container), children: [
|
|
4351
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4592
4352
|
"div",
|
|
4593
4353
|
{
|
|
4594
|
-
className: (0,
|
|
4354
|
+
className: (0, import_system74.cn)("flex", import_system74.gapSpace[space], classNames2.tabs),
|
|
4595
4355
|
...tabListProps,
|
|
4596
4356
|
ref,
|
|
4597
4357
|
children: [...state.collection].map((item) => {
|
|
4598
|
-
return /* @__PURE__ */ (0,
|
|
4358
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Tab, { item, state }, item.key);
|
|
4599
4359
|
})
|
|
4600
4360
|
}
|
|
4601
4361
|
),
|
|
4602
|
-
/* @__PURE__ */ (0,
|
|
4362
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(TabPanel, { state }, (_a = state.selectedItem) == null ? void 0 : _a.key)
|
|
4603
4363
|
] }) });
|
|
4604
4364
|
};
|
|
4605
4365
|
Tabs.Item = import_collections7.Item;
|
|
@@ -4671,6 +4431,7 @@ Tabs.Item = import_collections7.Item;
|
|
|
4671
4431
|
Underlay,
|
|
4672
4432
|
VisuallyHidden,
|
|
4673
4433
|
XLoader,
|
|
4434
|
+
_Slider,
|
|
4674
4435
|
useAsyncList,
|
|
4675
4436
|
useCheckboxGroupContext,
|
|
4676
4437
|
useFieldGroupContext,
|