@jirawatpyk/aura-react 4.17.0 → 4.19.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 +30 -3
- package/dist/aura.bundle.js +468 -190
- package/dist/cjs/index.cjs +467 -189
- package/dist/esm/ActionBar.js +47 -0
- package/dist/esm/AppShell.js +2 -2
- package/dist/esm/BottomNav.js +45 -0
- package/dist/esm/Command.js +11 -9
- package/dist/esm/DataTable.js +84 -5
- package/dist/esm/DatePicker.js +9 -4
- package/dist/esm/DropdownMenu.js +1 -0
- package/dist/esm/Menu.js +64 -22
- package/dist/esm/Tabs.js +35 -0
- package/dist/esm/Toaster.js +23 -6
- package/dist/esm/dates.js +12 -1
- package/dist/esm/index.js +6 -0
- package/dist/esm/locale.js +4 -2
- package/dist/esm/strings.js +3 -0
- package/dist/index.d.ts +106 -5
- package/dist/server/index.cjs +15 -1
- package/dist/server/index.d.ts +3 -0
- package/dist/server/index.js +15 -1
- package/dist/styles.css +88 -3
- package/dist/styles.layer.css +88 -3
- 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":"RadioGroup"},{"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":"AppShell"},{"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":"RadioGroup"},{"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":"AppShell"},{"name":"ActionBar"},{"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"}]} */
|
|
2
2
|
window.Aura = (() => {
|
|
3
3
|
var __create = Object.create;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -51,11 +51,13 @@ window.Aura = (() => {
|
|
|
51
51
|
var index_exports = {};
|
|
52
52
|
__export(index_exports, {
|
|
53
53
|
Accordion: () => Accordion,
|
|
54
|
+
ActionBar: () => ActionBar,
|
|
54
55
|
Alert: () => Alert,
|
|
55
56
|
AppShell: () => AppShell,
|
|
56
57
|
AuraProvider: () => AuraProvider,
|
|
57
58
|
Avatar: () => Avatar,
|
|
58
59
|
Badge: () => Badge,
|
|
60
|
+
BottomNav: () => BottomNav,
|
|
59
61
|
Breadcrumb: () => Breadcrumb,
|
|
60
62
|
Button: () => Button,
|
|
61
63
|
Calendar: () => Calendar,
|
|
@@ -120,6 +122,7 @@ window.Aura = (() => {
|
|
|
120
122
|
parseTime: () => parseTime,
|
|
121
123
|
statusTone: () => toneFor,
|
|
122
124
|
toast: () => toast,
|
|
125
|
+
todayIn: () => todayIn,
|
|
123
126
|
useAuraLocale: () => useAuraLocale,
|
|
124
127
|
useBreakpoint: () => useBreakpoint,
|
|
125
128
|
useColorScheme: () => useColorScheme,
|
|
@@ -346,6 +349,7 @@ window.Aura = (() => {
|
|
|
346
349
|
},
|
|
347
350
|
prevPage: "Previous page",
|
|
348
351
|
nextPage: "Next page",
|
|
352
|
+
totals: "Totals",
|
|
349
353
|
rowCount: function(c) {
|
|
350
354
|
return n(c) + " rows";
|
|
351
355
|
},
|
|
@@ -459,6 +463,7 @@ window.Aura = (() => {
|
|
|
459
463
|
},
|
|
460
464
|
prevPage: "\u0E2B\u0E19\u0E49\u0E32\u0E01\u0E48\u0E2D\u0E19\u0E2B\u0E19\u0E49\u0E32",
|
|
461
465
|
nextPage: "\u0E2B\u0E19\u0E49\u0E32\u0E16\u0E31\u0E14\u0E44\u0E1B",
|
|
466
|
+
totals: "\u0E23\u0E27\u0E21",
|
|
462
467
|
rowCount: function(c) {
|
|
463
468
|
return n(c) + " \u0E41\u0E16\u0E27";
|
|
464
469
|
},
|
|
@@ -572,6 +577,7 @@ window.Aura = (() => {
|
|
|
572
577
|
},
|
|
573
578
|
prevPage: "F\xF6reg\xE5ende sida",
|
|
574
579
|
nextPage: "N\xE4sta sida",
|
|
580
|
+
totals: "Summa",
|
|
575
581
|
rowCount: function(c) {
|
|
576
582
|
return nsv(c) + " rader";
|
|
577
583
|
},
|
|
@@ -622,6 +628,7 @@ window.Aura = (() => {
|
|
|
622
628
|
function AuraProvider(props) {
|
|
623
629
|
const outer = React3.useContext(LocaleContext);
|
|
624
630
|
const density = props.density || outer && outer.density || null;
|
|
631
|
+
const timeZone = props.timeZone || outer && outer.timeZone || null;
|
|
625
632
|
const value = React3.useMemo(
|
|
626
633
|
function() {
|
|
627
634
|
const base = props.locale && STRINGS[props.locale] || STRINGS.en;
|
|
@@ -630,10 +637,11 @@ window.Aura = (() => {
|
|
|
630
637
|
calendar: props.calendar || null,
|
|
631
638
|
strings: props.strings ? Object.assign({}, base, props.strings) : base,
|
|
632
639
|
linkComponent: props.linkComponent || null,
|
|
633
|
-
density
|
|
640
|
+
density,
|
|
641
|
+
timeZone
|
|
634
642
|
};
|
|
635
643
|
},
|
|
636
|
-
[props.locale, props.calendar, props.strings, props.linkComponent, density]
|
|
644
|
+
[props.locale, props.calendar, props.strings, props.linkComponent, density, timeZone]
|
|
637
645
|
);
|
|
638
646
|
return /* @__PURE__ */ React3.createElement(LocaleContext.Provider, { value }, props.density ? /* @__PURE__ */ React3.createElement("div", { className: "aura-density", "data-density": props.density }, props.children) : props.children);
|
|
639
647
|
}
|
|
@@ -767,6 +775,7 @@ window.Aura = (() => {
|
|
|
767
775
|
const pos = posState[0], setPos = posState[1];
|
|
768
776
|
const items2 = props.items || [];
|
|
769
777
|
const mounted = useMounted();
|
|
778
|
+
const Link = useLinkComponent(props.linkComponent);
|
|
770
779
|
useIsoLayoutEffect(
|
|
771
780
|
function() {
|
|
772
781
|
const a = props.anchor, m = own.current;
|
|
@@ -827,6 +836,63 @@ window.Aura = (() => {
|
|
|
827
836
|
}
|
|
828
837
|
e.stopPropagation();
|
|
829
838
|
}
|
|
839
|
+
function groupItems(list) {
|
|
840
|
+
const out = [];
|
|
841
|
+
list.forEach(function(it, i) {
|
|
842
|
+
const g = it.type === "radio" && it.group ? it.group : null;
|
|
843
|
+
const last = out[out.length - 1];
|
|
844
|
+
if (last && last.group === g && g !== null) last.items.push({ it, i });
|
|
845
|
+
else out.push({ group: g, items: [{ it, i }] });
|
|
846
|
+
});
|
|
847
|
+
return out;
|
|
848
|
+
}
|
|
849
|
+
function renderItem(it, i) {
|
|
850
|
+
if (it.separator) return /* @__PURE__ */ React6.createElement("div", { key: "s" + i, role: "separator", className: "aura-menu__sep" });
|
|
851
|
+
const isRadio = it.type === "radio";
|
|
852
|
+
const isCheck = !isRadio && it.checked !== void 0;
|
|
853
|
+
const lead = isRadio ? /* @__PURE__ */ React6.createElement("span", { className: cx("aura-menu__radio", it.checked && "is-on") }) : 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" });
|
|
854
|
+
const body = [
|
|
855
|
+
/* @__PURE__ */ React6.createElement(React6.Fragment, { key: "l" }, lead),
|
|
856
|
+
/* @__PURE__ */ React6.createElement("span", { key: "t", className: "aura-menu__label" }, it.label),
|
|
857
|
+
it.hint ? /* @__PURE__ */ React6.createElement("span", { key: "h", className: "aura-menu__hint" }, it.hint) : null
|
|
858
|
+
];
|
|
859
|
+
const cls = cx("aura-menu__item", it.tone === "danger" && "aura-menu__item--danger");
|
|
860
|
+
if (it.href && !it.disabled)
|
|
861
|
+
return /* @__PURE__ */ React6.createElement(
|
|
862
|
+
Link,
|
|
863
|
+
{
|
|
864
|
+
key: i,
|
|
865
|
+
href: it.href,
|
|
866
|
+
target: it.target,
|
|
867
|
+
rel: it.target === "_blank" ? "noreferrer" : void 0,
|
|
868
|
+
tabIndex: -1,
|
|
869
|
+
role: "menuitem",
|
|
870
|
+
className: cls,
|
|
871
|
+
onClick: function() {
|
|
872
|
+
if (it.onSelect) it.onSelect();
|
|
873
|
+
props.onClose(false);
|
|
874
|
+
}
|
|
875
|
+
},
|
|
876
|
+
body
|
|
877
|
+
);
|
|
878
|
+
return /* @__PURE__ */ React6.createElement(
|
|
879
|
+
"button",
|
|
880
|
+
{
|
|
881
|
+
key: i,
|
|
882
|
+
type: "button",
|
|
883
|
+
tabIndex: -1,
|
|
884
|
+
disabled: it.disabled,
|
|
885
|
+
role: isRadio ? "menuitemradio" : isCheck ? "menuitemcheckbox" : "menuitem",
|
|
886
|
+
"aria-checked": isRadio || isCheck ? !!it.checked : void 0,
|
|
887
|
+
className: cls,
|
|
888
|
+
onClick: function() {
|
|
889
|
+
if (it.onSelect) it.onSelect();
|
|
890
|
+
if (!it.keepOpen) props.onClose(true);
|
|
891
|
+
}
|
|
892
|
+
},
|
|
893
|
+
body
|
|
894
|
+
);
|
|
895
|
+
}
|
|
830
896
|
const el = /* @__PURE__ */ React6.createElement(
|
|
831
897
|
"div",
|
|
832
898
|
{
|
|
@@ -837,28 +903,11 @@ window.Aura = (() => {
|
|
|
837
903
|
onKeyDown,
|
|
838
904
|
style: { top: pos ? pos.top : -9999, left: pos ? pos.left : -9999 }
|
|
839
905
|
},
|
|
840
|
-
items2.map(function(
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
{
|
|
846
|
-
key: i,
|
|
847
|
-
type: "button",
|
|
848
|
-
tabIndex: -1,
|
|
849
|
-
disabled: it.disabled,
|
|
850
|
-
role: isCheck ? "menuitemcheckbox" : "menuitem",
|
|
851
|
-
"aria-checked": isCheck ? !!it.checked : void 0,
|
|
852
|
-
className: "aura-menu__item",
|
|
853
|
-
onClick: function() {
|
|
854
|
-
it.onSelect();
|
|
855
|
-
if (!it.keepOpen) props.onClose(true);
|
|
856
|
-
}
|
|
857
|
-
},
|
|
858
|
-
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" }),
|
|
859
|
-
/* @__PURE__ */ React6.createElement("span", { className: "aura-menu__label" }, it.label),
|
|
860
|
-
it.hint ? /* @__PURE__ */ React6.createElement("span", { className: "aura-menu__hint" }, it.hint) : null
|
|
861
|
-
);
|
|
906
|
+
groupItems(items2).map(function(block, bi) {
|
|
907
|
+
const rendered = block.items.map(function(x) {
|
|
908
|
+
return renderItem(x.it, x.i);
|
|
909
|
+
});
|
|
910
|
+
return block.group ? /* @__PURE__ */ React6.createElement("div", { key: "g" + bi, role: "group", "aria-label": block.group, className: "aura-menu__group" }, rendered) : /* @__PURE__ */ React6.createElement(React6.Fragment, { key: "f" + bi }, rendered);
|
|
862
911
|
})
|
|
863
912
|
);
|
|
864
913
|
return mounted ? (0, import_react_dom.createPortal)(el, document.body) : null;
|
|
@@ -887,6 +936,7 @@ window.Aura = (() => {
|
|
|
887
936
|
anchor,
|
|
888
937
|
label: props.label,
|
|
889
938
|
items: props.items,
|
|
939
|
+
linkComponent: props.linkComponent,
|
|
890
940
|
onClose: function(restore) {
|
|
891
941
|
setAnchor(null);
|
|
892
942
|
if (restore && typeof anchor.focus === "function") anchor.focus();
|
|
@@ -1696,6 +1746,16 @@ window.Aura = (() => {
|
|
|
1696
1746
|
const dt = new Date(y, mo - 1, d);
|
|
1697
1747
|
return dt.getMonth() === mo - 1 && dt.getDate() === d ? toISO(dt) : null;
|
|
1698
1748
|
}
|
|
1749
|
+
function todayIn(timeZone) {
|
|
1750
|
+
const now = /* @__PURE__ */ new Date();
|
|
1751
|
+
if (!timeZone) return toISO(now);
|
|
1752
|
+
return new Intl.DateTimeFormat("en-CA", {
|
|
1753
|
+
timeZone,
|
|
1754
|
+
year: "numeric",
|
|
1755
|
+
month: "2-digit",
|
|
1756
|
+
day: "2-digit"
|
|
1757
|
+
}).format(now);
|
|
1758
|
+
}
|
|
1699
1759
|
|
|
1700
1760
|
// src/DatePicker.tsx
|
|
1701
1761
|
function useFormatDate() {
|
|
@@ -1717,9 +1777,9 @@ window.Aura = (() => {
|
|
|
1717
1777
|
var Calendar = React17.forwardRef(function Calendar2(props, ref) {
|
|
1718
1778
|
const ctx = useAuraLocale(), locale = props.locale || ctx.locale || "en", calendar = props.calendar || ctx.calendar || defaultCalendar(locale), tag = localeTag(locale, calendar);
|
|
1719
1779
|
const weekStart = props.weekStartsOn == null ? locale === "sv" ? 1 : 0 : props.weekStartsOn;
|
|
1720
|
-
|
|
1721
|
-
today =
|
|
1722
|
-
const min = fromISO(props.min), max = fromISO(props.max);
|
|
1780
|
+
const todayISO = props.today || todayIn(props.timeZone || ctx.timeZone);
|
|
1781
|
+
const today = fromISO(todayISO);
|
|
1782
|
+
const min = fromISO(props.min === "today" ? todayISO : props.min), max = fromISO(props.max === "today" ? todayISO : props.max);
|
|
1723
1783
|
const start = fromISO(props.start), end = fromISO(props.end);
|
|
1724
1784
|
const focusState = React17.useState(fromISO(props.focus) || start || today);
|
|
1725
1785
|
const focusDate = focusState[0], setFocus = focusState[1];
|
|
@@ -2105,6 +2165,8 @@ window.Aura = (() => {
|
|
|
2105
2165
|
weekStartsOn: props.weekStartsOn,
|
|
2106
2166
|
min: props.min,
|
|
2107
2167
|
max: props.max,
|
|
2168
|
+
timeZone: props.timeZone,
|
|
2169
|
+
today: props.today,
|
|
2108
2170
|
isDateDisabled: props.isDateDisabled,
|
|
2109
2171
|
start: st[0],
|
|
2110
2172
|
focus: st[0],
|
|
@@ -2221,6 +2283,8 @@ window.Aura = (() => {
|
|
|
2221
2283
|
weekStartsOn: props.weekStartsOn,
|
|
2222
2284
|
min: props.min,
|
|
2223
2285
|
max: props.max,
|
|
2286
|
+
timeZone: props.timeZone,
|
|
2287
|
+
today: props.today,
|
|
2224
2288
|
isDateDisabled: props.isDateDisabled,
|
|
2225
2289
|
start: draft[0] || v.start,
|
|
2226
2290
|
end: draft[0] ? null : v.end,
|
|
@@ -2295,11 +2359,19 @@ window.Aura = (() => {
|
|
|
2295
2359
|
// src/Toaster.tsx
|
|
2296
2360
|
var React19 = __toESM(require_react(), 1);
|
|
2297
2361
|
var import_react_dom4 = __toESM(require_react_dom(), 1);
|
|
2362
|
+
var MAX_VISIBLE = 3;
|
|
2298
2363
|
var toastState = {
|
|
2299
2364
|
list: [],
|
|
2365
|
+
queue: [],
|
|
2300
2366
|
subs: [],
|
|
2301
2367
|
n: 0
|
|
2302
2368
|
};
|
|
2369
|
+
function promote() {
|
|
2370
|
+
while (toastState.list.length < MAX_VISIBLE && toastState.queue.length) {
|
|
2371
|
+
toastState.list = toastState.list.concat([toastState.queue[0]]);
|
|
2372
|
+
toastState.queue = toastState.queue.slice(1);
|
|
2373
|
+
}
|
|
2374
|
+
}
|
|
2303
2375
|
function emitToasts() {
|
|
2304
2376
|
toastState.subs.forEach(function(f) {
|
|
2305
2377
|
f(toastState.list.slice());
|
|
@@ -2307,18 +2379,24 @@ window.Aura = (() => {
|
|
|
2307
2379
|
}
|
|
2308
2380
|
function show(opts) {
|
|
2309
2381
|
const id = opts.id || "t" + ++toastState.n;
|
|
2310
|
-
const
|
|
2382
|
+
const byId = function(t) {
|
|
2311
2383
|
return t.id === id;
|
|
2312
|
-
}
|
|
2384
|
+
};
|
|
2385
|
+
const at = toastState.list.findIndex(byId), queued = toastState.queue.findIndex(byId);
|
|
2386
|
+
const prev = at >= 0 ? toastState.list[at] : queued >= 0 ? toastState.queue[queued] : null;
|
|
2313
2387
|
const entry = Object.assign({ tone: "info" }, opts, {
|
|
2314
2388
|
id,
|
|
2315
2389
|
loading: !!opts.loading,
|
|
2316
|
-
rev:
|
|
2390
|
+
rev: prev ? prev.rev + 1 : 0
|
|
2317
2391
|
});
|
|
2318
2392
|
if (at >= 0) {
|
|
2319
2393
|
toastState.list = toastState.list.slice();
|
|
2320
2394
|
toastState.list[at] = entry;
|
|
2321
|
-
} else
|
|
2395
|
+
} else if (queued >= 0) {
|
|
2396
|
+
toastState.queue = toastState.queue.slice();
|
|
2397
|
+
toastState.queue[queued] = entry;
|
|
2398
|
+
} else if (toastState.list.length < MAX_VISIBLE) toastState.list = toastState.list.concat([entry]);
|
|
2399
|
+
else toastState.queue = toastState.queue.concat([entry]);
|
|
2322
2400
|
emitToasts();
|
|
2323
2401
|
return id;
|
|
2324
2402
|
}
|
|
@@ -2340,9 +2418,12 @@ window.Aura = (() => {
|
|
|
2340
2418
|
);
|
|
2341
2419
|
};
|
|
2342
2420
|
toast.dismiss = function(id) {
|
|
2343
|
-
|
|
2421
|
+
const keep = function(t) {
|
|
2344
2422
|
return t.id !== id;
|
|
2345
|
-
}
|
|
2423
|
+
};
|
|
2424
|
+
toastState.list = toastState.list.filter(keep);
|
|
2425
|
+
toastState.queue = toastState.queue.filter(keep);
|
|
2426
|
+
promote();
|
|
2346
2427
|
emitToasts();
|
|
2347
2428
|
};
|
|
2348
2429
|
function ToastItem(props) {
|
|
@@ -2901,8 +2982,8 @@ window.Aura = (() => {
|
|
|
2901
2982
|
"data-autofocus": "",
|
|
2902
2983
|
type: "text",
|
|
2903
2984
|
role: "combobox",
|
|
2904
|
-
"aria-expanded":
|
|
2905
|
-
"aria-controls": listId,
|
|
2985
|
+
"aria-expanded": flat.length > 0,
|
|
2986
|
+
"aria-controls": flat.length ? listId : void 0,
|
|
2906
2987
|
"aria-autocomplete": "list",
|
|
2907
2988
|
"aria-activedescendant": active >= 0 ? optId(active) : void 0,
|
|
2908
2989
|
"aria-label": props.label || t.commandMenu,
|
|
@@ -2918,17 +2999,15 @@ window.Aura = (() => {
|
|
|
2918
2999
|
onKeyDown: onKey
|
|
2919
3000
|
}
|
|
2920
3001
|
), /* @__PURE__ */ React25.createElement("kbd", { className: "aura-command__kbd" }, "Esc")),
|
|
2921
|
-
/* @__PURE__ */ React25.createElement(
|
|
3002
|
+
/* @__PURE__ */ React25.createElement("div", { className: "aura-command__list", "aria-busy": props.loading || void 0 }, props.loading ? /* @__PURE__ */ React25.createElement("div", { className: "aura-command__loading" }, /* @__PURE__ */ React25.createElement(Icon, { name: "loader-circle", className: "aura-spin" }), t.searching) : null, !flat.length ? props.loading ? null : /* @__PURE__ */ React25.createElement("div", { className: "aura-command__empty" }, props.empty != null ? props.empty : props.emptyText || t.noMatches) : /* @__PURE__ */ React25.createElement(
|
|
2922
3003
|
"div",
|
|
2923
3004
|
{
|
|
2924
|
-
className: "aura-command__list",
|
|
2925
3005
|
id: listId,
|
|
2926
3006
|
role: "listbox",
|
|
2927
3007
|
"aria-label": props.label || t.commandMenu,
|
|
2928
3008
|
"aria-busy": props.loading || void 0
|
|
2929
3009
|
},
|
|
2930
|
-
|
|
2931
|
-
!flat.length ? props.loading ? null : /* @__PURE__ */ React25.createElement("div", { className: "aura-command__empty", role: "presentation" }, props.empty != null ? props.empty : props.emptyText || t.noMatches) : groups.map(function(g, gi) {
|
|
3010
|
+
groups.map(function(g, gi) {
|
|
2932
3011
|
const gid = id + "-g" + gi;
|
|
2933
3012
|
return /* @__PURE__ */ React25.createElement(
|
|
2934
3013
|
"div",
|
|
@@ -2950,7 +3029,11 @@ window.Aura = (() => {
|
|
|
2950
3029
|
role: "option",
|
|
2951
3030
|
"aria-selected": n2 === active,
|
|
2952
3031
|
"aria-disabled": it.disabled || void 0,
|
|
2953
|
-
className: cx(
|
|
3032
|
+
className: cx(
|
|
3033
|
+
"aura-command__item",
|
|
3034
|
+
n2 === active && "is-active",
|
|
3035
|
+
it.disabled && "is-disabled"
|
|
3036
|
+
),
|
|
2954
3037
|
onPointerDown: function(e) {
|
|
2955
3038
|
e.preventDefault();
|
|
2956
3039
|
},
|
|
@@ -2968,8 +3051,8 @@ window.Aura = (() => {
|
|
|
2968
3051
|
})
|
|
2969
3052
|
);
|
|
2970
3053
|
})
|
|
2971
|
-
),
|
|
2972
|
-
/* @__PURE__ */ React25.createElement("span", { className: "aura-sr-only", role: "status" }, props.loading ? t.searching : props.loading === false && query ? t.results(flat.length) : ""),
|
|
3054
|
+
)),
|
|
3055
|
+
/* @__PURE__ */ React25.createElement("span", { className: "aura-sr-only", role: "status" }, props.loading ? t.searching : query && !flat.length ? t.noMatches : props.loading === false && query ? t.results(flat.length) : ""),
|
|
2973
3056
|
/* @__PURE__ */ React25.createElement("div", { className: "aura-command__foot", "aria-hidden": true }, t.commandHint, /* @__PURE__ */ React25.createElement("span", { className: "aura-command__mod" }, isMac() ? "\u2318K" : "Ctrl K"))
|
|
2974
3057
|
)
|
|
2975
3058
|
),
|
|
@@ -3130,6 +3213,7 @@ window.Aura = (() => {
|
|
|
3130
3213
|
|
|
3131
3214
|
// src/DataTable.tsx
|
|
3132
3215
|
var React28 = __toESM(require_react(), 1);
|
|
3216
|
+
var import_react_dom8 = __toESM(require_react_dom(), 1);
|
|
3133
3217
|
var BP = { sm: 640, md: 768, lg: 1024, xl: 1280 };
|
|
3134
3218
|
var DEFAULT_COLUMNS = [
|
|
3135
3219
|
{ key: "id", label: "ID", width: 96, mono: true },
|
|
@@ -3241,6 +3325,29 @@ window.Aura = (() => {
|
|
|
3241
3325
|
return px != null && boxWidth[0] < px;
|
|
3242
3326
|
}
|
|
3243
3327
|
const scrollRef = React28.useRef(null);
|
|
3328
|
+
const tipState = React28.useState(null), tip = tipState[0], setTip = tipState[1];
|
|
3329
|
+
function showFull(e) {
|
|
3330
|
+
const el = e.target.closest ? e.target.closest(".aura-table__td, .aura-table__card-fields dd") : null;
|
|
3331
|
+
if (!el || el.scrollWidth <= el.clientWidth + 1 || el.querySelector("button, input, .aura-pill"))
|
|
3332
|
+
return setTip(null);
|
|
3333
|
+
const r = el.getBoundingClientRect();
|
|
3334
|
+
setTip({ text: (el.textContent || "").trim(), left: r.left, top: r.top });
|
|
3335
|
+
}
|
|
3336
|
+
function hideFull() {
|
|
3337
|
+
setTip(null);
|
|
3338
|
+
}
|
|
3339
|
+
const tipEl = tip && typeof document !== "undefined" ? (0, import_react_dom8.createPortal)(
|
|
3340
|
+
/* @__PURE__ */ React28.createElement(
|
|
3341
|
+
"div",
|
|
3342
|
+
{
|
|
3343
|
+
className: "aura-tooltip aura-tooltip--above",
|
|
3344
|
+
"aria-hidden": "true",
|
|
3345
|
+
style: { left: tip.left, top: tip.top - 6 }
|
|
3346
|
+
},
|
|
3347
|
+
tip.text
|
|
3348
|
+
),
|
|
3349
|
+
document.body
|
|
3350
|
+
) : null;
|
|
3244
3351
|
const rowH = React28.useState(ROW_H_DEFAULT);
|
|
3245
3352
|
const ROW_H = rowH[0];
|
|
3246
3353
|
useIsoLayoutEffect(function() {
|
|
@@ -4109,7 +4216,7 @@ window.Aura = (() => {
|
|
|
4109
4216
|
return /* @__PURE__ */ React28.createElement("span", { key: c.key, className: "aura-table__card-actions" }, cellVal(c, r));
|
|
4110
4217
|
})),
|
|
4111
4218
|
rest.length ? /* @__PURE__ */ React28.createElement("dl", { className: "aura-table__card-fields" }, rest.map(function(c) {
|
|
4112
|
-
return /* @__PURE__ */ React28.createElement("div", { key: c.key }, /* @__PURE__ */ React28.createElement("dt", null, c.label), /* @__PURE__ */ React28.createElement("dd", { className: c.mono
|
|
4219
|
+
return /* @__PURE__ */ React28.createElement("div", { key: c.key }, /* @__PURE__ */ React28.createElement("dt", null, c.label), /* @__PURE__ */ React28.createElement("dd", { className: cx(c.mono && "aura-table__mono", c.align === "end" && "is-end") }, cellVal(c, r)));
|
|
4113
4220
|
})) : null
|
|
4114
4221
|
);
|
|
4115
4222
|
}));
|
|
@@ -4120,6 +4227,10 @@ window.Aura = (() => {
|
|
|
4120
4227
|
ref: wrapRefArg,
|
|
4121
4228
|
"data-density": props.density,
|
|
4122
4229
|
className: cx("aura-table aura-table--stacked", refreshing && "is-refreshing", props.className),
|
|
4230
|
+
onMouseOver: showFull,
|
|
4231
|
+
onMouseLeave: hideFull,
|
|
4232
|
+
onFocus: showFull,
|
|
4233
|
+
onBlur: hideFull,
|
|
4123
4234
|
role: "region",
|
|
4124
4235
|
"aria-label": props.label,
|
|
4125
4236
|
"aria-busy": busy || void 0
|
|
@@ -4135,10 +4246,55 @@ window.Aura = (() => {
|
|
|
4135
4246
|
}
|
|
4136
4247
|
), /* @__PURE__ */ React28.createElement("span", null, nSel ? t.selectedCount(nSel) : t.selectAll)) : null,
|
|
4137
4248
|
cardBody,
|
|
4138
|
-
|
|
4249
|
+
props.footer && rows.length && !loading ? /* @__PURE__ */ React28.createElement("div", { className: "aura-table__card aura-table__card--total", role: "group", "aria-label": t.totals }, /* @__PURE__ */ React28.createElement("dl", { className: "aura-table__card-fields" }, vis.filter(function(c) {
|
|
4250
|
+
return props.footer[c.key] != null;
|
|
4251
|
+
}).map(function(c) {
|
|
4252
|
+
return /* @__PURE__ */ React28.createElement("div", { key: c.key }, /* @__PURE__ */ React28.createElement("dt", null, c.label || t.totals), /* @__PURE__ */ React28.createElement("dd", { className: cx(c.mono && "aura-table__mono", c.align === "end" && "is-end") }, props.footer[c.key]));
|
|
4253
|
+
}))) : null,
|
|
4254
|
+
foot,
|
|
4255
|
+
tipEl
|
|
4139
4256
|
);
|
|
4140
4257
|
}
|
|
4141
4258
|
if (stacked) return renderStacked(wrapMerged);
|
|
4259
|
+
const totalRow = props.footer && rows.length && !loading ? /* @__PURE__ */ React28.createElement(
|
|
4260
|
+
"div",
|
|
4261
|
+
{
|
|
4262
|
+
role: "row",
|
|
4263
|
+
"aria-rowindex": shownTotal + 2,
|
|
4264
|
+
"aria-label": t.totals,
|
|
4265
|
+
className: cx("aura-table__row aura-table__total", props.stickyFooter && "is-sticky"),
|
|
4266
|
+
style: rowStyle
|
|
4267
|
+
},
|
|
4268
|
+
/* @__PURE__ */ React28.createElement("span", { className: "aura-table__gutter", "aria-hidden": true }),
|
|
4269
|
+
selectable ? /* @__PURE__ */ React28.createElement("span", { className: cx("aura-table__sel", nPinned && "is-pinned"), "aria-hidden": true }) : null,
|
|
4270
|
+
vis.map(function(c, j) {
|
|
4271
|
+
const pin = isPinned(c);
|
|
4272
|
+
return /* @__PURE__ */ React28.createElement(
|
|
4273
|
+
"span",
|
|
4274
|
+
{
|
|
4275
|
+
key: c.key,
|
|
4276
|
+
role: "gridcell",
|
|
4277
|
+
"aria-colindex": j + (selectable ? 2 : 1),
|
|
4278
|
+
className: cx(
|
|
4279
|
+
"aura-table__td",
|
|
4280
|
+
c.mono && "aura-table__mono",
|
|
4281
|
+
c.align === "end" && "is-end",
|
|
4282
|
+
pin && "is-pinned",
|
|
4283
|
+
pin && j === nPinned - 1 && "is-pin-edge"
|
|
4284
|
+
),
|
|
4285
|
+
style: cellStyle(c, j)
|
|
4286
|
+
},
|
|
4287
|
+
props.footer[c.key]
|
|
4288
|
+
);
|
|
4289
|
+
}),
|
|
4290
|
+
/* @__PURE__ */ React28.createElement(
|
|
4291
|
+
"span",
|
|
4292
|
+
{
|
|
4293
|
+
className: cx("aura-table__gutter aura-table__gutter--end", controls && "has-picker"),
|
|
4294
|
+
"aria-hidden": true
|
|
4295
|
+
}
|
|
4296
|
+
)
|
|
4297
|
+
) : null;
|
|
4142
4298
|
const scrollStyle = {
|
|
4143
4299
|
scrollPaddingLeft: "calc(var(--aura-space-6)" + selW + " + " + acc + "px)",
|
|
4144
4300
|
scrollPaddingTop: ROW_H + "px"
|
|
@@ -4160,11 +4316,15 @@ window.Aura = (() => {
|
|
|
4160
4316
|
gridRef.current = el;
|
|
4161
4317
|
},
|
|
4162
4318
|
className: "aura-table__scroll",
|
|
4319
|
+
onMouseOver: showFull,
|
|
4320
|
+
onMouseLeave: hideFull,
|
|
4321
|
+
onFocus: showFull,
|
|
4322
|
+
onBlur: hideFull,
|
|
4163
4323
|
style: scrollStyle,
|
|
4164
4324
|
role: "grid",
|
|
4165
4325
|
"aria-label": props.label,
|
|
4166
4326
|
"aria-busy": busy || void 0,
|
|
4167
|
-
"aria-rowcount": loading ? -1 : shownTotal + 1,
|
|
4327
|
+
"aria-rowcount": loading ? -1 : shownTotal + 1 + (totalRow ? 1 : 0),
|
|
4168
4328
|
"aria-colcount": nCols,
|
|
4169
4329
|
"aria-multiselectable": selectable || void 0,
|
|
4170
4330
|
onKeyDown: onGridKey,
|
|
@@ -4178,7 +4338,8 @@ window.Aura = (() => {
|
|
|
4178
4338
|
}
|
|
4179
4339
|
},
|
|
4180
4340
|
/* @__PURE__ */ React28.createElement("div", { className: "aura-table__head", role: "row", "aria-rowindex": 1, style: rowStyle }, head),
|
|
4181
|
-
body
|
|
4341
|
+
body,
|
|
4342
|
+
totalRow
|
|
4182
4343
|
),
|
|
4183
4344
|
busy ? /* @__PURE__ */ React28.createElement("span", { className: "aura-sr-only", role: "status" }, t.loadingRows) : null,
|
|
4184
4345
|
controls ? /* @__PURE__ */ React28.createElement("div", { className: "aura-table__picker" }, /* @__PURE__ */ React28.createElement(
|
|
@@ -4201,7 +4362,8 @@ window.Aura = (() => {
|
|
|
4201
4362
|
label: menu.kind === "picker" ? t.columns : t.column(byKey[menu.key] && byKey[menu.key].label),
|
|
4202
4363
|
items: menu.kind === "picker" ? pickerItems() : byKey[menu.key] ? columnMenuItems(byKey[menu.key]) : []
|
|
4203
4364
|
}
|
|
4204
|
-
) : null
|
|
4365
|
+
) : null,
|
|
4366
|
+
tipEl
|
|
4205
4367
|
);
|
|
4206
4368
|
if (!dual) return gridEl;
|
|
4207
4369
|
return /* @__PURE__ */ React28.createElement("div", { ref: wrapMerged, className: "aura-table-dual", "data-stack-below": props.stackBelow }, renderStacked(void 0), gridEl);
|
|
@@ -4243,6 +4405,40 @@ window.Aura = (() => {
|
|
|
4243
4405
|
const current2 = items2.filter(function(t) {
|
|
4244
4406
|
return t.id === st[0];
|
|
4245
4407
|
})[0] || items2[0];
|
|
4408
|
+
const Link = useLinkComponent(props.linkComponent);
|
|
4409
|
+
const asLinks = items2.length > 0 && items2.every(function(t) {
|
|
4410
|
+
return !!t.href;
|
|
4411
|
+
});
|
|
4412
|
+
if (asLinks)
|
|
4413
|
+
return /* @__PURE__ */ React30.createElement(
|
|
4414
|
+
"nav",
|
|
4415
|
+
{
|
|
4416
|
+
ref,
|
|
4417
|
+
"aria-label": props.label,
|
|
4418
|
+
className: cx("aura-tabs aura-tabs--links", props.className)
|
|
4419
|
+
},
|
|
4420
|
+
/* @__PURE__ */ React30.createElement("div", { className: "aura-tabs__list" }, items2.map(function(t) {
|
|
4421
|
+
const on = current2 && t.id === current2.id;
|
|
4422
|
+
const inner = [
|
|
4423
|
+
t.icon ? /* @__PURE__ */ React30.createElement(Icon, { key: "i", name: t.icon }) : null,
|
|
4424
|
+
t.label,
|
|
4425
|
+
t.count != null ? /* @__PURE__ */ React30.createElement("span", { key: "c", className: "aura-tab__count" }, t.count) : null
|
|
4426
|
+
];
|
|
4427
|
+
return t.disabled ? /* @__PURE__ */ React30.createElement("span", { key: t.id, className: "aura-tab is-disabled", "aria-disabled": true }, inner) : /* @__PURE__ */ React30.createElement(
|
|
4428
|
+
Link,
|
|
4429
|
+
{
|
|
4430
|
+
key: t.id,
|
|
4431
|
+
href: t.href,
|
|
4432
|
+
className: cx("aura-tab", on && "is-active"),
|
|
4433
|
+
"aria-current": on ? "page" : void 0,
|
|
4434
|
+
onClick: function() {
|
|
4435
|
+
st[1](t.id);
|
|
4436
|
+
}
|
|
4437
|
+
},
|
|
4438
|
+
inner
|
|
4439
|
+
);
|
|
4440
|
+
}))
|
|
4441
|
+
);
|
|
4246
4442
|
function go(i) {
|
|
4247
4443
|
const enabled = items2.filter(function(t2) {
|
|
4248
4444
|
return !t2.disabled;
|
|
@@ -4317,7 +4513,7 @@ window.Aura = (() => {
|
|
|
4317
4513
|
|
|
4318
4514
|
// src/SideNav.tsx
|
|
4319
4515
|
var React31 = __toESM(require_react(), 1);
|
|
4320
|
-
var
|
|
4516
|
+
var import_react_dom9 = __toESM(require_react_dom(), 1);
|
|
4321
4517
|
function contains(it, id) {
|
|
4322
4518
|
return !!id && !!it.children && it.children.some(function(c) {
|
|
4323
4519
|
return c.id === id || contains(c, id);
|
|
@@ -4504,7 +4700,7 @@ window.Aura = (() => {
|
|
|
4504
4700
|
}
|
|
4505
4701
|
}
|
|
4506
4702
|
)) : null,
|
|
4507
|
-
tip && typeof document !== "undefined" ? (0,
|
|
4703
|
+
tip && typeof document !== "undefined" ? (0, import_react_dom9.createPortal)(
|
|
4508
4704
|
/* @__PURE__ */ React31.createElement(
|
|
4509
4705
|
"div",
|
|
4510
4706
|
{
|
|
@@ -4688,7 +4884,7 @@ window.Aura = (() => {
|
|
|
4688
4884
|
collapsed: false,
|
|
4689
4885
|
collapsible: false
|
|
4690
4886
|
}) : props.nav;
|
|
4691
|
-
return /* @__PURE__ */ React38.createElement("div", { ref, className: cx("aura-shell", props.className) }, props.nav ? /* @__PURE__ */ React38.createElement("div", { className: "aura-shell__nav" }, props.nav) : null, props.nav ? /* @__PURE__ */ React38.createElement(
|
|
4887
|
+
return /* @__PURE__ */ React38.createElement("div", { ref, className: cx("aura-shell", props.bottomNav && "aura-shell--bottomnav", props.className) }, props.nav ? /* @__PURE__ */ React38.createElement("div", { className: "aura-shell__nav" }, props.nav) : null, props.nav ? /* @__PURE__ */ React38.createElement(
|
|
4692
4888
|
Drawer,
|
|
4693
4889
|
{
|
|
4694
4890
|
open,
|
|
@@ -4713,13 +4909,95 @@ window.Aura = (() => {
|
|
|
4713
4909
|
},
|
|
4714
4910
|
"aria-expanded": open
|
|
4715
4911
|
}
|
|
4716
|
-
) : null, /* @__PURE__ */ React38.createElement("div", { className: "aura-shell__bar-content" }, props.header)) : null, /* @__PURE__ */ React38.createElement("main", { className: "aura-shell__content", id: props.mainId || "main" }, props.children)));
|
|
4912
|
+
) : null, /* @__PURE__ */ React38.createElement("div", { className: "aura-shell__bar-content" }, props.header)) : null, /* @__PURE__ */ React38.createElement("main", { className: "aura-shell__content", id: props.mainId || "main" }, props.children), props.bottomNav || null));
|
|
4717
4913
|
});
|
|
4718
4914
|
|
|
4719
|
-
// src/
|
|
4915
|
+
// src/ActionBar.tsx
|
|
4720
4916
|
var React39 = __toESM(require_react(), 1);
|
|
4721
|
-
var
|
|
4722
|
-
|
|
4917
|
+
var ActionBar = React39.forwardRef(function ActionBar2(props, ref) {
|
|
4918
|
+
const t = useStrings();
|
|
4919
|
+
const bulk = props.selected != null;
|
|
4920
|
+
const idle = bulk && !props.selected;
|
|
4921
|
+
const count = bulk && props.selected ? t.selectedCount(props.selected) : null;
|
|
4922
|
+
const cameFrom = React39.useRef(null);
|
|
4923
|
+
const own = React39.useRef(null);
|
|
4924
|
+
function clear() {
|
|
4925
|
+
props.onClearSelection();
|
|
4926
|
+
setTimeout(function() {
|
|
4927
|
+
const back = cameFrom.current;
|
|
4928
|
+
const a = document.activeElement;
|
|
4929
|
+
if ((!a || a === document.body || !a.isConnected) && back && back.isConnected) back.focus();
|
|
4930
|
+
}, 0);
|
|
4931
|
+
}
|
|
4932
|
+
return /* @__PURE__ */ React39.createElement(
|
|
4933
|
+
"div",
|
|
4934
|
+
{
|
|
4935
|
+
ref: function(el) {
|
|
4936
|
+
own.current = el;
|
|
4937
|
+
if (typeof ref === "function") ref(el);
|
|
4938
|
+
else if (ref) ref.current = el;
|
|
4939
|
+
},
|
|
4940
|
+
onFocus: function(e) {
|
|
4941
|
+
const from = e.relatedTarget;
|
|
4942
|
+
if (from && own.current && !own.current.contains(from)) cameFrom.current = from;
|
|
4943
|
+
},
|
|
4944
|
+
role: "region",
|
|
4945
|
+
"aria-label": props.label || t.actions,
|
|
4946
|
+
className: cx(
|
|
4947
|
+
"aura-actionbar",
|
|
4948
|
+
"aura-actionbar--" + (props.position || "viewport"),
|
|
4949
|
+
idle && "is-idle",
|
|
4950
|
+
props.className
|
|
4951
|
+
)
|
|
4952
|
+
},
|
|
4953
|
+
/* @__PURE__ */ React39.createElement("div", { className: "aura-actionbar__inner" }, /* @__PURE__ */ React39.createElement("div", { className: "aura-actionbar__status", role: "status" }, count, count && props.status ? " \xB7 " : null, props.status), !idle ? /* @__PURE__ */ React39.createElement("div", { className: "aura-actionbar__actions" }, count && props.onClearSelection ? /* @__PURE__ */ React39.createElement(Button, { variant: "ghost", size: "sm", onClick: clear }, t.clear()) : null, props.children) : null)
|
|
4954
|
+
);
|
|
4955
|
+
});
|
|
4956
|
+
|
|
4957
|
+
// src/BottomNav.tsx
|
|
4958
|
+
var React40 = __toESM(require_react(), 1);
|
|
4959
|
+
var BottomNav = React40.forwardRef(function BottomNav2(props, ref) {
|
|
4960
|
+
const t = useStrings();
|
|
4961
|
+
const Link = useLinkComponent(props.linkComponent);
|
|
4962
|
+
const st = useMaybeControlled(
|
|
4963
|
+
props.value,
|
|
4964
|
+
props.defaultValue,
|
|
4965
|
+
props.onChange
|
|
4966
|
+
);
|
|
4967
|
+
const active = st[0];
|
|
4968
|
+
const hide = props.hideFrom === false ? "always" : "below-" + (props.hideFrom || "lg");
|
|
4969
|
+
return /* @__PURE__ */ React40.createElement(React40.Fragment, null, /* @__PURE__ */ React40.createElement("div", { className: cx("aura-bottomnav-spacer", "aura-bottomnav--" + hide), "aria-hidden": "true" }), /* @__PURE__ */ React40.createElement(
|
|
4970
|
+
"nav",
|
|
4971
|
+
{
|
|
4972
|
+
ref,
|
|
4973
|
+
className: cx("aura-bottomnav", "aura-bottomnav--" + hide, props.className),
|
|
4974
|
+
"aria-label": props.label || t.mainNav
|
|
4975
|
+
},
|
|
4976
|
+
/* @__PURE__ */ React40.createElement("ul", { className: "aura-bottomnav__list" }, props.items.map(function(it) {
|
|
4977
|
+
const on = active === it.id;
|
|
4978
|
+
const count = it.count != null && it.count > 0 ? it.count > 99 ? "99+" : String(it.count) : null;
|
|
4979
|
+
const common = {
|
|
4980
|
+
className: cx("aura-bottomnav__item", on && "is-active"),
|
|
4981
|
+
"aria-current": on ? "page" : void 0,
|
|
4982
|
+
onClick: function(e) {
|
|
4983
|
+
if (!it.href) e.preventDefault();
|
|
4984
|
+
st[1](it.id);
|
|
4985
|
+
}
|
|
4986
|
+
};
|
|
4987
|
+
const inner = [
|
|
4988
|
+
/* @__PURE__ */ React40.createElement("span", { key: "i", className: "aura-bottomnav__icon" }, /* @__PURE__ */ React40.createElement(Icon, { name: it.icon, size: "md" }), count ? /* @__PURE__ */ React40.createElement("span", { className: "aura-bottomnav__count", "aria-hidden": "true" }, count) : it.badge ? /* @__PURE__ */ React40.createElement("span", { className: "aura-bottomnav__dot", "aria-hidden": "true" }) : null),
|
|
4989
|
+
/* @__PURE__ */ React40.createElement("span", { key: "l", className: "aura-bottomnav__label" }, it.label),
|
|
4990
|
+
count || it.badge && it.badgeLabel ? /* @__PURE__ */ React40.createElement("span", { key: "s", className: "aura-sr-only" }, " (" + (count || it.badgeLabel) + ")") : null
|
|
4991
|
+
];
|
|
4992
|
+
return /* @__PURE__ */ React40.createElement("li", { key: it.id, className: "aura-bottomnav__cell" }, it.href ? /* @__PURE__ */ React40.createElement(Link, { href: it.href, ...common }, inner) : /* @__PURE__ */ React40.createElement("button", { type: "button", ...common }, inner));
|
|
4993
|
+
}))
|
|
4994
|
+
));
|
|
4995
|
+
});
|
|
4996
|
+
|
|
4997
|
+
// src/Surface.tsx
|
|
4998
|
+
var React41 = __toESM(require_react(), 1);
|
|
4999
|
+
var h8 = React41.createElement;
|
|
5000
|
+
var Surface = React41.forwardRef(function Surface2(props, ref) {
|
|
4723
5001
|
const t = props.texture || "mesh";
|
|
4724
5002
|
const rest = omit(props, ["texture", "className", "children", "as"]);
|
|
4725
5003
|
return h8(
|
|
@@ -4740,8 +5018,8 @@ window.Aura = (() => {
|
|
|
4740
5018
|
});
|
|
4741
5019
|
|
|
4742
5020
|
// src/Stat.tsx
|
|
4743
|
-
var
|
|
4744
|
-
var Stat =
|
|
5021
|
+
var React42 = __toESM(require_react(), 1);
|
|
5022
|
+
var Stat = React42.forwardRef(function Stat2(props, ref) {
|
|
4745
5023
|
const ch = props.change;
|
|
4746
5024
|
const dir = ch && (ch.direction || "flat");
|
|
4747
5025
|
const tone2 = ch && (ch.tone || (dir === "up" ? "positive" : dir === "down" ? "negative" : "neutral"));
|
|
@@ -4750,7 +5028,7 @@ window.Aura = (() => {
|
|
|
4750
5028
|
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, ""));
|
|
4751
5029
|
const Tag3 = props.href ? Link : props.onClick ? "button" : "div";
|
|
4752
5030
|
const interactive = !!(props.href || props.onClick);
|
|
4753
|
-
return /* @__PURE__ */
|
|
5031
|
+
return /* @__PURE__ */ React42.createElement(
|
|
4754
5032
|
Tag3,
|
|
4755
5033
|
{
|
|
4756
5034
|
ref,
|
|
@@ -4760,15 +5038,15 @@ window.Aura = (() => {
|
|
|
4760
5038
|
type: Tag3 === "button" ? "button" : void 0,
|
|
4761
5039
|
"aria-busy": props.loading || void 0
|
|
4762
5040
|
},
|
|
4763
|
-
/* @__PURE__ */
|
|
4764
|
-
props.loading ? /* @__PURE__ */
|
|
4765
|
-
ch && !props.loading || props.caption ? /* @__PURE__ */
|
|
5041
|
+
/* @__PURE__ */ React42.createElement("span", { className: "aura-stat__head" }, /* @__PURE__ */ React42.createElement("span", { className: "aura-stat__label" }, props.label), props.icon ? /* @__PURE__ */ React42.createElement("span", { className: "aura-stat__icon" }, /* @__PURE__ */ React42.createElement(Icon, { name: props.icon })) : null),
|
|
5042
|
+
props.loading ? /* @__PURE__ */ React42.createElement("span", { className: "aura-stat__value" }, /* @__PURE__ */ React42.createElement("span", { className: "aura-skel aura-stat__skel" })) : /* @__PURE__ */ React42.createElement("span", { className: cx("aura-stat__value", numeric && "is-numeric") }, props.value, props.unit ? /* @__PURE__ */ React42.createElement("span", { className: "aura-stat__unit" }, props.unit) : null),
|
|
5043
|
+
ch && !props.loading || props.caption ? /* @__PURE__ */ React42.createElement("span", { className: "aura-stat__foot" }, ch && !props.loading ? /* @__PURE__ */ React42.createElement("span", { className: cx("aura-stat__change", "is-" + tone2) }, /* @__PURE__ */ React42.createElement(Icon, { name: dir === "up" ? "trending-up" : dir === "down" ? "trending-down" : "minus", size: 14 }), /* @__PURE__ */ React42.createElement("span", null, ch.value)) : null, ch && ch.label && !props.loading ? /* @__PURE__ */ React42.createElement("span", { className: "aura-stat__caption" }, ch.label) : null, props.caption ? /* @__PURE__ */ React42.createElement("span", { className: "aura-stat__caption" }, props.caption) : null) : null
|
|
4766
5044
|
);
|
|
4767
5045
|
});
|
|
4768
5046
|
|
|
4769
5047
|
// src/TimePicker.tsx
|
|
4770
|
-
var
|
|
4771
|
-
var
|
|
5048
|
+
var React43 = __toESM(require_react(), 1);
|
|
5049
|
+
var import_react_dom10 = __toESM(require_react_dom(), 1);
|
|
4772
5050
|
|
|
4773
5051
|
// src/text.ts
|
|
4774
5052
|
function formatBytes(n2) {
|
|
@@ -4808,7 +5086,7 @@ window.Aura = (() => {
|
|
|
4808
5086
|
function fromMin(n2) {
|
|
4809
5087
|
return pad3(Math.floor(n2 / 60)) + ":" + pad3(n2 % 60);
|
|
4810
5088
|
}
|
|
4811
|
-
var TimePicker =
|
|
5089
|
+
var TimePicker = React43.forwardRef(function TimePicker2(props, ref) {
|
|
4812
5090
|
const t = useStrings();
|
|
4813
5091
|
const auto = uid(), id = props.id || auto, listId = id + "-list";
|
|
4814
5092
|
const st = useMaybeControlled(
|
|
@@ -4818,7 +5096,7 @@ window.Aura = (() => {
|
|
|
4818
5096
|
);
|
|
4819
5097
|
const value = st[0];
|
|
4820
5098
|
const step = props.step || 30, lo = toMin(props.min) != null ? toMin(props.min) : 0, hi = toMin(props.max) != null ? toMin(props.max) : 24 * 60 - 1;
|
|
4821
|
-
const slots =
|
|
5099
|
+
const slots = React43.useMemo(
|
|
4822
5100
|
function() {
|
|
4823
5101
|
const out = [];
|
|
4824
5102
|
for (let m = lo; m <= hi; m += step) out.push(fromMin(m));
|
|
@@ -4830,12 +5108,12 @@ window.Aura = (() => {
|
|
|
4830
5108
|
const n2 = toMin(v);
|
|
4831
5109
|
return n2 == null || n2 < lo || n2 > hi || props.isTimeDisabled && props.isTimeDisabled(v);
|
|
4832
5110
|
}
|
|
4833
|
-
const openState =
|
|
4834
|
-
const editState =
|
|
4835
|
-
const aState =
|
|
4836
|
-
const errState =
|
|
4837
|
-
const pos =
|
|
4838
|
-
const boxRef =
|
|
5111
|
+
const openState = React43.useState(false), open = openState[0], setOpen = openState[1];
|
|
5112
|
+
const editState = React43.useState(null), editing = editState[0], setEditing = editState[1];
|
|
5113
|
+
const aState = React43.useState(0), active = aState[0], setActive = aState[1];
|
|
5114
|
+
const errState = React43.useState(null);
|
|
5115
|
+
const pos = React43.useState(null);
|
|
5116
|
+
const boxRef = React43.useRef(null), inputRef = React43.useRef(null), listRef = React43.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
4839
5117
|
const mounted = useMounted();
|
|
4840
5118
|
function nearest(v) {
|
|
4841
5119
|
const n2 = toMin(v);
|
|
@@ -4863,7 +5141,7 @@ window.Aura = (() => {
|
|
|
4863
5141
|
},
|
|
4864
5142
|
[open]
|
|
4865
5143
|
);
|
|
4866
|
-
|
|
5144
|
+
React43.useEffect(
|
|
4867
5145
|
function() {
|
|
4868
5146
|
if (!open) return;
|
|
4869
5147
|
function outside(e) {
|
|
@@ -4885,7 +5163,7 @@ window.Aura = (() => {
|
|
|
4885
5163
|
},
|
|
4886
5164
|
[open]
|
|
4887
5165
|
);
|
|
4888
|
-
|
|
5166
|
+
React43.useEffect(
|
|
4889
5167
|
function() {
|
|
4890
5168
|
if (!open || !listRef.current) return;
|
|
4891
5169
|
const el = listRef.current.querySelector('[data-idx="' + active + '"]');
|
|
@@ -4982,10 +5260,10 @@ window.Aura = (() => {
|
|
|
4982
5260
|
}
|
|
4983
5261
|
}
|
|
4984
5262
|
const error = errState[0] || props.error;
|
|
4985
|
-
const list = open && mounted && pos[0] ? (0,
|
|
4986
|
-
/* @__PURE__ */
|
|
5263
|
+
const list = open && mounted && pos[0] ? (0, import_react_dom10.createPortal)(
|
|
5264
|
+
/* @__PURE__ */ React43.createElement("div", { ref: listRef, className: "aura-combo__popover aura-time__popover", style: pos[0] }, /* @__PURE__ */ React43.createElement("ul", { id: listId, role: "listbox", "aria-label": props.label, className: "aura-combo__list" }, slots.map(function(s, i) {
|
|
4987
5265
|
const dis = blocked(s), sel = s === value;
|
|
4988
|
-
return /* @__PURE__ */
|
|
5266
|
+
return /* @__PURE__ */ React43.createElement(
|
|
4989
5267
|
"li",
|
|
4990
5268
|
{
|
|
4991
5269
|
key: s,
|
|
@@ -5010,13 +5288,13 @@ window.Aura = (() => {
|
|
|
5010
5288
|
if (active !== i) setActive(i);
|
|
5011
5289
|
}
|
|
5012
5290
|
},
|
|
5013
|
-
/* @__PURE__ */
|
|
5014
|
-
sel ? /* @__PURE__ */
|
|
5291
|
+
/* @__PURE__ */ React43.createElement("span", { className: "aura-combo__label" }, s),
|
|
5292
|
+
sel ? /* @__PURE__ */ React43.createElement(Icon, { name: "check", className: "aura-combo__check" }) : null
|
|
5015
5293
|
);
|
|
5016
5294
|
}))),
|
|
5017
5295
|
document.body
|
|
5018
5296
|
) : null;
|
|
5019
|
-
return /* @__PURE__ */
|
|
5297
|
+
return /* @__PURE__ */ React43.createElement(
|
|
5020
5298
|
Field,
|
|
5021
5299
|
{
|
|
5022
5300
|
id,
|
|
@@ -5028,7 +5306,7 @@ window.Aura = (() => {
|
|
|
5028
5306
|
disabled: props.disabled,
|
|
5029
5307
|
className: props.className
|
|
5030
5308
|
},
|
|
5031
|
-
/* @__PURE__ */
|
|
5309
|
+
/* @__PURE__ */ React43.createElement("div", { ref: boxRef, className: cx("aura-input aura-combo aura-time has-icon", open && "is-open") }, /* @__PURE__ */ React43.createElement(Icon, { name: "clock", className: "aura-input__icon" }), /* @__PURE__ */ React43.createElement(
|
|
5032
5310
|
"input",
|
|
5033
5311
|
{
|
|
5034
5312
|
ref: inputMerged,
|
|
@@ -5068,7 +5346,7 @@ window.Aura = (() => {
|
|
|
5068
5346
|
}, 0);
|
|
5069
5347
|
}
|
|
5070
5348
|
}
|
|
5071
|
-
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */
|
|
5349
|
+
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */ React43.createElement(
|
|
5072
5350
|
"button",
|
|
5073
5351
|
{
|
|
5074
5352
|
type: "button",
|
|
@@ -5081,8 +5359,8 @@ window.Aura = (() => {
|
|
|
5081
5359
|
if (inputRef.current) inputRef.current.focus();
|
|
5082
5360
|
}
|
|
5083
5361
|
},
|
|
5084
|
-
/* @__PURE__ */
|
|
5085
|
-
) : null, /* @__PURE__ */
|
|
5362
|
+
/* @__PURE__ */ React43.createElement(Icon, { name: "x" })
|
|
5363
|
+
) : null, /* @__PURE__ */ React43.createElement(
|
|
5086
5364
|
"button",
|
|
5087
5365
|
{
|
|
5088
5366
|
type: "button",
|
|
@@ -5100,14 +5378,14 @@ window.Aura = (() => {
|
|
|
5100
5378
|
}
|
|
5101
5379
|
}
|
|
5102
5380
|
},
|
|
5103
|
-
/* @__PURE__ */
|
|
5381
|
+
/* @__PURE__ */ React43.createElement(Icon, { name: "chevron-down" })
|
|
5104
5382
|
)),
|
|
5105
5383
|
list
|
|
5106
5384
|
);
|
|
5107
5385
|
});
|
|
5108
5386
|
|
|
5109
5387
|
// src/FileUpload.tsx
|
|
5110
|
-
var
|
|
5388
|
+
var React44 = __toESM(require_react(), 1);
|
|
5111
5389
|
function matches(file, accept) {
|
|
5112
5390
|
if (!accept) return true;
|
|
5113
5391
|
const name = (file.name || "").toLowerCase(), type = (file.type || "").toLowerCase();
|
|
@@ -5131,17 +5409,17 @@ window.Aura = (() => {
|
|
|
5131
5409
|
}).join(", ");
|
|
5132
5410
|
}
|
|
5133
5411
|
var seq = 0;
|
|
5134
|
-
var FileUpload =
|
|
5412
|
+
var FileUpload = React44.forwardRef(function FileUpload2(props, ref) {
|
|
5135
5413
|
const t = useStrings();
|
|
5136
5414
|
const auto = uid(), id = props.id || auto;
|
|
5137
5415
|
const st = useMaybeControlled(props.value, props.defaultValue || [], props.onChange);
|
|
5138
5416
|
const items2 = st[0] || [];
|
|
5139
|
-
const dragState =
|
|
5140
|
-
const inputRef =
|
|
5141
|
-
const urls =
|
|
5417
|
+
const dragState = React44.useState(false), over = dragState[0];
|
|
5418
|
+
const inputRef = React44.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
5419
|
+
const urls = React44.useRef({});
|
|
5142
5420
|
const maxFiles = props.multiple ? props.maxFiles : 1;
|
|
5143
5421
|
const note = t.accepts(describeAccept(props.accept, t), props.maxSize ? formatBytes(props.maxSize) : "");
|
|
5144
|
-
|
|
5422
|
+
React44.useEffect(function() {
|
|
5145
5423
|
return function() {
|
|
5146
5424
|
Object.keys(urls.current).forEach(function(k) {
|
|
5147
5425
|
URL.revokeObjectURL(urls.current[k]);
|
|
@@ -5192,7 +5470,7 @@ window.Aura = (() => {
|
|
|
5192
5470
|
if (inputRef.current) inputRef.current.focus();
|
|
5193
5471
|
}
|
|
5194
5472
|
const error = props.error;
|
|
5195
|
-
return /* @__PURE__ */
|
|
5473
|
+
return /* @__PURE__ */ React44.createElement(
|
|
5196
5474
|
Field,
|
|
5197
5475
|
{
|
|
5198
5476
|
id,
|
|
@@ -5204,7 +5482,7 @@ window.Aura = (() => {
|
|
|
5204
5482
|
disabled: props.disabled,
|
|
5205
5483
|
className: props.className
|
|
5206
5484
|
},
|
|
5207
|
-
/* @__PURE__ */
|
|
5485
|
+
/* @__PURE__ */ React44.createElement(
|
|
5208
5486
|
"div",
|
|
5209
5487
|
{
|
|
5210
5488
|
className: cx("aura-upload", over && "is-over", props.disabled && "is-disabled", error && "is-invalid"),
|
|
@@ -5225,9 +5503,9 @@ window.Aura = (() => {
|
|
|
5225
5503
|
add(e.dataTransfer && e.dataTransfer.files);
|
|
5226
5504
|
}
|
|
5227
5505
|
},
|
|
5228
|
-
/* @__PURE__ */
|
|
5229
|
-
/* @__PURE__ */
|
|
5230
|
-
/* @__PURE__ */
|
|
5506
|
+
/* @__PURE__ */ React44.createElement(Icon, { name: "cloud-upload", size: "lg", className: "aura-upload__icon" }),
|
|
5507
|
+
/* @__PURE__ */ React44.createElement("span", { className: "aura-upload__text" }, t.dropFiles, " "),
|
|
5508
|
+
/* @__PURE__ */ React44.createElement(
|
|
5231
5509
|
"input",
|
|
5232
5510
|
{
|
|
5233
5511
|
ref: inputMerged,
|
|
@@ -5249,12 +5527,12 @@ window.Aura = (() => {
|
|
|
5249
5527
|
}
|
|
5250
5528
|
}
|
|
5251
5529
|
),
|
|
5252
|
-
/* @__PURE__ */
|
|
5253
|
-
note ? /* @__PURE__ */
|
|
5530
|
+
/* @__PURE__ */ React44.createElement("span", { className: "aura-upload__browse", "aria-hidden": true }, props.multiple ? t.browse : t.browseOne),
|
|
5531
|
+
note ? /* @__PURE__ */ React44.createElement("span", { className: "aura-upload__note", id: id + "-note" }, note) : null
|
|
5254
5532
|
),
|
|
5255
|
-
items2.length ? /* @__PURE__ */
|
|
5533
|
+
items2.length ? /* @__PURE__ */ React44.createElement("ul", { className: "aura-upload__list", "aria-live": "polite" }, items2.map(function(it) {
|
|
5256
5534
|
const src = thumb(it);
|
|
5257
|
-
return /* @__PURE__ */
|
|
5535
|
+
return /* @__PURE__ */ React44.createElement("li", { key: it.id, className: cx("aura-upload__item", it.error && "is-error") }, src ? /* @__PURE__ */ React44.createElement("img", { className: "aura-upload__thumb", src, alt: "" }) : /* @__PURE__ */ React44.createElement("span", { className: "aura-upload__thumb is-icon", "aria-hidden": true }, /* @__PURE__ */ React44.createElement(Icon, { name: /^image\//.test(it.type || "") ? "image" : "file", size: "md" })), /* @__PURE__ */ React44.createElement("span", { className: "aura-upload__meta" }, /* @__PURE__ */ React44.createElement("span", { className: "aura-upload__name" }, it.name), /* @__PURE__ */ React44.createElement("span", { className: "aura-upload__sub" }, it.error ? /* @__PURE__ */ React44.createElement(React44.Fragment, null, /* @__PURE__ */ React44.createElement(Icon, { name: "circle-alert", size: 12 }), it.error) : it.status === "uploading" ? t.uploading + (it.progress != null ? " " + Math.round(it.progress) + "%" : "") : it.status === "done" ? /* @__PURE__ */ React44.createElement(React44.Fragment, null, /* @__PURE__ */ React44.createElement(Icon, { name: "circle-check", size: 12 }), formatBytes(it.size)) : formatBytes(it.size)), it.status === "uploading" ? /* @__PURE__ */ React44.createElement(
|
|
5258
5536
|
"span",
|
|
5259
5537
|
{
|
|
5260
5538
|
className: "aura-upload__bar",
|
|
@@ -5264,8 +5542,8 @@ window.Aura = (() => {
|
|
|
5264
5542
|
"aria-valuemax": 100,
|
|
5265
5543
|
"aria-valuenow": it.progress != null ? Math.round(it.progress) : void 0
|
|
5266
5544
|
},
|
|
5267
|
-
/* @__PURE__ */
|
|
5268
|
-
) : null), /* @__PURE__ */
|
|
5545
|
+
/* @__PURE__ */ React44.createElement("span", { style: { width: (it.progress || 0) + "%" } })
|
|
5546
|
+
) : null), /* @__PURE__ */ React44.createElement(
|
|
5269
5547
|
IconButton,
|
|
5270
5548
|
{
|
|
5271
5549
|
icon: "x",
|
|
@@ -5551,9 +5829,9 @@ window.Aura = (() => {
|
|
|
5551
5829
|
}
|
|
5552
5830
|
|
|
5553
5831
|
// src/ThemeStyle.tsx
|
|
5554
|
-
var
|
|
5832
|
+
var React45 = __toESM(require_react(), 1);
|
|
5555
5833
|
function ThemeStyle(props) {
|
|
5556
|
-
const css =
|
|
5834
|
+
const css = React45.useMemo(
|
|
5557
5835
|
function() {
|
|
5558
5836
|
return createTheme({ brand: props.brand, signal: props.signal, primary: props.primary, name: props.name }).css(
|
|
5559
5837
|
props.selector
|
|
@@ -5561,11 +5839,11 @@ window.Aura = (() => {
|
|
|
5561
5839
|
},
|
|
5562
5840
|
[props.brand, props.signal, props.primary, props.name, props.selector]
|
|
5563
5841
|
);
|
|
5564
|
-
return /* @__PURE__ */
|
|
5842
|
+
return /* @__PURE__ */ React45.createElement("style", { "data-aura-theme": props.name || props.brand, dangerouslySetInnerHTML: { __html: css } });
|
|
5565
5843
|
}
|
|
5566
5844
|
|
|
5567
5845
|
// src/colorScheme.tsx
|
|
5568
|
-
var
|
|
5846
|
+
var React46 = __toESM(require_react(), 1);
|
|
5569
5847
|
|
|
5570
5848
|
// src/colorSchemeScript.ts
|
|
5571
5849
|
var DEFAULT_KEY = "aura-color-scheme";
|
|
@@ -5582,7 +5860,7 @@ window.Aura = (() => {
|
|
|
5582
5860
|
|
|
5583
5861
|
// src/colorScheme.tsx
|
|
5584
5862
|
function ColorSchemeScript(props) {
|
|
5585
|
-
return /* @__PURE__ */
|
|
5863
|
+
return /* @__PURE__ */ React46.createElement(
|
|
5586
5864
|
"script",
|
|
5587
5865
|
{
|
|
5588
5866
|
"data-aura-color-scheme": "",
|
|
@@ -5607,7 +5885,7 @@ window.Aura = (() => {
|
|
|
5607
5885
|
function useColorScheme(options) {
|
|
5608
5886
|
const key = options && options.storageKey || DEFAULT_KEY;
|
|
5609
5887
|
const fallback = options && options.defaultScheme || "system";
|
|
5610
|
-
const subscribe2 =
|
|
5888
|
+
const subscribe2 = React46.useCallback(
|
|
5611
5889
|
function(cb) {
|
|
5612
5890
|
const mq = window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null;
|
|
5613
5891
|
function onSystem() {
|
|
@@ -5625,7 +5903,7 @@ window.Aura = (() => {
|
|
|
5625
5903
|
},
|
|
5626
5904
|
[fallback]
|
|
5627
5905
|
);
|
|
5628
|
-
const snapshot =
|
|
5906
|
+
const snapshot = React46.useSyncExternalStore(
|
|
5629
5907
|
subscribe2,
|
|
5630
5908
|
function() {
|
|
5631
5909
|
const s = readScheme(fallback);
|
|
@@ -5636,7 +5914,7 @@ window.Aura = (() => {
|
|
|
5636
5914
|
}
|
|
5637
5915
|
);
|
|
5638
5916
|
const parts = snapshot.split("|");
|
|
5639
|
-
const setScheme =
|
|
5917
|
+
const setScheme = React46.useCallback(
|
|
5640
5918
|
function(next) {
|
|
5641
5919
|
if (!valid(next)) return;
|
|
5642
5920
|
try {
|
|
@@ -5655,11 +5933,11 @@ window.Aura = (() => {
|
|
|
5655
5933
|
const cs = useColorScheme(props);
|
|
5656
5934
|
const names = { light: t.schemeLight, dark: t.schemeDark, system: t.schemeSystem };
|
|
5657
5935
|
const label = props.label || t.colorScheme;
|
|
5658
|
-
return /* @__PURE__ */
|
|
5936
|
+
return /* @__PURE__ */ React46.createElement(
|
|
5659
5937
|
DropdownMenu,
|
|
5660
5938
|
{
|
|
5661
5939
|
label,
|
|
5662
|
-
trigger: /* @__PURE__ */
|
|
5940
|
+
trigger: /* @__PURE__ */ React46.createElement(IconButton, { icon: cs.resolved === "dark" ? "moon" : "sun", label: label + ": " + names[cs.scheme] }),
|
|
5663
5941
|
items: SCHEMES.map(function(s) {
|
|
5664
5942
|
return {
|
|
5665
5943
|
label: names[s],
|
|
@@ -5674,10 +5952,10 @@ window.Aura = (() => {
|
|
|
5674
5952
|
}
|
|
5675
5953
|
|
|
5676
5954
|
// src/Badge.tsx
|
|
5677
|
-
var
|
|
5678
|
-
var Badge =
|
|
5955
|
+
var React47 = __toESM(require_react(), 1);
|
|
5956
|
+
var Badge = React47.forwardRef(function Badge2(props, ref) {
|
|
5679
5957
|
const rest = omit(props, ["tone", "variant", "icon", "className", "children"]);
|
|
5680
|
-
return /* @__PURE__ */
|
|
5958
|
+
return /* @__PURE__ */ React47.createElement(
|
|
5681
5959
|
"span",
|
|
5682
5960
|
{
|
|
5683
5961
|
...rest,
|
|
@@ -5690,19 +5968,19 @@ window.Aura = (() => {
|
|
|
5690
5968
|
props.className
|
|
5691
5969
|
)
|
|
5692
5970
|
},
|
|
5693
|
-
props.icon ? /* @__PURE__ */
|
|
5971
|
+
props.icon ? /* @__PURE__ */ React47.createElement(Icon, { name: props.icon, size: 12 }) : null,
|
|
5694
5972
|
props.children
|
|
5695
5973
|
);
|
|
5696
5974
|
});
|
|
5697
5975
|
|
|
5698
5976
|
// src/Progress.tsx
|
|
5699
|
-
var
|
|
5700
|
-
var Progress =
|
|
5977
|
+
var React48 = __toESM(require_react(), 1);
|
|
5978
|
+
var Progress = React48.forwardRef(function Progress2(props, ref) {
|
|
5701
5979
|
const auto = uid(), id = props.id || auto;
|
|
5702
5980
|
const max = props.max || 100, det = props.value != null;
|
|
5703
5981
|
const pct = det ? Math.max(0, Math.min(100, props.value / max * 100)) : 0;
|
|
5704
5982
|
const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
|
|
5705
|
-
return /* @__PURE__ */
|
|
5983
|
+
return /* @__PURE__ */ React48.createElement(
|
|
5706
5984
|
"div",
|
|
5707
5985
|
{
|
|
5708
5986
|
ref,
|
|
@@ -5713,8 +5991,8 @@ window.Aura = (() => {
|
|
|
5713
5991
|
props.className
|
|
5714
5992
|
)
|
|
5715
5993
|
},
|
|
5716
|
-
props.label || props.showValue && shown ? /* @__PURE__ */
|
|
5717
|
-
/* @__PURE__ */
|
|
5994
|
+
props.label || props.showValue && shown ? /* @__PURE__ */ React48.createElement("div", { className: "aura-progress__head" }, props.label ? /* @__PURE__ */ React48.createElement("span", { className: "aura-progress__label", id: id + "-label" }, props.label) : /* @__PURE__ */ React48.createElement("span", null), props.showValue && shown ? /* @__PURE__ */ React48.createElement("span", { className: "aura-progress__value" }, shown) : null) : null,
|
|
5995
|
+
/* @__PURE__ */ React48.createElement(
|
|
5718
5996
|
"div",
|
|
5719
5997
|
{
|
|
5720
5998
|
className: cx("aura-progress__track", !det && "is-indeterminate"),
|
|
@@ -5726,21 +6004,21 @@ window.Aura = (() => {
|
|
|
5726
6004
|
"aria-valuenow": det ? props.value : void 0,
|
|
5727
6005
|
"aria-valuetext": det && props.valueLabel != null ? String(props.valueLabel) : void 0
|
|
5728
6006
|
},
|
|
5729
|
-
/* @__PURE__ */
|
|
6007
|
+
/* @__PURE__ */ React48.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 })
|
|
5730
6008
|
),
|
|
5731
|
-
props.hint ? /* @__PURE__ */
|
|
6009
|
+
props.hint ? /* @__PURE__ */ React48.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
|
|
5732
6010
|
);
|
|
5733
6011
|
});
|
|
5734
6012
|
|
|
5735
6013
|
// src/Skeleton.tsx
|
|
5736
|
-
var
|
|
5737
|
-
var Skeleton =
|
|
6014
|
+
var React49 = __toESM(require_react(), 1);
|
|
6015
|
+
var Skeleton = React49.forwardRef(function Skeleton2(props, ref) {
|
|
5738
6016
|
const v = props.variant || "text";
|
|
5739
6017
|
if (v === "text" && (props.lines || 1) > 1) {
|
|
5740
6018
|
const n2 = props.lines, rows = [];
|
|
5741
6019
|
for (let i = 0; i < n2; i++)
|
|
5742
|
-
rows.push(/* @__PURE__ */
|
|
5743
|
-
return /* @__PURE__ */
|
|
6020
|
+
rows.push(/* @__PURE__ */ React49.createElement("span", { key: i, className: "aura-skel aura-skel--text", style: { width: i === n2 - 1 ? "60%" : "100%" } }));
|
|
6021
|
+
return /* @__PURE__ */ React49.createElement(
|
|
5744
6022
|
"span",
|
|
5745
6023
|
{
|
|
5746
6024
|
ref,
|
|
@@ -5758,28 +6036,28 @@ window.Aura = (() => {
|
|
|
5758
6036
|
if (v === "circle") {
|
|
5759
6037
|
style.width = style.height = props.size || props.width || 40;
|
|
5760
6038
|
}
|
|
5761
|
-
return /* @__PURE__ */
|
|
6039
|
+
return /* @__PURE__ */ React49.createElement("span", { ref, "aria-hidden": true, className: cx("aura-skel", "aura-skel--" + v, props.className), style });
|
|
5762
6040
|
});
|
|
5763
6041
|
|
|
5764
6042
|
// src/EmptyState.tsx
|
|
5765
|
-
var
|
|
5766
|
-
var EmptyState =
|
|
6043
|
+
var React50 = __toESM(require_react(), 1);
|
|
6044
|
+
var EmptyState = React50.forwardRef(function EmptyState2(props, ref) {
|
|
5767
6045
|
const HT = "h" + (props.headingLevel || 3);
|
|
5768
|
-
return /* @__PURE__ */
|
|
6046
|
+
return /* @__PURE__ */ React50.createElement(
|
|
5769
6047
|
"div",
|
|
5770
6048
|
{
|
|
5771
6049
|
ref,
|
|
5772
6050
|
className: cx("aura-empty", props.size === "sm" && "is-sm", props.bordered && "is-bordered", props.className)
|
|
5773
6051
|
},
|
|
5774
|
-
/* @__PURE__ */
|
|
5775
|
-
/* @__PURE__ */
|
|
5776
|
-
props.description ? /* @__PURE__ */
|
|
5777
|
-
props.action ? /* @__PURE__ */
|
|
6052
|
+
/* @__PURE__ */ React50.createElement("span", { className: "aura-empty__icon", "aria-hidden": true }, /* @__PURE__ */ React50.createElement(Icon, { name: props.icon || "inbox", size: props.size === "sm" ? "md" : "lg" })),
|
|
6053
|
+
/* @__PURE__ */ React50.createElement(HT, { className: "aura-empty__title" }, props.title),
|
|
6054
|
+
props.description ? /* @__PURE__ */ React50.createElement("p", { className: "aura-empty__text" }, props.description) : null,
|
|
6055
|
+
props.action ? /* @__PURE__ */ React50.createElement("div", { className: "aura-empty__action" }, props.action) : null
|
|
5778
6056
|
);
|
|
5779
6057
|
});
|
|
5780
6058
|
|
|
5781
6059
|
// src/Pagination.tsx
|
|
5782
|
-
var
|
|
6060
|
+
var React51 = __toESM(require_react(), 1);
|
|
5783
6061
|
function pageList(page, count, sib) {
|
|
5784
6062
|
let out = [], lo = Math.max(2, page - sib), hi = Math.min(count - 1, page + sib);
|
|
5785
6063
|
if (page - sib <= 3) {
|
|
@@ -5799,7 +6077,7 @@ window.Aura = (() => {
|
|
|
5799
6077
|
if (count > 1) out.push(count);
|
|
5800
6078
|
return out;
|
|
5801
6079
|
}
|
|
5802
|
-
var Pagination =
|
|
6080
|
+
var Pagination = React51.forwardRef(function Pagination2(props, ref) {
|
|
5803
6081
|
const t = useStrings();
|
|
5804
6082
|
const count = Math.max(1, props.pageCount || 1);
|
|
5805
6083
|
const st = useMaybeControlled(props.page, props.defaultPage || 1, props.onChange);
|
|
@@ -5818,7 +6096,7 @@ window.Aura = (() => {
|
|
|
5818
6096
|
},
|
|
5819
6097
|
extra
|
|
5820
6098
|
);
|
|
5821
|
-
return link ? /* @__PURE__ */
|
|
6099
|
+
return link ? /* @__PURE__ */ React51.createElement(
|
|
5822
6100
|
Link,
|
|
5823
6101
|
{
|
|
5824
6102
|
href: link(p),
|
|
@@ -5831,7 +6109,7 @@ window.Aura = (() => {
|
|
|
5831
6109
|
...common
|
|
5832
6110
|
},
|
|
5833
6111
|
label
|
|
5834
|
-
) : /* @__PURE__ */
|
|
6112
|
+
) : /* @__PURE__ */ React51.createElement(
|
|
5835
6113
|
"button",
|
|
5836
6114
|
{
|
|
5837
6115
|
type: "button",
|
|
@@ -5845,7 +6123,7 @@ window.Aura = (() => {
|
|
|
5845
6123
|
}
|
|
5846
6124
|
function arrow(p, icon, label, rel, disabled) {
|
|
5847
6125
|
if (!link || disabled)
|
|
5848
|
-
return /* @__PURE__ */
|
|
6126
|
+
return /* @__PURE__ */ React51.createElement(
|
|
5849
6127
|
IconButton,
|
|
5850
6128
|
{
|
|
5851
6129
|
icon,
|
|
@@ -5856,7 +6134,7 @@ window.Aura = (() => {
|
|
|
5856
6134
|
}
|
|
5857
6135
|
}
|
|
5858
6136
|
);
|
|
5859
|
-
return /* @__PURE__ */
|
|
6137
|
+
return /* @__PURE__ */ React51.createElement(
|
|
5860
6138
|
Link,
|
|
5861
6139
|
{
|
|
5862
6140
|
href: link(p),
|
|
@@ -5871,17 +6149,17 @@ window.Aura = (() => {
|
|
|
5871
6149
|
}
|
|
5872
6150
|
}
|
|
5873
6151
|
},
|
|
5874
|
-
/* @__PURE__ */
|
|
6152
|
+
/* @__PURE__ */ React51.createElement(Icon, { name: icon, size: "sm" })
|
|
5875
6153
|
);
|
|
5876
6154
|
}
|
|
5877
|
-
return /* @__PURE__ */
|
|
5878
|
-
return typeof p === "number" ? /* @__PURE__ */
|
|
5879
|
-
})), /* @__PURE__ */
|
|
6155
|
+
return /* @__PURE__ */ React51.createElement("nav", { ref, className: cx("aura-pagination", props.className), "aria-label": props.label || t.pagination }, arrow(page - 1, "chevron-left", t.prevPage, "prev", page <= 1), /* @__PURE__ */ React51.createElement("ol", { className: "aura-pagination__list" }, pageList(page, count, props.siblingCount == null ? 1 : props.siblingCount).map(function(p) {
|
|
6156
|
+
return typeof p === "number" ? /* @__PURE__ */ React51.createElement("li", { key: p }, item(p, p)) : /* @__PURE__ */ React51.createElement("li", { key: p, className: "aura-pagination__gap", "aria-hidden": true }, "\u2026");
|
|
6157
|
+
})), /* @__PURE__ */ React51.createElement("span", { className: "aura-pagination__compact", "aria-hidden": true }, t.page(page, count)), arrow(page + 1, "chevron-right", t.nextPage, "next", page >= count));
|
|
5880
6158
|
});
|
|
5881
6159
|
|
|
5882
6160
|
// src/Accordion.tsx
|
|
5883
|
-
var
|
|
5884
|
-
var Accordion =
|
|
6161
|
+
var React52 = __toESM(require_react(), 1);
|
|
6162
|
+
var Accordion = React52.forwardRef(function Accordion2(props, ref) {
|
|
5885
6163
|
const auto = uid(), base = props.id || auto;
|
|
5886
6164
|
const multiple = props.type === "multiple";
|
|
5887
6165
|
const st = useMaybeControlled(
|
|
@@ -5919,9 +6197,9 @@ window.Aura = (() => {
|
|
|
5919
6197
|
n2.focus();
|
|
5920
6198
|
}
|
|
5921
6199
|
}
|
|
5922
|
-
return /* @__PURE__ */
|
|
6200
|
+
return /* @__PURE__ */ React52.createElement("div", { ref, className: cx("aura-accordion", props.className), onKeyDown: onKey }, items2.map(function(it) {
|
|
5923
6201
|
const on = open.indexOf(it.id) >= 0, bid = base + "-btn-" + it.id, pid = base + "-panel-" + it.id;
|
|
5924
|
-
return /* @__PURE__ */
|
|
6202
|
+
return /* @__PURE__ */ React52.createElement("div", { key: it.id, className: cx("aura-accordion__item", on && "is-open") }, /* @__PURE__ */ React52.createElement(HT, { className: "aura-accordion__heading" }, /* @__PURE__ */ React52.createElement(
|
|
5925
6203
|
"button",
|
|
5926
6204
|
{
|
|
5927
6205
|
type: "button",
|
|
@@ -5933,16 +6211,16 @@ window.Aura = (() => {
|
|
|
5933
6211
|
toggle(it.id);
|
|
5934
6212
|
}
|
|
5935
6213
|
},
|
|
5936
|
-
it.icon ? /* @__PURE__ */
|
|
5937
|
-
/* @__PURE__ */
|
|
5938
|
-
/* @__PURE__ */
|
|
5939
|
-
)), /* @__PURE__ */
|
|
6214
|
+
it.icon ? /* @__PURE__ */ React52.createElement(Icon, { name: it.icon, className: "aura-accordion__lead" }) : null,
|
|
6215
|
+
/* @__PURE__ */ React52.createElement("span", { className: "aura-accordion__title" }, it.title, it.description ? /* @__PURE__ */ React52.createElement("span", { className: "aura-accordion__desc" }, it.description) : null),
|
|
6216
|
+
/* @__PURE__ */ React52.createElement(Icon, { name: "chevron-down", className: "aura-accordion__chevron" })
|
|
6217
|
+
)), /* @__PURE__ */ React52.createElement("div", { id: pid, role: "region", "aria-labelledby": bid, className: "aura-accordion__panel", hidden: !on }, it.content));
|
|
5940
6218
|
}));
|
|
5941
6219
|
});
|
|
5942
6220
|
|
|
5943
6221
|
// src/Popover.tsx
|
|
5944
|
-
var
|
|
5945
|
-
var
|
|
6222
|
+
var React53 = __toESM(require_react(), 1);
|
|
6223
|
+
var import_react_dom11 = __toESM(require_react_dom(), 1);
|
|
5946
6224
|
function position(anchor, pop, placement) {
|
|
5947
6225
|
const r = anchor.getBoundingClientRect(), pw = pop.offsetWidth, ph = pop.offsetHeight, vw = window.innerWidth, vh = window.innerHeight, gap = 6;
|
|
5948
6226
|
let side = (placement || "bottom-start").split("-")[0], align = (placement || "bottom-start").split("-")[1] || "start";
|
|
@@ -5952,14 +6230,14 @@ window.Aura = (() => {
|
|
|
5952
6230
|
const left = align === "end" ? r.right - pw : align === "center" ? r.left + r.width / 2 - pw / 2 : r.left;
|
|
5953
6231
|
return { top: Math.max(8, top), left: Math.max(8, Math.min(left, vw - pw - 8)), side };
|
|
5954
6232
|
}
|
|
5955
|
-
var Popover =
|
|
6233
|
+
var Popover = React53.forwardRef(function Popover2(props, ref) {
|
|
5956
6234
|
const t = useStrings();
|
|
5957
6235
|
const density = useDensity();
|
|
5958
6236
|
const auto = uid(), id = props.id || auto;
|
|
5959
6237
|
const st = useMaybeControlled(props.open, !!props.defaultOpen, props.onOpenChange);
|
|
5960
6238
|
const open = !!st[0];
|
|
5961
|
-
const wrap =
|
|
5962
|
-
const pos =
|
|
6239
|
+
const wrap = React53.useRef(null), pop = React53.useRef(null), popMerged = useMergedRef(ref, pop);
|
|
6240
|
+
const pos = React53.useState(null), mounted = useMounted();
|
|
5963
6241
|
function trigger() {
|
|
5964
6242
|
return wrap.current && (wrap.current.querySelector('button, [role="button"], a, input') || wrap.current.firstElementChild);
|
|
5965
6243
|
}
|
|
@@ -5986,7 +6264,7 @@ window.Aura = (() => {
|
|
|
5986
6264
|
},
|
|
5987
6265
|
[open, mounted, props.placement]
|
|
5988
6266
|
);
|
|
5989
|
-
|
|
6267
|
+
React53.useEffect(
|
|
5990
6268
|
function() {
|
|
5991
6269
|
if (!open || !mounted) return;
|
|
5992
6270
|
if (props.autoFocus !== false && pop.current) {
|
|
@@ -6005,9 +6283,9 @@ window.Aura = (() => {
|
|
|
6005
6283
|
},
|
|
6006
6284
|
[open, mounted]
|
|
6007
6285
|
);
|
|
6008
|
-
const child =
|
|
6009
|
-
const panel = open && mounted ? (0,
|
|
6010
|
-
/* @__PURE__ */
|
|
6286
|
+
const child = React53.Children.only(props.trigger);
|
|
6287
|
+
const panel = open && mounted ? (0, import_react_dom11.createPortal)(
|
|
6288
|
+
/* @__PURE__ */ React53.createElement(
|
|
6011
6289
|
"div",
|
|
6012
6290
|
{
|
|
6013
6291
|
ref: popMerged,
|
|
@@ -6030,7 +6308,7 @@ window.Aura = (() => {
|
|
|
6030
6308
|
} else trapTab(e, pop.current);
|
|
6031
6309
|
}
|
|
6032
6310
|
},
|
|
6033
|
-
props.title ? /* @__PURE__ */
|
|
6311
|
+
props.title ? /* @__PURE__ */ React53.createElement("div", { className: "aura-popover__head" }, /* @__PURE__ */ React53.createElement("p", { className: "aura-popover__title", id: id + "-title" }, props.title), /* @__PURE__ */ React53.createElement(
|
|
6034
6312
|
IconButton,
|
|
6035
6313
|
{
|
|
6036
6314
|
icon: "x",
|
|
@@ -6040,7 +6318,7 @@ window.Aura = (() => {
|
|
|
6040
6318
|
}
|
|
6041
6319
|
}
|
|
6042
6320
|
)) : null,
|
|
6043
|
-
/* @__PURE__ */
|
|
6321
|
+
/* @__PURE__ */ React53.createElement("div", { className: "aura-popover__body" }, typeof props.children === "function" ? props.children({
|
|
6044
6322
|
close: function() {
|
|
6045
6323
|
close(true);
|
|
6046
6324
|
}
|
|
@@ -6048,7 +6326,7 @@ window.Aura = (() => {
|
|
|
6048
6326
|
),
|
|
6049
6327
|
document.body
|
|
6050
6328
|
) : null;
|
|
6051
|
-
return /* @__PURE__ */
|
|
6329
|
+
return /* @__PURE__ */ React53.createElement("span", { ref: wrap, className: "aura-popover-anchor" }, React53.cloneElement(child, {
|
|
6052
6330
|
onClick: function(e) {
|
|
6053
6331
|
if (child.props.onClick) child.props.onClick(e);
|
|
6054
6332
|
st[1](!open);
|
|
@@ -6060,7 +6338,7 @@ window.Aura = (() => {
|
|
|
6060
6338
|
});
|
|
6061
6339
|
|
|
6062
6340
|
// src/NumberField.tsx
|
|
6063
|
-
var
|
|
6341
|
+
var React54 = __toESM(require_react(), 1);
|
|
6064
6342
|
function decimalsOf(n2) {
|
|
6065
6343
|
const s = String(n2);
|
|
6066
6344
|
const i = s.indexOf(".");
|
|
@@ -6071,7 +6349,7 @@ window.Aura = (() => {
|
|
|
6071
6349
|
if (!/^-?(\d+\.?\d*|\.\d+)$/.test(s)) return NaN;
|
|
6072
6350
|
return Number(s);
|
|
6073
6351
|
}
|
|
6074
|
-
var NumberField =
|
|
6352
|
+
var NumberField = React54.forwardRef(function NumberField2(props, ref) {
|
|
6075
6353
|
const t = useStrings();
|
|
6076
6354
|
const auto = uid(), id = props.id || auto;
|
|
6077
6355
|
const step = props.step || 1;
|
|
@@ -6082,7 +6360,7 @@ window.Aura = (() => {
|
|
|
6082
6360
|
props.onChange
|
|
6083
6361
|
);
|
|
6084
6362
|
const value = st[0], setValue = st[1];
|
|
6085
|
-
const draftState =
|
|
6363
|
+
const draftState = React54.useState(null), draft = draftState[0], setDraft = draftState[1];
|
|
6086
6364
|
function fmt2(n2) {
|
|
6087
6365
|
if (n2 == null || isNaN(n2)) return "";
|
|
6088
6366
|
return n2.toLocaleString("en", { minimumFractionDigits: decimals, maximumFractionDigits: decimals });
|
|
@@ -6131,7 +6409,7 @@ window.Aura = (() => {
|
|
|
6131
6409
|
};
|
|
6132
6410
|
const valueText = value == null ? void 0 : [affixText(props.prefix), fmt2(value), affixText(props.suffix)].join(" ").trim();
|
|
6133
6411
|
const stepper = props.stepper !== false && !props.readOnly;
|
|
6134
|
-
return /* @__PURE__ */
|
|
6412
|
+
return /* @__PURE__ */ React54.createElement(
|
|
6135
6413
|
Field,
|
|
6136
6414
|
{
|
|
6137
6415
|
id,
|
|
@@ -6143,7 +6421,7 @@ window.Aura = (() => {
|
|
|
6143
6421
|
disabled: props.disabled,
|
|
6144
6422
|
className: props.className
|
|
6145
6423
|
},
|
|
6146
|
-
/* @__PURE__ */
|
|
6424
|
+
/* @__PURE__ */ React54.createElement("div", { className: cx("aura-input aura-number", stepper && "has-stepper") }, props.prefix != null ? /* @__PURE__ */ React54.createElement("span", { className: "aura-number__affix", "aria-hidden": true }, props.prefix) : null, /* @__PURE__ */ React54.createElement(
|
|
6147
6425
|
"input",
|
|
6148
6426
|
{
|
|
6149
6427
|
ref,
|
|
@@ -6190,7 +6468,7 @@ window.Aura = (() => {
|
|
|
6190
6468
|
},
|
|
6191
6469
|
onKeyDown
|
|
6192
6470
|
}
|
|
6193
|
-
), props.suffix != null ? /* @__PURE__ */
|
|
6471
|
+
), props.suffix != null ? /* @__PURE__ */ React54.createElement("span", { className: "aura-number__affix", "aria-hidden": true }, props.suffix) : null, stepper ? /* @__PURE__ */ React54.createElement("span", { className: "aura-number__steps" }, /* @__PURE__ */ React54.createElement(
|
|
6194
6472
|
"button",
|
|
6195
6473
|
{
|
|
6196
6474
|
type: "button",
|
|
@@ -6206,8 +6484,8 @@ window.Aura = (() => {
|
|
|
6206
6484
|
nudge(-step);
|
|
6207
6485
|
}
|
|
6208
6486
|
},
|
|
6209
|
-
/* @__PURE__ */
|
|
6210
|
-
), /* @__PURE__ */
|
|
6487
|
+
/* @__PURE__ */ React54.createElement(Icon, { name: "minus" })
|
|
6488
|
+
), /* @__PURE__ */ React54.createElement(
|
|
6211
6489
|
"button",
|
|
6212
6490
|
{
|
|
6213
6491
|
type: "button",
|
|
@@ -6223,14 +6501,14 @@ window.Aura = (() => {
|
|
|
6223
6501
|
nudge(step);
|
|
6224
6502
|
}
|
|
6225
6503
|
},
|
|
6226
|
-
/* @__PURE__ */
|
|
6504
|
+
/* @__PURE__ */ React54.createElement(Icon, { name: "plus" })
|
|
6227
6505
|
)) : null)
|
|
6228
6506
|
);
|
|
6229
6507
|
});
|
|
6230
6508
|
|
|
6231
6509
|
// src/Stepper.tsx
|
|
6232
|
-
var
|
|
6233
|
-
var Stepper =
|
|
6510
|
+
var React55 = __toESM(require_react(), 1);
|
|
6511
|
+
var Stepper = React55.forwardRef(function Stepper2(props, ref) {
|
|
6234
6512
|
const t = useStrings();
|
|
6235
6513
|
const steps = props.steps || [];
|
|
6236
6514
|
let at = -1;
|
|
@@ -6240,26 +6518,26 @@ window.Aura = (() => {
|
|
|
6240
6518
|
if (at < 0) at = 0;
|
|
6241
6519
|
const vertical = props.orientation === "vertical";
|
|
6242
6520
|
const cur = steps[at];
|
|
6243
|
-
return /* @__PURE__ */
|
|
6521
|
+
return /* @__PURE__ */ React55.createElement(
|
|
6244
6522
|
"nav",
|
|
6245
6523
|
{
|
|
6246
6524
|
ref,
|
|
6247
6525
|
"aria-label": props.label,
|
|
6248
6526
|
className: cx("aura-stepper", vertical ? "aura-stepper--vertical" : "aura-stepper--horizontal", props.className)
|
|
6249
6527
|
},
|
|
6250
|
-
/* @__PURE__ */
|
|
6528
|
+
/* @__PURE__ */ React55.createElement("ol", { className: "aura-stepper__list" }, steps.map(function(s, i) {
|
|
6251
6529
|
const state = i < at ? "done" : i === at ? "current" : "upcoming";
|
|
6252
|
-
const marker = /* @__PURE__ */
|
|
6253
|
-
const text = /* @__PURE__ */
|
|
6530
|
+
const marker = /* @__PURE__ */ React55.createElement("span", { className: "aura-stepper__marker", "aria-hidden": true }, state === "done" ? /* @__PURE__ */ React55.createElement(Icon, { name: "check" }) : i + 1);
|
|
6531
|
+
const text = /* @__PURE__ */ React55.createElement("span", { className: "aura-stepper__text" }, /* @__PURE__ */ React55.createElement("span", { className: "aura-stepper__label" }, s.label, state === "done" ? /* @__PURE__ */ React55.createElement("span", { className: "aura-sr-only" }, ", " + t.stepDone) : null), s.description ? /* @__PURE__ */ React55.createElement("span", { className: "aura-stepper__desc" }, s.description) : null);
|
|
6254
6532
|
const clickable = state === "done" && !!props.onStepClick;
|
|
6255
|
-
return /* @__PURE__ */
|
|
6533
|
+
return /* @__PURE__ */ React55.createElement(
|
|
6256
6534
|
"li",
|
|
6257
6535
|
{
|
|
6258
6536
|
key: s.id,
|
|
6259
6537
|
className: cx("aura-stepper__item", "is-" + state),
|
|
6260
6538
|
"aria-current": state === "current" ? "step" : void 0
|
|
6261
6539
|
},
|
|
6262
|
-
clickable ? /* @__PURE__ */
|
|
6540
|
+
clickable ? /* @__PURE__ */ React55.createElement(
|
|
6263
6541
|
"button",
|
|
6264
6542
|
{
|
|
6265
6543
|
type: "button",
|
|
@@ -6270,19 +6548,19 @@ window.Aura = (() => {
|
|
|
6270
6548
|
},
|
|
6271
6549
|
marker,
|
|
6272
6550
|
text
|
|
6273
|
-
) : /* @__PURE__ */
|
|
6551
|
+
) : /* @__PURE__ */ React55.createElement("span", { className: "aura-stepper__step" }, marker, text)
|
|
6274
6552
|
);
|
|
6275
6553
|
})),
|
|
6276
|
-
!vertical && cur ? /* @__PURE__ */
|
|
6554
|
+
!vertical && cur ? /* @__PURE__ */ React55.createElement("p", { className: "aura-stepper__compact", "aria-hidden": true }, /* @__PURE__ */ React55.createElement("span", { className: "aura-stepper__count" }, t.stepOf(at + 1, steps.length)), /* @__PURE__ */ React55.createElement("span", { className: "aura-stepper__compact-label" }, cur.label)) : null
|
|
6277
6555
|
);
|
|
6278
6556
|
});
|
|
6279
6557
|
|
|
6280
6558
|
// src/SegmentedControl.tsx
|
|
6281
|
-
var
|
|
6559
|
+
var React56 = __toESM(require_react(), 1);
|
|
6282
6560
|
function toOpt2(o) {
|
|
6283
6561
|
return typeof o === "object" ? o : { value: o, label: o };
|
|
6284
6562
|
}
|
|
6285
|
-
var SegmentedControl =
|
|
6563
|
+
var SegmentedControl = React56.forwardRef(
|
|
6286
6564
|
function SegmentedControl2(props, ref) {
|
|
6287
6565
|
const options = (props.options || []).map(toOpt2);
|
|
6288
6566
|
const firstEnabled = options.filter(function(o) {
|
|
@@ -6295,7 +6573,7 @@ window.Aura = (() => {
|
|
|
6295
6573
|
);
|
|
6296
6574
|
const value = st[0], setValue = st[1];
|
|
6297
6575
|
const auto = uid(), id = props.id || auto;
|
|
6298
|
-
const refs =
|
|
6576
|
+
const refs = React56.useRef([]);
|
|
6299
6577
|
const selIdx = options.findIndex(function(o) {
|
|
6300
6578
|
return o.value === value;
|
|
6301
6579
|
});
|
|
@@ -6328,7 +6606,7 @@ window.Aura = (() => {
|
|
|
6328
6606
|
move(options.length, -1);
|
|
6329
6607
|
}
|
|
6330
6608
|
}
|
|
6331
|
-
return /* @__PURE__ */
|
|
6609
|
+
return /* @__PURE__ */ React56.createElement(
|
|
6332
6610
|
"div",
|
|
6333
6611
|
{
|
|
6334
6612
|
ref,
|
|
@@ -6347,7 +6625,7 @@ window.Aura = (() => {
|
|
|
6347
6625
|
options.map(function(o, i) {
|
|
6348
6626
|
const on = o.value === value;
|
|
6349
6627
|
const off = props.disabled || o.disabled;
|
|
6350
|
-
return /* @__PURE__ */
|
|
6628
|
+
return /* @__PURE__ */ React56.createElement(
|
|
6351
6629
|
"button",
|
|
6352
6630
|
{
|
|
6353
6631
|
key: o.value,
|
|
@@ -6369,8 +6647,8 @@ window.Aura = (() => {
|
|
|
6369
6647
|
onKeyDown(e, i);
|
|
6370
6648
|
}
|
|
6371
6649
|
},
|
|
6372
|
-
o.icon ? /* @__PURE__ */
|
|
6373
|
-
o.iconOnly ? null : /* @__PURE__ */
|
|
6650
|
+
o.icon ? /* @__PURE__ */ React56.createElement(Icon, { name: o.icon }) : null,
|
|
6651
|
+
o.iconOnly ? null : /* @__PURE__ */ React56.createElement("span", null, o.label)
|
|
6374
6652
|
);
|
|
6375
6653
|
})
|
|
6376
6654
|
);
|