@frontify/fondue-components 27.0.1 → 29.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/dist/fondue-components.js +62 -56
- package/dist/fondue-components.js.map +1 -1
- package/dist/fondue-components10.js +1 -1
- package/dist/fondue-components100.js +23 -6
- package/dist/fondue-components100.js.map +1 -1
- package/dist/fondue-components101.js +34 -12
- package/dist/fondue-components101.js.map +1 -1
- package/dist/fondue-components102.js +10 -70
- package/dist/fondue-components102.js.map +1 -1
- package/dist/fondue-components103.js +67 -14
- package/dist/fondue-components103.js.map +1 -1
- package/dist/fondue-components104.js +15 -7
- package/dist/fondue-components104.js.map +1 -1
- package/dist/fondue-components105.js +25 -88
- package/dist/fondue-components105.js.map +1 -1
- package/dist/fondue-components106.js +18 -80
- package/dist/fondue-components106.js.map +1 -1
- package/dist/fondue-components107.js +24 -30
- package/dist/fondue-components107.js.map +1 -1
- package/dist/fondue-components108.js +8 -20
- package/dist/fondue-components108.js.map +1 -1
- package/dist/fondue-components109.js +30 -39
- package/dist/fondue-components109.js.map +1 -1
- package/dist/fondue-components11.js +3 -3
- package/dist/fondue-components110.js +10 -0
- package/dist/fondue-components110.js.map +1 -0
- package/dist/fondue-components111.js +8 -0
- package/dist/fondue-components111.js.map +1 -0
- package/dist/fondue-components112.js +8 -0
- package/dist/fondue-components112.js.map +1 -0
- package/dist/fondue-components113.js +20 -0
- package/dist/fondue-components113.js.map +1 -0
- package/dist/fondue-components114.js +17 -0
- package/dist/fondue-components114.js.map +1 -0
- package/dist/fondue-components115.js +18 -0
- package/dist/fondue-components115.js.map +1 -0
- package/dist/fondue-components116.js +114 -0
- package/dist/fondue-components116.js.map +1 -0
- package/dist/fondue-components117.js +16 -0
- package/dist/fondue-components117.js.map +1 -0
- package/dist/fondue-components118.js +20 -0
- package/dist/fondue-components118.js.map +1 -0
- package/dist/fondue-components119.js +16 -0
- package/dist/fondue-components119.js.map +1 -0
- package/dist/fondue-components12.js +7 -37
- package/dist/fondue-components12.js.map +1 -1
- package/dist/fondue-components120.js +130 -0
- package/dist/fondue-components120.js.map +1 -0
- package/dist/fondue-components121.js +14 -0
- package/dist/fondue-components121.js.map +1 -0
- package/dist/fondue-components122.js +39 -0
- package/dist/fondue-components122.js.map +1 -0
- package/dist/fondue-components123.js +220 -0
- package/dist/fondue-components123.js.map +1 -0
- package/dist/fondue-components124.js +22 -0
- package/dist/fondue-components124.js.map +1 -0
- package/dist/fondue-components125.js +20 -0
- package/dist/fondue-components125.js.map +1 -0
- package/dist/fondue-components126.js +154 -0
- package/dist/fondue-components126.js.map +1 -0
- package/dist/fondue-components127.js +48 -0
- package/dist/fondue-components127.js.map +1 -0
- package/dist/fondue-components128.js +173 -0
- package/dist/fondue-components128.js.map +1 -0
- package/dist/fondue-components129.js +63 -0
- package/dist/fondue-components129.js.map +1 -0
- package/dist/fondue-components13.js +59 -118
- package/dist/fondue-components13.js.map +1 -1
- package/dist/fondue-components130.js +12 -0
- package/dist/fondue-components130.js.map +1 -0
- package/dist/fondue-components131.js +259 -0
- package/dist/fondue-components131.js.map +1 -0
- package/dist/fondue-components132.js +32 -0
- package/dist/fondue-components132.js.map +1 -0
- package/dist/fondue-components134.js +44 -0
- package/dist/fondue-components134.js.map +1 -0
- package/dist/fondue-components135.js +9 -0
- package/dist/fondue-components135.js.map +1 -0
- package/dist/fondue-components136.js +15 -0
- package/dist/fondue-components136.js.map +1 -0
- package/dist/fondue-components137.js +74 -0
- package/dist/fondue-components137.js.map +1 -0
- package/dist/fondue-components138.js +18 -0
- package/dist/fondue-components138.js.map +1 -0
- package/dist/fondue-components139.js +10 -0
- package/dist/fondue-components139.js.map +1 -0
- package/dist/fondue-components14.js +21 -21
- package/dist/fondue-components14.js.map +1 -1
- package/dist/fondue-components140.js +92 -0
- package/dist/fondue-components140.js.map +1 -0
- package/dist/fondue-components141.js +84 -0
- package/dist/fondue-components141.js.map +1 -0
- package/dist/fondue-components142.js +34 -0
- package/dist/fondue-components142.js.map +1 -0
- package/dist/fondue-components143.js +22 -0
- package/dist/fondue-components143.js.map +1 -0
- package/dist/fondue-components144.js +73 -0
- package/dist/fondue-components144.js.map +1 -0
- package/dist/fondue-components145.js +1355 -0
- package/dist/fondue-components145.js.map +1 -0
- package/dist/fondue-components146.js +944 -0
- package/dist/fondue-components146.js.map +1 -0
- package/dist/fondue-components147.js +201 -0
- package/dist/fondue-components147.js.map +1 -0
- package/dist/fondue-components148.js +24 -0
- package/dist/fondue-components148.js.map +1 -0
- package/dist/fondue-components149.js +43 -0
- package/dist/fondue-components149.js.map +1 -0
- package/dist/fondue-components15.js +121 -45
- package/dist/fondue-components15.js.map +1 -1
- package/dist/fondue-components150.js +71 -0
- package/dist/fondue-components150.js.map +1 -0
- package/dist/fondue-components151.js +34 -0
- package/dist/fondue-components151.js.map +1 -0
- package/dist/fondue-components152.js +12 -0
- package/dist/fondue-components152.js.map +1 -0
- package/dist/fondue-components153.js +156 -0
- package/dist/fondue-components153.js.map +1 -0
- package/dist/fondue-components154.js +111 -0
- package/dist/fondue-components154.js.map +1 -0
- package/dist/fondue-components155.js +19 -0
- package/dist/fondue-components155.js.map +1 -0
- package/dist/fondue-components156.js +19 -0
- package/dist/fondue-components156.js.map +1 -0
- package/dist/fondue-components157.js +32 -0
- package/dist/fondue-components157.js.map +1 -0
- package/dist/fondue-components158.js +16 -0
- package/dist/fondue-components158.js.map +1 -0
- package/dist/fondue-components159.js +10 -0
- package/dist/fondue-components159.js.map +1 -0
- package/dist/fondue-components16.js +35 -41
- package/dist/fondue-components16.js.map +1 -1
- package/dist/fondue-components17.js +44 -56
- package/dist/fondue-components17.js.map +1 -1
- package/dist/fondue-components18.js +40 -41
- package/dist/fondue-components18.js.map +1 -1
- package/dist/fondue-components19.js +56 -19
- package/dist/fondue-components19.js.map +1 -1
- package/dist/fondue-components20.js +42 -45
- package/dist/fondue-components20.js.map +1 -1
- package/dist/fondue-components21.js +18 -71
- package/dist/fondue-components21.js.map +1 -1
- package/dist/fondue-components22.js +46 -17
- package/dist/fondue-components22.js.map +1 -1
- package/dist/fondue-components23.js +68 -75
- package/dist/fondue-components23.js.map +1 -1
- package/dist/fondue-components24.js +70 -32
- package/dist/fondue-components24.js.map +1 -1
- package/dist/fondue-components25.js +17 -54
- package/dist/fondue-components25.js.map +1 -1
- package/dist/fondue-components26.js +77 -23
- package/dist/fondue-components26.js.map +1 -1
- package/dist/fondue-components27.js +34 -53
- package/dist/fondue-components27.js.map +1 -1
- package/dist/fondue-components28.js +52 -97
- package/dist/fondue-components28.js.map +1 -1
- package/dist/fondue-components29.js +23 -33
- package/dist/fondue-components29.js.map +1 -1
- package/dist/fondue-components3.js +1 -1
- package/dist/fondue-components30.js +52 -193
- package/dist/fondue-components30.js.map +1 -1
- package/dist/fondue-components31.js +89 -135
- package/dist/fondue-components31.js.map +1 -1
- package/dist/fondue-components32.js +30 -130
- package/dist/fondue-components32.js.map +1 -1
- package/dist/fondue-components33.js +191 -27
- package/dist/fondue-components33.js.map +1 -1
- package/dist/fondue-components34.js +144 -79
- package/dist/fondue-components34.js.map +1 -1
- package/dist/fondue-components35.js +125 -116
- package/dist/fondue-components35.js.map +1 -1
- package/dist/fondue-components36.js +32 -37
- package/dist/fondue-components36.js.map +1 -1
- package/dist/fondue-components37.js +77 -52
- package/dist/fondue-components37.js.map +1 -1
- package/dist/fondue-components38.js +123 -20
- package/dist/fondue-components38.js.map +1 -1
- package/dist/fondue-components39.js +34 -21
- package/dist/fondue-components39.js.map +1 -1
- package/dist/fondue-components4.js +3 -3
- package/dist/fondue-components40.js +56 -7
- package/dist/fondue-components40.js.map +1 -1
- package/dist/fondue-components41.js +20 -8
- package/dist/fondue-components41.js.map +1 -1
- package/dist/fondue-components42.js +26 -41
- package/dist/fondue-components42.js.map +1 -1
- package/dist/fondue-components43.js +7 -4
- package/dist/fondue-components43.js.map +1 -1
- package/dist/fondue-components44.js +8 -4
- package/dist/fondue-components44.js.map +1 -1
- package/dist/fondue-components45.js +41 -13
- package/dist/fondue-components45.js.map +1 -1
- package/dist/fondue-components46.js +5 -32
- package/dist/fondue-components46.js.map +1 -1
- package/dist/fondue-components47.js +4 -53
- package/dist/fondue-components47.js.map +1 -1
- package/dist/fondue-components48.js +12 -130
- package/dist/fondue-components48.js.map +1 -1
- package/dist/fondue-components49.js +32 -21
- package/dist/fondue-components49.js.map +1 -1
- package/dist/fondue-components5.js +2 -2
- package/dist/fondue-components50.js +54 -53
- package/dist/fondue-components50.js.map +1 -1
- package/dist/fondue-components51.js +130 -7
- package/dist/fondue-components51.js.map +1 -1
- package/dist/fondue-components52.js +21 -13
- package/dist/fondue-components52.js.map +1 -1
- package/dist/fondue-components53.js +53 -17
- package/dist/fondue-components53.js.map +1 -1
- package/dist/fondue-components54.js +7 -4
- package/dist/fondue-components54.js.map +1 -1
- package/dist/fondue-components55.js +13 -18
- package/dist/fondue-components55.js.map +1 -1
- package/dist/fondue-components56.js +16 -18
- package/dist/fondue-components56.js.map +1 -1
- package/dist/fondue-components57.js +1 -1
- package/dist/fondue-components58.js +18 -13
- package/dist/fondue-components58.js.map +1 -1
- package/dist/fondue-components59.js +18 -4
- package/dist/fondue-components59.js.map +1 -1
- package/dist/fondue-components6.js +1 -1
- package/dist/fondue-components60.js +43 -17
- package/dist/fondue-components60.js.map +1 -1
- package/dist/fondue-components61.js +24 -10
- package/dist/fondue-components61.js.map +1 -1
- package/dist/fondue-components62.js +22 -36
- package/dist/fondue-components62.js.map +1 -1
- package/dist/fondue-components63.js +6 -6
- package/dist/fondue-components64.js +1 -1
- package/dist/fondue-components65.js +10 -10
- package/dist/fondue-components66.js +3 -7
- package/dist/fondue-components66.js.map +1 -1
- package/dist/fondue-components67.js +16 -11
- package/dist/fondue-components67.js.map +1 -1
- package/dist/fondue-components68.js +10 -4
- package/dist/fondue-components68.js.map +1 -1
- package/dist/fondue-components69.js +36 -24
- package/dist/fondue-components69.js.map +1 -1
- package/dist/fondue-components7.js +1 -1
- package/dist/fondue-components70.js +6 -16
- package/dist/fondue-components70.js.map +1 -1
- package/dist/fondue-components71.js +5 -20
- package/dist/fondue-components71.js.map +1 -1
- package/dist/fondue-components72.js +13 -20
- package/dist/fondue-components72.js.map +1 -1
- package/dist/fondue-components73.js +52 -20
- package/dist/fondue-components73.js.map +1 -1
- package/dist/fondue-components74.js +44 -20
- package/dist/fondue-components74.js.map +1 -1
- package/dist/fondue-components75.js +6 -19
- package/dist/fondue-components75.js.map +1 -1
- package/dist/fondue-components76.js +6 -8
- package/dist/fondue-components76.js.map +1 -1
- package/dist/fondue-components77.js +13 -11
- package/dist/fondue-components77.js.map +1 -1
- package/dist/fondue-components78.js +27 -10
- package/dist/fondue-components78.js.map +1 -1
- package/dist/fondue-components79.js +13 -7
- package/dist/fondue-components79.js.map +1 -1
- package/dist/fondue-components8.js +5 -5
- package/dist/fondue-components80.js +4 -12
- package/dist/fondue-components80.js.map +1 -1
- package/dist/fondue-components81.js +12 -22
- package/dist/fondue-components81.js.map +1 -1
- package/dist/fondue-components82.js +48 -34
- package/dist/fondue-components82.js.map +1 -1
- package/dist/fondue-components83.js +22 -10
- package/dist/fondue-components83.js.map +1 -1
- package/dist/fondue-components84.js +623 -62
- package/dist/fondue-components84.js.map +1 -1
- package/dist/fondue-components85.js +8 -14
- package/dist/fondue-components85.js.map +1 -1
- package/dist/fondue-components86.js +12 -24
- package/dist/fondue-components86.js.map +1 -1
- package/dist/fondue-components87.js +4 -18
- package/dist/fondue-components87.js.map +1 -1
- package/dist/fondue-components88.js +24 -24
- package/dist/fondue-components88.js.map +1 -1
- package/dist/fondue-components89.js +16 -8
- package/dist/fondue-components89.js.map +1 -1
- package/dist/fondue-components9.js +5 -5
- package/dist/fondue-components90.js +20 -26
- package/dist/fondue-components90.js.map +1 -1
- package/dist/fondue-components91.js +20 -7
- package/dist/fondue-components91.js.map +1 -1
- package/dist/fondue-components92.js +20 -5
- package/dist/fondue-components92.js.map +1 -1
- package/dist/fondue-components93.js +20 -5
- package/dist/fondue-components93.js.map +1 -1
- package/dist/fondue-components94.js +19 -17
- package/dist/fondue-components94.js.map +1 -1
- package/dist/fondue-components95.js +8 -217
- package/dist/fondue-components95.js.map +1 -1
- package/dist/fondue-components96.js +10 -18
- package/dist/fondue-components96.js.map +1 -1
- package/dist/fondue-components97.js +10 -16
- package/dist/fondue-components97.js.map +1 -1
- package/dist/fondue-components98.js +6 -150
- package/dist/fondue-components98.js.map +1 -1
- package/dist/fondue-components99.js +12 -44
- package/dist/fondue-components99.js.map +1 -1
- package/dist/index.d.ts +201 -26
- package/dist/style.css +1 -1
- package/package.json +7 -3
|
@@ -1,103 +1,58 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import * as n from "@radix-ui/react-toggle-group";
|
|
3
|
+
import { forwardRef as i } from "react";
|
|
4
|
+
import { useControllableState as N } from "./fondue-components88.js";
|
|
5
|
+
import e from "./fondue-components89.js";
|
|
6
|
+
const d = ({
|
|
7
|
+
children: a,
|
|
8
|
+
value: o,
|
|
9
|
+
defaultValue: s,
|
|
10
|
+
onValueChange: p,
|
|
11
|
+
hugWidth: f = !0,
|
|
12
|
+
...m
|
|
13
|
+
}, g) => {
|
|
14
|
+
const [C, u] = N({
|
|
15
|
+
prop: o,
|
|
16
|
+
defaultProp: s,
|
|
17
|
+
onChange: p
|
|
18
|
+
});
|
|
19
|
+
return /* @__PURE__ */ l(
|
|
20
|
+
n.Root,
|
|
14
21
|
{
|
|
15
|
-
ref:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
ref: g,
|
|
23
|
+
...m,
|
|
24
|
+
className: e.root,
|
|
25
|
+
onValueChange: (r) => {
|
|
26
|
+
r && u(r);
|
|
27
|
+
},
|
|
28
|
+
value: C,
|
|
29
|
+
type: "single",
|
|
30
|
+
asChild: !1,
|
|
31
|
+
"data-hug-width": f,
|
|
32
|
+
"aria-disabled": m.disabled,
|
|
33
|
+
children: [
|
|
34
|
+
a,
|
|
35
|
+
/* @__PURE__ */ t("div", { className: e.activeIndicator })
|
|
36
|
+
]
|
|
25
37
|
}
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
({
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
"button",
|
|
41
|
-
{
|
|
42
|
-
ref: u,
|
|
43
|
-
type: r,
|
|
44
|
-
disabled: e,
|
|
45
|
-
"aria-label": t,
|
|
46
|
-
"aria-describedby": a,
|
|
47
|
-
title: l,
|
|
48
|
-
"data-test-id": o,
|
|
49
|
-
className: d.content,
|
|
50
|
-
onClick: n,
|
|
51
|
-
children: i
|
|
52
|
-
}
|
|
53
|
-
)
|
|
54
|
-
);
|
|
55
|
-
p.displayName = "SplitButton.Content";
|
|
56
|
-
const m = ({
|
|
57
|
-
"aria-label": t,
|
|
58
|
-
"data-test-id": a = "split-button-action",
|
|
59
|
-
rotateIcon: o = !0,
|
|
60
|
-
children: i
|
|
61
|
-
}) => /* @__PURE__ */ s("div", { "aria-label": t, "data-test-id": a, "data-rotate-icon": o, className: d.action, children: i });
|
|
62
|
-
m.displayName = "SplitButton.Action";
|
|
63
|
-
const B = c(
|
|
64
|
-
({
|
|
65
|
-
"aria-label": t,
|
|
66
|
-
"aria-describedby": a,
|
|
67
|
-
"data-test-id": o = "split-button-action-button",
|
|
68
|
-
children: i,
|
|
69
|
-
disabled: e = !1,
|
|
70
|
-
title: n,
|
|
71
|
-
type: l = "button",
|
|
72
|
-
...r
|
|
73
|
-
}, u) => /* @__PURE__ */ s(
|
|
74
|
-
"button",
|
|
75
|
-
{
|
|
76
|
-
ref: u,
|
|
77
|
-
type: l,
|
|
78
|
-
disabled: e,
|
|
79
|
-
"aria-label": t,
|
|
80
|
-
"aria-describedby": a,
|
|
81
|
-
title: n,
|
|
82
|
-
"data-test-id": o,
|
|
83
|
-
className: d.actionButton,
|
|
84
|
-
...r,
|
|
85
|
-
children: i
|
|
86
|
-
}
|
|
87
|
-
)
|
|
88
|
-
);
|
|
89
|
-
B.displayName = "SplitButton.ActionButton";
|
|
90
|
-
const N = {
|
|
91
|
-
Root: b,
|
|
92
|
-
Content: p,
|
|
93
|
-
Action: m,
|
|
94
|
-
ActionButton: B
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
d.displayName = "SegmentedControl.Root";
|
|
41
|
+
const c = ({ children: a, ...o }, s) => /* @__PURE__ */ l(n.Item, { ref: s, ...o, className: e.item, asChild: !1, children: [
|
|
42
|
+
/* @__PURE__ */ t("span", { className: e.separator }),
|
|
43
|
+
/* @__PURE__ */ l("span", { className: e.itemLabel, children: [
|
|
44
|
+
/* @__PURE__ */ t("span", { className: e.itemLabelActive, children: a }),
|
|
45
|
+
/* @__PURE__ */ t("span", { className: e.itemLabelInactive, children: a })
|
|
46
|
+
] })
|
|
47
|
+
] });
|
|
48
|
+
c.displayName = "SegmentedControl.Item";
|
|
49
|
+
const S = {
|
|
50
|
+
Root: i(d),
|
|
51
|
+
Item: i(c)
|
|
95
52
|
};
|
|
96
53
|
export {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
p as SplitButtonContent,
|
|
101
|
-
b as SplitButtonRoot
|
|
54
|
+
S as SegmentedControl,
|
|
55
|
+
c as SegmentedControlItem,
|
|
56
|
+
d as SegmentedControlRoot
|
|
102
57
|
};
|
|
103
58
|
//# sourceMappingURL=fondue-components28.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components28.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"fondue-components28.js","sources":["../src/components/SegmentedControl/SegmentedControl.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';\nimport { forwardRef, type ForwardedRef, type ReactElement, type ReactNode } from 'react';\n\nimport { useControllableState } from '#/hooks/useControllableState';\n\nimport styles from './styles/segmentedControl.module.scss';\n\nexport type SegmentedControlRootProps<TValue extends string = string> = {\n id?: string;\n children: ReactNode;\n /**\n * The default value of the segmented control\n * Used for uncontrolled components\n */\n defaultValue?: TValue;\n /**\n * The controlled value of the segmented control\n */\n value?: TValue;\n /**\n * Event handler called when the value changes\n */\n onValueChange?: (value: TValue) => void;\n /**\n * Disable the segmented control\n * @default false\n */\n disabled?: boolean;\n /**\n * Specify if the segmented control should only take the width of its content\n * @default true\n */\n hugWidth?: boolean;\n};\n\nexport const SegmentedControlRoot = <TValue extends string = string>(\n {\n children,\n value: propsValue,\n defaultValue,\n onValueChange,\n hugWidth = true,\n ...rootProps\n }: SegmentedControlRootProps<TValue>,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const [value, setValue] = useControllableState({\n prop: propsValue,\n defaultProp: defaultValue,\n onChange: onValueChange,\n });\n\n return (\n <ToggleGroupPrimitive.Root\n ref={ref}\n {...rootProps}\n className={styles.root}\n onValueChange={(value) => {\n if (value) {\n setValue(value as TValue);\n }\n }}\n value={value}\n type=\"single\"\n asChild={false}\n data-hug-width={hugWidth}\n aria-disabled={rootProps.disabled}\n >\n {children}\n {/* Active indicator */}\n <div className={styles.activeIndicator} />\n </ToggleGroupPrimitive.Root>\n );\n};\nSegmentedControlRoot.displayName = 'SegmentedControl.Root';\n\ntype SegmentedControlItemProps = {\n children: ReactNode;\n value: string;\n};\n\nexport const SegmentedControlItem = (\n { children, ...itemProps }: SegmentedControlItemProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => (\n <ToggleGroupPrimitive.Item ref={ref} {...itemProps} className={styles.item} asChild={false}>\n {/* Separator */}\n <span className={styles.separator} />\n <span className={styles.itemLabel}>\n {/* Active children */}\n <span className={styles.itemLabelActive}>{children}</span>\n\n {/* Inactive children */}\n <span className={styles.itemLabelInactive}>{children}</span>\n </span>\n </ToggleGroupPrimitive.Item>\n);\nSegmentedControlItem.displayName = 'SegmentedControl.Item';\n\nexport const SegmentedControl = {\n Root: forwardRef(SegmentedControlRoot) as <TValue extends string = string>(\n props: SegmentedControlRootProps<TValue> & { ref?: ForwardedRef<HTMLDivElement> },\n ) => ReactElement,\n Item: forwardRef(SegmentedControlItem),\n};\n"],"names":["SegmentedControlRoot","children","propsValue","defaultValue","onValueChange","hugWidth","rootProps","ref","value","setValue","useControllableState","jsxs","ToggleGroupPrimitive","styles","jsx","SegmentedControlItem","itemProps","SegmentedControl","forwardRef"],"mappings":";;;;;AAqCO,MAAMA,IAAuB,CAChC;AAAA,EACI,UAAAC;AAAA,EACA,OAAOC;AAAA,EACP,cAAAC;AAAA,EACA,eAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,GAAGC;AACP,GACAC,MACC;AACD,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAqB;AAAA,IAC3C,MAAMR;AAAA,IACN,aAAaC;AAAA,IACb,UAAUC;AAAA,EAAA,CACb;AAED,SACI,gBAAAO;AAAA,IAACC,EAAqB;AAAA,IAArB;AAAA,MACG,KAAAL;AAAA,MACC,GAAGD;AAAA,MACJ,WAAWO,EAAO;AAAA,MAClB,eAAe,CAACL,MAAU;AACtB,QAAIA,KACAC,EAASD,CAAe;AAAA,MAEhC;AAAA,MACA,OAAAA;AAAA,MACA,MAAK;AAAA,MACL,SAAS;AAAA,MACT,kBAAgBH;AAAA,MAChB,iBAAeC,EAAU;AAAA,MAExB,UAAA;AAAA,QAAAL;AAAA,QAED,gBAAAa,EAAC,OAAA,EAAI,WAAWD,EAAO,gBAAA,CAAiB;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGpD;AACAb,EAAqB,cAAc;AAO5B,MAAMe,IAAuB,CAChC,EAAE,UAAAd,GAAU,GAAGe,EAAA,GACfT,MAEA,gBAAAI,EAACC,EAAqB,MAArB,EAA0B,KAAAL,GAAW,GAAGS,GAAW,WAAWH,EAAO,MAAM,SAAS,IAEjF,UAAA;AAAA,EAAA,gBAAAC,EAAC,QAAA,EAAK,WAAWD,EAAO,UAAA,CAAW;AAAA,EACnC,gBAAAF,EAAC,QAAA,EAAK,WAAWE,EAAO,WAEpB,UAAA;AAAA,IAAA,gBAAAC,EAAC,QAAA,EAAK,WAAWD,EAAO,iBAAkB,UAAAZ,GAAS;AAAA,IAGnD,gBAAAa,EAAC,QAAA,EAAK,WAAWD,EAAO,mBAAoB,UAAAZ,EAAA,CAAS;AAAA,EAAA,EAAA,CACzD;AAAA,EAAA,CACJ;AAEJc,EAAqB,cAAc;AAE5B,MAAME,IAAmB;AAAA,EAC5B,MAAMC,EAAWlB,CAAoB;AAAA,EAGrC,MAAMkB,EAAWH,CAAoB;AACzC;"}
|
|
@@ -1,36 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
onCheckedChange: m,
|
|
24
|
-
"aria-label": c ?? l("Switch_defaultLabel"),
|
|
25
|
-
"data-test-id": s,
|
|
26
|
-
"data-size": r,
|
|
27
|
-
...d,
|
|
28
|
-
children: /* @__PURE__ */ t(a.Thumb, { className: e.thumb })
|
|
29
|
-
}
|
|
30
|
-
);
|
|
31
|
-
}, u = n(p);
|
|
32
|
-
u.displayName = "Switch";
|
|
1
|
+
import { ComboboxMultiple as o } from "./fondue-components90.js";
|
|
2
|
+
import { ComboboxSingle as t } from "./fondue-components91.js";
|
|
3
|
+
import { SelectMultiple as m } from "./fondue-components92.js";
|
|
4
|
+
import { SelectSingle as p } from "./fondue-components93.js";
|
|
5
|
+
import { ForwardedRefSelectItem as i, ForwardedRefSelectItemGroup as r } from "./fondue-components94.js";
|
|
6
|
+
import { ForwardedRefSelectSlot as S } from "./fondue-components95.js";
|
|
7
|
+
const l = t;
|
|
8
|
+
l.Multiple = o;
|
|
9
|
+
const e = p;
|
|
10
|
+
e.displayName = "Select";
|
|
11
|
+
e.Multiple = m;
|
|
12
|
+
e.Multiple.displayName = "Select.Multiple";
|
|
13
|
+
e.Combobox = l;
|
|
14
|
+
e.Combobox.displayName = "Select.Combobox";
|
|
15
|
+
e.Combobox.Multiple = o;
|
|
16
|
+
e.Combobox.Multiple.displayName = "Select.Combobox.Multiple";
|
|
17
|
+
e.Item = i;
|
|
18
|
+
e.Item.displayName = "Select.Item";
|
|
19
|
+
e.Group = r;
|
|
20
|
+
e.Group.displayName = "Select.Group";
|
|
21
|
+
e.Slot = S;
|
|
22
|
+
e.Slot.displayName = "Select.Slot";
|
|
33
23
|
export {
|
|
34
|
-
|
|
24
|
+
e as Select
|
|
35
25
|
};
|
|
36
26
|
//# sourceMappingURL=fondue-components29.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components29.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"fondue-components29.js","sources":["../src/components/Select/index.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { ComboboxMultiple } from './ComboboxMultiple';\nimport { ComboboxSingle } from './ComboboxSingle';\nimport { SelectMultiple } from './SelectMultiple';\nimport { SelectSingle } from './SelectSingle';\nimport { ForwardedRefSelectItem, ForwardedRefSelectItemGroup } from './components/SelectItem';\nimport { ForwardedRefSelectSlot } from './components/SelectSlot';\n\ntype ComboboxComponent = typeof ComboboxSingle & {\n Multiple: typeof ComboboxMultiple;\n};\n\n// @ts-expect-error We support both Select and Select.Combobox as the Root\nconst Combobox: ComboboxComponent = ComboboxSingle;\nCombobox.Multiple = ComboboxMultiple;\n\n// @ts-expect-error We support both Select and Select.Combobox as the Root\nexport const Select: typeof SelectSingle & {\n Multiple: typeof SelectMultiple;\n Combobox: ComboboxComponent;\n Item: typeof ForwardedRefSelectItem;\n Group: typeof ForwardedRefSelectItemGroup;\n Slot: typeof ForwardedRefSelectSlot;\n} = SelectSingle;\n\nSelect.displayName = 'Select';\nSelect.Multiple = SelectMultiple;\nSelect.Multiple.displayName = 'Select.Multiple';\nSelect.Combobox = Combobox;\nSelect.Combobox.displayName = 'Select.Combobox';\nSelect.Combobox.Multiple = ComboboxMultiple;\nSelect.Combobox.Multiple.displayName = 'Select.Combobox.Multiple';\nSelect.Item = ForwardedRefSelectItem;\nSelect.Item.displayName = 'Select.Item';\nSelect.Group = ForwardedRefSelectItemGroup;\nSelect.Group.displayName = 'Select.Group';\nSelect.Slot = ForwardedRefSelectSlot;\nSelect.Slot.displayName = 'Select.Slot';\n"],"names":["Combobox","ComboboxSingle","ComboboxMultiple","Select","SelectSingle","SelectMultiple","ForwardedRefSelectItem","ForwardedRefSelectItemGroup","ForwardedRefSelectSlot"],"mappings":";;;;;;AAcA,MAAMA,IAA8BC;AACpCD,EAAS,WAAWE;AAGb,MAAMC,IAMTC;AAEJD,EAAO,cAAc;AACrBA,EAAO,WAAWE;AAClBF,EAAO,SAAS,cAAc;AAC9BA,EAAO,WAAWH;AAClBG,EAAO,SAAS,cAAc;AAC9BA,EAAO,SAAS,WAAWD;AAC3BC,EAAO,SAAS,SAAS,cAAc;AACvCA,EAAO,OAAOG;AACdH,EAAO,KAAK,cAAc;AAC1BA,EAAO,QAAQI;AACfJ,EAAO,MAAM,cAAc;AAC3BA,EAAO,OAAOK;AACdL,EAAO,KAAK,cAAc;"}
|
|
@@ -2,7 +2,7 @@ import { jsx as n, jsxs as m } from "react/jsx-runtime";
|
|
|
2
2
|
import { IconCaretDown as C } from "@frontify/fondue-icons";
|
|
3
3
|
import * as s from "@radix-ui/react-accordion";
|
|
4
4
|
import { forwardRef as y, useMemo as R, Children as w, isValidElement as T } from "react";
|
|
5
|
-
import d from "./fondue-
|
|
5
|
+
import d from "./fondue-components41.js";
|
|
6
6
|
const g = ({
|
|
7
7
|
"data-test-id": o = "fondue-accordion",
|
|
8
8
|
border: e = !0,
|
|
@@ -1,199 +1,58 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const w = new ResizeObserver(y);
|
|
29
|
-
return w.observe(c), c.parentElement && w.observe(c.parentElement), () => {
|
|
30
|
-
w.disconnect();
|
|
31
|
-
};
|
|
32
|
-
}, [l]), // eslint-disable-next-line jsx-a11y-x/no-noninteractive-element-interactions
|
|
33
|
-
/* @__PURE__ */ n(
|
|
34
|
-
"table",
|
|
35
|
-
{
|
|
36
|
-
ref: b,
|
|
37
|
-
className: s.table,
|
|
38
|
-
style: {
|
|
39
|
-
// @ts-expect-error CSS custom properties are not in CSSProperties type
|
|
40
|
-
"--table-gutter": r
|
|
41
|
-
},
|
|
42
|
-
"data-layout": t,
|
|
43
|
-
"data-font-size": e,
|
|
44
|
-
"data-sticky-header": d,
|
|
45
|
-
"data-sticky-left-column": N,
|
|
46
|
-
"data-no-border": a,
|
|
47
|
-
"data-has-horizontal-overflow": p,
|
|
48
|
-
onKeyDown: U,
|
|
49
|
-
...m,
|
|
50
|
-
children: l
|
|
51
|
-
}
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
);
|
|
55
|
-
x.displayName = "Table.Root";
|
|
56
|
-
const k = u(({ children: t }, e) => /* @__PURE__ */ n("caption", { ref: e, className: s.caption, children: t }));
|
|
57
|
-
k.displayName = "Table.Caption";
|
|
58
|
-
const z = u(
|
|
59
|
-
({ sticky: t = !1, children: e, "aria-label": r, "aria-busy": o }, a) => /* @__PURE__ */ n("thead", { ref: a, className: s.header, "data-sticky": t, "aria-label": r, "aria-busy": o, children: e })
|
|
60
|
-
);
|
|
61
|
-
z.displayName = "Table.Header";
|
|
62
|
-
const H = u(
|
|
63
|
-
({
|
|
64
|
-
noShrink: t = !1,
|
|
65
|
-
truncate: e = !1,
|
|
66
|
-
align: r = "left",
|
|
67
|
-
scope: o = "col",
|
|
68
|
-
sortTranslations: a,
|
|
69
|
-
sortDirection: l,
|
|
70
|
-
colSpan: m,
|
|
71
|
-
width: f,
|
|
72
|
-
state: b = "idle",
|
|
73
|
-
loadingStateAriaLabel: p,
|
|
74
|
-
onSortChange: i,
|
|
75
|
-
children: d
|
|
76
|
-
}, N) => {
|
|
77
|
-
const { t: c } = j(), y = v(null);
|
|
78
|
-
R(y, N), h(y);
|
|
79
|
-
const w = L(() => typeof d == "string" ? l === "ascending" ? (a == null ? void 0 : a.sortDescending) ?? c("Table_sortByDescending", { column: d }) : (a == null ? void 0 : a.sortAscending) ?? c("Table_sortByAscending", { column: d }) : c(l === "ascending" ? "Table_sortDescending" : "Table_sortAscending"), [d, l, a, c]), g = () => {
|
|
80
|
-
if (!i)
|
|
81
|
-
return;
|
|
82
|
-
i(l === void 0 || l === "descending" ? "ascending" : "descending");
|
|
83
|
-
};
|
|
84
|
-
return /* @__PURE__ */ n(
|
|
85
|
-
"th",
|
|
86
|
-
{
|
|
87
|
-
ref: y,
|
|
88
|
-
style: { width: f },
|
|
89
|
-
className: s.headerCell,
|
|
90
|
-
scope: o,
|
|
91
|
-
colSpan: m,
|
|
92
|
-
"data-align": r,
|
|
93
|
-
"data-truncate": e,
|
|
94
|
-
"data-no-shrink": t,
|
|
95
|
-
"data-sortable": !!i,
|
|
96
|
-
"aria-sort": i ? l || "none" : void 0,
|
|
97
|
-
children: b === "loading" ? /* @__PURE__ */ T("div", { className: s.cellContent, "aria-live": "polite", "aria-label": p, children: [
|
|
98
|
-
typeof d == "string" && e ? /* @__PURE__ */ n("span", { className: s.buttonText, children: d }) : d,
|
|
99
|
-
/* @__PURE__ */ n(S, { "data-test-id": "fondue-loading-circle", size: "xx-small" })
|
|
100
|
-
] }) : i ? /* @__PURE__ */ T(
|
|
101
|
-
"button",
|
|
1
|
+
import { jsxs as f, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import * as e from "@radix-ui/react-slider";
|
|
3
|
+
import { forwardRef as h, useRef as R } from "react";
|
|
4
|
+
import r from "./fondue-components96.js";
|
|
5
|
+
const g = ({
|
|
6
|
+
value: a,
|
|
7
|
+
defaultValue: n = [0],
|
|
8
|
+
onChange: i,
|
|
9
|
+
onCommit: m,
|
|
10
|
+
"data-test-id": c = "fondue-slider",
|
|
11
|
+
...d
|
|
12
|
+
}, l) => {
|
|
13
|
+
const o = R(null);
|
|
14
|
+
return /* @__PURE__ */ f(
|
|
15
|
+
e.Root,
|
|
16
|
+
{
|
|
17
|
+
ref: l,
|
|
18
|
+
className: r.root,
|
|
19
|
+
value: a,
|
|
20
|
+
defaultValue: n,
|
|
21
|
+
onValueChange: i,
|
|
22
|
+
onValueCommit: m,
|
|
23
|
+
"data-test-id": c,
|
|
24
|
+
...d,
|
|
25
|
+
children: [
|
|
26
|
+
/* @__PURE__ */ s(
|
|
27
|
+
e.Track,
|
|
102
28
|
{
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
children: [
|
|
109
|
-
typeof d == "string" && e ? /* @__PURE__ */ n("span", { className: s.buttonText, children: d }) : d,
|
|
110
|
-
/* @__PURE__ */ n(M, { width: 3, children: l === "ascending" ? /* @__PURE__ */ n(O, { className: s.sortIndicator, size: "12" }) : l === "descending" ? /* @__PURE__ */ n(K, { className: s.sortIndicator, size: "12" }) : /* @__PURE__ */ n(W, { className: s.sortIndicator, size: "12" }) })
|
|
111
|
-
]
|
|
29
|
+
onPointerDown: () => {
|
|
30
|
+
o.current && (o.current.dataset.showFocusRing = "false");
|
|
31
|
+
},
|
|
32
|
+
className: r.track,
|
|
33
|
+
children: /* @__PURE__ */ s(e.Range, { className: r.range })
|
|
112
34
|
}
|
|
113
|
-
)
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
35
|
+
),
|
|
36
|
+
(a || n).map((w, u) => /* @__PURE__ */ s(
|
|
37
|
+
e.Thumb,
|
|
38
|
+
{
|
|
39
|
+
ref: o,
|
|
40
|
+
className: r.thumb,
|
|
41
|
+
onPointerDown: (t) => {
|
|
42
|
+
t.currentTarget.dataset.showFocusRing = "false";
|
|
43
|
+
},
|
|
44
|
+
onBlur: (t) => {
|
|
45
|
+
t.currentTarget.dataset.showFocusRing = "true";
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
u
|
|
49
|
+
))
|
|
50
|
+
]
|
|
129
51
|
}
|
|
130
|
-
)
|
|
131
|
-
);
|
|
132
|
-
|
|
133
|
-
const B = u(
|
|
134
|
-
({ disabled: t = !1, selected: e = !1, onClick: r, children: o, "aria-label": a, "data-test-id": l }, m) => {
|
|
135
|
-
const f = r !== void 0 && !t, b = (i) => {
|
|
136
|
-
t || q(i) || r && r(e);
|
|
137
|
-
}, p = (i) => {
|
|
138
|
-
f && (i.key === "Enter" || i.key === " ") && (i.preventDefault(), b());
|
|
139
|
-
};
|
|
140
|
-
return /* @__PURE__ */ n(
|
|
141
|
-
"tr",
|
|
142
|
-
{
|
|
143
|
-
ref: m,
|
|
144
|
-
className: s.row,
|
|
145
|
-
tabIndex: 0,
|
|
146
|
-
role: f ? "button" : "row",
|
|
147
|
-
"data-disabled": t,
|
|
148
|
-
"data-interactive": f,
|
|
149
|
-
"data-selected": f ? void 0 : e,
|
|
150
|
-
"aria-disabled": t,
|
|
151
|
-
"aria-label": a,
|
|
152
|
-
"aria-selected": f ? void 0 : e,
|
|
153
|
-
onClick: f ? b : void 0,
|
|
154
|
-
onKeyDown: f ? p : void 0,
|
|
155
|
-
"data-test-id": l,
|
|
156
|
-
children: o
|
|
157
|
-
}
|
|
158
|
-
);
|
|
159
|
-
}
|
|
160
|
-
);
|
|
161
|
-
B.displayName = "Table.Row";
|
|
162
|
-
const A = u(
|
|
163
|
-
({ colSpan: t, truncate: e, align: r = "left", children: o, "aria-label": a }, l) => {
|
|
164
|
-
const m = v(null);
|
|
165
|
-
return R(m, l), h(m), /* @__PURE__ */ n(
|
|
166
|
-
"td",
|
|
167
|
-
{
|
|
168
|
-
ref: m,
|
|
169
|
-
className: s.rowCell,
|
|
170
|
-
colSpan: t,
|
|
171
|
-
"data-align": r,
|
|
172
|
-
"data-truncate": e,
|
|
173
|
-
"aria-label": a,
|
|
174
|
-
children: o
|
|
175
|
-
}
|
|
176
|
-
);
|
|
177
|
-
}
|
|
178
|
-
);
|
|
179
|
-
A.displayName = "Table.RowCell";
|
|
180
|
-
const ee = {
|
|
181
|
-
Root: x,
|
|
182
|
-
Caption: k,
|
|
183
|
-
Header: z,
|
|
184
|
-
HeaderCell: H,
|
|
185
|
-
Body: I,
|
|
186
|
-
Row: B,
|
|
187
|
-
RowCell: A
|
|
188
|
-
};
|
|
52
|
+
);
|
|
53
|
+
}, p = h(g);
|
|
54
|
+
p.displayName = "Slider";
|
|
189
55
|
export {
|
|
190
|
-
|
|
191
|
-
I as TableBody,
|
|
192
|
-
k as TableCaption,
|
|
193
|
-
z as TableHeader,
|
|
194
|
-
H as TableHeaderCell,
|
|
195
|
-
x as TableRoot,
|
|
196
|
-
B as TableRow,
|
|
197
|
-
A as TableRowCell
|
|
56
|
+
p as Slider
|
|
198
57
|
};
|
|
199
58
|
//# sourceMappingURL=fondue-components30.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components30.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 useEffect,\n useMemo,\n useRef,\n useState,\n type AriaAttributes,\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 { useTranslation } from '#/hooks/useTranslation';\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 * Additional spacing between table cells (both horizontal and vertical)\n *\n * This value is added to the default cell spacing. For example, with `gutter=\"48px\"`,\n * cells will have 48px of additional space between them in both directions\n * (24px added to each side).\n *\n * Accepts any CSS length value with units (e.g., '16px', '1rem', '48px')\n *\n * **Important:** Always include a unit, even for zero (use '0px', not '0')\n * @default '0px'\n */\n gutter?: CSSProperties['borderSpacing'];\n /**\n * Whether header should stick to the top when scrolling\n * @deprecated Use `Table.Header sticky` prop instead. For sticky columns, use `Table.Body firstColumnSticky` or `lastColumnSticky` props\n */\n sticky?: 'head' | 'col' | 'both';\n /**\n * Whether to remove the top and bottom borders from the table\n * @default false\n */\n noBorder?: boolean;\n children: ReactNode;\n} & CommonAriaAttrs &\n Pick<AriaAttributes, 'aria-multiselectable'>;\n\nexport const TableRoot = forwardRef<HTMLTableElement, TableRootProps>(\n ({ layout = 'auto', fontSize = 'medium', gutter = '0px', sticky, noBorder = false, children, ...props }, ref) => {\n const tableRef = useRef<HTMLTableElement>(null);\n const [hasHorizontalOverflow, setHasHorizontalOverflow] = useState(false);\n\n useSyncRefs<HTMLTableElement>(tableRef, ref);\n\n // Handle deprecated `sticky` prop for backward compatibility\n const legacyStickyHeader = sticky === 'head' || sticky === 'both';\n const legacyStickyLeftColumn = sticky === 'col' || sticky === 'both';\n\n useEffect(() => {\n const table = tableRef.current;\n if (!table) {\n return;\n }\n\n const checkOverflow = () => {\n const parent = table.parentElement;\n if (!parent) {\n return;\n }\n\n const tableWidth = table.scrollWidth;\n const parentWidth = parent.clientWidth;\n setHasHorizontalOverflow(tableWidth > parentWidth);\n };\n\n checkOverflow();\n\n const resizeObserver = new ResizeObserver(checkOverflow);\n resizeObserver.observe(table);\n if (table.parentElement) {\n resizeObserver.observe(table.parentElement);\n }\n\n return () => {\n resizeObserver.disconnect();\n };\n }, [children]);\n\n return (\n // eslint-disable-next-line jsx-a11y-x/no-noninteractive-element-interactions\n <table\n ref={tableRef}\n className={styles.table}\n style={{\n // @ts-expect-error CSS custom properties are not in CSSProperties type\n '--table-gutter': gutter,\n }}\n data-layout={layout}\n data-font-size={fontSize}\n data-sticky-header={legacyStickyHeader}\n data-sticky-left-column={legacyStickyLeftColumn}\n data-no-border={noBorder}\n data-has-horizontal-overflow={hasHorizontalOverflow}\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 /**\n * Whether the header should stick to the top when scrolling\n * @default false\n */\n sticky?: boolean;\n children: ReactNode;\n 'aria-label'?: string;\n 'aria-busy'?: boolean;\n};\n\nexport const TableHeader = forwardRef<HTMLTableSectionElement, TableHeaderProps>(\n ({ sticky = false, children, 'aria-label': ariaLabel, 'aria-busy': ariaBusy }, ref) => {\n return (\n <thead ref={ref} className={styles.header} data-sticky={sticky} 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 ascending/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 { t } = useTranslation();\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 ?? t('Table_sortByDescending', { column: children });\n }\n return sortTranslations?.sortAscending ?? t('Table_sortByAscending', { column: children });\n }\n\n return sortDirection === 'ascending' ? t('Table_sortDescending') : t('Table_sortAscending');\n }, [children, sortDirection, sortTranslations, t]);\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 className={styles.sortIndicator} size=\"12\" />\n ) : sortDirection === 'descending' ? (\n <IconArrowDown className={styles.sortIndicator} 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 /**\n * Whether the first column should stick to the left when scrolling horizontally\n * @default false\n */\n firstColumnSticky?: boolean;\n /**\n * Whether the last column should stick to the right when scrolling horizontally\n * @default false\n */\n lastColumnSticky?: boolean;\n children: ReactNode;\n 'aria-busy'?: boolean;\n};\n\nexport const TableBody = forwardRef<HTMLTableSectionElement, TableBodyProps>(\n ({ firstColumnSticky = false, lastColumnSticky = false, children, 'aria-busy': ariaBusy }, ref) => {\n return (\n <tbody\n ref={ref}\n className={styles.body}\n data-first-column-sticky={firstColumnSticky}\n data-last-column-sticky={lastColumnSticky}\n aria-busy={ariaBusy}\n >\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","gutter","sticky","noBorder","children","props","ref","tableRef","useRef","hasHorizontalOverflow","setHasHorizontalOverflow","useState","useSyncRefs","legacyStickyHeader","legacyStickyLeftColumn","useEffect","table","checkOverflow","parent","tableWidth","parentWidth","resizeObserver","jsx","styles","handleKeyDown","TableCaption","TableHeader","ariaLabel","ariaBusy","TableHeaderCell","noShrink","truncate","align","scope","sortTranslations","sortDirection","colSpan","width","state","loadingStateAriaLabel","onSortChange","t","useTranslation","cellRef","useTextTruncation","sortLabel","useMemo","handleSortChange","jsxs","LoadingCircle","Box","IconArrowUp","IconArrowDown","IconArrowBidirectional","TableBody","firstColumnSticky","lastColumnSticky","TableRow","disabled","selected","onClick","dataTestId","isInteractive","handleClick","event","shouldIgnoreRowClick","TableRowCell","Table"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"fondue-components30.js","sources":["../src/components/Slider/Slider.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as RadixSlider from '@radix-ui/react-slider';\nimport { type ForwardedRef, forwardRef, useRef } from 'react';\n\nimport { type CommonAriaAttrs } from '#/utilities/types';\n\nimport styles from './styles/slider.module.scss';\n\nexport type SliderProps = {\n id?: string;\n name?: string;\n /**\n * The default value of the slider\n * Used for uncontrolled components\n * @default [0]\n */\n defaultValue?: number[];\n /**\n * The controlled value of the slider\n * @default [0]\n */\n value?: number[];\n /**\n * Minimum value of the slider\n * @default 0\n */\n min?: number;\n /**\n * Maximum value of the slider\n * @default 100\n */\n max?: number;\n /**\n * The granularity with which the slider can step through values\n * @default 1\n */\n step?: number;\n /**\n * The minimum steps between thumbs in a range slider\n * @default 0\n */\n minStepsBetweenThumbs?: number;\n /**\n * Disable the slider\n * @default false\n */\n disabled?: boolean;\n onChange?: (value: number[]) => void;\n onCommit?: (value: number[]) => void;\n 'data-test-id'?: string;\n} & CommonAriaAttrs;\n\nconst SliderComponent = (\n {\n value,\n defaultValue = [0],\n onChange,\n onCommit,\n 'data-test-id': dataTestId = 'fondue-slider',\n ...props\n }: SliderProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => {\n const sliderThumbRef = useRef<HTMLSpanElement | null>(null);\n return (\n <RadixSlider.Root\n ref={ref}\n className={styles.root}\n value={value}\n defaultValue={defaultValue}\n onValueChange={onChange}\n onValueCommit={onCommit}\n data-test-id={dataTestId}\n {...props}\n >\n <RadixSlider.Track\n onPointerDown={() => {\n if (sliderThumbRef.current) {\n sliderThumbRef.current.dataset.showFocusRing = 'false';\n }\n }}\n className={styles.track}\n >\n <RadixSlider.Range className={styles.range} />\n </RadixSlider.Track>\n {(value || defaultValue).map((_, index) => (\n <RadixSlider.Thumb\n ref={sliderThumbRef}\n className={styles.thumb}\n onPointerDown={(event) => {\n event.currentTarget.dataset.showFocusRing = 'false';\n }}\n onBlur={(event) => {\n event.currentTarget.dataset.showFocusRing = 'true';\n }}\n key={index}\n />\n ))}\n </RadixSlider.Root>\n );\n};\n\nexport const Slider = forwardRef<HTMLButtonElement, SliderProps>(SliderComponent);\nSlider.displayName = 'Slider';\n"],"names":["SliderComponent","value","defaultValue","onChange","onCommit","dataTestId","props","ref","sliderThumbRef","useRef","jsxs","RadixSlider","styles","jsx","_","index","event","Slider","forwardRef"],"mappings":";;;;AAqDA,MAAMA,IAAkB,CACpB;AAAA,EACI,OAAAC;AAAA,EACA,cAAAC,IAAe,CAAC,CAAC;AAAA,EACjB,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,gBAAgBC,IAAa;AAAA,EAC7B,GAAGC;AACP,GACAC,MACC;AACD,QAAMC,IAAiBC,EAA+B,IAAI;AAC1D,SACI,gBAAAC;AAAA,IAACC,EAAY;AAAA,IAAZ;AAAA,MACG,KAAAJ;AAAA,MACA,WAAWK,EAAO;AAAA,MAClB,OAAAX;AAAA,MACA,cAAAC;AAAA,MACA,eAAeC;AAAA,MACf,eAAeC;AAAA,MACf,gBAAcC;AAAA,MACb,GAAGC;AAAA,MAEJ,UAAA;AAAA,QAAA,gBAAAO;AAAA,UAACF,EAAY;AAAA,UAAZ;AAAA,YACG,eAAe,MAAM;AACjB,cAAIH,EAAe,YACfA,EAAe,QAAQ,QAAQ,gBAAgB;AAAA,YAEvD;AAAA,YACA,WAAWI,EAAO;AAAA,YAElB,4BAACD,EAAY,OAAZ,EAAkB,WAAWC,EAAO,MAAA,CAAO;AAAA,UAAA;AAAA,QAAA;AAAA,SAE9CX,KAASC,GAAc,IAAI,CAACY,GAAGC,MAC7B,gBAAAF;AAAA,UAACF,EAAY;AAAA,UAAZ;AAAA,YACG,KAAKH;AAAA,YACL,WAAWI,EAAO;AAAA,YAClB,eAAe,CAACI,MAAU;AACtB,cAAAA,EAAM,cAAc,QAAQ,gBAAgB;AAAA,YAChD;AAAA,YACA,QAAQ,CAACA,MAAU;AACf,cAAAA,EAAM,cAAc,QAAQ,gBAAgB;AAAA,YAChD;AAAA,UAAA;AAAA,UACKD;AAAA,QAAA,CAEZ;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGb,GAEaE,IAASC,EAA2ClB,CAAe;AAChFiB,EAAO,cAAc;"}
|