@marigold/components 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +250 -133
- package/dist/index.js +1161 -615
- package/dist/index.mjs +1192 -602
- package/package.json +13 -5
package/dist/index.mjs
CHANGED
|
@@ -30,84 +30,13 @@ var __objRest = (source, exclude) => {
|
|
|
30
30
|
return target;
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
// src/
|
|
34
|
-
import React3 from "react";
|
|
35
|
-
|
|
36
|
-
// src/Inline/Inline.tsx
|
|
33
|
+
// src/Aside/Aside.tsx
|
|
37
34
|
import React from "react";
|
|
38
35
|
|
|
39
36
|
// src/Box.ts
|
|
40
37
|
import { Box } from "@marigold/system";
|
|
41
38
|
|
|
42
|
-
// src/Inline/Inline.tsx
|
|
43
|
-
var ALIGNMENT = {
|
|
44
|
-
top: "flex-start",
|
|
45
|
-
center: "center",
|
|
46
|
-
bottom: "flex-end"
|
|
47
|
-
};
|
|
48
|
-
var Inline = (_a) => {
|
|
49
|
-
var _b = _a, {
|
|
50
|
-
space = "none",
|
|
51
|
-
align = "center",
|
|
52
|
-
children
|
|
53
|
-
} = _b, props = __objRest(_b, [
|
|
54
|
-
"space",
|
|
55
|
-
"align",
|
|
56
|
-
"children"
|
|
57
|
-
]);
|
|
58
|
-
return /* @__PURE__ */ React.createElement(Box, __spreadValues({
|
|
59
|
-
__baseCSS: { gap: space, flexWrap: "wrap" },
|
|
60
|
-
display: "inline-flex",
|
|
61
|
-
alignItems: ALIGNMENT[align]
|
|
62
|
-
}, props), children);
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
// src/Stack/Stack.tsx
|
|
66
|
-
import React2 from "react";
|
|
67
|
-
var ALIGNMENT2 = {
|
|
68
|
-
left: "flex-start",
|
|
69
|
-
center: "center",
|
|
70
|
-
right: "flex-end"
|
|
71
|
-
};
|
|
72
|
-
var Stack = (_a) => {
|
|
73
|
-
var _b = _a, {
|
|
74
|
-
space = "none",
|
|
75
|
-
align = "left",
|
|
76
|
-
children
|
|
77
|
-
} = _b, props = __objRest(_b, [
|
|
78
|
-
"space",
|
|
79
|
-
"align",
|
|
80
|
-
"children"
|
|
81
|
-
]);
|
|
82
|
-
return /* @__PURE__ */ React2.createElement(Box, __spreadProps(__spreadValues({}, props), {
|
|
83
|
-
display: "flex",
|
|
84
|
-
flexDirection: "column",
|
|
85
|
-
alignItems: ALIGNMENT2[align],
|
|
86
|
-
p: "0",
|
|
87
|
-
css: { gap: space }
|
|
88
|
-
}), children);
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
// src/ActionGroup/ActionGroup.tsx
|
|
92
|
-
var ActionGroup = (_a) => {
|
|
93
|
-
var _b = _a, {
|
|
94
|
-
space = "none",
|
|
95
|
-
verticalAlignment = false,
|
|
96
|
-
children
|
|
97
|
-
} = _b, props = __objRest(_b, [
|
|
98
|
-
"space",
|
|
99
|
-
"verticalAlignment",
|
|
100
|
-
"children"
|
|
101
|
-
]);
|
|
102
|
-
return verticalAlignment ? /* @__PURE__ */ React3.createElement(Stack, __spreadValues({
|
|
103
|
-
space
|
|
104
|
-
}, props), children) : /* @__PURE__ */ React3.createElement(Inline, __spreadValues({
|
|
105
|
-
space
|
|
106
|
-
}, props), children);
|
|
107
|
-
};
|
|
108
|
-
|
|
109
39
|
// src/Aside/Aside.tsx
|
|
110
|
-
import React4 from "react";
|
|
111
40
|
var SIDE_MAP = {
|
|
112
41
|
left: [":not(style):first-of-type", ":last-child"],
|
|
113
42
|
right: [":last-child", ":not(style):first-of-type"]
|
|
@@ -121,7 +50,7 @@ var Aside = ({
|
|
|
121
50
|
wrap = "50%"
|
|
122
51
|
}) => {
|
|
123
52
|
const [aside, content] = SIDE_MAP[side];
|
|
124
|
-
return /* @__PURE__ */
|
|
53
|
+
return /* @__PURE__ */ React.createElement(Box, {
|
|
125
54
|
css: {
|
|
126
55
|
display: "flex",
|
|
127
56
|
flexWrap: "wrap",
|
|
@@ -141,90 +70,86 @@ var Aside = ({
|
|
|
141
70
|
};
|
|
142
71
|
|
|
143
72
|
// src/Aspect/Aspect.tsx
|
|
144
|
-
import
|
|
73
|
+
import React2 from "react";
|
|
145
74
|
import { aspect } from "@marigold/tokens";
|
|
146
|
-
var Aspect =
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
aspectRatio: aspect[ratio]
|
|
158
|
-
}
|
|
159
|
-
}), /* @__PURE__ */ React5.createElement(Box, __spreadProps(__spreadValues({}, props), {
|
|
160
|
-
__baseCSS: {
|
|
161
|
-
position: "absolute",
|
|
162
|
-
top: 0,
|
|
163
|
-
right: 0,
|
|
164
|
-
bottom: 0,
|
|
165
|
-
left: 0
|
|
166
|
-
}
|
|
167
|
-
}), children));
|
|
168
|
-
});
|
|
75
|
+
var Aspect = ({
|
|
76
|
+
ratio = "square",
|
|
77
|
+
maxWidth,
|
|
78
|
+
children
|
|
79
|
+
}) => /* @__PURE__ */ React2.createElement(Box, {
|
|
80
|
+
css: {
|
|
81
|
+
aspectRatio: aspect[ratio],
|
|
82
|
+
overflow: "hidden",
|
|
83
|
+
maxWidth
|
|
84
|
+
}
|
|
85
|
+
}, children);
|
|
169
86
|
|
|
170
87
|
// src/Badge/Badge.tsx
|
|
171
|
-
import
|
|
88
|
+
import React3 from "react";
|
|
89
|
+
import { useComponentStyles } from "@marigold/system";
|
|
172
90
|
var Badge = (_a) => {
|
|
173
|
-
var _b = _a, {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
} = _b, props = __objRest(_b, [
|
|
179
|
-
"variant",
|
|
180
|
-
"bgColor",
|
|
181
|
-
"borderColor",
|
|
182
|
-
"children"
|
|
183
|
-
]);
|
|
184
|
-
return /* @__PURE__ */ React6.createElement(Box, __spreadValues({
|
|
185
|
-
css: { bg: bgColor, borderColor },
|
|
186
|
-
variant: `badge.${variant}`
|
|
187
|
-
}, props), children);
|
|
91
|
+
var _b = _a, { variant, size, children } = _b, props = __objRest(_b, ["variant", "size", "children"]);
|
|
92
|
+
const styles = useComponentStyles("Badge", { variant, size });
|
|
93
|
+
return /* @__PURE__ */ React3.createElement(Box, __spreadProps(__spreadValues({}, props), {
|
|
94
|
+
css: styles
|
|
95
|
+
}), children);
|
|
188
96
|
};
|
|
189
97
|
|
|
190
98
|
// src/Button/Button.tsx
|
|
191
|
-
import
|
|
99
|
+
import React4, {
|
|
100
|
+
forwardRef,
|
|
101
|
+
useImperativeHandle,
|
|
102
|
+
useRef
|
|
103
|
+
} from "react";
|
|
192
104
|
import { useButton } from "@react-aria/button";
|
|
105
|
+
import { useFocusRing } from "@react-aria/focus";
|
|
106
|
+
import { mergeProps } from "@react-aria/utils";
|
|
107
|
+
import {
|
|
108
|
+
Box as Box2,
|
|
109
|
+
useComponentStyles as useComponentStyles2,
|
|
110
|
+
useStateProps
|
|
111
|
+
} from "@marigold/system";
|
|
193
112
|
var Button = forwardRef((_a, ref) => {
|
|
194
113
|
var _b = _a, {
|
|
195
114
|
as = "button",
|
|
196
|
-
variant = "primary",
|
|
197
|
-
size = "large",
|
|
198
|
-
space = "none",
|
|
199
|
-
disabled,
|
|
200
115
|
children,
|
|
201
|
-
|
|
116
|
+
variant,
|
|
117
|
+
size,
|
|
118
|
+
disabled
|
|
202
119
|
} = _b, props = __objRest(_b, [
|
|
203
120
|
"as",
|
|
121
|
+
"children",
|
|
204
122
|
"variant",
|
|
205
123
|
"size",
|
|
206
|
-
"
|
|
207
|
-
"disabled",
|
|
208
|
-
"children",
|
|
209
|
-
"className"
|
|
124
|
+
"disabled"
|
|
210
125
|
]);
|
|
211
|
-
const
|
|
126
|
+
const buttonRef = useRef(null);
|
|
127
|
+
useImperativeHandle(ref, () => buttonRef.current);
|
|
128
|
+
const { buttonProps, isPressed } = useButton(__spreadProps(__spreadValues({}, props), {
|
|
212
129
|
elementType: typeof as === "string" ? as : "span",
|
|
213
130
|
isDisabled: disabled
|
|
214
|
-
}),
|
|
215
|
-
|
|
131
|
+
}), buttonRef);
|
|
132
|
+
const { isFocusVisible, focusProps } = useFocusRing();
|
|
133
|
+
const styles = useComponentStyles2("Button", { variant, size });
|
|
134
|
+
const stateProps = useStateProps({
|
|
135
|
+
active: isPressed,
|
|
136
|
+
focus: isFocusVisible
|
|
137
|
+
});
|
|
138
|
+
return /* @__PURE__ */ React4.createElement(Box2, __spreadProps(__spreadValues(__spreadValues({}, mergeProps(buttonProps, focusProps)), stateProps), {
|
|
216
139
|
as,
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
140
|
+
ref: buttonRef,
|
|
141
|
+
__baseCSS: {
|
|
142
|
+
display: "inline-flex",
|
|
143
|
+
alignItems: "center",
|
|
144
|
+
gap: "0.5ch",
|
|
145
|
+
cursor: disabled ? "not-allowed" : "pointer"
|
|
146
|
+
},
|
|
147
|
+
css: styles
|
|
223
148
|
}), children);
|
|
224
149
|
});
|
|
225
150
|
|
|
226
151
|
// src/Breakout/Breakout.tsx
|
|
227
|
-
import
|
|
152
|
+
import React5 from "react";
|
|
228
153
|
var useAlignment = (direction) => {
|
|
229
154
|
switch (direction) {
|
|
230
155
|
case "right":
|
|
@@ -248,7 +173,7 @@ var Breakout = (_a) => {
|
|
|
248
173
|
]);
|
|
249
174
|
const alignItems = useAlignment(horizontalAlign);
|
|
250
175
|
const justifyContent = useAlignment(verticalAlign);
|
|
251
|
-
return /* @__PURE__ */
|
|
176
|
+
return /* @__PURE__ */ React5.createElement(Box, __spreadValues({
|
|
252
177
|
alignItems,
|
|
253
178
|
justifyContent,
|
|
254
179
|
width: "100%",
|
|
@@ -260,34 +185,21 @@ var Breakout = (_a) => {
|
|
|
260
185
|
};
|
|
261
186
|
|
|
262
187
|
// src/Card/Card.tsx
|
|
263
|
-
import
|
|
188
|
+
import React6 from "react";
|
|
189
|
+
import {
|
|
190
|
+
Box as Box3,
|
|
191
|
+
useComponentStyles as useComponentStyles3
|
|
192
|
+
} from "@marigold/system";
|
|
264
193
|
var Card = (_a) => {
|
|
265
|
-
var _b = _a, {
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
children
|
|
271
|
-
} = _b, props = __objRest(_b, [
|
|
272
|
-
"variant",
|
|
273
|
-
"title",
|
|
274
|
-
"width",
|
|
275
|
-
"className",
|
|
276
|
-
"children"
|
|
277
|
-
]);
|
|
278
|
-
return /* @__PURE__ */ React9.createElement(Box, __spreadProps(__spreadValues({}, props), {
|
|
279
|
-
variant: `card.${variant}`,
|
|
280
|
-
maxWidth: width,
|
|
281
|
-
className
|
|
282
|
-
}), title && /* @__PURE__ */ React9.createElement(Box, {
|
|
283
|
-
as: "h2",
|
|
284
|
-
variant: "text.h2",
|
|
285
|
-
pb: "small"
|
|
286
|
-
}, title), children);
|
|
194
|
+
var _b = _a, { children, variant, size } = _b, props = __objRest(_b, ["children", "variant", "size"]);
|
|
195
|
+
const styles = useComponentStyles3("Card", { variant, size });
|
|
196
|
+
return /* @__PURE__ */ React6.createElement(Box3, __spreadProps(__spreadValues({}, props), {
|
|
197
|
+
css: styles
|
|
198
|
+
}), children);
|
|
287
199
|
};
|
|
288
200
|
|
|
289
201
|
// src/Center/Center.tsx
|
|
290
|
-
import
|
|
202
|
+
import React7 from "react";
|
|
291
203
|
var Center = (_a) => {
|
|
292
204
|
var _b = _a, {
|
|
293
205
|
maxWidth,
|
|
@@ -298,7 +210,7 @@ var Center = (_a) => {
|
|
|
298
210
|
"space",
|
|
299
211
|
"children"
|
|
300
212
|
]);
|
|
301
|
-
return /* @__PURE__ */
|
|
213
|
+
return /* @__PURE__ */ React7.createElement(Box, __spreadValues({
|
|
302
214
|
css: {
|
|
303
215
|
boxSizing: "content-box",
|
|
304
216
|
display: "flex",
|
|
@@ -313,172 +225,229 @@ var Center = (_a) => {
|
|
|
313
225
|
};
|
|
314
226
|
|
|
315
227
|
// src/Checkbox/Checkbox.tsx
|
|
316
|
-
import
|
|
317
|
-
import {
|
|
318
|
-
import {
|
|
319
|
-
import {
|
|
228
|
+
import React10 from "react";
|
|
229
|
+
import { useCheckbox, useCheckboxGroupItem } from "@react-aria/checkbox";
|
|
230
|
+
import { useFocusRing as useFocusRing2 } from "@react-aria/focus";
|
|
231
|
+
import { useHover } from "@react-aria/interactions";
|
|
320
232
|
import { useToggleState } from "@react-stately/toggle";
|
|
321
|
-
import {
|
|
233
|
+
import {
|
|
234
|
+
Box as Box6,
|
|
235
|
+
useComponentStyles as useComponentStyles6,
|
|
236
|
+
useStateProps as useStateProps2
|
|
237
|
+
} from "@marigold/system";
|
|
322
238
|
|
|
323
|
-
// src/Checkbox/
|
|
324
|
-
import
|
|
325
|
-
import {
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
}
|
|
333
|
-
const conditionalStates = disabled ? {
|
|
334
|
-
disabled
|
|
335
|
-
} : {
|
|
336
|
-
checked,
|
|
337
|
-
error
|
|
338
|
-
};
|
|
339
|
-
return /* @__PURE__ */ React11.createElement(SVG, {
|
|
340
|
-
width: "16",
|
|
341
|
-
height: "32",
|
|
342
|
-
viewBox: "0 0 16 32",
|
|
343
|
-
fill: "none",
|
|
344
|
-
"aria-hidden": "true"
|
|
345
|
-
}, /* @__PURE__ */ React11.createElement(Box, {
|
|
346
|
-
as: "rect",
|
|
347
|
-
x: "0.5",
|
|
348
|
-
y: "8.5",
|
|
349
|
-
width: "15px",
|
|
350
|
-
height: "15px",
|
|
351
|
-
rx: "1.5",
|
|
352
|
-
variant: conditional(`checkbox.${variant}`, conditionalStates)
|
|
353
|
-
}), checked && indeterminated && /* @__PURE__ */ React11.createElement(Box, {
|
|
354
|
-
__baseCSS: { fill: "gray00" },
|
|
355
|
-
as: "path",
|
|
356
|
-
fillRule: "evenodd",
|
|
357
|
-
clipRule: "evenodd",
|
|
358
|
-
d: "M13.5 17.0402H2.5V15.4688H13.5V17.0402V17.0402Z"
|
|
359
|
-
}), checked && !indeterminated && /* @__PURE__ */ React11.createElement(Box, {
|
|
360
|
-
__baseCSS: { fill: "gray00" },
|
|
361
|
-
as: "path",
|
|
362
|
-
fillRule: "evenodd",
|
|
363
|
-
clipRule: "evenodd",
|
|
364
|
-
d: "M13.9571 12.8338L12.4085 11.2852L6.08699 17.6007L3.59887 15.1126L2.04163 16.6588L6.08682 20.704L13.9571 12.8338Z"
|
|
365
|
-
}));
|
|
366
|
-
};
|
|
239
|
+
// src/Checkbox/CheckboxGroup.tsx
|
|
240
|
+
import React9, { createContext, useContext } from "react";
|
|
241
|
+
import { useCheckboxGroup } from "@react-aria/checkbox";
|
|
242
|
+
import {
|
|
243
|
+
useCheckboxGroupState
|
|
244
|
+
} from "@react-stately/checkbox";
|
|
245
|
+
import {
|
|
246
|
+
Box as Box5,
|
|
247
|
+
useComponentStyles as useComponentStyles5
|
|
248
|
+
} from "@marigold/system";
|
|
367
249
|
|
|
368
|
-
// src/
|
|
369
|
-
import
|
|
250
|
+
// src/Field/Label.tsx
|
|
251
|
+
import React8 from "react";
|
|
370
252
|
import { Required } from "@marigold/icons";
|
|
371
|
-
|
|
372
|
-
var _b = _a, {
|
|
373
|
-
variant = "above",
|
|
374
|
-
required,
|
|
375
|
-
color = "text",
|
|
376
|
-
children
|
|
377
|
-
} = _b, props = __objRest(_b, [
|
|
378
|
-
"variant",
|
|
379
|
-
"required",
|
|
380
|
-
"color",
|
|
381
|
-
"children"
|
|
382
|
-
]);
|
|
383
|
-
return /* @__PURE__ */ React12.createElement(Box, __spreadProps(__spreadValues({}, props), {
|
|
384
|
-
as: "label",
|
|
385
|
-
__baseCSS: { color },
|
|
386
|
-
variant: `label.${variant}`
|
|
387
|
-
}), children);
|
|
388
|
-
};
|
|
253
|
+
import { Box as Box4, useComponentStyles as useComponentStyles4 } from "@marigold/system";
|
|
389
254
|
var Label = (_a) => {
|
|
390
255
|
var _b = _a, {
|
|
256
|
+
as = "label",
|
|
391
257
|
required,
|
|
392
|
-
children
|
|
258
|
+
children,
|
|
259
|
+
variant,
|
|
260
|
+
size
|
|
393
261
|
} = _b, props = __objRest(_b, [
|
|
262
|
+
"as",
|
|
394
263
|
"required",
|
|
395
|
-
"children"
|
|
264
|
+
"children",
|
|
265
|
+
"variant",
|
|
266
|
+
"size"
|
|
396
267
|
]);
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
alignItems: "center"
|
|
401
|
-
|
|
268
|
+
const styles = useComponentStyles4("Label", { size, variant });
|
|
269
|
+
return /* @__PURE__ */ React8.createElement(Box4, __spreadProps(__spreadValues({}, props), {
|
|
270
|
+
as,
|
|
271
|
+
__baseCSS: { display: "flex", alignItems: "center", gap: 4 },
|
|
272
|
+
css: styles
|
|
273
|
+
}), children, required && /* @__PURE__ */ React8.createElement(Required, {
|
|
274
|
+
role: "presentation",
|
|
402
275
|
size: 16,
|
|
403
276
|
fill: "error"
|
|
404
|
-
}))
|
|
277
|
+
}));
|
|
405
278
|
};
|
|
406
279
|
|
|
407
|
-
// src/
|
|
408
|
-
|
|
409
|
-
var
|
|
280
|
+
// src/Checkbox/CheckboxGroup.tsx
|
|
281
|
+
var CheckboxGroupContext = createContext(null);
|
|
282
|
+
var useCheckboxGroupContext = () => useContext(CheckboxGroupContext);
|
|
283
|
+
var CheckboxGroup = (_a) => {
|
|
410
284
|
var _b = _a, {
|
|
411
|
-
variant = "error",
|
|
412
285
|
children,
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
286
|
+
variant,
|
|
287
|
+
size,
|
|
288
|
+
required,
|
|
289
|
+
disabled,
|
|
290
|
+
readOnly,
|
|
291
|
+
error
|
|
292
|
+
} = _b, rest = __objRest(_b, [
|
|
416
293
|
"children",
|
|
417
|
-
"
|
|
294
|
+
"variant",
|
|
295
|
+
"size",
|
|
296
|
+
"required",
|
|
297
|
+
"disabled",
|
|
298
|
+
"readOnly",
|
|
299
|
+
"error"
|
|
418
300
|
]);
|
|
419
|
-
|
|
301
|
+
const props = __spreadValues({
|
|
302
|
+
isRequired: required,
|
|
303
|
+
isDisabled: disabled,
|
|
304
|
+
isReadOnly: readOnly,
|
|
305
|
+
validationState: error ? "invalid" : "valid"
|
|
306
|
+
}, rest);
|
|
307
|
+
const state = useCheckboxGroupState(props);
|
|
308
|
+
const { groupProps, labelProps } = useCheckboxGroup(props, state);
|
|
309
|
+
const styles = useComponentStyles5("CheckboxGroup", { variant, size }, { parts: ["container", "group"] });
|
|
310
|
+
return /* @__PURE__ */ React9.createElement(Box5, __spreadProps(__spreadValues({}, groupProps), {
|
|
311
|
+
css: styles.container
|
|
312
|
+
}), props.label && /* @__PURE__ */ React9.createElement(Label, __spreadValues({
|
|
420
313
|
as: "span",
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
314
|
+
required
|
|
315
|
+
}, labelProps), props.label), /* @__PURE__ */ React9.createElement(Box5, {
|
|
316
|
+
role: "presentation",
|
|
317
|
+
__baseCSS: {
|
|
318
|
+
display: "flex",
|
|
319
|
+
flexDirection: "column",
|
|
320
|
+
alignItems: "left"
|
|
321
|
+
},
|
|
322
|
+
css: styles.group
|
|
323
|
+
}, /* @__PURE__ */ React9.createElement(CheckboxGroupContext.Provider, {
|
|
324
|
+
value: __spreadValues({ variant, size, error }, state)
|
|
325
|
+
}, children)));
|
|
426
326
|
};
|
|
427
327
|
|
|
428
328
|
// src/Checkbox/Checkbox.tsx
|
|
429
|
-
var
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
329
|
+
var CheckMark = () => /* @__PURE__ */ React10.createElement("svg", {
|
|
330
|
+
viewBox: "0 0 12 10"
|
|
331
|
+
}, /* @__PURE__ */ React10.createElement("path", {
|
|
332
|
+
fill: "currentColor",
|
|
333
|
+
stroke: "none",
|
|
334
|
+
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"
|
|
335
|
+
}));
|
|
336
|
+
var IndeterminateMark = () => /* @__PURE__ */ React10.createElement("svg", {
|
|
337
|
+
width: "12",
|
|
338
|
+
height: "3",
|
|
339
|
+
viewBox: "0 0 12 3"
|
|
340
|
+
}, /* @__PURE__ */ React10.createElement("path", {
|
|
341
|
+
fill: "currentColor",
|
|
342
|
+
stroke: "none",
|
|
343
|
+
d: "M11.5 2.04018H0.5V0.46875H11.5V2.04018Z"
|
|
344
|
+
}));
|
|
345
|
+
var Icon = (_a) => {
|
|
346
|
+
var _b = _a, { css, checked, indeterminate } = _b, props = __objRest(_b, ["css", "checked", "indeterminate"]);
|
|
347
|
+
const icon = indeterminate ? /* @__PURE__ */ React10.createElement(IndeterminateMark, null) : /* @__PURE__ */ React10.createElement(CheckMark, null);
|
|
348
|
+
return /* @__PURE__ */ React10.createElement(Box6, __spreadValues({
|
|
349
|
+
"aria-hidden": "true",
|
|
350
|
+
__baseCSS: {
|
|
351
|
+
width: 16,
|
|
352
|
+
height: 16,
|
|
353
|
+
bg: "#fff",
|
|
354
|
+
border: "1px solid #000",
|
|
355
|
+
borderRadius: 3,
|
|
356
|
+
display: "flex",
|
|
357
|
+
alignItems: "center",
|
|
358
|
+
justifyContent: "center",
|
|
359
|
+
p: "1px"
|
|
360
|
+
},
|
|
361
|
+
css
|
|
362
|
+
}, props), checked ? icon : null);
|
|
453
363
|
};
|
|
454
364
|
var Checkbox = (_a) => {
|
|
455
365
|
var _b = _a, {
|
|
366
|
+
size,
|
|
367
|
+
variant,
|
|
368
|
+
disabled,
|
|
369
|
+
checked,
|
|
370
|
+
defaultChecked,
|
|
371
|
+
indeterminate,
|
|
372
|
+
readOnly,
|
|
456
373
|
required,
|
|
457
|
-
|
|
458
|
-
errorMessage
|
|
374
|
+
error
|
|
459
375
|
} = _b, props = __objRest(_b, [
|
|
376
|
+
"size",
|
|
377
|
+
"variant",
|
|
378
|
+
"disabled",
|
|
379
|
+
"checked",
|
|
380
|
+
"defaultChecked",
|
|
381
|
+
"indeterminate",
|
|
382
|
+
"readOnly",
|
|
460
383
|
"required",
|
|
461
|
-
"
|
|
462
|
-
"errorMessage"
|
|
384
|
+
"error"
|
|
463
385
|
]);
|
|
464
|
-
|
|
465
|
-
|
|
386
|
+
const ref = React10.useRef(null);
|
|
387
|
+
const checkboxProps = {
|
|
388
|
+
isIndeterminate: indeterminate,
|
|
389
|
+
isDisabled: disabled,
|
|
390
|
+
isReadOnly: readOnly,
|
|
391
|
+
isRequired: required,
|
|
392
|
+
validationState: error ? "invalid" : "valid"
|
|
393
|
+
};
|
|
394
|
+
const groupState = useCheckboxGroupContext();
|
|
395
|
+
const { inputProps } = groupState ? useCheckboxGroupItem(__spreadProps(__spreadValues(__spreadValues({}, props), checkboxProps), {
|
|
396
|
+
value: props.value
|
|
397
|
+
}), groupState, ref) : useCheckbox(__spreadValues(__spreadValues({
|
|
398
|
+
isSelected: checked,
|
|
399
|
+
defaultSelected: defaultChecked
|
|
400
|
+
}, checkboxProps), props), useToggleState(__spreadValues({
|
|
401
|
+
isSelected: checked,
|
|
402
|
+
defaultSelected: defaultChecked
|
|
403
|
+
}, props)), ref);
|
|
404
|
+
const styles = useComponentStyles6("Checkbox", { variant: (groupState == null ? void 0 : groupState.variant) || variant, size: (groupState == null ? void 0 : groupState.size) || size }, { parts: ["container", "label", "checkbox"] });
|
|
405
|
+
const { hoverProps, isHovered } = useHover({});
|
|
406
|
+
const { isFocusVisible, focusProps } = useFocusRing2();
|
|
407
|
+
const stateProps = useStateProps2({
|
|
408
|
+
hover: isHovered,
|
|
409
|
+
focus: isFocusVisible,
|
|
410
|
+
checked: inputProps.checked,
|
|
411
|
+
disabled: inputProps.disabled,
|
|
412
|
+
error: (groupState == null ? void 0 : groupState.error) || error,
|
|
413
|
+
readOnly,
|
|
414
|
+
indeterminate
|
|
415
|
+
});
|
|
416
|
+
return /* @__PURE__ */ React10.createElement(Box6, __spreadValues(__spreadValues({
|
|
417
|
+
as: "label",
|
|
418
|
+
variant: "checkbox",
|
|
466
419
|
__baseCSS: {
|
|
467
|
-
|
|
420
|
+
display: "flex",
|
|
421
|
+
alignItems: "center",
|
|
422
|
+
gap: "1ch",
|
|
423
|
+
position: "relative"
|
|
468
424
|
},
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
425
|
+
css: styles.container
|
|
426
|
+
}, hoverProps), stateProps), /* @__PURE__ */ React10.createElement(Box6, __spreadValues(__spreadValues({
|
|
427
|
+
as: "input",
|
|
428
|
+
type: "checkbox",
|
|
429
|
+
ref,
|
|
430
|
+
css: {
|
|
431
|
+
position: "absolute",
|
|
432
|
+
width: "100%",
|
|
433
|
+
height: "100%",
|
|
434
|
+
top: 0,
|
|
435
|
+
left: 0,
|
|
436
|
+
zIndex: 1,
|
|
437
|
+
opacity: 1e-4,
|
|
438
|
+
cursor: inputProps.disabled ? "not-allowed" : "pointer"
|
|
439
|
+
}
|
|
440
|
+
}, inputProps), focusProps)), /* @__PURE__ */ React10.createElement(Icon, __spreadValues({
|
|
441
|
+
checked: inputProps.checked,
|
|
442
|
+
indeterminate,
|
|
443
|
+
css: styles.checkbox
|
|
444
|
+
}, stateProps)), /* @__PURE__ */ React10.createElement(Box6, __spreadValues({
|
|
445
|
+
css: styles.label
|
|
446
|
+
}, stateProps), props.children));
|
|
478
447
|
};
|
|
479
448
|
|
|
480
449
|
// src/Columns/Columns.tsx
|
|
481
|
-
import
|
|
450
|
+
import React11, { Children } from "react";
|
|
482
451
|
var Columns = (_a) => {
|
|
483
452
|
var _b = _a, {
|
|
484
453
|
space = "none",
|
|
@@ -501,7 +470,7 @@ var Columns = (_a) => {
|
|
|
501
470
|
}
|
|
502
471
|
};
|
|
503
472
|
});
|
|
504
|
-
return /* @__PURE__ */
|
|
473
|
+
return /* @__PURE__ */ React11.createElement(Box, __spreadValues({
|
|
505
474
|
display: "flex",
|
|
506
475
|
css: Object.assign({
|
|
507
476
|
flexWrap: "wrap",
|
|
@@ -513,54 +482,68 @@ var Columns = (_a) => {
|
|
|
513
482
|
}, props), children);
|
|
514
483
|
};
|
|
515
484
|
|
|
485
|
+
// src/Content/Content.tsx
|
|
486
|
+
import React12 from "react";
|
|
487
|
+
import {
|
|
488
|
+
Box as Box7,
|
|
489
|
+
useComponentStyles as useComponentStyles7
|
|
490
|
+
} from "@marigold/system";
|
|
491
|
+
var Content = (_a) => {
|
|
492
|
+
var _b = _a, {
|
|
493
|
+
children,
|
|
494
|
+
variant,
|
|
495
|
+
size
|
|
496
|
+
} = _b, props = __objRest(_b, [
|
|
497
|
+
"children",
|
|
498
|
+
"variant",
|
|
499
|
+
"size"
|
|
500
|
+
]);
|
|
501
|
+
const styles = useComponentStyles7("Content", { variant, size });
|
|
502
|
+
return /* @__PURE__ */ React12.createElement(Box7, __spreadProps(__spreadValues({
|
|
503
|
+
as: "section"
|
|
504
|
+
}, props), {
|
|
505
|
+
css: styles
|
|
506
|
+
}), children);
|
|
507
|
+
};
|
|
508
|
+
|
|
516
509
|
// src/Dialog/Dialog.tsx
|
|
517
|
-
import
|
|
510
|
+
import React15 from "react";
|
|
518
511
|
import { useOverlayTriggerState } from "@react-stately/overlays";
|
|
519
512
|
import { OverlayContainer } from "@react-aria/overlays";
|
|
520
513
|
import { useButton as useButton2 } from "@react-aria/button";
|
|
521
514
|
import { Close } from "@marigold/icons";
|
|
522
515
|
|
|
523
|
-
// src/
|
|
524
|
-
import
|
|
525
|
-
|
|
516
|
+
// src/Headline/Headline.tsx
|
|
517
|
+
import React13 from "react";
|
|
518
|
+
import {
|
|
519
|
+
Box as Box8,
|
|
520
|
+
useComponentStyles as useComponentStyles8
|
|
521
|
+
} from "@marigold/system";
|
|
522
|
+
var Headline = (_a) => {
|
|
526
523
|
var _b = _a, {
|
|
527
|
-
as = "span",
|
|
528
|
-
variant = "body",
|
|
529
524
|
children,
|
|
530
|
-
|
|
531
|
-
color,
|
|
532
|
-
cursor,
|
|
525
|
+
variant,
|
|
533
526
|
size,
|
|
534
|
-
|
|
535
|
-
userSelect
|
|
527
|
+
level = "1"
|
|
536
528
|
} = _b, props = __objRest(_b, [
|
|
537
|
-
"as",
|
|
538
|
-
"variant",
|
|
539
529
|
"children",
|
|
540
|
-
"
|
|
541
|
-
"color",
|
|
542
|
-
"cursor",
|
|
530
|
+
"variant",
|
|
543
531
|
"size",
|
|
544
|
-
"
|
|
545
|
-
"userSelect"
|
|
532
|
+
"level"
|
|
546
533
|
]);
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
outline,
|
|
556
|
-
userSelect
|
|
557
|
-
},
|
|
558
|
-
ref
|
|
534
|
+
const styles = useComponentStyles8("Headline", {
|
|
535
|
+
variant,
|
|
536
|
+
size: size != null ? size : `level-${level}`
|
|
537
|
+
});
|
|
538
|
+
return /* @__PURE__ */ React13.createElement(Box8, __spreadProps(__spreadValues({
|
|
539
|
+
as: `h${level}`
|
|
540
|
+
}, props), {
|
|
541
|
+
css: styles
|
|
559
542
|
}), children);
|
|
560
|
-
}
|
|
543
|
+
};
|
|
561
544
|
|
|
562
545
|
// src/Dialog/ModalDialog.tsx
|
|
563
|
-
import
|
|
546
|
+
import React14 from "react";
|
|
564
547
|
import {
|
|
565
548
|
useOverlay,
|
|
566
549
|
usePreventScroll,
|
|
@@ -579,12 +562,12 @@ var ModalDialog = (_a) => {
|
|
|
579
562
|
"children"
|
|
580
563
|
]);
|
|
581
564
|
const _a2 = props, { isDismissable, isOpen, onClose } = _a2, restProps = __objRest(_a2, ["isDismissable", "isOpen", "onClose"]);
|
|
582
|
-
const ref =
|
|
565
|
+
const ref = React14.useRef();
|
|
583
566
|
const { overlayProps, underlayProps } = useOverlay({ isDismissable, isOpen, onClose }, ref);
|
|
584
567
|
usePreventScroll();
|
|
585
568
|
const { modalProps } = useModal();
|
|
586
569
|
const { dialogProps } = useDialog(props, ref);
|
|
587
|
-
return /* @__PURE__ */
|
|
570
|
+
return /* @__PURE__ */ React14.createElement(Box, __spreadValues({
|
|
588
571
|
__baseCSS: {
|
|
589
572
|
display: "grid",
|
|
590
573
|
placeItems: "center",
|
|
@@ -596,11 +579,11 @@ var ModalDialog = (_a) => {
|
|
|
596
579
|
right: 0
|
|
597
580
|
},
|
|
598
581
|
variant: `dialog.${backdropVariant}`
|
|
599
|
-
}, underlayProps), /* @__PURE__ */
|
|
582
|
+
}, underlayProps), /* @__PURE__ */ React14.createElement(FocusScope, {
|
|
600
583
|
contain: true,
|
|
601
584
|
restoreFocus: true,
|
|
602
585
|
autoFocus: true
|
|
603
|
-
}, /* @__PURE__ */
|
|
586
|
+
}, /* @__PURE__ */ React14.createElement(Box, __spreadValues(__spreadProps(__spreadValues(__spreadValues(__spreadValues({}, overlayProps), dialogProps), modalProps), {
|
|
604
587
|
ref,
|
|
605
588
|
variant: variant ? `dialog.${variant}` : `dialog`
|
|
606
589
|
}), restProps), children)));
|
|
@@ -625,17 +608,17 @@ var Dialog = (_a) => {
|
|
|
625
608
|
"title",
|
|
626
609
|
"variant"
|
|
627
610
|
]);
|
|
628
|
-
const closeButtonRef =
|
|
611
|
+
const closeButtonRef = React15.useRef();
|
|
629
612
|
const { buttonProps: closeButtonProps } = useButton2({
|
|
630
613
|
onPress: () => close()
|
|
631
614
|
}, closeButtonRef);
|
|
632
|
-
return /* @__PURE__ */
|
|
615
|
+
return /* @__PURE__ */ React15.createElement(OverlayContainer, null, /* @__PURE__ */ React15.createElement(ModalDialog, __spreadValues({
|
|
633
616
|
variant,
|
|
634
617
|
backdropVariant,
|
|
635
618
|
isOpen,
|
|
636
619
|
onClose: close,
|
|
637
620
|
isDismissable: true
|
|
638
|
-
}, props), /* @__PURE__ */
|
|
621
|
+
}, props), /* @__PURE__ */ React15.createElement(Box, {
|
|
639
622
|
__baseCSS: {
|
|
640
623
|
display: "flex",
|
|
641
624
|
justifyContent: "space-between",
|
|
@@ -644,12 +627,11 @@ var Dialog = (_a) => {
|
|
|
644
627
|
pb: "large"
|
|
645
628
|
},
|
|
646
629
|
className
|
|
647
|
-
}, /* @__PURE__ */
|
|
630
|
+
}, /* @__PURE__ */ React15.createElement(Box, {
|
|
648
631
|
pt: "medium"
|
|
649
|
-
}, title && /* @__PURE__ */
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
}, title), children), /* @__PURE__ */ React18.createElement(Box, {
|
|
632
|
+
}, title && /* @__PURE__ */ React15.createElement(Headline, {
|
|
633
|
+
level: "4"
|
|
634
|
+
}, title), children), /* @__PURE__ */ React15.createElement(Box, {
|
|
653
635
|
__baseCSS: {
|
|
654
636
|
display: "flex",
|
|
655
637
|
justifyContent: "flex-end",
|
|
@@ -657,7 +639,7 @@ var Dialog = (_a) => {
|
|
|
657
639
|
paddingTop: "xsmall",
|
|
658
640
|
paddingX: "xsmall"
|
|
659
641
|
}
|
|
660
|
-
}, /* @__PURE__ */
|
|
642
|
+
}, /* @__PURE__ */ React15.createElement(Box, __spreadProps(__spreadValues({
|
|
661
643
|
as: Button,
|
|
662
644
|
__baseCSS: {
|
|
663
645
|
color: "text",
|
|
@@ -675,13 +657,13 @@ var Dialog = (_a) => {
|
|
|
675
657
|
}
|
|
676
658
|
}, closeButtonProps), {
|
|
677
659
|
ref: closeButtonRef
|
|
678
|
-
}), /* @__PURE__ */
|
|
660
|
+
}), /* @__PURE__ */ React15.createElement(Close, {
|
|
679
661
|
size: 16
|
|
680
662
|
}))))));
|
|
681
663
|
};
|
|
682
664
|
var useDialogButtonProps = () => {
|
|
683
665
|
const state = useOverlayTriggerState({});
|
|
684
|
-
const openButtonRef =
|
|
666
|
+
const openButtonRef = React15.useRef();
|
|
685
667
|
const { buttonProps: openButtonProps } = useButton2({
|
|
686
668
|
onPress: () => state.open()
|
|
687
669
|
}, openButtonRef);
|
|
@@ -693,87 +675,141 @@ var useDialogButtonProps = () => {
|
|
|
693
675
|
};
|
|
694
676
|
|
|
695
677
|
// src/Divider/Divider.tsx
|
|
696
|
-
import
|
|
678
|
+
import React16 from "react";
|
|
697
679
|
import { useSeparator } from "@react-aria/separator";
|
|
680
|
+
import { useComponentStyles as useComponentStyles9 } from "@marigold/system";
|
|
698
681
|
var Divider = (_a) => {
|
|
699
|
-
var _b = _a, { variant
|
|
682
|
+
var _b = _a, { variant } = _b, props = __objRest(_b, ["variant"]);
|
|
700
683
|
const { separatorProps } = useSeparator(props);
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
684
|
+
const styles = useComponentStyles9("Divider", { variant });
|
|
685
|
+
return /* @__PURE__ */ React16.createElement(Box, __spreadValues(__spreadValues({
|
|
686
|
+
css: styles
|
|
704
687
|
}, props), separatorProps));
|
|
705
688
|
};
|
|
706
689
|
|
|
707
|
-
// src/
|
|
708
|
-
import
|
|
709
|
-
import {
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
} = _b, props = __objRest(_b, [
|
|
721
|
-
"type",
|
|
722
|
-
"variant",
|
|
723
|
-
"labelVariant",
|
|
724
|
-
"htmlFor",
|
|
725
|
-
"required",
|
|
726
|
-
"error",
|
|
727
|
-
"errorMessage"
|
|
728
|
-
]);
|
|
729
|
-
const ref = useRef(null);
|
|
730
|
-
const { labelProps, inputProps, errorMessageProps } = useTextField(props, ref);
|
|
731
|
-
return /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement(Label, __spreadValues({
|
|
732
|
-
variant: labelVariant,
|
|
733
|
-
htmlFor,
|
|
734
|
-
required
|
|
735
|
-
}, labelProps), props.label), /* @__PURE__ */ React20.createElement(Box, __spreadValues(__spreadProps(__spreadValues({
|
|
736
|
-
as: "input",
|
|
737
|
-
type,
|
|
738
|
-
id: htmlFor,
|
|
739
|
-
variant: `input.${variant}`
|
|
740
|
-
}, inputProps), {
|
|
741
|
-
ref
|
|
742
|
-
}), props)), error && errorMessage && /* @__PURE__ */ React20.createElement(ValidationMessage, __spreadValues({}, errorMessageProps), /* @__PURE__ */ React20.createElement(Exclamation2, {
|
|
743
|
-
size: 16
|
|
744
|
-
}), errorMessage));
|
|
690
|
+
// src/Footer/Footer.tsx
|
|
691
|
+
import React17 from "react";
|
|
692
|
+
import {
|
|
693
|
+
useComponentStyles as useComponentStyles10
|
|
694
|
+
} from "@marigold/system";
|
|
695
|
+
var Footer = (_a) => {
|
|
696
|
+
var _b = _a, { children, variant, size } = _b, props = __objRest(_b, ["children", "variant", "size"]);
|
|
697
|
+
const styles = useComponentStyles10("Footer", { variant, size });
|
|
698
|
+
return /* @__PURE__ */ React17.createElement(Box, __spreadProps(__spreadValues({
|
|
699
|
+
as: "footer"
|
|
700
|
+
}, props), {
|
|
701
|
+
css: styles
|
|
702
|
+
}), children);
|
|
745
703
|
};
|
|
746
704
|
|
|
747
705
|
// src/VisuallyHidden/VisuallyHidden.tsx
|
|
748
|
-
import { VisuallyHidden
|
|
706
|
+
import { VisuallyHidden } from "@react-aria/visually-hidden";
|
|
707
|
+
|
|
708
|
+
// src/Header/Header.tsx
|
|
709
|
+
import React18 from "react";
|
|
710
|
+
import {
|
|
711
|
+
useComponentStyles as useComponentStyles11
|
|
712
|
+
} from "@marigold/system";
|
|
713
|
+
var Header = (_a) => {
|
|
714
|
+
var _b = _a, { children, variant, size } = _b, props = __objRest(_b, ["children", "variant", "size"]);
|
|
715
|
+
const styles = useComponentStyles11("Header", { variant, size });
|
|
716
|
+
return /* @__PURE__ */ React18.createElement(Box, __spreadProps(__spreadValues({
|
|
717
|
+
as: "header"
|
|
718
|
+
}, props), {
|
|
719
|
+
css: styles
|
|
720
|
+
}), children);
|
|
721
|
+
};
|
|
749
722
|
|
|
750
723
|
// src/Image/Image.tsx
|
|
751
|
-
import
|
|
724
|
+
import React19 from "react";
|
|
725
|
+
import { useComponentStyles as useComponentStyles12 } from "@marigold/system";
|
|
752
726
|
var Image = (_a) => {
|
|
727
|
+
var _b = _a, { variant } = _b, props = __objRest(_b, ["variant"]);
|
|
728
|
+
const styles = useComponentStyles12("Image", { variant });
|
|
729
|
+
return /* @__PURE__ */ React19.createElement(Box, __spreadProps(__spreadValues({}, props), {
|
|
730
|
+
as: "img",
|
|
731
|
+
css: styles
|
|
732
|
+
}));
|
|
733
|
+
};
|
|
734
|
+
|
|
735
|
+
// src/Inline/Inline.tsx
|
|
736
|
+
import React20 from "react";
|
|
737
|
+
var ALIGNMENT = {
|
|
738
|
+
top: "flex-start",
|
|
739
|
+
center: "center",
|
|
740
|
+
bottom: "flex-end"
|
|
741
|
+
};
|
|
742
|
+
var Inline = (_a) => {
|
|
753
743
|
var _b = _a, {
|
|
754
|
-
|
|
744
|
+
space = "none",
|
|
745
|
+
align = "center",
|
|
746
|
+
children
|
|
755
747
|
} = _b, props = __objRest(_b, [
|
|
756
|
-
"
|
|
748
|
+
"space",
|
|
749
|
+
"align",
|
|
750
|
+
"children"
|
|
751
|
+
]);
|
|
752
|
+
return /* @__PURE__ */ React20.createElement(Box, __spreadValues({
|
|
753
|
+
__baseCSS: { gap: space, flexWrap: "wrap" },
|
|
754
|
+
display: "inline-flex",
|
|
755
|
+
alignItems: ALIGNMENT[align]
|
|
756
|
+
}, props), children);
|
|
757
|
+
};
|
|
758
|
+
|
|
759
|
+
// src/Label/Label.tsx
|
|
760
|
+
import React21 from "react";
|
|
761
|
+
import { Required as Required2 } from "@marigold/icons";
|
|
762
|
+
var LabelBase = (_a) => {
|
|
763
|
+
var _b = _a, {
|
|
764
|
+
variant = "above",
|
|
765
|
+
required,
|
|
766
|
+
color = "text",
|
|
767
|
+
children
|
|
768
|
+
} = _b, props = __objRest(_b, [
|
|
769
|
+
"variant",
|
|
770
|
+
"required",
|
|
771
|
+
"color",
|
|
772
|
+
"children"
|
|
757
773
|
]);
|
|
758
774
|
return /* @__PURE__ */ React21.createElement(Box, __spreadProps(__spreadValues({}, props), {
|
|
759
|
-
as: "
|
|
760
|
-
|
|
761
|
-
|
|
775
|
+
as: "label",
|
|
776
|
+
__baseCSS: { color },
|
|
777
|
+
variant: `label.${variant}`
|
|
778
|
+
}), children);
|
|
779
|
+
};
|
|
780
|
+
var Label2 = (_a) => {
|
|
781
|
+
var _b = _a, {
|
|
782
|
+
required,
|
|
783
|
+
children
|
|
784
|
+
} = _b, props = __objRest(_b, [
|
|
785
|
+
"required",
|
|
786
|
+
"children"
|
|
787
|
+
]);
|
|
788
|
+
return required ? /* @__PURE__ */ React21.createElement(Box, {
|
|
789
|
+
as: "span",
|
|
790
|
+
display: "inline-flex",
|
|
791
|
+
alignItems: "center"
|
|
792
|
+
}, /* @__PURE__ */ React21.createElement(LabelBase, __spreadValues({}, props), children), required && /* @__PURE__ */ React21.createElement(Required2, {
|
|
793
|
+
size: 16,
|
|
794
|
+
fill: "error"
|
|
795
|
+
})) : /* @__PURE__ */ React21.createElement(LabelBase, __spreadValues({}, props), children);
|
|
762
796
|
};
|
|
763
797
|
|
|
764
798
|
// src/Link/Link.tsx
|
|
765
799
|
import React22, { useRef as useRef2 } from "react";
|
|
766
800
|
import { useLink } from "@react-aria/link";
|
|
767
|
-
import {
|
|
801
|
+
import { useComponentStyles as useComponentStyles13 } from "@marigold/system";
|
|
768
802
|
var Link = (_a) => {
|
|
769
803
|
var _b = _a, {
|
|
770
804
|
as = "a",
|
|
771
|
-
variant
|
|
805
|
+
variant,
|
|
806
|
+
size,
|
|
772
807
|
children,
|
|
773
808
|
disabled
|
|
774
809
|
} = _b, props = __objRest(_b, [
|
|
775
810
|
"as",
|
|
776
811
|
"variant",
|
|
812
|
+
"size",
|
|
777
813
|
"children",
|
|
778
814
|
"disabled"
|
|
779
815
|
]);
|
|
@@ -782,63 +818,192 @@ var Link = (_a) => {
|
|
|
782
818
|
elementType: typeof as === "string" ? as : "span",
|
|
783
819
|
isDisabled: disabled
|
|
784
820
|
}), ref);
|
|
821
|
+
const styles = useComponentStyles13("Link", { variant, size });
|
|
785
822
|
return /* @__PURE__ */ React22.createElement(Box, __spreadValues(__spreadValues({
|
|
786
823
|
as,
|
|
787
|
-
|
|
788
|
-
css: { cursor: disabled ? "default" : "pointer" },
|
|
824
|
+
css: styles,
|
|
789
825
|
ref
|
|
790
826
|
}, props), linkProps), children);
|
|
791
827
|
};
|
|
792
828
|
|
|
793
829
|
// src/Menu/Menu.tsx
|
|
794
|
-
import
|
|
830
|
+
import React27, { useRef as useRef5 } from "react";
|
|
831
|
+
import { FocusScope as FocusScope2 } from "@react-aria/focus";
|
|
832
|
+
import { useMenu } from "@react-aria/menu";
|
|
833
|
+
import { DismissButton } from "@react-aria/overlays";
|
|
834
|
+
import { Item } from "@react-stately/collections";
|
|
835
|
+
import { useTreeState } from "@react-stately/tree";
|
|
836
|
+
import {
|
|
837
|
+
Box as Box10,
|
|
838
|
+
useComponentStyles as useComponentStyles14
|
|
839
|
+
} from "@marigold/system";
|
|
840
|
+
|
|
841
|
+
// src/Menu/Context.ts
|
|
842
|
+
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
843
|
+
var MenuContext = createContext2({});
|
|
844
|
+
var useMenuContext = () => useContext2(MenuContext);
|
|
845
|
+
|
|
846
|
+
// src/Menu/MenuTrigger.tsx
|
|
847
|
+
import React25, { useRef as useRef3 } from "react";
|
|
848
|
+
import { useMenuTriggerState } from "@react-stately/menu";
|
|
849
|
+
import { useMenuTrigger } from "@react-aria/menu";
|
|
850
|
+
|
|
851
|
+
// src/Overlay/Overlay.tsx
|
|
852
|
+
import React23 from "react";
|
|
853
|
+
import ReactDOM from "react-dom";
|
|
854
|
+
var Overlay = (_a) => {
|
|
855
|
+
var _b = _a, {
|
|
856
|
+
children,
|
|
857
|
+
open = false,
|
|
858
|
+
container = document.body
|
|
859
|
+
} = _b, props = __objRest(_b, [
|
|
860
|
+
"children",
|
|
861
|
+
"open",
|
|
862
|
+
"container"
|
|
863
|
+
]);
|
|
864
|
+
if (!open) {
|
|
865
|
+
return null;
|
|
866
|
+
}
|
|
867
|
+
const component = /* @__PURE__ */ React23.createElement(Box, __spreadValues({}, props), children);
|
|
868
|
+
return ReactDOM.createPortal(component, container);
|
|
869
|
+
};
|
|
870
|
+
|
|
871
|
+
// src/Overlay/Popover.tsx
|
|
872
|
+
import React24, { forwardRef as forwardRef2 } from "react";
|
|
873
|
+
import { useModal as useModal2, useOverlay as useOverlay2 } from "@react-aria/overlays";
|
|
874
|
+
import { mergeProps as mergeProps2 } from "@react-aria/utils";
|
|
875
|
+
var Popover = forwardRef2((_a, ref) => {
|
|
876
|
+
var _b = _a, {
|
|
877
|
+
children,
|
|
878
|
+
open,
|
|
879
|
+
dismissable,
|
|
880
|
+
keyboardDismissDisabled,
|
|
881
|
+
shouldCloseOnBlur
|
|
882
|
+
} = _b, props = __objRest(_b, [
|
|
883
|
+
"children",
|
|
884
|
+
"open",
|
|
885
|
+
"dismissable",
|
|
886
|
+
"keyboardDismissDisabled",
|
|
887
|
+
"shouldCloseOnBlur"
|
|
888
|
+
]);
|
|
889
|
+
const { overlayProps } = useOverlay2(__spreadValues({
|
|
890
|
+
isOpen: open,
|
|
891
|
+
isDismissable: dismissable,
|
|
892
|
+
isKeyboardDismissDisabled: keyboardDismissDisabled,
|
|
893
|
+
shouldCloseOnBlur
|
|
894
|
+
}, props), ref);
|
|
895
|
+
const { modalProps } = useModal2({});
|
|
896
|
+
return /* @__PURE__ */ React24.createElement(Overlay, {
|
|
897
|
+
open
|
|
898
|
+
}, /* @__PURE__ */ React24.createElement(Box, __spreadValues({
|
|
899
|
+
ref,
|
|
900
|
+
role: "presentation"
|
|
901
|
+
}, mergeProps2(props, overlayProps, modalProps)), children));
|
|
902
|
+
});
|
|
903
|
+
|
|
904
|
+
// src/Menu/MenuTrigger.tsx
|
|
905
|
+
import { useOverlayPosition } from "@react-aria/overlays";
|
|
906
|
+
import { PressResponder } from "@react-aria/interactions";
|
|
907
|
+
var MenuTrigger = ({ disabled, children }) => {
|
|
908
|
+
const [menuTrigger, menu] = React25.Children.toArray(children);
|
|
909
|
+
const menuTriggerRef = useRef3(null);
|
|
910
|
+
const overlayRef = useRef3(null);
|
|
911
|
+
const state = useMenuTriggerState({});
|
|
912
|
+
const { menuTriggerProps, menuProps } = useMenuTrigger({ trigger: "press", isDisabled: disabled }, state, menuTriggerRef);
|
|
913
|
+
const { overlayProps: positionProps } = useOverlayPosition({
|
|
914
|
+
targetRef: menuTriggerRef,
|
|
915
|
+
overlayRef,
|
|
916
|
+
isOpen: state.isOpen
|
|
917
|
+
});
|
|
918
|
+
const menuContext = __spreadProps(__spreadValues({}, menuProps), {
|
|
919
|
+
open: state.isOpen,
|
|
920
|
+
onClose: state.close,
|
|
921
|
+
autoFocus: state.focusStrategy,
|
|
922
|
+
triggerWidth: menuTriggerRef.current ? menuTriggerRef.current.offsetWidth : void 0
|
|
923
|
+
});
|
|
924
|
+
return /* @__PURE__ */ React25.createElement(MenuContext.Provider, {
|
|
925
|
+
value: menuContext
|
|
926
|
+
}, /* @__PURE__ */ React25.createElement(PressResponder, __spreadProps(__spreadValues({}, menuTriggerProps), {
|
|
927
|
+
ref: menuTriggerRef,
|
|
928
|
+
isPressed: state.isOpen
|
|
929
|
+
}), menuTrigger), /* @__PURE__ */ React25.createElement(Popover, __spreadValues({
|
|
930
|
+
open: state.isOpen,
|
|
931
|
+
onClose: state.close,
|
|
932
|
+
dismissable: true,
|
|
933
|
+
shouldCloseOnBlur: true,
|
|
934
|
+
ref: overlayRef
|
|
935
|
+
}, positionProps), menu));
|
|
936
|
+
};
|
|
937
|
+
|
|
938
|
+
// src/Menu/MenuItem.tsx
|
|
939
|
+
import React26, { useRef as useRef4 } from "react";
|
|
940
|
+
import { useFocusRing as useFocusRing3 } from "@react-aria/focus";
|
|
941
|
+
import { useMenuItem } from "@react-aria/menu";
|
|
942
|
+
import { mergeProps as mergeProps3 } from "@react-aria/utils";
|
|
943
|
+
import { Box as Box9, useStateProps as useStateProps3 } from "@marigold/system";
|
|
944
|
+
var MenuItem = ({ item, state, onAction, css }) => {
|
|
945
|
+
const ref = useRef4(null);
|
|
946
|
+
const { onClose } = useMenuContext();
|
|
947
|
+
const { menuItemProps } = useMenuItem({
|
|
948
|
+
key: item.key,
|
|
949
|
+
onAction,
|
|
950
|
+
onClose
|
|
951
|
+
}, state, ref);
|
|
952
|
+
const { isFocusVisible, focusProps } = useFocusRing3();
|
|
953
|
+
const stateProps = useStateProps3({
|
|
954
|
+
focus: isFocusVisible
|
|
955
|
+
});
|
|
956
|
+
return /* @__PURE__ */ React26.createElement(Box9, __spreadValues(__spreadValues({
|
|
957
|
+
as: "li",
|
|
958
|
+
ref,
|
|
959
|
+
__baseCSS: {
|
|
960
|
+
"&:focus": {
|
|
961
|
+
outline: 0
|
|
962
|
+
}
|
|
963
|
+
},
|
|
964
|
+
css
|
|
965
|
+
}, mergeProps3(menuItemProps, focusProps)), stateProps), item.rendered);
|
|
966
|
+
};
|
|
967
|
+
|
|
968
|
+
// src/Menu/Menu.tsx
|
|
795
969
|
var Menu = (_a) => {
|
|
796
|
-
var _b = _a, {
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
variant = "default",
|
|
827
|
-
children
|
|
828
|
-
} = _b, props = __objRest(_b, [
|
|
829
|
-
"variant",
|
|
830
|
-
"children"
|
|
831
|
-
]);
|
|
832
|
-
return /* @__PURE__ */ React24.createElement(Box, {
|
|
833
|
-
variant: `menuItem.${variant}`
|
|
834
|
-
}, /* @__PURE__ */ React24.createElement(Link, __spreadValues({
|
|
835
|
-
variant: "menuItemLink"
|
|
836
|
-
}, props), children));
|
|
970
|
+
var _b = _a, { variant, size } = _b, props = __objRest(_b, ["variant", "size"]);
|
|
971
|
+
const _a2 = useMenuContext(), { triggerWidth } = _a2, menuContext = __objRest(_a2, ["triggerWidth"]);
|
|
972
|
+
const ownProps = __spreadValues(__spreadValues({}, props), menuContext);
|
|
973
|
+
const ref = useRef5(null);
|
|
974
|
+
const state = useTreeState(__spreadProps(__spreadValues({}, ownProps), { selectionMode: "none" }));
|
|
975
|
+
const { menuProps } = useMenu(ownProps, state, ref);
|
|
976
|
+
const styles = useComponentStyles14("Menu", { variant, size }, { parts: ["container", "item"] });
|
|
977
|
+
return /* @__PURE__ */ React27.createElement(FocusScope2, {
|
|
978
|
+
restoreFocus: true
|
|
979
|
+
}, /* @__PURE__ */ React27.createElement("div", null, /* @__PURE__ */ React27.createElement(DismissButton, {
|
|
980
|
+
onDismiss: ownProps.onClose
|
|
981
|
+
}), /* @__PURE__ */ React27.createElement(Box10, __spreadValues({
|
|
982
|
+
as: "ul",
|
|
983
|
+
ref,
|
|
984
|
+
style: { width: triggerWidth },
|
|
985
|
+
__baseCSS: {
|
|
986
|
+
listStyle: "none",
|
|
987
|
+
p: 0,
|
|
988
|
+
overflowWrap: "break-word"
|
|
989
|
+
},
|
|
990
|
+
css: styles.container
|
|
991
|
+
}, menuProps), [...state.collection].map((item) => /* @__PURE__ */ React27.createElement(MenuItem, {
|
|
992
|
+
key: item.key,
|
|
993
|
+
item,
|
|
994
|
+
state,
|
|
995
|
+
onAction: props.onSelect,
|
|
996
|
+
css: styles.item
|
|
997
|
+
}))), /* @__PURE__ */ React27.createElement(DismissButton, {
|
|
998
|
+
onDismiss: ownProps.onClose
|
|
999
|
+
})));
|
|
837
1000
|
};
|
|
1001
|
+
Menu.Trigger = MenuTrigger;
|
|
1002
|
+
Menu.Item = Item;
|
|
838
1003
|
|
|
839
1004
|
// src/Message/Message.tsx
|
|
840
|
-
import
|
|
841
|
-
import { Exclamation
|
|
1005
|
+
import React28 from "react";
|
|
1006
|
+
import { Exclamation, Info, Notification } from "@marigold/icons";
|
|
842
1007
|
var Message = (_a) => {
|
|
843
1008
|
var _b = _a, {
|
|
844
1009
|
messageTitle,
|
|
@@ -851,25 +1016,24 @@ var Message = (_a) => {
|
|
|
851
1016
|
"className",
|
|
852
1017
|
"children"
|
|
853
1018
|
]);
|
|
854
|
-
var icon = /* @__PURE__ */
|
|
1019
|
+
var icon = /* @__PURE__ */ React28.createElement(Info, null);
|
|
855
1020
|
if (variant === "warning") {
|
|
856
|
-
icon = /* @__PURE__ */
|
|
1021
|
+
icon = /* @__PURE__ */ React28.createElement(Notification, null);
|
|
857
1022
|
}
|
|
858
1023
|
if (variant === "error") {
|
|
859
|
-
icon = /* @__PURE__ */
|
|
1024
|
+
icon = /* @__PURE__ */ React28.createElement(Exclamation, null);
|
|
860
1025
|
}
|
|
861
|
-
return /* @__PURE__ */
|
|
1026
|
+
return /* @__PURE__ */ React28.createElement(Box, __spreadValues({
|
|
862
1027
|
display: "inline-block",
|
|
863
1028
|
variant: `message.${variant}`,
|
|
864
1029
|
className
|
|
865
|
-
}, props), /* @__PURE__ */
|
|
1030
|
+
}, props), /* @__PURE__ */ React28.createElement(Box, {
|
|
866
1031
|
display: "flex",
|
|
867
1032
|
alignItems: "center",
|
|
868
1033
|
variant: "message.title"
|
|
869
|
-
}, icon, /* @__PURE__ */
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
}, messageTitle)), /* @__PURE__ */ React25.createElement(Box, {
|
|
1034
|
+
}, icon, /* @__PURE__ */ React28.createElement(Headline, {
|
|
1035
|
+
level: "4"
|
|
1036
|
+
}, messageTitle)), /* @__PURE__ */ React28.createElement(Box, {
|
|
873
1037
|
css: { color: "black" }
|
|
874
1038
|
}, children));
|
|
875
1039
|
};
|
|
@@ -879,7 +1043,7 @@ import { useTheme as useTheme2, ThemeProvider as ThemeProvider2 } from "@marigol
|
|
|
879
1043
|
import { SSRProvider } from "@react-aria/ssr";
|
|
880
1044
|
|
|
881
1045
|
// src/Provider/MarigoldProvider.tsx
|
|
882
|
-
import
|
|
1046
|
+
import React29 from "react";
|
|
883
1047
|
import { OverlayProvider } from "@react-aria/overlays";
|
|
884
1048
|
import {
|
|
885
1049
|
Global,
|
|
@@ -893,20 +1057,20 @@ function MarigoldProvider({
|
|
|
893
1057
|
}) {
|
|
894
1058
|
const outer = useTheme();
|
|
895
1059
|
const isTopLevel = outer.theme === __defaultTheme;
|
|
896
|
-
return /* @__PURE__ */
|
|
1060
|
+
return /* @__PURE__ */ React29.createElement(ThemeProvider, {
|
|
897
1061
|
theme
|
|
898
|
-
}, isTopLevel ? /* @__PURE__ */
|
|
1062
|
+
}, isTopLevel ? /* @__PURE__ */ React29.createElement(React29.Fragment, null, /* @__PURE__ */ React29.createElement(Global, null), /* @__PURE__ */ React29.createElement(OverlayProvider, null, children)) : children);
|
|
899
1063
|
}
|
|
900
1064
|
|
|
901
1065
|
// src/Radio/Radio.tsx
|
|
902
|
-
import
|
|
903
|
-
import { Exclamation as
|
|
904
|
-
import { useFocusRing as
|
|
905
|
-
import { VisuallyHidden as
|
|
1066
|
+
import React32 from "react";
|
|
1067
|
+
import { Exclamation as Exclamation2 } from "@marigold/icons";
|
|
1068
|
+
import { useFocusRing as useFocusRing4 } from "@react-aria/focus";
|
|
1069
|
+
import { VisuallyHidden as VisuallyHidden2 } from "@react-aria/visually-hidden";
|
|
906
1070
|
|
|
907
1071
|
// src/Radio/RadioIcon.tsx
|
|
908
|
-
import
|
|
909
|
-
import { conditional
|
|
1072
|
+
import React30 from "react";
|
|
1073
|
+
import { conditional, SVG } from "@marigold/system";
|
|
910
1074
|
var RadioIcon = ({
|
|
911
1075
|
variant = "",
|
|
912
1076
|
checked = false,
|
|
@@ -919,19 +1083,19 @@ var RadioIcon = ({
|
|
|
919
1083
|
checked,
|
|
920
1084
|
error
|
|
921
1085
|
};
|
|
922
|
-
return /* @__PURE__ */
|
|
1086
|
+
return /* @__PURE__ */ React30.createElement(SVG, {
|
|
923
1087
|
width: "16",
|
|
924
1088
|
height: "32",
|
|
925
1089
|
viewBox: "0 0 16 32",
|
|
926
1090
|
fill: "none",
|
|
927
1091
|
"aria-hidden": "true"
|
|
928
|
-
}, /* @__PURE__ */
|
|
929
|
-
variant:
|
|
1092
|
+
}, /* @__PURE__ */ React30.createElement(Box, {
|
|
1093
|
+
variant: conditional(`radio.${variant}`, conditionalStates),
|
|
930
1094
|
as: "circle",
|
|
931
1095
|
cx: "8",
|
|
932
1096
|
cy: "16",
|
|
933
1097
|
r: "7.5"
|
|
934
|
-
}), checked && /* @__PURE__ */
|
|
1098
|
+
}), checked && /* @__PURE__ */ React30.createElement("circle", {
|
|
935
1099
|
fill: "white",
|
|
936
1100
|
cx: "8",
|
|
937
1101
|
cy: "16",
|
|
@@ -939,17 +1103,38 @@ var RadioIcon = ({
|
|
|
939
1103
|
}));
|
|
940
1104
|
};
|
|
941
1105
|
|
|
1106
|
+
// src/ValidationMessage/ValidationMessage.tsx
|
|
1107
|
+
import React31 from "react";
|
|
1108
|
+
var ValidationMessage = (_a) => {
|
|
1109
|
+
var _b = _a, {
|
|
1110
|
+
variant = "error",
|
|
1111
|
+
children,
|
|
1112
|
+
className
|
|
1113
|
+
} = _b, props = __objRest(_b, [
|
|
1114
|
+
"variant",
|
|
1115
|
+
"children",
|
|
1116
|
+
"className"
|
|
1117
|
+
]);
|
|
1118
|
+
return /* @__PURE__ */ React31.createElement(Box, __spreadValues({
|
|
1119
|
+
as: "span",
|
|
1120
|
+
display: "flex",
|
|
1121
|
+
alignItems: "center",
|
|
1122
|
+
variant: `validation.${variant}`,
|
|
1123
|
+
className
|
|
1124
|
+
}, props), children);
|
|
1125
|
+
};
|
|
1126
|
+
|
|
942
1127
|
// src/Radio/Radio.tsx
|
|
943
1128
|
var RadioInput = (_a) => {
|
|
944
1129
|
var _b = _a, { error } = _b, props = __objRest(_b, ["error"]);
|
|
945
|
-
const { focusProps } =
|
|
1130
|
+
const { focusProps } = useFocusRing4();
|
|
946
1131
|
const _a2 = props, { children } = _a2, restProps = __objRest(_a2, ["children"]);
|
|
947
|
-
return /* @__PURE__ */
|
|
1132
|
+
return /* @__PURE__ */ React32.createElement(Box, {
|
|
948
1133
|
pr: "xsmall"
|
|
949
|
-
}, /* @__PURE__ */
|
|
1134
|
+
}, /* @__PURE__ */ React32.createElement(VisuallyHidden2, null, /* @__PURE__ */ React32.createElement("input", __spreadValues(__spreadValues({
|
|
950
1135
|
type: "radio",
|
|
951
1136
|
disabled: props.disabled
|
|
952
|
-
}, focusProps), restProps))), /* @__PURE__ */
|
|
1137
|
+
}, focusProps), restProps))), /* @__PURE__ */ React32.createElement(RadioIcon, {
|
|
953
1138
|
variant: props.variant,
|
|
954
1139
|
disabled: props.disabled,
|
|
955
1140
|
checked: props.checked,
|
|
@@ -966,40 +1151,40 @@ var Radio = (_a) => {
|
|
|
966
1151
|
"labelVariant",
|
|
967
1152
|
"errorMessage"
|
|
968
1153
|
]);
|
|
969
|
-
return /* @__PURE__ */
|
|
970
|
-
as:
|
|
1154
|
+
return /* @__PURE__ */ React32.createElement(React32.Fragment, null, /* @__PURE__ */ React32.createElement(Box, {
|
|
1155
|
+
as: Label2,
|
|
971
1156
|
htmlFor: props.id,
|
|
972
1157
|
required,
|
|
973
1158
|
variant: `label.${labelVariant}`,
|
|
974
1159
|
css: props.disabled ? { color: "disabled", ":hover": { cursor: "not-allowed" } } : { color: "text", ":hover": { cursor: "pointer" } }
|
|
975
|
-
}, /* @__PURE__ */
|
|
1160
|
+
}, /* @__PURE__ */ React32.createElement(Box, __spreadValues({
|
|
976
1161
|
as: RadioInput,
|
|
977
1162
|
error: props.error
|
|
978
|
-
}, props)), props.children), props.error && errorMessage && /* @__PURE__ */
|
|
1163
|
+
}, props)), props.children), props.error && errorMessage && /* @__PURE__ */ React32.createElement(ValidationMessage, null, /* @__PURE__ */ React32.createElement(Exclamation2, {
|
|
979
1164
|
size: 16
|
|
980
1165
|
}), errorMessage));
|
|
981
1166
|
};
|
|
982
1167
|
|
|
983
1168
|
// src/Select/Select.tsx
|
|
984
|
-
import
|
|
1169
|
+
import React37, { useRef as useRef8 } from "react";
|
|
985
1170
|
import { useSelectState } from "@react-stately/select";
|
|
986
1171
|
import { useButton as useButton3 } from "@react-aria/button";
|
|
987
|
-
import { mergeProps as
|
|
988
|
-
import { useFocusRing as
|
|
1172
|
+
import { mergeProps as mergeProps5 } from "@react-aria/utils";
|
|
1173
|
+
import { useFocusRing as useFocusRing5 } from "@react-aria/focus";
|
|
989
1174
|
import { HiddenSelect, useSelect } from "@react-aria/select";
|
|
990
1175
|
import { useOverlayTriggerState as useOverlayTriggerState2 } from "@react-stately/overlays";
|
|
991
|
-
import { useOverlayTrigger, useOverlayPosition } from "@react-aria/overlays";
|
|
992
|
-
import { ArrowDown, ArrowUp, Exclamation as
|
|
1176
|
+
import { useOverlayTrigger, useOverlayPosition as useOverlayPosition2 } from "@react-aria/overlays";
|
|
1177
|
+
import { ArrowDown, ArrowUp, Exclamation as Exclamation3, Required as Required3 } from "@marigold/icons";
|
|
993
1178
|
|
|
994
1179
|
// src/Select/ListBox.tsx
|
|
995
|
-
import
|
|
1180
|
+
import React35, { useRef as useRef7 } from "react";
|
|
996
1181
|
import { useListBox } from "@react-aria/listbox";
|
|
997
1182
|
|
|
998
1183
|
// src/Select/Option.tsx
|
|
999
|
-
import
|
|
1184
|
+
import React33, { useEffect, useRef as useRef6, useState } from "react";
|
|
1000
1185
|
import { useOption } from "@react-aria/listbox";
|
|
1001
1186
|
var Option = ({ item, state }) => {
|
|
1002
|
-
const ref =
|
|
1187
|
+
const ref = useRef6(null);
|
|
1003
1188
|
const [disabled, setDisabled] = useState(false);
|
|
1004
1189
|
const { optionProps, isSelected } = useOption({
|
|
1005
1190
|
key: item.key
|
|
@@ -1011,7 +1196,7 @@ var Option = ({ item, state }) => {
|
|
|
1011
1196
|
}
|
|
1012
1197
|
}
|
|
1013
1198
|
}, [state.disabledKeys, item.key]);
|
|
1014
|
-
return /* @__PURE__ */
|
|
1199
|
+
return /* @__PURE__ */ React33.createElement(Box, __spreadProps(__spreadValues({
|
|
1015
1200
|
as: "li"
|
|
1016
1201
|
}, optionProps), {
|
|
1017
1202
|
ref,
|
|
@@ -1020,26 +1205,26 @@ var Option = ({ item, state }) => {
|
|
|
1020
1205
|
};
|
|
1021
1206
|
|
|
1022
1207
|
// src/Select/ListBoxSection.tsx
|
|
1023
|
-
import
|
|
1208
|
+
import React34 from "react";
|
|
1024
1209
|
import { useListBoxSection } from "@react-aria/listbox";
|
|
1025
1210
|
var ListBoxSection = ({ section, state }) => {
|
|
1026
1211
|
const { itemProps, headingProps, groupProps } = useListBoxSection({
|
|
1027
1212
|
heading: section.rendered,
|
|
1028
1213
|
"aria-label": section["aria-label"]
|
|
1029
1214
|
});
|
|
1030
|
-
return /* @__PURE__ */
|
|
1215
|
+
return /* @__PURE__ */ React34.createElement(Box, __spreadProps(__spreadValues({
|
|
1031
1216
|
as: "li"
|
|
1032
1217
|
}, itemProps), {
|
|
1033
1218
|
css: {
|
|
1034
1219
|
cursor: "not-allowed"
|
|
1035
1220
|
}
|
|
1036
|
-
}), section.rendered && /* @__PURE__ */
|
|
1221
|
+
}), section.rendered && /* @__PURE__ */ React34.createElement(Box, __spreadProps(__spreadValues({
|
|
1037
1222
|
as: "span"
|
|
1038
1223
|
}, headingProps), {
|
|
1039
1224
|
variant: "select.section"
|
|
1040
|
-
}), section.rendered), /* @__PURE__ */
|
|
1225
|
+
}), section.rendered), /* @__PURE__ */ React34.createElement(Box, __spreadValues({
|
|
1041
1226
|
as: "ul"
|
|
1042
|
-
}, groupProps), [...section.childNodes].map((node) => /* @__PURE__ */
|
|
1227
|
+
}, groupProps), [...section.childNodes].map((node) => /* @__PURE__ */ React34.createElement(Option, {
|
|
1043
1228
|
key: node.key,
|
|
1044
1229
|
item: node,
|
|
1045
1230
|
state
|
|
@@ -1048,10 +1233,10 @@ var ListBoxSection = ({ section, state }) => {
|
|
|
1048
1233
|
|
|
1049
1234
|
// src/Select/ListBox.tsx
|
|
1050
1235
|
var ListBox = (props) => {
|
|
1051
|
-
const ref =
|
|
1236
|
+
const ref = useRef7(null);
|
|
1052
1237
|
const { state, error } = props;
|
|
1053
1238
|
const { listBoxProps } = useListBox(props, state, ref);
|
|
1054
|
-
return /* @__PURE__ */
|
|
1239
|
+
return /* @__PURE__ */ React35.createElement(Box, __spreadProps(__spreadValues({
|
|
1055
1240
|
as: "ul",
|
|
1056
1241
|
p: "none",
|
|
1057
1242
|
css: {
|
|
@@ -1060,11 +1245,11 @@ var ListBox = (props) => {
|
|
|
1060
1245
|
}, listBoxProps), {
|
|
1061
1246
|
variant: error ? "select.listbox.error" : "select.listbox",
|
|
1062
1247
|
ref
|
|
1063
|
-
}), [...state.collection].map((item) => item.type === "section" ? /* @__PURE__ */
|
|
1248
|
+
}), [...state.collection].map((item) => item.type === "section" ? /* @__PURE__ */ React35.createElement(ListBoxSection, {
|
|
1064
1249
|
key: item.key,
|
|
1065
1250
|
section: item,
|
|
1066
1251
|
state
|
|
1067
|
-
}) : /* @__PURE__ */
|
|
1252
|
+
}) : /* @__PURE__ */ React35.createElement(Option, {
|
|
1068
1253
|
key: item.key,
|
|
1069
1254
|
item,
|
|
1070
1255
|
state
|
|
@@ -1072,30 +1257,30 @@ var ListBox = (props) => {
|
|
|
1072
1257
|
};
|
|
1073
1258
|
|
|
1074
1259
|
// src/Select/Popover.tsx
|
|
1075
|
-
import
|
|
1076
|
-
import { FocusScope as
|
|
1260
|
+
import React36, { forwardRef as forwardRef3 } from "react";
|
|
1261
|
+
import { FocusScope as FocusScope3 } from "@react-aria/focus";
|
|
1077
1262
|
import {
|
|
1078
|
-
DismissButton,
|
|
1263
|
+
DismissButton as DismissButton2,
|
|
1079
1264
|
OverlayContainer as OverlayContainer2,
|
|
1080
|
-
useModal as
|
|
1081
|
-
useOverlay as
|
|
1265
|
+
useModal as useModal3,
|
|
1266
|
+
useOverlay as useOverlay3
|
|
1082
1267
|
} from "@react-aria/overlays";
|
|
1083
|
-
import { mergeProps } from "@react-aria/utils";
|
|
1084
|
-
var
|
|
1268
|
+
import { mergeProps as mergeProps4 } from "@react-aria/utils";
|
|
1269
|
+
var Popover2 = forwardRef3((_a, ref) => {
|
|
1085
1270
|
var _b = _a, { children, className, isOpen, onClose } = _b, otherProps = __objRest(_b, ["children", "className", "isOpen", "onClose"]);
|
|
1086
|
-
const { overlayProps } =
|
|
1271
|
+
const { overlayProps } = useOverlay3({
|
|
1087
1272
|
isOpen,
|
|
1088
1273
|
onClose,
|
|
1089
1274
|
shouldCloseOnBlur: true,
|
|
1090
1275
|
isDismissable: true
|
|
1091
1276
|
}, ref);
|
|
1092
|
-
const { modalProps } =
|
|
1093
|
-
return /* @__PURE__ */
|
|
1277
|
+
const { modalProps } = useModal3();
|
|
1278
|
+
return /* @__PURE__ */ React36.createElement(OverlayContainer2, null, /* @__PURE__ */ React36.createElement(FocusScope3, {
|
|
1094
1279
|
restoreFocus: true
|
|
1095
|
-
}, /* @__PURE__ */
|
|
1280
|
+
}, /* @__PURE__ */ React36.createElement(Box, __spreadProps(__spreadValues({}, mergeProps4(overlayProps, otherProps, modalProps)), {
|
|
1096
1281
|
className,
|
|
1097
1282
|
ref
|
|
1098
|
-
}), children, /* @__PURE__ */
|
|
1283
|
+
}), children, /* @__PURE__ */ React36.createElement(DismissButton2, {
|
|
1099
1284
|
onDismiss: onClose
|
|
1100
1285
|
}))));
|
|
1101
1286
|
});
|
|
@@ -1123,10 +1308,10 @@ var Select = (_a) => {
|
|
|
1123
1308
|
]);
|
|
1124
1309
|
const state = useSelectState(props);
|
|
1125
1310
|
const overlayTriggerState = useOverlayTriggerState2({});
|
|
1126
|
-
const triggerRef =
|
|
1127
|
-
const overlayRef =
|
|
1311
|
+
const triggerRef = useRef8();
|
|
1312
|
+
const overlayRef = useRef8();
|
|
1128
1313
|
const { overlayProps } = useOverlayTrigger({ type: "listbox" }, overlayTriggerState, triggerRef);
|
|
1129
|
-
const { overlayProps: positionProps } =
|
|
1314
|
+
const { overlayProps: positionProps } = useOverlayPosition2({
|
|
1130
1315
|
targetRef: triggerRef,
|
|
1131
1316
|
overlayRef,
|
|
1132
1317
|
placement: "bottom",
|
|
@@ -1136,46 +1321,46 @@ var Select = (_a) => {
|
|
|
1136
1321
|
});
|
|
1137
1322
|
const { labelProps, triggerProps, valueProps, menuProps } = useSelect(props, state, triggerRef);
|
|
1138
1323
|
const { buttonProps } = useButton3(triggerProps, triggerRef);
|
|
1139
|
-
const { focusProps } =
|
|
1140
|
-
return /* @__PURE__ */
|
|
1324
|
+
const { focusProps } = useFocusRing5();
|
|
1325
|
+
return /* @__PURE__ */ React37.createElement(Box, {
|
|
1141
1326
|
position: "relative",
|
|
1142
1327
|
display: "inline-block",
|
|
1143
1328
|
width: width && width
|
|
1144
|
-
}, props.label && /* @__PURE__ */
|
|
1329
|
+
}, props.label && /* @__PURE__ */ React37.createElement(Box, null, /* @__PURE__ */ React37.createElement(Label2, __spreadProps(__spreadValues({}, labelProps), {
|
|
1145
1330
|
htmlFor: labelProps.id,
|
|
1146
1331
|
variant: labelVariant
|
|
1147
|
-
}), required ? /* @__PURE__ */
|
|
1332
|
+
}), required ? /* @__PURE__ */ React37.createElement(Box, {
|
|
1148
1333
|
as: "span",
|
|
1149
1334
|
display: "inline-flex",
|
|
1150
1335
|
alignItems: "center"
|
|
1151
|
-
}, props.label, /* @__PURE__ */
|
|
1336
|
+
}, props.label, /* @__PURE__ */ React37.createElement(Required3, {
|
|
1152
1337
|
size: 16,
|
|
1153
1338
|
fill: "error"
|
|
1154
|
-
})) : props.label)), /* @__PURE__ */
|
|
1339
|
+
})) : props.label)), /* @__PURE__ */ React37.createElement(HiddenSelect, {
|
|
1155
1340
|
state,
|
|
1156
1341
|
triggerRef,
|
|
1157
1342
|
label: props.label,
|
|
1158
1343
|
name: props.name,
|
|
1159
1344
|
isDisabled: disabled
|
|
1160
|
-
}), /* @__PURE__ */
|
|
1345
|
+
}), /* @__PURE__ */ React37.createElement(Box, __spreadProps(__spreadValues({
|
|
1161
1346
|
as: "button"
|
|
1162
|
-
},
|
|
1347
|
+
}, mergeProps5(buttonProps, focusProps)), {
|
|
1163
1348
|
ref: triggerRef,
|
|
1164
1349
|
variant: error && state.isOpen && !disabled ? "button.select.errorOpened" : error ? "button.select.error" : state.isOpen && !disabled ? "button.select.open" : "button.select",
|
|
1165
1350
|
disabled,
|
|
1166
1351
|
className
|
|
1167
|
-
}), /* @__PURE__ */
|
|
1352
|
+
}), /* @__PURE__ */ React37.createElement(Box, __spreadProps(__spreadValues({
|
|
1168
1353
|
as: "span"
|
|
1169
1354
|
}, valueProps), {
|
|
1170
1355
|
variant: disabled ? "select.disabled" : "select"
|
|
1171
|
-
}), state.selectedItem ? state.selectedItem.rendered : placeholder), state.isOpen && !disabled ? /* @__PURE__ */
|
|
1356
|
+
}), state.selectedItem ? state.selectedItem.rendered : placeholder), state.isOpen && !disabled ? /* @__PURE__ */ React37.createElement(ArrowUp, {
|
|
1172
1357
|
size: 16,
|
|
1173
1358
|
fill: "text"
|
|
1174
|
-
}) : /* @__PURE__ */
|
|
1359
|
+
}) : /* @__PURE__ */ React37.createElement(ArrowDown, {
|
|
1175
1360
|
size: 16,
|
|
1176
1361
|
fill: disabled ? "disabled" : "text"
|
|
1177
|
-
})), state.isOpen && !disabled && /* @__PURE__ */
|
|
1178
|
-
as:
|
|
1362
|
+
})), state.isOpen && !disabled && /* @__PURE__ */ React37.createElement(Box, __spreadProps(__spreadValues(__spreadValues({
|
|
1363
|
+
as: Popover2
|
|
1179
1364
|
}, overlayProps), positionProps), {
|
|
1180
1365
|
css: {
|
|
1181
1366
|
width: triggerRef.current && triggerRef.current.offsetWidth + "px"
|
|
@@ -1183,26 +1368,26 @@ var Select = (_a) => {
|
|
|
1183
1368
|
ref: overlayRef,
|
|
1184
1369
|
isOpen: state.isOpen,
|
|
1185
1370
|
onClose: state.close
|
|
1186
|
-
}), /* @__PURE__ */
|
|
1371
|
+
}), /* @__PURE__ */ React37.createElement(ListBox, __spreadProps(__spreadValues({
|
|
1187
1372
|
error
|
|
1188
1373
|
}, menuProps), {
|
|
1189
1374
|
state
|
|
1190
|
-
}))), error && errorMessage && /* @__PURE__ */
|
|
1375
|
+
}))), error && errorMessage && /* @__PURE__ */ React37.createElement(Box, {
|
|
1191
1376
|
as: "span",
|
|
1192
1377
|
display: "inline-flex",
|
|
1193
1378
|
alignItems: "center"
|
|
1194
|
-
}, /* @__PURE__ */
|
|
1195
|
-
as:
|
|
1379
|
+
}, /* @__PURE__ */ React37.createElement(Box, {
|
|
1380
|
+
as: Exclamation3,
|
|
1196
1381
|
size: 16,
|
|
1197
1382
|
css: { color: "error" }
|
|
1198
|
-
}), /* @__PURE__ */
|
|
1383
|
+
}), /* @__PURE__ */ React37.createElement(ValidationMessage, null, errorMessage)));
|
|
1199
1384
|
};
|
|
1200
1385
|
|
|
1201
1386
|
// src/Slider/Slider.tsx
|
|
1202
|
-
import
|
|
1387
|
+
import React38 from "react";
|
|
1203
1388
|
var Slider = (_a) => {
|
|
1204
1389
|
var _b = _a, { variant = "" } = _b, props = __objRest(_b, ["variant"]);
|
|
1205
|
-
return /* @__PURE__ */
|
|
1390
|
+
return /* @__PURE__ */ React38.createElement(Box, __spreadValues({
|
|
1206
1391
|
as: "input",
|
|
1207
1392
|
type: "range",
|
|
1208
1393
|
css: { verticalAlign: "middle" },
|
|
@@ -1211,12 +1396,12 @@ var Slider = (_a) => {
|
|
|
1211
1396
|
};
|
|
1212
1397
|
|
|
1213
1398
|
// src/Switch/Switch.tsx
|
|
1214
|
-
import
|
|
1215
|
-
import { useFocusRing as
|
|
1399
|
+
import React39, { useRef as useRef9 } from "react";
|
|
1400
|
+
import { useFocusRing as useFocusRing6 } from "@react-aria/focus";
|
|
1216
1401
|
import { useSwitch } from "@react-aria/switch";
|
|
1217
|
-
import { VisuallyHidden as
|
|
1402
|
+
import { VisuallyHidden as VisuallyHidden3 } from "@react-aria/visually-hidden";
|
|
1218
1403
|
import { useToggleState as useToggleState2 } from "@react-stately/toggle";
|
|
1219
|
-
import { conditional as
|
|
1404
|
+
import { conditional as conditional2 } from "@marigold/system";
|
|
1220
1405
|
var Switch = (_a) => {
|
|
1221
1406
|
var _b = _a, {
|
|
1222
1407
|
variant = "",
|
|
@@ -1228,19 +1413,19 @@ var Switch = (_a) => {
|
|
|
1228
1413
|
"disabled"
|
|
1229
1414
|
]);
|
|
1230
1415
|
const state = useToggleState2(props);
|
|
1231
|
-
const ref =
|
|
1416
|
+
const ref = useRef9();
|
|
1232
1417
|
const { inputProps } = useSwitch(props, state, ref);
|
|
1233
|
-
const { focusProps } =
|
|
1234
|
-
return /* @__PURE__ */
|
|
1235
|
-
as:
|
|
1418
|
+
const { focusProps } = useFocusRing6();
|
|
1419
|
+
return /* @__PURE__ */ React39.createElement(Box, {
|
|
1420
|
+
as: Label2,
|
|
1236
1421
|
__baseCSS: {
|
|
1237
1422
|
userSelect: "none"
|
|
1238
1423
|
},
|
|
1239
1424
|
variant: labelVariant
|
|
1240
|
-
}, props.children, /* @__PURE__ */
|
|
1425
|
+
}, props.children, /* @__PURE__ */ React39.createElement(VisuallyHidden3, null, /* @__PURE__ */ React39.createElement("input", __spreadProps(__spreadValues(__spreadValues({}, inputProps), focusProps), {
|
|
1241
1426
|
disabled,
|
|
1242
1427
|
ref
|
|
1243
|
-
}))), /* @__PURE__ */
|
|
1428
|
+
}))), /* @__PURE__ */ React39.createElement(Box, {
|
|
1244
1429
|
as: "svg",
|
|
1245
1430
|
__baseCSS: {
|
|
1246
1431
|
cursor: disabled ? "not-allowed" : "pointer",
|
|
@@ -1248,7 +1433,7 @@ var Switch = (_a) => {
|
|
|
1248
1433
|
height: 32
|
|
1249
1434
|
},
|
|
1250
1435
|
"aria-hidden": "true"
|
|
1251
|
-
}, /* @__PURE__ */
|
|
1436
|
+
}, /* @__PURE__ */ React39.createElement(Box, {
|
|
1252
1437
|
as: "rect",
|
|
1253
1438
|
__baseCSS: {
|
|
1254
1439
|
x: 4,
|
|
@@ -1257,11 +1442,11 @@ var Switch = (_a) => {
|
|
|
1257
1442
|
width: 48,
|
|
1258
1443
|
height: 24
|
|
1259
1444
|
},
|
|
1260
|
-
variant:
|
|
1445
|
+
variant: conditional2(`switch.${variant}`, {
|
|
1261
1446
|
checked: state.isSelected,
|
|
1262
1447
|
disabled
|
|
1263
1448
|
})
|
|
1264
|
-
}), /* @__PURE__ */
|
|
1449
|
+
}), /* @__PURE__ */ React39.createElement(Box, {
|
|
1265
1450
|
as: "circle",
|
|
1266
1451
|
__baseCSS: {
|
|
1267
1452
|
boxShadow: "1px 1px 4px rgba(0, 0, 0, 0.25)",
|
|
@@ -1273,51 +1458,465 @@ var Switch = (_a) => {
|
|
|
1273
1458
|
})));
|
|
1274
1459
|
};
|
|
1275
1460
|
|
|
1276
|
-
// src/
|
|
1277
|
-
import
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1461
|
+
// src/Stack/Stack.tsx
|
|
1462
|
+
import React40 from "react";
|
|
1463
|
+
var ALIGNMENT2 = {
|
|
1464
|
+
left: "flex-start",
|
|
1465
|
+
center: "center",
|
|
1466
|
+
right: "flex-end"
|
|
1467
|
+
};
|
|
1468
|
+
var Stack = (_a) => {
|
|
1281
1469
|
var _b = _a, {
|
|
1282
|
-
|
|
1283
|
-
|
|
1470
|
+
space = "none",
|
|
1471
|
+
align = "left",
|
|
1472
|
+
children
|
|
1473
|
+
} = _b, props = __objRest(_b, [
|
|
1474
|
+
"space",
|
|
1475
|
+
"align",
|
|
1476
|
+
"children"
|
|
1477
|
+
]);
|
|
1478
|
+
return /* @__PURE__ */ React40.createElement(Box, __spreadProps(__spreadValues({}, props), {
|
|
1479
|
+
display: "flex",
|
|
1480
|
+
flexDirection: "column",
|
|
1481
|
+
alignItems: ALIGNMENT2[align],
|
|
1482
|
+
p: "0",
|
|
1483
|
+
css: { gap: space }
|
|
1484
|
+
}), children);
|
|
1485
|
+
};
|
|
1486
|
+
|
|
1487
|
+
// src/Table/Table.tsx
|
|
1488
|
+
import React47, { useRef as useRef14 } from "react";
|
|
1489
|
+
import { useTable } from "@react-aria/table";
|
|
1490
|
+
import {
|
|
1491
|
+
Cell,
|
|
1492
|
+
Column,
|
|
1493
|
+
Row,
|
|
1494
|
+
TableBody,
|
|
1495
|
+
TableHeader,
|
|
1496
|
+
useTableState
|
|
1497
|
+
} from "@react-stately/table";
|
|
1498
|
+
import { useComponentStyles as useComponentStyles16 } from "@marigold/system";
|
|
1499
|
+
|
|
1500
|
+
// src/Table/TableCell.tsx
|
|
1501
|
+
import React41, { useRef as useRef10 } from "react";
|
|
1502
|
+
import { useCheckbox as useCheckbox2 } from "@react-aria/checkbox";
|
|
1503
|
+
import { useFocusRing as useFocusRing7 } from "@react-aria/focus";
|
|
1504
|
+
import { useTableCell, useTableSelectionCheckbox } from "@react-aria/table";
|
|
1505
|
+
import { mergeProps as mergeProps6 } from "@react-aria/utils";
|
|
1506
|
+
import { useToggleState as useToggleState3 } from "@react-stately/toggle";
|
|
1507
|
+
import { useStateProps as useStateProps4 } from "@marigold/system";
|
|
1508
|
+
var TableCell = ({
|
|
1509
|
+
item: cell,
|
|
1510
|
+
state,
|
|
1511
|
+
isSelectionCell,
|
|
1512
|
+
align = "left",
|
|
1513
|
+
css
|
|
1514
|
+
}) => {
|
|
1515
|
+
const cellRef = useRef10(null);
|
|
1516
|
+
const { gridCellProps } = useTableCell({ node: cell }, state, cellRef);
|
|
1517
|
+
const { checkboxProps } = useTableSelectionCheckbox({ key: cell.parentKey }, state);
|
|
1518
|
+
const inputRef = useRef10(null);
|
|
1519
|
+
const { inputProps } = useCheckbox2(checkboxProps, useToggleState3(checkboxProps), inputRef);
|
|
1520
|
+
const { focusProps, isFocusVisible } = useFocusRing7();
|
|
1521
|
+
const stateProps = useStateProps4({ focus: isFocusVisible });
|
|
1522
|
+
return /* @__PURE__ */ React41.createElement(Box, __spreadValues(__spreadValues({
|
|
1523
|
+
as: "td",
|
|
1524
|
+
ref: cellRef,
|
|
1525
|
+
__baseCSS: {
|
|
1526
|
+
textAlign: isSelectionCell ? "center" : align
|
|
1527
|
+
},
|
|
1528
|
+
css
|
|
1529
|
+
}, mergeProps6(gridCellProps, focusProps)), stateProps), isSelectionCell ? /* @__PURE__ */ React41.createElement("input", __spreadValues({}, inputProps)) : /* @__PURE__ */ React41.createElement(React41.Fragment, null, cell.rendered));
|
|
1530
|
+
};
|
|
1531
|
+
|
|
1532
|
+
// src/Table/TableColumnHeader.tsx
|
|
1533
|
+
import React43, { useRef as useRef11 } from "react";
|
|
1534
|
+
import { useCheckbox as useCheckbox3 } from "@react-aria/checkbox";
|
|
1535
|
+
import { useFocusRing as useFocusRing8 } from "@react-aria/focus";
|
|
1536
|
+
import {
|
|
1537
|
+
useTableSelectAllCheckbox,
|
|
1538
|
+
useTableColumnHeader
|
|
1539
|
+
} from "@react-aria/table";
|
|
1540
|
+
import { mergeProps as mergeProps7 } from "@react-aria/utils";
|
|
1541
|
+
import { useToggleState as useToggleState4 } from "@react-stately/toggle";
|
|
1542
|
+
import { useStateProps as useStateProps5 } from "@marigold/system";
|
|
1543
|
+
|
|
1544
|
+
// src/Text/Text.tsx
|
|
1545
|
+
import React42 from "react";
|
|
1546
|
+
import {
|
|
1547
|
+
useComponentStyles as useComponentStyles15
|
|
1548
|
+
} from "@marigold/system";
|
|
1549
|
+
import { Box as Box11 } from "@marigold/system";
|
|
1550
|
+
var Text = (_a) => {
|
|
1551
|
+
var _b = _a, {
|
|
1552
|
+
variant,
|
|
1553
|
+
size,
|
|
1554
|
+
align,
|
|
1555
|
+
color,
|
|
1556
|
+
fontSize,
|
|
1557
|
+
cursor,
|
|
1558
|
+
outline,
|
|
1559
|
+
children
|
|
1560
|
+
} = _b, props = __objRest(_b, [
|
|
1561
|
+
"variant",
|
|
1562
|
+
"size",
|
|
1563
|
+
"align",
|
|
1564
|
+
"color",
|
|
1565
|
+
"fontSize",
|
|
1566
|
+
"cursor",
|
|
1567
|
+
"outline",
|
|
1568
|
+
"children"
|
|
1569
|
+
]);
|
|
1570
|
+
const styles = useComponentStyles15("Text", {
|
|
1571
|
+
variant,
|
|
1572
|
+
size
|
|
1573
|
+
});
|
|
1574
|
+
return /* @__PURE__ */ React42.createElement(Box11, __spreadProps(__spreadValues({
|
|
1575
|
+
as: "p"
|
|
1576
|
+
}, props), {
|
|
1577
|
+
css: __spreadValues({ color, cursor, outline, fontSize, textAlign: align }, styles)
|
|
1578
|
+
}), children);
|
|
1579
|
+
};
|
|
1580
|
+
|
|
1581
|
+
// src/Table/TableColumnHeader.tsx
|
|
1582
|
+
var TableColumnHeader = ({
|
|
1583
|
+
item: column,
|
|
1584
|
+
state,
|
|
1585
|
+
isSelectionColumn,
|
|
1586
|
+
align = "left",
|
|
1587
|
+
css
|
|
1588
|
+
}) => {
|
|
1589
|
+
const ref = useRef11(null);
|
|
1590
|
+
const { columnHeaderProps } = useTableColumnHeader({ node: column }, state, ref);
|
|
1591
|
+
const { checkboxProps } = useTableSelectAllCheckbox(state);
|
|
1592
|
+
const inputRef = useRef11(null);
|
|
1593
|
+
const { inputProps } = useCheckbox3(checkboxProps, useToggleState4(checkboxProps), inputRef);
|
|
1594
|
+
const { focusProps, isFocusVisible } = useFocusRing8();
|
|
1595
|
+
const stateProps = useStateProps5({ focus: isFocusVisible });
|
|
1596
|
+
return /* @__PURE__ */ React43.createElement(Box, __spreadValues(__spreadValues({
|
|
1597
|
+
as: "th",
|
|
1598
|
+
ref,
|
|
1599
|
+
__baseCSS: { textAlign: isSelectionColumn ? "center" : align },
|
|
1600
|
+
css
|
|
1601
|
+
}, mergeProps7(columnHeaderProps, focusProps)), stateProps), isSelectionColumn ? /* @__PURE__ */ React43.createElement("input", __spreadProps(__spreadValues({}, inputProps), {
|
|
1602
|
+
ref: inputRef
|
|
1603
|
+
})) : /* @__PURE__ */ React43.createElement(Text, {
|
|
1604
|
+
size: "xxsmall"
|
|
1605
|
+
}, column.rendered));
|
|
1606
|
+
};
|
|
1607
|
+
|
|
1608
|
+
// src/Table/TableHeaderRow.tsx
|
|
1609
|
+
import React44, { useRef as useRef12 } from "react";
|
|
1610
|
+
import { useTableHeaderRow } from "@react-aria/table";
|
|
1611
|
+
var TableHeaderRow = ({
|
|
1612
|
+
item,
|
|
1613
|
+
state,
|
|
1614
|
+
children
|
|
1615
|
+
}) => {
|
|
1616
|
+
const ref = useRef12(null);
|
|
1617
|
+
const { rowProps } = useTableHeaderRow({ node: item }, state, ref);
|
|
1618
|
+
return /* @__PURE__ */ React44.createElement("tr", __spreadProps(__spreadValues({}, rowProps), {
|
|
1619
|
+
ref
|
|
1620
|
+
}), children);
|
|
1621
|
+
};
|
|
1622
|
+
|
|
1623
|
+
// src/Table/TableRow.tsx
|
|
1624
|
+
import React45, { useRef as useRef13 } from "react";
|
|
1625
|
+
import { useFocusRing as useFocusRing9 } from "@react-aria/focus";
|
|
1626
|
+
import { useTableRow } from "@react-aria/table";
|
|
1627
|
+
import { mergeProps as mergeProps8 } from "@react-aria/utils";
|
|
1628
|
+
import { useStateProps as useStateProps6 } from "@marigold/system";
|
|
1629
|
+
var TableRow = ({ item, state, children, css }) => {
|
|
1630
|
+
const ref = useRef13(null);
|
|
1631
|
+
const isSelected = state.selectionManager.isSelected(item.key);
|
|
1632
|
+
const { rowProps } = useTableRow({
|
|
1633
|
+
node: item
|
|
1634
|
+
}, state, ref);
|
|
1635
|
+
const { focusProps, isFocusVisible } = useFocusRing9();
|
|
1636
|
+
const stateProps = useStateProps6({
|
|
1637
|
+
focus: isFocusVisible,
|
|
1638
|
+
checked: isSelected
|
|
1639
|
+
});
|
|
1640
|
+
return /* @__PURE__ */ React45.createElement(Box, __spreadValues(__spreadValues({
|
|
1641
|
+
as: "tr",
|
|
1642
|
+
ref,
|
|
1643
|
+
css
|
|
1644
|
+
}, mergeProps8(rowProps, focusProps)), stateProps), children);
|
|
1645
|
+
};
|
|
1646
|
+
|
|
1647
|
+
// src/Table/TableRowGroup.tsx
|
|
1648
|
+
import React46 from "react";
|
|
1649
|
+
import { useTableRowGroup } from "@react-aria/table";
|
|
1650
|
+
var TableRowGroup = ({
|
|
1651
|
+
as: Element,
|
|
1652
|
+
children
|
|
1653
|
+
}) => {
|
|
1654
|
+
const { rowGroupProps } = useTableRowGroup();
|
|
1655
|
+
return /* @__PURE__ */ React46.createElement(Element, __spreadValues({}, rowGroupProps), children);
|
|
1656
|
+
};
|
|
1657
|
+
|
|
1658
|
+
// src/Table/Table.tsx
|
|
1659
|
+
var Table = (_a) => {
|
|
1660
|
+
var _b = _a, {
|
|
1661
|
+
align,
|
|
1662
|
+
alignHeader,
|
|
1663
|
+
variant,
|
|
1664
|
+
size
|
|
1665
|
+
} = _b, props = __objRest(_b, [
|
|
1666
|
+
"align",
|
|
1667
|
+
"alignHeader",
|
|
1668
|
+
"variant",
|
|
1669
|
+
"size"
|
|
1670
|
+
]);
|
|
1671
|
+
const showSelectionCheckboxes = props.selectionMode === "multiple" && props.selectionBehavior !== "replace";
|
|
1672
|
+
const state = useTableState(__spreadProps(__spreadValues({}, props), {
|
|
1673
|
+
showSelectionCheckboxes
|
|
1674
|
+
}));
|
|
1675
|
+
const ref = useRef14(null);
|
|
1676
|
+
const { gridProps } = useTable(props, state, ref);
|
|
1677
|
+
const styles = useComponentStyles16("Table", { variant, size }, { parts: ["table", "header", "row", "cell"] });
|
|
1678
|
+
return /* @__PURE__ */ React47.createElement(Box, __spreadValues({
|
|
1679
|
+
as: "table",
|
|
1680
|
+
ref,
|
|
1681
|
+
__baseCSS: styles.table
|
|
1682
|
+
}, gridProps), /* @__PURE__ */ React47.createElement(TableRowGroup, {
|
|
1683
|
+
as: "thead"
|
|
1684
|
+
}, state.collection.headerRows.map((headerRow) => /* @__PURE__ */ React47.createElement(TableHeaderRow, {
|
|
1685
|
+
key: headerRow.key,
|
|
1686
|
+
item: headerRow,
|
|
1687
|
+
state
|
|
1688
|
+
}, [...headerRow.childNodes].map((column) => /* @__PURE__ */ React47.createElement(TableColumnHeader, {
|
|
1689
|
+
key: column.key,
|
|
1690
|
+
item: column,
|
|
1691
|
+
state,
|
|
1692
|
+
isSelectionColumn: column.props.isSelectionCell,
|
|
1693
|
+
align: alignHeader,
|
|
1694
|
+
css: styles.header
|
|
1695
|
+
}))))), /* @__PURE__ */ React47.createElement(TableRowGroup, {
|
|
1696
|
+
as: "tbody"
|
|
1697
|
+
}, [...state.collection.body.childNodes].map((row) => /* @__PURE__ */ React47.createElement(TableRow, {
|
|
1698
|
+
css: styles.row,
|
|
1699
|
+
key: row.key,
|
|
1700
|
+
item: row,
|
|
1701
|
+
state
|
|
1702
|
+
}, [...row.childNodes].map((cell) => /* @__PURE__ */ React47.createElement(TableCell, {
|
|
1703
|
+
key: cell.key,
|
|
1704
|
+
item: cell,
|
|
1705
|
+
state,
|
|
1706
|
+
isSelectionCell: cell.props.isSelectionCell,
|
|
1707
|
+
align,
|
|
1708
|
+
css: styles.cell
|
|
1709
|
+
}))))));
|
|
1710
|
+
};
|
|
1711
|
+
Table.Body = TableBody;
|
|
1712
|
+
Table.Cell = Cell;
|
|
1713
|
+
Table.Column = Column;
|
|
1714
|
+
Table.Header = TableHeader;
|
|
1715
|
+
Table.Row = Row;
|
|
1716
|
+
|
|
1717
|
+
// src/TextArea/TextArea.tsx
|
|
1718
|
+
import React50, { useRef as useRef15 } from "react";
|
|
1719
|
+
import { useTextField } from "@react-aria/textfield";
|
|
1720
|
+
import {
|
|
1721
|
+
Box as Box13,
|
|
1722
|
+
useComponentStyles as useComponentStyles18,
|
|
1723
|
+
useStateProps as useStateProps7
|
|
1724
|
+
} from "@marigold/system";
|
|
1725
|
+
|
|
1726
|
+
// src/Field/FieldBase.tsx
|
|
1727
|
+
import React49 from "react";
|
|
1728
|
+
|
|
1729
|
+
// src/Field/HelpText.tsx
|
|
1730
|
+
import React48 from "react";
|
|
1731
|
+
import { Exclamation as Exclamation4 } from "@marigold/icons";
|
|
1732
|
+
import {
|
|
1733
|
+
Box as Box12,
|
|
1734
|
+
useComponentStyles as useComponentStyles17
|
|
1735
|
+
} from "@marigold/system";
|
|
1736
|
+
var HelpText = (_a) => {
|
|
1737
|
+
var _b = _a, {
|
|
1738
|
+
variant,
|
|
1739
|
+
size,
|
|
1740
|
+
disabled,
|
|
1741
|
+
description,
|
|
1742
|
+
descriptionProps,
|
|
1284
1743
|
error,
|
|
1285
1744
|
errorMessage,
|
|
1286
|
-
|
|
1287
|
-
children
|
|
1745
|
+
errorMessageProps
|
|
1288
1746
|
} = _b, props = __objRest(_b, [
|
|
1289
1747
|
"variant",
|
|
1290
|
-
"
|
|
1748
|
+
"size",
|
|
1749
|
+
"disabled",
|
|
1750
|
+
"description",
|
|
1751
|
+
"descriptionProps",
|
|
1291
1752
|
"error",
|
|
1292
1753
|
"errorMessage",
|
|
1293
|
-
"
|
|
1294
|
-
"children"
|
|
1754
|
+
"errorMessageProps"
|
|
1295
1755
|
]);
|
|
1296
|
-
|
|
1297
|
-
const
|
|
1298
|
-
|
|
1299
|
-
}),
|
|
1300
|
-
|
|
1301
|
-
|
|
1756
|
+
var _a2;
|
|
1757
|
+
const hasErrorMessage = errorMessage && error;
|
|
1758
|
+
const styles = useComponentStyles17("HelpText", { variant, size }, { parts: ["container", "icon"] });
|
|
1759
|
+
return /* @__PURE__ */ React48.createElement(Box12, __spreadProps(__spreadValues({}, props), {
|
|
1760
|
+
__baseCSS: { display: "flex", alignItems: "center", gap: 4 },
|
|
1761
|
+
css: styles.container
|
|
1762
|
+
}), hasErrorMessage ? /* @__PURE__ */ React48.createElement(React48.Fragment, null, /* @__PURE__ */ React48.createElement(Exclamation4, {
|
|
1763
|
+
role: "presentation",
|
|
1764
|
+
size: ((_a2 = styles == null ? void 0 : styles.icon) == null ? void 0 : _a2.size) || 16
|
|
1765
|
+
}), /* @__PURE__ */ React48.createElement(Box12, __spreadValues({}, errorMessageProps), errorMessage)) : /* @__PURE__ */ React48.createElement(Box12, __spreadValues({}, descriptionProps), description));
|
|
1766
|
+
};
|
|
1767
|
+
|
|
1768
|
+
// src/Field/FieldBase.tsx
|
|
1769
|
+
var FieldBase = ({
|
|
1770
|
+
variant,
|
|
1771
|
+
size,
|
|
1772
|
+
children,
|
|
1773
|
+
disabled,
|
|
1774
|
+
required,
|
|
1775
|
+
label,
|
|
1776
|
+
labelProps,
|
|
1777
|
+
description,
|
|
1778
|
+
descriptionProps,
|
|
1779
|
+
error,
|
|
1780
|
+
errorMessage,
|
|
1781
|
+
errorMessageProps,
|
|
1782
|
+
stateProps
|
|
1783
|
+
}) => {
|
|
1784
|
+
const hasHelpText = !!description || errorMessage && error;
|
|
1785
|
+
return /* @__PURE__ */ React49.createElement(Stack, null, label && /* @__PURE__ */ React49.createElement(Label, __spreadProps(__spreadValues(__spreadValues({}, labelProps), stateProps), {
|
|
1302
1786
|
required
|
|
1303
|
-
}
|
|
1787
|
+
}), label), children, hasHelpText && /* @__PURE__ */ React49.createElement(HelpText, __spreadProps(__spreadValues({}, stateProps), {
|
|
1788
|
+
disabled,
|
|
1789
|
+
description,
|
|
1790
|
+
descriptionProps,
|
|
1791
|
+
error,
|
|
1792
|
+
errorMessage,
|
|
1793
|
+
errorMessageProps
|
|
1794
|
+
})));
|
|
1795
|
+
};
|
|
1796
|
+
|
|
1797
|
+
// src/TextArea/TextArea.tsx
|
|
1798
|
+
import { useHover as useHover2 } from "@react-aria/interactions";
|
|
1799
|
+
import { useFocusRing as useFocusRing10 } from "@react-aria/focus";
|
|
1800
|
+
var TextArea = (_a) => {
|
|
1801
|
+
var _b = _a, {
|
|
1802
|
+
disabled,
|
|
1803
|
+
required,
|
|
1804
|
+
readOnly,
|
|
1805
|
+
error
|
|
1806
|
+
} = _b, props = __objRest(_b, [
|
|
1807
|
+
"disabled",
|
|
1808
|
+
"required",
|
|
1809
|
+
"readOnly",
|
|
1810
|
+
"error"
|
|
1811
|
+
]);
|
|
1812
|
+
const { label, description, errorMessage } = props;
|
|
1813
|
+
const ref = useRef15(null);
|
|
1814
|
+
const { labelProps, inputProps, descriptionProps, errorMessageProps } = useTextField(__spreadValues({
|
|
1815
|
+
inputElementType: "textarea",
|
|
1816
|
+
isDisabled: disabled,
|
|
1817
|
+
isRequired: required,
|
|
1818
|
+
isReadOnly: readOnly,
|
|
1819
|
+
validationState: error ? "invalid" : "valid"
|
|
1820
|
+
}, props), ref);
|
|
1821
|
+
const { hoverProps, isHovered } = useHover2({});
|
|
1822
|
+
const { focusProps, isFocusVisible } = useFocusRing10();
|
|
1823
|
+
const stateProps = useStateProps7({
|
|
1824
|
+
hover: isHovered,
|
|
1825
|
+
focus: isFocusVisible,
|
|
1826
|
+
disabled,
|
|
1827
|
+
readOnly,
|
|
1828
|
+
error
|
|
1829
|
+
});
|
|
1830
|
+
const styles = useComponentStyles18("TextArea", {});
|
|
1831
|
+
return /* @__PURE__ */ React50.createElement(FieldBase, {
|
|
1832
|
+
label,
|
|
1833
|
+
labelProps,
|
|
1834
|
+
required,
|
|
1835
|
+
description,
|
|
1836
|
+
descriptionProps,
|
|
1837
|
+
error,
|
|
1838
|
+
errorMessage,
|
|
1839
|
+
errorMessageProps,
|
|
1840
|
+
stateProps
|
|
1841
|
+
}, /* @__PURE__ */ React50.createElement(Box13, __spreadValues(__spreadValues(__spreadValues(__spreadValues({
|
|
1304
1842
|
as: "textarea",
|
|
1305
|
-
variant:
|
|
1306
|
-
css:
|
|
1307
|
-
outlineColor: error && "error"
|
|
1308
|
-
}
|
|
1309
|
-
}, inputProps), {
|
|
1843
|
+
variant: "textArea",
|
|
1844
|
+
css: styles,
|
|
1310
1845
|
ref
|
|
1311
|
-
}
|
|
1312
|
-
|
|
1313
|
-
|
|
1846
|
+
}, inputProps), focusProps), hoverProps), stateProps)));
|
|
1847
|
+
};
|
|
1848
|
+
|
|
1849
|
+
// src/TextField/TextField.tsx
|
|
1850
|
+
import React52, { useRef as useRef16 } from "react";
|
|
1851
|
+
import { useHover as useHover3 } from "@react-aria/interactions";
|
|
1852
|
+
import { useFocusRing as useFocusRing11 } from "@react-aria/focus";
|
|
1853
|
+
import { useTextField as useTextField2 } from "@react-aria/textfield";
|
|
1854
|
+
import { useStateProps as useStateProps8 } from "@marigold/system";
|
|
1855
|
+
|
|
1856
|
+
// src/Input/Input.tsx
|
|
1857
|
+
import React51, { forwardRef as forwardRef4 } from "react";
|
|
1858
|
+
import { Box as Box14, useComponentStyles as useComponentStyles19 } from "@marigold/system";
|
|
1859
|
+
var Input = forwardRef4((_a, ref) => {
|
|
1860
|
+
var _b = _a, { variant, size, type = "text" } = _b, props = __objRest(_b, ["variant", "size", "type"]);
|
|
1861
|
+
const styles = useComponentStyles19("Input", { variant, size });
|
|
1862
|
+
return /* @__PURE__ */ React51.createElement(Box14, __spreadProps(__spreadValues({}, props), {
|
|
1863
|
+
ref,
|
|
1864
|
+
as: "input",
|
|
1865
|
+
type,
|
|
1866
|
+
css: styles
|
|
1867
|
+
}));
|
|
1868
|
+
});
|
|
1869
|
+
|
|
1870
|
+
// src/TextField/TextField.tsx
|
|
1871
|
+
var TextField = (_a) => {
|
|
1872
|
+
var _b = _a, {
|
|
1873
|
+
disabled,
|
|
1874
|
+
required,
|
|
1875
|
+
readOnly,
|
|
1876
|
+
error
|
|
1877
|
+
} = _b, props = __objRest(_b, [
|
|
1878
|
+
"disabled",
|
|
1879
|
+
"required",
|
|
1880
|
+
"readOnly",
|
|
1881
|
+
"error"
|
|
1882
|
+
]);
|
|
1883
|
+
const { label, description, errorMessage } = props;
|
|
1884
|
+
const ref = useRef16(null);
|
|
1885
|
+
const { labelProps, inputProps, descriptionProps, errorMessageProps } = useTextField2(__spreadValues({
|
|
1886
|
+
isDisabled: disabled,
|
|
1887
|
+
isRequired: required,
|
|
1888
|
+
isReadOnly: readOnly,
|
|
1889
|
+
validationState: error ? "invalid" : "valid"
|
|
1890
|
+
}, props), ref);
|
|
1891
|
+
const { hoverProps, isHovered } = useHover3({});
|
|
1892
|
+
const { focusProps, isFocusVisible } = useFocusRing11();
|
|
1893
|
+
const stateProps = useStateProps8({
|
|
1894
|
+
hover: isHovered,
|
|
1895
|
+
focus: isFocusVisible,
|
|
1896
|
+
disabled,
|
|
1897
|
+
readOnly,
|
|
1898
|
+
error
|
|
1899
|
+
});
|
|
1900
|
+
return /* @__PURE__ */ React52.createElement(FieldBase, {
|
|
1901
|
+
label,
|
|
1902
|
+
labelProps,
|
|
1903
|
+
required,
|
|
1904
|
+
description,
|
|
1905
|
+
descriptionProps,
|
|
1906
|
+
error,
|
|
1907
|
+
errorMessage,
|
|
1908
|
+
errorMessageProps,
|
|
1909
|
+
stateProps
|
|
1910
|
+
}, /* @__PURE__ */ React52.createElement(Input, __spreadValues(__spreadValues(__spreadValues(__spreadValues({
|
|
1911
|
+
ref
|
|
1912
|
+
}, inputProps), focusProps), hoverProps), stateProps)));
|
|
1314
1913
|
};
|
|
1315
1914
|
|
|
1316
1915
|
// src/Tiles/Tiles.tsx
|
|
1317
|
-
import
|
|
1318
|
-
var Tiles =
|
|
1916
|
+
import React53 from "react";
|
|
1917
|
+
var Tiles = React53.forwardRef(function Tiles2(_a, ref) {
|
|
1319
1918
|
var _b = _a, { space = "none", itemMinWidth = "250px", children } = _b, props = __objRest(_b, ["space", "itemMinWidth", "children"]);
|
|
1320
|
-
return /* @__PURE__ */
|
|
1919
|
+
return /* @__PURE__ */ React53.createElement(Box, __spreadValues({
|
|
1321
1920
|
ref,
|
|
1322
1921
|
display: "grid",
|
|
1323
1922
|
__baseCSS: {
|
|
@@ -1328,27 +1927,27 @@ var Tiles = React37.forwardRef(function Tiles2(_a, ref) {
|
|
|
1328
1927
|
});
|
|
1329
1928
|
|
|
1330
1929
|
// src/Tooltip/Tooltip.tsx
|
|
1331
|
-
import
|
|
1930
|
+
import React55, { useContext as useContext3 } from "react";
|
|
1332
1931
|
import { useTooltip } from "@react-aria/tooltip";
|
|
1333
|
-
import { mergeProps as
|
|
1932
|
+
import { mergeProps as mergeProps9 } from "@react-aria/utils";
|
|
1334
1933
|
|
|
1335
1934
|
// src/Tooltip/TooltipTrigger.tsx
|
|
1336
|
-
import
|
|
1935
|
+
import React54, { useRef as useRef17 } from "react";
|
|
1337
1936
|
import { FocusableProvider } from "@react-aria/focus";
|
|
1338
1937
|
import { useTooltipTrigger } from "@react-aria/tooltip";
|
|
1339
1938
|
import {
|
|
1340
1939
|
useTooltipTriggerState
|
|
1341
1940
|
} from "@react-stately/tooltip";
|
|
1342
|
-
var TooltipContext =
|
|
1941
|
+
var TooltipContext = React54.createContext({});
|
|
1343
1942
|
var TooltipTrigger = (_a) => {
|
|
1344
1943
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
|
1345
|
-
const [trigger, tooltip] =
|
|
1944
|
+
const [trigger, tooltip] = React54.Children.toArray(children);
|
|
1346
1945
|
const state = useTooltipTriggerState(props);
|
|
1347
|
-
const tooltipTriggerRef =
|
|
1946
|
+
const tooltipTriggerRef = useRef17();
|
|
1348
1947
|
const { triggerProps, tooltipProps } = useTooltipTrigger({}, state, tooltipTriggerRef);
|
|
1349
|
-
return /* @__PURE__ */
|
|
1948
|
+
return /* @__PURE__ */ React54.createElement(FocusableProvider, __spreadProps(__spreadValues({}, triggerProps), {
|
|
1350
1949
|
ref: tooltipTriggerRef
|
|
1351
|
-
}), trigger, state.isOpen && /* @__PURE__ */
|
|
1950
|
+
}), trigger, state.isOpen && /* @__PURE__ */ React54.createElement(TooltipContext.Provider, {
|
|
1352
1951
|
value: __spreadValues({
|
|
1353
1952
|
state
|
|
1354
1953
|
}, tooltipProps)
|
|
@@ -1364,36 +1963,19 @@ var Tooltip = (_a) => {
|
|
|
1364
1963
|
"variant",
|
|
1365
1964
|
"children"
|
|
1366
1965
|
]);
|
|
1367
|
-
const _a2 =
|
|
1368
|
-
const mergedProps =
|
|
1966
|
+
const _a2 = useContext3(TooltipContext), { state } = _a2, tooltipProviderProps = __objRest(_a2, ["state"]);
|
|
1967
|
+
const mergedProps = mergeProps9(props, tooltipProviderProps);
|
|
1369
1968
|
const { tooltipProps } = useTooltip(mergedProps, state);
|
|
1370
|
-
return /* @__PURE__ */
|
|
1969
|
+
return /* @__PURE__ */ React55.createElement(Box, __spreadValues({
|
|
1371
1970
|
position: "relative"
|
|
1372
|
-
}, tooltipProps), /* @__PURE__ */
|
|
1971
|
+
}, tooltipProps), /* @__PURE__ */ React55.createElement(Box, __spreadValues({
|
|
1373
1972
|
position: "absolute",
|
|
1374
1973
|
variant: `tooltip.${variant}`
|
|
1375
1974
|
}, mergedProps), children));
|
|
1376
1975
|
};
|
|
1377
1976
|
|
|
1378
|
-
// src/Input/Input.tsx
|
|
1379
|
-
import React40 from "react";
|
|
1380
|
-
var Input = (_a) => {
|
|
1381
|
-
var _b = _a, {
|
|
1382
|
-
variant = "",
|
|
1383
|
-
type = "text"
|
|
1384
|
-
} = _b, props = __objRest(_b, [
|
|
1385
|
-
"variant",
|
|
1386
|
-
"type"
|
|
1387
|
-
]);
|
|
1388
|
-
return /* @__PURE__ */ React40.createElement(Box, __spreadProps(__spreadValues({}, props), {
|
|
1389
|
-
as: "input",
|
|
1390
|
-
type,
|
|
1391
|
-
variant: `input.${variant}`
|
|
1392
|
-
}));
|
|
1393
|
-
};
|
|
1394
|
-
|
|
1395
1977
|
// src/Container/Container.tsx
|
|
1396
|
-
import
|
|
1978
|
+
import React56 from "react";
|
|
1397
1979
|
import { size as tokenSize } from "@marigold/tokens";
|
|
1398
1980
|
var ALIGNMENT3 = {
|
|
1399
1981
|
left: "flex-start",
|
|
@@ -1425,7 +2007,7 @@ var Container = (_a) => {
|
|
|
1425
2007
|
gridTemplateColumns = `1fr 1fr ${maxWidth}`;
|
|
1426
2008
|
gridColumn = 3;
|
|
1427
2009
|
}
|
|
1428
|
-
return /* @__PURE__ */
|
|
2010
|
+
return /* @__PURE__ */ React56.createElement(Box, __spreadValues({
|
|
1429
2011
|
display: "grid",
|
|
1430
2012
|
css: {
|
|
1431
2013
|
gridTemplateColumns,
|
|
@@ -1438,9 +2020,8 @@ var Container = (_a) => {
|
|
|
1438
2020
|
};
|
|
1439
2021
|
|
|
1440
2022
|
// src/index.ts
|
|
1441
|
-
import { Item, Section } from "@react-stately/collections";
|
|
2023
|
+
import { Item as Item2, Section } from "@react-stately/collections";
|
|
1442
2024
|
export {
|
|
1443
|
-
ActionGroup,
|
|
1444
2025
|
Aside,
|
|
1445
2026
|
Aspect,
|
|
1446
2027
|
Badge,
|
|
@@ -1450,22 +2031,28 @@ export {
|
|
|
1450
2031
|
Card,
|
|
1451
2032
|
Center,
|
|
1452
2033
|
Checkbox,
|
|
2034
|
+
CheckboxGroup,
|
|
2035
|
+
CheckboxGroupContext,
|
|
1453
2036
|
Columns,
|
|
1454
2037
|
Container,
|
|
2038
|
+
Content,
|
|
1455
2039
|
Dialog,
|
|
1456
2040
|
Divider,
|
|
1457
|
-
|
|
2041
|
+
Footer,
|
|
2042
|
+
Header,
|
|
2043
|
+
Headline,
|
|
1458
2044
|
Image,
|
|
1459
2045
|
Inline,
|
|
1460
2046
|
Input,
|
|
1461
|
-
Item,
|
|
1462
|
-
Label,
|
|
2047
|
+
Item2 as Item,
|
|
2048
|
+
Label2 as Label,
|
|
1463
2049
|
LabelBase,
|
|
1464
2050
|
Link,
|
|
1465
2051
|
MarigoldProvider,
|
|
1466
2052
|
Menu,
|
|
1467
|
-
MenuItem,
|
|
1468
2053
|
Message,
|
|
2054
|
+
Overlay,
|
|
2055
|
+
Popover,
|
|
1469
2056
|
Radio,
|
|
1470
2057
|
SSRProvider,
|
|
1471
2058
|
Section,
|
|
@@ -1473,15 +2060,18 @@ export {
|
|
|
1473
2060
|
Slider,
|
|
1474
2061
|
Stack,
|
|
1475
2062
|
Switch,
|
|
2063
|
+
Table,
|
|
1476
2064
|
Text,
|
|
1477
|
-
|
|
2065
|
+
TextArea,
|
|
2066
|
+
TextField,
|
|
1478
2067
|
ThemeProvider2 as ThemeProvider,
|
|
1479
2068
|
Tiles,
|
|
1480
2069
|
Tooltip,
|
|
1481
2070
|
TooltipContext,
|
|
1482
2071
|
TooltipTrigger,
|
|
1483
2072
|
ValidationMessage,
|
|
1484
|
-
|
|
2073
|
+
VisuallyHidden,
|
|
2074
|
+
useCheckboxGroupContext,
|
|
1485
2075
|
useDialogButtonProps,
|
|
1486
2076
|
useTheme2 as useTheme
|
|
1487
2077
|
};
|