@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/cjs/index.cjs
CHANGED
|
@@ -100,6 +100,7 @@ __export(index_exports, {
|
|
|
100
100
|
Tr: () => Tr,
|
|
101
101
|
brandScale: () => scale,
|
|
102
102
|
breakpoints: () => breakpoints,
|
|
103
|
+
buttonClass: () => buttonClass,
|
|
103
104
|
colorSchemeScript: () => colorSchemeScript,
|
|
104
105
|
comboboxFilter: () => defaultFilter,
|
|
105
106
|
contrast: () => contrast,
|
|
@@ -122,10 +123,9 @@ __export(index_exports, {
|
|
|
122
123
|
module.exports = __toCommonJS(index_exports);
|
|
123
124
|
|
|
124
125
|
// src/Icon.tsx
|
|
125
|
-
var React2 = __toESM(require("react"), 1);
|
|
126
|
-
|
|
127
|
-
// src/internal.tsx
|
|
128
126
|
var React = __toESM(require("react"), 1);
|
|
127
|
+
|
|
128
|
+
// src/classes.ts
|
|
129
129
|
function cx() {
|
|
130
130
|
return Array.prototype.filter.call(arguments, Boolean).join(" ");
|
|
131
131
|
}
|
|
@@ -136,18 +136,73 @@ function omit(src, keys) {
|
|
|
136
136
|
out[k] = src[k];
|
|
137
137
|
return out;
|
|
138
138
|
}
|
|
139
|
+
var TONES = ["neutral", "accent", "success", "warning", "danger"];
|
|
140
|
+
function tone(t) {
|
|
141
|
+
return TONES.indexOf(t) >= 0 ? t : "neutral";
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// src/Icon.tsx
|
|
145
|
+
var h = React.createElement;
|
|
146
|
+
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" }]] };
|
|
147
|
+
var SIZES = { sm: 16, md: 20, lg: 24 };
|
|
148
|
+
var Icon = React.forwardRef(function Icon2(props, ref) {
|
|
149
|
+
const size = SIZES[props.size] || props.size || 16;
|
|
150
|
+
if (React.isValidElement(props.name)) {
|
|
151
|
+
return /* @__PURE__ */ React.createElement(
|
|
152
|
+
"span",
|
|
153
|
+
{
|
|
154
|
+
className: cx("aura-icon", "aura-icon--custom", props.className),
|
|
155
|
+
style: { width: size, height: size, ["--aura-icon-stroke"]: props.strokeWidth || 2 },
|
|
156
|
+
...props.label ? { role: "img", "aria-label": props.label } : { "aria-hidden": true }
|
|
157
|
+
},
|
|
158
|
+
props.name
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
const shapes = ICONS[props.name];
|
|
162
|
+
if (!shapes) return null;
|
|
163
|
+
const a11y = props.label ? { role: "img", "aria-label": props.label } : { "aria-hidden": true, focusable: "false" };
|
|
164
|
+
return /* @__PURE__ */ React.createElement(
|
|
165
|
+
"svg",
|
|
166
|
+
{
|
|
167
|
+
ref,
|
|
168
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
169
|
+
width: size,
|
|
170
|
+
height: size,
|
|
171
|
+
viewBox: "0 0 24 24",
|
|
172
|
+
fill: "none",
|
|
173
|
+
stroke: "currentColor",
|
|
174
|
+
strokeWidth: props.strokeWidth || 2,
|
|
175
|
+
strokeLinecap: "round",
|
|
176
|
+
strokeLinejoin: "round",
|
|
177
|
+
className: cx("aura-icon", props.className),
|
|
178
|
+
...a11y
|
|
179
|
+
},
|
|
180
|
+
shapes.map(function(s, i) {
|
|
181
|
+
const attrs = { key: i };
|
|
182
|
+
for (const k in s[1]) attrs[k === "stroke-width" ? "strokeWidth" : k] = s[1][k];
|
|
183
|
+
return h(s[0], attrs);
|
|
184
|
+
})
|
|
185
|
+
);
|
|
186
|
+
});
|
|
187
|
+
var iconNames = Object.keys(ICONS);
|
|
188
|
+
|
|
189
|
+
// src/Button.tsx
|
|
190
|
+
var React5 = __toESM(require("react"), 1);
|
|
191
|
+
|
|
192
|
+
// src/internal.tsx
|
|
193
|
+
var React2 = __toESM(require("react"), 1);
|
|
139
194
|
function useMaybeControlled(value, initial, onChange) {
|
|
140
|
-
const s =
|
|
141
|
-
const wasSet =
|
|
195
|
+
const s = React2.useState(initial);
|
|
196
|
+
const wasSet = React2.useState(value !== void 0);
|
|
142
197
|
if (value !== void 0 && !wasSet[0]) wasSet[1](true);
|
|
143
198
|
else if (value === void 0 && wasSet[0]) {
|
|
144
199
|
wasSet[1](false);
|
|
145
200
|
s[1](initial);
|
|
146
201
|
}
|
|
147
202
|
const controlled = value !== void 0;
|
|
148
|
-
const latest =
|
|
203
|
+
const latest = React2.useRef({ controlled, onChange, set: s[1] });
|
|
149
204
|
latest.current = { controlled, onChange, set: s[1] };
|
|
150
|
-
const set =
|
|
205
|
+
const set = React2.useCallback(function(next) {
|
|
151
206
|
const l = latest.current;
|
|
152
207
|
if (!l.controlled) l.set(next);
|
|
153
208
|
if (l.onChange) l.onChange(next);
|
|
@@ -162,8 +217,8 @@ function compare(a, b) {
|
|
|
162
217
|
if (typeof a === "number" && typeof b === "number") return a - b;
|
|
163
218
|
return collator ? collator.compare(String(a), String(b)) : String(a).localeCompare(String(b));
|
|
164
219
|
}
|
|
165
|
-
var uid =
|
|
166
|
-
const r =
|
|
220
|
+
var uid = React2.useId || function() {
|
|
221
|
+
const r = React2.useRef(null);
|
|
167
222
|
if (!r.current) r.current = "aura-" + Math.random().toString(36).slice(2, 9);
|
|
168
223
|
return r.current;
|
|
169
224
|
};
|
|
@@ -179,9 +234,9 @@ function no() {
|
|
|
179
234
|
return false;
|
|
180
235
|
}
|
|
181
236
|
function useMounted() {
|
|
182
|
-
return
|
|
237
|
+
return React2.useSyncExternalStore(noopSubscribe, yes, no);
|
|
183
238
|
}
|
|
184
|
-
var useIsoLayoutEffect = typeof window !== "undefined" ?
|
|
239
|
+
var useIsoLayoutEffect = typeof window !== "undefined" ? React2.useLayoutEffect : React2.useEffect;
|
|
185
240
|
function trapTab(e, container) {
|
|
186
241
|
if (e.key !== "Tab" || !container) return;
|
|
187
242
|
const list = Array.prototype.filter.call(
|
|
@@ -201,7 +256,7 @@ function trapTab(e, container) {
|
|
|
201
256
|
}
|
|
202
257
|
}
|
|
203
258
|
function useMergedRef(a, b) {
|
|
204
|
-
return
|
|
259
|
+
return React2.useCallback(
|
|
205
260
|
function(node) {
|
|
206
261
|
[a, b].forEach(function(r) {
|
|
207
262
|
if (!r) return;
|
|
@@ -212,10 +267,6 @@ function useMergedRef(a, b) {
|
|
|
212
267
|
[a, b]
|
|
213
268
|
);
|
|
214
269
|
}
|
|
215
|
-
var TONES = ["neutral", "accent", "success", "warning", "danger"];
|
|
216
|
-
function tone(t) {
|
|
217
|
-
return TONES.indexOf(t) >= 0 ? t : "neutral";
|
|
218
|
-
}
|
|
219
270
|
var warned = {};
|
|
220
271
|
function plainClick(e) {
|
|
221
272
|
return !e.defaultPrevented && e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey;
|
|
@@ -233,56 +284,138 @@ function devWarnOnce(key, message) {
|
|
|
233
284
|
console.warn("[AURA] " + message);
|
|
234
285
|
}
|
|
235
286
|
|
|
236
|
-
// src/
|
|
237
|
-
var
|
|
238
|
-
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" }]] };
|
|
239
|
-
|
|
240
|
-
var
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
287
|
+
// src/display.tsx
|
|
288
|
+
var React3 = __toESM(require("react"), 1);
|
|
289
|
+
|
|
290
|
+
// src/status.ts
|
|
291
|
+
var TONE_WORDS = {
|
|
292
|
+
ready: ["ready", "done", "complete", "completed", "approved", "live", "passed"],
|
|
293
|
+
progress: ["in progress", "in review", "review", "syncing", "running", "pending"],
|
|
294
|
+
warning: ["warning", "problem", "degraded", "at risk"],
|
|
295
|
+
blocked: ["blocked", "failed", "error", "rejected", "on hold", "cancelled"]
|
|
296
|
+
};
|
|
297
|
+
function toneFor(status) {
|
|
298
|
+
const s = String(status == null ? "" : status).trim().toLowerCase();
|
|
299
|
+
for (const t in TONE_WORDS) if (TONE_WORDS[t].indexOf(s) >= 0) return t;
|
|
300
|
+
return "neutral";
|
|
301
|
+
}
|
|
302
|
+
var TONE_ORDER = { neutral: 0, progress: 1, ready: 2, warning: 3, blocked: 4 };
|
|
303
|
+
|
|
304
|
+
// src/display.tsx
|
|
305
|
+
var h2 = React3.createElement;
|
|
306
|
+
var ALERT_ICON = {
|
|
307
|
+
info: "info",
|
|
308
|
+
success: "circle-check",
|
|
309
|
+
warning: "triangle-alert",
|
|
310
|
+
danger: "circle-alert"
|
|
311
|
+
};
|
|
312
|
+
function alertElement(props, ref, close) {
|
|
313
|
+
const tone2 = props.tone || "info";
|
|
314
|
+
const rest = omit(props, ["tone", "title", "children", "action", "onDismiss", "className", "role", "icon"]);
|
|
315
|
+
return /* @__PURE__ */ React3.createElement(
|
|
316
|
+
"div",
|
|
258
317
|
{
|
|
318
|
+
...rest,
|
|
259
319
|
ref,
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
height: size,
|
|
263
|
-
viewBox: "0 0 24 24",
|
|
264
|
-
fill: "none",
|
|
265
|
-
stroke: "currentColor",
|
|
266
|
-
strokeWidth: props.strokeWidth || 2,
|
|
267
|
-
strokeLinecap: "round",
|
|
268
|
-
strokeLinejoin: "round",
|
|
269
|
-
className: cx("aura-icon", props.className),
|
|
270
|
-
...a11y
|
|
320
|
+
className: cx("aura-alert", "aura-alert--" + tone2, props.className),
|
|
321
|
+
role: props.role || (tone2 === "danger" || tone2 === "warning" ? "alert" : "status")
|
|
271
322
|
},
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
return h(s[0], attrs);
|
|
276
|
-
})
|
|
323
|
+
/* @__PURE__ */ React3.createElement(Icon, { name: props.icon || ALERT_ICON[tone2], className: "aura-alert__icon" }),
|
|
324
|
+
/* @__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),
|
|
325
|
+
close
|
|
277
326
|
);
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
327
|
+
}
|
|
328
|
+
function cardElement(props, ref) {
|
|
329
|
+
const creative = props.variant === "creative";
|
|
330
|
+
const rest = omit(props, [
|
|
331
|
+
"title",
|
|
332
|
+
"description",
|
|
333
|
+
"actions",
|
|
334
|
+
"footer",
|
|
335
|
+
"children",
|
|
336
|
+
"variant",
|
|
337
|
+
"headingLevel",
|
|
338
|
+
"interactive",
|
|
339
|
+
"as",
|
|
340
|
+
"className",
|
|
341
|
+
"titleId"
|
|
342
|
+
]);
|
|
343
|
+
return h2(
|
|
344
|
+
props.as || "section",
|
|
345
|
+
Object.assign({}, rest, {
|
|
346
|
+
ref,
|
|
347
|
+
className: cx(
|
|
348
|
+
"aura-card",
|
|
349
|
+
creative && "aura-card--creative",
|
|
350
|
+
props.interactive && "is-interactive",
|
|
351
|
+
props.className
|
|
352
|
+
),
|
|
353
|
+
/* A titled card is labelled by its title; otherwise the caller's aria-labelledby stays (5.8). */
|
|
354
|
+
"aria-labelledby": props.title && props.titleId ? props.titleId : props["aria-labelledby"]
|
|
355
|
+
}),
|
|
356
|
+
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,
|
|
357
|
+
props.children ? /* @__PURE__ */ React3.createElement("div", { className: "aura-card__body" }, props.children) : null,
|
|
358
|
+
props.footer ? /* @__PURE__ */ React3.createElement("div", { className: "aura-card__foot" }, props.footer) : null
|
|
359
|
+
);
|
|
360
|
+
}
|
|
361
|
+
var PILL_ICON = {
|
|
362
|
+
neutral: "circle",
|
|
363
|
+
progress: "circle-dot-dashed",
|
|
364
|
+
ready: "circle-check",
|
|
365
|
+
warning: "triangle-alert",
|
|
366
|
+
blocked: "ban"
|
|
367
|
+
};
|
|
368
|
+
function statusPillElement(props, ref) {
|
|
369
|
+
const tone2 = props.tone || toneFor(props.children);
|
|
370
|
+
const rest = omit(props, ["tone", "className", "children"]);
|
|
371
|
+
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);
|
|
372
|
+
}
|
|
373
|
+
function badgeElement(props, ref) {
|
|
374
|
+
const rest = omit(props, ["tone", "variant", "icon", "className", "children"]);
|
|
375
|
+
return /* @__PURE__ */ React3.createElement(
|
|
376
|
+
"span",
|
|
377
|
+
{
|
|
378
|
+
...rest,
|
|
379
|
+
ref,
|
|
380
|
+
className: cx(
|
|
381
|
+
"aura-badge",
|
|
382
|
+
"aura-badge--" + tone(props.tone),
|
|
383
|
+
props.variant === "solid" && "is-solid",
|
|
384
|
+
props.variant === "outline" && "is-outline",
|
|
385
|
+
props.className
|
|
386
|
+
)
|
|
387
|
+
},
|
|
388
|
+
props.icon ? /* @__PURE__ */ React3.createElement(Icon, { name: props.icon, size: 12 }) : null,
|
|
389
|
+
props.children
|
|
390
|
+
);
|
|
391
|
+
}
|
|
392
|
+
function emptyStateElement(props, ref) {
|
|
393
|
+
const HT = "h" + (props.headingLevel || 3);
|
|
394
|
+
return /* @__PURE__ */ React3.createElement(
|
|
395
|
+
"div",
|
|
396
|
+
{
|
|
397
|
+
ref,
|
|
398
|
+
className: cx("aura-empty", props.size === "sm" && "is-sm", props.bordered && "is-bordered", props.className)
|
|
399
|
+
},
|
|
400
|
+
/* @__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" })),
|
|
401
|
+
/* @__PURE__ */ React3.createElement(HT, { className: "aura-empty__title" }, props.title),
|
|
402
|
+
props.description ? /* @__PURE__ */ React3.createElement("p", { className: "aura-empty__text" }, props.description) : null,
|
|
403
|
+
props.action ? /* @__PURE__ */ React3.createElement("div", { className: "aura-empty__action" }, props.action) : null
|
|
404
|
+
);
|
|
405
|
+
}
|
|
406
|
+
function buttonClass(opts = {}) {
|
|
407
|
+
return cx(
|
|
408
|
+
"aura-btn",
|
|
409
|
+
"aura-btn--" + (opts.variant || "primary"),
|
|
410
|
+
opts.size === "sm" && "aura-btn--sm",
|
|
411
|
+
opts.fullWidth && "aura-btn--full",
|
|
412
|
+
opts.loading && "is-loading",
|
|
413
|
+
opts.className
|
|
414
|
+
);
|
|
415
|
+
}
|
|
283
416
|
|
|
284
417
|
// src/locale.tsx
|
|
285
|
-
var
|
|
418
|
+
var React4 = __toESM(require("react"), 1);
|
|
286
419
|
|
|
287
420
|
// src/strings.ts
|
|
288
421
|
var n = function(x) {
|
|
@@ -658,12 +791,12 @@ var STRINGS = {
|
|
|
658
791
|
};
|
|
659
792
|
|
|
660
793
|
// src/locale.tsx
|
|
661
|
-
var LocaleContext =
|
|
794
|
+
var LocaleContext = React4.createContext(null);
|
|
662
795
|
function AuraProvider(props) {
|
|
663
|
-
const outer =
|
|
796
|
+
const outer = React4.useContext(LocaleContext);
|
|
664
797
|
const density = props.density || outer && outer.density || null;
|
|
665
798
|
const timeZone = props.timeZone || outer && outer.timeZone || null;
|
|
666
|
-
const value =
|
|
799
|
+
const value = React4.useMemo(
|
|
667
800
|
function() {
|
|
668
801
|
const own = !!props.locale || !outer || !outer.locale;
|
|
669
802
|
const base = own ? props.locale && STRINGS[props.locale] || STRINGS.en : outer.strings;
|
|
@@ -678,17 +811,17 @@ function AuraProvider(props) {
|
|
|
678
811
|
},
|
|
679
812
|
[props.locale, props.calendar, props.strings, props.linkComponent, density, timeZone, outer]
|
|
680
813
|
);
|
|
681
|
-
return /* @__PURE__ */
|
|
814
|
+
return /* @__PURE__ */ React4.createElement(LocaleContext.Provider, { value }, props.density ? /* @__PURE__ */ React4.createElement("div", { className: "aura-density", "data-density": props.density }, props.children) : props.children);
|
|
682
815
|
}
|
|
683
816
|
function useAuraLocale() {
|
|
684
|
-
return
|
|
817
|
+
return React4.useContext(LocaleContext) || { locale: null, calendar: null, strings: STRINGS.en };
|
|
685
818
|
}
|
|
686
819
|
function useLinkComponent(own) {
|
|
687
|
-
const ctx =
|
|
820
|
+
const ctx = React4.useContext(LocaleContext);
|
|
688
821
|
return own || ctx && ctx.linkComponent || "a";
|
|
689
822
|
}
|
|
690
823
|
function useDensity() {
|
|
691
|
-
const ctx =
|
|
824
|
+
const ctx = React4.useContext(LocaleContext);
|
|
692
825
|
return ctx && ctx.density || void 0;
|
|
693
826
|
}
|
|
694
827
|
function useStrings() {
|
|
@@ -712,7 +845,7 @@ function ButtonLink(props, ref, Link) {
|
|
|
712
845
|
"size"
|
|
713
846
|
]);
|
|
714
847
|
const Tag3 = disabled ? "a" : Link;
|
|
715
|
-
return /* @__PURE__ */
|
|
848
|
+
return /* @__PURE__ */ React5.createElement(
|
|
716
849
|
Tag3,
|
|
717
850
|
{
|
|
718
851
|
...rest,
|
|
@@ -721,21 +854,20 @@ function ButtonLink(props, ref, Link) {
|
|
|
721
854
|
role: disabled ? "link" : void 0,
|
|
722
855
|
"aria-disabled": disabled || void 0,
|
|
723
856
|
tabIndex: disabled ? -1 : props.tabIndex,
|
|
724
|
-
className:
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
props.
|
|
728
|
-
props.
|
|
729
|
-
|
|
730
|
-
),
|
|
857
|
+
className: buttonClass({
|
|
858
|
+
variant,
|
|
859
|
+
size: props.size,
|
|
860
|
+
fullWidth: props.fullWidth,
|
|
861
|
+
className: props.className
|
|
862
|
+
}),
|
|
731
863
|
onClick: disabled ? void 0 : props.onClick
|
|
732
864
|
},
|
|
733
|
-
props.icon ? /* @__PURE__ */
|
|
865
|
+
props.icon ? /* @__PURE__ */ React5.createElement(Icon, { name: props.icon }) : null,
|
|
734
866
|
props.children,
|
|
735
|
-
props.iconRight ? /* @__PURE__ */
|
|
867
|
+
props.iconRight ? /* @__PURE__ */ React5.createElement(Icon, { name: props.iconRight }) : null
|
|
736
868
|
);
|
|
737
869
|
}
|
|
738
|
-
var Button =
|
|
870
|
+
var Button = React5.forwardRef(
|
|
739
871
|
function Button2(all, ref) {
|
|
740
872
|
const Link = useLinkComponent(all.linkComponent);
|
|
741
873
|
if (typeof all.href === "string") {
|
|
@@ -756,38 +888,37 @@ var Button = React4.forwardRef(
|
|
|
756
888
|
"fullWidth",
|
|
757
889
|
"size"
|
|
758
890
|
]);
|
|
759
|
-
return /* @__PURE__ */
|
|
891
|
+
return /* @__PURE__ */ React5.createElement(
|
|
760
892
|
"button",
|
|
761
893
|
{
|
|
762
894
|
...rest,
|
|
763
895
|
ref,
|
|
764
896
|
type: props.type || "button",
|
|
765
|
-
className:
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
props.
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
),
|
|
897
|
+
className: buttonClass({
|
|
898
|
+
variant,
|
|
899
|
+
size: props.size,
|
|
900
|
+
fullWidth: props.fullWidth,
|
|
901
|
+
loading,
|
|
902
|
+
className: props.className
|
|
903
|
+
}),
|
|
773
904
|
"aria-busy": loading || void 0,
|
|
774
905
|
"aria-disabled": loading || void 0,
|
|
775
906
|
onClick: loading ? function(e) {
|
|
776
907
|
e.preventDefault();
|
|
777
908
|
} : props.onClick
|
|
778
909
|
},
|
|
779
|
-
loading ? /* @__PURE__ */
|
|
910
|
+
loading ? /* @__PURE__ */ React5.createElement(Icon, { name: "loader-circle", className: "aura-spin" }) : props.icon ? /* @__PURE__ */ React5.createElement(Icon, { name: props.icon }) : null,
|
|
780
911
|
props.children,
|
|
781
|
-
props.iconRight && !loading ? /* @__PURE__ */
|
|
912
|
+
props.iconRight && !loading ? /* @__PURE__ */ React5.createElement(Icon, { name: props.iconRight }) : null
|
|
782
913
|
);
|
|
783
914
|
}
|
|
784
915
|
);
|
|
785
916
|
|
|
786
917
|
// src/IconButton.tsx
|
|
787
|
-
var
|
|
788
|
-
var IconButton =
|
|
918
|
+
var React6 = __toESM(require("react"), 1);
|
|
919
|
+
var IconButton = React6.forwardRef(function IconButton2(props, ref) {
|
|
789
920
|
const rest = omit(props, ["icon", "label", "className", "size", "tone"]);
|
|
790
|
-
return /* @__PURE__ */
|
|
921
|
+
return /* @__PURE__ */ React6.createElement(
|
|
791
922
|
"button",
|
|
792
923
|
{
|
|
793
924
|
...rest,
|
|
@@ -797,16 +928,16 @@ var IconButton = React5.forwardRef(function IconButton2(props, ref) {
|
|
|
797
928
|
title: props.label,
|
|
798
929
|
className: cx("aura-icon-btn", props.tone === "danger" && "aura-icon-btn--danger", props.className)
|
|
799
930
|
},
|
|
800
|
-
/* @__PURE__ */
|
|
931
|
+
/* @__PURE__ */ React6.createElement(Icon, { name: props.icon, size: props.size || "sm" })
|
|
801
932
|
);
|
|
802
933
|
});
|
|
803
934
|
|
|
804
935
|
// src/Menu.tsx
|
|
805
|
-
var
|
|
936
|
+
var React7 = __toESM(require("react"), 1);
|
|
806
937
|
var import_react_dom = require("react-dom");
|
|
807
|
-
var Menu =
|
|
808
|
-
const own =
|
|
809
|
-
const posState =
|
|
938
|
+
var Menu = React7.forwardRef(function Menu2(props, ref) {
|
|
939
|
+
const own = React7.useRef(null), merged = useMergedRef(ref, own);
|
|
940
|
+
const posState = React7.useState(null);
|
|
810
941
|
const pos = posState[0], setPos = posState[1];
|
|
811
942
|
const items2 = props.items || [];
|
|
812
943
|
const mounted = useMounted();
|
|
@@ -831,8 +962,8 @@ var Menu = React6.forwardRef(function Menu2(props, ref) {
|
|
|
831
962
|
},
|
|
832
963
|
[props.anchor, mounted, hasHeader]
|
|
833
964
|
);
|
|
834
|
-
const hadHeader =
|
|
835
|
-
|
|
965
|
+
const hadHeader = React7.useRef(hasHeader);
|
|
966
|
+
React7.useEffect(
|
|
836
967
|
function() {
|
|
837
968
|
if (hadHeader.current === hasHeader) return;
|
|
838
969
|
hadHeader.current = hasHeader;
|
|
@@ -844,7 +975,7 @@ var Menu = React6.forwardRef(function Menu2(props, ref) {
|
|
|
844
975
|
},
|
|
845
976
|
[hasHeader]
|
|
846
977
|
);
|
|
847
|
-
|
|
978
|
+
React7.useEffect(
|
|
848
979
|
function() {
|
|
849
980
|
if (!mounted) return;
|
|
850
981
|
const first = own.current && own.current.querySelector('[role^="menuitem"]:not([disabled])');
|
|
@@ -906,18 +1037,18 @@ var Menu = React6.forwardRef(function Menu2(props, ref) {
|
|
|
906
1037
|
return out;
|
|
907
1038
|
}
|
|
908
1039
|
function renderItem(it, i) {
|
|
909
|
-
if (it.separator) return /* @__PURE__ */
|
|
1040
|
+
if (it.separator) return /* @__PURE__ */ React7.createElement("div", { key: "s" + i, role: "separator", className: "aura-menu__sep" });
|
|
910
1041
|
const isRadio = it.type === "radio";
|
|
911
1042
|
const isCheck = !isRadio && it.checked !== void 0;
|
|
912
|
-
const lead = isRadio ? /* @__PURE__ */
|
|
1043
|
+
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" });
|
|
913
1044
|
const body = [
|
|
914
|
-
/* @__PURE__ */
|
|
915
|
-
/* @__PURE__ */
|
|
916
|
-
it.hint ? /* @__PURE__ */
|
|
1045
|
+
/* @__PURE__ */ React7.createElement(React7.Fragment, { key: "l" }, lead),
|
|
1046
|
+
/* @__PURE__ */ React7.createElement("span", { key: "t", className: "aura-menu__label" }, it.label),
|
|
1047
|
+
it.hint ? /* @__PURE__ */ React7.createElement("span", { key: "h", className: "aura-menu__hint" }, it.hint) : null
|
|
917
1048
|
];
|
|
918
1049
|
const cls = cx("aura-menu__item", it.tone === "danger" && "aura-menu__item--danger");
|
|
919
1050
|
if (it.href && !it.disabled)
|
|
920
|
-
return /* @__PURE__ */
|
|
1051
|
+
return /* @__PURE__ */ React7.createElement(
|
|
921
1052
|
Link,
|
|
922
1053
|
{
|
|
923
1054
|
key: i,
|
|
@@ -934,7 +1065,7 @@ var Menu = React6.forwardRef(function Menu2(props, ref) {
|
|
|
934
1065
|
},
|
|
935
1066
|
body
|
|
936
1067
|
);
|
|
937
|
-
return /* @__PURE__ */
|
|
1068
|
+
return /* @__PURE__ */ React7.createElement(
|
|
938
1069
|
"button",
|
|
939
1070
|
{
|
|
940
1071
|
key: i,
|
|
@@ -961,9 +1092,9 @@ var Menu = React6.forwardRef(function Menu2(props, ref) {
|
|
|
961
1092
|
const rendered = block.items.map(function(x) {
|
|
962
1093
|
return renderItem(x.it, x.i);
|
|
963
1094
|
});
|
|
964
|
-
return block.group ? /* @__PURE__ */
|
|
1095
|
+
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);
|
|
965
1096
|
});
|
|
966
|
-
const el = hasHeader ? /* @__PURE__ */
|
|
1097
|
+
const el = hasHeader ? /* @__PURE__ */ React7.createElement("div", { ref: merged, className: "aura-menu has-header", onKeyDown, style }, /* @__PURE__ */ React7.createElement(
|
|
967
1098
|
"div",
|
|
968
1099
|
{
|
|
969
1100
|
className: "aura-menu__header",
|
|
@@ -973,18 +1104,18 @@ var Menu = React6.forwardRef(function Menu2(props, ref) {
|
|
|
973
1104
|
}
|
|
974
1105
|
},
|
|
975
1106
|
props.header
|
|
976
|
-
), /* @__PURE__ */
|
|
1107
|
+
), /* @__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);
|
|
977
1108
|
return mounted ? (0, import_react_dom.createPortal)(el, document.body) : null;
|
|
978
1109
|
});
|
|
979
1110
|
|
|
980
1111
|
// src/DropdownMenu.tsx
|
|
981
|
-
var
|
|
982
|
-
var DropdownMenu =
|
|
983
|
-
const st =
|
|
984
|
-
const wrap =
|
|
985
|
-
const child =
|
|
986
|
-
const menuRef =
|
|
987
|
-
|
|
1112
|
+
var React8 = __toESM(require("react"), 1);
|
|
1113
|
+
var DropdownMenu = React8.forwardRef(function DropdownMenu2(props, ref) {
|
|
1114
|
+
const st = React8.useState(null), anchor = st[0], setAnchor = st[1];
|
|
1115
|
+
const wrap = React8.useRef(null), wrapMerged = useMergedRef(ref, wrap);
|
|
1116
|
+
const child = React8.Children.only(props.trigger);
|
|
1117
|
+
const menuRef = React8.useRef(null), toLast = React8.useRef(false);
|
|
1118
|
+
React8.useEffect(
|
|
988
1119
|
function() {
|
|
989
1120
|
if (!anchor || !toLast.current || !menuRef.current) return;
|
|
990
1121
|
toLast.current = false;
|
|
@@ -1005,7 +1136,7 @@ var DropdownMenu = React7.forwardRef(function DropdownMenu2(props, ref) {
|
|
|
1005
1136
|
setAnchor(wrap.current.querySelector('button, [role="button"], a') || wrap.current);
|
|
1006
1137
|
}
|
|
1007
1138
|
}
|
|
1008
|
-
return /* @__PURE__ */
|
|
1139
|
+
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(
|
|
1009
1140
|
Menu,
|
|
1010
1141
|
{
|
|
1011
1142
|
ref: menuRef,
|
|
@@ -1023,13 +1154,13 @@ var DropdownMenu = React7.forwardRef(function DropdownMenu2(props, ref) {
|
|
|
1023
1154
|
});
|
|
1024
1155
|
|
|
1025
1156
|
// src/Checkbox.tsx
|
|
1026
|
-
var
|
|
1027
|
-
var Checkbox =
|
|
1028
|
-
const own =
|
|
1157
|
+
var React9 = __toESM(require("react"), 1);
|
|
1158
|
+
var Checkbox = React9.forwardRef(function Checkbox2(props, ref) {
|
|
1159
|
+
const own = React9.useRef(null), merged = useMergedRef(ref, own);
|
|
1029
1160
|
const st = useMaybeControlled(props.checked, !!props.defaultChecked, props.onChange);
|
|
1030
1161
|
const on = !!st[0];
|
|
1031
1162
|
const auto = uid();
|
|
1032
|
-
|
|
1163
|
+
React9.useEffect(function() {
|
|
1033
1164
|
if (own.current) own.current.indeterminate = !!props.indeterminate;
|
|
1034
1165
|
});
|
|
1035
1166
|
const rest = omit(props, [
|
|
@@ -1045,15 +1176,15 @@ var Checkbox = React8.forwardRef(function Checkbox2(props, ref) {
|
|
|
1045
1176
|
"tabIndex",
|
|
1046
1177
|
"disabled"
|
|
1047
1178
|
]);
|
|
1048
|
-
const
|
|
1049
|
-
const labelled =
|
|
1179
|
+
const text2 = props.children;
|
|
1180
|
+
const labelled = text2 != null && text2 !== "";
|
|
1050
1181
|
if (!labelled && props.label && !props.hideLabel)
|
|
1051
1182
|
devWarnOnce(
|
|
1052
1183
|
"checkbox-label",
|
|
1053
1184
|
"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`."
|
|
1054
1185
|
);
|
|
1055
1186
|
const descId = props.description ? (props.id || auto) + "-desc" : void 0;
|
|
1056
|
-
return /* @__PURE__ */
|
|
1187
|
+
return /* @__PURE__ */ React9.createElement(
|
|
1057
1188
|
"label",
|
|
1058
1189
|
{
|
|
1059
1190
|
className: cx("aura-check", labelled && "aura-check--labelled", props.disabled && "is-disabled", props.className),
|
|
@@ -1061,7 +1192,7 @@ var Checkbox = React8.forwardRef(function Checkbox2(props, ref) {
|
|
|
1061
1192
|
e.stopPropagation();
|
|
1062
1193
|
}
|
|
1063
1194
|
},
|
|
1064
|
-
/* @__PURE__ */
|
|
1195
|
+
/* @__PURE__ */ React9.createElement(
|
|
1065
1196
|
"input",
|
|
1066
1197
|
{
|
|
1067
1198
|
...rest,
|
|
@@ -1078,62 +1209,38 @@ var Checkbox = React8.forwardRef(function Checkbox2(props, ref) {
|
|
|
1078
1209
|
}
|
|
1079
1210
|
}
|
|
1080
1211
|
),
|
|
1081
|
-
/* @__PURE__ */
|
|
1082
|
-
!labelled && props.description ? /* @__PURE__ */
|
|
1083
|
-
labelled ? /* @__PURE__ */
|
|
1212
|
+
/* @__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),
|
|
1213
|
+
!labelled && props.description ? /* @__PURE__ */ React9.createElement("span", { className: "aura-sr-only", id: descId }, props.description) : null,
|
|
1214
|
+
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
|
|
1084
1215
|
);
|
|
1085
1216
|
});
|
|
1086
1217
|
|
|
1087
1218
|
// src/StatusPill.tsx
|
|
1088
|
-
var
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
var TONE_WORDS = {
|
|
1092
|
-
ready: ["ready", "done", "complete", "completed", "approved", "live", "passed"],
|
|
1093
|
-
progress: ["in progress", "in review", "review", "syncing", "running", "pending"],
|
|
1094
|
-
warning: ["warning", "problem", "degraded", "at risk"],
|
|
1095
|
-
blocked: ["blocked", "failed", "error", "rejected", "on hold", "cancelled"]
|
|
1096
|
-
};
|
|
1097
|
-
function toneFor(status) {
|
|
1098
|
-
const s = String(status == null ? "" : status).trim().toLowerCase();
|
|
1099
|
-
for (const t in TONE_WORDS) if (TONE_WORDS[t].indexOf(s) >= 0) return t;
|
|
1100
|
-
return "neutral";
|
|
1101
|
-
}
|
|
1102
|
-
var TONE_ORDER = { neutral: 0, progress: 1, ready: 2, warning: 3, blocked: 4 };
|
|
1103
|
-
|
|
1104
|
-
// src/StatusPill.tsx
|
|
1105
|
-
var TONE_ICON = {
|
|
1106
|
-
neutral: "circle",
|
|
1107
|
-
progress: "circle-dot-dashed",
|
|
1108
|
-
ready: "circle-check",
|
|
1109
|
-
warning: "triangle-alert",
|
|
1110
|
-
blocked: "ban"
|
|
1111
|
-
};
|
|
1112
|
-
var StatusPill = React9.forwardRef(function StatusPill2(props, ref) {
|
|
1113
|
-
const tone2 = props.tone || toneFor(props.children);
|
|
1114
|
-
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);
|
|
1219
|
+
var React10 = __toESM(require("react"), 1);
|
|
1220
|
+
var StatusPill = React10.forwardRef(function StatusPill2(props, ref) {
|
|
1221
|
+
return statusPillElement(props, ref);
|
|
1115
1222
|
});
|
|
1116
1223
|
|
|
1117
1224
|
// src/Field.tsx
|
|
1118
|
-
var
|
|
1119
|
-
var
|
|
1120
|
-
var Field =
|
|
1225
|
+
var React11 = __toESM(require("react"), 1);
|
|
1226
|
+
var h3 = React11.createElement;
|
|
1227
|
+
var Field = React11.forwardRef(function Field2(props, ref) {
|
|
1121
1228
|
const t = useStrings();
|
|
1122
|
-
return /* @__PURE__ */
|
|
1229
|
+
return /* @__PURE__ */ React11.createElement(
|
|
1123
1230
|
"div",
|
|
1124
1231
|
{
|
|
1125
1232
|
ref,
|
|
1126
1233
|
className: cx("aura-field", props.error && "is-invalid", props.disabled && "is-disabled", props.className)
|
|
1127
1234
|
},
|
|
1128
|
-
props.label ?
|
|
1235
|
+
props.label ? h3(
|
|
1129
1236
|
props.labelAs || "label",
|
|
1130
1237
|
{ className: "aura-field__label", htmlFor: props.labelAs ? void 0 : props.id, id: props.labelId },
|
|
1131
1238
|
props.label,
|
|
1132
|
-
props.required ? /* @__PURE__ */
|
|
1133
|
-
props.optional ? /* @__PURE__ */
|
|
1239
|
+
props.required ? /* @__PURE__ */ React11.createElement("span", { className: "aura-field__req", "aria-hidden": true }, " *") : null,
|
|
1240
|
+
props.optional ? /* @__PURE__ */ React11.createElement("span", { className: "aura-field__opt" }, " (" + t.optional + ")") : null
|
|
1134
1241
|
) : null,
|
|
1135
1242
|
props.children,
|
|
1136
|
-
props.error ? /* @__PURE__ */
|
|
1243
|
+
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
|
|
1137
1244
|
);
|
|
1138
1245
|
});
|
|
1139
1246
|
function describedBy(id, p) {
|
|
@@ -1154,11 +1261,11 @@ var FIELD_KEYS = [
|
|
|
1154
1261
|
];
|
|
1155
1262
|
|
|
1156
1263
|
// src/TextField.tsx
|
|
1157
|
-
var
|
|
1158
|
-
var TextField =
|
|
1264
|
+
var React12 = __toESM(require("react"), 1);
|
|
1265
|
+
var TextField = React12.forwardRef(function TextField2(props, ref) {
|
|
1159
1266
|
const auto = uid(), id = props.id || auto;
|
|
1160
1267
|
const rest = omit(props, FIELD_KEYS);
|
|
1161
|
-
return /* @__PURE__ */
|
|
1268
|
+
return /* @__PURE__ */ React12.createElement(
|
|
1162
1269
|
Field,
|
|
1163
1270
|
{
|
|
1164
1271
|
id,
|
|
@@ -1170,7 +1277,7 @@ var TextField = React11.forwardRef(function TextField2(props, ref) {
|
|
|
1170
1277
|
disabled: props.disabled,
|
|
1171
1278
|
className: props.className
|
|
1172
1279
|
},
|
|
1173
|
-
/* @__PURE__ */
|
|
1280
|
+
/* @__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(
|
|
1174
1281
|
"input",
|
|
1175
1282
|
{
|
|
1176
1283
|
type: "text",
|
|
@@ -1183,16 +1290,16 @@ var TextField = React11.forwardRef(function TextField2(props, ref) {
|
|
|
1183
1290
|
"aria-invalid": props.error ? true : rest["aria-invalid"],
|
|
1184
1291
|
"aria-describedby": [describedBy(id, props), rest["aria-describedby"]].filter(Boolean).join(" ") || void 0
|
|
1185
1292
|
}
|
|
1186
|
-
), props.suffix ? /* @__PURE__ */
|
|
1293
|
+
), props.suffix ? /* @__PURE__ */ React12.createElement("span", { className: "aura-input__suffix" }, props.suffix) : null)
|
|
1187
1294
|
);
|
|
1188
1295
|
});
|
|
1189
1296
|
|
|
1190
1297
|
// src/Textarea.tsx
|
|
1191
|
-
var
|
|
1192
|
-
var Textarea =
|
|
1298
|
+
var React13 = __toESM(require("react"), 1);
|
|
1299
|
+
var Textarea = React13.forwardRef(function Textarea2(props, ref) {
|
|
1193
1300
|
const auto = uid(), id = props.id || auto;
|
|
1194
1301
|
const rest = omit(props, FIELD_KEYS);
|
|
1195
|
-
return /* @__PURE__ */
|
|
1302
|
+
return /* @__PURE__ */ React13.createElement(
|
|
1196
1303
|
Field,
|
|
1197
1304
|
{
|
|
1198
1305
|
id,
|
|
@@ -1204,7 +1311,7 @@ var Textarea = React12.forwardRef(function Textarea2(props, ref) {
|
|
|
1204
1311
|
disabled: props.disabled,
|
|
1205
1312
|
className: props.className
|
|
1206
1313
|
},
|
|
1207
|
-
/* @__PURE__ */
|
|
1314
|
+
/* @__PURE__ */ React13.createElement(
|
|
1208
1315
|
"textarea",
|
|
1209
1316
|
{
|
|
1210
1317
|
rows: 4,
|
|
@@ -1222,9 +1329,9 @@ var Textarea = React12.forwardRef(function Textarea2(props, ref) {
|
|
|
1222
1329
|
});
|
|
1223
1330
|
|
|
1224
1331
|
// src/Select.tsx
|
|
1225
|
-
var
|
|
1332
|
+
var React14 = __toESM(require("react"), 1);
|
|
1226
1333
|
var import_react_dom2 = require("react-dom");
|
|
1227
|
-
var
|
|
1334
|
+
var h4 = React14.createElement;
|
|
1228
1335
|
var FORM_KEYS = ["name", "form", "value", "defaultValue", "disabled", "autoComplete", "onInput", "onInvalid"];
|
|
1229
1336
|
var HANDLED_KEYS = FORM_KEYS.concat([
|
|
1230
1337
|
"onChange",
|
|
@@ -1269,23 +1376,23 @@ function initialLabel(props) {
|
|
|
1269
1376
|
if (hit) return { label: hit.label, empty: false };
|
|
1270
1377
|
return { label: props.placeholder || "", empty: true };
|
|
1271
1378
|
}
|
|
1272
|
-
var Select =
|
|
1379
|
+
var Select = React14.forwardRef(function Select2(props, ref) {
|
|
1273
1380
|
const auto = uid(), id = props.id || auto;
|
|
1274
1381
|
const rest = omit(props, FIELD_KEYS.concat(["children"]));
|
|
1275
1382
|
const opts = (props.options || []).map(function(o) {
|
|
1276
1383
|
const v = typeof o === "object" ? o : { value: o, label: o };
|
|
1277
|
-
return /* @__PURE__ */
|
|
1384
|
+
return /* @__PURE__ */ React14.createElement("option", { key: v.value, value: v.value, disabled: v.disabled }, v.label);
|
|
1278
1385
|
});
|
|
1279
1386
|
if (props.placeholder)
|
|
1280
1387
|
opts.unshift(
|
|
1281
|
-
/* @__PURE__ */
|
|
1388
|
+
/* @__PURE__ */ React14.createElement("option", { key: "__ph", value: "", disabled: true }, props.placeholder)
|
|
1282
1389
|
);
|
|
1283
1390
|
const extra = props.value === void 0 && props.defaultValue === void 0 && props.placeholder ? { defaultValue: "" } : {};
|
|
1284
1391
|
const native = !!props.multiple || props.size != null && props.size > 1;
|
|
1285
1392
|
const mounted = useMounted();
|
|
1286
1393
|
const live = !native && mounted;
|
|
1287
1394
|
const density = useDensity();
|
|
1288
|
-
|
|
1395
|
+
React14.useEffect(function() {
|
|
1289
1396
|
if (props.label || props["aria-label"] || props["aria-labelledby"] || props.title) return;
|
|
1290
1397
|
if (document.querySelector('label[for="' + id.replace(/["\\]/g, "\\$&") + '"]')) return;
|
|
1291
1398
|
devWarnOnce(
|
|
@@ -1293,16 +1400,16 @@ var Select = React13.forwardRef(function Select2(props, ref) {
|
|
|
1293
1400
|
"Select needs a label, aria-label or aria-labelledby: screen readers announce it with no name."
|
|
1294
1401
|
);
|
|
1295
1402
|
}, []);
|
|
1296
|
-
const selRef =
|
|
1297
|
-
const shown =
|
|
1403
|
+
const selRef = React14.useRef(null), trigRef = React14.useRef(null), listRef = React14.useRef(null);
|
|
1404
|
+
const shown = React14.useState(function() {
|
|
1298
1405
|
return initialLabel(props);
|
|
1299
1406
|
});
|
|
1300
|
-
const openState =
|
|
1301
|
-
const activeState =
|
|
1302
|
-
const items2 =
|
|
1303
|
-
const pos =
|
|
1304
|
-
const typed =
|
|
1305
|
-
const sync =
|
|
1407
|
+
const openState = React14.useState(false), open = openState[0];
|
|
1408
|
+
const activeState = React14.useState(-1), active = activeState[0];
|
|
1409
|
+
const items2 = React14.useState([]);
|
|
1410
|
+
const pos = React14.useState(null);
|
|
1411
|
+
const typed = React14.useRef({ text: "", at: 0 });
|
|
1412
|
+
const sync = React14.useCallback(function() {
|
|
1306
1413
|
const el = selRef.current;
|
|
1307
1414
|
if (!el) return;
|
|
1308
1415
|
const o = el.selectedIndex >= 0 ? el.options[el.selectedIndex] : null;
|
|
@@ -1311,7 +1418,7 @@ var Select = React13.forwardRef(function Select2(props, ref) {
|
|
|
1311
1418
|
return cur.label === next.label && cur.empty === next.empty ? cur : next;
|
|
1312
1419
|
});
|
|
1313
1420
|
}, []);
|
|
1314
|
-
const hook =
|
|
1421
|
+
const hook = React14.useCallback(
|
|
1315
1422
|
function(el) {
|
|
1316
1423
|
selRef.current = el;
|
|
1317
1424
|
if (!el || native || el.__auraHooked) return;
|
|
@@ -1348,7 +1455,7 @@ var Select = React13.forwardRef(function Select2(props, ref) {
|
|
|
1348
1455
|
[native, sync]
|
|
1349
1456
|
);
|
|
1350
1457
|
const selMerged = useMergedRef(ref, hook);
|
|
1351
|
-
|
|
1458
|
+
React14.useEffect(
|
|
1352
1459
|
function() {
|
|
1353
1460
|
const f = selRef.current && selRef.current.form;
|
|
1354
1461
|
if (!f || native) return;
|
|
@@ -1362,8 +1469,8 @@ var Select = React13.forwardRef(function Select2(props, ref) {
|
|
|
1362
1469
|
},
|
|
1363
1470
|
[native, sync]
|
|
1364
1471
|
);
|
|
1365
|
-
const focusedOnce =
|
|
1366
|
-
|
|
1472
|
+
const focusedOnce = React14.useRef(false);
|
|
1473
|
+
React14.useEffect(
|
|
1367
1474
|
function() {
|
|
1368
1475
|
if (!live || focusedOnce.current || !trigRef.current) return;
|
|
1369
1476
|
focusedOnce.current = true;
|
|
@@ -1528,7 +1635,7 @@ var Select = React13.forwardRef(function Select2(props, ref) {
|
|
|
1528
1635
|
},
|
|
1529
1636
|
[open]
|
|
1530
1637
|
);
|
|
1531
|
-
|
|
1638
|
+
React14.useEffect(
|
|
1532
1639
|
function() {
|
|
1533
1640
|
if (!open || !listRef.current || active < 0) return;
|
|
1534
1641
|
const el = listRef.current.querySelector('[data-idx="' + active + '"]');
|
|
@@ -1537,7 +1644,7 @@ var Select = React13.forwardRef(function Select2(props, ref) {
|
|
|
1537
1644
|
[open, active, pos[0] != null]
|
|
1538
1645
|
);
|
|
1539
1646
|
const described = [describedBy(id, props), rest["aria-describedby"]].filter(Boolean).join(" ") || void 0;
|
|
1540
|
-
const field = (child) => /* @__PURE__ */
|
|
1647
|
+
const field = (child) => /* @__PURE__ */ React14.createElement(
|
|
1541
1648
|
Field,
|
|
1542
1649
|
{
|
|
1543
1650
|
id,
|
|
@@ -1554,7 +1661,7 @@ var Select = React13.forwardRef(function Select2(props, ref) {
|
|
|
1554
1661
|
);
|
|
1555
1662
|
if (!live)
|
|
1556
1663
|
return field(
|
|
1557
|
-
/* @__PURE__ */
|
|
1664
|
+
/* @__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(
|
|
1558
1665
|
"select",
|
|
1559
1666
|
Object.assign(extra, rest, {
|
|
1560
1667
|
ref: native ? ref : selMerged,
|
|
@@ -1566,7 +1673,7 @@ var Select = React13.forwardRef(function Select2(props, ref) {
|
|
|
1566
1673
|
}),
|
|
1567
1674
|
opts,
|
|
1568
1675
|
props.children
|
|
1569
|
-
), /* @__PURE__ */
|
|
1676
|
+
), /* @__PURE__ */ React14.createElement(Icon, { name: "chevron-down", className: "aura-select__chevron" }))
|
|
1570
1677
|
);
|
|
1571
1678
|
const listId = id + "-list", labelId = id + "-label";
|
|
1572
1679
|
const optId = function(i) {
|
|
@@ -1576,7 +1683,7 @@ var Select = React13.forwardRef(function Select2(props, ref) {
|
|
|
1576
1683
|
const selIndex = selRef.current ? selRef.current.selectedIndex : -1;
|
|
1577
1684
|
const option = function(it) {
|
|
1578
1685
|
const sel = selIndex === it.index;
|
|
1579
|
-
return /* @__PURE__ */
|
|
1686
|
+
return /* @__PURE__ */ React14.createElement(
|
|
1580
1687
|
"div",
|
|
1581
1688
|
{
|
|
1582
1689
|
key: it.index,
|
|
@@ -1601,8 +1708,8 @@ var Select = React13.forwardRef(function Select2(props, ref) {
|
|
|
1601
1708
|
choose(it);
|
|
1602
1709
|
}
|
|
1603
1710
|
},
|
|
1604
|
-
/* @__PURE__ */
|
|
1605
|
-
sel ? /* @__PURE__ */
|
|
1711
|
+
/* @__PURE__ */ React14.createElement("span", { className: "aura-combo__text" }, /* @__PURE__ */ React14.createElement("span", { className: "aura-combo__label" }, it.label)),
|
|
1712
|
+
sel ? /* @__PURE__ */ React14.createElement(Icon, { name: "check", className: "aura-combo__check" }) : null
|
|
1606
1713
|
);
|
|
1607
1714
|
};
|
|
1608
1715
|
const runs = [];
|
|
@@ -1613,7 +1720,7 @@ var Select = React13.forwardRef(function Select2(props, ref) {
|
|
|
1613
1720
|
else runs.push({ group: it.group, items: [it] });
|
|
1614
1721
|
});
|
|
1615
1722
|
const popup = open ? (0, import_react_dom2.createPortal)(
|
|
1616
|
-
/* @__PURE__ */
|
|
1723
|
+
/* @__PURE__ */ React14.createElement(
|
|
1617
1724
|
"div",
|
|
1618
1725
|
{
|
|
1619
1726
|
ref: listRef,
|
|
@@ -1627,7 +1734,7 @@ var Select = React13.forwardRef(function Select2(props, ref) {
|
|
|
1627
1734
|
maxHeight: pos[0].maxHeight
|
|
1628
1735
|
} : { left: -9999, top: -9999 }
|
|
1629
1736
|
},
|
|
1630
|
-
/* @__PURE__ */
|
|
1737
|
+
/* @__PURE__ */ React14.createElement(
|
|
1631
1738
|
"div",
|
|
1632
1739
|
{
|
|
1633
1740
|
id: listId,
|
|
@@ -1637,9 +1744,9 @@ var Select = React13.forwardRef(function Select2(props, ref) {
|
|
|
1637
1744
|
className: "aura-combo__list"
|
|
1638
1745
|
},
|
|
1639
1746
|
runs.map(function(r, n2) {
|
|
1640
|
-
if (r.group === null) return /* @__PURE__ */
|
|
1747
|
+
if (r.group === null) return /* @__PURE__ */ React14.createElement(React14.Fragment, { key: "r" + n2 }, r.items.map(option));
|
|
1641
1748
|
const gid = id + "-group-" + n2;
|
|
1642
|
-
return /* @__PURE__ */
|
|
1749
|
+
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));
|
|
1643
1750
|
})
|
|
1644
1751
|
)
|
|
1645
1752
|
),
|
|
@@ -1647,14 +1754,14 @@ var Select = React13.forwardRef(function Select2(props, ref) {
|
|
|
1647
1754
|
) : null;
|
|
1648
1755
|
const userFocus = rest.onFocus, userBlur = rest.onBlur, userKey = rest.onKeyDown, userClick = rest.onClick;
|
|
1649
1756
|
return field(
|
|
1650
|
-
/* @__PURE__ */
|
|
1757
|
+
/* @__PURE__ */ React14.createElement(
|
|
1651
1758
|
"div",
|
|
1652
1759
|
{
|
|
1653
1760
|
className: cx("aura-input aura-select aura-select--custom", props.icon && "has-icon", open && "is-open"),
|
|
1654
1761
|
"data-invalid": props.error ? "" : void 0
|
|
1655
1762
|
},
|
|
1656
|
-
props.icon ? /* @__PURE__ */
|
|
1657
|
-
|
|
1763
|
+
props.icon ? /* @__PURE__ */ React14.createElement(Icon, { name: props.icon, className: "aura-input__icon" }) : null,
|
|
1764
|
+
h4(
|
|
1658
1765
|
"select",
|
|
1659
1766
|
Object.assign(extra, pick(rest, FORM_KEYS), {
|
|
1660
1767
|
ref: selMerged,
|
|
@@ -1679,7 +1786,7 @@ var Select = React13.forwardRef(function Select2(props, ref) {
|
|
|
1679
1786
|
opts,
|
|
1680
1787
|
props.children
|
|
1681
1788
|
),
|
|
1682
|
-
/* @__PURE__ */
|
|
1789
|
+
/* @__PURE__ */ React14.createElement(
|
|
1683
1790
|
"button",
|
|
1684
1791
|
{
|
|
1685
1792
|
...omit(rest, HANDLED_KEYS),
|
|
@@ -1719,17 +1826,17 @@ var Select = React13.forwardRef(function Select2(props, ref) {
|
|
|
1719
1826
|
if (selRef.current) selRef.current.dispatchEvent(new FocusEvent("focusout", { bubbles: true }));
|
|
1720
1827
|
}
|
|
1721
1828
|
},
|
|
1722
|
-
/* @__PURE__ */
|
|
1829
|
+
/* @__PURE__ */ React14.createElement("span", { id: id + "-value", className: cx("aura-select__value", shown[0].empty && "is-placeholder") }, shown[0].label || " ")
|
|
1723
1830
|
),
|
|
1724
|
-
/* @__PURE__ */
|
|
1831
|
+
/* @__PURE__ */ React14.createElement(Icon, { name: "chevron-down", className: "aura-select__chevron" }),
|
|
1725
1832
|
popup
|
|
1726
1833
|
)
|
|
1727
1834
|
);
|
|
1728
1835
|
});
|
|
1729
1836
|
|
|
1730
1837
|
// src/RadioGroup.tsx
|
|
1731
|
-
var
|
|
1732
|
-
var RadioGroup =
|
|
1838
|
+
var React15 = __toESM(require("react"), 1);
|
|
1839
|
+
var RadioGroup = React15.forwardRef(function RadioGroup2(props, ref) {
|
|
1733
1840
|
const auto = uid(), id = props.id || auto;
|
|
1734
1841
|
const st = useMaybeControlled(
|
|
1735
1842
|
props.value,
|
|
@@ -1737,7 +1844,7 @@ var RadioGroup = React14.forwardRef(function RadioGroup2(props, ref) {
|
|
|
1737
1844
|
props.onChange
|
|
1738
1845
|
);
|
|
1739
1846
|
const name = props.name || id;
|
|
1740
|
-
const setRef =
|
|
1847
|
+
const setRef = React15.useCallback(
|
|
1741
1848
|
function(el) {
|
|
1742
1849
|
if (el)
|
|
1743
1850
|
el.focus = function(opts) {
|
|
@@ -1749,7 +1856,7 @@ var RadioGroup = React14.forwardRef(function RadioGroup2(props, ref) {
|
|
|
1749
1856
|
},
|
|
1750
1857
|
[ref]
|
|
1751
1858
|
);
|
|
1752
|
-
return /* @__PURE__ */
|
|
1859
|
+
return /* @__PURE__ */ React15.createElement(
|
|
1753
1860
|
"fieldset",
|
|
1754
1861
|
{
|
|
1755
1862
|
ref: setRef,
|
|
@@ -1758,10 +1865,10 @@ var RadioGroup = React14.forwardRef(function RadioGroup2(props, ref) {
|
|
|
1758
1865
|
"aria-invalid": props.error ? true : void 0,
|
|
1759
1866
|
disabled: props.disabled
|
|
1760
1867
|
},
|
|
1761
|
-
props.label ? /* @__PURE__ */
|
|
1762
|
-
/* @__PURE__ */
|
|
1868
|
+
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,
|
|
1869
|
+
/* @__PURE__ */ React15.createElement("div", { className: cx("aura-radio-group__list", props.orientation === "horizontal" && "is-horizontal") }, (props.options || []).map(function(o) {
|
|
1763
1870
|
const v = typeof o === "object" ? o : { value: o, label: o };
|
|
1764
|
-
return /* @__PURE__ */
|
|
1871
|
+
return /* @__PURE__ */ React15.createElement("label", { key: v.value, className: cx("aura-choice", v.disabled && "is-disabled") }, /* @__PURE__ */ React15.createElement(
|
|
1765
1872
|
"input",
|
|
1766
1873
|
{
|
|
1767
1874
|
type: "radio",
|
|
@@ -1775,19 +1882,19 @@ var RadioGroup = React14.forwardRef(function RadioGroup2(props, ref) {
|
|
|
1775
1882
|
st[1](v.value);
|
|
1776
1883
|
}
|
|
1777
1884
|
}
|
|
1778
|
-
), /* @__PURE__ */
|
|
1885
|
+
), /* @__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));
|
|
1779
1886
|
})),
|
|
1780
|
-
props.error ? /* @__PURE__ */
|
|
1887
|
+
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
|
|
1781
1888
|
);
|
|
1782
1889
|
});
|
|
1783
1890
|
|
|
1784
1891
|
// src/Switch.tsx
|
|
1785
|
-
var
|
|
1786
|
-
var Switch =
|
|
1892
|
+
var React16 = __toESM(require("react"), 1);
|
|
1893
|
+
var Switch = React16.forwardRef(function Switch2(props, ref) {
|
|
1787
1894
|
const auto = uid(), id = props.id || auto;
|
|
1788
1895
|
const st = useMaybeControlled(props.checked, !!props.defaultChecked, props.onChange);
|
|
1789
1896
|
const on = !!st[0];
|
|
1790
|
-
return /* @__PURE__ */
|
|
1897
|
+
return /* @__PURE__ */ React16.createElement(
|
|
1791
1898
|
"div",
|
|
1792
1899
|
{
|
|
1793
1900
|
className: cx("aura-switch-row", props.disabled && "is-disabled", props.className),
|
|
@@ -1797,7 +1904,7 @@ var Switch = React15.forwardRef(function Switch2(props, ref) {
|
|
|
1797
1904
|
st[1](!on);
|
|
1798
1905
|
}
|
|
1799
1906
|
},
|
|
1800
|
-
/* @__PURE__ */
|
|
1907
|
+
/* @__PURE__ */ React16.createElement(
|
|
1801
1908
|
"button",
|
|
1802
1909
|
{
|
|
1803
1910
|
ref,
|
|
@@ -1814,14 +1921,14 @@ var Switch = React15.forwardRef(function Switch2(props, ref) {
|
|
|
1814
1921
|
st[1](!on);
|
|
1815
1922
|
}
|
|
1816
1923
|
},
|
|
1817
|
-
/* @__PURE__ */
|
|
1924
|
+
/* @__PURE__ */ React16.createElement("span", { className: "aura-switch__thumb" })
|
|
1818
1925
|
),
|
|
1819
|
-
props.label ? /* @__PURE__ */
|
|
1926
|
+
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
|
|
1820
1927
|
);
|
|
1821
1928
|
});
|
|
1822
1929
|
|
|
1823
1930
|
// src/Combobox.tsx
|
|
1824
|
-
var
|
|
1931
|
+
var React17 = __toESM(require("react"), 1);
|
|
1825
1932
|
var import_react_dom3 = require("react-dom");
|
|
1826
1933
|
function norm(s) {
|
|
1827
1934
|
return String(s == null ? "" : s).normalize("NFC").toLocaleLowerCase("th");
|
|
@@ -1836,7 +1943,7 @@ function defaultFilter(option, query) {
|
|
|
1836
1943
|
return norm(k).indexOf(q) >= 0;
|
|
1837
1944
|
});
|
|
1838
1945
|
}
|
|
1839
|
-
var Combobox =
|
|
1946
|
+
var Combobox = React17.forwardRef(
|
|
1840
1947
|
function Combobox2(all, ref) {
|
|
1841
1948
|
const props = all;
|
|
1842
1949
|
const multi = all.multiple === true;
|
|
@@ -1871,11 +1978,11 @@ var Combobox = React16.forwardRef(
|
|
|
1871
1978
|
return o.value === v;
|
|
1872
1979
|
})[0];
|
|
1873
1980
|
}).filter(Boolean) : [];
|
|
1874
|
-
const openState =
|
|
1875
|
-
const qState =
|
|
1876
|
-
const aState =
|
|
1877
|
-
const posState =
|
|
1878
|
-
const inputRef =
|
|
1981
|
+
const openState = React17.useState(false), open = openState[0], setOpen = openState[1];
|
|
1982
|
+
const qState = React17.useState(null), query = qState[0], setQuery = qState[1];
|
|
1983
|
+
const aState = React17.useState(0), active = aState[0], setActive = aState[1];
|
|
1984
|
+
const posState = React17.useState(null);
|
|
1985
|
+
const inputRef = React17.useRef(null), inputMerged = useMergedRef(ref, inputRef), boxRef = React17.useRef(null), listRef = React17.useRef(null);
|
|
1879
1986
|
const mounted = useMounted();
|
|
1880
1987
|
const limit = props.limit || 200;
|
|
1881
1988
|
const filter = props.filter || defaultFilter;
|
|
@@ -1903,7 +2010,7 @@ var Combobox = React16.forwardRef(
|
|
|
1903
2010
|
},
|
|
1904
2011
|
[open, shown.length, values.length]
|
|
1905
2012
|
);
|
|
1906
|
-
|
|
2013
|
+
React17.useEffect(
|
|
1907
2014
|
function() {
|
|
1908
2015
|
if (!open) return;
|
|
1909
2016
|
function outside(e) {
|
|
@@ -1925,7 +2032,7 @@ var Combobox = React16.forwardRef(
|
|
|
1925
2032
|
},
|
|
1926
2033
|
[open]
|
|
1927
2034
|
);
|
|
1928
|
-
|
|
2035
|
+
React17.useEffect(
|
|
1929
2036
|
function() {
|
|
1930
2037
|
if (!open || !listRef.current) return;
|
|
1931
2038
|
const el = listRef.current.querySelector('[data-idx="' + activeIdx + '"]');
|
|
@@ -1994,19 +2101,19 @@ var Combobox = React16.forwardRef(
|
|
|
1994
2101
|
} else if (!multi && !props.readOnly && props.clearable !== false && value != null && query == null) {
|
|
1995
2102
|
setValue(null);
|
|
1996
2103
|
}
|
|
1997
|
-
} else if (k === "Backspace" && multi && !props.readOnly && !
|
|
2104
|
+
} else if (k === "Backspace" && multi && !props.readOnly && !text2 && values.length) {
|
|
1998
2105
|
setValues(values.slice(0, -1));
|
|
1999
2106
|
} else if (k === "Tab") {
|
|
2000
2107
|
if (open) close();
|
|
2001
2108
|
}
|
|
2002
2109
|
}
|
|
2003
|
-
const
|
|
2110
|
+
const text2 = query != null ? query : selected ? selected.label : "";
|
|
2004
2111
|
const summaryId = id + "-picked";
|
|
2005
2112
|
const optId = function(i) {
|
|
2006
2113
|
return id + "-opt-" + i;
|
|
2007
2114
|
};
|
|
2008
2115
|
const list = open && mounted && posState[0] ? (0, import_react_dom3.createPortal)(
|
|
2009
|
-
/* @__PURE__ */
|
|
2116
|
+
/* @__PURE__ */ React17.createElement("div", { ref: listRef, "data-density": density, className: "aura-combo__popover", style: posState[0] }, live.length ? /* @__PURE__ */ React17.createElement(
|
|
2010
2117
|
"ul",
|
|
2011
2118
|
{
|
|
2012
2119
|
id: listId,
|
|
@@ -2018,7 +2125,7 @@ var Combobox = React16.forwardRef(
|
|
|
2018
2125
|
live.map(function(o, i) {
|
|
2019
2126
|
const isSel = multi ? isPicked(o.value) : !!selected && o.value === selected.value;
|
|
2020
2127
|
const blocked = o.disabled || multi && full && !isSel;
|
|
2021
|
-
return /* @__PURE__ */
|
|
2128
|
+
return /* @__PURE__ */ React17.createElement(
|
|
2022
2129
|
"li",
|
|
2023
2130
|
{
|
|
2024
2131
|
key: o.value,
|
|
@@ -2043,15 +2150,15 @@ var Combobox = React16.forwardRef(
|
|
|
2043
2150
|
if (activeIdx !== i) setActive(i);
|
|
2044
2151
|
}
|
|
2045
2152
|
},
|
|
2046
|
-
o.icon ? /* @__PURE__ */
|
|
2047
|
-
/* @__PURE__ */
|
|
2048
|
-
isSel ? /* @__PURE__ */
|
|
2153
|
+
o.icon ? /* @__PURE__ */ React17.createElement(Icon, { name: o.icon }) : null,
|
|
2154
|
+
/* @__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),
|
|
2155
|
+
isSel ? /* @__PURE__ */ React17.createElement(Icon, { name: "check", className: "aura-combo__check" }) : null
|
|
2049
2156
|
);
|
|
2050
2157
|
})
|
|
2051
|
-
) : null, props.loading || !live.length || more ? /* @__PURE__ */
|
|
2158
|
+
) : 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),
|
|
2052
2159
|
document.body
|
|
2053
2160
|
) : null;
|
|
2054
|
-
return /* @__PURE__ */
|
|
2161
|
+
return /* @__PURE__ */ React17.createElement(
|
|
2055
2162
|
Field,
|
|
2056
2163
|
{
|
|
2057
2164
|
id,
|
|
@@ -2063,8 +2170,8 @@ var Combobox = React16.forwardRef(
|
|
|
2063
2170
|
disabled: props.disabled,
|
|
2064
2171
|
className: props.className
|
|
2065
2172
|
},
|
|
2066
|
-
/* @__PURE__ */
|
|
2067
|
-
return /* @__PURE__ */
|
|
2173
|
+
/* @__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) {
|
|
2174
|
+
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(
|
|
2068
2175
|
"button",
|
|
2069
2176
|
{
|
|
2070
2177
|
type: "button",
|
|
@@ -2083,13 +2190,13 @@ var Combobox = React16.forwardRef(
|
|
|
2083
2190
|
if (inputRef.current) inputRef.current.focus();
|
|
2084
2191
|
}
|
|
2085
2192
|
},
|
|
2086
|
-
/* @__PURE__ */
|
|
2193
|
+
/* @__PURE__ */ React17.createElement(Icon, { name: "x" })
|
|
2087
2194
|
));
|
|
2088
|
-
})) : null, multi ? /* @__PURE__ */
|
|
2195
|
+
})) : null, multi ? /* @__PURE__ */ React17.createElement("span", { id: summaryId, className: "aura-sr-only" }, picked.length ? t.selectedCount(picked.length) + ": " + picked.map(function(o) {
|
|
2089
2196
|
return o.label;
|
|
2090
2197
|
}).join(", ") : "") : null, props.name ? multi ? values.map(function(v) {
|
|
2091
|
-
return /* @__PURE__ */
|
|
2092
|
-
}) : /* @__PURE__ */
|
|
2198
|
+
return /* @__PURE__ */ React17.createElement("input", { key: v, type: "hidden", name: props.name, value: v });
|
|
2199
|
+
}) : /* @__PURE__ */ React17.createElement("input", { type: "hidden", name: props.name, value: value == null ? "" : value }) : null, /* @__PURE__ */ React17.createElement(
|
|
2093
2200
|
"input",
|
|
2094
2201
|
{
|
|
2095
2202
|
ref: inputMerged,
|
|
@@ -2108,7 +2215,7 @@ var Combobox = React16.forwardRef(
|
|
|
2108
2215
|
disabled: props.disabled,
|
|
2109
2216
|
readOnly: props.readOnly,
|
|
2110
2217
|
required: props.required && (!multi || !values.length),
|
|
2111
|
-
value:
|
|
2218
|
+
value: text2,
|
|
2112
2219
|
onChange: function(e) {
|
|
2113
2220
|
setQuery(e.target.value);
|
|
2114
2221
|
setActive(0);
|
|
@@ -2125,7 +2232,7 @@ var Combobox = React16.forwardRef(
|
|
|
2125
2232
|
}, 0);
|
|
2126
2233
|
}
|
|
2127
2234
|
}
|
|
2128
|
-
), props.clearable !== false && values.length && !props.disabled && !props.readOnly ? /* @__PURE__ */
|
|
2235
|
+
), props.clearable !== false && values.length && !props.disabled && !props.readOnly ? /* @__PURE__ */ React17.createElement(
|
|
2129
2236
|
"button",
|
|
2130
2237
|
{
|
|
2131
2238
|
type: "button",
|
|
@@ -2138,8 +2245,8 @@ var Combobox = React16.forwardRef(
|
|
|
2138
2245
|
if (inputRef.current) inputRef.current.focus();
|
|
2139
2246
|
}
|
|
2140
2247
|
},
|
|
2141
|
-
/* @__PURE__ */
|
|
2142
|
-
) : null, /* @__PURE__ */
|
|
2248
|
+
/* @__PURE__ */ React17.createElement(Icon, { name: "x" })
|
|
2249
|
+
) : null, /* @__PURE__ */ React17.createElement(
|
|
2143
2250
|
"button",
|
|
2144
2251
|
{
|
|
2145
2252
|
type: "button",
|
|
@@ -2157,7 +2264,7 @@ var Combobox = React16.forwardRef(
|
|
|
2157
2264
|
}
|
|
2158
2265
|
}
|
|
2159
2266
|
},
|
|
2160
|
-
/* @__PURE__ */
|
|
2267
|
+
/* @__PURE__ */ React17.createElement(Icon, { name: "chevron-down" })
|
|
2161
2268
|
)),
|
|
2162
2269
|
list
|
|
2163
2270
|
);
|
|
@@ -2165,7 +2272,7 @@ var Combobox = React16.forwardRef(
|
|
|
2165
2272
|
);
|
|
2166
2273
|
|
|
2167
2274
|
// src/DatePicker.tsx
|
|
2168
|
-
var
|
|
2275
|
+
var React18 = __toESM(require("react"), 1);
|
|
2169
2276
|
var import_react_dom4 = require("react-dom");
|
|
2170
2277
|
|
|
2171
2278
|
// src/dates.ts
|
|
@@ -2303,8 +2410,8 @@ function monthIndex(word) {
|
|
|
2303
2410
|
const k = word.toLowerCase().replace(/\.$/, "");
|
|
2304
2411
|
return MONTHS[k] != null ? MONTHS[k] : -1;
|
|
2305
2412
|
}
|
|
2306
|
-
function parseDate(
|
|
2307
|
-
const raw = String(
|
|
2413
|
+
function parseDate(text2) {
|
|
2414
|
+
const raw = String(text2 || "").trim();
|
|
2308
2415
|
const gregorian = /ค\.ศ\.|\d\s*(AD|CE)\b|^\s*(AD|CE)\s/i.test(raw);
|
|
2309
2416
|
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();
|
|
2310
2417
|
const eight = /^(\d{2})(\d{2})(\d{4})$/.exec(s);
|
|
@@ -2349,7 +2456,7 @@ function todayIn(timeZone) {
|
|
|
2349
2456
|
// src/DatePicker.tsx
|
|
2350
2457
|
function useFormatDate() {
|
|
2351
2458
|
const ctx = useAuraLocale(), locale = ctx.locale || "en", calendar = ctx.calendar;
|
|
2352
|
-
return
|
|
2459
|
+
return React18.useCallback(
|
|
2353
2460
|
function(iso, opts) {
|
|
2354
2461
|
const o = opts || {}, loc = o.locale || locale;
|
|
2355
2462
|
return formatDate(
|
|
@@ -2370,7 +2477,7 @@ function allowedDate(iso, o) {
|
|
|
2370
2477
|
if (hi && fromISO(hi) && iso > hi) return false;
|
|
2371
2478
|
return !(o.isDateDisabled && o.isDateDisabled(iso));
|
|
2372
2479
|
}
|
|
2373
|
-
var Calendar =
|
|
2480
|
+
var Calendar = React18.forwardRef(function Calendar2(props, ref) {
|
|
2374
2481
|
const ctx = useAuraLocale(), locale = props.locale || ctx.locale || "en", calendar = props.calendar || ctx.calendar || defaultCalendar(locale), tag = localeTag(locale, calendar);
|
|
2375
2482
|
const weekStart = props.weekStartsOn == null ? locale === "sv" ? 1 : 0 : props.weekStartsOn;
|
|
2376
2483
|
const given = props.today && fromISO(props.today) ? props.today : null, zone = props.timeZone || ctx.timeZone;
|
|
@@ -2385,7 +2492,7 @@ var Calendar = React17.forwardRef(function Calendar2(props, ref) {
|
|
|
2385
2492
|
function select(iso) {
|
|
2386
2493
|
if (props.onSelect) props.onSelect(iso);
|
|
2387
2494
|
}
|
|
2388
|
-
const focusState =
|
|
2495
|
+
const focusState = React18.useState(function() {
|
|
2389
2496
|
const d0 = fromISO(props.focus) || start || today;
|
|
2390
2497
|
if (!disabledAt(d0)) return d0;
|
|
2391
2498
|
for (let i = 1; i <= 366; i++) {
|
|
@@ -2395,21 +2502,21 @@ var Calendar = React17.forwardRef(function Calendar2(props, ref) {
|
|
|
2395
2502
|
return d0;
|
|
2396
2503
|
});
|
|
2397
2504
|
const focusDate = focusState[0], setFocus = focusState[1];
|
|
2398
|
-
const viewState =
|
|
2399
|
-
const hoverState =
|
|
2400
|
-
const gridRef =
|
|
2505
|
+
const viewState = React18.useState("days"), view = viewState[0], setView = viewState[1];
|
|
2506
|
+
const hoverState = React18.useState(null);
|
|
2507
|
+
const gridRef = React18.useRef(null), gridMerged = useMergedRef(ref, gridRef), moved = React18.useRef(false);
|
|
2401
2508
|
const th = locale === "th";
|
|
2402
2509
|
const dt = dateText(locale);
|
|
2403
2510
|
function disabled(d) {
|
|
2404
2511
|
return disabledAt(d);
|
|
2405
2512
|
}
|
|
2406
|
-
|
|
2513
|
+
React18.useEffect(function() {
|
|
2407
2514
|
if (!moved.current) return;
|
|
2408
2515
|
moved.current = false;
|
|
2409
2516
|
const el = gridRef.current && gridRef.current.querySelector('[data-date="' + toISO(focusDate) + '"]');
|
|
2410
2517
|
if (el) el.focus();
|
|
2411
2518
|
});
|
|
2412
|
-
|
|
2519
|
+
React18.useEffect(
|
|
2413
2520
|
function() {
|
|
2414
2521
|
if (props.autoFocus === false) return;
|
|
2415
2522
|
const el = gridRef.current && gridRef.current.querySelector('[tabindex="0"]');
|
|
@@ -2464,7 +2571,7 @@ var Calendar = React17.forwardRef(function Calendar2(props, ref) {
|
|
|
2464
2571
|
const yr = focusDate.getFullYear(), base = yr - yr % 12;
|
|
2465
2572
|
const years = [];
|
|
2466
2573
|
for (let y = base; y < base + 12; y++) years.push(y);
|
|
2467
|
-
return /* @__PURE__ */
|
|
2574
|
+
return /* @__PURE__ */ React18.createElement("div", { className: "aura-cal", ref: gridMerged, key: gridKey }, /* @__PURE__ */ React18.createElement("div", { className: "aura-cal__head" }, /* @__PURE__ */ React18.createElement(
|
|
2468
2575
|
IconButton,
|
|
2469
2576
|
{
|
|
2470
2577
|
icon: "chevron-left",
|
|
@@ -2473,7 +2580,7 @@ var Calendar = React17.forwardRef(function Calendar2(props, ref) {
|
|
|
2473
2580
|
setFocus(new Date(yr - 12, focusDate.getMonth(), 1));
|
|
2474
2581
|
}
|
|
2475
2582
|
}
|
|
2476
|
-
), /* @__PURE__ */
|
|
2583
|
+
), /* @__PURE__ */ React18.createElement(
|
|
2477
2584
|
"button",
|
|
2478
2585
|
{
|
|
2479
2586
|
type: "button",
|
|
@@ -2483,7 +2590,7 @@ var Calendar = React17.forwardRef(function Calendar2(props, ref) {
|
|
|
2483
2590
|
}
|
|
2484
2591
|
},
|
|
2485
2592
|
fmt(tag, { year: "numeric" }, new Date(base, 0, 1)).replace(ERA, "") + " \u2013 " + fmt(tag, { year: "numeric" }, new Date(base + 11, 0, 1)).replace(ERA, "")
|
|
2486
|
-
), /* @__PURE__ */
|
|
2593
|
+
), /* @__PURE__ */ React18.createElement(
|
|
2487
2594
|
IconButton,
|
|
2488
2595
|
{
|
|
2489
2596
|
icon: "chevron-right",
|
|
@@ -2492,9 +2599,9 @@ var Calendar = React17.forwardRef(function Calendar2(props, ref) {
|
|
|
2492
2599
|
setFocus(new Date(yr + 12, focusDate.getMonth(), 1));
|
|
2493
2600
|
}
|
|
2494
2601
|
}
|
|
2495
|
-
)), /* @__PURE__ */
|
|
2602
|
+
)), /* @__PURE__ */ React18.createElement("div", { className: "aura-cal__years" }, years.map(function(y) {
|
|
2496
2603
|
const d = new Date(y, focusDate.getMonth(), 1);
|
|
2497
|
-
return /* @__PURE__ */
|
|
2604
|
+
return /* @__PURE__ */ React18.createElement(
|
|
2498
2605
|
"button",
|
|
2499
2606
|
{
|
|
2500
2607
|
key: y,
|
|
@@ -2511,7 +2618,7 @@ var Calendar = React17.forwardRef(function Calendar2(props, ref) {
|
|
|
2511
2618
|
);
|
|
2512
2619
|
})));
|
|
2513
2620
|
}
|
|
2514
|
-
return /* @__PURE__ */
|
|
2621
|
+
return /* @__PURE__ */ React18.createElement("div", { className: "aura-cal", ref: gridMerged, key: gridKey }, /* @__PURE__ */ React18.createElement("div", { className: "aura-cal__head" }, /* @__PURE__ */ React18.createElement(
|
|
2515
2622
|
IconButton,
|
|
2516
2623
|
{
|
|
2517
2624
|
icon: "chevron-left",
|
|
@@ -2520,7 +2627,7 @@ var Calendar = React17.forwardRef(function Calendar2(props, ref) {
|
|
|
2520
2627
|
setFocus(addMonths(focusDate, -1));
|
|
2521
2628
|
}
|
|
2522
2629
|
}
|
|
2523
|
-
), /* @__PURE__ */
|
|
2630
|
+
), /* @__PURE__ */ React18.createElement(
|
|
2524
2631
|
"button",
|
|
2525
2632
|
{
|
|
2526
2633
|
type: "button",
|
|
@@ -2531,8 +2638,8 @@ var Calendar = React17.forwardRef(function Calendar2(props, ref) {
|
|
|
2531
2638
|
}
|
|
2532
2639
|
},
|
|
2533
2640
|
monthTitle,
|
|
2534
|
-
/* @__PURE__ */
|
|
2535
|
-
), /* @__PURE__ */
|
|
2641
|
+
/* @__PURE__ */ React18.createElement(Icon, { name: "chevron-down", size: 14 })
|
|
2642
|
+
), /* @__PURE__ */ React18.createElement(
|
|
2536
2643
|
IconButton,
|
|
2537
2644
|
{
|
|
2538
2645
|
icon: "chevron-right",
|
|
@@ -2541,9 +2648,9 @@ var Calendar = React17.forwardRef(function Calendar2(props, ref) {
|
|
|
2541
2648
|
setFocus(addMonths(focusDate, 1));
|
|
2542
2649
|
}
|
|
2543
2650
|
}
|
|
2544
|
-
)), /* @__PURE__ */
|
|
2545
|
-
return /* @__PURE__ */
|
|
2546
|
-
}))), /* @__PURE__ */
|
|
2651
|
+
)), /* @__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) {
|
|
2652
|
+
return /* @__PURE__ */ React18.createElement("th", { key: i, scope: "col", abbr: n2.long }, /* @__PURE__ */ React18.createElement("span", { "aria-hidden": true }, n2.short));
|
|
2653
|
+
}))), /* @__PURE__ */ React18.createElement(
|
|
2547
2654
|
"tbody",
|
|
2548
2655
|
{
|
|
2549
2656
|
onMouseLeave: function() {
|
|
@@ -2551,11 +2658,11 @@ var Calendar = React17.forwardRef(function Calendar2(props, ref) {
|
|
|
2551
2658
|
}
|
|
2552
2659
|
},
|
|
2553
2660
|
weeks.map(function(wk, wi) {
|
|
2554
|
-
return /* @__PURE__ */
|
|
2661
|
+
return /* @__PURE__ */ React18.createElement("tr", { key: wi }, wk.map(function(d) {
|
|
2555
2662
|
const iso = toISO(d), out = d.getMonth() !== focusDate.getMonth(), dis = disabled(d);
|
|
2556
2663
|
const isStart = same(d, start), isEnd = same(d, end) || !end && props.range && same(d, hover) && start;
|
|
2557
2664
|
const sel = isStart || same(d, end);
|
|
2558
|
-
return /* @__PURE__ */
|
|
2665
|
+
return /* @__PURE__ */ React18.createElement(
|
|
2559
2666
|
"td",
|
|
2560
2667
|
{
|
|
2561
2668
|
key: iso,
|
|
@@ -2567,7 +2674,7 @@ var Calendar = React17.forwardRef(function Calendar2(props, ref) {
|
|
|
2567
2674
|
props.range && isEnd && start && "is-range-end"
|
|
2568
2675
|
)
|
|
2569
2676
|
},
|
|
2570
|
-
/* @__PURE__ */
|
|
2677
|
+
/* @__PURE__ */ React18.createElement(
|
|
2571
2678
|
"button",
|
|
2572
2679
|
{
|
|
2573
2680
|
type: "button",
|
|
@@ -2600,7 +2707,7 @@ var Calendar = React17.forwardRef(function Calendar2(props, ref) {
|
|
|
2600
2707
|
);
|
|
2601
2708
|
}));
|
|
2602
2709
|
})
|
|
2603
|
-
)), props.footer === false ? null : /* @__PURE__ */
|
|
2710
|
+
)), props.footer === false ? null : /* @__PURE__ */ React18.createElement("div", { className: "aura-cal__foot" }, /* @__PURE__ */ React18.createElement(
|
|
2604
2711
|
"button",
|
|
2605
2712
|
{
|
|
2606
2713
|
type: "button",
|
|
@@ -2612,11 +2719,11 @@ var Calendar = React17.forwardRef(function Calendar2(props, ref) {
|
|
|
2612
2719
|
}
|
|
2613
2720
|
},
|
|
2614
2721
|
dt.today
|
|
2615
|
-
), props.onClear ? /* @__PURE__ */
|
|
2722
|
+
), props.onClear ? /* @__PURE__ */ React18.createElement("button", { type: "button", className: "aura-cal__link", onClick: props.onClear }, dt.clear) : null));
|
|
2616
2723
|
});
|
|
2617
2724
|
function useCalendarPopover(boxRef) {
|
|
2618
|
-
const openState =
|
|
2619
|
-
const pos =
|
|
2725
|
+
const openState = React18.useState(false), open = openState[0], setOpen = openState[1];
|
|
2726
|
+
const pos = React18.useState(null), popRef = React18.useRef(null), mounted = useMounted();
|
|
2620
2727
|
function place() {
|
|
2621
2728
|
if (!boxRef.current) return;
|
|
2622
2729
|
const el = popRef.current, r = boxRef.current.getBoundingClientRect(), W = el ? el.offsetWidth : 320, H = el ? el.offsetHeight : 380;
|
|
@@ -2630,7 +2737,7 @@ function useCalendarPopover(boxRef) {
|
|
|
2630
2737
|
},
|
|
2631
2738
|
[open, !!pos[0]]
|
|
2632
2739
|
);
|
|
2633
|
-
|
|
2740
|
+
React18.useEffect(
|
|
2634
2741
|
function() {
|
|
2635
2742
|
if (!open) return;
|
|
2636
2743
|
function outside(e) {
|
|
@@ -2652,8 +2759,8 @@ function useCalendarPopover(boxRef) {
|
|
|
2652
2759
|
return { open, setOpen, pos: pos[0], popRef, mounted };
|
|
2653
2760
|
}
|
|
2654
2761
|
function DateField(props) {
|
|
2655
|
-
const editState =
|
|
2656
|
-
return /* @__PURE__ */
|
|
2762
|
+
const editState = React18.useState(null), editing = editState[0], setEditing = editState[1];
|
|
2763
|
+
return /* @__PURE__ */ React18.createElement(
|
|
2657
2764
|
Field,
|
|
2658
2765
|
{
|
|
2659
2766
|
id: props.id,
|
|
@@ -2665,7 +2772,7 @@ function DateField(props) {
|
|
|
2665
2772
|
disabled: props.disabled,
|
|
2666
2773
|
className: props.className
|
|
2667
2774
|
},
|
|
2668
|
-
/* @__PURE__ */
|
|
2775
|
+
/* @__PURE__ */ React18.createElement("div", { ref: props.boxRef, className: cx("aura-input aura-date", props.open && "is-open") }, /* @__PURE__ */ React18.createElement(
|
|
2669
2776
|
"input",
|
|
2670
2777
|
{
|
|
2671
2778
|
ref: props.inputRef,
|
|
@@ -2704,7 +2811,7 @@ function DateField(props) {
|
|
|
2704
2811
|
}
|
|
2705
2812
|
}
|
|
2706
2813
|
}
|
|
2707
|
-
), props.clearable !== false && props.hasValue && !props.disabled ? /* @__PURE__ */
|
|
2814
|
+
), props.clearable !== false && props.hasValue && !props.disabled ? /* @__PURE__ */ React18.createElement(
|
|
2708
2815
|
"button",
|
|
2709
2816
|
{
|
|
2710
2817
|
type: "button",
|
|
@@ -2713,8 +2820,8 @@ function DateField(props) {
|
|
|
2713
2820
|
"aria-label": props.clearLabel,
|
|
2714
2821
|
onClick: props.onClear
|
|
2715
2822
|
},
|
|
2716
|
-
/* @__PURE__ */
|
|
2717
|
-
) : null, /* @__PURE__ */
|
|
2823
|
+
/* @__PURE__ */ React18.createElement(Icon, { name: "x" })
|
|
2824
|
+
) : null, /* @__PURE__ */ React18.createElement(
|
|
2718
2825
|
"button",
|
|
2719
2826
|
{
|
|
2720
2827
|
type: "button",
|
|
@@ -2728,11 +2835,11 @@ function DateField(props) {
|
|
|
2728
2835
|
props.onToggle(!props.open);
|
|
2729
2836
|
}
|
|
2730
2837
|
},
|
|
2731
|
-
/* @__PURE__ */
|
|
2838
|
+
/* @__PURE__ */ React18.createElement(Icon, { name: "calendar" })
|
|
2732
2839
|
))
|
|
2733
2840
|
);
|
|
2734
2841
|
}
|
|
2735
|
-
var DatePicker =
|
|
2842
|
+
var DatePicker = React18.forwardRef(function DatePicker2(props, ref) {
|
|
2736
2843
|
const auto = uid(), id = props.id || auto, dialogId = id + "-cal";
|
|
2737
2844
|
const ctx = useAuraLocale(), locale = props.locale || ctx.locale || "en", calendar = props.calendar || ctx.calendar || defaultCalendar(locale), dt = dateText(locale);
|
|
2738
2845
|
const st = useMaybeControlled(
|
|
@@ -2740,7 +2847,7 @@ var DatePicker = React17.forwardRef(function DatePicker2(props, ref) {
|
|
|
2740
2847
|
props.defaultValue == null ? null : props.defaultValue,
|
|
2741
2848
|
props.onChange
|
|
2742
2849
|
);
|
|
2743
|
-
const boxRef =
|
|
2850
|
+
const boxRef = React18.useRef(null), inputRef = React18.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
2744
2851
|
const pop = useCalendarPopover(boxRef);
|
|
2745
2852
|
const limits = {
|
|
2746
2853
|
min: props.min,
|
|
@@ -2749,20 +2856,20 @@ var DatePicker = React17.forwardRef(function DatePicker2(props, ref) {
|
|
|
2749
2856
|
timeZone: props.timeZone || ctx.timeZone,
|
|
2750
2857
|
isDateDisabled: props.isDateDisabled
|
|
2751
2858
|
};
|
|
2752
|
-
const bad =
|
|
2753
|
-
|
|
2859
|
+
const bad = React18.useState(null);
|
|
2860
|
+
React18.useEffect(
|
|
2754
2861
|
function() {
|
|
2755
2862
|
bad[1](null);
|
|
2756
2863
|
},
|
|
2757
2864
|
[st[0]]
|
|
2758
2865
|
);
|
|
2759
|
-
function commit(
|
|
2866
|
+
function commit(text2) {
|
|
2760
2867
|
bad[1](null);
|
|
2761
|
-
if (!
|
|
2868
|
+
if (!text2.trim()) {
|
|
2762
2869
|
st[1](null);
|
|
2763
2870
|
return;
|
|
2764
2871
|
}
|
|
2765
|
-
const iso = parseDate(
|
|
2872
|
+
const iso = parseDate(text2);
|
|
2766
2873
|
if (!iso) return;
|
|
2767
2874
|
if (allowedDate(iso, limits)) st[1](iso);
|
|
2768
2875
|
else bad[1](dt.dateUnavailable);
|
|
@@ -2772,7 +2879,7 @@ var DatePicker = React17.forwardRef(function DatePicker2(props, ref) {
|
|
|
2772
2879
|
if (inputRef.current) inputRef.current.focus();
|
|
2773
2880
|
}
|
|
2774
2881
|
const cal = pop.open && pop.mounted && pop.pos ? (0, import_react_dom4.createPortal)(
|
|
2775
|
-
/* @__PURE__ */
|
|
2882
|
+
/* @__PURE__ */ React18.createElement(
|
|
2776
2883
|
"div",
|
|
2777
2884
|
{
|
|
2778
2885
|
ref: pop.popRef,
|
|
@@ -2789,7 +2896,7 @@ var DatePicker = React17.forwardRef(function DatePicker2(props, ref) {
|
|
|
2789
2896
|
} else trapTab(e, pop.popRef.current);
|
|
2790
2897
|
}
|
|
2791
2898
|
},
|
|
2792
|
-
/* @__PURE__ */
|
|
2899
|
+
/* @__PURE__ */ React18.createElement(
|
|
2793
2900
|
Calendar,
|
|
2794
2901
|
{
|
|
2795
2902
|
locale,
|
|
@@ -2812,7 +2919,7 @@ var DatePicker = React17.forwardRef(function DatePicker2(props, ref) {
|
|
|
2812
2919
|
),
|
|
2813
2920
|
document.body
|
|
2814
2921
|
) : null;
|
|
2815
|
-
return /* @__PURE__ */
|
|
2922
|
+
return /* @__PURE__ */ React18.createElement(React18.Fragment, null, /* @__PURE__ */ React18.createElement(
|
|
2816
2923
|
DateField,
|
|
2817
2924
|
{
|
|
2818
2925
|
id,
|
|
@@ -2847,7 +2954,7 @@ var DatePicker = React17.forwardRef(function DatePicker2(props, ref) {
|
|
|
2847
2954
|
}
|
|
2848
2955
|
), cal);
|
|
2849
2956
|
});
|
|
2850
|
-
var DateRangePicker =
|
|
2957
|
+
var DateRangePicker = React18.forwardRef(
|
|
2851
2958
|
function DateRangePicker2(props, ref) {
|
|
2852
2959
|
const auto = uid(), id = props.id || auto, dialogId = id + "-cal";
|
|
2853
2960
|
const ctx = useAuraLocale(), locale = props.locale || ctx.locale || "en", calendar = props.calendar || ctx.calendar || defaultCalendar(locale), dt = dateText(locale);
|
|
@@ -2857,8 +2964,8 @@ var DateRangePicker = React17.forwardRef(
|
|
|
2857
2964
|
props.onChange
|
|
2858
2965
|
);
|
|
2859
2966
|
const v = st[0] || { start: null, end: null };
|
|
2860
|
-
const draft =
|
|
2861
|
-
const boxRef =
|
|
2967
|
+
const draft = React18.useState(null);
|
|
2968
|
+
const boxRef = React18.useRef(null), inputRef = React18.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
2862
2969
|
const pop = useCalendarPopover(boxRef);
|
|
2863
2970
|
const limits = {
|
|
2864
2971
|
min: props.min,
|
|
@@ -2873,17 +2980,17 @@ var DateRangePicker = React17.forwardRef(
|
|
|
2873
2980
|
if (!r.end) return formatDate(r.start, o) + " \u2013";
|
|
2874
2981
|
return formatDate(r.start, o) + " \u2013 " + formatDate(r.end, o);
|
|
2875
2982
|
}
|
|
2876
|
-
const bad =
|
|
2877
|
-
|
|
2983
|
+
const bad = React18.useState(null);
|
|
2984
|
+
React18.useEffect(
|
|
2878
2985
|
function() {
|
|
2879
2986
|
bad[1](null);
|
|
2880
2987
|
},
|
|
2881
2988
|
[v.start, v.end]
|
|
2882
2989
|
);
|
|
2883
|
-
function commit(
|
|
2990
|
+
function commit(text2) {
|
|
2884
2991
|
bad[1](null);
|
|
2885
|
-
const parts = String(
|
|
2886
|
-
if (!
|
|
2992
|
+
const parts = String(text2).split(/\s[–-]\s|\s*–\s*/);
|
|
2993
|
+
if (!text2.trim()) {
|
|
2887
2994
|
st[1]({ start: null, end: null });
|
|
2888
2995
|
return;
|
|
2889
2996
|
}
|
|
@@ -2907,7 +3014,7 @@ var DateRangePicker = React17.forwardRef(
|
|
|
2907
3014
|
close();
|
|
2908
3015
|
}
|
|
2909
3016
|
const cal = pop.open && pop.mounted && pop.pos ? (0, import_react_dom4.createPortal)(
|
|
2910
|
-
/* @__PURE__ */
|
|
3017
|
+
/* @__PURE__ */ React18.createElement(
|
|
2911
3018
|
"div",
|
|
2912
3019
|
{
|
|
2913
3020
|
ref: pop.popRef,
|
|
@@ -2924,8 +3031,8 @@ var DateRangePicker = React17.forwardRef(
|
|
|
2924
3031
|
} else trapTab(e, pop.popRef.current);
|
|
2925
3032
|
}
|
|
2926
3033
|
},
|
|
2927
|
-
/* @__PURE__ */
|
|
2928
|
-
/* @__PURE__ */
|
|
3034
|
+
/* @__PURE__ */ React18.createElement("p", { className: "aura-cal__hint", "aria-live": "polite" }, draft[0] ? dt.chooseEnd : dt.chooseStart),
|
|
3035
|
+
/* @__PURE__ */ React18.createElement(
|
|
2929
3036
|
Calendar,
|
|
2930
3037
|
{
|
|
2931
3038
|
range: true,
|
|
@@ -2946,7 +3053,7 @@ var DateRangePicker = React17.forwardRef(
|
|
|
2946
3053
|
),
|
|
2947
3054
|
document.body
|
|
2948
3055
|
) : null;
|
|
2949
|
-
return /* @__PURE__ */
|
|
3056
|
+
return /* @__PURE__ */ React18.createElement(React18.Fragment, null, /* @__PURE__ */ React18.createElement(
|
|
2950
3057
|
DateField,
|
|
2951
3058
|
{
|
|
2952
3059
|
id,
|
|
@@ -2985,31 +3092,18 @@ var DateRangePicker = React17.forwardRef(
|
|
|
2985
3092
|
);
|
|
2986
3093
|
|
|
2987
3094
|
// src/Alert.tsx
|
|
2988
|
-
var
|
|
2989
|
-
var
|
|
2990
|
-
info: "info",
|
|
2991
|
-
success: "circle-check",
|
|
2992
|
-
warning: "triangle-alert",
|
|
2993
|
-
danger: "circle-alert"
|
|
2994
|
-
};
|
|
2995
|
-
var Alert = React18.forwardRef(function Alert2(props, ref) {
|
|
3095
|
+
var React19 = __toESM(require("react"), 1);
|
|
3096
|
+
var Alert = React19.forwardRef(function Alert2(props, ref) {
|
|
2996
3097
|
const t = useStrings();
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
{
|
|
3001
|
-
ref,
|
|
3002
|
-
className: cx("aura-alert", "aura-alert--" + tone2, props.className),
|
|
3003
|
-
role: tone2 === "danger" || tone2 === "warning" ? "alert" : "status"
|
|
3004
|
-
},
|
|
3005
|
-
/* @__PURE__ */ React18.createElement(Icon, { name: ALERT_ICON[tone2], className: "aura-alert__icon" }),
|
|
3006
|
-
/* @__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),
|
|
3007
|
-
props.onDismiss ? /* @__PURE__ */ React18.createElement(IconButton, { icon: "x", label: t.dismiss, className: "aura-alert__close", onClick: props.onDismiss }) : null
|
|
3098
|
+
return alertElement(
|
|
3099
|
+
props,
|
|
3100
|
+
ref,
|
|
3101
|
+
props.onDismiss ? /* @__PURE__ */ React19.createElement(IconButton, { icon: "x", label: t.dismiss, className: "aura-alert__close", onClick: props.onDismiss }) : null
|
|
3008
3102
|
);
|
|
3009
3103
|
});
|
|
3010
3104
|
|
|
3011
3105
|
// src/Toaster.tsx
|
|
3012
|
-
var
|
|
3106
|
+
var React20 = __toESM(require("react"), 1);
|
|
3013
3107
|
var import_react_dom5 = require("react-dom");
|
|
3014
3108
|
var MAX_VISIBLE = 3;
|
|
3015
3109
|
var toastState = {
|
|
@@ -3085,8 +3179,8 @@ function outsideToaster(el) {
|
|
|
3085
3179
|
function ToastItem(props) {
|
|
3086
3180
|
const str = useStrings();
|
|
3087
3181
|
const Link = useLinkComponent();
|
|
3088
|
-
const node =
|
|
3089
|
-
const origin =
|
|
3182
|
+
const node = React20.useRef(null);
|
|
3183
|
+
const origin = React20.useRef(null);
|
|
3090
3184
|
useIsoLayoutEffect(function() {
|
|
3091
3185
|
origin.current = outsideToaster(document.activeElement);
|
|
3092
3186
|
const el = node.current;
|
|
@@ -3102,8 +3196,8 @@ function ToastItem(props) {
|
|
|
3102
3196
|
}, 0);
|
|
3103
3197
|
};
|
|
3104
3198
|
}, []);
|
|
3105
|
-
const t = props.toast, timer =
|
|
3106
|
-
const hover =
|
|
3199
|
+
const t = props.toast, timer = React20.useRef(null), left = React20.useRef(t.duration || 5e3), since = React20.useRef(0);
|
|
3200
|
+
const hover = React20.useRef(false), focused = React20.useRef(false);
|
|
3107
3201
|
function syncFocus() {
|
|
3108
3202
|
if (focused.current && !(node.current && node.current.contains(document.activeElement))) focused.current = false;
|
|
3109
3203
|
}
|
|
@@ -3125,7 +3219,7 @@ function ToastItem(props) {
|
|
|
3125
3219
|
left.current -= Date.now() - since.current;
|
|
3126
3220
|
}
|
|
3127
3221
|
}
|
|
3128
|
-
|
|
3222
|
+
React20.useEffect(
|
|
3129
3223
|
function() {
|
|
3130
3224
|
if (timer.current) clearTimeout(timer.current);
|
|
3131
3225
|
timer.current = null;
|
|
@@ -3144,7 +3238,7 @@ function ToastItem(props) {
|
|
|
3144
3238
|
if (a.onClick) a.onClick();
|
|
3145
3239
|
if (a.dismiss !== false) toast.dismiss(t.id);
|
|
3146
3240
|
}
|
|
3147
|
-
return /* @__PURE__ */
|
|
3241
|
+
return /* @__PURE__ */ React20.createElement(
|
|
3148
3242
|
"div",
|
|
3149
3243
|
{
|
|
3150
3244
|
ref: node,
|
|
@@ -3181,16 +3275,16 @@ function ToastItem(props) {
|
|
|
3181
3275
|
resume();
|
|
3182
3276
|
}
|
|
3183
3277
|
},
|
|
3184
|
-
/* @__PURE__ */
|
|
3278
|
+
/* @__PURE__ */ React20.createElement(
|
|
3185
3279
|
Icon,
|
|
3186
3280
|
{
|
|
3187
3281
|
name: t.loading ? "loader-circle" : ALERT_ICON[t.tone] || "info",
|
|
3188
3282
|
className: cx("aura-toast__icon", t.loading && "aura-spin")
|
|
3189
3283
|
}
|
|
3190
3284
|
),
|
|
3191
|
-
/* @__PURE__ */
|
|
3192
|
-
actions.length ? /* @__PURE__ */
|
|
3193
|
-
return a.href ? /* @__PURE__ */
|
|
3285
|
+
/* @__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),
|
|
3286
|
+
actions.length ? /* @__PURE__ */ React20.createElement("div", { className: "aura-toast__actions" }, actions.map(function(a, i) {
|
|
3287
|
+
return a.href ? /* @__PURE__ */ React20.createElement(
|
|
3194
3288
|
Link,
|
|
3195
3289
|
{
|
|
3196
3290
|
key: i,
|
|
@@ -3202,7 +3296,7 @@ function ToastItem(props) {
|
|
|
3202
3296
|
}
|
|
3203
3297
|
},
|
|
3204
3298
|
a.label
|
|
3205
|
-
) : /* @__PURE__ */
|
|
3299
|
+
) : /* @__PURE__ */ React20.createElement(
|
|
3206
3300
|
"button",
|
|
3207
3301
|
{
|
|
3208
3302
|
key: i,
|
|
@@ -3215,7 +3309,7 @@ function ToastItem(props) {
|
|
|
3215
3309
|
a.label
|
|
3216
3310
|
);
|
|
3217
3311
|
})) : null,
|
|
3218
|
-
/* @__PURE__ */
|
|
3312
|
+
/* @__PURE__ */ React20.createElement(
|
|
3219
3313
|
IconButton,
|
|
3220
3314
|
{
|
|
3221
3315
|
icon: "x",
|
|
@@ -3246,8 +3340,8 @@ function hotkeyMatcher(spec) {
|
|
|
3246
3340
|
function Toaster(props = {}) {
|
|
3247
3341
|
const t = useStrings();
|
|
3248
3342
|
const mounted = useMounted();
|
|
3249
|
-
const s =
|
|
3250
|
-
|
|
3343
|
+
const s = React20.useState(toastState.list);
|
|
3344
|
+
React20.useEffect(function() {
|
|
3251
3345
|
toastState.subs.push(s[1]);
|
|
3252
3346
|
s[1](toastState.list.slice());
|
|
3253
3347
|
return function() {
|
|
@@ -3256,9 +3350,9 @@ function Toaster(props = {}) {
|
|
|
3256
3350
|
});
|
|
3257
3351
|
};
|
|
3258
3352
|
}, []);
|
|
3259
|
-
const region =
|
|
3353
|
+
const region = React20.useRef(null);
|
|
3260
3354
|
const hotkey = props.hotkey === void 0 ? "Alt+T" : props.hotkey;
|
|
3261
|
-
|
|
3355
|
+
React20.useEffect(
|
|
3262
3356
|
function() {
|
|
3263
3357
|
if (!hotkey) return;
|
|
3264
3358
|
const match = hotkeyMatcher(hotkey);
|
|
@@ -3289,7 +3383,7 @@ function Toaster(props = {}) {
|
|
|
3289
3383
|
const pos = props.position || "bottom";
|
|
3290
3384
|
const offset = props.offset;
|
|
3291
3385
|
return (0, import_react_dom5.createPortal)(
|
|
3292
|
-
/* @__PURE__ */
|
|
3386
|
+
/* @__PURE__ */ React20.createElement(
|
|
3293
3387
|
"div",
|
|
3294
3388
|
{
|
|
3295
3389
|
ref: region,
|
|
@@ -3301,7 +3395,7 @@ function Toaster(props = {}) {
|
|
|
3301
3395
|
"aria-keyshortcuts": hotkey || void 0
|
|
3302
3396
|
},
|
|
3303
3397
|
s[0].map(function(t2) {
|
|
3304
|
-
return /* @__PURE__ */
|
|
3398
|
+
return /* @__PURE__ */ React20.createElement(ToastItem, { key: t2.id, toast: t2 });
|
|
3305
3399
|
})
|
|
3306
3400
|
),
|
|
3307
3401
|
document.body
|
|
@@ -3309,12 +3403,12 @@ function Toaster(props = {}) {
|
|
|
3309
3403
|
}
|
|
3310
3404
|
|
|
3311
3405
|
// src/PasswordField.tsx
|
|
3312
|
-
var
|
|
3313
|
-
var PasswordField =
|
|
3406
|
+
var React21 = __toESM(require("react"), 1);
|
|
3407
|
+
var PasswordField = React21.forwardRef(function PasswordField2(props, ref) {
|
|
3314
3408
|
const t = useStrings();
|
|
3315
|
-
const shown =
|
|
3409
|
+
const shown = React21.useState(false);
|
|
3316
3410
|
const rest = omit(props, ["toggle", "className"]);
|
|
3317
|
-
return /* @__PURE__ */
|
|
3411
|
+
return /* @__PURE__ */ React21.createElement(
|
|
3318
3412
|
TextField,
|
|
3319
3413
|
{
|
|
3320
3414
|
autoComplete: "current-password",
|
|
@@ -3324,7 +3418,7 @@ var PasswordField = React20.forwardRef(function PasswordField2(props, ref) {
|
|
|
3324
3418
|
spellCheck: false,
|
|
3325
3419
|
autoCapitalize: "none",
|
|
3326
3420
|
className: cx("aura-password", props.className),
|
|
3327
|
-
suffix: props.toggle === false ? void 0 : /* @__PURE__ */
|
|
3421
|
+
suffix: props.toggle === false ? void 0 : /* @__PURE__ */ React21.createElement(
|
|
3328
3422
|
IconButton,
|
|
3329
3423
|
{
|
|
3330
3424
|
icon: shown[0] ? "eye-off" : "eye",
|
|
@@ -3341,7 +3435,7 @@ var PasswordField = React20.forwardRef(function PasswordField2(props, ref) {
|
|
|
3341
3435
|
});
|
|
3342
3436
|
|
|
3343
3437
|
// src/FormErrorSummary.tsx
|
|
3344
|
-
var
|
|
3438
|
+
var React22 = __toESM(require("react"), 1);
|
|
3345
3439
|
function items(errors) {
|
|
3346
3440
|
if (Array.isArray(errors)) return errors;
|
|
3347
3441
|
const out = [];
|
|
@@ -3370,23 +3464,59 @@ function fieldElement(field) {
|
|
|
3370
3464
|
}
|
|
3371
3465
|
return named;
|
|
3372
3466
|
}
|
|
3373
|
-
var FormErrorSummary =
|
|
3467
|
+
var FormErrorSummary = React22.forwardRef(
|
|
3374
3468
|
function FormErrorSummary2(props, ref) {
|
|
3375
3469
|
const t = useStrings();
|
|
3376
3470
|
const auto = uid(), id = props.id || auto;
|
|
3377
3471
|
const list = items(props.errors);
|
|
3378
|
-
const box =
|
|
3379
|
-
|
|
3472
|
+
const box = React22.useRef(null);
|
|
3473
|
+
const keyed = props.focusKey !== void 0;
|
|
3474
|
+
const lastKey = React22.useRef(null), armed = React22.useRef(false), hadErrors = React22.useRef(false);
|
|
3475
|
+
const has = list.length > 0;
|
|
3476
|
+
React22.useEffect(
|
|
3380
3477
|
function() {
|
|
3381
|
-
const
|
|
3382
|
-
|
|
3478
|
+
const appeared = has && !hadErrors.current;
|
|
3479
|
+
hadErrors.current = has;
|
|
3480
|
+
if (!keyed) {
|
|
3481
|
+
lastKey.current = null;
|
|
3482
|
+
if (appeared && box.current) box.current.focus();
|
|
3483
|
+
return;
|
|
3484
|
+
}
|
|
3485
|
+
if (!lastKey.current) {
|
|
3486
|
+
lastKey.current = { v: props.focusKey };
|
|
3487
|
+
armed.current = has;
|
|
3488
|
+
} else if (!Object.is(lastKey.current.v, props.focusKey)) {
|
|
3489
|
+
lastKey.current = { v: props.focusKey };
|
|
3490
|
+
armed.current = true;
|
|
3491
|
+
}
|
|
3492
|
+
if (armed.current && has && box.current) {
|
|
3493
|
+
armed.current = false;
|
|
3494
|
+
box.current.focus();
|
|
3495
|
+
}
|
|
3383
3496
|
},
|
|
3384
|
-
/* focus when errors first appear, and again whenever focusKey changes (each submit) */
|
|
3385
3497
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3386
|
-
[
|
|
3498
|
+
[has, props.focusKey, keyed]
|
|
3499
|
+
);
|
|
3500
|
+
React22.useEffect(
|
|
3501
|
+
function() {
|
|
3502
|
+
if (!keyed) return;
|
|
3503
|
+
function disarm() {
|
|
3504
|
+
armed.current = false;
|
|
3505
|
+
}
|
|
3506
|
+
const events = ["input", "change", "keydown", "pointerdown"];
|
|
3507
|
+
events.forEach(function(n2) {
|
|
3508
|
+
document.addEventListener(n2, disarm, true);
|
|
3509
|
+
});
|
|
3510
|
+
return function() {
|
|
3511
|
+
events.forEach(function(n2) {
|
|
3512
|
+
document.removeEventListener(n2, disarm, true);
|
|
3513
|
+
});
|
|
3514
|
+
};
|
|
3515
|
+
},
|
|
3516
|
+
[keyed]
|
|
3387
3517
|
);
|
|
3388
3518
|
if (!list.length) return null;
|
|
3389
|
-
return /* @__PURE__ */
|
|
3519
|
+
return /* @__PURE__ */ React22.createElement(
|
|
3390
3520
|
"div",
|
|
3391
3521
|
{
|
|
3392
3522
|
ref: function(el) {
|
|
@@ -3400,9 +3530,9 @@ var FormErrorSummary = React21.forwardRef(
|
|
|
3400
3530
|
"aria-labelledby": id + "-title",
|
|
3401
3531
|
className: cx("aura-alert aura-alert--danger aura-error-summary", props.className)
|
|
3402
3532
|
},
|
|
3403
|
-
/* @__PURE__ */
|
|
3404
|
-
/* @__PURE__ */
|
|
3405
|
-
return /* @__PURE__ */
|
|
3533
|
+
/* @__PURE__ */ React22.createElement(Icon, { name: "circle-alert", className: "aura-alert__icon" }),
|
|
3534
|
+
/* @__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) {
|
|
3535
|
+
return /* @__PURE__ */ React22.createElement("li", { key: e.field }, /* @__PURE__ */ React22.createElement(
|
|
3406
3536
|
"a",
|
|
3407
3537
|
{
|
|
3408
3538
|
href: "#" + e.field,
|
|
@@ -3427,20 +3557,20 @@ var FormErrorSummary = React21.forwardRef(
|
|
|
3427
3557
|
);
|
|
3428
3558
|
|
|
3429
3559
|
// src/FilterBar.tsx
|
|
3430
|
-
var
|
|
3560
|
+
var React24 = __toESM(require("react"), 1);
|
|
3431
3561
|
|
|
3432
3562
|
// src/Tag.tsx
|
|
3433
|
-
var
|
|
3434
|
-
var Tag =
|
|
3563
|
+
var React23 = __toESM(require("react"), 1);
|
|
3564
|
+
var Tag = React23.forwardRef(function Tag2(props, ref) {
|
|
3435
3565
|
const t = useStrings();
|
|
3436
3566
|
const selectable = props.onClick != null || props.selected != null;
|
|
3437
3567
|
const rest = omit(props, ["onRemove", "selected", "icon", "className", "children", "disabled", "removeLabel"]);
|
|
3438
3568
|
const inner = [
|
|
3439
|
-
props.icon ? /* @__PURE__ */
|
|
3440
|
-
/* @__PURE__ */
|
|
3569
|
+
props.icon ? /* @__PURE__ */ React23.createElement(Icon, { key: "i", name: props.icon, size: 14 }) : null,
|
|
3570
|
+
/* @__PURE__ */ React23.createElement("span", { key: "t", className: "aura-tag__text" }, props.children)
|
|
3441
3571
|
];
|
|
3442
3572
|
if (selectable) {
|
|
3443
|
-
return /* @__PURE__ */
|
|
3573
|
+
return /* @__PURE__ */ React23.createElement(
|
|
3444
3574
|
"button",
|
|
3445
3575
|
{
|
|
3446
3576
|
...rest,
|
|
@@ -3450,11 +3580,11 @@ var Tag = React22.forwardRef(function Tag2(props, ref) {
|
|
|
3450
3580
|
disabled: props.disabled,
|
|
3451
3581
|
className: cx("aura-tag is-selectable", props.selected && "is-selected", props.className)
|
|
3452
3582
|
},
|
|
3453
|
-
props.selected ? /* @__PURE__ */
|
|
3583
|
+
props.selected ? /* @__PURE__ */ React23.createElement(Icon, { name: "check", size: 14 }) : inner[0],
|
|
3454
3584
|
inner[1]
|
|
3455
3585
|
);
|
|
3456
3586
|
}
|
|
3457
|
-
return /* @__PURE__ */
|
|
3587
|
+
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(
|
|
3458
3588
|
"button",
|
|
3459
3589
|
{
|
|
3460
3590
|
type: "button",
|
|
@@ -3462,21 +3592,21 @@ var Tag = React22.forwardRef(function Tag2(props, ref) {
|
|
|
3462
3592
|
"aria-label": props.removeLabel || t.remove(typeof props.children === "string" ? props.children : ""),
|
|
3463
3593
|
onClick: props.onRemove
|
|
3464
3594
|
},
|
|
3465
|
-
/* @__PURE__ */
|
|
3595
|
+
/* @__PURE__ */ React23.createElement(Icon, { name: "x", size: 12 })
|
|
3466
3596
|
) : null);
|
|
3467
3597
|
});
|
|
3468
3598
|
|
|
3469
3599
|
// src/FilterBar.tsx
|
|
3470
|
-
var FilterBar =
|
|
3600
|
+
var FilterBar = React24.forwardRef(function FilterBar2(props, ref) {
|
|
3471
3601
|
const t = useStrings();
|
|
3472
3602
|
const id = uid();
|
|
3473
3603
|
const hasSearch = !!props.onSearchChange;
|
|
3474
|
-
const draft =
|
|
3475
|
-
const timer =
|
|
3476
|
-
const sent =
|
|
3477
|
-
const onChange =
|
|
3604
|
+
const draft = React24.useState(props.search || "");
|
|
3605
|
+
const timer = React24.useRef(null);
|
|
3606
|
+
const sent = React24.useRef(props.search || "");
|
|
3607
|
+
const onChange = React24.useRef(props.onSearchChange);
|
|
3478
3608
|
onChange.current = props.onSearchChange;
|
|
3479
|
-
|
|
3609
|
+
React24.useEffect(
|
|
3480
3610
|
function() {
|
|
3481
3611
|
if ((props.search || "") !== sent.current) {
|
|
3482
3612
|
sent.current = props.search || "";
|
|
@@ -3485,7 +3615,7 @@ var FilterBar = React23.forwardRef(function FilterBar2(props, ref) {
|
|
|
3485
3615
|
},
|
|
3486
3616
|
[props.search]
|
|
3487
3617
|
);
|
|
3488
|
-
|
|
3618
|
+
React24.useEffect(function() {
|
|
3489
3619
|
return function() {
|
|
3490
3620
|
if (timer.current) clearTimeout(timer.current);
|
|
3491
3621
|
};
|
|
@@ -3510,7 +3640,7 @@ var FilterBar = React23.forwardRef(function FilterBar2(props, ref) {
|
|
|
3510
3640
|
const filters = props.filters || [];
|
|
3511
3641
|
const anything = filters.length > 0 || !!(props.search || draft[0]);
|
|
3512
3642
|
const count = props.resultCount == null ? null : typeof props.resultCount === "number" ? t.results(props.resultCount) : props.resultCount;
|
|
3513
|
-
return /* @__PURE__ */
|
|
3643
|
+
return /* @__PURE__ */ React24.createElement(
|
|
3514
3644
|
"div",
|
|
3515
3645
|
{
|
|
3516
3646
|
ref,
|
|
@@ -3518,7 +3648,7 @@ var FilterBar = React23.forwardRef(function FilterBar2(props, ref) {
|
|
|
3518
3648
|
"aria-label": props.label || t.filters,
|
|
3519
3649
|
className: cx("aura-filterbar", props.className)
|
|
3520
3650
|
},
|
|
3521
|
-
/* @__PURE__ */
|
|
3651
|
+
/* @__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(
|
|
3522
3652
|
"input",
|
|
3523
3653
|
{
|
|
3524
3654
|
id,
|
|
@@ -3539,7 +3669,7 @@ var FilterBar = React23.forwardRef(function FilterBar2(props, ref) {
|
|
|
3539
3669
|
}
|
|
3540
3670
|
}
|
|
3541
3671
|
}
|
|
3542
|
-
), draft[0] ? /* @__PURE__ */
|
|
3672
|
+
), draft[0] ? /* @__PURE__ */ React24.createElement(
|
|
3543
3673
|
IconButton,
|
|
3544
3674
|
{
|
|
3545
3675
|
icon: "x",
|
|
@@ -3550,10 +3680,10 @@ var FilterBar = React23.forwardRef(function FilterBar2(props, ref) {
|
|
|
3550
3680
|
send("");
|
|
3551
3681
|
}
|
|
3552
3682
|
}
|
|
3553
|
-
) : null) : null, props.children ? /* @__PURE__ */
|
|
3554
|
-
filters.length || props.onClearAll && anything ? /* @__PURE__ */
|
|
3555
|
-
return /* @__PURE__ */
|
|
3556
|
-
}), props.onClearAll && anything ? /* @__PURE__ */
|
|
3683
|
+
) : 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),
|
|
3684
|
+
filters.length || props.onClearAll && anything ? /* @__PURE__ */ React24.createElement("div", { className: "aura-filterbar__chips" }, filters.map(function(f) {
|
|
3685
|
+
return /* @__PURE__ */ React24.createElement(Tag, { key: f.id, onRemove: f.onRemove }, f.label);
|
|
3686
|
+
}), props.onClearAll && anything ? /* @__PURE__ */ React24.createElement(
|
|
3557
3687
|
"button",
|
|
3558
3688
|
{
|
|
3559
3689
|
type: "button",
|
|
@@ -3571,11 +3701,11 @@ var FilterBar = React23.forwardRef(function FilterBar2(props, ref) {
|
|
|
3571
3701
|
});
|
|
3572
3702
|
|
|
3573
3703
|
// src/Command.tsx
|
|
3574
|
-
var
|
|
3704
|
+
var React26 = __toESM(require("react"), 1);
|
|
3575
3705
|
var import_react_dom6 = require("react-dom");
|
|
3576
3706
|
|
|
3577
3707
|
// src/useModal.tsx
|
|
3578
|
-
var
|
|
3708
|
+
var React25 = __toESM(require("react"), 1);
|
|
3579
3709
|
var locks = 0;
|
|
3580
3710
|
var savedOverflow = "";
|
|
3581
3711
|
function lockScroll() {
|
|
@@ -3602,9 +3732,9 @@ function tabbable(el) {
|
|
|
3602
3732
|
}
|
|
3603
3733
|
function useModal(open, ref, opts) {
|
|
3604
3734
|
const mounted = useMounted();
|
|
3605
|
-
const prev =
|
|
3735
|
+
const prev = React25.useRef(null);
|
|
3606
3736
|
const o = opts || {};
|
|
3607
|
-
|
|
3737
|
+
React25.useEffect(
|
|
3608
3738
|
function() {
|
|
3609
3739
|
if (!open || !mounted) return;
|
|
3610
3740
|
prev.current = document.activeElement;
|
|
@@ -3662,21 +3792,21 @@ function Command(props) {
|
|
|
3662
3792
|
const t = useStrings();
|
|
3663
3793
|
const density = useDensity();
|
|
3664
3794
|
const id = uid(), listId = id + "-list";
|
|
3665
|
-
const box =
|
|
3666
|
-
const input =
|
|
3667
|
-
const qState =
|
|
3795
|
+
const box = React26.useRef(null);
|
|
3796
|
+
const input = React26.useRef(null);
|
|
3797
|
+
const qState = React26.useState(""), act = React26.useState(null);
|
|
3668
3798
|
const query = props.query !== void 0 ? props.query : qState[0];
|
|
3669
3799
|
function setQuery(v) {
|
|
3670
3800
|
if (props.query === void 0) qState[1](v);
|
|
3671
3801
|
if (props.onQueryChange) props.onQueryChange(v);
|
|
3672
3802
|
}
|
|
3673
|
-
const openRef =
|
|
3803
|
+
const openRef = React26.useRef(props.open);
|
|
3674
3804
|
openRef.current = props.open;
|
|
3675
3805
|
const close = function() {
|
|
3676
3806
|
props.onOpenChange(false);
|
|
3677
3807
|
};
|
|
3678
3808
|
const modal = useModal(props.open, box, { onEscape: close });
|
|
3679
|
-
|
|
3809
|
+
React26.useEffect(
|
|
3680
3810
|
function() {
|
|
3681
3811
|
if (props.hotkey === false) return;
|
|
3682
3812
|
function onKey2(e) {
|
|
@@ -3692,7 +3822,7 @@ function Command(props) {
|
|
|
3692
3822
|
},
|
|
3693
3823
|
[props.hotkey, props.onOpenChange]
|
|
3694
3824
|
);
|
|
3695
|
-
|
|
3825
|
+
React26.useEffect(
|
|
3696
3826
|
function() {
|
|
3697
3827
|
if (!props.open) {
|
|
3698
3828
|
if (query) setQuery("");
|
|
@@ -3714,25 +3844,25 @@ function Command(props) {
|
|
|
3714
3844
|
if (!g) groups.push(g = { name, items: [] });
|
|
3715
3845
|
g.items.push(it);
|
|
3716
3846
|
});
|
|
3717
|
-
const
|
|
3847
|
+
const flat2 = [];
|
|
3718
3848
|
groups.forEach(function(g) {
|
|
3719
3849
|
g.items.forEach(function(it) {
|
|
3720
|
-
|
|
3850
|
+
flat2.push(it);
|
|
3721
3851
|
});
|
|
3722
3852
|
});
|
|
3723
|
-
const enabled =
|
|
3853
|
+
const enabled = flat2.map(function(it, i2) {
|
|
3724
3854
|
return it.disabled ? -1 : i2;
|
|
3725
3855
|
}).filter(function(i2) {
|
|
3726
3856
|
return i2 >= 0;
|
|
3727
3857
|
});
|
|
3728
|
-
const byId = act[0] == null ? -1 :
|
|
3858
|
+
const byId = act[0] == null ? -1 : flat2.findIndex(function(it) {
|
|
3729
3859
|
return it.id === act[0];
|
|
3730
3860
|
});
|
|
3731
3861
|
const active = enabled.indexOf(byId) >= 0 ? byId : enabled.length ? enabled[0] : -1;
|
|
3732
3862
|
const optId = function(i2) {
|
|
3733
3863
|
return id + "-o" + i2;
|
|
3734
3864
|
};
|
|
3735
|
-
|
|
3865
|
+
React26.useEffect(
|
|
3736
3866
|
function() {
|
|
3737
3867
|
if (!box.current || active < 0) return;
|
|
3738
3868
|
const el = box.current.querySelector("#" + CSS.escape(optId(active)));
|
|
@@ -3753,7 +3883,7 @@ function Command(props) {
|
|
|
3753
3883
|
if (dir === "first") n2 = 0;
|
|
3754
3884
|
else if (dir === "last") n2 = enabled.length - 1;
|
|
3755
3885
|
else n2 = (at + dir + enabled.length) % enabled.length;
|
|
3756
|
-
act[1](
|
|
3886
|
+
act[1](flat2[enabled[n2]].id);
|
|
3757
3887
|
}
|
|
3758
3888
|
function onKey(e) {
|
|
3759
3889
|
if (e.key === "ArrowDown") {
|
|
@@ -3771,13 +3901,13 @@ function Command(props) {
|
|
|
3771
3901
|
} else if (e.key === "Enter") {
|
|
3772
3902
|
if (e.nativeEvent.isComposing || e.keyCode === 229) return;
|
|
3773
3903
|
e.preventDefault();
|
|
3774
|
-
if (active >= 0) run(
|
|
3904
|
+
if (active >= 0) run(flat2[active]);
|
|
3775
3905
|
}
|
|
3776
3906
|
}
|
|
3777
3907
|
if (!modal.ready) return null;
|
|
3778
3908
|
let i = -1;
|
|
3779
3909
|
return (0, import_react_dom6.createPortal)(
|
|
3780
|
-
/* @__PURE__ */
|
|
3910
|
+
/* @__PURE__ */ React26.createElement(
|
|
3781
3911
|
"div",
|
|
3782
3912
|
{
|
|
3783
3913
|
className: "aura-dialog-layer aura-command-layer",
|
|
@@ -3787,8 +3917,8 @@ function Command(props) {
|
|
|
3787
3917
|
e.stopPropagation();
|
|
3788
3918
|
}
|
|
3789
3919
|
},
|
|
3790
|
-
/* @__PURE__ */
|
|
3791
|
-
/* @__PURE__ */
|
|
3920
|
+
/* @__PURE__ */ React26.createElement("div", { className: "aura-scrim", onClick: close, "aria-hidden": true }),
|
|
3921
|
+
/* @__PURE__ */ React26.createElement(
|
|
3792
3922
|
"div",
|
|
3793
3923
|
{
|
|
3794
3924
|
ref: box,
|
|
@@ -3798,15 +3928,15 @@ function Command(props) {
|
|
|
3798
3928
|
tabIndex: -1,
|
|
3799
3929
|
className: cx("aura-command", props.className)
|
|
3800
3930
|
},
|
|
3801
|
-
/* @__PURE__ */
|
|
3931
|
+
/* @__PURE__ */ React26.createElement("div", { className: "aura-command__search" }, /* @__PURE__ */ React26.createElement(Icon, { name: "search", className: "aura-command__search-icon" }), /* @__PURE__ */ React26.createElement(
|
|
3802
3932
|
"input",
|
|
3803
3933
|
{
|
|
3804
3934
|
ref: input,
|
|
3805
3935
|
"data-autofocus": "",
|
|
3806
3936
|
type: "text",
|
|
3807
3937
|
role: "combobox",
|
|
3808
|
-
"aria-expanded":
|
|
3809
|
-
"aria-controls":
|
|
3938
|
+
"aria-expanded": flat2.length > 0,
|
|
3939
|
+
"aria-controls": flat2.length ? listId : void 0,
|
|
3810
3940
|
"aria-autocomplete": "list",
|
|
3811
3941
|
"aria-activedescendant": active >= 0 ? optId(active) : void 0,
|
|
3812
3942
|
"aria-label": props.label || t.commandMenu,
|
|
@@ -3821,8 +3951,8 @@ function Command(props) {
|
|
|
3821
3951
|
},
|
|
3822
3952
|
onKeyDown: onKey
|
|
3823
3953
|
}
|
|
3824
|
-
), /* @__PURE__ */
|
|
3825
|
-
/* @__PURE__ */
|
|
3954
|
+
), /* @__PURE__ */ React26.createElement("kbd", { className: "aura-command__kbd" }, "Esc")),
|
|
3955
|
+
/* @__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(
|
|
3826
3956
|
"div",
|
|
3827
3957
|
{
|
|
3828
3958
|
id: listId,
|
|
@@ -3832,7 +3962,7 @@ function Command(props) {
|
|
|
3832
3962
|
},
|
|
3833
3963
|
groups.map(function(g, gi) {
|
|
3834
3964
|
const gid = id + "-g" + gi;
|
|
3835
|
-
return /* @__PURE__ */
|
|
3965
|
+
return /* @__PURE__ */ React26.createElement(
|
|
3836
3966
|
"div",
|
|
3837
3967
|
{
|
|
3838
3968
|
key: g.name || gi,
|
|
@@ -3840,11 +3970,11 @@ function Command(props) {
|
|
|
3840
3970
|
"aria-labelledby": g.name ? gid : void 0,
|
|
3841
3971
|
className: "aura-command__group"
|
|
3842
3972
|
},
|
|
3843
|
-
g.name ? /* @__PURE__ */
|
|
3973
|
+
g.name ? /* @__PURE__ */ React26.createElement("div", { className: "aura-command__heading", id: gid, role: "presentation" }, g.name) : null,
|
|
3844
3974
|
g.items.map(function(it) {
|
|
3845
3975
|
i++;
|
|
3846
3976
|
const n2 = i;
|
|
3847
|
-
return /* @__PURE__ */
|
|
3977
|
+
return /* @__PURE__ */ React26.createElement(
|
|
3848
3978
|
"div",
|
|
3849
3979
|
{
|
|
3850
3980
|
key: it.id,
|
|
@@ -3867,16 +3997,16 @@ function Command(props) {
|
|
|
3867
3997
|
run(it);
|
|
3868
3998
|
}
|
|
3869
3999
|
},
|
|
3870
|
-
it.icon ? /* @__PURE__ */
|
|
3871
|
-
/* @__PURE__ */
|
|
3872
|
-
it.shortcut ? /* @__PURE__ */
|
|
4000
|
+
it.icon ? /* @__PURE__ */ React26.createElement(Icon, { name: it.icon }) : null,
|
|
4001
|
+
/* @__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),
|
|
4002
|
+
it.shortcut ? /* @__PURE__ */ React26.createElement("kbd", { className: "aura-command__kbd" }, it.shortcut) : null
|
|
3873
4003
|
);
|
|
3874
4004
|
})
|
|
3875
4005
|
);
|
|
3876
4006
|
})
|
|
3877
4007
|
)),
|
|
3878
|
-
/* @__PURE__ */
|
|
3879
|
-
/* @__PURE__ */
|
|
4008
|
+
/* @__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) : ""),
|
|
4009
|
+
/* @__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"))
|
|
3880
4010
|
)
|
|
3881
4011
|
),
|
|
3882
4012
|
document.body
|
|
@@ -3884,12 +4014,12 @@ function Command(props) {
|
|
|
3884
4014
|
}
|
|
3885
4015
|
|
|
3886
4016
|
// src/Tooltip.tsx
|
|
3887
|
-
var
|
|
4017
|
+
var React27 = __toESM(require("react"), 1);
|
|
3888
4018
|
var import_react_dom7 = require("react-dom");
|
|
3889
|
-
var Tooltip =
|
|
3890
|
-
const id = uid(), st =
|
|
3891
|
-
const anchor =
|
|
3892
|
-
const pos =
|
|
4019
|
+
var Tooltip = React27.forwardRef(function Tooltip2(props, ref) {
|
|
4020
|
+
const id = uid(), st = React27.useState(false), open = props.open !== void 0 ? props.open : st[0], set = st[1];
|
|
4021
|
+
const anchor = React27.useRef(null), anchorMerged = useMergedRef(ref, anchor), tip = React27.useRef(null), timer = React27.useRef(void 0);
|
|
4022
|
+
const pos = React27.useState(null), mounted = useMounted();
|
|
3893
4023
|
function show2(now) {
|
|
3894
4024
|
clearTimeout(timer.current);
|
|
3895
4025
|
timer.current = setTimeout(
|
|
@@ -3909,7 +4039,7 @@ var Tooltip = React26.forwardRef(function Tooltip2(props, ref) {
|
|
|
3909
4039
|
set(false);
|
|
3910
4040
|
}, 120);
|
|
3911
4041
|
}
|
|
3912
|
-
|
|
4042
|
+
React27.useEffect(function() {
|
|
3913
4043
|
return function() {
|
|
3914
4044
|
clearTimeout(timer.current);
|
|
3915
4045
|
};
|
|
@@ -3953,7 +4083,7 @@ var Tooltip = React26.forwardRef(function Tooltip2(props, ref) {
|
|
|
3953
4083
|
},
|
|
3954
4084
|
[open, mounted]
|
|
3955
4085
|
);
|
|
3956
|
-
|
|
4086
|
+
React27.useEffect(
|
|
3957
4087
|
function() {
|
|
3958
4088
|
if (!open) return;
|
|
3959
4089
|
function esc(e) {
|
|
@@ -3966,8 +4096,8 @@ var Tooltip = React26.forwardRef(function Tooltip2(props, ref) {
|
|
|
3966
4096
|
},
|
|
3967
4097
|
[open]
|
|
3968
4098
|
);
|
|
3969
|
-
const child =
|
|
3970
|
-
const trigger = /* @__PURE__ */
|
|
4099
|
+
const child = React27.Children.only(props.children);
|
|
4100
|
+
const trigger = /* @__PURE__ */ React27.createElement(
|
|
3971
4101
|
"span",
|
|
3972
4102
|
{
|
|
3973
4103
|
ref: anchorMerged,
|
|
@@ -3981,10 +4111,10 @@ var Tooltip = React26.forwardRef(function Tooltip2(props, ref) {
|
|
|
3981
4111
|
},
|
|
3982
4112
|
onBlur: hide
|
|
3983
4113
|
},
|
|
3984
|
-
|
|
4114
|
+
React27.cloneElement(child, { "aria-describedby": open ? id : child.props["aria-describedby"] })
|
|
3985
4115
|
);
|
|
3986
|
-
return /* @__PURE__ */
|
|
3987
|
-
/* @__PURE__ */
|
|
4116
|
+
return /* @__PURE__ */ React27.createElement(React27.Fragment, null, trigger, open && mounted ? (0, import_react_dom7.createPortal)(
|
|
4117
|
+
/* @__PURE__ */ React27.createElement(
|
|
3988
4118
|
"div",
|
|
3989
4119
|
{
|
|
3990
4120
|
ref: tip,
|
|
@@ -4004,12 +4134,12 @@ var Tooltip = React26.forwardRef(function Tooltip2(props, ref) {
|
|
|
4004
4134
|
});
|
|
4005
4135
|
|
|
4006
4136
|
// src/Dialog.tsx
|
|
4007
|
-
var
|
|
4137
|
+
var React28 = __toESM(require("react"), 1);
|
|
4008
4138
|
var import_react_dom8 = require("react-dom");
|
|
4009
|
-
var Dialog =
|
|
4139
|
+
var Dialog = React28.forwardRef(function Dialog2(props, ref) {
|
|
4010
4140
|
const t = useStrings();
|
|
4011
4141
|
const density = useDensity();
|
|
4012
|
-
const own =
|
|
4142
|
+
const own = React28.useRef(null), merged = useMergedRef(ref, own), titleId = uid(), descId = uid();
|
|
4013
4143
|
function close() {
|
|
4014
4144
|
if (props.dismissible !== false && props.onClose) props.onClose();
|
|
4015
4145
|
}
|
|
@@ -4022,7 +4152,7 @@ var Dialog = React27.forwardRef(function Dialog2(props, ref) {
|
|
|
4022
4152
|
});
|
|
4023
4153
|
if (!modal.ready) return null;
|
|
4024
4154
|
return (0, import_react_dom8.createPortal)(
|
|
4025
|
-
/* @__PURE__ */
|
|
4155
|
+
/* @__PURE__ */ React28.createElement("div", { className: "aura-dialog-layer", "data-density": density, onKeyDown: modal.onKeyDown }, /* @__PURE__ */ React28.createElement(
|
|
4026
4156
|
"div",
|
|
4027
4157
|
{
|
|
4028
4158
|
className: "aura-scrim",
|
|
@@ -4032,7 +4162,7 @@ var Dialog = React27.forwardRef(function Dialog2(props, ref) {
|
|
|
4032
4162
|
},
|
|
4033
4163
|
"aria-hidden": true
|
|
4034
4164
|
}
|
|
4035
|
-
), /* @__PURE__ */
|
|
4165
|
+
), /* @__PURE__ */ React28.createElement(
|
|
4036
4166
|
"div",
|
|
4037
4167
|
{
|
|
4038
4168
|
ref: merged,
|
|
@@ -4043,18 +4173,18 @@ var Dialog = React27.forwardRef(function Dialog2(props, ref) {
|
|
|
4043
4173
|
tabIndex: -1,
|
|
4044
4174
|
className: cx("aura-dialog", "aura-dialog--" + (props.size || "md"), props.className)
|
|
4045
4175
|
},
|
|
4046
|
-
/* @__PURE__ */
|
|
4047
|
-
props.description ? /* @__PURE__ */
|
|
4048
|
-
props.children ? /* @__PURE__ */
|
|
4049
|
-
props.footer ? /* @__PURE__ */
|
|
4176
|
+
/* @__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),
|
|
4177
|
+
props.description ? /* @__PURE__ */ React28.createElement("p", { className: "aura-dialog__desc", id: descId }, props.description) : null,
|
|
4178
|
+
props.children ? /* @__PURE__ */ React28.createElement("div", { className: "aura-dialog__body" }, props.children) : null,
|
|
4179
|
+
props.footer ? /* @__PURE__ */ React28.createElement("div", { className: "aura-dialog__foot" }, props.footer) : null
|
|
4050
4180
|
)),
|
|
4051
4181
|
document.body
|
|
4052
4182
|
);
|
|
4053
4183
|
});
|
|
4054
|
-
var Drawer =
|
|
4184
|
+
var Drawer = React28.forwardRef(function Drawer2(props, ref) {
|
|
4055
4185
|
const t = useStrings();
|
|
4056
4186
|
const density = useDensity();
|
|
4057
|
-
const own =
|
|
4187
|
+
const own = React28.useRef(null), merged = useMergedRef(ref, own), titleId = uid(), descId = uid();
|
|
4058
4188
|
function close() {
|
|
4059
4189
|
if (props.dismissible !== false && props.onClose) props.onClose();
|
|
4060
4190
|
}
|
|
@@ -4068,7 +4198,7 @@ var Drawer = React27.forwardRef(function Drawer2(props, ref) {
|
|
|
4068
4198
|
const side = props.side === "left" ? "left" : "right";
|
|
4069
4199
|
const drawerScrimCloses = props.dismissible !== false && props.dismissOnScrim !== false;
|
|
4070
4200
|
return (0, import_react_dom8.createPortal)(
|
|
4071
|
-
/* @__PURE__ */
|
|
4201
|
+
/* @__PURE__ */ React28.createElement("div", { className: "aura-dialog-layer aura-drawer-layer", "data-density": density, onKeyDown: modal.onKeyDown }, /* @__PURE__ */ React28.createElement(
|
|
4072
4202
|
"div",
|
|
4073
4203
|
{
|
|
4074
4204
|
className: "aura-scrim",
|
|
@@ -4078,7 +4208,7 @@ var Drawer = React27.forwardRef(function Drawer2(props, ref) {
|
|
|
4078
4208
|
} : void 0,
|
|
4079
4209
|
"aria-hidden": true
|
|
4080
4210
|
}
|
|
4081
|
-
), /* @__PURE__ */
|
|
4211
|
+
), /* @__PURE__ */ React28.createElement(
|
|
4082
4212
|
"div",
|
|
4083
4213
|
{
|
|
4084
4214
|
ref: merged,
|
|
@@ -4090,17 +4220,17 @@ var Drawer = React27.forwardRef(function Drawer2(props, ref) {
|
|
|
4090
4220
|
tabIndex: -1,
|
|
4091
4221
|
className: cx("aura-drawer", "aura-drawer--" + side, "aura-drawer--" + (props.size || "md"), props.className)
|
|
4092
4222
|
},
|
|
4093
|
-
props.title || props.dismissible !== false ? /* @__PURE__ */
|
|
4094
|
-
props.description ? /* @__PURE__ */
|
|
4095
|
-
/* @__PURE__ */
|
|
4096
|
-
props.footer ? /* @__PURE__ */
|
|
4223
|
+
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,
|
|
4224
|
+
props.description ? /* @__PURE__ */ React28.createElement("p", { className: "aura-drawer__desc", id: descId }, props.description) : null,
|
|
4225
|
+
/* @__PURE__ */ React28.createElement("div", { className: "aura-drawer__body" }, props.children),
|
|
4226
|
+
props.footer ? /* @__PURE__ */ React28.createElement("div", { className: "aura-drawer__foot" }, props.footer) : null
|
|
4097
4227
|
)),
|
|
4098
4228
|
document.body
|
|
4099
4229
|
);
|
|
4100
4230
|
});
|
|
4101
4231
|
|
|
4102
4232
|
// src/DataTable.tsx
|
|
4103
|
-
var
|
|
4233
|
+
var React29 = __toESM(require("react"), 1);
|
|
4104
4234
|
var import_react_dom9 = require("react-dom");
|
|
4105
4235
|
var BP = { sm: 640, md: 768, lg: 1024, xl: 1280 };
|
|
4106
4236
|
var DEFAULT_COLUMNS = [
|
|
@@ -4123,7 +4253,7 @@ function hidePx(c) {
|
|
|
4123
4253
|
var ROW_H_DEFAULT = 48;
|
|
4124
4254
|
var OVERSCAN = 8;
|
|
4125
4255
|
var FLEX_MIN = 160;
|
|
4126
|
-
var DataTableImpl =
|
|
4256
|
+
var DataTableImpl = React29.forwardRef(function DataTable(props, ref) {
|
|
4127
4257
|
const t = useStrings();
|
|
4128
4258
|
const columns = props.columns || DEFAULT_COLUMNS;
|
|
4129
4259
|
const byKey = {};
|
|
@@ -4162,7 +4292,7 @@ var DataTableImpl = React28.forwardRef(function DataTable(props, ref) {
|
|
|
4162
4292
|
const droppedSig = selState[0].length === selected.length ? "" : "#" + selState[0].filter(function(k) {
|
|
4163
4293
|
return rejected[String(k)];
|
|
4164
4294
|
}).join("\0") + "#" + selected.join("\0");
|
|
4165
|
-
|
|
4295
|
+
React29.useEffect(
|
|
4166
4296
|
function() {
|
|
4167
4297
|
if (droppedSig !== "") setSelected(selected);
|
|
4168
4298
|
},
|
|
@@ -4199,19 +4329,19 @@ var DataTableImpl = React28.forwardRef(function DataTable(props, ref) {
|
|
|
4199
4329
|
}),
|
|
4200
4330
|
props.onPinnedColumnsChange
|
|
4201
4331
|
);
|
|
4202
|
-
const widthState =
|
|
4332
|
+
const widthState = React29.useState({});
|
|
4203
4333
|
const widths = widthState[0], setWidths = widthState[1];
|
|
4204
|
-
const activeState =
|
|
4205
|
-
const scrollState =
|
|
4334
|
+
const activeState = React29.useState({ r: 1, c: 0 });
|
|
4335
|
+
const scrollState = React29.useState(0);
|
|
4206
4336
|
const scrollTop = scrollState[0], setScrollTop = scrollState[1];
|
|
4207
|
-
const scrolledX =
|
|
4208
|
-
const menuState =
|
|
4337
|
+
const scrolledX = React29.useState(false);
|
|
4338
|
+
const menuState = React29.useState(null);
|
|
4209
4339
|
const menu = menuState[0], setMenu = menuState[1];
|
|
4210
|
-
const dragState =
|
|
4340
|
+
const dragState = React29.useState(null);
|
|
4211
4341
|
const drag = dragState[0], setDrag = dragState[1];
|
|
4212
|
-
const gridRef =
|
|
4213
|
-
const wrapRef =
|
|
4214
|
-
const boxWidth =
|
|
4342
|
+
const gridRef = React29.useRef(null);
|
|
4343
|
+
const wrapRef = React29.useRef(null), wrapMerged = useMergedRef(ref, wrapRef);
|
|
4344
|
+
const boxWidth = React29.useState(null);
|
|
4215
4345
|
const measure = !!props.stackBelow || columns.some(function(c) {
|
|
4216
4346
|
return c.hideBelow != null;
|
|
4217
4347
|
});
|
|
@@ -4221,7 +4351,7 @@ var DataTableImpl = React28.forwardRef(function DataTable(props, ref) {
|
|
|
4221
4351
|
return px != null && a.indexOf(px) === i;
|
|
4222
4352
|
}).length
|
|
4223
4353
|
);
|
|
4224
|
-
|
|
4354
|
+
React29.useEffect(
|
|
4225
4355
|
function() {
|
|
4226
4356
|
if (!measure || !wrapRef.current || typeof ResizeObserver === "undefined") return;
|
|
4227
4357
|
const ro = new ResizeObserver(function(en) {
|
|
@@ -4266,8 +4396,8 @@ var DataTableImpl = React28.forwardRef(function DataTable(props, ref) {
|
|
|
4266
4396
|
const px = hidePx(c);
|
|
4267
4397
|
return px != null && below(boxWidth[0], px);
|
|
4268
4398
|
}
|
|
4269
|
-
const scrollRef =
|
|
4270
|
-
const tipState =
|
|
4399
|
+
const scrollRef = React29.useRef(null);
|
|
4400
|
+
const tipState = React29.useState(null), tip = tipState[0], setTip = tipState[1];
|
|
4271
4401
|
function showFull(e) {
|
|
4272
4402
|
const el = e.target.closest ? e.target.closest(".aura-table__td") : null;
|
|
4273
4403
|
if (!el || el.scrollWidth <= el.clientWidth + 1 || el.querySelector("button, input, .aura-pill"))
|
|
@@ -4279,7 +4409,7 @@ var DataTableImpl = React28.forwardRef(function DataTable(props, ref) {
|
|
|
4279
4409
|
setTip(null);
|
|
4280
4410
|
}
|
|
4281
4411
|
const tipEl = tip && typeof document !== "undefined" ? (0, import_react_dom9.createPortal)(
|
|
4282
|
-
/* @__PURE__ */
|
|
4412
|
+
/* @__PURE__ */ React29.createElement(
|
|
4283
4413
|
"div",
|
|
4284
4414
|
{
|
|
4285
4415
|
className: "aura-tooltip aura-tooltip--above",
|
|
@@ -4290,7 +4420,7 @@ var DataTableImpl = React28.forwardRef(function DataTable(props, ref) {
|
|
|
4290
4420
|
),
|
|
4291
4421
|
document.body
|
|
4292
4422
|
) : null;
|
|
4293
|
-
const rowH =
|
|
4423
|
+
const rowH = React29.useState(ROW_H_DEFAULT);
|
|
4294
4424
|
const ROW_H = rowH[0];
|
|
4295
4425
|
useIsoLayoutEffect(function() {
|
|
4296
4426
|
const el = wrapRef.current;
|
|
@@ -4298,8 +4428,8 @@ var DataTableImpl = React28.forwardRef(function DataTable(props, ref) {
|
|
|
4298
4428
|
const v = parseFloat(getComputedStyle(el).getPropertyValue("--aura-table-row-height"));
|
|
4299
4429
|
if (v > 0 && v !== rowH[0]) rowH[1](v);
|
|
4300
4430
|
});
|
|
4301
|
-
const pending =
|
|
4302
|
-
const resizing =
|
|
4431
|
+
const pending = React29.useRef(null);
|
|
4432
|
+
const resizing = React29.useRef(false);
|
|
4303
4433
|
useIsoLayoutEffect(function() {
|
|
4304
4434
|
if (!gridRef.current) return;
|
|
4305
4435
|
const els = gridRef.current.querySelectorAll(
|
|
@@ -4383,7 +4513,7 @@ var DataTableImpl = React28.forwardRef(function DataTable(props, ref) {
|
|
|
4383
4513
|
return s;
|
|
4384
4514
|
}
|
|
4385
4515
|
const sortCol = sort && sort.key ? byKey[sort.key] : void 0;
|
|
4386
|
-
const view =
|
|
4516
|
+
const view = React29.useMemo(
|
|
4387
4517
|
function() {
|
|
4388
4518
|
if (manual || !sort || !sort.key || !byKey[sort.key]) return rows;
|
|
4389
4519
|
const col = byKey[sort.key];
|
|
@@ -4425,8 +4555,8 @@ var DataTableImpl = React28.forwardRef(function DataTable(props, ref) {
|
|
|
4425
4555
|
const pageRows = pageSize && !manual ? view.slice(first, first + pageSize) : view;
|
|
4426
4556
|
const canSortAny = !busy && (manual ? total > 1 : rows.length > 1);
|
|
4427
4557
|
const shownTotal = manual && props.totalRows == null ? first + rows.length : total;
|
|
4428
|
-
const prevCount =
|
|
4429
|
-
|
|
4558
|
+
const prevCount = React29.useRef(pageCount);
|
|
4559
|
+
React29.useEffect(
|
|
4430
4560
|
function() {
|
|
4431
4561
|
if (busy) return;
|
|
4432
4562
|
const before = prevCount.current;
|
|
@@ -4440,9 +4570,9 @@ var DataTableImpl = React28.forwardRef(function DataTable(props, ref) {
|
|
|
4440
4570
|
[pageState[0], page, busy, pageCount]
|
|
4441
4571
|
);
|
|
4442
4572
|
const linkPaging = !!props.getPageHref && !props.onPageChange && !oneCallback;
|
|
4443
|
-
const prevLink =
|
|
4444
|
-
const jumpState =
|
|
4445
|
-
|
|
4573
|
+
const prevLink = React29.useRef(null), nextLink = React29.useRef(null), jumpLink = React29.useRef(null);
|
|
4574
|
+
const jumpState = React29.useState(null);
|
|
4575
|
+
React29.useEffect(
|
|
4446
4576
|
function() {
|
|
4447
4577
|
if (jumpState[0] == null) return;
|
|
4448
4578
|
if (jumpLink.current) jumpLink.current.click();
|
|
@@ -4493,7 +4623,7 @@ var DataTableImpl = React28.forwardRef(function DataTable(props, ref) {
|
|
|
4493
4623
|
);
|
|
4494
4624
|
}
|
|
4495
4625
|
function rowLinkWrap(r, content) {
|
|
4496
|
-
return rowHref ? /* @__PURE__ */
|
|
4626
|
+
return rowHref ? /* @__PURE__ */ React29.createElement(Link, { href: rowHref(r), className: "aura-table__row-link" }, content) : content;
|
|
4497
4627
|
}
|
|
4498
4628
|
const height = props.height || 0;
|
|
4499
4629
|
const virtual = !!height && !loading && pageRows.length > 0 && !stacked;
|
|
@@ -4518,7 +4648,7 @@ var DataTableImpl = React28.forwardRef(function DataTable(props, ref) {
|
|
|
4518
4648
|
if (!activeRendered) return r === 0 && c === ac ? 0 : -1;
|
|
4519
4649
|
return r === ar && c === ac ? 0 : -1;
|
|
4520
4650
|
}
|
|
4521
|
-
|
|
4651
|
+
React29.useEffect(function() {
|
|
4522
4652
|
const p = pending.current;
|
|
4523
4653
|
if (!p || !gridRef.current) return;
|
|
4524
4654
|
let c = p.c;
|
|
@@ -4860,10 +4990,10 @@ var DataTableImpl = React28.forwardRef(function DataTable(props, ref) {
|
|
|
4860
4990
|
e.stopPropagation();
|
|
4861
4991
|
}
|
|
4862
4992
|
}
|
|
4863
|
-
const head = [/* @__PURE__ */
|
|
4993
|
+
const head = [/* @__PURE__ */ React29.createElement("span", { key: "__gl", className: "aura-table__gutter", "aria-hidden": true })];
|
|
4864
4994
|
if (selectable)
|
|
4865
4995
|
head.push(
|
|
4866
|
-
/* @__PURE__ */
|
|
4996
|
+
/* @__PURE__ */ React29.createElement(
|
|
4867
4997
|
"span",
|
|
4868
4998
|
{
|
|
4869
4999
|
key: "__sel",
|
|
@@ -4877,7 +5007,7 @@ var DataTableImpl = React28.forwardRef(function DataTable(props, ref) {
|
|
|
4877
5007
|
activeState[1]({ r: 0, c: 0 });
|
|
4878
5008
|
}
|
|
4879
5009
|
},
|
|
4880
|
-
pageKeys.length ? /* @__PURE__ */
|
|
5010
|
+
pageKeys.length ? /* @__PURE__ */ React29.createElement(
|
|
4881
5011
|
Checkbox,
|
|
4882
5012
|
{
|
|
4883
5013
|
hideLabel: true,
|
|
@@ -4888,7 +5018,7 @@ var DataTableImpl = React28.forwardRef(function DataTable(props, ref) {
|
|
|
4888
5018
|
onChange: toggleAll
|
|
4889
5019
|
}
|
|
4890
5020
|
) : null,
|
|
4891
|
-
pageKeys.length ? /* @__PURE__ */
|
|
5021
|
+
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)
|
|
4892
5022
|
)
|
|
4893
5023
|
);
|
|
4894
5024
|
vis.forEach(function(c, i) {
|
|
@@ -4898,7 +5028,7 @@ var DataTableImpl = React28.forwardRef(function DataTable(props, ref) {
|
|
|
4898
5028
|
const ariaSort = isSorted && canSort ? sort.dir === "desc" ? "descending" : "ascending" : canSort ? "none" : void 0;
|
|
4899
5029
|
const pin = isPinned(c), edge = pin && i === nPinned - 1;
|
|
4900
5030
|
head.push(
|
|
4901
|
-
/* @__PURE__ */
|
|
5031
|
+
/* @__PURE__ */ React29.createElement(
|
|
4902
5032
|
"span",
|
|
4903
5033
|
{
|
|
4904
5034
|
key: c.key,
|
|
@@ -4948,7 +5078,7 @@ var DataTableImpl = React28.forwardRef(function DataTable(props, ref) {
|
|
|
4948
5078
|
setDrag(null);
|
|
4949
5079
|
}
|
|
4950
5080
|
},
|
|
4951
|
-
/* @__PURE__ */
|
|
5081
|
+
/* @__PURE__ */ React29.createElement("span", { className: "aura-table__th-inner" }, canSort ? /* @__PURE__ */ React29.createElement(
|
|
4952
5082
|
"button",
|
|
4953
5083
|
{
|
|
4954
5084
|
type: "button",
|
|
@@ -4960,8 +5090,8 @@ var DataTableImpl = React28.forwardRef(function DataTable(props, ref) {
|
|
|
4960
5090
|
}
|
|
4961
5091
|
},
|
|
4962
5092
|
c.label,
|
|
4963
|
-
/* @__PURE__ */
|
|
4964
|
-
) : /* @__PURE__ */
|
|
5093
|
+
/* @__PURE__ */ React29.createElement(Icon, { name: isSorted ? sort.dir === "desc" ? "arrow-down" : "arrow-up" : "arrow-up-down", size: 12 })
|
|
5094
|
+
) : /* @__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(
|
|
4965
5095
|
"button",
|
|
4966
5096
|
{
|
|
4967
5097
|
type: "button",
|
|
@@ -4975,9 +5105,9 @@ var DataTableImpl = React28.forwardRef(function DataTable(props, ref) {
|
|
|
4975
5105
|
openMenu("col", c.key, e.currentTarget, { r: 0, c: ci });
|
|
4976
5106
|
}
|
|
4977
5107
|
},
|
|
4978
|
-
/* @__PURE__ */
|
|
5108
|
+
/* @__PURE__ */ React29.createElement(Icon, { name: "ellipsis" })
|
|
4979
5109
|
) : null),
|
|
4980
|
-
canResize(c) ? /* @__PURE__ */
|
|
5110
|
+
canResize(c) ? /* @__PURE__ */ React29.createElement(
|
|
4981
5111
|
"span",
|
|
4982
5112
|
{
|
|
4983
5113
|
className: "aura-table__resize",
|
|
@@ -4999,7 +5129,7 @@ var DataTableImpl = React28.forwardRef(function DataTable(props, ref) {
|
|
|
4999
5129
|
);
|
|
5000
5130
|
});
|
|
5001
5131
|
head.push(
|
|
5002
|
-
/* @__PURE__ */
|
|
5132
|
+
/* @__PURE__ */ React29.createElement(
|
|
5003
5133
|
"span",
|
|
5004
5134
|
{
|
|
5005
5135
|
key: "__gr",
|
|
@@ -5010,14 +5140,14 @@ var DataTableImpl = React28.forwardRef(function DataTable(props, ref) {
|
|
|
5010
5140
|
);
|
|
5011
5141
|
function cellContent(c, r) {
|
|
5012
5142
|
const v = r[c.key];
|
|
5013
|
-
return c.render ? c.render(r) : c.pill ? /* @__PURE__ */
|
|
5143
|
+
return c.render ? c.render(r) : c.pill ? /* @__PURE__ */ React29.createElement(StatusPill, { ...{ tone: c.tones && c.tones[v] } }, v) : v;
|
|
5014
5144
|
}
|
|
5015
5145
|
function rowCells(r, i, k, isSel) {
|
|
5016
5146
|
const ri = i + 1;
|
|
5017
|
-
const cells = [/* @__PURE__ */
|
|
5147
|
+
const cells = [/* @__PURE__ */ React29.createElement("span", { key: "__gl", className: "aura-table__gutter", "aria-hidden": true })];
|
|
5018
5148
|
if (selectable)
|
|
5019
5149
|
cells.push(
|
|
5020
|
-
/* @__PURE__ */
|
|
5150
|
+
/* @__PURE__ */ React29.createElement(
|
|
5021
5151
|
"span",
|
|
5022
5152
|
{
|
|
5023
5153
|
key: "__sel",
|
|
@@ -5031,7 +5161,7 @@ var DataTableImpl = React28.forwardRef(function DataTable(props, ref) {
|
|
|
5031
5161
|
if (e.target === e.currentTarget) activeState[1]({ r: ri, c: 0 });
|
|
5032
5162
|
}
|
|
5033
5163
|
},
|
|
5034
|
-
canSelect(r) ? /* @__PURE__ */
|
|
5164
|
+
canSelect(r) ? /* @__PURE__ */ React29.createElement(
|
|
5035
5165
|
Checkbox,
|
|
5036
5166
|
{
|
|
5037
5167
|
hideLabel: true,
|
|
@@ -5048,7 +5178,7 @@ var DataTableImpl = React28.forwardRef(function DataTable(props, ref) {
|
|
|
5048
5178
|
vis.forEach(function(c, j) {
|
|
5049
5179
|
const ci = j + (selectable ? 1 : 0), v = r[c.key], pin = isPinned(c);
|
|
5050
5180
|
cells.push(
|
|
5051
|
-
/* @__PURE__ */
|
|
5181
|
+
/* @__PURE__ */ React29.createElement(
|
|
5052
5182
|
"span",
|
|
5053
5183
|
{
|
|
5054
5184
|
key: c.key,
|
|
@@ -5073,9 +5203,9 @@ var DataTableImpl = React28.forwardRef(function DataTable(props, ref) {
|
|
|
5073
5203
|
)
|
|
5074
5204
|
);
|
|
5075
5205
|
});
|
|
5076
|
-
if (hasFields) cells.push(/* @__PURE__ */
|
|
5206
|
+
if (hasFields) cells.push(/* @__PURE__ */ React29.createElement("span", { key: "__br", className: "aura-table__break", "aria-hidden": true }));
|
|
5077
5207
|
cells.push(
|
|
5078
|
-
/* @__PURE__ */
|
|
5208
|
+
/* @__PURE__ */ React29.createElement(
|
|
5079
5209
|
"span",
|
|
5080
5210
|
{
|
|
5081
5211
|
key: "__gr",
|
|
@@ -5092,14 +5222,14 @@ var DataTableImpl = React28.forwardRef(function DataTable(props, ref) {
|
|
|
5092
5222
|
const n2 = pageSize || props.skeletonRows || 5;
|
|
5093
5223
|
const skRows = body = [];
|
|
5094
5224
|
for (let i = 0; i < n2; i++) {
|
|
5095
|
-
const sk = [/* @__PURE__ */
|
|
5225
|
+
const sk = [/* @__PURE__ */ React29.createElement("span", { key: "__gl", className: "aura-table__gutter" })];
|
|
5096
5226
|
if (selectable)
|
|
5097
5227
|
sk.push(
|
|
5098
|
-
/* @__PURE__ */
|
|
5228
|
+
/* @__PURE__ */ React29.createElement("span", { key: "__sel", className: cx("aura-table__sel", nPinned && "is-pinned") }, /* @__PURE__ */ React29.createElement("span", { className: "aura-skel aura-skel--box" }))
|
|
5099
5229
|
);
|
|
5100
5230
|
vis.forEach(function(c, j) {
|
|
5101
5231
|
sk.push(
|
|
5102
|
-
/* @__PURE__ */
|
|
5232
|
+
/* @__PURE__ */ React29.createElement(
|
|
5103
5233
|
"span",
|
|
5104
5234
|
{
|
|
5105
5235
|
key: c.key,
|
|
@@ -5108,7 +5238,7 @@ var DataTableImpl = React28.forwardRef(function DataTable(props, ref) {
|
|
|
5108
5238
|
...cardAttrs(c, j),
|
|
5109
5239
|
"data-label": void 0
|
|
5110
5240
|
},
|
|
5111
|
-
/* @__PURE__ */
|
|
5241
|
+
/* @__PURE__ */ React29.createElement(
|
|
5112
5242
|
"span",
|
|
5113
5243
|
{
|
|
5114
5244
|
className: cx("aura-skel", c.pill && "aura-skel--pill"),
|
|
@@ -5118,28 +5248,28 @@ var DataTableImpl = React28.forwardRef(function DataTable(props, ref) {
|
|
|
5118
5248
|
)
|
|
5119
5249
|
);
|
|
5120
5250
|
});
|
|
5121
|
-
if (hasFields) sk.push(/* @__PURE__ */
|
|
5251
|
+
if (hasFields) sk.push(/* @__PURE__ */ React29.createElement("span", { key: "__br", className: "aura-table__break" }));
|
|
5122
5252
|
sk.push(
|
|
5123
|
-
/* @__PURE__ */
|
|
5253
|
+
/* @__PURE__ */ React29.createElement("span", { key: "__gr", className: cx("aura-table__gutter aura-table__gutter--end", controls && "has-picker") })
|
|
5124
5254
|
);
|
|
5125
5255
|
skRows.push(
|
|
5126
|
-
/* @__PURE__ */
|
|
5256
|
+
/* @__PURE__ */ React29.createElement("div", { key: "sk" + i, className: "aura-table__row aura-table__row--skeleton", "aria-hidden": true, style: rowStyle }, sk)
|
|
5127
5257
|
);
|
|
5128
5258
|
}
|
|
5129
5259
|
} else if (!rows.length) {
|
|
5130
5260
|
const em = props.empty || {};
|
|
5131
|
-
body = /* @__PURE__ */
|
|
5261
|
+
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));
|
|
5132
5262
|
} else {
|
|
5133
5263
|
const bodyRows = body = [];
|
|
5134
5264
|
if (virtual && start > 0)
|
|
5135
5265
|
bodyRows.push(
|
|
5136
|
-
/* @__PURE__ */
|
|
5266
|
+
/* @__PURE__ */ React29.createElement("div", { key: "__top", className: "aura-table__spacer", style: { height: start * ROW_H + "px" }, "aria-hidden": true })
|
|
5137
5267
|
);
|
|
5138
5268
|
for (let ri = start; ri < end; ri++) {
|
|
5139
5269
|
(function(r, i) {
|
|
5140
5270
|
const k = r[rowKey], isSel = !!selSet[k];
|
|
5141
5271
|
bodyRows.push(
|
|
5142
|
-
/* @__PURE__ */
|
|
5272
|
+
/* @__PURE__ */ React29.createElement(
|
|
5143
5273
|
"div",
|
|
5144
5274
|
{
|
|
5145
5275
|
key: k,
|
|
@@ -5166,7 +5296,7 @@ var DataTableImpl = React28.forwardRef(function DataTable(props, ref) {
|
|
|
5166
5296
|
}
|
|
5167
5297
|
if (virtual && end < pageRows.length)
|
|
5168
5298
|
bodyRows.push(
|
|
5169
|
-
/* @__PURE__ */
|
|
5299
|
+
/* @__PURE__ */ React29.createElement(
|
|
5170
5300
|
"div",
|
|
5171
5301
|
{
|
|
5172
5302
|
key: "__bot",
|
|
@@ -5181,7 +5311,7 @@ var DataTableImpl = React28.forwardRef(function DataTable(props, ref) {
|
|
|
5181
5311
|
function pagerButton(dir) {
|
|
5182
5312
|
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";
|
|
5183
5313
|
if (props.getPageHref && !off)
|
|
5184
|
-
return /* @__PURE__ */
|
|
5314
|
+
return /* @__PURE__ */ React29.createElement(
|
|
5185
5315
|
Link,
|
|
5186
5316
|
{
|
|
5187
5317
|
ref: dir < 0 ? prevLink : nextLink,
|
|
@@ -5196,9 +5326,9 @@ var DataTableImpl = React28.forwardRef(function DataTable(props, ref) {
|
|
|
5196
5326
|
}
|
|
5197
5327
|
}
|
|
5198
5328
|
},
|
|
5199
|
-
/* @__PURE__ */
|
|
5329
|
+
/* @__PURE__ */ React29.createElement(Icon, { name: icon })
|
|
5200
5330
|
);
|
|
5201
|
-
return /* @__PURE__ */
|
|
5331
|
+
return /* @__PURE__ */ React29.createElement(
|
|
5202
5332
|
IconButton,
|
|
5203
5333
|
{
|
|
5204
5334
|
icon,
|
|
@@ -5213,11 +5343,11 @@ var DataTableImpl = React28.forwardRef(function DataTable(props, ref) {
|
|
|
5213
5343
|
const openTotal = manual && props.totalRows == null && !!pageSize && rows.length >= pageSize;
|
|
5214
5344
|
if (pageSize && (rows.length || busy || page > 1)) {
|
|
5215
5345
|
const from = rows.length ? first + 1 : 0, to = manual ? first + rows.length : Math.min(first + pageSize, view.length);
|
|
5216
|
-
foot = /* @__PURE__ */
|
|
5346
|
+
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)));
|
|
5217
5347
|
} else if (height && rows.length && !loading) {
|
|
5218
|
-
foot = /* @__PURE__ */
|
|
5348
|
+
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));
|
|
5219
5349
|
}
|
|
5220
|
-
const totalRow = props.footer && rows.length && !loading ? /* @__PURE__ */
|
|
5350
|
+
const totalRow = props.footer && rows.length && !loading ? /* @__PURE__ */ React29.createElement(
|
|
5221
5351
|
"div",
|
|
5222
5352
|
{
|
|
5223
5353
|
role: "row",
|
|
@@ -5226,8 +5356,8 @@ var DataTableImpl = React28.forwardRef(function DataTable(props, ref) {
|
|
|
5226
5356
|
className: cx("aura-table__row aura-table__total", props.stickyFooter && "is-sticky"),
|
|
5227
5357
|
style: rowStyle
|
|
5228
5358
|
},
|
|
5229
|
-
/* @__PURE__ */
|
|
5230
|
-
selectable ? /* @__PURE__ */
|
|
5359
|
+
/* @__PURE__ */ React29.createElement("span", { className: "aura-table__gutter", "aria-hidden": true }),
|
|
5360
|
+
selectable ? /* @__PURE__ */ React29.createElement(
|
|
5231
5361
|
"span",
|
|
5232
5362
|
{
|
|
5233
5363
|
role: "gridcell",
|
|
@@ -5242,7 +5372,7 @@ var DataTableImpl = React28.forwardRef(function DataTable(props, ref) {
|
|
|
5242
5372
|
) : null,
|
|
5243
5373
|
vis.map(function(c, j) {
|
|
5244
5374
|
const pin = isPinned(c), ci = j + (selectable ? 1 : 0);
|
|
5245
|
-
return /* @__PURE__ */
|
|
5375
|
+
return /* @__PURE__ */ React29.createElement(
|
|
5246
5376
|
"span",
|
|
5247
5377
|
{
|
|
5248
5378
|
key: c.key,
|
|
@@ -5268,8 +5398,8 @@ var DataTableImpl = React28.forwardRef(function DataTable(props, ref) {
|
|
|
5268
5398
|
props.footer[c.key]
|
|
5269
5399
|
);
|
|
5270
5400
|
}),
|
|
5271
|
-
hasFields ? /* @__PURE__ */
|
|
5272
|
-
/* @__PURE__ */
|
|
5401
|
+
hasFields ? /* @__PURE__ */ React29.createElement("span", { className: "aura-table__break", "aria-hidden": true }) : null,
|
|
5402
|
+
/* @__PURE__ */ React29.createElement(
|
|
5273
5403
|
"span",
|
|
5274
5404
|
{
|
|
5275
5405
|
className: cx("aura-table__gutter aura-table__gutter--end", controls && "has-picker"),
|
|
@@ -5283,7 +5413,7 @@ var DataTableImpl = React28.forwardRef(function DataTable(props, ref) {
|
|
|
5283
5413
|
scrollPaddingBottom: stickyTotal ? ROW_H + "px" : void 0
|
|
5284
5414
|
};
|
|
5285
5415
|
if (height) scrollStyle["--aura-table-h"] = height + "px";
|
|
5286
|
-
const gridEl = /* @__PURE__ */
|
|
5416
|
+
const gridEl = /* @__PURE__ */ React29.createElement(
|
|
5287
5417
|
"div",
|
|
5288
5418
|
{
|
|
5289
5419
|
ref: levels.length ? wrapRef : wrapMerged,
|
|
@@ -5297,8 +5427,8 @@ var DataTableImpl = React28.forwardRef(function DataTable(props, ref) {
|
|
|
5297
5427
|
),
|
|
5298
5428
|
style: levels.length ? { ["--aura-q-back"]: String(levels[levels.length - 1].px / Q) } : void 0
|
|
5299
5429
|
},
|
|
5300
|
-
refreshing ? /* @__PURE__ */
|
|
5301
|
-
/* @__PURE__ */
|
|
5430
|
+
refreshing ? /* @__PURE__ */ React29.createElement("span", { className: "aura-table__busy-bar", "aria-hidden": true }) : null,
|
|
5431
|
+
/* @__PURE__ */ React29.createElement(
|
|
5302
5432
|
"div",
|
|
5303
5433
|
{
|
|
5304
5434
|
ref: function(el) {
|
|
@@ -5327,7 +5457,7 @@ var DataTableImpl = React28.forwardRef(function DataTable(props, ref) {
|
|
|
5327
5457
|
if (sx !== scrolledX[0]) scrolledX[1](sx);
|
|
5328
5458
|
}
|
|
5329
5459
|
},
|
|
5330
|
-
/* @__PURE__ */
|
|
5460
|
+
/* @__PURE__ */ React29.createElement(
|
|
5331
5461
|
"div",
|
|
5332
5462
|
{
|
|
5333
5463
|
className: cx("aura-table__head", selectable && nRows > 0 && !busy && "has-select-all"),
|
|
@@ -5340,8 +5470,8 @@ var DataTableImpl = React28.forwardRef(function DataTable(props, ref) {
|
|
|
5340
5470
|
body,
|
|
5341
5471
|
totalRow
|
|
5342
5472
|
),
|
|
5343
|
-
busy ? /* @__PURE__ */
|
|
5344
|
-
controls ? /* @__PURE__ */
|
|
5473
|
+
busy ? /* @__PURE__ */ React29.createElement("span", { className: "aura-sr-only", role: "status" }, t.loadingRows) : null,
|
|
5474
|
+
controls ? /* @__PURE__ */ React29.createElement("div", { className: "aura-table__picker" }, /* @__PURE__ */ React29.createElement(
|
|
5345
5475
|
IconButton,
|
|
5346
5476
|
{
|
|
5347
5477
|
icon: "columns-3",
|
|
@@ -5353,7 +5483,7 @@ var DataTableImpl = React28.forwardRef(function DataTable(props, ref) {
|
|
|
5353
5483
|
}
|
|
5354
5484
|
)) : null,
|
|
5355
5485
|
foot,
|
|
5356
|
-
menu ? /* @__PURE__ */
|
|
5486
|
+
menu ? /* @__PURE__ */ React29.createElement(
|
|
5357
5487
|
Menu,
|
|
5358
5488
|
{
|
|
5359
5489
|
anchor: menu.anchor,
|
|
@@ -5363,13 +5493,13 @@ var DataTableImpl = React28.forwardRef(function DataTable(props, ref) {
|
|
|
5363
5493
|
}
|
|
5364
5494
|
) : null,
|
|
5365
5495
|
tipEl,
|
|
5366
|
-
jumpState[0] != null && props.getPageHref ? /* @__PURE__ */
|
|
5496
|
+
jumpState[0] != null && props.getPageHref ? /* @__PURE__ */ React29.createElement(Link, { ref: jumpLink, href: props.getPageHref(jumpState[0]), hidden: true, tabIndex: -1, "aria-hidden": true }) : null
|
|
5367
5497
|
);
|
|
5368
5498
|
if (!levels.length) return gridEl;
|
|
5369
5499
|
let out = gridEl;
|
|
5370
5500
|
for (let i = levels.length - 1; i >= 0; i--) {
|
|
5371
5501
|
const prev = i === 0 ? Q : levels[i - 1].px;
|
|
5372
|
-
out = /* @__PURE__ */
|
|
5502
|
+
out = /* @__PURE__ */ React29.createElement(
|
|
5373
5503
|
"div",
|
|
5374
5504
|
{
|
|
5375
5505
|
className: cx("aura-table-q", "aura-table-q--" + levels[i].name),
|
|
@@ -5378,36 +5508,19 @@ var DataTableImpl = React28.forwardRef(function DataTable(props, ref) {
|
|
|
5378
5508
|
out
|
|
5379
5509
|
);
|
|
5380
5510
|
}
|
|
5381
|
-
return /* @__PURE__ */
|
|
5511
|
+
return /* @__PURE__ */ React29.createElement("div", { ref, className: cx("aura-table-box", props.className) }, out);
|
|
5382
5512
|
});
|
|
5383
5513
|
var DataTable2 = DataTableImpl;
|
|
5384
5514
|
|
|
5385
5515
|
// src/Card.tsx
|
|
5386
|
-
var
|
|
5387
|
-
var
|
|
5388
|
-
|
|
5389
|
-
const creative = props.variant === "creative";
|
|
5390
|
-
return h4(
|
|
5391
|
-
props.as || "section",
|
|
5392
|
-
{
|
|
5393
|
-
ref,
|
|
5394
|
-
className: cx(
|
|
5395
|
-
"aura-card",
|
|
5396
|
-
creative && "aura-card--creative",
|
|
5397
|
-
props.interactive && "is-interactive",
|
|
5398
|
-
props.className
|
|
5399
|
-
),
|
|
5400
|
-
"aria-labelledby": props.title && props.titleId ? props.titleId : void 0
|
|
5401
|
-
},
|
|
5402
|
-
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,
|
|
5403
|
-
props.children ? /* @__PURE__ */ React29.createElement("div", { className: "aura-card__body" }, props.children) : null,
|
|
5404
|
-
props.footer ? /* @__PURE__ */ React29.createElement("div", { className: "aura-card__foot" }, props.footer) : null
|
|
5405
|
-
);
|
|
5516
|
+
var React30 = __toESM(require("react"), 1);
|
|
5517
|
+
var Card = React30.forwardRef(function Card2(props, ref) {
|
|
5518
|
+
return cardElement(props, ref);
|
|
5406
5519
|
});
|
|
5407
5520
|
|
|
5408
5521
|
// src/Tabs.tsx
|
|
5409
|
-
var
|
|
5410
|
-
var Tabs =
|
|
5522
|
+
var React31 = __toESM(require("react"), 1);
|
|
5523
|
+
var Tabs = React31.forwardRef(function Tabs2(props, ref) {
|
|
5411
5524
|
const items2 = props.tabs || [], base = uid();
|
|
5412
5525
|
const asLinks = items2.length > 0 && items2.every(function(t) {
|
|
5413
5526
|
return !!t.href;
|
|
@@ -5421,27 +5534,27 @@ var Tabs = React30.forwardRef(function Tabs2(props, ref) {
|
|
|
5421
5534
|
props.onChange
|
|
5422
5535
|
);
|
|
5423
5536
|
const cur = asLinks && "value" in props ? props.value : st[0];
|
|
5424
|
-
const refs =
|
|
5537
|
+
const refs = React31.useRef({});
|
|
5425
5538
|
const current2 = items2.filter(function(t) {
|
|
5426
5539
|
return t.id === cur;
|
|
5427
5540
|
})[0] || firstOn || items2[0];
|
|
5428
5541
|
const Link = useLinkComponent(props.linkComponent);
|
|
5429
5542
|
if (asLinks)
|
|
5430
|
-
return /* @__PURE__ */
|
|
5543
|
+
return /* @__PURE__ */ React31.createElement(
|
|
5431
5544
|
"nav",
|
|
5432
5545
|
{
|
|
5433
5546
|
ref,
|
|
5434
5547
|
"aria-label": props.label,
|
|
5435
5548
|
className: cx("aura-tabs aura-tabs--links", props.className)
|
|
5436
5549
|
},
|
|
5437
|
-
/* @__PURE__ */
|
|
5550
|
+
/* @__PURE__ */ React31.createElement("div", { className: "aura-tabs__list" }, items2.map(function(t) {
|
|
5438
5551
|
const on = t.id === cur;
|
|
5439
5552
|
const inner = [
|
|
5440
|
-
t.icon ? /* @__PURE__ */
|
|
5553
|
+
t.icon ? /* @__PURE__ */ React31.createElement(Icon, { key: "i", name: t.icon }) : null,
|
|
5441
5554
|
t.label,
|
|
5442
|
-
t.count != null ? /* @__PURE__ */
|
|
5555
|
+
t.count != null ? /* @__PURE__ */ React31.createElement("span", { key: "c", className: "aura-tab__count" }, t.count) : null
|
|
5443
5556
|
];
|
|
5444
|
-
return t.disabled ? /* @__PURE__ */
|
|
5557
|
+
return t.disabled ? /* @__PURE__ */ React31.createElement("span", { key: t.id, className: "aura-tab is-disabled", "aria-disabled": true }, inner) : /* @__PURE__ */ React31.createElement(
|
|
5445
5558
|
Link,
|
|
5446
5559
|
{
|
|
5447
5560
|
key: t.id,
|
|
@@ -5465,7 +5578,7 @@ var Tabs = React30.forwardRef(function Tabs2(props, ref) {
|
|
|
5465
5578
|
st[1](t.id);
|
|
5466
5579
|
if (refs.current[t.id]) refs.current[t.id].focus();
|
|
5467
5580
|
}
|
|
5468
|
-
return /* @__PURE__ */
|
|
5581
|
+
return /* @__PURE__ */ React31.createElement("div", { ref, className: cx("aura-tabs", props.className) }, /* @__PURE__ */ React31.createElement(
|
|
5469
5582
|
"div",
|
|
5470
5583
|
{
|
|
5471
5584
|
role: "tablist",
|
|
@@ -5492,7 +5605,7 @@ var Tabs = React30.forwardRef(function Tabs2(props, ref) {
|
|
|
5492
5605
|
},
|
|
5493
5606
|
items2.map(function(t) {
|
|
5494
5607
|
const on = current2 && t.id === current2.id;
|
|
5495
|
-
return /* @__PURE__ */
|
|
5608
|
+
return /* @__PURE__ */ React31.createElement(
|
|
5496
5609
|
"button",
|
|
5497
5610
|
{
|
|
5498
5611
|
key: t.id,
|
|
@@ -5511,12 +5624,12 @@ var Tabs = React30.forwardRef(function Tabs2(props, ref) {
|
|
|
5511
5624
|
st[1](t.id);
|
|
5512
5625
|
}
|
|
5513
5626
|
},
|
|
5514
|
-
t.icon ? /* @__PURE__ */
|
|
5627
|
+
t.icon ? /* @__PURE__ */ React31.createElement(Icon, { name: t.icon }) : null,
|
|
5515
5628
|
t.label,
|
|
5516
|
-
t.count != null ? /* @__PURE__ */
|
|
5629
|
+
t.count != null ? /* @__PURE__ */ React31.createElement("span", { className: "aura-tab__count" }, t.count) : null
|
|
5517
5630
|
);
|
|
5518
5631
|
})
|
|
5519
|
-
), current2 && current2.content !== void 0 ? /* @__PURE__ */
|
|
5632
|
+
), current2 && current2.content !== void 0 ? /* @__PURE__ */ React31.createElement(
|
|
5520
5633
|
"div",
|
|
5521
5634
|
{
|
|
5522
5635
|
role: "tabpanel",
|
|
@@ -5530,14 +5643,14 @@ var Tabs = React30.forwardRef(function Tabs2(props, ref) {
|
|
|
5530
5643
|
});
|
|
5531
5644
|
|
|
5532
5645
|
// src/SideNav.tsx
|
|
5533
|
-
var
|
|
5646
|
+
var React32 = __toESM(require("react"), 1);
|
|
5534
5647
|
var import_react_dom10 = require("react-dom");
|
|
5535
5648
|
function contains(it, id) {
|
|
5536
5649
|
return !!id && !!it.children && it.children.some(function(c) {
|
|
5537
5650
|
return c.id === id || contains(c, id);
|
|
5538
5651
|
});
|
|
5539
5652
|
}
|
|
5540
|
-
var SideNav =
|
|
5653
|
+
var SideNav = React32.forwardRef(function SideNav2(props, ref) {
|
|
5541
5654
|
const t = useStrings();
|
|
5542
5655
|
const Link = useLinkComponent(props.linkComponent);
|
|
5543
5656
|
const base = uid();
|
|
@@ -5549,14 +5662,14 @@ var SideNav = React31.forwardRef(function SideNav2(props, ref) {
|
|
|
5549
5662
|
const active = st[0];
|
|
5550
5663
|
const col = useMaybeControlled(props.collapsed, !!props.defaultCollapsed, props.onCollapsedChange);
|
|
5551
5664
|
const collapsed = col[0];
|
|
5552
|
-
const tipState =
|
|
5553
|
-
|
|
5665
|
+
const tipState = React32.useState(null), tip = tipState[0], setTip = tipState[1];
|
|
5666
|
+
React32.useEffect(
|
|
5554
5667
|
function() {
|
|
5555
5668
|
if (!collapsed) setTip(null);
|
|
5556
5669
|
},
|
|
5557
5670
|
[collapsed]
|
|
5558
5671
|
);
|
|
5559
|
-
|
|
5672
|
+
React32.useEffect(
|
|
5560
5673
|
function() {
|
|
5561
5674
|
if (!tip) return;
|
|
5562
5675
|
function esc(e) {
|
|
@@ -5581,12 +5694,12 @@ var SideNav = React31.forwardRef(function SideNav2(props, ref) {
|
|
|
5581
5694
|
return { onMouseEnter: show2, onFocus: show2, onMouseLeave: hide, onBlur: hide };
|
|
5582
5695
|
}
|
|
5583
5696
|
const sections = props.sections || [{ items: props.items || [] }];
|
|
5584
|
-
const openState =
|
|
5697
|
+
const openState = React32.useState({}), toggled = openState[0], setToggled = openState[1];
|
|
5585
5698
|
function isOpen(it) {
|
|
5586
5699
|
if (toggled[it.id] != null) return toggled[it.id];
|
|
5587
5700
|
return !!it.defaultOpen || contains(it, active);
|
|
5588
5701
|
}
|
|
5589
|
-
|
|
5702
|
+
React32.useEffect(
|
|
5590
5703
|
function() {
|
|
5591
5704
|
if (!active) return;
|
|
5592
5705
|
const next = {};
|
|
@@ -5608,7 +5721,7 @@ var SideNav = React31.forwardRef(function SideNav2(props, ref) {
|
|
|
5608
5721
|
},
|
|
5609
5722
|
[active]
|
|
5610
5723
|
);
|
|
5611
|
-
const navRef =
|
|
5724
|
+
const navRef = React32.useRef(null);
|
|
5612
5725
|
function onKeyDown(e) {
|
|
5613
5726
|
const k = e.key;
|
|
5614
5727
|
if (k !== "ArrowDown" && k !== "ArrowUp" && k !== "Home" && k !== "End") return;
|
|
@@ -5627,12 +5740,12 @@ var SideNav = React31.forwardRef(function SideNav2(props, ref) {
|
|
|
5627
5740
|
function inner(it, group, open) {
|
|
5628
5741
|
const marked = it.count != null && it.count > 0 || it.badge != null;
|
|
5629
5742
|
return [
|
|
5630
|
-
it.icon ? /* @__PURE__ */
|
|
5631
|
-
collapsed && marked ? /* @__PURE__ */
|
|
5632
|
-
/* @__PURE__ */
|
|
5633
|
-
it.badge != null ? /* @__PURE__ */
|
|
5634
|
-
it.count != null ? /* @__PURE__ */
|
|
5635
|
-
group ? /* @__PURE__ */
|
|
5743
|
+
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,
|
|
5744
|
+
collapsed && marked ? /* @__PURE__ */ React32.createElement("span", { key: "d", className: "aura-nav__dot", "aria-hidden": "true" }) : null,
|
|
5745
|
+
/* @__PURE__ */ React32.createElement("span", { key: "l", className: "aura-nav__label" }, it.label),
|
|
5746
|
+
it.badge != null ? /* @__PURE__ */ React32.createElement("span", { key: "b", className: "aura-nav__badge" }, it.badge) : null,
|
|
5747
|
+
it.count != null ? /* @__PURE__ */ React32.createElement("span", { key: "c", className: "aura-nav__count" }, it.count) : null,
|
|
5748
|
+
group ? /* @__PURE__ */ React32.createElement(Icon, { key: "g", name: "chevron-down", className: cx("aura-nav__chevron", open && "is-open") }) : null
|
|
5636
5749
|
];
|
|
5637
5750
|
}
|
|
5638
5751
|
function item(it, depth) {
|
|
@@ -5640,7 +5753,7 @@ var SideNav = React31.forwardRef(function SideNav2(props, ref) {
|
|
|
5640
5753
|
const open = !collapsed && isOpen(it);
|
|
5641
5754
|
const listId = base + "-" + it.id;
|
|
5642
5755
|
const holdsActive = contains(it, active);
|
|
5643
|
-
return /* @__PURE__ */
|
|
5756
|
+
return /* @__PURE__ */ React32.createElement("li", { key: it.id, className: "aura-nav__group" }, /* @__PURE__ */ React32.createElement(
|
|
5644
5757
|
"button",
|
|
5645
5758
|
{
|
|
5646
5759
|
type: "button",
|
|
@@ -5669,7 +5782,7 @@ var SideNav = React31.forwardRef(function SideNav2(props, ref) {
|
|
|
5669
5782
|
}
|
|
5670
5783
|
},
|
|
5671
5784
|
inner(it, true, open)
|
|
5672
|
-
), /* @__PURE__ */
|
|
5785
|
+
), /* @__PURE__ */ React32.createElement("ul", { id: listId, className: "aura-nav__list aura-nav__sub", hidden: !open }, it.children.map(function(c) {
|
|
5673
5786
|
return item(c, depth + 1);
|
|
5674
5787
|
})));
|
|
5675
5788
|
}
|
|
@@ -5685,9 +5798,9 @@ var SideNav = React31.forwardRef(function SideNav2(props, ref) {
|
|
|
5685
5798
|
st[1](it.id);
|
|
5686
5799
|
}
|
|
5687
5800
|
};
|
|
5688
|
-
return /* @__PURE__ */
|
|
5801
|
+
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)));
|
|
5689
5802
|
}
|
|
5690
|
-
return /* @__PURE__ */
|
|
5803
|
+
return /* @__PURE__ */ React32.createElement(
|
|
5691
5804
|
"nav",
|
|
5692
5805
|
{
|
|
5693
5806
|
ref: function(el) {
|
|
@@ -5705,14 +5818,14 @@ var SideNav = React31.forwardRef(function SideNav2(props, ref) {
|
|
|
5705
5818
|
"aria-label": props.label || t.mainNav,
|
|
5706
5819
|
onKeyDown
|
|
5707
5820
|
},
|
|
5708
|
-
props.header ? /* @__PURE__ */
|
|
5709
|
-
/* @__PURE__ */
|
|
5710
|
-
return /* @__PURE__ */
|
|
5821
|
+
props.header ? /* @__PURE__ */ React32.createElement("div", { className: "aura-nav__header" }, props.header) : null,
|
|
5822
|
+
/* @__PURE__ */ React32.createElement("div", { className: "aura-nav__scroll" }, sections.map(function(s, i) {
|
|
5823
|
+
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) {
|
|
5711
5824
|
return item(it, 0);
|
|
5712
5825
|
})));
|
|
5713
5826
|
})),
|
|
5714
|
-
props.footer ? /* @__PURE__ */
|
|
5715
|
-
props.collapsible ? /* @__PURE__ */
|
|
5827
|
+
props.footer ? /* @__PURE__ */ React32.createElement("div", { className: "aura-nav__footer" }, props.footer) : null,
|
|
5828
|
+
props.collapsible ? /* @__PURE__ */ React32.createElement("div", { className: "aura-nav__toggle" }, /* @__PURE__ */ React32.createElement(
|
|
5716
5829
|
IconButton,
|
|
5717
5830
|
{
|
|
5718
5831
|
icon: collapsed ? "panel-left-open" : "panel-left-close",
|
|
@@ -5725,7 +5838,7 @@ var SideNav = React31.forwardRef(function SideNav2(props, ref) {
|
|
|
5725
5838
|
}
|
|
5726
5839
|
)) : null,
|
|
5727
5840
|
tip && typeof document !== "undefined" ? (0, import_react_dom10.createPortal)(
|
|
5728
|
-
/* @__PURE__ */
|
|
5841
|
+
/* @__PURE__ */ React32.createElement(
|
|
5729
5842
|
"div",
|
|
5730
5843
|
{
|
|
5731
5844
|
className: "aura-tooltip aura-tooltip--right",
|
|
@@ -5740,35 +5853,35 @@ var SideNav = React31.forwardRef(function SideNav2(props, ref) {
|
|
|
5740
5853
|
});
|
|
5741
5854
|
|
|
5742
5855
|
// src/Breadcrumb.tsx
|
|
5743
|
-
var
|
|
5744
|
-
var Breadcrumb =
|
|
5856
|
+
var React33 = __toESM(require("react"), 1);
|
|
5857
|
+
var Breadcrumb = React33.forwardRef(function Breadcrumb2(props, ref) {
|
|
5745
5858
|
const t = useStrings();
|
|
5746
5859
|
const Link = useLinkComponent(props.linkComponent);
|
|
5747
5860
|
const items2 = props.items || [];
|
|
5748
|
-
return /* @__PURE__ */
|
|
5861
|
+
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) {
|
|
5749
5862
|
const last = i === items2.length - 1;
|
|
5750
|
-
return /* @__PURE__ */
|
|
5863
|
+
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) : (
|
|
5751
5864
|
/* 5.7: a segment with no page and no action is text, not a button that does nothing. */
|
|
5752
|
-
/* @__PURE__ */
|
|
5753
|
-
), last ? null : /* @__PURE__ */
|
|
5865
|
+
/* @__PURE__ */ React33.createElement("span", { className: "aura-crumbs__text" }, it.label)
|
|
5866
|
+
), last ? null : /* @__PURE__ */ React33.createElement(Icon, { name: "chevron-right", size: 12, className: "aura-crumbs__sep" }));
|
|
5754
5867
|
})));
|
|
5755
5868
|
});
|
|
5756
5869
|
|
|
5757
5870
|
// src/Avatar.tsx
|
|
5758
|
-
var
|
|
5871
|
+
var React34 = __toESM(require("react"), 1);
|
|
5759
5872
|
var AVATAR_TONES = ["progress", "ready", "neutral", "warning"];
|
|
5760
5873
|
function initials(name) {
|
|
5761
5874
|
const parts = String(name || "?").trim().split(/\s+/);
|
|
5762
5875
|
return ((parts[0] || "?")[0] + (parts.length > 1 ? parts[parts.length - 1][0] : parts[0][1] || "")).toUpperCase();
|
|
5763
5876
|
}
|
|
5764
|
-
var Avatar =
|
|
5765
|
-
const size = props.size || "md", errState =
|
|
5877
|
+
var Avatar = React34.forwardRef(function Avatar2(props, ref) {
|
|
5878
|
+
const size = props.size || "md", errState = React34.useState(null);
|
|
5766
5879
|
let hash = 0;
|
|
5767
5880
|
String(props.name || "").split("").forEach(function(ch) {
|
|
5768
5881
|
hash = hash * 31 + ch.charCodeAt(0) >>> 0;
|
|
5769
5882
|
});
|
|
5770
5883
|
const tone2 = AVATAR_TONES[hash % AVATAR_TONES.length];
|
|
5771
|
-
return /* @__PURE__ */
|
|
5884
|
+
return /* @__PURE__ */ React34.createElement(
|
|
5772
5885
|
"span",
|
|
5773
5886
|
{
|
|
5774
5887
|
ref,
|
|
@@ -5776,7 +5889,7 @@ var Avatar = React33.forwardRef(function Avatar2(props, ref) {
|
|
|
5776
5889
|
role: "img",
|
|
5777
5890
|
"aria-label": props.name + (props.status ? ", " + props.status : "")
|
|
5778
5891
|
},
|
|
5779
|
-
props.src && errState[0] !== props.src ? /* @__PURE__ */
|
|
5892
|
+
props.src && errState[0] !== props.src ? /* @__PURE__ */ React34.createElement(
|
|
5780
5893
|
"img",
|
|
5781
5894
|
{
|
|
5782
5895
|
key: props.src,
|
|
@@ -5786,16 +5899,16 @@ var Avatar = React33.forwardRef(function Avatar2(props, ref) {
|
|
|
5786
5899
|
errState[1](props.src || null);
|
|
5787
5900
|
}
|
|
5788
5901
|
}
|
|
5789
|
-
) : /* @__PURE__ */
|
|
5790
|
-
props.status === "online" ? /* @__PURE__ */
|
|
5902
|
+
) : /* @__PURE__ */ React34.createElement("span", { "aria-hidden": true }, initials(props.name)),
|
|
5903
|
+
props.status === "online" ? /* @__PURE__ */ React34.createElement("span", { className: "aura-avatar__status", "aria-hidden": true }) : null
|
|
5791
5904
|
);
|
|
5792
5905
|
});
|
|
5793
5906
|
|
|
5794
5907
|
// src/Stack.tsx
|
|
5795
|
-
var
|
|
5908
|
+
var React36 = __toESM(require("react"), 1);
|
|
5796
5909
|
|
|
5797
5910
|
// src/responsive.tsx
|
|
5798
|
-
var
|
|
5911
|
+
var React35 = __toESM(require("react"), 1);
|
|
5799
5912
|
|
|
5800
5913
|
// src/breakpoints.ts
|
|
5801
5914
|
var breakpoints = { sm: 640, md: 768, lg: 1024, xl: 1280 };
|
|
@@ -5803,7 +5916,7 @@ var breakpoints = { sm: 640, md: 768, lg: 1024, xl: 1280 };
|
|
|
5803
5916
|
// src/responsive.tsx
|
|
5804
5917
|
var ORDER = ["base", "sm", "md", "lg", "xl"];
|
|
5805
5918
|
function useBreakpoint() {
|
|
5806
|
-
return
|
|
5919
|
+
return React35.useSyncExternalStore(subscribe, current, function() {
|
|
5807
5920
|
return "lg";
|
|
5808
5921
|
});
|
|
5809
5922
|
}
|
|
@@ -5843,8 +5956,8 @@ var space = function(v) {
|
|
|
5843
5956
|
};
|
|
5844
5957
|
|
|
5845
5958
|
// src/Stack.tsx
|
|
5846
|
-
var h5 =
|
|
5847
|
-
var Stack =
|
|
5959
|
+
var h5 = React36.createElement;
|
|
5960
|
+
var Stack = React36.forwardRef(function Stack2(props, ref) {
|
|
5848
5961
|
const style = Object.assign(
|
|
5849
5962
|
{},
|
|
5850
5963
|
respVars("aura-stack-dir", props.direction || "column"),
|
|
@@ -5858,9 +5971,9 @@ var Stack = React35.forwardRef(function Stack2(props, ref) {
|
|
|
5858
5971
|
});
|
|
5859
5972
|
|
|
5860
5973
|
// src/Grid.tsx
|
|
5861
|
-
var
|
|
5862
|
-
var h6 =
|
|
5863
|
-
var Grid =
|
|
5974
|
+
var React37 = __toESM(require("react"), 1);
|
|
5975
|
+
var h6 = React37.createElement;
|
|
5976
|
+
var Grid = React37.forwardRef(function Grid2(props, ref) {
|
|
5864
5977
|
const style = Object.assign(
|
|
5865
5978
|
{},
|
|
5866
5979
|
respVars("aura-grid-gap", props.gap == null ? 6 : props.gap, space),
|
|
@@ -5875,9 +5988,9 @@ var Grid = React36.forwardRef(function Grid2(props, ref) {
|
|
|
5875
5988
|
});
|
|
5876
5989
|
|
|
5877
5990
|
// src/Container.tsx
|
|
5878
|
-
var
|
|
5879
|
-
var h7 =
|
|
5880
|
-
var Container =
|
|
5991
|
+
var React38 = __toESM(require("react"), 1);
|
|
5992
|
+
var h7 = React38.createElement;
|
|
5993
|
+
var Container = React38.forwardRef(function Container2(props, ref) {
|
|
5881
5994
|
return h7(
|
|
5882
5995
|
props.as || "div",
|
|
5883
5996
|
{
|
|
@@ -5890,27 +6003,27 @@ var Container = React37.forwardRef(function Container2(props, ref) {
|
|
|
5890
6003
|
});
|
|
5891
6004
|
|
|
5892
6005
|
// src/AppShell.tsx
|
|
5893
|
-
var
|
|
5894
|
-
var AppShell =
|
|
6006
|
+
var React39 = __toESM(require("react"), 1);
|
|
6007
|
+
var AppShell = React39.forwardRef(function AppShell2(props, ref) {
|
|
5895
6008
|
const t = useStrings();
|
|
5896
6009
|
const bp = useBreakpoint();
|
|
5897
6010
|
const wide = bp === "lg" || bp === "xl";
|
|
5898
|
-
const st =
|
|
5899
|
-
|
|
6011
|
+
const st = React39.useState(false), open = st[0], setOpen = st[1];
|
|
6012
|
+
React39.useEffect(
|
|
5900
6013
|
function() {
|
|
5901
6014
|
if (wide) setOpen(false);
|
|
5902
6015
|
},
|
|
5903
6016
|
[wide]
|
|
5904
6017
|
);
|
|
5905
|
-
const navEl = props.nav &&
|
|
6018
|
+
const navEl = props.nav && React39.isValidElement(props.nav) ? props.nav : null;
|
|
5906
6019
|
const shared = !!navEl && navEl.props.value === void 0 && (navEl.props.defaultValue !== void 0 || navEl.props.sections !== void 0 || navEl.props.items !== void 0);
|
|
5907
|
-
const navState =
|
|
6020
|
+
const navState = React39.useState(navEl ? navEl.props.defaultValue : void 0);
|
|
5908
6021
|
function onNav(id) {
|
|
5909
6022
|
if (shared) navState[1](id);
|
|
5910
6023
|
if (navEl && navEl.props.onChange) navEl.props.onChange(id);
|
|
5911
6024
|
}
|
|
5912
|
-
const deskNav = navEl && shared ?
|
|
5913
|
-
const drawerNav = navEl ?
|
|
6025
|
+
const deskNav = navEl && shared ? React39.cloneElement(navEl, { value: navState[0], onChange: onNav }) : props.nav;
|
|
6026
|
+
const drawerNav = navEl ? React39.cloneElement(navEl, {
|
|
5914
6027
|
value: shared ? navState[0] : navEl.props.value,
|
|
5915
6028
|
onChange: function(id) {
|
|
5916
6029
|
onNav(id);
|
|
@@ -5920,7 +6033,7 @@ var AppShell = React38.forwardRef(function AppShell2(props, ref) {
|
|
|
5920
6033
|
collapsed: false,
|
|
5921
6034
|
collapsible: false
|
|
5922
6035
|
}) : props.nav;
|
|
5923
|
-
return /* @__PURE__ */
|
|
6036
|
+
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(
|
|
5924
6037
|
Drawer,
|
|
5925
6038
|
{
|
|
5926
6039
|
open,
|
|
@@ -5933,7 +6046,7 @@ var AppShell = React38.forwardRef(function AppShell2(props, ref) {
|
|
|
5933
6046
|
dismissible: true
|
|
5934
6047
|
},
|
|
5935
6048
|
drawerNav
|
|
5936
|
-
) : null, /* @__PURE__ */
|
|
6049
|
+
) : 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(
|
|
5937
6050
|
IconButton,
|
|
5938
6051
|
{
|
|
5939
6052
|
className: "aura-shell__menu",
|
|
@@ -5945,18 +6058,18 @@ var AppShell = React38.forwardRef(function AppShell2(props, ref) {
|
|
|
5945
6058
|
},
|
|
5946
6059
|
"aria-expanded": open
|
|
5947
6060
|
}
|
|
5948
|
-
) : null, /* @__PURE__ */
|
|
6061
|
+
) : 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));
|
|
5949
6062
|
});
|
|
5950
6063
|
|
|
5951
6064
|
// src/ActionBar.tsx
|
|
5952
|
-
var
|
|
5953
|
-
var ActionBar =
|
|
6065
|
+
var React40 = __toESM(require("react"), 1);
|
|
6066
|
+
var ActionBar = React40.forwardRef(function ActionBar2(props, ref) {
|
|
5954
6067
|
const t = useStrings();
|
|
5955
6068
|
const bulk = props.selected != null;
|
|
5956
6069
|
const idle = bulk && !props.selected;
|
|
5957
6070
|
const count = bulk && props.selected ? t.selectedCount(props.selected) : null;
|
|
5958
|
-
const cameFrom =
|
|
5959
|
-
const own =
|
|
6071
|
+
const cameFrom = React40.useRef(null);
|
|
6072
|
+
const own = React40.useRef(null);
|
|
5960
6073
|
function clear() {
|
|
5961
6074
|
props.onClearSelection();
|
|
5962
6075
|
setTimeout(function() {
|
|
@@ -5965,7 +6078,7 @@ var ActionBar = React39.forwardRef(function ActionBar2(props, ref) {
|
|
|
5965
6078
|
if ((!a || a === document.body || !a.isConnected) && back && back.isConnected) back.focus();
|
|
5966
6079
|
}, 0);
|
|
5967
6080
|
}
|
|
5968
|
-
return /* @__PURE__ */
|
|
6081
|
+
return /* @__PURE__ */ React40.createElement(
|
|
5969
6082
|
"div",
|
|
5970
6083
|
{
|
|
5971
6084
|
ref: function(el) {
|
|
@@ -5986,16 +6099,16 @@ var ActionBar = React39.forwardRef(function ActionBar2(props, ref) {
|
|
|
5986
6099
|
props.className
|
|
5987
6100
|
)
|
|
5988
6101
|
},
|
|
5989
|
-
/* @__PURE__ */
|
|
6102
|
+
/* @__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)
|
|
5990
6103
|
);
|
|
5991
6104
|
});
|
|
5992
6105
|
|
|
5993
6106
|
// src/Separator.tsx
|
|
5994
|
-
var
|
|
5995
|
-
var Separator =
|
|
6107
|
+
var React41 = __toESM(require("react"), 1);
|
|
6108
|
+
var Separator = React41.forwardRef(function Separator2(props, ref) {
|
|
5996
6109
|
const vertical = props.orientation === "vertical";
|
|
5997
6110
|
const decorative = props.decorative !== false;
|
|
5998
|
-
return /* @__PURE__ */
|
|
6111
|
+
return /* @__PURE__ */ React41.createElement(
|
|
5999
6112
|
"div",
|
|
6000
6113
|
{
|
|
6001
6114
|
ref,
|
|
@@ -6008,12 +6121,64 @@ var Separator = React40.forwardRef(function Separator2(props, ref) {
|
|
|
6008
6121
|
});
|
|
6009
6122
|
|
|
6010
6123
|
// src/Table.tsx
|
|
6011
|
-
var
|
|
6012
|
-
var
|
|
6013
|
-
|
|
6124
|
+
var React42 = __toESM(require("react"), 1);
|
|
6125
|
+
var StackLabels = React42.createContext(null);
|
|
6126
|
+
var ColumnIndex = React42.createContext(-1);
|
|
6127
|
+
function flat(children) {
|
|
6128
|
+
const out = [];
|
|
6129
|
+
React42.Children.toArray(children).forEach(function(c) {
|
|
6130
|
+
if (React42.isValidElement(c) && c.type === React42.Fragment)
|
|
6131
|
+
out.push.apply(out, flat(c.props.children));
|
|
6132
|
+
else out.push(c);
|
|
6133
|
+
});
|
|
6134
|
+
return out;
|
|
6135
|
+
}
|
|
6136
|
+
function text(node) {
|
|
6137
|
+
if (typeof node === "string" || typeof node === "number") return String(node);
|
|
6138
|
+
if (Array.isArray(node)) {
|
|
6139
|
+
const parts = node.map(text).filter(function(x) {
|
|
6140
|
+
return x != null;
|
|
6141
|
+
});
|
|
6142
|
+
return parts.length ? parts.join("") : void 0;
|
|
6143
|
+
}
|
|
6144
|
+
if (React42.isValidElement(node)) {
|
|
6145
|
+
const p = node.props;
|
|
6146
|
+
if (p["aria-hidden"] === true || p["aria-hidden"] === "true") return void 0;
|
|
6147
|
+
return text(p.children);
|
|
6148
|
+
}
|
|
6149
|
+
return void 0;
|
|
6150
|
+
}
|
|
6151
|
+
function headerLabels(children) {
|
|
6152
|
+
let out = [];
|
|
6153
|
+
flat(children).forEach(function(c) {
|
|
6154
|
+
if (out.length || !React42.isValidElement(c) || c.type !== THead) return;
|
|
6155
|
+
const row = flat(c.props.children).find(function(r) {
|
|
6156
|
+
return React42.isValidElement(r);
|
|
6157
|
+
});
|
|
6158
|
+
if (!row) return;
|
|
6159
|
+
flat(row.props.children).forEach(function(cell) {
|
|
6160
|
+
if (!React42.isValidElement(cell)) return;
|
|
6161
|
+
const p = cell.props;
|
|
6162
|
+
const t = text(p.children);
|
|
6163
|
+
const label = p.label != null ? p.label : t != null ? t.replace(/\s+/g, " ").trim() || void 0 : void 0;
|
|
6164
|
+
const span = Math.max(1, Number(p.colSpan) || 1);
|
|
6165
|
+
for (let i = 0; i < span; i++) out.push(label);
|
|
6166
|
+
});
|
|
6167
|
+
});
|
|
6168
|
+
return out;
|
|
6169
|
+
}
|
|
6170
|
+
var Table = React42.forwardRef(function Table2(props, ref) {
|
|
6171
|
+
const { caption, captionHidden, density, stackBelow, className, children, ...rest } = props;
|
|
6172
|
+
const labels = stackBelow ? headerLabels(children) : null;
|
|
6173
|
+
if (labels && !labels.length)
|
|
6174
|
+
devWarnOnce(
|
|
6175
|
+
"tbl-stack-labels",
|
|
6176
|
+
"Table stackBelow: no THead > Tr > Th found among its children, so cells have no labels. Pass `label` on each Td."
|
|
6177
|
+
);
|
|
6178
|
+
const outer = React42.useContext(StackLabels);
|
|
6014
6179
|
const capId = uid();
|
|
6015
|
-
const wrap =
|
|
6016
|
-
const sc =
|
|
6180
|
+
const wrap = React42.useRef(null);
|
|
6181
|
+
const sc = React42.useState(false), scrolls = sc[0];
|
|
6017
6182
|
useIsoLayoutEffect(function() {
|
|
6018
6183
|
const el = wrap.current;
|
|
6019
6184
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
@@ -6027,24 +6192,38 @@ var Table = React41.forwardRef(function Table2(props, ref) {
|
|
|
6027
6192
|
ro.disconnect();
|
|
6028
6193
|
};
|
|
6029
6194
|
}, []);
|
|
6030
|
-
return /* @__PURE__ */
|
|
6195
|
+
return /* @__PURE__ */ React42.createElement(
|
|
6031
6196
|
"div",
|
|
6032
6197
|
{
|
|
6033
6198
|
ref: wrap,
|
|
6034
|
-
className: "aura-tbl-wrap",
|
|
6199
|
+
className: cx("aura-tbl-wrap", stackBelow && "is-stackable"),
|
|
6035
6200
|
"data-density": density,
|
|
6036
6201
|
tabIndex: scrolls ? 0 : void 0,
|
|
6037
6202
|
role: scrolls && (caption != null || rest["aria-label"]) ? "region" : void 0,
|
|
6038
6203
|
"aria-labelledby": scrolls && caption != null ? capId : void 0,
|
|
6039
6204
|
"aria-label": scrolls && caption == null ? rest["aria-label"] : void 0
|
|
6040
6205
|
},
|
|
6041
|
-
/* @__PURE__ */
|
|
6206
|
+
/* @__PURE__ */ React42.createElement(
|
|
6207
|
+
"table",
|
|
6208
|
+
{
|
|
6209
|
+
ref,
|
|
6210
|
+
className: cx("aura-tbl", stackBelow && "aura-tbl--stack-" + stackBelow, className),
|
|
6211
|
+
role: stackBelow ? "table" : void 0,
|
|
6212
|
+
...rest
|
|
6213
|
+
},
|
|
6214
|
+
caption != null ? /* @__PURE__ */ React42.createElement("caption", { id: capId, className: cx("aura-tbl__caption", captionHidden && "aura-sr-only") }, caption) : null,
|
|
6215
|
+
labels ? /* @__PURE__ */ React42.createElement(StackLabels.Provider, { value: labels }, children) : outer ? /* @__PURE__ */ React42.createElement(StackLabels.Provider, { value: null }, children) : children
|
|
6216
|
+
)
|
|
6042
6217
|
);
|
|
6043
6218
|
});
|
|
6044
6219
|
function section(tag, cls) {
|
|
6045
|
-
const C =
|
|
6220
|
+
const C = React42.forwardRef(function TableSection(props, ref) {
|
|
6046
6221
|
const { className, ...rest } = props;
|
|
6047
|
-
|
|
6222
|
+
const stacked = React42.useContext(StackLabels) != null;
|
|
6223
|
+
return React42.createElement(
|
|
6224
|
+
tag,
|
|
6225
|
+
Object.assign({ ref, className: cx(cls, className), role: stacked ? "rowgroup" : void 0 }, rest)
|
|
6226
|
+
);
|
|
6048
6227
|
});
|
|
6049
6228
|
return C;
|
|
6050
6229
|
}
|
|
@@ -6054,9 +6233,15 @@ var TBody = section("tbody", "aura-tbl__body");
|
|
|
6054
6233
|
TBody.displayName = "TBody";
|
|
6055
6234
|
var TFoot = section("tfoot", "aura-tbl__foot");
|
|
6056
6235
|
TFoot.displayName = "TFoot";
|
|
6057
|
-
var Tr =
|
|
6058
|
-
const { className, ...rest } = props;
|
|
6059
|
-
|
|
6236
|
+
var Tr = React42.forwardRef(function Tr2(props, ref) {
|
|
6237
|
+
const { className, children, ...rest } = props;
|
|
6238
|
+
const stacked = React42.useContext(StackLabels) != null;
|
|
6239
|
+
let col = 0;
|
|
6240
|
+
return /* @__PURE__ */ React42.createElement("tr", { ref, className: cx("aura-tbl__row", className), role: stacked ? "row" : void 0, ...rest }, stacked ? flat(children).map(function(c) {
|
|
6241
|
+
const at = col;
|
|
6242
|
+
if (React42.isValidElement(c)) col += Math.max(1, Number(c.props.colSpan) || 1);
|
|
6243
|
+
return /* @__PURE__ */ React42.createElement(ColumnIndex.Provider, { key: React42.isValidElement(c) && c.key != null ? c.key : at, value: at }, c);
|
|
6244
|
+
}) : children);
|
|
6060
6245
|
});
|
|
6061
6246
|
function cellClass(base, p) {
|
|
6062
6247
|
const align = p.align || (p.numeric ? "end" : void 0);
|
|
@@ -6069,18 +6254,39 @@ function cellClass(base, p) {
|
|
|
6069
6254
|
p.className
|
|
6070
6255
|
);
|
|
6071
6256
|
}
|
|
6072
|
-
var Th =
|
|
6073
|
-
const { align, numeric, mono, className, scope, ...rest } = props;
|
|
6074
|
-
|
|
6257
|
+
var Th = React42.forwardRef(function Th2(props, ref) {
|
|
6258
|
+
const { align, numeric, mono, className, scope, label, ...rest } = props;
|
|
6259
|
+
const stacked = React42.useContext(StackLabels) != null;
|
|
6260
|
+
return /* @__PURE__ */ React42.createElement(
|
|
6261
|
+
"th",
|
|
6262
|
+
{
|
|
6263
|
+
ref,
|
|
6264
|
+
scope: scope || "col",
|
|
6265
|
+
className: cellClass("aura-tbl__th", props),
|
|
6266
|
+
role: stacked ? scope === "row" ? "rowheader" : "columnheader" : void 0,
|
|
6267
|
+
...rest
|
|
6268
|
+
}
|
|
6269
|
+
);
|
|
6075
6270
|
});
|
|
6076
|
-
var Td =
|
|
6077
|
-
const { align, numeric, mono, className, scope, ...rest } = props;
|
|
6078
|
-
|
|
6271
|
+
var Td = React42.forwardRef(function Td2(props, ref) {
|
|
6272
|
+
const { align, numeric, mono, className, scope, label, ...rest } = props;
|
|
6273
|
+
const labels = React42.useContext(StackLabels), col = React42.useContext(ColumnIndex);
|
|
6274
|
+
const shown = labels ? label != null ? label : col >= 0 ? labels[col] : void 0 : void 0;
|
|
6275
|
+
return /* @__PURE__ */ React42.createElement(
|
|
6276
|
+
"td",
|
|
6277
|
+
{
|
|
6278
|
+
ref,
|
|
6279
|
+
className: cellClass("aura-tbl__td", props),
|
|
6280
|
+
role: labels ? "cell" : void 0,
|
|
6281
|
+
"data-label": shown || void 0,
|
|
6282
|
+
...rest
|
|
6283
|
+
}
|
|
6284
|
+
);
|
|
6079
6285
|
});
|
|
6080
6286
|
|
|
6081
6287
|
// src/BottomNav.tsx
|
|
6082
|
-
var
|
|
6083
|
-
var BottomNav =
|
|
6288
|
+
var React43 = __toESM(require("react"), 1);
|
|
6289
|
+
var BottomNav = React43.forwardRef(function BottomNav2(props, ref) {
|
|
6084
6290
|
const t = useStrings();
|
|
6085
6291
|
const Link = useLinkComponent(props.linkComponent);
|
|
6086
6292
|
const st = useMaybeControlled(
|
|
@@ -6090,14 +6296,14 @@ var BottomNav = React42.forwardRef(function BottomNav2(props, ref) {
|
|
|
6090
6296
|
);
|
|
6091
6297
|
const active = st[0];
|
|
6092
6298
|
const hide = props.hideFrom === false ? "always" : "below-" + (props.hideFrom || "lg");
|
|
6093
|
-
return /* @__PURE__ */
|
|
6299
|
+
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(
|
|
6094
6300
|
"nav",
|
|
6095
6301
|
{
|
|
6096
6302
|
ref,
|
|
6097
6303
|
className: cx("aura-bottomnav", "aura-bottomnav--" + hide, props.className),
|
|
6098
6304
|
"aria-label": props.label || t.mainNav
|
|
6099
6305
|
},
|
|
6100
|
-
/* @__PURE__ */
|
|
6306
|
+
/* @__PURE__ */ React43.createElement("ul", { className: "aura-bottomnav__list" }, props.items.map(function(it) {
|
|
6101
6307
|
const on = active === it.id;
|
|
6102
6308
|
const count = it.count != null && it.count > 0 ? it.count > 99 ? "99+" : String(it.count) : null;
|
|
6103
6309
|
const suffix = count || it.badge && it.badgeLabel ? " (" + (count || it.badgeLabel) + ")" : "";
|
|
@@ -6113,19 +6319,19 @@ var BottomNav = React42.forwardRef(function BottomNav2(props, ref) {
|
|
|
6113
6319
|
}
|
|
6114
6320
|
};
|
|
6115
6321
|
const inner = [
|
|
6116
|
-
/* @__PURE__ */
|
|
6117
|
-
/* @__PURE__ */
|
|
6118
|
-
suffix && !it.ariaLabel ? /* @__PURE__ */
|
|
6322
|
+
/* @__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),
|
|
6323
|
+
/* @__PURE__ */ React43.createElement("span", { key: "l", className: "aura-bottomnav__label" }, it.label),
|
|
6324
|
+
suffix && !it.ariaLabel ? /* @__PURE__ */ React43.createElement("span", { key: "s", className: "aura-sr-only" }, suffix) : null
|
|
6119
6325
|
];
|
|
6120
|
-
return /* @__PURE__ */
|
|
6326
|
+
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));
|
|
6121
6327
|
}))
|
|
6122
6328
|
));
|
|
6123
6329
|
});
|
|
6124
6330
|
|
|
6125
6331
|
// src/Surface.tsx
|
|
6126
|
-
var
|
|
6127
|
-
var h8 =
|
|
6128
|
-
var Surface =
|
|
6332
|
+
var React44 = __toESM(require("react"), 1);
|
|
6333
|
+
var h8 = React44.createElement;
|
|
6334
|
+
var Surface = React44.forwardRef(function Surface2(props, ref) {
|
|
6129
6335
|
const t = props.texture || "mesh";
|
|
6130
6336
|
const rest = omit(props, ["texture", "className", "children", "as"]);
|
|
6131
6337
|
return h8(
|
|
@@ -6146,8 +6352,8 @@ var Surface = React43.forwardRef(function Surface2(props, ref) {
|
|
|
6146
6352
|
});
|
|
6147
6353
|
|
|
6148
6354
|
// src/Stat.tsx
|
|
6149
|
-
var
|
|
6150
|
-
var Stat =
|
|
6355
|
+
var React45 = __toESM(require("react"), 1);
|
|
6356
|
+
var Stat = React45.forwardRef(function Stat2(props, ref) {
|
|
6151
6357
|
const ch = props.change;
|
|
6152
6358
|
const dir = ch && (ch.direction || "flat");
|
|
6153
6359
|
const tone2 = ch && (ch.tone || (dir === "up" ? "positive" : dir === "down" ? "negative" : "neutral"));
|
|
@@ -6156,7 +6362,7 @@ var Stat = React44.forwardRef(function Stat2(props, ref) {
|
|
|
6156
6362
|
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, ""));
|
|
6157
6363
|
const Tag3 = props.href ? Link : props.onClick ? "button" : "div";
|
|
6158
6364
|
const interactive = !!(props.href || props.onClick);
|
|
6159
|
-
return /* @__PURE__ */
|
|
6365
|
+
return /* @__PURE__ */ React45.createElement(
|
|
6160
6366
|
Tag3,
|
|
6161
6367
|
{
|
|
6162
6368
|
ref,
|
|
@@ -6166,14 +6372,14 @@ var Stat = React44.forwardRef(function Stat2(props, ref) {
|
|
|
6166
6372
|
type: Tag3 === "button" ? "button" : void 0,
|
|
6167
6373
|
"aria-busy": props.loading || void 0
|
|
6168
6374
|
},
|
|
6169
|
-
/* @__PURE__ */
|
|
6170
|
-
props.loading ? /* @__PURE__ */
|
|
6171
|
-
ch && !props.loading || props.caption ? /* @__PURE__ */
|
|
6375
|
+
/* @__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),
|
|
6376
|
+
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),
|
|
6377
|
+
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
|
|
6172
6378
|
);
|
|
6173
6379
|
});
|
|
6174
6380
|
|
|
6175
6381
|
// src/TimePicker.tsx
|
|
6176
|
-
var
|
|
6382
|
+
var React46 = __toESM(require("react"), 1);
|
|
6177
6383
|
var import_react_dom11 = require("react-dom");
|
|
6178
6384
|
|
|
6179
6385
|
// src/text.ts
|
|
@@ -6190,8 +6396,8 @@ function formatBytes(n2) {
|
|
|
6190
6396
|
function pad2(n2) {
|
|
6191
6397
|
return (n2 < 10 ? "0" : "") + n2;
|
|
6192
6398
|
}
|
|
6193
|
-
function parseTime(
|
|
6194
|
-
let s = String(
|
|
6399
|
+
function parseTime(text2) {
|
|
6400
|
+
let s = String(text2 || "").trim().toLowerCase().replace(/\s*(น\.?|นาฬิกา)$/, "").trim();
|
|
6195
6401
|
const pm = /\s*(pm|p\.m\.)$/.test(s), am = /\s*(am|a\.m\.)$/.test(s);
|
|
6196
6402
|
s = s.replace(/\s*(am|pm|a\.m\.|p\.m\.)$/, "");
|
|
6197
6403
|
const m = /^(\d{1,2})(?:[:.](\d{2}))?$/.exec(s) || /^(\d{1,2})(\d{2})$/.exec(s);
|
|
@@ -6215,7 +6421,7 @@ function toMin(t) {
|
|
|
6215
6421
|
function fromMin(n2) {
|
|
6216
6422
|
return pad3(Math.floor(n2 / 60)) + ":" + pad3(n2 % 60);
|
|
6217
6423
|
}
|
|
6218
|
-
var TimePicker =
|
|
6424
|
+
var TimePicker = React46.forwardRef(function TimePicker2(props, ref) {
|
|
6219
6425
|
const t = useStrings();
|
|
6220
6426
|
const auto = uid(), id = props.id || auto, listId = id + "-list";
|
|
6221
6427
|
const st = useMaybeControlled(
|
|
@@ -6225,7 +6431,7 @@ var TimePicker = React45.forwardRef(function TimePicker2(props, ref) {
|
|
|
6225
6431
|
);
|
|
6226
6432
|
const value = st[0];
|
|
6227
6433
|
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;
|
|
6228
|
-
const slots =
|
|
6434
|
+
const slots = React46.useMemo(
|
|
6229
6435
|
function() {
|
|
6230
6436
|
const out = [];
|
|
6231
6437
|
for (let m = lo; m <= hi; m += step) out.push(fromMin(m));
|
|
@@ -6237,12 +6443,12 @@ var TimePicker = React45.forwardRef(function TimePicker2(props, ref) {
|
|
|
6237
6443
|
const n2 = toMin(v);
|
|
6238
6444
|
return n2 == null || n2 < lo || n2 > hi || props.isTimeDisabled && props.isTimeDisabled(v);
|
|
6239
6445
|
}
|
|
6240
|
-
const openState =
|
|
6241
|
-
const editState =
|
|
6242
|
-
const aState =
|
|
6243
|
-
const errState =
|
|
6244
|
-
const pos =
|
|
6245
|
-
const boxRef =
|
|
6446
|
+
const openState = React46.useState(false), open = openState[0], setOpen = openState[1];
|
|
6447
|
+
const editState = React46.useState(null), editing = editState[0], setEditing = editState[1];
|
|
6448
|
+
const aState = React46.useState(0), active = aState[0], setActive = aState[1];
|
|
6449
|
+
const errState = React46.useState(null);
|
|
6450
|
+
const pos = React46.useState(null);
|
|
6451
|
+
const boxRef = React46.useRef(null), inputRef = React46.useRef(null), listRef = React46.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
6246
6452
|
const mounted = useMounted();
|
|
6247
6453
|
function nearest(v) {
|
|
6248
6454
|
const n2 = toMin(v);
|
|
@@ -6270,7 +6476,7 @@ var TimePicker = React45.forwardRef(function TimePicker2(props, ref) {
|
|
|
6270
6476
|
},
|
|
6271
6477
|
[open]
|
|
6272
6478
|
);
|
|
6273
|
-
|
|
6479
|
+
React46.useEffect(
|
|
6274
6480
|
function() {
|
|
6275
6481
|
if (!open) return;
|
|
6276
6482
|
function outside(e) {
|
|
@@ -6292,7 +6498,7 @@ var TimePicker = React45.forwardRef(function TimePicker2(props, ref) {
|
|
|
6292
6498
|
},
|
|
6293
6499
|
[open]
|
|
6294
6500
|
);
|
|
6295
|
-
|
|
6501
|
+
React46.useEffect(
|
|
6296
6502
|
function() {
|
|
6297
6503
|
if (!open || !listRef.current) return;
|
|
6298
6504
|
const el = listRef.current.querySelector('[data-idx="' + active + '"]');
|
|
@@ -6391,9 +6597,9 @@ var TimePicker = React45.forwardRef(function TimePicker2(props, ref) {
|
|
|
6391
6597
|
}
|
|
6392
6598
|
const error = errState[0] || props.error;
|
|
6393
6599
|
const list = open && mounted && pos[0] ? (0, import_react_dom11.createPortal)(
|
|
6394
|
-
/* @__PURE__ */
|
|
6600
|
+
/* @__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) {
|
|
6395
6601
|
const dis = blocked(s), sel = s === value;
|
|
6396
|
-
return /* @__PURE__ */
|
|
6602
|
+
return /* @__PURE__ */ React46.createElement(
|
|
6397
6603
|
"li",
|
|
6398
6604
|
{
|
|
6399
6605
|
key: s,
|
|
@@ -6418,13 +6624,13 @@ var TimePicker = React45.forwardRef(function TimePicker2(props, ref) {
|
|
|
6418
6624
|
if (active !== i) setActive(i);
|
|
6419
6625
|
}
|
|
6420
6626
|
},
|
|
6421
|
-
/* @__PURE__ */
|
|
6422
|
-
sel ? /* @__PURE__ */
|
|
6627
|
+
/* @__PURE__ */ React46.createElement("span", { className: "aura-combo__label" }, s),
|
|
6628
|
+
sel ? /* @__PURE__ */ React46.createElement(Icon, { name: "check", className: "aura-combo__check" }) : null
|
|
6423
6629
|
);
|
|
6424
6630
|
}))),
|
|
6425
6631
|
document.body
|
|
6426
6632
|
) : null;
|
|
6427
|
-
return /* @__PURE__ */
|
|
6633
|
+
return /* @__PURE__ */ React46.createElement(
|
|
6428
6634
|
Field,
|
|
6429
6635
|
{
|
|
6430
6636
|
id,
|
|
@@ -6436,7 +6642,7 @@ var TimePicker = React45.forwardRef(function TimePicker2(props, ref) {
|
|
|
6436
6642
|
disabled: props.disabled,
|
|
6437
6643
|
className: props.className
|
|
6438
6644
|
},
|
|
6439
|
-
/* @__PURE__ */
|
|
6645
|
+
/* @__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(
|
|
6440
6646
|
"input",
|
|
6441
6647
|
{
|
|
6442
6648
|
ref: inputMerged,
|
|
@@ -6476,7 +6682,7 @@ var TimePicker = React45.forwardRef(function TimePicker2(props, ref) {
|
|
|
6476
6682
|
}, 0);
|
|
6477
6683
|
}
|
|
6478
6684
|
}
|
|
6479
|
-
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */
|
|
6685
|
+
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */ React46.createElement(
|
|
6480
6686
|
"button",
|
|
6481
6687
|
{
|
|
6482
6688
|
type: "button",
|
|
@@ -6489,8 +6695,8 @@ var TimePicker = React45.forwardRef(function TimePicker2(props, ref) {
|
|
|
6489
6695
|
if (inputRef.current) inputRef.current.focus();
|
|
6490
6696
|
}
|
|
6491
6697
|
},
|
|
6492
|
-
/* @__PURE__ */
|
|
6493
|
-
) : null, /* @__PURE__ */
|
|
6698
|
+
/* @__PURE__ */ React46.createElement(Icon, { name: "x" })
|
|
6699
|
+
) : null, /* @__PURE__ */ React46.createElement(
|
|
6494
6700
|
"button",
|
|
6495
6701
|
{
|
|
6496
6702
|
type: "button",
|
|
@@ -6508,14 +6714,14 @@ var TimePicker = React45.forwardRef(function TimePicker2(props, ref) {
|
|
|
6508
6714
|
}
|
|
6509
6715
|
}
|
|
6510
6716
|
},
|
|
6511
|
-
/* @__PURE__ */
|
|
6717
|
+
/* @__PURE__ */ React46.createElement(Icon, { name: "chevron-down" })
|
|
6512
6718
|
)),
|
|
6513
6719
|
list
|
|
6514
6720
|
);
|
|
6515
6721
|
});
|
|
6516
6722
|
|
|
6517
6723
|
// src/FileUpload.tsx
|
|
6518
|
-
var
|
|
6724
|
+
var React47 = __toESM(require("react"), 1);
|
|
6519
6725
|
function matches(file, accept) {
|
|
6520
6726
|
if (!accept) return true;
|
|
6521
6727
|
const name = (file.name || "").toLowerCase(), type = (file.type || "").toLowerCase();
|
|
@@ -6539,24 +6745,24 @@ function describeAccept(accept, t) {
|
|
|
6539
6745
|
}).join(", ");
|
|
6540
6746
|
}
|
|
6541
6747
|
var seq = 0;
|
|
6542
|
-
var FileUpload =
|
|
6748
|
+
var FileUpload = React47.forwardRef(function FileUpload2(props, ref) {
|
|
6543
6749
|
const t = useStrings();
|
|
6544
6750
|
const auto = uid(), id = props.id || auto;
|
|
6545
6751
|
const st = useMaybeControlled(props.value, props.defaultValue || [], props.onChange);
|
|
6546
6752
|
const items2 = st[0] || [];
|
|
6547
|
-
const dragState =
|
|
6548
|
-
const inputRef =
|
|
6549
|
-
const urls =
|
|
6753
|
+
const dragState = React47.useState(false), over = dragState[0];
|
|
6754
|
+
const inputRef = React47.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
6755
|
+
const urls = React47.useRef({});
|
|
6550
6756
|
const maxFiles = props.multiple ? props.maxFiles : 1;
|
|
6551
6757
|
const note = t.accepts(describeAccept(props.accept, t), props.maxSize ? formatBytes(props.maxSize) : "");
|
|
6552
|
-
|
|
6758
|
+
React47.useEffect(function() {
|
|
6553
6759
|
return function() {
|
|
6554
6760
|
Object.keys(urls.current).forEach(function(k) {
|
|
6555
6761
|
URL.revokeObjectURL(urls.current[k]);
|
|
6556
6762
|
});
|
|
6557
6763
|
};
|
|
6558
6764
|
}, []);
|
|
6559
|
-
|
|
6765
|
+
React47.useEffect(
|
|
6560
6766
|
function() {
|
|
6561
6767
|
const el = inputRef.current;
|
|
6562
6768
|
if (!el || !props.name || typeof DataTransfer === "undefined") return;
|
|
@@ -6616,7 +6822,7 @@ var FileUpload = React46.forwardRef(function FileUpload2(props, ref) {
|
|
|
6616
6822
|
if (inputRef.current) inputRef.current.focus();
|
|
6617
6823
|
}
|
|
6618
6824
|
const error = props.error;
|
|
6619
|
-
return /* @__PURE__ */
|
|
6825
|
+
return /* @__PURE__ */ React47.createElement(
|
|
6620
6826
|
Field,
|
|
6621
6827
|
{
|
|
6622
6828
|
id,
|
|
@@ -6628,7 +6834,7 @@ var FileUpload = React46.forwardRef(function FileUpload2(props, ref) {
|
|
|
6628
6834
|
disabled: props.disabled,
|
|
6629
6835
|
className: props.className
|
|
6630
6836
|
},
|
|
6631
|
-
/* @__PURE__ */
|
|
6837
|
+
/* @__PURE__ */ React47.createElement(
|
|
6632
6838
|
"div",
|
|
6633
6839
|
{
|
|
6634
6840
|
className: cx("aura-upload", over && "is-over", props.disabled && "is-disabled", error && "is-invalid"),
|
|
@@ -6649,9 +6855,9 @@ var FileUpload = React46.forwardRef(function FileUpload2(props, ref) {
|
|
|
6649
6855
|
add(e.dataTransfer && e.dataTransfer.files);
|
|
6650
6856
|
}
|
|
6651
6857
|
},
|
|
6652
|
-
/* @__PURE__ */
|
|
6653
|
-
/* @__PURE__ */
|
|
6654
|
-
/* @__PURE__ */
|
|
6858
|
+
/* @__PURE__ */ React47.createElement(Icon, { name: "cloud-upload", size: "lg", className: "aura-upload__icon" }),
|
|
6859
|
+
/* @__PURE__ */ React47.createElement("span", { className: "aura-upload__text" }, t.dropFiles, " "),
|
|
6860
|
+
/* @__PURE__ */ React47.createElement(
|
|
6655
6861
|
"input",
|
|
6656
6862
|
{
|
|
6657
6863
|
ref: inputMerged,
|
|
@@ -6673,12 +6879,12 @@ var FileUpload = React46.forwardRef(function FileUpload2(props, ref) {
|
|
|
6673
6879
|
}
|
|
6674
6880
|
}
|
|
6675
6881
|
),
|
|
6676
|
-
/* @__PURE__ */
|
|
6677
|
-
note ? /* @__PURE__ */
|
|
6882
|
+
/* @__PURE__ */ React47.createElement("span", { className: "aura-upload__browse", "aria-hidden": true }, props.multiple ? t.browse : t.browseOne),
|
|
6883
|
+
note ? /* @__PURE__ */ React47.createElement("span", { className: "aura-upload__note", id: id + "-note" }, note) : null
|
|
6678
6884
|
),
|
|
6679
|
-
items2.length ? /* @__PURE__ */
|
|
6885
|
+
items2.length ? /* @__PURE__ */ React47.createElement("ul", { className: "aura-upload__list", "aria-live": "polite" }, items2.map(function(it) {
|
|
6680
6886
|
const src = thumb(it);
|
|
6681
|
-
return /* @__PURE__ */
|
|
6887
|
+
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(
|
|
6682
6888
|
"span",
|
|
6683
6889
|
{
|
|
6684
6890
|
className: "aura-upload__bar",
|
|
@@ -6688,8 +6894,8 @@ var FileUpload = React46.forwardRef(function FileUpload2(props, ref) {
|
|
|
6688
6894
|
"aria-valuemax": 100,
|
|
6689
6895
|
"aria-valuenow": it.progress != null ? Math.round(it.progress) : void 0
|
|
6690
6896
|
},
|
|
6691
|
-
/* @__PURE__ */
|
|
6692
|
-
) : null), /* @__PURE__ */
|
|
6897
|
+
/* @__PURE__ */ React47.createElement("span", { style: { width: (it.progress || 0) + "%" } })
|
|
6898
|
+
) : null), /* @__PURE__ */ React47.createElement(
|
|
6693
6899
|
IconButton,
|
|
6694
6900
|
{
|
|
6695
6901
|
icon: "x",
|
|
@@ -6977,9 +7183,9 @@ function createTheme(opts) {
|
|
|
6977
7183
|
}
|
|
6978
7184
|
|
|
6979
7185
|
// src/ThemeStyle.tsx
|
|
6980
|
-
var
|
|
7186
|
+
var React48 = __toESM(require("react"), 1);
|
|
6981
7187
|
function ThemeStyle(props) {
|
|
6982
|
-
const css =
|
|
7188
|
+
const css = React48.useMemo(
|
|
6983
7189
|
function() {
|
|
6984
7190
|
try {
|
|
6985
7191
|
return createTheme({
|
|
@@ -6996,11 +7202,11 @@ function ThemeStyle(props) {
|
|
|
6996
7202
|
[props.brand, props.signal, props.primary, props.name, props.selector]
|
|
6997
7203
|
);
|
|
6998
7204
|
if (css === null) return null;
|
|
6999
|
-
return /* @__PURE__ */
|
|
7205
|
+
return /* @__PURE__ */ React48.createElement("style", { "data-aura-theme": props.name || props.brand, dangerouslySetInnerHTML: { __html: css } });
|
|
7000
7206
|
}
|
|
7001
7207
|
|
|
7002
7208
|
// src/colorScheme.tsx
|
|
7003
|
-
var
|
|
7209
|
+
var React49 = __toESM(require("react"), 1);
|
|
7004
7210
|
|
|
7005
7211
|
// src/colorSchemeScript.ts
|
|
7006
7212
|
var DEFAULT_KEY = "aura-color-scheme";
|
|
@@ -7017,7 +7223,7 @@ function colorSchemeScript(options) {
|
|
|
7017
7223
|
|
|
7018
7224
|
// src/colorScheme.tsx
|
|
7019
7225
|
function ColorSchemeScript(props) {
|
|
7020
|
-
return /* @__PURE__ */
|
|
7226
|
+
return /* @__PURE__ */ React49.createElement(
|
|
7021
7227
|
"script",
|
|
7022
7228
|
{
|
|
7023
7229
|
"data-aura-color-scheme": "",
|
|
@@ -7042,7 +7248,7 @@ function apply(scheme) {
|
|
|
7042
7248
|
function useColorScheme(options) {
|
|
7043
7249
|
const key = options && options.storageKey || DEFAULT_KEY;
|
|
7044
7250
|
const fallback = options && options.defaultScheme || "system";
|
|
7045
|
-
const subscribe2 =
|
|
7251
|
+
const subscribe2 = React49.useCallback(
|
|
7046
7252
|
function(cb) {
|
|
7047
7253
|
const mq = window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null;
|
|
7048
7254
|
function onSystem() {
|
|
@@ -7064,7 +7270,7 @@ function useColorScheme(options) {
|
|
|
7064
7270
|
},
|
|
7065
7271
|
[fallback, key]
|
|
7066
7272
|
);
|
|
7067
|
-
const snapshot =
|
|
7273
|
+
const snapshot = React49.useSyncExternalStore(
|
|
7068
7274
|
subscribe2,
|
|
7069
7275
|
function() {
|
|
7070
7276
|
const s = readScheme(fallback);
|
|
@@ -7075,7 +7281,7 @@ function useColorScheme(options) {
|
|
|
7075
7281
|
}
|
|
7076
7282
|
);
|
|
7077
7283
|
const parts = snapshot.split("|");
|
|
7078
|
-
const setScheme =
|
|
7284
|
+
const setScheme = React49.useCallback(
|
|
7079
7285
|
function(next) {
|
|
7080
7286
|
if (!valid(next)) return;
|
|
7081
7287
|
try {
|
|
@@ -7094,11 +7300,11 @@ function ColorSchemeToggle(props) {
|
|
|
7094
7300
|
const cs = useColorScheme(props);
|
|
7095
7301
|
const names = { light: t.schemeLight, dark: t.schemeDark, system: t.schemeSystem };
|
|
7096
7302
|
const label = props.label || t.colorScheme;
|
|
7097
|
-
return /* @__PURE__ */
|
|
7303
|
+
return /* @__PURE__ */ React49.createElement(
|
|
7098
7304
|
DropdownMenu,
|
|
7099
7305
|
{
|
|
7100
7306
|
label,
|
|
7101
|
-
trigger: /* @__PURE__ */
|
|
7307
|
+
trigger: /* @__PURE__ */ React49.createElement(IconButton, { icon: cs.resolved === "dark" ? "moon" : "sun", label: label + ": " + names[cs.scheme] }),
|
|
7102
7308
|
items: SCHEMES.map(function(s) {
|
|
7103
7309
|
return {
|
|
7104
7310
|
label: names[s],
|
|
@@ -7113,35 +7319,19 @@ function ColorSchemeToggle(props) {
|
|
|
7113
7319
|
}
|
|
7114
7320
|
|
|
7115
7321
|
// src/Badge.tsx
|
|
7116
|
-
var
|
|
7117
|
-
var Badge =
|
|
7118
|
-
|
|
7119
|
-
return /* @__PURE__ */ React49.createElement(
|
|
7120
|
-
"span",
|
|
7121
|
-
{
|
|
7122
|
-
...rest,
|
|
7123
|
-
ref,
|
|
7124
|
-
className: cx(
|
|
7125
|
-
"aura-badge",
|
|
7126
|
-
"aura-badge--" + tone(props.tone),
|
|
7127
|
-
props.variant === "solid" && "is-solid",
|
|
7128
|
-
props.variant === "outline" && "is-outline",
|
|
7129
|
-
props.className
|
|
7130
|
-
)
|
|
7131
|
-
},
|
|
7132
|
-
props.icon ? /* @__PURE__ */ React49.createElement(Icon, { name: props.icon, size: 12 }) : null,
|
|
7133
|
-
props.children
|
|
7134
|
-
);
|
|
7322
|
+
var React50 = __toESM(require("react"), 1);
|
|
7323
|
+
var Badge = React50.forwardRef(function Badge2(props, ref) {
|
|
7324
|
+
return badgeElement(props, ref);
|
|
7135
7325
|
});
|
|
7136
7326
|
|
|
7137
7327
|
// src/Progress.tsx
|
|
7138
|
-
var
|
|
7139
|
-
var Progress =
|
|
7328
|
+
var React51 = __toESM(require("react"), 1);
|
|
7329
|
+
var Progress = React51.forwardRef(function Progress2(props, ref) {
|
|
7140
7330
|
const auto = uid(), id = props.id || auto;
|
|
7141
7331
|
const max = props.max || 100, det = props.value != null;
|
|
7142
7332
|
const pct = det ? Math.max(0, Math.min(100, props.value / max * 100)) : 0;
|
|
7143
7333
|
const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
|
|
7144
|
-
return /* @__PURE__ */
|
|
7334
|
+
return /* @__PURE__ */ React51.createElement(
|
|
7145
7335
|
"div",
|
|
7146
7336
|
{
|
|
7147
7337
|
ref,
|
|
@@ -7152,8 +7342,8 @@ var Progress = React50.forwardRef(function Progress2(props, ref) {
|
|
|
7152
7342
|
props.className
|
|
7153
7343
|
)
|
|
7154
7344
|
},
|
|
7155
|
-
props.label || props.showValue && shown ? /* @__PURE__ */
|
|
7156
|
-
/* @__PURE__ */
|
|
7345
|
+
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,
|
|
7346
|
+
/* @__PURE__ */ React51.createElement(
|
|
7157
7347
|
"div",
|
|
7158
7348
|
{
|
|
7159
7349
|
className: cx("aura-progress__track", !det && "is-indeterminate"),
|
|
@@ -7165,21 +7355,21 @@ var Progress = React50.forwardRef(function Progress2(props, ref) {
|
|
|
7165
7355
|
"aria-valuenow": det ? props.value : void 0,
|
|
7166
7356
|
"aria-valuetext": det && props.valueLabel != null ? String(props.valueLabel) : void 0
|
|
7167
7357
|
},
|
|
7168
|
-
/* @__PURE__ */
|
|
7358
|
+
/* @__PURE__ */ React51.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 })
|
|
7169
7359
|
),
|
|
7170
|
-
props.hint ? /* @__PURE__ */
|
|
7360
|
+
props.hint ? /* @__PURE__ */ React51.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
|
|
7171
7361
|
);
|
|
7172
7362
|
});
|
|
7173
7363
|
|
|
7174
7364
|
// src/Skeleton.tsx
|
|
7175
|
-
var
|
|
7176
|
-
var Skeleton =
|
|
7365
|
+
var React52 = __toESM(require("react"), 1);
|
|
7366
|
+
var Skeleton = React52.forwardRef(function Skeleton2(props, ref) {
|
|
7177
7367
|
const v = props.variant || "text";
|
|
7178
7368
|
if (v === "text" && (props.lines || 1) > 1) {
|
|
7179
7369
|
const n2 = props.lines, rows = [];
|
|
7180
7370
|
for (let i = 0; i < n2; i++)
|
|
7181
|
-
rows.push(/* @__PURE__ */
|
|
7182
|
-
return /* @__PURE__ */
|
|
7371
|
+
rows.push(/* @__PURE__ */ React52.createElement("span", { key: i, className: "aura-skel aura-skel--text", style: { width: i === n2 - 1 ? "60%" : "100%" } }));
|
|
7372
|
+
return /* @__PURE__ */ React52.createElement(
|
|
7183
7373
|
"span",
|
|
7184
7374
|
{
|
|
7185
7375
|
ref,
|
|
@@ -7197,28 +7387,17 @@ var Skeleton = React51.forwardRef(function Skeleton2(props, ref) {
|
|
|
7197
7387
|
if (v === "circle") {
|
|
7198
7388
|
style.width = style.height = props.size || props.width || 40;
|
|
7199
7389
|
}
|
|
7200
|
-
return /* @__PURE__ */
|
|
7390
|
+
return /* @__PURE__ */ React52.createElement("span", { ref, "aria-hidden": true, className: cx("aura-skel", "aura-skel--" + v, props.className), style });
|
|
7201
7391
|
});
|
|
7202
7392
|
|
|
7203
7393
|
// src/EmptyState.tsx
|
|
7204
|
-
var
|
|
7205
|
-
var EmptyState =
|
|
7206
|
-
|
|
7207
|
-
return /* @__PURE__ */ React52.createElement(
|
|
7208
|
-
"div",
|
|
7209
|
-
{
|
|
7210
|
-
ref,
|
|
7211
|
-
className: cx("aura-empty", props.size === "sm" && "is-sm", props.bordered && "is-bordered", props.className)
|
|
7212
|
-
},
|
|
7213
|
-
/* @__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" })),
|
|
7214
|
-
/* @__PURE__ */ React52.createElement(HT, { className: "aura-empty__title" }, props.title),
|
|
7215
|
-
props.description ? /* @__PURE__ */ React52.createElement("p", { className: "aura-empty__text" }, props.description) : null,
|
|
7216
|
-
props.action ? /* @__PURE__ */ React52.createElement("div", { className: "aura-empty__action" }, props.action) : null
|
|
7217
|
-
);
|
|
7394
|
+
var React53 = __toESM(require("react"), 1);
|
|
7395
|
+
var EmptyState = React53.forwardRef(function EmptyState2(props, ref) {
|
|
7396
|
+
return emptyStateElement(props, ref);
|
|
7218
7397
|
});
|
|
7219
7398
|
|
|
7220
7399
|
// src/Pagination.tsx
|
|
7221
|
-
var
|
|
7400
|
+
var React54 = __toESM(require("react"), 1);
|
|
7222
7401
|
function pageList(page, count, sib) {
|
|
7223
7402
|
let out = [], lo = Math.max(2, page - sib), hi = Math.min(count - 1, page + sib);
|
|
7224
7403
|
if (page - sib <= 3) {
|
|
@@ -7238,7 +7417,7 @@ function pageList(page, count, sib) {
|
|
|
7238
7417
|
if (count > 1) out.push(count);
|
|
7239
7418
|
return out;
|
|
7240
7419
|
}
|
|
7241
|
-
var Pagination =
|
|
7420
|
+
var Pagination = React54.forwardRef(function Pagination2(props, ref) {
|
|
7242
7421
|
const t = useStrings();
|
|
7243
7422
|
const count = Math.max(1, props.pageCount || 1);
|
|
7244
7423
|
const st = useMaybeControlled(props.page, props.defaultPage || 1, props.onChange);
|
|
@@ -7257,7 +7436,7 @@ var Pagination = React53.forwardRef(function Pagination2(props, ref) {
|
|
|
7257
7436
|
},
|
|
7258
7437
|
extra
|
|
7259
7438
|
);
|
|
7260
|
-
return link ? /* @__PURE__ */
|
|
7439
|
+
return link ? /* @__PURE__ */ React54.createElement(
|
|
7261
7440
|
Link,
|
|
7262
7441
|
{
|
|
7263
7442
|
href: link(p),
|
|
@@ -7270,7 +7449,7 @@ var Pagination = React53.forwardRef(function Pagination2(props, ref) {
|
|
|
7270
7449
|
...common
|
|
7271
7450
|
},
|
|
7272
7451
|
label
|
|
7273
|
-
) : /* @__PURE__ */
|
|
7452
|
+
) : /* @__PURE__ */ React54.createElement(
|
|
7274
7453
|
"button",
|
|
7275
7454
|
{
|
|
7276
7455
|
type: "button",
|
|
@@ -7284,7 +7463,7 @@ var Pagination = React53.forwardRef(function Pagination2(props, ref) {
|
|
|
7284
7463
|
}
|
|
7285
7464
|
function arrow(p, icon, label, rel, disabled) {
|
|
7286
7465
|
if (!link || disabled)
|
|
7287
|
-
return /* @__PURE__ */
|
|
7466
|
+
return /* @__PURE__ */ React54.createElement(
|
|
7288
7467
|
IconButton,
|
|
7289
7468
|
{
|
|
7290
7469
|
icon,
|
|
@@ -7295,7 +7474,7 @@ var Pagination = React53.forwardRef(function Pagination2(props, ref) {
|
|
|
7295
7474
|
}
|
|
7296
7475
|
}
|
|
7297
7476
|
);
|
|
7298
|
-
return /* @__PURE__ */
|
|
7477
|
+
return /* @__PURE__ */ React54.createElement(
|
|
7299
7478
|
Link,
|
|
7300
7479
|
{
|
|
7301
7480
|
href: link(p),
|
|
@@ -7310,17 +7489,17 @@ var Pagination = React53.forwardRef(function Pagination2(props, ref) {
|
|
|
7310
7489
|
}
|
|
7311
7490
|
}
|
|
7312
7491
|
},
|
|
7313
|
-
/* @__PURE__ */
|
|
7492
|
+
/* @__PURE__ */ React54.createElement(Icon, { name: icon, size: "sm" })
|
|
7314
7493
|
);
|
|
7315
7494
|
}
|
|
7316
|
-
return /* @__PURE__ */
|
|
7317
|
-
return typeof p === "number" ? /* @__PURE__ */
|
|
7318
|
-
})), /* @__PURE__ */
|
|
7495
|
+
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) {
|
|
7496
|
+
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");
|
|
7497
|
+
})), /* @__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));
|
|
7319
7498
|
});
|
|
7320
7499
|
|
|
7321
7500
|
// src/Accordion.tsx
|
|
7322
|
-
var
|
|
7323
|
-
var Accordion =
|
|
7501
|
+
var React55 = __toESM(require("react"), 1);
|
|
7502
|
+
var Accordion = React55.forwardRef(function Accordion2(props, ref) {
|
|
7324
7503
|
const auto = uid(), base = props.id || auto;
|
|
7325
7504
|
const multiple = props.type === "multiple";
|
|
7326
7505
|
const st = useMaybeControlled(
|
|
@@ -7358,9 +7537,9 @@ var Accordion = React54.forwardRef(function Accordion2(props, ref) {
|
|
|
7358
7537
|
n2.focus();
|
|
7359
7538
|
}
|
|
7360
7539
|
}
|
|
7361
|
-
return /* @__PURE__ */
|
|
7540
|
+
return /* @__PURE__ */ React55.createElement("div", { ref, className: cx("aura-accordion", props.className), onKeyDown: onKey }, items2.map(function(it) {
|
|
7362
7541
|
const on = open.indexOf(it.id) >= 0, bid = base + "-btn-" + it.id, pid = base + "-panel-" + it.id;
|
|
7363
|
-
return /* @__PURE__ */
|
|
7542
|
+
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(
|
|
7364
7543
|
"button",
|
|
7365
7544
|
{
|
|
7366
7545
|
type: "button",
|
|
@@ -7372,15 +7551,15 @@ var Accordion = React54.forwardRef(function Accordion2(props, ref) {
|
|
|
7372
7551
|
toggle(it.id);
|
|
7373
7552
|
}
|
|
7374
7553
|
},
|
|
7375
|
-
it.icon ? /* @__PURE__ */
|
|
7376
|
-
/* @__PURE__ */
|
|
7377
|
-
/* @__PURE__ */
|
|
7378
|
-
)), /* @__PURE__ */
|
|
7554
|
+
it.icon ? /* @__PURE__ */ React55.createElement(Icon, { name: it.icon, className: "aura-accordion__lead" }) : null,
|
|
7555
|
+
/* @__PURE__ */ React55.createElement("span", { className: "aura-accordion__title" }, it.title, it.description ? /* @__PURE__ */ React55.createElement("span", { className: "aura-accordion__desc" }, it.description) : null),
|
|
7556
|
+
/* @__PURE__ */ React55.createElement(Icon, { name: "chevron-down", className: "aura-accordion__chevron" })
|
|
7557
|
+
)), /* @__PURE__ */ React55.createElement("div", { id: pid, role: "region", "aria-labelledby": bid, className: "aura-accordion__panel", hidden: !on }, it.content));
|
|
7379
7558
|
}));
|
|
7380
7559
|
});
|
|
7381
7560
|
|
|
7382
7561
|
// src/Popover.tsx
|
|
7383
|
-
var
|
|
7562
|
+
var React56 = __toESM(require("react"), 1);
|
|
7384
7563
|
var import_react_dom12 = require("react-dom");
|
|
7385
7564
|
function position(anchor, pop, placement) {
|
|
7386
7565
|
const r = anchor.getBoundingClientRect(), pw = pop.offsetWidth, ph = pop.scrollHeight, vw = window.innerWidth, vh = window.innerHeight, gap = 6;
|
|
@@ -7398,15 +7577,15 @@ function position(anchor, pop, placement) {
|
|
|
7398
7577
|
const left = align === "end" ? r.right - pw : align === "center" ? r.left + r.width / 2 - pw / 2 : r.left;
|
|
7399
7578
|
return { top: Math.max(8, top), left: Math.max(8, Math.min(left, vw - pw - 8)), side, maxHeight };
|
|
7400
7579
|
}
|
|
7401
|
-
var Popover =
|
|
7580
|
+
var Popover = React56.forwardRef(function Popover2(props, ref) {
|
|
7402
7581
|
const t = useStrings();
|
|
7403
7582
|
const density = useDensity();
|
|
7404
7583
|
const auto = uid(), id = props.id || auto;
|
|
7405
7584
|
const st = useMaybeControlled(props.open, !!props.defaultOpen, props.onOpenChange);
|
|
7406
7585
|
const open = !!st[0];
|
|
7407
|
-
const wrap =
|
|
7408
|
-
const pos =
|
|
7409
|
-
const inTree =
|
|
7586
|
+
const wrap = React56.useRef(null), pop = React56.useRef(null), popMerged = useMergedRef(ref, pop);
|
|
7587
|
+
const pos = React56.useState(null), mounted = useMounted();
|
|
7588
|
+
const inTree = React56.useRef(false);
|
|
7410
7589
|
function trigger() {
|
|
7411
7590
|
return wrap.current && (wrap.current.querySelector('button, [role="button"], a, input') || wrap.current.firstElementChild);
|
|
7412
7591
|
}
|
|
@@ -7433,7 +7612,7 @@ var Popover = React55.forwardRef(function Popover2(props, ref) {
|
|
|
7433
7612
|
},
|
|
7434
7613
|
[open, mounted, props.placement]
|
|
7435
7614
|
);
|
|
7436
|
-
|
|
7615
|
+
React56.useEffect(
|
|
7437
7616
|
function() {
|
|
7438
7617
|
if (!open || !mounted) return;
|
|
7439
7618
|
if (props.autoFocus !== false && pop.current) {
|
|
@@ -7458,9 +7637,9 @@ var Popover = React55.forwardRef(function Popover2(props, ref) {
|
|
|
7458
7637
|
},
|
|
7459
7638
|
[open, mounted]
|
|
7460
7639
|
);
|
|
7461
|
-
const child =
|
|
7640
|
+
const child = React56.Children.only(props.trigger);
|
|
7462
7641
|
const panel = open && mounted ? (0, import_react_dom12.createPortal)(
|
|
7463
|
-
/* @__PURE__ */
|
|
7642
|
+
/* @__PURE__ */ React56.createElement(
|
|
7464
7643
|
"div",
|
|
7465
7644
|
{
|
|
7466
7645
|
ref: popMerged,
|
|
@@ -7490,7 +7669,7 @@ var Popover = React55.forwardRef(function Popover2(props, ref) {
|
|
|
7490
7669
|
} else trapTab(e, pop.current);
|
|
7491
7670
|
}
|
|
7492
7671
|
},
|
|
7493
|
-
props.title ? /* @__PURE__ */
|
|
7672
|
+
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(
|
|
7494
7673
|
IconButton,
|
|
7495
7674
|
{
|
|
7496
7675
|
icon: "x",
|
|
@@ -7500,7 +7679,7 @@ var Popover = React55.forwardRef(function Popover2(props, ref) {
|
|
|
7500
7679
|
}
|
|
7501
7680
|
}
|
|
7502
7681
|
)) : null,
|
|
7503
|
-
/* @__PURE__ */
|
|
7682
|
+
/* @__PURE__ */ React56.createElement("div", { className: "aura-popover__body" }, typeof props.children === "function" ? props.children({
|
|
7504
7683
|
close: function() {
|
|
7505
7684
|
close(true);
|
|
7506
7685
|
}
|
|
@@ -7508,7 +7687,7 @@ var Popover = React55.forwardRef(function Popover2(props, ref) {
|
|
|
7508
7687
|
),
|
|
7509
7688
|
document.body
|
|
7510
7689
|
) : null;
|
|
7511
|
-
return /* @__PURE__ */
|
|
7690
|
+
return /* @__PURE__ */ React56.createElement("span", { ref: wrap, className: "aura-popover-anchor" }, React56.cloneElement(child, {
|
|
7512
7691
|
onClick: function(e) {
|
|
7513
7692
|
if (child.props.onClick) child.props.onClick(e);
|
|
7514
7693
|
st[1](!open);
|
|
@@ -7520,20 +7699,20 @@ var Popover = React55.forwardRef(function Popover2(props, ref) {
|
|
|
7520
7699
|
});
|
|
7521
7700
|
|
|
7522
7701
|
// src/NumberField.tsx
|
|
7523
|
-
var
|
|
7702
|
+
var React57 = __toESM(require("react"), 1);
|
|
7524
7703
|
function decimalsOf(n2) {
|
|
7525
7704
|
const s = String(n2);
|
|
7526
7705
|
const i = s.indexOf(".");
|
|
7527
7706
|
return i < 0 ? 0 : s.length - i - 1;
|
|
7528
7707
|
}
|
|
7529
|
-
function parse(
|
|
7530
|
-
let t =
|
|
7708
|
+
function parse(text2) {
|
|
7709
|
+
let t = text2.trim();
|
|
7531
7710
|
if (t.indexOf(".") < 0 && /^-?\d+,\d+$/.test(t.replace(/[\s ]/g, "")) && !/,\d{3}$/.test(t)) t = t.replace(",", ".");
|
|
7532
7711
|
const s = t.replace(/[,\s ]/g, "");
|
|
7533
7712
|
if (!/^-?(\d+\.?\d*|\.\d+)$/.test(s)) return NaN;
|
|
7534
7713
|
return Number(s);
|
|
7535
7714
|
}
|
|
7536
|
-
var NumberField =
|
|
7715
|
+
var NumberField = React57.forwardRef(function NumberField2(props, ref) {
|
|
7537
7716
|
const t = useStrings();
|
|
7538
7717
|
const auto = uid(), id = props.id || auto;
|
|
7539
7718
|
const step = props.step || 1;
|
|
@@ -7544,7 +7723,7 @@ var NumberField = React56.forwardRef(function NumberField2(props, ref) {
|
|
|
7544
7723
|
props.onChange
|
|
7545
7724
|
);
|
|
7546
7725
|
const value = st[0], setValue = st[1];
|
|
7547
|
-
const draftState =
|
|
7726
|
+
const draftState = React57.useState(null), draft = draftState[0], setDraft = draftState[1];
|
|
7548
7727
|
function fmt2(n2) {
|
|
7549
7728
|
if (n2 == null || isNaN(n2)) return "";
|
|
7550
7729
|
return n2.toLocaleString("en", { minimumFractionDigits: decimals, maximumFractionDigits: decimals });
|
|
@@ -7593,7 +7772,7 @@ var NumberField = React56.forwardRef(function NumberField2(props, ref) {
|
|
|
7593
7772
|
};
|
|
7594
7773
|
const valueText = value == null ? void 0 : [affixText(props.prefix), fmt2(value), affixText(props.suffix)].join(" ").trim();
|
|
7595
7774
|
const stepper = props.stepper !== false && !props.readOnly;
|
|
7596
|
-
return /* @__PURE__ */
|
|
7775
|
+
return /* @__PURE__ */ React57.createElement(
|
|
7597
7776
|
Field,
|
|
7598
7777
|
{
|
|
7599
7778
|
id,
|
|
@@ -7605,7 +7784,7 @@ var NumberField = React56.forwardRef(function NumberField2(props, ref) {
|
|
|
7605
7784
|
disabled: props.disabled,
|
|
7606
7785
|
className: props.className
|
|
7607
7786
|
},
|
|
7608
|
-
/* @__PURE__ */
|
|
7787
|
+
/* @__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(
|
|
7609
7788
|
"input",
|
|
7610
7789
|
{
|
|
7611
7790
|
ref,
|
|
@@ -7631,11 +7810,11 @@ var NumberField = React56.forwardRef(function NumberField2(props, ref) {
|
|
|
7631
7810
|
setDraft(fmt2(value));
|
|
7632
7811
|
},
|
|
7633
7812
|
onChange: function(e) {
|
|
7634
|
-
const
|
|
7635
|
-
setDraft(
|
|
7636
|
-
if (!
|
|
7813
|
+
const text2 = e.target.value;
|
|
7814
|
+
setDraft(text2);
|
|
7815
|
+
if (!text2.trim()) setValue(null);
|
|
7637
7816
|
else {
|
|
7638
|
-
const n2 = parse(
|
|
7817
|
+
const n2 = parse(text2);
|
|
7639
7818
|
if (!isNaN(n2)) setValue(n2);
|
|
7640
7819
|
}
|
|
7641
7820
|
},
|
|
@@ -7652,7 +7831,7 @@ var NumberField = React56.forwardRef(function NumberField2(props, ref) {
|
|
|
7652
7831
|
},
|
|
7653
7832
|
onKeyDown
|
|
7654
7833
|
}
|
|
7655
|
-
), props.suffix != null ? /* @__PURE__ */
|
|
7834
|
+
), 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(
|
|
7656
7835
|
"button",
|
|
7657
7836
|
{
|
|
7658
7837
|
type: "button",
|
|
@@ -7668,8 +7847,8 @@ var NumberField = React56.forwardRef(function NumberField2(props, ref) {
|
|
|
7668
7847
|
nudge(-step);
|
|
7669
7848
|
}
|
|
7670
7849
|
},
|
|
7671
|
-
/* @__PURE__ */
|
|
7672
|
-
), /* @__PURE__ */
|
|
7850
|
+
/* @__PURE__ */ React57.createElement(Icon, { name: "minus" })
|
|
7851
|
+
), /* @__PURE__ */ React57.createElement(
|
|
7673
7852
|
"button",
|
|
7674
7853
|
{
|
|
7675
7854
|
type: "button",
|
|
@@ -7685,14 +7864,14 @@ var NumberField = React56.forwardRef(function NumberField2(props, ref) {
|
|
|
7685
7864
|
nudge(step);
|
|
7686
7865
|
}
|
|
7687
7866
|
},
|
|
7688
|
-
/* @__PURE__ */
|
|
7867
|
+
/* @__PURE__ */ React57.createElement(Icon, { name: "plus" })
|
|
7689
7868
|
)) : null)
|
|
7690
7869
|
);
|
|
7691
7870
|
});
|
|
7692
7871
|
|
|
7693
7872
|
// src/Stepper.tsx
|
|
7694
|
-
var
|
|
7695
|
-
var Stepper =
|
|
7873
|
+
var React58 = __toESM(require("react"), 1);
|
|
7874
|
+
var Stepper = React58.forwardRef(function Stepper2(props, ref) {
|
|
7696
7875
|
const t = useStrings();
|
|
7697
7876
|
const steps = props.steps || [];
|
|
7698
7877
|
let at = -1;
|
|
@@ -7702,26 +7881,26 @@ var Stepper = React57.forwardRef(function Stepper2(props, ref) {
|
|
|
7702
7881
|
if (at < 0) at = 0;
|
|
7703
7882
|
const vertical = props.orientation === "vertical";
|
|
7704
7883
|
const cur = steps[at];
|
|
7705
|
-
return /* @__PURE__ */
|
|
7884
|
+
return /* @__PURE__ */ React58.createElement(
|
|
7706
7885
|
"nav",
|
|
7707
7886
|
{
|
|
7708
7887
|
ref,
|
|
7709
7888
|
"aria-label": props.label,
|
|
7710
7889
|
className: cx("aura-stepper", vertical ? "aura-stepper--vertical" : "aura-stepper--horizontal", props.className)
|
|
7711
7890
|
},
|
|
7712
|
-
/* @__PURE__ */
|
|
7891
|
+
/* @__PURE__ */ React58.createElement("ol", { className: "aura-stepper__list" }, steps.map(function(s, i) {
|
|
7713
7892
|
const state = i < at ? "done" : i === at ? "current" : "upcoming";
|
|
7714
|
-
const marker = /* @__PURE__ */
|
|
7715
|
-
const
|
|
7893
|
+
const marker = /* @__PURE__ */ React58.createElement("span", { className: "aura-stepper__marker", "aria-hidden": true }, state === "done" ? /* @__PURE__ */ React58.createElement(Icon, { name: "check" }) : i + 1);
|
|
7894
|
+
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);
|
|
7716
7895
|
const clickable = state === "done" && !!props.onStepClick;
|
|
7717
|
-
return /* @__PURE__ */
|
|
7896
|
+
return /* @__PURE__ */ React58.createElement(
|
|
7718
7897
|
"li",
|
|
7719
7898
|
{
|
|
7720
7899
|
key: s.id,
|
|
7721
7900
|
className: cx("aura-stepper__item", "is-" + state),
|
|
7722
7901
|
"aria-current": state === "current" ? "step" : void 0
|
|
7723
7902
|
},
|
|
7724
|
-
clickable ? /* @__PURE__ */
|
|
7903
|
+
clickable ? /* @__PURE__ */ React58.createElement(
|
|
7725
7904
|
"button",
|
|
7726
7905
|
{
|
|
7727
7906
|
type: "button",
|
|
@@ -7731,20 +7910,20 @@ var Stepper = React57.forwardRef(function Stepper2(props, ref) {
|
|
|
7731
7910
|
}
|
|
7732
7911
|
},
|
|
7733
7912
|
marker,
|
|
7734
|
-
|
|
7735
|
-
) : /* @__PURE__ */
|
|
7913
|
+
text2
|
|
7914
|
+
) : /* @__PURE__ */ React58.createElement("span", { className: "aura-stepper__step" }, marker, text2)
|
|
7736
7915
|
);
|
|
7737
7916
|
})),
|
|
7738
|
-
!vertical && cur ? /* @__PURE__ */
|
|
7917
|
+
!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
|
|
7739
7918
|
);
|
|
7740
7919
|
});
|
|
7741
7920
|
|
|
7742
7921
|
// src/SegmentedControl.tsx
|
|
7743
|
-
var
|
|
7922
|
+
var React59 = __toESM(require("react"), 1);
|
|
7744
7923
|
function toOpt2(o) {
|
|
7745
7924
|
return typeof o === "object" ? o : { value: o, label: o };
|
|
7746
7925
|
}
|
|
7747
|
-
var SegmentedControl =
|
|
7926
|
+
var SegmentedControl = React59.forwardRef(
|
|
7748
7927
|
function SegmentedControl2(props, ref) {
|
|
7749
7928
|
const options = (props.options || []).map(toOpt2);
|
|
7750
7929
|
const firstEnabled = options.filter(function(o) {
|
|
@@ -7757,7 +7936,7 @@ var SegmentedControl = React58.forwardRef(
|
|
|
7757
7936
|
);
|
|
7758
7937
|
const value = st[0], setValue = st[1];
|
|
7759
7938
|
const auto = uid(), id = props.id || auto;
|
|
7760
|
-
const refs =
|
|
7939
|
+
const refs = React59.useRef([]);
|
|
7761
7940
|
const selIdx = options.findIndex(function(o) {
|
|
7762
7941
|
return o.value === value;
|
|
7763
7942
|
});
|
|
@@ -7790,7 +7969,7 @@ var SegmentedControl = React58.forwardRef(
|
|
|
7790
7969
|
move(options.length, -1);
|
|
7791
7970
|
}
|
|
7792
7971
|
}
|
|
7793
|
-
return /* @__PURE__ */
|
|
7972
|
+
return /* @__PURE__ */ React59.createElement(
|
|
7794
7973
|
"div",
|
|
7795
7974
|
{
|
|
7796
7975
|
ref,
|
|
@@ -7809,7 +7988,7 @@ var SegmentedControl = React58.forwardRef(
|
|
|
7809
7988
|
options.map(function(o, i) {
|
|
7810
7989
|
const on = o.value === value;
|
|
7811
7990
|
const off = props.disabled || o.disabled;
|
|
7812
|
-
return /* @__PURE__ */
|
|
7991
|
+
return /* @__PURE__ */ React59.createElement(
|
|
7813
7992
|
"button",
|
|
7814
7993
|
{
|
|
7815
7994
|
key: o.value,
|
|
@@ -7831,8 +8010,8 @@ var SegmentedControl = React58.forwardRef(
|
|
|
7831
8010
|
onKeyDown(e, i);
|
|
7832
8011
|
}
|
|
7833
8012
|
},
|
|
7834
|
-
o.icon ? /* @__PURE__ */
|
|
7835
|
-
o.iconOnly ? null : /* @__PURE__ */
|
|
8013
|
+
o.icon ? /* @__PURE__ */ React59.createElement(Icon, { name: o.icon }) : null,
|
|
8014
|
+
o.iconOnly ? null : /* @__PURE__ */ React59.createElement("span", null, o.label)
|
|
7836
8015
|
);
|
|
7837
8016
|
})
|
|
7838
8017
|
);
|