@mond-design-system/react 1.0.0-alpha.2 → 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 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 Text_default = {
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
- Text_default.text,
62
- Text_default[`variant-${variant}`],
63
- Text_default[`tone-${resolvedTone}`],
64
- align && Text_default[`align-${align}`],
65
- truncate && Text_default.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 Heading_default = {
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
- Heading_default.heading,
102
- Heading_default[`variant-${variant ?? LEVEL_VARIANT[level]}`],
103
- Heading_default[`tone-${tone}`],
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 Spinner_default = {
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(Spinner_default.spinner, className),
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 Icon_default = {
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(Icon_default.icon, Icon_default[`size-${size}`], className),
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,19 +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 Button_default = {
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-danger": "Button_variant-danger",
179
- fullWidth: "Button_fullWidth",
180
- "icon-only": "Button_icon-only"
181
- };
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" };
182
134
  var SPINNER_PX = { sm: 16, md: 18, lg: 20 };
183
135
  function Button({
184
136
  variant = "primary",
@@ -203,11 +155,11 @@ function Button({
203
155
  Element,
204
156
  {
205
157
  className: cx(
206
- Button_default.button,
207
- Button_default[`variant-${variant}`],
208
- Button_default[`size-${size}`],
209
- fullWidth && Button_default.fullWidth,
210
- iconOnly && Button_default["icon-only"],
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"],
211
163
  className
212
164
  ),
213
165
  "aria-busy": loading || void 0,
@@ -222,58 +174,78 @@ function Button({
222
174
  );
223
175
  }
224
176
 
225
- // src/components/Link/Link.module.css
226
- var Link_default = {
227
- link: "Link_link",
228
- "variant-inline": "Link_variant-inline",
229
- "variant-standalone": "Link_variant-standalone"
230
- };
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" };
231
179
  function Link({
232
180
  variant = "inline",
181
+ size,
233
182
  external = false,
234
- as: Element = "a",
235
- className,
183
+ as,
236
184
  ...rest
237
185
  }) {
186
+ const Element = as ?? "a";
187
+ const { className, type, ...others } = rest;
238
188
  const externalProps = external ? { target: "_blank", rel: "noopener noreferrer" } : {};
189
+ const typeProps = Element === "button" ? { type: type ?? "button" } : type !== void 0 ? { type } : {};
239
190
  return /* @__PURE__ */ jsxRuntime.jsx(
240
191
  Element,
241
192
  {
242
- className: cx(Link_default.link, Link_default[`variant-${variant}`], className),
193
+ className: cx(
194
+ Link_module_default.link,
195
+ Link_module_default[`variant-${variant}`],
196
+ size && Link_module_default[`size-${size}`],
197
+ className
198
+ ),
243
199
  ...externalProps,
244
- ...rest
200
+ ...others,
201
+ ...typeProps
245
202
  }
246
203
  );
247
204
  }
248
205
 
249
- // src/components/Avatar/Avatar.module.css
250
- var Avatar_default = {
251
- avatar: "Avatar_avatar",
252
- "size-sm": "Avatar_size-sm",
253
- "size-md": "Avatar_size-md",
254
- "size-lg": "Avatar_size-lg",
255
- image: "Avatar_image",
256
- initials: "Avatar_initials"
257
- };
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" };
258
208
  function initials(name) {
259
209
  const words = name.trim().split(/\s+/).filter(Boolean);
260
210
  const first = words[0]?.[0] ?? "";
261
211
  const last = words.length > 1 ? words.at(-1)?.[0] ?? "" : "";
262
212
  return (first + last).toUpperCase();
263
213
  }
264
- function Avatar({ name, src, size = "md", className, ...rest }) {
265
- return /* @__PURE__ */ jsxRuntime.jsx("span", { className: cx(Avatar_default.avatar, Avatar_default[`size-${size}`], className), ...rest, children: src ? /* @__PURE__ */ jsxRuntime.jsx("img", { className: Avatar_default.image, src, alt: name }) : /* @__PURE__ */ jsxRuntime.jsx("span", { role: "img", "aria-label": name, className: Avatar_default.initials, children: initials(name) }) });
214
+ function Avatar({
215
+ name,
216
+ src,
217
+ size = "md",
218
+ tone,
219
+ decorative = false,
220
+ className,
221
+ ...rest
222
+ }) {
223
+ return /* @__PURE__ */ jsxRuntime.jsx(
224
+ "span",
225
+ {
226
+ className: cx(
227
+ Avatar_module_default.avatar,
228
+ Avatar_module_default[`size-${size}`],
229
+ tone !== void 0 && Avatar_module_default[`tone-${tone}`],
230
+ className
231
+ ),
232
+ "aria-hidden": decorative || void 0,
233
+ ...rest,
234
+ children: src ? /* @__PURE__ */ jsxRuntime.jsx("img", { className: Avatar_module_default.image, src, alt: decorative ? "" : name }) : /* @__PURE__ */ jsxRuntime.jsx(
235
+ "span",
236
+ {
237
+ role: decorative ? void 0 : "img",
238
+ "aria-label": decorative ? void 0 : name,
239
+ className: Avatar_module_default.initials,
240
+ children: initials(name)
241
+ }
242
+ )
243
+ }
244
+ );
266
245
  }
267
246
 
268
- // src/components/AvatarGroup/AvatarGroup.module.css
269
- var AvatarGroup_default = {
270
- group: "AvatarGroup_group",
271
- item: "AvatarGroup_item",
272
- overflow: "AvatarGroup_overflow",
273
- "size-sm": "AvatarGroup_size-sm",
274
- "size-md": "AvatarGroup_size-md",
275
- "size-lg": "AvatarGroup_size-lg"
276
- };
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" };
277
249
  function AvatarGroup({
278
250
  children,
279
251
  max = 4,
@@ -284,12 +256,12 @@ function AvatarGroup({
284
256
  const all = react.Children.toArray(children);
285
257
  const visible = all.slice(0, max);
286
258
  const hidden = all.length - visible.length;
287
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx(AvatarGroup_default.group, className), ...rest, children: [
288
- visible.map((child, i) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: AvatarGroup_default.item, children: child }, i)),
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)),
289
261
  hidden > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
290
262
  "span",
291
263
  {
292
- className: cx(AvatarGroup_default.item, AvatarGroup_default.overflow, AvatarGroup_default[`size-${size}`]),
264
+ className: cx(AvatarGroup_module_default.item, AvatarGroup_module_default.overflow, AvatarGroup_module_default[`size-${size}`]),
293
265
  "aria-label": `${hidden} more`,
294
266
  children: [
295
267
  "+",
@@ -300,28 +272,14 @@ function AvatarGroup({
300
272
  ] });
301
273
  }
302
274
 
303
- // src/components/Badge/Badge.module.css
304
- var Badge_default = {
305
- badge: "Badge_badge",
306
- "tone-neutral": "Badge_tone-neutral",
307
- "tone-accent": "Badge_tone-accent",
308
- "tone-danger": "Badge_tone-danger",
309
- "tone-warning": "Badge_tone-warning",
310
- "tone-success": "Badge_tone-success"
311
- };
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" };
312
277
  function Badge({ tone = "neutral", className, ...rest }) {
313
- return /* @__PURE__ */ jsxRuntime.jsx("span", { className: cx(Badge_default.badge, Badge_default[`tone-${tone}`], className), ...rest });
278
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: cx(Badge_module_default.badge, Badge_module_default[`tone-${tone}`], className), ...rest });
314
279
  }
315
280
 
316
- // src/components/Chip/Chip.module.css
317
- var Chip_default = {
318
- chip: "Chip_chip",
319
- "variant-soft": "Chip_variant-soft",
320
- "variant-outline": "Chip_variant-outline",
321
- selected: "Chip_selected",
322
- interactive: "Chip_interactive",
323
- disabled: "Chip_disabled"
324
- };
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" };
325
283
  function Chip({
326
284
  children,
327
285
  variant = "soft",
@@ -335,11 +293,11 @@ function Chip({
335
293
  const interactive = typeof onClick === "function";
336
294
  const shared = {
337
295
  className: cx(
338
- Chip_default.chip,
339
- Chip_default[`variant-${variant}`],
340
- selected && Chip_default.selected,
341
- interactive && !disabled && Chip_default.interactive,
342
- disabled && Chip_default.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,
343
301
  className
344
302
  ),
345
303
  ...rest
@@ -361,27 +319,14 @@ function Chip({
361
319
  ) : /* @__PURE__ */ jsxRuntime.jsx("span", { ...shared, children: content });
362
320
  }
363
321
 
364
- // src/components/Chip/ChipGroup.module.css
365
- var ChipGroup_default = {
366
- group: "ChipGroup_group",
367
- "gap-hairline": "ChipGroup_gap-hairline",
368
- "gap-tight": "ChipGroup_gap-tight",
369
- "gap-base": "ChipGroup_gap-base"
370
- };
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" };
371
324
  function ChipGroup({ children, gap = "tight", className, ...rest }) {
372
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx(ChipGroup_default.group, ChipGroup_default[`gap-${gap}`], className), ...rest, children });
325
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx(ChipGroup_module_default.group, ChipGroup_module_default[`gap-${gap}`], className), ...rest, children });
373
326
  }
374
327
 
375
- // src/components/Chip/ChipBar.module.css
376
- var ChipBar_default = {
377
- bar: "ChipBar_bar",
378
- "gap-hairline": "ChipBar_gap-hairline",
379
- "gap-tight": "ChipBar_gap-tight",
380
- "gap-base": "ChipBar_gap-base",
381
- bordered: "ChipBar_bordered",
382
- fade: "ChipBar_fade",
383
- item: "ChipBar_item"
384
- };
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" };
385
330
  function ChipBar({
386
331
  children,
387
332
  gap = "tight",
@@ -393,20 +338,15 @@ function ChipBar({
393
338
  return /* @__PURE__ */ jsxRuntime.jsx(
394
339
  "div",
395
340
  {
396
- className: cx(ChipBar_default.bar, ChipBar_default[`gap-${gap}`], bordered && ChipBar_default.bordered, fade && ChipBar_default.fade, className),
341
+ className: cx(ChipBar_module_default.bar, ChipBar_module_default[`gap-${gap}`], bordered && ChipBar_module_default.bordered, fade && ChipBar_module_default.fade, className),
397
342
  ...rest,
398
- children: react.Children.map(children, (child) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: ChipBar_default.item, children: child }))
343
+ children: react.Children.map(children, (child) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: ChipBar_module_default.item, children: child }))
399
344
  }
400
345
  );
401
346
  }
402
347
 
403
- // src/components/CountButton/CountButton.module.css
404
- var CountButton_default = {
405
- button: "CountButton_button",
406
- "tone-accent": "CountButton_tone-accent",
407
- "tone-danger": "CountButton_tone-danger",
408
- glyph: "CountButton_glyph"
409
- };
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" };
410
350
  var SPINNER_PX2 = 20;
411
351
  function CountButton({
412
352
  icon,
@@ -428,24 +368,18 @@ function CountButton({
428
368
  "aria-label": label,
429
369
  "aria-pressed": isToggle ? active : void 0,
430
370
  "aria-busy": loading || void 0,
431
- className: cx(CountButton_default.button, active && CountButton_default[`tone-${tone}`], className),
371
+ className: cx(CountButton_module_default.button, active && CountButton_module_default[`tone-${tone}`], className),
432
372
  ...rest,
433
373
  children: [
434
- loading ? /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: SPINNER_PX2, label: "", "aria-hidden": "true" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: CountButton_default.glyph, children: icon }),
374
+ loading ? /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: SPINNER_PX2, label: "", "aria-hidden": "true" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: CountButton_module_default.glyph, children: icon }),
435
375
  children != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { children }) : null
436
376
  ]
437
377
  }
438
378
  );
439
379
  }
440
380
 
441
- // src/components/Field/Field.module.css
442
- var Field_default = {
443
- field: "Field_field",
444
- label: "Field_label",
445
- required: "Field_required",
446
- message: "Field_message",
447
- error: "Field_error"
448
- };
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" };
449
383
  var FieldContext = react.createContext(null);
450
384
  function useFieldContext() {
451
385
  return react.useContext(FieldContext);
@@ -454,10 +388,10 @@ function Field({ label, children, hint, error, required = false, className }) {
454
388
  const id = react.useId();
455
389
  const messageId = `${id}-message`;
456
390
  const message = error ?? hint;
457
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx(Field_default.field, className), children: [
458
- /* @__PURE__ */ jsxRuntime.jsxs("label", { className: Field_default.label, htmlFor: id, children: [
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: [
459
393
  label,
460
- required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: Field_default.required, "aria-hidden": "true", children: "*" })
394
+ required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: Field_module_default.required, "aria-hidden": "true", children: "*" })
461
395
  ] }),
462
396
  /* @__PURE__ */ jsxRuntime.jsx(
463
397
  FieldContext.Provider,
@@ -466,34 +400,27 @@ function Field({ label, children, hint, error, required = false, className }) {
466
400
  children
467
401
  }
468
402
  ),
469
- message && /* @__PURE__ */ jsxRuntime.jsx("span", { id: messageId, className: cx(Field_default.message, error !== void 0 && Field_default.error), children: message })
403
+ message && /* @__PURE__ */ jsxRuntime.jsx("span", { id: messageId, className: cx(Field_module_default.message, error !== void 0 && Field_module_default.error), children: message })
470
404
  ] });
471
405
  }
472
406
 
473
- // src/components/Select/Select.module.css
474
- var Select_default = {
475
- wrap: "Select_wrap",
476
- select: "Select_select",
477
- "size-sm": "Select_size-sm",
478
- "size-md": "Select_size-md",
479
- "size-lg": "Select_size-lg",
480
- chevron: "Select_chevron"
481
- };
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" };
482
409
  function Select({ size = "md", className, children, ...rest }) {
483
410
  const field = useFieldContext();
484
- return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: Select_default.wrap, children: [
411
+ return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: Select_module_default.wrap, children: [
485
412
  /* @__PURE__ */ jsxRuntime.jsx(
486
413
  "select",
487
414
  {
488
415
  id: rest.id ?? field?.id,
489
416
  "aria-describedby": rest["aria-describedby"] ?? field?.describedBy,
490
417
  "aria-invalid": rest["aria-invalid"] ?? (field?.invalid || void 0),
491
- className: cx(Select_default.select, Select_default[`size-${size}`], className),
418
+ className: cx(Select_module_default.select, Select_module_default[`size-${size}`], className),
492
419
  ...rest,
493
420
  children
494
421
  }
495
422
  ),
496
- /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className: Select_default.chevron, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4 6l4 4 4-4", fill: "none", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" }) })
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" }) })
497
424
  ] });
498
425
  }
499
426
  var OverlayHistoryContext = react.createContext(null);
@@ -563,14 +490,10 @@ function usePresence(open, durationMs) {
563
490
  return { mounted: open || mounted, visible: open };
564
491
  }
565
492
 
566
- // src/components/Overlay/Overlay.module.css
567
- var Overlay_default = {
568
- scrim: "Overlay_scrim",
569
- "variant-modal": "Overlay_variant-modal",
570
- "variant-sheet": "Overlay_variant-sheet"
571
- };
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" };
572
495
  var OVERLAY_EXIT_MS = 200;
573
- function Overlay({ open, onClose, label, variant, closeOnScrimClick, panelClassName, children }) {
496
+ function Overlay({ open, onClose, label, variant, role = "dialog", closeOnScrimClick, panelClassName, children }) {
574
497
  const { mounted, visible } = usePresence(open, OVERLAY_EXIT_MS);
575
498
  const ref = useOverlay({ open, onClose });
576
499
  if (!mounted) return null;
@@ -578,7 +501,7 @@ function Overlay({ open, onClose, label, variant, closeOnScrimClick, panelClassN
578
501
  /* @__PURE__ */ jsxRuntime.jsx(
579
502
  "div",
580
503
  {
581
- className: cx(Overlay_default.scrim, Overlay_default[`variant-${variant}`]),
504
+ className: cx(Overlay_module_default.scrim, Overlay_module_default[`variant-${variant}`]),
582
505
  "data-open": visible || void 0,
583
506
  "data-testid": "mds-scrim",
584
507
  onClick: closeOnScrimClick ? onClose : void 0,
@@ -586,7 +509,7 @@ function Overlay({ open, onClose, label, variant, closeOnScrimClick, panelClassN
586
509
  "div",
587
510
  {
588
511
  ref,
589
- role: "dialog",
512
+ role,
590
513
  "aria-modal": "true",
591
514
  "aria-label": label,
592
515
  tabIndex: -1,
@@ -602,13 +525,8 @@ function Overlay({ open, onClose, label, variant, closeOnScrimClick, panelClassN
602
525
  );
603
526
  }
604
527
 
605
- // src/components/Sheet/Sheet.module.css
606
- var Sheet_default = {
607
- panel: "Sheet_panel",
608
- header: "Sheet_header",
609
- body: "Sheet_body",
610
- footer: "Sheet_footer"
611
- };
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" };
612
530
  function Sheet({ open, onClose, label, closeOnScrimClick = true, children }) {
613
531
  return /* @__PURE__ */ jsxRuntime.jsx(
614
532
  Overlay,
@@ -618,41 +536,26 @@ function Sheet({ open, onClose, label, closeOnScrimClick = true, children }) {
618
536
  label,
619
537
  variant: "sheet",
620
538
  closeOnScrimClick,
621
- panelClassName: Sheet_default.panel,
539
+ panelClassName: Sheet_module_default.panel,
622
540
  children
623
541
  }
624
542
  );
625
543
  }
626
- function SheetHeader({ children }) {
627
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: Sheet_default.header, children });
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
+ ] });
628
549
  }
629
550
  function SheetBody({ children }) {
630
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: Sheet_default.body, children });
551
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: Sheet_module_default.body, children });
631
552
  }
632
553
  function SheetFooter({ children }) {
633
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: Sheet_default.footer, children });
554
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: Sheet_module_default.footer, children });
634
555
  }
635
556
 
636
- // src/components/DateTimePicker/DateTimePicker.module.css
637
- var DateTimePicker_default = {
638
- trigger: "DateTimePicker_trigger",
639
- hasValue: "DateTimePicker_hasValue",
640
- triggerLabel: "DateTimePicker_triggerLabel",
641
- glyph: "DateTimePicker_glyph",
642
- timeRow: "DateTimePicker_timeRow",
643
- grow: "DateTimePicker_grow",
644
- meridiem: "DateTimePicker_meridiem",
645
- colon: "DateTimePicker_colon",
646
- calendarHeader: "DateTimePicker_calendarHeader",
647
- monthLabel: "DateTimePicker_monthLabel",
648
- weekdays: "DateTimePicker_weekdays",
649
- weekday: "DateTimePicker_weekday",
650
- grid: "DateTimePicker_grid",
651
- day: "DateTimePicker_day",
652
- today: "DateTimePicker_today",
653
- selected: "DateTimePicker_selected",
654
- outside: "DateTimePicker_outside"
655
- };
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" };
656
559
  var DEFAULT_LABELS = {
657
560
  dialog: "Pick date and time",
658
561
  previousMonth: "Previous month",
@@ -718,13 +621,13 @@ function minuteOptions(step) {
718
621
  function pad2(n) {
719
622
  return String(n).padStart(2, "0");
720
623
  }
721
- var chevronLeft = /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className: DateTimePicker_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" }) });
722
- var chevronRight = /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className: DateTimePicker_default.glyph, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6 3l5 5-5 5", fill: "none", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" }) });
723
- var calendarGlyph = /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className: DateTimePicker_default.glyph, children: [
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: [
724
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" }),
725
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" })
726
629
  ] });
727
- var clockGlyph = /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className: DateTimePicker_default.glyph, children: [
630
+ var clockGlyph = /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className: DateTimePicker_module_default.glyph, children: [
728
631
  /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "8", cy: "8", r: "5.75", fill: "none", stroke: "currentColor", strokeWidth: "1.5" }),
729
632
  /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8 5v3.25l2 1.5", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
730
633
  ] });
@@ -741,6 +644,7 @@ function DateTimePicker({
741
644
  labels
742
645
  }) {
743
646
  const text = { ...DEFAULT_LABELS, ...labels };
647
+ const field = useFieldContext();
744
648
  const intl = react.useMemo(() => localeData(locale), [locale]);
745
649
  const [open, setOpen] = react.useState(false);
746
650
  const [draft, setDraft] = react.useState(() => /* @__PURE__ */ new Date());
@@ -896,7 +800,7 @@ function DateTimePicker({
896
800
  "aria-pressed": isSelected,
897
801
  onClick: inMonth ? () => pickDay(cell.getDate()) : void 0,
898
802
  onKeyDown: inMonth && !isDisabled ? (e) => onDayKeyDown(e, cell) : void 0,
899
- className: cx(DateTimePicker_default.day, isToday && DateTimePicker_default.today, isSelected && DateTimePicker_default.selected, !inMonth && DateTimePicker_default.outside),
803
+ className: cx(DateTimePicker_module_default.day, isToday && DateTimePicker_module_default.today, isSelected && DateTimePicker_module_default.selected, !inMonth && DateTimePicker_module_default.outside),
900
804
  children: cell.getDate()
901
805
  },
902
806
  `c-${i}`
@@ -906,41 +810,42 @@ function DateTimePicker({
906
810
  /* @__PURE__ */ jsxRuntime.jsxs(
907
811
  "button",
908
812
  {
909
- id,
813
+ id: id ?? field?.id,
910
814
  type: "button",
911
815
  disabled,
816
+ "aria-describedby": field?.describedBy,
912
817
  "aria-haspopup": "dialog",
913
818
  "aria-expanded": open,
914
819
  "aria-label": ariaLabel ? `${ariaLabel}: ${value ? intl.full.format(new Date(value)) : placeholder}` : void 0,
915
820
  onClick: openPicker,
916
- className: cx(DateTimePicker_default.trigger, value && DateTimePicker_default.hasValue),
821
+ className: cx(DateTimePicker_module_default.trigger, value && DateTimePicker_module_default.hasValue),
917
822
  children: [
918
823
  calendarGlyph,
919
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: DateTimePicker_default.triggerLabel, children: value ? intl.full.format(new Date(value)) : placeholder })
824
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: DateTimePicker_module_default.triggerLabel, children: value ? intl.full.format(new Date(value)) : placeholder })
920
825
  ]
921
826
  }
922
827
  ),
923
828
  /* @__PURE__ */ jsxRuntime.jsxs(Sheet, { open, onClose: () => setOpen(false), label: ariaLabel ?? text.dialog, children: [
924
829
  /* @__PURE__ */ jsxRuntime.jsx(SheetHeader, { children: intl.full.format(draft) }),
925
830
  /* @__PURE__ */ jsxRuntime.jsxs(SheetBody, { children: [
926
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: DateTimePicker_default.timeRow, children: [
831
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: DateTimePicker_module_default.timeRow, children: [
927
832
  clockGlyph,
928
833
  intl.hour12 ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
929
- /* @__PURE__ */ jsxRuntime.jsx(Select, { "aria-label": text.hour, value: String(h12), onChange: (e) => setHour(e.target.value), className: DateTimePicker_default.grow, children: Array.from({ length: 12 }, (_, i) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: String(i + 1), children: i + 1 }, i + 1)) }),
930
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: DateTimePicker_default.colon, "aria-hidden": "true", children: ":" }),
931
- /* @__PURE__ */ jsxRuntime.jsx(Select, { "aria-label": text.minute, value: String(draft.getMinutes()), onChange: (e) => setMinute(e.target.value), className: DateTimePicker_default.grow, children: minuteOptions(minuteStep).map((m) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: String(m), children: pad2(m) }, m)) }),
932
- /* @__PURE__ */ jsxRuntime.jsxs(Select, { "aria-label": text.dayPeriod, value: isPM ? "pm" : "am", onChange: (e) => setMeridiem(e.target.value), className: DateTimePicker_default.meridiem, children: [
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: [
933
838
  /* @__PURE__ */ jsxRuntime.jsx("option", { value: "am", children: intl.dayPeriods[0] }),
934
839
  /* @__PURE__ */ jsxRuntime.jsx("option", { value: "pm", children: intl.dayPeriods[1] })
935
840
  ] })
936
841
  ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
937
- /* @__PURE__ */ jsxRuntime.jsx(Select, { "aria-label": text.hour, value: String(h24), onChange: (e) => setHour(e.target.value), className: DateTimePicker_default.grow, children: Array.from({ length: 24 }, (_, i) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: String(i), children: pad2(i) }, i)) }),
938
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: DateTimePicker_default.colon, "aria-hidden": "true", children: ":" }),
939
- /* @__PURE__ */ jsxRuntime.jsx(Select, { "aria-label": text.minute, value: String(draft.getMinutes()), onChange: (e) => setMinute(e.target.value), className: DateTimePicker_default.grow, children: minuteOptions(minuteStep).map((m) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: String(m), children: pad2(m) }, m)) })
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)) })
940
845
  ] })
941
846
  ] }),
942
847
  /* @__PURE__ */ jsxRuntime.jsxs("div", { role: "group", "aria-label": intl.monthTitle.format(first), children: [
943
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: DateTimePicker_default.calendarHeader, children: [
848
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: DateTimePicker_module_default.calendarHeader, children: [
944
849
  /* @__PURE__ */ jsxRuntime.jsx(
945
850
  Button,
946
851
  {
@@ -953,11 +858,11 @@ function DateTimePicker({
953
858
  children: chevronLeft
954
859
  }
955
860
  ),
956
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: DateTimePicker_default.monthLabel, children: intl.monthTitle.format(first) }),
861
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: DateTimePicker_module_default.monthLabel, children: intl.monthTitle.format(first) }),
957
862
  /* @__PURE__ */ jsxRuntime.jsx(Button, { iconOnly: true, "aria-label": text.nextMonth, variant: "ghost", size: "sm", onClick: () => shiftMonth(1), children: chevronRight })
958
863
  ] }),
959
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: DateTimePicker_default.weekdays, children: intl.weekdays.map((w, i) => /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", className: DateTimePicker_default.weekday, children: w }, `wd-${i}`)) }),
960
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: DateTimePicker_default.grid, children: dayCells })
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 })
961
866
  ] })
962
867
  ] }),
963
868
  /* @__PURE__ */ jsxRuntime.jsxs(SheetFooter, { children: [
@@ -968,56 +873,41 @@ function DateTimePicker({
968
873
  ] });
969
874
  }
970
875
 
971
- // src/components/Tag/Tag.module.css
972
- var Tag_default = {
973
- tag: "Tag_tag",
974
- "tone-accent": "Tag_tone-accent",
975
- remove: "Tag_remove",
976
- removeGlyph: "Tag_removeGlyph"
977
- };
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" };
978
878
  function Tag({ children, tone = "neutral", onRemove, className, ...rest }) {
979
879
  const text = typeof children === "string" ? children : void 0;
980
- return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: cx(Tag_default.tag, Tag_default[`tone-${tone}`], className), ...rest, children: [
880
+ return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: cx(Tag_module_default.tag, Tag_module_default[`tone-${tone}`], className), ...rest, children: [
981
881
  children,
982
882
  onRemove && /* @__PURE__ */ jsxRuntime.jsx(
983
883
  "button",
984
884
  {
985
885
  type: "button",
986
- className: Tag_default.remove,
886
+ className: Tag_module_default.remove,
987
887
  "aria-label": text ? `Remove ${text}` : "Remove",
988
888
  onClick: onRemove,
989
- children: /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className: Tag_default.removeGlyph, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4 4l8 8M12 4l-8 8", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round" }) })
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" }) })
990
890
  }
991
891
  )
992
892
  ] });
993
893
  }
994
894
 
995
- // src/components/Divider/Divider.module.css
996
- var Divider_default = {
997
- divider: "Divider_divider",
998
- horizontal: "Divider_horizontal",
999
- vertical: "Divider_vertical"
1000
- };
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" };
1001
897
  function Divider({ orientation = "horizontal", className, ...rest }) {
1002
898
  return /* @__PURE__ */ jsxRuntime.jsx(
1003
899
  "div",
1004
900
  {
1005
901
  role: "separator",
1006
902
  "aria-orientation": orientation === "vertical" ? "vertical" : void 0,
1007
- className: cx(Divider_default.divider, Divider_default[orientation], className),
903
+ className: cx(Divider_module_default.divider, Divider_module_default[orientation], className),
1008
904
  ...rest
1009
905
  }
1010
906
  );
1011
907
  }
1012
908
 
1013
- // src/components/Skeleton/Skeleton.module.css
1014
- var Skeleton_default = {
1015
- skeleton: "Skeleton_skeleton",
1016
- pulse: "Skeleton_pulse",
1017
- "variant-text": "Skeleton_variant-text",
1018
- "variant-rect": "Skeleton_variant-rect",
1019
- "variant-circle": "Skeleton_variant-circle"
1020
- };
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" };
1021
911
  function Skeleton({
1022
912
  variant = "text",
1023
913
  width,
@@ -1034,18 +924,15 @@ function Skeleton({
1034
924
  "span",
1035
925
  {
1036
926
  "aria-hidden": "true",
1037
- className: cx(Skeleton_default.skeleton, Skeleton_default[`variant-${variant}`], className),
927
+ className: cx(Skeleton_module_default.skeleton, Skeleton_module_default[`variant-${variant}`], className),
1038
928
  style: { ...vars, ...style },
1039
929
  ...rest
1040
930
  }
1041
931
  );
1042
932
  }
1043
933
 
1044
- // src/components/ProgressBar/ProgressBar.module.css
1045
- var ProgressBar_default = {
1046
- track: "ProgressBar_track",
1047
- fill: "ProgressBar_fill",
1048
- 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"};
1049
936
  function ProgressBar({
1050
937
  value = 0,
1051
938
  label,
@@ -1063,50 +950,60 @@ function ProgressBar({
1063
950
  "aria-valuemin": 0,
1064
951
  "aria-valuemax": 100,
1065
952
  "aria-valuenow": indeterminate ? void 0 : clamped,
1066
- className: cx(ProgressBar_default.track, indeterminate && ProgressBar_default.indeterminate, className),
953
+ className: cx(ProgressBar_module_default.track, indeterminate && ProgressBar_module_default.indeterminate, className),
1067
954
  style: { ...{ "--progress": `${clamped}%` }, ...style },
1068
955
  ...rest,
1069
- children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: ProgressBar_default.fill })
956
+ children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: ProgressBar_module_default.fill })
1070
957
  }
1071
958
  );
1072
959
  }
1073
960
 
1074
- // src/components/Input/Input.module.css
1075
- var Input_default = {
1076
- input: "Input_input",
1077
- "size-sm": "Input_size-sm",
1078
- "size-md": "Input_size-md",
1079
- "size-lg": "Input_size-lg"
1080
- };
1081
- function Input({ size = "md", className, ...rest }) {
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" };
963
+ function Input({
964
+ size = "md",
965
+ invalid,
966
+ iconLeft,
967
+ iconRight,
968
+ className,
969
+ ...rest
970
+ }) {
1082
971
  const field = useFieldContext();
1083
- return /* @__PURE__ */ jsxRuntime.jsx(
972
+ const input = /* @__PURE__ */ jsxRuntime.jsx(
1084
973
  "input",
1085
974
  {
1086
975
  id: rest.id ?? field?.id,
1087
976
  "aria-describedby": rest["aria-describedby"] ?? field?.describedBy,
1088
- "aria-invalid": rest["aria-invalid"] ?? (field?.invalid || void 0),
1089
- className: cx(Input_default.input, Input_default[`size-${size}`], className),
977
+ "aria-invalid": rest["aria-invalid"] ?? ((invalid ?? field?.invalid) || void 0),
978
+ className: cx(
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"],
983
+ className
984
+ ),
1090
985
  ...rest
1091
986
  }
1092
987
  );
988
+ if (iconLeft == null && iconRight == null) return input;
989
+ return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: Input_module_default.iconWrap, children: [
990
+ input,
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 })
993
+ ] });
1093
994
  }
1094
995
 
1095
- // src/components/PasswordInput/PasswordInput.module.css
1096
- var PasswordInput_default = {
1097
- wrap: "PasswordInput_wrap",
1098
- input: "PasswordInput_input",
1099
- toggle: "PasswordInput_toggle"
1100
- };
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" };
1101
998
  function PasswordInput({ className, ...rest }) {
1102
999
  const [visible, setVisible] = react.useState(false);
1103
- return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: PasswordInput_default.wrap, children: [
1104
- /* @__PURE__ */ jsxRuntime.jsx(Input, { ...rest, type: visible ? "text" : "password", className: cx(PasswordInput_default.input, className) }),
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) }),
1105
1002
  /* @__PURE__ */ jsxRuntime.jsx(
1106
1003
  "button",
1107
1004
  {
1108
1005
  type: "button",
1109
- className: PasswordInput_default.toggle,
1006
+ className: PasswordInput_module_default.toggle,
1110
1007
  "aria-label": visible ? "Hide password" : "Show password",
1111
1008
  "aria-pressed": visible,
1112
1009
  onClick: () => setVisible((v) => !v),
@@ -1130,12 +1027,8 @@ function PasswordInput({ className, ...rest }) {
1130
1027
  ] });
1131
1028
  }
1132
1029
 
1133
- // src/components/Textarea/Textarea.module.css
1134
- var Textarea_default = {
1135
- textarea: "Textarea_textarea",
1136
- wrap: "Textarea_wrap",
1137
- count: "Textarea_count"
1138
- };
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" };
1139
1032
  function Textarea({ rows = 3, showCount = false, className, ...rest }) {
1140
1033
  const field = useFieldContext();
1141
1034
  const [tracked, setTracked] = react.useState(() => String(rest.defaultValue ?? ""));
@@ -1151,73 +1044,76 @@ function Textarea({ rows = 3, showCount = false, className, ...rest }) {
1151
1044
  "aria-describedby": rest["aria-describedby"] ?? field?.describedBy,
1152
1045
  "aria-invalid": rest["aria-invalid"] ?? (field?.invalid || void 0),
1153
1046
  rows,
1154
- className: cx(Textarea_default.textarea, className),
1047
+ className: cx(Textarea_module_default.textarea, className),
1155
1048
  ...rest,
1156
1049
  ...showCount ? { onChange } : {}
1157
1050
  }
1158
1051
  );
1159
1052
  if (!showCount) return textarea;
1160
- return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: Textarea_default.wrap, children: [
1053
+ return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: Textarea_module_default.wrap, children: [
1161
1054
  textarea,
1162
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: Textarea_default.count, "aria-hidden": "true", children: rest.maxLength !== void 0 ? `${current.length}/${rest.maxLength}` : current.length })
1055
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: Textarea_module_default.count, "aria-hidden": "true", children: rest.maxLength !== void 0 ? `${current.length}/${rest.maxLength}` : current.length })
1163
1056
  ] });
1164
1057
  }
1165
1058
 
1166
- // src/components/Checkbox/Checkbox.module.css
1167
- var Checkbox_default = {
1168
- root: "Checkbox_root",
1169
- box: "Checkbox_box",
1170
- label: "Checkbox_label"
1171
- };
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" };
1172
1061
  function Checkbox({ label, className, ...rest }) {
1173
- return /* @__PURE__ */ jsxRuntime.jsxs("label", { className: cx(Checkbox_default.root, className), children: [
1174
- /* @__PURE__ */ jsxRuntime.jsx("input", { type: "checkbox", className: Checkbox_default.box, ...rest }),
1175
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: Checkbox_default.label, children: label })
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 })
1176
1065
  ] });
1177
1066
  }
1178
1067
 
1179
- // src/components/Radio/Radio.module.css
1180
- var Radio_default = {
1181
- root: "Radio_root",
1182
- dot: "Radio_dot",
1183
- label: "Radio_label"
1184
- };
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" };
1185
1070
  function Radio({ label, className, ...rest }) {
1186
- return /* @__PURE__ */ jsxRuntime.jsxs("label", { className: cx(Radio_default.root, className), children: [
1187
- /* @__PURE__ */ jsxRuntime.jsx("input", { type: "radio", className: Radio_default.dot, ...rest }),
1188
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: Radio_default.label, children: label })
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 })
1189
1074
  ] });
1190
1075
  }
1191
1076
 
1192
- // src/components/Switch/Switch.module.css
1193
- var Switch_default = {
1194
- root: "Switch_root",
1195
- track: "Switch_track",
1196
- label: "Switch_label"
1197
- };
1198
- function Switch({ label, className, ...rest }) {
1199
- return /* @__PURE__ */ jsxRuntime.jsxs("label", { className: cx(Switch_default.root, className), children: [
1200
- /* @__PURE__ */ jsxRuntime.jsx("input", { type: "checkbox", role: "switch", className: Switch_default.track, ...rest }),
1201
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: Switch_default.label, children: label })
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" };
1079
+ function Switch({
1080
+ label,
1081
+ loading = false,
1082
+ disabled = false,
1083
+ className,
1084
+ ...rest
1085
+ }) {
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: [
1088
+ /* @__PURE__ */ jsxRuntime.jsx(
1089
+ "input",
1090
+ {
1091
+ type: "checkbox",
1092
+ role: "switch",
1093
+ className: Switch_module_default.track,
1094
+ disabled: disabled || loading,
1095
+ "aria-busy": loading || void 0,
1096
+ ...rest
1097
+ }
1098
+ ),
1099
+ loading && /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: 12, label: "", "aria-hidden": "true", className: Switch_module_default.spinner })
1100
+ ] }),
1101
+ label !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: Switch_module_default.label, children: label })
1202
1102
  ] });
1203
1103
  }
1204
1104
 
1205
- // src/components/SegmentedControl/SegmentedControl.module.css
1206
- var SegmentedControl_default = {
1207
- group: "SegmentedControl_group",
1208
- segment: "SegmentedControl_segment",
1209
- input: "SegmentedControl_input",
1210
- face: "SegmentedControl_face"
1211
- };
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" };
1212
1107
  function SegmentedControl({
1213
1108
  label,
1214
1109
  options,
1215
1110
  value,
1216
1111
  onChange,
1112
+ disabled = false,
1217
1113
  className
1218
1114
  }) {
1219
1115
  const name = react.useId();
1220
- return /* @__PURE__ */ jsxRuntime.jsx("div", { role: "radiogroup", "aria-label": label, className: cx(SegmentedControl_default.group, className), children: options.map((option) => /* @__PURE__ */ jsxRuntime.jsxs("label", { className: SegmentedControl_default.segment, children: [
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: [
1221
1117
  /* @__PURE__ */ jsxRuntime.jsx(
1222
1118
  "input",
1223
1119
  {
@@ -1226,24 +1122,19 @@ function SegmentedControl({
1226
1122
  value: option.value,
1227
1123
  checked: option.value === value,
1228
1124
  onChange: () => onChange(option.value),
1229
- className: SegmentedControl_default.input
1125
+ disabled,
1126
+ className: SegmentedControl_module_default.input
1230
1127
  }
1231
1128
  ),
1232
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: SegmentedControl_default.face, children: option.label })
1129
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: SegmentedControl_module_default.face, children: option.label })
1233
1130
  ] }, option.value)) });
1234
1131
  }
1235
1132
 
1236
- // src/components/SearchField/SearchField.module.css
1237
- var SearchField_default = {
1238
- wrap: "SearchField_wrap",
1239
- glass: "SearchField_glass",
1240
- input: "SearchField_input",
1241
- clear: "SearchField_clear",
1242
- clearGlyph: "SearchField_clearGlyph"
1243
- };
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" };
1244
1135
  function SearchField({ label, value, onChange, className, ...rest }) {
1245
- return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: cx(SearchField_default.wrap, className), children: [
1246
- /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className: SearchField_default.glass, children: /* @__PURE__ */ jsxRuntime.jsx(
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(
1247
1138
  "path",
1248
1139
  {
1249
1140
  d: "M7 12a5 5 0 1 1 0-10 5 5 0 0 1 0 10Zm7 2-3.5-3.5",
@@ -1260,7 +1151,7 @@ function SearchField({ label, value, onChange, className, ...rest }) {
1260
1151
  "aria-label": label,
1261
1152
  value,
1262
1153
  onChange: (event) => onChange(event.target.value),
1263
- className: SearchField_default.input,
1154
+ className: SearchField_module_default.input,
1264
1155
  ...rest
1265
1156
  }
1266
1157
  ),
@@ -1269,28 +1160,32 @@ function SearchField({ label, value, onChange, className, ...rest }) {
1269
1160
  {
1270
1161
  type: "button",
1271
1162
  "aria-label": "Clear search",
1272
- className: SearchField_default.clear,
1163
+ className: SearchField_module_default.clear,
1273
1164
  onClick: () => onChange(""),
1274
- children: /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className: SearchField_default.clearGlyph, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4 4l8 8M12 4l-8 8", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round" }) })
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" }) })
1275
1166
  }
1276
1167
  )
1277
1168
  ] });
1278
1169
  }
1279
1170
 
1280
- // src/components/List/List.module.css
1281
- var List_default = {
1282
- group: "List_group",
1283
- item: "List_item",
1284
- row: "List_row",
1285
- interactive: "List_interactive",
1286
- leading: "List_leading",
1287
- trailing: "List_trailing",
1288
- text: "List_text",
1289
- title: "List_title",
1290
- description: "List_description"
1291
- };
1292
- function ListGroup({ className, ...rest }) {
1293
- return /* @__PURE__ */ jsxRuntime.jsx("ul", { className: cx(List_default.group, className), ...rest });
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" };
1173
+ var ListGroupContext = react.createContext(false);
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
+ ] });
1294
1189
  }
1295
1190
  function ListItem({
1296
1191
  title,
@@ -1298,43 +1193,55 @@ function ListItem({
1298
1193
  leading,
1299
1194
  trailing,
1300
1195
  onClick,
1196
+ pressed,
1301
1197
  href,
1198
+ surface,
1302
1199
  className,
1303
1200
  ...rest
1304
1201
  }) {
1202
+ const inGroup = react.useContext(ListGroupContext);
1203
+ const Root = inGroup ? "li" : "div";
1204
+ const resolved = surface ?? (inGroup ? void 0 : "card");
1305
1205
  const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1306
- leading != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: List_default.leading, children: leading }),
1307
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: List_default.text, children: [
1308
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: List_default.title, children: title }),
1309
- description != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: List_default.description, children: description })
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 })
1310
1210
  ] }),
1311
- trailing != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: List_default.trailing, children: trailing })
1211
+ trailing != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: List_module_default.trailing, children: trailing })
1312
1212
  ] });
1313
- return /* @__PURE__ */ jsxRuntime.jsx("li", { className: cx(List_default.item, className), ...rest, children: href !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx("a", { className: cx(List_default.row, List_default.interactive), href, children: content }) : onClick !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: cx(List_default.row, List_default.interactive), onClick, children: content }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: List_default.row, children: content }) });
1213
+ return /* @__PURE__ */ jsxRuntime.jsx(
1214
+ Root,
1215
+ {
1216
+ className: cx(List_module_default.item, resolved && List_module_default[`surface-${resolved}`], className),
1217
+ ...rest,
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 })
1228
+ }
1229
+ );
1314
1230
  }
1315
1231
 
1316
- // src/components/EmptyState/EmptyState.module.css
1317
- var EmptyState_default = {
1318
- root: "EmptyState_root",
1319
- icon: "EmptyState_icon",
1320
- action: "EmptyState_action"
1321
- };
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" };
1322
1234
  function EmptyState({ title, description, icon, action, className }) {
1323
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx(EmptyState_default.root, className), children: [
1324
- icon != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: EmptyState_default.icon, "aria-hidden": "true", children: icon }),
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 }),
1325
1237
  /* @__PURE__ */ jsxRuntime.jsx(Heading, { level: 3, children: title }),
1326
1238
  description !== void 0 && /* @__PURE__ */ jsxRuntime.jsx(Text, { tone: "secondary", children: description }),
1327
- action != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: EmptyState_default.action, children: action })
1239
+ action != null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: EmptyState_module_default.action, children: action })
1328
1240
  ] });
1329
1241
  }
1330
1242
 
1331
- // src/components/Tabs/Tabs.module.css
1332
- var Tabs_default = {
1333
- list: "Tabs_list",
1334
- tab: "Tabs_tab",
1335
- selected: "Tabs_selected",
1336
- panel: "Tabs_panel"
1337
- };
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" };
1338
1245
  var TabsContext = react.createContext(null);
1339
1246
  function useTabs(component) {
1340
1247
  const context = react.useContext(TabsContext);
@@ -1343,7 +1250,18 @@ function useTabs(component) {
1343
1250
  }
1344
1251
  function Tabs({ value, onChange, children }) {
1345
1252
  const baseId = react.useId();
1346
- return /* @__PURE__ */ jsxRuntime.jsx(TabsContext.Provider, { value: { value, onChange, baseId }, children });
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 });
1347
1265
  }
1348
1266
  function onArrow(event, onChange) {
1349
1267
  const keys = ["ArrowLeft", "ArrowRight", "Home", "End"];
@@ -1366,7 +1284,7 @@ function TabList({ label, className, children, ...rest }) {
1366
1284
  {
1367
1285
  role: "tablist",
1368
1286
  "aria-label": label,
1369
- className: cx(Tabs_default.list, className),
1287
+ className: cx(Tabs_module_default.list, className),
1370
1288
  onKeyDown: (event) => onArrow(event, onChange),
1371
1289
  ...rest,
1372
1290
  children
@@ -1383,10 +1301,10 @@ function Tab({ value, className, children, ...rest }) {
1383
1301
  role: "tab",
1384
1302
  id: `${tabs.baseId}-tab-${value}`,
1385
1303
  "aria-selected": selected,
1386
- "aria-controls": `${tabs.baseId}-panel-${value}`,
1304
+ "aria-controls": tabs.panels.has(value) ? `${tabs.baseId}-panel-${value}` : void 0,
1387
1305
  tabIndex: selected ? 0 : -1,
1388
1306
  "data-value": value,
1389
- className: cx(Tabs_default.tab, selected && Tabs_default.selected, className),
1307
+ className: cx(Tabs_module_default.tab, selected && Tabs_module_default.selected, className),
1390
1308
  onClick: () => tabs.onChange(value),
1391
1309
  ...rest,
1392
1310
  children
@@ -1396,6 +1314,8 @@ function Tab({ value, className, children, ...rest }) {
1396
1314
  function TabPanel({ value, className, children, ...rest }) {
1397
1315
  const tabs = useTabs("TabPanel");
1398
1316
  const selected = tabs.value === value;
1317
+ const { registerPanel } = tabs;
1318
+ react.useEffect(() => registerPanel(value), [registerPanel, value]);
1399
1319
  return /* @__PURE__ */ jsxRuntime.jsx(
1400
1320
  "div",
1401
1321
  {
@@ -1403,32 +1323,26 @@ function TabPanel({ value, className, children, ...rest }) {
1403
1323
  id: `${tabs.baseId}-panel-${value}`,
1404
1324
  "aria-labelledby": `${tabs.baseId}-tab-${value}`,
1405
1325
  hidden: !selected,
1406
- className: cx(Tabs_default.panel, className),
1326
+ className: cx(Tabs_module_default.panel, className),
1407
1327
  ...rest,
1408
1328
  children
1409
1329
  }
1410
1330
  );
1411
1331
  }
1412
1332
 
1413
- // src/components/Toast/Toast.module.css
1414
- var Toast_default = {
1415
- viewport: "Toast_viewport",
1416
- toast: "Toast_toast",
1417
- "tone-success": "Toast_tone-success",
1418
- "tone-danger": "Toast_tone-danger",
1419
- body: "Toast_body",
1420
- title: "Toast_title",
1421
- description: "Toast_description",
1422
- close: "Toast_close",
1423
- closeGlyph: "Toast_closeGlyph"
1424
- };
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" };
1425
1335
  var ToastContext = react.createContext(null);
1426
1336
  function useToast() {
1427
1337
  const context = react.useContext(ToastContext);
1428
1338
  if (context === null) throw new Error("useToast needs a <ToastProvider> above it");
1429
1339
  return context;
1430
1340
  }
1431
- function ToastProvider({ children }) {
1341
+ function ToastProvider({
1342
+ children,
1343
+ regionLabel = "Notifications",
1344
+ dismissLabel = "Dismiss"
1345
+ }) {
1432
1346
  const [toasts, setToasts] = react.useState([]);
1433
1347
  const nextId = react.useRef(1);
1434
1348
  const dismiss = react.useCallback((id) => {
@@ -1446,38 +1360,27 @@ function ToastProvider({ children }) {
1446
1360
  const value = react.useMemo(() => ({ toast, dismiss }), [toast, dismiss]);
1447
1361
  return /* @__PURE__ */ jsxRuntime.jsxs(ToastContext.Provider, { value, children: [
1448
1362
  children,
1449
- /* @__PURE__ */ jsxRuntime.jsx("div", { role: "region", "aria-label": "Notifications", className: Toast_default.viewport, children: toasts.map((entry) => /* @__PURE__ */ jsxRuntime.jsxs("div", { role: "status", className: cx(Toast_default.toast, Toast_default[`tone-${entry.tone}`]), children: [
1450
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: Toast_default.body, children: [
1451
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: Toast_default.title, children: entry.title }),
1452
- entry.description !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: Toast_default.description, children: entry.description })
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 })
1453
1367
  ] }),
1454
1368
  /* @__PURE__ */ jsxRuntime.jsx(
1455
1369
  "button",
1456
1370
  {
1457
1371
  type: "button",
1458
- "aria-label": "Dismiss",
1459
- className: Toast_default.close,
1372
+ "aria-label": `${dismissLabel}: ${entry.title}`,
1373
+ className: Toast_module_default.close,
1460
1374
  onClick: () => dismiss(entry.id),
1461
- children: /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className: Toast_default.closeGlyph, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4 4l8 8M12 4l-8 8", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round" }) })
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" }) })
1462
1376
  }
1463
1377
  )
1464
1378
  ] }, entry.id)) })
1465
1379
  ] });
1466
1380
  }
1467
1381
 
1468
- // src/components/Stack/Stack.module.css
1469
- var Stack_default = {
1470
- stack: "Stack_stack",
1471
- "gap-hairline": "Stack_gap-hairline",
1472
- "gap-tight": "Stack_gap-tight",
1473
- "gap-base": "Stack_gap-base",
1474
- "gap-loose": "Stack_gap-loose",
1475
- "gap-section": "Stack_gap-section",
1476
- "align-start": "Stack_align-start",
1477
- "align-center": "Stack_align-center",
1478
- "align-end": "Stack_align-end",
1479
- "align-stretch": "Stack_align-stretch"
1480
- };
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" };
1481
1384
 
1482
1385
  // src/components/Stack/Stack.tsx
1483
1386
  function Stack({
@@ -1488,28 +1391,13 @@ function Stack({
1488
1391
  ...rest
1489
1392
  }) {
1490
1393
  return react.createElement(as, {
1491
- className: cx(Stack_default.stack, Stack_default[`gap-${gap}`], Stack_default[`align-${align}`], className),
1394
+ className: cx(Stack_module_default.stack, Stack_module_default[`gap-${gap}`], Stack_module_default[`align-${align}`], className),
1492
1395
  ...rest
1493
1396
  });
1494
1397
  }
1495
1398
 
1496
- // src/components/Inline/Inline.module.css
1497
- var Inline_default = {
1498
- inline: "Inline_inline",
1499
- "gap-hairline": "Inline_gap-hairline",
1500
- "gap-tight": "Inline_gap-tight",
1501
- "gap-base": "Inline_gap-base",
1502
- "gap-loose": "Inline_gap-loose",
1503
- "align-start": "Inline_align-start",
1504
- "align-center": "Inline_align-center",
1505
- "align-end": "Inline_align-end",
1506
- "align-baseline": "Inline_align-baseline",
1507
- "justify-start": "Inline_justify-start",
1508
- "justify-center": "Inline_justify-center",
1509
- "justify-end": "Inline_justify-end",
1510
- "justify-between": "Inline_justify-between",
1511
- wrap: "Inline_wrap"
1512
- };
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" };
1513
1401
 
1514
1402
  // src/components/Inline/Inline.tsx
1515
1403
  function Inline({
@@ -1523,23 +1411,19 @@ function Inline({
1523
1411
  }) {
1524
1412
  return react.createElement(as, {
1525
1413
  className: cx(
1526
- Inline_default.inline,
1527
- Inline_default[`gap-${gap}`],
1528
- Inline_default[`align-${align}`],
1529
- Inline_default[`justify-${justify}`],
1530
- wrap && Inline_default.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,
1531
1419
  className
1532
1420
  ),
1533
1421
  ...rest
1534
1422
  });
1535
1423
  }
1536
1424
 
1537
- // src/components/Container/Container.module.css
1538
- var Container_default = {
1539
- container: "Container_container",
1540
- "width-content": "Container_width-content",
1541
- "width-wide": "Container_width-wide"
1542
- };
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" };
1543
1427
 
1544
1428
  // src/components/Container/Container.tsx
1545
1429
  function Container({
@@ -1549,48 +1433,36 @@ function Container({
1549
1433
  ...rest
1550
1434
  }) {
1551
1435
  return react.createElement(as, {
1552
- className: cx(Container_default.container, Container_default[`width-${width}`], className),
1436
+ className: cx(Container_module_default.container, Container_module_default[`width-${width}`], className),
1553
1437
  ...rest
1554
1438
  });
1555
1439
  }
1556
1440
 
1557
- // src/components/Card/Card.module.css
1558
- var Card_default = {
1559
- card: "Card_card",
1560
- "variant-raised": "Card_variant-raised",
1561
- interactive: "Card_interactive",
1562
- header: "Card_header",
1563
- body: "Card_body",
1564
- footer: "Card_footer"
1565
- };
1566
- function Card({ children, variant = "card", onClick, href, className, ...rest }) {
1567
- 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);
1568
1445
  if (href !== void 0) {
1569
- return /* @__PURE__ */ jsxRuntime.jsx("a", { className: cx(cardClass, Card_default.interactive), href, ...rest, children });
1446
+ return /* @__PURE__ */ jsxRuntime.jsx("a", { className: cx(cardClass, Card_module_default.interactive), href, ...rest, children });
1570
1447
  }
1571
1448
  if (onClick !== void 0) {
1572
- return /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: cx(cardClass, Card_default.interactive), onClick, ...rest, children });
1449
+ return /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: cx(cardClass, Card_module_default.interactive), onClick, ...rest, children });
1573
1450
  }
1574
1451
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cardClass, ...rest, children });
1575
1452
  }
1576
1453
  function CardHeader({ className, ...rest }) {
1577
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx(Card_default.header, className), ...rest });
1454
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx(Card_module_default.header, className), ...rest });
1578
1455
  }
1579
1456
  function CardBody({ className, ...rest }) {
1580
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx(Card_default.body, className), ...rest });
1457
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx(Card_module_default.body, className), ...rest });
1581
1458
  }
1582
1459
  function CardFooter({ className, ...rest }) {
1583
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx(Card_default.footer, className), ...rest });
1460
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx(Card_module_default.footer, className), ...rest });
1584
1461
  }
1585
1462
 
1586
- // src/components/Modal/Modal.module.css
1587
- var Modal_default = {
1588
- panel: "Modal_panel",
1589
- header: "Modal_header",
1590
- body: "Modal_body",
1591
- footer: "Modal_footer"
1592
- };
1593
- 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 }) {
1594
1466
  return /* @__PURE__ */ jsxRuntime.jsx(
1595
1467
  Overlay,
1596
1468
  {
@@ -1598,94 +1470,141 @@ function Modal({ open, onClose, label, closeOnScrimClick = true, children }) {
1598
1470
  onClose,
1599
1471
  label,
1600
1472
  variant: "modal",
1473
+ role,
1601
1474
  closeOnScrimClick,
1602
- panelClassName: Modal_default.panel,
1475
+ panelClassName: Modal_module_default.panel,
1603
1476
  children
1604
1477
  }
1605
1478
  );
1606
1479
  }
1607
1480
  function ModalHeader({ children }) {
1608
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: Modal_default.header, children });
1481
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: Modal_module_default.header, children });
1609
1482
  }
1610
1483
  function ModalBody({ children }) {
1611
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: Modal_default.body, children });
1484
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: Modal_module_default.body, children });
1612
1485
  }
1613
1486
  function ModalFooter({ children }) {
1614
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: Modal_default.footer, children });
1487
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: Modal_module_default.footer, children });
1615
1488
  }
1616
1489
 
1617
- // src/components/ConfirmDialog/ConfirmDialog.module.css
1618
- var ConfirmDialog_default = {
1619
- description: "ConfirmDialog_description"
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"
1620
1496
  };
1621
1497
  function ConfirmDialog({
1622
- open,
1498
+ target,
1499
+ open = target != null,
1623
1500
  onClose,
1624
1501
  onConfirm,
1625
1502
  title,
1626
1503
  description,
1627
1504
  confirmLabel,
1628
1505
  cancelLabel = "Cancel",
1629
- danger = false
1506
+ tone = "default",
1507
+ errorMessage
1630
1508
  }) {
1631
- return /* @__PURE__ */ jsxRuntime.jsxs(Modal, { open, onClose, label: title, closeOnScrimClick: false, children: [
1632
- /* @__PURE__ */ jsxRuntime.jsx(ModalHeader, { children: title }),
1633
- /* @__PURE__ */ jsxRuntime.jsx(ModalBody, { children: description ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: ConfirmDialog_default.description, children: description }) : null }),
1634
- /* @__PURE__ */ jsxRuntime.jsxs(ModalFooter, { children: [
1635
- /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "secondary", onClick: onClose, children: cancelLabel }),
1636
- /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: danger ? "danger" : "primary", onClick: onConfirm, children: confirmLabel })
1637
- ] })
1638
- ] });
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
+ );
1639
1561
  }
1640
1562
 
1641
- // src/components/Screen/Screen.module.css
1642
- var Screen_default = {
1643
- screen: "Screen_screen",
1644
- content: "Screen_content"
1645
- };
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" };
1646
1565
  function Screen({ children }) {
1647
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: Screen_default.screen, children });
1566
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: Screen_module_default.screen, children });
1648
1567
  }
1649
- function ScreenContent({ children }) {
1650
- return /* @__PURE__ */ jsxRuntime.jsx("main", { className: Screen_default.content, children });
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 });
1651
1570
  }
1652
1571
 
1653
- // src/components/AppBar/AppBar.module.css
1654
- var AppBar_default = {
1655
- bar: "AppBar_bar",
1656
- title: "AppBar_title",
1657
- slot: "AppBar_slot"
1658
- };
1659
- function AppBar({ title, leading, trailing }) {
1660
- return /* @__PURE__ */ jsxRuntime.jsxs("header", { className: AppBar_default.bar, children: [
1661
- leading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: AppBar_default.slot, children: leading }) : null,
1662
- title ? /* @__PURE__ */ jsxRuntime.jsx("h1", { className: AppBar_default.title, children: title }) : null,
1663
- trailing ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: AppBar_default.slot, children: trailing }) : null
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
1664
1583
  ] });
1665
1584
  }
1666
1585
 
1667
- // src/components/TabBar/TabBar.module.css
1668
- var TabBar_default = {
1669
- bar: "TabBar_bar",
1670
- item: "TabBar_item",
1671
- active: "TabBar_active",
1672
- icon: "TabBar_icon",
1673
- label: "TabBar_label"
1674
- };
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" };
1675
1588
  function TabBar({ label, children }) {
1676
- return /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": label, className: TabBar_default.bar, children });
1589
+ return /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": label, className: TabBar_module_default.bar, children });
1677
1590
  }
1678
- function TabBarItem({ label, icon, href, onClick, active = false }) {
1679
- const className = cx(TabBar_default.item, active && TabBar_default.active);
1591
+ function TabBarItem({ label, icon, href, onClick, active = false, badge = false }) {
1592
+ const className = cx(TabBar_module_default.item, active && TabBar_module_default.active);
1680
1593
  const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1681
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: TabBar_default.icon, "aria-hidden": "true", children: icon }),
1682
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: TabBar_default.label, children: label })
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 })
1683
1599
  ] });
1684
1600
  if (href !== void 0) {
1685
1601
  return /* @__PURE__ */ jsxRuntime.jsx("a", { href, className, "aria-current": active ? "page" : void 0, onClick, children: content });
1686
1602
  }
1687
1603
  return /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className, "aria-current": active ? "page" : void 0, onClick, children: content });
1688
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
+ }
1689
1608
  function useRovingGroup(ref, { selector, orientation = "horizontal" }) {
1690
1609
  return react.useCallback(
1691
1610
  (event) => {
@@ -1762,6 +1681,7 @@ exports.Stack = Stack;
1762
1681
  exports.Switch = Switch;
1763
1682
  exports.Tab = Tab;
1764
1683
  exports.TabBar = TabBar;
1684
+ exports.TabBarAction = TabBarAction;
1765
1685
  exports.TabBarItem = TabBarItem;
1766
1686
  exports.TabList = TabList;
1767
1687
  exports.TabPanel = TabPanel;