@frontify/fondue-components 7.0.1 → 8.0.1
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-components10.js +1 -1
- package/dist/fondue-components11.js +65 -75
- package/dist/fondue-components11.js.map +1 -1
- package/dist/fondue-components12.js +1 -1
- package/dist/fondue-components14.js +1 -1
- package/dist/fondue-components15.js +1 -1
- package/dist/fondue-components16.js +1 -1
- package/dist/fondue-components17.js +2 -2
- package/dist/fondue-components18.js +6 -6
- package/dist/fondue-components19.js +1 -1
- package/dist/fondue-components20.js +1 -1
- package/dist/fondue-components21.js +46 -46
- package/dist/fondue-components21.js.map +1 -1
- package/dist/fondue-components22.js +3 -3
- package/dist/fondue-components23.js +1 -1
- package/dist/fondue-components24.js +1 -1
- package/dist/fondue-components25.js +8 -8
- package/dist/fondue-components25.js.map +1 -1
- package/dist/fondue-components28.js +1 -1
- package/dist/fondue-components31.js +1 -1
- package/dist/fondue-components33.js +1 -1
- package/dist/fondue-components37.js +10 -25
- package/dist/fondue-components37.js.map +1 -1
- package/dist/fondue-components40.js +17 -14
- package/dist/fondue-components40.js.map +1 -1
- package/dist/fondue-components41.js +17 -18
- package/dist/fondue-components41.js.map +1 -1
- package/dist/fondue-components42.js +4 -16
- package/dist/fondue-components42.js.map +1 -1
- package/dist/fondue-components43.js +13 -3
- package/dist/fondue-components43.js.map +1 -1
- package/dist/fondue-components44.js +3 -13
- package/dist/fondue-components44.js.map +1 -1
- package/dist/fondue-components45.js +35 -5
- package/dist/fondue-components45.js.map +1 -1
- package/dist/fondue-components46.js +13 -35
- package/dist/fondue-components46.js.map +1 -1
- package/dist/fondue-components47.js +4 -12
- package/dist/fondue-components47.js.map +1 -1
- package/dist/fondue-components48.js +24 -4
- package/dist/fondue-components48.js.map +1 -1
- package/dist/fondue-components49.js +16 -24
- package/dist/fondue-components49.js.map +1 -1
- package/dist/fondue-components50.js +139 -16
- package/dist/fondue-components50.js.map +1 -1
- package/dist/fondue-components51.js +16 -140
- package/dist/fondue-components51.js.map +1 -1
- package/dist/fondue-components52.js +70 -16
- package/dist/fondue-components52.js.map +1 -1
- package/dist/fondue-components53.js +8 -72
- package/dist/fondue-components53.js.map +1 -1
- package/dist/fondue-components54.js +33 -8
- package/dist/fondue-components54.js.map +1 -1
- package/dist/fondue-components55.js +48 -32
- package/dist/fondue-components55.js.map +1 -1
- package/dist/fondue-components56.js +10 -48
- package/dist/fondue-components56.js.map +1 -1
- package/dist/fondue-components57.js +10 -8
- package/dist/fondue-components57.js.map +1 -1
- package/dist/fondue-components58.js +7 -12
- package/dist/fondue-components58.js.map +1 -1
- package/dist/fondue-components59.js +12 -7
- package/dist/fondue-components59.js.map +1 -1
- package/dist/fondue-components60.js +20 -12
- package/dist/fondue-components60.js.map +1 -1
- package/dist/fondue-components61.js +15 -19
- package/dist/fondue-components61.js.map +1 -1
- package/dist/fondue-components62.js +52 -14
- package/dist/fondue-components62.js.map +1 -1
- package/dist/fondue-components63.js +14 -52
- package/dist/fondue-components63.js.map +1 -1
- package/dist/fondue-components64.js +17 -14
- package/dist/fondue-components64.js.map +1 -1
- package/dist/fondue-components65.js +6 -17
- package/dist/fondue-components65.js.map +1 -1
- package/dist/fondue-components66.js +2 -7
- package/dist/fondue-components66.js.map +1 -1
- package/dist/fondue-components67.js +15 -2
- package/dist/fondue-components67.js.map +1 -1
- package/dist/fondue-components68.js +1 -1
- package/dist/fondue-components9.js +91 -101
- package/dist/fondue-components9.js.map +1 -1
- package/dist/index.d.ts +6 -8
- package/dist/style.css +1 -1
- package/package.json +3 -3
- package/dist/fondue-components69.js +0 -18
- package/dist/fondue-components69.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components63.js","sources":[
|
|
1
|
+
{"version":3,"file":"fondue-components63.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
const
|
|
2
|
-
root:
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
const s = "_root_1s6a3_5", o = "_input_1s6a3_59", t = "_slot_1s6a3_82", _ = "_iconSuccess_1s6a3_132", n = "_iconError_1s6a3_140", c = "_loadingStatus_1s6a3_148", a = "_spin_1s6a3_1", i = {
|
|
2
|
+
root: s,
|
|
3
|
+
input: o,
|
|
4
|
+
slot: t,
|
|
5
|
+
iconSuccess: _,
|
|
6
|
+
iconError: n,
|
|
7
|
+
loadingStatus: c,
|
|
8
|
+
spin: a,
|
|
9
|
+
"tw-dark": "_tw-dark_1s6a3_180"
|
|
8
10
|
};
|
|
9
11
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
i as default,
|
|
13
|
+
n as iconError,
|
|
14
|
+
_ as iconSuccess,
|
|
15
|
+
o as input,
|
|
16
|
+
c as loadingStatus,
|
|
17
|
+
s as root,
|
|
18
|
+
t as slot,
|
|
19
|
+
a as spin
|
|
17
20
|
};
|
|
18
21
|
//# sourceMappingURL=fondue-components64.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components64.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fondue-components64.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
|
|
@@ -1,21 +1,10 @@
|
|
|
1
|
-
const
|
|
2
|
-
root:
|
|
3
|
-
|
|
4
|
-
slot: s,
|
|
5
|
-
iconSuccess: _,
|
|
6
|
-
iconError: n,
|
|
7
|
-
loadingStatus: c,
|
|
8
|
-
spin: i,
|
|
9
|
-
"tw-dark": "_tw-dark_y2kt3_176"
|
|
1
|
+
const o = "_root_18vgg_4", r = "_arrow_18vgg_22", t = {
|
|
2
|
+
root: o,
|
|
3
|
+
arrow: r
|
|
10
4
|
};
|
|
11
5
|
export {
|
|
12
|
-
r as
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
o as input,
|
|
16
|
-
c as loadingStatus,
|
|
17
|
-
t as root,
|
|
18
|
-
s as slot,
|
|
19
|
-
i as spin
|
|
6
|
+
r as arrow,
|
|
7
|
+
t as default,
|
|
8
|
+
o as root
|
|
20
9
|
};
|
|
21
10
|
//# sourceMappingURL=fondue-components65.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components65.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fondue-components65.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
const
|
|
2
|
-
root: o,
|
|
3
|
-
arrow: r
|
|
4
|
-
};
|
|
1
|
+
const t = "focus-visible:tw-outline has-[[data-show-focus-ring=true]]:tw-outline tw-outline-4 tw-outline-offset-2 tw-outline-blue focus-visible:tw-outline-blue";
|
|
5
2
|
export {
|
|
6
|
-
|
|
7
|
-
t as default,
|
|
8
|
-
o as root
|
|
3
|
+
t as FOCUS_OUTLINE
|
|
9
4
|
};
|
|
10
5
|
//# sourceMappingURL=fondue-components66.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components66.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fondue-components66.js","sources":["../src/utilities/focusStyle.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nexport const FOCUS_OUTLINE =\n 'focus-visible:tw-outline has-[[data-show-focus-ring=true]]:tw-outline tw-outline-4 tw-outline-offset-2 tw-outline-blue focus-visible:tw-outline-blue'; // second declaration of tw-outline-blue is to assure that in firefox the outline isn't overriden by a global definition of :-moz-focusring which is coming from tailwinds normalization styling\n"],"names":["FOCUS_OUTLINE"],"mappings":"AAEO,MAAMA,IACT;"}
|
|
@@ -1,5 +1,18 @@
|
|
|
1
|
-
const t = "
|
|
1
|
+
const o = "_root_8a8rm_5", t = "_button_8a8rm_56", c = "_colorIndicator_8a8rm_69", r = "_actions_8a8rm_75", a = "_clear_8a8rm_85", _ = "_caret_8a8rm_98", n = {
|
|
2
|
+
root: o,
|
|
3
|
+
button: t,
|
|
4
|
+
colorIndicator: c,
|
|
5
|
+
actions: r,
|
|
6
|
+
clear: a,
|
|
7
|
+
caret: _
|
|
8
|
+
};
|
|
2
9
|
export {
|
|
3
|
-
|
|
10
|
+
r as actions,
|
|
11
|
+
t as button,
|
|
12
|
+
_ as caret,
|
|
13
|
+
a as clear,
|
|
14
|
+
c as colorIndicator,
|
|
15
|
+
n as default,
|
|
16
|
+
o as root
|
|
4
17
|
};
|
|
5
18
|
//# sourceMappingURL=fondue-components67.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components67.js","sources":[
|
|
1
|
+
{"version":3,"file":"fondue-components67.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -1,139 +1,129 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { IconCaretRight as
|
|
1
|
+
import { jsx as e, jsxs as h } from "react/jsx-runtime";
|
|
2
|
+
import { IconCaretRight as F } from "@frontify/fondue-icons";
|
|
3
3
|
import * as n from "@radix-ui/react-dropdown-menu";
|
|
4
|
-
import { Slot as
|
|
5
|
-
import { forwardRef as s
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
import a from "./fondue-components42.js";
|
|
10
|
-
const b = ({
|
|
4
|
+
import { Slot as I } from "@radix-ui/react-slot";
|
|
5
|
+
import { forwardRef as s } from "react";
|
|
6
|
+
import { useProcessedChildren as w } from "./fondue-components40.js";
|
|
7
|
+
import a from "./fondue-components41.js";
|
|
8
|
+
const m = ({
|
|
11
9
|
children: o,
|
|
12
10
|
open: t,
|
|
13
11
|
onOpenChange: r,
|
|
14
|
-
"data-test-id":
|
|
15
|
-
}) => /* @__PURE__ */
|
|
16
|
-
|
|
17
|
-
const
|
|
12
|
+
"data-test-id": d = "fondue-dropdown"
|
|
13
|
+
}) => /* @__PURE__ */ e(n.Root, { open: t, onOpenChange: r, "data-test-id": d, children: o });
|
|
14
|
+
m.displayName = "Dropdown.Root";
|
|
15
|
+
const l = ({
|
|
18
16
|
asChild: o = !0,
|
|
19
17
|
children: t,
|
|
20
18
|
"data-test-id": r = "fondue-dropdown-trigger",
|
|
21
|
-
...
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
children: w
|
|
53
|
-
}
|
|
54
|
-
) });
|
|
55
|
-
};
|
|
56
|
-
R.displayName = "Dropdown.Content";
|
|
57
|
-
const N = ({ children: o, "data-test-id": t = "fondue-dropdown-group" }, r) => /* @__PURE__ */ d(n.Group, { className: a.group, "data-test-id": t, ref: r, children: o });
|
|
58
|
-
N.displayName = "Dropdown.Group";
|
|
59
|
-
const C = ({
|
|
19
|
+
...d
|
|
20
|
+
}, i) => /* @__PURE__ */ e(n.Trigger, { asChild: o, "data-test-id": r, ref: i, ...d, children: t });
|
|
21
|
+
l.displayName = "Dropdown.Trigger";
|
|
22
|
+
const g = ({
|
|
23
|
+
side: o = "bottom",
|
|
24
|
+
padding: t = "comfortable",
|
|
25
|
+
align: r = "start",
|
|
26
|
+
children: d,
|
|
27
|
+
preventTriggerFocusOnClose: i,
|
|
28
|
+
"data-test-id": p = "fondue-dropdown-content"
|
|
29
|
+
}, u) => /* @__PURE__ */ e(n.Portal, { children: /* @__PURE__ */ e(
|
|
30
|
+
n.Content,
|
|
31
|
+
{
|
|
32
|
+
align: r,
|
|
33
|
+
collisionPadding: 8,
|
|
34
|
+
sideOffset: 8,
|
|
35
|
+
side: o,
|
|
36
|
+
className: a.content,
|
|
37
|
+
"data-padding": t,
|
|
38
|
+
"data-test-id": p,
|
|
39
|
+
ref: u,
|
|
40
|
+
onCloseAutoFocus: (c) => {
|
|
41
|
+
i && c.preventDefault();
|
|
42
|
+
},
|
|
43
|
+
children: d
|
|
44
|
+
}
|
|
45
|
+
) });
|
|
46
|
+
g.displayName = "Dropdown.Content";
|
|
47
|
+
const f = ({ children: o, "data-test-id": t = "fondue-dropdown-group" }, r) => /* @__PURE__ */ e(n.Group, { className: a.group, "data-test-id": t, ref: r, children: o });
|
|
48
|
+
f.displayName = "Dropdown.Group";
|
|
49
|
+
const D = ({
|
|
60
50
|
children: o,
|
|
61
51
|
"data-test-id": t = "fondue-dropdown-submenu"
|
|
62
|
-
}) => /* @__PURE__ */
|
|
63
|
-
|
|
64
|
-
const
|
|
65
|
-
const { content:
|
|
66
|
-
return /* @__PURE__ */
|
|
67
|
-
|
|
68
|
-
/* @__PURE__ */
|
|
52
|
+
}) => /* @__PURE__ */ e(n.Sub, { "data-test-id": t, children: o });
|
|
53
|
+
D.displayName = "Dropdown.SubMenu";
|
|
54
|
+
const b = ({ children: o, "data-test-id": t = "fondue-dropdown-subtrigger" }, r) => {
|
|
55
|
+
const { content: d } = w(o);
|
|
56
|
+
return /* @__PURE__ */ h(n.SubTrigger, { className: a.subTrigger, "data-test-id": t, ref: r, children: [
|
|
57
|
+
d,
|
|
58
|
+
/* @__PURE__ */ e(F, { className: a.subMenuIndicator, size: 16 })
|
|
69
59
|
] });
|
|
70
60
|
};
|
|
71
|
-
|
|
72
|
-
const
|
|
61
|
+
b.displayName = "Dropdown.SubTrigger";
|
|
62
|
+
const S = ({
|
|
73
63
|
padding: o = "comfortable",
|
|
74
64
|
children: t,
|
|
75
65
|
"data-test-id": r = "fondue-dropdown-subcontent"
|
|
76
|
-
},
|
|
66
|
+
}, d) => /* @__PURE__ */ e(n.Portal, { children: /* @__PURE__ */ e(
|
|
77
67
|
n.SubContent,
|
|
78
68
|
{
|
|
79
69
|
className: a.subContent,
|
|
80
70
|
"data-padding": o,
|
|
81
71
|
"data-test-id": r,
|
|
82
|
-
ref:
|
|
72
|
+
ref: d,
|
|
83
73
|
children: t
|
|
84
74
|
}
|
|
85
75
|
) });
|
|
86
|
-
|
|
87
|
-
const
|
|
76
|
+
S.displayName = "Dropdown.SubContent";
|
|
77
|
+
const N = ({
|
|
88
78
|
children: o,
|
|
89
79
|
disabled: t,
|
|
90
80
|
textValue: r,
|
|
91
|
-
onSelect:
|
|
92
|
-
emphasis:
|
|
93
|
-
"data-test-id":
|
|
94
|
-
...
|
|
95
|
-
},
|
|
96
|
-
const { content:
|
|
97
|
-
return /* @__PURE__ */
|
|
81
|
+
onSelect: d,
|
|
82
|
+
emphasis: i = "default",
|
|
83
|
+
"data-test-id": p = "fondue-dropdown-subtrigger",
|
|
84
|
+
...u
|
|
85
|
+
}, c) => {
|
|
86
|
+
const { content: R, isLink: T } = w(o), y = T ? I : "div";
|
|
87
|
+
return /* @__PURE__ */ e(
|
|
98
88
|
n.Item,
|
|
99
89
|
{
|
|
100
|
-
onSelect:
|
|
90
|
+
onSelect: d,
|
|
101
91
|
className: a.item,
|
|
102
92
|
textValue: r,
|
|
103
|
-
"data-test-id":
|
|
104
|
-
"data-emphasis":
|
|
105
|
-
ref:
|
|
93
|
+
"data-test-id": p,
|
|
94
|
+
"data-emphasis": i,
|
|
95
|
+
ref: c,
|
|
106
96
|
disabled: t,
|
|
107
97
|
asChild: !0,
|
|
108
|
-
...
|
|
109
|
-
children: /* @__PURE__ */
|
|
98
|
+
...u,
|
|
99
|
+
children: /* @__PURE__ */ e(y, { children: R })
|
|
110
100
|
}
|
|
111
101
|
);
|
|
112
102
|
};
|
|
113
|
-
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
const
|
|
117
|
-
Root:
|
|
118
|
-
Trigger:
|
|
119
|
-
Content:
|
|
120
|
-
Group:
|
|
121
|
-
SubMenu:
|
|
122
|
-
SubTrigger:
|
|
123
|
-
SubContent:
|
|
124
|
-
Item:
|
|
125
|
-
Slot:
|
|
103
|
+
N.displayName = "Dropdown.Item";
|
|
104
|
+
const C = ({ children: o, name: t, "data-test-id": r = "fondue-dropdown-slot" }, d) => /* @__PURE__ */ e("div", { "data-name": t, className: a.slot, "data-test-id": r, ref: d, children: o });
|
|
105
|
+
C.displayName = "Dropdown.Slot";
|
|
106
|
+
const G = s(l), x = s(g), M = s(f), P = s(b), v = s(S), j = s(N), k = s(C), B = {
|
|
107
|
+
Root: m,
|
|
108
|
+
Trigger: G,
|
|
109
|
+
Content: x,
|
|
110
|
+
Group: M,
|
|
111
|
+
SubMenu: D,
|
|
112
|
+
SubTrigger: P,
|
|
113
|
+
SubContent: v,
|
|
114
|
+
Item: j,
|
|
115
|
+
Slot: k
|
|
126
116
|
};
|
|
127
117
|
export {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
118
|
+
B as Dropdown,
|
|
119
|
+
g as DropdownContent,
|
|
120
|
+
f as DropdownGroup,
|
|
121
|
+
N as DropdownItem,
|
|
122
|
+
m as DropdownRoot,
|
|
123
|
+
C as DropdownSlot,
|
|
124
|
+
S as DropdownSubContent,
|
|
125
|
+
D as DropdownSubMenu,
|
|
126
|
+
b as DropdownSubTrigger,
|
|
127
|
+
l as DropdownTrigger
|
|
138
128
|
};
|
|
139
129
|
//# sourceMappingURL=fondue-components9.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-components9.js","sources":["../src/components/Dropdown/Dropdown.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCaretRight } from '@frontify/fondue-icons';\nimport * as RadixDropdown from '@radix-ui/react-dropdown-menu';\nimport { Slot } from '@radix-ui/react-slot';\nimport { forwardRef, useRef, type ForwardedRef, type ReactNode } from 'react';\n\nimport { usePreventDropdownOverflow } from '#/hooks/usePreventDropdownOverflow';\nimport { syncRefs } from '#/utilities/domUtilities';\n\nimport { useProcessedChildren } from './hooks/useProcessedChildren';\nimport styles from './styles/dropdown.module.scss';\n\nexport type DropdownRootProps = {\n children?: ReactNode;\n /**\n * Controls the open state of the dropdown.\n */\n open?: boolean;\n /**\n * Callback that is called when the open state of the dropdown changes.\n */\n onOpenChange?: (open: boolean) => void;\n\n 'data-test-id'?: string;\n};\n\nexport const DropdownRoot = ({\n children,\n open,\n onOpenChange,\n\n 'data-test-id': dataTestId = 'fondue-dropdown',\n}: DropdownRootProps) => {\n return (\n <RadixDropdown.Root open={open} onOpenChange={onOpenChange} data-test-id={dataTestId}>\n {children}\n </RadixDropdown.Root>\n );\n};\nDropdownRoot.displayName = 'Dropdown.Root';\n\nexport type DropdownTriggerProps = {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n * @default true\n */\n asChild?: boolean;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const DropdownTrigger = (\n {\n asChild = true,\n children,\n 'data-test-id': dataTestId = 'fondue-dropdown-trigger',\n ...props\n }: DropdownTriggerProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => {\n return (\n <RadixDropdown.Trigger asChild={asChild} data-test-id={dataTestId} ref={ref} {...props}>\n {children}\n </RadixDropdown.Trigger>\n );\n};\nDropdownTrigger.displayName = 'Dropdown.Trigger';\n\nexport type DropdownContentProps = {\n children?: ReactNode;\n 'data-test-id'?: string;\n onOpen?: () => void;\n onClose?: () => void;\n /**\n * The vertical padding around each dropdown item.\n * @default \"comfortable\"\n */\n padding?: 'comfortable' | 'compact';\n /**\n * Defines the alignment of the dropdown.\n * @default \"start\"\n */\n align?: 'start' | 'center' | 'end';\n /**\n * Defines the preferred side of the dropdown. It will not be respected if there are collisions with the viewport.\n * @default \"bottom\"\n */\n side?: 'top' | 'right' | 'bottom' | 'left';\n /**\n * Prevents the focus from being set on the trigger when the dropdown is closed.\n */\n preventTriggerFocusOnClose?: boolean;\n};\n\nexport const DropdownContent = (\n {\n onOpen,\n onClose,\n side = 'bottom',\n padding = 'comfortable',\n align = 'start',\n children,\n preventTriggerFocusOnClose,\n 'data-test-id': dataTestId = 'fondue-dropdown-content',\n }: DropdownContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const localRef = useRef(null);\n const dropdownIsOpen = useRef(false);\n\n const { setMaxHeight } = usePreventDropdownOverflow(localRef);\n\n return (\n <RadixDropdown.Portal>\n <RadixDropdown.Content\n align={align}\n collisionPadding={8}\n sideOffset={8}\n side={side}\n className={styles.content}\n data-padding={padding}\n data-test-id={dataTestId}\n ref={localRef}\n onCloseAutoFocus={(event) => {\n if (preventTriggerFocusOnClose) {\n event.preventDefault();\n }\n syncRefs(localRef, ref);\n onClose && onClose();\n dropdownIsOpen.current = false;\n }}\n onFocus={() => {\n if (!dropdownIsOpen.current) {\n setMaxHeight();\n syncRefs(localRef, ref);\n onOpen && onOpen();\n dropdownIsOpen.current = true;\n }\n }}\n >\n {children}\n </RadixDropdown.Content>\n </RadixDropdown.Portal>\n );\n};\nDropdownContent.displayName = 'Dropdown.Content';\n\nexport type DropdownGroupProps = { children: ReactNode; 'data-test-id'?: string };\n\nexport const DropdownGroup = (\n { children, 'data-test-id': dataTestId = 'fondue-dropdown-group' }: DropdownGroupProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <RadixDropdown.Group className={styles.group} data-test-id={dataTestId} ref={ref}>\n {children}\n </RadixDropdown.Group>\n );\n};\nDropdownGroup.displayName = 'Dropdown.Group';\n\nexport type DropdownSubMenuProps = { children: ReactNode; 'data-test-id'?: string };\n\nexport const DropdownSubMenu = ({\n children,\n 'data-test-id': dataTestId = 'fondue-dropdown-submenu',\n}: DropdownSubMenuProps) => {\n return <RadixDropdown.Sub data-test-id={dataTestId}>{children}</RadixDropdown.Sub>;\n};\nDropdownSubMenu.displayName = 'Dropdown.SubMenu';\n\nexport type DropdownSubTriggerProps = { children: ReactNode; 'data-test-id'?: string };\n\nexport const DropdownSubTrigger = (\n { children, 'data-test-id': dataTestId = 'fondue-dropdown-subtrigger' }: DropdownSubTriggerProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const { content } = useProcessedChildren(children);\n return (\n <RadixDropdown.SubTrigger className={styles.subTrigger} data-test-id={dataTestId} ref={ref}>\n {content}\n <IconCaretRight className={styles.subMenuIndicator} size={16} />\n </RadixDropdown.SubTrigger>\n );\n};\nDropdownSubTrigger.displayName = 'Dropdown.SubTrigger';\n\nexport type DropdownSubContentProps = {\n /**\n * The vertical padding around each dropdown item.\n * @default \"comfortable\"\n */\n padding?: 'comfortable' | 'compact';\n children: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const DropdownSubContent = (\n {\n padding = 'comfortable',\n children,\n 'data-test-id': dataTestId = 'fondue-dropdown-subcontent',\n }: DropdownSubContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <RadixDropdown.Portal>\n <RadixDropdown.SubContent\n className={styles.subContent}\n data-padding={padding}\n data-test-id={dataTestId}\n ref={ref}\n >\n {children}\n </RadixDropdown.SubContent>\n </RadixDropdown.Portal>\n );\n};\nDropdownSubContent.displayName = 'Dropdown.SubContent';\n\nexport type DropdownItemProps = {\n children: ReactNode;\n /**\n * Disables the item.\n */\n disabled?: boolean;\n /**\n * The text value of the item that is passed to the onSelect callback.\n */\n textValue?: string;\n /**\n * The style of the item.\n * @default \"default\"\n */\n emphasis?: 'default' | 'danger';\n /**\n * Callback that is called when the item is selected.\n */\n onSelect?: (event: Event) => void;\n 'data-test-id'?: string;\n};\n\nexport const DropdownItem = (\n {\n children,\n disabled,\n textValue,\n onSelect,\n emphasis = 'default',\n 'data-test-id': dataTestId = 'fondue-dropdown-subtrigger',\n ...props\n }: DropdownItemProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const { content, isLink } = useProcessedChildren(children);\n\n const Wrapper = isLink ? Slot : 'div';\n\n return (\n <RadixDropdown.Item\n onSelect={onSelect}\n className={styles.item}\n textValue={textValue}\n data-test-id={dataTestId}\n data-emphasis={emphasis}\n ref={ref}\n disabled={disabled}\n asChild\n {...props}\n >\n <Wrapper>{content}</Wrapper>\n </RadixDropdown.Item>\n );\n};\nDropdownItem.displayName = 'Dropdown.Item';\n\nexport type DropdownSlotProps = { children: ReactNode; name?: 'left' | 'right'; 'data-test-id'?: string };\n\nexport const DropdownSlot = (\n { children, name, 'data-test-id': dataTestId = 'fondue-dropdown-slot' }: DropdownSlotProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-name={name} className={styles.slot} data-test-id={dataTestId} ref={ref}>\n {children}\n </div>\n );\n};\nDropdownSlot.displayName = 'Dropdown.Slot';\n\nconst ForwardedRefDropdownTrigger = forwardRef<HTMLButtonElement, DropdownTriggerProps>(DropdownTrigger);\nconst ForwardedRefDropdownContent = forwardRef<HTMLDivElement, DropdownContentProps>(DropdownContent);\nconst ForwardedRefDropdownGroup = forwardRef<HTMLDivElement, DropdownGroupProps>(DropdownGroup);\nconst ForwardedRefDropdownSubTrigger = forwardRef<HTMLDivElement, DropdownSubTriggerProps>(DropdownSubTrigger);\nconst ForwardedRefDropdownSubContent = forwardRef<HTMLDivElement, DropdownSubContentProps>(DropdownSubContent);\nconst ForwardedRefDropdownItem = forwardRef<HTMLDivElement, DropdownItemProps>(DropdownItem);\nconst ForwardedRefDropdownSlot = forwardRef<HTMLDivElement, DropdownSlotProps>(DropdownSlot);\n\nexport const Dropdown = {\n Root: DropdownRoot,\n Trigger: ForwardedRefDropdownTrigger,\n Content: ForwardedRefDropdownContent,\n Group: ForwardedRefDropdownGroup,\n SubMenu: DropdownSubMenu,\n SubTrigger: ForwardedRefDropdownSubTrigger,\n SubContent: ForwardedRefDropdownSubContent,\n Item: ForwardedRefDropdownItem,\n Slot: ForwardedRefDropdownSlot,\n};\n"],"names":["DropdownRoot","children","open","onOpenChange","dataTestId","jsx","RadixDropdown","DropdownTrigger","asChild","props","ref","DropdownContent","onOpen","onClose","side","padding","align","preventTriggerFocusOnClose","localRef","useRef","dropdownIsOpen","setMaxHeight","usePreventDropdownOverflow","styles","event","syncRefs","DropdownGroup","DropdownSubMenu","DropdownSubTrigger","content","useProcessedChildren","jsxs","IconCaretRight","DropdownSubContent","DropdownItem","disabled","textValue","onSelect","emphasis","isLink","Wrapper","Slot","DropdownSlot","name","ForwardedRefDropdownTrigger","forwardRef","ForwardedRefDropdownContent","ForwardedRefDropdownGroup","ForwardedRefDropdownSubTrigger","ForwardedRefDropdownSubContent","ForwardedRefDropdownItem","ForwardedRefDropdownSlot","Dropdown"],"mappings":";;;;;;;;;AA2BO,MAAMA,IAAe,CAAC;AAAA,EACzB,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC;AAAA,EAEA,gBAAgBC,IAAa;AACjC,MAEQ,gBAAAC,EAACC,EAAc,MAAd,EAAmB,MAAAJ,GAAY,cAAAC,GAA4B,gBAAcC,GACrE,UAAAH,GACL;AAGRD,EAAa,cAAc;AAYpB,MAAMO,IAAkB,CAC3B;AAAA,EACI,SAAAC,IAAU;AAAA,EACV,UAAAP;AAAA,EACA,gBAAgBG,IAAa;AAAA,EAC7B,GAAGK;AACP,GACAC,MAGI,gBAAAL,EAACC,EAAc,SAAd,EAAsB,SAAAE,GAAkB,gBAAcJ,GAAY,KAAAM,GAAW,GAAGD,GAC5E,UAAAR,EACL,CAAA;AAGRM,EAAgB,cAAc;AA4BvB,MAAMI,IAAkB,CAC3B;AAAA,EACI,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,SAAAC,IAAU;AAAA,EACV,OAAAC,IAAQ;AAAA,EACR,UAAAf;AA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xB,EAAE,UAAAzC,GAAU,MAAA0C,GAAM,gBAAgBvC,IAAa,uBAAuB,GACtEM,MAGI,gBAAAL,EAAC,OAAI,EAAA,aAAWsC,GAAM,WAAWpB,EAAO,MAAM,gBAAcnB,GAAY,KAAAM,GACnE,UAAAT,EACL,CAAA;AAGRyC,EAAa,cAAc;AAE3B,MAAME,IAA8BC,EAAoDtC,CAAe,GACjGuC,IAA8BD,EAAiDlC,CAAe,GAC9FoC,IAA4BF,EAA+CnB,CAAa,GACxFsB,IAAiCH,EAAoDjB,CAAkB,GACvGqB,IAAiCJ,EAAoDZ,CAAkB,GACvGiB,IAA2BL,EAA8CX,CAAY,GACrFiB,IAA2BN,EAA8CH,CAAY,GAE9EU,IAAW;AAAA,EACpB,MAAMpD;AAAA,EACN,SAAS4C;AAAA,EACT,SAASE;AAAA,EACT,OAAOC;AAAA,EACP,SAASpB;AAAA,EACT,YAAYqB;AAAA,EACZ,YAAYC;AAAA,EACZ,MAAMC;AAAA,EACN,MAAMC;AACV;"}
|
|
1
|
+
{"version":3,"file":"fondue-components9.js","sources":["../src/components/Dropdown/Dropdown.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCaretRight } from '@frontify/fondue-icons';\nimport * as RadixDropdown from '@radix-ui/react-dropdown-menu';\nimport { Slot } from '@radix-ui/react-slot';\nimport { forwardRef, type ForwardedRef, type ReactNode } from 'react';\n\nimport { useProcessedChildren } from './hooks/useProcessedChildren';\nimport styles from './styles/dropdown.module.scss';\n\nexport type DropdownRootProps = {\n children?: ReactNode;\n /**\n * Controls the open state of the dropdown.\n */\n open?: boolean;\n /**\n * Callback that is called when the open state of the dropdown changes.\n */\n onOpenChange?: (open: boolean) => void;\n\n 'data-test-id'?: string;\n};\n\nexport const DropdownRoot = ({\n children,\n open,\n onOpenChange,\n\n 'data-test-id': dataTestId = 'fondue-dropdown',\n}: DropdownRootProps) => {\n return (\n <RadixDropdown.Root open={open} onOpenChange={onOpenChange} data-test-id={dataTestId}>\n {children}\n </RadixDropdown.Root>\n );\n};\nDropdownRoot.displayName = 'Dropdown.Root';\n\nexport type DropdownTriggerProps = {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n * @default true\n */\n asChild?: boolean;\n children?: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const DropdownTrigger = (\n {\n asChild = true,\n children,\n 'data-test-id': dataTestId = 'fondue-dropdown-trigger',\n ...props\n }: DropdownTriggerProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => {\n return (\n <RadixDropdown.Trigger asChild={asChild} data-test-id={dataTestId} ref={ref} {...props}>\n {children}\n </RadixDropdown.Trigger>\n );\n};\nDropdownTrigger.displayName = 'Dropdown.Trigger';\n\nexport type DropdownContentProps = {\n children?: ReactNode;\n 'data-test-id'?: string;\n /**\n * The vertical padding around each dropdown item.\n * @default \"comfortable\"\n */\n padding?: 'comfortable' | 'compact';\n /**\n * Defines the alignment of the dropdown.\n * @default \"start\"\n */\n align?: 'start' | 'center' | 'end';\n /**\n * Defines the preferred side of the dropdown. It will not be respected if there are collisions with the viewport.\n * @default \"bottom\"\n */\n side?: 'top' | 'right' | 'bottom' | 'left';\n /**\n * Prevents the focus from being set on the trigger when the dropdown is closed.\n */\n preventTriggerFocusOnClose?: boolean;\n};\n\nexport const DropdownContent = (\n {\n side = 'bottom',\n padding = 'comfortable',\n align = 'start',\n children,\n preventTriggerFocusOnClose,\n 'data-test-id': dataTestId = 'fondue-dropdown-content',\n }: DropdownContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <RadixDropdown.Portal>\n <RadixDropdown.Content\n align={align}\n collisionPadding={8}\n sideOffset={8}\n side={side}\n className={styles.content}\n data-padding={padding}\n data-test-id={dataTestId}\n ref={ref}\n onCloseAutoFocus={(event) => {\n if (preventTriggerFocusOnClose) {\n event.preventDefault();\n }\n }}\n >\n {children}\n </RadixDropdown.Content>\n </RadixDropdown.Portal>\n );\n};\nDropdownContent.displayName = 'Dropdown.Content';\n\nexport type DropdownGroupProps = { children: ReactNode; 'data-test-id'?: string };\n\nexport const DropdownGroup = (\n { children, 'data-test-id': dataTestId = 'fondue-dropdown-group' }: DropdownGroupProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <RadixDropdown.Group className={styles.group} data-test-id={dataTestId} ref={ref}>\n {children}\n </RadixDropdown.Group>\n );\n};\nDropdownGroup.displayName = 'Dropdown.Group';\n\nexport type DropdownSubMenuProps = { children: ReactNode; 'data-test-id'?: string };\n\nexport const DropdownSubMenu = ({\n children,\n 'data-test-id': dataTestId = 'fondue-dropdown-submenu',\n}: DropdownSubMenuProps) => {\n return <RadixDropdown.Sub data-test-id={dataTestId}>{children}</RadixDropdown.Sub>;\n};\nDropdownSubMenu.displayName = 'Dropdown.SubMenu';\n\nexport type DropdownSubTriggerProps = { children: ReactNode; 'data-test-id'?: string };\n\nexport const DropdownSubTrigger = (\n { children, 'data-test-id': dataTestId = 'fondue-dropdown-subtrigger' }: DropdownSubTriggerProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const { content } = useProcessedChildren(children);\n return (\n <RadixDropdown.SubTrigger className={styles.subTrigger} data-test-id={dataTestId} ref={ref}>\n {content}\n <IconCaretRight className={styles.subMenuIndicator} size={16} />\n </RadixDropdown.SubTrigger>\n );\n};\nDropdownSubTrigger.displayName = 'Dropdown.SubTrigger';\n\nexport type DropdownSubContentProps = {\n /**\n * The vertical padding around each dropdown item.\n * @default \"comfortable\"\n */\n padding?: 'comfortable' | 'compact';\n children: ReactNode;\n 'data-test-id'?: string;\n};\n\nexport const DropdownSubContent = (\n {\n padding = 'comfortable',\n children,\n 'data-test-id': dataTestId = 'fondue-dropdown-subcontent',\n }: DropdownSubContentProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <RadixDropdown.Portal>\n <RadixDropdown.SubContent\n className={styles.subContent}\n data-padding={padding}\n data-test-id={dataTestId}\n ref={ref}\n >\n {children}\n </RadixDropdown.SubContent>\n </RadixDropdown.Portal>\n );\n};\nDropdownSubContent.displayName = 'Dropdown.SubContent';\n\nexport type DropdownItemProps = {\n children: ReactNode;\n /**\n * Disables the item.\n */\n disabled?: boolean;\n /**\n * The text value of the item that is passed to the onSelect callback.\n */\n textValue?: string;\n /**\n * The style of the item.\n * @default \"default\"\n */\n emphasis?: 'default' | 'danger';\n /**\n * Callback that is called when the item is selected.\n */\n onSelect?: (event: Event) => void;\n 'data-test-id'?: string;\n};\n\nexport const DropdownItem = (\n {\n children,\n disabled,\n textValue,\n onSelect,\n emphasis = 'default',\n 'data-test-id': dataTestId = 'fondue-dropdown-subtrigger',\n ...props\n }: DropdownItemProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const { content, isLink } = useProcessedChildren(children);\n\n const Wrapper = isLink ? Slot : 'div';\n\n return (\n <RadixDropdown.Item\n onSelect={onSelect}\n className={styles.item}\n textValue={textValue}\n data-test-id={dataTestId}\n data-emphasis={emphasis}\n ref={ref}\n disabled={disabled}\n asChild\n {...props}\n >\n <Wrapper>{content}</Wrapper>\n </RadixDropdown.Item>\n );\n};\nDropdownItem.displayName = 'Dropdown.Item';\n\nexport type DropdownSlotProps = { children: ReactNode; name?: 'left' | 'right'; 'data-test-id'?: string };\n\nexport const DropdownSlot = (\n { children, name, 'data-test-id': dataTestId = 'fondue-dropdown-slot' }: DropdownSlotProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div data-name={name} className={styles.slot} data-test-id={dataTestId} ref={ref}>\n {children}\n </div>\n );\n};\nDropdownSlot.displayName = 'Dropdown.Slot';\n\nconst ForwardedRefDropdownTrigger = forwardRef<HTMLButtonElement, DropdownTriggerProps>(DropdownTrigger);\nconst ForwardedRefDropdownContent = forwardRef<HTMLDivElement, DropdownContentProps>(DropdownContent);\nconst ForwardedRefDropdownGroup = forwardRef<HTMLDivElement, DropdownGroupProps>(DropdownGroup);\nconst ForwardedRefDropdownSubTrigger = forwardRef<HTMLDivElement, DropdownSubTriggerProps>(DropdownSubTrigger);\nconst ForwardedRefDropdownSubContent = forwardRef<HTMLDivElement, DropdownSubContentProps>(DropdownSubContent);\nconst ForwardedRefDropdownItem = forwardRef<HTMLDivElement, DropdownItemProps>(DropdownItem);\nconst ForwardedRefDropdownSlot = forwardRef<HTMLDivElement, DropdownSlotProps>(DropdownSlot);\n\nexport const Dropdown = {\n Root: DropdownRoot,\n Trigger: ForwardedRefDropdownTrigger,\n Content: ForwardedRefDropdownContent,\n Group: ForwardedRefDropdownGroup,\n SubMenu: DropdownSubMenu,\n SubTrigger: ForwardedRefDropdownSubTrigger,\n SubContent: ForwardedRefDropdownSubContent,\n Item: ForwardedRefDropdownItem,\n Slot: ForwardedRefDropdownSlot,\n};\n"],"names":["DropdownRoot","children","open","onOpenChange","dataTestId","jsx","RadixDropdown","DropdownTrigger","asChild","props","ref","DropdownContent","side","padding","align","preventTriggerFocusOnClose","styles","event","DropdownGroup","DropdownSubMenu","DropdownSubTrigger","content","useProcessedChildren","jsxs","IconCaretRight","DropdownSubContent","DropdownItem","disabled","textValue","onSelect","emphasis","isLink","Wrapper","Slot","DropdownSlot","name","ForwardedRefDropdownTrigger","forwardRef","ForwardedRefDropdownContent","ForwardedRefDropdownGroup","ForwardedRefDropdownSubTrigger","ForwardedRefDropdownSubContent","ForwardedRefDropdownItem","ForwardedRefDropdownSlot","Dropdown"],"mappings":";;;;;;;AAwBO,MAAMA,IAAe,CAAC;AAAA,EACzB,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,cAAAC;AAAA,EAEA,gBAAgBC,IAAa;AACjC,MAEQ,gBAAAC,EAACC,EAAc,MAAd,EAAmB,MAAAJ,GAAY,cAAAC,GAA4B,gBAAcC,GACrE,UAAAH,GACL;AAGRD,EAAa,cAAc;AAYpB,MAAMO,IAAkB,CAC3B;AAAA,EACI,SAAAC,IAAU;AAAA,EACV,UAAAP;AAAA,EACA,gBAAgBG,IAAa;AAAA,EAC7B,GAAGK;AACP,GACAC,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,gBAAAL,EAAC,OAAI,EAAA,aAAW8B,GAAM,WAAWnB,EAAO,MAAM,gBAAcZ,GAAY,KAAAM,GACnE,UAAAT,EACL,CAAA;AAGRiC,EAAa,cAAc;AAE3B,MAAME,IAA8BC,EAAoD9B,CAAe,GACjG+B,IAA8BD,EAAiD1B,CAAe,GAC9F4B,IAA4BF,EAA+CnB,CAAa,GACxFsB,IAAiCH,EAAoDjB,CAAkB,GACvGqB,IAAiCJ,EAAoDZ,CAAkB,GACvGiB,IAA2BL,EAA8CX,CAAY,GACrFiB,IAA2BN,EAA8CH,CAAY,GAE9EU,IAAW;AAAA,EACpB,MAAM5C;AAAA,EACN,SAASoC;AAAA,EACT,SAASE;AAAA,EACT,OAAOC;AAAA,EACP,SAASpB;AAAA,EACT,YAAYqB;AAAA,EACZ,YAAYC;AAAA,EACZ,MAAMC;AAAA,EACN,MAAMC;AACV;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -510,8 +510,6 @@ export declare const Dropdown: {
|
|
|
510
510
|
declare type DropdownContentProps = {
|
|
511
511
|
children?: ReactNode;
|
|
512
512
|
'data-test-id'?: string;
|
|
513
|
-
onOpen?: () => void;
|
|
514
|
-
onClose?: () => void;
|
|
515
513
|
/**
|
|
516
514
|
* The vertical padding around each dropdown item.
|
|
517
515
|
* @default "comfortable"
|
|
@@ -932,19 +930,19 @@ declare type LayoutComponentProps = {
|
|
|
932
930
|
/**
|
|
933
931
|
* The top property of the component.
|
|
934
932
|
*/
|
|
935
|
-
top?: Responsive<
|
|
933
|
+
top?: Responsive<SpacingValue>;
|
|
936
934
|
/**
|
|
937
935
|
* The right property of the component.
|
|
938
936
|
*/
|
|
939
|
-
right?: Responsive<
|
|
937
|
+
right?: Responsive<SpacingValue>;
|
|
940
938
|
/**
|
|
941
939
|
* The bottom property of the component.
|
|
942
940
|
*/
|
|
943
|
-
bottom?: Responsive<
|
|
941
|
+
bottom?: Responsive<SpacingValue>;
|
|
944
942
|
/**
|
|
945
943
|
* The left property of the component.
|
|
946
944
|
*/
|
|
947
|
-
left?: Responsive<
|
|
945
|
+
left?: Responsive<SpacingValue>;
|
|
948
946
|
};
|
|
949
947
|
|
|
950
948
|
export declare const LoadingBar: ForwardRefExoticComponent<LoadingBarProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -1218,7 +1216,7 @@ declare type SelectSlotProps = {
|
|
|
1218
1216
|
'data-test-id'?: string;
|
|
1219
1217
|
};
|
|
1220
1218
|
|
|
1221
|
-
declare type SizeValue =
|
|
1219
|
+
declare type SizeValue = SpacingValue | 'auto' | 'fit-content' | 'intrinsic' | 'max-content' | 'min-content';
|
|
1222
1220
|
|
|
1223
1221
|
export declare const Slider: ForwardRefExoticComponent<SliderProps & RefAttributes<HTMLButtonElement>>;
|
|
1224
1222
|
|
|
@@ -1268,7 +1266,7 @@ declare type SliderProps = {
|
|
|
1268
1266
|
|
|
1269
1267
|
declare type SortDirection = 'ascending' | 'descending' | undefined;
|
|
1270
1268
|
|
|
1271
|
-
declare type SpacingValue = (string & {}) | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 16 | 20 | 24 | 32 | 40 | 48 | 56 | 64;
|
|
1269
|
+
declare type SpacingValue = (string & {}) | (number & {}) | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 16 | 20 | 24 | 32 | 40 | 48 | 56 | 64;
|
|
1272
1270
|
|
|
1273
1271
|
export declare const Switch: ForwardRefExoticComponent<SwitchProps & RefAttributes<HTMLButtonElement>>;
|
|
1274
1272
|
|