@jirawatpyk/aura-react 5.13.0 → 5.15.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 +26 -0
- package/dist/aura.bundle.js +291 -106
- package/dist/cjs/index.cjs +291 -106
- package/dist/esm/AppShell.js +69 -24
- package/dist/esm/Avatar.js +4 -32
- package/dist/esm/Breadcrumb.js +76 -6
- package/dist/esm/Button.js +10 -4
- package/dist/esm/Checkbox.js +12 -2
- package/dist/esm/FilterBar.js +7 -1
- package/dist/esm/IconButton.js +7 -2
- package/dist/esm/Progress.js +14 -2
- package/dist/esm/Stat.js +2 -30
- package/dist/esm/Table.js +5 -2
- package/dist/esm/Tabs.js +8 -2
- package/dist/esm/display.js +83 -5
- package/dist/esm/strings.js +4 -0
- package/dist/esm/strings.sv.js +4 -0
- package/dist/esm/strings.th.js +4 -0
- package/dist/index.d.cts +68 -5
- package/dist/index.d.ts +68 -5
- package/dist/locales/sv.cjs +4 -0
- package/dist/locales/sv.d.cts +4 -0
- package/dist/locales/sv.d.ts +4 -0
- package/dist/locales/th.cjs +4 -0
- package/dist/locales/th.d.cts +4 -0
- package/dist/locales/th.d.ts +4 -0
- package/dist/server/index.cjs +98 -4
- package/dist/server/index.d.cts +62 -1
- package/dist/server/index.d.ts +62 -1
- package/dist/server/index.js +98 -4
- package/dist/styles.css +125 -5
- package/dist/styles.layer.css +125 -5
- package/package.json +1 -1
package/dist/esm/AppShell.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { Drawer } from "./Dialog.js";
|
|
4
4
|
import { IconButton } from "./IconButton.js";
|
|
5
|
-
import { cx } from "./internal.js";
|
|
5
|
+
import { cx, useIsoLayoutEffect, useMergedRef } from "./internal.js";
|
|
6
6
|
import { useStrings } from "./locale.js";
|
|
7
7
|
import { useBreakpoint } from "./responsive.js";
|
|
8
8
|
import { IconMenu } from "./icons.js";
|
|
@@ -24,6 +24,27 @@ const AppShell = React.forwardRef(function AppShell2(props, ref) {
|
|
|
24
24
|
if (shared) navState[1](id);
|
|
25
25
|
if (navEl && navEl.props.onChange) navEl.props.onChange(id);
|
|
26
26
|
}
|
|
27
|
+
const rootRef = React.useRef(null);
|
|
28
|
+
const barRef = React.useRef(null);
|
|
29
|
+
const mergedRef = useMergedRef(ref, rootRef);
|
|
30
|
+
const hasBar = !!(props.header || props.nav);
|
|
31
|
+
useIsoLayoutEffect(
|
|
32
|
+
function() {
|
|
33
|
+
const root = rootRef.current, bar = barRef.current;
|
|
34
|
+
if (!root || !bar) return;
|
|
35
|
+
function sync() {
|
|
36
|
+
root.style.setProperty("--aura-shell-bar-height", bar.getBoundingClientRect().height + "px");
|
|
37
|
+
}
|
|
38
|
+
sync();
|
|
39
|
+
const ro = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(sync);
|
|
40
|
+
if (ro) ro.observe(bar);
|
|
41
|
+
return function() {
|
|
42
|
+
if (ro) ro.disconnect();
|
|
43
|
+
root.style.removeProperty("--aura-shell-bar-height");
|
|
44
|
+
};
|
|
45
|
+
},
|
|
46
|
+
[hasBar]
|
|
47
|
+
);
|
|
27
48
|
const deskNav = navEl && shared ? React.cloneElement(navEl, { value: navState[0], onChange: onNav }) : props.nav;
|
|
28
49
|
const drawerNav = navEl ? React.cloneElement(navEl, {
|
|
29
50
|
value: shared ? navState[0] : navEl.props.value,
|
|
@@ -35,32 +56,56 @@ const AppShell = React.forwardRef(function AppShell2(props, ref) {
|
|
|
35
56
|
collapsed: false,
|
|
36
57
|
collapsible: false
|
|
37
58
|
}) : props.nav;
|
|
38
|
-
return /* @__PURE__ */ React.createElement(
|
|
39
|
-
|
|
59
|
+
return /* @__PURE__ */ React.createElement(
|
|
60
|
+
"div",
|
|
40
61
|
{
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
62
|
+
ref: mergedRef,
|
|
63
|
+
className: cx(
|
|
64
|
+
"aura-shell",
|
|
65
|
+
props.bottomNav && "aura-shell--bottomnav",
|
|
66
|
+
/* 5.14: no top bar at all, or one that only holds the menu button (gone from lg up): the bar-height token is 0. */
|
|
67
|
+
!props.header && !props.nav && "aura-shell--no-bar",
|
|
68
|
+
!props.header && props.nav && "aura-shell--menu-bar",
|
|
69
|
+
props.className
|
|
70
|
+
)
|
|
49
71
|
},
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
72
|
+
props.nav ? /* @__PURE__ */ React.createElement("div", { className: "aura-shell__nav" }, deskNav) : null,
|
|
73
|
+
props.nav ? /* @__PURE__ */ React.createElement(
|
|
74
|
+
Drawer,
|
|
75
|
+
{
|
|
76
|
+
open,
|
|
77
|
+
onClose: function() {
|
|
78
|
+
setOpen(false);
|
|
79
|
+
},
|
|
80
|
+
side: "left",
|
|
81
|
+
size: "nav",
|
|
82
|
+
"aria-label": props.navLabel || t.navigation,
|
|
83
|
+
dismissible: true
|
|
84
|
+
},
|
|
85
|
+
drawerNav
|
|
86
|
+
) : null,
|
|
87
|
+
/* @__PURE__ */ React.createElement("div", { className: "aura-shell__main" }, props.header || props.nav ? /* @__PURE__ */ React.createElement("header", { ref: barRef, className: cx("aura-shell__bar", !props.header && "aura-shell__bar--menu-only") }, props.nav ? /* @__PURE__ */ React.createElement(
|
|
88
|
+
IconButton,
|
|
89
|
+
{
|
|
90
|
+
className: "aura-shell__menu",
|
|
91
|
+
icon: /* @__PURE__ */ React.createElement(IconMenu, null),
|
|
92
|
+
label: props.menuLabel || t.openNav,
|
|
93
|
+
size: "md",
|
|
94
|
+
onClick: function() {
|
|
95
|
+
setOpen(true);
|
|
96
|
+
},
|
|
97
|
+
"aria-expanded": open
|
|
98
|
+
}
|
|
99
|
+
) : null, /* @__PURE__ */ React.createElement("div", { className: "aura-shell__bar-content" }, props.header)) : null, /* @__PURE__ */ React.createElement(
|
|
100
|
+
"main",
|
|
101
|
+
{
|
|
102
|
+
className: cx("aura-shell__content", props.contentPadding === false && "is-flush"),
|
|
103
|
+
id: props.mainId || "main",
|
|
104
|
+
tabIndex: -1
|
|
60
105
|
},
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
)
|
|
106
|
+
props.children
|
|
107
|
+
), props.bottomNav || null)
|
|
108
|
+
);
|
|
64
109
|
});
|
|
65
110
|
export {
|
|
66
111
|
AppShell
|
package/dist/esm/Avatar.js
CHANGED
|
@@ -1,39 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import {
|
|
4
|
-
const AVATAR_TONES = ["progress", "ready", "neutral", "warning"];
|
|
5
|
-
function initials(name) {
|
|
6
|
-
const parts = String(name || "?").trim().split(/\s+/);
|
|
7
|
-
return ((parts[0] || "?")[0] + (parts.length > 1 ? parts[parts.length - 1][0] : parts[0][1] || "")).toUpperCase();
|
|
8
|
-
}
|
|
3
|
+
import { avatarElement } from "./display.js";
|
|
9
4
|
const Avatar = React.forwardRef(function Avatar2(props, ref) {
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
hash = hash * 31 + ch.charCodeAt(0) >>> 0;
|
|
5
|
+
const errState = React.useState(null);
|
|
6
|
+
return avatarElement(props, ref, errState[0], function() {
|
|
7
|
+
errState[1](props.src || null);
|
|
14
8
|
});
|
|
15
|
-
const tone = AVATAR_TONES[hash % AVATAR_TONES.length];
|
|
16
|
-
return /* @__PURE__ */ React.createElement(
|
|
17
|
-
"span",
|
|
18
|
-
{
|
|
19
|
-
ref,
|
|
20
|
-
className: cx("aura-avatar", "aura-avatar--" + size, "aura-avatar--" + tone, props.className),
|
|
21
|
-
role: "img",
|
|
22
|
-
"aria-label": props.name + (props.status ? ", " + props.status : "")
|
|
23
|
-
},
|
|
24
|
-
props.src && errState[0] !== props.src ? /* @__PURE__ */ React.createElement(
|
|
25
|
-
"img",
|
|
26
|
-
{
|
|
27
|
-
key: props.src,
|
|
28
|
-
src: props.src,
|
|
29
|
-
alt: "",
|
|
30
|
-
onError: function() {
|
|
31
|
-
errState[1](props.src || null);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
) : /* @__PURE__ */ React.createElement("span", { "aria-hidden": true }, initials(props.name)),
|
|
35
|
-
props.status === "online" ? /* @__PURE__ */ React.createElement("span", { className: "aura-avatar__status", "aria-hidden": true }) : null
|
|
36
|
-
);
|
|
37
9
|
});
|
|
38
10
|
export {
|
|
39
11
|
Avatar
|
package/dist/esm/Breadcrumb.js
CHANGED
|
@@ -8,13 +8,83 @@ const Breadcrumb = React.forwardRef(function Breadcrumb2(props, ref) {
|
|
|
8
8
|
const t = useStrings();
|
|
9
9
|
const Link = useLinkComponent(props.linkComponent);
|
|
10
10
|
const items = props.items || [];
|
|
11
|
-
|
|
11
|
+
const collapsible = !!props.collapseBelow && items.length > 2;
|
|
12
|
+
const trail = items.map(function(it) {
|
|
13
|
+
return it.label + "" + (it.href || "");
|
|
14
|
+
}).join("");
|
|
15
|
+
const st = React.useState(null), expanded = st[0] === trail, setExpanded = function() {
|
|
16
|
+
st[1](trail);
|
|
17
|
+
};
|
|
18
|
+
const listRef = React.useRef(null);
|
|
19
|
+
const focusNext = React.useRef(false);
|
|
20
|
+
React.useEffect(
|
|
21
|
+
function() {
|
|
22
|
+
if (!expanded || !focusNext.current) return;
|
|
23
|
+
focusNext.current = false;
|
|
24
|
+
const ol = listRef.current;
|
|
25
|
+
if (!ol) return;
|
|
26
|
+
let target = ol.querySelector(".aura-crumbs__middle a, .aura-crumbs__middle button");
|
|
27
|
+
if (!target) {
|
|
28
|
+
target = ol.querySelector(".aura-crumbs__middle > *");
|
|
29
|
+
if (target) target.tabIndex = -1;
|
|
30
|
+
}
|
|
31
|
+
if (target) target.focus();
|
|
32
|
+
},
|
|
33
|
+
[expanded]
|
|
34
|
+
);
|
|
35
|
+
const sep = /* @__PURE__ */ React.createElement(Icon, { name: /* @__PURE__ */ React.createElement(IconChevronRight, null), size: 12, className: "aura-crumbs__sep" });
|
|
36
|
+
const more = collapsible && !expanded ? /* @__PURE__ */ React.createElement("li", { key: "more", className: "aura-crumbs__more" }, /* @__PURE__ */ React.createElement(
|
|
37
|
+
"button",
|
|
38
|
+
{
|
|
39
|
+
type: "button",
|
|
40
|
+
"aria-label": t.breadcrumbMore,
|
|
41
|
+
onClick: function() {
|
|
42
|
+
focusNext.current = true;
|
|
43
|
+
setExpanded();
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"\u2026"
|
|
47
|
+
), sep) : null;
|
|
48
|
+
const out = [];
|
|
49
|
+
items.forEach(function(it, i) {
|
|
12
50
|
const last = i === items.length - 1;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
51
|
+
const lp = it.linkProps || {};
|
|
52
|
+
const plain = lp;
|
|
53
|
+
const own = lp.onClick;
|
|
54
|
+
const click = own || it.onClick ? function(e) {
|
|
55
|
+
if (own) own(e);
|
|
56
|
+
if (it.onClick) it.onClick();
|
|
57
|
+
} : void 0;
|
|
58
|
+
out.push(
|
|
59
|
+
/* @__PURE__ */ React.createElement(
|
|
60
|
+
"li",
|
|
61
|
+
{
|
|
62
|
+
key: i,
|
|
63
|
+
...it.itemProps,
|
|
64
|
+
className: cx(it.itemProps && it.itemProps.className, collapsible && !last && i > 0 && "aura-crumbs__middle") || void 0
|
|
65
|
+
},
|
|
66
|
+
last ? /* @__PURE__ */ React.createElement("span", { ...plain, "aria-current": "page", className: cx("aura-crumbs__current", lp.className) }, it.label) : it.href ? /* @__PURE__ */ React.createElement(Link, { ...lp, href: it.href, onClick: click }, it.label) : it.onClick ? /* @__PURE__ */ React.createElement("button", { ...lp, type: "button", onClick: click }, it.label) : (
|
|
67
|
+
/* 5.7: a segment with no page and no action is text, not a button that does nothing. */
|
|
68
|
+
/* @__PURE__ */ React.createElement("span", { ...plain, className: cx("aura-crumbs__text", lp.className) }, it.label)
|
|
69
|
+
),
|
|
70
|
+
last ? null : sep
|
|
71
|
+
)
|
|
72
|
+
);
|
|
73
|
+
if (i === 0 && more) out.push(more);
|
|
74
|
+
});
|
|
75
|
+
return /* @__PURE__ */ React.createElement(
|
|
76
|
+
"nav",
|
|
77
|
+
{
|
|
78
|
+
ref,
|
|
79
|
+
"aria-label": props.label || t.breadcrumb,
|
|
80
|
+
className: cx(
|
|
81
|
+
"aura-crumbs",
|
|
82
|
+
collapsible && !expanded && "aura-crumbs--collapse-" + props.collapseBelow,
|
|
83
|
+
props.className
|
|
84
|
+
)
|
|
85
|
+
},
|
|
86
|
+
/* @__PURE__ */ React.createElement("ol", { ref: listRef }, out)
|
|
87
|
+
);
|
|
18
88
|
});
|
|
19
89
|
export {
|
|
20
90
|
Breadcrumb
|
package/dist/esm/Button.js
CHANGED
|
@@ -18,7 +18,8 @@ function ButtonLink(props, ref, Link) {
|
|
|
18
18
|
"linkComponent",
|
|
19
19
|
"href",
|
|
20
20
|
"fullWidth",
|
|
21
|
-
"size"
|
|
21
|
+
"size",
|
|
22
|
+
"touchHeight"
|
|
22
23
|
]);
|
|
23
24
|
const Tag = disabled ? "a" : Link;
|
|
24
25
|
return /* @__PURE__ */ React.createElement(
|
|
@@ -34,6 +35,7 @@ function ButtonLink(props, ref, Link) {
|
|
|
34
35
|
variant,
|
|
35
36
|
size: props.size,
|
|
36
37
|
fullWidth: props.fullWidth,
|
|
38
|
+
touchHeight: props.touchHeight,
|
|
37
39
|
className: props.className
|
|
38
40
|
}),
|
|
39
41
|
onClick: disabled ? void 0 : props.onClick
|
|
@@ -52,6 +54,8 @@ const Button = React.forwardRef(
|
|
|
52
54
|
const props = all;
|
|
53
55
|
const variant = props.variant || "primary";
|
|
54
56
|
const loading = !!props.loading;
|
|
57
|
+
const ad = props["aria-disabled"];
|
|
58
|
+
const blocked = loading || ad === true || ad === "true";
|
|
55
59
|
const rest = omit(props, [
|
|
56
60
|
"variant",
|
|
57
61
|
"className",
|
|
@@ -62,7 +66,8 @@ const Button = React.forwardRef(
|
|
|
62
66
|
"loading",
|
|
63
67
|
"onClick",
|
|
64
68
|
"fullWidth",
|
|
65
|
-
"size"
|
|
69
|
+
"size",
|
|
70
|
+
"touchHeight"
|
|
66
71
|
]);
|
|
67
72
|
return /* @__PURE__ */ React.createElement(
|
|
68
73
|
"button",
|
|
@@ -74,12 +79,13 @@ const Button = React.forwardRef(
|
|
|
74
79
|
variant,
|
|
75
80
|
size: props.size,
|
|
76
81
|
fullWidth: props.fullWidth,
|
|
82
|
+
touchHeight: props.touchHeight,
|
|
77
83
|
loading,
|
|
78
84
|
className: props.className
|
|
79
85
|
}),
|
|
80
86
|
"aria-busy": loading || void 0,
|
|
81
|
-
"aria-disabled":
|
|
82
|
-
onClick:
|
|
87
|
+
"aria-disabled": blocked || void 0,
|
|
88
|
+
onClick: blocked ? function(e) {
|
|
83
89
|
e.preventDefault();
|
|
84
90
|
} : props.onClick
|
|
85
91
|
},
|
package/dist/esm/Checkbox.js
CHANGED
|
@@ -22,7 +22,8 @@ const Checkbox = React.forwardRef(function Checkbox2(props, ref) {
|
|
|
22
22
|
"description",
|
|
23
23
|
"className",
|
|
24
24
|
"tabIndex",
|
|
25
|
-
"disabled"
|
|
25
|
+
"disabled",
|
|
26
|
+
"hitArea"
|
|
26
27
|
]);
|
|
27
28
|
const text = props.children;
|
|
28
29
|
const labelled = text != null && text !== "";
|
|
@@ -32,10 +33,19 @@ const Checkbox = React.forwardRef(function Checkbox2(props, ref) {
|
|
|
32
33
|
"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`."
|
|
33
34
|
);
|
|
34
35
|
const descId = props.description ? (props.id || auto) + "-desc" : void 0;
|
|
36
|
+
const ha = props.hitArea;
|
|
37
|
+
const hit = !labelled && ha && ha !== "box" ? ha === "target" ? { x: 4, y: 4 } : ha : null;
|
|
35
38
|
return /* @__PURE__ */ React.createElement(
|
|
36
39
|
"label",
|
|
37
40
|
{
|
|
38
|
-
className: cx(
|
|
41
|
+
className: cx(
|
|
42
|
+
"aura-check",
|
|
43
|
+
labelled && "aura-check--labelled",
|
|
44
|
+
hit && "has-hit",
|
|
45
|
+
props.disabled && "is-disabled",
|
|
46
|
+
props.className
|
|
47
|
+
),
|
|
48
|
+
style: hit ? { "--aura-check-hit-x": hit.x + "px", "--aura-check-hit-y": hit.y + "px" } : void 0,
|
|
39
49
|
onClick: function(e) {
|
|
40
50
|
e.stopPropagation();
|
|
41
51
|
}
|
package/dist/esm/FilterBar.js
CHANGED
|
@@ -55,7 +55,13 @@ const FilterBar = React.forwardRef(function FilterBar2(props, ref) {
|
|
|
55
55
|
ref,
|
|
56
56
|
role: "region",
|
|
57
57
|
"aria-label": props.label || t.filters,
|
|
58
|
-
className: cx(
|
|
58
|
+
className: cx(
|
|
59
|
+
"aura-filterbar",
|
|
60
|
+
props.searchGrow && "aura-filterbar--grow",
|
|
61
|
+
props.controlsLayout === "fill" && "aura-filterbar--fill",
|
|
62
|
+
props.stackBelow === "lg" && "aura-filterbar--stack-lg",
|
|
63
|
+
props.className
|
|
64
|
+
)
|
|
59
65
|
},
|
|
60
66
|
/* @__PURE__ */ React.createElement("div", { className: "aura-filterbar__row" }, hasSearch ? /* @__PURE__ */ React.createElement("div", { className: "aura-input has-icon aura-filterbar__search" }, /* @__PURE__ */ React.createElement(Icon, { name: /* @__PURE__ */ React.createElement(IconSearch, null), className: "aura-input__icon" }), /* @__PURE__ */ React.createElement(
|
|
61
67
|
"input",
|
package/dist/esm/IconButton.js
CHANGED
|
@@ -3,7 +3,7 @@ import * as React from "react";
|
|
|
3
3
|
import { cx, omit } from "./internal.js";
|
|
4
4
|
import { Icon } from "./Icon.js";
|
|
5
5
|
const IconButton = React.forwardRef(function IconButton2(props, ref) {
|
|
6
|
-
const rest = omit(props, ["icon", "label", "className", "size", "tone"]);
|
|
6
|
+
const rest = omit(props, ["icon", "label", "className", "size", "tone", "touchHeight"]);
|
|
7
7
|
return /* @__PURE__ */ React.createElement(
|
|
8
8
|
"button",
|
|
9
9
|
{
|
|
@@ -12,7 +12,12 @@ const IconButton = React.forwardRef(function IconButton2(props, ref) {
|
|
|
12
12
|
type: props.type || "button",
|
|
13
13
|
"aria-label": props.label,
|
|
14
14
|
title: props.label,
|
|
15
|
-
className: cx(
|
|
15
|
+
className: cx(
|
|
16
|
+
"aura-icon-btn",
|
|
17
|
+
props.tone === "danger" && "aura-icon-btn--danger",
|
|
18
|
+
props.touchHeight && "aura-icon-btn--touch",
|
|
19
|
+
props.className
|
|
20
|
+
)
|
|
16
21
|
},
|
|
17
22
|
/* @__PURE__ */ React.createElement(Icon, { name: props.icon, size: props.size || "sm" })
|
|
18
23
|
);
|
package/dist/esm/Progress.js
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { cx, tone, uid } from "./internal.js";
|
|
4
|
+
import { useStrings } from "./locale.js";
|
|
4
5
|
const Progress = React.forwardRef(function Progress2(props, ref) {
|
|
6
|
+
const t = useStrings();
|
|
5
7
|
const auto = uid(), id = props.id || auto;
|
|
6
8
|
const max = props.max || 100, det = props.value != null;
|
|
7
9
|
const pct = det ? Math.max(0, Math.min(100, props.value / max * 100)) : 0;
|
|
10
|
+
const sec = det && props.secondaryValue != null && props.secondaryValue > 0 ? props.secondaryValue : 0;
|
|
11
|
+
const spct = sec ? Math.max(0, Math.min(100 - pct, sec / max * 100)) : 0;
|
|
12
|
+
const valueText = props.valueLabel != null ? String(props.valueLabel) : sec ? t.progressReserved(props.value, sec, max) : void 0;
|
|
8
13
|
const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
|
|
9
14
|
return /* @__PURE__ */ React.createElement(
|
|
10
15
|
"div",
|
|
@@ -28,9 +33,16 @@ const Progress = React.forwardRef(function Progress2(props, ref) {
|
|
|
28
33
|
"aria-valuemin": det ? 0 : void 0,
|
|
29
34
|
"aria-valuemax": det ? max : void 0,
|
|
30
35
|
"aria-valuenow": det ? props.value : void 0,
|
|
31
|
-
"aria-valuetext": det
|
|
36
|
+
"aria-valuetext": det ? valueText : void 0
|
|
32
37
|
},
|
|
33
|
-
/* @__PURE__ */ React.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 })
|
|
38
|
+
/* @__PURE__ */ React.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 }),
|
|
39
|
+
sec ? /* @__PURE__ */ React.createElement(
|
|
40
|
+
"span",
|
|
41
|
+
{
|
|
42
|
+
className: "aura-progress__bar aura-progress__bar--reserved",
|
|
43
|
+
style: { left: pct + "%", width: spct + "%" }
|
|
44
|
+
}
|
|
45
|
+
) : null
|
|
34
46
|
),
|
|
35
47
|
props.hint ? /* @__PURE__ */ React.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
|
|
36
48
|
);
|
package/dist/esm/Stat.js
CHANGED
|
@@ -1,38 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import { cx } from "./internal.js";
|
|
4
|
-
import { Icon } from "./Icon.js";
|
|
5
3
|
import { useLinkComponent } from "./locale.js";
|
|
6
|
-
import {
|
|
4
|
+
import { statElement } from "./display.js";
|
|
7
5
|
const Stat = React.forwardRef(function Stat2(props, ref) {
|
|
8
|
-
const ch = props.change;
|
|
9
|
-
const dir = ch && (ch.direction || "flat");
|
|
10
|
-
const tone = ch && (ch.tone || (dir === "up" ? "positive" : dir === "down" ? "negative" : "neutral"));
|
|
11
6
|
const Link = useLinkComponent(props.linkComponent);
|
|
12
|
-
|
|
13
|
-
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, ""));
|
|
14
|
-
const Tag = props.href ? Link : props.onClick ? "button" : "div";
|
|
15
|
-
const interactive = !!(props.href || props.onClick);
|
|
16
|
-
return /* @__PURE__ */ React.createElement(
|
|
17
|
-
Tag,
|
|
18
|
-
{
|
|
19
|
-
ref,
|
|
20
|
-
className: cx("aura-stat", interactive && "is-interactive", props.loading && "is-loading", props.className),
|
|
21
|
-
href: props.href,
|
|
22
|
-
onClick: props.onClick,
|
|
23
|
-
type: Tag === "button" ? "button" : void 0,
|
|
24
|
-
"aria-busy": props.loading || void 0
|
|
25
|
-
},
|
|
26
|
-
/* @__PURE__ */ React.createElement("span", { className: "aura-stat__head" }, /* @__PURE__ */ React.createElement("span", { className: "aura-stat__label" }, props.label), props.icon ? /* @__PURE__ */ React.createElement("span", { className: "aura-stat__icon" }, /* @__PURE__ */ React.createElement(Icon, { name: props.icon })) : null),
|
|
27
|
-
props.loading ? /* @__PURE__ */ React.createElement("span", { className: "aura-stat__value" }, /* @__PURE__ */ React.createElement("span", { className: "aura-skel aura-stat__skel" })) : /* @__PURE__ */ React.createElement("span", { className: cx("aura-stat__value", numeric && "is-numeric") }, props.value, props.unit ? /* @__PURE__ */ React.createElement("span", { className: "aura-stat__unit" }, props.unit) : null),
|
|
28
|
-
ch && !props.loading || props.caption ? /* @__PURE__ */ React.createElement("span", { className: "aura-stat__foot" }, ch && !props.loading ? /* @__PURE__ */ React.createElement("span", { className: cx("aura-stat__change", "is-" + tone) }, /* @__PURE__ */ React.createElement(
|
|
29
|
-
Icon,
|
|
30
|
-
{
|
|
31
|
-
name: dir === "up" ? /* @__PURE__ */ React.createElement(IconTrendingUp, null) : dir === "down" ? /* @__PURE__ */ React.createElement(IconTrendingDown, null) : /* @__PURE__ */ React.createElement(IconMinus, null),
|
|
32
|
-
size: 14
|
|
33
|
-
}
|
|
34
|
-
), /* @__PURE__ */ React.createElement("span", null, ch.value)) : null, ch && ch.label && !props.loading ? /* @__PURE__ */ React.createElement("span", { className: "aura-stat__caption" }, ch.label) : null, props.caption ? /* @__PURE__ */ React.createElement("span", { className: "aura-stat__caption" }, props.caption) : null) : null
|
|
35
|
-
);
|
|
7
|
+
return statElement(props, ref, Link);
|
|
36
8
|
});
|
|
37
9
|
export {
|
|
38
10
|
Stat
|
package/dist/esm/Table.js
CHANGED
|
@@ -47,7 +47,8 @@ function headerLabels(children) {
|
|
|
47
47
|
return out;
|
|
48
48
|
}
|
|
49
49
|
const Table = React.forwardRef(function Table2(props, ref) {
|
|
50
|
-
const { caption, captionHidden, density, stackBelow, align, bordered, className, children, ...rest } = props;
|
|
50
|
+
const { caption, captionHidden, density, stackBelow, align, bordered, stackStyle, className, children, ...rest } = props;
|
|
51
|
+
const cards = !!stackBelow && stackStyle === "cards";
|
|
51
52
|
const labels = stackBelow ? headerLabels(children) : null;
|
|
52
53
|
if (labels && !labels.length)
|
|
53
54
|
devWarnOnce(
|
|
@@ -71,7 +72,7 @@ const Table = React.forwardRef(function Table2(props, ref) {
|
|
|
71
72
|
ro.disconnect();
|
|
72
73
|
};
|
|
73
74
|
}, []);
|
|
74
|
-
|
|
75
|
+
const table = /* @__PURE__ */ React.createElement(
|
|
75
76
|
"div",
|
|
76
77
|
{
|
|
77
78
|
ref: wrap,
|
|
@@ -90,6 +91,7 @@ const Table = React.forwardRef(function Table2(props, ref) {
|
|
|
90
91
|
"aura-tbl",
|
|
91
92
|
stackBelow && "aura-tbl--stack-" + stackBelow,
|
|
92
93
|
align === "middle" && "aura-tbl--middle",
|
|
94
|
+
cards && "aura-tbl--cards",
|
|
93
95
|
className
|
|
94
96
|
),
|
|
95
97
|
role: stackBelow ? "table" : void 0,
|
|
@@ -99,6 +101,7 @@ const Table = React.forwardRef(function Table2(props, ref) {
|
|
|
99
101
|
labels ? /* @__PURE__ */ React.createElement(StackLabels.Provider, { value: labels }, children) : outer ? /* @__PURE__ */ React.createElement(StackLabels.Provider, { value: null }, children) : children
|
|
100
102
|
)
|
|
101
103
|
);
|
|
104
|
+
return cards ? /* @__PURE__ */ React.createElement("div", { className: "aura-tbl-cards aura-tbl-cards--" + stackBelow }, table) : table;
|
|
102
105
|
});
|
|
103
106
|
function section(tag, cls) {
|
|
104
107
|
const C = React.forwardRef(function TableSection(props, ref) {
|
package/dist/esm/Tabs.js
CHANGED
|
@@ -24,7 +24,13 @@ const Tabs = React.forwardRef(function Tabs2(props, ref) {
|
|
|
24
24
|
const Link = useLinkComponent(props.linkComponent);
|
|
25
25
|
const manual = props.activation === "manual";
|
|
26
26
|
const seg = props.variant === "segmented";
|
|
27
|
-
const
|
|
27
|
+
const fw = props.fullWidth;
|
|
28
|
+
const listCls = cx(
|
|
29
|
+
"aura-tabs__list",
|
|
30
|
+
seg && "aura-segmented",
|
|
31
|
+
fw === true && (seg ? "is-full" : "is-fill"),
|
|
32
|
+
typeof fw === "string" && (seg ? "is-full-" : "is-fill-") + fw
|
|
33
|
+
);
|
|
28
34
|
const tabCls = function(on, extra) {
|
|
29
35
|
return cx("aura-tab", on && "is-active", seg && "aura-segmented__option", seg && on && "is-selected", extra);
|
|
30
36
|
};
|
|
@@ -81,7 +87,7 @@ const Tabs = React.forwardRef(function Tabs2(props, ref) {
|
|
|
81
87
|
key: t.id,
|
|
82
88
|
href: t.href,
|
|
83
89
|
className: tabCls(on, own.className),
|
|
84
|
-
"aria-current": on ? "page" : void 0,
|
|
90
|
+
"aria-current": on ? props.current || "page" : void 0,
|
|
85
91
|
onClick: function(e) {
|
|
86
92
|
if (own.onClick) own.onClick(e);
|
|
87
93
|
if (e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return;
|