@jirawatpyk/aura-react 4.9.0 → 4.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,8 +29,69 @@ function addMonths(d, n) {
29
29
  function same(a, b) {
30
30
  return !!a && !!b && a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
31
31
  }
32
+ const TAGS = { th: "th-TH", en: "en-GB", sv: "sv-SE" };
33
+ function defaultCalendar(locale) {
34
+ return locale === "sv" ? "gregory" : "buddhist";
35
+ }
32
36
  function localeTag(locale, calendar) {
33
- return (locale === "en" ? "en-GB" : "th-TH") + "-u-ca-" + (calendar === "gregory" ? "gregory" : "buddhist");
37
+ const cal = calendar || defaultCalendar(locale);
38
+ return (TAGS[locale || "th"] || "th-TH") + "-u-ca-" + (cal === "gregory" ? "gregory" : "buddhist");
39
+ }
40
+ const DATE_TEXT = {
41
+ th: {
42
+ prevYears: "\u0E0A\u0E48\u0E27\u0E07\u0E1B\u0E35\u0E01\u0E48\u0E2D\u0E19\u0E2B\u0E19\u0E49\u0E32",
43
+ nextYears: "\u0E0A\u0E48\u0E27\u0E07\u0E1B\u0E35\u0E16\u0E31\u0E14\u0E44\u0E1B",
44
+ prevMonth: "\u0E40\u0E14\u0E37\u0E2D\u0E19\u0E01\u0E48\u0E2D\u0E19\u0E2B\u0E19\u0E49\u0E32",
45
+ nextMonth: "\u0E40\u0E14\u0E37\u0E2D\u0E19\u0E16\u0E31\u0E14\u0E44\u0E1B",
46
+ today: "\u0E27\u0E31\u0E19\u0E19\u0E35\u0E49",
47
+ clear: "\u0E25\u0E49\u0E32\u0E07",
48
+ chooseDate: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48",
49
+ datePlaceholder: "\u0E27\u0E27/\u0E14\u0E14/\u0E1B\u0E1B\u0E1B\u0E1B",
50
+ clearDate: "\u0E25\u0E49\u0E32\u0E07\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48",
51
+ openCalendar: "\u0E40\u0E1B\u0E34\u0E14\u0E1B\u0E0F\u0E34\u0E17\u0E34\u0E19",
52
+ chooseDates: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E0A\u0E48\u0E27\u0E07\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48",
53
+ rangePlaceholder: "\u0E27\u0E27/\u0E14\u0E14/\u0E1B\u0E1B\u0E1B\u0E1B \u2013 \u0E27\u0E27/\u0E14\u0E14/\u0E1B\u0E1B\u0E1B\u0E1B",
54
+ clearDates: "\u0E25\u0E49\u0E32\u0E07\u0E0A\u0E48\u0E27\u0E07\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48",
55
+ chooseStart: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E27\u0E31\u0E19\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19",
56
+ chooseEnd: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E27\u0E31\u0E19\u0E2A\u0E34\u0E49\u0E19\u0E2A\u0E38\u0E14"
57
+ },
58
+ en: {
59
+ prevYears: "Previous years",
60
+ nextYears: "Next years",
61
+ prevMonth: "Previous month",
62
+ nextMonth: "Next month",
63
+ today: "Today",
64
+ clear: "Clear",
65
+ chooseDate: "Choose date",
66
+ datePlaceholder: "dd/mm/yyyy",
67
+ clearDate: "Clear date",
68
+ openCalendar: "Open calendar",
69
+ chooseDates: "Choose dates",
70
+ rangePlaceholder: "dd/mm/yyyy \u2013 dd/mm/yyyy",
71
+ clearDates: "Clear dates",
72
+ chooseStart: "Choose the start date",
73
+ chooseEnd: "Choose the end date"
74
+ },
75
+ sv: {
76
+ prevYears: "Tidigare \xE5r",
77
+ nextYears: "Senare \xE5r",
78
+ prevMonth: "F\xF6reg\xE5ende m\xE5nad",
79
+ nextMonth: "N\xE4sta m\xE5nad",
80
+ today: "Idag",
81
+ clear: "Rensa",
82
+ chooseDate: "V\xE4lj datum",
83
+ datePlaceholder: "\xE5\xE5\xE5\xE5-mm-dd",
84
+ clearDate: "Rensa datum",
85
+ openCalendar: "\xD6ppna kalendern",
86
+ chooseDates: "V\xE4lj datum",
87
+ rangePlaceholder: "\xE5\xE5\xE5\xE5-mm-dd \u2013 \xE5\xE5\xE5\xE5-mm-dd",
88
+ clearDates: "Rensa datumen",
89
+ chooseStart: "V\xE4lj startdatum",
90
+ chooseEnd: "V\xE4lj slutdatum"
91
+ }
92
+ };
93
+ function dateText(locale) {
94
+ return DATE_TEXT[locale || "th"] || DATE_TEXT.th;
34
95
  }
35
96
  const fmtCache = {};
36
97
  const PRESETS = {
@@ -53,12 +114,12 @@ let MONTHS = null;
53
114
  function monthIndex(word) {
54
115
  if (!MONTHS) {
55
116
  MONTHS = {};
56
- ["th-TH", "en-GB"].forEach(function(tag) {
117
+ ["th-TH", "en-GB", "sv-SE"].forEach(function(tag) {
57
118
  ["short", "long"].forEach(function(w) {
58
119
  for (let i = 0; i < 12; i++) {
59
120
  const n = new Intl.DateTimeFormat(tag, { month: w }).format(new Date(2020, i, 1)).toLowerCase().replace(/\.$/, "");
60
121
  MONTHS[n] = i;
61
- if (/^[a-z]/.test(n)) MONTHS[n.slice(0, 3)] = i;
122
+ if (/^[a-zåäö]/.test(n)) MONTHS[n.slice(0, 3)] = i;
62
123
  }
63
124
  });
64
125
  });
@@ -87,8 +148,8 @@ function parseDate(text) {
87
148
  return dt.getMonth() === mo - 1 && dt.getDate() === d ? toISO(dt) : null;
88
149
  }
89
150
  const Calendar = React.forwardRef(function Calendar2(props, ref) {
90
- const ctx = useAuraLocale(), locale = props.locale || ctx.locale || "th", calendar = props.calendar || ctx.calendar || "buddhist", tag = localeTag(locale, calendar);
91
- const weekStart = props.weekStartsOn == null ? 0 : props.weekStartsOn;
151
+ const ctx = useAuraLocale(), locale = props.locale || ctx.locale || "th", calendar = props.calendar || ctx.calendar || defaultCalendar(locale), tag = localeTag(locale, calendar);
152
+ const weekStart = props.weekStartsOn == null ? locale === "sv" ? 1 : 0 : props.weekStartsOn;
92
153
  let today = /* @__PURE__ */ new Date();
93
154
  today = new Date(today.getFullYear(), today.getMonth(), today.getDate());
94
155
  const min = fromISO(props.min), max = fromISO(props.max);
@@ -98,7 +159,8 @@ const Calendar = React.forwardRef(function Calendar2(props, ref) {
98
159
  const viewState = React.useState("days"), view = viewState[0], setView = viewState[1];
99
160
  const hoverState = React.useState(null);
100
161
  const gridRef = React.useRef(null), gridMerged = useMergedRef(ref, gridRef), moved = React.useRef(false);
101
- const th = locale !== "en";
162
+ const th = locale === "th";
163
+ const dt = dateText(locale);
102
164
  function disabled(d) {
103
165
  return !!(min && d < min || max && d > max || props.isDateDisabled && props.isDateDisabled(toISO(d)));
104
166
  }
@@ -164,7 +226,7 @@ const Calendar = React.forwardRef(function Calendar2(props, ref) {
164
226
  IconButton,
165
227
  {
166
228
  icon: "chevron-left",
167
- label: th ? "\u0E0A\u0E48\u0E27\u0E07\u0E1B\u0E35\u0E01\u0E48\u0E2D\u0E19\u0E2B\u0E19\u0E49\u0E32" : "Previous years",
229
+ label: dt.prevYears,
168
230
  onClick: function() {
169
231
  setFocus(new Date(yr - 12, focusDate.getMonth(), 1));
170
232
  }
@@ -183,7 +245,7 @@ const Calendar = React.forwardRef(function Calendar2(props, ref) {
183
245
  IconButton,
184
246
  {
185
247
  icon: "chevron-right",
186
- label: th ? "\u0E0A\u0E48\u0E27\u0E07\u0E1B\u0E35\u0E16\u0E31\u0E14\u0E44\u0E1B" : "Next years",
248
+ label: dt.nextYears,
187
249
  onClick: function() {
188
250
  setFocus(new Date(yr + 12, focusDate.getMonth(), 1));
189
251
  }
@@ -211,7 +273,7 @@ const Calendar = React.forwardRef(function Calendar2(props, ref) {
211
273
  IconButton,
212
274
  {
213
275
  icon: "chevron-left",
214
- label: th ? "\u0E40\u0E14\u0E37\u0E2D\u0E19\u0E01\u0E48\u0E2D\u0E19\u0E2B\u0E19\u0E49\u0E32" : "Previous month",
276
+ label: dt.prevMonth,
215
277
  onClick: function() {
216
278
  setFocus(addMonths(focusDate, -1));
217
279
  }
@@ -232,7 +294,7 @@ const Calendar = React.forwardRef(function Calendar2(props, ref) {
232
294
  IconButton,
233
295
  {
234
296
  icon: "chevron-right",
235
- label: th ? "\u0E40\u0E14\u0E37\u0E2D\u0E19\u0E16\u0E31\u0E14\u0E44\u0E1B" : "Next month",
297
+ label: dt.nextMonth,
236
298
  onClick: function() {
237
299
  setFocus(addMonths(focusDate, 1));
238
300
  }
@@ -306,8 +368,8 @@ const Calendar = React.forwardRef(function Calendar2(props, ref) {
306
368
  props.onSelect(toISO(today));
307
369
  }
308
370
  },
309
- th ? "\u0E27\u0E31\u0E19\u0E19\u0E35\u0E49" : "Today"
310
- ), props.onClear ? /* @__PURE__ */ React.createElement("button", { type: "button", className: "aura-cal__link", onClick: props.onClear }, th ? "\u0E25\u0E49\u0E32\u0E07" : "Clear") : null));
371
+ dt.today
372
+ ), props.onClear ? /* @__PURE__ */ React.createElement("button", { type: "button", className: "aura-cal__link", onClick: props.onClear }, dt.clear) : null));
311
373
  });
312
374
  function useCalendarPopover(boxRef) {
313
375
  const openState = React.useState(false), open = openState[0], setOpen = openState[1];
@@ -429,7 +491,7 @@ function DateField(props) {
429
491
  }
430
492
  const DatePicker = React.forwardRef(function DatePicker2(props, ref) {
431
493
  const auto = uid(), id = props.id || auto, dialogId = id + "-cal";
432
- const ctx = useAuraLocale(), locale = props.locale || ctx.locale || "th", calendar = props.calendar || ctx.calendar || "buddhist", th = locale !== "en";
494
+ const ctx = useAuraLocale(), locale = props.locale || ctx.locale || "th", calendar = props.calendar || ctx.calendar || defaultCalendar(locale), dt = dateText(locale);
433
495
  const st = useMaybeControlled(
434
496
  props.value,
435
497
  props.defaultValue == null ? null : props.defaultValue,
@@ -457,7 +519,7 @@ const DatePicker = React.forwardRef(function DatePicker2(props, ref) {
457
519
  id: dialogId,
458
520
  role: "dialog",
459
521
  "aria-modal": false,
460
- "aria-label": props.label || (th ? "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48" : "Choose date"),
522
+ "aria-label": props.label || dt.chooseDate,
461
523
  className: "aura-cal__popover",
462
524
  style: pop.pos,
463
525
  onKeyDown: function(e) {
@@ -504,15 +566,15 @@ const DatePicker = React.forwardRef(function DatePicker2(props, ref) {
504
566
  inputRef: inputMerged,
505
567
  open: pop.open,
506
568
  display: formatDate(st[0], { locale, calendar }),
507
- placeholder: props.placeholder || (th ? "\u0E27\u0E27/\u0E14\u0E14/\u0E1B\u0E1B\u0E1B\u0E1B" : "dd/mm/yyyy"),
569
+ placeholder: props.placeholder || dt.datePlaceholder,
508
570
  hasValue: st[0] != null,
509
571
  clearable: props.clearable,
510
572
  onClear: function() {
511
573
  st[1](null);
512
574
  inputRef.current && inputRef.current.focus();
513
575
  },
514
- clearLabel: th ? "\u0E25\u0E49\u0E32\u0E07\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48" : "Clear date",
515
- toggleLabel: th ? "\u0E40\u0E1B\u0E34\u0E14\u0E1B\u0E0F\u0E34\u0E17\u0E34\u0E19" : "Open calendar",
576
+ clearLabel: dt.clearDate,
577
+ toggleLabel: dt.openCalendar,
516
578
  onCommit: commit,
517
579
  onToggle: function(o) {
518
580
  pop.setOpen(o);
@@ -524,7 +586,7 @@ const DatePicker = React.forwardRef(function DatePicker2(props, ref) {
524
586
  const DateRangePicker = React.forwardRef(
525
587
  function DateRangePicker2(props, ref) {
526
588
  const auto = uid(), id = props.id || auto, dialogId = id + "-cal";
527
- const ctx = useAuraLocale(), locale = props.locale || ctx.locale || "th", calendar = props.calendar || ctx.calendar || "buddhist", th = locale !== "en";
589
+ const ctx = useAuraLocale(), locale = props.locale || ctx.locale || "th", calendar = props.calendar || ctx.calendar || defaultCalendar(locale), dt = dateText(locale);
528
590
  const st = useMaybeControlled(
529
591
  props.value,
530
592
  props.defaultValue || { start: null, end: null },
@@ -571,7 +633,7 @@ const DateRangePicker = React.forwardRef(
571
633
  id: dialogId,
572
634
  role: "dialog",
573
635
  "aria-modal": false,
574
- "aria-label": props.label || (th ? "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E0A\u0E48\u0E27\u0E07\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48" : "Choose dates"),
636
+ "aria-label": props.label || dt.chooseDates,
575
637
  className: "aura-cal__popover",
576
638
  style: pop.pos,
577
639
  onKeyDown: function(e) {
@@ -581,7 +643,7 @@ const DateRangePicker = React.forwardRef(
581
643
  } else trapTab(e, pop.popRef.current);
582
644
  }
583
645
  },
584
- /* @__PURE__ */ React.createElement("p", { className: "aura-cal__hint", "aria-live": "polite" }, draft[0] ? th ? "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E27\u0E31\u0E19\u0E2A\u0E34\u0E49\u0E19\u0E2A\u0E38\u0E14" : "Choose the end date" : th ? "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E27\u0E31\u0E19\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19" : "Choose the start date"),
646
+ /* @__PURE__ */ React.createElement("p", { className: "aura-cal__hint", "aria-live": "polite" }, draft[0] ? dt.chooseEnd : dt.chooseStart),
585
647
  /* @__PURE__ */ React.createElement(
586
648
  Calendar,
587
649
  {
@@ -618,15 +680,15 @@ const DateRangePicker = React.forwardRef(
618
680
  inputRef: inputMerged,
619
681
  open: pop.open,
620
682
  display: show(v),
621
- placeholder: props.placeholder || (th ? "\u0E27\u0E27/\u0E14\u0E14/\u0E1B\u0E1B\u0E1B\u0E1B \u2013 \u0E27\u0E27/\u0E14\u0E14/\u0E1B\u0E1B\u0E1B\u0E1B" : "dd/mm/yyyy \u2013 dd/mm/yyyy"),
683
+ placeholder: props.placeholder || dt.rangePlaceholder,
622
684
  hasValue: v.start != null,
623
685
  clearable: props.clearable,
624
686
  onClear: function() {
625
687
  st[1]({ start: null, end: null });
626
688
  inputRef.current && inputRef.current.focus();
627
689
  },
628
- clearLabel: th ? "\u0E25\u0E49\u0E32\u0E07\u0E0A\u0E48\u0E27\u0E07\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48" : "Clear dates",
629
- toggleLabel: th ? "\u0E40\u0E1B\u0E34\u0E14\u0E1B\u0E0F\u0E34\u0E17\u0E34\u0E19" : "Open calendar",
690
+ clearLabel: dt.clearDates,
691
+ toggleLabel: dt.openCalendar,
630
692
  onCommit: commit,
631
693
  onToggle: function(op) {
632
694
  pop.setOpen(op);
package/dist/esm/Icon.js CHANGED
@@ -5,9 +5,20 @@ const h = React.createElement;
5
5
  const ICONS = { "check": [["path", { "d": "M20 6 9 17l-5-5" }]], "x": [["path", { "d": "M18 6 6 18" }], ["path", { "d": "m6 6 12 12" }]], "plus": [["path", { "d": "M5 12h14" }], ["path", { "d": "M12 5v14" }]], "minus": [["path", { "d": "M5 12h14" }]], "search": [["path", { "d": "m21 21-4.34-4.34" }], ["circle", { "cx": "11", "cy": "11", "r": "8" }]], "chevron-down": [["path", { "d": "m6 9 6 6 6-6" }]], "chevron-up": [["path", { "d": "m18 15-6-6-6 6" }]], "chevron-left": [["path", { "d": "m15 18-6-6 6-6" }]], "chevron-right": [["path", { "d": "m9 18 6-6-6-6" }]], "arrow-right": [["path", { "d": "M5 12h14" }], ["path", { "d": "m12 5 7 7-7 7" }]], "arrow-up-right": [["path", { "d": "M7 7h10v10" }], ["path", { "d": "M7 17 17 7" }]], "arrow-up-down": [["path", { "d": "m21 16-4 4-4-4" }], ["path", { "d": "M17 20V4" }], ["path", { "d": "m3 8 4-4 4 4" }], ["path", { "d": "M7 4v16" }]], "loader-circle": [["path", { "d": "M21 12a9 9 0 1 1-6.219-8.56" }]], "circle-alert": [["circle", { "cx": "12", "cy": "12", "r": "10" }], ["line", { "x1": "12", "x2": "12", "y1": "8", "y2": "12" }], ["line", { "x1": "12", "x2": "12.01", "y1": "16", "y2": "16" }]], "circle-check": [["circle", { "cx": "12", "cy": "12", "r": "10" }], ["path", { "d": "m16 9-5.5 5.5L8 12" }]], "info": [["circle", { "cx": "12", "cy": "12", "r": "10" }], ["path", { "d": "M12 16v-4" }], ["path", { "d": "M12 8h.01" }]], "triangle-alert": [["path", { "d": "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" }], ["path", { "d": "M12 9v4" }], ["path", { "d": "M12 17h.01" }]], "settings": [["path", { "d": "M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915" }], ["circle", { "cx": "12", "cy": "12", "r": "3" }]], "user": [["path", { "d": "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" }], ["circle", { "cx": "12", "cy": "7", "r": "4" }]], "users": [["path", { "d": "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" }], ["path", { "d": "M16 3.128a4 4 0 0 1 0 7.744" }], ["path", { "d": "M22 21v-2a4 4 0 0 0-3-3.87" }], ["circle", { "cx": "9", "cy": "7", "r": "4" }]], "filter": [["path", { "d": "M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z" }]], "ellipsis": [["circle", { "cx": "12", "cy": "12", "r": "1" }], ["circle", { "cx": "19", "cy": "12", "r": "1" }], ["circle", { "cx": "5", "cy": "12", "r": "1" }]], "external-link": [["path", { "d": "M15 3h6v6" }], ["path", { "d": "M10 14 21 3" }], ["path", { "d": "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }]], "copy": [["rect", { "width": "14", "height": "14", "x": "8", "y": "8", "rx": "2", "ry": "2" }], ["path", { "d": "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" }]], "trash-2": [["path", { "d": "M10 11v6" }], ["path", { "d": "M14 11v6" }], ["path", { "d": "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" }], ["path", { "d": "M3 6h18" }], ["path", { "d": "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" }]], "pencil": [["path", { "d": "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z" }], ["path", { "d": "m15 5 4 4" }]], "download": [["path", { "d": "M12 15V3" }], ["path", { "d": "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }], ["path", { "d": "m7 10 5 5 5-5" }]], "upload": [["path", { "d": "M12 3v12" }], ["path", { "d": "m17 8-5-5-5 5" }], ["path", { "d": "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }]], "calendar": [["path", { "d": "M8 2v3" }], ["path", { "d": "M16 2v3" }], ["rect", { "x": "3", "y": "3", "width": "18", "height": "18", "rx": "2" }], ["path", { "d": "M3 9h18" }]], "bell": [["path", { "d": "M10.268 21a2 2 0 0 0 3.464 0" }], ["path", { "d": "M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326" }]], "menu": [["path", { "d": "M4 5h16" }], ["path", { "d": "M4 12h16" }], ["path", { "d": "M4 19h16" }]], "eye": [["path", { "d": "M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0" }], ["circle", { "cx": "12", "cy": "12", "r": "3" }]], "log-out": [["path", { "d": "m16 17 5-5-5-5" }], ["path", { "d": "M21 12H9" }], ["path", { "d": "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" }]], "circle": [["circle", { "cx": "12", "cy": "12", "r": "10" }]], "circle-dot-dashed": [["path", { "d": "M10.1 2.18a9.93 9.93 0 0 1 3.8 0" }], ["path", { "d": "M17.6 3.71a9.95 9.95 0 0 1 2.69 2.7" }], ["path", { "d": "M21.82 10.1a9.93 9.93 0 0 1 0 3.8" }], ["path", { "d": "M20.29 17.6a9.95 9.95 0 0 1-2.7 2.69" }], ["path", { "d": "M13.9 21.82a9.94 9.94 0 0 1-3.8 0" }], ["path", { "d": "M6.4 20.29a9.95 9.95 0 0 1-2.69-2.7" }], ["path", { "d": "M2.18 13.9a9.93 9.93 0 0 1 0-3.8" }], ["path", { "d": "M3.71 6.4a9.95 9.95 0 0 1 2.7-2.69" }], ["circle", { "cx": "12", "cy": "12", "r": "1" }]], "ban": [["circle", { "cx": "12", "cy": "12", "r": "10" }], ["path", { "d": "M4.929 4.929 19.07 19.071" }]], "arrow-up": [["path", { "d": "m5 12 7-7 7 7" }], ["path", { "d": "M12 19V5" }]], "arrow-down": [["path", { "d": "M12 5v14" }], ["path", { "d": "m19 12-7 7-7-7" }]], "inbox": [["polyline", { "points": "22 12 16 12 14 15 10 15 8 12 2 12" }], ["path", { "d": "M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z" }]], "pin": [["path", { "d": "M12 17v5" }], ["path", { "d": "M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z" }]], "pin-off": [["path", { "d": "M12 17v5" }], ["path", { "d": "M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89" }], ["path", { "d": "m2 2 20 20" }], ["path", { "d": "M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11" }]], "eye-off": [["path", { "d": "M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49" }], ["path", { "d": "M14.084 14.158a3 3 0 0 1-4.242-4.242" }], ["path", { "d": "M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143" }], ["path", { "d": "m2 2 20 20" }]], "columns-3": [["rect", { "width": "18", "height": "18", "x": "3", "y": "3", "rx": "2" }], ["path", { "d": "M9 3v18" }], ["path", { "d": "M15 3v18" }]], "arrow-left": [["path", { "d": "m12 19-7-7 7-7" }], ["path", { "d": "M19 12H5" }]], "rotate-ccw": [["path", { "d": "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }], ["path", { "d": "M3 3v5h5" }]], "house": [["path", { "d": "M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8" }], ["path", { "d": "M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" }]], "layout-dashboard": [["rect", { "width": "7", "height": "9", "x": "3", "y": "3", "rx": "1" }], ["rect", { "width": "7", "height": "5", "x": "14", "y": "3", "rx": "1" }], ["rect", { "width": "7", "height": "9", "x": "14", "y": "12", "rx": "1" }], ["rect", { "width": "7", "height": "5", "x": "3", "y": "16", "rx": "1" }]], "folder": [["path", { "d": "M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z" }]], "chart-column": [["path", { "d": "M3 3v16a2 2 0 0 0 2 2h16" }], ["path", { "d": "M18 17V9" }], ["path", { "d": "M13 17V5" }], ["path", { "d": "M8 17v-3" }]], "file-text": [["path", { "d": "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" }], ["path", { "d": "M14 2v5a1 1 0 0 0 1 1h5" }], ["path", { "d": "M10 9H8" }], ["path", { "d": "M16 13H8" }], ["path", { "d": "M16 17H8" }]], "mail": [["path", { "d": "m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7" }], ["rect", { "x": "2", "y": "4", "width": "20", "height": "16", "rx": "2" }]], "lock": [["rect", { "width": "18", "height": "11", "x": "3", "y": "11", "rx": "2", "ry": "2" }], ["path", { "d": "M7 11V7a5 5 0 0 1 10 0v4" }]], "clock": [["circle", { "cx": "12", "cy": "12", "r": "10" }], ["path", { "d": "M12 6v6l4 2" }]], "trending-up": [["path", { "d": "M16 7h6v6" }], ["path", { "d": "m22 7-8.5 8.5-5-5L2 17" }]], "trending-down": [["path", { "d": "M16 17h6v-6" }], ["path", { "d": "m22 17-8.5-8.5-5 5L2 7" }]], "image": [["rect", { "width": "18", "height": "18", "x": "3", "y": "3", "rx": "2", "ry": "2" }], ["circle", { "cx": "9", "cy": "9", "r": "2" }], ["path", { "d": "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" }]], "paperclip": [["path", { "d": "m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551" }]], "cloud-upload": [["path", { "d": "M12 13v8" }], ["path", { "d": "M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242" }], ["path", { "d": "m8 17 4-4 4 4" }]], "file": [["path", { "d": "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" }], ["path", { "d": "M14 2v5a1 1 0 0 0 1 1h5" }]], "sun": [["circle", { "cx": "12", "cy": "12", "r": "4" }], ["path", { "d": "M12 2v2" }], ["path", { "d": "M12 20v2" }], ["path", { "d": "m4.93 4.93 1.41 1.41" }], ["path", { "d": "m17.66 17.66 1.41 1.41" }], ["path", { "d": "M2 12h2" }], ["path", { "d": "M20 12h2" }], ["path", { "d": "m6.34 17.66-1.41 1.41" }], ["path", { "d": "m19.07 4.93-1.41 1.41" }]], "moon": [["path", { "d": "M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401" }]], "monitor": [["rect", { "width": "20", "height": "14", "x": "2", "y": "3", "rx": "2" }], ["line", { "x1": "8", "x2": "16", "y1": "21", "y2": "21" }], ["line", { "x1": "12", "x2": "12", "y1": "17", "y2": "21" }]] };
6
6
  const SIZES = { sm: 16, md: 20, lg: 24 };
7
7
  const Icon = React.forwardRef(function Icon2(props, ref) {
8
+ const size = SIZES[props.size] || props.size || 16;
9
+ if (React.isValidElement(props.name)) {
10
+ return /* @__PURE__ */ React.createElement(
11
+ "span",
12
+ {
13
+ className: cx("aura-icon", "aura-icon--custom", props.className),
14
+ style: { width: size, height: size, ["--aura-icon-stroke"]: props.strokeWidth || 2 },
15
+ ...props.label ? { role: "img", "aria-label": props.label } : { "aria-hidden": true }
16
+ },
17
+ props.name
18
+ );
19
+ }
8
20
  const shapes = ICONS[props.name];
9
21
  if (!shapes) return null;
10
- const size = SIZES[props.size] || props.size || 16;
11
22
  const a11y = props.label ? { role: "img", "aria-label": props.label } : { "aria-hidden": true, focusable: "false" };
12
23
  return /* @__PURE__ */ React.createElement(
13
24
  "svg",
@@ -3,7 +3,7 @@ import * as React from "react";
3
3
  import { cx, omit } from "./internal.js";
4
4
  import { Icon } from "./Icon.js";
5
5
  const IconButton = React.forwardRef(function IconButton2(props, ref) {
6
- const rest = omit(props, ["icon", "label", "className", "size"]);
6
+ const rest = omit(props, ["icon", "label", "className", "size", "tone"]);
7
7
  return /* @__PURE__ */ React.createElement(
8
8
  "button",
9
9
  {
@@ -12,7 +12,7 @@ const IconButton = React.forwardRef(function IconButton2(props, ref) {
12
12
  type: props.type || "button",
13
13
  "aria-label": props.label,
14
14
  title: props.label,
15
- className: cx("aura-icon-btn", props.className)
15
+ className: cx("aura-icon-btn", props.tone === "danger" && "aura-icon-btn--danger", props.className)
16
16
  },
17
17
  /* @__PURE__ */ React.createElement(Icon, { name: props.icon, size: props.size || "sm" })
18
18
  );
@@ -2,7 +2,7 @@
2
2
  import * as React from "react";
3
3
  import { IconButton } from "./IconButton.js";
4
4
  import { cx, useMaybeControlled } from "./internal.js";
5
- import { useStrings } from "./locale.js";
5
+ import { useLinkComponent, useStrings } from "./locale.js";
6
6
  function pageList(page, count, sib) {
7
7
  let out = [], lo = Math.max(2, page - sib), hi = Math.min(count - 1, page + sib);
8
8
  if (page - sib <= 3) {
@@ -31,6 +31,7 @@ const Pagination = React.forwardRef(function Pagination2(props, ref) {
31
31
  if (p >= 1 && p <= count && p !== page) st[1](p);
32
32
  }
33
33
  const link = props.getHref;
34
+ const Link = useLinkComponent();
34
35
  function item(p, label, extra) {
35
36
  const common = Object.assign(
36
37
  {
@@ -41,7 +42,7 @@ const Pagination = React.forwardRef(function Pagination2(props, ref) {
41
42
  extra
42
43
  );
43
44
  return link ? /* @__PURE__ */ React.createElement(
44
- "a",
45
+ Link,
45
46
  {
46
47
  href: link(p),
47
48
  onClick: function(e) {
@@ -1,35 +1,141 @@
1
1
  'use client';
2
2
  import * as React from "react";
3
3
  import { Icon } from "./Icon.js";
4
- import { cx, useMaybeControlled } from "./internal.js";
5
- import { useStrings } from "./locale.js";
4
+ import { cx, uid, useMaybeControlled } from "./internal.js";
5
+ import { useLinkComponent, useStrings } from "./locale.js";
6
+ function contains(it, id) {
7
+ return !!id && !!it.children && it.children.some(function(c) {
8
+ return c.id === id || contains(c, id);
9
+ });
10
+ }
6
11
  const SideNav = React.forwardRef(function SideNav2(props, ref) {
7
12
  const t = useStrings();
13
+ const Link = useLinkComponent(props.linkComponent);
14
+ const base = uid();
8
15
  const st = useMaybeControlled(
9
16
  props.value,
10
17
  props.defaultValue,
11
18
  props.onChange
12
19
  );
13
- function item(it) {
14
- const on = st[0] === it.id;
15
- const inner = [
20
+ const active = st[0];
21
+ const sections = props.sections || [{ items: props.items || [] }];
22
+ const openState = React.useState({}), toggled = openState[0], setToggled = openState[1];
23
+ function isOpen(it) {
24
+ if (toggled[it.id] != null) return toggled[it.id];
25
+ return !!it.defaultOpen || contains(it, active);
26
+ }
27
+ React.useEffect(
28
+ function() {
29
+ if (!active) return;
30
+ const next = {};
31
+ let changed = false;
32
+ sections.forEach(function(s) {
33
+ (function walk(list) {
34
+ list.forEach(function(it) {
35
+ if (it.children) {
36
+ if (contains(it, active) && toggled[it.id] !== true) {
37
+ next[it.id] = true;
38
+ changed = true;
39
+ }
40
+ walk(it.children);
41
+ }
42
+ });
43
+ })(s.items);
44
+ });
45
+ if (changed) setToggled(Object.assign({}, toggled, next));
46
+ },
47
+ [active]
48
+ );
49
+ const navRef = React.useRef(null);
50
+ function onKeyDown(e) {
51
+ const k = e.key;
52
+ if (k !== "ArrowDown" && k !== "ArrowUp" && k !== "Home" && k !== "End") return;
53
+ const root = navRef.current;
54
+ if (!root) return;
55
+ const items = Array.prototype.slice.call(root.querySelectorAll(".aura-nav__item"));
56
+ const visible = items.filter(function(el) {
57
+ return el.offsetParent !== null || el === document.activeElement;
58
+ });
59
+ const i = visible.indexOf(document.activeElement);
60
+ if (i < 0) return;
61
+ e.preventDefault();
62
+ const j = k === "Home" ? 0 : k === "End" ? visible.length - 1 : Math.max(0, Math.min(visible.length - 1, i + (k === "ArrowDown" ? 1 : -1)));
63
+ visible[j].focus();
64
+ }
65
+ function inner(it, group, open) {
66
+ return [
16
67
  it.icon ? /* @__PURE__ */ React.createElement(Icon, { key: "i", name: it.icon }) : null,
17
68
  /* @__PURE__ */ React.createElement("span", { key: "l", className: "aura-nav__label" }, it.label),
18
- it.count != null ? /* @__PURE__ */ React.createElement("span", { key: "c", className: "aura-nav__count" }, it.count) : null
69
+ it.badge != null ? /* @__PURE__ */ React.createElement("span", { key: "b", className: "aura-nav__badge" }, it.badge) : null,
70
+ it.count != null ? /* @__PURE__ */ React.createElement("span", { key: "c", className: "aura-nav__count" }, it.count) : null,
71
+ group ? /* @__PURE__ */ React.createElement(Icon, { key: "g", name: "chevron-down", className: cx("aura-nav__chevron", open && "is-open") }) : null
19
72
  ];
73
+ }
74
+ function item(it, depth) {
75
+ if (it.children) {
76
+ const open = isOpen(it);
77
+ const listId = base + "-" + it.id;
78
+ const holdsActive = contains(it, active);
79
+ return /* @__PURE__ */ React.createElement("li", { key: it.id, className: "aura-nav__group" }, /* @__PURE__ */ React.createElement(
80
+ "button",
81
+ {
82
+ type: "button",
83
+ className: cx("aura-nav__item", "aura-nav__item--group", holdsActive && "has-active"),
84
+ "aria-expanded": open,
85
+ "aria-controls": listId,
86
+ style: depth ? { ["--aura-nav-depth"]: depth } : void 0,
87
+ onClick: function() {
88
+ const next = Object.assign({}, toggled);
89
+ next[it.id] = !open;
90
+ setToggled(next);
91
+ },
92
+ onKeyDown: function(e) {
93
+ if (e.key === "ArrowRight" && !open) {
94
+ e.preventDefault();
95
+ setToggled(Object.assign({}, toggled, { [it.id]: true }));
96
+ } else if (e.key === "ArrowLeft" && open) {
97
+ e.preventDefault();
98
+ setToggled(Object.assign({}, toggled, { [it.id]: false }));
99
+ }
100
+ }
101
+ },
102
+ inner(it, true, open)
103
+ ), /* @__PURE__ */ React.createElement("ul", { id: listId, className: "aura-nav__list aura-nav__sub", hidden: !open }, it.children.map(function(c) {
104
+ return item(c, depth + 1);
105
+ })));
106
+ }
107
+ const on = active === it.id;
20
108
  const common = {
21
109
  className: cx("aura-nav__item", on && "is-active"),
22
110
  "aria-current": on ? "page" : void 0,
111
+ style: depth ? { ["--aura-nav-depth"]: depth } : void 0,
23
112
  onClick: function(e) {
24
113
  if (!it.href) e.preventDefault();
25
114
  st[1](it.id);
26
115
  }
27
116
  };
28
- return /* @__PURE__ */ React.createElement("li", { key: it.id }, it.href ? /* @__PURE__ */ React.createElement("a", { href: it.href, ...common }, inner) : /* @__PURE__ */ React.createElement("button", { type: "button", ...common }, inner));
117
+ return /* @__PURE__ */ React.createElement("li", { key: it.id }, it.href ? /* @__PURE__ */ React.createElement(Link, { href: it.href, ...common }, inner(it, false, false)) : /* @__PURE__ */ React.createElement("button", { type: "button", ...common }, inner(it, false, false)));
29
118
  }
30
- return /* @__PURE__ */ React.createElement("nav", { ref, className: cx("aura-nav", props.className), "aria-label": props.label || t.mainNav }, props.header ? /* @__PURE__ */ React.createElement("div", { className: "aura-nav__header" }, props.header) : null, /* @__PURE__ */ React.createElement("div", { className: "aura-nav__scroll" }, (props.sections || [{ items: props.items || [] }]).map(function(s, i) {
31
- return /* @__PURE__ */ React.createElement("div", { key: i, className: "aura-nav__section" }, s.title ? /* @__PURE__ */ React.createElement("p", { className: "aura-nav__title" }, s.title) : null, /* @__PURE__ */ React.createElement("ul", { className: "aura-nav__list" }, s.items.map(item)));
32
- })), props.footer ? /* @__PURE__ */ React.createElement("div", { className: "aura-nav__footer" }, props.footer) : null);
119
+ return /* @__PURE__ */ React.createElement(
120
+ "nav",
121
+ {
122
+ ref: function(el) {
123
+ navRef.current = el;
124
+ if (typeof ref === "function") ref(el);
125
+ else if (ref) ref.current = el;
126
+ },
127
+ className: cx("aura-nav", props.className),
128
+ "aria-label": props.label || t.mainNav,
129
+ onKeyDown
130
+ },
131
+ props.header ? /* @__PURE__ */ React.createElement("div", { className: "aura-nav__header" }, props.header) : null,
132
+ /* @__PURE__ */ React.createElement("div", { className: "aura-nav__scroll" }, sections.map(function(s, i) {
133
+ return /* @__PURE__ */ React.createElement("div", { key: i, className: "aura-nav__section" }, s.title ? /* @__PURE__ */ React.createElement("p", { className: "aura-nav__title" }, s.title) : null, /* @__PURE__ */ React.createElement("ul", { className: "aura-nav__list" }, s.items.map(function(it) {
134
+ return item(it, 0);
135
+ })));
136
+ })),
137
+ props.footer ? /* @__PURE__ */ React.createElement("div", { className: "aura-nav__footer" }, props.footer) : null
138
+ );
33
139
  });
34
140
  export {
35
141
  SideNav
package/dist/esm/Stat.js CHANGED
@@ -2,12 +2,16 @@
2
2
  import * as React from "react";
3
3
  import { cx } from "./internal.js";
4
4
  import { Icon } from "./Icon.js";
5
+ import { useLinkComponent } from "./locale.js";
5
6
  const Stat = React.forwardRef(function Stat2(props, ref) {
6
7
  const ch = props.change;
7
8
  const dir = ch && (ch.direction || "flat");
8
9
  const tone = ch && (ch.tone || (dir === "up" ? "positive" : dir === "down" ? "negative" : "neutral"));
9
- const Tag = props.href ? "a" : props.onClick ? "button" : "div";
10
- const interactive = Tag !== "div";
10
+ const Link = useLinkComponent();
11
+ const v = props.value;
12
+ const numeric = typeof v === "number" || typeof v === "string" && /\d/.test(v) && /^[\s\d.,:+\-\u2212%()\u0E3F$\u20AC\u00A3\u00A5kKmMbB]+$/.test(v.replace(/\b[A-Z]{3}\b/g, ""));
13
+ const Tag = props.href ? Link : props.onClick ? "button" : "div";
14
+ const interactive = !!(props.href || props.onClick);
11
15
  return /* @__PURE__ */ React.createElement(
12
16
  Tag,
13
17
  {
@@ -19,7 +23,7 @@ const Stat = React.forwardRef(function Stat2(props, ref) {
19
23
  "aria-busy": props.loading || void 0
20
24
  },
21
25
  /* @__PURE__ */ React.createElement("span", { className: "aura-stat__head" }, /* @__PURE__ */ React.createElement("span", { className: "aura-stat__label" }, props.label), props.icon ? /* @__PURE__ */ React.createElement("span", { className: "aura-stat__icon" }, /* @__PURE__ */ React.createElement(Icon, { name: props.icon })) : null),
22
- props.loading ? /* @__PURE__ */ React.createElement("span", { className: "aura-stat__value" }, /* @__PURE__ */ React.createElement("span", { className: "aura-skel aura-stat__skel" })) : /* @__PURE__ */ React.createElement("span", { className: "aura-stat__value" }, props.value, props.unit ? /* @__PURE__ */ React.createElement("span", { className: "aura-stat__unit" }, props.unit) : null),
26
+ props.loading ? /* @__PURE__ */ React.createElement("span", { className: "aura-stat__value" }, /* @__PURE__ */ React.createElement("span", { className: "aura-skel aura-stat__skel" })) : /* @__PURE__ */ React.createElement("span", { className: cx("aura-stat__value", numeric && "is-numeric") }, props.value, props.unit ? /* @__PURE__ */ React.createElement("span", { className: "aura-stat__unit" }, props.unit) : null),
23
27
  ch && !props.loading || props.caption ? /* @__PURE__ */ React.createElement("span", { className: "aura-stat__foot" }, ch && !props.loading ? /* @__PURE__ */ React.createElement("span", { className: cx("aura-stat__change", "is-" + tone) }, /* @__PURE__ */ React.createElement(Icon, { name: dir === "up" ? "trending-up" : dir === "down" ? "trending-down" : "minus", size: 14 }), /* @__PURE__ */ React.createElement("span", null, ch.value)) : null, ch && ch.label && !props.loading ? /* @__PURE__ */ React.createElement("span", { className: "aura-stat__caption" }, ch.label) : null, props.caption ? /* @__PURE__ */ React.createElement("span", { className: "aura-stat__caption" }, props.caption) : null) : null
24
28
  );
25
29
  });
@@ -15,7 +15,14 @@ function colorSchemeScript(options) {
15
15
  return "(function(){try{var s=localStorage.getItem(" + key + ");if(s!=='light'&&s!=='dark'&&s!=='system')s=" + fallback + `;var d=document.documentElement;d.setAttribute("data-theme",s);var dark=s==='dark'||(s==='system'&&window.matchMedia('(prefers-color-scheme: dark)').matches);d.classList.toggle("dark",dark);}catch(e){}})();`;
16
16
  }
17
17
  function ColorSchemeScript(props) {
18
- return /* @__PURE__ */ React.createElement("script", { "data-aura-color-scheme": "", dangerouslySetInnerHTML: { __html: colorSchemeScript(props) } });
18
+ return /* @__PURE__ */ React.createElement(
19
+ "script",
20
+ {
21
+ "data-aura-color-scheme": "",
22
+ nonce: props.nonce,
23
+ dangerouslySetInnerHTML: { __html: colorSchemeScript(props) }
24
+ }
25
+ );
19
26
  }
20
27
  function systemDark() {
21
28
  return typeof window !== "undefined" && !!window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches;