@mond-design-system/react 1.0.0-alpha.3 → 1.0.0-alpha.4
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.cjs +376 -573
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +512 -386
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +129 -41
- package/dist/index.d.ts +129 -41
- package/dist/index.js +376 -574
- package/dist/index.js.map +1 -1
- package/package.json +5 -3
package/dist/index.cjs
CHANGED
|
@@ -9,28 +9,8 @@ function cx(...parts) {
|
|
|
9
9
|
return parts.filter(Boolean).join(" ");
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
// src/components/Text/Text.module.css
|
|
13
|
-
var
|
|
14
|
-
text: "Text_text",
|
|
15
|
-
"variant-body": "Text_variant-body",
|
|
16
|
-
"variant-label": "Text_variant-label",
|
|
17
|
-
"variant-note": "Text_variant-note",
|
|
18
|
-
"variant-meta": "Text_variant-meta",
|
|
19
|
-
"variant-eyebrow": "Text_variant-eyebrow",
|
|
20
|
-
"tone-primary": "Text_tone-primary",
|
|
21
|
-
"tone-secondary": "Text_tone-secondary",
|
|
22
|
-
"tone-muted": "Text_tone-muted",
|
|
23
|
-
"tone-inverse": "Text_tone-inverse",
|
|
24
|
-
"tone-accent": "Text_tone-accent",
|
|
25
|
-
"tone-on-media": "Text_tone-on-media",
|
|
26
|
-
"tone-danger": "Text_tone-danger",
|
|
27
|
-
"tone-warning": "Text_tone-warning",
|
|
28
|
-
"tone-success": "Text_tone-success",
|
|
29
|
-
"align-left": "Text_align-left",
|
|
30
|
-
"align-center": "Text_align-center",
|
|
31
|
-
"align-right": "Text_align-right",
|
|
32
|
-
truncate: "Text_truncate"
|
|
33
|
-
};
|
|
12
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/Text/Text.module.css?mds-scoped
|
|
13
|
+
var Text_module_default = { "text": "mds-Text__text", "variant-body": "mds-Text__variant-body", "variant-label": "mds-Text__variant-label", "variant-note": "mds-Text__variant-note", "variant-meta": "mds-Text__variant-meta", "variant-eyebrow": "mds-Text__variant-eyebrow", "tone-primary": "mds-Text__tone-primary", "tone-secondary": "mds-Text__tone-secondary", "tone-muted": "mds-Text__tone-muted", "tone-inverse": "mds-Text__tone-inverse", "tone-accent": "mds-Text__tone-accent", "tone-on-media": "mds-Text__tone-on-media", "tone-danger": "mds-Text__tone-danger", "tone-warning": "mds-Text__tone-warning", "tone-success": "mds-Text__tone-success", "align-left": "mds-Text__align-left", "align-center": "mds-Text__align-center", "align-right": "mds-Text__align-right", "truncate": "mds-Text__truncate" };
|
|
34
14
|
|
|
35
15
|
// src/components/Text/Text.tsx
|
|
36
16
|
var ELEMENT = {
|
|
@@ -58,29 +38,19 @@ function Text({
|
|
|
58
38
|
const resolvedTone = tone ?? DEFAULT_TONE[variant] ?? "primary";
|
|
59
39
|
return react.createElement(element, {
|
|
60
40
|
className: cx(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
align &&
|
|
65
|
-
truncate &&
|
|
41
|
+
Text_module_default.text,
|
|
42
|
+
Text_module_default[`variant-${variant}`],
|
|
43
|
+
Text_module_default[`tone-${resolvedTone}`],
|
|
44
|
+
align && Text_module_default[`align-${align}`],
|
|
45
|
+
truncate && Text_module_default.truncate,
|
|
66
46
|
className
|
|
67
47
|
),
|
|
68
48
|
...rest
|
|
69
49
|
});
|
|
70
50
|
}
|
|
71
51
|
|
|
72
|
-
// src/components/Heading/Heading.module.css
|
|
73
|
-
var
|
|
74
|
-
heading: "Heading_heading",
|
|
75
|
-
"variant-display": "Heading_variant-display",
|
|
76
|
-
"variant-title": "Heading_variant-title",
|
|
77
|
-
"variant-subtitle": "Heading_variant-subtitle",
|
|
78
|
-
"tone-primary": "Heading_tone-primary",
|
|
79
|
-
"tone-secondary": "Heading_tone-secondary",
|
|
80
|
-
"tone-inverse": "Heading_tone-inverse",
|
|
81
|
-
"tone-accent": "Heading_tone-accent",
|
|
82
|
-
"tone-on-media": "Heading_tone-on-media"
|
|
83
|
-
};
|
|
52
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/Heading/Heading.module.css?mds-scoped
|
|
53
|
+
var Heading_module_default = { "heading": "mds-Heading__heading", "variant-display": "mds-Heading__variant-display", "variant-title": "mds-Heading__variant-title", "variant-subtitle": "mds-Heading__variant-subtitle", "tone-primary": "mds-Heading__tone-primary", "tone-secondary": "mds-Heading__tone-secondary", "tone-inverse": "mds-Heading__tone-inverse", "tone-accent": "mds-Heading__tone-accent", "tone-on-media": "mds-Heading__tone-on-media" };
|
|
84
54
|
|
|
85
55
|
// src/components/Heading/Heading.tsx
|
|
86
56
|
var LEVEL_VARIANT = {
|
|
@@ -98,19 +68,17 @@ function Heading({
|
|
|
98
68
|
}) {
|
|
99
69
|
return react.createElement(`h${level}`, {
|
|
100
70
|
className: cx(
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
71
|
+
Heading_module_default.heading,
|
|
72
|
+
Heading_module_default[`variant-${variant ?? LEVEL_VARIANT[level]}`],
|
|
73
|
+
Heading_module_default[`tone-${tone}`],
|
|
104
74
|
className
|
|
105
75
|
),
|
|
106
76
|
...rest
|
|
107
77
|
});
|
|
108
78
|
}
|
|
109
79
|
|
|
110
|
-
// src/components/Spinner/Spinner.module.css
|
|
111
|
-
var
|
|
112
|
-
spinner: "Spinner_spinner"
|
|
113
|
-
};
|
|
80
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/Spinner/Spinner.module.css?mds-scoped
|
|
81
|
+
var Spinner_module_default = { "spinner": "mds-Spinner__spinner"};
|
|
114
82
|
function Spinner({
|
|
115
83
|
size = 20,
|
|
116
84
|
label = "Loading",
|
|
@@ -127,20 +95,15 @@ function Spinner({
|
|
|
127
95
|
{
|
|
128
96
|
role: "status",
|
|
129
97
|
"aria-label": label,
|
|
130
|
-
className: cx(
|
|
98
|
+
className: cx(Spinner_module_default.spinner, className),
|
|
131
99
|
style: { ...vars, ...style },
|
|
132
100
|
...rest
|
|
133
101
|
}
|
|
134
102
|
);
|
|
135
103
|
}
|
|
136
104
|
|
|
137
|
-
// src/components/Icon/Icon.module.css
|
|
138
|
-
var
|
|
139
|
-
icon: "Icon_icon",
|
|
140
|
-
"size-sm": "Icon_size-sm",
|
|
141
|
-
"size-md": "Icon_size-md",
|
|
142
|
-
"size-lg": "Icon_size-lg"
|
|
143
|
-
};
|
|
105
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/Icon/Icon.module.css?mds-scoped
|
|
106
|
+
var Icon_module_default = { "icon": "mds-Icon__icon", "size-sm": "mds-Icon__size-sm", "size-md": "mds-Icon__size-md", "size-lg": "mds-Icon__size-lg" };
|
|
144
107
|
var IconContext = react.createContext(null);
|
|
145
108
|
function IconProvider({ render, children }) {
|
|
146
109
|
return /* @__PURE__ */ jsxRuntime.jsx(IconContext.Provider, { value: render, children });
|
|
@@ -158,7 +121,7 @@ function Icon({ name, size = "md", label, className, ...rest }) {
|
|
|
158
121
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
159
122
|
"span",
|
|
160
123
|
{
|
|
161
|
-
className: cx(
|
|
124
|
+
className: cx(Icon_module_default.icon, Icon_module_default[`size-${size}`], className),
|
|
162
125
|
...label ? { role: "img", "aria-label": label } : { "aria-hidden": true },
|
|
163
126
|
...rest,
|
|
164
127
|
children: render?.(name, { size: SIZE_PX[size] })
|
|
@@ -166,20 +129,8 @@ function Icon({ name, size = "md", label, className, ...rest }) {
|
|
|
166
129
|
);
|
|
167
130
|
}
|
|
168
131
|
|
|
169
|
-
// src/components/Button/Button.module.css
|
|
170
|
-
var
|
|
171
|
-
button: "Button_button",
|
|
172
|
-
"size-sm": "Button_size-sm",
|
|
173
|
-
"size-md": "Button_size-md",
|
|
174
|
-
"size-lg": "Button_size-lg",
|
|
175
|
-
"variant-primary": "Button_variant-primary",
|
|
176
|
-
"variant-secondary": "Button_variant-secondary",
|
|
177
|
-
"variant-ghost": "Button_variant-ghost",
|
|
178
|
-
"variant-highlight": "Button_variant-highlight",
|
|
179
|
-
"variant-danger": "Button_variant-danger",
|
|
180
|
-
fullWidth: "Button_fullWidth",
|
|
181
|
-
"icon-only": "Button_icon-only"
|
|
182
|
-
};
|
|
132
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/Button/Button.module.css?mds-scoped
|
|
133
|
+
var Button_module_default = { "button": "mds-Button__button", "size-sm": "mds-Button__size-sm", "size-md": "mds-Button__size-md", "size-lg": "mds-Button__size-lg", "variant-primary": "mds-Button__variant-primary", "variant-secondary": "mds-Button__variant-secondary", "variant-ghost": "mds-Button__variant-ghost", "variant-highlight": "mds-Button__variant-highlight", "variant-danger": "mds-Button__variant-danger", "variant-warning": "mds-Button__variant-warning", "fullWidth": "mds-Button__fullWidth", "icon-only": "mds-Button__icon-only" };
|
|
183
134
|
var SPINNER_PX = { sm: 16, md: 18, lg: 20 };
|
|
184
135
|
function Button({
|
|
185
136
|
variant = "primary",
|
|
@@ -204,11 +155,11 @@ function Button({
|
|
|
204
155
|
Element,
|
|
205
156
|
{
|
|
206
157
|
className: cx(
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
fullWidth &&
|
|
211
|
-
iconOnly &&
|
|
158
|
+
Button_module_default.button,
|
|
159
|
+
Button_module_default[`variant-${variant}`],
|
|
160
|
+
Button_module_default[`size-${size}`],
|
|
161
|
+
fullWidth && Button_module_default.fullWidth,
|
|
162
|
+
iconOnly && Button_module_default["icon-only"],
|
|
212
163
|
className
|
|
213
164
|
),
|
|
214
165
|
"aria-busy": loading || void 0,
|
|
@@ -223,60 +174,37 @@ function Button({
|
|
|
223
174
|
);
|
|
224
175
|
}
|
|
225
176
|
|
|
226
|
-
// src/components/Link/Link.module.css
|
|
227
|
-
var
|
|
228
|
-
link: "Link_link",
|
|
229
|
-
"variant-inline": "Link_variant-inline",
|
|
230
|
-
"variant-standalone": "Link_variant-standalone",
|
|
231
|
-
"variant-plain": "Link_variant-plain",
|
|
232
|
-
"size-xs": "Link_size-xs",
|
|
233
|
-
"size-sm": "Link_size-sm",
|
|
234
|
-
"size-base": "Link_size-base",
|
|
235
|
-
"size-lg": "Link_size-lg",
|
|
236
|
-
"size-xl": "Link_size-xl"
|
|
237
|
-
};
|
|
177
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/Link/Link.module.css?mds-scoped
|
|
178
|
+
var Link_module_default = { "link": "mds-Link__link", "variant-inline": "mds-Link__variant-inline", "variant-standalone": "mds-Link__variant-standalone", "variant-plain": "mds-Link__variant-plain", "size-xs": "mds-Link__size-xs", "size-sm": "mds-Link__size-sm", "size-base": "mds-Link__size-base", "size-lg": "mds-Link__size-lg", "size-xl": "mds-Link__size-xl" };
|
|
238
179
|
function Link({
|
|
239
180
|
variant = "inline",
|
|
240
181
|
size,
|
|
241
182
|
external = false,
|
|
242
|
-
as
|
|
243
|
-
className,
|
|
183
|
+
as,
|
|
244
184
|
...rest
|
|
245
185
|
}) {
|
|
186
|
+
const Element = as ?? "a";
|
|
187
|
+
const { className, type, ...others } = rest;
|
|
246
188
|
const externalProps = external ? { target: "_blank", rel: "noopener noreferrer" } : {};
|
|
247
|
-
const typeProps = Element === "button" ? { type:
|
|
189
|
+
const typeProps = Element === "button" ? { type: type ?? "button" } : type !== void 0 ? { type } : {};
|
|
248
190
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
249
191
|
Element,
|
|
250
192
|
{
|
|
251
193
|
className: cx(
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
size &&
|
|
194
|
+
Link_module_default.link,
|
|
195
|
+
Link_module_default[`variant-${variant}`],
|
|
196
|
+
size && Link_module_default[`size-${size}`],
|
|
255
197
|
className
|
|
256
198
|
),
|
|
257
199
|
...externalProps,
|
|
258
|
-
...
|
|
200
|
+
...others,
|
|
259
201
|
...typeProps
|
|
260
202
|
}
|
|
261
203
|
);
|
|
262
204
|
}
|
|
263
205
|
|
|
264
|
-
// src/components/Avatar/Avatar.module.css
|
|
265
|
-
var
|
|
266
|
-
avatar: "Avatar_avatar",
|
|
267
|
-
"size-xs": "Avatar_size-xs",
|
|
268
|
-
"size-sm": "Avatar_size-sm",
|
|
269
|
-
"size-md": "Avatar_size-md",
|
|
270
|
-
"size-lg": "Avatar_size-lg",
|
|
271
|
-
"size-xl": "Avatar_size-xl",
|
|
272
|
-
"tone-1": "Avatar_tone-1",
|
|
273
|
-
"tone-2": "Avatar_tone-2",
|
|
274
|
-
"tone-3": "Avatar_tone-3",
|
|
275
|
-
"tone-4": "Avatar_tone-4",
|
|
276
|
-
"tone-5": "Avatar_tone-5",
|
|
277
|
-
image: "Avatar_image",
|
|
278
|
-
initials: "Avatar_initials"
|
|
279
|
-
};
|
|
206
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/Avatar/Avatar.module.css?mds-scoped
|
|
207
|
+
var Avatar_module_default = { "avatar": "mds-Avatar__avatar", "size-xs": "mds-Avatar__size-xs", "size-sm": "mds-Avatar__size-sm", "size-md": "mds-Avatar__size-md", "size-lg": "mds-Avatar__size-lg", "size-xl": "mds-Avatar__size-xl", "tone-1": "mds-Avatar__tone-1", "tone-2": "mds-Avatar__tone-2", "tone-3": "mds-Avatar__tone-3", "tone-4": "mds-Avatar__tone-4", "tone-5": "mds-Avatar__tone-5", "image": "mds-Avatar__image", "initials": "mds-Avatar__initials" };
|
|
280
208
|
function initials(name) {
|
|
281
209
|
const words = name.trim().split(/\s+/).filter(Boolean);
|
|
282
210
|
const first = words[0]?.[0] ?? "";
|
|
@@ -296,19 +224,19 @@ function Avatar({
|
|
|
296
224
|
"span",
|
|
297
225
|
{
|
|
298
226
|
className: cx(
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
tone !== void 0 &&
|
|
227
|
+
Avatar_module_default.avatar,
|
|
228
|
+
Avatar_module_default[`size-${size}`],
|
|
229
|
+
tone !== void 0 && Avatar_module_default[`tone-${tone}`],
|
|
302
230
|
className
|
|
303
231
|
),
|
|
304
232
|
"aria-hidden": decorative || void 0,
|
|
305
233
|
...rest,
|
|
306
|
-
children: src ? /* @__PURE__ */ jsxRuntime.jsx("img", { className:
|
|
234
|
+
children: src ? /* @__PURE__ */ jsxRuntime.jsx("img", { className: Avatar_module_default.image, src, alt: decorative ? "" : name }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
307
235
|
"span",
|
|
308
236
|
{
|
|
309
237
|
role: decorative ? void 0 : "img",
|
|
310
238
|
"aria-label": decorative ? void 0 : name,
|
|
311
|
-
className:
|
|
239
|
+
className: Avatar_module_default.initials,
|
|
312
240
|
children: initials(name)
|
|
313
241
|
}
|
|
314
242
|
)
|
|
@@ -316,15 +244,8 @@ function Avatar({
|
|
|
316
244
|
);
|
|
317
245
|
}
|
|
318
246
|
|
|
319
|
-
// src/components/AvatarGroup/AvatarGroup.module.css
|
|
320
|
-
var
|
|
321
|
-
group: "AvatarGroup_group",
|
|
322
|
-
item: "AvatarGroup_item",
|
|
323
|
-
overflow: "AvatarGroup_overflow",
|
|
324
|
-
"size-sm": "AvatarGroup_size-sm",
|
|
325
|
-
"size-md": "AvatarGroup_size-md",
|
|
326
|
-
"size-lg": "AvatarGroup_size-lg"
|
|
327
|
-
};
|
|
247
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/AvatarGroup/AvatarGroup.module.css?mds-scoped
|
|
248
|
+
var AvatarGroup_module_default = { "group": "mds-AvatarGroup__group", "item": "mds-AvatarGroup__item", "overflow": "mds-AvatarGroup__overflow", "size-xs": "mds-AvatarGroup__size-xs", "size-sm": "mds-AvatarGroup__size-sm", "size-md": "mds-AvatarGroup__size-md", "size-lg": "mds-AvatarGroup__size-lg", "size-xl": "mds-AvatarGroup__size-xl" };
|
|
328
249
|
function AvatarGroup({
|
|
329
250
|
children,
|
|
330
251
|
max = 4,
|
|
@@ -335,12 +256,12 @@ function AvatarGroup({
|
|
|
335
256
|
const all = react.Children.toArray(children);
|
|
336
257
|
const visible = all.slice(0, max);
|
|
337
258
|
const hidden = all.length - visible.length;
|
|
338
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx(
|
|
339
|
-
visible.map((child, i) => /* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
259
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx(AvatarGroup_module_default.group, className), ...rest, children: [
|
|
260
|
+
visible.map((child, i) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: AvatarGroup_module_default.item, children: child }, i)),
|
|
340
261
|
hidden > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
341
262
|
"span",
|
|
342
263
|
{
|
|
343
|
-
className: cx(
|
|
264
|
+
className: cx(AvatarGroup_module_default.item, AvatarGroup_module_default.overflow, AvatarGroup_module_default[`size-${size}`]),
|
|
344
265
|
"aria-label": `${hidden} more`,
|
|
345
266
|
children: [
|
|
346
267
|
"+",
|
|
@@ -351,30 +272,14 @@ function AvatarGroup({
|
|
|
351
272
|
] });
|
|
352
273
|
}
|
|
353
274
|
|
|
354
|
-
// src/components/Badge/Badge.module.css
|
|
355
|
-
var
|
|
356
|
-
badge: "Badge_badge",
|
|
357
|
-
"tone-neutral": "Badge_tone-neutral",
|
|
358
|
-
"tone-accent": "Badge_tone-accent",
|
|
359
|
-
"tone-highlight": "Badge_tone-highlight",
|
|
360
|
-
"tone-danger": "Badge_tone-danger",
|
|
361
|
-
"tone-warning": "Badge_tone-warning",
|
|
362
|
-
"tone-success": "Badge_tone-success"
|
|
363
|
-
};
|
|
275
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/Badge/Badge.module.css?mds-scoped
|
|
276
|
+
var Badge_module_default = { "badge": "mds-Badge__badge", "tone-neutral": "mds-Badge__tone-neutral", "tone-accent": "mds-Badge__tone-accent", "tone-highlight": "mds-Badge__tone-highlight", "tone-danger": "mds-Badge__tone-danger", "tone-warning": "mds-Badge__tone-warning", "tone-success": "mds-Badge__tone-success" };
|
|
364
277
|
function Badge({ tone = "neutral", className, ...rest }) {
|
|
365
|
-
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: cx(
|
|
278
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: cx(Badge_module_default.badge, Badge_module_default[`tone-${tone}`], className), ...rest });
|
|
366
279
|
}
|
|
367
280
|
|
|
368
|
-
// src/components/Chip/Chip.module.css
|
|
369
|
-
var
|
|
370
|
-
chip: "Chip_chip",
|
|
371
|
-
"variant-soft": "Chip_variant-soft",
|
|
372
|
-
"variant-outline": "Chip_variant-outline",
|
|
373
|
-
"variant-highlight": "Chip_variant-highlight",
|
|
374
|
-
selected: "Chip_selected",
|
|
375
|
-
interactive: "Chip_interactive",
|
|
376
|
-
disabled: "Chip_disabled"
|
|
377
|
-
};
|
|
281
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/Chip/Chip.module.css?mds-scoped
|
|
282
|
+
var Chip_module_default = { "chip": "mds-Chip__chip", "variant-soft": "mds-Chip__variant-soft", "variant-outline": "mds-Chip__variant-outline", "variant-highlight": "mds-Chip__variant-highlight", "selected": "mds-Chip__selected", "interactive": "mds-Chip__interactive", "disabled": "mds-Chip__disabled" };
|
|
378
283
|
function Chip({
|
|
379
284
|
children,
|
|
380
285
|
variant = "soft",
|
|
@@ -388,11 +293,11 @@ function Chip({
|
|
|
388
293
|
const interactive = typeof onClick === "function";
|
|
389
294
|
const shared = {
|
|
390
295
|
className: cx(
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
selected &&
|
|
394
|
-
interactive && !disabled &&
|
|
395
|
-
disabled &&
|
|
296
|
+
Chip_module_default.chip,
|
|
297
|
+
Chip_module_default[`variant-${variant}`],
|
|
298
|
+
selected && Chip_module_default.selected,
|
|
299
|
+
interactive && !disabled && Chip_module_default.interactive,
|
|
300
|
+
disabled && Chip_module_default.disabled,
|
|
396
301
|
className
|
|
397
302
|
),
|
|
398
303
|
...rest
|
|
@@ -414,27 +319,14 @@ function Chip({
|
|
|
414
319
|
) : /* @__PURE__ */ jsxRuntime.jsx("span", { ...shared, children: content });
|
|
415
320
|
}
|
|
416
321
|
|
|
417
|
-
// src/components/Chip/ChipGroup.module.css
|
|
418
|
-
var
|
|
419
|
-
group: "ChipGroup_group",
|
|
420
|
-
"gap-hairline": "ChipGroup_gap-hairline",
|
|
421
|
-
"gap-tight": "ChipGroup_gap-tight",
|
|
422
|
-
"gap-base": "ChipGroup_gap-base"
|
|
423
|
-
};
|
|
322
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/Chip/ChipGroup.module.css?mds-scoped
|
|
323
|
+
var ChipGroup_module_default = { "group": "mds-ChipGroup__group", "gap-hairline": "mds-ChipGroup__gap-hairline", "gap-tight": "mds-ChipGroup__gap-tight", "gap-base": "mds-ChipGroup__gap-base" };
|
|
424
324
|
function ChipGroup({ children, gap = "tight", className, ...rest }) {
|
|
425
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx(
|
|
325
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx(ChipGroup_module_default.group, ChipGroup_module_default[`gap-${gap}`], className), ...rest, children });
|
|
426
326
|
}
|
|
427
327
|
|
|
428
|
-
// src/components/Chip/ChipBar.module.css
|
|
429
|
-
var
|
|
430
|
-
bar: "ChipBar_bar",
|
|
431
|
-
"gap-hairline": "ChipBar_gap-hairline",
|
|
432
|
-
"gap-tight": "ChipBar_gap-tight",
|
|
433
|
-
"gap-base": "ChipBar_gap-base",
|
|
434
|
-
bordered: "ChipBar_bordered",
|
|
435
|
-
fade: "ChipBar_fade",
|
|
436
|
-
item: "ChipBar_item"
|
|
437
|
-
};
|
|
328
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/Chip/ChipBar.module.css?mds-scoped
|
|
329
|
+
var ChipBar_module_default = { "bar": "mds-ChipBar__bar", "gap-hairline": "mds-ChipBar__gap-hairline", "gap-tight": "mds-ChipBar__gap-tight", "gap-base": "mds-ChipBar__gap-base", "bordered": "mds-ChipBar__bordered", "fade": "mds-ChipBar__fade", "item": "mds-ChipBar__item" };
|
|
438
330
|
function ChipBar({
|
|
439
331
|
children,
|
|
440
332
|
gap = "tight",
|
|
@@ -446,20 +338,15 @@ function ChipBar({
|
|
|
446
338
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
447
339
|
"div",
|
|
448
340
|
{
|
|
449
|
-
className: cx(
|
|
341
|
+
className: cx(ChipBar_module_default.bar, ChipBar_module_default[`gap-${gap}`], bordered && ChipBar_module_default.bordered, fade && ChipBar_module_default.fade, className),
|
|
450
342
|
...rest,
|
|
451
|
-
children: react.Children.map(children, (child) => /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
343
|
+
children: react.Children.map(children, (child) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: ChipBar_module_default.item, children: child }))
|
|
452
344
|
}
|
|
453
345
|
);
|
|
454
346
|
}
|
|
455
347
|
|
|
456
|
-
// src/components/CountButton/CountButton.module.css
|
|
457
|
-
var
|
|
458
|
-
button: "CountButton_button",
|
|
459
|
-
"tone-accent": "CountButton_tone-accent",
|
|
460
|
-
"tone-danger": "CountButton_tone-danger",
|
|
461
|
-
glyph: "CountButton_glyph"
|
|
462
|
-
};
|
|
348
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/CountButton/CountButton.module.css?mds-scoped
|
|
349
|
+
var CountButton_module_default = { "button": "mds-CountButton__button", "tone-accent": "mds-CountButton__tone-accent", "tone-danger": "mds-CountButton__tone-danger", "glyph": "mds-CountButton__glyph" };
|
|
463
350
|
var SPINNER_PX2 = 20;
|
|
464
351
|
function CountButton({
|
|
465
352
|
icon,
|
|
@@ -481,24 +368,18 @@ function CountButton({
|
|
|
481
368
|
"aria-label": label,
|
|
482
369
|
"aria-pressed": isToggle ? active : void 0,
|
|
483
370
|
"aria-busy": loading || void 0,
|
|
484
|
-
className: cx(
|
|
371
|
+
className: cx(CountButton_module_default.button, active && CountButton_module_default[`tone-${tone}`], className),
|
|
485
372
|
...rest,
|
|
486
373
|
children: [
|
|
487
|
-
loading ? /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: SPINNER_PX2, label: "", "aria-hidden": "true" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
374
|
+
loading ? /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: SPINNER_PX2, label: "", "aria-hidden": "true" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: CountButton_module_default.glyph, children: icon }),
|
|
488
375
|
children != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { children }) : null
|
|
489
376
|
]
|
|
490
377
|
}
|
|
491
378
|
);
|
|
492
379
|
}
|
|
493
380
|
|
|
494
|
-
// src/components/Field/Field.module.css
|
|
495
|
-
var
|
|
496
|
-
field: "Field_field",
|
|
497
|
-
label: "Field_label",
|
|
498
|
-
required: "Field_required",
|
|
499
|
-
message: "Field_message",
|
|
500
|
-
error: "Field_error"
|
|
501
|
-
};
|
|
381
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/Field/Field.module.css?mds-scoped
|
|
382
|
+
var Field_module_default = { "field": "mds-Field__field", "label": "mds-Field__label", "required": "mds-Field__required", "message": "mds-Field__message", "error": "mds-Field__error" };
|
|
502
383
|
var FieldContext = react.createContext(null);
|
|
503
384
|
function useFieldContext() {
|
|
504
385
|
return react.useContext(FieldContext);
|
|
@@ -507,10 +388,10 @@ function Field({ label, children, hint, error, required = false, className }) {
|
|
|
507
388
|
const id = react.useId();
|
|
508
389
|
const messageId = `${id}-message`;
|
|
509
390
|
const message = error ?? hint;
|
|
510
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx(
|
|
511
|
-
/* @__PURE__ */ jsxRuntime.jsxs("label", { className:
|
|
391
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx(Field_module_default.field, className), children: [
|
|
392
|
+
/* @__PURE__ */ jsxRuntime.jsxs("label", { className: Field_module_default.label, htmlFor: id, children: [
|
|
512
393
|
label,
|
|
513
|
-
required && /* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
394
|
+
required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: Field_module_default.required, "aria-hidden": "true", children: "*" })
|
|
514
395
|
] }),
|
|
515
396
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
516
397
|
FieldContext.Provider,
|
|
@@ -519,34 +400,27 @@ function Field({ label, children, hint, error, required = false, className }) {
|
|
|
519
400
|
children
|
|
520
401
|
}
|
|
521
402
|
),
|
|
522
|
-
message && /* @__PURE__ */ jsxRuntime.jsx("span", { id: messageId, className: cx(
|
|
403
|
+
message && /* @__PURE__ */ jsxRuntime.jsx("span", { id: messageId, className: cx(Field_module_default.message, error !== void 0 && Field_module_default.error), children: message })
|
|
523
404
|
] });
|
|
524
405
|
}
|
|
525
406
|
|
|
526
|
-
// src/components/Select/Select.module.css
|
|
527
|
-
var
|
|
528
|
-
wrap: "Select_wrap",
|
|
529
|
-
select: "Select_select",
|
|
530
|
-
"size-sm": "Select_size-sm",
|
|
531
|
-
"size-md": "Select_size-md",
|
|
532
|
-
"size-lg": "Select_size-lg",
|
|
533
|
-
chevron: "Select_chevron"
|
|
534
|
-
};
|
|
407
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/Select/Select.module.css?mds-scoped
|
|
408
|
+
var Select_module_default = { "wrap": "mds-Select__wrap", "select": "mds-Select__select", "size-sm": "mds-Select__size-sm", "size-md": "mds-Select__size-md", "size-lg": "mds-Select__size-lg", "chevron": "mds-Select__chevron" };
|
|
535
409
|
function Select({ size = "md", className, children, ...rest }) {
|
|
536
410
|
const field = useFieldContext();
|
|
537
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className:
|
|
411
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: Select_module_default.wrap, children: [
|
|
538
412
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
539
413
|
"select",
|
|
540
414
|
{
|
|
541
415
|
id: rest.id ?? field?.id,
|
|
542
416
|
"aria-describedby": rest["aria-describedby"] ?? field?.describedBy,
|
|
543
417
|
"aria-invalid": rest["aria-invalid"] ?? (field?.invalid || void 0),
|
|
544
|
-
className: cx(
|
|
418
|
+
className: cx(Select_module_default.select, Select_module_default[`size-${size}`], className),
|
|
545
419
|
...rest,
|
|
546
420
|
children
|
|
547
421
|
}
|
|
548
422
|
),
|
|
549
|
-
/* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className:
|
|
423
|
+
/* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className: Select_module_default.chevron, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4 6l4 4 4-4", fill: "none", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
550
424
|
] });
|
|
551
425
|
}
|
|
552
426
|
var OverlayHistoryContext = react.createContext(null);
|
|
@@ -616,14 +490,10 @@ function usePresence(open, durationMs) {
|
|
|
616
490
|
return { mounted: open || mounted, visible: open };
|
|
617
491
|
}
|
|
618
492
|
|
|
619
|
-
// src/components/Overlay/Overlay.module.css
|
|
620
|
-
var
|
|
621
|
-
scrim: "Overlay_scrim",
|
|
622
|
-
"variant-modal": "Overlay_variant-modal",
|
|
623
|
-
"variant-sheet": "Overlay_variant-sheet"
|
|
624
|
-
};
|
|
493
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/Overlay/Overlay.module.css?mds-scoped
|
|
494
|
+
var Overlay_module_default = { "scrim": "mds-Overlay__scrim", "variant-modal": "mds-Overlay__variant-modal", "variant-sheet": "mds-Overlay__variant-sheet" };
|
|
625
495
|
var OVERLAY_EXIT_MS = 200;
|
|
626
|
-
function Overlay({ open, onClose, label, variant, closeOnScrimClick, panelClassName, children }) {
|
|
496
|
+
function Overlay({ open, onClose, label, variant, role = "dialog", closeOnScrimClick, panelClassName, children }) {
|
|
627
497
|
const { mounted, visible } = usePresence(open, OVERLAY_EXIT_MS);
|
|
628
498
|
const ref = useOverlay({ open, onClose });
|
|
629
499
|
if (!mounted) return null;
|
|
@@ -631,7 +501,7 @@ function Overlay({ open, onClose, label, variant, closeOnScrimClick, panelClassN
|
|
|
631
501
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
632
502
|
"div",
|
|
633
503
|
{
|
|
634
|
-
className: cx(
|
|
504
|
+
className: cx(Overlay_module_default.scrim, Overlay_module_default[`variant-${variant}`]),
|
|
635
505
|
"data-open": visible || void 0,
|
|
636
506
|
"data-testid": "mds-scrim",
|
|
637
507
|
onClick: closeOnScrimClick ? onClose : void 0,
|
|
@@ -639,7 +509,7 @@ function Overlay({ open, onClose, label, variant, closeOnScrimClick, panelClassN
|
|
|
639
509
|
"div",
|
|
640
510
|
{
|
|
641
511
|
ref,
|
|
642
|
-
role
|
|
512
|
+
role,
|
|
643
513
|
"aria-modal": "true",
|
|
644
514
|
"aria-label": label,
|
|
645
515
|
tabIndex: -1,
|
|
@@ -655,13 +525,8 @@ function Overlay({ open, onClose, label, variant, closeOnScrimClick, panelClassN
|
|
|
655
525
|
);
|
|
656
526
|
}
|
|
657
527
|
|
|
658
|
-
// src/components/Sheet/Sheet.module.css
|
|
659
|
-
var
|
|
660
|
-
panel: "Sheet_panel",
|
|
661
|
-
header: "Sheet_header",
|
|
662
|
-
body: "Sheet_body",
|
|
663
|
-
footer: "Sheet_footer"
|
|
664
|
-
};
|
|
528
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/Sheet/Sheet.module.css?mds-scoped
|
|
529
|
+
var Sheet_module_default = { "panel": "mds-Sheet__panel", "header": "mds-Sheet__header", "body": "mds-Sheet__body", "footer": "mds-Sheet__footer", "headerTitle": "mds-Sheet__headerTitle", "close": "mds-Sheet__close", "closeGlyph": "mds-Sheet__closeGlyph" };
|
|
665
530
|
function Sheet({ open, onClose, label, closeOnScrimClick = true, children }) {
|
|
666
531
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
667
532
|
Overlay,
|
|
@@ -671,41 +536,26 @@ function Sheet({ open, onClose, label, closeOnScrimClick = true, children }) {
|
|
|
671
536
|
label,
|
|
672
537
|
variant: "sheet",
|
|
673
538
|
closeOnScrimClick,
|
|
674
|
-
panelClassName:
|
|
539
|
+
panelClassName: Sheet_module_default.panel,
|
|
675
540
|
children
|
|
676
541
|
}
|
|
677
542
|
);
|
|
678
543
|
}
|
|
679
|
-
function SheetHeader({ children }) {
|
|
680
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
544
|
+
function SheetHeader({ children, onClose, closeLabel }) {
|
|
545
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: Sheet_module_default.header, children: [
|
|
546
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: Sheet_module_default.headerTitle, children }),
|
|
547
|
+
onClose !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", "aria-label": closeLabel, className: Sheet_module_default.close, onClick: onClose, children: /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className: Sheet_module_default.closeGlyph, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4 4l8 8M12 4l-8 8", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round" }) }) })
|
|
548
|
+
] });
|
|
681
549
|
}
|
|
682
550
|
function SheetBody({ children }) {
|
|
683
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
551
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: Sheet_module_default.body, children });
|
|
684
552
|
}
|
|
685
553
|
function SheetFooter({ children }) {
|
|
686
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
554
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: Sheet_module_default.footer, children });
|
|
687
555
|
}
|
|
688
556
|
|
|
689
|
-
// src/components/DateTimePicker/DateTimePicker.module.css
|
|
690
|
-
var
|
|
691
|
-
trigger: "DateTimePicker_trigger",
|
|
692
|
-
hasValue: "DateTimePicker_hasValue",
|
|
693
|
-
triggerLabel: "DateTimePicker_triggerLabel",
|
|
694
|
-
glyph: "DateTimePicker_glyph",
|
|
695
|
-
timeRow: "DateTimePicker_timeRow",
|
|
696
|
-
grow: "DateTimePicker_grow",
|
|
697
|
-
meridiem: "DateTimePicker_meridiem",
|
|
698
|
-
colon: "DateTimePicker_colon",
|
|
699
|
-
calendarHeader: "DateTimePicker_calendarHeader",
|
|
700
|
-
monthLabel: "DateTimePicker_monthLabel",
|
|
701
|
-
weekdays: "DateTimePicker_weekdays",
|
|
702
|
-
weekday: "DateTimePicker_weekday",
|
|
703
|
-
grid: "DateTimePicker_grid",
|
|
704
|
-
day: "DateTimePicker_day",
|
|
705
|
-
today: "DateTimePicker_today",
|
|
706
|
-
selected: "DateTimePicker_selected",
|
|
707
|
-
outside: "DateTimePicker_outside"
|
|
708
|
-
};
|
|
557
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/DateTimePicker/DateTimePicker.module.css?mds-scoped
|
|
558
|
+
var DateTimePicker_module_default = { "trigger": "mds-DateTimePicker__trigger", "hasValue": "mds-DateTimePicker__hasValue", "triggerLabel": "mds-DateTimePicker__triggerLabel", "glyph": "mds-DateTimePicker__glyph", "timeRow": "mds-DateTimePicker__timeRow", "grow": "mds-DateTimePicker__grow", "meridiem": "mds-DateTimePicker__meridiem", "colon": "mds-DateTimePicker__colon", "calendarHeader": "mds-DateTimePicker__calendarHeader", "monthLabel": "mds-DateTimePicker__monthLabel", "weekdays": "mds-DateTimePicker__weekdays", "weekday": "mds-DateTimePicker__weekday", "grid": "mds-DateTimePicker__grid", "day": "mds-DateTimePicker__day", "today": "mds-DateTimePicker__today", "selected": "mds-DateTimePicker__selected", "outside": "mds-DateTimePicker__outside" };
|
|
709
559
|
var DEFAULT_LABELS = {
|
|
710
560
|
dialog: "Pick date and time",
|
|
711
561
|
previousMonth: "Previous month",
|
|
@@ -771,13 +621,13 @@ function minuteOptions(step) {
|
|
|
771
621
|
function pad2(n) {
|
|
772
622
|
return String(n).padStart(2, "0");
|
|
773
623
|
}
|
|
774
|
-
var chevronLeft = /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className:
|
|
775
|
-
var chevronRight = /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className:
|
|
776
|
-
var calendarGlyph = /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className:
|
|
624
|
+
var chevronLeft = /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className: DateTimePicker_module_default.glyph, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10 3l-5 5 5 5", fill: "none", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
625
|
+
var chevronRight = /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className: DateTimePicker_module_default.glyph, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6 3l5 5-5 5", fill: "none", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
626
|
+
var calendarGlyph = /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className: DateTimePicker_module_default.glyph, children: [
|
|
777
627
|
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "2.5", y: "3.5", width: "11", height: "10", rx: "1.5", fill: "none", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
778
628
|
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M2.5 6.5h11M5.5 2v2.5M10.5 2v2.5", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
|
|
779
629
|
] });
|
|
780
|
-
var clockGlyph = /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className:
|
|
630
|
+
var clockGlyph = /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className: DateTimePicker_module_default.glyph, children: [
|
|
781
631
|
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "8", cy: "8", r: "5.75", fill: "none", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
782
632
|
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8 5v3.25l2 1.5", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
783
633
|
] });
|
|
@@ -794,6 +644,7 @@ function DateTimePicker({
|
|
|
794
644
|
labels
|
|
795
645
|
}) {
|
|
796
646
|
const text = { ...DEFAULT_LABELS, ...labels };
|
|
647
|
+
const field = useFieldContext();
|
|
797
648
|
const intl = react.useMemo(() => localeData(locale), [locale]);
|
|
798
649
|
const [open, setOpen] = react.useState(false);
|
|
799
650
|
const [draft, setDraft] = react.useState(() => /* @__PURE__ */ new Date());
|
|
@@ -949,7 +800,7 @@ function DateTimePicker({
|
|
|
949
800
|
"aria-pressed": isSelected,
|
|
950
801
|
onClick: inMonth ? () => pickDay(cell.getDate()) : void 0,
|
|
951
802
|
onKeyDown: inMonth && !isDisabled ? (e) => onDayKeyDown(e, cell) : void 0,
|
|
952
|
-
className: cx(
|
|
803
|
+
className: cx(DateTimePicker_module_default.day, isToday && DateTimePicker_module_default.today, isSelected && DateTimePicker_module_default.selected, !inMonth && DateTimePicker_module_default.outside),
|
|
953
804
|
children: cell.getDate()
|
|
954
805
|
},
|
|
955
806
|
`c-${i}`
|
|
@@ -959,41 +810,42 @@ function DateTimePicker({
|
|
|
959
810
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
960
811
|
"button",
|
|
961
812
|
{
|
|
962
|
-
id,
|
|
813
|
+
id: id ?? field?.id,
|
|
963
814
|
type: "button",
|
|
964
815
|
disabled,
|
|
816
|
+
"aria-describedby": field?.describedBy,
|
|
965
817
|
"aria-haspopup": "dialog",
|
|
966
818
|
"aria-expanded": open,
|
|
967
819
|
"aria-label": ariaLabel ? `${ariaLabel}: ${value ? intl.full.format(new Date(value)) : placeholder}` : void 0,
|
|
968
820
|
onClick: openPicker,
|
|
969
|
-
className: cx(
|
|
821
|
+
className: cx(DateTimePicker_module_default.trigger, value && DateTimePicker_module_default.hasValue),
|
|
970
822
|
children: [
|
|
971
823
|
calendarGlyph,
|
|
972
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
824
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: DateTimePicker_module_default.triggerLabel, children: value ? intl.full.format(new Date(value)) : placeholder })
|
|
973
825
|
]
|
|
974
826
|
}
|
|
975
827
|
),
|
|
976
828
|
/* @__PURE__ */ jsxRuntime.jsxs(Sheet, { open, onClose: () => setOpen(false), label: ariaLabel ?? text.dialog, children: [
|
|
977
829
|
/* @__PURE__ */ jsxRuntime.jsx(SheetHeader, { children: intl.full.format(draft) }),
|
|
978
830
|
/* @__PURE__ */ jsxRuntime.jsxs(SheetBody, { children: [
|
|
979
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
831
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: DateTimePicker_module_default.timeRow, children: [
|
|
980
832
|
clockGlyph,
|
|
981
833
|
intl.hour12 ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
982
|
-
/* @__PURE__ */ jsxRuntime.jsx(Select, { "aria-label": text.hour, value: String(h12), onChange: (e) => setHour(e.target.value), className:
|
|
983
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
984
|
-
/* @__PURE__ */ jsxRuntime.jsx(Select, { "aria-label": text.minute, value: String(draft.getMinutes()), onChange: (e) => setMinute(e.target.value), className:
|
|
985
|
-
/* @__PURE__ */ jsxRuntime.jsxs(Select, { "aria-label": text.dayPeriod, value: isPM ? "pm" : "am", onChange: (e) => setMeridiem(e.target.value), className:
|
|
834
|
+
/* @__PURE__ */ jsxRuntime.jsx(Select, { "aria-label": text.hour, value: String(h12), onChange: (e) => setHour(e.target.value), className: DateTimePicker_module_default.grow, children: Array.from({ length: 12 }, (_, i) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: String(i + 1), children: i + 1 }, i + 1)) }),
|
|
835
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: DateTimePicker_module_default.colon, "aria-hidden": "true", children: ":" }),
|
|
836
|
+
/* @__PURE__ */ jsxRuntime.jsx(Select, { "aria-label": text.minute, value: String(draft.getMinutes()), onChange: (e) => setMinute(e.target.value), className: DateTimePicker_module_default.grow, children: minuteOptions(minuteStep).map((m) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: String(m), children: pad2(m) }, m)) }),
|
|
837
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Select, { "aria-label": text.dayPeriod, value: isPM ? "pm" : "am", onChange: (e) => setMeridiem(e.target.value), className: DateTimePicker_module_default.meridiem, children: [
|
|
986
838
|
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "am", children: intl.dayPeriods[0] }),
|
|
987
839
|
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "pm", children: intl.dayPeriods[1] })
|
|
988
840
|
] })
|
|
989
841
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
990
|
-
/* @__PURE__ */ jsxRuntime.jsx(Select, { "aria-label": text.hour, value: String(h24), onChange: (e) => setHour(e.target.value), className:
|
|
991
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
992
|
-
/* @__PURE__ */ jsxRuntime.jsx(Select, { "aria-label": text.minute, value: String(draft.getMinutes()), onChange: (e) => setMinute(e.target.value), className:
|
|
842
|
+
/* @__PURE__ */ jsxRuntime.jsx(Select, { "aria-label": text.hour, value: String(h24), onChange: (e) => setHour(e.target.value), className: DateTimePicker_module_default.grow, children: Array.from({ length: 24 }, (_, i) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: String(i), children: pad2(i) }, i)) }),
|
|
843
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: DateTimePicker_module_default.colon, "aria-hidden": "true", children: ":" }),
|
|
844
|
+
/* @__PURE__ */ jsxRuntime.jsx(Select, { "aria-label": text.minute, value: String(draft.getMinutes()), onChange: (e) => setMinute(e.target.value), className: DateTimePicker_module_default.grow, children: minuteOptions(minuteStep).map((m) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: String(m), children: pad2(m) }, m)) })
|
|
993
845
|
] })
|
|
994
846
|
] }),
|
|
995
847
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { role: "group", "aria-label": intl.monthTitle.format(first), children: [
|
|
996
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
848
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: DateTimePicker_module_default.calendarHeader, children: [
|
|
997
849
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
998
850
|
Button,
|
|
999
851
|
{
|
|
@@ -1006,11 +858,11 @@ function DateTimePicker({
|
|
|
1006
858
|
children: chevronLeft
|
|
1007
859
|
}
|
|
1008
860
|
),
|
|
1009
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
861
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: DateTimePicker_module_default.monthLabel, children: intl.monthTitle.format(first) }),
|
|
1010
862
|
/* @__PURE__ */ jsxRuntime.jsx(Button, { iconOnly: true, "aria-label": text.nextMonth, variant: "ghost", size: "sm", onClick: () => shiftMonth(1), children: chevronRight })
|
|
1011
863
|
] }),
|
|
1012
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
1013
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
864
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: DateTimePicker_module_default.weekdays, children: intl.weekdays.map((w, i) => /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", className: DateTimePicker_module_default.weekday, children: w }, `wd-${i}`)) }),
|
|
865
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: DateTimePicker_module_default.grid, children: dayCells })
|
|
1014
866
|
] })
|
|
1015
867
|
] }),
|
|
1016
868
|
/* @__PURE__ */ jsxRuntime.jsxs(SheetFooter, { children: [
|
|
@@ -1021,56 +873,41 @@ function DateTimePicker({
|
|
|
1021
873
|
] });
|
|
1022
874
|
}
|
|
1023
875
|
|
|
1024
|
-
// src/components/Tag/Tag.module.css
|
|
1025
|
-
var
|
|
1026
|
-
tag: "Tag_tag",
|
|
1027
|
-
"tone-accent": "Tag_tone-accent",
|
|
1028
|
-
remove: "Tag_remove",
|
|
1029
|
-
removeGlyph: "Tag_removeGlyph"
|
|
1030
|
-
};
|
|
876
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/Tag/Tag.module.css?mds-scoped
|
|
877
|
+
var Tag_module_default = { "tag": "mds-Tag__tag", "tone-accent": "mds-Tag__tone-accent", "remove": "mds-Tag__remove", "removeGlyph": "mds-Tag__removeGlyph" };
|
|
1031
878
|
function Tag({ children, tone = "neutral", onRemove, className, ...rest }) {
|
|
1032
879
|
const text = typeof children === "string" ? children : void 0;
|
|
1033
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: cx(
|
|
880
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: cx(Tag_module_default.tag, Tag_module_default[`tone-${tone}`], className), ...rest, children: [
|
|
1034
881
|
children,
|
|
1035
882
|
onRemove && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1036
883
|
"button",
|
|
1037
884
|
{
|
|
1038
885
|
type: "button",
|
|
1039
|
-
className:
|
|
886
|
+
className: Tag_module_default.remove,
|
|
1040
887
|
"aria-label": text ? `Remove ${text}` : "Remove",
|
|
1041
888
|
onClick: onRemove,
|
|
1042
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className:
|
|
889
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className: Tag_module_default.removeGlyph, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4 4l8 8M12 4l-8 8", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round" }) })
|
|
1043
890
|
}
|
|
1044
891
|
)
|
|
1045
892
|
] });
|
|
1046
893
|
}
|
|
1047
894
|
|
|
1048
|
-
// src/components/Divider/Divider.module.css
|
|
1049
|
-
var
|
|
1050
|
-
divider: "Divider_divider",
|
|
1051
|
-
horizontal: "Divider_horizontal",
|
|
1052
|
-
vertical: "Divider_vertical"
|
|
1053
|
-
};
|
|
895
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/Divider/Divider.module.css?mds-scoped
|
|
896
|
+
var Divider_module_default = { "divider": "mds-Divider__divider", "horizontal": "mds-Divider__horizontal", "vertical": "mds-Divider__vertical" };
|
|
1054
897
|
function Divider({ orientation = "horizontal", className, ...rest }) {
|
|
1055
898
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1056
899
|
"div",
|
|
1057
900
|
{
|
|
1058
901
|
role: "separator",
|
|
1059
902
|
"aria-orientation": orientation === "vertical" ? "vertical" : void 0,
|
|
1060
|
-
className: cx(
|
|
903
|
+
className: cx(Divider_module_default.divider, Divider_module_default[orientation], className),
|
|
1061
904
|
...rest
|
|
1062
905
|
}
|
|
1063
906
|
);
|
|
1064
907
|
}
|
|
1065
908
|
|
|
1066
|
-
// src/components/Skeleton/Skeleton.module.css
|
|
1067
|
-
var
|
|
1068
|
-
skeleton: "Skeleton_skeleton",
|
|
1069
|
-
pulse: "Skeleton_pulse",
|
|
1070
|
-
"variant-text": "Skeleton_variant-text",
|
|
1071
|
-
"variant-rect": "Skeleton_variant-rect",
|
|
1072
|
-
"variant-circle": "Skeleton_variant-circle"
|
|
1073
|
-
};
|
|
909
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/Skeleton/Skeleton.module.css?mds-scoped
|
|
910
|
+
var Skeleton_module_default = { "skeleton": "mds-Skeleton__skeleton", "pulse": "mds-Skeleton__pulse", "variant-text": "mds-Skeleton__variant-text", "variant-rect": "mds-Skeleton__variant-rect", "variant-circle": "mds-Skeleton__variant-circle" };
|
|
1074
911
|
function Skeleton({
|
|
1075
912
|
variant = "text",
|
|
1076
913
|
width,
|
|
@@ -1087,18 +924,15 @@ function Skeleton({
|
|
|
1087
924
|
"span",
|
|
1088
925
|
{
|
|
1089
926
|
"aria-hidden": "true",
|
|
1090
|
-
className: cx(
|
|
927
|
+
className: cx(Skeleton_module_default.skeleton, Skeleton_module_default[`variant-${variant}`], className),
|
|
1091
928
|
style: { ...vars, ...style },
|
|
1092
929
|
...rest
|
|
1093
930
|
}
|
|
1094
931
|
);
|
|
1095
932
|
}
|
|
1096
933
|
|
|
1097
|
-
// src/components/ProgressBar/ProgressBar.module.css
|
|
1098
|
-
var
|
|
1099
|
-
track: "ProgressBar_track",
|
|
1100
|
-
fill: "ProgressBar_fill",
|
|
1101
|
-
indeterminate: "ProgressBar_indeterminate"};
|
|
934
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/ProgressBar/ProgressBar.module.css?mds-scoped
|
|
935
|
+
var ProgressBar_module_default = { "track": "mds-ProgressBar__track", "fill": "mds-ProgressBar__fill", "indeterminate": "mds-ProgressBar__indeterminate"};
|
|
1102
936
|
function ProgressBar({
|
|
1103
937
|
value = 0,
|
|
1104
938
|
label,
|
|
@@ -1116,27 +950,16 @@ function ProgressBar({
|
|
|
1116
950
|
"aria-valuemin": 0,
|
|
1117
951
|
"aria-valuemax": 100,
|
|
1118
952
|
"aria-valuenow": indeterminate ? void 0 : clamped,
|
|
1119
|
-
className: cx(
|
|
953
|
+
className: cx(ProgressBar_module_default.track, indeterminate && ProgressBar_module_default.indeterminate, className),
|
|
1120
954
|
style: { ...{ "--progress": `${clamped}%` }, ...style },
|
|
1121
955
|
...rest,
|
|
1122
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
956
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: ProgressBar_module_default.fill })
|
|
1123
957
|
}
|
|
1124
958
|
);
|
|
1125
959
|
}
|
|
1126
960
|
|
|
1127
|
-
// src/components/Input/Input.module.css
|
|
1128
|
-
var
|
|
1129
|
-
input: "Input_input",
|
|
1130
|
-
"size-sm": "Input_size-sm",
|
|
1131
|
-
"size-md": "Input_size-md",
|
|
1132
|
-
"size-lg": "Input_size-lg",
|
|
1133
|
-
iconWrap: "Input_iconWrap",
|
|
1134
|
-
icon: "Input_icon",
|
|
1135
|
-
iconLeft: "Input_iconLeft",
|
|
1136
|
-
iconRight: "Input_iconRight",
|
|
1137
|
-
"with-icon-left": "Input_with-icon-left",
|
|
1138
|
-
"with-icon-right": "Input_with-icon-right"
|
|
1139
|
-
};
|
|
961
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/Input/Input.module.css?mds-scoped
|
|
962
|
+
var Input_module_default = { "input": "mds-Input__input", "size-sm": "mds-Input__size-sm", "size-md": "mds-Input__size-md", "size-lg": "mds-Input__size-lg", "iconWrap": "mds-Input__iconWrap", "icon": "mds-Input__icon", "iconLeft": "mds-Input__iconLeft", "iconRight": "mds-Input__iconRight", "with-icon-left": "mds-Input__with-icon-left", "with-icon-right": "mds-Input__with-icon-right" };
|
|
1140
963
|
function Input({
|
|
1141
964
|
size = "md",
|
|
1142
965
|
invalid,
|
|
@@ -1153,38 +976,34 @@ function Input({
|
|
|
1153
976
|
"aria-describedby": rest["aria-describedby"] ?? field?.describedBy,
|
|
1154
977
|
"aria-invalid": rest["aria-invalid"] ?? ((invalid ?? field?.invalid) || void 0),
|
|
1155
978
|
className: cx(
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
iconLeft != null &&
|
|
1159
|
-
iconRight != null &&
|
|
979
|
+
Input_module_default.input,
|
|
980
|
+
Input_module_default[`size-${size}`],
|
|
981
|
+
iconLeft != null && Input_module_default["with-icon-left"],
|
|
982
|
+
iconRight != null && Input_module_default["with-icon-right"],
|
|
1160
983
|
className
|
|
1161
984
|
),
|
|
1162
985
|
...rest
|
|
1163
986
|
}
|
|
1164
987
|
);
|
|
1165
988
|
if (iconLeft == null && iconRight == null) return input;
|
|
1166
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className:
|
|
989
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: Input_module_default.iconWrap, children: [
|
|
1167
990
|
input,
|
|
1168
|
-
iconLeft != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: cx(
|
|
1169
|
-
iconRight != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: cx(
|
|
991
|
+
iconLeft != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: cx(Input_module_default.icon, Input_module_default.iconLeft), "aria-hidden": "true", children: iconLeft }),
|
|
992
|
+
iconRight != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: cx(Input_module_default.icon, Input_module_default.iconRight), "aria-hidden": "true", children: iconRight })
|
|
1170
993
|
] });
|
|
1171
994
|
}
|
|
1172
995
|
|
|
1173
|
-
// src/components/PasswordInput/PasswordInput.module.css
|
|
1174
|
-
var
|
|
1175
|
-
wrap: "PasswordInput_wrap",
|
|
1176
|
-
input: "PasswordInput_input",
|
|
1177
|
-
toggle: "PasswordInput_toggle"
|
|
1178
|
-
};
|
|
996
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/PasswordInput/PasswordInput.module.css?mds-scoped
|
|
997
|
+
var PasswordInput_module_default = { "wrap": "mds-PasswordInput__wrap", "input": "mds-PasswordInput__input", "toggle": "mds-PasswordInput__toggle" };
|
|
1179
998
|
function PasswordInput({ className, ...rest }) {
|
|
1180
999
|
const [visible, setVisible] = react.useState(false);
|
|
1181
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className:
|
|
1182
|
-
/* @__PURE__ */ jsxRuntime.jsx(Input, { ...rest, type: visible ? "text" : "password", className: cx(
|
|
1000
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: PasswordInput_module_default.wrap, children: [
|
|
1001
|
+
/* @__PURE__ */ jsxRuntime.jsx(Input, { ...rest, type: visible ? "text" : "password", className: cx(PasswordInput_module_default.input, className) }),
|
|
1183
1002
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1184
1003
|
"button",
|
|
1185
1004
|
{
|
|
1186
1005
|
type: "button",
|
|
1187
|
-
className:
|
|
1006
|
+
className: PasswordInput_module_default.toggle,
|
|
1188
1007
|
"aria-label": visible ? "Hide password" : "Show password",
|
|
1189
1008
|
"aria-pressed": visible,
|
|
1190
1009
|
onClick: () => setVisible((v) => !v),
|
|
@@ -1208,12 +1027,8 @@ function PasswordInput({ className, ...rest }) {
|
|
|
1208
1027
|
] });
|
|
1209
1028
|
}
|
|
1210
1029
|
|
|
1211
|
-
// src/components/Textarea/Textarea.module.css
|
|
1212
|
-
var
|
|
1213
|
-
textarea: "Textarea_textarea",
|
|
1214
|
-
wrap: "Textarea_wrap",
|
|
1215
|
-
count: "Textarea_count"
|
|
1216
|
-
};
|
|
1030
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/Textarea/Textarea.module.css?mds-scoped
|
|
1031
|
+
var Textarea_module_default = { "textarea": "mds-Textarea__textarea", "wrap": "mds-Textarea__wrap", "count": "mds-Textarea__count" };
|
|
1217
1032
|
function Textarea({ rows = 3, showCount = false, className, ...rest }) {
|
|
1218
1033
|
const field = useFieldContext();
|
|
1219
1034
|
const [tracked, setTracked] = react.useState(() => String(rest.defaultValue ?? ""));
|
|
@@ -1229,52 +1044,38 @@ function Textarea({ rows = 3, showCount = false, className, ...rest }) {
|
|
|
1229
1044
|
"aria-describedby": rest["aria-describedby"] ?? field?.describedBy,
|
|
1230
1045
|
"aria-invalid": rest["aria-invalid"] ?? (field?.invalid || void 0),
|
|
1231
1046
|
rows,
|
|
1232
|
-
className: cx(
|
|
1047
|
+
className: cx(Textarea_module_default.textarea, className),
|
|
1233
1048
|
...rest,
|
|
1234
1049
|
...showCount ? { onChange } : {}
|
|
1235
1050
|
}
|
|
1236
1051
|
);
|
|
1237
1052
|
if (!showCount) return textarea;
|
|
1238
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className:
|
|
1053
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: Textarea_module_default.wrap, children: [
|
|
1239
1054
|
textarea,
|
|
1240
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
1055
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: Textarea_module_default.count, "aria-hidden": "true", children: rest.maxLength !== void 0 ? `${current.length}/${rest.maxLength}` : current.length })
|
|
1241
1056
|
] });
|
|
1242
1057
|
}
|
|
1243
1058
|
|
|
1244
|
-
// src/components/Checkbox/Checkbox.module.css
|
|
1245
|
-
var
|
|
1246
|
-
root: "Checkbox_root",
|
|
1247
|
-
box: "Checkbox_box",
|
|
1248
|
-
label: "Checkbox_label"
|
|
1249
|
-
};
|
|
1059
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/Checkbox/Checkbox.module.css?mds-scoped
|
|
1060
|
+
var Checkbox_module_default = { "root": "mds-Checkbox__root", "box": "mds-Checkbox__box", "label": "mds-Checkbox__label" };
|
|
1250
1061
|
function Checkbox({ label, className, ...rest }) {
|
|
1251
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("label", { className: cx(
|
|
1252
|
-
/* @__PURE__ */ jsxRuntime.jsx("input", { type: "checkbox", className:
|
|
1253
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
1062
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("label", { className: cx(Checkbox_module_default.root, className), children: [
|
|
1063
|
+
/* @__PURE__ */ jsxRuntime.jsx("input", { type: "checkbox", className: Checkbox_module_default.box, ...rest }),
|
|
1064
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: Checkbox_module_default.label, children: label })
|
|
1254
1065
|
] });
|
|
1255
1066
|
}
|
|
1256
1067
|
|
|
1257
|
-
// src/components/Radio/Radio.module.css
|
|
1258
|
-
var
|
|
1259
|
-
root: "Radio_root",
|
|
1260
|
-
dot: "Radio_dot",
|
|
1261
|
-
label: "Radio_label"
|
|
1262
|
-
};
|
|
1068
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/Radio/Radio.module.css?mds-scoped
|
|
1069
|
+
var Radio_module_default = { "root": "mds-Radio__root", "dot": "mds-Radio__dot", "label": "mds-Radio__label" };
|
|
1263
1070
|
function Radio({ label, className, ...rest }) {
|
|
1264
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("label", { className: cx(
|
|
1265
|
-
/* @__PURE__ */ jsxRuntime.jsx("input", { type: "radio", className:
|
|
1266
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
1071
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("label", { className: cx(Radio_module_default.root, className), children: [
|
|
1072
|
+
/* @__PURE__ */ jsxRuntime.jsx("input", { type: "radio", className: Radio_module_default.dot, ...rest }),
|
|
1073
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: Radio_module_default.label, children: label })
|
|
1267
1074
|
] });
|
|
1268
1075
|
}
|
|
1269
1076
|
|
|
1270
|
-
// src/components/Switch/Switch.module.css
|
|
1271
|
-
var
|
|
1272
|
-
root: "Switch_root",
|
|
1273
|
-
track: "Switch_track",
|
|
1274
|
-
trackWrap: "Switch_trackWrap",
|
|
1275
|
-
spinner: "Switch_spinner",
|
|
1276
|
-
label: "Switch_label"
|
|
1277
|
-
};
|
|
1077
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/Switch/Switch.module.css?mds-scoped
|
|
1078
|
+
var Switch_module_default = { "root": "mds-Switch__root", "track": "mds-Switch__track", "trackWrap": "mds-Switch__trackWrap", "spinner": "mds-Switch__spinner", "label": "mds-Switch__label" };
|
|
1278
1079
|
function Switch({
|
|
1279
1080
|
label,
|
|
1280
1081
|
loading = false,
|
|
@@ -1282,32 +1083,27 @@ function Switch({
|
|
|
1282
1083
|
className,
|
|
1283
1084
|
...rest
|
|
1284
1085
|
}) {
|
|
1285
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("label", { className: cx(
|
|
1286
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className:
|
|
1086
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("label", { className: cx(Switch_module_default.root, className), children: [
|
|
1087
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: Switch_module_default.trackWrap, children: [
|
|
1287
1088
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1288
1089
|
"input",
|
|
1289
1090
|
{
|
|
1290
1091
|
type: "checkbox",
|
|
1291
1092
|
role: "switch",
|
|
1292
|
-
className:
|
|
1093
|
+
className: Switch_module_default.track,
|
|
1293
1094
|
disabled: disabled || loading,
|
|
1294
1095
|
"aria-busy": loading || void 0,
|
|
1295
1096
|
...rest
|
|
1296
1097
|
}
|
|
1297
1098
|
),
|
|
1298
|
-
loading && /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 12, label: "", "aria-hidden": "true", className:
|
|
1099
|
+
loading && /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 12, label: "", "aria-hidden": "true", className: Switch_module_default.spinner })
|
|
1299
1100
|
] }),
|
|
1300
|
-
label !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
1101
|
+
label !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: Switch_module_default.label, children: label })
|
|
1301
1102
|
] });
|
|
1302
1103
|
}
|
|
1303
1104
|
|
|
1304
|
-
// src/components/SegmentedControl/SegmentedControl.module.css
|
|
1305
|
-
var
|
|
1306
|
-
group: "SegmentedControl_group",
|
|
1307
|
-
segment: "SegmentedControl_segment",
|
|
1308
|
-
input: "SegmentedControl_input",
|
|
1309
|
-
face: "SegmentedControl_face"
|
|
1310
|
-
};
|
|
1105
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/SegmentedControl/SegmentedControl.module.css?mds-scoped
|
|
1106
|
+
var SegmentedControl_module_default = { "group": "mds-SegmentedControl__group", "segment": "mds-SegmentedControl__segment", "input": "mds-SegmentedControl__input", "face": "mds-SegmentedControl__face" };
|
|
1311
1107
|
function SegmentedControl({
|
|
1312
1108
|
label,
|
|
1313
1109
|
options,
|
|
@@ -1317,7 +1113,7 @@ function SegmentedControl({
|
|
|
1317
1113
|
className
|
|
1318
1114
|
}) {
|
|
1319
1115
|
const name = react.useId();
|
|
1320
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { role: "radiogroup", "aria-label": label, className: cx(
|
|
1116
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { role: "radiogroup", "aria-label": label, className: cx(SegmentedControl_module_default.group, className), children: options.map((option) => /* @__PURE__ */ jsxRuntime.jsxs("label", { className: SegmentedControl_module_default.segment, children: [
|
|
1321
1117
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1322
1118
|
"input",
|
|
1323
1119
|
{
|
|
@@ -1327,24 +1123,18 @@ function SegmentedControl({
|
|
|
1327
1123
|
checked: option.value === value,
|
|
1328
1124
|
onChange: () => onChange(option.value),
|
|
1329
1125
|
disabled,
|
|
1330
|
-
className:
|
|
1126
|
+
className: SegmentedControl_module_default.input
|
|
1331
1127
|
}
|
|
1332
1128
|
),
|
|
1333
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
1129
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: SegmentedControl_module_default.face, children: option.label })
|
|
1334
1130
|
] }, option.value)) });
|
|
1335
1131
|
}
|
|
1336
1132
|
|
|
1337
|
-
// src/components/SearchField/SearchField.module.css
|
|
1338
|
-
var
|
|
1339
|
-
wrap: "SearchField_wrap",
|
|
1340
|
-
glass: "SearchField_glass",
|
|
1341
|
-
input: "SearchField_input",
|
|
1342
|
-
clear: "SearchField_clear",
|
|
1343
|
-
clearGlyph: "SearchField_clearGlyph"
|
|
1344
|
-
};
|
|
1133
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/SearchField/SearchField.module.css?mds-scoped
|
|
1134
|
+
var SearchField_module_default = { "wrap": "mds-SearchField__wrap", "glass": "mds-SearchField__glass", "input": "mds-SearchField__input", "clear": "mds-SearchField__clear", "clearGlyph": "mds-SearchField__clearGlyph" };
|
|
1345
1135
|
function SearchField({ label, value, onChange, className, ...rest }) {
|
|
1346
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: cx(
|
|
1347
|
-
/* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className:
|
|
1136
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: cx(SearchField_module_default.wrap, className), children: [
|
|
1137
|
+
/* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className: SearchField_module_default.glass, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1348
1138
|
"path",
|
|
1349
1139
|
{
|
|
1350
1140
|
d: "M7 12a5 5 0 1 1 0-10 5 5 0 0 1 0 10Zm7 2-3.5-3.5",
|
|
@@ -1361,7 +1151,7 @@ function SearchField({ label, value, onChange, className, ...rest }) {
|
|
|
1361
1151
|
"aria-label": label,
|
|
1362
1152
|
value,
|
|
1363
1153
|
onChange: (event) => onChange(event.target.value),
|
|
1364
|
-
className:
|
|
1154
|
+
className: SearchField_module_default.input,
|
|
1365
1155
|
...rest
|
|
1366
1156
|
}
|
|
1367
1157
|
),
|
|
@@ -1370,33 +1160,32 @@ function SearchField({ label, value, onChange, className, ...rest }) {
|
|
|
1370
1160
|
{
|
|
1371
1161
|
type: "button",
|
|
1372
1162
|
"aria-label": "Clear search",
|
|
1373
|
-
className:
|
|
1163
|
+
className: SearchField_module_default.clear,
|
|
1374
1164
|
onClick: () => onChange(""),
|
|
1375
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className:
|
|
1165
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className: SearchField_module_default.clearGlyph, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4 4l8 8M12 4l-8 8", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round" }) })
|
|
1376
1166
|
}
|
|
1377
1167
|
)
|
|
1378
1168
|
] });
|
|
1379
1169
|
}
|
|
1380
1170
|
|
|
1381
|
-
// src/components/List/List.module.css
|
|
1382
|
-
var
|
|
1383
|
-
group: "List_group",
|
|
1384
|
-
item: "List_item",
|
|
1385
|
-
"surface-card": "List_surface-card",
|
|
1386
|
-
"surface-sunken": "List_surface-sunken",
|
|
1387
|
-
"surface-accent": "List_surface-accent",
|
|
1388
|
-
"surface-plain": "List_surface-plain",
|
|
1389
|
-
row: "List_row",
|
|
1390
|
-
interactive: "List_interactive",
|
|
1391
|
-
leading: "List_leading",
|
|
1392
|
-
trailing: "List_trailing",
|
|
1393
|
-
text: "List_text",
|
|
1394
|
-
title: "List_title",
|
|
1395
|
-
description: "List_description"
|
|
1396
|
-
};
|
|
1171
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/List/List.module.css?mds-scoped
|
|
1172
|
+
var List_module_default = { "group": "mds-List__group", "labelledGroup": "mds-List__labelledGroup", "label": "mds-List__label", "item": "mds-List__item", "surface-card": "mds-List__surface-card", "surface-sunken": "mds-List__surface-sunken", "surface-accent": "mds-List__surface-accent", "surface-plain": "mds-List__surface-plain", "row": "mds-List__row", "interactive": "mds-List__interactive", "leading": "mds-List__leading", "trailing": "mds-List__trailing", "text": "mds-List__text", "title": "mds-List__title", "description": "mds-List__description" };
|
|
1397
1173
|
var ListGroupContext = react.createContext(false);
|
|
1398
|
-
function ListGroup({ className, ...rest }) {
|
|
1399
|
-
|
|
1174
|
+
function ListGroup({ label, className, ...rest }) {
|
|
1175
|
+
const headingId = react.useId();
|
|
1176
|
+
const list = /* @__PURE__ */ jsxRuntime.jsx(ListGroupContext.Provider, { value: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1177
|
+
"ul",
|
|
1178
|
+
{
|
|
1179
|
+
className: cx(List_module_default.group, className),
|
|
1180
|
+
"aria-labelledby": label != null ? headingId : void 0,
|
|
1181
|
+
...rest
|
|
1182
|
+
}
|
|
1183
|
+
) });
|
|
1184
|
+
if (label == null) return list;
|
|
1185
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: List_module_default.labelledGroup, children: [
|
|
1186
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: List_module_default.label, id: headingId, children: label }),
|
|
1187
|
+
list
|
|
1188
|
+
] });
|
|
1400
1189
|
}
|
|
1401
1190
|
function ListItem({
|
|
1402
1191
|
title,
|
|
@@ -1404,6 +1193,7 @@ function ListItem({
|
|
|
1404
1193
|
leading,
|
|
1405
1194
|
trailing,
|
|
1406
1195
|
onClick,
|
|
1196
|
+
pressed,
|
|
1407
1197
|
href,
|
|
1408
1198
|
surface,
|
|
1409
1199
|
className,
|
|
@@ -1413,45 +1203,45 @@ function ListItem({
|
|
|
1413
1203
|
const Root = inGroup ? "li" : "div";
|
|
1414
1204
|
const resolved = surface ?? (inGroup ? void 0 : "card");
|
|
1415
1205
|
const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1416
|
-
leading != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
1417
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className:
|
|
1418
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
1419
|
-
description != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
1206
|
+
leading != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: List_module_default.leading, children: leading }),
|
|
1207
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: List_module_default.text, children: [
|
|
1208
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: List_module_default.title, children: title }),
|
|
1209
|
+
description != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: List_module_default.description, children: description })
|
|
1420
1210
|
] }),
|
|
1421
|
-
trailing != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
1211
|
+
trailing != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: List_module_default.trailing, children: trailing })
|
|
1422
1212
|
] });
|
|
1423
1213
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1424
1214
|
Root,
|
|
1425
1215
|
{
|
|
1426
|
-
className: cx(
|
|
1216
|
+
className: cx(List_module_default.item, resolved && List_module_default[`surface-${resolved}`], className),
|
|
1427
1217
|
...rest,
|
|
1428
|
-
children: href !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx("a", { className: cx(
|
|
1218
|
+
children: href !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx("a", { className: cx(List_module_default.row, List_module_default.interactive), href, children: content }) : onClick !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1219
|
+
"button",
|
|
1220
|
+
{
|
|
1221
|
+
type: "button",
|
|
1222
|
+
className: cx(List_module_default.row, List_module_default.interactive),
|
|
1223
|
+
onClick,
|
|
1224
|
+
"aria-pressed": pressed,
|
|
1225
|
+
children: content
|
|
1226
|
+
}
|
|
1227
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: List_module_default.row, children: content })
|
|
1429
1228
|
}
|
|
1430
1229
|
);
|
|
1431
1230
|
}
|
|
1432
1231
|
|
|
1433
|
-
// src/components/EmptyState/EmptyState.module.css
|
|
1434
|
-
var
|
|
1435
|
-
root: "EmptyState_root",
|
|
1436
|
-
icon: "EmptyState_icon",
|
|
1437
|
-
action: "EmptyState_action"
|
|
1438
|
-
};
|
|
1232
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/EmptyState/EmptyState.module.css?mds-scoped
|
|
1233
|
+
var EmptyState_module_default = { "root": "mds-EmptyState__root", "icon": "mds-EmptyState__icon", "action": "mds-EmptyState__action" };
|
|
1439
1234
|
function EmptyState({ title, description, icon, action, className }) {
|
|
1440
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx(
|
|
1441
|
-
icon != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
1235
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx(EmptyState_module_default.root, className), children: [
|
|
1236
|
+
icon != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: EmptyState_module_default.icon, "aria-hidden": "true", children: icon }),
|
|
1442
1237
|
/* @__PURE__ */ jsxRuntime.jsx(Heading, { level: 3, children: title }),
|
|
1443
1238
|
description !== void 0 && /* @__PURE__ */ jsxRuntime.jsx(Text, { tone: "secondary", children: description }),
|
|
1444
|
-
action != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
1239
|
+
action != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: EmptyState_module_default.action, children: action })
|
|
1445
1240
|
] });
|
|
1446
1241
|
}
|
|
1447
1242
|
|
|
1448
|
-
// src/components/Tabs/Tabs.module.css
|
|
1449
|
-
var
|
|
1450
|
-
list: "Tabs_list",
|
|
1451
|
-
tab: "Tabs_tab",
|
|
1452
|
-
selected: "Tabs_selected",
|
|
1453
|
-
panel: "Tabs_panel"
|
|
1454
|
-
};
|
|
1243
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/Tabs/Tabs.module.css?mds-scoped
|
|
1244
|
+
var Tabs_module_default = { "list": "mds-Tabs__list", "tab": "mds-Tabs__tab", "selected": "mds-Tabs__selected", "panel": "mds-Tabs__panel" };
|
|
1455
1245
|
var TabsContext = react.createContext(null);
|
|
1456
1246
|
function useTabs(component) {
|
|
1457
1247
|
const context = react.useContext(TabsContext);
|
|
@@ -1460,7 +1250,18 @@ function useTabs(component) {
|
|
|
1460
1250
|
}
|
|
1461
1251
|
function Tabs({ value, onChange, children }) {
|
|
1462
1252
|
const baseId = react.useId();
|
|
1463
|
-
|
|
1253
|
+
const [panels, setPanels] = react.useState(/* @__PURE__ */ new Set());
|
|
1254
|
+
const registerPanel = react.useCallback((panel) => {
|
|
1255
|
+
setPanels((prev) => new Set(prev).add(panel));
|
|
1256
|
+
return () => {
|
|
1257
|
+
setPanels((prev) => {
|
|
1258
|
+
const next = new Set(prev);
|
|
1259
|
+
next.delete(panel);
|
|
1260
|
+
return next;
|
|
1261
|
+
});
|
|
1262
|
+
};
|
|
1263
|
+
}, []);
|
|
1264
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TabsContext.Provider, { value: { value, onChange, baseId, panels, registerPanel }, children });
|
|
1464
1265
|
}
|
|
1465
1266
|
function onArrow(event, onChange) {
|
|
1466
1267
|
const keys = ["ArrowLeft", "ArrowRight", "Home", "End"];
|
|
@@ -1483,7 +1284,7 @@ function TabList({ label, className, children, ...rest }) {
|
|
|
1483
1284
|
{
|
|
1484
1285
|
role: "tablist",
|
|
1485
1286
|
"aria-label": label,
|
|
1486
|
-
className: cx(
|
|
1287
|
+
className: cx(Tabs_module_default.list, className),
|
|
1487
1288
|
onKeyDown: (event) => onArrow(event, onChange),
|
|
1488
1289
|
...rest,
|
|
1489
1290
|
children
|
|
@@ -1500,10 +1301,10 @@ function Tab({ value, className, children, ...rest }) {
|
|
|
1500
1301
|
role: "tab",
|
|
1501
1302
|
id: `${tabs.baseId}-tab-${value}`,
|
|
1502
1303
|
"aria-selected": selected,
|
|
1503
|
-
"aria-controls": `${tabs.baseId}-panel-${value}
|
|
1304
|
+
"aria-controls": tabs.panels.has(value) ? `${tabs.baseId}-panel-${value}` : void 0,
|
|
1504
1305
|
tabIndex: selected ? 0 : -1,
|
|
1505
1306
|
"data-value": value,
|
|
1506
|
-
className: cx(
|
|
1307
|
+
className: cx(Tabs_module_default.tab, selected && Tabs_module_default.selected, className),
|
|
1507
1308
|
onClick: () => tabs.onChange(value),
|
|
1508
1309
|
...rest,
|
|
1509
1310
|
children
|
|
@@ -1513,6 +1314,8 @@ function Tab({ value, className, children, ...rest }) {
|
|
|
1513
1314
|
function TabPanel({ value, className, children, ...rest }) {
|
|
1514
1315
|
const tabs = useTabs("TabPanel");
|
|
1515
1316
|
const selected = tabs.value === value;
|
|
1317
|
+
const { registerPanel } = tabs;
|
|
1318
|
+
react.useEffect(() => registerPanel(value), [registerPanel, value]);
|
|
1516
1319
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1517
1320
|
"div",
|
|
1518
1321
|
{
|
|
@@ -1520,32 +1323,26 @@ function TabPanel({ value, className, children, ...rest }) {
|
|
|
1520
1323
|
id: `${tabs.baseId}-panel-${value}`,
|
|
1521
1324
|
"aria-labelledby": `${tabs.baseId}-tab-${value}`,
|
|
1522
1325
|
hidden: !selected,
|
|
1523
|
-
className: cx(
|
|
1326
|
+
className: cx(Tabs_module_default.panel, className),
|
|
1524
1327
|
...rest,
|
|
1525
1328
|
children
|
|
1526
1329
|
}
|
|
1527
1330
|
);
|
|
1528
1331
|
}
|
|
1529
1332
|
|
|
1530
|
-
// src/components/Toast/Toast.module.css
|
|
1531
|
-
var
|
|
1532
|
-
viewport: "Toast_viewport",
|
|
1533
|
-
toast: "Toast_toast",
|
|
1534
|
-
"tone-success": "Toast_tone-success",
|
|
1535
|
-
"tone-danger": "Toast_tone-danger",
|
|
1536
|
-
body: "Toast_body",
|
|
1537
|
-
title: "Toast_title",
|
|
1538
|
-
description: "Toast_description",
|
|
1539
|
-
close: "Toast_close",
|
|
1540
|
-
closeGlyph: "Toast_closeGlyph"
|
|
1541
|
-
};
|
|
1333
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/Toast/Toast.module.css?mds-scoped
|
|
1334
|
+
var Toast_module_default = { "viewport": "mds-Toast__viewport", "toast": "mds-Toast__toast", "tone-success": "mds-Toast__tone-success", "tone-danger": "mds-Toast__tone-danger", "body": "mds-Toast__body", "title": "mds-Toast__title", "description": "mds-Toast__description", "close": "mds-Toast__close", "closeGlyph": "mds-Toast__closeGlyph" };
|
|
1542
1335
|
var ToastContext = react.createContext(null);
|
|
1543
1336
|
function useToast() {
|
|
1544
1337
|
const context = react.useContext(ToastContext);
|
|
1545
1338
|
if (context === null) throw new Error("useToast needs a <ToastProvider> above it");
|
|
1546
1339
|
return context;
|
|
1547
1340
|
}
|
|
1548
|
-
function ToastProvider({
|
|
1341
|
+
function ToastProvider({
|
|
1342
|
+
children,
|
|
1343
|
+
regionLabel = "Notifications",
|
|
1344
|
+
dismissLabel = "Dismiss"
|
|
1345
|
+
}) {
|
|
1549
1346
|
const [toasts, setToasts] = react.useState([]);
|
|
1550
1347
|
const nextId = react.useRef(1);
|
|
1551
1348
|
const dismiss = react.useCallback((id) => {
|
|
@@ -1563,38 +1360,27 @@ function ToastProvider({ children }) {
|
|
|
1563
1360
|
const value = react.useMemo(() => ({ toast, dismiss }), [toast, dismiss]);
|
|
1564
1361
|
return /* @__PURE__ */ jsxRuntime.jsxs(ToastContext.Provider, { value, children: [
|
|
1565
1362
|
children,
|
|
1566
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { role: "region", "aria-label":
|
|
1567
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className:
|
|
1568
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
1569
|
-
entry.description !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
1363
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { role: "region", "aria-label": regionLabel, className: Toast_module_default.viewport, children: toasts.map((entry) => /* @__PURE__ */ jsxRuntime.jsxs("div", { role: "status", className: cx(Toast_module_default.toast, Toast_module_default[`tone-${entry.tone}`]), children: [
|
|
1364
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: Toast_module_default.body, children: [
|
|
1365
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: Toast_module_default.title, children: entry.title }),
|
|
1366
|
+
entry.description !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: Toast_module_default.description, children: entry.description })
|
|
1570
1367
|
] }),
|
|
1571
1368
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1572
1369
|
"button",
|
|
1573
1370
|
{
|
|
1574
1371
|
type: "button",
|
|
1575
|
-
"aria-label":
|
|
1576
|
-
className:
|
|
1372
|
+
"aria-label": `${dismissLabel}: ${entry.title}`,
|
|
1373
|
+
className: Toast_module_default.close,
|
|
1577
1374
|
onClick: () => dismiss(entry.id),
|
|
1578
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className:
|
|
1375
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className: Toast_module_default.closeGlyph, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4 4l8 8M12 4l-8 8", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round" }) })
|
|
1579
1376
|
}
|
|
1580
1377
|
)
|
|
1581
1378
|
] }, entry.id)) })
|
|
1582
1379
|
] });
|
|
1583
1380
|
}
|
|
1584
1381
|
|
|
1585
|
-
// src/components/Stack/Stack.module.css
|
|
1586
|
-
var
|
|
1587
|
-
stack: "Stack_stack",
|
|
1588
|
-
"gap-hairline": "Stack_gap-hairline",
|
|
1589
|
-
"gap-tight": "Stack_gap-tight",
|
|
1590
|
-
"gap-base": "Stack_gap-base",
|
|
1591
|
-
"gap-loose": "Stack_gap-loose",
|
|
1592
|
-
"gap-section": "Stack_gap-section",
|
|
1593
|
-
"align-start": "Stack_align-start",
|
|
1594
|
-
"align-center": "Stack_align-center",
|
|
1595
|
-
"align-end": "Stack_align-end",
|
|
1596
|
-
"align-stretch": "Stack_align-stretch"
|
|
1597
|
-
};
|
|
1382
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/Stack/Stack.module.css?mds-scoped
|
|
1383
|
+
var Stack_module_default = { "stack": "mds-Stack__stack", "gap-hairline": "mds-Stack__gap-hairline", "gap-tight": "mds-Stack__gap-tight", "gap-base": "mds-Stack__gap-base", "gap-loose": "mds-Stack__gap-loose", "gap-section": "mds-Stack__gap-section", "align-start": "mds-Stack__align-start", "align-center": "mds-Stack__align-center", "align-end": "mds-Stack__align-end", "align-stretch": "mds-Stack__align-stretch" };
|
|
1598
1384
|
|
|
1599
1385
|
// src/components/Stack/Stack.tsx
|
|
1600
1386
|
function Stack({
|
|
@@ -1605,28 +1391,13 @@ function Stack({
|
|
|
1605
1391
|
...rest
|
|
1606
1392
|
}) {
|
|
1607
1393
|
return react.createElement(as, {
|
|
1608
|
-
className: cx(
|
|
1394
|
+
className: cx(Stack_module_default.stack, Stack_module_default[`gap-${gap}`], Stack_module_default[`align-${align}`], className),
|
|
1609
1395
|
...rest
|
|
1610
1396
|
});
|
|
1611
1397
|
}
|
|
1612
1398
|
|
|
1613
|
-
// src/components/Inline/Inline.module.css
|
|
1614
|
-
var
|
|
1615
|
-
inline: "Inline_inline",
|
|
1616
|
-
"gap-hairline": "Inline_gap-hairline",
|
|
1617
|
-
"gap-tight": "Inline_gap-tight",
|
|
1618
|
-
"gap-base": "Inline_gap-base",
|
|
1619
|
-
"gap-loose": "Inline_gap-loose",
|
|
1620
|
-
"align-start": "Inline_align-start",
|
|
1621
|
-
"align-center": "Inline_align-center",
|
|
1622
|
-
"align-end": "Inline_align-end",
|
|
1623
|
-
"align-baseline": "Inline_align-baseline",
|
|
1624
|
-
"justify-start": "Inline_justify-start",
|
|
1625
|
-
"justify-center": "Inline_justify-center",
|
|
1626
|
-
"justify-end": "Inline_justify-end",
|
|
1627
|
-
"justify-between": "Inline_justify-between",
|
|
1628
|
-
wrap: "Inline_wrap"
|
|
1629
|
-
};
|
|
1399
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/Inline/Inline.module.css?mds-scoped
|
|
1400
|
+
var Inline_module_default = { "inline": "mds-Inline__inline", "gap-hairline": "mds-Inline__gap-hairline", "gap-tight": "mds-Inline__gap-tight", "gap-base": "mds-Inline__gap-base", "gap-loose": "mds-Inline__gap-loose", "align-start": "mds-Inline__align-start", "align-center": "mds-Inline__align-center", "align-end": "mds-Inline__align-end", "align-baseline": "mds-Inline__align-baseline", "justify-start": "mds-Inline__justify-start", "justify-center": "mds-Inline__justify-center", "justify-end": "mds-Inline__justify-end", "justify-between": "mds-Inline__justify-between", "wrap": "mds-Inline__wrap" };
|
|
1630
1401
|
|
|
1631
1402
|
// src/components/Inline/Inline.tsx
|
|
1632
1403
|
function Inline({
|
|
@@ -1640,23 +1411,19 @@ function Inline({
|
|
|
1640
1411
|
}) {
|
|
1641
1412
|
return react.createElement(as, {
|
|
1642
1413
|
className: cx(
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
wrap &&
|
|
1414
|
+
Inline_module_default.inline,
|
|
1415
|
+
Inline_module_default[`gap-${gap}`],
|
|
1416
|
+
Inline_module_default[`align-${align}`],
|
|
1417
|
+
Inline_module_default[`justify-${justify}`],
|
|
1418
|
+
wrap && Inline_module_default.wrap,
|
|
1648
1419
|
className
|
|
1649
1420
|
),
|
|
1650
1421
|
...rest
|
|
1651
1422
|
});
|
|
1652
1423
|
}
|
|
1653
1424
|
|
|
1654
|
-
// src/components/Container/Container.module.css
|
|
1655
|
-
var
|
|
1656
|
-
container: "Container_container",
|
|
1657
|
-
"width-content": "Container_width-content",
|
|
1658
|
-
"width-wide": "Container_width-wide"
|
|
1659
|
-
};
|
|
1425
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/Container/Container.module.css?mds-scoped
|
|
1426
|
+
var Container_module_default = { "container": "mds-Container__container", "width-content": "mds-Container__width-content", "width-wide": "mds-Container__width-wide" };
|
|
1660
1427
|
|
|
1661
1428
|
// src/components/Container/Container.tsx
|
|
1662
1429
|
function Container({
|
|
@@ -1666,48 +1433,36 @@ function Container({
|
|
|
1666
1433
|
...rest
|
|
1667
1434
|
}) {
|
|
1668
1435
|
return react.createElement(as, {
|
|
1669
|
-
className: cx(
|
|
1436
|
+
className: cx(Container_module_default.container, Container_module_default[`width-${width}`], className),
|
|
1670
1437
|
...rest
|
|
1671
1438
|
});
|
|
1672
1439
|
}
|
|
1673
1440
|
|
|
1674
|
-
// src/components/Card/Card.module.css
|
|
1675
|
-
var
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
interactive: "Card_interactive",
|
|
1679
|
-
header: "Card_header",
|
|
1680
|
-
body: "Card_body",
|
|
1681
|
-
footer: "Card_footer"
|
|
1682
|
-
};
|
|
1683
|
-
function Card({ children, variant = "card", onClick, href, className, ...rest }) {
|
|
1684
|
-
const cardClass = cx(Card_default.card, Card_default[`variant-${variant}`], className);
|
|
1441
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/Card/Card.module.css?mds-scoped
|
|
1442
|
+
var Card_module_default = { "card": "mds-Card__card", "variant-raised": "mds-Card__variant-raised", "variant-sunken": "mds-Card__variant-sunken", "emphasis": "mds-Card__emphasis", "interactive": "mds-Card__interactive", "header": "mds-Card__header", "body": "mds-Card__body", "footer": "mds-Card__footer" };
|
|
1443
|
+
function Card({ children, variant = "card", emphasis = false, onClick, href, className, ...rest }) {
|
|
1444
|
+
const cardClass = cx(Card_module_default.card, Card_module_default[`variant-${variant}`], emphasis && Card_module_default.emphasis, className);
|
|
1685
1445
|
if (href !== void 0) {
|
|
1686
|
-
return /* @__PURE__ */ jsxRuntime.jsx("a", { className: cx(cardClass,
|
|
1446
|
+
return /* @__PURE__ */ jsxRuntime.jsx("a", { className: cx(cardClass, Card_module_default.interactive), href, ...rest, children });
|
|
1687
1447
|
}
|
|
1688
1448
|
if (onClick !== void 0) {
|
|
1689
|
-
return /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: cx(cardClass,
|
|
1449
|
+
return /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: cx(cardClass, Card_module_default.interactive), onClick, ...rest, children });
|
|
1690
1450
|
}
|
|
1691
1451
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cardClass, ...rest, children });
|
|
1692
1452
|
}
|
|
1693
1453
|
function CardHeader({ className, ...rest }) {
|
|
1694
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx(
|
|
1454
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx(Card_module_default.header, className), ...rest });
|
|
1695
1455
|
}
|
|
1696
1456
|
function CardBody({ className, ...rest }) {
|
|
1697
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx(
|
|
1457
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx(Card_module_default.body, className), ...rest });
|
|
1698
1458
|
}
|
|
1699
1459
|
function CardFooter({ className, ...rest }) {
|
|
1700
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx(
|
|
1460
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx(Card_module_default.footer, className), ...rest });
|
|
1701
1461
|
}
|
|
1702
1462
|
|
|
1703
|
-
// src/components/Modal/Modal.module.css
|
|
1704
|
-
var
|
|
1705
|
-
|
|
1706
|
-
header: "Modal_header",
|
|
1707
|
-
body: "Modal_body",
|
|
1708
|
-
footer: "Modal_footer"
|
|
1709
|
-
};
|
|
1710
|
-
function Modal({ open, onClose, label, closeOnScrimClick = true, children }) {
|
|
1463
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/Modal/Modal.module.css?mds-scoped
|
|
1464
|
+
var Modal_module_default = { "panel": "mds-Modal__panel", "header": "mds-Modal__header", "body": "mds-Modal__body", "footer": "mds-Modal__footer" };
|
|
1465
|
+
function Modal({ open, onClose, label, closeOnScrimClick = true, role = "dialog", children }) {
|
|
1711
1466
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1712
1467
|
Overlay,
|
|
1713
1468
|
{
|
|
@@ -1715,94 +1470,141 @@ function Modal({ open, onClose, label, closeOnScrimClick = true, children }) {
|
|
|
1715
1470
|
onClose,
|
|
1716
1471
|
label,
|
|
1717
1472
|
variant: "modal",
|
|
1473
|
+
role,
|
|
1718
1474
|
closeOnScrimClick,
|
|
1719
|
-
panelClassName:
|
|
1475
|
+
panelClassName: Modal_module_default.panel,
|
|
1720
1476
|
children
|
|
1721
1477
|
}
|
|
1722
1478
|
);
|
|
1723
1479
|
}
|
|
1724
1480
|
function ModalHeader({ children }) {
|
|
1725
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
1481
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: Modal_module_default.header, children });
|
|
1726
1482
|
}
|
|
1727
1483
|
function ModalBody({ children }) {
|
|
1728
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
1484
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: Modal_module_default.body, children });
|
|
1729
1485
|
}
|
|
1730
1486
|
function ModalFooter({ children }) {
|
|
1731
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
1487
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: Modal_module_default.footer, children });
|
|
1732
1488
|
}
|
|
1733
1489
|
|
|
1734
|
-
// src/components/ConfirmDialog/ConfirmDialog.module.css
|
|
1735
|
-
var
|
|
1736
|
-
|
|
1490
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/ConfirmDialog/ConfirmDialog.module.css?mds-scoped
|
|
1491
|
+
var ConfirmDialog_module_default = { "description": "mds-ConfirmDialog__description", "error": "mds-ConfirmDialog__error" };
|
|
1492
|
+
var CONFIRM_VARIANT = {
|
|
1493
|
+
default: "primary",
|
|
1494
|
+
danger: "danger",
|
|
1495
|
+
warning: "warning"
|
|
1737
1496
|
};
|
|
1738
1497
|
function ConfirmDialog({
|
|
1739
|
-
|
|
1498
|
+
target,
|
|
1499
|
+
open = target != null,
|
|
1740
1500
|
onClose,
|
|
1741
1501
|
onConfirm,
|
|
1742
1502
|
title,
|
|
1743
1503
|
description,
|
|
1744
1504
|
confirmLabel,
|
|
1745
1505
|
cancelLabel = "Cancel",
|
|
1746
|
-
|
|
1506
|
+
tone = "default",
|
|
1507
|
+
errorMessage
|
|
1747
1508
|
}) {
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1509
|
+
const [busy, setBusy] = react.useState(false);
|
|
1510
|
+
const [error, setError] = react.useState(null);
|
|
1511
|
+
const [prevOpen, setPrevOpen] = react.useState(open);
|
|
1512
|
+
if (open !== prevOpen) {
|
|
1513
|
+
setPrevOpen(open);
|
|
1514
|
+
if (open) {
|
|
1515
|
+
setBusy(false);
|
|
1516
|
+
setError(null);
|
|
1517
|
+
}
|
|
1518
|
+
}
|
|
1519
|
+
const live = { target, title, description, confirmLabel, cancelLabel, tone };
|
|
1520
|
+
const [frozen, setFrozen] = react.useState(live);
|
|
1521
|
+
const view = open ? live : frozen;
|
|
1522
|
+
const close = () => {
|
|
1523
|
+
setFrozen(live);
|
|
1524
|
+
onClose?.();
|
|
1525
|
+
};
|
|
1526
|
+
const handleConfirm = async () => {
|
|
1527
|
+
if (!onConfirm) return;
|
|
1528
|
+
const asked = live.target;
|
|
1529
|
+
setBusy(true);
|
|
1530
|
+
setError(null);
|
|
1531
|
+
try {
|
|
1532
|
+
await onConfirm(asked);
|
|
1533
|
+
close();
|
|
1534
|
+
} catch (e) {
|
|
1535
|
+
setBusy(false);
|
|
1536
|
+
const message = e.message;
|
|
1537
|
+
setError(errorMessage?.(message) ?? message);
|
|
1538
|
+
}
|
|
1539
|
+
};
|
|
1540
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1541
|
+
Modal,
|
|
1542
|
+
{
|
|
1543
|
+
open,
|
|
1544
|
+
onClose: close,
|
|
1545
|
+
label: view.title,
|
|
1546
|
+
role: "alertdialog",
|
|
1547
|
+
closeOnScrimClick: false,
|
|
1548
|
+
children: [
|
|
1549
|
+
/* @__PURE__ */ jsxRuntime.jsx(ModalHeader, { children: view.title }),
|
|
1550
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ModalBody, { children: [
|
|
1551
|
+
view.description != null ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: ConfirmDialog_module_default.description, children: view.description }) : null,
|
|
1552
|
+
error != null ? /* @__PURE__ */ jsxRuntime.jsx("p", { role: "alert", className: ConfirmDialog_module_default.error, children: error }) : null
|
|
1553
|
+
] }),
|
|
1554
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ModalFooter, { children: [
|
|
1555
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "secondary", onClick: close, children: view.cancelLabel }),
|
|
1556
|
+
/* @__PURE__ */ jsxRuntime.jsx(Button, { variant: CONFIRM_VARIANT[view.tone], loading: busy, onClick: handleConfirm, children: view.confirmLabel })
|
|
1557
|
+
] })
|
|
1558
|
+
]
|
|
1559
|
+
}
|
|
1560
|
+
);
|
|
1756
1561
|
}
|
|
1757
1562
|
|
|
1758
|
-
// src/components/Screen/Screen.module.css
|
|
1759
|
-
var
|
|
1760
|
-
screen: "Screen_screen",
|
|
1761
|
-
content: "Screen_content"
|
|
1762
|
-
};
|
|
1563
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/Screen/Screen.module.css?mds-scoped
|
|
1564
|
+
var Screen_module_default = { "screen": "mds-Screen__screen", "content": "mds-Screen__content", "flush": "mds-Screen__flush" };
|
|
1763
1565
|
function Screen({ children }) {
|
|
1764
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
1566
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: Screen_module_default.screen, children });
|
|
1765
1567
|
}
|
|
1766
|
-
function ScreenContent({ children }) {
|
|
1767
|
-
return /* @__PURE__ */ jsxRuntime.jsx("main", { className:
|
|
1568
|
+
function ScreenContent({ children, flush = false, className, ref, ...rest }) {
|
|
1569
|
+
return /* @__PURE__ */ jsxRuntime.jsx("main", { ref, className: cx(Screen_module_default.content, flush && Screen_module_default.flush, className), ...rest, children });
|
|
1768
1570
|
}
|
|
1769
1571
|
|
|
1770
|
-
// src/components/AppBar/AppBar.module.css
|
|
1771
|
-
var
|
|
1772
|
-
|
|
1773
|
-
title
|
|
1774
|
-
|
|
1775
|
-
}
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
trailing ? /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
1572
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/AppBar/AppBar.module.css?mds-scoped
|
|
1573
|
+
var AppBar_module_default = { "bar": "mds-AppBar__bar", "title": "mds-AppBar__title", "text": "mds-AppBar__text", "subtitle": "mds-AppBar__subtitle", "slot": "mds-AppBar__slot" };
|
|
1574
|
+
function AppBar({ title, subtitle, leading, trailing }) {
|
|
1575
|
+
const heading = title ? /* @__PURE__ */ jsxRuntime.jsx("h1", { className: AppBar_module_default.title, children: title }) : null;
|
|
1576
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("header", { className: AppBar_module_default.bar, children: [
|
|
1577
|
+
leading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: AppBar_module_default.slot, children: leading }) : null,
|
|
1578
|
+
subtitle != null ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: AppBar_module_default.text, children: [
|
|
1579
|
+
heading,
|
|
1580
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: AppBar_module_default.subtitle, children: subtitle })
|
|
1581
|
+
] }) : heading,
|
|
1582
|
+
trailing ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: AppBar_module_default.slot, children: trailing }) : null
|
|
1781
1583
|
] });
|
|
1782
1584
|
}
|
|
1783
1585
|
|
|
1784
|
-
// src/components/TabBar/TabBar.module.css
|
|
1785
|
-
var
|
|
1786
|
-
bar: "TabBar_bar",
|
|
1787
|
-
item: "TabBar_item",
|
|
1788
|
-
active: "TabBar_active",
|
|
1789
|
-
icon: "TabBar_icon",
|
|
1790
|
-
label: "TabBar_label"
|
|
1791
|
-
};
|
|
1586
|
+
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/TabBar/TabBar.module.css?mds-scoped
|
|
1587
|
+
var TabBar_module_default = { "bar": "mds-TabBar__bar", "item": "mds-TabBar__item", "active": "mds-TabBar__active", "icon": "mds-TabBar__icon", "badge": "mds-TabBar__badge", "label": "mds-TabBar__label", "action": "mds-TabBar__action" };
|
|
1792
1588
|
function TabBar({ label, children }) {
|
|
1793
|
-
return /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": label, className:
|
|
1589
|
+
return /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": label, className: TabBar_module_default.bar, children });
|
|
1794
1590
|
}
|
|
1795
|
-
function TabBarItem({ label, icon, href, onClick, active = false }) {
|
|
1796
|
-
const className = cx(
|
|
1591
|
+
function TabBarItem({ label, icon, href, onClick, active = false, badge = false }) {
|
|
1592
|
+
const className = cx(TabBar_module_default.item, active && TabBar_module_default.active);
|
|
1797
1593
|
const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1798
|
-
/* @__PURE__ */ jsxRuntime.
|
|
1799
|
-
|
|
1594
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: TabBar_module_default.icon, "aria-hidden": "true", children: [
|
|
1595
|
+
icon,
|
|
1596
|
+
badge ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: TabBar_module_default.badge, "data-testid": "mds-tabbar-badge" }) : null
|
|
1597
|
+
] }),
|
|
1598
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: TabBar_module_default.label, children: label })
|
|
1800
1599
|
] });
|
|
1801
1600
|
if (href !== void 0) {
|
|
1802
1601
|
return /* @__PURE__ */ jsxRuntime.jsx("a", { href, className, "aria-current": active ? "page" : void 0, onClick, children: content });
|
|
1803
1602
|
}
|
|
1804
1603
|
return /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className, "aria-current": active ? "page" : void 0, onClick, children: content });
|
|
1805
1604
|
}
|
|
1605
|
+
function TabBarAction({ label, icon, onClick }) {
|
|
1606
|
+
return /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", "aria-label": label, className: TabBar_module_default.action, onClick, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: TabBar_module_default.icon, "aria-hidden": "true", children: icon }) });
|
|
1607
|
+
}
|
|
1806
1608
|
function useRovingGroup(ref, { selector, orientation = "horizontal" }) {
|
|
1807
1609
|
return react.useCallback(
|
|
1808
1610
|
(event) => {
|
|
@@ -1879,6 +1681,7 @@ exports.Stack = Stack;
|
|
|
1879
1681
|
exports.Switch = Switch;
|
|
1880
1682
|
exports.Tab = Tab;
|
|
1881
1683
|
exports.TabBar = TabBar;
|
|
1684
|
+
exports.TabBarAction = TabBarAction;
|
|
1882
1685
|
exports.TabBarItem = TabBarItem;
|
|
1883
1686
|
exports.TabList = TabList;
|
|
1884
1687
|
exports.TabPanel = TabPanel;
|