@jirawatpyk/aura-react 5.7.2 → 5.8.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 +17 -0
- package/dist/aura.bundle.js +1003 -824
- package/dist/cjs/index.cjs +1003 -824
- package/dist/esm/Alert.js +5 -18
- package/dist/esm/Badge.js +2 -19
- package/dist/esm/Button.js +15 -16
- package/dist/esm/Card.js +2 -19
- package/dist/esm/EmptyState.js +2 -15
- package/dist/esm/FormErrorSummary.js +40 -4
- package/dist/esm/Icon.js +1 -1
- package/dist/esm/StatusPill.js +4 -14
- package/dist/esm/Table.js +104 -11
- package/dist/esm/classes.js +20 -0
- package/dist/esm/display.js +145 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/internal.js +1 -14
- package/dist/index.d.cts +29 -5
- package/dist/index.d.ts +29 -5
- package/dist/server/index.cjs +217 -5
- package/dist/server/index.d.cts +117 -0
- package/dist/server/index.d.ts +117 -0
- package/dist/server/index.js +207 -5
- package/dist/styles.css +34 -0
- package/dist/styles.layer.css +34 -0
- package/package.json +1 -1
package/dist/aura.bundle.js
CHANGED
|
@@ -119,6 +119,7 @@ window.Aura = (() => {
|
|
|
119
119
|
Tr: () => Tr,
|
|
120
120
|
brandScale: () => scale,
|
|
121
121
|
breakpoints: () => breakpoints,
|
|
122
|
+
buttonClass: () => buttonClass,
|
|
122
123
|
colorSchemeScript: () => colorSchemeScript,
|
|
123
124
|
comboboxFilter: () => defaultFilter,
|
|
124
125
|
contrast: () => contrast,
|
|
@@ -140,10 +141,9 @@ window.Aura = (() => {
|
|
|
140
141
|
});
|
|
141
142
|
|
|
142
143
|
// src/Icon.tsx
|
|
143
|
-
var React2 = __toESM(require_react(), 1);
|
|
144
|
-
|
|
145
|
-
// src/internal.tsx
|
|
146
144
|
var React = __toESM(require_react(), 1);
|
|
145
|
+
|
|
146
|
+
// src/classes.ts
|
|
147
147
|
function cx() {
|
|
148
148
|
return Array.prototype.filter.call(arguments, Boolean).join(" ");
|
|
149
149
|
}
|
|
@@ -154,18 +154,73 @@ window.Aura = (() => {
|
|
|
154
154
|
out[k] = src[k];
|
|
155
155
|
return out;
|
|
156
156
|
}
|
|
157
|
+
var TONES = ["neutral", "accent", "success", "warning", "danger"];
|
|
158
|
+
function tone(t) {
|
|
159
|
+
return TONES.indexOf(t) >= 0 ? t : "neutral";
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// src/Icon.tsx
|
|
163
|
+
var h = React.createElement;
|
|
164
|
+
var ICONS = { "check": [["path", { "d": "M20 6 9 17l-5-5" }]], "x": [["path", { "d": "M18 6 6 18" }], ["path", { "d": "m6 6 12 12" }]], "plus": [["path", { "d": "M5 12h14" }], ["path", { "d": "M12 5v14" }]], "minus": [["path", { "d": "M5 12h14" }]], "search": [["path", { "d": "m21 21-4.34-4.34" }], ["circle", { "cx": "11", "cy": "11", "r": "8" }]], "chevron-down": [["path", { "d": "m6 9 6 6 6-6" }]], "chevron-up": [["path", { "d": "m18 15-6-6-6 6" }]], "chevron-left": [["path", { "d": "m15 18-6-6 6-6" }]], "chevron-right": [["path", { "d": "m9 18 6-6-6-6" }]], "arrow-right": [["path", { "d": "M5 12h14" }], ["path", { "d": "m12 5 7 7-7 7" }]], "arrow-up-right": [["path", { "d": "M7 7h10v10" }], ["path", { "d": "M7 17 17 7" }]], "arrow-up-down": [["path", { "d": "m21 16-4 4-4-4" }], ["path", { "d": "M17 20V4" }], ["path", { "d": "m3 8 4-4 4 4" }], ["path", { "d": "M7 4v16" }]], "loader-circle": [["path", { "d": "M21 12a9 9 0 1 1-6.219-8.56" }]], "circle-alert": [["circle", { "cx": "12", "cy": "12", "r": "10" }], ["line", { "x1": "12", "x2": "12", "y1": "8", "y2": "12" }], ["line", { "x1": "12", "x2": "12.01", "y1": "16", "y2": "16" }]], "circle-check": [["circle", { "cx": "12", "cy": "12", "r": "10" }], ["path", { "d": "m16 9-5.5 5.5L8 12" }]], "info": [["circle", { "cx": "12", "cy": "12", "r": "10" }], ["path", { "d": "M12 16v-4" }], ["path", { "d": "M12 8h.01" }]], "triangle-alert": [["path", { "d": "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" }], ["path", { "d": "M12 9v4" }], ["path", { "d": "M12 17h.01" }]], "settings": [["path", { "d": "M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915" }], ["circle", { "cx": "12", "cy": "12", "r": "3" }]], "user": [["path", { "d": "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" }], ["circle", { "cx": "12", "cy": "7", "r": "4" }]], "users": [["path", { "d": "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" }], ["path", { "d": "M16 3.128a4 4 0 0 1 0 7.744" }], ["path", { "d": "M22 21v-2a4 4 0 0 0-3-3.87" }], ["circle", { "cx": "9", "cy": "7", "r": "4" }]], "filter": [["path", { "d": "M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z" }]], "ellipsis": [["circle", { "cx": "12", "cy": "12", "r": "1" }], ["circle", { "cx": "19", "cy": "12", "r": "1" }], ["circle", { "cx": "5", "cy": "12", "r": "1" }]], "external-link": [["path", { "d": "M15 3h6v6" }], ["path", { "d": "M10 14 21 3" }], ["path", { "d": "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }]], "copy": [["rect", { "width": "14", "height": "14", "x": "8", "y": "8", "rx": "2", "ry": "2" }], ["path", { "d": "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" }]], "trash-2": [["path", { "d": "M10 11v6" }], ["path", { "d": "M14 11v6" }], ["path", { "d": "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" }], ["path", { "d": "M3 6h18" }], ["path", { "d": "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" }]], "pencil": [["path", { "d": "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z" }], ["path", { "d": "m15 5 4 4" }]], "download": [["path", { "d": "M12 15V3" }], ["path", { "d": "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }], ["path", { "d": "m7 10 5 5 5-5" }]], "upload": [["path", { "d": "M12 3v12" }], ["path", { "d": "m17 8-5-5-5 5" }], ["path", { "d": "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }]], "calendar": [["path", { "d": "M8 2v3" }], ["path", { "d": "M16 2v3" }], ["rect", { "x": "3", "y": "3", "width": "18", "height": "18", "rx": "2" }], ["path", { "d": "M3 9h18" }]], "bell": [["path", { "d": "M10.268 21a2 2 0 0 0 3.464 0" }], ["path", { "d": "M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326" }]], "menu": [["path", { "d": "M4 5h16" }], ["path", { "d": "M4 12h16" }], ["path", { "d": "M4 19h16" }]], "eye": [["path", { "d": "M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0" }], ["circle", { "cx": "12", "cy": "12", "r": "3" }]], "log-out": [["path", { "d": "m16 17 5-5-5-5" }], ["path", { "d": "M21 12H9" }], ["path", { "d": "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" }]], "circle": [["circle", { "cx": "12", "cy": "12", "r": "10" }]], "circle-dot-dashed": [["path", { "d": "M10.1 2.18a9.93 9.93 0 0 1 3.8 0" }], ["path", { "d": "M17.6 3.71a9.95 9.95 0 0 1 2.69 2.7" }], ["path", { "d": "M21.82 10.1a9.93 9.93 0 0 1 0 3.8" }], ["path", { "d": "M20.29 17.6a9.95 9.95 0 0 1-2.7 2.69" }], ["path", { "d": "M13.9 21.82a9.94 9.94 0 0 1-3.8 0" }], ["path", { "d": "M6.4 20.29a9.95 9.95 0 0 1-2.69-2.7" }], ["path", { "d": "M2.18 13.9a9.93 9.93 0 0 1 0-3.8" }], ["path", { "d": "M3.71 6.4a9.95 9.95 0 0 1 2.7-2.69" }], ["circle", { "cx": "12", "cy": "12", "r": "1" }]], "ban": [["circle", { "cx": "12", "cy": "12", "r": "10" }], ["path", { "d": "M4.929 4.929 19.07 19.071" }]], "arrow-up": [["path", { "d": "m5 12 7-7 7 7" }], ["path", { "d": "M12 19V5" }]], "arrow-down": [["path", { "d": "M12 5v14" }], ["path", { "d": "m19 12-7 7-7-7" }]], "inbox": [["polyline", { "points": "22 12 16 12 14 15 10 15 8 12 2 12" }], ["path", { "d": "M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z" }]], "pin": [["path", { "d": "M12 17v5" }], ["path", { "d": "M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z" }]], "pin-off": [["path", { "d": "M12 17v5" }], ["path", { "d": "M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89" }], ["path", { "d": "m2 2 20 20" }], ["path", { "d": "M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11" }]], "eye-off": [["path", { "d": "M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49" }], ["path", { "d": "M14.084 14.158a3 3 0 0 1-4.242-4.242" }], ["path", { "d": "M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143" }], ["path", { "d": "m2 2 20 20" }]], "columns-3": [["rect", { "width": "18", "height": "18", "x": "3", "y": "3", "rx": "2" }], ["path", { "d": "M9 3v18" }], ["path", { "d": "M15 3v18" }]], "arrow-left": [["path", { "d": "m12 19-7-7 7-7" }], ["path", { "d": "M19 12H5" }]], "rotate-ccw": [["path", { "d": "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }], ["path", { "d": "M3 3v5h5" }]], "house": [["path", { "d": "M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8" }], ["path", { "d": "M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" }]], "layout-dashboard": [["rect", { "width": "7", "height": "9", "x": "3", "y": "3", "rx": "1" }], ["rect", { "width": "7", "height": "5", "x": "14", "y": "3", "rx": "1" }], ["rect", { "width": "7", "height": "9", "x": "14", "y": "12", "rx": "1" }], ["rect", { "width": "7", "height": "5", "x": "3", "y": "16", "rx": "1" }]], "folder": [["path", { "d": "M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z" }]], "chart-column": [["path", { "d": "M3 3v16a2 2 0 0 0 2 2h16" }], ["path", { "d": "M18 17V9" }], ["path", { "d": "M13 17V5" }], ["path", { "d": "M8 17v-3" }]], "file-text": [["path", { "d": "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" }], ["path", { "d": "M14 2v5a1 1 0 0 0 1 1h5" }], ["path", { "d": "M10 9H8" }], ["path", { "d": "M16 13H8" }], ["path", { "d": "M16 17H8" }]], "mail": [["path", { "d": "m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7" }], ["rect", { "x": "2", "y": "4", "width": "20", "height": "16", "rx": "2" }]], "lock": [["rect", { "width": "18", "height": "11", "x": "3", "y": "11", "rx": "2", "ry": "2" }], ["path", { "d": "M7 11V7a5 5 0 0 1 10 0v4" }]], "clock": [["circle", { "cx": "12", "cy": "12", "r": "10" }], ["path", { "d": "M12 6v6l4 2" }]], "trending-up": [["path", { "d": "M16 7h6v6" }], ["path", { "d": "m22 7-8.5 8.5-5-5L2 17" }]], "trending-down": [["path", { "d": "M16 17h6v-6" }], ["path", { "d": "m22 17-8.5-8.5-5 5L2 7" }]], "image": [["rect", { "width": "18", "height": "18", "x": "3", "y": "3", "rx": "2", "ry": "2" }], ["circle", { "cx": "9", "cy": "9", "r": "2" }], ["path", { "d": "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" }]], "paperclip": [["path", { "d": "m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551" }]], "cloud-upload": [["path", { "d": "M12 13v8" }], ["path", { "d": "M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242" }], ["path", { "d": "m8 17 4-4 4 4" }]], "file": [["path", { "d": "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" }], ["path", { "d": "M14 2v5a1 1 0 0 0 1 1h5" }]], "sun": [["circle", { "cx": "12", "cy": "12", "r": "4" }], ["path", { "d": "M12 2v2" }], ["path", { "d": "M12 20v2" }], ["path", { "d": "m4.93 4.93 1.41 1.41" }], ["path", { "d": "m17.66 17.66 1.41 1.41" }], ["path", { "d": "M2 12h2" }], ["path", { "d": "M20 12h2" }], ["path", { "d": "m6.34 17.66-1.41 1.41" }], ["path", { "d": "m19.07 4.93-1.41 1.41" }]], "moon": [["path", { "d": "M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401" }]], "monitor": [["rect", { "width": "20", "height": "14", "x": "2", "y": "3", "rx": "2" }], ["line", { "x1": "8", "x2": "16", "y1": "21", "y2": "21" }], ["line", { "x1": "12", "x2": "12", "y1": "17", "y2": "21" }]], "panel-left-close": [["rect", { "width": "18", "height": "18", "x": "3", "y": "3", "rx": "2" }], ["path", { "d": "M9 3v18" }], ["path", { "d": "m16 15-3-3 3-3" }]], "panel-left-open": [["rect", { "width": "18", "height": "18", "x": "3", "y": "3", "rx": "2" }], ["path", { "d": "M9 3v18" }], ["path", { "d": "m14 9 3 3-3 3" }]], "server": [["rect", { "width": "20", "height": "8", "x": "2", "y": "2", "rx": "2", "ry": "2" }], ["rect", { "width": "20", "height": "8", "x": "2", "y": "14", "rx": "2", "ry": "2" }], ["line", { "x1": "6", "x2": "6.01", "y1": "6", "y2": "6" }], ["line", { "x1": "6", "x2": "6.01", "y1": "18", "y2": "18" }]], "globe": [["circle", { "cx": "12", "cy": "12", "r": "10" }], ["path", { "d": "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20" }], ["path", { "d": "M2 12h20" }]], "activity": [["path", { "d": "M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2" }]], "shield-alert": [["path", { "d": "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z" }], ["path", { "d": "M12 8v4" }], ["path", { "d": "M12 16h.01" }]], "phone": [["path", { "d": "M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384" }]], "wrench": [["path", { "d": "M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z" }]] };
|
|
165
|
+
var SIZES = { sm: 16, md: 20, lg: 24 };
|
|
166
|
+
var Icon = React.forwardRef(function Icon2(props, ref) {
|
|
167
|
+
const size = SIZES[props.size] || props.size || 16;
|
|
168
|
+
if (React.isValidElement(props.name)) {
|
|
169
|
+
return /* @__PURE__ */ React.createElement(
|
|
170
|
+
"span",
|
|
171
|
+
{
|
|
172
|
+
className: cx("aura-icon", "aura-icon--custom", props.className),
|
|
173
|
+
style: { width: size, height: size, ["--aura-icon-stroke"]: props.strokeWidth || 2 },
|
|
174
|
+
...props.label ? { role: "img", "aria-label": props.label } : { "aria-hidden": true }
|
|
175
|
+
},
|
|
176
|
+
props.name
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
const shapes = ICONS[props.name];
|
|
180
|
+
if (!shapes) return null;
|
|
181
|
+
const a11y = props.label ? { role: "img", "aria-label": props.label } : { "aria-hidden": true, focusable: "false" };
|
|
182
|
+
return /* @__PURE__ */ React.createElement(
|
|
183
|
+
"svg",
|
|
184
|
+
{
|
|
185
|
+
ref,
|
|
186
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
187
|
+
width: size,
|
|
188
|
+
height: size,
|
|
189
|
+
viewBox: "0 0 24 24",
|
|
190
|
+
fill: "none",
|
|
191
|
+
stroke: "currentColor",
|
|
192
|
+
strokeWidth: props.strokeWidth || 2,
|
|
193
|
+
strokeLinecap: "round",
|
|
194
|
+
strokeLinejoin: "round",
|
|
195
|
+
className: cx("aura-icon", props.className),
|
|
196
|
+
...a11y
|
|
197
|
+
},
|
|
198
|
+
shapes.map(function(s, i) {
|
|
199
|
+
const attrs = { key: i };
|
|
200
|
+
for (const k in s[1]) attrs[k === "stroke-width" ? "strokeWidth" : k] = s[1][k];
|
|
201
|
+
return h(s[0], attrs);
|
|
202
|
+
})
|
|
203
|
+
);
|
|
204
|
+
});
|
|
205
|
+
var iconNames = Object.keys(ICONS);
|
|
206
|
+
|
|
207
|
+
// src/Button.tsx
|
|
208
|
+
var React5 = __toESM(require_react(), 1);
|
|
209
|
+
|
|
210
|
+
// src/internal.tsx
|
|
211
|
+
var React2 = __toESM(require_react(), 1);
|
|
157
212
|
function useMaybeControlled(value, initial, onChange) {
|
|
158
|
-
const s =
|
|
159
|
-
const wasSet =
|
|
213
|
+
const s = React2.useState(initial);
|
|
214
|
+
const wasSet = React2.useState(value !== void 0);
|
|
160
215
|
if (value !== void 0 && !wasSet[0]) wasSet[1](true);
|
|
161
216
|
else if (value === void 0 && wasSet[0]) {
|
|
162
217
|
wasSet[1](false);
|
|
163
218
|
s[1](initial);
|
|
164
219
|
}
|
|
165
220
|
const controlled = value !== void 0;
|
|
166
|
-
const latest =
|
|
221
|
+
const latest = React2.useRef({ controlled, onChange, set: s[1] });
|
|
167
222
|
latest.current = { controlled, onChange, set: s[1] };
|
|
168
|
-
const set =
|
|
223
|
+
const set = React2.useCallback(function(next) {
|
|
169
224
|
const l = latest.current;
|
|
170
225
|
if (!l.controlled) l.set(next);
|
|
171
226
|
if (l.onChange) l.onChange(next);
|
|
@@ -180,8 +235,8 @@ window.Aura = (() => {
|
|
|
180
235
|
if (typeof a === "number" && typeof b === "number") return a - b;
|
|
181
236
|
return collator ? collator.compare(String(a), String(b)) : String(a).localeCompare(String(b));
|
|
182
237
|
}
|
|
183
|
-
var uid =
|
|
184
|
-
const r =
|
|
238
|
+
var uid = React2.useId || function() {
|
|
239
|
+
const r = React2.useRef(null);
|
|
185
240
|
if (!r.current) r.current = "aura-" + Math.random().toString(36).slice(2, 9);
|
|
186
241
|
return r.current;
|
|
187
242
|
};
|
|
@@ -197,9 +252,9 @@ window.Aura = (() => {
|
|
|
197
252
|
return false;
|
|
198
253
|
}
|
|
199
254
|
function useMounted() {
|
|
200
|
-
return
|
|
255
|
+
return React2.useSyncExternalStore(noopSubscribe, yes, no);
|
|
201
256
|
}
|
|
202
|
-
var useIsoLayoutEffect = typeof window !== "undefined" ?
|
|
257
|
+
var useIsoLayoutEffect = typeof window !== "undefined" ? React2.useLayoutEffect : React2.useEffect;
|
|
203
258
|
function trapTab(e, container) {
|
|
204
259
|
if (e.key !== "Tab" || !container) return;
|
|
205
260
|
const list = Array.prototype.filter.call(
|
|
@@ -219,7 +274,7 @@ window.Aura = (() => {
|
|
|
219
274
|
}
|
|
220
275
|
}
|
|
221
276
|
function useMergedRef(a, b) {
|
|
222
|
-
return
|
|
277
|
+
return React2.useCallback(
|
|
223
278
|
function(node) {
|
|
224
279
|
[a, b].forEach(function(r) {
|
|
225
280
|
if (!r) return;
|
|
@@ -230,10 +285,6 @@ window.Aura = (() => {
|
|
|
230
285
|
[a, b]
|
|
231
286
|
);
|
|
232
287
|
}
|
|
233
|
-
var TONES = ["neutral", "accent", "success", "warning", "danger"];
|
|
234
|
-
function tone(t) {
|
|
235
|
-
return TONES.indexOf(t) >= 0 ? t : "neutral";
|
|
236
|
-
}
|
|
237
288
|
var warned = {};
|
|
238
289
|
function plainClick(e) {
|
|
239
290
|
return !e.defaultPrevented && e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey;
|
|
@@ -251,56 +302,138 @@ window.Aura = (() => {
|
|
|
251
302
|
console.warn("[AURA] " + message);
|
|
252
303
|
}
|
|
253
304
|
|
|
254
|
-
// src/
|
|
255
|
-
var
|
|
256
|
-
var ICONS = { "check": [["path", { "d": "M20 6 9 17l-5-5" }]], "x": [["path", { "d": "M18 6 6 18" }], ["path", { "d": "m6 6 12 12" }]], "plus": [["path", { "d": "M5 12h14" }], ["path", { "d": "M12 5v14" }]], "minus": [["path", { "d": "M5 12h14" }]], "search": [["path", { "d": "m21 21-4.34-4.34" }], ["circle", { "cx": "11", "cy": "11", "r": "8" }]], "chevron-down": [["path", { "d": "m6 9 6 6 6-6" }]], "chevron-up": [["path", { "d": "m18 15-6-6-6 6" }]], "chevron-left": [["path", { "d": "m15 18-6-6 6-6" }]], "chevron-right": [["path", { "d": "m9 18 6-6-6-6" }]], "arrow-right": [["path", { "d": "M5 12h14" }], ["path", { "d": "m12 5 7 7-7 7" }]], "arrow-up-right": [["path", { "d": "M7 7h10v10" }], ["path", { "d": "M7 17 17 7" }]], "arrow-up-down": [["path", { "d": "m21 16-4 4-4-4" }], ["path", { "d": "M17 20V4" }], ["path", { "d": "m3 8 4-4 4 4" }], ["path", { "d": "M7 4v16" }]], "loader-circle": [["path", { "d": "M21 12a9 9 0 1 1-6.219-8.56" }]], "circle-alert": [["circle", { "cx": "12", "cy": "12", "r": "10" }], ["line", { "x1": "12", "x2": "12", "y1": "8", "y2": "12" }], ["line", { "x1": "12", "x2": "12.01", "y1": "16", "y2": "16" }]], "circle-check": [["circle", { "cx": "12", "cy": "12", "r": "10" }], ["path", { "d": "m16 9-5.5 5.5L8 12" }]], "info": [["circle", { "cx": "12", "cy": "12", "r": "10" }], ["path", { "d": "M12 16v-4" }], ["path", { "d": "M12 8h.01" }]], "triangle-alert": [["path", { "d": "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" }], ["path", { "d": "M12 9v4" }], ["path", { "d": "M12 17h.01" }]], "settings": [["path", { "d": "M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915" }], ["circle", { "cx": "12", "cy": "12", "r": "3" }]], "user": [["path", { "d": "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" }], ["circle", { "cx": "12", "cy": "7", "r": "4" }]], "users": [["path", { "d": "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" }], ["path", { "d": "M16 3.128a4 4 0 0 1 0 7.744" }], ["path", { "d": "M22 21v-2a4 4 0 0 0-3-3.87" }], ["circle", { "cx": "9", "cy": "7", "r": "4" }]], "filter": [["path", { "d": "M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z" }]], "ellipsis": [["circle", { "cx": "12", "cy": "12", "r": "1" }], ["circle", { "cx": "19", "cy": "12", "r": "1" }], ["circle", { "cx": "5", "cy": "12", "r": "1" }]], "external-link": [["path", { "d": "M15 3h6v6" }], ["path", { "d": "M10 14 21 3" }], ["path", { "d": "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }]], "copy": [["rect", { "width": "14", "height": "14", "x": "8", "y": "8", "rx": "2", "ry": "2" }], ["path", { "d": "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" }]], "trash-2": [["path", { "d": "M10 11v6" }], ["path", { "d": "M14 11v6" }], ["path", { "d": "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" }], ["path", { "d": "M3 6h18" }], ["path", { "d": "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" }]], "pencil": [["path", { "d": "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z" }], ["path", { "d": "m15 5 4 4" }]], "download": [["path", { "d": "M12 15V3" }], ["path", { "d": "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }], ["path", { "d": "m7 10 5 5 5-5" }]], "upload": [["path", { "d": "M12 3v12" }], ["path", { "d": "m17 8-5-5-5 5" }], ["path", { "d": "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }]], "calendar": [["path", { "d": "M8 2v3" }], ["path", { "d": "M16 2v3" }], ["rect", { "x": "3", "y": "3", "width": "18", "height": "18", "rx": "2" }], ["path", { "d": "M3 9h18" }]], "bell": [["path", { "d": "M10.268 21a2 2 0 0 0 3.464 0" }], ["path", { "d": "M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326" }]], "menu": [["path", { "d": "M4 5h16" }], ["path", { "d": "M4 12h16" }], ["path", { "d": "M4 19h16" }]], "eye": [["path", { "d": "M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0" }], ["circle", { "cx": "12", "cy": "12", "r": "3" }]], "log-out": [["path", { "d": "m16 17 5-5-5-5" }], ["path", { "d": "M21 12H9" }], ["path", { "d": "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" }]], "circle": [["circle", { "cx": "12", "cy": "12", "r": "10" }]], "circle-dot-dashed": [["path", { "d": "M10.1 2.18a9.93 9.93 0 0 1 3.8 0" }], ["path", { "d": "M17.6 3.71a9.95 9.95 0 0 1 2.69 2.7" }], ["path", { "d": "M21.82 10.1a9.93 9.93 0 0 1 0 3.8" }], ["path", { "d": "M20.29 17.6a9.95 9.95 0 0 1-2.7 2.69" }], ["path", { "d": "M13.9 21.82a9.94 9.94 0 0 1-3.8 0" }], ["path", { "d": "M6.4 20.29a9.95 9.95 0 0 1-2.69-2.7" }], ["path", { "d": "M2.18 13.9a9.93 9.93 0 0 1 0-3.8" }], ["path", { "d": "M3.71 6.4a9.95 9.95 0 0 1 2.7-2.69" }], ["circle", { "cx": "12", "cy": "12", "r": "1" }]], "ban": [["circle", { "cx": "12", "cy": "12", "r": "10" }], ["path", { "d": "M4.929 4.929 19.07 19.071" }]], "arrow-up": [["path", { "d": "m5 12 7-7 7 7" }], ["path", { "d": "M12 19V5" }]], "arrow-down": [["path", { "d": "M12 5v14" }], ["path", { "d": "m19 12-7 7-7-7" }]], "inbox": [["polyline", { "points": "22 12 16 12 14 15 10 15 8 12 2 12" }], ["path", { "d": "M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z" }]], "pin": [["path", { "d": "M12 17v5" }], ["path", { "d": "M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z" }]], "pin-off": [["path", { "d": "M12 17v5" }], ["path", { "d": "M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89" }], ["path", { "d": "m2 2 20 20" }], ["path", { "d": "M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11" }]], "eye-off": [["path", { "d": "M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49" }], ["path", { "d": "M14.084 14.158a3 3 0 0 1-4.242-4.242" }], ["path", { "d": "M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143" }], ["path", { "d": "m2 2 20 20" }]], "columns-3": [["rect", { "width": "18", "height": "18", "x": "3", "y": "3", "rx": "2" }], ["path", { "d": "M9 3v18" }], ["path", { "d": "M15 3v18" }]], "arrow-left": [["path", { "d": "m12 19-7-7 7-7" }], ["path", { "d": "M19 12H5" }]], "rotate-ccw": [["path", { "d": "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }], ["path", { "d": "M3 3v5h5" }]], "house": [["path", { "d": "M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8" }], ["path", { "d": "M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" }]], "layout-dashboard": [["rect", { "width": "7", "height": "9", "x": "3", "y": "3", "rx": "1" }], ["rect", { "width": "7", "height": "5", "x": "14", "y": "3", "rx": "1" }], ["rect", { "width": "7", "height": "9", "x": "14", "y": "12", "rx": "1" }], ["rect", { "width": "7", "height": "5", "x": "3", "y": "16", "rx": "1" }]], "folder": [["path", { "d": "M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z" }]], "chart-column": [["path", { "d": "M3 3v16a2 2 0 0 0 2 2h16" }], ["path", { "d": "M18 17V9" }], ["path", { "d": "M13 17V5" }], ["path", { "d": "M8 17v-3" }]], "file-text": [["path", { "d": "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" }], ["path", { "d": "M14 2v5a1 1 0 0 0 1 1h5" }], ["path", { "d": "M10 9H8" }], ["path", { "d": "M16 13H8" }], ["path", { "d": "M16 17H8" }]], "mail": [["path", { "d": "m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7" }], ["rect", { "x": "2", "y": "4", "width": "20", "height": "16", "rx": "2" }]], "lock": [["rect", { "width": "18", "height": "11", "x": "3", "y": "11", "rx": "2", "ry": "2" }], ["path", { "d": "M7 11V7a5 5 0 0 1 10 0v4" }]], "clock": [["circle", { "cx": "12", "cy": "12", "r": "10" }], ["path", { "d": "M12 6v6l4 2" }]], "trending-up": [["path", { "d": "M16 7h6v6" }], ["path", { "d": "m22 7-8.5 8.5-5-5L2 17" }]], "trending-down": [["path", { "d": "M16 17h6v-6" }], ["path", { "d": "m22 17-8.5-8.5-5 5L2 7" }]], "image": [["rect", { "width": "18", "height": "18", "x": "3", "y": "3", "rx": "2", "ry": "2" }], ["circle", { "cx": "9", "cy": "9", "r": "2" }], ["path", { "d": "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" }]], "paperclip": [["path", { "d": "m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551" }]], "cloud-upload": [["path", { "d": "M12 13v8" }], ["path", { "d": "M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242" }], ["path", { "d": "m8 17 4-4 4 4" }]], "file": [["path", { "d": "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" }], ["path", { "d": "M14 2v5a1 1 0 0 0 1 1h5" }]], "sun": [["circle", { "cx": "12", "cy": "12", "r": "4" }], ["path", { "d": "M12 2v2" }], ["path", { "d": "M12 20v2" }], ["path", { "d": "m4.93 4.93 1.41 1.41" }], ["path", { "d": "m17.66 17.66 1.41 1.41" }], ["path", { "d": "M2 12h2" }], ["path", { "d": "M20 12h2" }], ["path", { "d": "m6.34 17.66-1.41 1.41" }], ["path", { "d": "m19.07 4.93-1.41 1.41" }]], "moon": [["path", { "d": "M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401" }]], "monitor": [["rect", { "width": "20", "height": "14", "x": "2", "y": "3", "rx": "2" }], ["line", { "x1": "8", "x2": "16", "y1": "21", "y2": "21" }], ["line", { "x1": "12", "x2": "12", "y1": "17", "y2": "21" }]], "panel-left-close": [["rect", { "width": "18", "height": "18", "x": "3", "y": "3", "rx": "2" }], ["path", { "d": "M9 3v18" }], ["path", { "d": "m16 15-3-3 3-3" }]], "panel-left-open": [["rect", { "width": "18", "height": "18", "x": "3", "y": "3", "rx": "2" }], ["path", { "d": "M9 3v18" }], ["path", { "d": "m14 9 3 3-3 3" }]], "server": [["rect", { "width": "20", "height": "8", "x": "2", "y": "2", "rx": "2", "ry": "2" }], ["rect", { "width": "20", "height": "8", "x": "2", "y": "14", "rx": "2", "ry": "2" }], ["line", { "x1": "6", "x2": "6.01", "y1": "6", "y2": "6" }], ["line", { "x1": "6", "x2": "6.01", "y1": "18", "y2": "18" }]], "globe": [["circle", { "cx": "12", "cy": "12", "r": "10" }], ["path", { "d": "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20" }], ["path", { "d": "M2 12h20" }]], "activity": [["path", { "d": "M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2" }]], "shield-alert": [["path", { "d": "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z" }], ["path", { "d": "M12 8v4" }], ["path", { "d": "M12 16h.01" }]], "phone": [["path", { "d": "M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384" }]], "wrench": [["path", { "d": "M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z" }]] };
|
|
257
|
-
|
|
258
|
-
var
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
305
|
+
// src/display.tsx
|
|
306
|
+
var React3 = __toESM(require_react(), 1);
|
|
307
|
+
|
|
308
|
+
// src/status.ts
|
|
309
|
+
var TONE_WORDS = {
|
|
310
|
+
ready: ["ready", "done", "complete", "completed", "approved", "live", "passed"],
|
|
311
|
+
progress: ["in progress", "in review", "review", "syncing", "running", "pending"],
|
|
312
|
+
warning: ["warning", "problem", "degraded", "at risk"],
|
|
313
|
+
blocked: ["blocked", "failed", "error", "rejected", "on hold", "cancelled"]
|
|
314
|
+
};
|
|
315
|
+
function toneFor(status) {
|
|
316
|
+
const s = String(status == null ? "" : status).trim().toLowerCase();
|
|
317
|
+
for (const t in TONE_WORDS) if (TONE_WORDS[t].indexOf(s) >= 0) return t;
|
|
318
|
+
return "neutral";
|
|
319
|
+
}
|
|
320
|
+
var TONE_ORDER = { neutral: 0, progress: 1, ready: 2, warning: 3, blocked: 4 };
|
|
321
|
+
|
|
322
|
+
// src/display.tsx
|
|
323
|
+
var h2 = React3.createElement;
|
|
324
|
+
var ALERT_ICON = {
|
|
325
|
+
info: "info",
|
|
326
|
+
success: "circle-check",
|
|
327
|
+
warning: "triangle-alert",
|
|
328
|
+
danger: "circle-alert"
|
|
329
|
+
};
|
|
330
|
+
function alertElement(props, ref, close) {
|
|
331
|
+
const tone2 = props.tone || "info";
|
|
332
|
+
const rest = omit(props, ["tone", "title", "children", "action", "onDismiss", "className", "role", "icon"]);
|
|
333
|
+
return /* @__PURE__ */ React3.createElement(
|
|
334
|
+
"div",
|
|
276
335
|
{
|
|
336
|
+
...rest,
|
|
277
337
|
ref,
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
height: size,
|
|
281
|
-
viewBox: "0 0 24 24",
|
|
282
|
-
fill: "none",
|
|
283
|
-
stroke: "currentColor",
|
|
284
|
-
strokeWidth: props.strokeWidth || 2,
|
|
285
|
-
strokeLinecap: "round",
|
|
286
|
-
strokeLinejoin: "round",
|
|
287
|
-
className: cx("aura-icon", props.className),
|
|
288
|
-
...a11y
|
|
338
|
+
className: cx("aura-alert", "aura-alert--" + tone2, props.className),
|
|
339
|
+
role: props.role || (tone2 === "danger" || tone2 === "warning" ? "alert" : "status")
|
|
289
340
|
},
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
return h(s[0], attrs);
|
|
294
|
-
})
|
|
341
|
+
/* @__PURE__ */ React3.createElement(Icon, { name: props.icon || ALERT_ICON[tone2], className: "aura-alert__icon" }),
|
|
342
|
+
/* @__PURE__ */ React3.createElement("div", { className: "aura-alert__body" }, props.title ? /* @__PURE__ */ React3.createElement("p", { className: "aura-alert__title" }, props.title) : null, props.children ? /* @__PURE__ */ React3.createElement("div", { className: "aura-alert__text" }, props.children) : null, props.action ? /* @__PURE__ */ React3.createElement("div", { className: "aura-alert__action" }, props.action) : null),
|
|
343
|
+
close
|
|
295
344
|
);
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
345
|
+
}
|
|
346
|
+
function cardElement(props, ref) {
|
|
347
|
+
const creative = props.variant === "creative";
|
|
348
|
+
const rest = omit(props, [
|
|
349
|
+
"title",
|
|
350
|
+
"description",
|
|
351
|
+
"actions",
|
|
352
|
+
"footer",
|
|
353
|
+
"children",
|
|
354
|
+
"variant",
|
|
355
|
+
"headingLevel",
|
|
356
|
+
"interactive",
|
|
357
|
+
"as",
|
|
358
|
+
"className",
|
|
359
|
+
"titleId"
|
|
360
|
+
]);
|
|
361
|
+
return h2(
|
|
362
|
+
props.as || "section",
|
|
363
|
+
Object.assign({}, rest, {
|
|
364
|
+
ref,
|
|
365
|
+
className: cx(
|
|
366
|
+
"aura-card",
|
|
367
|
+
creative && "aura-card--creative",
|
|
368
|
+
props.interactive && "is-interactive",
|
|
369
|
+
props.className
|
|
370
|
+
),
|
|
371
|
+
/* A titled card is labelled by its title; otherwise the caller's aria-labelledby stays (5.8). */
|
|
372
|
+
"aria-labelledby": props.title && props.titleId ? props.titleId : props["aria-labelledby"]
|
|
373
|
+
}),
|
|
374
|
+
props.title || props.actions ? /* @__PURE__ */ React3.createElement("div", { className: "aura-card__head" }, /* @__PURE__ */ React3.createElement("div", { className: "aura-card__heading" }, props.title ? h2("h" + (props.headingLevel || 3), { className: "aura-card__title", id: props.titleId }, props.title) : null, props.description ? /* @__PURE__ */ React3.createElement("p", { className: "aura-card__desc" }, props.description) : null), props.actions ? /* @__PURE__ */ React3.createElement("div", { className: "aura-card__actions" }, props.actions) : null) : null,
|
|
375
|
+
props.children ? /* @__PURE__ */ React3.createElement("div", { className: "aura-card__body" }, props.children) : null,
|
|
376
|
+
props.footer ? /* @__PURE__ */ React3.createElement("div", { className: "aura-card__foot" }, props.footer) : null
|
|
377
|
+
);
|
|
378
|
+
}
|
|
379
|
+
var PILL_ICON = {
|
|
380
|
+
neutral: "circle",
|
|
381
|
+
progress: "circle-dot-dashed",
|
|
382
|
+
ready: "circle-check",
|
|
383
|
+
warning: "triangle-alert",
|
|
384
|
+
blocked: "ban"
|
|
385
|
+
};
|
|
386
|
+
function statusPillElement(props, ref) {
|
|
387
|
+
const tone2 = props.tone || toneFor(props.children);
|
|
388
|
+
const rest = omit(props, ["tone", "className", "children"]);
|
|
389
|
+
return /* @__PURE__ */ React3.createElement("span", { ...rest, ref, className: cx("aura-pill", "aura-pill--" + tone2, props.className) }, /* @__PURE__ */ React3.createElement(Icon, { name: PILL_ICON[tone2] || "circle", size: 12 }), props.children);
|
|
390
|
+
}
|
|
391
|
+
function badgeElement(props, ref) {
|
|
392
|
+
const rest = omit(props, ["tone", "variant", "icon", "className", "children"]);
|
|
393
|
+
return /* @__PURE__ */ React3.createElement(
|
|
394
|
+
"span",
|
|
395
|
+
{
|
|
396
|
+
...rest,
|
|
397
|
+
ref,
|
|
398
|
+
className: cx(
|
|
399
|
+
"aura-badge",
|
|
400
|
+
"aura-badge--" + tone(props.tone),
|
|
401
|
+
props.variant === "solid" && "is-solid",
|
|
402
|
+
props.variant === "outline" && "is-outline",
|
|
403
|
+
props.className
|
|
404
|
+
)
|
|
405
|
+
},
|
|
406
|
+
props.icon ? /* @__PURE__ */ React3.createElement(Icon, { name: props.icon, size: 12 }) : null,
|
|
407
|
+
props.children
|
|
408
|
+
);
|
|
409
|
+
}
|
|
410
|
+
function emptyStateElement(props, ref) {
|
|
411
|
+
const HT = "h" + (props.headingLevel || 3);
|
|
412
|
+
return /* @__PURE__ */ React3.createElement(
|
|
413
|
+
"div",
|
|
414
|
+
{
|
|
415
|
+
ref,
|
|
416
|
+
className: cx("aura-empty", props.size === "sm" && "is-sm", props.bordered && "is-bordered", props.className)
|
|
417
|
+
},
|
|
418
|
+
/* @__PURE__ */ React3.createElement("span", { className: "aura-empty__icon", "aria-hidden": true }, /* @__PURE__ */ React3.createElement(Icon, { name: props.icon || "inbox", size: props.size === "sm" ? "md" : "lg" })),
|
|
419
|
+
/* @__PURE__ */ React3.createElement(HT, { className: "aura-empty__title" }, props.title),
|
|
420
|
+
props.description ? /* @__PURE__ */ React3.createElement("p", { className: "aura-empty__text" }, props.description) : null,
|
|
421
|
+
props.action ? /* @__PURE__ */ React3.createElement("div", { className: "aura-empty__action" }, props.action) : null
|
|
422
|
+
);
|
|
423
|
+
}
|
|
424
|
+
function buttonClass(opts = {}) {
|
|
425
|
+
return cx(
|
|
426
|
+
"aura-btn",
|
|
427
|
+
"aura-btn--" + (opts.variant || "primary"),
|
|
428
|
+
opts.size === "sm" && "aura-btn--sm",
|
|
429
|
+
opts.fullWidth && "aura-btn--full",
|
|
430
|
+
opts.loading && "is-loading",
|
|
431
|
+
opts.className
|
|
432
|
+
);
|
|
433
|
+
}
|
|
301
434
|
|
|
302
435
|
// src/locale.tsx
|
|
303
|
-
var
|
|
436
|
+
var React4 = __toESM(require_react(), 1);
|
|
304
437
|
|
|
305
438
|
// src/strings.ts
|
|
306
439
|
var n = function(x) {
|
|
@@ -676,12 +809,12 @@ window.Aura = (() => {
|
|
|
676
809
|
};
|
|
677
810
|
|
|
678
811
|
// src/locale.tsx
|
|
679
|
-
var LocaleContext =
|
|
812
|
+
var LocaleContext = React4.createContext(null);
|
|
680
813
|
function AuraProvider(props) {
|
|
681
|
-
const outer =
|
|
814
|
+
const outer = React4.useContext(LocaleContext);
|
|
682
815
|
const density = props.density || outer && outer.density || null;
|
|
683
816
|
const timeZone = props.timeZone || outer && outer.timeZone || null;
|
|
684
|
-
const value =
|
|
817
|
+
const value = React4.useMemo(
|
|
685
818
|
function() {
|
|
686
819
|
const own = !!props.locale || !outer || !outer.locale;
|
|
687
820
|
const base = own ? props.locale && STRINGS[props.locale] || STRINGS.en : outer.strings;
|
|
@@ -696,17 +829,17 @@ window.Aura = (() => {
|
|
|
696
829
|
},
|
|
697
830
|
[props.locale, props.calendar, props.strings, props.linkComponent, density, timeZone, outer]
|
|
698
831
|
);
|
|
699
|
-
return /* @__PURE__ */
|
|
832
|
+
return /* @__PURE__ */ React4.createElement(LocaleContext.Provider, { value }, props.density ? /* @__PURE__ */ React4.createElement("div", { className: "aura-density", "data-density": props.density }, props.children) : props.children);
|
|
700
833
|
}
|
|
701
834
|
function useAuraLocale() {
|
|
702
|
-
return
|
|
835
|
+
return React4.useContext(LocaleContext) || { locale: null, calendar: null, strings: STRINGS.en };
|
|
703
836
|
}
|
|
704
837
|
function useLinkComponent(own) {
|
|
705
|
-
const ctx =
|
|
838
|
+
const ctx = React4.useContext(LocaleContext);
|
|
706
839
|
return own || ctx && ctx.linkComponent || "a";
|
|
707
840
|
}
|
|
708
841
|
function useDensity() {
|
|
709
|
-
const ctx =
|
|
842
|
+
const ctx = React4.useContext(LocaleContext);
|
|
710
843
|
return ctx && ctx.density || void 0;
|
|
711
844
|
}
|
|
712
845
|
function useStrings() {
|
|
@@ -730,7 +863,7 @@ window.Aura = (() => {
|
|
|
730
863
|
"size"
|
|
731
864
|
]);
|
|
732
865
|
const Tag3 = disabled ? "a" : Link;
|
|
733
|
-
return /* @__PURE__ */
|
|
866
|
+
return /* @__PURE__ */ React5.createElement(
|
|
734
867
|
Tag3,
|
|
735
868
|
{
|
|
736
869
|
...rest,
|
|
@@ -739,21 +872,20 @@ window.Aura = (() => {
|
|
|
739
872
|
role: disabled ? "link" : void 0,
|
|
740
873
|
"aria-disabled": disabled || void 0,
|
|
741
874
|
tabIndex: disabled ? -1 : props.tabIndex,
|
|
742
|
-
className:
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
props.
|
|
746
|
-
props.
|
|
747
|
-
|
|
748
|
-
),
|
|
875
|
+
className: buttonClass({
|
|
876
|
+
variant,
|
|
877
|
+
size: props.size,
|
|
878
|
+
fullWidth: props.fullWidth,
|
|
879
|
+
className: props.className
|
|
880
|
+
}),
|
|
749
881
|
onClick: disabled ? void 0 : props.onClick
|
|
750
882
|
},
|
|
751
|
-
props.icon ? /* @__PURE__ */
|
|
883
|
+
props.icon ? /* @__PURE__ */ React5.createElement(Icon, { name: props.icon }) : null,
|
|
752
884
|
props.children,
|
|
753
|
-
props.iconRight ? /* @__PURE__ */
|
|
885
|
+
props.iconRight ? /* @__PURE__ */ React5.createElement(Icon, { name: props.iconRight }) : null
|
|
754
886
|
);
|
|
755
887
|
}
|
|
756
|
-
var Button =
|
|
888
|
+
var Button = React5.forwardRef(
|
|
757
889
|
function Button2(all, ref) {
|
|
758
890
|
const Link = useLinkComponent(all.linkComponent);
|
|
759
891
|
if (typeof all.href === "string") {
|
|
@@ -774,38 +906,37 @@ window.Aura = (() => {
|
|
|
774
906
|
"fullWidth",
|
|
775
907
|
"size"
|
|
776
908
|
]);
|
|
777
|
-
return /* @__PURE__ */
|
|
909
|
+
return /* @__PURE__ */ React5.createElement(
|
|
778
910
|
"button",
|
|
779
911
|
{
|
|
780
912
|
...rest,
|
|
781
913
|
ref,
|
|
782
914
|
type: props.type || "button",
|
|
783
|
-
className:
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
props.
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
),
|
|
915
|
+
className: buttonClass({
|
|
916
|
+
variant,
|
|
917
|
+
size: props.size,
|
|
918
|
+
fullWidth: props.fullWidth,
|
|
919
|
+
loading,
|
|
920
|
+
className: props.className
|
|
921
|
+
}),
|
|
791
922
|
"aria-busy": loading || void 0,
|
|
792
923
|
"aria-disabled": loading || void 0,
|
|
793
924
|
onClick: loading ? function(e) {
|
|
794
925
|
e.preventDefault();
|
|
795
926
|
} : props.onClick
|
|
796
927
|
},
|
|
797
|
-
loading ? /* @__PURE__ */
|
|
928
|
+
loading ? /* @__PURE__ */ React5.createElement(Icon, { name: "loader-circle", className: "aura-spin" }) : props.icon ? /* @__PURE__ */ React5.createElement(Icon, { name: props.icon }) : null,
|
|
798
929
|
props.children,
|
|
799
|
-
props.iconRight && !loading ? /* @__PURE__ */
|
|
930
|
+
props.iconRight && !loading ? /* @__PURE__ */ React5.createElement(Icon, { name: props.iconRight }) : null
|
|
800
931
|
);
|
|
801
932
|
}
|
|
802
933
|
);
|
|
803
934
|
|
|
804
935
|
// src/IconButton.tsx
|
|
805
|
-
var
|
|
806
|
-
var IconButton =
|
|
936
|
+
var React6 = __toESM(require_react(), 1);
|
|
937
|
+
var IconButton = React6.forwardRef(function IconButton2(props, ref) {
|
|
807
938
|
const rest = omit(props, ["icon", "label", "className", "size", "tone"]);
|
|
808
|
-
return /* @__PURE__ */
|
|
939
|
+
return /* @__PURE__ */ React6.createElement(
|
|
809
940
|
"button",
|
|
810
941
|
{
|
|
811
942
|
...rest,
|
|
@@ -815,16 +946,16 @@ window.Aura = (() => {
|
|
|
815
946
|
title: props.label,
|
|
816
947
|
className: cx("aura-icon-btn", props.tone === "danger" && "aura-icon-btn--danger", props.className)
|
|
817
948
|
},
|
|
818
|
-
/* @__PURE__ */
|
|
949
|
+
/* @__PURE__ */ React6.createElement(Icon, { name: props.icon, size: props.size || "sm" })
|
|
819
950
|
);
|
|
820
951
|
});
|
|
821
952
|
|
|
822
953
|
// src/Menu.tsx
|
|
823
|
-
var
|
|
954
|
+
var React7 = __toESM(require_react(), 1);
|
|
824
955
|
var import_react_dom = __toESM(require_react_dom(), 1);
|
|
825
|
-
var Menu =
|
|
826
|
-
const own =
|
|
827
|
-
const posState =
|
|
956
|
+
var Menu = React7.forwardRef(function Menu2(props, ref) {
|
|
957
|
+
const own = React7.useRef(null), merged = useMergedRef(ref, own);
|
|
958
|
+
const posState = React7.useState(null);
|
|
828
959
|
const pos = posState[0], setPos = posState[1];
|
|
829
960
|
const items2 = props.items || [];
|
|
830
961
|
const mounted = useMounted();
|
|
@@ -849,8 +980,8 @@ window.Aura = (() => {
|
|
|
849
980
|
},
|
|
850
981
|
[props.anchor, mounted, hasHeader]
|
|
851
982
|
);
|
|
852
|
-
const hadHeader =
|
|
853
|
-
|
|
983
|
+
const hadHeader = React7.useRef(hasHeader);
|
|
984
|
+
React7.useEffect(
|
|
854
985
|
function() {
|
|
855
986
|
if (hadHeader.current === hasHeader) return;
|
|
856
987
|
hadHeader.current = hasHeader;
|
|
@@ -862,7 +993,7 @@ window.Aura = (() => {
|
|
|
862
993
|
},
|
|
863
994
|
[hasHeader]
|
|
864
995
|
);
|
|
865
|
-
|
|
996
|
+
React7.useEffect(
|
|
866
997
|
function() {
|
|
867
998
|
if (!mounted) return;
|
|
868
999
|
const first = own.current && own.current.querySelector('[role^="menuitem"]:not([disabled])');
|
|
@@ -924,18 +1055,18 @@ window.Aura = (() => {
|
|
|
924
1055
|
return out;
|
|
925
1056
|
}
|
|
926
1057
|
function renderItem(it, i) {
|
|
927
|
-
if (it.separator) return /* @__PURE__ */
|
|
1058
|
+
if (it.separator) return /* @__PURE__ */ React7.createElement("div", { key: "s" + i, role: "separator", className: "aura-menu__sep" });
|
|
928
1059
|
const isRadio = it.type === "radio";
|
|
929
1060
|
const isCheck = !isRadio && it.checked !== void 0;
|
|
930
|
-
const lead = isRadio ? /* @__PURE__ */
|
|
1061
|
+
const lead = isRadio ? /* @__PURE__ */ React7.createElement("span", { className: cx("aura-menu__radio", it.checked && "is-on") }) : isCheck ? /* @__PURE__ */ React7.createElement("span", { className: cx("aura-menu__check", it.checked && "is-on") }, it.checked ? /* @__PURE__ */ React7.createElement(Icon, { name: "check", size: 12, strokeWidth: 3 }) : null) : it.icon ? /* @__PURE__ */ React7.createElement(Icon, { name: it.icon }) : /* @__PURE__ */ React7.createElement("span", { className: "aura-menu__blank" });
|
|
931
1062
|
const body = [
|
|
932
|
-
/* @__PURE__ */
|
|
933
|
-
/* @__PURE__ */
|
|
934
|
-
it.hint ? /* @__PURE__ */
|
|
1063
|
+
/* @__PURE__ */ React7.createElement(React7.Fragment, { key: "l" }, lead),
|
|
1064
|
+
/* @__PURE__ */ React7.createElement("span", { key: "t", className: "aura-menu__label" }, it.label),
|
|
1065
|
+
it.hint ? /* @__PURE__ */ React7.createElement("span", { key: "h", className: "aura-menu__hint" }, it.hint) : null
|
|
935
1066
|
];
|
|
936
1067
|
const cls = cx("aura-menu__item", it.tone === "danger" && "aura-menu__item--danger");
|
|
937
1068
|
if (it.href && !it.disabled)
|
|
938
|
-
return /* @__PURE__ */
|
|
1069
|
+
return /* @__PURE__ */ React7.createElement(
|
|
939
1070
|
Link,
|
|
940
1071
|
{
|
|
941
1072
|
key: i,
|
|
@@ -952,7 +1083,7 @@ window.Aura = (() => {
|
|
|
952
1083
|
},
|
|
953
1084
|
body
|
|
954
1085
|
);
|
|
955
|
-
return /* @__PURE__ */
|
|
1086
|
+
return /* @__PURE__ */ React7.createElement(
|
|
956
1087
|
"button",
|
|
957
1088
|
{
|
|
958
1089
|
key: i,
|
|
@@ -979,9 +1110,9 @@ window.Aura = (() => {
|
|
|
979
1110
|
const rendered = block.items.map(function(x) {
|
|
980
1111
|
return renderItem(x.it, x.i);
|
|
981
1112
|
});
|
|
982
|
-
return block.group ? /* @__PURE__ */
|
|
1113
|
+
return block.group ? /* @__PURE__ */ React7.createElement("div", { key: "g" + bi, role: "group", "aria-label": block.group, className: "aura-menu__group" }, rendered) : /* @__PURE__ */ React7.createElement(React7.Fragment, { key: "f" + bi }, rendered);
|
|
983
1114
|
});
|
|
984
|
-
const el = hasHeader ? /* @__PURE__ */
|
|
1115
|
+
const el = hasHeader ? /* @__PURE__ */ React7.createElement("div", { ref: merged, className: "aura-menu has-header", onKeyDown, style }, /* @__PURE__ */ React7.createElement(
|
|
985
1116
|
"div",
|
|
986
1117
|
{
|
|
987
1118
|
className: "aura-menu__header",
|
|
@@ -991,18 +1122,18 @@ window.Aura = (() => {
|
|
|
991
1122
|
}
|
|
992
1123
|
},
|
|
993
1124
|
props.header
|
|
994
|
-
), /* @__PURE__ */
|
|
1125
|
+
), /* @__PURE__ */ React7.createElement("div", { role: "menu", "aria-label": props.label, "aria-describedby": headerId, className: "aura-menu__list" }, list)) : /* @__PURE__ */ React7.createElement("div", { ref: merged, role: "menu", "aria-label": props.label, className: "aura-menu", onKeyDown, style }, list);
|
|
995
1126
|
return mounted ? (0, import_react_dom.createPortal)(el, document.body) : null;
|
|
996
1127
|
});
|
|
997
1128
|
|
|
998
1129
|
// src/DropdownMenu.tsx
|
|
999
|
-
var
|
|
1000
|
-
var DropdownMenu =
|
|
1001
|
-
const st =
|
|
1002
|
-
const wrap =
|
|
1003
|
-
const child =
|
|
1004
|
-
const menuRef =
|
|
1005
|
-
|
|
1130
|
+
var React8 = __toESM(require_react(), 1);
|
|
1131
|
+
var DropdownMenu = React8.forwardRef(function DropdownMenu2(props, ref) {
|
|
1132
|
+
const st = React8.useState(null), anchor = st[0], setAnchor = st[1];
|
|
1133
|
+
const wrap = React8.useRef(null), wrapMerged = useMergedRef(ref, wrap);
|
|
1134
|
+
const child = React8.Children.only(props.trigger);
|
|
1135
|
+
const menuRef = React8.useRef(null), toLast = React8.useRef(false);
|
|
1136
|
+
React8.useEffect(
|
|
1006
1137
|
function() {
|
|
1007
1138
|
if (!anchor || !toLast.current || !menuRef.current) return;
|
|
1008
1139
|
toLast.current = false;
|
|
@@ -1023,7 +1154,7 @@ window.Aura = (() => {
|
|
|
1023
1154
|
setAnchor(wrap.current.querySelector('button, [role="button"], a') || wrap.current);
|
|
1024
1155
|
}
|
|
1025
1156
|
}
|
|
1026
|
-
return /* @__PURE__ */
|
|
1157
|
+
return /* @__PURE__ */ React8.createElement("span", { ref: wrapMerged, className: "aura-dropdown", onKeyDown }, React8.cloneElement(child, { onClick: toggle, "aria-haspopup": "menu", "aria-expanded": anchor ? true : false }), anchor ? /* @__PURE__ */ React8.createElement(
|
|
1027
1158
|
Menu,
|
|
1028
1159
|
{
|
|
1029
1160
|
ref: menuRef,
|
|
@@ -1041,13 +1172,13 @@ window.Aura = (() => {
|
|
|
1041
1172
|
});
|
|
1042
1173
|
|
|
1043
1174
|
// src/Checkbox.tsx
|
|
1044
|
-
var
|
|
1045
|
-
var Checkbox =
|
|
1046
|
-
const own =
|
|
1175
|
+
var React9 = __toESM(require_react(), 1);
|
|
1176
|
+
var Checkbox = React9.forwardRef(function Checkbox2(props, ref) {
|
|
1177
|
+
const own = React9.useRef(null), merged = useMergedRef(ref, own);
|
|
1047
1178
|
const st = useMaybeControlled(props.checked, !!props.defaultChecked, props.onChange);
|
|
1048
1179
|
const on = !!st[0];
|
|
1049
1180
|
const auto = uid();
|
|
1050
|
-
|
|
1181
|
+
React9.useEffect(function() {
|
|
1051
1182
|
if (own.current) own.current.indeterminate = !!props.indeterminate;
|
|
1052
1183
|
});
|
|
1053
1184
|
const rest = omit(props, [
|
|
@@ -1063,15 +1194,15 @@ window.Aura = (() => {
|
|
|
1063
1194
|
"tabIndex",
|
|
1064
1195
|
"disabled"
|
|
1065
1196
|
]);
|
|
1066
|
-
const
|
|
1067
|
-
const labelled =
|
|
1197
|
+
const text2 = props.children;
|
|
1198
|
+
const labelled = text2 != null && text2 !== "";
|
|
1068
1199
|
if (!labelled && props.label && !props.hideLabel)
|
|
1069
1200
|
devWarnOnce(
|
|
1070
1201
|
"checkbox-label",
|
|
1071
1202
|
"Checkbox `label` is only the accessible name: it is not shown. In 6.0 it will be shown beside the box, like Switch and TextField. For visible text now pass it as children; for a bare box (a table row) add `hideLabel`."
|
|
1072
1203
|
);
|
|
1073
1204
|
const descId = props.description ? (props.id || auto) + "-desc" : void 0;
|
|
1074
|
-
return /* @__PURE__ */
|
|
1205
|
+
return /* @__PURE__ */ React9.createElement(
|
|
1075
1206
|
"label",
|
|
1076
1207
|
{
|
|
1077
1208
|
className: cx("aura-check", labelled && "aura-check--labelled", props.disabled && "is-disabled", props.className),
|
|
@@ -1079,7 +1210,7 @@ window.Aura = (() => {
|
|
|
1079
1210
|
e.stopPropagation();
|
|
1080
1211
|
}
|
|
1081
1212
|
},
|
|
1082
|
-
/* @__PURE__ */
|
|
1213
|
+
/* @__PURE__ */ React9.createElement(
|
|
1083
1214
|
"input",
|
|
1084
1215
|
{
|
|
1085
1216
|
...rest,
|
|
@@ -1096,62 +1227,38 @@ window.Aura = (() => {
|
|
|
1096
1227
|
}
|
|
1097
1228
|
}
|
|
1098
1229
|
),
|
|
1099
|
-
/* @__PURE__ */
|
|
1100
|
-
!labelled && props.description ? /* @__PURE__ */
|
|
1101
|
-
labelled ? /* @__PURE__ */
|
|
1230
|
+
/* @__PURE__ */ React9.createElement("span", { className: "aura-check__box", "aria-hidden": true }, props.indeterminate ? /* @__PURE__ */ React9.createElement(Icon, { name: "minus", size: 12, strokeWidth: 3 }) : on ? /* @__PURE__ */ React9.createElement(Icon, { name: "check", size: 12, strokeWidth: 3 }) : null),
|
|
1231
|
+
!labelled && props.description ? /* @__PURE__ */ React9.createElement("span", { className: "aura-sr-only", id: descId }, props.description) : null,
|
|
1232
|
+
labelled ? /* @__PURE__ */ React9.createElement("span", { className: "aura-check__text" }, /* @__PURE__ */ React9.createElement("span", { className: "aura-check__label" }, text2), props.description ? /* @__PURE__ */ React9.createElement("span", { className: "aura-check__desc", id: descId }, props.description) : null) : null
|
|
1102
1233
|
);
|
|
1103
1234
|
});
|
|
1104
1235
|
|
|
1105
1236
|
// src/StatusPill.tsx
|
|
1106
|
-
var
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
var TONE_WORDS = {
|
|
1110
|
-
ready: ["ready", "done", "complete", "completed", "approved", "live", "passed"],
|
|
1111
|
-
progress: ["in progress", "in review", "review", "syncing", "running", "pending"],
|
|
1112
|
-
warning: ["warning", "problem", "degraded", "at risk"],
|
|
1113
|
-
blocked: ["blocked", "failed", "error", "rejected", "on hold", "cancelled"]
|
|
1114
|
-
};
|
|
1115
|
-
function toneFor(status) {
|
|
1116
|
-
const s = String(status == null ? "" : status).trim().toLowerCase();
|
|
1117
|
-
for (const t in TONE_WORDS) if (TONE_WORDS[t].indexOf(s) >= 0) return t;
|
|
1118
|
-
return "neutral";
|
|
1119
|
-
}
|
|
1120
|
-
var TONE_ORDER = { neutral: 0, progress: 1, ready: 2, warning: 3, blocked: 4 };
|
|
1121
|
-
|
|
1122
|
-
// src/StatusPill.tsx
|
|
1123
|
-
var TONE_ICON = {
|
|
1124
|
-
neutral: "circle",
|
|
1125
|
-
progress: "circle-dot-dashed",
|
|
1126
|
-
ready: "circle-check",
|
|
1127
|
-
warning: "triangle-alert",
|
|
1128
|
-
blocked: "ban"
|
|
1129
|
-
};
|
|
1130
|
-
var StatusPill = React9.forwardRef(function StatusPill2(props, ref) {
|
|
1131
|
-
const tone2 = props.tone || toneFor(props.children);
|
|
1132
|
-
return /* @__PURE__ */ React9.createElement("span", { ref, className: cx("aura-pill", "aura-pill--" + tone2, props.className) }, /* @__PURE__ */ React9.createElement(Icon, { name: TONE_ICON[tone2] || "circle", size: 12 }), props.children);
|
|
1237
|
+
var React10 = __toESM(require_react(), 1);
|
|
1238
|
+
var StatusPill = React10.forwardRef(function StatusPill2(props, ref) {
|
|
1239
|
+
return statusPillElement(props, ref);
|
|
1133
1240
|
});
|
|
1134
1241
|
|
|
1135
1242
|
// src/Field.tsx
|
|
1136
|
-
var
|
|
1137
|
-
var
|
|
1138
|
-
var Field =
|
|
1243
|
+
var React11 = __toESM(require_react(), 1);
|
|
1244
|
+
var h3 = React11.createElement;
|
|
1245
|
+
var Field = React11.forwardRef(function Field2(props, ref) {
|
|
1139
1246
|
const t = useStrings();
|
|
1140
|
-
return /* @__PURE__ */
|
|
1247
|
+
return /* @__PURE__ */ React11.createElement(
|
|
1141
1248
|
"div",
|
|
1142
1249
|
{
|
|
1143
1250
|
ref,
|
|
1144
1251
|
className: cx("aura-field", props.error && "is-invalid", props.disabled && "is-disabled", props.className)
|
|
1145
1252
|
},
|
|
1146
|
-
props.label ?
|
|
1253
|
+
props.label ? h3(
|
|
1147
1254
|
props.labelAs || "label",
|
|
1148
1255
|
{ className: "aura-field__label", htmlFor: props.labelAs ? void 0 : props.id, id: props.labelId },
|
|
1149
1256
|
props.label,
|
|
1150
|
-
props.required ? /* @__PURE__ */
|
|
1151
|
-
props.optional ? /* @__PURE__ */
|
|
1257
|
+
props.required ? /* @__PURE__ */ React11.createElement("span", { className: "aura-field__req", "aria-hidden": true }, " *") : null,
|
|
1258
|
+
props.optional ? /* @__PURE__ */ React11.createElement("span", { className: "aura-field__opt" }, " (" + t.optional + ")") : null
|
|
1152
1259
|
) : null,
|
|
1153
1260
|
props.children,
|
|
1154
|
-
props.error ? /* @__PURE__ */
|
|
1261
|
+
props.error ? /* @__PURE__ */ React11.createElement("p", { className: "aura-field__error", id: props.id + "-error" }, /* @__PURE__ */ React11.createElement(Icon, { name: "circle-alert", size: 14 }), props.error) : props.hint ? /* @__PURE__ */ React11.createElement("p", { className: "aura-field__hint", id: props.id + "-hint" }, props.hint) : null
|
|
1155
1262
|
);
|
|
1156
1263
|
});
|
|
1157
1264
|
function describedBy(id, p) {
|
|
@@ -1172,11 +1279,11 @@ window.Aura = (() => {
|
|
|
1172
1279
|
];
|
|
1173
1280
|
|
|
1174
1281
|
// src/TextField.tsx
|
|
1175
|
-
var
|
|
1176
|
-
var TextField =
|
|
1282
|
+
var React12 = __toESM(require_react(), 1);
|
|
1283
|
+
var TextField = React12.forwardRef(function TextField2(props, ref) {
|
|
1177
1284
|
const auto = uid(), id = props.id || auto;
|
|
1178
1285
|
const rest = omit(props, FIELD_KEYS);
|
|
1179
|
-
return /* @__PURE__ */
|
|
1286
|
+
return /* @__PURE__ */ React12.createElement(
|
|
1180
1287
|
Field,
|
|
1181
1288
|
{
|
|
1182
1289
|
id,
|
|
@@ -1188,7 +1295,7 @@ window.Aura = (() => {
|
|
|
1188
1295
|
disabled: props.disabled,
|
|
1189
1296
|
className: props.className
|
|
1190
1297
|
},
|
|
1191
|
-
/* @__PURE__ */
|
|
1298
|
+
/* @__PURE__ */ React12.createElement("div", { className: cx("aura-input", props.icon && "has-icon", props.suffix && "has-suffix") }, props.icon ? /* @__PURE__ */ React12.createElement(Icon, { name: props.icon, className: "aura-input__icon" }) : null, /* @__PURE__ */ React12.createElement(
|
|
1192
1299
|
"input",
|
|
1193
1300
|
{
|
|
1194
1301
|
type: "text",
|
|
@@ -1201,16 +1308,16 @@ window.Aura = (() => {
|
|
|
1201
1308
|
"aria-invalid": props.error ? true : rest["aria-invalid"],
|
|
1202
1309
|
"aria-describedby": [describedBy(id, props), rest["aria-describedby"]].filter(Boolean).join(" ") || void 0
|
|
1203
1310
|
}
|
|
1204
|
-
), props.suffix ? /* @__PURE__ */
|
|
1311
|
+
), props.suffix ? /* @__PURE__ */ React12.createElement("span", { className: "aura-input__suffix" }, props.suffix) : null)
|
|
1205
1312
|
);
|
|
1206
1313
|
});
|
|
1207
1314
|
|
|
1208
1315
|
// src/Textarea.tsx
|
|
1209
|
-
var
|
|
1210
|
-
var Textarea =
|
|
1316
|
+
var React13 = __toESM(require_react(), 1);
|
|
1317
|
+
var Textarea = React13.forwardRef(function Textarea2(props, ref) {
|
|
1211
1318
|
const auto = uid(), id = props.id || auto;
|
|
1212
1319
|
const rest = omit(props, FIELD_KEYS);
|
|
1213
|
-
return /* @__PURE__ */
|
|
1320
|
+
return /* @__PURE__ */ React13.createElement(
|
|
1214
1321
|
Field,
|
|
1215
1322
|
{
|
|
1216
1323
|
id,
|
|
@@ -1222,7 +1329,7 @@ window.Aura = (() => {
|
|
|
1222
1329
|
disabled: props.disabled,
|
|
1223
1330
|
className: props.className
|
|
1224
1331
|
},
|
|
1225
|
-
/* @__PURE__ */
|
|
1332
|
+
/* @__PURE__ */ React13.createElement(
|
|
1226
1333
|
"textarea",
|
|
1227
1334
|
{
|
|
1228
1335
|
rows: 4,
|
|
@@ -1240,9 +1347,9 @@ window.Aura = (() => {
|
|
|
1240
1347
|
});
|
|
1241
1348
|
|
|
1242
1349
|
// src/Select.tsx
|
|
1243
|
-
var
|
|
1350
|
+
var React14 = __toESM(require_react(), 1);
|
|
1244
1351
|
var import_react_dom2 = __toESM(require_react_dom(), 1);
|
|
1245
|
-
var
|
|
1352
|
+
var h4 = React14.createElement;
|
|
1246
1353
|
var FORM_KEYS = ["name", "form", "value", "defaultValue", "disabled", "autoComplete", "onInput", "onInvalid"];
|
|
1247
1354
|
var HANDLED_KEYS = FORM_KEYS.concat([
|
|
1248
1355
|
"onChange",
|
|
@@ -1287,23 +1394,23 @@ window.Aura = (() => {
|
|
|
1287
1394
|
if (hit) return { label: hit.label, empty: false };
|
|
1288
1395
|
return { label: props.placeholder || "", empty: true };
|
|
1289
1396
|
}
|
|
1290
|
-
var Select =
|
|
1397
|
+
var Select = React14.forwardRef(function Select2(props, ref) {
|
|
1291
1398
|
const auto = uid(), id = props.id || auto;
|
|
1292
1399
|
const rest = omit(props, FIELD_KEYS.concat(["children"]));
|
|
1293
1400
|
const opts = (props.options || []).map(function(o) {
|
|
1294
1401
|
const v = typeof o === "object" ? o : { value: o, label: o };
|
|
1295
|
-
return /* @__PURE__ */
|
|
1402
|
+
return /* @__PURE__ */ React14.createElement("option", { key: v.value, value: v.value, disabled: v.disabled }, v.label);
|
|
1296
1403
|
});
|
|
1297
1404
|
if (props.placeholder)
|
|
1298
1405
|
opts.unshift(
|
|
1299
|
-
/* @__PURE__ */
|
|
1406
|
+
/* @__PURE__ */ React14.createElement("option", { key: "__ph", value: "", disabled: true }, props.placeholder)
|
|
1300
1407
|
);
|
|
1301
1408
|
const extra = props.value === void 0 && props.defaultValue === void 0 && props.placeholder ? { defaultValue: "" } : {};
|
|
1302
1409
|
const native = !!props.multiple || props.size != null && props.size > 1;
|
|
1303
1410
|
const mounted = useMounted();
|
|
1304
1411
|
const live = !native && mounted;
|
|
1305
1412
|
const density = useDensity();
|
|
1306
|
-
|
|
1413
|
+
React14.useEffect(function() {
|
|
1307
1414
|
if (props.label || props["aria-label"] || props["aria-labelledby"] || props.title) return;
|
|
1308
1415
|
if (document.querySelector('label[for="' + id.replace(/["\\]/g, "\\$&") + '"]')) return;
|
|
1309
1416
|
devWarnOnce(
|
|
@@ -1311,16 +1418,16 @@ window.Aura = (() => {
|
|
|
1311
1418
|
"Select needs a label, aria-label or aria-labelledby: screen readers announce it with no name."
|
|
1312
1419
|
);
|
|
1313
1420
|
}, []);
|
|
1314
|
-
const selRef =
|
|
1315
|
-
const shown =
|
|
1421
|
+
const selRef = React14.useRef(null), trigRef = React14.useRef(null), listRef = React14.useRef(null);
|
|
1422
|
+
const shown = React14.useState(function() {
|
|
1316
1423
|
return initialLabel(props);
|
|
1317
1424
|
});
|
|
1318
|
-
const openState =
|
|
1319
|
-
const activeState =
|
|
1320
|
-
const items2 =
|
|
1321
|
-
const pos =
|
|
1322
|
-
const typed =
|
|
1323
|
-
const sync =
|
|
1425
|
+
const openState = React14.useState(false), open = openState[0];
|
|
1426
|
+
const activeState = React14.useState(-1), active = activeState[0];
|
|
1427
|
+
const items2 = React14.useState([]);
|
|
1428
|
+
const pos = React14.useState(null);
|
|
1429
|
+
const typed = React14.useRef({ text: "", at: 0 });
|
|
1430
|
+
const sync = React14.useCallback(function() {
|
|
1324
1431
|
const el = selRef.current;
|
|
1325
1432
|
if (!el) return;
|
|
1326
1433
|
const o = el.selectedIndex >= 0 ? el.options[el.selectedIndex] : null;
|
|
@@ -1329,7 +1436,7 @@ window.Aura = (() => {
|
|
|
1329
1436
|
return cur.label === next.label && cur.empty === next.empty ? cur : next;
|
|
1330
1437
|
});
|
|
1331
1438
|
}, []);
|
|
1332
|
-
const hook =
|
|
1439
|
+
const hook = React14.useCallback(
|
|
1333
1440
|
function(el) {
|
|
1334
1441
|
selRef.current = el;
|
|
1335
1442
|
if (!el || native || el.__auraHooked) return;
|
|
@@ -1366,7 +1473,7 @@ window.Aura = (() => {
|
|
|
1366
1473
|
[native, sync]
|
|
1367
1474
|
);
|
|
1368
1475
|
const selMerged = useMergedRef(ref, hook);
|
|
1369
|
-
|
|
1476
|
+
React14.useEffect(
|
|
1370
1477
|
function() {
|
|
1371
1478
|
const f = selRef.current && selRef.current.form;
|
|
1372
1479
|
if (!f || native) return;
|
|
@@ -1380,8 +1487,8 @@ window.Aura = (() => {
|
|
|
1380
1487
|
},
|
|
1381
1488
|
[native, sync]
|
|
1382
1489
|
);
|
|
1383
|
-
const focusedOnce =
|
|
1384
|
-
|
|
1490
|
+
const focusedOnce = React14.useRef(false);
|
|
1491
|
+
React14.useEffect(
|
|
1385
1492
|
function() {
|
|
1386
1493
|
if (!live || focusedOnce.current || !trigRef.current) return;
|
|
1387
1494
|
focusedOnce.current = true;
|
|
@@ -1546,7 +1653,7 @@ window.Aura = (() => {
|
|
|
1546
1653
|
},
|
|
1547
1654
|
[open]
|
|
1548
1655
|
);
|
|
1549
|
-
|
|
1656
|
+
React14.useEffect(
|
|
1550
1657
|
function() {
|
|
1551
1658
|
if (!open || !listRef.current || active < 0) return;
|
|
1552
1659
|
const el = listRef.current.querySelector('[data-idx="' + active + '"]');
|
|
@@ -1555,7 +1662,7 @@ window.Aura = (() => {
|
|
|
1555
1662
|
[open, active, pos[0] != null]
|
|
1556
1663
|
);
|
|
1557
1664
|
const described = [describedBy(id, props), rest["aria-describedby"]].filter(Boolean).join(" ") || void 0;
|
|
1558
|
-
const field = (child) => /* @__PURE__ */
|
|
1665
|
+
const field = (child) => /* @__PURE__ */ React14.createElement(
|
|
1559
1666
|
Field,
|
|
1560
1667
|
{
|
|
1561
1668
|
id,
|
|
@@ -1572,7 +1679,7 @@ window.Aura = (() => {
|
|
|
1572
1679
|
);
|
|
1573
1680
|
if (!live)
|
|
1574
1681
|
return field(
|
|
1575
|
-
/* @__PURE__ */
|
|
1682
|
+
/* @__PURE__ */ React14.createElement("div", { className: cx("aura-input aura-select", props.icon && "has-icon") }, props.icon ? /* @__PURE__ */ React14.createElement(Icon, { name: props.icon, className: "aura-input__icon" }) : null, h4(
|
|
1576
1683
|
"select",
|
|
1577
1684
|
Object.assign(extra, rest, {
|
|
1578
1685
|
ref: native ? ref : selMerged,
|
|
@@ -1584,7 +1691,7 @@ window.Aura = (() => {
|
|
|
1584
1691
|
}),
|
|
1585
1692
|
opts,
|
|
1586
1693
|
props.children
|
|
1587
|
-
), /* @__PURE__ */
|
|
1694
|
+
), /* @__PURE__ */ React14.createElement(Icon, { name: "chevron-down", className: "aura-select__chevron" }))
|
|
1588
1695
|
);
|
|
1589
1696
|
const listId = id + "-list", labelId = id + "-label";
|
|
1590
1697
|
const optId = function(i) {
|
|
@@ -1594,7 +1701,7 @@ window.Aura = (() => {
|
|
|
1594
1701
|
const selIndex = selRef.current ? selRef.current.selectedIndex : -1;
|
|
1595
1702
|
const option = function(it) {
|
|
1596
1703
|
const sel = selIndex === it.index;
|
|
1597
|
-
return /* @__PURE__ */
|
|
1704
|
+
return /* @__PURE__ */ React14.createElement(
|
|
1598
1705
|
"div",
|
|
1599
1706
|
{
|
|
1600
1707
|
key: it.index,
|
|
@@ -1619,8 +1726,8 @@ window.Aura = (() => {
|
|
|
1619
1726
|
choose(it);
|
|
1620
1727
|
}
|
|
1621
1728
|
},
|
|
1622
|
-
/* @__PURE__ */
|
|
1623
|
-
sel ? /* @__PURE__ */
|
|
1729
|
+
/* @__PURE__ */ React14.createElement("span", { className: "aura-combo__text" }, /* @__PURE__ */ React14.createElement("span", { className: "aura-combo__label" }, it.label)),
|
|
1730
|
+
sel ? /* @__PURE__ */ React14.createElement(Icon, { name: "check", className: "aura-combo__check" }) : null
|
|
1624
1731
|
);
|
|
1625
1732
|
};
|
|
1626
1733
|
const runs = [];
|
|
@@ -1631,7 +1738,7 @@ window.Aura = (() => {
|
|
|
1631
1738
|
else runs.push({ group: it.group, items: [it] });
|
|
1632
1739
|
});
|
|
1633
1740
|
const popup = open ? (0, import_react_dom2.createPortal)(
|
|
1634
|
-
/* @__PURE__ */
|
|
1741
|
+
/* @__PURE__ */ React14.createElement(
|
|
1635
1742
|
"div",
|
|
1636
1743
|
{
|
|
1637
1744
|
ref: listRef,
|
|
@@ -1645,7 +1752,7 @@ window.Aura = (() => {
|
|
|
1645
1752
|
maxHeight: pos[0].maxHeight
|
|
1646
1753
|
} : { left: -9999, top: -9999 }
|
|
1647
1754
|
},
|
|
1648
|
-
/* @__PURE__ */
|
|
1755
|
+
/* @__PURE__ */ React14.createElement(
|
|
1649
1756
|
"div",
|
|
1650
1757
|
{
|
|
1651
1758
|
id: listId,
|
|
@@ -1655,9 +1762,9 @@ window.Aura = (() => {
|
|
|
1655
1762
|
className: "aura-combo__list"
|
|
1656
1763
|
},
|
|
1657
1764
|
runs.map(function(r, n2) {
|
|
1658
|
-
if (r.group === null) return /* @__PURE__ */
|
|
1765
|
+
if (r.group === null) return /* @__PURE__ */ React14.createElement(React14.Fragment, { key: "r" + n2 }, r.items.map(option));
|
|
1659
1766
|
const gid = id + "-group-" + n2;
|
|
1660
|
-
return /* @__PURE__ */
|
|
1767
|
+
return /* @__PURE__ */ React14.createElement("div", { key: "r" + n2, role: "group", "aria-labelledby": gid }, /* @__PURE__ */ React14.createElement("div", { id: gid, className: "aura-select__group" }, r.group), r.items.map(option));
|
|
1661
1768
|
})
|
|
1662
1769
|
)
|
|
1663
1770
|
),
|
|
@@ -1665,14 +1772,14 @@ window.Aura = (() => {
|
|
|
1665
1772
|
) : null;
|
|
1666
1773
|
const userFocus = rest.onFocus, userBlur = rest.onBlur, userKey = rest.onKeyDown, userClick = rest.onClick;
|
|
1667
1774
|
return field(
|
|
1668
|
-
/* @__PURE__ */
|
|
1775
|
+
/* @__PURE__ */ React14.createElement(
|
|
1669
1776
|
"div",
|
|
1670
1777
|
{
|
|
1671
1778
|
className: cx("aura-input aura-select aura-select--custom", props.icon && "has-icon", open && "is-open"),
|
|
1672
1779
|
"data-invalid": props.error ? "" : void 0
|
|
1673
1780
|
},
|
|
1674
|
-
props.icon ? /* @__PURE__ */
|
|
1675
|
-
|
|
1781
|
+
props.icon ? /* @__PURE__ */ React14.createElement(Icon, { name: props.icon, className: "aura-input__icon" }) : null,
|
|
1782
|
+
h4(
|
|
1676
1783
|
"select",
|
|
1677
1784
|
Object.assign(extra, pick(rest, FORM_KEYS), {
|
|
1678
1785
|
ref: selMerged,
|
|
@@ -1697,7 +1804,7 @@ window.Aura = (() => {
|
|
|
1697
1804
|
opts,
|
|
1698
1805
|
props.children
|
|
1699
1806
|
),
|
|
1700
|
-
/* @__PURE__ */
|
|
1807
|
+
/* @__PURE__ */ React14.createElement(
|
|
1701
1808
|
"button",
|
|
1702
1809
|
{
|
|
1703
1810
|
...omit(rest, HANDLED_KEYS),
|
|
@@ -1737,17 +1844,17 @@ window.Aura = (() => {
|
|
|
1737
1844
|
if (selRef.current) selRef.current.dispatchEvent(new FocusEvent("focusout", { bubbles: true }));
|
|
1738
1845
|
}
|
|
1739
1846
|
},
|
|
1740
|
-
/* @__PURE__ */
|
|
1847
|
+
/* @__PURE__ */ React14.createElement("span", { id: id + "-value", className: cx("aura-select__value", shown[0].empty && "is-placeholder") }, shown[0].label || " ")
|
|
1741
1848
|
),
|
|
1742
|
-
/* @__PURE__ */
|
|
1849
|
+
/* @__PURE__ */ React14.createElement(Icon, { name: "chevron-down", className: "aura-select__chevron" }),
|
|
1743
1850
|
popup
|
|
1744
1851
|
)
|
|
1745
1852
|
);
|
|
1746
1853
|
});
|
|
1747
1854
|
|
|
1748
1855
|
// src/RadioGroup.tsx
|
|
1749
|
-
var
|
|
1750
|
-
var RadioGroup =
|
|
1856
|
+
var React15 = __toESM(require_react(), 1);
|
|
1857
|
+
var RadioGroup = React15.forwardRef(function RadioGroup2(props, ref) {
|
|
1751
1858
|
const auto = uid(), id = props.id || auto;
|
|
1752
1859
|
const st = useMaybeControlled(
|
|
1753
1860
|
props.value,
|
|
@@ -1755,7 +1862,7 @@ window.Aura = (() => {
|
|
|
1755
1862
|
props.onChange
|
|
1756
1863
|
);
|
|
1757
1864
|
const name = props.name || id;
|
|
1758
|
-
const setRef =
|
|
1865
|
+
const setRef = React15.useCallback(
|
|
1759
1866
|
function(el) {
|
|
1760
1867
|
if (el)
|
|
1761
1868
|
el.focus = function(opts) {
|
|
@@ -1767,7 +1874,7 @@ window.Aura = (() => {
|
|
|
1767
1874
|
},
|
|
1768
1875
|
[ref]
|
|
1769
1876
|
);
|
|
1770
|
-
return /* @__PURE__ */
|
|
1877
|
+
return /* @__PURE__ */ React15.createElement(
|
|
1771
1878
|
"fieldset",
|
|
1772
1879
|
{
|
|
1773
1880
|
ref: setRef,
|
|
@@ -1776,10 +1883,10 @@ window.Aura = (() => {
|
|
|
1776
1883
|
"aria-invalid": props.error ? true : void 0,
|
|
1777
1884
|
disabled: props.disabled
|
|
1778
1885
|
},
|
|
1779
|
-
props.label ? /* @__PURE__ */
|
|
1780
|
-
/* @__PURE__ */
|
|
1886
|
+
props.label ? /* @__PURE__ */ React15.createElement("legend", { className: "aura-field__label" }, props.label, props.required ? /* @__PURE__ */ React15.createElement("span", { className: "aura-field__req", "aria-hidden": true }, " *") : null) : null,
|
|
1887
|
+
/* @__PURE__ */ React15.createElement("div", { className: cx("aura-radio-group__list", props.orientation === "horizontal" && "is-horizontal") }, (props.options || []).map(function(o) {
|
|
1781
1888
|
const v = typeof o === "object" ? o : { value: o, label: o };
|
|
1782
|
-
return /* @__PURE__ */
|
|
1889
|
+
return /* @__PURE__ */ React15.createElement("label", { key: v.value, className: cx("aura-choice", v.disabled && "is-disabled") }, /* @__PURE__ */ React15.createElement(
|
|
1783
1890
|
"input",
|
|
1784
1891
|
{
|
|
1785
1892
|
type: "radio",
|
|
@@ -1793,19 +1900,19 @@ window.Aura = (() => {
|
|
|
1793
1900
|
st[1](v.value);
|
|
1794
1901
|
}
|
|
1795
1902
|
}
|
|
1796
|
-
), /* @__PURE__ */
|
|
1903
|
+
), /* @__PURE__ */ React15.createElement("span", { className: "aura-choice__text" }, /* @__PURE__ */ React15.createElement("span", { className: "aura-choice__label" }, v.label), v.description ? /* @__PURE__ */ React15.createElement("span", { className: "aura-choice__desc" }, v.description) : null));
|
|
1797
1904
|
})),
|
|
1798
|
-
props.error ? /* @__PURE__ */
|
|
1905
|
+
props.error ? /* @__PURE__ */ React15.createElement("p", { className: "aura-field__error", id: id + "-error" }, /* @__PURE__ */ React15.createElement(Icon, { name: "circle-alert", size: 14 }), props.error) : props.hint ? /* @__PURE__ */ React15.createElement("p", { className: "aura-field__hint", id: id + "-hint" }, props.hint) : null
|
|
1799
1906
|
);
|
|
1800
1907
|
});
|
|
1801
1908
|
|
|
1802
1909
|
// src/Switch.tsx
|
|
1803
|
-
var
|
|
1804
|
-
var Switch =
|
|
1910
|
+
var React16 = __toESM(require_react(), 1);
|
|
1911
|
+
var Switch = React16.forwardRef(function Switch2(props, ref) {
|
|
1805
1912
|
const auto = uid(), id = props.id || auto;
|
|
1806
1913
|
const st = useMaybeControlled(props.checked, !!props.defaultChecked, props.onChange);
|
|
1807
1914
|
const on = !!st[0];
|
|
1808
|
-
return /* @__PURE__ */
|
|
1915
|
+
return /* @__PURE__ */ React16.createElement(
|
|
1809
1916
|
"div",
|
|
1810
1917
|
{
|
|
1811
1918
|
className: cx("aura-switch-row", props.disabled && "is-disabled", props.className),
|
|
@@ -1815,7 +1922,7 @@ window.Aura = (() => {
|
|
|
1815
1922
|
st[1](!on);
|
|
1816
1923
|
}
|
|
1817
1924
|
},
|
|
1818
|
-
/* @__PURE__ */
|
|
1925
|
+
/* @__PURE__ */ React16.createElement(
|
|
1819
1926
|
"button",
|
|
1820
1927
|
{
|
|
1821
1928
|
ref,
|
|
@@ -1832,14 +1939,14 @@ window.Aura = (() => {
|
|
|
1832
1939
|
st[1](!on);
|
|
1833
1940
|
}
|
|
1834
1941
|
},
|
|
1835
|
-
/* @__PURE__ */
|
|
1942
|
+
/* @__PURE__ */ React16.createElement("span", { className: "aura-switch__thumb" })
|
|
1836
1943
|
),
|
|
1837
|
-
props.label ? /* @__PURE__ */
|
|
1944
|
+
props.label ? /* @__PURE__ */ React16.createElement("span", { className: "aura-choice__text" }, /* @__PURE__ */ React16.createElement("label", { className: "aura-choice__label", id: id + "-label", htmlFor: id }, props.label), props.description ? /* @__PURE__ */ React16.createElement("span", { className: "aura-choice__desc", id: id + "-desc" }, props.description) : null) : props.description ? /* @__PURE__ */ React16.createElement("span", { className: "aura-sr-only", id: id + "-desc" }, props.description) : null
|
|
1838
1945
|
);
|
|
1839
1946
|
});
|
|
1840
1947
|
|
|
1841
1948
|
// src/Combobox.tsx
|
|
1842
|
-
var
|
|
1949
|
+
var React17 = __toESM(require_react(), 1);
|
|
1843
1950
|
var import_react_dom3 = __toESM(require_react_dom(), 1);
|
|
1844
1951
|
function norm(s) {
|
|
1845
1952
|
return String(s == null ? "" : s).normalize("NFC").toLocaleLowerCase("th");
|
|
@@ -1854,7 +1961,7 @@ window.Aura = (() => {
|
|
|
1854
1961
|
return norm(k).indexOf(q) >= 0;
|
|
1855
1962
|
});
|
|
1856
1963
|
}
|
|
1857
|
-
var Combobox =
|
|
1964
|
+
var Combobox = React17.forwardRef(
|
|
1858
1965
|
function Combobox2(all, ref) {
|
|
1859
1966
|
const props = all;
|
|
1860
1967
|
const multi = all.multiple === true;
|
|
@@ -1889,11 +1996,11 @@ window.Aura = (() => {
|
|
|
1889
1996
|
return o.value === v;
|
|
1890
1997
|
})[0];
|
|
1891
1998
|
}).filter(Boolean) : [];
|
|
1892
|
-
const openState =
|
|
1893
|
-
const qState =
|
|
1894
|
-
const aState =
|
|
1895
|
-
const posState =
|
|
1896
|
-
const inputRef =
|
|
1999
|
+
const openState = React17.useState(false), open = openState[0], setOpen = openState[1];
|
|
2000
|
+
const qState = React17.useState(null), query = qState[0], setQuery = qState[1];
|
|
2001
|
+
const aState = React17.useState(0), active = aState[0], setActive = aState[1];
|
|
2002
|
+
const posState = React17.useState(null);
|
|
2003
|
+
const inputRef = React17.useRef(null), inputMerged = useMergedRef(ref, inputRef), boxRef = React17.useRef(null), listRef = React17.useRef(null);
|
|
1897
2004
|
const mounted = useMounted();
|
|
1898
2005
|
const limit = props.limit || 200;
|
|
1899
2006
|
const filter = props.filter || defaultFilter;
|
|
@@ -1921,7 +2028,7 @@ window.Aura = (() => {
|
|
|
1921
2028
|
},
|
|
1922
2029
|
[open, shown.length, values.length]
|
|
1923
2030
|
);
|
|
1924
|
-
|
|
2031
|
+
React17.useEffect(
|
|
1925
2032
|
function() {
|
|
1926
2033
|
if (!open) return;
|
|
1927
2034
|
function outside(e) {
|
|
@@ -1943,7 +2050,7 @@ window.Aura = (() => {
|
|
|
1943
2050
|
},
|
|
1944
2051
|
[open]
|
|
1945
2052
|
);
|
|
1946
|
-
|
|
2053
|
+
React17.useEffect(
|
|
1947
2054
|
function() {
|
|
1948
2055
|
if (!open || !listRef.current) return;
|
|
1949
2056
|
const el = listRef.current.querySelector('[data-idx="' + activeIdx + '"]');
|
|
@@ -2012,19 +2119,19 @@ window.Aura = (() => {
|
|
|
2012
2119
|
} else if (!multi && !props.readOnly && props.clearable !== false && value != null && query == null) {
|
|
2013
2120
|
setValue(null);
|
|
2014
2121
|
}
|
|
2015
|
-
} else if (k === "Backspace" && multi && !props.readOnly && !
|
|
2122
|
+
} else if (k === "Backspace" && multi && !props.readOnly && !text2 && values.length) {
|
|
2016
2123
|
setValues(values.slice(0, -1));
|
|
2017
2124
|
} else if (k === "Tab") {
|
|
2018
2125
|
if (open) close();
|
|
2019
2126
|
}
|
|
2020
2127
|
}
|
|
2021
|
-
const
|
|
2128
|
+
const text2 = query != null ? query : selected ? selected.label : "";
|
|
2022
2129
|
const summaryId = id + "-picked";
|
|
2023
2130
|
const optId = function(i) {
|
|
2024
2131
|
return id + "-opt-" + i;
|
|
2025
2132
|
};
|
|
2026
2133
|
const list = open && mounted && posState[0] ? (0, import_react_dom3.createPortal)(
|
|
2027
|
-
/* @__PURE__ */
|
|
2134
|
+
/* @__PURE__ */ React17.createElement("div", { ref: listRef, "data-density": density, className: "aura-combo__popover", style: posState[0] }, live.length ? /* @__PURE__ */ React17.createElement(
|
|
2028
2135
|
"ul",
|
|
2029
2136
|
{
|
|
2030
2137
|
id: listId,
|
|
@@ -2036,7 +2143,7 @@ window.Aura = (() => {
|
|
|
2036
2143
|
live.map(function(o, i) {
|
|
2037
2144
|
const isSel = multi ? isPicked(o.value) : !!selected && o.value === selected.value;
|
|
2038
2145
|
const blocked = o.disabled || multi && full && !isSel;
|
|
2039
|
-
return /* @__PURE__ */
|
|
2146
|
+
return /* @__PURE__ */ React17.createElement(
|
|
2040
2147
|
"li",
|
|
2041
2148
|
{
|
|
2042
2149
|
key: o.value,
|
|
@@ -2061,15 +2168,15 @@ window.Aura = (() => {
|
|
|
2061
2168
|
if (activeIdx !== i) setActive(i);
|
|
2062
2169
|
}
|
|
2063
2170
|
},
|
|
2064
|
-
o.icon ? /* @__PURE__ */
|
|
2065
|
-
/* @__PURE__ */
|
|
2066
|
-
isSel ? /* @__PURE__ */
|
|
2171
|
+
o.icon ? /* @__PURE__ */ React17.createElement(Icon, { name: o.icon }) : null,
|
|
2172
|
+
/* @__PURE__ */ React17.createElement("span", { className: "aura-combo__text" }, /* @__PURE__ */ React17.createElement("span", { className: "aura-combo__label" }, o.label), o.description ? /* @__PURE__ */ React17.createElement("span", { className: "aura-combo__desc" }, o.description) : null),
|
|
2173
|
+
isSel ? /* @__PURE__ */ React17.createElement(Icon, { name: "check", className: "aura-combo__check" }) : null
|
|
2067
2174
|
);
|
|
2068
2175
|
})
|
|
2069
|
-
) : null, props.loading || !live.length || more ? /* @__PURE__ */
|
|
2176
|
+
) : null, props.loading || !live.length || more ? /* @__PURE__ */ React17.createElement("div", { className: "aura-combo__list", role: "status" }, props.loading ? /* @__PURE__ */ React17.createElement("div", { className: "aura-combo__note" }, /* @__PURE__ */ React17.createElement(Icon, { name: "loader-circle", className: "aura-spin" }), props.loadingText || t.searching) : !live.length ? /* @__PURE__ */ React17.createElement("div", { className: "aura-combo__note" }, props.emptyText || t.noMatches) : /* @__PURE__ */ React17.createElement("div", { className: "aura-combo__note" }, t.keepTyping((props.options || []).length))) : null),
|
|
2070
2177
|
document.body
|
|
2071
2178
|
) : null;
|
|
2072
|
-
return /* @__PURE__ */
|
|
2179
|
+
return /* @__PURE__ */ React17.createElement(
|
|
2073
2180
|
Field,
|
|
2074
2181
|
{
|
|
2075
2182
|
id,
|
|
@@ -2081,8 +2188,8 @@ window.Aura = (() => {
|
|
|
2081
2188
|
disabled: props.disabled,
|
|
2082
2189
|
className: props.className
|
|
2083
2190
|
},
|
|
2084
|
-
/* @__PURE__ */
|
|
2085
|
-
return /* @__PURE__ */
|
|
2191
|
+
/* @__PURE__ */ React17.createElement("div", { ref: boxRef, className: cx("aura-input aura-combo has-icon", open && "is-open", multi && "is-multi") }, /* @__PURE__ */ React17.createElement(Icon, { name: props.icon || "search", className: "aura-input__icon" }), multi && picked.length ? /* @__PURE__ */ React17.createElement("span", { className: "aura-combo__chips" }, picked.map(function(o) {
|
|
2192
|
+
return /* @__PURE__ */ React17.createElement("span", { key: o.value, className: "aura-combo__chip" }, /* @__PURE__ */ React17.createElement("span", { className: "aura-combo__chip-label" }, o.label), props.disabled || props.readOnly ? null : /* @__PURE__ */ React17.createElement(
|
|
2086
2193
|
"button",
|
|
2087
2194
|
{
|
|
2088
2195
|
type: "button",
|
|
@@ -2101,13 +2208,13 @@ window.Aura = (() => {
|
|
|
2101
2208
|
if (inputRef.current) inputRef.current.focus();
|
|
2102
2209
|
}
|
|
2103
2210
|
},
|
|
2104
|
-
/* @__PURE__ */
|
|
2211
|
+
/* @__PURE__ */ React17.createElement(Icon, { name: "x" })
|
|
2105
2212
|
));
|
|
2106
|
-
})) : null, multi ? /* @__PURE__ */
|
|
2213
|
+
})) : null, multi ? /* @__PURE__ */ React17.createElement("span", { id: summaryId, className: "aura-sr-only" }, picked.length ? t.selectedCount(picked.length) + ": " + picked.map(function(o) {
|
|
2107
2214
|
return o.label;
|
|
2108
2215
|
}).join(", ") : "") : null, props.name ? multi ? values.map(function(v) {
|
|
2109
|
-
return /* @__PURE__ */
|
|
2110
|
-
}) : /* @__PURE__ */
|
|
2216
|
+
return /* @__PURE__ */ React17.createElement("input", { key: v, type: "hidden", name: props.name, value: v });
|
|
2217
|
+
}) : /* @__PURE__ */ React17.createElement("input", { type: "hidden", name: props.name, value: value == null ? "" : value }) : null, /* @__PURE__ */ React17.createElement(
|
|
2111
2218
|
"input",
|
|
2112
2219
|
{
|
|
2113
2220
|
ref: inputMerged,
|
|
@@ -2126,7 +2233,7 @@ window.Aura = (() => {
|
|
|
2126
2233
|
disabled: props.disabled,
|
|
2127
2234
|
readOnly: props.readOnly,
|
|
2128
2235
|
required: props.required && (!multi || !values.length),
|
|
2129
|
-
value:
|
|
2236
|
+
value: text2,
|
|
2130
2237
|
onChange: function(e) {
|
|
2131
2238
|
setQuery(e.target.value);
|
|
2132
2239
|
setActive(0);
|
|
@@ -2143,7 +2250,7 @@ window.Aura = (() => {
|
|
|
2143
2250
|
}, 0);
|
|
2144
2251
|
}
|
|
2145
2252
|
}
|
|
2146
|
-
), props.clearable !== false && values.length && !props.disabled && !props.readOnly ? /* @__PURE__ */
|
|
2253
|
+
), props.clearable !== false && values.length && !props.disabled && !props.readOnly ? /* @__PURE__ */ React17.createElement(
|
|
2147
2254
|
"button",
|
|
2148
2255
|
{
|
|
2149
2256
|
type: "button",
|
|
@@ -2156,8 +2263,8 @@ window.Aura = (() => {
|
|
|
2156
2263
|
if (inputRef.current) inputRef.current.focus();
|
|
2157
2264
|
}
|
|
2158
2265
|
},
|
|
2159
|
-
/* @__PURE__ */
|
|
2160
|
-
) : null, /* @__PURE__ */
|
|
2266
|
+
/* @__PURE__ */ React17.createElement(Icon, { name: "x" })
|
|
2267
|
+
) : null, /* @__PURE__ */ React17.createElement(
|
|
2161
2268
|
"button",
|
|
2162
2269
|
{
|
|
2163
2270
|
type: "button",
|
|
@@ -2175,7 +2282,7 @@ window.Aura = (() => {
|
|
|
2175
2282
|
}
|
|
2176
2283
|
}
|
|
2177
2284
|
},
|
|
2178
|
-
/* @__PURE__ */
|
|
2285
|
+
/* @__PURE__ */ React17.createElement(Icon, { name: "chevron-down" })
|
|
2179
2286
|
)),
|
|
2180
2287
|
list
|
|
2181
2288
|
);
|
|
@@ -2183,7 +2290,7 @@ window.Aura = (() => {
|
|
|
2183
2290
|
);
|
|
2184
2291
|
|
|
2185
2292
|
// src/DatePicker.tsx
|
|
2186
|
-
var
|
|
2293
|
+
var React18 = __toESM(require_react(), 1);
|
|
2187
2294
|
var import_react_dom4 = __toESM(require_react_dom(), 1);
|
|
2188
2295
|
|
|
2189
2296
|
// src/dates.ts
|
|
@@ -2321,8 +2428,8 @@ window.Aura = (() => {
|
|
|
2321
2428
|
const k = word.toLowerCase().replace(/\.$/, "");
|
|
2322
2429
|
return MONTHS[k] != null ? MONTHS[k] : -1;
|
|
2323
2430
|
}
|
|
2324
|
-
function parseDate(
|
|
2325
|
-
const raw = String(
|
|
2431
|
+
function parseDate(text2) {
|
|
2432
|
+
const raw = String(text2 || "").trim();
|
|
2326
2433
|
const gregorian = /ค\.ศ\.|\d\s*(AD|CE)\b|^\s*(AD|CE)\s/i.test(raw);
|
|
2327
2434
|
let s = raw.replace(/พ\.ศ\.|ค\.ศ\./g, " ").replace(/(\d)\s*(BE|AD|CE)\b/gi, "$1 ").replace(/^\s*(BE|AD|CE)\s+/i, " ").replace(/\s+/g, " ").trim();
|
|
2328
2435
|
const eight = /^(\d{2})(\d{2})(\d{4})$/.exec(s);
|
|
@@ -2367,7 +2474,7 @@ window.Aura = (() => {
|
|
|
2367
2474
|
// src/DatePicker.tsx
|
|
2368
2475
|
function useFormatDate() {
|
|
2369
2476
|
const ctx = useAuraLocale(), locale = ctx.locale || "en", calendar = ctx.calendar;
|
|
2370
|
-
return
|
|
2477
|
+
return React18.useCallback(
|
|
2371
2478
|
function(iso, opts) {
|
|
2372
2479
|
const o = opts || {}, loc = o.locale || locale;
|
|
2373
2480
|
return formatDate(
|
|
@@ -2388,7 +2495,7 @@ window.Aura = (() => {
|
|
|
2388
2495
|
if (hi && fromISO(hi) && iso > hi) return false;
|
|
2389
2496
|
return !(o.isDateDisabled && o.isDateDisabled(iso));
|
|
2390
2497
|
}
|
|
2391
|
-
var Calendar =
|
|
2498
|
+
var Calendar = React18.forwardRef(function Calendar2(props, ref) {
|
|
2392
2499
|
const ctx = useAuraLocale(), locale = props.locale || ctx.locale || "en", calendar = props.calendar || ctx.calendar || defaultCalendar(locale), tag = localeTag(locale, calendar);
|
|
2393
2500
|
const weekStart = props.weekStartsOn == null ? locale === "sv" ? 1 : 0 : props.weekStartsOn;
|
|
2394
2501
|
const given = props.today && fromISO(props.today) ? props.today : null, zone = props.timeZone || ctx.timeZone;
|
|
@@ -2403,7 +2510,7 @@ window.Aura = (() => {
|
|
|
2403
2510
|
function select(iso) {
|
|
2404
2511
|
if (props.onSelect) props.onSelect(iso);
|
|
2405
2512
|
}
|
|
2406
|
-
const focusState =
|
|
2513
|
+
const focusState = React18.useState(function() {
|
|
2407
2514
|
const d0 = fromISO(props.focus) || start || today;
|
|
2408
2515
|
if (!disabledAt(d0)) return d0;
|
|
2409
2516
|
for (let i = 1; i <= 366; i++) {
|
|
@@ -2413,21 +2520,21 @@ window.Aura = (() => {
|
|
|
2413
2520
|
return d0;
|
|
2414
2521
|
});
|
|
2415
2522
|
const focusDate = focusState[0], setFocus = focusState[1];
|
|
2416
|
-
const viewState =
|
|
2417
|
-
const hoverState =
|
|
2418
|
-
const gridRef =
|
|
2523
|
+
const viewState = React18.useState("days"), view = viewState[0], setView = viewState[1];
|
|
2524
|
+
const hoverState = React18.useState(null);
|
|
2525
|
+
const gridRef = React18.useRef(null), gridMerged = useMergedRef(ref, gridRef), moved = React18.useRef(false);
|
|
2419
2526
|
const th = locale === "th";
|
|
2420
2527
|
const dt = dateText(locale);
|
|
2421
2528
|
function disabled(d) {
|
|
2422
2529
|
return disabledAt(d);
|
|
2423
2530
|
}
|
|
2424
|
-
|
|
2531
|
+
React18.useEffect(function() {
|
|
2425
2532
|
if (!moved.current) return;
|
|
2426
2533
|
moved.current = false;
|
|
2427
2534
|
const el = gridRef.current && gridRef.current.querySelector('[data-date="' + toISO(focusDate) + '"]');
|
|
2428
2535
|
if (el) el.focus();
|
|
2429
2536
|
});
|
|
2430
|
-
|
|
2537
|
+
React18.useEffect(
|
|
2431
2538
|
function() {
|
|
2432
2539
|
if (props.autoFocus === false) return;
|
|
2433
2540
|
const el = gridRef.current && gridRef.current.querySelector('[tabindex="0"]');
|
|
@@ -2482,7 +2589,7 @@ window.Aura = (() => {
|
|
|
2482
2589
|
const yr = focusDate.getFullYear(), base = yr - yr % 12;
|
|
2483
2590
|
const years = [];
|
|
2484
2591
|
for (let y = base; y < base + 12; y++) years.push(y);
|
|
2485
|
-
return /* @__PURE__ */
|
|
2592
|
+
return /* @__PURE__ */ React18.createElement("div", { className: "aura-cal", ref: gridMerged, key: gridKey }, /* @__PURE__ */ React18.createElement("div", { className: "aura-cal__head" }, /* @__PURE__ */ React18.createElement(
|
|
2486
2593
|
IconButton,
|
|
2487
2594
|
{
|
|
2488
2595
|
icon: "chevron-left",
|
|
@@ -2491,7 +2598,7 @@ window.Aura = (() => {
|
|
|
2491
2598
|
setFocus(new Date(yr - 12, focusDate.getMonth(), 1));
|
|
2492
2599
|
}
|
|
2493
2600
|
}
|
|
2494
|
-
), /* @__PURE__ */
|
|
2601
|
+
), /* @__PURE__ */ React18.createElement(
|
|
2495
2602
|
"button",
|
|
2496
2603
|
{
|
|
2497
2604
|
type: "button",
|
|
@@ -2501,7 +2608,7 @@ window.Aura = (() => {
|
|
|
2501
2608
|
}
|
|
2502
2609
|
},
|
|
2503
2610
|
fmt(tag, { year: "numeric" }, new Date(base, 0, 1)).replace(ERA, "") + " \u2013 " + fmt(tag, { year: "numeric" }, new Date(base + 11, 0, 1)).replace(ERA, "")
|
|
2504
|
-
), /* @__PURE__ */
|
|
2611
|
+
), /* @__PURE__ */ React18.createElement(
|
|
2505
2612
|
IconButton,
|
|
2506
2613
|
{
|
|
2507
2614
|
icon: "chevron-right",
|
|
@@ -2510,9 +2617,9 @@ window.Aura = (() => {
|
|
|
2510
2617
|
setFocus(new Date(yr + 12, focusDate.getMonth(), 1));
|
|
2511
2618
|
}
|
|
2512
2619
|
}
|
|
2513
|
-
)), /* @__PURE__ */
|
|
2620
|
+
)), /* @__PURE__ */ React18.createElement("div", { className: "aura-cal__years" }, years.map(function(y) {
|
|
2514
2621
|
const d = new Date(y, focusDate.getMonth(), 1);
|
|
2515
|
-
return /* @__PURE__ */
|
|
2622
|
+
return /* @__PURE__ */ React18.createElement(
|
|
2516
2623
|
"button",
|
|
2517
2624
|
{
|
|
2518
2625
|
key: y,
|
|
@@ -2529,7 +2636,7 @@ window.Aura = (() => {
|
|
|
2529
2636
|
);
|
|
2530
2637
|
})));
|
|
2531
2638
|
}
|
|
2532
|
-
return /* @__PURE__ */
|
|
2639
|
+
return /* @__PURE__ */ React18.createElement("div", { className: "aura-cal", ref: gridMerged, key: gridKey }, /* @__PURE__ */ React18.createElement("div", { className: "aura-cal__head" }, /* @__PURE__ */ React18.createElement(
|
|
2533
2640
|
IconButton,
|
|
2534
2641
|
{
|
|
2535
2642
|
icon: "chevron-left",
|
|
@@ -2538,7 +2645,7 @@ window.Aura = (() => {
|
|
|
2538
2645
|
setFocus(addMonths(focusDate, -1));
|
|
2539
2646
|
}
|
|
2540
2647
|
}
|
|
2541
|
-
), /* @__PURE__ */
|
|
2648
|
+
), /* @__PURE__ */ React18.createElement(
|
|
2542
2649
|
"button",
|
|
2543
2650
|
{
|
|
2544
2651
|
type: "button",
|
|
@@ -2549,8 +2656,8 @@ window.Aura = (() => {
|
|
|
2549
2656
|
}
|
|
2550
2657
|
},
|
|
2551
2658
|
monthTitle,
|
|
2552
|
-
/* @__PURE__ */
|
|
2553
|
-
), /* @__PURE__ */
|
|
2659
|
+
/* @__PURE__ */ React18.createElement(Icon, { name: "chevron-down", size: 14 })
|
|
2660
|
+
), /* @__PURE__ */ React18.createElement(
|
|
2554
2661
|
IconButton,
|
|
2555
2662
|
{
|
|
2556
2663
|
icon: "chevron-right",
|
|
@@ -2559,9 +2666,9 @@ window.Aura = (() => {
|
|
|
2559
2666
|
setFocus(addMonths(focusDate, 1));
|
|
2560
2667
|
}
|
|
2561
2668
|
}
|
|
2562
|
-
)), /* @__PURE__ */
|
|
2563
|
-
return /* @__PURE__ */
|
|
2564
|
-
}))), /* @__PURE__ */
|
|
2669
|
+
)), /* @__PURE__ */ React18.createElement("table", { role: "grid", className: "aura-cal__grid", "aria-label": monthTitle }, /* @__PURE__ */ React18.createElement("thead", null, /* @__PURE__ */ React18.createElement("tr", null, weekdayNames.map(function(n2, i) {
|
|
2670
|
+
return /* @__PURE__ */ React18.createElement("th", { key: i, scope: "col", abbr: n2.long }, /* @__PURE__ */ React18.createElement("span", { "aria-hidden": true }, n2.short));
|
|
2671
|
+
}))), /* @__PURE__ */ React18.createElement(
|
|
2565
2672
|
"tbody",
|
|
2566
2673
|
{
|
|
2567
2674
|
onMouseLeave: function() {
|
|
@@ -2569,11 +2676,11 @@ window.Aura = (() => {
|
|
|
2569
2676
|
}
|
|
2570
2677
|
},
|
|
2571
2678
|
weeks.map(function(wk, wi) {
|
|
2572
|
-
return /* @__PURE__ */
|
|
2679
|
+
return /* @__PURE__ */ React18.createElement("tr", { key: wi }, wk.map(function(d) {
|
|
2573
2680
|
const iso = toISO(d), out = d.getMonth() !== focusDate.getMonth(), dis = disabled(d);
|
|
2574
2681
|
const isStart = same(d, start), isEnd = same(d, end) || !end && props.range && same(d, hover) && start;
|
|
2575
2682
|
const sel = isStart || same(d, end);
|
|
2576
|
-
return /* @__PURE__ */
|
|
2683
|
+
return /* @__PURE__ */ React18.createElement(
|
|
2577
2684
|
"td",
|
|
2578
2685
|
{
|
|
2579
2686
|
key: iso,
|
|
@@ -2585,7 +2692,7 @@ window.Aura = (() => {
|
|
|
2585
2692
|
props.range && isEnd && start && "is-range-end"
|
|
2586
2693
|
)
|
|
2587
2694
|
},
|
|
2588
|
-
/* @__PURE__ */
|
|
2695
|
+
/* @__PURE__ */ React18.createElement(
|
|
2589
2696
|
"button",
|
|
2590
2697
|
{
|
|
2591
2698
|
type: "button",
|
|
@@ -2618,7 +2725,7 @@ window.Aura = (() => {
|
|
|
2618
2725
|
);
|
|
2619
2726
|
}));
|
|
2620
2727
|
})
|
|
2621
|
-
)), props.footer === false ? null : /* @__PURE__ */
|
|
2728
|
+
)), props.footer === false ? null : /* @__PURE__ */ React18.createElement("div", { className: "aura-cal__foot" }, /* @__PURE__ */ React18.createElement(
|
|
2622
2729
|
"button",
|
|
2623
2730
|
{
|
|
2624
2731
|
type: "button",
|
|
@@ -2630,11 +2737,11 @@ window.Aura = (() => {
|
|
|
2630
2737
|
}
|
|
2631
2738
|
},
|
|
2632
2739
|
dt.today
|
|
2633
|
-
), props.onClear ? /* @__PURE__ */
|
|
2740
|
+
), props.onClear ? /* @__PURE__ */ React18.createElement("button", { type: "button", className: "aura-cal__link", onClick: props.onClear }, dt.clear) : null));
|
|
2634
2741
|
});
|
|
2635
2742
|
function useCalendarPopover(boxRef) {
|
|
2636
|
-
const openState =
|
|
2637
|
-
const pos =
|
|
2743
|
+
const openState = React18.useState(false), open = openState[0], setOpen = openState[1];
|
|
2744
|
+
const pos = React18.useState(null), popRef = React18.useRef(null), mounted = useMounted();
|
|
2638
2745
|
function place() {
|
|
2639
2746
|
if (!boxRef.current) return;
|
|
2640
2747
|
const el = popRef.current, r = boxRef.current.getBoundingClientRect(), W = el ? el.offsetWidth : 320, H = el ? el.offsetHeight : 380;
|
|
@@ -2648,7 +2755,7 @@ window.Aura = (() => {
|
|
|
2648
2755
|
},
|
|
2649
2756
|
[open, !!pos[0]]
|
|
2650
2757
|
);
|
|
2651
|
-
|
|
2758
|
+
React18.useEffect(
|
|
2652
2759
|
function() {
|
|
2653
2760
|
if (!open) return;
|
|
2654
2761
|
function outside(e) {
|
|
@@ -2670,8 +2777,8 @@ window.Aura = (() => {
|
|
|
2670
2777
|
return { open, setOpen, pos: pos[0], popRef, mounted };
|
|
2671
2778
|
}
|
|
2672
2779
|
function DateField(props) {
|
|
2673
|
-
const editState =
|
|
2674
|
-
return /* @__PURE__ */
|
|
2780
|
+
const editState = React18.useState(null), editing = editState[0], setEditing = editState[1];
|
|
2781
|
+
return /* @__PURE__ */ React18.createElement(
|
|
2675
2782
|
Field,
|
|
2676
2783
|
{
|
|
2677
2784
|
id: props.id,
|
|
@@ -2683,7 +2790,7 @@ window.Aura = (() => {
|
|
|
2683
2790
|
disabled: props.disabled,
|
|
2684
2791
|
className: props.className
|
|
2685
2792
|
},
|
|
2686
|
-
/* @__PURE__ */
|
|
2793
|
+
/* @__PURE__ */ React18.createElement("div", { ref: props.boxRef, className: cx("aura-input aura-date", props.open && "is-open") }, /* @__PURE__ */ React18.createElement(
|
|
2687
2794
|
"input",
|
|
2688
2795
|
{
|
|
2689
2796
|
ref: props.inputRef,
|
|
@@ -2722,7 +2829,7 @@ window.Aura = (() => {
|
|
|
2722
2829
|
}
|
|
2723
2830
|
}
|
|
2724
2831
|
}
|
|
2725
|
-
), props.clearable !== false && props.hasValue && !props.disabled ? /* @__PURE__ */
|
|
2832
|
+
), props.clearable !== false && props.hasValue && !props.disabled ? /* @__PURE__ */ React18.createElement(
|
|
2726
2833
|
"button",
|
|
2727
2834
|
{
|
|
2728
2835
|
type: "button",
|
|
@@ -2731,8 +2838,8 @@ window.Aura = (() => {
|
|
|
2731
2838
|
"aria-label": props.clearLabel,
|
|
2732
2839
|
onClick: props.onClear
|
|
2733
2840
|
},
|
|
2734
|
-
/* @__PURE__ */
|
|
2735
|
-
) : null, /* @__PURE__ */
|
|
2841
|
+
/* @__PURE__ */ React18.createElement(Icon, { name: "x" })
|
|
2842
|
+
) : null, /* @__PURE__ */ React18.createElement(
|
|
2736
2843
|
"button",
|
|
2737
2844
|
{
|
|
2738
2845
|
type: "button",
|
|
@@ -2746,11 +2853,11 @@ window.Aura = (() => {
|
|
|
2746
2853
|
props.onToggle(!props.open);
|
|
2747
2854
|
}
|
|
2748
2855
|
},
|
|
2749
|
-
/* @__PURE__ */
|
|
2856
|
+
/* @__PURE__ */ React18.createElement(Icon, { name: "calendar" })
|
|
2750
2857
|
))
|
|
2751
2858
|
);
|
|
2752
2859
|
}
|
|
2753
|
-
var DatePicker =
|
|
2860
|
+
var DatePicker = React18.forwardRef(function DatePicker2(props, ref) {
|
|
2754
2861
|
const auto = uid(), id = props.id || auto, dialogId = id + "-cal";
|
|
2755
2862
|
const ctx = useAuraLocale(), locale = props.locale || ctx.locale || "en", calendar = props.calendar || ctx.calendar || defaultCalendar(locale), dt = dateText(locale);
|
|
2756
2863
|
const st = useMaybeControlled(
|
|
@@ -2758,7 +2865,7 @@ window.Aura = (() => {
|
|
|
2758
2865
|
props.defaultValue == null ? null : props.defaultValue,
|
|
2759
2866
|
props.onChange
|
|
2760
2867
|
);
|
|
2761
|
-
const boxRef =
|
|
2868
|
+
const boxRef = React18.useRef(null), inputRef = React18.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
2762
2869
|
const pop = useCalendarPopover(boxRef);
|
|
2763
2870
|
const limits = {
|
|
2764
2871
|
min: props.min,
|
|
@@ -2767,20 +2874,20 @@ window.Aura = (() => {
|
|
|
2767
2874
|
timeZone: props.timeZone || ctx.timeZone,
|
|
2768
2875
|
isDateDisabled: props.isDateDisabled
|
|
2769
2876
|
};
|
|
2770
|
-
const bad =
|
|
2771
|
-
|
|
2877
|
+
const bad = React18.useState(null);
|
|
2878
|
+
React18.useEffect(
|
|
2772
2879
|
function() {
|
|
2773
2880
|
bad[1](null);
|
|
2774
2881
|
},
|
|
2775
2882
|
[st[0]]
|
|
2776
2883
|
);
|
|
2777
|
-
function commit(
|
|
2884
|
+
function commit(text2) {
|
|
2778
2885
|
bad[1](null);
|
|
2779
|
-
if (!
|
|
2886
|
+
if (!text2.trim()) {
|
|
2780
2887
|
st[1](null);
|
|
2781
2888
|
return;
|
|
2782
2889
|
}
|
|
2783
|
-
const iso = parseDate(
|
|
2890
|
+
const iso = parseDate(text2);
|
|
2784
2891
|
if (!iso) return;
|
|
2785
2892
|
if (allowedDate(iso, limits)) st[1](iso);
|
|
2786
2893
|
else bad[1](dt.dateUnavailable);
|
|
@@ -2790,7 +2897,7 @@ window.Aura = (() => {
|
|
|
2790
2897
|
if (inputRef.current) inputRef.current.focus();
|
|
2791
2898
|
}
|
|
2792
2899
|
const cal = pop.open && pop.mounted && pop.pos ? (0, import_react_dom4.createPortal)(
|
|
2793
|
-
/* @__PURE__ */
|
|
2900
|
+
/* @__PURE__ */ React18.createElement(
|
|
2794
2901
|
"div",
|
|
2795
2902
|
{
|
|
2796
2903
|
ref: pop.popRef,
|
|
@@ -2807,7 +2914,7 @@ window.Aura = (() => {
|
|
|
2807
2914
|
} else trapTab(e, pop.popRef.current);
|
|
2808
2915
|
}
|
|
2809
2916
|
},
|
|
2810
|
-
/* @__PURE__ */
|
|
2917
|
+
/* @__PURE__ */ React18.createElement(
|
|
2811
2918
|
Calendar,
|
|
2812
2919
|
{
|
|
2813
2920
|
locale,
|
|
@@ -2830,7 +2937,7 @@ window.Aura = (() => {
|
|
|
2830
2937
|
),
|
|
2831
2938
|
document.body
|
|
2832
2939
|
) : null;
|
|
2833
|
-
return /* @__PURE__ */
|
|
2940
|
+
return /* @__PURE__ */ React18.createElement(React18.Fragment, null, /* @__PURE__ */ React18.createElement(
|
|
2834
2941
|
DateField,
|
|
2835
2942
|
{
|
|
2836
2943
|
id,
|
|
@@ -2865,7 +2972,7 @@ window.Aura = (() => {
|
|
|
2865
2972
|
}
|
|
2866
2973
|
), cal);
|
|
2867
2974
|
});
|
|
2868
|
-
var DateRangePicker =
|
|
2975
|
+
var DateRangePicker = React18.forwardRef(
|
|
2869
2976
|
function DateRangePicker2(props, ref) {
|
|
2870
2977
|
const auto = uid(), id = props.id || auto, dialogId = id + "-cal";
|
|
2871
2978
|
const ctx = useAuraLocale(), locale = props.locale || ctx.locale || "en", calendar = props.calendar || ctx.calendar || defaultCalendar(locale), dt = dateText(locale);
|
|
@@ -2875,8 +2982,8 @@ window.Aura = (() => {
|
|
|
2875
2982
|
props.onChange
|
|
2876
2983
|
);
|
|
2877
2984
|
const v = st[0] || { start: null, end: null };
|
|
2878
|
-
const draft =
|
|
2879
|
-
const boxRef =
|
|
2985
|
+
const draft = React18.useState(null);
|
|
2986
|
+
const boxRef = React18.useRef(null), inputRef = React18.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
2880
2987
|
const pop = useCalendarPopover(boxRef);
|
|
2881
2988
|
const limits = {
|
|
2882
2989
|
min: props.min,
|
|
@@ -2891,17 +2998,17 @@ window.Aura = (() => {
|
|
|
2891
2998
|
if (!r.end) return formatDate(r.start, o) + " \u2013";
|
|
2892
2999
|
return formatDate(r.start, o) + " \u2013 " + formatDate(r.end, o);
|
|
2893
3000
|
}
|
|
2894
|
-
const bad =
|
|
2895
|
-
|
|
3001
|
+
const bad = React18.useState(null);
|
|
3002
|
+
React18.useEffect(
|
|
2896
3003
|
function() {
|
|
2897
3004
|
bad[1](null);
|
|
2898
3005
|
},
|
|
2899
3006
|
[v.start, v.end]
|
|
2900
3007
|
);
|
|
2901
|
-
function commit(
|
|
3008
|
+
function commit(text2) {
|
|
2902
3009
|
bad[1](null);
|
|
2903
|
-
const parts = String(
|
|
2904
|
-
if (!
|
|
3010
|
+
const parts = String(text2).split(/\s[–-]\s|\s*–\s*/);
|
|
3011
|
+
if (!text2.trim()) {
|
|
2905
3012
|
st[1]({ start: null, end: null });
|
|
2906
3013
|
return;
|
|
2907
3014
|
}
|
|
@@ -2925,7 +3032,7 @@ window.Aura = (() => {
|
|
|
2925
3032
|
close();
|
|
2926
3033
|
}
|
|
2927
3034
|
const cal = pop.open && pop.mounted && pop.pos ? (0, import_react_dom4.createPortal)(
|
|
2928
|
-
/* @__PURE__ */
|
|
3035
|
+
/* @__PURE__ */ React18.createElement(
|
|
2929
3036
|
"div",
|
|
2930
3037
|
{
|
|
2931
3038
|
ref: pop.popRef,
|
|
@@ -2942,8 +3049,8 @@ window.Aura = (() => {
|
|
|
2942
3049
|
} else trapTab(e, pop.popRef.current);
|
|
2943
3050
|
}
|
|
2944
3051
|
},
|
|
2945
|
-
/* @__PURE__ */
|
|
2946
|
-
/* @__PURE__ */
|
|
3052
|
+
/* @__PURE__ */ React18.createElement("p", { className: "aura-cal__hint", "aria-live": "polite" }, draft[0] ? dt.chooseEnd : dt.chooseStart),
|
|
3053
|
+
/* @__PURE__ */ React18.createElement(
|
|
2947
3054
|
Calendar,
|
|
2948
3055
|
{
|
|
2949
3056
|
range: true,
|
|
@@ -2964,7 +3071,7 @@ window.Aura = (() => {
|
|
|
2964
3071
|
),
|
|
2965
3072
|
document.body
|
|
2966
3073
|
) : null;
|
|
2967
|
-
return /* @__PURE__ */
|
|
3074
|
+
return /* @__PURE__ */ React18.createElement(React18.Fragment, null, /* @__PURE__ */ React18.createElement(
|
|
2968
3075
|
DateField,
|
|
2969
3076
|
{
|
|
2970
3077
|
id,
|
|
@@ -3003,31 +3110,18 @@ window.Aura = (() => {
|
|
|
3003
3110
|
);
|
|
3004
3111
|
|
|
3005
3112
|
// src/Alert.tsx
|
|
3006
|
-
var
|
|
3007
|
-
var
|
|
3008
|
-
info: "info",
|
|
3009
|
-
success: "circle-check",
|
|
3010
|
-
warning: "triangle-alert",
|
|
3011
|
-
danger: "circle-alert"
|
|
3012
|
-
};
|
|
3013
|
-
var Alert = React18.forwardRef(function Alert2(props, ref) {
|
|
3113
|
+
var React19 = __toESM(require_react(), 1);
|
|
3114
|
+
var Alert = React19.forwardRef(function Alert2(props, ref) {
|
|
3014
3115
|
const t = useStrings();
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
{
|
|
3019
|
-
ref,
|
|
3020
|
-
className: cx("aura-alert", "aura-alert--" + tone2, props.className),
|
|
3021
|
-
role: tone2 === "danger" || tone2 === "warning" ? "alert" : "status"
|
|
3022
|
-
},
|
|
3023
|
-
/* @__PURE__ */ React18.createElement(Icon, { name: ALERT_ICON[tone2], className: "aura-alert__icon" }),
|
|
3024
|
-
/* @__PURE__ */ React18.createElement("div", { className: "aura-alert__body" }, props.title ? /* @__PURE__ */ React18.createElement("p", { className: "aura-alert__title" }, props.title) : null, props.children ? /* @__PURE__ */ React18.createElement("div", { className: "aura-alert__text" }, props.children) : null, props.action ? /* @__PURE__ */ React18.createElement("div", { className: "aura-alert__action" }, props.action) : null),
|
|
3025
|
-
props.onDismiss ? /* @__PURE__ */ React18.createElement(IconButton, { icon: "x", label: t.dismiss, className: "aura-alert__close", onClick: props.onDismiss }) : null
|
|
3116
|
+
return alertElement(
|
|
3117
|
+
props,
|
|
3118
|
+
ref,
|
|
3119
|
+
props.onDismiss ? /* @__PURE__ */ React19.createElement(IconButton, { icon: "x", label: t.dismiss, className: "aura-alert__close", onClick: props.onDismiss }) : null
|
|
3026
3120
|
);
|
|
3027
3121
|
});
|
|
3028
3122
|
|
|
3029
3123
|
// src/Toaster.tsx
|
|
3030
|
-
var
|
|
3124
|
+
var React20 = __toESM(require_react(), 1);
|
|
3031
3125
|
var import_react_dom5 = __toESM(require_react_dom(), 1);
|
|
3032
3126
|
var MAX_VISIBLE = 3;
|
|
3033
3127
|
var toastState = {
|
|
@@ -3103,8 +3197,8 @@ window.Aura = (() => {
|
|
|
3103
3197
|
function ToastItem(props) {
|
|
3104
3198
|
const str = useStrings();
|
|
3105
3199
|
const Link = useLinkComponent();
|
|
3106
|
-
const node =
|
|
3107
|
-
const origin =
|
|
3200
|
+
const node = React20.useRef(null);
|
|
3201
|
+
const origin = React20.useRef(null);
|
|
3108
3202
|
useIsoLayoutEffect(function() {
|
|
3109
3203
|
origin.current = outsideToaster(document.activeElement);
|
|
3110
3204
|
const el = node.current;
|
|
@@ -3120,8 +3214,8 @@ window.Aura = (() => {
|
|
|
3120
3214
|
}, 0);
|
|
3121
3215
|
};
|
|
3122
3216
|
}, []);
|
|
3123
|
-
const t = props.toast, timer =
|
|
3124
|
-
const hover =
|
|
3217
|
+
const t = props.toast, timer = React20.useRef(null), left = React20.useRef(t.duration || 5e3), since = React20.useRef(0);
|
|
3218
|
+
const hover = React20.useRef(false), focused = React20.useRef(false);
|
|
3125
3219
|
function syncFocus() {
|
|
3126
3220
|
if (focused.current && !(node.current && node.current.contains(document.activeElement))) focused.current = false;
|
|
3127
3221
|
}
|
|
@@ -3143,7 +3237,7 @@ window.Aura = (() => {
|
|
|
3143
3237
|
left.current -= Date.now() - since.current;
|
|
3144
3238
|
}
|
|
3145
3239
|
}
|
|
3146
|
-
|
|
3240
|
+
React20.useEffect(
|
|
3147
3241
|
function() {
|
|
3148
3242
|
if (timer.current) clearTimeout(timer.current);
|
|
3149
3243
|
timer.current = null;
|
|
@@ -3162,7 +3256,7 @@ window.Aura = (() => {
|
|
|
3162
3256
|
if (a.onClick) a.onClick();
|
|
3163
3257
|
if (a.dismiss !== false) toast.dismiss(t.id);
|
|
3164
3258
|
}
|
|
3165
|
-
return /* @__PURE__ */
|
|
3259
|
+
return /* @__PURE__ */ React20.createElement(
|
|
3166
3260
|
"div",
|
|
3167
3261
|
{
|
|
3168
3262
|
ref: node,
|
|
@@ -3199,16 +3293,16 @@ window.Aura = (() => {
|
|
|
3199
3293
|
resume();
|
|
3200
3294
|
}
|
|
3201
3295
|
},
|
|
3202
|
-
/* @__PURE__ */
|
|
3296
|
+
/* @__PURE__ */ React20.createElement(
|
|
3203
3297
|
Icon,
|
|
3204
3298
|
{
|
|
3205
3299
|
name: t.loading ? "loader-circle" : ALERT_ICON[t.tone] || "info",
|
|
3206
3300
|
className: cx("aura-toast__icon", t.loading && "aura-spin")
|
|
3207
3301
|
}
|
|
3208
3302
|
),
|
|
3209
|
-
/* @__PURE__ */
|
|
3210
|
-
actions.length ? /* @__PURE__ */
|
|
3211
|
-
return a.href ? /* @__PURE__ */
|
|
3303
|
+
/* @__PURE__ */ React20.createElement("div", { className: "aura-toast__body" }, /* @__PURE__ */ React20.createElement("p", { className: "aura-toast__title" }, t.title), rich ? /* @__PURE__ */ React20.createElement("div", { className: "aura-toast__text" }, t.description) : null),
|
|
3304
|
+
actions.length ? /* @__PURE__ */ React20.createElement("div", { className: "aura-toast__actions" }, actions.map(function(a, i) {
|
|
3305
|
+
return a.href ? /* @__PURE__ */ React20.createElement(
|
|
3212
3306
|
Link,
|
|
3213
3307
|
{
|
|
3214
3308
|
key: i,
|
|
@@ -3220,7 +3314,7 @@ window.Aura = (() => {
|
|
|
3220
3314
|
}
|
|
3221
3315
|
},
|
|
3222
3316
|
a.label
|
|
3223
|
-
) : /* @__PURE__ */
|
|
3317
|
+
) : /* @__PURE__ */ React20.createElement(
|
|
3224
3318
|
"button",
|
|
3225
3319
|
{
|
|
3226
3320
|
key: i,
|
|
@@ -3233,7 +3327,7 @@ window.Aura = (() => {
|
|
|
3233
3327
|
a.label
|
|
3234
3328
|
);
|
|
3235
3329
|
})) : null,
|
|
3236
|
-
/* @__PURE__ */
|
|
3330
|
+
/* @__PURE__ */ React20.createElement(
|
|
3237
3331
|
IconButton,
|
|
3238
3332
|
{
|
|
3239
3333
|
icon: "x",
|
|
@@ -3264,8 +3358,8 @@ window.Aura = (() => {
|
|
|
3264
3358
|
function Toaster(props = {}) {
|
|
3265
3359
|
const t = useStrings();
|
|
3266
3360
|
const mounted = useMounted();
|
|
3267
|
-
const s =
|
|
3268
|
-
|
|
3361
|
+
const s = React20.useState(toastState.list);
|
|
3362
|
+
React20.useEffect(function() {
|
|
3269
3363
|
toastState.subs.push(s[1]);
|
|
3270
3364
|
s[1](toastState.list.slice());
|
|
3271
3365
|
return function() {
|
|
@@ -3274,9 +3368,9 @@ window.Aura = (() => {
|
|
|
3274
3368
|
});
|
|
3275
3369
|
};
|
|
3276
3370
|
}, []);
|
|
3277
|
-
const region =
|
|
3371
|
+
const region = React20.useRef(null);
|
|
3278
3372
|
const hotkey = props.hotkey === void 0 ? "Alt+T" : props.hotkey;
|
|
3279
|
-
|
|
3373
|
+
React20.useEffect(
|
|
3280
3374
|
function() {
|
|
3281
3375
|
if (!hotkey) return;
|
|
3282
3376
|
const match = hotkeyMatcher(hotkey);
|
|
@@ -3307,7 +3401,7 @@ window.Aura = (() => {
|
|
|
3307
3401
|
const pos = props.position || "bottom";
|
|
3308
3402
|
const offset = props.offset;
|
|
3309
3403
|
return (0, import_react_dom5.createPortal)(
|
|
3310
|
-
/* @__PURE__ */
|
|
3404
|
+
/* @__PURE__ */ React20.createElement(
|
|
3311
3405
|
"div",
|
|
3312
3406
|
{
|
|
3313
3407
|
ref: region,
|
|
@@ -3319,7 +3413,7 @@ window.Aura = (() => {
|
|
|
3319
3413
|
"aria-keyshortcuts": hotkey || void 0
|
|
3320
3414
|
},
|
|
3321
3415
|
s[0].map(function(t2) {
|
|
3322
|
-
return /* @__PURE__ */
|
|
3416
|
+
return /* @__PURE__ */ React20.createElement(ToastItem, { key: t2.id, toast: t2 });
|
|
3323
3417
|
})
|
|
3324
3418
|
),
|
|
3325
3419
|
document.body
|
|
@@ -3327,12 +3421,12 @@ window.Aura = (() => {
|
|
|
3327
3421
|
}
|
|
3328
3422
|
|
|
3329
3423
|
// src/PasswordField.tsx
|
|
3330
|
-
var
|
|
3331
|
-
var PasswordField =
|
|
3424
|
+
var React21 = __toESM(require_react(), 1);
|
|
3425
|
+
var PasswordField = React21.forwardRef(function PasswordField2(props, ref) {
|
|
3332
3426
|
const t = useStrings();
|
|
3333
|
-
const shown =
|
|
3427
|
+
const shown = React21.useState(false);
|
|
3334
3428
|
const rest = omit(props, ["toggle", "className"]);
|
|
3335
|
-
return /* @__PURE__ */
|
|
3429
|
+
return /* @__PURE__ */ React21.createElement(
|
|
3336
3430
|
TextField,
|
|
3337
3431
|
{
|
|
3338
3432
|
autoComplete: "current-password",
|
|
@@ -3342,7 +3436,7 @@ window.Aura = (() => {
|
|
|
3342
3436
|
spellCheck: false,
|
|
3343
3437
|
autoCapitalize: "none",
|
|
3344
3438
|
className: cx("aura-password", props.className),
|
|
3345
|
-
suffix: props.toggle === false ? void 0 : /* @__PURE__ */
|
|
3439
|
+
suffix: props.toggle === false ? void 0 : /* @__PURE__ */ React21.createElement(
|
|
3346
3440
|
IconButton,
|
|
3347
3441
|
{
|
|
3348
3442
|
icon: shown[0] ? "eye-off" : "eye",
|
|
@@ -3359,7 +3453,7 @@ window.Aura = (() => {
|
|
|
3359
3453
|
});
|
|
3360
3454
|
|
|
3361
3455
|
// src/FormErrorSummary.tsx
|
|
3362
|
-
var
|
|
3456
|
+
var React22 = __toESM(require_react(), 1);
|
|
3363
3457
|
function items(errors) {
|
|
3364
3458
|
if (Array.isArray(errors)) return errors;
|
|
3365
3459
|
const out = [];
|
|
@@ -3388,23 +3482,59 @@ window.Aura = (() => {
|
|
|
3388
3482
|
}
|
|
3389
3483
|
return named;
|
|
3390
3484
|
}
|
|
3391
|
-
var FormErrorSummary =
|
|
3485
|
+
var FormErrorSummary = React22.forwardRef(
|
|
3392
3486
|
function FormErrorSummary2(props, ref) {
|
|
3393
3487
|
const t = useStrings();
|
|
3394
3488
|
const auto = uid(), id = props.id || auto;
|
|
3395
3489
|
const list = items(props.errors);
|
|
3396
|
-
const box =
|
|
3397
|
-
|
|
3490
|
+
const box = React22.useRef(null);
|
|
3491
|
+
const keyed = props.focusKey !== void 0;
|
|
3492
|
+
const lastKey = React22.useRef(null), armed = React22.useRef(false), hadErrors = React22.useRef(false);
|
|
3493
|
+
const has = list.length > 0;
|
|
3494
|
+
React22.useEffect(
|
|
3398
3495
|
function() {
|
|
3399
|
-
const
|
|
3400
|
-
|
|
3496
|
+
const appeared = has && !hadErrors.current;
|
|
3497
|
+
hadErrors.current = has;
|
|
3498
|
+
if (!keyed) {
|
|
3499
|
+
lastKey.current = null;
|
|
3500
|
+
if (appeared && box.current) box.current.focus();
|
|
3501
|
+
return;
|
|
3502
|
+
}
|
|
3503
|
+
if (!lastKey.current) {
|
|
3504
|
+
lastKey.current = { v: props.focusKey };
|
|
3505
|
+
armed.current = has;
|
|
3506
|
+
} else if (!Object.is(lastKey.current.v, props.focusKey)) {
|
|
3507
|
+
lastKey.current = { v: props.focusKey };
|
|
3508
|
+
armed.current = true;
|
|
3509
|
+
}
|
|
3510
|
+
if (armed.current && has && box.current) {
|
|
3511
|
+
armed.current = false;
|
|
3512
|
+
box.current.focus();
|
|
3513
|
+
}
|
|
3401
3514
|
},
|
|
3402
|
-
/* focus when errors first appear, and again whenever focusKey changes (each submit) */
|
|
3403
3515
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3404
|
-
[
|
|
3516
|
+
[has, props.focusKey, keyed]
|
|
3517
|
+
);
|
|
3518
|
+
React22.useEffect(
|
|
3519
|
+
function() {
|
|
3520
|
+
if (!keyed) return;
|
|
3521
|
+
function disarm() {
|
|
3522
|
+
armed.current = false;
|
|
3523
|
+
}
|
|
3524
|
+
const events = ["input", "change", "keydown", "pointerdown"];
|
|
3525
|
+
events.forEach(function(n2) {
|
|
3526
|
+
document.addEventListener(n2, disarm, true);
|
|
3527
|
+
});
|
|
3528
|
+
return function() {
|
|
3529
|
+
events.forEach(function(n2) {
|
|
3530
|
+
document.removeEventListener(n2, disarm, true);
|
|
3531
|
+
});
|
|
3532
|
+
};
|
|
3533
|
+
},
|
|
3534
|
+
[keyed]
|
|
3405
3535
|
);
|
|
3406
3536
|
if (!list.length) return null;
|
|
3407
|
-
return /* @__PURE__ */
|
|
3537
|
+
return /* @__PURE__ */ React22.createElement(
|
|
3408
3538
|
"div",
|
|
3409
3539
|
{
|
|
3410
3540
|
ref: function(el) {
|
|
@@ -3418,9 +3548,9 @@ window.Aura = (() => {
|
|
|
3418
3548
|
"aria-labelledby": id + "-title",
|
|
3419
3549
|
className: cx("aura-alert aura-alert--danger aura-error-summary", props.className)
|
|
3420
3550
|
},
|
|
3421
|
-
/* @__PURE__ */
|
|
3422
|
-
/* @__PURE__ */
|
|
3423
|
-
return /* @__PURE__ */
|
|
3551
|
+
/* @__PURE__ */ React22.createElement(Icon, { name: "circle-alert", className: "aura-alert__icon" }),
|
|
3552
|
+
/* @__PURE__ */ React22.createElement("div", { className: "aura-alert__body" }, /* @__PURE__ */ React22.createElement("h2", { className: "aura-alert__title", id: id + "-title" }, props.title || t.errorSummary(list.length)), /* @__PURE__ */ React22.createElement("ul", { className: "aura-error-summary__list" }, list.map(function(e) {
|
|
3553
|
+
return /* @__PURE__ */ React22.createElement("li", { key: e.field }, /* @__PURE__ */ React22.createElement(
|
|
3424
3554
|
"a",
|
|
3425
3555
|
{
|
|
3426
3556
|
href: "#" + e.field,
|
|
@@ -3445,20 +3575,20 @@ window.Aura = (() => {
|
|
|
3445
3575
|
);
|
|
3446
3576
|
|
|
3447
3577
|
// src/FilterBar.tsx
|
|
3448
|
-
var
|
|
3578
|
+
var React24 = __toESM(require_react(), 1);
|
|
3449
3579
|
|
|
3450
3580
|
// src/Tag.tsx
|
|
3451
|
-
var
|
|
3452
|
-
var Tag =
|
|
3581
|
+
var React23 = __toESM(require_react(), 1);
|
|
3582
|
+
var Tag = React23.forwardRef(function Tag2(props, ref) {
|
|
3453
3583
|
const t = useStrings();
|
|
3454
3584
|
const selectable = props.onClick != null || props.selected != null;
|
|
3455
3585
|
const rest = omit(props, ["onRemove", "selected", "icon", "className", "children", "disabled", "removeLabel"]);
|
|
3456
3586
|
const inner = [
|
|
3457
|
-
props.icon ? /* @__PURE__ */
|
|
3458
|
-
/* @__PURE__ */
|
|
3587
|
+
props.icon ? /* @__PURE__ */ React23.createElement(Icon, { key: "i", name: props.icon, size: 14 }) : null,
|
|
3588
|
+
/* @__PURE__ */ React23.createElement("span", { key: "t", className: "aura-tag__text" }, props.children)
|
|
3459
3589
|
];
|
|
3460
3590
|
if (selectable) {
|
|
3461
|
-
return /* @__PURE__ */
|
|
3591
|
+
return /* @__PURE__ */ React23.createElement(
|
|
3462
3592
|
"button",
|
|
3463
3593
|
{
|
|
3464
3594
|
...rest,
|
|
@@ -3468,11 +3598,11 @@ window.Aura = (() => {
|
|
|
3468
3598
|
disabled: props.disabled,
|
|
3469
3599
|
className: cx("aura-tag is-selectable", props.selected && "is-selected", props.className)
|
|
3470
3600
|
},
|
|
3471
|
-
props.selected ? /* @__PURE__ */
|
|
3601
|
+
props.selected ? /* @__PURE__ */ React23.createElement(Icon, { name: "check", size: 14 }) : inner[0],
|
|
3472
3602
|
inner[1]
|
|
3473
3603
|
);
|
|
3474
3604
|
}
|
|
3475
|
-
return /* @__PURE__ */
|
|
3605
|
+
return /* @__PURE__ */ React23.createElement("span", { ...rest, ref, className: cx("aura-tag", props.disabled && "is-disabled", props.className) }, inner, props.onRemove && !props.disabled ? /* @__PURE__ */ React23.createElement(
|
|
3476
3606
|
"button",
|
|
3477
3607
|
{
|
|
3478
3608
|
type: "button",
|
|
@@ -3480,21 +3610,21 @@ window.Aura = (() => {
|
|
|
3480
3610
|
"aria-label": props.removeLabel || t.remove(typeof props.children === "string" ? props.children : ""),
|
|
3481
3611
|
onClick: props.onRemove
|
|
3482
3612
|
},
|
|
3483
|
-
/* @__PURE__ */
|
|
3613
|
+
/* @__PURE__ */ React23.createElement(Icon, { name: "x", size: 12 })
|
|
3484
3614
|
) : null);
|
|
3485
3615
|
});
|
|
3486
3616
|
|
|
3487
3617
|
// src/FilterBar.tsx
|
|
3488
|
-
var FilterBar =
|
|
3618
|
+
var FilterBar = React24.forwardRef(function FilterBar2(props, ref) {
|
|
3489
3619
|
const t = useStrings();
|
|
3490
3620
|
const id = uid();
|
|
3491
3621
|
const hasSearch = !!props.onSearchChange;
|
|
3492
|
-
const draft =
|
|
3493
|
-
const timer =
|
|
3494
|
-
const sent =
|
|
3495
|
-
const onChange =
|
|
3622
|
+
const draft = React24.useState(props.search || "");
|
|
3623
|
+
const timer = React24.useRef(null);
|
|
3624
|
+
const sent = React24.useRef(props.search || "");
|
|
3625
|
+
const onChange = React24.useRef(props.onSearchChange);
|
|
3496
3626
|
onChange.current = props.onSearchChange;
|
|
3497
|
-
|
|
3627
|
+
React24.useEffect(
|
|
3498
3628
|
function() {
|
|
3499
3629
|
if ((props.search || "") !== sent.current) {
|
|
3500
3630
|
sent.current = props.search || "";
|
|
@@ -3503,7 +3633,7 @@ window.Aura = (() => {
|
|
|
3503
3633
|
},
|
|
3504
3634
|
[props.search]
|
|
3505
3635
|
);
|
|
3506
|
-
|
|
3636
|
+
React24.useEffect(function() {
|
|
3507
3637
|
return function() {
|
|
3508
3638
|
if (timer.current) clearTimeout(timer.current);
|
|
3509
3639
|
};
|
|
@@ -3528,7 +3658,7 @@ window.Aura = (() => {
|
|
|
3528
3658
|
const filters = props.filters || [];
|
|
3529
3659
|
const anything = filters.length > 0 || !!(props.search || draft[0]);
|
|
3530
3660
|
const count = props.resultCount == null ? null : typeof props.resultCount === "number" ? t.results(props.resultCount) : props.resultCount;
|
|
3531
|
-
return /* @__PURE__ */
|
|
3661
|
+
return /* @__PURE__ */ React24.createElement(
|
|
3532
3662
|
"div",
|
|
3533
3663
|
{
|
|
3534
3664
|
ref,
|
|
@@ -3536,7 +3666,7 @@ window.Aura = (() => {
|
|
|
3536
3666
|
"aria-label": props.label || t.filters,
|
|
3537
3667
|
className: cx("aura-filterbar", props.className)
|
|
3538
3668
|
},
|
|
3539
|
-
/* @__PURE__ */
|
|
3669
|
+
/* @__PURE__ */ React24.createElement("div", { className: "aura-filterbar__row" }, hasSearch ? /* @__PURE__ */ React24.createElement("div", { className: "aura-input has-icon aura-filterbar__search" }, /* @__PURE__ */ React24.createElement(Icon, { name: "search", className: "aura-input__icon" }), /* @__PURE__ */ React24.createElement(
|
|
3540
3670
|
"input",
|
|
3541
3671
|
{
|
|
3542
3672
|
id,
|
|
@@ -3557,7 +3687,7 @@ window.Aura = (() => {
|
|
|
3557
3687
|
}
|
|
3558
3688
|
}
|
|
3559
3689
|
}
|
|
3560
|
-
), draft[0] ? /* @__PURE__ */
|
|
3690
|
+
), draft[0] ? /* @__PURE__ */ React24.createElement(
|
|
3561
3691
|
IconButton,
|
|
3562
3692
|
{
|
|
3563
3693
|
icon: "x",
|
|
@@ -3568,10 +3698,10 @@ window.Aura = (() => {
|
|
|
3568
3698
|
send("");
|
|
3569
3699
|
}
|
|
3570
3700
|
}
|
|
3571
|
-
) : null) : null, props.children ? /* @__PURE__ */
|
|
3572
|
-
filters.length || props.onClearAll && anything ? /* @__PURE__ */
|
|
3573
|
-
return /* @__PURE__ */
|
|
3574
|
-
}), props.onClearAll && anything ? /* @__PURE__ */
|
|
3701
|
+
) : null) : null, props.children ? /* @__PURE__ */ React24.createElement("div", { className: "aura-filterbar__controls" }, props.children) : null, /* @__PURE__ */ React24.createElement("span", { className: "aura-filterbar__spacer" }), count != null ? /* @__PURE__ */ React24.createElement("span", { className: "aura-filterbar__count", "aria-live": "polite" }, count) : null, props.actions ? /* @__PURE__ */ React24.createElement("div", { className: "aura-filterbar__actions" }, props.actions) : null),
|
|
3702
|
+
filters.length || props.onClearAll && anything ? /* @__PURE__ */ React24.createElement("div", { className: "aura-filterbar__chips" }, filters.map(function(f) {
|
|
3703
|
+
return /* @__PURE__ */ React24.createElement(Tag, { key: f.id, onRemove: f.onRemove }, f.label);
|
|
3704
|
+
}), props.onClearAll && anything ? /* @__PURE__ */ React24.createElement(
|
|
3575
3705
|
"button",
|
|
3576
3706
|
{
|
|
3577
3707
|
type: "button",
|
|
@@ -3589,11 +3719,11 @@ window.Aura = (() => {
|
|
|
3589
3719
|
});
|
|
3590
3720
|
|
|
3591
3721
|
// src/Command.tsx
|
|
3592
|
-
var
|
|
3722
|
+
var React26 = __toESM(require_react(), 1);
|
|
3593
3723
|
var import_react_dom6 = __toESM(require_react_dom(), 1);
|
|
3594
3724
|
|
|
3595
3725
|
// src/useModal.tsx
|
|
3596
|
-
var
|
|
3726
|
+
var React25 = __toESM(require_react(), 1);
|
|
3597
3727
|
var locks = 0;
|
|
3598
3728
|
var savedOverflow = "";
|
|
3599
3729
|
function lockScroll() {
|
|
@@ -3620,9 +3750,9 @@ window.Aura = (() => {
|
|
|
3620
3750
|
}
|
|
3621
3751
|
function useModal(open, ref, opts) {
|
|
3622
3752
|
const mounted = useMounted();
|
|
3623
|
-
const prev =
|
|
3753
|
+
const prev = React25.useRef(null);
|
|
3624
3754
|
const o = opts || {};
|
|
3625
|
-
|
|
3755
|
+
React25.useEffect(
|
|
3626
3756
|
function() {
|
|
3627
3757
|
if (!open || !mounted) return;
|
|
3628
3758
|
prev.current = document.activeElement;
|
|
@@ -3680,21 +3810,21 @@ window.Aura = (() => {
|
|
|
3680
3810
|
const t = useStrings();
|
|
3681
3811
|
const density = useDensity();
|
|
3682
3812
|
const id = uid(), listId = id + "-list";
|
|
3683
|
-
const box =
|
|
3684
|
-
const input =
|
|
3685
|
-
const qState =
|
|
3813
|
+
const box = React26.useRef(null);
|
|
3814
|
+
const input = React26.useRef(null);
|
|
3815
|
+
const qState = React26.useState(""), act = React26.useState(null);
|
|
3686
3816
|
const query = props.query !== void 0 ? props.query : qState[0];
|
|
3687
3817
|
function setQuery(v) {
|
|
3688
3818
|
if (props.query === void 0) qState[1](v);
|
|
3689
3819
|
if (props.onQueryChange) props.onQueryChange(v);
|
|
3690
3820
|
}
|
|
3691
|
-
const openRef =
|
|
3821
|
+
const openRef = React26.useRef(props.open);
|
|
3692
3822
|
openRef.current = props.open;
|
|
3693
3823
|
const close = function() {
|
|
3694
3824
|
props.onOpenChange(false);
|
|
3695
3825
|
};
|
|
3696
3826
|
const modal = useModal(props.open, box, { onEscape: close });
|
|
3697
|
-
|
|
3827
|
+
React26.useEffect(
|
|
3698
3828
|
function() {
|
|
3699
3829
|
if (props.hotkey === false) return;
|
|
3700
3830
|
function onKey2(e) {
|
|
@@ -3710,7 +3840,7 @@ window.Aura = (() => {
|
|
|
3710
3840
|
},
|
|
3711
3841
|
[props.hotkey, props.onOpenChange]
|
|
3712
3842
|
);
|
|
3713
|
-
|
|
3843
|
+
React26.useEffect(
|
|
3714
3844
|
function() {
|
|
3715
3845
|
if (!props.open) {
|
|
3716
3846
|
if (query) setQuery("");
|
|
@@ -3732,25 +3862,25 @@ window.Aura = (() => {
|
|
|
3732
3862
|
if (!g) groups.push(g = { name, items: [] });
|
|
3733
3863
|
g.items.push(it);
|
|
3734
3864
|
});
|
|
3735
|
-
const
|
|
3865
|
+
const flat2 = [];
|
|
3736
3866
|
groups.forEach(function(g) {
|
|
3737
3867
|
g.items.forEach(function(it) {
|
|
3738
|
-
|
|
3868
|
+
flat2.push(it);
|
|
3739
3869
|
});
|
|
3740
3870
|
});
|
|
3741
|
-
const enabled =
|
|
3871
|
+
const enabled = flat2.map(function(it, i2) {
|
|
3742
3872
|
return it.disabled ? -1 : i2;
|
|
3743
3873
|
}).filter(function(i2) {
|
|
3744
3874
|
return i2 >= 0;
|
|
3745
3875
|
});
|
|
3746
|
-
const byId = act[0] == null ? -1 :
|
|
3876
|
+
const byId = act[0] == null ? -1 : flat2.findIndex(function(it) {
|
|
3747
3877
|
return it.id === act[0];
|
|
3748
3878
|
});
|
|
3749
3879
|
const active = enabled.indexOf(byId) >= 0 ? byId : enabled.length ? enabled[0] : -1;
|
|
3750
3880
|
const optId = function(i2) {
|
|
3751
3881
|
return id + "-o" + i2;
|
|
3752
3882
|
};
|
|
3753
|
-
|
|
3883
|
+
React26.useEffect(
|
|
3754
3884
|
function() {
|
|
3755
3885
|
if (!box.current || active < 0) return;
|
|
3756
3886
|
const el = box.current.querySelector("#" + CSS.escape(optId(active)));
|
|
@@ -3771,7 +3901,7 @@ window.Aura = (() => {
|
|
|
3771
3901
|
if (dir === "first") n2 = 0;
|
|
3772
3902
|
else if (dir === "last") n2 = enabled.length - 1;
|
|
3773
3903
|
else n2 = (at + dir + enabled.length) % enabled.length;
|
|
3774
|
-
act[1](
|
|
3904
|
+
act[1](flat2[enabled[n2]].id);
|
|
3775
3905
|
}
|
|
3776
3906
|
function onKey(e) {
|
|
3777
3907
|
if (e.key === "ArrowDown") {
|
|
@@ -3789,13 +3919,13 @@ window.Aura = (() => {
|
|
|
3789
3919
|
} else if (e.key === "Enter") {
|
|
3790
3920
|
if (e.nativeEvent.isComposing || e.keyCode === 229) return;
|
|
3791
3921
|
e.preventDefault();
|
|
3792
|
-
if (active >= 0) run(
|
|
3922
|
+
if (active >= 0) run(flat2[active]);
|
|
3793
3923
|
}
|
|
3794
3924
|
}
|
|
3795
3925
|
if (!modal.ready) return null;
|
|
3796
3926
|
let i = -1;
|
|
3797
3927
|
return (0, import_react_dom6.createPortal)(
|
|
3798
|
-
/* @__PURE__ */
|
|
3928
|
+
/* @__PURE__ */ React26.createElement(
|
|
3799
3929
|
"div",
|
|
3800
3930
|
{
|
|
3801
3931
|
className: "aura-dialog-layer aura-command-layer",
|
|
@@ -3805,8 +3935,8 @@ window.Aura = (() => {
|
|
|
3805
3935
|
e.stopPropagation();
|
|
3806
3936
|
}
|
|
3807
3937
|
},
|
|
3808
|
-
/* @__PURE__ */
|
|
3809
|
-
/* @__PURE__ */
|
|
3938
|
+
/* @__PURE__ */ React26.createElement("div", { className: "aura-scrim", onClick: close, "aria-hidden": true }),
|
|
3939
|
+
/* @__PURE__ */ React26.createElement(
|
|
3810
3940
|
"div",
|
|
3811
3941
|
{
|
|
3812
3942
|
ref: box,
|
|
@@ -3816,15 +3946,15 @@ window.Aura = (() => {
|
|
|
3816
3946
|
tabIndex: -1,
|
|
3817
3947
|
className: cx("aura-command", props.className)
|
|
3818
3948
|
},
|
|
3819
|
-
/* @__PURE__ */
|
|
3949
|
+
/* @__PURE__ */ React26.createElement("div", { className: "aura-command__search" }, /* @__PURE__ */ React26.createElement(Icon, { name: "search", className: "aura-command__search-icon" }), /* @__PURE__ */ React26.createElement(
|
|
3820
3950
|
"input",
|
|
3821
3951
|
{
|
|
3822
3952
|
ref: input,
|
|
3823
3953
|
"data-autofocus": "",
|
|
3824
3954
|
type: "text",
|
|
3825
3955
|
role: "combobox",
|
|
3826
|
-
"aria-expanded":
|
|
3827
|
-
"aria-controls":
|
|
3956
|
+
"aria-expanded": flat2.length > 0,
|
|
3957
|
+
"aria-controls": flat2.length ? listId : void 0,
|
|
3828
3958
|
"aria-autocomplete": "list",
|
|
3829
3959
|
"aria-activedescendant": active >= 0 ? optId(active) : void 0,
|
|
3830
3960
|
"aria-label": props.label || t.commandMenu,
|
|
@@ -3839,8 +3969,8 @@ window.Aura = (() => {
|
|
|
3839
3969
|
},
|
|
3840
3970
|
onKeyDown: onKey
|
|
3841
3971
|
}
|
|
3842
|
-
), /* @__PURE__ */
|
|
3843
|
-
/* @__PURE__ */
|
|
3972
|
+
), /* @__PURE__ */ React26.createElement("kbd", { className: "aura-command__kbd" }, "Esc")),
|
|
3973
|
+
/* @__PURE__ */ React26.createElement("div", { className: "aura-command__list", "aria-busy": props.loading || void 0 }, props.loading ? /* @__PURE__ */ React26.createElement("div", { className: "aura-command__loading" }, /* @__PURE__ */ React26.createElement(Icon, { name: "loader-circle", className: "aura-spin" }), t.searching) : null, !flat2.length ? props.loading ? null : /* @__PURE__ */ React26.createElement("div", { className: "aura-command__empty" }, props.empty != null ? props.empty : props.emptyText || t.noMatches) : /* @__PURE__ */ React26.createElement(
|
|
3844
3974
|
"div",
|
|
3845
3975
|
{
|
|
3846
3976
|
id: listId,
|
|
@@ -3850,7 +3980,7 @@ window.Aura = (() => {
|
|
|
3850
3980
|
},
|
|
3851
3981
|
groups.map(function(g, gi) {
|
|
3852
3982
|
const gid = id + "-g" + gi;
|
|
3853
|
-
return /* @__PURE__ */
|
|
3983
|
+
return /* @__PURE__ */ React26.createElement(
|
|
3854
3984
|
"div",
|
|
3855
3985
|
{
|
|
3856
3986
|
key: g.name || gi,
|
|
@@ -3858,11 +3988,11 @@ window.Aura = (() => {
|
|
|
3858
3988
|
"aria-labelledby": g.name ? gid : void 0,
|
|
3859
3989
|
className: "aura-command__group"
|
|
3860
3990
|
},
|
|
3861
|
-
g.name ? /* @__PURE__ */
|
|
3991
|
+
g.name ? /* @__PURE__ */ React26.createElement("div", { className: "aura-command__heading", id: gid, role: "presentation" }, g.name) : null,
|
|
3862
3992
|
g.items.map(function(it) {
|
|
3863
3993
|
i++;
|
|
3864
3994
|
const n2 = i;
|
|
3865
|
-
return /* @__PURE__ */
|
|
3995
|
+
return /* @__PURE__ */ React26.createElement(
|
|
3866
3996
|
"div",
|
|
3867
3997
|
{
|
|
3868
3998
|
key: it.id,
|
|
@@ -3885,16 +4015,16 @@ window.Aura = (() => {
|
|
|
3885
4015
|
run(it);
|
|
3886
4016
|
}
|
|
3887
4017
|
},
|
|
3888
|
-
it.icon ? /* @__PURE__ */
|
|
3889
|
-
/* @__PURE__ */
|
|
3890
|
-
it.shortcut ? /* @__PURE__ */
|
|
4018
|
+
it.icon ? /* @__PURE__ */ React26.createElement(Icon, { name: it.icon }) : null,
|
|
4019
|
+
/* @__PURE__ */ React26.createElement("span", { className: "aura-command__text" }, /* @__PURE__ */ React26.createElement("span", { className: "aura-command__label" }, it.label), it.description ? /* @__PURE__ */ React26.createElement("span", { className: "aura-command__desc" }, it.description) : null),
|
|
4020
|
+
it.shortcut ? /* @__PURE__ */ React26.createElement("kbd", { className: "aura-command__kbd" }, it.shortcut) : null
|
|
3891
4021
|
);
|
|
3892
4022
|
})
|
|
3893
4023
|
);
|
|
3894
4024
|
})
|
|
3895
4025
|
)),
|
|
3896
|
-
/* @__PURE__ */
|
|
3897
|
-
/* @__PURE__ */
|
|
4026
|
+
/* @__PURE__ */ React26.createElement("span", { className: "aura-sr-only", role: "status" }, props.loading ? t.searching : query && !flat2.length ? t.noMatches : props.loading === false && query ? t.results(flat2.length) : ""),
|
|
4027
|
+
/* @__PURE__ */ React26.createElement("div", { className: "aura-command__foot", "aria-hidden": true }, t.commandHint, /* @__PURE__ */ React26.createElement("span", { className: "aura-command__mod" }, isMac() ? "\u2318K" : "Ctrl K"))
|
|
3898
4028
|
)
|
|
3899
4029
|
),
|
|
3900
4030
|
document.body
|
|
@@ -3902,12 +4032,12 @@ window.Aura = (() => {
|
|
|
3902
4032
|
}
|
|
3903
4033
|
|
|
3904
4034
|
// src/Tooltip.tsx
|
|
3905
|
-
var
|
|
4035
|
+
var React27 = __toESM(require_react(), 1);
|
|
3906
4036
|
var import_react_dom7 = __toESM(require_react_dom(), 1);
|
|
3907
|
-
var Tooltip =
|
|
3908
|
-
const id = uid(), st =
|
|
3909
|
-
const anchor =
|
|
3910
|
-
const pos =
|
|
4037
|
+
var Tooltip = React27.forwardRef(function Tooltip2(props, ref) {
|
|
4038
|
+
const id = uid(), st = React27.useState(false), open = props.open !== void 0 ? props.open : st[0], set = st[1];
|
|
4039
|
+
const anchor = React27.useRef(null), anchorMerged = useMergedRef(ref, anchor), tip = React27.useRef(null), timer = React27.useRef(void 0);
|
|
4040
|
+
const pos = React27.useState(null), mounted = useMounted();
|
|
3911
4041
|
function show2(now) {
|
|
3912
4042
|
clearTimeout(timer.current);
|
|
3913
4043
|
timer.current = setTimeout(
|
|
@@ -3927,7 +4057,7 @@ window.Aura = (() => {
|
|
|
3927
4057
|
set(false);
|
|
3928
4058
|
}, 120);
|
|
3929
4059
|
}
|
|
3930
|
-
|
|
4060
|
+
React27.useEffect(function() {
|
|
3931
4061
|
return function() {
|
|
3932
4062
|
clearTimeout(timer.current);
|
|
3933
4063
|
};
|
|
@@ -3971,7 +4101,7 @@ window.Aura = (() => {
|
|
|
3971
4101
|
},
|
|
3972
4102
|
[open, mounted]
|
|
3973
4103
|
);
|
|
3974
|
-
|
|
4104
|
+
React27.useEffect(
|
|
3975
4105
|
function() {
|
|
3976
4106
|
if (!open) return;
|
|
3977
4107
|
function esc(e) {
|
|
@@ -3984,8 +4114,8 @@ window.Aura = (() => {
|
|
|
3984
4114
|
},
|
|
3985
4115
|
[open]
|
|
3986
4116
|
);
|
|
3987
|
-
const child =
|
|
3988
|
-
const trigger = /* @__PURE__ */
|
|
4117
|
+
const child = React27.Children.only(props.children);
|
|
4118
|
+
const trigger = /* @__PURE__ */ React27.createElement(
|
|
3989
4119
|
"span",
|
|
3990
4120
|
{
|
|
3991
4121
|
ref: anchorMerged,
|
|
@@ -3999,10 +4129,10 @@ window.Aura = (() => {
|
|
|
3999
4129
|
},
|
|
4000
4130
|
onBlur: hide
|
|
4001
4131
|
},
|
|
4002
|
-
|
|
4132
|
+
React27.cloneElement(child, { "aria-describedby": open ? id : child.props["aria-describedby"] })
|
|
4003
4133
|
);
|
|
4004
|
-
return /* @__PURE__ */
|
|
4005
|
-
/* @__PURE__ */
|
|
4134
|
+
return /* @__PURE__ */ React27.createElement(React27.Fragment, null, trigger, open && mounted ? (0, import_react_dom7.createPortal)(
|
|
4135
|
+
/* @__PURE__ */ React27.createElement(
|
|
4006
4136
|
"div",
|
|
4007
4137
|
{
|
|
4008
4138
|
ref: tip,
|
|
@@ -4022,12 +4152,12 @@ window.Aura = (() => {
|
|
|
4022
4152
|
});
|
|
4023
4153
|
|
|
4024
4154
|
// src/Dialog.tsx
|
|
4025
|
-
var
|
|
4155
|
+
var React28 = __toESM(require_react(), 1);
|
|
4026
4156
|
var import_react_dom8 = __toESM(require_react_dom(), 1);
|
|
4027
|
-
var Dialog =
|
|
4157
|
+
var Dialog = React28.forwardRef(function Dialog2(props, ref) {
|
|
4028
4158
|
const t = useStrings();
|
|
4029
4159
|
const density = useDensity();
|
|
4030
|
-
const own =
|
|
4160
|
+
const own = React28.useRef(null), merged = useMergedRef(ref, own), titleId = uid(), descId = uid();
|
|
4031
4161
|
function close() {
|
|
4032
4162
|
if (props.dismissible !== false && props.onClose) props.onClose();
|
|
4033
4163
|
}
|
|
@@ -4040,7 +4170,7 @@ window.Aura = (() => {
|
|
|
4040
4170
|
});
|
|
4041
4171
|
if (!modal.ready) return null;
|
|
4042
4172
|
return (0, import_react_dom8.createPortal)(
|
|
4043
|
-
/* @__PURE__ */
|
|
4173
|
+
/* @__PURE__ */ React28.createElement("div", { className: "aura-dialog-layer", "data-density": density, onKeyDown: modal.onKeyDown }, /* @__PURE__ */ React28.createElement(
|
|
4044
4174
|
"div",
|
|
4045
4175
|
{
|
|
4046
4176
|
className: "aura-scrim",
|
|
@@ -4050,7 +4180,7 @@ window.Aura = (() => {
|
|
|
4050
4180
|
},
|
|
4051
4181
|
"aria-hidden": true
|
|
4052
4182
|
}
|
|
4053
|
-
), /* @__PURE__ */
|
|
4183
|
+
), /* @__PURE__ */ React28.createElement(
|
|
4054
4184
|
"div",
|
|
4055
4185
|
{
|
|
4056
4186
|
ref: merged,
|
|
@@ -4061,18 +4191,18 @@ window.Aura = (() => {
|
|
|
4061
4191
|
tabIndex: -1,
|
|
4062
4192
|
className: cx("aura-dialog", "aura-dialog--" + (props.size || "md"), props.className)
|
|
4063
4193
|
},
|
|
4064
|
-
/* @__PURE__ */
|
|
4065
|
-
props.description ? /* @__PURE__ */
|
|
4066
|
-
props.children ? /* @__PURE__ */
|
|
4067
|
-
props.footer ? /* @__PURE__ */
|
|
4194
|
+
/* @__PURE__ */ React28.createElement("div", { className: "aura-dialog__head" }, /* @__PURE__ */ React28.createElement("h2", { className: "aura-dialog__title", id: titleId }, props.title), props.dismissible !== false ? /* @__PURE__ */ React28.createElement(IconButton, { icon: "x", label: t.close, className: "aura-dialog__close", onClick: close }) : null),
|
|
4195
|
+
props.description ? /* @__PURE__ */ React28.createElement("p", { className: "aura-dialog__desc", id: descId }, props.description) : null,
|
|
4196
|
+
props.children ? /* @__PURE__ */ React28.createElement("div", { className: "aura-dialog__body" }, props.children) : null,
|
|
4197
|
+
props.footer ? /* @__PURE__ */ React28.createElement("div", { className: "aura-dialog__foot" }, props.footer) : null
|
|
4068
4198
|
)),
|
|
4069
4199
|
document.body
|
|
4070
4200
|
);
|
|
4071
4201
|
});
|
|
4072
|
-
var Drawer =
|
|
4202
|
+
var Drawer = React28.forwardRef(function Drawer2(props, ref) {
|
|
4073
4203
|
const t = useStrings();
|
|
4074
4204
|
const density = useDensity();
|
|
4075
|
-
const own =
|
|
4205
|
+
const own = React28.useRef(null), merged = useMergedRef(ref, own), titleId = uid(), descId = uid();
|
|
4076
4206
|
function close() {
|
|
4077
4207
|
if (props.dismissible !== false && props.onClose) props.onClose();
|
|
4078
4208
|
}
|
|
@@ -4086,7 +4216,7 @@ window.Aura = (() => {
|
|
|
4086
4216
|
const side = props.side === "left" ? "left" : "right";
|
|
4087
4217
|
const drawerScrimCloses = props.dismissible !== false && props.dismissOnScrim !== false;
|
|
4088
4218
|
return (0, import_react_dom8.createPortal)(
|
|
4089
|
-
/* @__PURE__ */
|
|
4219
|
+
/* @__PURE__ */ React28.createElement("div", { className: "aura-dialog-layer aura-drawer-layer", "data-density": density, onKeyDown: modal.onKeyDown }, /* @__PURE__ */ React28.createElement(
|
|
4090
4220
|
"div",
|
|
4091
4221
|
{
|
|
4092
4222
|
className: "aura-scrim",
|
|
@@ -4096,7 +4226,7 @@ window.Aura = (() => {
|
|
|
4096
4226
|
} : void 0,
|
|
4097
4227
|
"aria-hidden": true
|
|
4098
4228
|
}
|
|
4099
|
-
), /* @__PURE__ */
|
|
4229
|
+
), /* @__PURE__ */ React28.createElement(
|
|
4100
4230
|
"div",
|
|
4101
4231
|
{
|
|
4102
4232
|
ref: merged,
|
|
@@ -4108,17 +4238,17 @@ window.Aura = (() => {
|
|
|
4108
4238
|
tabIndex: -1,
|
|
4109
4239
|
className: cx("aura-drawer", "aura-drawer--" + side, "aura-drawer--" + (props.size || "md"), props.className)
|
|
4110
4240
|
},
|
|
4111
|
-
props.title || props.dismissible !== false ? /* @__PURE__ */
|
|
4112
|
-
props.description ? /* @__PURE__ */
|
|
4113
|
-
/* @__PURE__ */
|
|
4114
|
-
props.footer ? /* @__PURE__ */
|
|
4241
|
+
props.title || props.dismissible !== false ? /* @__PURE__ */ React28.createElement("div", { className: "aura-drawer__head" }, props.title ? /* @__PURE__ */ React28.createElement("h2", { className: "aura-drawer__title", id: titleId }, props.title) : /* @__PURE__ */ React28.createElement("span", { style: { flex: 1 } }), props.dismissible !== false ? /* @__PURE__ */ React28.createElement(IconButton, { icon: "x", label: t.close, onClick: close }) : null) : null,
|
|
4242
|
+
props.description ? /* @__PURE__ */ React28.createElement("p", { className: "aura-drawer__desc", id: descId }, props.description) : null,
|
|
4243
|
+
/* @__PURE__ */ React28.createElement("div", { className: "aura-drawer__body" }, props.children),
|
|
4244
|
+
props.footer ? /* @__PURE__ */ React28.createElement("div", { className: "aura-drawer__foot" }, props.footer) : null
|
|
4115
4245
|
)),
|
|
4116
4246
|
document.body
|
|
4117
4247
|
);
|
|
4118
4248
|
});
|
|
4119
4249
|
|
|
4120
4250
|
// src/DataTable.tsx
|
|
4121
|
-
var
|
|
4251
|
+
var React29 = __toESM(require_react(), 1);
|
|
4122
4252
|
var import_react_dom9 = __toESM(require_react_dom(), 1);
|
|
4123
4253
|
var BP = { sm: 640, md: 768, lg: 1024, xl: 1280 };
|
|
4124
4254
|
var DEFAULT_COLUMNS = [
|
|
@@ -4141,7 +4271,7 @@ window.Aura = (() => {
|
|
|
4141
4271
|
var ROW_H_DEFAULT = 48;
|
|
4142
4272
|
var OVERSCAN = 8;
|
|
4143
4273
|
var FLEX_MIN = 160;
|
|
4144
|
-
var DataTableImpl =
|
|
4274
|
+
var DataTableImpl = React29.forwardRef(function DataTable(props, ref) {
|
|
4145
4275
|
const t = useStrings();
|
|
4146
4276
|
const columns = props.columns || DEFAULT_COLUMNS;
|
|
4147
4277
|
const byKey = {};
|
|
@@ -4180,7 +4310,7 @@ window.Aura = (() => {
|
|
|
4180
4310
|
const droppedSig = selState[0].length === selected.length ? "" : "#" + selState[0].filter(function(k) {
|
|
4181
4311
|
return rejected[String(k)];
|
|
4182
4312
|
}).join("\0") + "#" + selected.join("\0");
|
|
4183
|
-
|
|
4313
|
+
React29.useEffect(
|
|
4184
4314
|
function() {
|
|
4185
4315
|
if (droppedSig !== "") setSelected(selected);
|
|
4186
4316
|
},
|
|
@@ -4217,19 +4347,19 @@ window.Aura = (() => {
|
|
|
4217
4347
|
}),
|
|
4218
4348
|
props.onPinnedColumnsChange
|
|
4219
4349
|
);
|
|
4220
|
-
const widthState =
|
|
4350
|
+
const widthState = React29.useState({});
|
|
4221
4351
|
const widths = widthState[0], setWidths = widthState[1];
|
|
4222
|
-
const activeState =
|
|
4223
|
-
const scrollState =
|
|
4352
|
+
const activeState = React29.useState({ r: 1, c: 0 });
|
|
4353
|
+
const scrollState = React29.useState(0);
|
|
4224
4354
|
const scrollTop = scrollState[0], setScrollTop = scrollState[1];
|
|
4225
|
-
const scrolledX =
|
|
4226
|
-
const menuState =
|
|
4355
|
+
const scrolledX = React29.useState(false);
|
|
4356
|
+
const menuState = React29.useState(null);
|
|
4227
4357
|
const menu = menuState[0], setMenu = menuState[1];
|
|
4228
|
-
const dragState =
|
|
4358
|
+
const dragState = React29.useState(null);
|
|
4229
4359
|
const drag = dragState[0], setDrag = dragState[1];
|
|
4230
|
-
const gridRef =
|
|
4231
|
-
const wrapRef =
|
|
4232
|
-
const boxWidth =
|
|
4360
|
+
const gridRef = React29.useRef(null);
|
|
4361
|
+
const wrapRef = React29.useRef(null), wrapMerged = useMergedRef(ref, wrapRef);
|
|
4362
|
+
const boxWidth = React29.useState(null);
|
|
4233
4363
|
const measure = !!props.stackBelow || columns.some(function(c) {
|
|
4234
4364
|
return c.hideBelow != null;
|
|
4235
4365
|
});
|
|
@@ -4239,7 +4369,7 @@ window.Aura = (() => {
|
|
|
4239
4369
|
return px != null && a.indexOf(px) === i;
|
|
4240
4370
|
}).length
|
|
4241
4371
|
);
|
|
4242
|
-
|
|
4372
|
+
React29.useEffect(
|
|
4243
4373
|
function() {
|
|
4244
4374
|
if (!measure || !wrapRef.current || typeof ResizeObserver === "undefined") return;
|
|
4245
4375
|
const ro = new ResizeObserver(function(en) {
|
|
@@ -4284,8 +4414,8 @@ window.Aura = (() => {
|
|
|
4284
4414
|
const px = hidePx(c);
|
|
4285
4415
|
return px != null && below(boxWidth[0], px);
|
|
4286
4416
|
}
|
|
4287
|
-
const scrollRef =
|
|
4288
|
-
const tipState =
|
|
4417
|
+
const scrollRef = React29.useRef(null);
|
|
4418
|
+
const tipState = React29.useState(null), tip = tipState[0], setTip = tipState[1];
|
|
4289
4419
|
function showFull(e) {
|
|
4290
4420
|
const el = e.target.closest ? e.target.closest(".aura-table__td") : null;
|
|
4291
4421
|
if (!el || el.scrollWidth <= el.clientWidth + 1 || el.querySelector("button, input, .aura-pill"))
|
|
@@ -4297,7 +4427,7 @@ window.Aura = (() => {
|
|
|
4297
4427
|
setTip(null);
|
|
4298
4428
|
}
|
|
4299
4429
|
const tipEl = tip && typeof document !== "undefined" ? (0, import_react_dom9.createPortal)(
|
|
4300
|
-
/* @__PURE__ */
|
|
4430
|
+
/* @__PURE__ */ React29.createElement(
|
|
4301
4431
|
"div",
|
|
4302
4432
|
{
|
|
4303
4433
|
className: "aura-tooltip aura-tooltip--above",
|
|
@@ -4308,7 +4438,7 @@ window.Aura = (() => {
|
|
|
4308
4438
|
),
|
|
4309
4439
|
document.body
|
|
4310
4440
|
) : null;
|
|
4311
|
-
const rowH =
|
|
4441
|
+
const rowH = React29.useState(ROW_H_DEFAULT);
|
|
4312
4442
|
const ROW_H = rowH[0];
|
|
4313
4443
|
useIsoLayoutEffect(function() {
|
|
4314
4444
|
const el = wrapRef.current;
|
|
@@ -4316,8 +4446,8 @@ window.Aura = (() => {
|
|
|
4316
4446
|
const v = parseFloat(getComputedStyle(el).getPropertyValue("--aura-table-row-height"));
|
|
4317
4447
|
if (v > 0 && v !== rowH[0]) rowH[1](v);
|
|
4318
4448
|
});
|
|
4319
|
-
const pending =
|
|
4320
|
-
const resizing =
|
|
4449
|
+
const pending = React29.useRef(null);
|
|
4450
|
+
const resizing = React29.useRef(false);
|
|
4321
4451
|
useIsoLayoutEffect(function() {
|
|
4322
4452
|
if (!gridRef.current) return;
|
|
4323
4453
|
const els = gridRef.current.querySelectorAll(
|
|
@@ -4401,7 +4531,7 @@ window.Aura = (() => {
|
|
|
4401
4531
|
return s;
|
|
4402
4532
|
}
|
|
4403
4533
|
const sortCol = sort && sort.key ? byKey[sort.key] : void 0;
|
|
4404
|
-
const view =
|
|
4534
|
+
const view = React29.useMemo(
|
|
4405
4535
|
function() {
|
|
4406
4536
|
if (manual || !sort || !sort.key || !byKey[sort.key]) return rows;
|
|
4407
4537
|
const col = byKey[sort.key];
|
|
@@ -4443,8 +4573,8 @@ window.Aura = (() => {
|
|
|
4443
4573
|
const pageRows = pageSize && !manual ? view.slice(first, first + pageSize) : view;
|
|
4444
4574
|
const canSortAny = !busy && (manual ? total > 1 : rows.length > 1);
|
|
4445
4575
|
const shownTotal = manual && props.totalRows == null ? first + rows.length : total;
|
|
4446
|
-
const prevCount =
|
|
4447
|
-
|
|
4576
|
+
const prevCount = React29.useRef(pageCount);
|
|
4577
|
+
React29.useEffect(
|
|
4448
4578
|
function() {
|
|
4449
4579
|
if (busy) return;
|
|
4450
4580
|
const before = prevCount.current;
|
|
@@ -4458,9 +4588,9 @@ window.Aura = (() => {
|
|
|
4458
4588
|
[pageState[0], page, busy, pageCount]
|
|
4459
4589
|
);
|
|
4460
4590
|
const linkPaging = !!props.getPageHref && !props.onPageChange && !oneCallback;
|
|
4461
|
-
const prevLink =
|
|
4462
|
-
const jumpState =
|
|
4463
|
-
|
|
4591
|
+
const prevLink = React29.useRef(null), nextLink = React29.useRef(null), jumpLink = React29.useRef(null);
|
|
4592
|
+
const jumpState = React29.useState(null);
|
|
4593
|
+
React29.useEffect(
|
|
4464
4594
|
function() {
|
|
4465
4595
|
if (jumpState[0] == null) return;
|
|
4466
4596
|
if (jumpLink.current) jumpLink.current.click();
|
|
@@ -4511,7 +4641,7 @@ window.Aura = (() => {
|
|
|
4511
4641
|
);
|
|
4512
4642
|
}
|
|
4513
4643
|
function rowLinkWrap(r, content) {
|
|
4514
|
-
return rowHref ? /* @__PURE__ */
|
|
4644
|
+
return rowHref ? /* @__PURE__ */ React29.createElement(Link, { href: rowHref(r), className: "aura-table__row-link" }, content) : content;
|
|
4515
4645
|
}
|
|
4516
4646
|
const height = props.height || 0;
|
|
4517
4647
|
const virtual = !!height && !loading && pageRows.length > 0 && !stacked;
|
|
@@ -4536,7 +4666,7 @@ window.Aura = (() => {
|
|
|
4536
4666
|
if (!activeRendered) return r === 0 && c === ac ? 0 : -1;
|
|
4537
4667
|
return r === ar && c === ac ? 0 : -1;
|
|
4538
4668
|
}
|
|
4539
|
-
|
|
4669
|
+
React29.useEffect(function() {
|
|
4540
4670
|
const p = pending.current;
|
|
4541
4671
|
if (!p || !gridRef.current) return;
|
|
4542
4672
|
let c = p.c;
|
|
@@ -4878,10 +5008,10 @@ window.Aura = (() => {
|
|
|
4878
5008
|
e.stopPropagation();
|
|
4879
5009
|
}
|
|
4880
5010
|
}
|
|
4881
|
-
const head = [/* @__PURE__ */
|
|
5011
|
+
const head = [/* @__PURE__ */ React29.createElement("span", { key: "__gl", className: "aura-table__gutter", "aria-hidden": true })];
|
|
4882
5012
|
if (selectable)
|
|
4883
5013
|
head.push(
|
|
4884
|
-
/* @__PURE__ */
|
|
5014
|
+
/* @__PURE__ */ React29.createElement(
|
|
4885
5015
|
"span",
|
|
4886
5016
|
{
|
|
4887
5017
|
key: "__sel",
|
|
@@ -4895,7 +5025,7 @@ window.Aura = (() => {
|
|
|
4895
5025
|
activeState[1]({ r: 0, c: 0 });
|
|
4896
5026
|
}
|
|
4897
5027
|
},
|
|
4898
|
-
pageKeys.length ? /* @__PURE__ */
|
|
5028
|
+
pageKeys.length ? /* @__PURE__ */ React29.createElement(
|
|
4899
5029
|
Checkbox,
|
|
4900
5030
|
{
|
|
4901
5031
|
hideLabel: true,
|
|
@@ -4906,7 +5036,7 @@ window.Aura = (() => {
|
|
|
4906
5036
|
onChange: toggleAll
|
|
4907
5037
|
}
|
|
4908
5038
|
) : null,
|
|
4909
|
-
pageKeys.length ? /* @__PURE__ */
|
|
5039
|
+
pageKeys.length ? /* @__PURE__ */ React29.createElement("span", { className: "aura-table__sel-text" }, nSel ? t.selectedCount(nSel) : t.selectAll) : /* @__PURE__ */ React29.createElement("span", { className: "aura-sr-only" }, t.selectRows)
|
|
4910
5040
|
)
|
|
4911
5041
|
);
|
|
4912
5042
|
vis.forEach(function(c, i) {
|
|
@@ -4916,7 +5046,7 @@ window.Aura = (() => {
|
|
|
4916
5046
|
const ariaSort = isSorted && canSort ? sort.dir === "desc" ? "descending" : "ascending" : canSort ? "none" : void 0;
|
|
4917
5047
|
const pin = isPinned(c), edge = pin && i === nPinned - 1;
|
|
4918
5048
|
head.push(
|
|
4919
|
-
/* @__PURE__ */
|
|
5049
|
+
/* @__PURE__ */ React29.createElement(
|
|
4920
5050
|
"span",
|
|
4921
5051
|
{
|
|
4922
5052
|
key: c.key,
|
|
@@ -4966,7 +5096,7 @@ window.Aura = (() => {
|
|
|
4966
5096
|
setDrag(null);
|
|
4967
5097
|
}
|
|
4968
5098
|
},
|
|
4969
|
-
/* @__PURE__ */
|
|
5099
|
+
/* @__PURE__ */ React29.createElement("span", { className: "aura-table__th-inner" }, canSort ? /* @__PURE__ */ React29.createElement(
|
|
4970
5100
|
"button",
|
|
4971
5101
|
{
|
|
4972
5102
|
type: "button",
|
|
@@ -4978,8 +5108,8 @@ window.Aura = (() => {
|
|
|
4978
5108
|
}
|
|
4979
5109
|
},
|
|
4980
5110
|
c.label,
|
|
4981
|
-
/* @__PURE__ */
|
|
4982
|
-
) : /* @__PURE__ */
|
|
5111
|
+
/* @__PURE__ */ React29.createElement(Icon, { name: isSorted ? sort.dir === "desc" ? "arrow-down" : "arrow-up" : "arrow-up-down", size: 12 })
|
|
5112
|
+
) : /* @__PURE__ */ React29.createElement("span", { className: cx("aura-table__th-label", !c.label && "aura-sr-only") }, c.label || (c.actions ? t.actions : c.key)), pin ? /* @__PURE__ */ React29.createElement(Icon, { name: "pin", size: 12, className: "aura-table__pin-icon", label: t.pinned }) : null, controls ? /* @__PURE__ */ React29.createElement(
|
|
4983
5113
|
"button",
|
|
4984
5114
|
{
|
|
4985
5115
|
type: "button",
|
|
@@ -4993,9 +5123,9 @@ window.Aura = (() => {
|
|
|
4993
5123
|
openMenu("col", c.key, e.currentTarget, { r: 0, c: ci });
|
|
4994
5124
|
}
|
|
4995
5125
|
},
|
|
4996
|
-
/* @__PURE__ */
|
|
5126
|
+
/* @__PURE__ */ React29.createElement(Icon, { name: "ellipsis" })
|
|
4997
5127
|
) : null),
|
|
4998
|
-
canResize(c) ? /* @__PURE__ */
|
|
5128
|
+
canResize(c) ? /* @__PURE__ */ React29.createElement(
|
|
4999
5129
|
"span",
|
|
5000
5130
|
{
|
|
5001
5131
|
className: "aura-table__resize",
|
|
@@ -5017,7 +5147,7 @@ window.Aura = (() => {
|
|
|
5017
5147
|
);
|
|
5018
5148
|
});
|
|
5019
5149
|
head.push(
|
|
5020
|
-
/* @__PURE__ */
|
|
5150
|
+
/* @__PURE__ */ React29.createElement(
|
|
5021
5151
|
"span",
|
|
5022
5152
|
{
|
|
5023
5153
|
key: "__gr",
|
|
@@ -5028,14 +5158,14 @@ window.Aura = (() => {
|
|
|
5028
5158
|
);
|
|
5029
5159
|
function cellContent(c, r) {
|
|
5030
5160
|
const v = r[c.key];
|
|
5031
|
-
return c.render ? c.render(r) : c.pill ? /* @__PURE__ */
|
|
5161
|
+
return c.render ? c.render(r) : c.pill ? /* @__PURE__ */ React29.createElement(StatusPill, { ...{ tone: c.tones && c.tones[v] } }, v) : v;
|
|
5032
5162
|
}
|
|
5033
5163
|
function rowCells(r, i, k, isSel) {
|
|
5034
5164
|
const ri = i + 1;
|
|
5035
|
-
const cells = [/* @__PURE__ */
|
|
5165
|
+
const cells = [/* @__PURE__ */ React29.createElement("span", { key: "__gl", className: "aura-table__gutter", "aria-hidden": true })];
|
|
5036
5166
|
if (selectable)
|
|
5037
5167
|
cells.push(
|
|
5038
|
-
/* @__PURE__ */
|
|
5168
|
+
/* @__PURE__ */ React29.createElement(
|
|
5039
5169
|
"span",
|
|
5040
5170
|
{
|
|
5041
5171
|
key: "__sel",
|
|
@@ -5049,7 +5179,7 @@ window.Aura = (() => {
|
|
|
5049
5179
|
if (e.target === e.currentTarget) activeState[1]({ r: ri, c: 0 });
|
|
5050
5180
|
}
|
|
5051
5181
|
},
|
|
5052
|
-
canSelect(r) ? /* @__PURE__ */
|
|
5182
|
+
canSelect(r) ? /* @__PURE__ */ React29.createElement(
|
|
5053
5183
|
Checkbox,
|
|
5054
5184
|
{
|
|
5055
5185
|
hideLabel: true,
|
|
@@ -5066,7 +5196,7 @@ window.Aura = (() => {
|
|
|
5066
5196
|
vis.forEach(function(c, j) {
|
|
5067
5197
|
const ci = j + (selectable ? 1 : 0), v = r[c.key], pin = isPinned(c);
|
|
5068
5198
|
cells.push(
|
|
5069
|
-
/* @__PURE__ */
|
|
5199
|
+
/* @__PURE__ */ React29.createElement(
|
|
5070
5200
|
"span",
|
|
5071
5201
|
{
|
|
5072
5202
|
key: c.key,
|
|
@@ -5091,9 +5221,9 @@ window.Aura = (() => {
|
|
|
5091
5221
|
)
|
|
5092
5222
|
);
|
|
5093
5223
|
});
|
|
5094
|
-
if (hasFields) cells.push(/* @__PURE__ */
|
|
5224
|
+
if (hasFields) cells.push(/* @__PURE__ */ React29.createElement("span", { key: "__br", className: "aura-table__break", "aria-hidden": true }));
|
|
5095
5225
|
cells.push(
|
|
5096
|
-
/* @__PURE__ */
|
|
5226
|
+
/* @__PURE__ */ React29.createElement(
|
|
5097
5227
|
"span",
|
|
5098
5228
|
{
|
|
5099
5229
|
key: "__gr",
|
|
@@ -5110,14 +5240,14 @@ window.Aura = (() => {
|
|
|
5110
5240
|
const n2 = pageSize || props.skeletonRows || 5;
|
|
5111
5241
|
const skRows = body = [];
|
|
5112
5242
|
for (let i = 0; i < n2; i++) {
|
|
5113
|
-
const sk = [/* @__PURE__ */
|
|
5243
|
+
const sk = [/* @__PURE__ */ React29.createElement("span", { key: "__gl", className: "aura-table__gutter" })];
|
|
5114
5244
|
if (selectable)
|
|
5115
5245
|
sk.push(
|
|
5116
|
-
/* @__PURE__ */
|
|
5246
|
+
/* @__PURE__ */ React29.createElement("span", { key: "__sel", className: cx("aura-table__sel", nPinned && "is-pinned") }, /* @__PURE__ */ React29.createElement("span", { className: "aura-skel aura-skel--box" }))
|
|
5117
5247
|
);
|
|
5118
5248
|
vis.forEach(function(c, j) {
|
|
5119
5249
|
sk.push(
|
|
5120
|
-
/* @__PURE__ */
|
|
5250
|
+
/* @__PURE__ */ React29.createElement(
|
|
5121
5251
|
"span",
|
|
5122
5252
|
{
|
|
5123
5253
|
key: c.key,
|
|
@@ -5126,7 +5256,7 @@ window.Aura = (() => {
|
|
|
5126
5256
|
...cardAttrs(c, j),
|
|
5127
5257
|
"data-label": void 0
|
|
5128
5258
|
},
|
|
5129
|
-
/* @__PURE__ */
|
|
5259
|
+
/* @__PURE__ */ React29.createElement(
|
|
5130
5260
|
"span",
|
|
5131
5261
|
{
|
|
5132
5262
|
className: cx("aura-skel", c.pill && "aura-skel--pill"),
|
|
@@ -5136,28 +5266,28 @@ window.Aura = (() => {
|
|
|
5136
5266
|
)
|
|
5137
5267
|
);
|
|
5138
5268
|
});
|
|
5139
|
-
if (hasFields) sk.push(/* @__PURE__ */
|
|
5269
|
+
if (hasFields) sk.push(/* @__PURE__ */ React29.createElement("span", { key: "__br", className: "aura-table__break" }));
|
|
5140
5270
|
sk.push(
|
|
5141
|
-
/* @__PURE__ */
|
|
5271
|
+
/* @__PURE__ */ React29.createElement("span", { key: "__gr", className: cx("aura-table__gutter aura-table__gutter--end", controls && "has-picker") })
|
|
5142
5272
|
);
|
|
5143
5273
|
skRows.push(
|
|
5144
|
-
/* @__PURE__ */
|
|
5274
|
+
/* @__PURE__ */ React29.createElement("div", { key: "sk" + i, className: "aura-table__row aura-table__row--skeleton", "aria-hidden": true, style: rowStyle }, sk)
|
|
5145
5275
|
);
|
|
5146
5276
|
}
|
|
5147
5277
|
} else if (!rows.length) {
|
|
5148
5278
|
const em = props.empty || {};
|
|
5149
|
-
body = /* @__PURE__ */
|
|
5279
|
+
body = /* @__PURE__ */ React29.createElement("div", { className: "aura-table__empty", role: "row" }, /* @__PURE__ */ React29.createElement("div", { role: "gridcell" }, /* @__PURE__ */ React29.createElement("span", { className: "aura-table__empty-icon" }, /* @__PURE__ */ React29.createElement(Icon, { name: em.icon || "inbox", size: "lg" })), /* @__PURE__ */ React29.createElement("p", { className: "aura-table__empty-title" }, em.title || t.empty), em.description ? /* @__PURE__ */ React29.createElement("p", { className: "aura-table__empty-text" }, em.description) : null, em.action ? /* @__PURE__ */ React29.createElement("div", { className: "aura-table__empty-action" }, em.action) : null));
|
|
5150
5280
|
} else {
|
|
5151
5281
|
const bodyRows = body = [];
|
|
5152
5282
|
if (virtual && start > 0)
|
|
5153
5283
|
bodyRows.push(
|
|
5154
|
-
/* @__PURE__ */
|
|
5284
|
+
/* @__PURE__ */ React29.createElement("div", { key: "__top", className: "aura-table__spacer", style: { height: start * ROW_H + "px" }, "aria-hidden": true })
|
|
5155
5285
|
);
|
|
5156
5286
|
for (let ri = start; ri < end; ri++) {
|
|
5157
5287
|
(function(r, i) {
|
|
5158
5288
|
const k = r[rowKey], isSel = !!selSet[k];
|
|
5159
5289
|
bodyRows.push(
|
|
5160
|
-
/* @__PURE__ */
|
|
5290
|
+
/* @__PURE__ */ React29.createElement(
|
|
5161
5291
|
"div",
|
|
5162
5292
|
{
|
|
5163
5293
|
key: k,
|
|
@@ -5184,7 +5314,7 @@ window.Aura = (() => {
|
|
|
5184
5314
|
}
|
|
5185
5315
|
if (virtual && end < pageRows.length)
|
|
5186
5316
|
bodyRows.push(
|
|
5187
|
-
/* @__PURE__ */
|
|
5317
|
+
/* @__PURE__ */ React29.createElement(
|
|
5188
5318
|
"div",
|
|
5189
5319
|
{
|
|
5190
5320
|
key: "__bot",
|
|
@@ -5199,7 +5329,7 @@ window.Aura = (() => {
|
|
|
5199
5329
|
function pagerButton(dir) {
|
|
5200
5330
|
const p = page + dir, off = busy || (dir < 0 ? page <= 1 : page >= pageCount), label = dir < 0 ? t.prevPage : t.nextPage, icon = dir < 0 ? "chevron-left" : "chevron-right";
|
|
5201
5331
|
if (props.getPageHref && !off)
|
|
5202
|
-
return /* @__PURE__ */
|
|
5332
|
+
return /* @__PURE__ */ React29.createElement(
|
|
5203
5333
|
Link,
|
|
5204
5334
|
{
|
|
5205
5335
|
ref: dir < 0 ? prevLink : nextLink,
|
|
@@ -5214,9 +5344,9 @@ window.Aura = (() => {
|
|
|
5214
5344
|
}
|
|
5215
5345
|
}
|
|
5216
5346
|
},
|
|
5217
|
-
/* @__PURE__ */
|
|
5347
|
+
/* @__PURE__ */ React29.createElement(Icon, { name: icon })
|
|
5218
5348
|
);
|
|
5219
|
-
return /* @__PURE__ */
|
|
5349
|
+
return /* @__PURE__ */ React29.createElement(
|
|
5220
5350
|
IconButton,
|
|
5221
5351
|
{
|
|
5222
5352
|
icon,
|
|
@@ -5231,11 +5361,11 @@ window.Aura = (() => {
|
|
|
5231
5361
|
const openTotal = manual && props.totalRows == null && !!pageSize && rows.length >= pageSize;
|
|
5232
5362
|
if (pageSize && (rows.length || busy || page > 1)) {
|
|
5233
5363
|
const from = rows.length ? first + 1 : 0, to = manual ? first + rows.length : Math.min(first + pageSize, view.length);
|
|
5234
|
-
foot = /* @__PURE__ */
|
|
5364
|
+
foot = /* @__PURE__ */ React29.createElement("div", { className: "aura-table__foot" }, /* @__PURE__ */ React29.createElement("span", { "aria-live": "polite" }, busy ? t.loading : openTotal ? t.rangeOpen(from, to) : t.range(from, to, shownTotal)), /* @__PURE__ */ React29.createElement("span", { className: "aura-table__pager" }, /* @__PURE__ */ React29.createElement("span", null, openTotal ? t.pageOpen(page) : t.page(page, pageCount)), pagerButton(-1), pagerButton(1)));
|
|
5235
5365
|
} else if (height && rows.length && !loading) {
|
|
5236
|
-
foot = /* @__PURE__ */
|
|
5366
|
+
foot = /* @__PURE__ */ React29.createElement("div", { className: "aura-table__foot" }, /* @__PURE__ */ React29.createElement("span", null, t.rowCount(shownTotal)), selectable && selected.length ? /* @__PURE__ */ React29.createElement("span", null, t.selectedCount(selected.length)) : /* @__PURE__ */ React29.createElement("span", null));
|
|
5237
5367
|
}
|
|
5238
|
-
const totalRow = props.footer && rows.length && !loading ? /* @__PURE__ */
|
|
5368
|
+
const totalRow = props.footer && rows.length && !loading ? /* @__PURE__ */ React29.createElement(
|
|
5239
5369
|
"div",
|
|
5240
5370
|
{
|
|
5241
5371
|
role: "row",
|
|
@@ -5244,8 +5374,8 @@ window.Aura = (() => {
|
|
|
5244
5374
|
className: cx("aura-table__row aura-table__total", props.stickyFooter && "is-sticky"),
|
|
5245
5375
|
style: rowStyle
|
|
5246
5376
|
},
|
|
5247
|
-
/* @__PURE__ */
|
|
5248
|
-
selectable ? /* @__PURE__ */
|
|
5377
|
+
/* @__PURE__ */ React29.createElement("span", { className: "aura-table__gutter", "aria-hidden": true }),
|
|
5378
|
+
selectable ? /* @__PURE__ */ React29.createElement(
|
|
5249
5379
|
"span",
|
|
5250
5380
|
{
|
|
5251
5381
|
role: "gridcell",
|
|
@@ -5260,7 +5390,7 @@ window.Aura = (() => {
|
|
|
5260
5390
|
) : null,
|
|
5261
5391
|
vis.map(function(c, j) {
|
|
5262
5392
|
const pin = isPinned(c), ci = j + (selectable ? 1 : 0);
|
|
5263
|
-
return /* @__PURE__ */
|
|
5393
|
+
return /* @__PURE__ */ React29.createElement(
|
|
5264
5394
|
"span",
|
|
5265
5395
|
{
|
|
5266
5396
|
key: c.key,
|
|
@@ -5286,8 +5416,8 @@ window.Aura = (() => {
|
|
|
5286
5416
|
props.footer[c.key]
|
|
5287
5417
|
);
|
|
5288
5418
|
}),
|
|
5289
|
-
hasFields ? /* @__PURE__ */
|
|
5290
|
-
/* @__PURE__ */
|
|
5419
|
+
hasFields ? /* @__PURE__ */ React29.createElement("span", { className: "aura-table__break", "aria-hidden": true }) : null,
|
|
5420
|
+
/* @__PURE__ */ React29.createElement(
|
|
5291
5421
|
"span",
|
|
5292
5422
|
{
|
|
5293
5423
|
className: cx("aura-table__gutter aura-table__gutter--end", controls && "has-picker"),
|
|
@@ -5301,7 +5431,7 @@ window.Aura = (() => {
|
|
|
5301
5431
|
scrollPaddingBottom: stickyTotal ? ROW_H + "px" : void 0
|
|
5302
5432
|
};
|
|
5303
5433
|
if (height) scrollStyle["--aura-table-h"] = height + "px";
|
|
5304
|
-
const gridEl = /* @__PURE__ */
|
|
5434
|
+
const gridEl = /* @__PURE__ */ React29.createElement(
|
|
5305
5435
|
"div",
|
|
5306
5436
|
{
|
|
5307
5437
|
ref: levels.length ? wrapRef : wrapMerged,
|
|
@@ -5315,8 +5445,8 @@ window.Aura = (() => {
|
|
|
5315
5445
|
),
|
|
5316
5446
|
style: levels.length ? { ["--aura-q-back"]: String(levels[levels.length - 1].px / Q) } : void 0
|
|
5317
5447
|
},
|
|
5318
|
-
refreshing ? /* @__PURE__ */
|
|
5319
|
-
/* @__PURE__ */
|
|
5448
|
+
refreshing ? /* @__PURE__ */ React29.createElement("span", { className: "aura-table__busy-bar", "aria-hidden": true }) : null,
|
|
5449
|
+
/* @__PURE__ */ React29.createElement(
|
|
5320
5450
|
"div",
|
|
5321
5451
|
{
|
|
5322
5452
|
ref: function(el) {
|
|
@@ -5345,7 +5475,7 @@ window.Aura = (() => {
|
|
|
5345
5475
|
if (sx !== scrolledX[0]) scrolledX[1](sx);
|
|
5346
5476
|
}
|
|
5347
5477
|
},
|
|
5348
|
-
/* @__PURE__ */
|
|
5478
|
+
/* @__PURE__ */ React29.createElement(
|
|
5349
5479
|
"div",
|
|
5350
5480
|
{
|
|
5351
5481
|
className: cx("aura-table__head", selectable && nRows > 0 && !busy && "has-select-all"),
|
|
@@ -5358,8 +5488,8 @@ window.Aura = (() => {
|
|
|
5358
5488
|
body,
|
|
5359
5489
|
totalRow
|
|
5360
5490
|
),
|
|
5361
|
-
busy ? /* @__PURE__ */
|
|
5362
|
-
controls ? /* @__PURE__ */
|
|
5491
|
+
busy ? /* @__PURE__ */ React29.createElement("span", { className: "aura-sr-only", role: "status" }, t.loadingRows) : null,
|
|
5492
|
+
controls ? /* @__PURE__ */ React29.createElement("div", { className: "aura-table__picker" }, /* @__PURE__ */ React29.createElement(
|
|
5363
5493
|
IconButton,
|
|
5364
5494
|
{
|
|
5365
5495
|
icon: "columns-3",
|
|
@@ -5371,7 +5501,7 @@ window.Aura = (() => {
|
|
|
5371
5501
|
}
|
|
5372
5502
|
)) : null,
|
|
5373
5503
|
foot,
|
|
5374
|
-
menu ? /* @__PURE__ */
|
|
5504
|
+
menu ? /* @__PURE__ */ React29.createElement(
|
|
5375
5505
|
Menu,
|
|
5376
5506
|
{
|
|
5377
5507
|
anchor: menu.anchor,
|
|
@@ -5381,13 +5511,13 @@ window.Aura = (() => {
|
|
|
5381
5511
|
}
|
|
5382
5512
|
) : null,
|
|
5383
5513
|
tipEl,
|
|
5384
|
-
jumpState[0] != null && props.getPageHref ? /* @__PURE__ */
|
|
5514
|
+
jumpState[0] != null && props.getPageHref ? /* @__PURE__ */ React29.createElement(Link, { ref: jumpLink, href: props.getPageHref(jumpState[0]), hidden: true, tabIndex: -1, "aria-hidden": true }) : null
|
|
5385
5515
|
);
|
|
5386
5516
|
if (!levels.length) return gridEl;
|
|
5387
5517
|
let out = gridEl;
|
|
5388
5518
|
for (let i = levels.length - 1; i >= 0; i--) {
|
|
5389
5519
|
const prev = i === 0 ? Q : levels[i - 1].px;
|
|
5390
|
-
out = /* @__PURE__ */
|
|
5520
|
+
out = /* @__PURE__ */ React29.createElement(
|
|
5391
5521
|
"div",
|
|
5392
5522
|
{
|
|
5393
5523
|
className: cx("aura-table-q", "aura-table-q--" + levels[i].name),
|
|
@@ -5396,36 +5526,19 @@ window.Aura = (() => {
|
|
|
5396
5526
|
out
|
|
5397
5527
|
);
|
|
5398
5528
|
}
|
|
5399
|
-
return /* @__PURE__ */
|
|
5529
|
+
return /* @__PURE__ */ React29.createElement("div", { ref, className: cx("aura-table-box", props.className) }, out);
|
|
5400
5530
|
});
|
|
5401
5531
|
var DataTable2 = DataTableImpl;
|
|
5402
5532
|
|
|
5403
5533
|
// src/Card.tsx
|
|
5404
|
-
var
|
|
5405
|
-
var
|
|
5406
|
-
|
|
5407
|
-
const creative = props.variant === "creative";
|
|
5408
|
-
return h4(
|
|
5409
|
-
props.as || "section",
|
|
5410
|
-
{
|
|
5411
|
-
ref,
|
|
5412
|
-
className: cx(
|
|
5413
|
-
"aura-card",
|
|
5414
|
-
creative && "aura-card--creative",
|
|
5415
|
-
props.interactive && "is-interactive",
|
|
5416
|
-
props.className
|
|
5417
|
-
),
|
|
5418
|
-
"aria-labelledby": props.title && props.titleId ? props.titleId : void 0
|
|
5419
|
-
},
|
|
5420
|
-
props.title || props.actions ? /* @__PURE__ */ React29.createElement("div", { className: "aura-card__head" }, /* @__PURE__ */ React29.createElement("div", { className: "aura-card__heading" }, props.title ? h4("h" + (props.headingLevel || 3), { className: "aura-card__title", id: props.titleId }, props.title) : null, props.description ? /* @__PURE__ */ React29.createElement("p", { className: "aura-card__desc" }, props.description) : null), props.actions ? /* @__PURE__ */ React29.createElement("div", { className: "aura-card__actions" }, props.actions) : null) : null,
|
|
5421
|
-
props.children ? /* @__PURE__ */ React29.createElement("div", { className: "aura-card__body" }, props.children) : null,
|
|
5422
|
-
props.footer ? /* @__PURE__ */ React29.createElement("div", { className: "aura-card__foot" }, props.footer) : null
|
|
5423
|
-
);
|
|
5534
|
+
var React30 = __toESM(require_react(), 1);
|
|
5535
|
+
var Card = React30.forwardRef(function Card2(props, ref) {
|
|
5536
|
+
return cardElement(props, ref);
|
|
5424
5537
|
});
|
|
5425
5538
|
|
|
5426
5539
|
// src/Tabs.tsx
|
|
5427
|
-
var
|
|
5428
|
-
var Tabs =
|
|
5540
|
+
var React31 = __toESM(require_react(), 1);
|
|
5541
|
+
var Tabs = React31.forwardRef(function Tabs2(props, ref) {
|
|
5429
5542
|
const items2 = props.tabs || [], base = uid();
|
|
5430
5543
|
const asLinks = items2.length > 0 && items2.every(function(t) {
|
|
5431
5544
|
return !!t.href;
|
|
@@ -5439,27 +5552,27 @@ window.Aura = (() => {
|
|
|
5439
5552
|
props.onChange
|
|
5440
5553
|
);
|
|
5441
5554
|
const cur = asLinks && "value" in props ? props.value : st[0];
|
|
5442
|
-
const refs =
|
|
5555
|
+
const refs = React31.useRef({});
|
|
5443
5556
|
const current2 = items2.filter(function(t) {
|
|
5444
5557
|
return t.id === cur;
|
|
5445
5558
|
})[0] || firstOn || items2[0];
|
|
5446
5559
|
const Link = useLinkComponent(props.linkComponent);
|
|
5447
5560
|
if (asLinks)
|
|
5448
|
-
return /* @__PURE__ */
|
|
5561
|
+
return /* @__PURE__ */ React31.createElement(
|
|
5449
5562
|
"nav",
|
|
5450
5563
|
{
|
|
5451
5564
|
ref,
|
|
5452
5565
|
"aria-label": props.label,
|
|
5453
5566
|
className: cx("aura-tabs aura-tabs--links", props.className)
|
|
5454
5567
|
},
|
|
5455
|
-
/* @__PURE__ */
|
|
5568
|
+
/* @__PURE__ */ React31.createElement("div", { className: "aura-tabs__list" }, items2.map(function(t) {
|
|
5456
5569
|
const on = t.id === cur;
|
|
5457
5570
|
const inner = [
|
|
5458
|
-
t.icon ? /* @__PURE__ */
|
|
5571
|
+
t.icon ? /* @__PURE__ */ React31.createElement(Icon, { key: "i", name: t.icon }) : null,
|
|
5459
5572
|
t.label,
|
|
5460
|
-
t.count != null ? /* @__PURE__ */
|
|
5573
|
+
t.count != null ? /* @__PURE__ */ React31.createElement("span", { key: "c", className: "aura-tab__count" }, t.count) : null
|
|
5461
5574
|
];
|
|
5462
|
-
return t.disabled ? /* @__PURE__ */
|
|
5575
|
+
return t.disabled ? /* @__PURE__ */ React31.createElement("span", { key: t.id, className: "aura-tab is-disabled", "aria-disabled": true }, inner) : /* @__PURE__ */ React31.createElement(
|
|
5463
5576
|
Link,
|
|
5464
5577
|
{
|
|
5465
5578
|
key: t.id,
|
|
@@ -5483,7 +5596,7 @@ window.Aura = (() => {
|
|
|
5483
5596
|
st[1](t.id);
|
|
5484
5597
|
if (refs.current[t.id]) refs.current[t.id].focus();
|
|
5485
5598
|
}
|
|
5486
|
-
return /* @__PURE__ */
|
|
5599
|
+
return /* @__PURE__ */ React31.createElement("div", { ref, className: cx("aura-tabs", props.className) }, /* @__PURE__ */ React31.createElement(
|
|
5487
5600
|
"div",
|
|
5488
5601
|
{
|
|
5489
5602
|
role: "tablist",
|
|
@@ -5510,7 +5623,7 @@ window.Aura = (() => {
|
|
|
5510
5623
|
},
|
|
5511
5624
|
items2.map(function(t) {
|
|
5512
5625
|
const on = current2 && t.id === current2.id;
|
|
5513
|
-
return /* @__PURE__ */
|
|
5626
|
+
return /* @__PURE__ */ React31.createElement(
|
|
5514
5627
|
"button",
|
|
5515
5628
|
{
|
|
5516
5629
|
key: t.id,
|
|
@@ -5529,12 +5642,12 @@ window.Aura = (() => {
|
|
|
5529
5642
|
st[1](t.id);
|
|
5530
5643
|
}
|
|
5531
5644
|
},
|
|
5532
|
-
t.icon ? /* @__PURE__ */
|
|
5645
|
+
t.icon ? /* @__PURE__ */ React31.createElement(Icon, { name: t.icon }) : null,
|
|
5533
5646
|
t.label,
|
|
5534
|
-
t.count != null ? /* @__PURE__ */
|
|
5647
|
+
t.count != null ? /* @__PURE__ */ React31.createElement("span", { className: "aura-tab__count" }, t.count) : null
|
|
5535
5648
|
);
|
|
5536
5649
|
})
|
|
5537
|
-
), current2 && current2.content !== void 0 ? /* @__PURE__ */
|
|
5650
|
+
), current2 && current2.content !== void 0 ? /* @__PURE__ */ React31.createElement(
|
|
5538
5651
|
"div",
|
|
5539
5652
|
{
|
|
5540
5653
|
role: "tabpanel",
|
|
@@ -5548,14 +5661,14 @@ window.Aura = (() => {
|
|
|
5548
5661
|
});
|
|
5549
5662
|
|
|
5550
5663
|
// src/SideNav.tsx
|
|
5551
|
-
var
|
|
5664
|
+
var React32 = __toESM(require_react(), 1);
|
|
5552
5665
|
var import_react_dom10 = __toESM(require_react_dom(), 1);
|
|
5553
5666
|
function contains(it, id) {
|
|
5554
5667
|
return !!id && !!it.children && it.children.some(function(c) {
|
|
5555
5668
|
return c.id === id || contains(c, id);
|
|
5556
5669
|
});
|
|
5557
5670
|
}
|
|
5558
|
-
var SideNav =
|
|
5671
|
+
var SideNav = React32.forwardRef(function SideNav2(props, ref) {
|
|
5559
5672
|
const t = useStrings();
|
|
5560
5673
|
const Link = useLinkComponent(props.linkComponent);
|
|
5561
5674
|
const base = uid();
|
|
@@ -5567,14 +5680,14 @@ window.Aura = (() => {
|
|
|
5567
5680
|
const active = st[0];
|
|
5568
5681
|
const col = useMaybeControlled(props.collapsed, !!props.defaultCollapsed, props.onCollapsedChange);
|
|
5569
5682
|
const collapsed = col[0];
|
|
5570
|
-
const tipState =
|
|
5571
|
-
|
|
5683
|
+
const tipState = React32.useState(null), tip = tipState[0], setTip = tipState[1];
|
|
5684
|
+
React32.useEffect(
|
|
5572
5685
|
function() {
|
|
5573
5686
|
if (!collapsed) setTip(null);
|
|
5574
5687
|
},
|
|
5575
5688
|
[collapsed]
|
|
5576
5689
|
);
|
|
5577
|
-
|
|
5690
|
+
React32.useEffect(
|
|
5578
5691
|
function() {
|
|
5579
5692
|
if (!tip) return;
|
|
5580
5693
|
function esc(e) {
|
|
@@ -5599,12 +5712,12 @@ window.Aura = (() => {
|
|
|
5599
5712
|
return { onMouseEnter: show2, onFocus: show2, onMouseLeave: hide, onBlur: hide };
|
|
5600
5713
|
}
|
|
5601
5714
|
const sections = props.sections || [{ items: props.items || [] }];
|
|
5602
|
-
const openState =
|
|
5715
|
+
const openState = React32.useState({}), toggled = openState[0], setToggled = openState[1];
|
|
5603
5716
|
function isOpen(it) {
|
|
5604
5717
|
if (toggled[it.id] != null) return toggled[it.id];
|
|
5605
5718
|
return !!it.defaultOpen || contains(it, active);
|
|
5606
5719
|
}
|
|
5607
|
-
|
|
5720
|
+
React32.useEffect(
|
|
5608
5721
|
function() {
|
|
5609
5722
|
if (!active) return;
|
|
5610
5723
|
const next = {};
|
|
@@ -5626,7 +5739,7 @@ window.Aura = (() => {
|
|
|
5626
5739
|
},
|
|
5627
5740
|
[active]
|
|
5628
5741
|
);
|
|
5629
|
-
const navRef =
|
|
5742
|
+
const navRef = React32.useRef(null);
|
|
5630
5743
|
function onKeyDown(e) {
|
|
5631
5744
|
const k = e.key;
|
|
5632
5745
|
if (k !== "ArrowDown" && k !== "ArrowUp" && k !== "Home" && k !== "End") return;
|
|
@@ -5645,12 +5758,12 @@ window.Aura = (() => {
|
|
|
5645
5758
|
function inner(it, group, open) {
|
|
5646
5759
|
const marked = it.count != null && it.count > 0 || it.badge != null;
|
|
5647
5760
|
return [
|
|
5648
|
-
it.icon ? /* @__PURE__ */
|
|
5649
|
-
collapsed && marked ? /* @__PURE__ */
|
|
5650
|
-
/* @__PURE__ */
|
|
5651
|
-
it.badge != null ? /* @__PURE__ */
|
|
5652
|
-
it.count != null ? /* @__PURE__ */
|
|
5653
|
-
group ? /* @__PURE__ */
|
|
5761
|
+
it.icon ? /* @__PURE__ */ React32.createElement(Icon, { key: "i", name: it.icon }) : collapsed ? /* @__PURE__ */ React32.createElement("span", { key: "i", className: "aura-nav__initial", "aria-hidden": "true" }, it.label.charAt(0)) : null,
|
|
5762
|
+
collapsed && marked ? /* @__PURE__ */ React32.createElement("span", { key: "d", className: "aura-nav__dot", "aria-hidden": "true" }) : null,
|
|
5763
|
+
/* @__PURE__ */ React32.createElement("span", { key: "l", className: "aura-nav__label" }, it.label),
|
|
5764
|
+
it.badge != null ? /* @__PURE__ */ React32.createElement("span", { key: "b", className: "aura-nav__badge" }, it.badge) : null,
|
|
5765
|
+
it.count != null ? /* @__PURE__ */ React32.createElement("span", { key: "c", className: "aura-nav__count" }, it.count) : null,
|
|
5766
|
+
group ? /* @__PURE__ */ React32.createElement(Icon, { key: "g", name: "chevron-down", className: cx("aura-nav__chevron", open && "is-open") }) : null
|
|
5654
5767
|
];
|
|
5655
5768
|
}
|
|
5656
5769
|
function item(it, depth) {
|
|
@@ -5658,7 +5771,7 @@ window.Aura = (() => {
|
|
|
5658
5771
|
const open = !collapsed && isOpen(it);
|
|
5659
5772
|
const listId = base + "-" + it.id;
|
|
5660
5773
|
const holdsActive = contains(it, active);
|
|
5661
|
-
return /* @__PURE__ */
|
|
5774
|
+
return /* @__PURE__ */ React32.createElement("li", { key: it.id, className: "aura-nav__group" }, /* @__PURE__ */ React32.createElement(
|
|
5662
5775
|
"button",
|
|
5663
5776
|
{
|
|
5664
5777
|
type: "button",
|
|
@@ -5687,7 +5800,7 @@ window.Aura = (() => {
|
|
|
5687
5800
|
}
|
|
5688
5801
|
},
|
|
5689
5802
|
inner(it, true, open)
|
|
5690
|
-
), /* @__PURE__ */
|
|
5803
|
+
), /* @__PURE__ */ React32.createElement("ul", { id: listId, className: "aura-nav__list aura-nav__sub", hidden: !open }, it.children.map(function(c) {
|
|
5691
5804
|
return item(c, depth + 1);
|
|
5692
5805
|
})));
|
|
5693
5806
|
}
|
|
@@ -5703,9 +5816,9 @@ window.Aura = (() => {
|
|
|
5703
5816
|
st[1](it.id);
|
|
5704
5817
|
}
|
|
5705
5818
|
};
|
|
5706
|
-
return /* @__PURE__ */
|
|
5819
|
+
return /* @__PURE__ */ React32.createElement("li", { key: it.id }, it.href ? /* @__PURE__ */ React32.createElement(Link, { href: it.href, ...common }, inner(it, false, false)) : /* @__PURE__ */ React32.createElement("button", { type: "button", ...common }, inner(it, false, false)));
|
|
5707
5820
|
}
|
|
5708
|
-
return /* @__PURE__ */
|
|
5821
|
+
return /* @__PURE__ */ React32.createElement(
|
|
5709
5822
|
"nav",
|
|
5710
5823
|
{
|
|
5711
5824
|
ref: function(el) {
|
|
@@ -5723,14 +5836,14 @@ window.Aura = (() => {
|
|
|
5723
5836
|
"aria-label": props.label || t.mainNav,
|
|
5724
5837
|
onKeyDown
|
|
5725
5838
|
},
|
|
5726
|
-
props.header ? /* @__PURE__ */
|
|
5727
|
-
/* @__PURE__ */
|
|
5728
|
-
return /* @__PURE__ */
|
|
5839
|
+
props.header ? /* @__PURE__ */ React32.createElement("div", { className: "aura-nav__header" }, props.header) : null,
|
|
5840
|
+
/* @__PURE__ */ React32.createElement("div", { className: "aura-nav__scroll" }, sections.map(function(s, i) {
|
|
5841
|
+
return /* @__PURE__ */ React32.createElement("div", { key: i, className: "aura-nav__section" }, s.title ? /* @__PURE__ */ React32.createElement("p", { className: "aura-nav__title" }, s.title) : null, /* @__PURE__ */ React32.createElement("ul", { className: "aura-nav__list" }, s.items.map(function(it) {
|
|
5729
5842
|
return item(it, 0);
|
|
5730
5843
|
})));
|
|
5731
5844
|
})),
|
|
5732
|
-
props.footer ? /* @__PURE__ */
|
|
5733
|
-
props.collapsible ? /* @__PURE__ */
|
|
5845
|
+
props.footer ? /* @__PURE__ */ React32.createElement("div", { className: "aura-nav__footer" }, props.footer) : null,
|
|
5846
|
+
props.collapsible ? /* @__PURE__ */ React32.createElement("div", { className: "aura-nav__toggle" }, /* @__PURE__ */ React32.createElement(
|
|
5734
5847
|
IconButton,
|
|
5735
5848
|
{
|
|
5736
5849
|
icon: collapsed ? "panel-left-open" : "panel-left-close",
|
|
@@ -5743,7 +5856,7 @@ window.Aura = (() => {
|
|
|
5743
5856
|
}
|
|
5744
5857
|
)) : null,
|
|
5745
5858
|
tip && typeof document !== "undefined" ? (0, import_react_dom10.createPortal)(
|
|
5746
|
-
/* @__PURE__ */
|
|
5859
|
+
/* @__PURE__ */ React32.createElement(
|
|
5747
5860
|
"div",
|
|
5748
5861
|
{
|
|
5749
5862
|
className: "aura-tooltip aura-tooltip--right",
|
|
@@ -5758,35 +5871,35 @@ window.Aura = (() => {
|
|
|
5758
5871
|
});
|
|
5759
5872
|
|
|
5760
5873
|
// src/Breadcrumb.tsx
|
|
5761
|
-
var
|
|
5762
|
-
var Breadcrumb =
|
|
5874
|
+
var React33 = __toESM(require_react(), 1);
|
|
5875
|
+
var Breadcrumb = React33.forwardRef(function Breadcrumb2(props, ref) {
|
|
5763
5876
|
const t = useStrings();
|
|
5764
5877
|
const Link = useLinkComponent(props.linkComponent);
|
|
5765
5878
|
const items2 = props.items || [];
|
|
5766
|
-
return /* @__PURE__ */
|
|
5879
|
+
return /* @__PURE__ */ React33.createElement("nav", { ref, "aria-label": props.label || t.breadcrumb, className: cx("aura-crumbs", props.className) }, /* @__PURE__ */ React33.createElement("ol", null, items2.map(function(it, i) {
|
|
5767
5880
|
const last = i === items2.length - 1;
|
|
5768
|
-
return /* @__PURE__ */
|
|
5881
|
+
return /* @__PURE__ */ React33.createElement("li", { key: i }, last ? /* @__PURE__ */ React33.createElement("span", { "aria-current": "page", className: "aura-crumbs__current" }, it.label) : it.href ? /* @__PURE__ */ React33.createElement(Link, { href: it.href, onClick: it.onClick }, it.label) : it.onClick ? /* @__PURE__ */ React33.createElement("button", { type: "button", onClick: it.onClick }, it.label) : (
|
|
5769
5882
|
/* 5.7: a segment with no page and no action is text, not a button that does nothing. */
|
|
5770
|
-
/* @__PURE__ */
|
|
5771
|
-
), last ? null : /* @__PURE__ */
|
|
5883
|
+
/* @__PURE__ */ React33.createElement("span", { className: "aura-crumbs__text" }, it.label)
|
|
5884
|
+
), last ? null : /* @__PURE__ */ React33.createElement(Icon, { name: "chevron-right", size: 12, className: "aura-crumbs__sep" }));
|
|
5772
5885
|
})));
|
|
5773
5886
|
});
|
|
5774
5887
|
|
|
5775
5888
|
// src/Avatar.tsx
|
|
5776
|
-
var
|
|
5889
|
+
var React34 = __toESM(require_react(), 1);
|
|
5777
5890
|
var AVATAR_TONES = ["progress", "ready", "neutral", "warning"];
|
|
5778
5891
|
function initials(name) {
|
|
5779
5892
|
const parts = String(name || "?").trim().split(/\s+/);
|
|
5780
5893
|
return ((parts[0] || "?")[0] + (parts.length > 1 ? parts[parts.length - 1][0] : parts[0][1] || "")).toUpperCase();
|
|
5781
5894
|
}
|
|
5782
|
-
var Avatar =
|
|
5783
|
-
const size = props.size || "md", errState =
|
|
5895
|
+
var Avatar = React34.forwardRef(function Avatar2(props, ref) {
|
|
5896
|
+
const size = props.size || "md", errState = React34.useState(null);
|
|
5784
5897
|
let hash = 0;
|
|
5785
5898
|
String(props.name || "").split("").forEach(function(ch) {
|
|
5786
5899
|
hash = hash * 31 + ch.charCodeAt(0) >>> 0;
|
|
5787
5900
|
});
|
|
5788
5901
|
const tone2 = AVATAR_TONES[hash % AVATAR_TONES.length];
|
|
5789
|
-
return /* @__PURE__ */
|
|
5902
|
+
return /* @__PURE__ */ React34.createElement(
|
|
5790
5903
|
"span",
|
|
5791
5904
|
{
|
|
5792
5905
|
ref,
|
|
@@ -5794,7 +5907,7 @@ window.Aura = (() => {
|
|
|
5794
5907
|
role: "img",
|
|
5795
5908
|
"aria-label": props.name + (props.status ? ", " + props.status : "")
|
|
5796
5909
|
},
|
|
5797
|
-
props.src && errState[0] !== props.src ? /* @__PURE__ */
|
|
5910
|
+
props.src && errState[0] !== props.src ? /* @__PURE__ */ React34.createElement(
|
|
5798
5911
|
"img",
|
|
5799
5912
|
{
|
|
5800
5913
|
key: props.src,
|
|
@@ -5804,16 +5917,16 @@ window.Aura = (() => {
|
|
|
5804
5917
|
errState[1](props.src || null);
|
|
5805
5918
|
}
|
|
5806
5919
|
}
|
|
5807
|
-
) : /* @__PURE__ */
|
|
5808
|
-
props.status === "online" ? /* @__PURE__ */
|
|
5920
|
+
) : /* @__PURE__ */ React34.createElement("span", { "aria-hidden": true }, initials(props.name)),
|
|
5921
|
+
props.status === "online" ? /* @__PURE__ */ React34.createElement("span", { className: "aura-avatar__status", "aria-hidden": true }) : null
|
|
5809
5922
|
);
|
|
5810
5923
|
});
|
|
5811
5924
|
|
|
5812
5925
|
// src/Stack.tsx
|
|
5813
|
-
var
|
|
5926
|
+
var React36 = __toESM(require_react(), 1);
|
|
5814
5927
|
|
|
5815
5928
|
// src/responsive.tsx
|
|
5816
|
-
var
|
|
5929
|
+
var React35 = __toESM(require_react(), 1);
|
|
5817
5930
|
|
|
5818
5931
|
// src/breakpoints.ts
|
|
5819
5932
|
var breakpoints = { sm: 640, md: 768, lg: 1024, xl: 1280 };
|
|
@@ -5821,7 +5934,7 @@ window.Aura = (() => {
|
|
|
5821
5934
|
// src/responsive.tsx
|
|
5822
5935
|
var ORDER = ["base", "sm", "md", "lg", "xl"];
|
|
5823
5936
|
function useBreakpoint() {
|
|
5824
|
-
return
|
|
5937
|
+
return React35.useSyncExternalStore(subscribe, current, function() {
|
|
5825
5938
|
return "lg";
|
|
5826
5939
|
});
|
|
5827
5940
|
}
|
|
@@ -5861,8 +5974,8 @@ window.Aura = (() => {
|
|
|
5861
5974
|
};
|
|
5862
5975
|
|
|
5863
5976
|
// src/Stack.tsx
|
|
5864
|
-
var h5 =
|
|
5865
|
-
var Stack =
|
|
5977
|
+
var h5 = React36.createElement;
|
|
5978
|
+
var Stack = React36.forwardRef(function Stack2(props, ref) {
|
|
5866
5979
|
const style = Object.assign(
|
|
5867
5980
|
{},
|
|
5868
5981
|
respVars("aura-stack-dir", props.direction || "column"),
|
|
@@ -5876,9 +5989,9 @@ window.Aura = (() => {
|
|
|
5876
5989
|
});
|
|
5877
5990
|
|
|
5878
5991
|
// src/Grid.tsx
|
|
5879
|
-
var
|
|
5880
|
-
var h6 =
|
|
5881
|
-
var Grid =
|
|
5992
|
+
var React37 = __toESM(require_react(), 1);
|
|
5993
|
+
var h6 = React37.createElement;
|
|
5994
|
+
var Grid = React37.forwardRef(function Grid2(props, ref) {
|
|
5882
5995
|
const style = Object.assign(
|
|
5883
5996
|
{},
|
|
5884
5997
|
respVars("aura-grid-gap", props.gap == null ? 6 : props.gap, space),
|
|
@@ -5893,9 +6006,9 @@ window.Aura = (() => {
|
|
|
5893
6006
|
});
|
|
5894
6007
|
|
|
5895
6008
|
// src/Container.tsx
|
|
5896
|
-
var
|
|
5897
|
-
var h7 =
|
|
5898
|
-
var Container =
|
|
6009
|
+
var React38 = __toESM(require_react(), 1);
|
|
6010
|
+
var h7 = React38.createElement;
|
|
6011
|
+
var Container = React38.forwardRef(function Container2(props, ref) {
|
|
5899
6012
|
return h7(
|
|
5900
6013
|
props.as || "div",
|
|
5901
6014
|
{
|
|
@@ -5908,27 +6021,27 @@ window.Aura = (() => {
|
|
|
5908
6021
|
});
|
|
5909
6022
|
|
|
5910
6023
|
// src/AppShell.tsx
|
|
5911
|
-
var
|
|
5912
|
-
var AppShell =
|
|
6024
|
+
var React39 = __toESM(require_react(), 1);
|
|
6025
|
+
var AppShell = React39.forwardRef(function AppShell2(props, ref) {
|
|
5913
6026
|
const t = useStrings();
|
|
5914
6027
|
const bp = useBreakpoint();
|
|
5915
6028
|
const wide = bp === "lg" || bp === "xl";
|
|
5916
|
-
const st =
|
|
5917
|
-
|
|
6029
|
+
const st = React39.useState(false), open = st[0], setOpen = st[1];
|
|
6030
|
+
React39.useEffect(
|
|
5918
6031
|
function() {
|
|
5919
6032
|
if (wide) setOpen(false);
|
|
5920
6033
|
},
|
|
5921
6034
|
[wide]
|
|
5922
6035
|
);
|
|
5923
|
-
const navEl = props.nav &&
|
|
6036
|
+
const navEl = props.nav && React39.isValidElement(props.nav) ? props.nav : null;
|
|
5924
6037
|
const shared = !!navEl && navEl.props.value === void 0 && (navEl.props.defaultValue !== void 0 || navEl.props.sections !== void 0 || navEl.props.items !== void 0);
|
|
5925
|
-
const navState =
|
|
6038
|
+
const navState = React39.useState(navEl ? navEl.props.defaultValue : void 0);
|
|
5926
6039
|
function onNav(id) {
|
|
5927
6040
|
if (shared) navState[1](id);
|
|
5928
6041
|
if (navEl && navEl.props.onChange) navEl.props.onChange(id);
|
|
5929
6042
|
}
|
|
5930
|
-
const deskNav = navEl && shared ?
|
|
5931
|
-
const drawerNav = navEl ?
|
|
6043
|
+
const deskNav = navEl && shared ? React39.cloneElement(navEl, { value: navState[0], onChange: onNav }) : props.nav;
|
|
6044
|
+
const drawerNav = navEl ? React39.cloneElement(navEl, {
|
|
5932
6045
|
value: shared ? navState[0] : navEl.props.value,
|
|
5933
6046
|
onChange: function(id) {
|
|
5934
6047
|
onNav(id);
|
|
@@ -5938,7 +6051,7 @@ window.Aura = (() => {
|
|
|
5938
6051
|
collapsed: false,
|
|
5939
6052
|
collapsible: false
|
|
5940
6053
|
}) : props.nav;
|
|
5941
|
-
return /* @__PURE__ */
|
|
6054
|
+
return /* @__PURE__ */ React39.createElement("div", { ref, className: cx("aura-shell", props.bottomNav && "aura-shell--bottomnav", props.className) }, props.nav ? /* @__PURE__ */ React39.createElement("div", { className: "aura-shell__nav" }, deskNav) : null, props.nav ? /* @__PURE__ */ React39.createElement(
|
|
5942
6055
|
Drawer,
|
|
5943
6056
|
{
|
|
5944
6057
|
open,
|
|
@@ -5951,7 +6064,7 @@ window.Aura = (() => {
|
|
|
5951
6064
|
dismissible: true
|
|
5952
6065
|
},
|
|
5953
6066
|
drawerNav
|
|
5954
|
-
) : null, /* @__PURE__ */
|
|
6067
|
+
) : null, /* @__PURE__ */ React39.createElement("div", { className: "aura-shell__main" }, props.header || props.nav ? /* @__PURE__ */ React39.createElement("header", { className: cx("aura-shell__bar", !props.header && "aura-shell__bar--menu-only") }, props.nav ? /* @__PURE__ */ React39.createElement(
|
|
5955
6068
|
IconButton,
|
|
5956
6069
|
{
|
|
5957
6070
|
className: "aura-shell__menu",
|
|
@@ -5963,18 +6076,18 @@ window.Aura = (() => {
|
|
|
5963
6076
|
},
|
|
5964
6077
|
"aria-expanded": open
|
|
5965
6078
|
}
|
|
5966
|
-
) : null, /* @__PURE__ */
|
|
6079
|
+
) : null, /* @__PURE__ */ React39.createElement("div", { className: "aura-shell__bar-content" }, props.header)) : null, /* @__PURE__ */ React39.createElement("main", { className: "aura-shell__content", id: props.mainId || "main", tabIndex: -1 }, props.children), props.bottomNav || null));
|
|
5967
6080
|
});
|
|
5968
6081
|
|
|
5969
6082
|
// src/ActionBar.tsx
|
|
5970
|
-
var
|
|
5971
|
-
var ActionBar =
|
|
6083
|
+
var React40 = __toESM(require_react(), 1);
|
|
6084
|
+
var ActionBar = React40.forwardRef(function ActionBar2(props, ref) {
|
|
5972
6085
|
const t = useStrings();
|
|
5973
6086
|
const bulk = props.selected != null;
|
|
5974
6087
|
const idle = bulk && !props.selected;
|
|
5975
6088
|
const count = bulk && props.selected ? t.selectedCount(props.selected) : null;
|
|
5976
|
-
const cameFrom =
|
|
5977
|
-
const own =
|
|
6089
|
+
const cameFrom = React40.useRef(null);
|
|
6090
|
+
const own = React40.useRef(null);
|
|
5978
6091
|
function clear() {
|
|
5979
6092
|
props.onClearSelection();
|
|
5980
6093
|
setTimeout(function() {
|
|
@@ -5983,7 +6096,7 @@ window.Aura = (() => {
|
|
|
5983
6096
|
if ((!a || a === document.body || !a.isConnected) && back && back.isConnected) back.focus();
|
|
5984
6097
|
}, 0);
|
|
5985
6098
|
}
|
|
5986
|
-
return /* @__PURE__ */
|
|
6099
|
+
return /* @__PURE__ */ React40.createElement(
|
|
5987
6100
|
"div",
|
|
5988
6101
|
{
|
|
5989
6102
|
ref: function(el) {
|
|
@@ -6004,16 +6117,16 @@ window.Aura = (() => {
|
|
|
6004
6117
|
props.className
|
|
6005
6118
|
)
|
|
6006
6119
|
},
|
|
6007
|
-
/* @__PURE__ */
|
|
6120
|
+
/* @__PURE__ */ React40.createElement("div", { className: "aura-actionbar__inner" }, /* @__PURE__ */ React40.createElement("div", { className: "aura-actionbar__status", role: "status" }, count, count && props.status ? " \xB7 " : null, props.status), !idle ? /* @__PURE__ */ React40.createElement("div", { className: "aura-actionbar__actions" }, count && props.onClearSelection ? /* @__PURE__ */ React40.createElement(Button, { variant: "ghost", size: "sm", onClick: clear }, t.clear()) : null, props.children) : null)
|
|
6008
6121
|
);
|
|
6009
6122
|
});
|
|
6010
6123
|
|
|
6011
6124
|
// src/Separator.tsx
|
|
6012
|
-
var
|
|
6013
|
-
var Separator =
|
|
6125
|
+
var React41 = __toESM(require_react(), 1);
|
|
6126
|
+
var Separator = React41.forwardRef(function Separator2(props, ref) {
|
|
6014
6127
|
const vertical = props.orientation === "vertical";
|
|
6015
6128
|
const decorative = props.decorative !== false;
|
|
6016
|
-
return /* @__PURE__ */
|
|
6129
|
+
return /* @__PURE__ */ React41.createElement(
|
|
6017
6130
|
"div",
|
|
6018
6131
|
{
|
|
6019
6132
|
ref,
|
|
@@ -6026,12 +6139,64 @@ window.Aura = (() => {
|
|
|
6026
6139
|
});
|
|
6027
6140
|
|
|
6028
6141
|
// src/Table.tsx
|
|
6029
|
-
var
|
|
6030
|
-
var
|
|
6031
|
-
|
|
6142
|
+
var React42 = __toESM(require_react(), 1);
|
|
6143
|
+
var StackLabels = React42.createContext(null);
|
|
6144
|
+
var ColumnIndex = React42.createContext(-1);
|
|
6145
|
+
function flat(children) {
|
|
6146
|
+
const out = [];
|
|
6147
|
+
React42.Children.toArray(children).forEach(function(c) {
|
|
6148
|
+
if (React42.isValidElement(c) && c.type === React42.Fragment)
|
|
6149
|
+
out.push.apply(out, flat(c.props.children));
|
|
6150
|
+
else out.push(c);
|
|
6151
|
+
});
|
|
6152
|
+
return out;
|
|
6153
|
+
}
|
|
6154
|
+
function text(node) {
|
|
6155
|
+
if (typeof node === "string" || typeof node === "number") return String(node);
|
|
6156
|
+
if (Array.isArray(node)) {
|
|
6157
|
+
const parts = node.map(text).filter(function(x) {
|
|
6158
|
+
return x != null;
|
|
6159
|
+
});
|
|
6160
|
+
return parts.length ? parts.join("") : void 0;
|
|
6161
|
+
}
|
|
6162
|
+
if (React42.isValidElement(node)) {
|
|
6163
|
+
const p = node.props;
|
|
6164
|
+
if (p["aria-hidden"] === true || p["aria-hidden"] === "true") return void 0;
|
|
6165
|
+
return text(p.children);
|
|
6166
|
+
}
|
|
6167
|
+
return void 0;
|
|
6168
|
+
}
|
|
6169
|
+
function headerLabels(children) {
|
|
6170
|
+
let out = [];
|
|
6171
|
+
flat(children).forEach(function(c) {
|
|
6172
|
+
if (out.length || !React42.isValidElement(c) || c.type !== THead) return;
|
|
6173
|
+
const row = flat(c.props.children).find(function(r) {
|
|
6174
|
+
return React42.isValidElement(r);
|
|
6175
|
+
});
|
|
6176
|
+
if (!row) return;
|
|
6177
|
+
flat(row.props.children).forEach(function(cell) {
|
|
6178
|
+
if (!React42.isValidElement(cell)) return;
|
|
6179
|
+
const p = cell.props;
|
|
6180
|
+
const t = text(p.children);
|
|
6181
|
+
const label = p.label != null ? p.label : t != null ? t.replace(/\s+/g, " ").trim() || void 0 : void 0;
|
|
6182
|
+
const span = Math.max(1, Number(p.colSpan) || 1);
|
|
6183
|
+
for (let i = 0; i < span; i++) out.push(label);
|
|
6184
|
+
});
|
|
6185
|
+
});
|
|
6186
|
+
return out;
|
|
6187
|
+
}
|
|
6188
|
+
var Table = React42.forwardRef(function Table2(props, ref) {
|
|
6189
|
+
const { caption, captionHidden, density, stackBelow, className, children, ...rest } = props;
|
|
6190
|
+
const labels = stackBelow ? headerLabels(children) : null;
|
|
6191
|
+
if (labels && !labels.length)
|
|
6192
|
+
devWarnOnce(
|
|
6193
|
+
"tbl-stack-labels",
|
|
6194
|
+
"Table stackBelow: no THead > Tr > Th found among its children, so cells have no labels. Pass `label` on each Td."
|
|
6195
|
+
);
|
|
6196
|
+
const outer = React42.useContext(StackLabels);
|
|
6032
6197
|
const capId = uid();
|
|
6033
|
-
const wrap =
|
|
6034
|
-
const sc =
|
|
6198
|
+
const wrap = React42.useRef(null);
|
|
6199
|
+
const sc = React42.useState(false), scrolls = sc[0];
|
|
6035
6200
|
useIsoLayoutEffect(function() {
|
|
6036
6201
|
const el = wrap.current;
|
|
6037
6202
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
@@ -6045,24 +6210,38 @@ window.Aura = (() => {
|
|
|
6045
6210
|
ro.disconnect();
|
|
6046
6211
|
};
|
|
6047
6212
|
}, []);
|
|
6048
|
-
return /* @__PURE__ */
|
|
6213
|
+
return /* @__PURE__ */ React42.createElement(
|
|
6049
6214
|
"div",
|
|
6050
6215
|
{
|
|
6051
6216
|
ref: wrap,
|
|
6052
|
-
className: "aura-tbl-wrap",
|
|
6217
|
+
className: cx("aura-tbl-wrap", stackBelow && "is-stackable"),
|
|
6053
6218
|
"data-density": density,
|
|
6054
6219
|
tabIndex: scrolls ? 0 : void 0,
|
|
6055
6220
|
role: scrolls && (caption != null || rest["aria-label"]) ? "region" : void 0,
|
|
6056
6221
|
"aria-labelledby": scrolls && caption != null ? capId : void 0,
|
|
6057
6222
|
"aria-label": scrolls && caption == null ? rest["aria-label"] : void 0
|
|
6058
6223
|
},
|
|
6059
|
-
/* @__PURE__ */
|
|
6224
|
+
/* @__PURE__ */ React42.createElement(
|
|
6225
|
+
"table",
|
|
6226
|
+
{
|
|
6227
|
+
ref,
|
|
6228
|
+
className: cx("aura-tbl", stackBelow && "aura-tbl--stack-" + stackBelow, className),
|
|
6229
|
+
role: stackBelow ? "table" : void 0,
|
|
6230
|
+
...rest
|
|
6231
|
+
},
|
|
6232
|
+
caption != null ? /* @__PURE__ */ React42.createElement("caption", { id: capId, className: cx("aura-tbl__caption", captionHidden && "aura-sr-only") }, caption) : null,
|
|
6233
|
+
labels ? /* @__PURE__ */ React42.createElement(StackLabels.Provider, { value: labels }, children) : outer ? /* @__PURE__ */ React42.createElement(StackLabels.Provider, { value: null }, children) : children
|
|
6234
|
+
)
|
|
6060
6235
|
);
|
|
6061
6236
|
});
|
|
6062
6237
|
function section(tag, cls) {
|
|
6063
|
-
const C =
|
|
6238
|
+
const C = React42.forwardRef(function TableSection(props, ref) {
|
|
6064
6239
|
const { className, ...rest } = props;
|
|
6065
|
-
|
|
6240
|
+
const stacked = React42.useContext(StackLabels) != null;
|
|
6241
|
+
return React42.createElement(
|
|
6242
|
+
tag,
|
|
6243
|
+
Object.assign({ ref, className: cx(cls, className), role: stacked ? "rowgroup" : void 0 }, rest)
|
|
6244
|
+
);
|
|
6066
6245
|
});
|
|
6067
6246
|
return C;
|
|
6068
6247
|
}
|
|
@@ -6072,9 +6251,15 @@ window.Aura = (() => {
|
|
|
6072
6251
|
TBody.displayName = "TBody";
|
|
6073
6252
|
var TFoot = section("tfoot", "aura-tbl__foot");
|
|
6074
6253
|
TFoot.displayName = "TFoot";
|
|
6075
|
-
var Tr =
|
|
6076
|
-
const { className, ...rest } = props;
|
|
6077
|
-
|
|
6254
|
+
var Tr = React42.forwardRef(function Tr2(props, ref) {
|
|
6255
|
+
const { className, children, ...rest } = props;
|
|
6256
|
+
const stacked = React42.useContext(StackLabels) != null;
|
|
6257
|
+
let col = 0;
|
|
6258
|
+
return /* @__PURE__ */ React42.createElement("tr", { ref, className: cx("aura-tbl__row", className), role: stacked ? "row" : void 0, ...rest }, stacked ? flat(children).map(function(c) {
|
|
6259
|
+
const at = col;
|
|
6260
|
+
if (React42.isValidElement(c)) col += Math.max(1, Number(c.props.colSpan) || 1);
|
|
6261
|
+
return /* @__PURE__ */ React42.createElement(ColumnIndex.Provider, { key: React42.isValidElement(c) && c.key != null ? c.key : at, value: at }, c);
|
|
6262
|
+
}) : children);
|
|
6078
6263
|
});
|
|
6079
6264
|
function cellClass(base, p) {
|
|
6080
6265
|
const align = p.align || (p.numeric ? "end" : void 0);
|
|
@@ -6087,18 +6272,39 @@ window.Aura = (() => {
|
|
|
6087
6272
|
p.className
|
|
6088
6273
|
);
|
|
6089
6274
|
}
|
|
6090
|
-
var Th =
|
|
6091
|
-
const { align, numeric, mono, className, scope, ...rest } = props;
|
|
6092
|
-
|
|
6275
|
+
var Th = React42.forwardRef(function Th2(props, ref) {
|
|
6276
|
+
const { align, numeric, mono, className, scope, label, ...rest } = props;
|
|
6277
|
+
const stacked = React42.useContext(StackLabels) != null;
|
|
6278
|
+
return /* @__PURE__ */ React42.createElement(
|
|
6279
|
+
"th",
|
|
6280
|
+
{
|
|
6281
|
+
ref,
|
|
6282
|
+
scope: scope || "col",
|
|
6283
|
+
className: cellClass("aura-tbl__th", props),
|
|
6284
|
+
role: stacked ? scope === "row" ? "rowheader" : "columnheader" : void 0,
|
|
6285
|
+
...rest
|
|
6286
|
+
}
|
|
6287
|
+
);
|
|
6093
6288
|
});
|
|
6094
|
-
var Td =
|
|
6095
|
-
const { align, numeric, mono, className, scope, ...rest } = props;
|
|
6096
|
-
|
|
6289
|
+
var Td = React42.forwardRef(function Td2(props, ref) {
|
|
6290
|
+
const { align, numeric, mono, className, scope, label, ...rest } = props;
|
|
6291
|
+
const labels = React42.useContext(StackLabels), col = React42.useContext(ColumnIndex);
|
|
6292
|
+
const shown = labels ? label != null ? label : col >= 0 ? labels[col] : void 0 : void 0;
|
|
6293
|
+
return /* @__PURE__ */ React42.createElement(
|
|
6294
|
+
"td",
|
|
6295
|
+
{
|
|
6296
|
+
ref,
|
|
6297
|
+
className: cellClass("aura-tbl__td", props),
|
|
6298
|
+
role: labels ? "cell" : void 0,
|
|
6299
|
+
"data-label": shown || void 0,
|
|
6300
|
+
...rest
|
|
6301
|
+
}
|
|
6302
|
+
);
|
|
6097
6303
|
});
|
|
6098
6304
|
|
|
6099
6305
|
// src/BottomNav.tsx
|
|
6100
|
-
var
|
|
6101
|
-
var BottomNav =
|
|
6306
|
+
var React43 = __toESM(require_react(), 1);
|
|
6307
|
+
var BottomNav = React43.forwardRef(function BottomNav2(props, ref) {
|
|
6102
6308
|
const t = useStrings();
|
|
6103
6309
|
const Link = useLinkComponent(props.linkComponent);
|
|
6104
6310
|
const st = useMaybeControlled(
|
|
@@ -6108,14 +6314,14 @@ window.Aura = (() => {
|
|
|
6108
6314
|
);
|
|
6109
6315
|
const active = st[0];
|
|
6110
6316
|
const hide = props.hideFrom === false ? "always" : "below-" + (props.hideFrom || "lg");
|
|
6111
|
-
return /* @__PURE__ */
|
|
6317
|
+
return /* @__PURE__ */ React43.createElement(React43.Fragment, null, /* @__PURE__ */ React43.createElement("div", { className: cx("aura-bottomnav-spacer", "aura-bottomnav--" + hide), "aria-hidden": "true" }), /* @__PURE__ */ React43.createElement(
|
|
6112
6318
|
"nav",
|
|
6113
6319
|
{
|
|
6114
6320
|
ref,
|
|
6115
6321
|
className: cx("aura-bottomnav", "aura-bottomnav--" + hide, props.className),
|
|
6116
6322
|
"aria-label": props.label || t.mainNav
|
|
6117
6323
|
},
|
|
6118
|
-
/* @__PURE__ */
|
|
6324
|
+
/* @__PURE__ */ React43.createElement("ul", { className: "aura-bottomnav__list" }, props.items.map(function(it) {
|
|
6119
6325
|
const on = active === it.id;
|
|
6120
6326
|
const count = it.count != null && it.count > 0 ? it.count > 99 ? "99+" : String(it.count) : null;
|
|
6121
6327
|
const suffix = count || it.badge && it.badgeLabel ? " (" + (count || it.badgeLabel) + ")" : "";
|
|
@@ -6131,19 +6337,19 @@ window.Aura = (() => {
|
|
|
6131
6337
|
}
|
|
6132
6338
|
};
|
|
6133
6339
|
const inner = [
|
|
6134
|
-
/* @__PURE__ */
|
|
6135
|
-
/* @__PURE__ */
|
|
6136
|
-
suffix && !it.ariaLabel ? /* @__PURE__ */
|
|
6340
|
+
/* @__PURE__ */ React43.createElement("span", { key: "i", className: "aura-bottomnav__icon" }, /* @__PURE__ */ React43.createElement(Icon, { name: it.icon, size: "md" }), count ? /* @__PURE__ */ React43.createElement("span", { className: "aura-bottomnav__count", "aria-hidden": "true" }, count) : it.badge ? /* @__PURE__ */ React43.createElement("span", { className: "aura-bottomnav__dot", "aria-hidden": "true" }) : null),
|
|
6341
|
+
/* @__PURE__ */ React43.createElement("span", { key: "l", className: "aura-bottomnav__label" }, it.label),
|
|
6342
|
+
suffix && !it.ariaLabel ? /* @__PURE__ */ React43.createElement("span", { key: "s", className: "aura-sr-only" }, suffix) : null
|
|
6137
6343
|
];
|
|
6138
|
-
return /* @__PURE__ */
|
|
6344
|
+
return /* @__PURE__ */ React43.createElement("li", { key: it.id, className: "aura-bottomnav__cell" }, it.href ? /* @__PURE__ */ React43.createElement(Link, { href: it.href, ...common }, inner) : /* @__PURE__ */ React43.createElement("button", { type: "button", ...common }, inner));
|
|
6139
6345
|
}))
|
|
6140
6346
|
));
|
|
6141
6347
|
});
|
|
6142
6348
|
|
|
6143
6349
|
// src/Surface.tsx
|
|
6144
|
-
var
|
|
6145
|
-
var h8 =
|
|
6146
|
-
var Surface =
|
|
6350
|
+
var React44 = __toESM(require_react(), 1);
|
|
6351
|
+
var h8 = React44.createElement;
|
|
6352
|
+
var Surface = React44.forwardRef(function Surface2(props, ref) {
|
|
6147
6353
|
const t = props.texture || "mesh";
|
|
6148
6354
|
const rest = omit(props, ["texture", "className", "children", "as"]);
|
|
6149
6355
|
return h8(
|
|
@@ -6164,8 +6370,8 @@ window.Aura = (() => {
|
|
|
6164
6370
|
});
|
|
6165
6371
|
|
|
6166
6372
|
// src/Stat.tsx
|
|
6167
|
-
var
|
|
6168
|
-
var Stat =
|
|
6373
|
+
var React45 = __toESM(require_react(), 1);
|
|
6374
|
+
var Stat = React45.forwardRef(function Stat2(props, ref) {
|
|
6169
6375
|
const ch = props.change;
|
|
6170
6376
|
const dir = ch && (ch.direction || "flat");
|
|
6171
6377
|
const tone2 = ch && (ch.tone || (dir === "up" ? "positive" : dir === "down" ? "negative" : "neutral"));
|
|
@@ -6174,7 +6380,7 @@ window.Aura = (() => {
|
|
|
6174
6380
|
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, ""));
|
|
6175
6381
|
const Tag3 = props.href ? Link : props.onClick ? "button" : "div";
|
|
6176
6382
|
const interactive = !!(props.href || props.onClick);
|
|
6177
|
-
return /* @__PURE__ */
|
|
6383
|
+
return /* @__PURE__ */ React45.createElement(
|
|
6178
6384
|
Tag3,
|
|
6179
6385
|
{
|
|
6180
6386
|
ref,
|
|
@@ -6184,14 +6390,14 @@ window.Aura = (() => {
|
|
|
6184
6390
|
type: Tag3 === "button" ? "button" : void 0,
|
|
6185
6391
|
"aria-busy": props.loading || void 0
|
|
6186
6392
|
},
|
|
6187
|
-
/* @__PURE__ */
|
|
6188
|
-
props.loading ? /* @__PURE__ */
|
|
6189
|
-
ch && !props.loading || props.caption ? /* @__PURE__ */
|
|
6393
|
+
/* @__PURE__ */ React45.createElement("span", { className: "aura-stat__head" }, /* @__PURE__ */ React45.createElement("span", { className: "aura-stat__label" }, props.label), props.icon ? /* @__PURE__ */ React45.createElement("span", { className: "aura-stat__icon" }, /* @__PURE__ */ React45.createElement(Icon, { name: props.icon })) : null),
|
|
6394
|
+
props.loading ? /* @__PURE__ */ React45.createElement("span", { className: "aura-stat__value" }, /* @__PURE__ */ React45.createElement("span", { className: "aura-skel aura-stat__skel" })) : /* @__PURE__ */ React45.createElement("span", { className: cx("aura-stat__value", numeric && "is-numeric") }, props.value, props.unit ? /* @__PURE__ */ React45.createElement("span", { className: "aura-stat__unit" }, props.unit) : null),
|
|
6395
|
+
ch && !props.loading || props.caption ? /* @__PURE__ */ React45.createElement("span", { className: "aura-stat__foot" }, ch && !props.loading ? /* @__PURE__ */ React45.createElement("span", { className: cx("aura-stat__change", "is-" + tone2) }, /* @__PURE__ */ React45.createElement(Icon, { name: dir === "up" ? "trending-up" : dir === "down" ? "trending-down" : "minus", size: 14 }), /* @__PURE__ */ React45.createElement("span", null, ch.value)) : null, ch && ch.label && !props.loading ? /* @__PURE__ */ React45.createElement("span", { className: "aura-stat__caption" }, ch.label) : null, props.caption ? /* @__PURE__ */ React45.createElement("span", { className: "aura-stat__caption" }, props.caption) : null) : null
|
|
6190
6396
|
);
|
|
6191
6397
|
});
|
|
6192
6398
|
|
|
6193
6399
|
// src/TimePicker.tsx
|
|
6194
|
-
var
|
|
6400
|
+
var React46 = __toESM(require_react(), 1);
|
|
6195
6401
|
var import_react_dom11 = __toESM(require_react_dom(), 1);
|
|
6196
6402
|
|
|
6197
6403
|
// src/text.ts
|
|
@@ -6208,8 +6414,8 @@ window.Aura = (() => {
|
|
|
6208
6414
|
function pad2(n2) {
|
|
6209
6415
|
return (n2 < 10 ? "0" : "") + n2;
|
|
6210
6416
|
}
|
|
6211
|
-
function parseTime(
|
|
6212
|
-
let s = String(
|
|
6417
|
+
function parseTime(text2) {
|
|
6418
|
+
let s = String(text2 || "").trim().toLowerCase().replace(/\s*(น\.?|นาฬิกา)$/, "").trim();
|
|
6213
6419
|
const pm = /\s*(pm|p\.m\.)$/.test(s), am = /\s*(am|a\.m\.)$/.test(s);
|
|
6214
6420
|
s = s.replace(/\s*(am|pm|a\.m\.|p\.m\.)$/, "");
|
|
6215
6421
|
const m = /^(\d{1,2})(?:[:.](\d{2}))?$/.exec(s) || /^(\d{1,2})(\d{2})$/.exec(s);
|
|
@@ -6233,7 +6439,7 @@ window.Aura = (() => {
|
|
|
6233
6439
|
function fromMin(n2) {
|
|
6234
6440
|
return pad3(Math.floor(n2 / 60)) + ":" + pad3(n2 % 60);
|
|
6235
6441
|
}
|
|
6236
|
-
var TimePicker =
|
|
6442
|
+
var TimePicker = React46.forwardRef(function TimePicker2(props, ref) {
|
|
6237
6443
|
const t = useStrings();
|
|
6238
6444
|
const auto = uid(), id = props.id || auto, listId = id + "-list";
|
|
6239
6445
|
const st = useMaybeControlled(
|
|
@@ -6243,7 +6449,7 @@ window.Aura = (() => {
|
|
|
6243
6449
|
);
|
|
6244
6450
|
const value = st[0];
|
|
6245
6451
|
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;
|
|
6246
|
-
const slots =
|
|
6452
|
+
const slots = React46.useMemo(
|
|
6247
6453
|
function() {
|
|
6248
6454
|
const out = [];
|
|
6249
6455
|
for (let m = lo; m <= hi; m += step) out.push(fromMin(m));
|
|
@@ -6255,12 +6461,12 @@ window.Aura = (() => {
|
|
|
6255
6461
|
const n2 = toMin(v);
|
|
6256
6462
|
return n2 == null || n2 < lo || n2 > hi || props.isTimeDisabled && props.isTimeDisabled(v);
|
|
6257
6463
|
}
|
|
6258
|
-
const openState =
|
|
6259
|
-
const editState =
|
|
6260
|
-
const aState =
|
|
6261
|
-
const errState =
|
|
6262
|
-
const pos =
|
|
6263
|
-
const boxRef =
|
|
6464
|
+
const openState = React46.useState(false), open = openState[0], setOpen = openState[1];
|
|
6465
|
+
const editState = React46.useState(null), editing = editState[0], setEditing = editState[1];
|
|
6466
|
+
const aState = React46.useState(0), active = aState[0], setActive = aState[1];
|
|
6467
|
+
const errState = React46.useState(null);
|
|
6468
|
+
const pos = React46.useState(null);
|
|
6469
|
+
const boxRef = React46.useRef(null), inputRef = React46.useRef(null), listRef = React46.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
6264
6470
|
const mounted = useMounted();
|
|
6265
6471
|
function nearest(v) {
|
|
6266
6472
|
const n2 = toMin(v);
|
|
@@ -6288,7 +6494,7 @@ window.Aura = (() => {
|
|
|
6288
6494
|
},
|
|
6289
6495
|
[open]
|
|
6290
6496
|
);
|
|
6291
|
-
|
|
6497
|
+
React46.useEffect(
|
|
6292
6498
|
function() {
|
|
6293
6499
|
if (!open) return;
|
|
6294
6500
|
function outside(e) {
|
|
@@ -6310,7 +6516,7 @@ window.Aura = (() => {
|
|
|
6310
6516
|
},
|
|
6311
6517
|
[open]
|
|
6312
6518
|
);
|
|
6313
|
-
|
|
6519
|
+
React46.useEffect(
|
|
6314
6520
|
function() {
|
|
6315
6521
|
if (!open || !listRef.current) return;
|
|
6316
6522
|
const el = listRef.current.querySelector('[data-idx="' + active + '"]');
|
|
@@ -6409,9 +6615,9 @@ window.Aura = (() => {
|
|
|
6409
6615
|
}
|
|
6410
6616
|
const error = errState[0] || props.error;
|
|
6411
6617
|
const list = open && mounted && pos[0] ? (0, import_react_dom11.createPortal)(
|
|
6412
|
-
/* @__PURE__ */
|
|
6618
|
+
/* @__PURE__ */ React46.createElement("div", { ref: listRef, className: "aura-combo__popover aura-time__popover", style: pos[0] }, /* @__PURE__ */ React46.createElement("ul", { id: listId, role: "listbox", "aria-label": props.label, className: "aura-combo__list" }, slots.map(function(s, i) {
|
|
6413
6619
|
const dis = blocked(s), sel = s === value;
|
|
6414
|
-
return /* @__PURE__ */
|
|
6620
|
+
return /* @__PURE__ */ React46.createElement(
|
|
6415
6621
|
"li",
|
|
6416
6622
|
{
|
|
6417
6623
|
key: s,
|
|
@@ -6436,13 +6642,13 @@ window.Aura = (() => {
|
|
|
6436
6642
|
if (active !== i) setActive(i);
|
|
6437
6643
|
}
|
|
6438
6644
|
},
|
|
6439
|
-
/* @__PURE__ */
|
|
6440
|
-
sel ? /* @__PURE__ */
|
|
6645
|
+
/* @__PURE__ */ React46.createElement("span", { className: "aura-combo__label" }, s),
|
|
6646
|
+
sel ? /* @__PURE__ */ React46.createElement(Icon, { name: "check", className: "aura-combo__check" }) : null
|
|
6441
6647
|
);
|
|
6442
6648
|
}))),
|
|
6443
6649
|
document.body
|
|
6444
6650
|
) : null;
|
|
6445
|
-
return /* @__PURE__ */
|
|
6651
|
+
return /* @__PURE__ */ React46.createElement(
|
|
6446
6652
|
Field,
|
|
6447
6653
|
{
|
|
6448
6654
|
id,
|
|
@@ -6454,7 +6660,7 @@ window.Aura = (() => {
|
|
|
6454
6660
|
disabled: props.disabled,
|
|
6455
6661
|
className: props.className
|
|
6456
6662
|
},
|
|
6457
|
-
/* @__PURE__ */
|
|
6663
|
+
/* @__PURE__ */ React46.createElement("div", { ref: boxRef, className: cx("aura-input aura-combo aura-time has-icon", open && "is-open") }, /* @__PURE__ */ React46.createElement(Icon, { name: "clock", className: "aura-input__icon" }), /* @__PURE__ */ React46.createElement(
|
|
6458
6664
|
"input",
|
|
6459
6665
|
{
|
|
6460
6666
|
ref: inputMerged,
|
|
@@ -6494,7 +6700,7 @@ window.Aura = (() => {
|
|
|
6494
6700
|
}, 0);
|
|
6495
6701
|
}
|
|
6496
6702
|
}
|
|
6497
|
-
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */
|
|
6703
|
+
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */ React46.createElement(
|
|
6498
6704
|
"button",
|
|
6499
6705
|
{
|
|
6500
6706
|
type: "button",
|
|
@@ -6507,8 +6713,8 @@ window.Aura = (() => {
|
|
|
6507
6713
|
if (inputRef.current) inputRef.current.focus();
|
|
6508
6714
|
}
|
|
6509
6715
|
},
|
|
6510
|
-
/* @__PURE__ */
|
|
6511
|
-
) : null, /* @__PURE__ */
|
|
6716
|
+
/* @__PURE__ */ React46.createElement(Icon, { name: "x" })
|
|
6717
|
+
) : null, /* @__PURE__ */ React46.createElement(
|
|
6512
6718
|
"button",
|
|
6513
6719
|
{
|
|
6514
6720
|
type: "button",
|
|
@@ -6526,14 +6732,14 @@ window.Aura = (() => {
|
|
|
6526
6732
|
}
|
|
6527
6733
|
}
|
|
6528
6734
|
},
|
|
6529
|
-
/* @__PURE__ */
|
|
6735
|
+
/* @__PURE__ */ React46.createElement(Icon, { name: "chevron-down" })
|
|
6530
6736
|
)),
|
|
6531
6737
|
list
|
|
6532
6738
|
);
|
|
6533
6739
|
});
|
|
6534
6740
|
|
|
6535
6741
|
// src/FileUpload.tsx
|
|
6536
|
-
var
|
|
6742
|
+
var React47 = __toESM(require_react(), 1);
|
|
6537
6743
|
function matches(file, accept) {
|
|
6538
6744
|
if (!accept) return true;
|
|
6539
6745
|
const name = (file.name || "").toLowerCase(), type = (file.type || "").toLowerCase();
|
|
@@ -6557,24 +6763,24 @@ window.Aura = (() => {
|
|
|
6557
6763
|
}).join(", ");
|
|
6558
6764
|
}
|
|
6559
6765
|
var seq = 0;
|
|
6560
|
-
var FileUpload =
|
|
6766
|
+
var FileUpload = React47.forwardRef(function FileUpload2(props, ref) {
|
|
6561
6767
|
const t = useStrings();
|
|
6562
6768
|
const auto = uid(), id = props.id || auto;
|
|
6563
6769
|
const st = useMaybeControlled(props.value, props.defaultValue || [], props.onChange);
|
|
6564
6770
|
const items2 = st[0] || [];
|
|
6565
|
-
const dragState =
|
|
6566
|
-
const inputRef =
|
|
6567
|
-
const urls =
|
|
6771
|
+
const dragState = React47.useState(false), over = dragState[0];
|
|
6772
|
+
const inputRef = React47.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
6773
|
+
const urls = React47.useRef({});
|
|
6568
6774
|
const maxFiles = props.multiple ? props.maxFiles : 1;
|
|
6569
6775
|
const note = t.accepts(describeAccept(props.accept, t), props.maxSize ? formatBytes(props.maxSize) : "");
|
|
6570
|
-
|
|
6776
|
+
React47.useEffect(function() {
|
|
6571
6777
|
return function() {
|
|
6572
6778
|
Object.keys(urls.current).forEach(function(k) {
|
|
6573
6779
|
URL.revokeObjectURL(urls.current[k]);
|
|
6574
6780
|
});
|
|
6575
6781
|
};
|
|
6576
6782
|
}, []);
|
|
6577
|
-
|
|
6783
|
+
React47.useEffect(
|
|
6578
6784
|
function() {
|
|
6579
6785
|
const el = inputRef.current;
|
|
6580
6786
|
if (!el || !props.name || typeof DataTransfer === "undefined") return;
|
|
@@ -6634,7 +6840,7 @@ window.Aura = (() => {
|
|
|
6634
6840
|
if (inputRef.current) inputRef.current.focus();
|
|
6635
6841
|
}
|
|
6636
6842
|
const error = props.error;
|
|
6637
|
-
return /* @__PURE__ */
|
|
6843
|
+
return /* @__PURE__ */ React47.createElement(
|
|
6638
6844
|
Field,
|
|
6639
6845
|
{
|
|
6640
6846
|
id,
|
|
@@ -6646,7 +6852,7 @@ window.Aura = (() => {
|
|
|
6646
6852
|
disabled: props.disabled,
|
|
6647
6853
|
className: props.className
|
|
6648
6854
|
},
|
|
6649
|
-
/* @__PURE__ */
|
|
6855
|
+
/* @__PURE__ */ React47.createElement(
|
|
6650
6856
|
"div",
|
|
6651
6857
|
{
|
|
6652
6858
|
className: cx("aura-upload", over && "is-over", props.disabled && "is-disabled", error && "is-invalid"),
|
|
@@ -6667,9 +6873,9 @@ window.Aura = (() => {
|
|
|
6667
6873
|
add(e.dataTransfer && e.dataTransfer.files);
|
|
6668
6874
|
}
|
|
6669
6875
|
},
|
|
6670
|
-
/* @__PURE__ */
|
|
6671
|
-
/* @__PURE__ */
|
|
6672
|
-
/* @__PURE__ */
|
|
6876
|
+
/* @__PURE__ */ React47.createElement(Icon, { name: "cloud-upload", size: "lg", className: "aura-upload__icon" }),
|
|
6877
|
+
/* @__PURE__ */ React47.createElement("span", { className: "aura-upload__text" }, t.dropFiles, " "),
|
|
6878
|
+
/* @__PURE__ */ React47.createElement(
|
|
6673
6879
|
"input",
|
|
6674
6880
|
{
|
|
6675
6881
|
ref: inputMerged,
|
|
@@ -6691,12 +6897,12 @@ window.Aura = (() => {
|
|
|
6691
6897
|
}
|
|
6692
6898
|
}
|
|
6693
6899
|
),
|
|
6694
|
-
/* @__PURE__ */
|
|
6695
|
-
note ? /* @__PURE__ */
|
|
6900
|
+
/* @__PURE__ */ React47.createElement("span", { className: "aura-upload__browse", "aria-hidden": true }, props.multiple ? t.browse : t.browseOne),
|
|
6901
|
+
note ? /* @__PURE__ */ React47.createElement("span", { className: "aura-upload__note", id: id + "-note" }, note) : null
|
|
6696
6902
|
),
|
|
6697
|
-
items2.length ? /* @__PURE__ */
|
|
6903
|
+
items2.length ? /* @__PURE__ */ React47.createElement("ul", { className: "aura-upload__list", "aria-live": "polite" }, items2.map(function(it) {
|
|
6698
6904
|
const src = thumb(it);
|
|
6699
|
-
return /* @__PURE__ */
|
|
6905
|
+
return /* @__PURE__ */ React47.createElement("li", { key: it.id, className: cx("aura-upload__item", it.error && "is-error") }, src ? /* @__PURE__ */ React47.createElement("img", { className: "aura-upload__thumb", src, alt: "" }) : /* @__PURE__ */ React47.createElement("span", { className: "aura-upload__thumb is-icon", "aria-hidden": true }, /* @__PURE__ */ React47.createElement(Icon, { name: /^image\//.test(it.type || "") ? "image" : "file", size: "md" })), /* @__PURE__ */ React47.createElement("span", { className: "aura-upload__meta" }, it.url && !it.error ? /* @__PURE__ */ React47.createElement("a", { className: "aura-upload__name", href: it.url, target: "_blank", rel: "noreferrer" }, it.name) : /* @__PURE__ */ React47.createElement("span", { className: "aura-upload__name" }, it.name), /* @__PURE__ */ React47.createElement("span", { className: "aura-upload__sub" }, it.error ? /* @__PURE__ */ React47.createElement(React47.Fragment, null, /* @__PURE__ */ React47.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__ */ React47.createElement(React47.Fragment, null, /* @__PURE__ */ React47.createElement(Icon, { name: "circle-check", size: 12 }), formatBytes(it.size)) : formatBytes(it.size)), it.status === "uploading" ? /* @__PURE__ */ React47.createElement(
|
|
6700
6906
|
"span",
|
|
6701
6907
|
{
|
|
6702
6908
|
className: "aura-upload__bar",
|
|
@@ -6706,8 +6912,8 @@ window.Aura = (() => {
|
|
|
6706
6912
|
"aria-valuemax": 100,
|
|
6707
6913
|
"aria-valuenow": it.progress != null ? Math.round(it.progress) : void 0
|
|
6708
6914
|
},
|
|
6709
|
-
/* @__PURE__ */
|
|
6710
|
-
) : null), /* @__PURE__ */
|
|
6915
|
+
/* @__PURE__ */ React47.createElement("span", { style: { width: (it.progress || 0) + "%" } })
|
|
6916
|
+
) : null), /* @__PURE__ */ React47.createElement(
|
|
6711
6917
|
IconButton,
|
|
6712
6918
|
{
|
|
6713
6919
|
icon: "x",
|
|
@@ -6995,9 +7201,9 @@ window.Aura = (() => {
|
|
|
6995
7201
|
}
|
|
6996
7202
|
|
|
6997
7203
|
// src/ThemeStyle.tsx
|
|
6998
|
-
var
|
|
7204
|
+
var React48 = __toESM(require_react(), 1);
|
|
6999
7205
|
function ThemeStyle(props) {
|
|
7000
|
-
const css =
|
|
7206
|
+
const css = React48.useMemo(
|
|
7001
7207
|
function() {
|
|
7002
7208
|
try {
|
|
7003
7209
|
return createTheme({
|
|
@@ -7014,11 +7220,11 @@ window.Aura = (() => {
|
|
|
7014
7220
|
[props.brand, props.signal, props.primary, props.name, props.selector]
|
|
7015
7221
|
);
|
|
7016
7222
|
if (css === null) return null;
|
|
7017
|
-
return /* @__PURE__ */
|
|
7223
|
+
return /* @__PURE__ */ React48.createElement("style", { "data-aura-theme": props.name || props.brand, dangerouslySetInnerHTML: { __html: css } });
|
|
7018
7224
|
}
|
|
7019
7225
|
|
|
7020
7226
|
// src/colorScheme.tsx
|
|
7021
|
-
var
|
|
7227
|
+
var React49 = __toESM(require_react(), 1);
|
|
7022
7228
|
|
|
7023
7229
|
// src/colorSchemeScript.ts
|
|
7024
7230
|
var DEFAULT_KEY = "aura-color-scheme";
|
|
@@ -7035,7 +7241,7 @@ window.Aura = (() => {
|
|
|
7035
7241
|
|
|
7036
7242
|
// src/colorScheme.tsx
|
|
7037
7243
|
function ColorSchemeScript(props) {
|
|
7038
|
-
return /* @__PURE__ */
|
|
7244
|
+
return /* @__PURE__ */ React49.createElement(
|
|
7039
7245
|
"script",
|
|
7040
7246
|
{
|
|
7041
7247
|
"data-aura-color-scheme": "",
|
|
@@ -7060,7 +7266,7 @@ window.Aura = (() => {
|
|
|
7060
7266
|
function useColorScheme(options) {
|
|
7061
7267
|
const key = options && options.storageKey || DEFAULT_KEY;
|
|
7062
7268
|
const fallback = options && options.defaultScheme || "system";
|
|
7063
|
-
const subscribe2 =
|
|
7269
|
+
const subscribe2 = React49.useCallback(
|
|
7064
7270
|
function(cb) {
|
|
7065
7271
|
const mq = window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null;
|
|
7066
7272
|
function onSystem() {
|
|
@@ -7082,7 +7288,7 @@ window.Aura = (() => {
|
|
|
7082
7288
|
},
|
|
7083
7289
|
[fallback, key]
|
|
7084
7290
|
);
|
|
7085
|
-
const snapshot =
|
|
7291
|
+
const snapshot = React49.useSyncExternalStore(
|
|
7086
7292
|
subscribe2,
|
|
7087
7293
|
function() {
|
|
7088
7294
|
const s = readScheme(fallback);
|
|
@@ -7093,7 +7299,7 @@ window.Aura = (() => {
|
|
|
7093
7299
|
}
|
|
7094
7300
|
);
|
|
7095
7301
|
const parts = snapshot.split("|");
|
|
7096
|
-
const setScheme =
|
|
7302
|
+
const setScheme = React49.useCallback(
|
|
7097
7303
|
function(next) {
|
|
7098
7304
|
if (!valid(next)) return;
|
|
7099
7305
|
try {
|
|
@@ -7112,11 +7318,11 @@ window.Aura = (() => {
|
|
|
7112
7318
|
const cs = useColorScheme(props);
|
|
7113
7319
|
const names = { light: t.schemeLight, dark: t.schemeDark, system: t.schemeSystem };
|
|
7114
7320
|
const label = props.label || t.colorScheme;
|
|
7115
|
-
return /* @__PURE__ */
|
|
7321
|
+
return /* @__PURE__ */ React49.createElement(
|
|
7116
7322
|
DropdownMenu,
|
|
7117
7323
|
{
|
|
7118
7324
|
label,
|
|
7119
|
-
trigger: /* @__PURE__ */
|
|
7325
|
+
trigger: /* @__PURE__ */ React49.createElement(IconButton, { icon: cs.resolved === "dark" ? "moon" : "sun", label: label + ": " + names[cs.scheme] }),
|
|
7120
7326
|
items: SCHEMES.map(function(s) {
|
|
7121
7327
|
return {
|
|
7122
7328
|
label: names[s],
|
|
@@ -7131,35 +7337,19 @@ window.Aura = (() => {
|
|
|
7131
7337
|
}
|
|
7132
7338
|
|
|
7133
7339
|
// src/Badge.tsx
|
|
7134
|
-
var
|
|
7135
|
-
var Badge =
|
|
7136
|
-
|
|
7137
|
-
return /* @__PURE__ */ React49.createElement(
|
|
7138
|
-
"span",
|
|
7139
|
-
{
|
|
7140
|
-
...rest,
|
|
7141
|
-
ref,
|
|
7142
|
-
className: cx(
|
|
7143
|
-
"aura-badge",
|
|
7144
|
-
"aura-badge--" + tone(props.tone),
|
|
7145
|
-
props.variant === "solid" && "is-solid",
|
|
7146
|
-
props.variant === "outline" && "is-outline",
|
|
7147
|
-
props.className
|
|
7148
|
-
)
|
|
7149
|
-
},
|
|
7150
|
-
props.icon ? /* @__PURE__ */ React49.createElement(Icon, { name: props.icon, size: 12 }) : null,
|
|
7151
|
-
props.children
|
|
7152
|
-
);
|
|
7340
|
+
var React50 = __toESM(require_react(), 1);
|
|
7341
|
+
var Badge = React50.forwardRef(function Badge2(props, ref) {
|
|
7342
|
+
return badgeElement(props, ref);
|
|
7153
7343
|
});
|
|
7154
7344
|
|
|
7155
7345
|
// src/Progress.tsx
|
|
7156
|
-
var
|
|
7157
|
-
var Progress =
|
|
7346
|
+
var React51 = __toESM(require_react(), 1);
|
|
7347
|
+
var Progress = React51.forwardRef(function Progress2(props, ref) {
|
|
7158
7348
|
const auto = uid(), id = props.id || auto;
|
|
7159
7349
|
const max = props.max || 100, det = props.value != null;
|
|
7160
7350
|
const pct = det ? Math.max(0, Math.min(100, props.value / max * 100)) : 0;
|
|
7161
7351
|
const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
|
|
7162
|
-
return /* @__PURE__ */
|
|
7352
|
+
return /* @__PURE__ */ React51.createElement(
|
|
7163
7353
|
"div",
|
|
7164
7354
|
{
|
|
7165
7355
|
ref,
|
|
@@ -7170,8 +7360,8 @@ window.Aura = (() => {
|
|
|
7170
7360
|
props.className
|
|
7171
7361
|
)
|
|
7172
7362
|
},
|
|
7173
|
-
props.label || props.showValue && shown ? /* @__PURE__ */
|
|
7174
|
-
/* @__PURE__ */
|
|
7363
|
+
props.label || props.showValue && shown ? /* @__PURE__ */ React51.createElement("div", { className: "aura-progress__head" }, props.label ? /* @__PURE__ */ React51.createElement("span", { className: "aura-progress__label", id: id + "-label" }, props.label) : /* @__PURE__ */ React51.createElement("span", null), props.showValue && shown ? /* @__PURE__ */ React51.createElement("span", { className: "aura-progress__value" }, shown) : null) : null,
|
|
7364
|
+
/* @__PURE__ */ React51.createElement(
|
|
7175
7365
|
"div",
|
|
7176
7366
|
{
|
|
7177
7367
|
className: cx("aura-progress__track", !det && "is-indeterminate"),
|
|
@@ -7183,21 +7373,21 @@ window.Aura = (() => {
|
|
|
7183
7373
|
"aria-valuenow": det ? props.value : void 0,
|
|
7184
7374
|
"aria-valuetext": det && props.valueLabel != null ? String(props.valueLabel) : void 0
|
|
7185
7375
|
},
|
|
7186
|
-
/* @__PURE__ */
|
|
7376
|
+
/* @__PURE__ */ React51.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 })
|
|
7187
7377
|
),
|
|
7188
|
-
props.hint ? /* @__PURE__ */
|
|
7378
|
+
props.hint ? /* @__PURE__ */ React51.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
|
|
7189
7379
|
);
|
|
7190
7380
|
});
|
|
7191
7381
|
|
|
7192
7382
|
// src/Skeleton.tsx
|
|
7193
|
-
var
|
|
7194
|
-
var Skeleton =
|
|
7383
|
+
var React52 = __toESM(require_react(), 1);
|
|
7384
|
+
var Skeleton = React52.forwardRef(function Skeleton2(props, ref) {
|
|
7195
7385
|
const v = props.variant || "text";
|
|
7196
7386
|
if (v === "text" && (props.lines || 1) > 1) {
|
|
7197
7387
|
const n2 = props.lines, rows = [];
|
|
7198
7388
|
for (let i = 0; i < n2; i++)
|
|
7199
|
-
rows.push(/* @__PURE__ */
|
|
7200
|
-
return /* @__PURE__ */
|
|
7389
|
+
rows.push(/* @__PURE__ */ React52.createElement("span", { key: i, className: "aura-skel aura-skel--text", style: { width: i === n2 - 1 ? "60%" : "100%" } }));
|
|
7390
|
+
return /* @__PURE__ */ React52.createElement(
|
|
7201
7391
|
"span",
|
|
7202
7392
|
{
|
|
7203
7393
|
ref,
|
|
@@ -7215,28 +7405,17 @@ window.Aura = (() => {
|
|
|
7215
7405
|
if (v === "circle") {
|
|
7216
7406
|
style.width = style.height = props.size || props.width || 40;
|
|
7217
7407
|
}
|
|
7218
|
-
return /* @__PURE__ */
|
|
7408
|
+
return /* @__PURE__ */ React52.createElement("span", { ref, "aria-hidden": true, className: cx("aura-skel", "aura-skel--" + v, props.className), style });
|
|
7219
7409
|
});
|
|
7220
7410
|
|
|
7221
7411
|
// src/EmptyState.tsx
|
|
7222
|
-
var
|
|
7223
|
-
var EmptyState =
|
|
7224
|
-
|
|
7225
|
-
return /* @__PURE__ */ React52.createElement(
|
|
7226
|
-
"div",
|
|
7227
|
-
{
|
|
7228
|
-
ref,
|
|
7229
|
-
className: cx("aura-empty", props.size === "sm" && "is-sm", props.bordered && "is-bordered", props.className)
|
|
7230
|
-
},
|
|
7231
|
-
/* @__PURE__ */ React52.createElement("span", { className: "aura-empty__icon", "aria-hidden": true }, /* @__PURE__ */ React52.createElement(Icon, { name: props.icon || "inbox", size: props.size === "sm" ? "md" : "lg" })),
|
|
7232
|
-
/* @__PURE__ */ React52.createElement(HT, { className: "aura-empty__title" }, props.title),
|
|
7233
|
-
props.description ? /* @__PURE__ */ React52.createElement("p", { className: "aura-empty__text" }, props.description) : null,
|
|
7234
|
-
props.action ? /* @__PURE__ */ React52.createElement("div", { className: "aura-empty__action" }, props.action) : null
|
|
7235
|
-
);
|
|
7412
|
+
var React53 = __toESM(require_react(), 1);
|
|
7413
|
+
var EmptyState = React53.forwardRef(function EmptyState2(props, ref) {
|
|
7414
|
+
return emptyStateElement(props, ref);
|
|
7236
7415
|
});
|
|
7237
7416
|
|
|
7238
7417
|
// src/Pagination.tsx
|
|
7239
|
-
var
|
|
7418
|
+
var React54 = __toESM(require_react(), 1);
|
|
7240
7419
|
function pageList(page, count, sib) {
|
|
7241
7420
|
let out = [], lo = Math.max(2, page - sib), hi = Math.min(count - 1, page + sib);
|
|
7242
7421
|
if (page - sib <= 3) {
|
|
@@ -7256,7 +7435,7 @@ window.Aura = (() => {
|
|
|
7256
7435
|
if (count > 1) out.push(count);
|
|
7257
7436
|
return out;
|
|
7258
7437
|
}
|
|
7259
|
-
var Pagination =
|
|
7438
|
+
var Pagination = React54.forwardRef(function Pagination2(props, ref) {
|
|
7260
7439
|
const t = useStrings();
|
|
7261
7440
|
const count = Math.max(1, props.pageCount || 1);
|
|
7262
7441
|
const st = useMaybeControlled(props.page, props.defaultPage || 1, props.onChange);
|
|
@@ -7275,7 +7454,7 @@ window.Aura = (() => {
|
|
|
7275
7454
|
},
|
|
7276
7455
|
extra
|
|
7277
7456
|
);
|
|
7278
|
-
return link ? /* @__PURE__ */
|
|
7457
|
+
return link ? /* @__PURE__ */ React54.createElement(
|
|
7279
7458
|
Link,
|
|
7280
7459
|
{
|
|
7281
7460
|
href: link(p),
|
|
@@ -7288,7 +7467,7 @@ window.Aura = (() => {
|
|
|
7288
7467
|
...common
|
|
7289
7468
|
},
|
|
7290
7469
|
label
|
|
7291
|
-
) : /* @__PURE__ */
|
|
7470
|
+
) : /* @__PURE__ */ React54.createElement(
|
|
7292
7471
|
"button",
|
|
7293
7472
|
{
|
|
7294
7473
|
type: "button",
|
|
@@ -7302,7 +7481,7 @@ window.Aura = (() => {
|
|
|
7302
7481
|
}
|
|
7303
7482
|
function arrow(p, icon, label, rel, disabled) {
|
|
7304
7483
|
if (!link || disabled)
|
|
7305
|
-
return /* @__PURE__ */
|
|
7484
|
+
return /* @__PURE__ */ React54.createElement(
|
|
7306
7485
|
IconButton,
|
|
7307
7486
|
{
|
|
7308
7487
|
icon,
|
|
@@ -7313,7 +7492,7 @@ window.Aura = (() => {
|
|
|
7313
7492
|
}
|
|
7314
7493
|
}
|
|
7315
7494
|
);
|
|
7316
|
-
return /* @__PURE__ */
|
|
7495
|
+
return /* @__PURE__ */ React54.createElement(
|
|
7317
7496
|
Link,
|
|
7318
7497
|
{
|
|
7319
7498
|
href: link(p),
|
|
@@ -7328,17 +7507,17 @@ window.Aura = (() => {
|
|
|
7328
7507
|
}
|
|
7329
7508
|
}
|
|
7330
7509
|
},
|
|
7331
|
-
/* @__PURE__ */
|
|
7510
|
+
/* @__PURE__ */ React54.createElement(Icon, { name: icon, size: "sm" })
|
|
7332
7511
|
);
|
|
7333
7512
|
}
|
|
7334
|
-
return /* @__PURE__ */
|
|
7335
|
-
return typeof p === "number" ? /* @__PURE__ */
|
|
7336
|
-
})), /* @__PURE__ */
|
|
7513
|
+
return /* @__PURE__ */ React54.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__ */ React54.createElement("ol", { className: "aura-pagination__list" }, pageList(page, count, props.siblingCount == null ? 1 : props.siblingCount).map(function(p) {
|
|
7514
|
+
return typeof p === "number" ? /* @__PURE__ */ React54.createElement("li", { key: p }, item(p, p)) : /* @__PURE__ */ React54.createElement("li", { key: p, className: "aura-pagination__gap", "aria-hidden": true }, "\u2026");
|
|
7515
|
+
})), /* @__PURE__ */ React54.createElement("span", { className: "aura-pagination__compact", "aria-hidden": true }, t.page(page, count)), arrow(page + 1, "chevron-right", t.nextPage, "next", page >= count));
|
|
7337
7516
|
});
|
|
7338
7517
|
|
|
7339
7518
|
// src/Accordion.tsx
|
|
7340
|
-
var
|
|
7341
|
-
var Accordion =
|
|
7519
|
+
var React55 = __toESM(require_react(), 1);
|
|
7520
|
+
var Accordion = React55.forwardRef(function Accordion2(props, ref) {
|
|
7342
7521
|
const auto = uid(), base = props.id || auto;
|
|
7343
7522
|
const multiple = props.type === "multiple";
|
|
7344
7523
|
const st = useMaybeControlled(
|
|
@@ -7376,9 +7555,9 @@ window.Aura = (() => {
|
|
|
7376
7555
|
n2.focus();
|
|
7377
7556
|
}
|
|
7378
7557
|
}
|
|
7379
|
-
return /* @__PURE__ */
|
|
7558
|
+
return /* @__PURE__ */ React55.createElement("div", { ref, className: cx("aura-accordion", props.className), onKeyDown: onKey }, items2.map(function(it) {
|
|
7380
7559
|
const on = open.indexOf(it.id) >= 0, bid = base + "-btn-" + it.id, pid = base + "-panel-" + it.id;
|
|
7381
|
-
return /* @__PURE__ */
|
|
7560
|
+
return /* @__PURE__ */ React55.createElement("div", { key: it.id, className: cx("aura-accordion__item", on && "is-open") }, /* @__PURE__ */ React55.createElement(HT, { className: "aura-accordion__heading" }, /* @__PURE__ */ React55.createElement(
|
|
7382
7561
|
"button",
|
|
7383
7562
|
{
|
|
7384
7563
|
type: "button",
|
|
@@ -7390,15 +7569,15 @@ window.Aura = (() => {
|
|
|
7390
7569
|
toggle(it.id);
|
|
7391
7570
|
}
|
|
7392
7571
|
},
|
|
7393
|
-
it.icon ? /* @__PURE__ */
|
|
7394
|
-
/* @__PURE__ */
|
|
7395
|
-
/* @__PURE__ */
|
|
7396
|
-
)), /* @__PURE__ */
|
|
7572
|
+
it.icon ? /* @__PURE__ */ React55.createElement(Icon, { name: it.icon, className: "aura-accordion__lead" }) : null,
|
|
7573
|
+
/* @__PURE__ */ React55.createElement("span", { className: "aura-accordion__title" }, it.title, it.description ? /* @__PURE__ */ React55.createElement("span", { className: "aura-accordion__desc" }, it.description) : null),
|
|
7574
|
+
/* @__PURE__ */ React55.createElement(Icon, { name: "chevron-down", className: "aura-accordion__chevron" })
|
|
7575
|
+
)), /* @__PURE__ */ React55.createElement("div", { id: pid, role: "region", "aria-labelledby": bid, className: "aura-accordion__panel", hidden: !on }, it.content));
|
|
7397
7576
|
}));
|
|
7398
7577
|
});
|
|
7399
7578
|
|
|
7400
7579
|
// src/Popover.tsx
|
|
7401
|
-
var
|
|
7580
|
+
var React56 = __toESM(require_react(), 1);
|
|
7402
7581
|
var import_react_dom12 = __toESM(require_react_dom(), 1);
|
|
7403
7582
|
function position(anchor, pop, placement) {
|
|
7404
7583
|
const r = anchor.getBoundingClientRect(), pw = pop.offsetWidth, ph = pop.scrollHeight, vw = window.innerWidth, vh = window.innerHeight, gap = 6;
|
|
@@ -7416,15 +7595,15 @@ window.Aura = (() => {
|
|
|
7416
7595
|
const left = align === "end" ? r.right - pw : align === "center" ? r.left + r.width / 2 - pw / 2 : r.left;
|
|
7417
7596
|
return { top: Math.max(8, top), left: Math.max(8, Math.min(left, vw - pw - 8)), side, maxHeight };
|
|
7418
7597
|
}
|
|
7419
|
-
var Popover =
|
|
7598
|
+
var Popover = React56.forwardRef(function Popover2(props, ref) {
|
|
7420
7599
|
const t = useStrings();
|
|
7421
7600
|
const density = useDensity();
|
|
7422
7601
|
const auto = uid(), id = props.id || auto;
|
|
7423
7602
|
const st = useMaybeControlled(props.open, !!props.defaultOpen, props.onOpenChange);
|
|
7424
7603
|
const open = !!st[0];
|
|
7425
|
-
const wrap =
|
|
7426
|
-
const pos =
|
|
7427
|
-
const inTree =
|
|
7604
|
+
const wrap = React56.useRef(null), pop = React56.useRef(null), popMerged = useMergedRef(ref, pop);
|
|
7605
|
+
const pos = React56.useState(null), mounted = useMounted();
|
|
7606
|
+
const inTree = React56.useRef(false);
|
|
7428
7607
|
function trigger() {
|
|
7429
7608
|
return wrap.current && (wrap.current.querySelector('button, [role="button"], a, input') || wrap.current.firstElementChild);
|
|
7430
7609
|
}
|
|
@@ -7451,7 +7630,7 @@ window.Aura = (() => {
|
|
|
7451
7630
|
},
|
|
7452
7631
|
[open, mounted, props.placement]
|
|
7453
7632
|
);
|
|
7454
|
-
|
|
7633
|
+
React56.useEffect(
|
|
7455
7634
|
function() {
|
|
7456
7635
|
if (!open || !mounted) return;
|
|
7457
7636
|
if (props.autoFocus !== false && pop.current) {
|
|
@@ -7476,9 +7655,9 @@ window.Aura = (() => {
|
|
|
7476
7655
|
},
|
|
7477
7656
|
[open, mounted]
|
|
7478
7657
|
);
|
|
7479
|
-
const child =
|
|
7658
|
+
const child = React56.Children.only(props.trigger);
|
|
7480
7659
|
const panel = open && mounted ? (0, import_react_dom12.createPortal)(
|
|
7481
|
-
/* @__PURE__ */
|
|
7660
|
+
/* @__PURE__ */ React56.createElement(
|
|
7482
7661
|
"div",
|
|
7483
7662
|
{
|
|
7484
7663
|
ref: popMerged,
|
|
@@ -7508,7 +7687,7 @@ window.Aura = (() => {
|
|
|
7508
7687
|
} else trapTab(e, pop.current);
|
|
7509
7688
|
}
|
|
7510
7689
|
},
|
|
7511
|
-
props.title ? /* @__PURE__ */
|
|
7690
|
+
props.title ? /* @__PURE__ */ React56.createElement("div", { className: "aura-popover__head" }, /* @__PURE__ */ React56.createElement("p", { className: "aura-popover__title", id: id + "-title" }, props.title), /* @__PURE__ */ React56.createElement(
|
|
7512
7691
|
IconButton,
|
|
7513
7692
|
{
|
|
7514
7693
|
icon: "x",
|
|
@@ -7518,7 +7697,7 @@ window.Aura = (() => {
|
|
|
7518
7697
|
}
|
|
7519
7698
|
}
|
|
7520
7699
|
)) : null,
|
|
7521
|
-
/* @__PURE__ */
|
|
7700
|
+
/* @__PURE__ */ React56.createElement("div", { className: "aura-popover__body" }, typeof props.children === "function" ? props.children({
|
|
7522
7701
|
close: function() {
|
|
7523
7702
|
close(true);
|
|
7524
7703
|
}
|
|
@@ -7526,7 +7705,7 @@ window.Aura = (() => {
|
|
|
7526
7705
|
),
|
|
7527
7706
|
document.body
|
|
7528
7707
|
) : null;
|
|
7529
|
-
return /* @__PURE__ */
|
|
7708
|
+
return /* @__PURE__ */ React56.createElement("span", { ref: wrap, className: "aura-popover-anchor" }, React56.cloneElement(child, {
|
|
7530
7709
|
onClick: function(e) {
|
|
7531
7710
|
if (child.props.onClick) child.props.onClick(e);
|
|
7532
7711
|
st[1](!open);
|
|
@@ -7538,20 +7717,20 @@ window.Aura = (() => {
|
|
|
7538
7717
|
});
|
|
7539
7718
|
|
|
7540
7719
|
// src/NumberField.tsx
|
|
7541
|
-
var
|
|
7720
|
+
var React57 = __toESM(require_react(), 1);
|
|
7542
7721
|
function decimalsOf(n2) {
|
|
7543
7722
|
const s = String(n2);
|
|
7544
7723
|
const i = s.indexOf(".");
|
|
7545
7724
|
return i < 0 ? 0 : s.length - i - 1;
|
|
7546
7725
|
}
|
|
7547
|
-
function parse(
|
|
7548
|
-
let t =
|
|
7726
|
+
function parse(text2) {
|
|
7727
|
+
let t = text2.trim();
|
|
7549
7728
|
if (t.indexOf(".") < 0 && /^-?\d+,\d+$/.test(t.replace(/[\s ]/g, "")) && !/,\d{3}$/.test(t)) t = t.replace(",", ".");
|
|
7550
7729
|
const s = t.replace(/[,\s ]/g, "");
|
|
7551
7730
|
if (!/^-?(\d+\.?\d*|\.\d+)$/.test(s)) return NaN;
|
|
7552
7731
|
return Number(s);
|
|
7553
7732
|
}
|
|
7554
|
-
var NumberField =
|
|
7733
|
+
var NumberField = React57.forwardRef(function NumberField2(props, ref) {
|
|
7555
7734
|
const t = useStrings();
|
|
7556
7735
|
const auto = uid(), id = props.id || auto;
|
|
7557
7736
|
const step = props.step || 1;
|
|
@@ -7562,7 +7741,7 @@ window.Aura = (() => {
|
|
|
7562
7741
|
props.onChange
|
|
7563
7742
|
);
|
|
7564
7743
|
const value = st[0], setValue = st[1];
|
|
7565
|
-
const draftState =
|
|
7744
|
+
const draftState = React57.useState(null), draft = draftState[0], setDraft = draftState[1];
|
|
7566
7745
|
function fmt2(n2) {
|
|
7567
7746
|
if (n2 == null || isNaN(n2)) return "";
|
|
7568
7747
|
return n2.toLocaleString("en", { minimumFractionDigits: decimals, maximumFractionDigits: decimals });
|
|
@@ -7611,7 +7790,7 @@ window.Aura = (() => {
|
|
|
7611
7790
|
};
|
|
7612
7791
|
const valueText = value == null ? void 0 : [affixText(props.prefix), fmt2(value), affixText(props.suffix)].join(" ").trim();
|
|
7613
7792
|
const stepper = props.stepper !== false && !props.readOnly;
|
|
7614
|
-
return /* @__PURE__ */
|
|
7793
|
+
return /* @__PURE__ */ React57.createElement(
|
|
7615
7794
|
Field,
|
|
7616
7795
|
{
|
|
7617
7796
|
id,
|
|
@@ -7623,7 +7802,7 @@ window.Aura = (() => {
|
|
|
7623
7802
|
disabled: props.disabled,
|
|
7624
7803
|
className: props.className
|
|
7625
7804
|
},
|
|
7626
|
-
/* @__PURE__ */
|
|
7805
|
+
/* @__PURE__ */ React57.createElement("div", { className: cx("aura-input aura-number", stepper && "has-stepper") }, props.prefix != null ? /* @__PURE__ */ React57.createElement("span", { className: "aura-number__affix", "aria-hidden": true }, props.prefix) : null, /* @__PURE__ */ React57.createElement(
|
|
7627
7806
|
"input",
|
|
7628
7807
|
{
|
|
7629
7808
|
ref,
|
|
@@ -7649,11 +7828,11 @@ window.Aura = (() => {
|
|
|
7649
7828
|
setDraft(fmt2(value));
|
|
7650
7829
|
},
|
|
7651
7830
|
onChange: function(e) {
|
|
7652
|
-
const
|
|
7653
|
-
setDraft(
|
|
7654
|
-
if (!
|
|
7831
|
+
const text2 = e.target.value;
|
|
7832
|
+
setDraft(text2);
|
|
7833
|
+
if (!text2.trim()) setValue(null);
|
|
7655
7834
|
else {
|
|
7656
|
-
const n2 = parse(
|
|
7835
|
+
const n2 = parse(text2);
|
|
7657
7836
|
if (!isNaN(n2)) setValue(n2);
|
|
7658
7837
|
}
|
|
7659
7838
|
},
|
|
@@ -7670,7 +7849,7 @@ window.Aura = (() => {
|
|
|
7670
7849
|
},
|
|
7671
7850
|
onKeyDown
|
|
7672
7851
|
}
|
|
7673
|
-
), props.suffix != null ? /* @__PURE__ */
|
|
7852
|
+
), props.suffix != null ? /* @__PURE__ */ React57.createElement("span", { className: "aura-number__affix", "aria-hidden": true }, props.suffix) : null, stepper ? /* @__PURE__ */ React57.createElement("span", { className: "aura-number__steps" }, /* @__PURE__ */ React57.createElement(
|
|
7674
7853
|
"button",
|
|
7675
7854
|
{
|
|
7676
7855
|
type: "button",
|
|
@@ -7686,8 +7865,8 @@ window.Aura = (() => {
|
|
|
7686
7865
|
nudge(-step);
|
|
7687
7866
|
}
|
|
7688
7867
|
},
|
|
7689
|
-
/* @__PURE__ */
|
|
7690
|
-
), /* @__PURE__ */
|
|
7868
|
+
/* @__PURE__ */ React57.createElement(Icon, { name: "minus" })
|
|
7869
|
+
), /* @__PURE__ */ React57.createElement(
|
|
7691
7870
|
"button",
|
|
7692
7871
|
{
|
|
7693
7872
|
type: "button",
|
|
@@ -7703,14 +7882,14 @@ window.Aura = (() => {
|
|
|
7703
7882
|
nudge(step);
|
|
7704
7883
|
}
|
|
7705
7884
|
},
|
|
7706
|
-
/* @__PURE__ */
|
|
7885
|
+
/* @__PURE__ */ React57.createElement(Icon, { name: "plus" })
|
|
7707
7886
|
)) : null)
|
|
7708
7887
|
);
|
|
7709
7888
|
});
|
|
7710
7889
|
|
|
7711
7890
|
// src/Stepper.tsx
|
|
7712
|
-
var
|
|
7713
|
-
var Stepper =
|
|
7891
|
+
var React58 = __toESM(require_react(), 1);
|
|
7892
|
+
var Stepper = React58.forwardRef(function Stepper2(props, ref) {
|
|
7714
7893
|
const t = useStrings();
|
|
7715
7894
|
const steps = props.steps || [];
|
|
7716
7895
|
let at = -1;
|
|
@@ -7720,26 +7899,26 @@ window.Aura = (() => {
|
|
|
7720
7899
|
if (at < 0) at = 0;
|
|
7721
7900
|
const vertical = props.orientation === "vertical";
|
|
7722
7901
|
const cur = steps[at];
|
|
7723
|
-
return /* @__PURE__ */
|
|
7902
|
+
return /* @__PURE__ */ React58.createElement(
|
|
7724
7903
|
"nav",
|
|
7725
7904
|
{
|
|
7726
7905
|
ref,
|
|
7727
7906
|
"aria-label": props.label,
|
|
7728
7907
|
className: cx("aura-stepper", vertical ? "aura-stepper--vertical" : "aura-stepper--horizontal", props.className)
|
|
7729
7908
|
},
|
|
7730
|
-
/* @__PURE__ */
|
|
7909
|
+
/* @__PURE__ */ React58.createElement("ol", { className: "aura-stepper__list" }, steps.map(function(s, i) {
|
|
7731
7910
|
const state = i < at ? "done" : i === at ? "current" : "upcoming";
|
|
7732
|
-
const marker = /* @__PURE__ */
|
|
7733
|
-
const
|
|
7911
|
+
const marker = /* @__PURE__ */ React58.createElement("span", { className: "aura-stepper__marker", "aria-hidden": true }, state === "done" ? /* @__PURE__ */ React58.createElement(Icon, { name: "check" }) : i + 1);
|
|
7912
|
+
const text2 = /* @__PURE__ */ React58.createElement("span", { className: "aura-stepper__text" }, /* @__PURE__ */ React58.createElement("span", { className: "aura-stepper__label" }, s.label, state === "done" ? /* @__PURE__ */ React58.createElement("span", { className: "aura-sr-only" }, ", " + t.stepDone) : null), s.description ? /* @__PURE__ */ React58.createElement("span", { className: "aura-stepper__desc" }, s.description) : null);
|
|
7734
7913
|
const clickable = state === "done" && !!props.onStepClick;
|
|
7735
|
-
return /* @__PURE__ */
|
|
7914
|
+
return /* @__PURE__ */ React58.createElement(
|
|
7736
7915
|
"li",
|
|
7737
7916
|
{
|
|
7738
7917
|
key: s.id,
|
|
7739
7918
|
className: cx("aura-stepper__item", "is-" + state),
|
|
7740
7919
|
"aria-current": state === "current" ? "step" : void 0
|
|
7741
7920
|
},
|
|
7742
|
-
clickable ? /* @__PURE__ */
|
|
7921
|
+
clickable ? /* @__PURE__ */ React58.createElement(
|
|
7743
7922
|
"button",
|
|
7744
7923
|
{
|
|
7745
7924
|
type: "button",
|
|
@@ -7749,20 +7928,20 @@ window.Aura = (() => {
|
|
|
7749
7928
|
}
|
|
7750
7929
|
},
|
|
7751
7930
|
marker,
|
|
7752
|
-
|
|
7753
|
-
) : /* @__PURE__ */
|
|
7931
|
+
text2
|
|
7932
|
+
) : /* @__PURE__ */ React58.createElement("span", { className: "aura-stepper__step" }, marker, text2)
|
|
7754
7933
|
);
|
|
7755
7934
|
})),
|
|
7756
|
-
!vertical && cur ? /* @__PURE__ */
|
|
7935
|
+
!vertical && cur ? /* @__PURE__ */ React58.createElement("p", { className: "aura-stepper__compact", "aria-hidden": true }, /* @__PURE__ */ React58.createElement("span", { className: "aura-stepper__count" }, t.stepOf(at + 1, steps.length)), /* @__PURE__ */ React58.createElement("span", { className: "aura-stepper__compact-label" }, cur.label)) : null
|
|
7757
7936
|
);
|
|
7758
7937
|
});
|
|
7759
7938
|
|
|
7760
7939
|
// src/SegmentedControl.tsx
|
|
7761
|
-
var
|
|
7940
|
+
var React59 = __toESM(require_react(), 1);
|
|
7762
7941
|
function toOpt2(o) {
|
|
7763
7942
|
return typeof o === "object" ? o : { value: o, label: o };
|
|
7764
7943
|
}
|
|
7765
|
-
var SegmentedControl =
|
|
7944
|
+
var SegmentedControl = React59.forwardRef(
|
|
7766
7945
|
function SegmentedControl2(props, ref) {
|
|
7767
7946
|
const options = (props.options || []).map(toOpt2);
|
|
7768
7947
|
const firstEnabled = options.filter(function(o) {
|
|
@@ -7775,7 +7954,7 @@ window.Aura = (() => {
|
|
|
7775
7954
|
);
|
|
7776
7955
|
const value = st[0], setValue = st[1];
|
|
7777
7956
|
const auto = uid(), id = props.id || auto;
|
|
7778
|
-
const refs =
|
|
7957
|
+
const refs = React59.useRef([]);
|
|
7779
7958
|
const selIdx = options.findIndex(function(o) {
|
|
7780
7959
|
return o.value === value;
|
|
7781
7960
|
});
|
|
@@ -7808,7 +7987,7 @@ window.Aura = (() => {
|
|
|
7808
7987
|
move(options.length, -1);
|
|
7809
7988
|
}
|
|
7810
7989
|
}
|
|
7811
|
-
return /* @__PURE__ */
|
|
7990
|
+
return /* @__PURE__ */ React59.createElement(
|
|
7812
7991
|
"div",
|
|
7813
7992
|
{
|
|
7814
7993
|
ref,
|
|
@@ -7827,7 +8006,7 @@ window.Aura = (() => {
|
|
|
7827
8006
|
options.map(function(o, i) {
|
|
7828
8007
|
const on = o.value === value;
|
|
7829
8008
|
const off = props.disabled || o.disabled;
|
|
7830
|
-
return /* @__PURE__ */
|
|
8009
|
+
return /* @__PURE__ */ React59.createElement(
|
|
7831
8010
|
"button",
|
|
7832
8011
|
{
|
|
7833
8012
|
key: o.value,
|
|
@@ -7849,8 +8028,8 @@ window.Aura = (() => {
|
|
|
7849
8028
|
onKeyDown(e, i);
|
|
7850
8029
|
}
|
|
7851
8030
|
},
|
|
7852
|
-
o.icon ? /* @__PURE__ */
|
|
7853
|
-
o.iconOnly ? null : /* @__PURE__ */
|
|
8031
|
+
o.icon ? /* @__PURE__ */ React59.createElement(Icon, { name: o.icon }) : null,
|
|
8032
|
+
o.iconOnly ? null : /* @__PURE__ */ React59.createElement("span", null, o.label)
|
|
7854
8033
|
);
|
|
7855
8034
|
})
|
|
7856
8035
|
);
|