@vkzstudio/muza-ui 1.0.38 → 1.0.39
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/dist/components/ExpandableTable/ExpandableTable.d.ts +17 -3
- package/dist/components/ExpandableTable/ExpandableTable.d.ts.map +1 -1
- package/dist/components/ExpandableTable/ExpandableTable.js +171 -144
- package/dist/components/ExpandableTable/ExpandableTable.stories.d.ts +2 -0
- package/dist/components/ExpandableTable/ExpandableTable.stories.d.ts.map +1 -1
- package/dist/hooks/use-is-breakpoint.js +1 -1
- package/dist/muza-ui.css +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Named breakpoint at and above which a column becomes visible.
|
|
4
|
+
* Mirrors the breakpoints exported from `@/hooks/use-is-breakpoint`.
|
|
5
|
+
*/
|
|
6
|
+
export type ResponsiveBreakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
|
|
2
7
|
/**
|
|
3
8
|
* Column definition for the ExpandableTable.
|
|
4
9
|
* @typeParam T - The type of data objects in each row
|
|
@@ -19,11 +24,20 @@ export interface IColumn<T> {
|
|
|
19
24
|
*/
|
|
20
25
|
render?: (value: T[keyof T], rowData: T) => ReactNode;
|
|
21
26
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
27
|
+
* Controls when the column is visible.
|
|
28
|
+
* - Named breakpoint (`'xs'..'3xl'`): visible at and above that breakpoint, rendered with static Tailwind classes.
|
|
29
|
+
* - Boolean: caller supplies the visibility directly (e.g. from `useMediaQuery('(min-width: 52rem)')`).
|
|
30
|
+
* `true` shows the column, `false` hides it. Use this for arbitrary thresholds.
|
|
24
31
|
* @default 'xs'
|
|
25
32
|
*/
|
|
26
|
-
responsive?:
|
|
33
|
+
responsive?: ResponsiveBreakpoint | boolean;
|
|
34
|
+
/**
|
|
35
|
+
* When `responsive` hides this column, also render it in the automatic expandable area
|
|
36
|
+
* below the row. Set to `false` to just hide the column — useful when the expandable
|
|
37
|
+
* area already contains a richer version of the same data.
|
|
38
|
+
* @default true
|
|
39
|
+
*/
|
|
40
|
+
moveToExpandable?: boolean;
|
|
27
41
|
}
|
|
28
42
|
/**
|
|
29
43
|
* Cell definition within an expandable row section.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpandableTable.d.ts","sourceRoot":"","sources":["../../../src/components/ExpandableTable/ExpandableTable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"ExpandableTable.d.ts","sourceRoot":"","sources":["../../../src/components/ExpandableTable/ExpandableTable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,SAAS,EAKf,MAAM,OAAO,CAAA;AAuBd;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAC5B,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,KAAK,GACL,KAAK,CAAA;AAET;;;GAGG;AACH,MAAM,WAAW,OAAO,CAAC,CAAC;IACxB,wDAAwD;IACxD,OAAO,EAAE,MAAM,CAAC,CAAA;IAChB,iDAAiD;IACjD,KAAK,EAAE,SAAS,CAAA;IAChB,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,KAAK,SAAS,CAAA;IACrD;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAA;IAC3C;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAuB,CAAC,CAAC;IACxC,sDAAsD;IACtD,OAAO,EAAE,MAAM,CAAC,CAAA;IAChB,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,6CAA6C;IAC7C,KAAK,EAAE,SAAS,CAAA;IAChB,kGAAkG;IAClG,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,KAAK,SAAS,CAAA;CACtD;AAED;;;;GAIG;AACH,MAAM,WAAW,0BAA0B,CAAC,CAAC;IAC3C,yDAAyD;IACzD,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,4FAA4F;IAC5F,KAAK,EAAE,uBAAuB,CAAC,CAAC,CAAC,EAAE,CAAA;CACpC;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB,CAAC,CAAC;IACrC,sEAAsE;IACtE,IAAI,EAAE,CAAC,EAAE,CAAA;IACT,sFAAsF;IACtF,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,CAAA;IACrB;;;;;;;;;;;;;OAaG;IACH,qBAAqB,CAAC,EAClB,0BAA0B,CAAC,CAAC,CAAC,EAAE,GAC/B,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,0BAA0B,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;IACjD;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;QACnB,0GAA0G;QAC1G,mBAAmB,EAAE,MAAM,CAAA;QAC3B,yFAAyF;QACzF,YAAY,EAAE,MAAM,CAAA;QACpB,0GAA0G;QAC1G,SAAS,EAAE,MAAM,CAAA;KAClB,CAAC,CAAA;CACH;AA4CD,eAAO,MAAM,eAAe,GAAI,CAAC,EAAG,uDAKjC,oBAAoB,CAAC,CAAC,CAAC,4CAgYzB,CAAA"}
|
|
@@ -1,153 +1,174 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { cva as
|
|
4
|
-
import {
|
|
5
|
-
import { Table as
|
|
6
|
-
import { cn as
|
|
7
|
-
import { Typography as
|
|
8
|
-
import { AltArrowDownOutline as
|
|
9
|
-
import { Flex as
|
|
10
|
-
const
|
|
1
|
+
import { jsxs as p, jsx as t, Fragment as A } from "react/jsx-runtime";
|
|
2
|
+
import { useState as V, useRef as G, useEffect as _, useCallback as O, Fragment as W } from "react";
|
|
3
|
+
import { cva as X } from "class-variance-authority";
|
|
4
|
+
import { useIsMin3xl as q, useIsMin2xl as J, useIsMinXl as Q, useIsMinLg as U, useIsMinMd as Y, useIsMinSm as Z } from "../../hooks/use-is-breakpoint.js";
|
|
5
|
+
import { Table as D, TableHeader as R, TableRow as L, TableHead as S, TableRowGroup as w, TableCell as $ } from "./Table.js";
|
|
6
|
+
import { cn as a } from "../../utils/cn.js";
|
|
7
|
+
import { Typography as f } from "../Typography/Typography.js";
|
|
8
|
+
import { AltArrowDownOutline as I } from "@solar-icons/react-perf";
|
|
9
|
+
import { Flex as j } from "../Flex/Flex.js";
|
|
10
|
+
const z = X("", {
|
|
11
11
|
variants: {
|
|
12
12
|
responsive: {
|
|
13
13
|
xs: "",
|
|
14
14
|
sm: "hidden sm:table-cell",
|
|
15
15
|
md: "hidden md:table-cell",
|
|
16
|
-
lg: "hidden lg:table-cell"
|
|
16
|
+
lg: "hidden lg:table-cell",
|
|
17
|
+
xl: "hidden xl:table-cell",
|
|
18
|
+
"2xl": "hidden 2xl:table-cell",
|
|
19
|
+
"3xl": "hidden 3xl:table-cell"
|
|
17
20
|
},
|
|
18
21
|
reverse: {
|
|
19
22
|
xs: "hidden",
|
|
20
23
|
sm: "sm:hidden",
|
|
21
24
|
md: "md:hidden",
|
|
22
|
-
lg: "lg:hidden"
|
|
25
|
+
lg: "lg:hidden",
|
|
26
|
+
xl: "xl:hidden",
|
|
27
|
+
"2xl": "2xl:hidden",
|
|
28
|
+
"3xl": "3xl:hidden"
|
|
23
29
|
}
|
|
24
30
|
}
|
|
25
|
-
}),
|
|
26
|
-
data:
|
|
27
|
-
columns:
|
|
28
|
-
expandableRowSections:
|
|
29
|
-
classNames:
|
|
31
|
+
}), B = (n) => typeof n == "string" && (n === "xs" || n === "sm" || n === "md" || n === "lg" || n === "xl" || n === "2xl" || n === "3xl"), C = (n, m) => n === void 0 || n === "xs" ? !0 : typeof n == "boolean" ? n : m[n], oe = ({
|
|
32
|
+
data: n,
|
|
33
|
+
columns: m,
|
|
34
|
+
expandableRowSections: s,
|
|
35
|
+
classNames: o
|
|
30
36
|
}) => {
|
|
31
|
-
const [
|
|
37
|
+
const [v, H] = V(/* @__PURE__ */ new Set()), [P, u] = V(/* @__PURE__ */ new Set()), g = G(
|
|
32
38
|
/* @__PURE__ */ new Map()
|
|
33
39
|
);
|
|
34
|
-
|
|
35
|
-
const e =
|
|
40
|
+
_(() => {
|
|
41
|
+
const e = g.current;
|
|
36
42
|
return () => {
|
|
37
43
|
e.forEach((i) => clearTimeout(i)), e.clear();
|
|
38
44
|
};
|
|
39
45
|
}, []);
|
|
40
|
-
const
|
|
41
|
-
|
|
46
|
+
const N = O((e) => {
|
|
47
|
+
H((i) => {
|
|
42
48
|
const l = new Set(i);
|
|
43
49
|
if (l.has(e)) {
|
|
44
|
-
l.delete(e),
|
|
50
|
+
l.delete(e), u((c) => {
|
|
45
51
|
const r = new Set(c);
|
|
46
52
|
return r.add(e), r;
|
|
47
53
|
});
|
|
48
|
-
const
|
|
49
|
-
|
|
54
|
+
const d = g.current.get(e);
|
|
55
|
+
d && clearTimeout(d), g.current.set(
|
|
50
56
|
e,
|
|
51
57
|
setTimeout(() => {
|
|
52
|
-
|
|
58
|
+
u((c) => {
|
|
53
59
|
const r = new Set(c);
|
|
54
60
|
return r.delete(e), r;
|
|
55
|
-
}),
|
|
61
|
+
}), g.current.delete(e);
|
|
56
62
|
}, 150)
|
|
57
63
|
);
|
|
58
64
|
} else {
|
|
59
65
|
l.add(e);
|
|
60
|
-
const
|
|
61
|
-
|
|
66
|
+
const d = g.current.get(e);
|
|
67
|
+
d && (clearTimeout(d), g.current.delete(e), u((c) => {
|
|
62
68
|
const r = new Set(c);
|
|
63
69
|
return r.delete(e), r;
|
|
64
70
|
}));
|
|
65
71
|
}
|
|
66
72
|
return l;
|
|
67
73
|
});
|
|
68
|
-
}, []),
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
74
|
+
}, []), y = {
|
|
75
|
+
xs: !0,
|
|
76
|
+
sm: Z(),
|
|
77
|
+
md: Y(),
|
|
78
|
+
lg: U(),
|
|
79
|
+
xl: Q(),
|
|
80
|
+
"2xl": J(),
|
|
81
|
+
"3xl": q()
|
|
82
|
+
}, M = m.some(
|
|
83
|
+
(e) => e.responsive !== void 0 && e.responsive !== "xs" && e.moveToExpandable !== !1 && !C(e.responsive, y)
|
|
84
|
+
);
|
|
85
|
+
let x = -1, F = -1;
|
|
86
|
+
m.forEach((e, i) => {
|
|
87
|
+
C(e.responsive, y) && (x === -1 && (x = i), F = i);
|
|
88
|
+
});
|
|
89
|
+
const T = !s && M, K = !!s || T;
|
|
90
|
+
return /* @__PURE__ */ p(D, { children: [
|
|
91
|
+
/* @__PURE__ */ t(R, { children: /* @__PURE__ */ t(L, { className: "[&>th]:border-0 [&>th]:bg-transparent", children: m.map((e, i) => {
|
|
92
|
+
const l = B(e.responsive) ? e.responsive : void 0, d = e.responsive === !1;
|
|
93
|
+
return /* @__PURE__ */ t(
|
|
94
|
+
S,
|
|
95
|
+
{
|
|
96
|
+
className: a(
|
|
97
|
+
e.className,
|
|
98
|
+
z({ responsive: l })
|
|
99
|
+
),
|
|
100
|
+
style: d ? { display: "none" } : void 0,
|
|
101
|
+
children: e.title
|
|
102
|
+
},
|
|
103
|
+
i
|
|
104
|
+
);
|
|
105
|
+
}) }) }),
|
|
106
|
+
n.map((e, i) => {
|
|
90
107
|
var c;
|
|
91
|
-
const l =
|
|
92
|
-
return /* @__PURE__ */
|
|
93
|
-
|
|
108
|
+
const l = v.has(i) || T, d = P.has(i);
|
|
109
|
+
return /* @__PURE__ */ p(
|
|
110
|
+
w,
|
|
94
111
|
{
|
|
95
|
-
className:
|
|
96
|
-
"group hover:[&_td]:border-stroke-brand-hover":
|
|
112
|
+
className: a({
|
|
113
|
+
"group hover:[&_td]:border-stroke-brand-hover": s
|
|
97
114
|
}),
|
|
98
115
|
children: [
|
|
99
|
-
/* @__PURE__ */
|
|
100
|
-
|
|
116
|
+
/* @__PURE__ */ p(
|
|
117
|
+
L,
|
|
101
118
|
{
|
|
102
|
-
expandablePosition:
|
|
103
|
-
className:
|
|
104
|
-
"cursor-pointer":
|
|
119
|
+
expandablePosition: s && (v.has(i) || d) || T ? "top" : "none",
|
|
120
|
+
className: a("focus-visible-default", {
|
|
121
|
+
"cursor-pointer": s
|
|
105
122
|
}),
|
|
106
|
-
onClick:
|
|
107
|
-
onKeyDown:
|
|
108
|
-
(r.key === "Enter" || r.key === " ") && (r.preventDefault(),
|
|
123
|
+
onClick: s ? () => N(i) : void 0,
|
|
124
|
+
onKeyDown: s ? (r) => {
|
|
125
|
+
(r.key === "Enter" || r.key === " ") && (r.preventDefault(), N(i));
|
|
109
126
|
} : void 0,
|
|
110
|
-
tabIndex:
|
|
111
|
-
role:
|
|
112
|
-
"aria-expanded":
|
|
127
|
+
tabIndex: s ? 0 : void 0,
|
|
128
|
+
role: s ? "button" : void 0,
|
|
129
|
+
"aria-expanded": s ? v.has(i) : void 0,
|
|
113
130
|
children: [
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
{
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
131
|
+
m.map((r, h) => {
|
|
132
|
+
const k = B(r.responsive) ? r.responsive : void 0, b = r.responsive === !1;
|
|
133
|
+
return /* @__PURE__ */ t(
|
|
134
|
+
$,
|
|
135
|
+
{
|
|
136
|
+
isFirst: h === x,
|
|
137
|
+
isLast: h === F && !s,
|
|
138
|
+
expandablePosition: (l || d) && K ? "top" : "none",
|
|
139
|
+
className: a(
|
|
140
|
+
r.className,
|
|
141
|
+
z({ responsive: k })
|
|
142
|
+
),
|
|
143
|
+
style: b ? { display: "none" } : void 0,
|
|
144
|
+
children: r.render ? r.render(e[r.dataKey], e) : /* @__PURE__ */ t(
|
|
145
|
+
f,
|
|
146
|
+
{
|
|
147
|
+
variant: "body",
|
|
148
|
+
size: "base",
|
|
149
|
+
weight: "medium",
|
|
150
|
+
component: "span",
|
|
151
|
+
children: e[r.dataKey]
|
|
152
|
+
}
|
|
153
|
+
)
|
|
154
|
+
},
|
|
155
|
+
h
|
|
156
|
+
);
|
|
157
|
+
}),
|
|
158
|
+
s && /* @__PURE__ */ t(
|
|
159
|
+
$,
|
|
139
160
|
{
|
|
140
161
|
className: "w-[68px]",
|
|
141
162
|
isFirst: !1,
|
|
142
163
|
isLast: !0,
|
|
143
|
-
expandablePosition:
|
|
144
|
-
children: /* @__PURE__ */
|
|
145
|
-
|
|
164
|
+
expandablePosition: v.has(i) || d ? "top" : "none",
|
|
165
|
+
children: /* @__PURE__ */ t(
|
|
166
|
+
I,
|
|
146
167
|
{
|
|
147
|
-
className:
|
|
168
|
+
className: a(
|
|
148
169
|
"text-text-brand-def transition-transform duration-300",
|
|
149
170
|
{
|
|
150
|
-
"rotate-180":
|
|
171
|
+
"rotate-180": v.has(i)
|
|
151
172
|
}
|
|
152
173
|
)
|
|
153
174
|
}
|
|
@@ -157,57 +178,63 @@ const F = Q("", {
|
|
|
157
178
|
]
|
|
158
179
|
}
|
|
159
180
|
),
|
|
160
|
-
|
|
181
|
+
K && /* @__PURE__ */ t("tr", { "aria-hidden": !l, children: /* @__PURE__ */ t(
|
|
161
182
|
"td",
|
|
162
183
|
{
|
|
163
|
-
colSpan:
|
|
184
|
+
colSpan: m.length + (s ? 1 : 0),
|
|
164
185
|
className: "border-0 p-0",
|
|
165
|
-
children: /* @__PURE__ */
|
|
186
|
+
children: /* @__PURE__ */ t(
|
|
166
187
|
"div",
|
|
167
188
|
{
|
|
168
|
-
className:
|
|
189
|
+
className: a(
|
|
169
190
|
"grid transition-[grid-template-rows] duration-300 ease-in-out",
|
|
170
191
|
l ? "grid-rows-[1fr]" : "grid-rows-[0fr]"
|
|
171
192
|
),
|
|
172
|
-
children: /* @__PURE__ */
|
|
193
|
+
children: /* @__PURE__ */ t("div", { className: "min-h-0 overflow-hidden", children: /* @__PURE__ */ p(
|
|
173
194
|
"div",
|
|
174
195
|
{
|
|
175
|
-
className:
|
|
196
|
+
className: a(
|
|
176
197
|
"rounded-b-xl border-x-1 border-b-1 border-stroke-base-secondary bg-surface-base-secondary transition-colors group-hover:border-stroke-brand-hover"
|
|
177
198
|
),
|
|
178
199
|
children: [
|
|
179
|
-
/* @__PURE__ */
|
|
180
|
-
/* @__PURE__ */
|
|
200
|
+
/* @__PURE__ */ t("div", { className: "mx-comp-table-p border-t-1 border-stroke-base-secondary" }),
|
|
201
|
+
/* @__PURE__ */ p(
|
|
181
202
|
"div",
|
|
182
203
|
{
|
|
183
|
-
className:
|
|
204
|
+
className: a(
|
|
184
205
|
"grid grid-cols-1 gap-2xl px-comp-table-p py-2xl md:grid-cols-[auto_1fr]",
|
|
185
|
-
|
|
206
|
+
o == null ? void 0 : o.expandedContentGrid
|
|
186
207
|
),
|
|
187
208
|
children: [
|
|
188
|
-
|
|
189
|
-
/* @__PURE__ */
|
|
190
|
-
|
|
209
|
+
M && /* @__PURE__ */ p(A, { children: [
|
|
210
|
+
/* @__PURE__ */ t(
|
|
211
|
+
j,
|
|
191
212
|
{
|
|
192
213
|
gap: "md",
|
|
193
214
|
direction: "column",
|
|
194
215
|
className: "col-span-full",
|
|
195
|
-
children:
|
|
196
|
-
|
|
216
|
+
children: m.filter(
|
|
217
|
+
(r) => r.moveToExpandable !== !1 && r.responsive !== void 0 && r.responsive !== "xs" && !C(r.responsive, y)
|
|
218
|
+
).map((r, h) => /* @__PURE__ */ p(
|
|
219
|
+
j,
|
|
197
220
|
{
|
|
198
221
|
align: "center",
|
|
199
222
|
justify: "between",
|
|
200
223
|
direction: "row",
|
|
201
|
-
className: F({
|
|
202
|
-
reverse: r.responsive
|
|
203
|
-
}),
|
|
204
224
|
children: [
|
|
205
|
-
/* @__PURE__ */
|
|
225
|
+
/* @__PURE__ */ t(
|
|
226
|
+
f,
|
|
227
|
+
{
|
|
228
|
+
variant: "body",
|
|
229
|
+
component: "span",
|
|
230
|
+
children: r.title
|
|
231
|
+
}
|
|
232
|
+
),
|
|
206
233
|
r.render ? r.render(
|
|
207
234
|
e[r.dataKey],
|
|
208
235
|
e
|
|
209
|
-
) : /* @__PURE__ */
|
|
210
|
-
|
|
236
|
+
) : /* @__PURE__ */ t(
|
|
237
|
+
f,
|
|
211
238
|
{
|
|
212
239
|
variant: "body",
|
|
213
240
|
weight: "medium",
|
|
@@ -218,26 +245,26 @@ const F = Q("", {
|
|
|
218
245
|
)
|
|
219
246
|
]
|
|
220
247
|
},
|
|
221
|
-
|
|
248
|
+
h
|
|
222
249
|
))
|
|
223
250
|
}
|
|
224
251
|
),
|
|
225
|
-
|
|
252
|
+
s && /* @__PURE__ */ t("hr", { className: "col-span-full text-stroke-base-secondary md:col-span-2" })
|
|
226
253
|
] }),
|
|
227
|
-
(c = typeof
|
|
228
|
-
if (!
|
|
229
|
-
const
|
|
230
|
-
return /* @__PURE__ */
|
|
231
|
-
/* @__PURE__ */
|
|
254
|
+
(c = typeof s == "function" ? s(e) : s) == null ? void 0 : c.map((r, h) => {
|
|
255
|
+
if (!s) return null;
|
|
256
|
+
const k = typeof s == "function" ? s(e).length : s.length;
|
|
257
|
+
return /* @__PURE__ */ p(W, { children: [
|
|
258
|
+
/* @__PURE__ */ p(
|
|
232
259
|
"div",
|
|
233
260
|
{
|
|
234
|
-
className:
|
|
261
|
+
className: a(
|
|
235
262
|
"col-span-full grid grid-cols-1 gap-y-xl md:col-span-2 md:grid-cols-subgrid",
|
|
236
|
-
|
|
263
|
+
o == null ? void 0 : o.sectionTitle
|
|
237
264
|
),
|
|
238
265
|
children: [
|
|
239
|
-
r.title && /* @__PURE__ */
|
|
240
|
-
|
|
266
|
+
r.title && /* @__PURE__ */ t(
|
|
267
|
+
f,
|
|
241
268
|
{
|
|
242
269
|
variant: "body",
|
|
243
270
|
uppercase: !0,
|
|
@@ -248,43 +275,43 @@ const F = Q("", {
|
|
|
248
275
|
children: r.title
|
|
249
276
|
}
|
|
250
277
|
),
|
|
251
|
-
/* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */ t(
|
|
252
279
|
"div",
|
|
253
280
|
{
|
|
254
|
-
className:
|
|
281
|
+
className: a(
|
|
255
282
|
"col-span-full grid grid-cols-1 gap-x-3xl md:col-span-2 md:grid-cols-subgrid md:gap-y-md",
|
|
256
|
-
|
|
283
|
+
o == null ? void 0 : o.cellsWrap
|
|
257
284
|
),
|
|
258
285
|
children: r.cells.flatMap(
|
|
259
|
-
(
|
|
260
|
-
/* @__PURE__ */
|
|
261
|
-
|
|
286
|
+
(b, E) => [
|
|
287
|
+
/* @__PURE__ */ t(
|
|
288
|
+
f,
|
|
262
289
|
{
|
|
263
290
|
component: "span",
|
|
264
291
|
variant: "body",
|
|
265
292
|
className: "mb-xs text-text-dark-primary-def md:mb-0",
|
|
266
|
-
children:
|
|
293
|
+
children: b.title
|
|
267
294
|
},
|
|
268
295
|
`${E}-label`
|
|
269
296
|
),
|
|
270
|
-
|
|
297
|
+
b.render ? /* @__PURE__ */ t(
|
|
271
298
|
"div",
|
|
272
299
|
{
|
|
273
300
|
className: "mb-md block last-of-type:mb-0 md:mb-0",
|
|
274
|
-
children:
|
|
275
|
-
e[
|
|
301
|
+
children: b.render(
|
|
302
|
+
e[b.dataKey],
|
|
276
303
|
e
|
|
277
304
|
)
|
|
278
305
|
},
|
|
279
306
|
`${E}-value`
|
|
280
|
-
) : /* @__PURE__ */
|
|
281
|
-
|
|
307
|
+
) : /* @__PURE__ */ t(
|
|
308
|
+
f,
|
|
282
309
|
{
|
|
283
310
|
variant: "body",
|
|
284
311
|
weight: "medium",
|
|
285
312
|
component: "span",
|
|
286
313
|
className: "mb-md block last-of-type:mb-0 md:mb-0",
|
|
287
|
-
children: e[
|
|
314
|
+
children: e[b.dataKey]
|
|
288
315
|
},
|
|
289
316
|
`${E}-value`
|
|
290
317
|
)
|
|
@@ -295,8 +322,8 @@ const F = Q("", {
|
|
|
295
322
|
]
|
|
296
323
|
}
|
|
297
324
|
),
|
|
298
|
-
|
|
299
|
-
] },
|
|
325
|
+
h < k - 1 && /* @__PURE__ */ t("hr", { className: "col-span-full text-stroke-base-secondary md:col-span-2" })
|
|
326
|
+
] }, h);
|
|
300
327
|
})
|
|
301
328
|
]
|
|
302
329
|
}
|
|
@@ -36,4 +36,6 @@ export declare const SingleRow: Story;
|
|
|
36
36
|
export declare const DynamicExpandableRowSections: Story;
|
|
37
37
|
export declare const IndependentColumns: Story;
|
|
38
38
|
export declare const LongLabels: Story;
|
|
39
|
+
export declare const NoResponsiveColumns: Story;
|
|
40
|
+
export declare const HideWithoutMoving: Story;
|
|
39
41
|
//# sourceMappingURL=ExpandableTable.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpandableTable.stories.d.ts","sourceRoot":"","sources":["../../../src/components/ExpandableTable/ExpandableTable.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"ExpandableTable.stories.d.ts","sourceRoot":"","sources":["../../../src/components/ExpandableTable/ExpandableTable.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAO3D,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+B8B,CAAA;AAExC,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AA+MlC,eAAO,MAAM,MAAM,EAAE,KAsBpB,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,KAkB/B,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,KAwJjC,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KAuBvB,CAAA;AAED,eAAO,MAAM,4BAA4B,EAAE,KAyH1C,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,KA0DhC,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,KAoExB,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,KA6EjC,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,KA2E/B,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useMediaQuery as t } from "./use-media-query.js";
|
|
2
|
-
const s = 40, n = 48, e = 64, r = 80, m =
|
|
2
|
+
const s = 40, n = 48, e = 64, r = 80, m = 100, i = 120, o = () => t(`(min-width: ${s}rem)`), c = () => t(`(max-width: ${s}rem)`), I = () => t(`(min-width: ${n}rem)`), x = () => t(`(max-width: ${n}rem)`), M = () => t(`(min-width: ${e}rem)`), d = () => t(`(max-width: ${e}rem)`), a = () => t(`(min-width: ${r}rem)`), h = () => t(`(max-width: ${r}rem)`), w = () => t(`(min-width: ${m}rem)`), $ = () => t(`(max-width: ${m}rem)`), X = () => t(`(min-width: ${i}rem)`), l = () => t(`(max-width: ${i}rem)`);
|
|
3
3
|
export {
|
|
4
4
|
$ as useIsMax2xl,
|
|
5
5
|
l as useIsMax3xl,
|