@frontify/fondue-components 19.4.0 → 19.5.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/dist/fondue-components16.js +27 -19
- package/dist/fondue-components16.js.map +1 -1
- package/dist/fondue-components25.js +66 -62
- package/dist/fondue-components25.js.map +1 -1
- package/dist/fondue-components33.js +2 -2
- package/dist/fondue-components38.js +1 -1
- package/dist/fondue-components41.js +1 -1
- package/dist/fondue-components43.js +1 -1
- package/dist/fondue-components53.js +10 -10
- package/dist/fondue-components66.js +44 -43
- package/dist/fondue-components66.js.map +1 -1
- package/dist/fondue-components68.js +12 -12
- package/dist/fondue-components82.js +2 -5
- package/dist/fondue-components82.js.map +1 -1
- package/dist/fondue-components83.js +16 -4
- package/dist/fondue-components83.js.map +1 -1
- package/dist/fondue-components84.js +5 -2
- package/dist/fondue-components84.js.map +1 -1
- package/dist/fondue-components85.js +4 -16
- package/dist/fondue-components85.js.map +1 -1
- package/dist/index.d.ts +29 -30
- package/dist/style.css +1 -1
- package/package.json +2 -1
|
@@ -1,31 +1,39 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { cn as
|
|
5
|
-
const
|
|
6
|
-
|
|
1
|
+
import { jsxs as l, jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import * as w from "@radix-ui/react-label";
|
|
3
|
+
import { forwardRef as m } from "react";
|
|
4
|
+
import { cn as f } from "./fondue-components37.js";
|
|
5
|
+
const u = ({ className: i, "data-test-id": s = "fondue-label", children: a, ...o }, n) => /* @__PURE__ */ l(
|
|
6
|
+
w.Root,
|
|
7
7
|
{
|
|
8
|
-
ref:
|
|
9
|
-
"data-required":
|
|
10
|
-
className:
|
|
11
|
-
|
|
12
|
-
//
|
|
8
|
+
ref: n,
|
|
9
|
+
"data-required": o.required,
|
|
10
|
+
className: f(
|
|
11
|
+
"tw-group tw-relative tw-flex tw-gap-1 tw-font-body--stack tw-text-body-medium tw-text-text-weak tw-transition-colors",
|
|
12
|
+
// Peer-based color changes (apply to parent, inherit to spans)
|
|
13
|
+
"peer-hover:tw-text-text has-[+_*_input:hover:not(:disabled)]:tw-text-text has-[~_button:hover:not(:disabled)]:tw-text-text",
|
|
14
|
+
// Use adjacent sibling selector when checkbox is checked
|
|
15
|
+
'[*[data-state="checked"]+&]:tw-font-medium [*[data-state="indeterminate"]+&]:tw-font-medium',
|
|
16
|
+
// Disabled state styling and cursor
|
|
13
17
|
"has-[+_*_:disabled]:tw-text-text-disabled has-[~_:disabled]:tw-cursor-not-allowed peer-disabled:tw-text-text-disabled peer-disabled:tw-cursor-not-allowed",
|
|
14
18
|
// Required asterisk
|
|
15
19
|
'after:tw-hidden data-[required="true"]:after:tw-flex after:tw-content-["*"] after:-tw-ml-1 after:tw-font-body--stack after:tw-text-body-small after:tw-font-medium after:tw-text-text-negative group-hover:tw-text-text-negative-hover',
|
|
16
|
-
|
|
20
|
+
i
|
|
17
21
|
),
|
|
18
|
-
"data-test-id":
|
|
22
|
+
"data-test-id": s,
|
|
19
23
|
onClick: (t) => {
|
|
20
|
-
const
|
|
24
|
+
const r = t.target.getAttribute("for"), e = r ? document.getElementById(r) : null;
|
|
21
25
|
e && e.getAttribute("role") === "combobox" && (t.preventDefault(), t.stopPropagation(), e.click());
|
|
22
26
|
},
|
|
23
|
-
...
|
|
27
|
+
...o,
|
|
28
|
+
children: [
|
|
29
|
+
/* @__PURE__ */ d("span", { className: "tw-font-medium tw-opacity-0 tw-pointer-events-none", "aria-hidden": "true", children: a }),
|
|
30
|
+
/* @__PURE__ */ d("span", { className: "tw-absolute tw-inset-0", children: a })
|
|
31
|
+
]
|
|
24
32
|
}
|
|
25
|
-
),
|
|
26
|
-
|
|
33
|
+
), x = m(u);
|
|
34
|
+
x.displayName = "Label";
|
|
27
35
|
export {
|
|
28
|
-
|
|
29
|
-
|
|
36
|
+
x as Label,
|
|
37
|
+
u as LabelComponent
|
|
30
38
|
};
|
|
31
39
|
//# sourceMappingURL=fondue-components16.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components16.js","sources":["../src/components/Label/Label.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as LabelPrimitive from '@radix-ui/react-label';\nimport { type ForwardedRef, forwardRef, type MouseEventHandler, type ReactNode } from 'react';\n\nimport { cn } from '#/utilities/styleUtilities';\n\nexport type LabelProps = {\n id?: string;\n children: ReactNode;\n /**\n * The id of the input element the label is associated with\n */\n htmlFor: string;\n /**\n * Add an asterisk to the label to indicate it is required\n * @default false\n */\n required?: boolean;\n className?: string;\n onClick?: MouseEventHandler<HTMLLabelElement>;\n 'data-test-id'?: string;\n};\n\nexport const LabelComponent = (\n { className, 'data-test-id': dataTestId = 'fondue-label', ...props }: LabelProps,\n ref: ForwardedRef<HTMLLabelElement>,\n) => {\n return (\n <LabelPrimitive.Root\n ref={ref}\n data-required={props.required}\n className={cn(\n 'tw-group tw-flex tw-gap-1 tw-font-body--stack tw-
|
|
1
|
+
{"version":3,"file":"fondue-components16.js","sources":["../src/components/Label/Label.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as LabelPrimitive from '@radix-ui/react-label';\nimport { type ForwardedRef, forwardRef, type MouseEventHandler, type ReactNode } from 'react';\n\nimport { cn } from '#/utilities/styleUtilities';\n\nexport type LabelProps = {\n id?: string;\n children: ReactNode;\n /**\n * The id of the input element the label is associated with\n */\n htmlFor: string;\n /**\n * Add an asterisk to the label to indicate it is required\n * @default false\n */\n required?: boolean;\n className?: string;\n onClick?: MouseEventHandler<HTMLLabelElement>;\n 'data-test-id'?: string;\n};\n\nexport const LabelComponent = (\n { className, 'data-test-id': dataTestId = 'fondue-label', children, ...props }: LabelProps,\n ref: ForwardedRef<HTMLLabelElement>,\n) => {\n return (\n <LabelPrimitive.Root\n ref={ref}\n data-required={props.required}\n className={cn(\n 'tw-group tw-relative tw-flex tw-gap-1 tw-font-body--stack tw-text-body-medium tw-text-text-weak tw-transition-colors',\n // Peer-based color changes (apply to parent, inherit to spans)\n 'peer-hover:tw-text-text has-[+_*_input:hover:not(:disabled)]:tw-text-text has-[~_button:hover:not(:disabled)]:tw-text-text',\n // Use adjacent sibling selector when checkbox is checked\n '[*[data-state=\"checked\"]+&]:tw-font-medium [*[data-state=\"indeterminate\"]+&]:tw-font-medium',\n // Disabled state styling and cursor\n 'has-[+_*_:disabled]:tw-text-text-disabled has-[~_:disabled]:tw-cursor-not-allowed peer-disabled:tw-text-text-disabled peer-disabled:tw-cursor-not-allowed',\n // Required asterisk\n 'after:tw-hidden data-[required=\"true\"]:after:tw-flex after:tw-content-[\"*\"] after:-tw-ml-1 after:tw-font-body--stack after:tw-text-body-small after:tw-font-medium after:tw-text-text-negative group-hover:tw-text-text-negative-hover',\n className,\n )}\n data-test-id={dataTestId}\n onClick={(event) => {\n // Add support of Select component, Radix only allows native `select`\n // but we use `div[role=combobox]` because of downshift\n // https://github.com/radix-ui/primitives/blob/6e75e117977c9e6ffa939e6951a707f16ba0f95e/packages/react/label/src/label.tsx#L22\n const targetId = (event.target as HTMLElement).getAttribute('for');\n const target = targetId ? document.getElementById(targetId) : null;\n\n if (target && target.getAttribute('role') === 'combobox') {\n event.preventDefault();\n event.stopPropagation();\n target.click();\n }\n }}\n {...props}\n >\n {/* Hidden version with medium font weight to reserve space */}\n <span className=\"tw-font-medium tw-opacity-0 tw-pointer-events-none\" aria-hidden=\"true\">\n {children}\n </span>\n {/* Visible version (inherits all styling from parent) */}\n <span className=\"tw-absolute tw-inset-0\">{children}</span>\n </LabelPrimitive.Root>\n );\n};\n\nexport const Label = forwardRef<HTMLLabelElement, LabelProps>(LabelComponent);\nLabel.displayName = 'Label';\n"],"names":["LabelComponent","className","dataTestId","children","props","ref","jsxs","LabelPrimitive","cn","event","targetId","target","jsx","Label","forwardRef"],"mappings":";;;;AAwBO,MAAMA,IAAiB,CAC1B,EAAE,WAAAC,GAAW,gBAAgBC,IAAa,gBAAgB,UAAAC,GAAU,GAAGC,EAAA,GACvEC,MAGI,gBAAAC;AAAA,EAACC,EAAe;AAAA,EAAf;AAAA,IACG,KAAAF;AAAA,IACA,iBAAeD,EAAM;AAAA,IACrB,WAAWI;AAAA,MACP;AAAA;AAAA,MAEA;AAAA;AAAA,MAEA;AAAA;AAAA,MAEA;AAAA;AAAA,MAEA;AAAA,MACAP;AAAA,IAAA;AAAA,IAEJ,gBAAcC;AAAA,IACd,SAAS,CAACO,MAAU;AAIhB,YAAMC,IAAYD,EAAM,OAAuB,aAAa,KAAK,GAC3DE,IAASD,IAAW,SAAS,eAAeA,CAAQ,IAAI;AAE9D,MAAIC,KAAUA,EAAO,aAAa,MAAM,MAAM,eAC1CF,EAAM,eAAA,GACNA,EAAM,gBAAA,GACNE,EAAO,MAAA;AAAA,IAEf;AAAA,IACC,GAAGP;AAAA,IAGJ,UAAA;AAAA,MAAA,gBAAAQ,EAAC,QAAA,EAAK,WAAU,sDAAqD,eAAY,QAC5E,UAAAT,GACL;AAAA,MAEA,gBAAAS,EAAC,QAAA,EAAK,WAAU,0BAA0B,UAAAT,EAAA,CAAS;AAAA,IAAA;AAAA,EAAA;AAAA,GAKlDU,IAAQC,EAAyCd,CAAc;AAC5Ea,EAAM,cAAc;"}
|
|
@@ -1,34 +1,38 @@
|
|
|
1
1
|
import { jsx as t, jsxs as p } from "react/jsx-runtime";
|
|
2
2
|
import { IconArrowUp as A, IconArrowDown as K, IconArrowBidirectional as h } from "@frontify/fondue-icons";
|
|
3
|
-
import { forwardRef as
|
|
3
|
+
import { forwardRef as b, useRef as w, useMemo as j } from "react";
|
|
4
4
|
import { useSyncRefs as g } from "./fondue-components47.js";
|
|
5
5
|
import { useTextTruncation as N } from "./fondue-components72.js";
|
|
6
6
|
import { Box as L } from "./fondue-components5.js";
|
|
7
7
|
import { LoadingCircle as S } from "./fondue-components18.js";
|
|
8
|
-
import
|
|
8
|
+
import i from "./fondue-components73.js";
|
|
9
9
|
import { handleKeyDown as $, shouldIgnoreRowClick as D } from "./fondue-components74.js";
|
|
10
|
-
const R =
|
|
11
|
-
({ layout: a = "auto", fontSize: e = "medium", sticky: o, children: s, ...d }, l) =>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
10
|
+
const R = b(
|
|
11
|
+
({ layout: a = "auto", fontSize: e = "medium", sticky: o, children: s, ...d }, l) => (
|
|
12
|
+
// eslint-disable-next-line jsx-a11y-x/no-noninteractive-element-interactions
|
|
13
|
+
/* @__PURE__ */ t(
|
|
14
|
+
"table",
|
|
15
|
+
{
|
|
16
|
+
ref: l,
|
|
17
|
+
className: i.table,
|
|
18
|
+
"data-layout": a,
|
|
19
|
+
"data-font-size": e,
|
|
20
|
+
"data-sticky": o,
|
|
21
|
+
onKeyDown: $,
|
|
22
|
+
...d,
|
|
23
|
+
children: s
|
|
24
|
+
}
|
|
25
|
+
)
|
|
26
|
+
)
|
|
23
27
|
);
|
|
24
28
|
R.displayName = "Table.Root";
|
|
25
|
-
const C =
|
|
29
|
+
const C = b(({ children: a }, e) => /* @__PURE__ */ t("caption", { ref: e, className: i.caption, children: a }));
|
|
26
30
|
C.displayName = "Table.Caption";
|
|
27
|
-
const
|
|
28
|
-
({ children: a, "aria-label": e, "aria-busy": o }, s) => /* @__PURE__ */ t("thead", { ref: s, className:
|
|
31
|
+
const v = b(
|
|
32
|
+
({ children: a, "aria-label": e, "aria-busy": o }, s) => /* @__PURE__ */ t("thead", { ref: s, className: i.header, "aria-label": e, "aria-busy": o, children: a })
|
|
29
33
|
);
|
|
30
|
-
|
|
31
|
-
const
|
|
34
|
+
v.displayName = "Table.Header";
|
|
35
|
+
const x = b(
|
|
32
36
|
({
|
|
33
37
|
noShrink: a = !1,
|
|
34
38
|
truncate: e = !1,
|
|
@@ -36,47 +40,47 @@ const v = m(
|
|
|
36
40
|
scope: s = "col",
|
|
37
41
|
sortTranslations: d,
|
|
38
42
|
sortDirection: l,
|
|
39
|
-
colSpan:
|
|
40
|
-
width:
|
|
43
|
+
colSpan: m,
|
|
44
|
+
width: c,
|
|
41
45
|
state: f = "idle",
|
|
42
46
|
loadingStateAriaLabel: u,
|
|
43
|
-
onSortChange:
|
|
47
|
+
onSortChange: n,
|
|
44
48
|
children: r
|
|
45
49
|
}, H) => {
|
|
46
50
|
const y = w(null);
|
|
47
51
|
g(y, H), N(y);
|
|
48
52
|
const z = j(() => typeof r == "string" ? l === "ascending" ? (d == null ? void 0 : d.sortDescending) ?? `Sort by ${r} descending` : (d == null ? void 0 : d.sortAscending) ?? `Sort by ${r} ascending` : l === "ascending" ? "Sort descending" : "Sort ascending", [r, l, d]), B = () => {
|
|
49
|
-
if (!
|
|
53
|
+
if (!n)
|
|
50
54
|
return;
|
|
51
|
-
|
|
55
|
+
n(l === void 0 || l === "descending" ? "ascending" : "descending");
|
|
52
56
|
};
|
|
53
57
|
return /* @__PURE__ */ t(
|
|
54
58
|
"th",
|
|
55
59
|
{
|
|
56
60
|
ref: y,
|
|
57
|
-
style: { width:
|
|
58
|
-
className:
|
|
61
|
+
style: { width: c },
|
|
62
|
+
className: i.headerCell,
|
|
59
63
|
scope: s,
|
|
60
|
-
colSpan:
|
|
64
|
+
colSpan: m,
|
|
61
65
|
"data-align": o,
|
|
62
66
|
"data-truncate": e,
|
|
63
67
|
"data-no-shrink": a,
|
|
64
|
-
"data-sortable": !!
|
|
65
|
-
"aria-sort":
|
|
66
|
-
children: f === "loading" ? /* @__PURE__ */ p("div", { className:
|
|
67
|
-
typeof r == "string" && e ? /* @__PURE__ */ t("span", { className:
|
|
68
|
+
"data-sortable": !!n,
|
|
69
|
+
"aria-sort": n ? l || "none" : void 0,
|
|
70
|
+
children: f === "loading" ? /* @__PURE__ */ p("div", { className: i.cellContent, "aria-live": "polite", "aria-label": u, children: [
|
|
71
|
+
typeof r == "string" && e ? /* @__PURE__ */ t("span", { className: i.buttonText, children: r }) : r,
|
|
68
72
|
/* @__PURE__ */ t(S, { "data-test-id": "fondue-loading-circle", size: "xx-small" })
|
|
69
|
-
] }) :
|
|
73
|
+
] }) : n ? /* @__PURE__ */ p(
|
|
70
74
|
"button",
|
|
71
75
|
{
|
|
72
|
-
className:
|
|
76
|
+
className: i.cellContent,
|
|
73
77
|
"aria-label": z,
|
|
74
78
|
"data-active": !!l,
|
|
75
79
|
onClick: B,
|
|
76
80
|
type: "button",
|
|
77
81
|
children: [
|
|
78
|
-
typeof r == "string" && e ? /* @__PURE__ */ t("span", { className:
|
|
79
|
-
/* @__PURE__ */ t(L, { width: 3, children: l === "ascending" ? /* @__PURE__ */ t(A, { size: "12" }) : l === "descending" ? /* @__PURE__ */ t(K, { size: "12" }) : /* @__PURE__ */ t(h, { className:
|
|
82
|
+
typeof r == "string" && e ? /* @__PURE__ */ t("span", { className: i.buttonText, children: r }) : r,
|
|
83
|
+
/* @__PURE__ */ t(L, { width: 3, children: l === "ascending" ? /* @__PURE__ */ t(A, { size: "12" }) : l === "descending" ? /* @__PURE__ */ t(K, { size: "12" }) : /* @__PURE__ */ t(h, { className: i.sortIndicator, size: "12" }) })
|
|
80
84
|
]
|
|
81
85
|
}
|
|
82
86
|
) : r
|
|
@@ -84,33 +88,33 @@ const v = m(
|
|
|
84
88
|
);
|
|
85
89
|
}
|
|
86
90
|
);
|
|
87
|
-
|
|
88
|
-
const T =
|
|
89
|
-
({ children: a, "aria-busy": e }, o) => /* @__PURE__ */ t("tbody", { ref: o, className:
|
|
91
|
+
x.displayName = "Table.HeaderCell";
|
|
92
|
+
const T = b(
|
|
93
|
+
({ children: a, "aria-busy": e }, o) => /* @__PURE__ */ t("tbody", { ref: o, className: i.body, "aria-busy": e, children: a })
|
|
90
94
|
);
|
|
91
95
|
T.displayName = "Table.Body";
|
|
92
|
-
const I =
|
|
93
|
-
({ disabled: a = !1, selected: e = !1, onClick: o, children: s, "aria-label": d, "data-test-id": l },
|
|
94
|
-
const
|
|
95
|
-
a || D(
|
|
96
|
-
}, u = (
|
|
97
|
-
|
|
96
|
+
const I = b(
|
|
97
|
+
({ disabled: a = !1, selected: e = !1, onClick: o, children: s, "aria-label": d, "data-test-id": l }, m) => {
|
|
98
|
+
const c = o !== void 0 && !a, f = (n) => {
|
|
99
|
+
a || D(n) || o && o(e);
|
|
100
|
+
}, u = (n) => {
|
|
101
|
+
c && (n.key === "Enter" || n.key === " ") && (n.preventDefault(), f());
|
|
98
102
|
};
|
|
99
103
|
return /* @__PURE__ */ t(
|
|
100
104
|
"tr",
|
|
101
105
|
{
|
|
102
|
-
ref:
|
|
103
|
-
className:
|
|
106
|
+
ref: m,
|
|
107
|
+
className: i.row,
|
|
104
108
|
tabIndex: 0,
|
|
105
|
-
role:
|
|
109
|
+
role: c ? "button" : "row",
|
|
106
110
|
"data-disabled": a,
|
|
107
|
-
"data-interactive":
|
|
108
|
-
"data-selected": e,
|
|
111
|
+
"data-interactive": c,
|
|
112
|
+
"data-selected": c ? void 0 : e,
|
|
109
113
|
"aria-disabled": a,
|
|
110
114
|
"aria-label": d,
|
|
111
|
-
"aria-selected": e,
|
|
112
|
-
onClick:
|
|
113
|
-
onKeyDown:
|
|
115
|
+
"aria-selected": c ? void 0 : e,
|
|
116
|
+
onClick: c ? f : void 0,
|
|
117
|
+
onKeyDown: c ? u : void 0,
|
|
114
118
|
"data-test-id": l,
|
|
115
119
|
children: s
|
|
116
120
|
}
|
|
@@ -118,14 +122,14 @@ const I = m(
|
|
|
118
122
|
}
|
|
119
123
|
);
|
|
120
124
|
I.displayName = "Table.Row";
|
|
121
|
-
const k =
|
|
125
|
+
const k = b(
|
|
122
126
|
({ colSpan: a, truncate: e, align: o = "left", children: s, "aria-label": d }, l) => {
|
|
123
|
-
const
|
|
124
|
-
return g(
|
|
127
|
+
const m = w(null);
|
|
128
|
+
return g(m, l), N(m), /* @__PURE__ */ t(
|
|
125
129
|
"td",
|
|
126
130
|
{
|
|
127
|
-
ref:
|
|
128
|
-
className:
|
|
131
|
+
ref: m,
|
|
132
|
+
className: i.rowCell,
|
|
129
133
|
colSpan: a,
|
|
130
134
|
"data-align": o,
|
|
131
135
|
"data-truncate": e,
|
|
@@ -139,8 +143,8 @@ k.displayName = "Table.RowCell";
|
|
|
139
143
|
const V = {
|
|
140
144
|
Root: R,
|
|
141
145
|
Caption: C,
|
|
142
|
-
Header:
|
|
143
|
-
HeaderCell:
|
|
146
|
+
Header: v,
|
|
147
|
+
HeaderCell: x,
|
|
144
148
|
Body: T,
|
|
145
149
|
Row: I,
|
|
146
150
|
RowCell: k
|
|
@@ -149,8 +153,8 @@ export {
|
|
|
149
153
|
V as Table,
|
|
150
154
|
T as TableBody,
|
|
151
155
|
C as TableCaption,
|
|
152
|
-
|
|
153
|
-
|
|
156
|
+
v as TableHeader,
|
|
157
|
+
x as TableHeaderCell,
|
|
154
158
|
R as TableRoot,
|
|
155
159
|
I as TableRow,
|
|
156
160
|
k as TableRowCell
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components25.js","sources":["../src/components/Table/Table.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconArrowBidirectional, IconArrowDown, IconArrowUp } from '@frontify/fondue-icons';\nimport {\n forwardRef,\n useMemo,\n useRef,\n type CSSProperties,\n type KeyboardEvent,\n type MouseEvent,\n type ReactElement,\n type ReactNode,\n} from 'react';\n\nimport { useSyncRefs } from '#/hooks/useSyncRefs';\nimport { useTextTruncation } from '#/hooks/useTextTruncation';\nimport { type CommonAriaAttrs } from '#/utilities/types';\n\nimport { Box } from '../Box/Box';\nimport { LoadingCircle } from '../LoadingCircle/LoadingCircle';\n\nimport styles from './styles/table.module.scss';\nimport { handleKeyDown, shouldIgnoreRowClick } from './utils';\n\ntype TableRootProps = {\n /**\n * Whether the table should have a fixed or auto layout\n * @default 'auto'\n */\n layout?: 'auto' | 'fixed';\n /**\n * Font size of the table content\n * @default 'small'\n */\n fontSize?: 'small' | 'medium';\n /**\n * Whether header should stick to the top when scrolling\n */\n sticky?: 'head' | 'col' | 'both';\n children: ReactNode;\n} & CommonAriaAttrs;\n\nexport const TableRoot = forwardRef<HTMLTableElement, TableRootProps>(\n ({ layout = 'auto', fontSize = 'medium', sticky, children, ...props }, ref) => {\n return (\n <div onKeyDown={handleKeyDown} role=\"grid\" tabIndex={-1}>\n <table\n ref={ref}\n className={styles.table}\n data-layout={layout}\n data-font-size={fontSize}\n data-sticky={sticky}\n {...props}\n >\n {children}\n </table>\n </div>\n );\n },\n);\nTableRoot.displayName = 'Table.Root';\n\nexport const TableCaption = forwardRef<HTMLTableCaptionElement, { children: ReactNode }>(({ children }, ref) => {\n return (\n <caption ref={ref} className={styles.caption}>\n {children}\n </caption>\n );\n});\nTableCaption.displayName = 'Table.Caption';\n\ntype TableHeaderProps = {\n children: ReactNode;\n 'aria-label'?: string;\n 'aria-busy'?: boolean;\n};\n\nexport const TableHeader = forwardRef<HTMLTableSectionElement, TableHeaderProps>(\n ({ children, 'aria-label': ariaLabel, 'aria-busy': ariaBusy }, ref) => {\n return (\n <thead ref={ref} className={styles.header} aria-label={ariaLabel} aria-busy={ariaBusy}>\n {children}\n </thead>\n );\n },\n);\nTableHeader.displayName = 'Table.Header';\n\ntype SortDirection = 'ascending' | 'descending' | undefined;\ntype HorizontalAlignment = 'left' | 'center' | 'right';\n\ntype TableHeaderCellProps = {\n /**\n * Scope of the column\n * @default 'col'\n */\n scope?: HTMLTableCellElement['scope'];\n /**\n * Number of columns the cell should span\n */\n colSpan?: HTMLTableCellElement['colSpan'];\n /**\n * Width of the column\n */\n width?: CSSProperties['width'];\n /**\n * Current sort direction of the column\n */\n sortDirection?: SortDirection;\n /**\n * Horizontal alignment of the content\n * @default 'left'\n */\n align?: HorizontalAlignment;\n /**\n * Whether to truncate content with ellipsis when it overflows\n * @default false\n */\n truncate?: boolean;\n /**\n * Aria label for asceding/descending sort. Variables: {column} - column name\n * @default \"Sort by {column} ascending/descending\"\n */\n sortTranslations?: {\n sortAscending?: string;\n sortDescending?: string;\n };\n /**\n * Whether the column should have a minimum width\n * @default false\n */\n noShrink?: boolean;\n /**\n * State of the cell, used for displaying loading state\n * @default 'idle'\n */\n state?: 'idle' | 'loading';\n /**\n * The aria-label to be applied when state='loading'\n */\n loadingStateAriaLabel?: string;\n /**\n * Handler called when the sort direction changes\n * @param direction - The new sort direction\n */\n onSortChange?: (direction: SortDirection) => void;\n children: ReactNode;\n};\n\nexport const TableHeaderCell = forwardRef<HTMLTableCellElement, TableHeaderCellProps>(\n (\n {\n noShrink = false,\n truncate = false,\n align = 'left',\n scope = 'col',\n sortTranslations,\n sortDirection,\n colSpan,\n width,\n state = 'idle',\n loadingStateAriaLabel,\n onSortChange,\n children,\n },\n ref,\n ) => {\n const cellRef = useRef<HTMLTableCellElement>(null);\n useSyncRefs<HTMLTableCellElement>(cellRef, ref);\n\n useTextTruncation(cellRef);\n\n const sortLabel = useMemo(() => {\n if (typeof children === 'string') {\n if (sortDirection === 'ascending') {\n return sortTranslations?.sortDescending ?? `Sort by ${children} descending`;\n }\n return sortTranslations?.sortAscending ?? `Sort by ${children} ascending`;\n }\n\n return sortDirection === 'ascending' ? 'Sort descending' : 'Sort ascending';\n }, [children, sortDirection, sortTranslations]);\n\n const handleSortChange = () => {\n if (!onSortChange) {\n return;\n }\n\n const newDirection: SortDirection =\n sortDirection === undefined || sortDirection === 'descending' ? 'ascending' : 'descending';\n\n onSortChange(newDirection);\n };\n\n return (\n <th\n ref={cellRef}\n style={{ width }}\n className={styles.headerCell}\n scope={scope}\n colSpan={colSpan}\n data-align={align}\n data-truncate={truncate}\n data-no-shrink={noShrink}\n data-sortable={!!onSortChange}\n aria-sort={onSortChange ? sortDirection || 'none' : undefined}\n >\n {state === 'loading' ? (\n <div className={styles.cellContent} aria-live=\"polite\" aria-label={loadingStateAriaLabel}>\n {typeof children === 'string' && truncate ? (\n <span className={styles.buttonText}>{children}</span>\n ) : (\n children\n )}\n <LoadingCircle data-test-id=\"fondue-loading-circle\" size=\"xx-small\" />\n </div>\n ) : onSortChange ? (\n <button\n className={styles.cellContent}\n aria-label={sortLabel}\n data-active={!!sortDirection}\n onClick={handleSortChange}\n type=\"button\"\n >\n {typeof children === 'string' && truncate ? (\n <span className={styles.buttonText}>{children}</span>\n ) : (\n children\n )}\n <Box width={3}>\n {sortDirection === 'ascending' ? (\n <IconArrowUp size=\"12\" />\n ) : sortDirection === 'descending' ? (\n <IconArrowDown size=\"12\" />\n ) : (\n <IconArrowBidirectional className={styles.sortIndicator} size=\"12\" />\n )}\n </Box>\n </button>\n ) : (\n children\n )}\n </th>\n );\n },\n);\nTableHeaderCell.displayName = 'Table.HeaderCell';\n\ntype TableBodyProps = {\n children: ReactNode;\n 'aria-busy'?: boolean;\n};\n\nexport const TableBody = forwardRef<HTMLTableSectionElement, TableBodyProps>(\n ({ children, 'aria-busy': ariaBusy }, ref) => {\n return (\n <tbody ref={ref} className={styles.body} aria-busy={ariaBusy}>\n {children}\n </tbody>\n );\n },\n);\nTableBody.displayName = 'Table.Body';\n\ntype BaseTableRowProps = {\n /**\n * Whether the row is in a selected state\n * @default false\n */\n selected?: boolean;\n /**\n * Whether to disable interactions for this row\n * @default false\n */\n disabled?: boolean;\n /**\n * Content to be rendered within the row\n */\n children: ReactNode;\n /**\n * Accessible label for the row\n */\n 'aria-label'?: string;\n 'data-test-id'?: string;\n};\n\ntype TableRowProps = BaseTableRowProps & {\n /**\n * Handler called when the row is clicked or activated via keyboard\n * If provided, the row will be hoverable and interactive\n */\n onClick?: (selected: boolean) => void;\n};\n\nexport const TableRow = forwardRef<HTMLTableRowElement, TableRowProps>(\n (\n { disabled = false, selected = false, onClick, children, 'aria-label': ariaLabel, 'data-test-id': dataTestId },\n ref,\n ) => {\n const isInteractive = onClick !== undefined && !disabled;\n\n const handleClick = (event?: MouseEvent) => {\n if (disabled) {\n return;\n }\n\n if (shouldIgnoreRowClick(event)) {\n return;\n }\n\n if (onClick) {\n onClick(selected);\n }\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLTableRowElement>) => {\n if (!isInteractive) {\n return;\n }\n\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n handleClick();\n }\n };\n\n return (\n <tr\n ref={ref}\n className={styles.row}\n tabIndex={0}\n role={isInteractive ? 'button' : 'row'}\n data-disabled={disabled}\n data-interactive={isInteractive}\n data-selected={selected}\n aria-disabled={disabled}\n aria-label={ariaLabel}\n aria-selected={selected}\n onClick={isInteractive ? handleClick : undefined}\n onKeyDown={isInteractive ? handleKeyDown : undefined}\n data-test-id={dataTestId}\n >\n {children}\n </tr>\n );\n },\n);\nTableRow.displayName = 'Table.Row';\n\ntype TableRowCellProps = {\n /**\n * Number of columns the cell should span\n */\n colSpan?: HTMLTableCellElement['colSpan'];\n /**\n * Whether to truncate content with ellipsis when it overflows\n * @default false\n */\n truncate?: boolean;\n /**\n * Horizontal alignment of the content\n * @default 'left'\n */\n align?: HorizontalAlignment;\n children: ReactNode;\n 'aria-label'?: string;\n};\n\nexport const TableRowCell = forwardRef<HTMLTableCellElement, TableRowCellProps>(\n ({ colSpan, truncate, align = 'left', children, 'aria-label': ariaLabel }, ref): ReactElement => {\n const cellRef = useRef<HTMLTableCellElement>(null);\n useSyncRefs<HTMLTableCellElement>(cellRef, ref);\n\n useTextTruncation(cellRef);\n\n return (\n <td\n ref={cellRef}\n className={styles.rowCell}\n colSpan={colSpan}\n data-align={align}\n data-truncate={truncate}\n aria-label={ariaLabel}\n >\n {children}\n </td>\n );\n },\n);\nTableRowCell.displayName = 'Table.RowCell';\n\nexport const Table = {\n Root: TableRoot,\n Caption: TableCaption,\n Header: TableHeader,\n HeaderCell: TableHeaderCell,\n Body: TableBody,\n Row: TableRow,\n RowCell: TableRowCell,\n};\n"],"names":["TableRoot","forwardRef","layout","fontSize","sticky","children","props","ref","handleKeyDown","jsx","styles","TableCaption","TableHeader","ariaLabel","ariaBusy","TableHeaderCell","noShrink","truncate","align","scope","sortTranslations","sortDirection","colSpan","width","state","loadingStateAriaLabel","onSortChange","cellRef","useRef","useSyncRefs","useTextTruncation","sortLabel","useMemo","handleSortChange","jsxs","LoadingCircle","Box","IconArrowUp","IconArrowDown","IconArrowBidirectional","TableBody","TableRow","disabled","selected","onClick","dataTestId","isInteractive","handleClick","event","shouldIgnoreRowClick","TableRowCell","Table"],"mappings":";;;;;;;;;AA0CO,MAAMA,IAAYC;AAAA,EACrB,CAAC,EAAE,QAAAC,IAAS,QAAQ,UAAAC,IAAW,UAAU,QAAAC,GAAQ,UAAAC,GAAU,GAAGC,EAAA,GAASC,wBAE9D,OAAA,EAAI,WAAWC,GAAe,MAAK,QAAO,UAAU,IACjD,UAAA,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,KAAAF;AAAA,MACA,WAAWG,EAAO;AAAA,MAClB,eAAaR;AAAA,MACb,kBAAgBC;AAAA,MAChB,eAAaC;AAAA,MACZ,GAAGE;AAAA,MAEH,UAAAD;AAAA,IAAA;AAAA,EAAA,GAET;AAGZ;AACAL,EAAU,cAAc;AAEjB,MAAMW,IAAeV,EAA6D,CAAC,EAAE,UAAAI,EAAA,GAAYE,wBAE/F,WAAA,EAAQ,KAAAA,GAAU,WAAWG,EAAO,SAChC,UAAAL,GACL,CAEP;AACDM,EAAa,cAAc;AAQpB,MAAMC,IAAcX;AAAA,EACvB,CAAC,EAAE,UAAAI,GAAU,cAAcQ,GAAW,aAAaC,EAAA,GAAYP,MAEvD,gBAAAE,EAAC,SAAA,EAAM,KAAAF,GAAU,WAAWG,EAAO,QAAQ,cAAYG,GAAW,aAAWC,GACxE,UAAAT,EAAA,CACL;AAGZ;AACAO,EAAY,cAAc;AA+DnB,MAAMG,IAAkBd;AAAA,EAC3B,CACI;AAAA,IACI,UAAAe,IAAW;AAAA,IACX,UAAAC,IAAW;AAAA,IACX,OAAAC,IAAQ;AAAA,IACR,OAAAC,IAAQ;AAAA,IACR,kBAAAC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A,EAAM,QAAQ,SACvCA,EAAM,eAAA,GACND,EAAA;AAAA,IAER;AAEA,WACI,gBAAAtC;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,KAAAF;AAAA,QACA,WAAWG,EAAO;AAAA,QAClB,UAAU;AAAA,QACV,MAAMoC,IAAgB,WAAW;AAAA,QACjC,iBAAeJ;AAAA,QACf,oBAAkBI;AAAA,QAClB,iBAAeH;AAAA,QACf,iBAAeD;AAAA,QACf,cAAY7B;AAAA,QACZ,iBAAe8B;AAAA,QACf,SAASG,IAAgBC,IAAc;AAAA,QACvC,WAAWD,IAAgBtC,IAAgB;AAAA,QAC3C,gBAAcqC;AAAA,QAEb,UAAAxC;AAAA,MAAA;AAAA,IAAA;AAAA,EAGb;AACJ;AACAoC,EAAS,cAAc;AAqBhB,MAAMS,IAAejD;AAAA,EACxB,CAAC,EAAE,SAAAqB,GAAS,UAAAL,GAAU,OAAAC,IAAQ,QAAQ,UAAAb,GAAU,cAAcQ,EAAA,GAAaN,MAAsB;AAC7F,UAAMoB,IAAUC,EAA6B,IAAI;AACjD,WAAAC,EAAkCF,GAASpB,CAAG,GAE9CuB,EAAkBH,CAAO,GAGrB,gBAAAlB;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,KAAKkB;AAAA,QACL,WAAWjB,EAAO;AAAA,QAClB,SAAAY;AAAA,QACA,cAAYJ;AAAA,QACZ,iBAAeD;AAAA,QACf,cAAYJ;AAAA,QAEX,UAAAR;AAAA,MAAA;AAAA,IAAA;AAAA,EAGb;AACJ;AACA6C,EAAa,cAAc;AAEpB,MAAMC,IAAQ;AAAA,EACjB,MAAMnD;AAAA,EACN,SAASW;AAAA,EACT,QAAQC;AAAA,EACR,YAAYG;AAAA,EACZ,MAAMyB;AAAA,EACN,KAAKC;AAAA,EACL,SAASS;AACb;"}
|
|
1
|
+
{"version":3,"file":"fondue-components25.js","sources":["../src/components/Table/Table.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconArrowBidirectional, IconArrowDown, IconArrowUp } from '@frontify/fondue-icons';\nimport {\n type AriaAttributes,\n forwardRef,\n useMemo,\n useRef,\n type CSSProperties,\n type KeyboardEvent,\n type MouseEvent,\n type ReactElement,\n type ReactNode,\n} from 'react';\n\nimport { useSyncRefs } from '#/hooks/useSyncRefs';\nimport { useTextTruncation } from '#/hooks/useTextTruncation';\nimport { type CommonAriaAttrs } from '#/utilities/types';\n\nimport { Box } from '../Box/Box';\nimport { LoadingCircle } from '../LoadingCircle/LoadingCircle';\n\nimport styles from './styles/table.module.scss';\nimport { handleKeyDown, shouldIgnoreRowClick } from './utils';\n\ntype TableRootProps = {\n /**\n * Whether the table should have a fixed or auto layout\n * @default 'auto'\n */\n layout?: 'auto' | 'fixed';\n /**\n * Font size of the table content\n * @default 'small'\n */\n fontSize?: 'small' | 'medium';\n /**\n * Whether header should stick to the top when scrolling\n */\n sticky?: 'head' | 'col' | 'both';\n children: ReactNode;\n} & CommonAriaAttrs &\n Pick<AriaAttributes, 'aria-multiselectable'>;\n\nexport const TableRoot = forwardRef<HTMLTableElement, TableRootProps>(\n ({ layout = 'auto', fontSize = 'medium', sticky, children, ...props }, ref) => {\n return (\n // eslint-disable-next-line jsx-a11y-x/no-noninteractive-element-interactions\n <table\n ref={ref}\n className={styles.table}\n data-layout={layout}\n data-font-size={fontSize}\n data-sticky={sticky}\n onKeyDown={handleKeyDown}\n {...props}\n >\n {children}\n </table>\n );\n },\n);\nTableRoot.displayName = 'Table.Root';\n\nexport const TableCaption = forwardRef<HTMLTableCaptionElement, { children: ReactNode }>(({ children }, ref) => {\n return (\n <caption ref={ref} className={styles.caption}>\n {children}\n </caption>\n );\n});\nTableCaption.displayName = 'Table.Caption';\n\ntype TableHeaderProps = {\n children: ReactNode;\n 'aria-label'?: string;\n 'aria-busy'?: boolean;\n};\n\nexport const TableHeader = forwardRef<HTMLTableSectionElement, TableHeaderProps>(\n ({ children, 'aria-label': ariaLabel, 'aria-busy': ariaBusy }, ref) => {\n return (\n <thead ref={ref} className={styles.header} aria-label={ariaLabel} aria-busy={ariaBusy}>\n {children}\n </thead>\n );\n },\n);\nTableHeader.displayName = 'Table.Header';\n\ntype SortDirection = 'ascending' | 'descending' | undefined;\ntype HorizontalAlignment = 'left' | 'center' | 'right';\n\ntype TableHeaderCellProps = {\n /**\n * Scope of the column\n * @default 'col'\n */\n scope?: HTMLTableCellElement['scope'];\n /**\n * Number of columns the cell should span\n */\n colSpan?: HTMLTableCellElement['colSpan'];\n /**\n * Width of the column\n */\n width?: CSSProperties['width'];\n /**\n * Current sort direction of the column\n */\n sortDirection?: SortDirection;\n /**\n * Horizontal alignment of the content\n * @default 'left'\n */\n align?: HorizontalAlignment;\n /**\n * Whether to truncate content with ellipsis when it overflows\n * @default false\n */\n truncate?: boolean;\n /**\n * Aria label for asceding/descending sort. Variables: {column} - column name\n * @default \"Sort by {column} ascending/descending\"\n */\n sortTranslations?: {\n sortAscending?: string;\n sortDescending?: string;\n };\n /**\n * Whether the column should have a minimum width\n * @default false\n */\n noShrink?: boolean;\n /**\n * State of the cell, used for displaying loading state\n * @default 'idle'\n */\n state?: 'idle' | 'loading';\n /**\n * The aria-label to be applied when state='loading'\n */\n loadingStateAriaLabel?: string;\n /**\n * Handler called when the sort direction changes\n * @param direction - The new sort direction\n */\n onSortChange?: (direction: SortDirection) => void;\n children: ReactNode;\n};\n\nexport const TableHeaderCell = forwardRef<HTMLTableCellElement, TableHeaderCellProps>(\n (\n {\n noShrink = false,\n truncate = false,\n align = 'left',\n scope = 'col',\n sortTranslations,\n sortDirection,\n colSpan,\n width,\n state = 'idle',\n loadingStateAriaLabel,\n onSortChange,\n children,\n },\n ref,\n ) => {\n const cellRef = useRef<HTMLTableCellElement>(null);\n useSyncRefs<HTMLTableCellElement>(cellRef, ref);\n\n useTextTruncation(cellRef);\n\n const sortLabel = useMemo(() => {\n if (typeof children === 'string') {\n if (sortDirection === 'ascending') {\n return sortTranslations?.sortDescending ?? `Sort by ${children} descending`;\n }\n return sortTranslations?.sortAscending ?? `Sort by ${children} ascending`;\n }\n\n return sortDirection === 'ascending' ? 'Sort descending' : 'Sort ascending';\n }, [children, sortDirection, sortTranslations]);\n\n const handleSortChange = () => {\n if (!onSortChange) {\n return;\n }\n\n const newDirection: SortDirection =\n sortDirection === undefined || sortDirection === 'descending' ? 'ascending' : 'descending';\n\n onSortChange(newDirection);\n };\n\n return (\n <th\n ref={cellRef}\n style={{ width }}\n className={styles.headerCell}\n scope={scope}\n colSpan={colSpan}\n data-align={align}\n data-truncate={truncate}\n data-no-shrink={noShrink}\n data-sortable={!!onSortChange}\n aria-sort={onSortChange ? sortDirection || 'none' : undefined}\n >\n {state === 'loading' ? (\n <div className={styles.cellContent} aria-live=\"polite\" aria-label={loadingStateAriaLabel}>\n {typeof children === 'string' && truncate ? (\n <span className={styles.buttonText}>{children}</span>\n ) : (\n children\n )}\n <LoadingCircle data-test-id=\"fondue-loading-circle\" size=\"xx-small\" />\n </div>\n ) : onSortChange ? (\n <button\n className={styles.cellContent}\n aria-label={sortLabel}\n data-active={!!sortDirection}\n onClick={handleSortChange}\n type=\"button\"\n >\n {typeof children === 'string' && truncate ? (\n <span className={styles.buttonText}>{children}</span>\n ) : (\n children\n )}\n <Box width={3}>\n {sortDirection === 'ascending' ? (\n <IconArrowUp size=\"12\" />\n ) : sortDirection === 'descending' ? (\n <IconArrowDown size=\"12\" />\n ) : (\n <IconArrowBidirectional className={styles.sortIndicator} size=\"12\" />\n )}\n </Box>\n </button>\n ) : (\n children\n )}\n </th>\n );\n },\n);\nTableHeaderCell.displayName = 'Table.HeaderCell';\n\ntype TableBodyProps = {\n children: ReactNode;\n 'aria-busy'?: boolean;\n};\n\nexport const TableBody = forwardRef<HTMLTableSectionElement, TableBodyProps>(\n ({ children, 'aria-busy': ariaBusy }, ref) => {\n return (\n <tbody ref={ref} className={styles.body} aria-busy={ariaBusy}>\n {children}\n </tbody>\n );\n },\n);\nTableBody.displayName = 'Table.Body';\n\ntype TableRowProps = {\n /**\n * Whether the row is in a selected state\n * @default false\n */\n selected?: boolean;\n /**\n * Whether to disable interactions for this row\n * @default false\n */\n disabled?: boolean;\n /**\n * Handler called when the row is clicked or activated via keyboard\n * If provided, the row will be hoverable and interactive\n */\n onClick?: (selected: boolean) => void;\n /**\n * Content to be rendered within the row\n */\n children: ReactNode;\n /**\n * Accessible label for the row\n */\n 'aria-label'?: string;\n 'data-test-id'?: string;\n};\n\nexport const TableRow = forwardRef<HTMLTableRowElement, TableRowProps>(\n (\n { disabled = false, selected = false, onClick, children, 'aria-label': ariaLabel, 'data-test-id': dataTestId },\n ref,\n ) => {\n const isInteractive = onClick !== undefined && !disabled;\n\n const handleClick = (event?: MouseEvent) => {\n if (disabled) {\n return;\n }\n\n if (shouldIgnoreRowClick(event)) {\n return;\n }\n\n if (onClick) {\n onClick(selected);\n }\n };\n\n const handleKeyDown = (event: KeyboardEvent<HTMLTableRowElement>) => {\n if (!isInteractive) {\n return;\n }\n\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n handleClick();\n }\n };\n\n return (\n <tr\n ref={ref}\n className={styles.row}\n tabIndex={0}\n role={isInteractive ? 'button' : 'row'}\n data-disabled={disabled}\n data-interactive={isInteractive}\n data-selected={!isInteractive ? selected : undefined}\n aria-disabled={disabled}\n aria-label={ariaLabel}\n aria-selected={!isInteractive ? selected : undefined}\n onClick={isInteractive ? handleClick : undefined}\n onKeyDown={isInteractive ? handleKeyDown : undefined}\n data-test-id={dataTestId}\n >\n {children}\n </tr>\n );\n },\n);\nTableRow.displayName = 'Table.Row';\n\ntype TableRowCellProps = {\n /**\n * Number of columns the cell should span\n */\n colSpan?: HTMLTableCellElement['colSpan'];\n /**\n * Whether to truncate content with ellipsis when it overflows\n * @default false\n */\n truncate?: boolean;\n /**\n * Horizontal alignment of the content\n * @default 'left'\n */\n align?: HorizontalAlignment;\n children: ReactNode;\n 'aria-label'?: string;\n};\n\nexport const TableRowCell = forwardRef<HTMLTableCellElement, TableRowCellProps>(\n ({ colSpan, truncate, align = 'left', children, 'aria-label': ariaLabel }, ref): ReactElement => {\n const cellRef = useRef<HTMLTableCellElement>(null);\n useSyncRefs<HTMLTableCellElement>(cellRef, ref);\n\n useTextTruncation(cellRef);\n\n return (\n <td\n ref={cellRef}\n className={styles.rowCell}\n colSpan={colSpan}\n data-align={align}\n data-truncate={truncate}\n aria-label={ariaLabel}\n >\n {children}\n </td>\n );\n },\n);\nTableRowCell.displayName = 'Table.RowCell';\n\nexport const Table = {\n Root: TableRoot,\n Caption: TableCaption,\n Header: TableHeader,\n HeaderCell: TableHeaderCell,\n Body: TableBody,\n Row: TableRow,\n RowCell: TableRowCell,\n};\n"],"names":["TableRoot","forwardRef","layout","fontSize","sticky","children","props","ref","jsx","styles","handleKeyDown","TableCaption","TableHeader","ariaLabel","ariaBusy","TableHeaderCell","noShrink","truncate","align","scope","sortTranslations","sortDirection","colSpan","width","state","loadingStateAriaLabel","onSortChange","cellRef","useRef","useSyncRefs","useTextTruncation","sortLabel","useMemo","handleSortChange","jsxs","LoadingCircle","Box","IconArrowUp","IconArrowDown","IconArrowBidirectional","TableBody","TableRow","disabled","selected","onClick","dataTestId","isInteractive","handleClick","event","shouldIgnoreRowClick","TableRowCell","Table"],"mappings":";;;;;;;;;AA4CO,MAAMA,IAAYC;AAAA,EACrB,CAAC,EAAE,QAAAC,IAAS,QAAQ,UAAAC,IAAW,UAAU,QAAAC,GAAQ,UAAAC,GAAU,GAAGC,EAAA,GAASC;AAAA;AAAA,IAG/D,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,KAAAD;AAAA,QACA,WAAWE,EAAO;AAAA,QAClB,eAAaP;AAAA,QACb,kBAAgBC;AAAA,QAChB,eAAaC;AAAA,QACb,WAAWM;AAAA,QACV,GAAGJ;AAAA,QAEH,UAAAD;AAAA,MAAA;AAAA,IAAA;AAAA;AAIjB;AACAL,EAAU,cAAc;AAEjB,MAAMW,IAAeV,EAA6D,CAAC,EAAE,UA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GAE9CuB,EAAkBH,CAAO,GAGrB,gBAAAnB;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,KAAKmB;AAAA,QACL,WAAWlB,EAAO;AAAA,QAClB,SAAAa;AAAA,QACA,cAAYJ;AAAA,QACZ,iBAAeD;AAAA,QACf,cAAYJ;AAAA,QAEX,UAAAR;AAAA,MAAA;AAAA,IAAA;AAAA,EAGb;AACJ;AACA6C,EAAa,cAAc;AAEpB,MAAMC,IAAQ;AAAA,EACjB,MAAMnD;AAAA,EACN,SAASW;AAAA,EACT,QAAQC;AAAA,EACR,YAAYG;AAAA,EACZ,MAAMyB;AAAA,EACN,KAAKC;AAAA,EACL,SAASS;AACb;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import s from "./fondue-
|
|
3
|
-
import { colorToCss as e } from "./fondue-
|
|
2
|
+
import s from "./fondue-components84.js";
|
|
3
|
+
import { colorToCss as e } from "./fondue-components85.js";
|
|
4
4
|
const a = ["default", "positive", "highlight", "warning", "negative"], i = (t) => typeof t == "string" && a.includes(t), p = ({ status: t }) => {
|
|
5
5
|
const o = i(t) ? { "data-status": t } : { style: { backgroundColor: typeof t == "string" ? t : e(t) || "transparent" } };
|
|
6
6
|
return /* @__PURE__ */ r("div", { "data-test-id": "badge-status", className: s.root, ...o });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FOCUS_OUTLINE as t } from "./fondue-
|
|
1
|
+
import { FOCUS_OUTLINE as t } from "./fondue-components82.js";
|
|
2
2
|
import { sv as e } from "./fondue-components37.js";
|
|
3
3
|
const o = e({
|
|
4
4
|
base: `tw-group tw-relative tw-flex tw-flex-row tw-gap-2 tw-items-center tw-justify-center tw-cursor-pointer tw-font-body tw-font-medium tw-box-border tw-whitespace-nowrap tw-transition-colors ${t}`,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FOCUS_OUTLINE as t } from "./fondue-
|
|
1
|
+
import { FOCUS_OUTLINE as t } from "./fondue-components82.js";
|
|
2
2
|
import { sv as e } from "./fondue-components37.js";
|
|
3
3
|
const s = e({
|
|
4
4
|
base: `tw-peer tw-relative tw-inline-flex tw-bg-base tw-text-white tw-shrink-0 tw-rounded tw-border tw-border-line-x-strong group-hover:tw-border-line-xx-strong hover:tw-border-line-xx-strong tw-transition-colors data-[state="checked"]:tw-border-transparent data-[state="indeterminate"]:tw-border-transparent disabled:tw-border-line-strong disabled:tw-bg-base disabled:tw-cursor-not-allowed data-[state="checked"]:disabled:tw-bg-box-disabled-strong data-[readonly="true"]:tw-pointer-events-none ${t}`,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as s, jsx as e, Fragment as f } from "react/jsx-runtime";
|
|
2
2
|
import { IconDroplet as h, IconCross as I, IconCaretDown as v } from "@frontify/fondue-icons";
|
|
3
3
|
import { forwardRef as b } from "react";
|
|
4
|
-
import t from "./fondue-
|
|
4
|
+
import t from "./fondue-components83.js";
|
|
5
5
|
import { getColorWithName as k, colorToCss as y } from "./fondue-components46.js";
|
|
6
6
|
const c = ({
|
|
7
7
|
id: l,
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
const t = "
|
|
1
|
+
const t = "_content_1ysry_7", s = "_subContent_1ysry_8", n = "_item_1ysry_21", o = "_subTrigger_1ysry_22", r = "_subMenuIndicator_1ysry_115", _ = "_group_1ysry_121", e = "_groupHeading_1ysry_128", u = "_slot_1ysry_139", y = {
|
|
2
2
|
content: t,
|
|
3
3
|
subContent: s,
|
|
4
4
|
item: n,
|
|
5
5
|
subTrigger: o,
|
|
6
|
-
subMenuIndicator:
|
|
7
|
-
group:
|
|
8
|
-
groupHeading:
|
|
9
|
-
slot:
|
|
6
|
+
subMenuIndicator: r,
|
|
7
|
+
group: _,
|
|
8
|
+
groupHeading: e,
|
|
9
|
+
slot: u
|
|
10
10
|
};
|
|
11
11
|
export {
|
|
12
12
|
t as content,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
y as default,
|
|
14
|
+
_ as group,
|
|
15
|
+
e as groupHeading,
|
|
16
16
|
n as item,
|
|
17
|
-
|
|
17
|
+
u as slot,
|
|
18
18
|
s as subContent,
|
|
19
|
-
|
|
19
|
+
r as subMenuIndicator,
|
|
20
20
|
o as subTrigger
|
|
21
21
|
};
|
|
22
22
|
//# sourceMappingURL=fondue-components53.js.map
|
|
@@ -1,80 +1,81 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { Slot as
|
|
4
|
-
import { isValidElement as
|
|
5
|
-
import { useFondueTheme as
|
|
6
|
-
import
|
|
7
|
-
import { recursiveMap as
|
|
8
|
-
const
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import * as l from "@radix-ui/react-popover";
|
|
3
|
+
import { Slot as V } from "@radix-ui/react-slot";
|
|
4
|
+
import { isValidElement as g } from "react";
|
|
5
|
+
import { useFondueTheme as A, ThemeProvider as D } from "./fondue-components30.js";
|
|
6
|
+
import s from "./fondue-components68.js";
|
|
7
|
+
import { recursiveMap as M, getSelectOptionValue as T } from "./fondue-components86.js";
|
|
8
|
+
const E = ({
|
|
9
9
|
highlightedIndex: p,
|
|
10
|
-
getMenuProps:
|
|
10
|
+
getMenuProps: c,
|
|
11
11
|
getItemProps: m,
|
|
12
12
|
children: u,
|
|
13
|
-
filterText:
|
|
13
|
+
filterText: d,
|
|
14
14
|
align: f,
|
|
15
|
-
side:
|
|
16
|
-
selectedItem:
|
|
17
|
-
hasInteractedSinceOpening:
|
|
18
|
-
viewportCollisionPadding:
|
|
15
|
+
side: h,
|
|
16
|
+
selectedItem: r,
|
|
17
|
+
hasInteractedSinceOpening: v,
|
|
18
|
+
viewportCollisionPadding: P = "compact"
|
|
19
19
|
}) => {
|
|
20
|
-
const
|
|
20
|
+
const O = (e) => {
|
|
21
21
|
e.preventDefault();
|
|
22
|
-
},
|
|
22
|
+
}, S = {
|
|
23
23
|
compact: 8,
|
|
24
24
|
spacious: 24
|
|
25
|
-
}, N =
|
|
26
|
-
return /* @__PURE__ */
|
|
27
|
-
|
|
25
|
+
}, N = A();
|
|
26
|
+
return /* @__PURE__ */ t(l.Portal, { children: /* @__PURE__ */ t(D, { theme: N, children: /* @__PURE__ */ t(
|
|
27
|
+
l.Content,
|
|
28
28
|
{
|
|
29
29
|
align: f,
|
|
30
|
-
side:
|
|
31
|
-
collisionPadding:
|
|
32
|
-
onOpenAutoFocus:
|
|
33
|
-
className:
|
|
34
|
-
children: /* @__PURE__ */
|
|
30
|
+
side: h,
|
|
31
|
+
collisionPadding: S[P] + 8,
|
|
32
|
+
onOpenAutoFocus: O,
|
|
33
|
+
className: s.portal,
|
|
34
|
+
children: /* @__PURE__ */ t(
|
|
35
35
|
"ul",
|
|
36
36
|
{
|
|
37
|
-
className:
|
|
38
|
-
...
|
|
39
|
-
"data-has-interacted":
|
|
37
|
+
className: s.menu,
|
|
38
|
+
...c({}, { suppressRefError: !0 }),
|
|
39
|
+
"data-has-interacted": v ? "true" : "false",
|
|
40
40
|
"data-test-id": "fondue-select-menu",
|
|
41
|
-
children:
|
|
41
|
+
children: M(
|
|
42
42
|
u,
|
|
43
|
-
(e,
|
|
43
|
+
(e, n) => {
|
|
44
44
|
if (((o) => (
|
|
45
45
|
// @ts-expect-error - We are explicitly checking for ref
|
|
46
|
-
|
|
46
|
+
g(o) && o.ref !== void 0
|
|
47
47
|
))(e)) {
|
|
48
|
-
const o =
|
|
48
|
+
const o = T(e.props), a = m({
|
|
49
49
|
item: o,
|
|
50
|
-
index:
|
|
50
|
+
index: n,
|
|
51
51
|
...e.ref ? { ref: e.ref } : {}
|
|
52
|
-
});
|
|
53
|
-
return /* @__PURE__ */
|
|
54
|
-
|
|
52
|
+
}), i = (r == null ? void 0 : r.value) === o.value;
|
|
53
|
+
return /* @__PURE__ */ t(
|
|
54
|
+
V,
|
|
55
55
|
{
|
|
56
|
-
className:
|
|
57
|
-
"data-highlighted": p ===
|
|
58
|
-
"data-selected":
|
|
59
|
-
onTouchStart: (
|
|
60
|
-
a.onClick && a.onClick(
|
|
56
|
+
className: s.item,
|
|
57
|
+
"data-highlighted": p === n,
|
|
58
|
+
"data-selected": i,
|
|
59
|
+
onTouchStart: (C) => {
|
|
60
|
+
a.onClick && a.onClick(C);
|
|
61
61
|
},
|
|
62
62
|
...a,
|
|
63
|
+
"aria-selected": i,
|
|
63
64
|
children: e
|
|
64
65
|
},
|
|
65
66
|
e.props.value
|
|
66
67
|
);
|
|
67
68
|
}
|
|
68
69
|
},
|
|
69
|
-
|
|
70
|
+
d
|
|
70
71
|
).parsedChildren
|
|
71
72
|
}
|
|
72
73
|
)
|
|
73
74
|
}
|
|
74
75
|
) }) });
|
|
75
76
|
};
|
|
76
|
-
|
|
77
|
+
E.displayName = "Select.Menu";
|
|
77
78
|
export {
|
|
78
|
-
|
|
79
|
+
E as SelectMenu
|
|
79
80
|
};
|
|
80
81
|
//# sourceMappingURL=fondue-components66.js.map
|