@jirawatpyk/aura-react 4.8.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.
@@ -60,17 +60,20 @@ __export(index_exports, {
60
60
  Icon: () => Icon,
61
61
  IconButton: () => IconButton,
62
62
  Menu: () => Menu,
63
+ NumberField: () => NumberField,
63
64
  Pagination: () => Pagination,
64
65
  Popover: () => Popover,
65
66
  Progress: () => Progress,
66
67
  RadioGroup: () => RadioGroup,
67
68
  STRINGS: () => STRINGS,
69
+ SegmentedControl: () => SegmentedControl,
68
70
  Select: () => Select,
69
71
  SideNav: () => SideNav,
70
72
  Skeleton: () => Skeleton,
71
73
  Stack: () => Stack,
72
74
  Stat: () => Stat,
73
75
  StatusPill: () => StatusPill,
76
+ Stepper: () => Stepper,
74
77
  Surface: () => Surface,
75
78
  Switch: () => Switch,
76
79
  Tabs: () => Tabs,
@@ -195,9 +198,20 @@ var h = React2.createElement;
195
198
  var 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" }]] };
196
199
  var SIZES = { sm: 16, md: 20, lg: 24 };
197
200
  var Icon = React2.forwardRef(function Icon2(props, ref) {
201
+ const size = SIZES[props.size] || props.size || 16;
202
+ if (React2.isValidElement(props.name)) {
203
+ return /* @__PURE__ */ React2.createElement(
204
+ "span",
205
+ {
206
+ className: cx("aura-icon", "aura-icon--custom", props.className),
207
+ style: { width: size, height: size, ["--aura-icon-stroke"]: props.strokeWidth || 2 },
208
+ ...props.label ? { role: "img", "aria-label": props.label } : { "aria-hidden": true }
209
+ },
210
+ props.name
211
+ );
212
+ }
198
213
  const shapes = ICONS[props.name];
199
214
  if (!shapes) return null;
200
- const size = SIZES[props.size] || props.size || 16;
201
215
  const a11y = props.label ? { role: "img", "aria-label": props.label } : { "aria-hidden": true, focusable: "false" };
202
216
  return /* @__PURE__ */ React2.createElement(
203
217
  "svg",
@@ -225,8 +239,341 @@ var Icon = React2.forwardRef(function Icon2(props, ref) {
225
239
  var iconNames = Object.keys(ICONS);
226
240
 
227
241
  // src/Button.tsx
242
+ var React4 = __toESM(require("react"), 1);
243
+
244
+ // src/locale.tsx
228
245
  var React3 = __toESM(require("react"), 1);
229
- function ButtonLink(props, ref) {
246
+ var n = function(x) {
247
+ return Number(x).toLocaleString("en");
248
+ };
249
+ var nsv = function(x) {
250
+ return Number(x).toLocaleString("sv-SE");
251
+ };
252
+ var STRINGS = {
253
+ en: {
254
+ close: "Close",
255
+ dismiss: "Dismiss",
256
+ dismissToast: "Dismiss notification",
257
+ notifications: "Notifications",
258
+ mainNav: "Main",
259
+ breadcrumb: "Breadcrumb",
260
+ navigation: "Navigation",
261
+ openNav: "Open navigation",
262
+ searching: "Searching\u2026",
263
+ noMatches: "No matches",
264
+ clear: function(what) {
265
+ return "Clear " + (what || "selection");
266
+ },
267
+ keepTyping: function(total) {
268
+ return "Keep typing to narrow " + n(total) + " options";
269
+ },
270
+ sortAsc: "Sort ascending",
271
+ sortDesc: "Sort descending",
272
+ pin: "Pin to left",
273
+ unpin: "Unpin column",
274
+ moveLeft: "Move left",
275
+ moveRight: "Move right",
276
+ hideColumn: "Hide column",
277
+ resetColumns: "Reset columns",
278
+ selectRows: "Select rows",
279
+ selectAllRows: "Select all rows",
280
+ deselectAllRows: "Deselect all rows",
281
+ selectAll: "Select all",
282
+ selectRow: function(k) {
283
+ return "Select " + k;
284
+ },
285
+ selectedCount: function(c) {
286
+ return n(c) + " selected";
287
+ },
288
+ pinned: "Pinned",
289
+ columnOptions: function(label) {
290
+ return label + " column options";
291
+ },
292
+ column: function(label) {
293
+ return label ? label + " column" : "Column";
294
+ },
295
+ columns: "Columns",
296
+ showHideColumns: "Show or hide columns",
297
+ empty: "Nothing here yet",
298
+ loading: "Loading\u2026",
299
+ loadingRows: "Loading rows",
300
+ range: function(a, b, total) {
301
+ return a + "\u2013" + b + " of " + n(total);
302
+ },
303
+ page: function(p, total) {
304
+ return "Page " + p + " of " + total;
305
+ },
306
+ prevPage: "Previous page",
307
+ nextPage: "Next page",
308
+ rowCount: function(c) {
309
+ return n(c) + " rows";
310
+ },
311
+ actions: "Actions",
312
+ optional: "optional",
313
+ timePlaceholder: "hh:mm",
314
+ timeInvalid: "Type a time like 09:30",
315
+ timeOutOfRange: function(a, b) {
316
+ return "Choose a time between " + a + " and " + b;
317
+ },
318
+ dropFiles: "Drag files here or",
319
+ browse: "Choose files",
320
+ browseOne: "Choose a file",
321
+ remove: function(n2) {
322
+ return "Remove " + n2;
323
+ },
324
+ fileTooBig: function(max) {
325
+ return "Larger than " + max;
326
+ },
327
+ fileWrongType: "This file type isn\u2019t accepted",
328
+ tooManyFiles: function(n2) {
329
+ return "Up to " + n2 + " files";
330
+ },
331
+ colorScheme: "Colour scheme",
332
+ increase: "Increase",
333
+ decrease: "Decrease",
334
+ stepDone: "completed",
335
+ stepOf: function(i, total) {
336
+ return "Step " + i + " of " + total;
337
+ },
338
+ schemeLight: "Light",
339
+ schemeDark: "Dark",
340
+ schemeSystem: "System",
341
+ uploading: "Uploading\u2026",
342
+ images: "Images",
343
+ pagination: "Pagination",
344
+ pageN: function(p) {
345
+ return "Page " + p;
346
+ },
347
+ accepts: function(list, max) {
348
+ return [list, max && "up to " + max + " each"].filter(Boolean).join(", ");
349
+ }
350
+ },
351
+ th: {
352
+ close: "\u0E1B\u0E34\u0E14",
353
+ dismiss: "\u0E1B\u0E34\u0E14",
354
+ dismissToast: "\u0E1B\u0E34\u0E14\u0E01\u0E32\u0E23\u0E41\u0E08\u0E49\u0E07\u0E40\u0E15\u0E37\u0E2D\u0E19",
355
+ notifications: "\u0E01\u0E32\u0E23\u0E41\u0E08\u0E49\u0E07\u0E40\u0E15\u0E37\u0E2D\u0E19",
356
+ mainNav: "\u0E40\u0E21\u0E19\u0E39\u0E2B\u0E25\u0E31\u0E01",
357
+ breadcrumb: "\u0E40\u0E2A\u0E49\u0E19\u0E17\u0E32\u0E07",
358
+ navigation: "\u0E40\u0E21\u0E19\u0E39",
359
+ openNav: "\u0E40\u0E1B\u0E34\u0E14\u0E40\u0E21\u0E19\u0E39",
360
+ searching: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E04\u0E49\u0E19\u0E2B\u0E32\u2026",
361
+ noMatches: "\u0E44\u0E21\u0E48\u0E1E\u0E1A\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23\u0E17\u0E35\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E19",
362
+ clear: function(what) {
363
+ return "\u0E25\u0E49\u0E32\u0E07" + (what || "\u0E17\u0E35\u0E48\u0E40\u0E25\u0E37\u0E2D\u0E01");
364
+ },
365
+ keepTyping: function(total) {
366
+ return "\u0E1E\u0E34\u0E21\u0E1E\u0E4C\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E01\u0E23\u0E2D\u0E07\u0E08\u0E32\u0E01 " + n(total) + " \u0E23\u0E32\u0E22\u0E01\u0E32\u0E23";
367
+ },
368
+ sortAsc: "\u0E40\u0E23\u0E35\u0E22\u0E07\u0E08\u0E32\u0E01\u0E19\u0E49\u0E2D\u0E22\u0E44\u0E1B\u0E21\u0E32\u0E01",
369
+ sortDesc: "\u0E40\u0E23\u0E35\u0E22\u0E07\u0E08\u0E32\u0E01\u0E21\u0E32\u0E01\u0E44\u0E1B\u0E19\u0E49\u0E2D\u0E22",
370
+ pin: "\u0E15\u0E23\u0E36\u0E07\u0E44\u0E27\u0E49\u0E0B\u0E49\u0E32\u0E22",
371
+ unpin: "\u0E40\u0E25\u0E34\u0E01\u0E15\u0E23\u0E36\u0E07\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",
372
+ moveLeft: "\u0E22\u0E49\u0E32\u0E22\u0E44\u0E1B\u0E0B\u0E49\u0E32\u0E22",
373
+ moveRight: "\u0E22\u0E49\u0E32\u0E22\u0E44\u0E1B\u0E02\u0E27\u0E32",
374
+ hideColumn: "\u0E0B\u0E48\u0E2D\u0E19\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",
375
+ resetColumns: "\u0E04\u0E37\u0E19\u0E04\u0E48\u0E32\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",
376
+ selectRows: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E41\u0E16\u0E27",
377
+ selectAllRows: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E17\u0E38\u0E01\u0E41\u0E16\u0E27",
378
+ deselectAllRows: "\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01\u0E01\u0E32\u0E23\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E17\u0E38\u0E01\u0E41\u0E16\u0E27",
379
+ selectAll: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14",
380
+ selectRow: function(k) {
381
+ return "\u0E40\u0E25\u0E37\u0E2D\u0E01 " + k;
382
+ },
383
+ selectedCount: function(c) {
384
+ return "\u0E40\u0E25\u0E37\u0E2D\u0E01 " + n(c) + " \u0E23\u0E32\u0E22\u0E01\u0E32\u0E23";
385
+ },
386
+ pinned: "\u0E15\u0E23\u0E36\u0E07\u0E2D\u0E22\u0E39\u0E48",
387
+ columnOptions: function(label) {
388
+ return "\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C " + label;
389
+ },
390
+ column: function(label) {
391
+ return label ? "\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C " + label : "\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C";
392
+ },
393
+ columns: "\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",
394
+ showHideColumns: "\u0E41\u0E2A\u0E14\u0E07\u0E2B\u0E23\u0E37\u0E2D\u0E0B\u0E48\u0E2D\u0E19\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",
395
+ empty: "\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E21\u0E35\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25",
396
+ loading: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E42\u0E2B\u0E25\u0E14\u2026",
397
+ loadingRows: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E42\u0E2B\u0E25\u0E14\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25",
398
+ range: function(a, b, total) {
399
+ return a + "\u2013" + b + " \u0E08\u0E32\u0E01 " + n(total);
400
+ },
401
+ page: function(p, total) {
402
+ return "\u0E2B\u0E19\u0E49\u0E32 " + p + " / " + total;
403
+ },
404
+ prevPage: "\u0E2B\u0E19\u0E49\u0E32\u0E01\u0E48\u0E2D\u0E19\u0E2B\u0E19\u0E49\u0E32",
405
+ nextPage: "\u0E2B\u0E19\u0E49\u0E32\u0E16\u0E31\u0E14\u0E44\u0E1B",
406
+ rowCount: function(c) {
407
+ return n(c) + " \u0E41\u0E16\u0E27";
408
+ },
409
+ actions: "\u0E01\u0E32\u0E23\u0E08\u0E31\u0E14\u0E01\u0E32\u0E23",
410
+ optional: "\u0E44\u0E21\u0E48\u0E1A\u0E31\u0E07\u0E04\u0E31\u0E1A",
411
+ timePlaceholder: "\u0E0A\u0E0A:\u0E19\u0E19",
412
+ timeInvalid: "\u0E1E\u0E34\u0E21\u0E1E\u0E4C\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A 09:30",
413
+ timeOutOfRange: function(a, b) {
414
+ return "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E40\u0E27\u0E25\u0E32\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07 " + a + "\u2013" + b + " \u0E19.";
415
+ },
416
+ dropFiles: "\u0E25\u0E32\u0E01\u0E44\u0E1F\u0E25\u0E4C\u0E21\u0E32\u0E27\u0E32\u0E07 \u0E2B\u0E23\u0E37\u0E2D",
417
+ browse: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E1F\u0E25\u0E4C",
418
+ browseOne: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E1F\u0E25\u0E4C",
419
+ remove: function(n2) {
420
+ return "\u0E25\u0E1A " + n2;
421
+ },
422
+ fileTooBig: function(max) {
423
+ return "\u0E44\u0E1F\u0E25\u0E4C\u0E43\u0E2B\u0E0D\u0E48\u0E40\u0E01\u0E34\u0E19 " + max;
424
+ },
425
+ fileWrongType: "\u0E44\u0E21\u0E48\u0E23\u0E2D\u0E07\u0E23\u0E31\u0E1A\u0E44\u0E1F\u0E25\u0E4C\u0E0A\u0E19\u0E34\u0E14\u0E19\u0E35\u0E49",
426
+ tooManyFiles: function(n2) {
427
+ return "\u0E41\u0E19\u0E1A\u0E44\u0E14\u0E49\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 " + n2 + " \u0E44\u0E1F\u0E25\u0E4C";
428
+ },
429
+ colorScheme: "\u0E42\u0E2B\u0E21\u0E14\u0E2A\u0E35",
430
+ increase: "\u0E40\u0E1E\u0E34\u0E48\u0E21",
431
+ decrease: "\u0E25\u0E14",
432
+ stepDone: "\u0E40\u0E2A\u0E23\u0E47\u0E08\u0E41\u0E25\u0E49\u0E27",
433
+ stepOf: function(i, total) {
434
+ return "\u0E02\u0E31\u0E49\u0E19\u0E17\u0E35\u0E48 " + i + " \u0E08\u0E32\u0E01 " + total;
435
+ },
436
+ schemeLight: "\u0E2A\u0E27\u0E48\u0E32\u0E07",
437
+ schemeDark: "\u0E21\u0E37\u0E14",
438
+ schemeSystem: "\u0E15\u0E32\u0E21\u0E23\u0E30\u0E1A\u0E1A",
439
+ uploading: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14\u2026",
440
+ images: "\u0E23\u0E39\u0E1B\u0E20\u0E32\u0E1E",
441
+ pagination: "\u0E40\u0E25\u0E02\u0E2B\u0E19\u0E49\u0E32",
442
+ pageN: function(p) {
443
+ return "\u0E2B\u0E19\u0E49\u0E32 " + p;
444
+ },
445
+ accepts: function(list, max) {
446
+ return [list, max && "\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 " + max + " \u0E15\u0E48\u0E2D\u0E44\u0E1F\u0E25\u0E4C"].filter(Boolean).join(" \xB7 ");
447
+ }
448
+ },
449
+ sv: {
450
+ close: "St\xE4ng",
451
+ dismiss: "St\xE4ng",
452
+ dismissToast: "St\xE4ng aviseringen",
453
+ notifications: "Aviseringar",
454
+ mainNav: "Huvudmeny",
455
+ breadcrumb: "Br\xF6dsmulor",
456
+ navigation: "Navigering",
457
+ openNav: "\xD6ppna menyn",
458
+ searching: "S\xF6ker\u2026",
459
+ noMatches: "Inga tr\xE4ffar",
460
+ clear: function(what) {
461
+ return "Rensa " + (what || "urvalet");
462
+ },
463
+ keepTyping: function(total) {
464
+ return "Skriv mer f\xF6r att begr\xE4nsa " + nsv(total) + " alternativ";
465
+ },
466
+ sortAsc: "Sortera stigande",
467
+ sortDesc: "Sortera fallande",
468
+ pin: "F\xE4st till v\xE4nster",
469
+ unpin: "Lossa kolumnen",
470
+ moveLeft: "Flytta v\xE4nster",
471
+ moveRight: "Flytta h\xF6ger",
472
+ hideColumn: "D\xF6lj kolumnen",
473
+ resetColumns: "\xC5terst\xE4ll kolumner",
474
+ selectRows: "V\xE4lj rader",
475
+ selectAllRows: "V\xE4lj alla rader",
476
+ deselectAllRows: "Avmarkera alla rader",
477
+ selectAll: "V\xE4lj alla",
478
+ selectRow: function(k) {
479
+ return "V\xE4lj " + k;
480
+ },
481
+ selectedCount: function(c) {
482
+ return nsv(c) + " valda";
483
+ },
484
+ pinned: "F\xE4st",
485
+ columnOptions: function(label) {
486
+ return "Alternativ f\xF6r kolumnen " + label;
487
+ },
488
+ column: function(label) {
489
+ return label ? "Kolumnen " + label : "Kolumn";
490
+ },
491
+ columns: "Kolumner",
492
+ showHideColumns: "Visa eller d\xF6lj kolumner",
493
+ empty: "Inget h\xE4r \xE4nnu",
494
+ loading: "Laddar\u2026",
495
+ loadingRows: "Laddar rader",
496
+ range: function(a, b, total) {
497
+ return a + "\u2013" + b + " av " + nsv(total);
498
+ },
499
+ page: function(p, total) {
500
+ return "Sida " + p + " av " + total;
501
+ },
502
+ prevPage: "F\xF6reg\xE5ende sida",
503
+ nextPage: "N\xE4sta sida",
504
+ rowCount: function(c) {
505
+ return nsv(c) + " rader";
506
+ },
507
+ actions: "\xC5tg\xE4rder",
508
+ optional: "valfritt",
509
+ timePlaceholder: "tt:mm",
510
+ timeInvalid: "Skriv en tid som 09:30",
511
+ timeOutOfRange: function(a, b) {
512
+ return "V\xE4lj en tid mellan " + a + " och " + b;
513
+ },
514
+ dropFiles: "Dra filer hit eller",
515
+ browse: "V\xE4lj filer",
516
+ browseOne: "V\xE4lj en fil",
517
+ remove: function(n2) {
518
+ return "Ta bort " + n2;
519
+ },
520
+ fileTooBig: function(max) {
521
+ return "St\xF6rre \xE4n " + max;
522
+ },
523
+ fileWrongType: "Den h\xE4r filtypen godtas inte",
524
+ tooManyFiles: function(n2) {
525
+ return "H\xF6gst " + n2 + " filer";
526
+ },
527
+ colorScheme: "F\xE4rgl\xE4ge",
528
+ increase: "\xD6ka",
529
+ decrease: "Minska",
530
+ stepDone: "klart",
531
+ stepOf: function(i, total) {
532
+ return "Steg " + i + " av " + total;
533
+ },
534
+ schemeLight: "Ljust",
535
+ schemeDark: "M\xF6rkt",
536
+ schemeSystem: "System",
537
+ uploading: "Laddar upp\u2026",
538
+ images: "Bilder",
539
+ pagination: "Sidnumrering",
540
+ pageN: function(p) {
541
+ return "Sida " + p;
542
+ },
543
+ accepts: function(list, max) {
544
+ return [list, max && "h\xF6gst " + max + " per fil"].filter(Boolean).join(", ");
545
+ }
546
+ }
547
+ };
548
+ var LocaleContext = React3.createContext(null);
549
+ function AuraProvider(props) {
550
+ const value = React3.useMemo(
551
+ function() {
552
+ const base = props.locale && STRINGS[props.locale] || STRINGS.en;
553
+ return {
554
+ locale: props.locale || "en",
555
+ calendar: props.calendar || null,
556
+ strings: props.strings ? Object.assign({}, base, props.strings) : base,
557
+ linkComponent: props.linkComponent || null
558
+ };
559
+ },
560
+ [props.locale, props.calendar, props.strings, props.linkComponent]
561
+ );
562
+ return /* @__PURE__ */ React3.createElement(LocaleContext.Provider, { value }, props.children);
563
+ }
564
+ function useAuraLocale() {
565
+ return React3.useContext(LocaleContext) || { locale: null, calendar: null, strings: STRINGS.en };
566
+ }
567
+ function useLinkComponent(own) {
568
+ const ctx = React3.useContext(LocaleContext);
569
+ return own || ctx && ctx.linkComponent || "a";
570
+ }
571
+ function useStrings() {
572
+ return useAuraLocale().strings;
573
+ }
574
+
575
+ // src/Button.tsx
576
+ function ButtonLink(props, ref, Link) {
230
577
  const variant = props.variant || "primary";
231
578
  const disabled = !!props.disabled;
232
579
  const rest = omit(props, [
@@ -239,8 +586,8 @@ function ButtonLink(props, ref) {
239
586
  "linkComponent",
240
587
  "href"
241
588
  ]);
242
- const Tag3 = !disabled && props.linkComponent ? props.linkComponent : "a";
243
- return /* @__PURE__ */ React3.createElement(
589
+ const Tag3 = disabled ? "a" : Link;
590
+ return /* @__PURE__ */ React4.createElement(
244
591
  Tag3,
245
592
  {
246
593
  ...rest,
@@ -252,21 +599,22 @@ function ButtonLink(props, ref) {
252
599
  className: cx("aura-btn", "aura-btn--" + variant, props.className),
253
600
  onClick: disabled ? void 0 : props.onClick
254
601
  },
255
- props.icon ? /* @__PURE__ */ React3.createElement(Icon, { name: props.icon }) : null,
602
+ props.icon ? /* @__PURE__ */ React4.createElement(Icon, { name: props.icon }) : null,
256
603
  props.children,
257
- props.iconRight ? /* @__PURE__ */ React3.createElement(Icon, { name: props.iconRight }) : null
604
+ props.iconRight ? /* @__PURE__ */ React4.createElement(Icon, { name: props.iconRight }) : null
258
605
  );
259
606
  }
260
- var Button = React3.forwardRef(
607
+ var Button = React4.forwardRef(
261
608
  function Button2(all, ref) {
609
+ const Link = useLinkComponent(all.linkComponent);
262
610
  if (typeof all.href === "string") {
263
- return ButtonLink(all, ref);
611
+ return ButtonLink(all, ref, Link);
264
612
  }
265
613
  const props = all;
266
614
  const variant = props.variant || "primary";
267
615
  const loading = !!props.loading;
268
616
  const rest = omit(props, ["variant", "className", "children", "type", "icon", "iconRight", "loading", "onClick"]);
269
- return /* @__PURE__ */ React3.createElement(
617
+ return /* @__PURE__ */ React4.createElement(
270
618
  "button",
271
619
  {
272
620
  ...rest,
@@ -279,18 +627,18 @@ var Button = React3.forwardRef(
279
627
  e.preventDefault();
280
628
  } : props.onClick
281
629
  },
282
- loading ? /* @__PURE__ */ React3.createElement(Icon, { name: "loader-circle", className: "aura-spin" }) : props.icon ? /* @__PURE__ */ React3.createElement(Icon, { name: props.icon }) : null,
630
+ loading ? /* @__PURE__ */ React4.createElement(Icon, { name: "loader-circle", className: "aura-spin" }) : props.icon ? /* @__PURE__ */ React4.createElement(Icon, { name: props.icon }) : null,
283
631
  props.children,
284
- props.iconRight && !loading ? /* @__PURE__ */ React3.createElement(Icon, { name: props.iconRight }) : null
632
+ props.iconRight && !loading ? /* @__PURE__ */ React4.createElement(Icon, { name: props.iconRight }) : null
285
633
  );
286
634
  }
287
635
  );
288
636
 
289
637
  // src/IconButton.tsx
290
- var React4 = __toESM(require("react"), 1);
291
- var IconButton = React4.forwardRef(function IconButton2(props, ref) {
292
- const rest = omit(props, ["icon", "label", "className", "size"]);
293
- return /* @__PURE__ */ React4.createElement(
638
+ var React5 = __toESM(require("react"), 1);
639
+ var IconButton = React5.forwardRef(function IconButton2(props, ref) {
640
+ const rest = omit(props, ["icon", "label", "className", "size", "tone"]);
641
+ return /* @__PURE__ */ React5.createElement(
294
642
  "button",
295
643
  {
296
644
  ...rest,
@@ -298,18 +646,18 @@ var IconButton = React4.forwardRef(function IconButton2(props, ref) {
298
646
  type: props.type || "button",
299
647
  "aria-label": props.label,
300
648
  title: props.label,
301
- className: cx("aura-icon-btn", props.className)
649
+ className: cx("aura-icon-btn", props.tone === "danger" && "aura-icon-btn--danger", props.className)
302
650
  },
303
- /* @__PURE__ */ React4.createElement(Icon, { name: props.icon, size: props.size || "sm" })
651
+ /* @__PURE__ */ React5.createElement(Icon, { name: props.icon, size: props.size || "sm" })
304
652
  );
305
653
  });
306
654
 
307
655
  // src/Menu.tsx
308
- var React5 = __toESM(require("react"), 1);
656
+ var React6 = __toESM(require("react"), 1);
309
657
  var import_react_dom = require("react-dom");
310
- var Menu = React5.forwardRef(function Menu2(props, ref) {
311
- const own = React5.useRef(null), merged = useMergedRef(ref, own);
312
- const posState = React5.useState(null);
658
+ var Menu = React6.forwardRef(function Menu2(props, ref) {
659
+ const own = React6.useRef(null), merged = useMergedRef(ref, own);
660
+ const posState = React6.useState(null);
313
661
  const pos = posState[0], setPos = posState[1];
314
662
  const items = props.items || [];
315
663
  const mounted = useMounted();
@@ -325,7 +673,7 @@ var Menu = React5.forwardRef(function Menu2(props, ref) {
325
673
  },
326
674
  [props.anchor, mounted]
327
675
  );
328
- React5.useEffect(
676
+ React6.useEffect(
329
677
  function() {
330
678
  if (!mounted) return;
331
679
  const first = own.current && own.current.querySelector('[role^="menuitem"]:not([disabled])');
@@ -373,7 +721,7 @@ var Menu = React5.forwardRef(function Menu2(props, ref) {
373
721
  }
374
722
  e.stopPropagation();
375
723
  }
376
- const el = /* @__PURE__ */ React5.createElement(
724
+ const el = /* @__PURE__ */ React6.createElement(
377
725
  "div",
378
726
  {
379
727
  ref: merged,
@@ -384,9 +732,9 @@ var Menu = React5.forwardRef(function Menu2(props, ref) {
384
732
  style: { top: pos ? pos.top : -9999, left: pos ? pos.left : -9999 }
385
733
  },
386
734
  items.map(function(it, i) {
387
- if (it.separator) return /* @__PURE__ */ React5.createElement("div", { key: "s" + i, role: "separator", className: "aura-menu__sep" });
735
+ if (it.separator) return /* @__PURE__ */ React6.createElement("div", { key: "s" + i, role: "separator", className: "aura-menu__sep" });
388
736
  const isCheck = it.checked !== void 0;
389
- return /* @__PURE__ */ React5.createElement(
737
+ return /* @__PURE__ */ React6.createElement(
390
738
  "button",
391
739
  {
392
740
  key: i,
@@ -401,9 +749,9 @@ var Menu = React5.forwardRef(function Menu2(props, ref) {
401
749
  if (!it.keepOpen) props.onClose(true);
402
750
  }
403
751
  },
404
- isCheck ? /* @__PURE__ */ React5.createElement("span", { className: cx("aura-menu__check", it.checked && "is-on") }, it.checked ? /* @__PURE__ */ React5.createElement(Icon, { name: "check", size: 12, strokeWidth: 3 }) : null) : it.icon ? /* @__PURE__ */ React5.createElement(Icon, { name: it.icon }) : /* @__PURE__ */ React5.createElement("span", { className: "aura-menu__blank" }),
405
- /* @__PURE__ */ React5.createElement("span", { className: "aura-menu__label" }, it.label),
406
- it.hint ? /* @__PURE__ */ React5.createElement("span", { className: "aura-menu__hint" }, it.hint) : null
752
+ isCheck ? /* @__PURE__ */ React6.createElement("span", { className: cx("aura-menu__check", it.checked && "is-on") }, it.checked ? /* @__PURE__ */ React6.createElement(Icon, { name: "check", size: 12, strokeWidth: 3 }) : null) : it.icon ? /* @__PURE__ */ React6.createElement(Icon, { name: it.icon }) : /* @__PURE__ */ React6.createElement("span", { className: "aura-menu__blank" }),
753
+ /* @__PURE__ */ React6.createElement("span", { className: "aura-menu__label" }, it.label),
754
+ it.hint ? /* @__PURE__ */ React6.createElement("span", { className: "aura-menu__hint" }, it.hint) : null
407
755
  );
408
756
  })
409
757
  );
@@ -411,11 +759,11 @@ var Menu = React5.forwardRef(function Menu2(props, ref) {
411
759
  });
412
760
 
413
761
  // src/DropdownMenu.tsx
414
- var React6 = __toESM(require("react"), 1);
415
- var DropdownMenu = React6.forwardRef(function DropdownMenu2(props, ref) {
416
- const st = React6.useState(null), anchor = st[0], setAnchor = st[1];
417
- const wrap = React6.useRef(null), wrapMerged = useMergedRef(ref, wrap);
418
- const child = React6.Children.only(props.trigger);
762
+ var React7 = __toESM(require("react"), 1);
763
+ var DropdownMenu = React7.forwardRef(function DropdownMenu2(props, ref) {
764
+ const st = React7.useState(null), anchor = st[0], setAnchor = st[1];
765
+ const wrap = React7.useRef(null), wrapMerged = useMergedRef(ref, wrap);
766
+ const child = React7.Children.only(props.trigger);
419
767
  function toggle(e) {
420
768
  if (child.props.onClick) child.props.onClick(e);
421
769
  const el = wrap.current && (wrap.current.querySelector('button, [role="button"], a') || wrap.current);
@@ -427,7 +775,7 @@ var DropdownMenu = React6.forwardRef(function DropdownMenu2(props, ref) {
427
775
  setAnchor(wrap.current.querySelector('button, [role="button"], a') || wrap.current);
428
776
  }
429
777
  }
430
- return /* @__PURE__ */ React6.createElement("span", { ref: wrapMerged, className: "aura-dropdown", onKeyDown }, React6.cloneElement(child, { onClick: toggle, "aria-haspopup": "menu", "aria-expanded": anchor ? true : false }), anchor ? /* @__PURE__ */ React6.createElement(
778
+ return /* @__PURE__ */ React7.createElement("span", { ref: wrapMerged, className: "aura-dropdown", onKeyDown }, React7.cloneElement(child, { onClick: toggle, "aria-haspopup": "menu", "aria-expanded": anchor ? true : false }), anchor ? /* @__PURE__ */ React7.createElement(
431
779
  Menu,
432
780
  {
433
781
  anchor,
@@ -442,12 +790,12 @@ var DropdownMenu = React6.forwardRef(function DropdownMenu2(props, ref) {
442
790
  });
443
791
 
444
792
  // src/Checkbox.tsx
445
- var React7 = __toESM(require("react"), 1);
446
- var Checkbox = React7.forwardRef(function Checkbox2(props, ref) {
447
- const own = React7.useRef(null), merged = useMergedRef(ref, own);
793
+ var React8 = __toESM(require("react"), 1);
794
+ var Checkbox = React8.forwardRef(function Checkbox2(props, ref) {
795
+ const own = React8.useRef(null), merged = useMergedRef(ref, own);
448
796
  const st = useMaybeControlled(props.checked, !!props.defaultChecked, props.onChange);
449
797
  const on = !!st[0];
450
- React7.useEffect(function() {
798
+ React8.useEffect(function() {
451
799
  if (own.current) own.current.indeterminate = !!props.indeterminate;
452
800
  });
453
801
  const rest = omit(props, [
@@ -464,7 +812,7 @@ var Checkbox = React7.forwardRef(function Checkbox2(props, ref) {
464
812
  ]);
465
813
  const labelled = props.children != null;
466
814
  const descId = props.description && props.id ? props.id + "-desc" : void 0;
467
- return /* @__PURE__ */ React7.createElement(
815
+ return /* @__PURE__ */ React8.createElement(
468
816
  "label",
469
817
  {
470
818
  className: cx("aura-check", labelled && "aura-check--labelled", props.disabled && "is-disabled", props.className),
@@ -472,7 +820,7 @@ var Checkbox = React7.forwardRef(function Checkbox2(props, ref) {
472
820
  e.stopPropagation();
473
821
  }
474
822
  },
475
- /* @__PURE__ */ React7.createElement(
823
+ /* @__PURE__ */ React8.createElement(
476
824
  "input",
477
825
  {
478
826
  ...rest,
@@ -489,13 +837,13 @@ var Checkbox = React7.forwardRef(function Checkbox2(props, ref) {
489
837
  }
490
838
  }
491
839
  ),
492
- /* @__PURE__ */ React7.createElement("span", { className: "aura-check__box", "aria-hidden": true }, props.indeterminate ? /* @__PURE__ */ React7.createElement(Icon, { name: "minus", size: 12, strokeWidth: 3 }) : on ? /* @__PURE__ */ React7.createElement(Icon, { name: "check", size: 12, strokeWidth: 3 }) : null),
493
- labelled ? /* @__PURE__ */ React7.createElement("span", { className: "aura-check__text" }, /* @__PURE__ */ React7.createElement("span", { className: "aura-check__label" }, props.children), props.description ? /* @__PURE__ */ React7.createElement("span", { className: "aura-check__desc", id: descId }, props.description) : null) : null
840
+ /* @__PURE__ */ React8.createElement("span", { className: "aura-check__box", "aria-hidden": true }, props.indeterminate ? /* @__PURE__ */ React8.createElement(Icon, { name: "minus", size: 12, strokeWidth: 3 }) : on ? /* @__PURE__ */ React8.createElement(Icon, { name: "check", size: 12, strokeWidth: 3 }) : null),
841
+ labelled ? /* @__PURE__ */ React8.createElement("span", { className: "aura-check__text" }, /* @__PURE__ */ React8.createElement("span", { className: "aura-check__label" }, props.children), props.description ? /* @__PURE__ */ React8.createElement("span", { className: "aura-check__desc", id: descId }, props.description) : null) : null
494
842
  );
495
843
  });
496
844
 
497
845
  // src/StatusPill.tsx
498
- var React8 = __toESM(require("react"), 1);
846
+ var React9 = __toESM(require("react"), 1);
499
847
  var TONE_ICON = {
500
848
  neutral: "circle",
501
849
  progress: "circle-dot-dashed",
@@ -507,234 +855,19 @@ var TONE_WORDS = {
507
855
  progress: ["in progress", "in review", "review", "syncing", "running", "pending"],
508
856
  blocked: ["blocked", "failed", "error", "rejected", "on hold", "cancelled"]
509
857
  };
510
- function toneFor(status) {
511
- const s = String(status == null ? "" : status).trim().toLowerCase();
512
- for (const t in TONE_WORDS) if (TONE_WORDS[t].indexOf(s) >= 0) return t;
513
- return "neutral";
514
- }
515
- var TONE_ORDER = { neutral: 0, progress: 1, ready: 2, blocked: 3 };
516
- var StatusPill = React8.forwardRef(function StatusPill2(props, ref) {
517
- const tone2 = props.tone || toneFor(props.children);
518
- return /* @__PURE__ */ React8.createElement("span", { ref, className: cx("aura-pill", "aura-pill--" + tone2, props.className) }, /* @__PURE__ */ React8.createElement(Icon, { name: TONE_ICON[tone2] || "circle", size: 12 }), props.children);
519
- });
520
-
521
- // src/Field.tsx
522
- var React10 = __toESM(require("react"), 1);
523
-
524
- // src/locale.tsx
525
- var React9 = __toESM(require("react"), 1);
526
- var n = function(x) {
527
- return Number(x).toLocaleString("en");
528
- };
529
- var STRINGS = {
530
- en: {
531
- close: "Close",
532
- dismiss: "Dismiss",
533
- dismissToast: "Dismiss notification",
534
- notifications: "Notifications",
535
- mainNav: "Main",
536
- breadcrumb: "Breadcrumb",
537
- navigation: "Navigation",
538
- openNav: "Open navigation",
539
- searching: "Searching\u2026",
540
- noMatches: "No matches",
541
- clear: function(what) {
542
- return "Clear " + (what || "selection");
543
- },
544
- keepTyping: function(total) {
545
- return "Keep typing to narrow " + n(total) + " options";
546
- },
547
- sortAsc: "Sort ascending",
548
- sortDesc: "Sort descending",
549
- pin: "Pin to left",
550
- unpin: "Unpin column",
551
- moveLeft: "Move left",
552
- moveRight: "Move right",
553
- hideColumn: "Hide column",
554
- resetColumns: "Reset columns",
555
- selectRows: "Select rows",
556
- selectAllRows: "Select all rows",
557
- deselectAllRows: "Deselect all rows",
558
- selectAll: "Select all",
559
- selectRow: function(k) {
560
- return "Select " + k;
561
- },
562
- selectedCount: function(c) {
563
- return n(c) + " selected";
564
- },
565
- pinned: "Pinned",
566
- columnOptions: function(label) {
567
- return label + " column options";
568
- },
569
- column: function(label) {
570
- return label ? label + " column" : "Column";
571
- },
572
- columns: "Columns",
573
- showHideColumns: "Show or hide columns",
574
- empty: "Nothing here yet",
575
- loading: "Loading\u2026",
576
- loadingRows: "Loading rows",
577
- range: function(a, b, total) {
578
- return a + "\u2013" + b + " of " + n(total);
579
- },
580
- page: function(p, total) {
581
- return "Page " + p + " of " + total;
582
- },
583
- prevPage: "Previous page",
584
- nextPage: "Next page",
585
- rowCount: function(c) {
586
- return n(c) + " rows";
587
- },
588
- actions: "Actions",
589
- optional: "optional",
590
- timePlaceholder: "hh:mm",
591
- timeInvalid: "Type a time like 09:30",
592
- timeOutOfRange: function(a, b) {
593
- return "Choose a time between " + a + " and " + b;
594
- },
595
- dropFiles: "Drag files here or",
596
- browse: "Choose files",
597
- browseOne: "Choose a file",
598
- remove: function(n2) {
599
- return "Remove " + n2;
600
- },
601
- fileTooBig: function(max) {
602
- return "Larger than " + max;
603
- },
604
- fileWrongType: "This file type isn\u2019t accepted",
605
- tooManyFiles: function(n2) {
606
- return "Up to " + n2 + " files";
607
- },
608
- colorScheme: "Colour scheme",
609
- schemeLight: "Light",
610
- schemeDark: "Dark",
611
- schemeSystem: "System",
612
- uploading: "Uploading\u2026",
613
- images: "Images",
614
- pagination: "Pagination",
615
- pageN: function(p) {
616
- return "Page " + p;
617
- },
618
- accepts: function(list, max) {
619
- return [list, max && "up to " + max + " each"].filter(Boolean).join(", ");
620
- }
621
- },
622
- th: {
623
- close: "\u0E1B\u0E34\u0E14",
624
- dismiss: "\u0E1B\u0E34\u0E14",
625
- dismissToast: "\u0E1B\u0E34\u0E14\u0E01\u0E32\u0E23\u0E41\u0E08\u0E49\u0E07\u0E40\u0E15\u0E37\u0E2D\u0E19",
626
- notifications: "\u0E01\u0E32\u0E23\u0E41\u0E08\u0E49\u0E07\u0E40\u0E15\u0E37\u0E2D\u0E19",
627
- mainNav: "\u0E40\u0E21\u0E19\u0E39\u0E2B\u0E25\u0E31\u0E01",
628
- breadcrumb: "\u0E40\u0E2A\u0E49\u0E19\u0E17\u0E32\u0E07",
629
- navigation: "\u0E40\u0E21\u0E19\u0E39",
630
- openNav: "\u0E40\u0E1B\u0E34\u0E14\u0E40\u0E21\u0E19\u0E39",
631
- searching: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E04\u0E49\u0E19\u0E2B\u0E32\u2026",
632
- noMatches: "\u0E44\u0E21\u0E48\u0E1E\u0E1A\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23\u0E17\u0E35\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E19",
633
- clear: function(what) {
634
- return "\u0E25\u0E49\u0E32\u0E07" + (what || "\u0E17\u0E35\u0E48\u0E40\u0E25\u0E37\u0E2D\u0E01");
635
- },
636
- keepTyping: function(total) {
637
- return "\u0E1E\u0E34\u0E21\u0E1E\u0E4C\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E01\u0E23\u0E2D\u0E07\u0E08\u0E32\u0E01 " + n(total) + " \u0E23\u0E32\u0E22\u0E01\u0E32\u0E23";
638
- },
639
- sortAsc: "\u0E40\u0E23\u0E35\u0E22\u0E07\u0E08\u0E32\u0E01\u0E19\u0E49\u0E2D\u0E22\u0E44\u0E1B\u0E21\u0E32\u0E01",
640
- sortDesc: "\u0E40\u0E23\u0E35\u0E22\u0E07\u0E08\u0E32\u0E01\u0E21\u0E32\u0E01\u0E44\u0E1B\u0E19\u0E49\u0E2D\u0E22",
641
- pin: "\u0E15\u0E23\u0E36\u0E07\u0E44\u0E27\u0E49\u0E0B\u0E49\u0E32\u0E22",
642
- unpin: "\u0E40\u0E25\u0E34\u0E01\u0E15\u0E23\u0E36\u0E07\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",
643
- moveLeft: "\u0E22\u0E49\u0E32\u0E22\u0E44\u0E1B\u0E0B\u0E49\u0E32\u0E22",
644
- moveRight: "\u0E22\u0E49\u0E32\u0E22\u0E44\u0E1B\u0E02\u0E27\u0E32",
645
- hideColumn: "\u0E0B\u0E48\u0E2D\u0E19\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",
646
- resetColumns: "\u0E04\u0E37\u0E19\u0E04\u0E48\u0E32\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",
647
- selectRows: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E41\u0E16\u0E27",
648
- selectAllRows: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E17\u0E38\u0E01\u0E41\u0E16\u0E27",
649
- deselectAllRows: "\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01\u0E01\u0E32\u0E23\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E17\u0E38\u0E01\u0E41\u0E16\u0E27",
650
- selectAll: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14",
651
- selectRow: function(k) {
652
- return "\u0E40\u0E25\u0E37\u0E2D\u0E01 " + k;
653
- },
654
- selectedCount: function(c) {
655
- return "\u0E40\u0E25\u0E37\u0E2D\u0E01 " + n(c) + " \u0E23\u0E32\u0E22\u0E01\u0E32\u0E23";
656
- },
657
- pinned: "\u0E15\u0E23\u0E36\u0E07\u0E2D\u0E22\u0E39\u0E48",
658
- columnOptions: function(label) {
659
- return "\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C " + label;
660
- },
661
- column: function(label) {
662
- return label ? "\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C " + label : "\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C";
663
- },
664
- columns: "\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",
665
- showHideColumns: "\u0E41\u0E2A\u0E14\u0E07\u0E2B\u0E23\u0E37\u0E2D\u0E0B\u0E48\u0E2D\u0E19\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",
666
- empty: "\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E21\u0E35\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25",
667
- loading: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E42\u0E2B\u0E25\u0E14\u2026",
668
- loadingRows: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E42\u0E2B\u0E25\u0E14\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25",
669
- range: function(a, b, total) {
670
- return a + "\u2013" + b + " \u0E08\u0E32\u0E01 " + n(total);
671
- },
672
- page: function(p, total) {
673
- return "\u0E2B\u0E19\u0E49\u0E32 " + p + " / " + total;
674
- },
675
- prevPage: "\u0E2B\u0E19\u0E49\u0E32\u0E01\u0E48\u0E2D\u0E19\u0E2B\u0E19\u0E49\u0E32",
676
- nextPage: "\u0E2B\u0E19\u0E49\u0E32\u0E16\u0E31\u0E14\u0E44\u0E1B",
677
- rowCount: function(c) {
678
- return n(c) + " \u0E41\u0E16\u0E27";
679
- },
680
- actions: "\u0E01\u0E32\u0E23\u0E08\u0E31\u0E14\u0E01\u0E32\u0E23",
681
- optional: "\u0E44\u0E21\u0E48\u0E1A\u0E31\u0E07\u0E04\u0E31\u0E1A",
682
- timePlaceholder: "\u0E0A\u0E0A:\u0E19\u0E19",
683
- timeInvalid: "\u0E1E\u0E34\u0E21\u0E1E\u0E4C\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A 09:30",
684
- timeOutOfRange: function(a, b) {
685
- return "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E40\u0E27\u0E25\u0E32\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07 " + a + "\u2013" + b + " \u0E19.";
686
- },
687
- dropFiles: "\u0E25\u0E32\u0E01\u0E44\u0E1F\u0E25\u0E4C\u0E21\u0E32\u0E27\u0E32\u0E07 \u0E2B\u0E23\u0E37\u0E2D",
688
- browse: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E1F\u0E25\u0E4C",
689
- browseOne: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E1F\u0E25\u0E4C",
690
- remove: function(n2) {
691
- return "\u0E25\u0E1A " + n2;
692
- },
693
- fileTooBig: function(max) {
694
- return "\u0E44\u0E1F\u0E25\u0E4C\u0E43\u0E2B\u0E0D\u0E48\u0E40\u0E01\u0E34\u0E19 " + max;
695
- },
696
- fileWrongType: "\u0E44\u0E21\u0E48\u0E23\u0E2D\u0E07\u0E23\u0E31\u0E1A\u0E44\u0E1F\u0E25\u0E4C\u0E0A\u0E19\u0E34\u0E14\u0E19\u0E35\u0E49",
697
- tooManyFiles: function(n2) {
698
- return "\u0E41\u0E19\u0E1A\u0E44\u0E14\u0E49\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 " + n2 + " \u0E44\u0E1F\u0E25\u0E4C";
699
- },
700
- colorScheme: "\u0E42\u0E2B\u0E21\u0E14\u0E2A\u0E35",
701
- schemeLight: "\u0E2A\u0E27\u0E48\u0E32\u0E07",
702
- schemeDark: "\u0E21\u0E37\u0E14",
703
- schemeSystem: "\u0E15\u0E32\u0E21\u0E23\u0E30\u0E1A\u0E1A",
704
- uploading: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14\u2026",
705
- images: "\u0E23\u0E39\u0E1B\u0E20\u0E32\u0E1E",
706
- pagination: "\u0E40\u0E25\u0E02\u0E2B\u0E19\u0E49\u0E32",
707
- pageN: function(p) {
708
- return "\u0E2B\u0E19\u0E49\u0E32 " + p;
709
- },
710
- accepts: function(list, max) {
711
- return [list, max && "\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 " + max + " \u0E15\u0E48\u0E2D\u0E44\u0E1F\u0E25\u0E4C"].filter(Boolean).join(" \xB7 ");
712
- }
713
- }
714
- };
715
- var LocaleContext = React9.createContext(null);
716
- function AuraProvider(props) {
717
- const value = React9.useMemo(
718
- function() {
719
- const base = props.locale && STRINGS[props.locale] || STRINGS.en;
720
- return {
721
- locale: props.locale || "en",
722
- calendar: props.calendar || null,
723
- strings: props.strings ? Object.assign({}, base, props.strings) : base
724
- };
725
- },
726
- [props.locale, props.calendar, props.strings]
727
- );
728
- return /* @__PURE__ */ React9.createElement(LocaleContext.Provider, { value }, props.children);
729
- }
730
- function useAuraLocale() {
731
- return React9.useContext(LocaleContext) || { locale: null, calendar: null, strings: STRINGS.en };
732
- }
733
- function useStrings() {
734
- return useAuraLocale().strings;
858
+ function toneFor(status) {
859
+ const s = String(status == null ? "" : status).trim().toLowerCase();
860
+ for (const t in TONE_WORDS) if (TONE_WORDS[t].indexOf(s) >= 0) return t;
861
+ return "neutral";
735
862
  }
863
+ var TONE_ORDER = { neutral: 0, progress: 1, ready: 2, blocked: 3 };
864
+ var StatusPill = React9.forwardRef(function StatusPill2(props, ref) {
865
+ const tone2 = props.tone || toneFor(props.children);
866
+ return /* @__PURE__ */ React9.createElement("span", { ref, className: cx("aura-pill", "aura-pill--" + tone2, props.className) }, /* @__PURE__ */ React9.createElement(Icon, { name: TONE_ICON[tone2] || "circle", size: 12 }), props.children);
867
+ });
736
868
 
737
869
  // src/Field.tsx
870
+ var React10 = __toESM(require("react"), 1);
738
871
  var h2 = React10.createElement;
739
872
  var Field = React10.forwardRef(function Field2(props, ref) {
740
873
  const t = useStrings();
@@ -967,257 +1100,332 @@ function defaultFilter(option, query) {
967
1100
  return norm(k).indexOf(q) >= 0;
968
1101
  });
969
1102
  }
970
- var Combobox = React16.forwardRef(function Combobox2(props, ref) {
971
- const t = useStrings();
972
- const auto = uid(), id = props.id || auto, listId = id + "-list";
973
- const options = (props.options || []).map(toOpt);
974
- const st = useMaybeControlled(
975
- props.value,
976
- props.defaultValue == null ? null : props.defaultValue,
977
- props.onChange
978
- );
979
- const value = st[0], setValue = st[1];
980
- const selected = options.filter(function(o) {
981
- return o.value === value;
982
- })[0] || null;
983
- const openState = React16.useState(false), open = openState[0], setOpen = openState[1];
984
- const qState = React16.useState(null), query = qState[0], setQuery = qState[1];
985
- const aState = React16.useState(0), active = aState[0], setActive = aState[1];
986
- const posState = React16.useState(null);
987
- const inputRef = React16.useRef(null), inputMerged = useMergedRef(ref, inputRef), boxRef = React16.useRef(null), listRef = React16.useRef(null);
988
- const mounted = useMounted();
989
- const limit = props.limit || 200;
990
- const filter = props.filter || defaultFilter;
991
- let shown = props.onSearch || query == null ? options : options.filter(function(o) {
992
- return filter(o, query);
993
- });
994
- const more = shown.length > limit;
995
- shown = shown.slice(0, limit);
996
- const activeIdx = Math.min(active, shown.length - 1);
997
- function place() {
998
- if (!boxRef.current) return;
999
- const r = boxRef.current.getBoundingClientRect();
1000
- const maxH = 320, below = window.innerHeight - r.bottom - 8, up = below < 200 && r.top > below;
1001
- posState[1]({
1002
- left: r.left,
1003
- width: r.width,
1004
- top: up ? void 0 : r.bottom + 4,
1005
- bottom: up ? window.innerHeight - r.top + 4 : void 0,
1006
- maxHeight: Math.min(maxH, (up ? r.top : below) - 8)
1103
+ var Combobox = React16.forwardRef(
1104
+ function Combobox2(all, ref) {
1105
+ const props = all;
1106
+ const multi = all.multiple === true;
1107
+ const mp = all;
1108
+ const t = useStrings();
1109
+ const auto = uid(), id = props.id || auto, listId = id + "-list";
1110
+ const options = (props.options || []).map(toOpt);
1111
+ const st = useMaybeControlled(
1112
+ multi ? mp.value : props.value === void 0 ? void 0 : props.value == null ? [] : [props.value],
1113
+ multi ? mp.defaultValue || [] : props.defaultValue == null ? [] : [props.defaultValue],
1114
+ function(next) {
1115
+ if (multi) {
1116
+ if (mp.onChange) mp.onChange(next);
1117
+ } else if (props.onChange) props.onChange(next.length ? next[0] : null);
1118
+ }
1119
+ );
1120
+ const values = st[0], setValues = st[1];
1121
+ const value = values.length ? values[0] : null;
1122
+ function setValue(v) {
1123
+ setValues(v == null ? [] : [v]);
1124
+ }
1125
+ const isPicked = function(v) {
1126
+ return values.indexOf(v) >= 0;
1127
+ };
1128
+ const full = multi && mp.max != null && values.length >= mp.max;
1129
+ const selected = multi ? null : options.filter(function(o) {
1130
+ return o.value === value;
1131
+ })[0] || null;
1132
+ const picked = multi ? values.map(function(v) {
1133
+ return options.filter(function(o) {
1134
+ return o.value === v;
1135
+ })[0];
1136
+ }).filter(Boolean) : [];
1137
+ const openState = React16.useState(false), open = openState[0], setOpen = openState[1];
1138
+ const qState = React16.useState(null), query = qState[0], setQuery = qState[1];
1139
+ const aState = React16.useState(0), active = aState[0], setActive = aState[1];
1140
+ const posState = React16.useState(null);
1141
+ const inputRef = React16.useRef(null), inputMerged = useMergedRef(ref, inputRef), boxRef = React16.useRef(null), listRef = React16.useRef(null);
1142
+ const mounted = useMounted();
1143
+ const limit = props.limit || 200;
1144
+ const filter = props.filter || defaultFilter;
1145
+ let shown = props.onSearch || query == null ? options : options.filter(function(o) {
1146
+ return filter(o, query);
1007
1147
  });
1008
- }
1009
- useIsoLayoutEffect(
1010
- function() {
1011
- if (open) place();
1012
- },
1013
- [open, shown.length]
1014
- );
1015
- React16.useEffect(
1016
- function() {
1017
- if (!open) return;
1018
- function outside(e) {
1019
- if (boxRef.current && boxRef.current.contains(e.target)) return;
1020
- if (listRef.current && listRef.current.contains(e.target)) return;
1021
- close(false);
1148
+ const more = shown.length > limit;
1149
+ shown = shown.slice(0, limit);
1150
+ const activeIdx = Math.min(active, shown.length - 1);
1151
+ function place() {
1152
+ if (!boxRef.current) return;
1153
+ const r = boxRef.current.getBoundingClientRect();
1154
+ const maxH = 320, below = window.innerHeight - r.bottom - 8, up = below < 200 && r.top > below;
1155
+ posState[1]({
1156
+ left: r.left,
1157
+ width: r.width,
1158
+ top: up ? void 0 : r.bottom + 4,
1159
+ bottom: up ? window.innerHeight - r.top + 4 : void 0,
1160
+ maxHeight: Math.min(maxH, (up ? r.top : below) - 8)
1161
+ });
1162
+ }
1163
+ useIsoLayoutEffect(
1164
+ function() {
1165
+ if (open) place();
1166
+ },
1167
+ [open, shown.length]
1168
+ );
1169
+ React16.useEffect(
1170
+ function() {
1171
+ if (!open) return;
1172
+ function outside(e) {
1173
+ if (boxRef.current && boxRef.current.contains(e.target)) return;
1174
+ if (listRef.current && listRef.current.contains(e.target)) return;
1175
+ close(false);
1176
+ }
1177
+ function onScroll(e) {
1178
+ if (!listRef.current || !listRef.current.contains(e.target)) place();
1179
+ }
1180
+ document.addEventListener("pointerdown", outside, true);
1181
+ window.addEventListener("scroll", onScroll, true);
1182
+ window.addEventListener("resize", place);
1183
+ return function() {
1184
+ document.removeEventListener("pointerdown", outside, true);
1185
+ window.removeEventListener("scroll", onScroll, true);
1186
+ window.removeEventListener("resize", place);
1187
+ };
1188
+ },
1189
+ [open]
1190
+ );
1191
+ React16.useEffect(
1192
+ function() {
1193
+ if (!open || !listRef.current) return;
1194
+ const el = listRef.current.querySelector('[data-idx="' + activeIdx + '"]');
1195
+ if (el && el.scrollIntoView) el.scrollIntoView({ block: "nearest" });
1196
+ },
1197
+ [activeIdx, open]
1198
+ );
1199
+ function openList() {
1200
+ if (!open && !props.disabled && !props.readOnly) {
1201
+ setOpen(true);
1202
+ const i = selected ? shown.indexOf(selected) : 0;
1203
+ setActive(i < 0 ? 0 : i);
1022
1204
  }
1023
- function onScroll(e) {
1024
- if (!listRef.current || !listRef.current.contains(e.target)) place();
1205
+ }
1206
+ function close(restoreLabel) {
1207
+ setOpen(false);
1208
+ setQuery(null);
1209
+ }
1210
+ function choose(o) {
1211
+ if (!o || o.disabled) return;
1212
+ if (multi) {
1213
+ if (isPicked(o.value))
1214
+ setValues(
1215
+ values.filter(function(v) {
1216
+ return v !== o.value;
1217
+ })
1218
+ );
1219
+ else if (!full) setValues(values.concat([o.value]));
1220
+ setQuery(null);
1221
+ if (inputRef.current) inputRef.current.focus();
1222
+ return;
1025
1223
  }
1026
- document.addEventListener("pointerdown", outside, true);
1027
- window.addEventListener("scroll", onScroll, true);
1028
- window.addEventListener("resize", place);
1029
- return function() {
1030
- document.removeEventListener("pointerdown", outside, true);
1031
- window.removeEventListener("scroll", onScroll, true);
1032
- window.removeEventListener("resize", place);
1033
- };
1034
- },
1035
- [open]
1036
- );
1037
- React16.useEffect(
1038
- function() {
1039
- if (!open || !listRef.current) return;
1040
- const el = listRef.current.querySelector('[data-idx="' + activeIdx + '"]');
1041
- if (el && el.scrollIntoView) el.scrollIntoView({ block: "nearest" });
1042
- },
1043
- [activeIdx, open]
1044
- );
1045
- function openList() {
1046
- if (!open && !props.disabled && !props.readOnly) {
1047
- setOpen(true);
1048
- const i = selected ? shown.indexOf(selected) : 0;
1049
- setActive(i < 0 ? 0 : i);
1224
+ setValue(o.value);
1225
+ setQuery(null);
1226
+ setOpen(false);
1227
+ if (inputRef.current) inputRef.current.focus();
1050
1228
  }
1051
- }
1052
- function close(restoreLabel) {
1053
- setOpen(false);
1054
- setQuery(null);
1055
- }
1056
- function choose(o) {
1057
- if (!o || o.disabled) return;
1058
- setValue(o.value);
1059
- setQuery(null);
1060
- setOpen(false);
1061
- if (inputRef.current) inputRef.current.focus();
1062
- }
1063
- function onKeyDown(e) {
1064
- const k = e.key;
1065
- if (k === "ArrowDown") {
1066
- e.preventDefault();
1067
- if (!open) openList();
1068
- else setActive(Math.min(activeIdx + 1, shown.length - 1));
1069
- } else if (k === "ArrowUp") {
1070
- e.preventDefault();
1071
- if (!open) openList();
1072
- else setActive(Math.max(activeIdx - 1, 0));
1073
- } else if (k === "Home" && open) {
1074
- e.preventDefault();
1075
- setActive(0);
1076
- } else if (k === "End" && open) {
1077
- e.preventDefault();
1078
- setActive(shown.length - 1);
1079
- } else if (k === "Enter") {
1080
- if (open && shown[activeIdx]) {
1229
+ function onKeyDown(e) {
1230
+ const k = e.key;
1231
+ if (k === "ArrowDown") {
1081
1232
  e.preventDefault();
1082
- choose(shown[activeIdx]);
1083
- }
1084
- } else if (k === "Escape") {
1085
- if (open) {
1233
+ if (!open) openList();
1234
+ else setActive(Math.min(activeIdx + 1, shown.length - 1));
1235
+ } else if (k === "ArrowUp") {
1086
1236
  e.preventDefault();
1087
- e.stopPropagation();
1088
- close();
1089
- } else if (props.clearable !== false && value != null && query == null) {
1090
- setValue(null);
1237
+ if (!open) openList();
1238
+ else setActive(Math.max(activeIdx - 1, 0));
1239
+ } else if (k === "Home" && open) {
1240
+ e.preventDefault();
1241
+ setActive(0);
1242
+ } else if (k === "End" && open) {
1243
+ e.preventDefault();
1244
+ setActive(shown.length - 1);
1245
+ } else if (k === "Enter") {
1246
+ if (open && shown[activeIdx]) {
1247
+ e.preventDefault();
1248
+ choose(shown[activeIdx]);
1249
+ }
1250
+ } else if (k === "Escape") {
1251
+ if (open) {
1252
+ e.preventDefault();
1253
+ e.stopPropagation();
1254
+ close();
1255
+ } else if (!multi && props.clearable !== false && value != null && query == null) {
1256
+ setValue(null);
1257
+ }
1258
+ } else if (k === "Backspace" && multi && !text && values.length) {
1259
+ setValues(values.slice(0, -1));
1260
+ } else if (k === "Tab") {
1261
+ if (open) close();
1091
1262
  }
1092
- } else if (k === "Tab") {
1093
- if (open) close();
1094
1263
  }
1095
- }
1096
- const text = query != null ? query : selected ? selected.label : "";
1097
- const optId = function(i) {
1098
- return id + "-opt-" + i;
1099
- };
1100
- const list = open && mounted && posState[0] ? (0, import_react_dom2.createPortal)(
1101
- /* @__PURE__ */ React16.createElement("div", { ref: listRef, className: "aura-combo__popover", style: posState[0] }, /* @__PURE__ */ React16.createElement("ul", { id: listId, role: "listbox", "aria-label": props.label, className: "aura-combo__list" }, props.loading ? /* @__PURE__ */ React16.createElement("li", { className: "aura-combo__note", role: "presentation" }, /* @__PURE__ */ React16.createElement(Icon, { name: "loader-circle", className: "aura-spin" }), props.loadingText || t.searching) : !shown.length ? /* @__PURE__ */ React16.createElement("li", { className: "aura-combo__note", role: "presentation" }, props.emptyText || t.noMatches) : shown.map(function(o, i) {
1102
- const isSel = selected && o.value === selected.value;
1103
- return /* @__PURE__ */ React16.createElement(
1104
- "li",
1264
+ const text = query != null ? query : selected ? selected.label : "";
1265
+ const summaryId = id + "-picked";
1266
+ const optId = function(i) {
1267
+ return id + "-opt-" + i;
1268
+ };
1269
+ const list = open && mounted && posState[0] ? (0, import_react_dom2.createPortal)(
1270
+ /* @__PURE__ */ React16.createElement("div", { ref: listRef, className: "aura-combo__popover", style: posState[0] }, /* @__PURE__ */ React16.createElement(
1271
+ "ul",
1105
1272
  {
1106
- key: o.value,
1107
- id: optId(i),
1108
- role: "option",
1109
- "data-idx": i,
1110
- "aria-selected": isSel,
1111
- "aria-disabled": o.disabled || void 0,
1112
- className: cx(
1113
- "aura-combo__option",
1114
- i === activeIdx && "is-active",
1115
- isSel && "is-selected",
1116
- o.disabled && "is-disabled"
1117
- ),
1118
- onPointerDown: function(e) {
1119
- e.preventDefault();
1120
- },
1121
- onClick: function() {
1122
- choose(o);
1123
- },
1124
- onPointerMove: function() {
1125
- if (activeIdx !== i) setActive(i);
1126
- }
1273
+ id: listId,
1274
+ role: "listbox",
1275
+ "aria-label": props.label,
1276
+ "aria-multiselectable": multi || void 0,
1277
+ className: "aura-combo__list"
1127
1278
  },
1128
- o.icon ? /* @__PURE__ */ React16.createElement(Icon, { name: o.icon }) : null,
1129
- /* @__PURE__ */ React16.createElement("span", { className: "aura-combo__text" }, /* @__PURE__ */ React16.createElement("span", { className: "aura-combo__label" }, o.label), o.description ? /* @__PURE__ */ React16.createElement("span", { className: "aura-combo__desc" }, o.description) : null),
1130
- isSel ? /* @__PURE__ */ React16.createElement(Icon, { name: "check", className: "aura-combo__check" }) : null
1131
- );
1132
- }), more && !props.loading ? /* @__PURE__ */ React16.createElement("li", { className: "aura-combo__note", role: "presentation" }, t.keepTyping((props.options || []).length)) : null)),
1133
- document.body
1134
- ) : null;
1135
- return /* @__PURE__ */ React16.createElement(
1136
- Field,
1137
- {
1138
- id,
1139
- label: props.label,
1140
- hint: props.hint,
1141
- error: props.error,
1142
- required: props.required,
1143
- optional: props.optional,
1144
- disabled: props.disabled,
1145
- className: props.className
1146
- },
1147
- /* @__PURE__ */ React16.createElement("div", { ref: boxRef, className: cx("aura-input aura-combo has-icon", open && "is-open") }, /* @__PURE__ */ React16.createElement(Icon, { name: props.icon || "search", className: "aura-input__icon" }), /* @__PURE__ */ React16.createElement(
1148
- "input",
1279
+ props.loading ? /* @__PURE__ */ React16.createElement("li", { className: "aura-combo__note", role: "presentation" }, /* @__PURE__ */ React16.createElement(Icon, { name: "loader-circle", className: "aura-spin" }), props.loadingText || t.searching) : !shown.length ? /* @__PURE__ */ React16.createElement("li", { className: "aura-combo__note", role: "presentation" }, props.emptyText || t.noMatches) : shown.map(function(o, i) {
1280
+ const isSel = multi ? isPicked(o.value) : !!selected && o.value === selected.value;
1281
+ const blocked = o.disabled || multi && full && !isSel;
1282
+ return /* @__PURE__ */ React16.createElement(
1283
+ "li",
1284
+ {
1285
+ key: o.value,
1286
+ id: optId(i),
1287
+ role: "option",
1288
+ "data-idx": i,
1289
+ "aria-selected": isSel,
1290
+ "aria-disabled": blocked || void 0,
1291
+ className: cx(
1292
+ "aura-combo__option",
1293
+ i === activeIdx && "is-active",
1294
+ isSel && "is-selected",
1295
+ blocked && "is-disabled"
1296
+ ),
1297
+ onPointerDown: function(e) {
1298
+ e.preventDefault();
1299
+ },
1300
+ onClick: function() {
1301
+ if (!blocked || isSel) choose(o);
1302
+ },
1303
+ onPointerMove: function() {
1304
+ if (activeIdx !== i) setActive(i);
1305
+ }
1306
+ },
1307
+ o.icon ? /* @__PURE__ */ React16.createElement(Icon, { name: o.icon }) : null,
1308
+ /* @__PURE__ */ React16.createElement("span", { className: "aura-combo__text" }, /* @__PURE__ */ React16.createElement("span", { className: "aura-combo__label" }, o.label), o.description ? /* @__PURE__ */ React16.createElement("span", { className: "aura-combo__desc" }, o.description) : null),
1309
+ isSel ? /* @__PURE__ */ React16.createElement(Icon, { name: "check", className: "aura-combo__check" }) : null
1310
+ );
1311
+ }),
1312
+ more && !props.loading ? /* @__PURE__ */ React16.createElement("li", { className: "aura-combo__note", role: "presentation" }, t.keepTyping((props.options || []).length)) : null
1313
+ )),
1314
+ document.body
1315
+ ) : null;
1316
+ return /* @__PURE__ */ React16.createElement(
1317
+ Field,
1149
1318
  {
1150
- ref: inputMerged,
1151
1319
  id,
1152
- type: "text",
1153
- role: "combobox",
1154
- className: "aura-input__control",
1155
- autoComplete: "off",
1156
- "aria-expanded": open,
1157
- "aria-controls": listId,
1158
- "aria-autocomplete": "list",
1159
- "aria-activedescendant": open && shown[activeIdx] ? optId(activeIdx) : void 0,
1160
- "aria-invalid": props.error ? true : void 0,
1161
- "aria-describedby": props.error ? id + "-error" : props.hint ? id + "-hint" : void 0,
1162
- placeholder: props.placeholder,
1163
- disabled: props.disabled,
1164
- readOnly: props.readOnly,
1320
+ label: props.label,
1321
+ hint: props.hint,
1322
+ error: props.error,
1165
1323
  required: props.required,
1166
- name: props.name,
1167
- value: text,
1168
- onChange: function(e) {
1169
- setQuery(e.target.value);
1170
- setActive(0);
1171
- if (!open) setOpen(true);
1172
- if (props.onSearch) props.onSearch(e.target.value);
1173
- },
1174
- onClick: openList,
1175
- onKeyDown,
1176
- onBlur: function() {
1177
- setTimeout(function() {
1178
- if (listRef.current && listRef.current.contains(document.activeElement)) return;
1179
- setOpen(false);
1180
- setQuery(null);
1181
- }, 0);
1182
- }
1183
- }
1184
- ), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */ React16.createElement(
1185
- "button",
1186
- {
1187
- type: "button",
1188
- className: "aura-combo__clear",
1189
- "aria-label": t.clear(props.label),
1190
- tabIndex: -1,
1191
- onClick: function() {
1192
- setValue(null);
1193
- setQuery(null);
1194
- if (inputRef.current) inputRef.current.focus();
1195
- }
1324
+ optional: props.optional,
1325
+ disabled: props.disabled,
1326
+ className: props.className
1196
1327
  },
1197
- /* @__PURE__ */ React16.createElement(Icon, { name: "x" })
1198
- ) : null, /* @__PURE__ */ React16.createElement(
1199
- "button",
1200
- {
1201
- type: "button",
1202
- tabIndex: -1,
1203
- "aria-hidden": true,
1204
- className: "aura-combo__toggle",
1205
- onPointerDown: function(e) {
1206
- e.preventDefault();
1207
- },
1208
- onClick: function() {
1209
- if (open) close();
1210
- else {
1211
- openList();
1212
- inputRef.current && inputRef.current.focus();
1328
+ /* @__PURE__ */ React16.createElement("div", { ref: boxRef, className: cx("aura-input aura-combo has-icon", open && "is-open", multi && "is-multi") }, /* @__PURE__ */ React16.createElement(Icon, { name: props.icon || "search", className: "aura-input__icon" }), multi && picked.length ? /* @__PURE__ */ React16.createElement("span", { className: "aura-combo__chips" }, picked.map(function(o) {
1329
+ return /* @__PURE__ */ React16.createElement("span", { key: o.value, className: "aura-combo__chip" }, /* @__PURE__ */ React16.createElement("span", { className: "aura-combo__chip-label" }, o.label), props.disabled || props.readOnly ? null : /* @__PURE__ */ React16.createElement(
1330
+ "button",
1331
+ {
1332
+ type: "button",
1333
+ tabIndex: -1,
1334
+ className: "aura-combo__chip-remove",
1335
+ "aria-label": t.remove(o.label),
1336
+ onPointerDown: function(e) {
1337
+ e.preventDefault();
1338
+ },
1339
+ onClick: function() {
1340
+ setValues(
1341
+ values.filter(function(v) {
1342
+ return v !== o.value;
1343
+ })
1344
+ );
1345
+ if (inputRef.current) inputRef.current.focus();
1346
+ }
1347
+ },
1348
+ /* @__PURE__ */ React16.createElement(Icon, { name: "x" })
1349
+ ));
1350
+ })) : null, multi ? /* @__PURE__ */ React16.createElement("span", { id: summaryId, className: "aura-sr-only" }, picked.length ? t.selectedCount(picked.length) + ": " + picked.map(function(o) {
1351
+ return o.label;
1352
+ }).join(", ") : "") : null, multi && props.name ? values.map(function(v) {
1353
+ return /* @__PURE__ */ React16.createElement("input", { key: v, type: "hidden", name: props.name, value: v });
1354
+ }) : null, /* @__PURE__ */ React16.createElement(
1355
+ "input",
1356
+ {
1357
+ ref: inputMerged,
1358
+ id,
1359
+ type: "text",
1360
+ role: "combobox",
1361
+ className: "aura-input__control",
1362
+ autoComplete: "off",
1363
+ "aria-expanded": open,
1364
+ "aria-controls": listId,
1365
+ "aria-autocomplete": "list",
1366
+ "aria-activedescendant": open && shown[activeIdx] ? optId(activeIdx) : void 0,
1367
+ "aria-invalid": props.error ? true : void 0,
1368
+ "aria-describedby": [props.error ? id + "-error" : props.hint ? id + "-hint" : "", multi && picked.length ? summaryId : ""].filter(Boolean).join(" ") || void 0,
1369
+ placeholder: multi && values.length ? void 0 : props.placeholder,
1370
+ disabled: props.disabled,
1371
+ readOnly: props.readOnly,
1372
+ required: props.required && (!multi || !values.length),
1373
+ name: multi ? void 0 : props.name,
1374
+ value: text,
1375
+ onChange: function(e) {
1376
+ setQuery(e.target.value);
1377
+ setActive(0);
1378
+ if (!open) setOpen(true);
1379
+ if (props.onSearch) props.onSearch(e.target.value);
1380
+ },
1381
+ onClick: openList,
1382
+ onKeyDown,
1383
+ onBlur: function() {
1384
+ setTimeout(function() {
1385
+ if (listRef.current && listRef.current.contains(document.activeElement)) return;
1386
+ setOpen(false);
1387
+ setQuery(null);
1388
+ }, 0);
1213
1389
  }
1214
1390
  }
1215
- },
1216
- /* @__PURE__ */ React16.createElement(Icon, { name: "chevron-down" })
1217
- )),
1218
- list
1219
- );
1220
- });
1391
+ ), props.clearable !== false && values.length && !props.disabled ? /* @__PURE__ */ React16.createElement(
1392
+ "button",
1393
+ {
1394
+ type: "button",
1395
+ className: "aura-combo__clear",
1396
+ "aria-label": t.clear(props.label),
1397
+ tabIndex: -1,
1398
+ onClick: function() {
1399
+ setValues([]);
1400
+ setQuery(null);
1401
+ if (inputRef.current) inputRef.current.focus();
1402
+ }
1403
+ },
1404
+ /* @__PURE__ */ React16.createElement(Icon, { name: "x" })
1405
+ ) : null, /* @__PURE__ */ React16.createElement(
1406
+ "button",
1407
+ {
1408
+ type: "button",
1409
+ tabIndex: -1,
1410
+ "aria-hidden": true,
1411
+ className: "aura-combo__toggle",
1412
+ onPointerDown: function(e) {
1413
+ e.preventDefault();
1414
+ },
1415
+ onClick: function() {
1416
+ if (open) close();
1417
+ else {
1418
+ openList();
1419
+ inputRef.current && inputRef.current.focus();
1420
+ }
1421
+ }
1422
+ },
1423
+ /* @__PURE__ */ React16.createElement(Icon, { name: "chevron-down" })
1424
+ )),
1425
+ list
1426
+ );
1427
+ }
1428
+ );
1221
1429
 
1222
1430
  // src/DatePicker.tsx
1223
1431
  var React17 = __toESM(require("react"), 1);
@@ -1245,8 +1453,69 @@ function addMonths(d, n2) {
1245
1453
  function same(a, b) {
1246
1454
  return !!a && !!b && a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
1247
1455
  }
1456
+ var TAGS = { th: "th-TH", en: "en-GB", sv: "sv-SE" };
1457
+ function defaultCalendar(locale) {
1458
+ return locale === "sv" ? "gregory" : "buddhist";
1459
+ }
1248
1460
  function localeTag(locale, calendar) {
1249
- return (locale === "en" ? "en-GB" : "th-TH") + "-u-ca-" + (calendar === "gregory" ? "gregory" : "buddhist");
1461
+ const cal = calendar || defaultCalendar(locale);
1462
+ return (TAGS[locale || "th"] || "th-TH") + "-u-ca-" + (cal === "gregory" ? "gregory" : "buddhist");
1463
+ }
1464
+ var DATE_TEXT = {
1465
+ th: {
1466
+ prevYears: "\u0E0A\u0E48\u0E27\u0E07\u0E1B\u0E35\u0E01\u0E48\u0E2D\u0E19\u0E2B\u0E19\u0E49\u0E32",
1467
+ nextYears: "\u0E0A\u0E48\u0E27\u0E07\u0E1B\u0E35\u0E16\u0E31\u0E14\u0E44\u0E1B",
1468
+ prevMonth: "\u0E40\u0E14\u0E37\u0E2D\u0E19\u0E01\u0E48\u0E2D\u0E19\u0E2B\u0E19\u0E49\u0E32",
1469
+ nextMonth: "\u0E40\u0E14\u0E37\u0E2D\u0E19\u0E16\u0E31\u0E14\u0E44\u0E1B",
1470
+ today: "\u0E27\u0E31\u0E19\u0E19\u0E35\u0E49",
1471
+ clear: "\u0E25\u0E49\u0E32\u0E07",
1472
+ chooseDate: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48",
1473
+ datePlaceholder: "\u0E27\u0E27/\u0E14\u0E14/\u0E1B\u0E1B\u0E1B\u0E1B",
1474
+ clearDate: "\u0E25\u0E49\u0E32\u0E07\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48",
1475
+ openCalendar: "\u0E40\u0E1B\u0E34\u0E14\u0E1B\u0E0F\u0E34\u0E17\u0E34\u0E19",
1476
+ chooseDates: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E0A\u0E48\u0E27\u0E07\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48",
1477
+ rangePlaceholder: "\u0E27\u0E27/\u0E14\u0E14/\u0E1B\u0E1B\u0E1B\u0E1B \u2013 \u0E27\u0E27/\u0E14\u0E14/\u0E1B\u0E1B\u0E1B\u0E1B",
1478
+ clearDates: "\u0E25\u0E49\u0E32\u0E07\u0E0A\u0E48\u0E27\u0E07\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48",
1479
+ chooseStart: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E27\u0E31\u0E19\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19",
1480
+ chooseEnd: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E27\u0E31\u0E19\u0E2A\u0E34\u0E49\u0E19\u0E2A\u0E38\u0E14"
1481
+ },
1482
+ en: {
1483
+ prevYears: "Previous years",
1484
+ nextYears: "Next years",
1485
+ prevMonth: "Previous month",
1486
+ nextMonth: "Next month",
1487
+ today: "Today",
1488
+ clear: "Clear",
1489
+ chooseDate: "Choose date",
1490
+ datePlaceholder: "dd/mm/yyyy",
1491
+ clearDate: "Clear date",
1492
+ openCalendar: "Open calendar",
1493
+ chooseDates: "Choose dates",
1494
+ rangePlaceholder: "dd/mm/yyyy \u2013 dd/mm/yyyy",
1495
+ clearDates: "Clear dates",
1496
+ chooseStart: "Choose the start date",
1497
+ chooseEnd: "Choose the end date"
1498
+ },
1499
+ sv: {
1500
+ prevYears: "Tidigare \xE5r",
1501
+ nextYears: "Senare \xE5r",
1502
+ prevMonth: "F\xF6reg\xE5ende m\xE5nad",
1503
+ nextMonth: "N\xE4sta m\xE5nad",
1504
+ today: "Idag",
1505
+ clear: "Rensa",
1506
+ chooseDate: "V\xE4lj datum",
1507
+ datePlaceholder: "\xE5\xE5\xE5\xE5-mm-dd",
1508
+ clearDate: "Rensa datum",
1509
+ openCalendar: "\xD6ppna kalendern",
1510
+ chooseDates: "V\xE4lj datum",
1511
+ rangePlaceholder: "\xE5\xE5\xE5\xE5-mm-dd \u2013 \xE5\xE5\xE5\xE5-mm-dd",
1512
+ clearDates: "Rensa datumen",
1513
+ chooseStart: "V\xE4lj startdatum",
1514
+ chooseEnd: "V\xE4lj slutdatum"
1515
+ }
1516
+ };
1517
+ function dateText(locale) {
1518
+ return DATE_TEXT[locale || "th"] || DATE_TEXT.th;
1250
1519
  }
1251
1520
  var fmtCache = {};
1252
1521
  var PRESETS = {
@@ -1269,12 +1538,12 @@ var MONTHS = null;
1269
1538
  function monthIndex(word) {
1270
1539
  if (!MONTHS) {
1271
1540
  MONTHS = {};
1272
- ["th-TH", "en-GB"].forEach(function(tag) {
1541
+ ["th-TH", "en-GB", "sv-SE"].forEach(function(tag) {
1273
1542
  ["short", "long"].forEach(function(w) {
1274
1543
  for (let i = 0; i < 12; i++) {
1275
1544
  const n2 = new Intl.DateTimeFormat(tag, { month: w }).format(new Date(2020, i, 1)).toLowerCase().replace(/\.$/, "");
1276
1545
  MONTHS[n2] = i;
1277
- if (/^[a-z]/.test(n2)) MONTHS[n2.slice(0, 3)] = i;
1546
+ if (/^[a-zåäö]/.test(n2)) MONTHS[n2.slice(0, 3)] = i;
1278
1547
  }
1279
1548
  });
1280
1549
  });
@@ -1303,8 +1572,8 @@ function parseDate(text) {
1303
1572
  return dt.getMonth() === mo - 1 && dt.getDate() === d ? toISO(dt) : null;
1304
1573
  }
1305
1574
  var Calendar = React17.forwardRef(function Calendar2(props, ref) {
1306
- const ctx = useAuraLocale(), locale = props.locale || ctx.locale || "th", calendar = props.calendar || ctx.calendar || "buddhist", tag = localeTag(locale, calendar);
1307
- const weekStart = props.weekStartsOn == null ? 0 : props.weekStartsOn;
1575
+ const ctx = useAuraLocale(), locale = props.locale || ctx.locale || "th", calendar = props.calendar || ctx.calendar || defaultCalendar(locale), tag = localeTag(locale, calendar);
1576
+ const weekStart = props.weekStartsOn == null ? locale === "sv" ? 1 : 0 : props.weekStartsOn;
1308
1577
  let today = /* @__PURE__ */ new Date();
1309
1578
  today = new Date(today.getFullYear(), today.getMonth(), today.getDate());
1310
1579
  const min = fromISO(props.min), max = fromISO(props.max);
@@ -1314,7 +1583,8 @@ var Calendar = React17.forwardRef(function Calendar2(props, ref) {
1314
1583
  const viewState = React17.useState("days"), view = viewState[0], setView = viewState[1];
1315
1584
  const hoverState = React17.useState(null);
1316
1585
  const gridRef = React17.useRef(null), gridMerged = useMergedRef(ref, gridRef), moved = React17.useRef(false);
1317
- const th = locale !== "en";
1586
+ const th = locale === "th";
1587
+ const dt = dateText(locale);
1318
1588
  function disabled(d) {
1319
1589
  return !!(min && d < min || max && d > max || props.isDateDisabled && props.isDateDisabled(toISO(d)));
1320
1590
  }
@@ -1380,7 +1650,7 @@ var Calendar = React17.forwardRef(function Calendar2(props, ref) {
1380
1650
  IconButton,
1381
1651
  {
1382
1652
  icon: "chevron-left",
1383
- label: th ? "\u0E0A\u0E48\u0E27\u0E07\u0E1B\u0E35\u0E01\u0E48\u0E2D\u0E19\u0E2B\u0E19\u0E49\u0E32" : "Previous years",
1653
+ label: dt.prevYears,
1384
1654
  onClick: function() {
1385
1655
  setFocus(new Date(yr - 12, focusDate.getMonth(), 1));
1386
1656
  }
@@ -1399,7 +1669,7 @@ var Calendar = React17.forwardRef(function Calendar2(props, ref) {
1399
1669
  IconButton,
1400
1670
  {
1401
1671
  icon: "chevron-right",
1402
- label: th ? "\u0E0A\u0E48\u0E27\u0E07\u0E1B\u0E35\u0E16\u0E31\u0E14\u0E44\u0E1B" : "Next years",
1672
+ label: dt.nextYears,
1403
1673
  onClick: function() {
1404
1674
  setFocus(new Date(yr + 12, focusDate.getMonth(), 1));
1405
1675
  }
@@ -1427,7 +1697,7 @@ var Calendar = React17.forwardRef(function Calendar2(props, ref) {
1427
1697
  IconButton,
1428
1698
  {
1429
1699
  icon: "chevron-left",
1430
- label: th ? "\u0E40\u0E14\u0E37\u0E2D\u0E19\u0E01\u0E48\u0E2D\u0E19\u0E2B\u0E19\u0E49\u0E32" : "Previous month",
1700
+ label: dt.prevMonth,
1431
1701
  onClick: function() {
1432
1702
  setFocus(addMonths(focusDate, -1));
1433
1703
  }
@@ -1448,7 +1718,7 @@ var Calendar = React17.forwardRef(function Calendar2(props, ref) {
1448
1718
  IconButton,
1449
1719
  {
1450
1720
  icon: "chevron-right",
1451
- label: th ? "\u0E40\u0E14\u0E37\u0E2D\u0E19\u0E16\u0E31\u0E14\u0E44\u0E1B" : "Next month",
1721
+ label: dt.nextMonth,
1452
1722
  onClick: function() {
1453
1723
  setFocus(addMonths(focusDate, 1));
1454
1724
  }
@@ -1522,8 +1792,8 @@ var Calendar = React17.forwardRef(function Calendar2(props, ref) {
1522
1792
  props.onSelect(toISO(today));
1523
1793
  }
1524
1794
  },
1525
- th ? "\u0E27\u0E31\u0E19\u0E19\u0E35\u0E49" : "Today"
1526
- ), props.onClear ? /* @__PURE__ */ React17.createElement("button", { type: "button", className: "aura-cal__link", onClick: props.onClear }, th ? "\u0E25\u0E49\u0E32\u0E07" : "Clear") : null));
1795
+ dt.today
1796
+ ), props.onClear ? /* @__PURE__ */ React17.createElement("button", { type: "button", className: "aura-cal__link", onClick: props.onClear }, dt.clear) : null));
1527
1797
  });
1528
1798
  function useCalendarPopover(boxRef) {
1529
1799
  const openState = React17.useState(false), open = openState[0], setOpen = openState[1];
@@ -1645,7 +1915,7 @@ function DateField(props) {
1645
1915
  }
1646
1916
  var DatePicker = React17.forwardRef(function DatePicker2(props, ref) {
1647
1917
  const auto = uid(), id = props.id || auto, dialogId = id + "-cal";
1648
- const ctx = useAuraLocale(), locale = props.locale || ctx.locale || "th", calendar = props.calendar || ctx.calendar || "buddhist", th = locale !== "en";
1918
+ const ctx = useAuraLocale(), locale = props.locale || ctx.locale || "th", calendar = props.calendar || ctx.calendar || defaultCalendar(locale), dt = dateText(locale);
1649
1919
  const st = useMaybeControlled(
1650
1920
  props.value,
1651
1921
  props.defaultValue == null ? null : props.defaultValue,
@@ -1673,7 +1943,7 @@ var DatePicker = React17.forwardRef(function DatePicker2(props, ref) {
1673
1943
  id: dialogId,
1674
1944
  role: "dialog",
1675
1945
  "aria-modal": false,
1676
- "aria-label": props.label || (th ? "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48" : "Choose date"),
1946
+ "aria-label": props.label || dt.chooseDate,
1677
1947
  className: "aura-cal__popover",
1678
1948
  style: pop.pos,
1679
1949
  onKeyDown: function(e) {
@@ -1720,15 +1990,15 @@ var DatePicker = React17.forwardRef(function DatePicker2(props, ref) {
1720
1990
  inputRef: inputMerged,
1721
1991
  open: pop.open,
1722
1992
  display: formatDate(st[0], { locale, calendar }),
1723
- placeholder: props.placeholder || (th ? "\u0E27\u0E27/\u0E14\u0E14/\u0E1B\u0E1B\u0E1B\u0E1B" : "dd/mm/yyyy"),
1993
+ placeholder: props.placeholder || dt.datePlaceholder,
1724
1994
  hasValue: st[0] != null,
1725
1995
  clearable: props.clearable,
1726
1996
  onClear: function() {
1727
1997
  st[1](null);
1728
1998
  inputRef.current && inputRef.current.focus();
1729
1999
  },
1730
- clearLabel: th ? "\u0E25\u0E49\u0E32\u0E07\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48" : "Clear date",
1731
- toggleLabel: th ? "\u0E40\u0E1B\u0E34\u0E14\u0E1B\u0E0F\u0E34\u0E17\u0E34\u0E19" : "Open calendar",
2000
+ clearLabel: dt.clearDate,
2001
+ toggleLabel: dt.openCalendar,
1732
2002
  onCommit: commit,
1733
2003
  onToggle: function(o) {
1734
2004
  pop.setOpen(o);
@@ -1740,7 +2010,7 @@ var DatePicker = React17.forwardRef(function DatePicker2(props, ref) {
1740
2010
  var DateRangePicker = React17.forwardRef(
1741
2011
  function DateRangePicker2(props, ref) {
1742
2012
  const auto = uid(), id = props.id || auto, dialogId = id + "-cal";
1743
- const ctx = useAuraLocale(), locale = props.locale || ctx.locale || "th", calendar = props.calendar || ctx.calendar || "buddhist", th = locale !== "en";
2013
+ const ctx = useAuraLocale(), locale = props.locale || ctx.locale || "th", calendar = props.calendar || ctx.calendar || defaultCalendar(locale), dt = dateText(locale);
1744
2014
  const st = useMaybeControlled(
1745
2015
  props.value,
1746
2016
  props.defaultValue || { start: null, end: null },
@@ -1787,7 +2057,7 @@ var DateRangePicker = React17.forwardRef(
1787
2057
  id: dialogId,
1788
2058
  role: "dialog",
1789
2059
  "aria-modal": false,
1790
- "aria-label": props.label || (th ? "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E0A\u0E48\u0E27\u0E07\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48" : "Choose dates"),
2060
+ "aria-label": props.label || dt.chooseDates,
1791
2061
  className: "aura-cal__popover",
1792
2062
  style: pop.pos,
1793
2063
  onKeyDown: function(e) {
@@ -1797,7 +2067,7 @@ var DateRangePicker = React17.forwardRef(
1797
2067
  } else trapTab(e, pop.popRef.current);
1798
2068
  }
1799
2069
  },
1800
- /* @__PURE__ */ React17.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"),
2070
+ /* @__PURE__ */ React17.createElement("p", { className: "aura-cal__hint", "aria-live": "polite" }, draft[0] ? dt.chooseEnd : dt.chooseStart),
1801
2071
  /* @__PURE__ */ React17.createElement(
1802
2072
  Calendar,
1803
2073
  {
@@ -1834,15 +2104,15 @@ var DateRangePicker = React17.forwardRef(
1834
2104
  inputRef: inputMerged,
1835
2105
  open: pop.open,
1836
2106
  display: show(v),
1837
- 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"),
2107
+ placeholder: props.placeholder || dt.rangePlaceholder,
1838
2108
  hasValue: v.start != null,
1839
2109
  clearable: props.clearable,
1840
2110
  onClear: function() {
1841
2111
  st[1]({ start: null, end: null });
1842
2112
  inputRef.current && inputRef.current.focus();
1843
2113
  },
1844
- clearLabel: th ? "\u0E25\u0E49\u0E32\u0E07\u0E0A\u0E48\u0E27\u0E07\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48" : "Clear dates",
1845
- toggleLabel: th ? "\u0E40\u0E1B\u0E34\u0E14\u0E1B\u0E0F\u0E34\u0E17\u0E34\u0E19" : "Open calendar",
2114
+ clearLabel: dt.clearDates,
2115
+ toggleLabel: dt.openCalendar,
1846
2116
  onCommit: commit,
1847
2117
  onToggle: function(op) {
1848
2118
  pop.setOpen(op);
@@ -2213,7 +2483,11 @@ var DataTable = React23.forwardRef(function DataTable2(props, ref) {
2213
2483
  });
2214
2484
  const rows = props.rows || [];
2215
2485
  const rowKey = props.rowKey || columns[0].key;
2216
- const loading = !!props.loading;
2486
+ const manual = !!props.manual;
2487
+ const Link = useLinkComponent(props.linkComponent);
2488
+ const busy = !!props.loading;
2489
+ const refreshing = busy && manual && rows.length > 0;
2490
+ const loading = busy && !refreshing;
2217
2491
  const selectable = !!props.selectable;
2218
2492
  const reorderable = props.reorderable !== false && !!props.columnControls;
2219
2493
  const controls = !!props.columnControls;
@@ -2345,7 +2619,7 @@ var DataTable = React23.forwardRef(function DataTable2(props, ref) {
2345
2619
  }
2346
2620
  const view = React23.useMemo(
2347
2621
  function() {
2348
- if (!sort || !sort.key || !byKey[sort.key]) return rows;
2622
+ if (manual || !sort || !sort.key || !byKey[sort.key]) return rows;
2349
2623
  const col = byKey[sort.key];
2350
2624
  const val = col.sortValue || (col.pill ? function(r) {
2351
2625
  return TONE_ORDER[col.tones && col.tones[r[col.key]] || toneFor(r[col.key])];
@@ -2361,7 +2635,7 @@ var DataTable = React23.forwardRef(function DataTable2(props, ref) {
2361
2635
  return p[0];
2362
2636
  });
2363
2637
  },
2364
- [rows, sort && sort.key, sort && sort.dir]
2638
+ [rows, manual, sort && sort.key, sort && sort.dir]
2365
2639
  );
2366
2640
  function nextSort(key) {
2367
2641
  if (!sort || sort.key !== key) return { key, dir: "asc" };
@@ -2369,18 +2643,51 @@ var DataTable = React23.forwardRef(function DataTable2(props, ref) {
2369
2643
  return null;
2370
2644
  }
2371
2645
  const pageSize = props.pageSize || 0;
2372
- const pageCount = pageSize ? Math.max(1, Math.ceil(view.length / pageSize)) : 1;
2646
+ const total = manual ? props.totalRows != null ? props.totalRows : (Math.max(1, pageState[0] || 1) - 1) * pageSize + rows.length + (pageSize && rows.length >= pageSize ? 1 : 0) : view.length;
2647
+ const pageCount = pageSize ? Math.max(1, Math.ceil(total / pageSize)) : 1;
2373
2648
  const page = Math.min(Math.max(1, pageState[0] || 1), pageCount);
2374
2649
  const first = pageSize ? (page - 1) * pageSize : 0;
2375
- const pageRows = pageSize ? view.slice(first, first + pageSize) : view;
2650
+ const pageRows = pageSize && !manual ? view.slice(first, first + pageSize) : view;
2651
+ const canSortAny = !busy && (manual ? total > 1 : rows.length > 1);
2652
+ const shownTotal = manual && props.totalRows == null ? first + rows.length : total;
2653
+ const linkPaging = !!props.getPageHref && !props.onPageChange;
2654
+ const prevLink = React23.useRef(null), nextLink = React23.useRef(null);
2376
2655
  function goPage(p, focus) {
2377
2656
  const next = Math.min(Math.max(1, p), pageCount);
2378
2657
  if (next === page) return false;
2658
+ if (linkPaging) {
2659
+ const a = next === page - 1 ? prevLink.current : next === page + 1 ? nextLink.current : null;
2660
+ if (a) a.click();
2661
+ return false;
2662
+ }
2379
2663
  if (focus) pending.current = focus;
2380
2664
  pageState[1](next);
2381
2665
  if (scrollRef.current) scrollRef.current.scrollTop = 0;
2382
2666
  return true;
2383
2667
  }
2668
+ function sortBy(key) {
2669
+ setSort(nextSort(key));
2670
+ if (!(manual && linkPaging)) goPage(1);
2671
+ }
2672
+ const rowHref = props.getRowHref;
2673
+ function followRow(el, e) {
2674
+ const a = el && el.querySelector(".aura-table__row-link");
2675
+ if (!a) return;
2676
+ a.dispatchEvent(
2677
+ new MouseEvent("click", {
2678
+ bubbles: true,
2679
+ cancelable: true,
2680
+ view: window,
2681
+ ctrlKey: !!(e && e.ctrlKey),
2682
+ metaKey: !!(e && e.metaKey),
2683
+ shiftKey: !!(e && e.shiftKey),
2684
+ altKey: !!(e && e.altKey)
2685
+ })
2686
+ );
2687
+ }
2688
+ function rowLinkWrap(r, content) {
2689
+ return rowHref ? /* @__PURE__ */ React23.createElement(Link, { href: rowHref(r), className: "aura-table__row-link" }, content) : content;
2690
+ }
2384
2691
  const height = props.height || 0;
2385
2692
  const virtual = !!height && !loading && pageRows.length > 0;
2386
2693
  const bodyH = Math.max(ROW_H, height - ROW_H);
@@ -2699,10 +3006,10 @@ var DataTable = React23.forwardRef(function DataTable2(props, ref) {
2699
3006
  else handled = false;
2700
3007
  } else if (k === " " || k === "Enter") {
2701
3008
  if (r === 0 && !col && selectable && nRows) toggleAll();
2702
- else if (r === 0 && col && col.sortable && nRows > 1) {
2703
- setSort(nextSort(col.key));
2704
- goPage(1);
2705
- } else if (r > 0 && k === " " && selectable) toggle(row[rowKey], !selSet[row[rowKey]]);
3009
+ else if (r === 0 && col && col.sortable && canSortAny) sortBy(col.key);
3010
+ else if (r > 0 && k === " " && selectable) toggle(row[rowKey], !selSet[row[rowKey]]);
3011
+ else if (r > 0 && k === "Enter" && rowHref && !target.querySelector("button, a[href]:not(.aura-table__row-link), input, select, textarea"))
3012
+ followRow(target.closest('[role="row"]'), e);
2706
3013
  else if (r > 0 && k === "Enter" && target.querySelector("button, a[href], input, select, textarea"))
2707
3014
  target.querySelector("button, a[href], input, select, textarea").focus();
2708
3015
  else if (r > 0 && k === "Enter" && props.onRowActivate) props.onRowActivate(row);
@@ -2745,7 +3052,7 @@ var DataTable = React23.forwardRef(function DataTable2(props, ref) {
2745
3052
  vis.forEach(function(c, i) {
2746
3053
  const ci = i + (selectable ? 1 : 0);
2747
3054
  const isSorted = sort && sort.key === c.key;
2748
- const canSort = c.sortable && rows.length > 1 && !loading;
3055
+ const canSort = c.sortable && canSortAny;
2749
3056
  const ariaSort = isSorted && canSort ? sort.dir === "desc" ? "descending" : "ascending" : canSort ? "none" : void 0;
2750
3057
  const pin = isPinned(c), edge = pin && i === nPinned - 1;
2751
3058
  head.push(
@@ -2761,12 +3068,13 @@ var DataTable = React23.forwardRef(function DataTable2(props, ref) {
2761
3068
  "data-rc": "0:" + ci,
2762
3069
  className: cx(
2763
3070
  "aura-table__th",
3071
+ c.align === "end" && "is-end",
2764
3072
  pin && "is-pinned",
2765
3073
  edge && "is-pin-edge",
2766
3074
  drag && drag.over === c.key && (drag.after ? "is-drop-after" : "is-drop-before"),
2767
3075
  drag && drag.key === c.key && "is-dragging"
2768
3076
  ),
2769
- draggable: reorderable && !loading ? true : void 0,
3077
+ draggable: reorderable && !busy ? true : void 0,
2770
3078
  onFocus: function(e) {
2771
3079
  if (e.target === e.currentTarget) activeState[1]({ r: 0, c: ci });
2772
3080
  },
@@ -2804,8 +3112,7 @@ var DataTable = React23.forwardRef(function DataTable2(props, ref) {
2804
3112
  tabIndex: -1,
2805
3113
  className: cx("aura-table__sort", isSorted && "is-active"),
2806
3114
  onClick: function() {
2807
- setSort(nextSort(c.key));
2808
- goPage(1);
3115
+ sortBy(c.key);
2809
3116
  activeState[1]({ r: 0, c: ci });
2810
3117
  }
2811
3118
  },
@@ -2858,6 +3165,10 @@ var DataTable = React23.forwardRef(function DataTable2(props, ref) {
2858
3165
  }
2859
3166
  )
2860
3167
  );
3168
+ function cellContent(c, r) {
3169
+ const v = r[c.key];
3170
+ return c.render ? c.render(r) : c.pill ? /* @__PURE__ */ React23.createElement(StatusPill, { ...{ tone: c.tones && c.tones[v] } }, v) : v;
3171
+ }
2861
3172
  function rowCells(r, i, k, isSel) {
2862
3173
  const ri = i + 1;
2863
3174
  const cells = [/* @__PURE__ */ React23.createElement("span", { key: "__gl", className: "aura-table__gutter", "aria-hidden": true })];
@@ -2904,6 +3215,7 @@ var DataTable = React23.forwardRef(function DataTable2(props, ref) {
2904
3215
  className: cx(
2905
3216
  "aura-table__td",
2906
3217
  c.mono && "aura-table__mono",
3218
+ c.align === "end" && "is-end",
2907
3219
  pin && "is-pinned",
2908
3220
  pin && j === nPinned - 1 && "is-pin-edge"
2909
3221
  ),
@@ -2912,7 +3224,7 @@ var DataTable = React23.forwardRef(function DataTable2(props, ref) {
2912
3224
  if (activeState[0].r !== ri || activeState[0].c !== ci) activeState[1]({ r: ri, c: ci });
2913
3225
  }
2914
3226
  },
2915
- c.render ? c.render(r) : c.pill ? /* @__PURE__ */ React23.createElement(StatusPill, { ...{ tone: c.tones && c.tones[v] } }, v) : v
3227
+ j === 0 ? rowLinkWrap(r, cellContent(c, r)) : cellContent(c, r)
2916
3228
  )
2917
3229
  );
2918
3230
  });
@@ -2941,13 +3253,21 @@ var DataTable = React23.forwardRef(function DataTable2(props, ref) {
2941
3253
  );
2942
3254
  vis.forEach(function(c, j) {
2943
3255
  sk.push(
2944
- /* @__PURE__ */ React23.createElement("span", { key: c.key, className: cx("aura-table__td", isPinned(c) && "is-pinned"), style: cellStyle(c, j) }, /* @__PURE__ */ React23.createElement(
3256
+ /* @__PURE__ */ React23.createElement(
2945
3257
  "span",
2946
3258
  {
2947
- className: cx("aura-skel", c.pill && "aura-skel--pill"),
2948
- style: c.pill ? void 0 : { width: SKELETON_WIDTHS[(i + j) % SKELETON_WIDTHS.length] }
2949
- }
2950
- ))
3259
+ key: c.key,
3260
+ className: cx("aura-table__td", c.align === "end" && "is-end", isPinned(c) && "is-pinned"),
3261
+ style: cellStyle(c, j)
3262
+ },
3263
+ /* @__PURE__ */ React23.createElement(
3264
+ "span",
3265
+ {
3266
+ className: cx("aura-skel", c.pill && "aura-skel--pill"),
3267
+ style: c.pill ? void 0 : { width: SKELETON_WIDTHS[(i + j) % SKELETON_WIDTHS.length] }
3268
+ }
3269
+ )
3270
+ )
2951
3271
  );
2952
3272
  });
2953
3273
  sk.push(
@@ -2975,12 +3295,17 @@ var DataTable = React23.forwardRef(function DataTable2(props, ref) {
2975
3295
  role: "row",
2976
3296
  "aria-rowindex": first + i + 2,
2977
3297
  "aria-selected": selectable ? isSel : void 0,
2978
- className: cx("aura-table__row", isSel && "is-selected", props.onRowActivate && "is-actionable"),
3298
+ className: cx(
3299
+ "aura-table__row",
3300
+ isSel && "is-selected",
3301
+ (props.onRowActivate || rowHref) && "is-actionable"
3302
+ ),
2979
3303
  style: rowStyle,
2980
3304
  onClick: function(e) {
2981
3305
  const el = e.target;
2982
3306
  if (el.closest && el.closest(".aura-check, button, a, input")) return;
2983
- if (props.onRowActivate) props.onRowActivate(r);
3307
+ if (rowHref) followRow(e.currentTarget, e);
3308
+ else if (props.onRowActivate) props.onRowActivate(r);
2984
3309
  }
2985
3310
  },
2986
3311
  rowCells(r, i, k, isSel)
@@ -2992,31 +3317,42 @@ var DataTable = React23.forwardRef(function DataTable2(props, ref) {
2992
3317
  bodyRows.push(/* @__PURE__ */ React23.createElement("div", { key: "__bot", style: { height: (pageRows.length - end) * ROW_H + "px" }, "aria-hidden": true }));
2993
3318
  }
2994
3319
  let foot = null;
2995
- if (pageSize && (rows.length || loading)) {
2996
- const from = rows.length ? first + 1 : 0, to = Math.min(first + pageSize, view.length);
2997
- foot = /* @__PURE__ */ React23.createElement("div", { className: "aura-table__foot" }, /* @__PURE__ */ React23.createElement("span", { "aria-live": "polite" }, loading ? t.loading : t.range(from, to, view.length)), /* @__PURE__ */ React23.createElement("span", { className: "aura-table__pager" }, /* @__PURE__ */ React23.createElement("span", null, t.page(page, pageCount)), /* @__PURE__ */ React23.createElement(
2998
- IconButton,
2999
- {
3000
- icon: "chevron-left",
3001
- label: t.prevPage,
3002
- disabled: loading || page <= 1,
3003
- onClick: function() {
3004
- goPage(page - 1);
3005
- }
3006
- }
3007
- ), /* @__PURE__ */ React23.createElement(
3320
+ function pagerButton(dir) {
3321
+ const p = page + dir, off = busy || (dir < 0 ? page <= 1 : page >= pageCount), label = dir < 0 ? t.prevPage : t.nextPage, icon = dir < 0 ? "chevron-left" : "chevron-right";
3322
+ if (props.getPageHref && !off)
3323
+ return /* @__PURE__ */ React23.createElement(
3324
+ Link,
3325
+ {
3326
+ ref: dir < 0 ? prevLink : nextLink,
3327
+ href: props.getPageHref(p),
3328
+ className: "aura-icon-btn",
3329
+ "aria-label": label,
3330
+ onClick: function(e) {
3331
+ if (props.onPageChange) {
3332
+ e.preventDefault();
3333
+ pageState[1](p);
3334
+ }
3335
+ }
3336
+ },
3337
+ /* @__PURE__ */ React23.createElement(Icon, { name: icon })
3338
+ );
3339
+ return /* @__PURE__ */ React23.createElement(
3008
3340
  IconButton,
3009
3341
  {
3010
- icon: "chevron-right",
3011
- label: t.nextPage,
3012
- disabled: loading || page >= pageCount,
3342
+ icon,
3343
+ label,
3344
+ disabled: off,
3013
3345
  onClick: function() {
3014
- goPage(page + 1);
3346
+ goPage(p);
3015
3347
  }
3016
3348
  }
3017
- )));
3349
+ );
3350
+ }
3351
+ if (pageSize && (rows.length || busy)) {
3352
+ const from = rows.length ? first + 1 : 0, to = manual ? first + rows.length : Math.min(first + pageSize, view.length);
3353
+ foot = /* @__PURE__ */ React23.createElement("div", { className: "aura-table__foot" }, /* @__PURE__ */ React23.createElement("span", { "aria-live": "polite" }, busy ? t.loading : t.range(from, to, shownTotal)), /* @__PURE__ */ React23.createElement("span", { className: "aura-table__pager" }, /* @__PURE__ */ React23.createElement("span", null, t.page(page, pageCount)), pagerButton(-1), pagerButton(1)));
3018
3354
  } else if (height && rows.length && !loading) {
3019
- foot = /* @__PURE__ */ React23.createElement("div", { className: "aura-table__foot" }, /* @__PURE__ */ React23.createElement("span", null, t.rowCount(view.length)), selectable && selected.length ? /* @__PURE__ */ React23.createElement("span", null, t.selectedCount(selected.length)) : /* @__PURE__ */ React23.createElement("span", null));
3355
+ foot = /* @__PURE__ */ React23.createElement("div", { className: "aura-table__foot" }, /* @__PURE__ */ React23.createElement("span", null, t.rowCount(shownTotal)), selectable && selected.length ? /* @__PURE__ */ React23.createElement("span", null, t.selectedCount(selected.length)) : /* @__PURE__ */ React23.createElement("span", null));
3020
3356
  }
3021
3357
  if (stacked) {
3022
3358
  const titleCol = vis[0], pillCol = vis.filter(function(c) {
@@ -3037,25 +3373,28 @@ var DataTable = React23.forwardRef(function DataTable2(props, ref) {
3037
3373
  const em2 = props.empty || {};
3038
3374
  cardBody = /* @__PURE__ */ React23.createElement("div", { className: "aura-table__empty" }, /* @__PURE__ */ React23.createElement("div", null, /* @__PURE__ */ React23.createElement("span", { className: "aura-table__empty-icon" }, /* @__PURE__ */ React23.createElement(Icon, { name: em2.icon || "inbox", size: "lg" })), /* @__PURE__ */ React23.createElement("p", { className: "aura-table__empty-title" }, em2.title || t.empty), em2.description ? /* @__PURE__ */ React23.createElement("p", { className: "aura-table__empty-text" }, em2.description) : null, em2.action ? /* @__PURE__ */ React23.createElement("div", { className: "aura-table__empty-action" }, em2.action) : null));
3039
3375
  } else {
3040
- const cellVal = function(c, r) {
3041
- const v = r[c.key];
3042
- return c.render ? c.render(r) : c.pill ? /* @__PURE__ */ React23.createElement(StatusPill, { ...{ tone: c.tones && c.tones[v] } }, v) : v;
3043
- };
3376
+ const cellVal = cellContent;
3044
3377
  cardBody = /* @__PURE__ */ React23.createElement("ul", { className: "aura-table__cards", "aria-label": props.label }, pageRows.map(function(r) {
3045
3378
  const k = r[rowKey], isSel = !!selSet[k];
3046
3379
  return /* @__PURE__ */ React23.createElement(
3047
3380
  "li",
3048
3381
  {
3049
3382
  key: k,
3050
- className: cx("aura-table__card", isSel && "is-selected", props.onRowActivate && "is-actionable"),
3051
- tabIndex: props.onRowActivate ? 0 : void 0,
3383
+ className: cx(
3384
+ "aura-table__card",
3385
+ isSel && "is-selected",
3386
+ (props.onRowActivate || rowHref) && "is-actionable"
3387
+ ),
3388
+ tabIndex: props.onRowActivate && !rowHref ? 0 : void 0,
3052
3389
  onClick: function(e) {
3053
3390
  const el = e.target;
3054
3391
  if (el.closest && el.closest(".aura-check, button, a, input")) return;
3055
- if (props.onRowActivate) props.onRowActivate(r);
3392
+ if (rowHref) followRow(e.currentTarget, e);
3393
+ else if (props.onRowActivate) props.onRowActivate(r);
3056
3394
  },
3057
3395
  onKeyDown: function(e) {
3058
- if (e.target === e.currentTarget && e.key === "Enter" && props.onRowActivate) props.onRowActivate(r);
3396
+ if (e.target === e.currentTarget && e.key === "Enter" && props.onRowActivate && !rowHref)
3397
+ props.onRowActivate(r);
3059
3398
  }
3060
3399
  },
3061
3400
  /* @__PURE__ */ React23.createElement("div", { className: "aura-table__card-head" }, selectable ? /* @__PURE__ */ React23.createElement(
@@ -3067,7 +3406,7 @@ var DataTable = React23.forwardRef(function DataTable2(props, ref) {
3067
3406
  toggle(k, on);
3068
3407
  }
3069
3408
  }
3070
- ) : null, /* @__PURE__ */ React23.createElement("span", { className: cx("aura-table__card-title", titleCol.mono && "aura-table__mono") }, cellVal(titleCol, r)), pillCol ? cellVal(pillCol, r) : null, actionCols.map(function(c) {
3409
+ ) : null, /* @__PURE__ */ React23.createElement("span", { className: cx("aura-table__card-title", titleCol.mono && "aura-table__mono") }, rowLinkWrap(r, cellVal(titleCol, r))), pillCol ? cellVal(pillCol, r) : null, actionCols.map(function(c) {
3071
3410
  return /* @__PURE__ */ React23.createElement("span", { key: c.key, className: "aura-table__card-actions" }, cellVal(c, r));
3072
3411
  })),
3073
3412
  rest.length ? /* @__PURE__ */ React23.createElement("dl", { className: "aura-table__card-fields" }, rest.map(function(c) {
@@ -3080,12 +3419,13 @@ var DataTable = React23.forwardRef(function DataTable2(props, ref) {
3080
3419
  "div",
3081
3420
  {
3082
3421
  ref: wrapMerged,
3083
- className: cx("aura-table aura-table--stacked", props.className),
3422
+ className: cx("aura-table aura-table--stacked", refreshing && "is-refreshing", props.className),
3084
3423
  role: "region",
3085
3424
  "aria-label": props.label,
3086
- "aria-busy": loading || void 0
3425
+ "aria-busy": busy || void 0
3087
3426
  },
3088
- selectable && pageRows.length && !loading ? /* @__PURE__ */ React23.createElement("div", { className: "aura-table__stack-bar" }, /* @__PURE__ */ React23.createElement(
3427
+ refreshing ? /* @__PURE__ */ React23.createElement("span", { className: "aura-table__busy-bar", "aria-hidden": true }) : null,
3428
+ selectable && pageRows.length && !busy ? /* @__PURE__ */ React23.createElement("div", { className: "aura-table__stack-bar" }, /* @__PURE__ */ React23.createElement(
3089
3429
  Checkbox,
3090
3430
  {
3091
3431
  checked: all,
@@ -3103,52 +3443,64 @@ var DataTable = React23.forwardRef(function DataTable2(props, ref) {
3103
3443
  scrollPaddingTop: ROW_H + "px"
3104
3444
  };
3105
3445
  if (height) scrollStyle.height = height + "px";
3106
- return /* @__PURE__ */ React23.createElement("div", { ref: wrapMerged, className: cx("aura-table", scrolledX[0] && "is-scrolled-x", props.className) }, /* @__PURE__ */ React23.createElement(
3446
+ return /* @__PURE__ */ React23.createElement(
3107
3447
  "div",
3108
3448
  {
3109
- ref: function(el) {
3110
- scrollRef.current = el;
3111
- gridRef.current = el;
3449
+ ref: wrapMerged,
3450
+ className: cx("aura-table", scrolledX[0] && "is-scrolled-x", refreshing && "is-refreshing", props.className)
3451
+ },
3452
+ refreshing ? /* @__PURE__ */ React23.createElement("span", { className: "aura-table__busy-bar", "aria-hidden": true }) : null,
3453
+ /* @__PURE__ */ React23.createElement(
3454
+ "div",
3455
+ {
3456
+ ref: function(el) {
3457
+ scrollRef.current = el;
3458
+ gridRef.current = el;
3459
+ },
3460
+ className: "aura-table__scroll",
3461
+ style: scrollStyle,
3462
+ role: "grid",
3463
+ "aria-label": props.label,
3464
+ "aria-busy": busy || void 0,
3465
+ "aria-rowcount": loading ? -1 : shownTotal + 1,
3466
+ "aria-colcount": nCols,
3467
+ "aria-multiselectable": selectable || void 0,
3468
+ onKeyDown: onGridKey,
3469
+ onScroll: function(e) {
3470
+ const t2 = e.currentTarget;
3471
+ if (virtual && Math.abs(t2.scrollTop - scrollTop) >= ROW_H / 2) setScrollTop(t2.scrollTop);
3472
+ else if (virtual && (t2.scrollTop === 0 || t2.scrollTop + t2.clientHeight >= t2.scrollHeight - 1))
3473
+ setScrollTop(t2.scrollTop);
3474
+ const sx = t2.scrollLeft > 0;
3475
+ if (sx !== scrolledX[0]) scrolledX[1](sx);
3476
+ }
3112
3477
  },
3113
- className: "aura-table__scroll",
3114
- style: scrollStyle,
3115
- role: "grid",
3116
- "aria-label": props.label,
3117
- "aria-busy": loading || void 0,
3118
- "aria-rowcount": loading ? -1 : view.length + 1,
3119
- "aria-colcount": nCols,
3120
- "aria-multiselectable": selectable || void 0,
3121
- onKeyDown: onGridKey,
3122
- onScroll: function(e) {
3123
- const t2 = e.currentTarget;
3124
- if (virtual && Math.abs(t2.scrollTop - scrollTop) >= ROW_H / 2) setScrollTop(t2.scrollTop);
3125
- else if (virtual && (t2.scrollTop === 0 || t2.scrollTop + t2.clientHeight >= t2.scrollHeight - 1))
3126
- setScrollTop(t2.scrollTop);
3127
- const sx = t2.scrollLeft > 0;
3128
- if (sx !== scrolledX[0]) scrolledX[1](sx);
3478
+ /* @__PURE__ */ React23.createElement("div", { className: "aura-table__head", role: "row", "aria-rowindex": 1, style: rowStyle }, head),
3479
+ body
3480
+ ),
3481
+ busy ? /* @__PURE__ */ React23.createElement("span", { className: "aura-sr-only", role: "status" }, t.loadingRows) : null,
3482
+ controls ? /* @__PURE__ */ React23.createElement("div", { className: "aura-table__picker" }, /* @__PURE__ */ React23.createElement(
3483
+ IconButton,
3484
+ {
3485
+ icon: "columns-3",
3486
+ label: t.showHideColumns,
3487
+ "aria-haspopup": "menu",
3488
+ onClick: function(e) {
3489
+ openMenu("picker", null, e.currentTarget);
3490
+ }
3129
3491
  }
3130
- },
3131
- /* @__PURE__ */ React23.createElement("div", { className: "aura-table__head", role: "row", "aria-rowindex": 1, style: rowStyle }, head),
3132
- body
3133
- ), loading ? /* @__PURE__ */ React23.createElement("span", { className: "aura-sr-only", role: "status" }, t.loadingRows) : null, controls ? /* @__PURE__ */ React23.createElement("div", { className: "aura-table__picker" }, /* @__PURE__ */ React23.createElement(
3134
- IconButton,
3135
- {
3136
- icon: "columns-3",
3137
- label: t.showHideColumns,
3138
- "aria-haspopup": "menu",
3139
- onClick: function(e) {
3140
- openMenu("picker", null, e.currentTarget);
3492
+ )) : null,
3493
+ foot,
3494
+ menu ? /* @__PURE__ */ React23.createElement(
3495
+ Menu,
3496
+ {
3497
+ anchor: menu.anchor,
3498
+ onClose: closeMenu,
3499
+ label: menu.kind === "picker" ? t.columns : t.column(byKey[menu.key] && byKey[menu.key].label),
3500
+ items: menu.kind === "picker" ? pickerItems() : byKey[menu.key] ? columnMenuItems(byKey[menu.key]) : []
3141
3501
  }
3142
- }
3143
- )) : null, foot, menu ? /* @__PURE__ */ React23.createElement(
3144
- Menu,
3145
- {
3146
- anchor: menu.anchor,
3147
- onClose: closeMenu,
3148
- label: menu.kind === "picker" ? t.columns : t.column(byKey[menu.key] && byKey[menu.key].label),
3149
- items: menu.kind === "picker" ? pickerItems() : byKey[menu.key] ? columnMenuItems(byKey[menu.key]) : []
3150
- }
3151
- ) : null);
3502
+ ) : null
3503
+ );
3152
3504
  });
3153
3505
 
3154
3506
  // src/Card.tsx
@@ -3261,43 +3613,150 @@ var Tabs = React25.forwardRef(function Tabs2(props, ref) {
3261
3613
 
3262
3614
  // src/SideNav.tsx
3263
3615
  var React26 = __toESM(require("react"), 1);
3616
+ function contains(it, id) {
3617
+ return !!id && !!it.children && it.children.some(function(c) {
3618
+ return c.id === id || contains(c, id);
3619
+ });
3620
+ }
3264
3621
  var SideNav = React26.forwardRef(function SideNav2(props, ref) {
3265
3622
  const t = useStrings();
3623
+ const Link = useLinkComponent(props.linkComponent);
3624
+ const base = uid();
3266
3625
  const st = useMaybeControlled(
3267
3626
  props.value,
3268
3627
  props.defaultValue,
3269
3628
  props.onChange
3270
3629
  );
3271
- function item(it) {
3272
- const on = st[0] === it.id;
3273
- const inner = [
3630
+ const active = st[0];
3631
+ const sections = props.sections || [{ items: props.items || [] }];
3632
+ const openState = React26.useState({}), toggled = openState[0], setToggled = openState[1];
3633
+ function isOpen(it) {
3634
+ if (toggled[it.id] != null) return toggled[it.id];
3635
+ return !!it.defaultOpen || contains(it, active);
3636
+ }
3637
+ React26.useEffect(
3638
+ function() {
3639
+ if (!active) return;
3640
+ const next = {};
3641
+ let changed = false;
3642
+ sections.forEach(function(s) {
3643
+ (function walk(list) {
3644
+ list.forEach(function(it) {
3645
+ if (it.children) {
3646
+ if (contains(it, active) && toggled[it.id] !== true) {
3647
+ next[it.id] = true;
3648
+ changed = true;
3649
+ }
3650
+ walk(it.children);
3651
+ }
3652
+ });
3653
+ })(s.items);
3654
+ });
3655
+ if (changed) setToggled(Object.assign({}, toggled, next));
3656
+ },
3657
+ [active]
3658
+ );
3659
+ const navRef = React26.useRef(null);
3660
+ function onKeyDown(e) {
3661
+ const k = e.key;
3662
+ if (k !== "ArrowDown" && k !== "ArrowUp" && k !== "Home" && k !== "End") return;
3663
+ const root = navRef.current;
3664
+ if (!root) return;
3665
+ const items = Array.prototype.slice.call(root.querySelectorAll(".aura-nav__item"));
3666
+ const visible = items.filter(function(el) {
3667
+ return el.offsetParent !== null || el === document.activeElement;
3668
+ });
3669
+ const i = visible.indexOf(document.activeElement);
3670
+ if (i < 0) return;
3671
+ e.preventDefault();
3672
+ const j = k === "Home" ? 0 : k === "End" ? visible.length - 1 : Math.max(0, Math.min(visible.length - 1, i + (k === "ArrowDown" ? 1 : -1)));
3673
+ visible[j].focus();
3674
+ }
3675
+ function inner(it, group, open) {
3676
+ return [
3274
3677
  it.icon ? /* @__PURE__ */ React26.createElement(Icon, { key: "i", name: it.icon }) : null,
3275
3678
  /* @__PURE__ */ React26.createElement("span", { key: "l", className: "aura-nav__label" }, it.label),
3276
- it.count != null ? /* @__PURE__ */ React26.createElement("span", { key: "c", className: "aura-nav__count" }, it.count) : null
3679
+ it.badge != null ? /* @__PURE__ */ React26.createElement("span", { key: "b", className: "aura-nav__badge" }, it.badge) : null,
3680
+ it.count != null ? /* @__PURE__ */ React26.createElement("span", { key: "c", className: "aura-nav__count" }, it.count) : null,
3681
+ group ? /* @__PURE__ */ React26.createElement(Icon, { key: "g", name: "chevron-down", className: cx("aura-nav__chevron", open && "is-open") }) : null
3277
3682
  ];
3683
+ }
3684
+ function item(it, depth) {
3685
+ if (it.children) {
3686
+ const open = isOpen(it);
3687
+ const listId = base + "-" + it.id;
3688
+ const holdsActive = contains(it, active);
3689
+ return /* @__PURE__ */ React26.createElement("li", { key: it.id, className: "aura-nav__group" }, /* @__PURE__ */ React26.createElement(
3690
+ "button",
3691
+ {
3692
+ type: "button",
3693
+ className: cx("aura-nav__item", "aura-nav__item--group", holdsActive && "has-active"),
3694
+ "aria-expanded": open,
3695
+ "aria-controls": listId,
3696
+ style: depth ? { ["--aura-nav-depth"]: depth } : void 0,
3697
+ onClick: function() {
3698
+ const next = Object.assign({}, toggled);
3699
+ next[it.id] = !open;
3700
+ setToggled(next);
3701
+ },
3702
+ onKeyDown: function(e) {
3703
+ if (e.key === "ArrowRight" && !open) {
3704
+ e.preventDefault();
3705
+ setToggled(Object.assign({}, toggled, { [it.id]: true }));
3706
+ } else if (e.key === "ArrowLeft" && open) {
3707
+ e.preventDefault();
3708
+ setToggled(Object.assign({}, toggled, { [it.id]: false }));
3709
+ }
3710
+ }
3711
+ },
3712
+ inner(it, true, open)
3713
+ ), /* @__PURE__ */ React26.createElement("ul", { id: listId, className: "aura-nav__list aura-nav__sub", hidden: !open }, it.children.map(function(c) {
3714
+ return item(c, depth + 1);
3715
+ })));
3716
+ }
3717
+ const on = active === it.id;
3278
3718
  const common = {
3279
3719
  className: cx("aura-nav__item", on && "is-active"),
3280
3720
  "aria-current": on ? "page" : void 0,
3721
+ style: depth ? { ["--aura-nav-depth"]: depth } : void 0,
3281
3722
  onClick: function(e) {
3282
3723
  if (!it.href) e.preventDefault();
3283
3724
  st[1](it.id);
3284
3725
  }
3285
3726
  };
3286
- return /* @__PURE__ */ React26.createElement("li", { key: it.id }, it.href ? /* @__PURE__ */ React26.createElement("a", { href: it.href, ...common }, inner) : /* @__PURE__ */ React26.createElement("button", { type: "button", ...common }, inner));
3727
+ return /* @__PURE__ */ React26.createElement("li", { key: it.id }, it.href ? /* @__PURE__ */ React26.createElement(Link, { href: it.href, ...common }, inner(it, false, false)) : /* @__PURE__ */ React26.createElement("button", { type: "button", ...common }, inner(it, false, false)));
3287
3728
  }
3288
- return /* @__PURE__ */ React26.createElement("nav", { ref, className: cx("aura-nav", props.className), "aria-label": props.label || t.mainNav }, props.header ? /* @__PURE__ */ React26.createElement("div", { className: "aura-nav__header" }, props.header) : null, /* @__PURE__ */ React26.createElement("div", { className: "aura-nav__scroll" }, (props.sections || [{ items: props.items || [] }]).map(function(s, i) {
3289
- return /* @__PURE__ */ React26.createElement("div", { key: i, className: "aura-nav__section" }, s.title ? /* @__PURE__ */ React26.createElement("p", { className: "aura-nav__title" }, s.title) : null, /* @__PURE__ */ React26.createElement("ul", { className: "aura-nav__list" }, s.items.map(item)));
3290
- })), props.footer ? /* @__PURE__ */ React26.createElement("div", { className: "aura-nav__footer" }, props.footer) : null);
3729
+ return /* @__PURE__ */ React26.createElement(
3730
+ "nav",
3731
+ {
3732
+ ref: function(el) {
3733
+ navRef.current = el;
3734
+ if (typeof ref === "function") ref(el);
3735
+ else if (ref) ref.current = el;
3736
+ },
3737
+ className: cx("aura-nav", props.className),
3738
+ "aria-label": props.label || t.mainNav,
3739
+ onKeyDown
3740
+ },
3741
+ props.header ? /* @__PURE__ */ React26.createElement("div", { className: "aura-nav__header" }, props.header) : null,
3742
+ /* @__PURE__ */ React26.createElement("div", { className: "aura-nav__scroll" }, sections.map(function(s, i) {
3743
+ return /* @__PURE__ */ React26.createElement("div", { key: i, className: "aura-nav__section" }, s.title ? /* @__PURE__ */ React26.createElement("p", { className: "aura-nav__title" }, s.title) : null, /* @__PURE__ */ React26.createElement("ul", { className: "aura-nav__list" }, s.items.map(function(it) {
3744
+ return item(it, 0);
3745
+ })));
3746
+ })),
3747
+ props.footer ? /* @__PURE__ */ React26.createElement("div", { className: "aura-nav__footer" }, props.footer) : null
3748
+ );
3291
3749
  });
3292
3750
 
3293
3751
  // src/Breadcrumb.tsx
3294
3752
  var React27 = __toESM(require("react"), 1);
3295
3753
  var Breadcrumb = React27.forwardRef(function Breadcrumb2(props, ref) {
3296
3754
  const t = useStrings();
3755
+ const Link = useLinkComponent();
3297
3756
  const items = props.items || [];
3298
3757
  return /* @__PURE__ */ React27.createElement("nav", { ref, "aria-label": props.label || t.breadcrumb, className: cx("aura-crumbs", props.className) }, /* @__PURE__ */ React27.createElement("ol", null, items.map(function(it, i) {
3299
3758
  const last = i === items.length - 1;
3300
- return /* @__PURE__ */ React27.createElement("li", { key: i }, last ? /* @__PURE__ */ React27.createElement("span", { "aria-current": "page", className: "aura-crumbs__current" }, it.label) : it.href ? /* @__PURE__ */ React27.createElement("a", { href: it.href, onClick: it.onClick }, it.label) : /* @__PURE__ */ React27.createElement("button", { type: "button", onClick: it.onClick }, it.label), last ? null : /* @__PURE__ */ React27.createElement(Icon, { name: "chevron-right", size: 12, className: "aura-crumbs__sep" }));
3759
+ return /* @__PURE__ */ React27.createElement("li", { key: i }, last ? /* @__PURE__ */ React27.createElement("span", { "aria-current": "page", className: "aura-crumbs__current" }, it.label) : it.href ? /* @__PURE__ */ React27.createElement(Link, { href: it.href, onClick: it.onClick }, it.label) : /* @__PURE__ */ React27.createElement("button", { type: "button", onClick: it.onClick }, it.label), last ? null : /* @__PURE__ */ React27.createElement(Icon, { name: "chevron-right", size: 12, className: "aura-crumbs__sep" }));
3301
3760
  })));
3302
3761
  });
3303
3762
 
@@ -3508,8 +3967,11 @@ var Stat = React35.forwardRef(function Stat2(props, ref) {
3508
3967
  const ch = props.change;
3509
3968
  const dir = ch && (ch.direction || "flat");
3510
3969
  const tone2 = ch && (ch.tone || (dir === "up" ? "positive" : dir === "down" ? "negative" : "neutral"));
3511
- const Tag3 = props.href ? "a" : props.onClick ? "button" : "div";
3512
- const interactive = Tag3 !== "div";
3970
+ const Link = useLinkComponent();
3971
+ const v = props.value;
3972
+ 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, ""));
3973
+ const Tag3 = props.href ? Link : props.onClick ? "button" : "div";
3974
+ const interactive = !!(props.href || props.onClick);
3513
3975
  return /* @__PURE__ */ React35.createElement(
3514
3976
  Tag3,
3515
3977
  {
@@ -3521,7 +3983,7 @@ var Stat = React35.forwardRef(function Stat2(props, ref) {
3521
3983
  "aria-busy": props.loading || void 0
3522
3984
  },
3523
3985
  /* @__PURE__ */ React35.createElement("span", { className: "aura-stat__head" }, /* @__PURE__ */ React35.createElement("span", { className: "aura-stat__label" }, props.label), props.icon ? /* @__PURE__ */ React35.createElement("span", { className: "aura-stat__icon" }, /* @__PURE__ */ React35.createElement(Icon, { name: props.icon })) : null),
3524
- props.loading ? /* @__PURE__ */ React35.createElement("span", { className: "aura-stat__value" }, /* @__PURE__ */ React35.createElement("span", { className: "aura-skel aura-stat__skel" })) : /* @__PURE__ */ React35.createElement("span", { className: "aura-stat__value" }, props.value, props.unit ? /* @__PURE__ */ React35.createElement("span", { className: "aura-stat__unit" }, props.unit) : null),
3986
+ props.loading ? /* @__PURE__ */ React35.createElement("span", { className: "aura-stat__value" }, /* @__PURE__ */ React35.createElement("span", { className: "aura-skel aura-stat__skel" })) : /* @__PURE__ */ React35.createElement("span", { className: cx("aura-stat__value", numeric && "is-numeric") }, props.value, props.unit ? /* @__PURE__ */ React35.createElement("span", { className: "aura-stat__unit" }, props.unit) : null),
3525
3987
  ch && !props.loading || props.caption ? /* @__PURE__ */ React35.createElement("span", { className: "aura-stat__foot" }, ch && !props.loading ? /* @__PURE__ */ React35.createElement("span", { className: cx("aura-stat__change", "is-" + tone2) }, /* @__PURE__ */ React35.createElement(Icon, { name: dir === "up" ? "trending-up" : dir === "down" ? "trending-down" : "minus", size: 14 }), /* @__PURE__ */ React35.createElement("span", null, ch.value)) : null, ch && ch.label && !props.loading ? /* @__PURE__ */ React35.createElement("span", { className: "aura-stat__caption" }, ch.label) : null, props.caption ? /* @__PURE__ */ React35.createElement("span", { className: "aura-stat__caption" }, props.caption) : null) : null
3526
3988
  );
3527
3989
  });
@@ -4139,6 +4601,20 @@ function fit(hex, grounds, target, dir) {
4139
4601
  }
4140
4602
  return c;
4141
4603
  }
4604
+ function atLuminance(hex, Y) {
4605
+ const o = rgbToOklch(hexToRgb(hex)), C = Math.max(o[1], 0.02);
4606
+ let lo = 0, hi = 1, c = hex;
4607
+ for (let i = 0; i < 30; i++) {
4608
+ const mid = (lo + hi) / 2;
4609
+ c = oklchToHex(mid, C, o[2]);
4610
+ if (luminance(c) < Y) lo = mid;
4611
+ else hi = mid;
4612
+ }
4613
+ return c;
4614
+ }
4615
+ var CHART_Y = { light: 0.075, dark: 0.46 };
4616
+ var SEQ_Y = { light: [0.26, 0.165, 0.1, 0.055, 0.028], dark: [0.14, 0.22, 0.34, 0.5, 0.7] };
4617
+ var CHART_2 = "#0a8b7a";
4142
4618
  var ZINC = { 0: "#ffffff", 50: "#fafafa", 100: "#f4f4f5", 800: "#27272a", 900: "#18181b", 950: "#09090b" };
4143
4619
  var INK = "#18181b";
4144
4620
  function createTheme(opts) {
@@ -4157,6 +4633,14 @@ function createTheme(opts) {
4157
4633
  L["alert-info-fg"] = fit(b[800], [b[50]], 4.5, -1);
4158
4634
  L["alert-info-border"] = b[200];
4159
4635
  L["mesh-from"] = b[400];
4636
+ L["chart-1"] = atLuminance(o.brand, CHART_Y.light);
4637
+ D["chart-1"] = atLuminance(o.brand, CHART_Y.dark);
4638
+ SEQ_Y.light.forEach(function(y, i) {
4639
+ L["chart-seq-" + (i + 1)] = atLuminance(o.brand, y);
4640
+ });
4641
+ SEQ_Y.dark.forEach(function(y, i) {
4642
+ D["chart-seq-" + (i + 1)] = atLuminance(o.brand, y);
4643
+ });
4160
4644
  D["fg-accent"] = fit(b[300], darkGrounds, 4.5, 1);
4161
4645
  D["accent-violet"] = fit(b[400], darkGrounds, 3, 1);
4162
4646
  D["focus-ring"] = fit(b[400], darkGrounds, 3, 1);
@@ -4216,6 +4700,19 @@ function createTheme(opts) {
4216
4700
  check("dark", "fg-accent", g[0], 4.5, D["fg-accent"], g[1]);
4217
4701
  check("dark", "focus-ring", g[0], 3, D["focus-ring"], g[1]);
4218
4702
  });
4703
+ [
4704
+ ["light", ZINC[0], L],
4705
+ ["light", ZINC[50], L],
4706
+ ["dark", ZINC[900], D],
4707
+ ["dark", ZINC[950], D]
4708
+ ].forEach(function(g) {
4709
+ const t = g[0], ground = g[1], m = g[2], name = ground === ZINC[0] || ground === ZINC[900] ? "bg-surface" : "bg-canvas";
4710
+ ["chart-1", "chart-seq-1", "chart-seq-5"].forEach(function(k) {
4711
+ check(t, k, name, 3, m[k], ground);
4712
+ });
4713
+ });
4714
+ check("light", "chart-1", "chart-2 (lightness step)", 1.8, L["chart-1"], CHART_2);
4715
+ check("dark", "chart-1", "chart-2 (lightness step)", 1.8, D["chart-1"], CHART_2);
4219
4716
  check("light", "fg-primary", "bg-selected", 4.5, INK, L["bg-selected"]);
4220
4717
  check("dark", "fg-primary", "bg-selected", 4.5, "#ffffff", D["bg-selected"]);
4221
4718
  check("light", "status-progress-fg", "status-progress-bg", 4.5, L["status-progress-fg"], L["status-progress-bg"]);
@@ -4295,7 +4792,14 @@ function colorSchemeScript(options) {
4295
4792
  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){}})();`;
4296
4793
  }
4297
4794
  function ColorSchemeScript(props) {
4298
- return /* @__PURE__ */ React39.createElement("script", { "data-aura-color-scheme": "", dangerouslySetInnerHTML: { __html: colorSchemeScript(props) } });
4795
+ return /* @__PURE__ */ React39.createElement(
4796
+ "script",
4797
+ {
4798
+ "data-aura-color-scheme": "",
4799
+ nonce: props.nonce,
4800
+ dangerouslySetInnerHTML: { __html: colorSchemeScript(props) }
4801
+ }
4802
+ );
4299
4803
  }
4300
4804
  function systemDark() {
4301
4805
  return typeof window !== "undefined" && !!window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches;
@@ -4548,6 +5052,7 @@ var Pagination = React45.forwardRef(function Pagination2(props, ref) {
4548
5052
  if (p >= 1 && p <= count && p !== page) st[1](p);
4549
5053
  }
4550
5054
  const link = props.getHref;
5055
+ const Link = useLinkComponent();
4551
5056
  function item(p, label, extra) {
4552
5057
  const common = Object.assign(
4553
5058
  {
@@ -4558,7 +5063,7 @@ var Pagination = React45.forwardRef(function Pagination2(props, ref) {
4558
5063
  extra
4559
5064
  );
4560
5065
  return link ? /* @__PURE__ */ React45.createElement(
4561
- "a",
5066
+ Link,
4562
5067
  {
4563
5068
  href: link(p),
4564
5069
  onClick: function(e) {
@@ -4784,3 +5289,321 @@ var Popover = React47.forwardRef(function Popover2(props, ref) {
4784
5289
  "aria-controls": open ? id : void 0
4785
5290
  }), panel);
4786
5291
  });
5292
+
5293
+ // src/NumberField.tsx
5294
+ var React48 = __toESM(require("react"), 1);
5295
+ function decimalsOf(n2) {
5296
+ const s = String(n2);
5297
+ const i = s.indexOf(".");
5298
+ return i < 0 ? 0 : s.length - i - 1;
5299
+ }
5300
+ function parse(text) {
5301
+ const s = text.replace(/[,\s ]/g, "");
5302
+ if (!/^-?(\d+\.?\d*|\.\d+)$/.test(s)) return NaN;
5303
+ return Number(s);
5304
+ }
5305
+ var NumberField = React48.forwardRef(function NumberField2(props, ref) {
5306
+ const t = useStrings();
5307
+ const auto = uid(), id = props.id || auto;
5308
+ const step = props.step || 1;
5309
+ const decimals = props.decimals != null ? props.decimals : decimalsOf(step);
5310
+ const st = useMaybeControlled(
5311
+ props.value,
5312
+ props.defaultValue == null ? null : props.defaultValue,
5313
+ props.onChange
5314
+ );
5315
+ const value = st[0], setValue = st[1];
5316
+ const draftState = React48.useState(null), draft = draftState[0], setDraft = draftState[1];
5317
+ function fmt2(n2) {
5318
+ if (n2 == null || isNaN(n2)) return "";
5319
+ return n2.toLocaleString("en", { minimumFractionDigits: decimals, maximumFractionDigits: decimals });
5320
+ }
5321
+ function fit2(n2) {
5322
+ let v = n2;
5323
+ if (props.min != null && v < props.min) v = props.min;
5324
+ if (props.max != null && v > props.max) v = props.max;
5325
+ const f = Math.pow(10, decimals);
5326
+ return Math.round(v * f) / f;
5327
+ }
5328
+ function nudge(by) {
5329
+ if (props.disabled || props.readOnly) return;
5330
+ const base = value == null ? props.min != null && props.min > 0 ? props.min - by : 0 : value;
5331
+ const next = fit2(base + by);
5332
+ setValue(next);
5333
+ setDraft(null);
5334
+ }
5335
+ function onKeyDown(e) {
5336
+ const k = e.key;
5337
+ let by = 0;
5338
+ if (k === "ArrowUp") by = step;
5339
+ else if (k === "ArrowDown") by = -step;
5340
+ else if (k === "PageUp") by = step * 10;
5341
+ else if (k === "PageDown") by = -step * 10;
5342
+ else if (k === "Home" && props.min != null) {
5343
+ e.preventDefault();
5344
+ setValue(props.min);
5345
+ setDraft(null);
5346
+ return;
5347
+ } else if (k === "End" && props.max != null) {
5348
+ e.preventDefault();
5349
+ setValue(props.max);
5350
+ setDraft(null);
5351
+ return;
5352
+ }
5353
+ if (by) {
5354
+ e.preventDefault();
5355
+ nudge(by);
5356
+ }
5357
+ }
5358
+ const atMin = value != null && props.min != null && value <= props.min;
5359
+ const atMax = value != null && props.max != null && value >= props.max;
5360
+ const affixText = function(x) {
5361
+ return typeof x === "string" || typeof x === "number" ? String(x) : "";
5362
+ };
5363
+ const valueText = value == null ? void 0 : [affixText(props.prefix), fmt2(value), affixText(props.suffix)].join(" ").trim();
5364
+ const stepper = props.stepper !== false && !props.readOnly;
5365
+ return /* @__PURE__ */ React48.createElement(
5366
+ Field,
5367
+ {
5368
+ id,
5369
+ label: props.label,
5370
+ hint: props.hint,
5371
+ error: props.error,
5372
+ required: props.required,
5373
+ optional: props.optional,
5374
+ disabled: props.disabled,
5375
+ className: props.className
5376
+ },
5377
+ /* @__PURE__ */ React48.createElement("div", { className: cx("aura-input aura-number", stepper && "has-stepper") }, props.prefix != null ? /* @__PURE__ */ React48.createElement("span", { className: "aura-number__affix", "aria-hidden": true }, props.prefix) : null, /* @__PURE__ */ React48.createElement(
5378
+ "input",
5379
+ {
5380
+ ref,
5381
+ id,
5382
+ type: "text",
5383
+ role: "spinbutton",
5384
+ inputMode: decimals > 0 || props.min != null && props.min < 0 ? "decimal" : "numeric",
5385
+ autoComplete: "off",
5386
+ className: "aura-input__control",
5387
+ name: props.name,
5388
+ placeholder: props.placeholder,
5389
+ disabled: props.disabled,
5390
+ readOnly: props.readOnly,
5391
+ required: props.required,
5392
+ "aria-valuenow": value == null ? void 0 : value,
5393
+ "aria-valuemin": props.min,
5394
+ "aria-valuemax": props.max,
5395
+ "aria-valuetext": valueText,
5396
+ "aria-invalid": props.error ? true : void 0,
5397
+ "aria-describedby": describedBy(id, props),
5398
+ value: draft != null ? draft : fmt2(value),
5399
+ onFocus: function() {
5400
+ setDraft(fmt2(value));
5401
+ },
5402
+ onChange: function(e) {
5403
+ const text = e.target.value;
5404
+ setDraft(text);
5405
+ if (!text.trim()) setValue(null);
5406
+ else {
5407
+ const n2 = parse(text);
5408
+ if (!isNaN(n2)) setValue(n2);
5409
+ }
5410
+ },
5411
+ onBlur: function(e) {
5412
+ const n2 = draft == null ? value : !draft.trim() ? null : parse(draft);
5413
+ if (n2 == null) {
5414
+ if (value != null) setValue(null);
5415
+ } else if (!isNaN(n2)) {
5416
+ const f = fit2(n2);
5417
+ if (f !== value) setValue(f);
5418
+ }
5419
+ setDraft(null);
5420
+ if (props.onBlur) props.onBlur(e);
5421
+ },
5422
+ onKeyDown
5423
+ }
5424
+ ), props.suffix != null ? /* @__PURE__ */ React48.createElement("span", { className: "aura-number__affix", "aria-hidden": true }, props.suffix) : null, stepper ? /* @__PURE__ */ React48.createElement("span", { className: "aura-number__steps" }, /* @__PURE__ */ React48.createElement(
5425
+ "button",
5426
+ {
5427
+ type: "button",
5428
+ tabIndex: -1,
5429
+ className: "aura-number__step",
5430
+ "aria-label": t.decrease,
5431
+ "aria-controls": id,
5432
+ disabled: props.disabled || atMin,
5433
+ onPointerDown: function(e) {
5434
+ e.preventDefault();
5435
+ },
5436
+ onClick: function() {
5437
+ nudge(-step);
5438
+ }
5439
+ },
5440
+ /* @__PURE__ */ React48.createElement(Icon, { name: "minus" })
5441
+ ), /* @__PURE__ */ React48.createElement(
5442
+ "button",
5443
+ {
5444
+ type: "button",
5445
+ tabIndex: -1,
5446
+ className: "aura-number__step",
5447
+ "aria-label": t.increase,
5448
+ "aria-controls": id,
5449
+ disabled: props.disabled || atMax,
5450
+ onPointerDown: function(e) {
5451
+ e.preventDefault();
5452
+ },
5453
+ onClick: function() {
5454
+ nudge(step);
5455
+ }
5456
+ },
5457
+ /* @__PURE__ */ React48.createElement(Icon, { name: "plus" })
5458
+ )) : null)
5459
+ );
5460
+ });
5461
+
5462
+ // src/Stepper.tsx
5463
+ var React49 = __toESM(require("react"), 1);
5464
+ var Stepper = React49.forwardRef(function Stepper2(props, ref) {
5465
+ const t = useStrings();
5466
+ const steps = props.steps || [];
5467
+ let at = -1;
5468
+ steps.forEach(function(s, i) {
5469
+ if (s.id === props.current) at = i;
5470
+ });
5471
+ if (at < 0) at = 0;
5472
+ const vertical = props.orientation === "vertical";
5473
+ const cur = steps[at];
5474
+ return /* @__PURE__ */ React49.createElement(
5475
+ "nav",
5476
+ {
5477
+ ref,
5478
+ "aria-label": props.label,
5479
+ className: cx("aura-stepper", vertical ? "aura-stepper--vertical" : "aura-stepper--horizontal", props.className)
5480
+ },
5481
+ /* @__PURE__ */ React49.createElement("ol", { className: "aura-stepper__list" }, steps.map(function(s, i) {
5482
+ const state = i < at ? "done" : i === at ? "current" : "upcoming";
5483
+ const marker = /* @__PURE__ */ React49.createElement("span", { className: "aura-stepper__marker", "aria-hidden": true }, state === "done" ? /* @__PURE__ */ React49.createElement(Icon, { name: "check" }) : i + 1);
5484
+ const text = /* @__PURE__ */ React49.createElement("span", { className: "aura-stepper__text" }, /* @__PURE__ */ React49.createElement("span", { className: "aura-stepper__label" }, s.label, state === "done" ? /* @__PURE__ */ React49.createElement("span", { className: "aura-sr-only" }, ", " + t.stepDone) : null), s.description ? /* @__PURE__ */ React49.createElement("span", { className: "aura-stepper__desc" }, s.description) : null);
5485
+ const clickable = state === "done" && !!props.onStepClick;
5486
+ return /* @__PURE__ */ React49.createElement(
5487
+ "li",
5488
+ {
5489
+ key: s.id,
5490
+ className: cx("aura-stepper__item", "is-" + state),
5491
+ "aria-current": state === "current" ? "step" : void 0
5492
+ },
5493
+ clickable ? /* @__PURE__ */ React49.createElement(
5494
+ "button",
5495
+ {
5496
+ type: "button",
5497
+ className: "aura-stepper__step aura-focusable",
5498
+ onClick: function() {
5499
+ props.onStepClick(s.id);
5500
+ }
5501
+ },
5502
+ marker,
5503
+ text
5504
+ ) : /* @__PURE__ */ React49.createElement("span", { className: "aura-stepper__step" }, marker, text)
5505
+ );
5506
+ })),
5507
+ !vertical && cur ? /* @__PURE__ */ React49.createElement("p", { className: "aura-stepper__compact", "aria-hidden": true }, /* @__PURE__ */ React49.createElement("span", { className: "aura-stepper__count" }, t.stepOf(at + 1, steps.length)), /* @__PURE__ */ React49.createElement("span", { className: "aura-stepper__compact-label" }, cur.label)) : null
5508
+ );
5509
+ });
5510
+
5511
+ // src/SegmentedControl.tsx
5512
+ var React50 = __toESM(require("react"), 1);
5513
+ function toOpt2(o) {
5514
+ return typeof o === "object" ? o : { value: o, label: o };
5515
+ }
5516
+ var SegmentedControl = React50.forwardRef(
5517
+ function SegmentedControl2(props, ref) {
5518
+ const options = (props.options || []).map(toOpt2);
5519
+ const firstEnabled = options.filter(function(o) {
5520
+ return !o.disabled;
5521
+ })[0];
5522
+ const st = useMaybeControlled(
5523
+ props.value,
5524
+ props.defaultValue != null ? props.defaultValue : firstEnabled ? firstEnabled.value : void 0,
5525
+ props.onChange
5526
+ );
5527
+ const value = st[0], setValue = st[1];
5528
+ const auto = uid(), id = props.id || auto;
5529
+ const refs = React50.useRef([]);
5530
+ const selIdx = options.findIndex(function(o) {
5531
+ return o.value === value;
5532
+ });
5533
+ const tabIdx = selIdx >= 0 && !options[selIdx].disabled ? selIdx : options.indexOf(firstEnabled);
5534
+ function move(from, dir) {
5535
+ const n2 = options.length;
5536
+ for (let k = 1; k <= n2; k++) {
5537
+ const i = ((from + dir * k) % n2 + n2) % n2;
5538
+ if (!options[i].disabled) {
5539
+ setValue(options[i].value);
5540
+ const el = refs.current[i];
5541
+ if (el) el.focus();
5542
+ return;
5543
+ }
5544
+ }
5545
+ }
5546
+ function onKeyDown(e, i) {
5547
+ const k = e.key;
5548
+ if (k === "ArrowRight" || k === "ArrowDown") {
5549
+ e.preventDefault();
5550
+ move(i, 1);
5551
+ } else if (k === "ArrowLeft" || k === "ArrowUp") {
5552
+ e.preventDefault();
5553
+ move(i, -1);
5554
+ } else if (k === "Home") {
5555
+ e.preventDefault();
5556
+ move(-1, 1);
5557
+ } else if (k === "End") {
5558
+ e.preventDefault();
5559
+ move(options.length, -1);
5560
+ }
5561
+ }
5562
+ return /* @__PURE__ */ React50.createElement(
5563
+ "div",
5564
+ {
5565
+ ref,
5566
+ id,
5567
+ role: "radiogroup",
5568
+ "aria-label": props.label,
5569
+ "aria-disabled": props.disabled || void 0,
5570
+ className: cx(
5571
+ "aura-segmented",
5572
+ props.size === "sm" && "aura-segmented--sm",
5573
+ props.fullWidth && "is-full",
5574
+ props.disabled && "is-disabled",
5575
+ props.className
5576
+ )
5577
+ },
5578
+ options.map(function(o, i) {
5579
+ const on = o.value === value;
5580
+ const off = props.disabled || o.disabled;
5581
+ return /* @__PURE__ */ React50.createElement(
5582
+ "button",
5583
+ {
5584
+ key: o.value,
5585
+ ref: function(el) {
5586
+ refs.current[i] = el;
5587
+ },
5588
+ type: "button",
5589
+ role: "radio",
5590
+ "aria-checked": on,
5591
+ "aria-label": o.iconOnly ? o.label : void 0,
5592
+ title: o.iconOnly ? o.label : void 0,
5593
+ tabIndex: i === tabIdx && !props.disabled ? 0 : -1,
5594
+ disabled: off,
5595
+ className: cx("aura-segmented__option", on && "is-selected", o.iconOnly && "is-icon"),
5596
+ onClick: function() {
5597
+ setValue(o.value);
5598
+ },
5599
+ onKeyDown: function(e) {
5600
+ onKeyDown(e, i);
5601
+ }
5602
+ },
5603
+ o.icon ? /* @__PURE__ */ React50.createElement(Icon, { name: o.icon }) : null,
5604
+ o.iconOnly ? null : /* @__PURE__ */ React50.createElement("span", null, o.label)
5605
+ );
5606
+ })
5607
+ );
5608
+ }
5609
+ );