@jirawatpyk/aura-react 5.77.0 → 5.79.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 +25 -0
- package/dist/aura.bundle.js +130 -13
- package/dist/cjs/index.cjs +130 -13
- package/dist/esm/DataTable.js +27 -1
- package/dist/esm/DatePicker.js +1 -1
- package/dist/esm/FileUpload.js +13 -0
- package/dist/esm/Menu.js +6 -2
- package/dist/esm/PageHeader.js +10 -1
- package/dist/esm/Table.js +5 -0
- package/dist/esm/Tabs.js +10 -3
- package/dist/esm/classes.js +8 -6
- package/dist/esm/internal.js +46 -2
- package/dist/esm/theme.js +3 -0
- package/dist/esm/tiles.js +16 -1
- package/dist/server/index.cjs +36 -8
- package/dist/server/index.js +36 -8
- package/dist/styles.css +115 -22
- package/dist/styles.layer.css +115 -22
- package/package.json +2 -2
package/dist/esm/FileUpload.js
CHANGED
|
@@ -26,6 +26,19 @@ function describeAccept(accept, t) {
|
|
|
26
26
|
a = a.trim();
|
|
27
27
|
if (a === "image/*") return t.images;
|
|
28
28
|
if (a === "application/pdf") return "PDF";
|
|
29
|
+
const known = {
|
|
30
|
+
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": "DOCX",
|
|
31
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "XLSX",
|
|
32
|
+
"application/vnd.openxmlformats-officedocument.presentationml.presentation": "PPTX",
|
|
33
|
+
"application/msword": "DOC",
|
|
34
|
+
"application/vnd.ms-excel": "XLS",
|
|
35
|
+
"application/vnd.ms-powerpoint": "PPT",
|
|
36
|
+
"text/plain": "TXT"
|
|
37
|
+
};
|
|
38
|
+
if (known[a]) return known[a];
|
|
39
|
+
const slash = a.indexOf("/");
|
|
40
|
+
if (slash > 0 && a.slice(slash + 1) !== "*")
|
|
41
|
+
a = a.slice(slash + 1).replace(/^(?:vnd\.|x-)/, "").replace(/\+xml$/, "");
|
|
29
42
|
return a.replace(/^\./, "").toUpperCase();
|
|
30
43
|
}).filter(function(x, i, arr) {
|
|
31
44
|
return arr.indexOf(x) === i;
|
package/dist/esm/Menu.js
CHANGED
|
@@ -61,7 +61,8 @@ const Menu = React.forwardRef(function Menu2(props, ref) {
|
|
|
61
61
|
top = r.top - above - 4;
|
|
62
62
|
} else maxHeight = below;
|
|
63
63
|
}
|
|
64
|
-
const
|
|
64
|
+
const endAligned = r.right - mw;
|
|
65
|
+
const left = Math.max(8, Math.min(endAligned >= 8 ? endAligned : r.left, window.innerWidth - mw - 8));
|
|
65
66
|
setPos(function(p) {
|
|
66
67
|
return p && p.top === top && p.left === left && p.maxHeight === maxHeight ? p : { top, left, maxHeight };
|
|
67
68
|
});
|
|
@@ -160,12 +161,15 @@ const Menu = React.forwardRef(function Menu2(props, ref) {
|
|
|
160
161
|
});
|
|
161
162
|
return out;
|
|
162
163
|
}
|
|
164
|
+
const anyLead = items.some(function(it) {
|
|
165
|
+
return !it.separator && (!!it.icon || it.type === "radio" || it.checked !== void 0);
|
|
166
|
+
});
|
|
163
167
|
function renderItem(it, i) {
|
|
164
168
|
if (it.separator) return /* @__PURE__ */ React.createElement("div", { key: "s" + i, role: "separator", className: "aura-menu__sep" });
|
|
165
169
|
const isRadio = it.type === "radio";
|
|
166
170
|
const isCheck = !isRadio && it.checked !== void 0;
|
|
167
171
|
const checkAtEnd = isCheck && !!it.icon && it.checkPlacement !== "start";
|
|
168
|
-
const lead = isRadio ? /* @__PURE__ */ React.createElement("span", { className: cx("aura-menu__radio", it.checked && "is-on") }) : isCheck && !checkAtEnd ? /* @__PURE__ */ React.createElement("span", { className: cx("aura-menu__check", it.checked && "is-on") }, it.checked ? /* @__PURE__ */ React.createElement(Icon, { name: /* @__PURE__ */ React.createElement(IconCheck, null), size: 12, strokeWidth: 3 }) : null) : it.icon ? /* @__PURE__ */ React.createElement(Icon, { name: it.icon }) : /* @__PURE__ */ React.createElement("span", { className: "aura-menu__blank" });
|
|
172
|
+
const lead = isRadio ? /* @__PURE__ */ React.createElement("span", { className: cx("aura-menu__radio", it.checked && "is-on") }) : isCheck && !checkAtEnd ? /* @__PURE__ */ React.createElement("span", { className: cx("aura-menu__check", it.checked && "is-on") }, it.checked ? /* @__PURE__ */ React.createElement(Icon, { name: /* @__PURE__ */ React.createElement(IconCheck, null), size: 12, strokeWidth: 3 }) : null) : it.icon ? /* @__PURE__ */ React.createElement(Icon, { name: it.icon }) : anyLead ? /* @__PURE__ */ React.createElement("span", { className: "aura-menu__blank" }) : null;
|
|
169
173
|
const body = [
|
|
170
174
|
/* @__PURE__ */ React.createElement(React.Fragment, { key: "l" }, lead),
|
|
171
175
|
/* @__PURE__ */ React.createElement("span", { key: "t", className: "aura-menu__label" }, it.label),
|
package/dist/esm/PageHeader.js
CHANGED
|
@@ -3,6 +3,15 @@ import * as React from "react";
|
|
|
3
3
|
import { cx } from "./classes.js";
|
|
4
4
|
const h = React.createElement;
|
|
5
5
|
const LAZY = Symbol.for("react.lazy");
|
|
6
|
+
const ID = /([A-Za-z0-9]+(?:-[A-Za-z0-9]+)+)/;
|
|
7
|
+
function keepIds(title) {
|
|
8
|
+
if (typeof title !== "string" || title.indexOf("-") < 0) return title;
|
|
9
|
+
const parts = title.split(ID);
|
|
10
|
+
if (parts.length < 2) return title;
|
|
11
|
+
return parts.map(function(p, i) {
|
|
12
|
+
return i % 2 && /\d/.test(p) && p.length <= 24 ? h("span", { key: i, className: "aura-nowrap" }, p) : p;
|
|
13
|
+
});
|
|
14
|
+
}
|
|
6
15
|
function chipsOnly(node) {
|
|
7
16
|
let el = 0;
|
|
8
17
|
const walk = function(n) {
|
|
@@ -54,7 +63,7 @@ const PageHeader = React.forwardRef(function PageHeader2(props, ref) {
|
|
|
54
63
|
tabIndex: props.focusTitleOnMount ? -1 : void 0,
|
|
55
64
|
"data-aura-focus-on-mount": props.focusTitleOnMount ? "" : void 0
|
|
56
65
|
},
|
|
57
|
-
props.title
|
|
66
|
+
keepIds(props.title)
|
|
58
67
|
);
|
|
59
68
|
const hasActions = props.actions != null && props.actions !== false;
|
|
60
69
|
const hasBarActions = props.actionsBar != null && props.actionsBar !== false;
|
package/dist/esm/Table.js
CHANGED
|
@@ -133,6 +133,11 @@ const Table = React.forwardRef(function Table2(props, ref) {
|
|
|
133
133
|
function check() {
|
|
134
134
|
const sideways = el.scrollWidth > el.clientWidth + 1;
|
|
135
135
|
wide[1](sideways);
|
|
136
|
+
if (sideways && !stackBelow && !outer && typeof window !== "undefined" && window.innerWidth < 640)
|
|
137
|
+
devWarnOnce(
|
|
138
|
+
"table-no-stack",
|
|
139
|
+
"Table" + (rest["aria-label"] ? ' "' + rest["aria-label"] + '"' : "") + " scrolls sideways at " + window.innerWidth + "px wide, so its last columns are off screen. On a phone pass stackBelow={640} (cards or rows). It becomes the default in 6.0."
|
|
140
|
+
);
|
|
136
141
|
sc[1](sideways || el.scrollHeight > el.clientHeight + 1);
|
|
137
142
|
}
|
|
138
143
|
check();
|
package/dist/esm/Tabs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { Icon } from "./Icon.js";
|
|
4
|
-
import { cx, devWarnOnce, omit, touchClass, uid, useMaybeControlled } from "./internal.js";
|
|
4
|
+
import { cx, devWarnOnce, omit, touchClass, uid, useMaybeControlled, useScrollEdges } from "./internal.js";
|
|
5
5
|
import { useLinkComponent } from "./locale.js";
|
|
6
6
|
const Tabs = React.forwardRef(function Tabs2(props, ref) {
|
|
7
7
|
const items = props.tabs || [], base = uid();
|
|
@@ -36,6 +36,8 @@ const Tabs = React.forwardRef(function Tabs2(props, ref) {
|
|
|
36
36
|
};
|
|
37
37
|
const rootCls = cx("aura-tabs", seg && "aura-tabs--segmented", touchClass(props.touchHeight));
|
|
38
38
|
const [focusId, setFocusId] = React.useState(null);
|
|
39
|
+
const listRef = React.useRef(null);
|
|
40
|
+
useScrollEdges(listRef, asLinks);
|
|
39
41
|
items.forEach(function(t) {
|
|
40
42
|
const al = t.tabProps && t.tabProps["aria-label"];
|
|
41
43
|
if (al && al.toLowerCase().indexOf(String(t.label).toLowerCase()) !== 0)
|
|
@@ -52,7 +54,7 @@ const Tabs = React.forwardRef(function Tabs2(props, ref) {
|
|
|
52
54
|
"aria-label": props.label,
|
|
53
55
|
className: cx(rootCls, "aura-tabs--links", props.className)
|
|
54
56
|
},
|
|
55
|
-
/* @__PURE__ */ React.createElement("div", { className: listCls }, items.map(function(t) {
|
|
57
|
+
/* @__PURE__ */ React.createElement("div", { ref: listRef, className: listCls }, items.map(function(t) {
|
|
56
58
|
const on = t.id === cur;
|
|
57
59
|
const inner = [
|
|
58
60
|
t.icon ? /* @__PURE__ */ React.createElement(Icon, { key: "i", name: t.icon }) : null,
|
|
@@ -105,7 +107,11 @@ const Tabs = React.forwardRef(function Tabs2(props, ref) {
|
|
|
105
107
|
const t = enabled[(i + enabled.length) % enabled.length];
|
|
106
108
|
if (manual) setFocusId(t.id);
|
|
107
109
|
else st[1](t.id);
|
|
108
|
-
if (refs.current[t.id])
|
|
110
|
+
if (refs.current[t.id]) {
|
|
111
|
+
refs.current[t.id].focus();
|
|
112
|
+
const tab = refs.current[t.id];
|
|
113
|
+
if (typeof tab.scrollIntoView === "function") tab.scrollIntoView({ block: "nearest", inline: "nearest" });
|
|
114
|
+
}
|
|
109
115
|
}
|
|
110
116
|
const stop = manual && focusId && items.filter(function(t) {
|
|
111
117
|
return t.id === focusId && !t.disabled;
|
|
@@ -113,6 +119,7 @@ const Tabs = React.forwardRef(function Tabs2(props, ref) {
|
|
|
113
119
|
return /* @__PURE__ */ React.createElement("div", { ref, className: cx(rootCls, props.className) }, /* @__PURE__ */ React.createElement(
|
|
114
120
|
"div",
|
|
115
121
|
{
|
|
122
|
+
ref: listRef,
|
|
116
123
|
role: "tablist",
|
|
117
124
|
"aria-label": props.label,
|
|
118
125
|
className: listCls,
|
package/dist/esm/classes.js
CHANGED
|
@@ -16,21 +16,23 @@ function tone(t) {
|
|
|
16
16
|
return TONES.indexOf(t) >= 0 ? t : "neutral";
|
|
17
17
|
}
|
|
18
18
|
const warned = {};
|
|
19
|
-
function
|
|
20
|
-
if (warned[key]) return;
|
|
21
|
-
let dev = false;
|
|
19
|
+
function isDev() {
|
|
22
20
|
try {
|
|
23
|
-
|
|
21
|
+
return true;
|
|
24
22
|
} catch (e) {
|
|
25
|
-
|
|
23
|
+
return false;
|
|
26
24
|
}
|
|
27
|
-
|
|
25
|
+
}
|
|
26
|
+
function devWarnOnce(key, message) {
|
|
27
|
+
if (warned[key]) return;
|
|
28
|
+
if (!isDev()) return;
|
|
28
29
|
warned[key] = true;
|
|
29
30
|
console.warn("[AURA] " + message);
|
|
30
31
|
}
|
|
31
32
|
export {
|
|
32
33
|
cx,
|
|
33
34
|
devWarnOnce,
|
|
35
|
+
isDev,
|
|
34
36
|
omit,
|
|
35
37
|
tone,
|
|
36
38
|
touchClass
|
package/dist/esm/internal.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import { cx, omit, tone, devWarnOnce, touchClass } from "./classes.js";
|
|
3
|
+
import { cx, omit, tone, devWarnOnce, isDev, touchClass } from "./classes.js";
|
|
4
4
|
function useMaybeControlled(value, initial, onChange) {
|
|
5
5
|
const s = React.useState(initial);
|
|
6
6
|
const wasSet = React.useState(value !== void 0);
|
|
@@ -217,6 +217,48 @@ function useInputModality() {
|
|
|
217
217
|
function pointerModality() {
|
|
218
218
|
setModality("pointer");
|
|
219
219
|
}
|
|
220
|
+
function useScrollEdges(r, key) {
|
|
221
|
+
React.useEffect(
|
|
222
|
+
function() {
|
|
223
|
+
const el = r.current;
|
|
224
|
+
if (!el || typeof ResizeObserver === "undefined") return;
|
|
225
|
+
let raf = 0;
|
|
226
|
+
const mark = function() {
|
|
227
|
+
raf = 0;
|
|
228
|
+
const max = el.scrollWidth - el.clientWidth;
|
|
229
|
+
const x = Math.abs(el.scrollLeft);
|
|
230
|
+
const v = ((x > 1 ? "start " : "") + (x < max - 1 ? "end" : "")).trim();
|
|
231
|
+
if ((el.getAttribute("data-aura-more") || "") === v) return;
|
|
232
|
+
if (v) el.setAttribute("data-aura-more", v);
|
|
233
|
+
else el.removeAttribute("data-aura-more");
|
|
234
|
+
};
|
|
235
|
+
const on = function() {
|
|
236
|
+
if (!raf) raf = requestAnimationFrame(mark);
|
|
237
|
+
};
|
|
238
|
+
mark();
|
|
239
|
+
el.addEventListener("scroll", on, { passive: true });
|
|
240
|
+
const ro = new ResizeObserver(on);
|
|
241
|
+
ro.observe(el);
|
|
242
|
+
Array.prototype.forEach.call(el.children, function(c) {
|
|
243
|
+
ro.observe(c);
|
|
244
|
+
});
|
|
245
|
+
const mo = new MutationObserver(function() {
|
|
246
|
+
Array.prototype.forEach.call(el.children, function(c) {
|
|
247
|
+
ro.observe(c);
|
|
248
|
+
});
|
|
249
|
+
on();
|
|
250
|
+
});
|
|
251
|
+
mo.observe(el, { childList: true });
|
|
252
|
+
return function() {
|
|
253
|
+
cancelAnimationFrame(raf);
|
|
254
|
+
el.removeEventListener("scroll", on);
|
|
255
|
+
ro.disconnect();
|
|
256
|
+
mo.disconnect();
|
|
257
|
+
};
|
|
258
|
+
},
|
|
259
|
+
[key]
|
|
260
|
+
);
|
|
261
|
+
}
|
|
220
262
|
export {
|
|
221
263
|
FOCUSABLE,
|
|
222
264
|
FilterSheet,
|
|
@@ -229,6 +271,7 @@ export {
|
|
|
229
271
|
fixedTrapped,
|
|
230
272
|
focusFirst,
|
|
231
273
|
inClosedDetails,
|
|
274
|
+
isDev,
|
|
232
275
|
isTabStop,
|
|
233
276
|
omit,
|
|
234
277
|
plainClick,
|
|
@@ -241,5 +284,6 @@ export {
|
|
|
241
284
|
useIsoLayoutEffect,
|
|
242
285
|
useMaybeControlled,
|
|
243
286
|
useMergedRef,
|
|
244
|
-
useMounted
|
|
287
|
+
useMounted,
|
|
288
|
+
useScrollEdges
|
|
245
289
|
};
|
package/dist/esm/theme.js
CHANGED
|
@@ -131,6 +131,7 @@ function createTheme(opts) {
|
|
|
131
131
|
L["accent-violet"] = L["fg-accent"];
|
|
132
132
|
L["focus-ring"] = fit(b[700], lightGrounds.concat([b[50]]), 3, -1);
|
|
133
133
|
L["bg-selected"] = b[50];
|
|
134
|
+
L["calendar-range-bg"] = b[100];
|
|
134
135
|
L["status-progress-bg"] = b[100];
|
|
135
136
|
L["status-progress-fg"] = fit(b[800], [b[100]], 4.5, -1);
|
|
136
137
|
L["alert-info-bg"] = b[50];
|
|
@@ -170,6 +171,7 @@ function createTheme(opts) {
|
|
|
170
171
|
D["control-checked-bg"] = fit(b[300], darkGrounds, 3, 1);
|
|
171
172
|
D["control-checked-fg"] = onFill(D["control-checked-bg"]);
|
|
172
173
|
D["nav-active-edge"] = D["control-checked-bg"];
|
|
174
|
+
D["calendar-range-bg"] = D["bg-selected"];
|
|
173
175
|
const shadowLight = INK, shadowDark = D["accent-violet"];
|
|
174
176
|
if (o.primary === "brand") {
|
|
175
177
|
L["button-primary-bg"] = fit(b[600], [ZINC[0]], 4.5, -1);
|
|
@@ -227,6 +229,7 @@ function createTheme(opts) {
|
|
|
227
229
|
check("dark", "chart-1", "chart-2 (lightness step)", 1.8, D["chart-1"], CHART_2);
|
|
228
230
|
check("light", "fg-primary", "bg-selected", 4.5, INK, L["bg-selected"]);
|
|
229
231
|
check("dark", "fg-primary", "bg-selected", 4.5, "#ffffff", D["bg-selected"]);
|
|
232
|
+
check("light", "fg-primary", "calendar-range-bg", 4.5, INK, L["calendar-range-bg"]);
|
|
230
233
|
check("light", "status-progress-fg", "status-progress-bg", 4.5, L["status-progress-fg"], L["status-progress-bg"]);
|
|
231
234
|
check("dark", "status-progress-fg", "status-progress-bg", 4.5, D["status-progress-fg"], D["status-progress-bg"]);
|
|
232
235
|
check("light", "alert-info-fg", "alert-info-bg", 4.5, L["alert-info-fg"], L["alert-info-bg"]);
|
package/dist/esm/tiles.js
CHANGED
|
@@ -27,6 +27,21 @@ const STATUS_WORD = {
|
|
|
27
27
|
ok: "statusOk",
|
|
28
28
|
unknown: "statusUnknown"
|
|
29
29
|
};
|
|
30
|
+
function breakAtDots(title) {
|
|
31
|
+
if (typeof title !== "string" || !/[./][A-Za-z]/.test(title)) return title;
|
|
32
|
+
const out = [];
|
|
33
|
+
let run = "";
|
|
34
|
+
for (let i = 0; i < title.length; i++) {
|
|
35
|
+
const c = title.charAt(i);
|
|
36
|
+
run += c;
|
|
37
|
+
if ((c === "." || c === "/") && i + 1 < title.length && /[A-Za-z]/.test(title.charAt(i + 1))) {
|
|
38
|
+
out.push(run, h("wbr", { key: i }));
|
|
39
|
+
run = "";
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (run) out.push(run);
|
|
43
|
+
return out;
|
|
44
|
+
}
|
|
30
45
|
function statusWord(status, t) {
|
|
31
46
|
return String(t[STATUS_WORD[status]] || STATUS_WORD[status]);
|
|
32
47
|
}
|
|
@@ -65,7 +80,7 @@ function statusTileElement(props, ref, Link, t, titleRef) {
|
|
|
65
80
|
"span",
|
|
66
81
|
{ className: "aura-status-tile__head" },
|
|
67
82
|
h(Icon, { name: h(STATUS_ICON[status]), size: 16, className: "aura-status-tile__icon" }),
|
|
68
|
-
h("span", { className: "aura-status-tile__title", ref: titleRef }, props.title, comma),
|
|
83
|
+
h("span", { className: "aura-status-tile__title", ref: titleRef }, breakAtDots(props.title), comma),
|
|
69
84
|
h("span", { className: "aura-sr-only" }, word + (hasValue || hasMeta || markers.length ? "," : "")),
|
|
70
85
|
hasValue ? h(
|
|
71
86
|
"span",
|
package/dist/server/index.cjs
CHANGED
|
@@ -780,6 +780,7 @@ function createTheme(opts) {
|
|
|
780
780
|
L["accent-violet"] = L["fg-accent"];
|
|
781
781
|
L["focus-ring"] = fit(b[700], lightGrounds.concat([b[50]]), 3, -1);
|
|
782
782
|
L["bg-selected"] = b[50];
|
|
783
|
+
L["calendar-range-bg"] = b[100];
|
|
783
784
|
L["status-progress-bg"] = b[100];
|
|
784
785
|
L["status-progress-fg"] = fit(b[800], [b[100]], 4.5, -1);
|
|
785
786
|
L["alert-info-bg"] = b[50];
|
|
@@ -819,6 +820,7 @@ function createTheme(opts) {
|
|
|
819
820
|
D["control-checked-bg"] = fit(b[300], darkGrounds, 3, 1);
|
|
820
821
|
D["control-checked-fg"] = onFill(D["control-checked-bg"]);
|
|
821
822
|
D["nav-active-edge"] = D["control-checked-bg"];
|
|
823
|
+
D["calendar-range-bg"] = D["bg-selected"];
|
|
822
824
|
const shadowLight = INK, shadowDark = D["accent-violet"];
|
|
823
825
|
if (o.primary === "brand") {
|
|
824
826
|
L["button-primary-bg"] = fit(b[600], [ZINC[0]], 4.5, -1);
|
|
@@ -876,6 +878,7 @@ function createTheme(opts) {
|
|
|
876
878
|
check("dark", "chart-1", "chart-2 (lightness step)", 1.8, D["chart-1"], CHART_2);
|
|
877
879
|
check("light", "fg-primary", "bg-selected", 4.5, INK, L["bg-selected"]);
|
|
878
880
|
check("dark", "fg-primary", "bg-selected", 4.5, "#ffffff", D["bg-selected"]);
|
|
881
|
+
check("light", "fg-primary", "calendar-range-bg", 4.5, INK, L["calendar-range-bg"]);
|
|
879
882
|
check("light", "status-progress-fg", "status-progress-bg", 4.5, L["status-progress-fg"], L["status-progress-bg"]);
|
|
880
883
|
check("dark", "status-progress-fg", "status-progress-bg", 4.5, D["status-progress-fg"], D["status-progress-bg"]);
|
|
881
884
|
check("light", "alert-info-fg", "alert-info-bg", 4.5, L["alert-info-fg"], L["alert-info-bg"]);
|
|
@@ -997,15 +1000,16 @@ function tone(t) {
|
|
|
997
1000
|
return TONES.indexOf(t) >= 0 ? t : "neutral";
|
|
998
1001
|
}
|
|
999
1002
|
var warned = {};
|
|
1000
|
-
function
|
|
1001
|
-
if (warned[key]) return;
|
|
1002
|
-
let dev = false;
|
|
1003
|
+
function isDev() {
|
|
1003
1004
|
try {
|
|
1004
|
-
|
|
1005
|
+
return process.env.NODE_ENV !== "production";
|
|
1005
1006
|
} catch (e) {
|
|
1006
|
-
|
|
1007
|
+
return false;
|
|
1007
1008
|
}
|
|
1008
|
-
|
|
1009
|
+
}
|
|
1010
|
+
function devWarnOnce(key, message) {
|
|
1011
|
+
if (warned[key]) return;
|
|
1012
|
+
if (!isDev()) return;
|
|
1009
1013
|
warned[key] = true;
|
|
1010
1014
|
console.warn("[AURA] " + message);
|
|
1011
1015
|
}
|
|
@@ -1669,6 +1673,15 @@ function TableSkeleton(props) {
|
|
|
1669
1673
|
var React6 = __toESM(require("react"), 1);
|
|
1670
1674
|
var h5 = React6.createElement;
|
|
1671
1675
|
var LAZY = Symbol.for("react.lazy");
|
|
1676
|
+
var ID = /([A-Za-z0-9]+(?:-[A-Za-z0-9]+)+)/;
|
|
1677
|
+
function keepIds(title) {
|
|
1678
|
+
if (typeof title !== "string" || title.indexOf("-") < 0) return title;
|
|
1679
|
+
const parts = title.split(ID);
|
|
1680
|
+
if (parts.length < 2) return title;
|
|
1681
|
+
return parts.map(function(p, i) {
|
|
1682
|
+
return i % 2 && /\d/.test(p) && p.length <= 24 ? h5("span", { key: i, className: "aura-nowrap" }, p) : p;
|
|
1683
|
+
});
|
|
1684
|
+
}
|
|
1672
1685
|
function chipsOnly(node) {
|
|
1673
1686
|
let el = 0;
|
|
1674
1687
|
const walk = function(n3) {
|
|
@@ -1720,7 +1733,7 @@ var PageHeader = React6.forwardRef(function PageHeader2(props, ref) {
|
|
|
1720
1733
|
tabIndex: props.focusTitleOnMount ? -1 : void 0,
|
|
1721
1734
|
"data-aura-focus-on-mount": props.focusTitleOnMount ? "" : void 0
|
|
1722
1735
|
},
|
|
1723
|
-
props.title
|
|
1736
|
+
keepIds(props.title)
|
|
1724
1737
|
);
|
|
1725
1738
|
const hasActions = props.actions != null && props.actions !== false;
|
|
1726
1739
|
const hasBarActions = props.actionsBar != null && props.actionsBar !== false;
|
|
@@ -1791,6 +1804,21 @@ var STATUS_WORD = {
|
|
|
1791
1804
|
ok: "statusOk",
|
|
1792
1805
|
unknown: "statusUnknown"
|
|
1793
1806
|
};
|
|
1807
|
+
function breakAtDots(title) {
|
|
1808
|
+
if (typeof title !== "string" || !/[./][A-Za-z]/.test(title)) return title;
|
|
1809
|
+
const out = [];
|
|
1810
|
+
let run = "";
|
|
1811
|
+
for (let i = 0; i < title.length; i++) {
|
|
1812
|
+
const c = title.charAt(i);
|
|
1813
|
+
run += c;
|
|
1814
|
+
if ((c === "." || c === "/") && i + 1 < title.length && /[A-Za-z]/.test(title.charAt(i + 1))) {
|
|
1815
|
+
out.push(run, h6("wbr", { key: i }));
|
|
1816
|
+
run = "";
|
|
1817
|
+
}
|
|
1818
|
+
}
|
|
1819
|
+
if (run) out.push(run);
|
|
1820
|
+
return out;
|
|
1821
|
+
}
|
|
1794
1822
|
function statusWord(status, t) {
|
|
1795
1823
|
return String(t[STATUS_WORD[status]] || STATUS_WORD[status]);
|
|
1796
1824
|
}
|
|
@@ -1829,7 +1857,7 @@ function statusTileElement(props, ref, Link, t, titleRef) {
|
|
|
1829
1857
|
"span",
|
|
1830
1858
|
{ className: "aura-status-tile__head" },
|
|
1831
1859
|
h6(Icon, { name: h6(STATUS_ICON[status]), size: 16, className: "aura-status-tile__icon" }),
|
|
1832
|
-
h6("span", { className: "aura-status-tile__title", ref: titleRef }, props.title, comma),
|
|
1860
|
+
h6("span", { className: "aura-status-tile__title", ref: titleRef }, breakAtDots(props.title), comma),
|
|
1833
1861
|
h6("span", { className: "aura-sr-only" }, word + (hasValue || hasMeta || markers.length ? "," : "")),
|
|
1834
1862
|
hasValue ? h6(
|
|
1835
1863
|
"span",
|
package/dist/server/index.js
CHANGED
|
@@ -713,6 +713,7 @@ function createTheme(opts) {
|
|
|
713
713
|
L["accent-violet"] = L["fg-accent"];
|
|
714
714
|
L["focus-ring"] = fit(b[700], lightGrounds.concat([b[50]]), 3, -1);
|
|
715
715
|
L["bg-selected"] = b[50];
|
|
716
|
+
L["calendar-range-bg"] = b[100];
|
|
716
717
|
L["status-progress-bg"] = b[100];
|
|
717
718
|
L["status-progress-fg"] = fit(b[800], [b[100]], 4.5, -1);
|
|
718
719
|
L["alert-info-bg"] = b[50];
|
|
@@ -752,6 +753,7 @@ function createTheme(opts) {
|
|
|
752
753
|
D["control-checked-bg"] = fit(b[300], darkGrounds, 3, 1);
|
|
753
754
|
D["control-checked-fg"] = onFill(D["control-checked-bg"]);
|
|
754
755
|
D["nav-active-edge"] = D["control-checked-bg"];
|
|
756
|
+
D["calendar-range-bg"] = D["bg-selected"];
|
|
755
757
|
const shadowLight = INK, shadowDark = D["accent-violet"];
|
|
756
758
|
if (o.primary === "brand") {
|
|
757
759
|
L["button-primary-bg"] = fit(b[600], [ZINC[0]], 4.5, -1);
|
|
@@ -809,6 +811,7 @@ function createTheme(opts) {
|
|
|
809
811
|
check("dark", "chart-1", "chart-2 (lightness step)", 1.8, D["chart-1"], CHART_2);
|
|
810
812
|
check("light", "fg-primary", "bg-selected", 4.5, INK, L["bg-selected"]);
|
|
811
813
|
check("dark", "fg-primary", "bg-selected", 4.5, "#ffffff", D["bg-selected"]);
|
|
814
|
+
check("light", "fg-primary", "calendar-range-bg", 4.5, INK, L["calendar-range-bg"]);
|
|
812
815
|
check("light", "status-progress-fg", "status-progress-bg", 4.5, L["status-progress-fg"], L["status-progress-bg"]);
|
|
813
816
|
check("dark", "status-progress-fg", "status-progress-bg", 4.5, D["status-progress-fg"], D["status-progress-bg"]);
|
|
814
817
|
check("light", "alert-info-fg", "alert-info-bg", 4.5, L["alert-info-fg"], L["alert-info-bg"]);
|
|
@@ -930,15 +933,16 @@ function tone(t) {
|
|
|
930
933
|
return TONES.indexOf(t) >= 0 ? t : "neutral";
|
|
931
934
|
}
|
|
932
935
|
var warned = {};
|
|
933
|
-
function
|
|
934
|
-
if (warned[key]) return;
|
|
935
|
-
let dev = false;
|
|
936
|
+
function isDev() {
|
|
936
937
|
try {
|
|
937
|
-
|
|
938
|
+
return process.env.NODE_ENV !== "production";
|
|
938
939
|
} catch (e) {
|
|
939
|
-
|
|
940
|
+
return false;
|
|
940
941
|
}
|
|
941
|
-
|
|
942
|
+
}
|
|
943
|
+
function devWarnOnce(key, message) {
|
|
944
|
+
if (warned[key]) return;
|
|
945
|
+
if (!isDev()) return;
|
|
942
946
|
warned[key] = true;
|
|
943
947
|
console.warn("[AURA] " + message);
|
|
944
948
|
}
|
|
@@ -1602,6 +1606,15 @@ function TableSkeleton(props) {
|
|
|
1602
1606
|
import * as React6 from "react";
|
|
1603
1607
|
var h5 = React6.createElement;
|
|
1604
1608
|
var LAZY = Symbol.for("react.lazy");
|
|
1609
|
+
var ID = /([A-Za-z0-9]+(?:-[A-Za-z0-9]+)+)/;
|
|
1610
|
+
function keepIds(title) {
|
|
1611
|
+
if (typeof title !== "string" || title.indexOf("-") < 0) return title;
|
|
1612
|
+
const parts = title.split(ID);
|
|
1613
|
+
if (parts.length < 2) return title;
|
|
1614
|
+
return parts.map(function(p, i) {
|
|
1615
|
+
return i % 2 && /\d/.test(p) && p.length <= 24 ? h5("span", { key: i, className: "aura-nowrap" }, p) : p;
|
|
1616
|
+
});
|
|
1617
|
+
}
|
|
1605
1618
|
function chipsOnly(node) {
|
|
1606
1619
|
let el = 0;
|
|
1607
1620
|
const walk = function(n3) {
|
|
@@ -1653,7 +1666,7 @@ var PageHeader = React6.forwardRef(function PageHeader2(props, ref) {
|
|
|
1653
1666
|
tabIndex: props.focusTitleOnMount ? -1 : void 0,
|
|
1654
1667
|
"data-aura-focus-on-mount": props.focusTitleOnMount ? "" : void 0
|
|
1655
1668
|
},
|
|
1656
|
-
props.title
|
|
1669
|
+
keepIds(props.title)
|
|
1657
1670
|
);
|
|
1658
1671
|
const hasActions = props.actions != null && props.actions !== false;
|
|
1659
1672
|
const hasBarActions = props.actionsBar != null && props.actionsBar !== false;
|
|
@@ -1724,6 +1737,21 @@ var STATUS_WORD = {
|
|
|
1724
1737
|
ok: "statusOk",
|
|
1725
1738
|
unknown: "statusUnknown"
|
|
1726
1739
|
};
|
|
1740
|
+
function breakAtDots(title) {
|
|
1741
|
+
if (typeof title !== "string" || !/[./][A-Za-z]/.test(title)) return title;
|
|
1742
|
+
const out = [];
|
|
1743
|
+
let run = "";
|
|
1744
|
+
for (let i = 0; i < title.length; i++) {
|
|
1745
|
+
const c = title.charAt(i);
|
|
1746
|
+
run += c;
|
|
1747
|
+
if ((c === "." || c === "/") && i + 1 < title.length && /[A-Za-z]/.test(title.charAt(i + 1))) {
|
|
1748
|
+
out.push(run, h6("wbr", { key: i }));
|
|
1749
|
+
run = "";
|
|
1750
|
+
}
|
|
1751
|
+
}
|
|
1752
|
+
if (run) out.push(run);
|
|
1753
|
+
return out;
|
|
1754
|
+
}
|
|
1727
1755
|
function statusWord(status, t) {
|
|
1728
1756
|
return String(t[STATUS_WORD[status]] || STATUS_WORD[status]);
|
|
1729
1757
|
}
|
|
@@ -1762,7 +1790,7 @@ function statusTileElement(props, ref, Link, t, titleRef) {
|
|
|
1762
1790
|
"span",
|
|
1763
1791
|
{ className: "aura-status-tile__head" },
|
|
1764
1792
|
h6(Icon, { name: h6(STATUS_ICON[status]), size: 16, className: "aura-status-tile__icon" }),
|
|
1765
|
-
h6("span", { className: "aura-status-tile__title", ref: titleRef }, props.title, comma),
|
|
1793
|
+
h6("span", { className: "aura-status-tile__title", ref: titleRef }, breakAtDots(props.title), comma),
|
|
1766
1794
|
h6("span", { className: "aura-sr-only" }, word + (hasValue || hasMeta || markers.length ? "," : "")),
|
|
1767
1795
|
hasValue ? h6(
|
|
1768
1796
|
"span",
|