@jirawatpyk/aura-react 5.69.0 → 5.71.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -0
- package/dist/aura.bundle.js +381 -145
- package/dist/cjs/index.cjs +380 -144
- package/dist/esm/Button.js +9 -3
- package/dist/esm/FileUpload.js +108 -1
- package/dist/esm/IconButton.js +5 -0
- package/dist/esm/PageHeader.js +9 -6
- package/dist/esm/PageHeaderClient.js +6 -3
- package/dist/esm/Pagination.js +49 -1
- package/dist/esm/Spinner.js +9 -0
- package/dist/esm/Table.js +38 -3
- package/dist/esm/display.js +24 -2
- package/dist/esm/index.js +2 -0
- package/dist/esm/strings.js +1 -0
- package/dist/esm/strings.sv.js +1 -0
- package/dist/esm/strings.th.js +1 -0
- package/dist/index.d.cts +79 -1
- package/dist/index.d.ts +79 -1
- package/dist/locales/sv.cjs +1 -0
- package/dist/locales/sv.d.cts +2 -0
- package/dist/locales/sv.d.ts +2 -0
- package/dist/locales/th.cjs +1 -0
- package/dist/locales/th.d.cts +2 -0
- package/dist/locales/th.d.ts +2 -0
- package/dist/server/index.cjs +37 -8
- package/dist/server/index.d.cts +23 -0
- package/dist/server/index.d.ts +23 -0
- package/dist/server/index.js +37 -8
- package/dist/styles.css +79 -41
- package/dist/styles.layer.css +79 -41
- package/package.json +1 -1
package/dist/aura.bundle.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @ds-bundle: {"format":4,"namespace":"Aura","components":[{"name":"Icon"},{"name":"Button"},{"name":"IconButton"},{"name":"Menu"},{"name":"DropdownMenu"},{"name":"Checkbox"},{"name":"StatusPill"},{"name":"TextField"},{"name":"Textarea"},{"name":"Select"},{"name":"FilterSelect"},{"name":"FilterDateRange"},{"name":"RadioGroup"},{"name":"CheckboxGroup"},{"name":"Switch"},{"name":"Combobox"},{"name":"DatePicker"},{"name":"DateRangePicker"},{"name":"Calendar"},{"name":"Alert"},{"name":"Toaster"},{"name":"PasswordField"},{"name":"FormErrorSummary"},{"name":"FilterBar"},{"name":"Command"},{"name":"Tooltip"},{"name":"Dialog"},{"name":"Drawer"},{"name":"DataTable"},{"name":"Card"},{"name":"Tabs"},{"name":"SideNav"},{"name":"Breadcrumb"},{"name":"Avatar"},{"name":"Stack"},{"name":"Grid"},{"name":"Container"},{"name":"PageHeader"},{"name":"StatusTile"},{"name":"TileGrid"},{"name":"Sparkline"},{"name":"AppShell"},{"name":"ActionBar"},{"name":"Separator"},{"name":"Table"},{"name":"Tr"},{"name":"Th"},{"name":"Td"},{"name":"TableSkeleton"},{"name":"BottomNav"},{"name":"Surface"},{"name":"Stat"},{"name":"TimePicker"},{"name":"FileUpload"},{"name":"ColorSchemeScript"},{"name":"ColorSchemeToggle"},{"name":"Badge"},{"name":"Tag"},{"name":"Progress"},{"name":"Skeleton"},{"name":"EmptyState"},{"name":"Pagination"},{"name":"Accordion"},{"name":"Popover"},{"name":"NumberField"},{"name":"Stepper"},{"name":"SegmentedControl"}]} */
|
|
1
|
+
/* @ds-bundle: {"format":4,"namespace":"Aura","components":[{"name":"Icon"},{"name":"Button"},{"name":"IconButton"},{"name":"Menu"},{"name":"DropdownMenu"},{"name":"Checkbox"},{"name":"StatusPill"},{"name":"TextField"},{"name":"Textarea"},{"name":"Select"},{"name":"FilterSelect"},{"name":"FilterDateRange"},{"name":"RadioGroup"},{"name":"CheckboxGroup"},{"name":"Switch"},{"name":"Combobox"},{"name":"DatePicker"},{"name":"DateRangePicker"},{"name":"Calendar"},{"name":"Alert"},{"name":"Toaster"},{"name":"PasswordField"},{"name":"FormErrorSummary"},{"name":"FilterBar"},{"name":"Command"},{"name":"Tooltip"},{"name":"Dialog"},{"name":"Drawer"},{"name":"DataTable"},{"name":"Card"},{"name":"Tabs"},{"name":"SideNav"},{"name":"Breadcrumb"},{"name":"Avatar"},{"name":"Stack"},{"name":"Grid"},{"name":"Container"},{"name":"PageHeader"},{"name":"StatusTile"},{"name":"TileGrid"},{"name":"Sparkline"},{"name":"AppShell"},{"name":"ActionBar"},{"name":"Separator"},{"name":"Table"},{"name":"Tr"},{"name":"Th"},{"name":"Td"},{"name":"TableSkeleton"},{"name":"BottomNav"},{"name":"Surface"},{"name":"Stat"},{"name":"TimePicker"},{"name":"FileUpload"},{"name":"ColorSchemeScript"},{"name":"ColorSchemeToggle"},{"name":"Badge"},{"name":"Tag"},{"name":"Progress"},{"name":"Skeleton"},{"name":"EmptyState"},{"name":"Pagination"},{"name":"Spinner"},{"name":"Accordion"},{"name":"Popover"},{"name":"NumberField"},{"name":"Stepper"},{"name":"SegmentedControl"}]} */
|
|
2
2
|
window.Aura = (() => {
|
|
3
3
|
var __create = Object.create;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -101,6 +101,7 @@ window.Aura = (() => {
|
|
|
101
101
|
SideNav: () => SideNav,
|
|
102
102
|
Skeleton: () => Skeleton,
|
|
103
103
|
Sparkline: () => Sparkline,
|
|
104
|
+
Spinner: () => Spinner,
|
|
104
105
|
Stack: () => Stack,
|
|
105
106
|
Stat: () => Stat,
|
|
106
107
|
StatusPill: () => StatusPill,
|
|
@@ -490,6 +491,11 @@ window.Aura = (() => {
|
|
|
490
491
|
["circle", { cx: "19", cy: "12", r: "1" }],
|
|
491
492
|
["circle", { cx: "5", cy: "12", r: "1" }]
|
|
492
493
|
]);
|
|
494
|
+
var IconUpload = /* @__PURE__ */ defineIcon("upload", [
|
|
495
|
+
["path", { d: "M12 3v12" }],
|
|
496
|
+
["path", { d: "m17 8-5-5-5 5" }],
|
|
497
|
+
["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }]
|
|
498
|
+
]);
|
|
493
499
|
var IconCalendar = /* @__PURE__ */ defineIcon("calendar", [
|
|
494
500
|
["path", { d: "M8 2v3" }],
|
|
495
501
|
["path", { d: "M16 2v3" }],
|
|
@@ -739,7 +745,7 @@ window.Aura = (() => {
|
|
|
739
745
|
};
|
|
740
746
|
function statusPillElement(props, ref) {
|
|
741
747
|
const tone2 = props.tone || toneFor(props.children);
|
|
742
|
-
const rest = omit(props, ["tone", "className", "children", "wrap"]);
|
|
748
|
+
const rest = omit(props, ["tone", "className", "children", "wrap", "busy"]);
|
|
743
749
|
return /* @__PURE__ */ React4.createElement(
|
|
744
750
|
"span",
|
|
745
751
|
{
|
|
@@ -747,10 +753,26 @@ window.Aura = (() => {
|
|
|
747
753
|
ref,
|
|
748
754
|
className: cx("aura-pill", "aura-pill--" + tone2, props.wrap && "is-wrap", props.className)
|
|
749
755
|
},
|
|
750
|
-
/* @__PURE__ */ React4.createElement(Icon, { name: h2(PILL_ICON[tone2] || IconCircle), size: 12 }),
|
|
756
|
+
props.busy ? /* @__PURE__ */ React4.createElement(Icon, { name: h2(IconLoaderCircle), size: 12, className: "aura-spin" }) : /* @__PURE__ */ React4.createElement(Icon, { name: h2(PILL_ICON[tone2] || IconCircle), size: 12 }),
|
|
751
757
|
props.wrap ? /* @__PURE__ */ React4.createElement("span", { className: "aura-pill__text" }, props.children) : props.children
|
|
752
758
|
);
|
|
753
759
|
}
|
|
760
|
+
function spinnerElement(props, ref) {
|
|
761
|
+
const rest = omit(props, ["size", "label", "className"]);
|
|
762
|
+
const label = props.label;
|
|
763
|
+
return /* @__PURE__ */ React4.createElement(
|
|
764
|
+
"span",
|
|
765
|
+
{
|
|
766
|
+
...rest,
|
|
767
|
+
ref,
|
|
768
|
+
className: cx("aura-spinner", "aura-spinner--" + (props.size || "md"), props.className),
|
|
769
|
+
role: label ? "status" : void 0,
|
|
770
|
+
"aria-hidden": label ? void 0 : true
|
|
771
|
+
},
|
|
772
|
+
/* @__PURE__ */ React4.createElement(Icon, { name: h2(IconLoaderCircle), size: props.size || "md", className: "aura-spin" }),
|
|
773
|
+
label ? /* @__PURE__ */ React4.createElement("span", { className: "aura-sr-only" }, label) : null
|
|
774
|
+
);
|
|
775
|
+
}
|
|
754
776
|
function badgeElement(props, ref) {
|
|
755
777
|
const rest = omit(props, ["tone", "variant", "icon", "className", "children"]);
|
|
756
778
|
return /* @__PURE__ */ React4.createElement(
|
|
@@ -1039,6 +1061,7 @@ window.Aura = (() => {
|
|
|
1039
1061
|
statusUnknown: "\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E21\u0E35\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25",
|
|
1040
1062
|
opensInNewTab: "\u0E40\u0E1B\u0E34\u0E14\u0E43\u0E19\u0E41\u0E17\u0E47\u0E1A\u0E43\u0E2B\u0E21\u0E48",
|
|
1041
1063
|
required: "\u0E08\u0E33\u0E40\u0E1B\u0E47\u0E19",
|
|
1064
|
+
firstPage: "\u0E2B\u0E19\u0E49\u0E32\u0E41\u0E23\u0E01",
|
|
1042
1065
|
filtersApplied: function(n3) {
|
|
1043
1066
|
return "\u0E15\u0E31\u0E27\u0E01\u0E23\u0E2D\u0E07, \u0E43\u0E0A\u0E49\u0E2D\u0E22\u0E39\u0E48 " + n3.toLocaleString("en") + " \u0E23\u0E32\u0E22\u0E01\u0E32\u0E23";
|
|
1044
1067
|
},
|
|
@@ -1181,6 +1204,7 @@ window.Aura = (() => {
|
|
|
1181
1204
|
statusUnknown: "Ingen data",
|
|
1182
1205
|
opensInNewTab: "\xF6ppnas i en ny flik",
|
|
1183
1206
|
required: "obligatoriskt",
|
|
1207
|
+
firstPage: "F\xF6rsta sidan",
|
|
1184
1208
|
filtersApplied: function(n3) {
|
|
1185
1209
|
return "Filter, " + n3.toLocaleString("sv-SE") + " aktiva";
|
|
1186
1210
|
},
|
|
@@ -1324,6 +1348,7 @@ window.Aura = (() => {
|
|
|
1324
1348
|
statusUnknown: "No data",
|
|
1325
1349
|
opensInNewTab: "opens in a new tab",
|
|
1326
1350
|
required: "required",
|
|
1351
|
+
firstPage: "First page",
|
|
1327
1352
|
filtersApplied: function(n3) {
|
|
1328
1353
|
return "Filters, " + n3.toLocaleString("en") + " applied";
|
|
1329
1354
|
},
|
|
@@ -1384,6 +1409,8 @@ window.Aura = (() => {
|
|
|
1384
1409
|
function ButtonLink(props, ref, Link) {
|
|
1385
1410
|
const variant = props.variant || "primary";
|
|
1386
1411
|
const disabled = !!props.disabled;
|
|
1412
|
+
const ad = props["aria-disabled"];
|
|
1413
|
+
const gated = !disabled && (ad === true || ad === "true");
|
|
1387
1414
|
const rest = omit(props, [
|
|
1388
1415
|
"variant",
|
|
1389
1416
|
"className",
|
|
@@ -1405,7 +1432,7 @@ window.Aura = (() => {
|
|
|
1405
1432
|
ref,
|
|
1406
1433
|
href: disabled ? void 0 : props.href,
|
|
1407
1434
|
role: disabled ? "link" : void 0,
|
|
1408
|
-
"aria-disabled": disabled || void 0,
|
|
1435
|
+
"aria-disabled": disabled || gated || void 0,
|
|
1409
1436
|
tabIndex: disabled ? -1 : props.tabIndex,
|
|
1410
1437
|
className: buttonClass({
|
|
1411
1438
|
variant,
|
|
@@ -1414,7 +1441,9 @@ window.Aura = (() => {
|
|
|
1414
1441
|
touchHeight: props.touchHeight,
|
|
1415
1442
|
className: props.className
|
|
1416
1443
|
}),
|
|
1417
|
-
onClick: disabled ? void 0 :
|
|
1444
|
+
onClick: disabled ? void 0 : gated ? function(e) {
|
|
1445
|
+
e.preventDefault();
|
|
1446
|
+
} : props.onClick
|
|
1418
1447
|
},
|
|
1419
1448
|
props.icon ? /* @__PURE__ */ React6.createElement(Icon, { name: props.icon }) : null,
|
|
1420
1449
|
props.children,
|
|
@@ -1432,6 +1461,8 @@ window.Aura = (() => {
|
|
|
1432
1461
|
const loading = !!props.loading;
|
|
1433
1462
|
const ad = props["aria-disabled"];
|
|
1434
1463
|
const blocked = loading || ad === true || ad === "true";
|
|
1464
|
+
const ab = props["aria-busy"];
|
|
1465
|
+
const busy = loading || ab === true || ab === "true";
|
|
1435
1466
|
const rest = omit(props, [
|
|
1436
1467
|
"variant",
|
|
1437
1468
|
"className",
|
|
@@ -1459,7 +1490,7 @@ window.Aura = (() => {
|
|
|
1459
1490
|
loading,
|
|
1460
1491
|
className: props.className
|
|
1461
1492
|
}),
|
|
1462
|
-
"aria-busy":
|
|
1493
|
+
"aria-busy": busy || void 0,
|
|
1463
1494
|
"aria-disabled": blocked || void 0,
|
|
1464
1495
|
onClick: blocked ? function(e) {
|
|
1465
1496
|
e.preventDefault();
|
|
@@ -1664,6 +1695,8 @@ window.Aura = (() => {
|
|
|
1664
1695
|
const rest = omit(props, ["icon", "label", "className", "size", "tone", "touchHeight", "variant", "pressed"]);
|
|
1665
1696
|
useAutoTip();
|
|
1666
1697
|
const own = props.title !== void 0;
|
|
1698
|
+
const ad = props["aria-disabled"];
|
|
1699
|
+
const blocked = ad === true || ad === "true";
|
|
1667
1700
|
return /* @__PURE__ */ React8.createElement(
|
|
1668
1701
|
"button",
|
|
1669
1702
|
{
|
|
@@ -1673,6 +1706,9 @@ window.Aura = (() => {
|
|
|
1673
1706
|
"aria-label": props.label,
|
|
1674
1707
|
"aria-pressed": props.pressed != null ? props.pressed : props["aria-pressed"],
|
|
1675
1708
|
"data-aura-tip": own ? void 0 : props.label,
|
|
1709
|
+
onClick: blocked ? function(e) {
|
|
1710
|
+
e.preventDefault();
|
|
1711
|
+
} : props.onClick,
|
|
1676
1712
|
className: cx(
|
|
1677
1713
|
"aura-icon-btn",
|
|
1678
1714
|
props.tone === "danger" && "aura-icon-btn--danger",
|
|
@@ -8077,7 +8113,10 @@ window.Aura = (() => {
|
|
|
8077
8113
|
props.title
|
|
8078
8114
|
);
|
|
8079
8115
|
const hasActions = props.actions != null && props.actions !== false;
|
|
8080
|
-
const
|
|
8116
|
+
const hasBarActions = props.actionsBar != null && props.actionsBar !== false;
|
|
8117
|
+
const bar = (hasActions || hasBarActions) && (props.actionsBarBelow === "sm" || props.actionsBarBelow === "md") ? props.actionsBarBelow : null;
|
|
8118
|
+
const split = !!bar && hasBarActions;
|
|
8119
|
+
const status = bar && props.actionsStatus != null && props.actionsStatus !== false ? h8("div", { className: "aura-page-header__status", role: "status" }, props.actionsStatus) : null;
|
|
8081
8120
|
return h8(
|
|
8082
8121
|
"div",
|
|
8083
8122
|
Object.assign(attrs2, {
|
|
@@ -8109,12 +8148,12 @@ window.Aura = (() => {
|
|
|
8109
8148
|
shown(props.subtitle) ? h8("div", { className: "aura-page-header__subtitle" }, props.subtitle) : null,
|
|
8110
8149
|
props.meta != null && props.meta !== false ? h8("div", { className: cx("aura-page-header__meta", richMeta && "aura-page-header__meta--rich") }, props.meta) : null
|
|
8111
8150
|
),
|
|
8112
|
-
|
|
8151
|
+
hasActions || hasBarActions ? split ? h8(
|
|
8113
8152
|
"div",
|
|
8114
|
-
{ className: "aura-page-header__actions" },
|
|
8115
|
-
|
|
8116
|
-
props.
|
|
8117
|
-
) : null
|
|
8153
|
+
{ className: "aura-page-header__actions is-split" },
|
|
8154
|
+
props.actions,
|
|
8155
|
+
h8("div", { className: "aura-page-header__bar" }, status, props.actionsBar)
|
|
8156
|
+
) : h8("div", { className: "aura-page-header__actions" }, status, props.actions, props.actionsBar) : null
|
|
8118
8157
|
);
|
|
8119
8158
|
});
|
|
8120
8159
|
|
|
@@ -8125,11 +8164,14 @@ window.Aura = (() => {
|
|
|
8125
8164
|
const own = React45.useRef(null);
|
|
8126
8165
|
const merged = useMergedRef(ref, own);
|
|
8127
8166
|
const bar = props.actionsBarBelow;
|
|
8128
|
-
const hasActions = props.actions != null && props.actions !== false;
|
|
8167
|
+
const hasActions = props.actions != null && props.actions !== false || props.actionsBar != null && props.actionsBar !== false;
|
|
8168
|
+
const split = props.actionsBar != null && props.actionsBar !== false;
|
|
8129
8169
|
React45.useEffect(
|
|
8130
8170
|
function() {
|
|
8131
8171
|
if (bar !== "sm" && bar !== "md" || !hasActions || !own.current) return;
|
|
8132
|
-
const el = own.current.querySelector(
|
|
8172
|
+
const el = own.current.querySelector(
|
|
8173
|
+
split ? ":scope > .aura-page-header__actions > .aura-page-header__bar" : ":scope > .aura-page-header__actions"
|
|
8174
|
+
);
|
|
8133
8175
|
if (!el) return;
|
|
8134
8176
|
const root = document.documentElement;
|
|
8135
8177
|
let checked = false;
|
|
@@ -8162,7 +8204,7 @@ window.Aura = (() => {
|
|
|
8162
8204
|
else root.style.removeProperty(NAME);
|
|
8163
8205
|
};
|
|
8164
8206
|
},
|
|
8165
|
-
[bar, hasActions]
|
|
8207
|
+
[bar, hasActions, split]
|
|
8166
8208
|
);
|
|
8167
8209
|
const focusTitle = !!props.focusTitleOnMount;
|
|
8168
8210
|
React45.useEffect(function() {
|
|
@@ -9191,8 +9233,39 @@ window.Aura = (() => {
|
|
|
9191
9233
|
);
|
|
9192
9234
|
}
|
|
9193
9235
|
var Th = React53.forwardRef(function Th2(props, ref) {
|
|
9194
|
-
const {
|
|
9236
|
+
const {
|
|
9237
|
+
align,
|
|
9238
|
+
numeric,
|
|
9239
|
+
mono,
|
|
9240
|
+
className,
|
|
9241
|
+
scope,
|
|
9242
|
+
label,
|
|
9243
|
+
card,
|
|
9244
|
+
skeleton,
|
|
9245
|
+
skeletonWidth,
|
|
9246
|
+
wrap,
|
|
9247
|
+
sort,
|
|
9248
|
+
onSort,
|
|
9249
|
+
sortHref,
|
|
9250
|
+
linkComponent,
|
|
9251
|
+
...rest
|
|
9252
|
+
} = props;
|
|
9195
9253
|
const stacked = React53.useContext(StackLabels) != null;
|
|
9254
|
+
const Link = useLinkComponent(linkComponent);
|
|
9255
|
+
const sortable = !!onSort || sortHref != null;
|
|
9256
|
+
const ariaSort = sort || (sortable ? "none" : void 0);
|
|
9257
|
+
let children = props.children;
|
|
9258
|
+
if (sortable) {
|
|
9259
|
+
const icon = /* @__PURE__ */ React53.createElement(
|
|
9260
|
+
Icon,
|
|
9261
|
+
{
|
|
9262
|
+
name: sort === "ascending" ? /* @__PURE__ */ React53.createElement(IconArrowUp, null) : sort === "descending" ? /* @__PURE__ */ React53.createElement(IconArrowDown, null) : /* @__PURE__ */ React53.createElement(IconArrowUpDown, null),
|
|
9263
|
+
size: 12
|
|
9264
|
+
}
|
|
9265
|
+
);
|
|
9266
|
+
const cls = cx("aura-table__sort", sort && sort !== "none" && "is-active");
|
|
9267
|
+
children = sortHref != null ? /* @__PURE__ */ React53.createElement(Link, { href: sortHref, className: cls }, props.children, icon) : /* @__PURE__ */ React53.createElement("button", { type: "button", className: cls, onClick: onSort }, props.children, icon);
|
|
9268
|
+
}
|
|
9196
9269
|
return /* @__PURE__ */ React53.createElement(
|
|
9197
9270
|
"th",
|
|
9198
9271
|
{
|
|
@@ -9201,8 +9274,10 @@ window.Aura = (() => {
|
|
|
9201
9274
|
className: cellClass("aura-tbl__th", props),
|
|
9202
9275
|
role: stacked ? scope === "row" ? "rowheader" : "columnheader" : void 0,
|
|
9203
9276
|
"data-card": stacked && (card === "title" || card === "action") ? card : void 0,
|
|
9277
|
+
"aria-sort": ariaSort,
|
|
9204
9278
|
...rest
|
|
9205
|
-
}
|
|
9279
|
+
},
|
|
9280
|
+
children
|
|
9206
9281
|
);
|
|
9207
9282
|
});
|
|
9208
9283
|
var Td = React53.forwardRef(function Td2(props, ref) {
|
|
@@ -9668,7 +9743,59 @@ window.Aura = (() => {
|
|
|
9668
9743
|
});
|
|
9669
9744
|
|
|
9670
9745
|
// src/FileUpload.tsx
|
|
9746
|
+
var React59 = __toESM(require_react(), 1);
|
|
9747
|
+
|
|
9748
|
+
// src/Progress.tsx
|
|
9671
9749
|
var React58 = __toESM(require_react(), 1);
|
|
9750
|
+
var Progress = React58.forwardRef(function Progress2(props, ref) {
|
|
9751
|
+
const t = useStrings();
|
|
9752
|
+
const auto = uid(), id = props.id || auto;
|
|
9753
|
+
const max = props.max || 100, det = props.value != null;
|
|
9754
|
+
const pct = det ? Math.max(0, Math.min(100, props.value / max * 100)) : 0;
|
|
9755
|
+
const sec = det && props.secondaryValue != null && props.secondaryValue > 0 ? props.secondaryValue : 0;
|
|
9756
|
+
const spct = sec ? Math.max(0, Math.min(100 - pct, sec / max * 100)) : 0;
|
|
9757
|
+
const keyed = !!props.legend && spct > 0;
|
|
9758
|
+
const valueText = props.valueText != null ? props.valueText : keyed ? t.progressReserved(props.value, sec, max) : props.valueLabel != null ? String(props.valueLabel) : sec ? t.progressReserved(props.value, sec, max) : void 0;
|
|
9759
|
+
const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
|
|
9760
|
+
return /* @__PURE__ */ React58.createElement(
|
|
9761
|
+
"div",
|
|
9762
|
+
{
|
|
9763
|
+
ref,
|
|
9764
|
+
className: cx(
|
|
9765
|
+
"aura-progress",
|
|
9766
|
+
"aura-progress--" + tone(props.tone || "accent"),
|
|
9767
|
+
props.size === "sm" && "is-sm",
|
|
9768
|
+
props.className
|
|
9769
|
+
)
|
|
9770
|
+
},
|
|
9771
|
+
props.label || props.showValue && shown ? /* @__PURE__ */ React58.createElement("div", { className: "aura-progress__head" }, props.label ? /* @__PURE__ */ React58.createElement("span", { className: "aura-progress__label", id: id + "-label" }, props.label) : /* @__PURE__ */ React58.createElement("span", null), props.showValue && shown ? /* @__PURE__ */ React58.createElement("span", { className: "aura-progress__value" }, shown) : null) : null,
|
|
9772
|
+
/* @__PURE__ */ React58.createElement(
|
|
9773
|
+
"div",
|
|
9774
|
+
{
|
|
9775
|
+
className: cx("aura-progress__track", !det && "is-indeterminate"),
|
|
9776
|
+
role: "progressbar",
|
|
9777
|
+
"aria-labelledby": props.label ? id + "-label" : void 0,
|
|
9778
|
+
"aria-label": props.label ? void 0 : props["aria-label"],
|
|
9779
|
+
"aria-valuemin": det ? 0 : void 0,
|
|
9780
|
+
"aria-valuemax": det ? max : void 0,
|
|
9781
|
+
"aria-valuenow": det ? props.value : void 0,
|
|
9782
|
+
"aria-valuetext": det ? valueText : void 0
|
|
9783
|
+
},
|
|
9784
|
+
/* @__PURE__ */ React58.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 }),
|
|
9785
|
+
sec ? /* @__PURE__ */ React58.createElement(
|
|
9786
|
+
"span",
|
|
9787
|
+
{
|
|
9788
|
+
className: "aura-progress__bar aura-progress__bar--reserved",
|
|
9789
|
+
style: { left: pct + "%", width: spct + "%" }
|
|
9790
|
+
}
|
|
9791
|
+
) : null
|
|
9792
|
+
),
|
|
9793
|
+
keyed ? /* @__PURE__ */ React58.createElement("div", { className: "aura-progress__legend", "aria-hidden": "true" }, props.legend.value != null && props.legend.value !== false ? /* @__PURE__ */ React58.createElement("span", { className: "aura-progress__key" }, /* @__PURE__ */ React58.createElement("span", { className: "aura-progress__swatch" }), props.legend.value) : null, /* @__PURE__ */ React58.createElement("span", { className: "aura-progress__key" }, /* @__PURE__ */ React58.createElement("span", { className: "aura-progress__swatch aura-progress__swatch--reserved" }), props.legend.secondary)) : null,
|
|
9794
|
+
props.hint ? /* @__PURE__ */ React58.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
|
|
9795
|
+
);
|
|
9796
|
+
});
|
|
9797
|
+
|
|
9798
|
+
// src/FileUpload.tsx
|
|
9672
9799
|
function matches(file, accept) {
|
|
9673
9800
|
if (!accept) return true;
|
|
9674
9801
|
const name = (file.name || "").toLowerCase(), type = (file.type || "").toLowerCase();
|
|
@@ -9692,24 +9819,40 @@ window.Aura = (() => {
|
|
|
9692
9819
|
}).join(", ");
|
|
9693
9820
|
}
|
|
9694
9821
|
var seq = 0;
|
|
9695
|
-
var FileUpload =
|
|
9822
|
+
var FileUpload = React59.forwardRef(function FileUpload2(props, ref) {
|
|
9696
9823
|
const t = useStrings();
|
|
9697
9824
|
const auto = uid(), id = props.id || auto;
|
|
9698
9825
|
const st = useMaybeControlled(props.value, props.defaultValue || [], props.onChange);
|
|
9699
9826
|
const items2 = st[0] || [];
|
|
9700
|
-
const dragState =
|
|
9701
|
-
const inputRef =
|
|
9702
|
-
const urls =
|
|
9827
|
+
const dragState = React59.useState(false), over = dragState[0];
|
|
9828
|
+
const inputRef = React59.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
9829
|
+
const urls = React59.useRef({});
|
|
9703
9830
|
const maxFiles = props.multiple ? props.maxFiles : 1;
|
|
9704
9831
|
const note = t.accepts(describeAccept(props.accept, t), props.maxSize ? formatBytes(props.maxSize) : "");
|
|
9705
|
-
|
|
9832
|
+
const pickState = React59.useState(null);
|
|
9833
|
+
const buttonRef = React59.useRef(null);
|
|
9834
|
+
const buttonMode = props.variant === "button";
|
|
9835
|
+
React59.useEffect(
|
|
9836
|
+
function() {
|
|
9837
|
+
const el = inputRef.current;
|
|
9838
|
+
if (!buttonMode || !el) return;
|
|
9839
|
+
el.focus = function(o) {
|
|
9840
|
+
if (buttonRef.current) buttonRef.current.focus(o);
|
|
9841
|
+
};
|
|
9842
|
+
return function() {
|
|
9843
|
+
delete el.focus;
|
|
9844
|
+
};
|
|
9845
|
+
},
|
|
9846
|
+
[buttonMode]
|
|
9847
|
+
);
|
|
9848
|
+
React59.useEffect(function() {
|
|
9706
9849
|
return function() {
|
|
9707
9850
|
Object.keys(urls.current).forEach(function(k) {
|
|
9708
9851
|
URL.revokeObjectURL(urls.current[k]);
|
|
9709
9852
|
});
|
|
9710
9853
|
};
|
|
9711
9854
|
}, []);
|
|
9712
|
-
|
|
9855
|
+
React59.useEffect(
|
|
9713
9856
|
function() {
|
|
9714
9857
|
const el = inputRef.current;
|
|
9715
9858
|
if (!el || !props.name || typeof DataTransfer === "undefined") return;
|
|
@@ -9769,7 +9912,96 @@ window.Aura = (() => {
|
|
|
9769
9912
|
if (inputRef.current) inputRef.current.focus();
|
|
9770
9913
|
}
|
|
9771
9914
|
const error = props.error;
|
|
9772
|
-
|
|
9915
|
+
if (props.variant === "button") {
|
|
9916
|
+
const err = error || pickState[0];
|
|
9917
|
+
const desc = [err ? id + "-error" : props.hint ? id + "-hint" : null, note ? id + "-note" : null].filter(Boolean).join(" ") || void 0;
|
|
9918
|
+
return /* @__PURE__ */ React59.createElement(
|
|
9919
|
+
Field,
|
|
9920
|
+
{
|
|
9921
|
+
id,
|
|
9922
|
+
label: props.label,
|
|
9923
|
+
labelAs: "span",
|
|
9924
|
+
labelId: id + "-label",
|
|
9925
|
+
hint: props.hint,
|
|
9926
|
+
error: err,
|
|
9927
|
+
required: props.required,
|
|
9928
|
+
optional: props.optional,
|
|
9929
|
+
disabled: props.disabled,
|
|
9930
|
+
className: cx("aura-upload-field", props.className)
|
|
9931
|
+
},
|
|
9932
|
+
/* @__PURE__ */ React59.createElement("div", { className: "aura-upload-button" }, /* @__PURE__ */ React59.createElement(
|
|
9933
|
+
Button,
|
|
9934
|
+
{
|
|
9935
|
+
ref: buttonRef,
|
|
9936
|
+
id: id + "-button",
|
|
9937
|
+
variant: "secondary",
|
|
9938
|
+
icon: /* @__PURE__ */ React59.createElement(IconUpload, null),
|
|
9939
|
+
touchHeight: props.touchHeight,
|
|
9940
|
+
disabled: props.disabled,
|
|
9941
|
+
"aria-labelledby": props.label ? id + "-label " + id + "-button" : void 0,
|
|
9942
|
+
"aria-describedby": desc,
|
|
9943
|
+
onClick: function() {
|
|
9944
|
+
if (inputRef.current) inputRef.current.click();
|
|
9945
|
+
}
|
|
9946
|
+
},
|
|
9947
|
+
props.buttonLabel != null ? props.buttonLabel : props.multiple ? t.browse : t.browseOne
|
|
9948
|
+
), /* @__PURE__ */ React59.createElement(
|
|
9949
|
+
"input",
|
|
9950
|
+
{
|
|
9951
|
+
ref: inputMerged,
|
|
9952
|
+
id,
|
|
9953
|
+
type: "file",
|
|
9954
|
+
className: "aura-upload__input",
|
|
9955
|
+
tabIndex: -1,
|
|
9956
|
+
"aria-hidden": true,
|
|
9957
|
+
accept: props.accept,
|
|
9958
|
+
multiple: !!props.multiple,
|
|
9959
|
+
disabled: props.disabled,
|
|
9960
|
+
name: props.name,
|
|
9961
|
+
required: props.name ? props.required : void 0,
|
|
9962
|
+
onInvalid: function(e) {
|
|
9963
|
+
e.preventDefault();
|
|
9964
|
+
pickState[1](props.multiple ? t.browse : t.browseOne);
|
|
9965
|
+
if (buttonRef.current) buttonRef.current.focus();
|
|
9966
|
+
},
|
|
9967
|
+
onChange: function(e) {
|
|
9968
|
+
const files = Array.prototype.slice.call(e.target.files || []);
|
|
9969
|
+
if (!files.length) return;
|
|
9970
|
+
let refused = null;
|
|
9971
|
+
const ok = files.filter(function(f) {
|
|
9972
|
+
const why = !matches(f, props.accept) ? t.fileWrongType : props.maxSize && f.size > props.maxSize ? t.fileTooBig(formatBytes(props.maxSize)) : null;
|
|
9973
|
+
if (why && !refused) refused = why;
|
|
9974
|
+
return !why;
|
|
9975
|
+
});
|
|
9976
|
+
pickState[1](refused);
|
|
9977
|
+
if (!props.name) e.target.value = "";
|
|
9978
|
+
else if (refused) {
|
|
9979
|
+
try {
|
|
9980
|
+
const dt = new DataTransfer();
|
|
9981
|
+
ok.forEach(function(f) {
|
|
9982
|
+
dt.items.add(f);
|
|
9983
|
+
});
|
|
9984
|
+
e.target.files = dt.files;
|
|
9985
|
+
} catch (x) {
|
|
9986
|
+
e.target.value = "";
|
|
9987
|
+
}
|
|
9988
|
+
}
|
|
9989
|
+
if (ok.length && props.onSelect) props.onSelect(ok);
|
|
9990
|
+
}
|
|
9991
|
+
}
|
|
9992
|
+
), note ? /* @__PURE__ */ React59.createElement("span", { className: "aura-upload__note", id: id + "-note" }, note) : null),
|
|
9993
|
+
props.progress !== void 0 ? /* @__PURE__ */ React59.createElement(
|
|
9994
|
+
Progress,
|
|
9995
|
+
{
|
|
9996
|
+
className: "aura-upload-button__progress",
|
|
9997
|
+
size: "sm",
|
|
9998
|
+
value: props.progress == null ? void 0 : props.progress,
|
|
9999
|
+
label: t.uploading
|
|
10000
|
+
}
|
|
10001
|
+
) : null
|
|
10002
|
+
);
|
|
10003
|
+
}
|
|
10004
|
+
return /* @__PURE__ */ React59.createElement(
|
|
9773
10005
|
Field,
|
|
9774
10006
|
{
|
|
9775
10007
|
id,
|
|
@@ -9781,7 +10013,7 @@ window.Aura = (() => {
|
|
|
9781
10013
|
disabled: props.disabled,
|
|
9782
10014
|
className: props.className
|
|
9783
10015
|
},
|
|
9784
|
-
/* @__PURE__ */
|
|
10016
|
+
/* @__PURE__ */ React59.createElement(
|
|
9785
10017
|
"div",
|
|
9786
10018
|
{
|
|
9787
10019
|
className: cx("aura-upload", over && "is-over", props.disabled && "is-disabled", error && "is-invalid"),
|
|
@@ -9802,9 +10034,9 @@ window.Aura = (() => {
|
|
|
9802
10034
|
add(e.dataTransfer && e.dataTransfer.files);
|
|
9803
10035
|
}
|
|
9804
10036
|
},
|
|
9805
|
-
/* @__PURE__ */
|
|
9806
|
-
/* @__PURE__ */
|
|
9807
|
-
/* @__PURE__ */
|
|
10037
|
+
/* @__PURE__ */ React59.createElement(Icon, { name: /* @__PURE__ */ React59.createElement(IconCloudUpload, null), size: "lg", className: "aura-upload__icon" }),
|
|
10038
|
+
/* @__PURE__ */ React59.createElement("span", { className: "aura-upload__text" }, t.dropFiles, " "),
|
|
10039
|
+
/* @__PURE__ */ React59.createElement(
|
|
9808
10040
|
"input",
|
|
9809
10041
|
{
|
|
9810
10042
|
ref: inputMerged,
|
|
@@ -9826,12 +10058,12 @@ window.Aura = (() => {
|
|
|
9826
10058
|
}
|
|
9827
10059
|
}
|
|
9828
10060
|
),
|
|
9829
|
-
/* @__PURE__ */
|
|
9830
|
-
note ? /* @__PURE__ */
|
|
10061
|
+
/* @__PURE__ */ React59.createElement("span", { className: "aura-upload__browse", "aria-hidden": true }, props.multiple ? t.browse : t.browseOne),
|
|
10062
|
+
note ? /* @__PURE__ */ React59.createElement("span", { className: "aura-upload__note", id: id + "-note" }, note) : null
|
|
9831
10063
|
),
|
|
9832
|
-
items2.length ? /* @__PURE__ */
|
|
10064
|
+
items2.length ? /* @__PURE__ */ React59.createElement("ul", { className: "aura-upload__list", "aria-live": "polite" }, items2.map(function(it) {
|
|
9833
10065
|
const src = thumb(it);
|
|
9834
|
-
return /* @__PURE__ */
|
|
10066
|
+
return /* @__PURE__ */ React59.createElement("li", { key: it.id, className: cx("aura-upload__item", it.error && "is-error") }, src ? /* @__PURE__ */ React59.createElement("img", { className: "aura-upload__thumb", src, alt: "" }) : /* @__PURE__ */ React59.createElement("span", { className: "aura-upload__thumb is-icon", "aria-hidden": true }, /* @__PURE__ */ React59.createElement(Icon, { name: /^image\//.test(it.type || "") ? /* @__PURE__ */ React59.createElement(IconImage, null) : /* @__PURE__ */ React59.createElement(IconFile, null), size: "md" })), /* @__PURE__ */ React59.createElement("span", { className: "aura-upload__meta" }, it.url && !it.error ? /* @__PURE__ */ React59.createElement("a", { className: "aura-upload__name", href: it.url, target: "_blank", rel: "noreferrer" }, it.name) : /* @__PURE__ */ React59.createElement("span", { className: "aura-upload__name" }, it.name), /* @__PURE__ */ React59.createElement("span", { className: "aura-upload__sub" }, it.error ? /* @__PURE__ */ React59.createElement(React59.Fragment, null, /* @__PURE__ */ React59.createElement(Icon, { name: /* @__PURE__ */ React59.createElement(IconCircleAlert, null), size: 12 }), it.error) : it.status === "uploading" ? t.uploading + (it.progress != null ? " " + Math.round(it.progress) + "%" : "") : it.status === "done" ? /* @__PURE__ */ React59.createElement(React59.Fragment, null, /* @__PURE__ */ React59.createElement(Icon, { name: /* @__PURE__ */ React59.createElement(IconCircleCheck, null), size: 12 }), formatBytes(it.size)) : formatBytes(it.size)), it.status === "uploading" ? /* @__PURE__ */ React59.createElement(
|
|
9835
10067
|
"span",
|
|
9836
10068
|
{
|
|
9837
10069
|
className: "aura-upload__bar",
|
|
@@ -9841,11 +10073,11 @@ window.Aura = (() => {
|
|
|
9841
10073
|
"aria-valuemax": 100,
|
|
9842
10074
|
"aria-valuenow": it.progress != null ? Math.round(it.progress) : void 0
|
|
9843
10075
|
},
|
|
9844
|
-
/* @__PURE__ */
|
|
9845
|
-
) : null), /* @__PURE__ */
|
|
10076
|
+
/* @__PURE__ */ React59.createElement("span", { style: { width: (it.progress || 0) + "%" } })
|
|
10077
|
+
) : null), /* @__PURE__ */ React59.createElement(
|
|
9846
10078
|
IconButton,
|
|
9847
10079
|
{
|
|
9848
|
-
icon: /* @__PURE__ */
|
|
10080
|
+
icon: /* @__PURE__ */ React59.createElement(IconX, null),
|
|
9849
10081
|
label: t.remove(it.name),
|
|
9850
10082
|
onClick: function() {
|
|
9851
10083
|
remove(it);
|
|
@@ -10161,9 +10393,9 @@ window.Aura = (() => {
|
|
|
10161
10393
|
}
|
|
10162
10394
|
|
|
10163
10395
|
// src/ThemeStyle.tsx
|
|
10164
|
-
var
|
|
10396
|
+
var React60 = __toESM(require_react(), 1);
|
|
10165
10397
|
function ThemeStyle(props) {
|
|
10166
|
-
const css =
|
|
10398
|
+
const css = React60.useMemo(
|
|
10167
10399
|
function() {
|
|
10168
10400
|
try {
|
|
10169
10401
|
return createTheme({
|
|
@@ -10180,11 +10412,11 @@ window.Aura = (() => {
|
|
|
10180
10412
|
[props.brand, props.signal, props.primary, props.name, props.selector]
|
|
10181
10413
|
);
|
|
10182
10414
|
if (css === null) return null;
|
|
10183
|
-
return /* @__PURE__ */
|
|
10415
|
+
return /* @__PURE__ */ React60.createElement("style", { "data-aura-theme": props.name || props.brand, dangerouslySetInnerHTML: { __html: css } });
|
|
10184
10416
|
}
|
|
10185
10417
|
|
|
10186
10418
|
// src/colorScheme.tsx
|
|
10187
|
-
var
|
|
10419
|
+
var React61 = __toESM(require_react(), 1);
|
|
10188
10420
|
|
|
10189
10421
|
// src/colorSchemeScript.ts
|
|
10190
10422
|
var DEFAULT_KEY = "aura-color-scheme";
|
|
@@ -10201,7 +10433,7 @@ window.Aura = (() => {
|
|
|
10201
10433
|
|
|
10202
10434
|
// src/colorScheme.tsx
|
|
10203
10435
|
function ColorSchemeScript(props) {
|
|
10204
|
-
return /* @__PURE__ */
|
|
10436
|
+
return /* @__PURE__ */ React61.createElement(
|
|
10205
10437
|
"script",
|
|
10206
10438
|
{
|
|
10207
10439
|
"data-aura-color-scheme": "",
|
|
@@ -10226,7 +10458,7 @@ window.Aura = (() => {
|
|
|
10226
10458
|
function useColorScheme(options) {
|
|
10227
10459
|
const key = options && options.storageKey || DEFAULT_KEY;
|
|
10228
10460
|
const fallback = options && options.defaultScheme || "system";
|
|
10229
|
-
const subscribe2 =
|
|
10461
|
+
const subscribe2 = React61.useCallback(
|
|
10230
10462
|
function(cb) {
|
|
10231
10463
|
const mq = window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null;
|
|
10232
10464
|
function onSystem() {
|
|
@@ -10248,7 +10480,7 @@ window.Aura = (() => {
|
|
|
10248
10480
|
},
|
|
10249
10481
|
[fallback, key]
|
|
10250
10482
|
);
|
|
10251
|
-
const snapshot =
|
|
10483
|
+
const snapshot = React61.useSyncExternalStore(
|
|
10252
10484
|
subscribe2,
|
|
10253
10485
|
function() {
|
|
10254
10486
|
const s = readScheme(fallback);
|
|
@@ -10259,7 +10491,7 @@ window.Aura = (() => {
|
|
|
10259
10491
|
}
|
|
10260
10492
|
);
|
|
10261
10493
|
const parts = snapshot.split("|");
|
|
10262
|
-
const setScheme =
|
|
10494
|
+
const setScheme = React61.useCallback(
|
|
10263
10495
|
function(next) {
|
|
10264
10496
|
if (!valid(next)) return;
|
|
10265
10497
|
try {
|
|
@@ -10278,14 +10510,14 @@ window.Aura = (() => {
|
|
|
10278
10510
|
const cs = useColorScheme(props);
|
|
10279
10511
|
const names = { light: t.schemeLight, dark: t.schemeDark, system: t.schemeSystem };
|
|
10280
10512
|
const label = props.label || t.colorScheme;
|
|
10281
|
-
return /* @__PURE__ */
|
|
10513
|
+
return /* @__PURE__ */ React61.createElement(
|
|
10282
10514
|
DropdownMenu,
|
|
10283
10515
|
{
|
|
10284
10516
|
label,
|
|
10285
|
-
trigger: /* @__PURE__ */
|
|
10517
|
+
trigger: /* @__PURE__ */ React61.createElement(
|
|
10286
10518
|
IconButton,
|
|
10287
10519
|
{
|
|
10288
|
-
icon: cs.resolved === "dark" ? /* @__PURE__ */
|
|
10520
|
+
icon: cs.resolved === "dark" ? /* @__PURE__ */ React61.createElement(IconMoon, null) : /* @__PURE__ */ React61.createElement(IconSun, null),
|
|
10289
10521
|
label: label + ": " + names[cs.scheme]
|
|
10290
10522
|
}
|
|
10291
10523
|
),
|
|
@@ -10303,59 +10535,9 @@ window.Aura = (() => {
|
|
|
10303
10535
|
}
|
|
10304
10536
|
|
|
10305
10537
|
// src/Badge.tsx
|
|
10306
|
-
var React61 = __toESM(require_react(), 1);
|
|
10307
|
-
var Badge = React61.forwardRef(function Badge2(props, ref) {
|
|
10308
|
-
return badgeElement(props, ref);
|
|
10309
|
-
});
|
|
10310
|
-
|
|
10311
|
-
// src/Progress.tsx
|
|
10312
10538
|
var React62 = __toESM(require_react(), 1);
|
|
10313
|
-
var
|
|
10314
|
-
|
|
10315
|
-
const auto = uid(), id = props.id || auto;
|
|
10316
|
-
const max = props.max || 100, det = props.value != null;
|
|
10317
|
-
const pct = det ? Math.max(0, Math.min(100, props.value / max * 100)) : 0;
|
|
10318
|
-
const sec = det && props.secondaryValue != null && props.secondaryValue > 0 ? props.secondaryValue : 0;
|
|
10319
|
-
const spct = sec ? Math.max(0, Math.min(100 - pct, sec / max * 100)) : 0;
|
|
10320
|
-
const keyed = !!props.legend && spct > 0;
|
|
10321
|
-
const valueText = props.valueText != null ? props.valueText : keyed ? t.progressReserved(props.value, sec, max) : props.valueLabel != null ? String(props.valueLabel) : sec ? t.progressReserved(props.value, sec, max) : void 0;
|
|
10322
|
-
const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
|
|
10323
|
-
return /* @__PURE__ */ React62.createElement(
|
|
10324
|
-
"div",
|
|
10325
|
-
{
|
|
10326
|
-
ref,
|
|
10327
|
-
className: cx(
|
|
10328
|
-
"aura-progress",
|
|
10329
|
-
"aura-progress--" + tone(props.tone || "accent"),
|
|
10330
|
-
props.size === "sm" && "is-sm",
|
|
10331
|
-
props.className
|
|
10332
|
-
)
|
|
10333
|
-
},
|
|
10334
|
-
props.label || props.showValue && shown ? /* @__PURE__ */ React62.createElement("div", { className: "aura-progress__head" }, props.label ? /* @__PURE__ */ React62.createElement("span", { className: "aura-progress__label", id: id + "-label" }, props.label) : /* @__PURE__ */ React62.createElement("span", null), props.showValue && shown ? /* @__PURE__ */ React62.createElement("span", { className: "aura-progress__value" }, shown) : null) : null,
|
|
10335
|
-
/* @__PURE__ */ React62.createElement(
|
|
10336
|
-
"div",
|
|
10337
|
-
{
|
|
10338
|
-
className: cx("aura-progress__track", !det && "is-indeterminate"),
|
|
10339
|
-
role: "progressbar",
|
|
10340
|
-
"aria-labelledby": props.label ? id + "-label" : void 0,
|
|
10341
|
-
"aria-label": props.label ? void 0 : props["aria-label"],
|
|
10342
|
-
"aria-valuemin": det ? 0 : void 0,
|
|
10343
|
-
"aria-valuemax": det ? max : void 0,
|
|
10344
|
-
"aria-valuenow": det ? props.value : void 0,
|
|
10345
|
-
"aria-valuetext": det ? valueText : void 0
|
|
10346
|
-
},
|
|
10347
|
-
/* @__PURE__ */ React62.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 }),
|
|
10348
|
-
sec ? /* @__PURE__ */ React62.createElement(
|
|
10349
|
-
"span",
|
|
10350
|
-
{
|
|
10351
|
-
className: "aura-progress__bar aura-progress__bar--reserved",
|
|
10352
|
-
style: { left: pct + "%", width: spct + "%" }
|
|
10353
|
-
}
|
|
10354
|
-
) : null
|
|
10355
|
-
),
|
|
10356
|
-
keyed ? /* @__PURE__ */ React62.createElement("div", { className: "aura-progress__legend", "aria-hidden": "true" }, props.legend.value != null && props.legend.value !== false ? /* @__PURE__ */ React62.createElement("span", { className: "aura-progress__key" }, /* @__PURE__ */ React62.createElement("span", { className: "aura-progress__swatch" }), props.legend.value) : null, /* @__PURE__ */ React62.createElement("span", { className: "aura-progress__key" }, /* @__PURE__ */ React62.createElement("span", { className: "aura-progress__swatch aura-progress__swatch--reserved" }), props.legend.secondary)) : null,
|
|
10357
|
-
props.hint ? /* @__PURE__ */ React62.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
|
|
10358
|
-
);
|
|
10539
|
+
var Badge = React62.forwardRef(function Badge2(props, ref) {
|
|
10540
|
+
return badgeElement(props, ref);
|
|
10359
10541
|
});
|
|
10360
10542
|
|
|
10361
10543
|
// src/Skeleton.tsx
|
|
@@ -10414,9 +10596,56 @@ window.Aura = (() => {
|
|
|
10414
10596
|
if (count > 1) out.push(count);
|
|
10415
10597
|
return out;
|
|
10416
10598
|
}
|
|
10417
|
-
|
|
10599
|
+
function cursorNav(props, ref, Link, t) {
|
|
10600
|
+
const links = props.firstHref != null || props.previousHref != null || props.nextHref != null;
|
|
10601
|
+
function step(key, href, on, has, label, rel, icon, after) {
|
|
10602
|
+
const body = /* @__PURE__ */ React65.createElement(React65.Fragment, null, icon && !after ? /* @__PURE__ */ React65.createElement(Icon, { name: icon, size: "sm" }) : null, /* @__PURE__ */ React65.createElement("span", null, label), icon && after ? /* @__PURE__ */ React65.createElement(Icon, { name: icon, size: "sm" }) : null);
|
|
10603
|
+
const cls = "aura-page aura-page--step";
|
|
10604
|
+
if (has === false || !href && !on)
|
|
10605
|
+
return links ? /* @__PURE__ */ React65.createElement("span", { key, className: cls, role: "link", "aria-disabled": true }, body) : /* @__PURE__ */ React65.createElement("button", { key, type: "button", className: cls, disabled: true }, body);
|
|
10606
|
+
if (href != null)
|
|
10607
|
+
return /* @__PURE__ */ React65.createElement(
|
|
10608
|
+
Link,
|
|
10609
|
+
{
|
|
10610
|
+
key,
|
|
10611
|
+
href,
|
|
10612
|
+
rel,
|
|
10613
|
+
className: cls,
|
|
10614
|
+
onClick: function(e) {
|
|
10615
|
+
if (on && plainClick(e)) {
|
|
10616
|
+
e.preventDefault();
|
|
10617
|
+
on();
|
|
10618
|
+
}
|
|
10619
|
+
}
|
|
10620
|
+
},
|
|
10621
|
+
body
|
|
10622
|
+
);
|
|
10623
|
+
return /* @__PURE__ */ React65.createElement("button", { key, type: "button", className: cls, onClick: on }, body);
|
|
10624
|
+
}
|
|
10625
|
+
return /* @__PURE__ */ React65.createElement(
|
|
10626
|
+
"nav",
|
|
10627
|
+
{
|
|
10628
|
+
ref,
|
|
10629
|
+
className: cx("aura-pagination", "aura-pagination--cursor", props.className),
|
|
10630
|
+
"aria-label": props.label || t.pagination
|
|
10631
|
+
},
|
|
10632
|
+
props.status != null && props.status !== false && props.status !== "" ? /* @__PURE__ */ React65.createElement("span", { className: "aura-pagination__status" }, props.status) : null,
|
|
10633
|
+
/* @__PURE__ */ React65.createElement("span", { className: "aura-pagination__steps" }, props.showFirst === false ? null : step("first", props.firstHref, props.onFirst, props.hasFirst, t.firstPage, void 0, null, false), step(
|
|
10634
|
+
"prev",
|
|
10635
|
+
props.previousHref,
|
|
10636
|
+
props.onPrevious,
|
|
10637
|
+
props.hasPrevious,
|
|
10638
|
+
t.prevPage,
|
|
10639
|
+
"prev",
|
|
10640
|
+
/* @__PURE__ */ React65.createElement(IconChevronLeft, null),
|
|
10641
|
+
false
|
|
10642
|
+
), step("next", props.nextHref, props.onNext, props.hasNext, t.nextPage, "next", /* @__PURE__ */ React65.createElement(IconChevronRight, null), true))
|
|
10643
|
+
);
|
|
10644
|
+
}
|
|
10645
|
+
var Pagination = React65.forwardRef(function Pagination2(all, ref) {
|
|
10418
10646
|
const t = useStrings();
|
|
10419
10647
|
useAutoTip();
|
|
10648
|
+
const props = all;
|
|
10420
10649
|
const count = Math.max(1, props.pageCount || 1);
|
|
10421
10650
|
const st = useMaybeControlled(props.page, props.defaultPage || 1, props.onChange);
|
|
10422
10651
|
const page = Math.min(count, Math.max(1, st[0]));
|
|
@@ -10425,6 +10654,7 @@ window.Aura = (() => {
|
|
|
10425
10654
|
}
|
|
10426
10655
|
const link = props.getHref;
|
|
10427
10656
|
const Link = useLinkComponent(props.linkComponent);
|
|
10657
|
+
if (all.mode === "cursor") return cursorNav(all, ref, Link, t);
|
|
10428
10658
|
function item(p, label, extra) {
|
|
10429
10659
|
const common = Object.assign(
|
|
10430
10660
|
{
|
|
@@ -10495,9 +10725,15 @@ window.Aura = (() => {
|
|
|
10495
10725
|
})), /* @__PURE__ */ React65.createElement("span", { className: "aura-pagination__compact", "aria-hidden": true }, t.page(page, count)), arrow(page + 1, /* @__PURE__ */ React65.createElement(IconChevronRight, null), t.nextPage, "next", page >= count));
|
|
10496
10726
|
});
|
|
10497
10727
|
|
|
10498
|
-
// src/
|
|
10728
|
+
// src/Spinner.tsx
|
|
10499
10729
|
var React66 = __toESM(require_react(), 1);
|
|
10500
|
-
var
|
|
10730
|
+
var Spinner = React66.forwardRef(function Spinner2(props, ref) {
|
|
10731
|
+
return spinnerElement(props, ref);
|
|
10732
|
+
});
|
|
10733
|
+
|
|
10734
|
+
// src/Accordion.tsx
|
|
10735
|
+
var React67 = __toESM(require_react(), 1);
|
|
10736
|
+
var Accordion = React67.forwardRef(function Accordion2(props, ref) {
|
|
10501
10737
|
const auto = uid(), base = props.id || auto;
|
|
10502
10738
|
const multiple = props.type === "multiple";
|
|
10503
10739
|
const st = useMaybeControlled(
|
|
@@ -10535,9 +10771,9 @@ window.Aura = (() => {
|
|
|
10535
10771
|
n3.focus();
|
|
10536
10772
|
}
|
|
10537
10773
|
}
|
|
10538
|
-
return /* @__PURE__ */
|
|
10774
|
+
return /* @__PURE__ */ React67.createElement("div", { ref, className: cx("aura-accordion", props.className), onKeyDown: onKey }, items2.map(function(it) {
|
|
10539
10775
|
const on = open.indexOf(it.id) >= 0, bid = base + "-btn-" + it.id, pid = base + "-panel-" + it.id;
|
|
10540
|
-
return /* @__PURE__ */
|
|
10776
|
+
return /* @__PURE__ */ React67.createElement("div", { key: it.id, className: cx("aura-accordion__item", on && "is-open") }, /* @__PURE__ */ React67.createElement(HT, { className: "aura-accordion__heading" }, /* @__PURE__ */ React67.createElement(
|
|
10541
10777
|
"button",
|
|
10542
10778
|
{
|
|
10543
10779
|
type: "button",
|
|
@@ -10550,10 +10786,10 @@ window.Aura = (() => {
|
|
|
10550
10786
|
toggle(it.id);
|
|
10551
10787
|
}
|
|
10552
10788
|
},
|
|
10553
|
-
it.icon ? /* @__PURE__ */
|
|
10554
|
-
/* @__PURE__ */
|
|
10555
|
-
/* @__PURE__ */
|
|
10556
|
-
)), /* @__PURE__ */
|
|
10789
|
+
it.icon ? /* @__PURE__ */ React67.createElement(Icon, { name: it.icon, className: "aura-accordion__lead" }) : null,
|
|
10790
|
+
/* @__PURE__ */ React67.createElement("span", { className: "aura-accordion__title" }, /* @__PURE__ */ React67.createElement("span", { id: it.description ? bid + "-title" : void 0 }, it.title), it.description ? /* @__PURE__ */ React67.createElement("span", { className: "aura-accordion__desc", id: bid + "-desc", "aria-hidden": true }, it.description) : null),
|
|
10791
|
+
/* @__PURE__ */ React67.createElement(Icon, { name: /* @__PURE__ */ React67.createElement(IconChevronDown, null), className: "aura-accordion__chevron" })
|
|
10792
|
+
)), /* @__PURE__ */ React67.createElement(
|
|
10557
10793
|
"div",
|
|
10558
10794
|
{
|
|
10559
10795
|
id: pid,
|
|
@@ -10568,7 +10804,7 @@ window.Aura = (() => {
|
|
|
10568
10804
|
});
|
|
10569
10805
|
|
|
10570
10806
|
// src/Popover.tsx
|
|
10571
|
-
var
|
|
10807
|
+
var React68 = __toESM(require_react(), 1);
|
|
10572
10808
|
var import_react_dom13 = __toESM(require_react_dom(), 1);
|
|
10573
10809
|
function position(anchor, pop, placement) {
|
|
10574
10810
|
const r2 = anchor.getBoundingClientRect(), pw = pop.offsetWidth, ph = pop.scrollHeight, vw = window.innerWidth, vh = window.innerHeight, gap = 6;
|
|
@@ -10586,15 +10822,15 @@ window.Aura = (() => {
|
|
|
10586
10822
|
const left = align === "end" ? r2.right - pw : align === "center" ? r2.left + r2.width / 2 - pw / 2 : r2.left;
|
|
10587
10823
|
return { top: Math.max(8, top), left: Math.max(8, Math.min(left, vw - pw - 8)), side, maxHeight };
|
|
10588
10824
|
}
|
|
10589
|
-
var Popover =
|
|
10825
|
+
var Popover = React68.forwardRef(function Popover2(props, ref) {
|
|
10590
10826
|
const t = useStrings();
|
|
10591
10827
|
const density = useDensity();
|
|
10592
10828
|
const auto = uid(), id = props.id || auto;
|
|
10593
10829
|
const st = useMaybeControlled(props.open, !!props.defaultOpen, props.onOpenChange);
|
|
10594
10830
|
const open = !!st[0];
|
|
10595
|
-
const wrap =
|
|
10596
|
-
const pos =
|
|
10597
|
-
const inTree =
|
|
10831
|
+
const wrap = React68.useRef(null), pop = React68.useRef(null), popMerged = useMergedRef(ref, pop);
|
|
10832
|
+
const pos = React68.useState(null), mounted = useMounted();
|
|
10833
|
+
const inTree = React68.useRef(false);
|
|
10598
10834
|
function trigger() {
|
|
10599
10835
|
return wrap.current && (wrap.current.querySelector('button, [role="button"], a, input') || wrap.current.firstElementChild);
|
|
10600
10836
|
}
|
|
@@ -10621,7 +10857,7 @@ window.Aura = (() => {
|
|
|
10621
10857
|
},
|
|
10622
10858
|
[open, mounted, props.placement]
|
|
10623
10859
|
);
|
|
10624
|
-
|
|
10860
|
+
React68.useEffect(
|
|
10625
10861
|
function() {
|
|
10626
10862
|
if (!open || !mounted) return;
|
|
10627
10863
|
if (props.autoFocus !== false && pop.current) {
|
|
@@ -10653,9 +10889,9 @@ window.Aura = (() => {
|
|
|
10653
10889
|
},
|
|
10654
10890
|
[open, mounted]
|
|
10655
10891
|
);
|
|
10656
|
-
const child =
|
|
10892
|
+
const child = React68.Children.only(props.trigger);
|
|
10657
10893
|
const panel = open && mounted ? (0, import_react_dom13.createPortal)(
|
|
10658
|
-
/* @__PURE__ */
|
|
10894
|
+
/* @__PURE__ */ React68.createElement(
|
|
10659
10895
|
"div",
|
|
10660
10896
|
{
|
|
10661
10897
|
ref: popMerged,
|
|
@@ -10685,17 +10921,17 @@ window.Aura = (() => {
|
|
|
10685
10921
|
} else trapTab(e, pop.current);
|
|
10686
10922
|
}
|
|
10687
10923
|
},
|
|
10688
|
-
props.title ? /* @__PURE__ */
|
|
10924
|
+
props.title ? /* @__PURE__ */ React68.createElement("div", { className: "aura-popover__head" }, /* @__PURE__ */ React68.createElement("p", { className: "aura-popover__title", id: id + "-title" }, props.title), /* @__PURE__ */ React68.createElement(
|
|
10689
10925
|
IconButton,
|
|
10690
10926
|
{
|
|
10691
|
-
icon: /* @__PURE__ */
|
|
10927
|
+
icon: /* @__PURE__ */ React68.createElement(IconX, null),
|
|
10692
10928
|
label: t.close,
|
|
10693
10929
|
onClick: function() {
|
|
10694
10930
|
close(true);
|
|
10695
10931
|
}
|
|
10696
10932
|
}
|
|
10697
10933
|
)) : null,
|
|
10698
|
-
/* @__PURE__ */
|
|
10934
|
+
/* @__PURE__ */ React68.createElement("div", { className: "aura-popover__body" }, typeof props.children === "function" ? props.children({
|
|
10699
10935
|
close: function() {
|
|
10700
10936
|
close(true);
|
|
10701
10937
|
}
|
|
@@ -10703,7 +10939,7 @@ window.Aura = (() => {
|
|
|
10703
10939
|
),
|
|
10704
10940
|
document.body
|
|
10705
10941
|
) : null;
|
|
10706
|
-
return /* @__PURE__ */
|
|
10942
|
+
return /* @__PURE__ */ React68.createElement("span", { ref: wrap, className: "aura-popover-anchor" }, React68.cloneElement(child, {
|
|
10707
10943
|
onClick: function(e) {
|
|
10708
10944
|
if (child.props.onClick) child.props.onClick(e);
|
|
10709
10945
|
st[1](!open);
|
|
@@ -10715,7 +10951,7 @@ window.Aura = (() => {
|
|
|
10715
10951
|
});
|
|
10716
10952
|
|
|
10717
10953
|
// src/NumberField.tsx
|
|
10718
|
-
var
|
|
10954
|
+
var React69 = __toESM(require_react(), 1);
|
|
10719
10955
|
function decimalsOf(n3) {
|
|
10720
10956
|
const s = String(n3);
|
|
10721
10957
|
const i = s.indexOf(".");
|
|
@@ -10728,7 +10964,7 @@ window.Aura = (() => {
|
|
|
10728
10964
|
if (!/^-?(\d+\.?\d*|\.\d+)$/.test(s)) return NaN;
|
|
10729
10965
|
return Number(s);
|
|
10730
10966
|
}
|
|
10731
|
-
var NumberField =
|
|
10967
|
+
var NumberField = React69.forwardRef(function NumberField2(props, ref) {
|
|
10732
10968
|
const t = useStrings();
|
|
10733
10969
|
const auto = uid(), id = props.id || auto;
|
|
10734
10970
|
const step = props.step || 1;
|
|
@@ -10739,7 +10975,7 @@ window.Aura = (() => {
|
|
|
10739
10975
|
props.onChange
|
|
10740
10976
|
);
|
|
10741
10977
|
const value = st[0], setValue = st[1];
|
|
10742
|
-
const draftState =
|
|
10978
|
+
const draftState = React69.useState(null), draft = draftState[0], setDraft = draftState[1];
|
|
10743
10979
|
function fmt2(n3) {
|
|
10744
10980
|
if (n3 == null || isNaN(n3)) return "";
|
|
10745
10981
|
return n3.toLocaleString("en", { minimumFractionDigits: decimals, maximumFractionDigits: decimals });
|
|
@@ -10788,7 +11024,7 @@ window.Aura = (() => {
|
|
|
10788
11024
|
};
|
|
10789
11025
|
const valueText = value == null ? void 0 : [affixText(props.prefix), fmt2(value), affixText(props.suffix)].join(" ").trim();
|
|
10790
11026
|
const stepper = props.stepper !== false && !props.readOnly;
|
|
10791
|
-
return /* @__PURE__ */
|
|
11027
|
+
return /* @__PURE__ */ React69.createElement(
|
|
10792
11028
|
Field,
|
|
10793
11029
|
{
|
|
10794
11030
|
id,
|
|
@@ -10800,7 +11036,7 @@ window.Aura = (() => {
|
|
|
10800
11036
|
disabled: props.disabled,
|
|
10801
11037
|
className: cx(touchClass(props.touchHeight), props.className)
|
|
10802
11038
|
},
|
|
10803
|
-
/* @__PURE__ */
|
|
11039
|
+
/* @__PURE__ */ React69.createElement("div", { className: cx("aura-input aura-number", stepper && "has-stepper") }, props.prefix != null ? /* @__PURE__ */ React69.createElement("span", { className: "aura-number__affix", "aria-hidden": true }, props.prefix) : null, /* @__PURE__ */ React69.createElement(
|
|
10804
11040
|
"input",
|
|
10805
11041
|
{
|
|
10806
11042
|
ref,
|
|
@@ -10847,7 +11083,7 @@ window.Aura = (() => {
|
|
|
10847
11083
|
},
|
|
10848
11084
|
onKeyDown
|
|
10849
11085
|
}
|
|
10850
|
-
), props.suffix != null ? /* @__PURE__ */
|
|
11086
|
+
), props.suffix != null ? /* @__PURE__ */ React69.createElement("span", { className: "aura-number__affix", "aria-hidden": true }, props.suffix) : null, stepper ? /* @__PURE__ */ React69.createElement("span", { className: "aura-number__steps" }, /* @__PURE__ */ React69.createElement(
|
|
10851
11087
|
"button",
|
|
10852
11088
|
{
|
|
10853
11089
|
type: "button",
|
|
@@ -10863,8 +11099,8 @@ window.Aura = (() => {
|
|
|
10863
11099
|
nudge(-step);
|
|
10864
11100
|
}
|
|
10865
11101
|
},
|
|
10866
|
-
/* @__PURE__ */
|
|
10867
|
-
), /* @__PURE__ */
|
|
11102
|
+
/* @__PURE__ */ React69.createElement(Icon, { name: /* @__PURE__ */ React69.createElement(IconMinus, null) })
|
|
11103
|
+
), /* @__PURE__ */ React69.createElement(
|
|
10868
11104
|
"button",
|
|
10869
11105
|
{
|
|
10870
11106
|
type: "button",
|
|
@@ -10880,14 +11116,14 @@ window.Aura = (() => {
|
|
|
10880
11116
|
nudge(step);
|
|
10881
11117
|
}
|
|
10882
11118
|
},
|
|
10883
|
-
/* @__PURE__ */
|
|
11119
|
+
/* @__PURE__ */ React69.createElement(Icon, { name: /* @__PURE__ */ React69.createElement(IconPlus, null) })
|
|
10884
11120
|
)) : null)
|
|
10885
11121
|
);
|
|
10886
11122
|
});
|
|
10887
11123
|
|
|
10888
11124
|
// src/Stepper.tsx
|
|
10889
|
-
var
|
|
10890
|
-
var Stepper =
|
|
11125
|
+
var React70 = __toESM(require_react(), 1);
|
|
11126
|
+
var Stepper = React70.forwardRef(function Stepper2(props, ref) {
|
|
10891
11127
|
const t = useStrings();
|
|
10892
11128
|
const idBase = uid();
|
|
10893
11129
|
const steps = props.steps || [];
|
|
@@ -10898,22 +11134,22 @@ window.Aura = (() => {
|
|
|
10898
11134
|
if (at < 0) at = 0;
|
|
10899
11135
|
const vertical = props.orientation === "vertical";
|
|
10900
11136
|
const cur2 = steps[at];
|
|
10901
|
-
return /* @__PURE__ */
|
|
11137
|
+
return /* @__PURE__ */ React70.createElement(
|
|
10902
11138
|
"nav",
|
|
10903
11139
|
{
|
|
10904
11140
|
ref,
|
|
10905
11141
|
"aria-label": props.label,
|
|
10906
11142
|
className: cx("aura-stepper", vertical ? "aura-stepper--vertical" : "aura-stepper--horizontal", props.className)
|
|
10907
11143
|
},
|
|
10908
|
-
/* @__PURE__ */
|
|
11144
|
+
/* @__PURE__ */ React70.createElement("ol", { className: "aura-stepper__list" }, steps.map(function(s, i) {
|
|
10909
11145
|
const state = i < at ? "done" : i === at ? "current" : "upcoming";
|
|
10910
11146
|
const error = s.status === "error";
|
|
10911
|
-
const marker = /* @__PURE__ */
|
|
11147
|
+
const marker = /* @__PURE__ */ React70.createElement("span", { className: "aura-stepper__marker", "aria-hidden": true }, error ? /* @__PURE__ */ React70.createElement(Icon, { name: /* @__PURE__ */ React70.createElement(IconCircleAlert, null) }) : state === "done" ? /* @__PURE__ */ React70.createElement(Icon, { name: /* @__PURE__ */ React70.createElement(IconCheck, null) }) : i + 1);
|
|
10912
11148
|
const note = error ? t.stepError : state === "done" ? t.stepDone : "";
|
|
10913
11149
|
const clickable = state === "done" && !!props.onStepClick;
|
|
10914
11150
|
const named = clickable && (typeof s.label === "string" || typeof s.label === "number") && String(s.label).trim() !== "";
|
|
10915
11151
|
const descId = idBase + "-step-" + i;
|
|
10916
|
-
const text2 = /* @__PURE__ */
|
|
11152
|
+
const text2 = /* @__PURE__ */ React70.createElement("span", { className: "aura-stepper__text" }, named ? /* @__PURE__ */ React70.createElement("span", { className: "aura-sr-only" }, String(s.label) + (note ? ", " + note : "")) : null, /* @__PURE__ */ React70.createElement("span", { className: "aura-stepper__label", "aria-hidden": named ? true : void 0 }, s.label, note && !named ? /* @__PURE__ */ React70.createElement("span", { className: "aura-sr-only" }, ", " + note) : null), s.description ? /* @__PURE__ */ React70.createElement(
|
|
10917
11153
|
"span",
|
|
10918
11154
|
{
|
|
10919
11155
|
className: "aura-stepper__desc",
|
|
@@ -10922,14 +11158,14 @@ window.Aura = (() => {
|
|
|
10922
11158
|
},
|
|
10923
11159
|
s.description
|
|
10924
11160
|
) : null);
|
|
10925
|
-
return /* @__PURE__ */
|
|
11161
|
+
return /* @__PURE__ */ React70.createElement(
|
|
10926
11162
|
"li",
|
|
10927
11163
|
{
|
|
10928
11164
|
key: s.id,
|
|
10929
11165
|
className: cx("aura-stepper__item", "is-" + state, error && "is-error"),
|
|
10930
11166
|
"aria-current": state === "current" ? "step" : void 0
|
|
10931
11167
|
},
|
|
10932
|
-
clickable ? /* @__PURE__ */
|
|
11168
|
+
clickable ? /* @__PURE__ */ React70.createElement(
|
|
10933
11169
|
"button",
|
|
10934
11170
|
{
|
|
10935
11171
|
type: "button",
|
|
@@ -10941,19 +11177,19 @@ window.Aura = (() => {
|
|
|
10941
11177
|
},
|
|
10942
11178
|
marker,
|
|
10943
11179
|
text2
|
|
10944
|
-
) : /* @__PURE__ */
|
|
11180
|
+
) : /* @__PURE__ */ React70.createElement("span", { className: "aura-stepper__step" }, marker, text2)
|
|
10945
11181
|
);
|
|
10946
11182
|
})),
|
|
10947
|
-
!vertical && cur2 ? /* @__PURE__ */
|
|
11183
|
+
!vertical && cur2 ? /* @__PURE__ */ React70.createElement("p", { className: "aura-stepper__compact", "aria-hidden": true }, /* @__PURE__ */ React70.createElement("span", { className: "aura-stepper__count" }, t.stepOf(at + 1, steps.length), cur2.status === "error" ? /* @__PURE__ */ React70.createElement("span", { className: "aura-stepper__count-error" }, " \u2014 " + t.stepError) : null), /* @__PURE__ */ React70.createElement("span", { className: "aura-stepper__compact-label" }, cur2.label)) : null
|
|
10948
11184
|
);
|
|
10949
11185
|
});
|
|
10950
11186
|
|
|
10951
11187
|
// src/SegmentedControl.tsx
|
|
10952
|
-
var
|
|
11188
|
+
var React71 = __toESM(require_react(), 1);
|
|
10953
11189
|
function toOpt2(o) {
|
|
10954
11190
|
return typeof o === "object" ? o : { value: o, label: o };
|
|
10955
11191
|
}
|
|
10956
|
-
var SegmentedControl =
|
|
11192
|
+
var SegmentedControl = React71.forwardRef(
|
|
10957
11193
|
function SegmentedControl2(props, ref) {
|
|
10958
11194
|
const options = (props.options || []).map(toOpt2);
|
|
10959
11195
|
useAutoTip();
|
|
@@ -10967,7 +11203,7 @@ window.Aura = (() => {
|
|
|
10967
11203
|
);
|
|
10968
11204
|
const value = st[0], setValue = st[1];
|
|
10969
11205
|
const auto = uid(), id = props.id || auto;
|
|
10970
|
-
const refs =
|
|
11206
|
+
const refs = React71.useRef([]);
|
|
10971
11207
|
const selIdx = options.findIndex(function(o) {
|
|
10972
11208
|
return o.value === value;
|
|
10973
11209
|
});
|
|
@@ -11000,7 +11236,7 @@ window.Aura = (() => {
|
|
|
11000
11236
|
move(options.length, -1);
|
|
11001
11237
|
}
|
|
11002
11238
|
}
|
|
11003
|
-
return /* @__PURE__ */
|
|
11239
|
+
return /* @__PURE__ */ React71.createElement(
|
|
11004
11240
|
"div",
|
|
11005
11241
|
{
|
|
11006
11242
|
ref,
|
|
@@ -11020,7 +11256,7 @@ window.Aura = (() => {
|
|
|
11020
11256
|
options.map(function(o, i) {
|
|
11021
11257
|
const on = o.value === value;
|
|
11022
11258
|
const off = props.disabled || o.disabled;
|
|
11023
|
-
return /* @__PURE__ */
|
|
11259
|
+
return /* @__PURE__ */ React71.createElement(
|
|
11024
11260
|
"button",
|
|
11025
11261
|
{
|
|
11026
11262
|
key: o.value,
|
|
@@ -11042,8 +11278,8 @@ window.Aura = (() => {
|
|
|
11042
11278
|
onKeyDown(e, i);
|
|
11043
11279
|
}
|
|
11044
11280
|
},
|
|
11045
|
-
o.icon ? /* @__PURE__ */
|
|
11046
|
-
o.iconOnly ? null : /* @__PURE__ */
|
|
11281
|
+
o.icon ? /* @__PURE__ */ React71.createElement(Icon, { name: o.icon }) : null,
|
|
11282
|
+
o.iconOnly ? null : /* @__PURE__ */ React71.createElement("span", null, o.label)
|
|
11047
11283
|
);
|
|
11048
11284
|
})
|
|
11049
11285
|
);
|