@studiolxd/brand 40.1.0 → 41.0.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/CHANGELOG.md +41 -0
- package/dist/_types/messages/BrandMessages.d.ts +5 -1
- package/dist/_types/messages/index.d.ts +1 -1
- package/dist/_types/molecules/Table/Table.d.ts +30 -7
- package/dist/_types/organisms/DataTable/DataTable.d.ts +28 -6
- package/dist/data-table.js +300 -299
- package/dist/table.js +53 -52
- package/package.json +1 -1
package/dist/table.js
CHANGED
|
@@ -1,73 +1,74 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import './table.css';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { n as e } from "./_shared/brandmessagescontext.js";
|
|
4
|
+
import { Icon as t } from "./icon.js";
|
|
5
|
+
import { VisuallyHidden as n } from "./visually-hidden.js";
|
|
6
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
6
7
|
//#region src/stories/molecules/Table/Table.tsx
|
|
7
|
-
function
|
|
8
|
-
return /* @__PURE__ */
|
|
8
|
+
function a({ children: e, ...t }) {
|
|
9
|
+
return /* @__PURE__ */ r("thead", {
|
|
9
10
|
...t,
|
|
10
11
|
children: e
|
|
11
12
|
});
|
|
12
13
|
}
|
|
13
|
-
function
|
|
14
|
-
return /* @__PURE__ */
|
|
14
|
+
function o({ children: e, ...t }) {
|
|
15
|
+
return /* @__PURE__ */ r("tfoot", {
|
|
15
16
|
...t,
|
|
16
17
|
children: e
|
|
17
18
|
});
|
|
18
19
|
}
|
|
19
|
-
function
|
|
20
|
-
return /* @__PURE__ */
|
|
20
|
+
function s({ children: e, ...t }) {
|
|
21
|
+
return /* @__PURE__ */ r("tbody", {
|
|
21
22
|
...t,
|
|
22
23
|
children: e
|
|
23
24
|
});
|
|
24
25
|
}
|
|
25
|
-
function
|
|
26
|
-
let
|
|
26
|
+
function c({ sortable: a = !1, sorted: o = !1, onSort: s, actions: c = !1, actionsLabel: l, sortedAscLabel: u, sortedDescLabel: d, sortableLabel: f, sticky: p, nowrap: m = !1, children: h, className: g, scope: _ = "col", ...v }) {
|
|
27
|
+
let y = e("table"), b = [
|
|
27
28
|
"table__header",
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
a ? "table__header--sortable" : "",
|
|
30
|
+
o === "asc" ? "table__header--sorted-asc" : "",
|
|
31
|
+
o === "desc" ? "table__header--sorted-desc" : "",
|
|
32
|
+
c ? "table__header--actions" : "",
|
|
33
|
+
p === "end" ? "table__header--sticky" : "",
|
|
34
|
+
m ? "table__header--nowrap" : "",
|
|
35
|
+
g
|
|
35
36
|
].filter(Boolean).join(" ");
|
|
36
|
-
return
|
|
37
|
-
...
|
|
38
|
-
scope:
|
|
39
|
-
className:
|
|
40
|
-
"aria-sort":
|
|
41
|
-
children: [/* @__PURE__ */
|
|
37
|
+
return a ? /* @__PURE__ */ i("th", {
|
|
38
|
+
...v,
|
|
39
|
+
scope: _,
|
|
40
|
+
className: b,
|
|
41
|
+
"aria-sort": o === "asc" ? "ascending" : o === "desc" ? "descending" : "none",
|
|
42
|
+
children: [/* @__PURE__ */ i("button", {
|
|
42
43
|
type: "button",
|
|
43
44
|
className: "table__header-content",
|
|
44
|
-
onClick:
|
|
45
|
-
children: [
|
|
45
|
+
onClick: s,
|
|
46
|
+
children: [h, /* @__PURE__ */ r(t, {
|
|
46
47
|
name: "chevron",
|
|
47
48
|
size: "xs",
|
|
48
49
|
className: "table__sort-icon"
|
|
49
50
|
})]
|
|
50
|
-
}), /* @__PURE__ */ n
|
|
51
|
-
}) :
|
|
52
|
-
...
|
|
53
|
-
scope:
|
|
54
|
-
className:
|
|
55
|
-
children: /* @__PURE__ */ n
|
|
56
|
-
}) : /* @__PURE__ */
|
|
57
|
-
...
|
|
58
|
-
scope:
|
|
59
|
-
className:
|
|
60
|
-
children:
|
|
51
|
+
}), /* @__PURE__ */ r(n, { children: o === "asc" ? y("sortedAscending", u) : o === "desc" ? y("sortedDescending", d) : y("sortable", f) })]
|
|
52
|
+
}) : c ? /* @__PURE__ */ r("th", {
|
|
53
|
+
...v,
|
|
54
|
+
scope: _,
|
|
55
|
+
className: b,
|
|
56
|
+
children: /* @__PURE__ */ r(n, { children: h ?? y("actions", l) })
|
|
57
|
+
}) : /* @__PURE__ */ r("th", {
|
|
58
|
+
...v,
|
|
59
|
+
scope: _,
|
|
60
|
+
className: b,
|
|
61
|
+
children: h
|
|
61
62
|
});
|
|
62
63
|
}
|
|
63
|
-
function
|
|
64
|
-
let c = t || !!e, l = c ?
|
|
64
|
+
function l({ onClick: e, interactive: t = !1, selected: n = !1, label: i, children: a, className: o, ...s }) {
|
|
65
|
+
let c = t || !!e, l = c ? n : n || void 0, u = [
|
|
65
66
|
"table__row",
|
|
66
67
|
c ? "table__row--interactive" : "",
|
|
67
|
-
|
|
68
|
+
n ? "table__row--selected" : "",
|
|
68
69
|
o
|
|
69
70
|
].filter(Boolean).join(" ");
|
|
70
|
-
return c ? /* @__PURE__ */
|
|
71
|
+
return c ? /* @__PURE__ */ r("tr", {
|
|
71
72
|
...s,
|
|
72
73
|
className: u,
|
|
73
74
|
"aria-label": i,
|
|
@@ -78,7 +79,7 @@ function c({ onClick: e, interactive: t = !1, selected: r = !1, label: i, childr
|
|
|
78
79
|
},
|
|
79
80
|
tabIndex: 0,
|
|
80
81
|
children: a
|
|
81
|
-
}) : /* @__PURE__ */
|
|
82
|
+
}) : /* @__PURE__ */ r("tr", {
|
|
82
83
|
...s,
|
|
83
84
|
className: u,
|
|
84
85
|
"aria-label": i,
|
|
@@ -86,37 +87,37 @@ function c({ onClick: e, interactive: t = !1, selected: r = !1, label: i, childr
|
|
|
86
87
|
children: a
|
|
87
88
|
});
|
|
88
89
|
}
|
|
89
|
-
function
|
|
90
|
+
function u({ sticky: e, actions: t = !1, nowrap: n = !1, children: i, className: a, ...o }) {
|
|
90
91
|
let s = [
|
|
91
92
|
"table__cell",
|
|
92
93
|
e === "end" ? "table__cell--sticky" : "",
|
|
93
94
|
t ? "table__cell--actions" : "",
|
|
94
|
-
|
|
95
|
+
n ? "table__cell--nowrap" : "",
|
|
95
96
|
a
|
|
96
97
|
].filter(Boolean).join(" ");
|
|
97
|
-
return /* @__PURE__ */
|
|
98
|
+
return /* @__PURE__ */ r("td", {
|
|
98
99
|
...o,
|
|
99
100
|
className: s,
|
|
100
101
|
children: i
|
|
101
102
|
});
|
|
102
103
|
}
|
|
103
|
-
function
|
|
104
|
-
return /* @__PURE__ */
|
|
104
|
+
function d({ caption: e, children: t, size: n = "md", className: a, ...o }) {
|
|
105
|
+
return /* @__PURE__ */ r("div", {
|
|
105
106
|
className: "table__wrapper",
|
|
106
|
-
children: /* @__PURE__ */
|
|
107
|
+
children: /* @__PURE__ */ i("table", {
|
|
107
108
|
className: [
|
|
108
109
|
"table",
|
|
109
|
-
|
|
110
|
+
n === "sm" ? "table--sm" : "",
|
|
110
111
|
a ?? ""
|
|
111
112
|
].filter(Boolean).join(" "),
|
|
112
113
|
...o,
|
|
113
|
-
children: [e && /* @__PURE__ */
|
|
114
|
+
children: [e && /* @__PURE__ */ r("caption", {
|
|
114
115
|
className: "visually-hidden",
|
|
115
116
|
children: e
|
|
116
117
|
}), t]
|
|
117
118
|
})
|
|
118
119
|
});
|
|
119
120
|
}
|
|
120
|
-
|
|
121
|
+
d.Head = a, d.Footer = o, d.Header = c, d.Body = s, d.Row = l, d.Cell = u;
|
|
121
122
|
//#endregion
|
|
122
|
-
export {
|
|
123
|
+
export { d as Table, s as TableBody, u as TableCell, o as TableFooter, a as TableHead, c as TableHeader, l as TableRow };
|