@webstudio-is/sdk-components-react-radix 0.218.0 → 0.220.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/lib/__generated__/accordion.props.js +9 -906
- package/lib/__generated__/checkbox.props.js +5 -403
- package/lib/__generated__/collapsible.props.js +7 -344
- package/lib/__generated__/dialog.props.js +10 -915
- package/lib/__generated__/label.props.js +2 -183
- package/lib/__generated__/navigation-menu.props.js +13 -1294
- package/lib/__generated__/popover.props.js +7 -175
- package/lib/__generated__/radio-group.props.js +14 -561
- package/lib/__generated__/select.props.js +38 -1273
- package/lib/__generated__/switch.props.js +5 -403
- package/lib/__generated__/tabs.props.js +12 -732
- package/lib/__generated__/tooltip.props.js +6 -175
- package/lib/accordion.js +4 -4
- package/lib/accordion.template.js +12 -12
- package/lib/accordion.ws.js +29 -43
- package/lib/checkbox.js +19 -4
- package/lib/checkbox.template.js +9 -9
- package/lib/checkbox.ws.js +5 -9
- package/lib/collapsible.js +3 -3
- package/lib/collapsible.ws.js +8 -21
- package/lib/components.js +46 -45
- package/lib/dialog.template.js +19 -19
- package/lib/dialog.ws.js +41 -69
- package/lib/label.template.js +3 -3
- package/lib/label.ws.js +9 -11
- package/lib/metas.js +45 -44
- package/lib/navigation-menu.template.js +8 -8
- package/lib/navigation-menu.ws.js +21 -35
- package/lib/popover.js +17 -16
- package/lib/popover.template.js +50 -20
- package/lib/popover.ws.js +37 -27
- package/lib/radio-group.js +14 -7
- package/lib/radio-group.ws.js +25 -31
- package/lib/select.js +4 -6
- package/lib/select.ws.js +34 -64
- package/lib/shared/theme.js +25 -68
- package/lib/sheet.template.js +20 -20
- package/lib/switch.js +19 -4
- package/lib/switch.template.js +9 -9
- package/lib/switch.ws.js +15 -19
- package/lib/tabs.js +4 -4
- package/lib/tabs.template.js +15 -15
- package/lib/tabs.ws.js +16 -30
- package/lib/tooltip.ws.js +16 -24
- package/lib/types/__generated__/popover.props.d.ts +1 -0
- package/lib/types/accordion.ws.d.ts +1 -6
- package/lib/types/checkbox.ws.d.ts +1 -3
- package/lib/types/collapsible.ws.d.ts +1 -4
- package/lib/types/components.d.ts +1 -1
- package/lib/types/dialog.ws.d.ts +1 -8
- package/lib/types/label.ws.d.ts +1 -2
- package/lib/types/metas.d.ts +1 -1
- package/lib/types/navigation-menu.ws.d.ts +1 -8
- package/lib/types/popover.d.ts +1 -0
- package/lib/types/popover.ws.d.ts +2 -4
- package/lib/types/radio-group.ws.d.ts +1 -4
- package/lib/types/select.d.ts +3 -3
- package/lib/types/select.ws.d.ts +1 -9
- package/lib/types/switch.ws.d.ts +1 -3
- package/lib/types/tabs.ws.d.ts +1 -5
- package/lib/types/tooltip.ws.d.ts +1 -4
- package/package.json +21 -26
- package/lib/props.js +0 -62
- package/lib/types/props.d.ts +0 -12
package/lib/shared/theme.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
const
|
|
1
|
+
const n = {
|
|
2
2
|
sm: "0.875rem",
|
|
3
3
|
lg: "1.125rem"
|
|
4
4
|
}, t = {
|
|
5
|
-
sm: "1.25rem"
|
|
6
|
-
|
|
7
|
-
}, p = {
|
|
5
|
+
sm: "1.25rem"
|
|
6
|
+
}, g = {
|
|
8
7
|
none: "1",
|
|
9
8
|
snug: "1.375"
|
|
10
9
|
}, s = {
|
|
11
10
|
medium: "500"
|
|
12
|
-
},
|
|
11
|
+
}, c = {
|
|
13
12
|
tight: "-0.025em"
|
|
14
13
|
}, m = {
|
|
15
14
|
0: "0px",
|
|
@@ -47,34 +46,22 @@ const o = {
|
|
|
47
46
|
"1.5": "0.375rem",
|
|
48
47
|
"2.5": "0.625rem",
|
|
49
48
|
"3.5": "0.875rem"
|
|
50
|
-
},
|
|
51
|
-
...m,
|
|
52
|
-
full: "100%"
|
|
53
|
-
}, x = {
|
|
49
|
+
}, p = {
|
|
54
50
|
...m,
|
|
55
51
|
full: "100%"
|
|
56
52
|
}, i = {
|
|
57
|
-
|
|
58
|
-
xs: "20rem",
|
|
59
|
-
sm: "24rem",
|
|
60
|
-
md: "28rem",
|
|
61
|
-
lg: "32rem",
|
|
62
|
-
xl: "36rem",
|
|
63
|
-
prose: "65ch"
|
|
53
|
+
...m
|
|
64
54
|
}, b = {
|
|
65
|
-
|
|
55
|
+
sm: "24rem",
|
|
56
|
+
lg: "32rem"
|
|
57
|
+
}, x = {
|
|
66
58
|
2: "2px",
|
|
67
|
-
4: "4px",
|
|
68
|
-
8: "8px",
|
|
69
59
|
DEFAULT: "1px"
|
|
70
60
|
}, d = {
|
|
71
61
|
sm: "0.125rem",
|
|
72
62
|
md: "0.375rem",
|
|
73
63
|
full: "9999px"
|
|
74
64
|
}, r = {
|
|
75
|
-
transparent: "transparent",
|
|
76
|
-
current: "currentColor",
|
|
77
|
-
inherit: "inherit",
|
|
78
65
|
popover: "rgb(255, 255, 255)",
|
|
79
66
|
popoverForeground: "rgb(2, 8, 23)",
|
|
80
67
|
border: "rgb(226, 232, 240)",
|
|
@@ -85,58 +72,28 @@ const o = {
|
|
|
85
72
|
muted: "hsl(210 40% 96.1%)",
|
|
86
73
|
primary: "rgb(15, 23, 42)",
|
|
87
74
|
primaryForeground: "hsl(210 40% 98%)",
|
|
88
|
-
destructive: "rgb(239, 68, 68)",
|
|
89
|
-
destructiveForeground: "rgb(248, 250, 252)",
|
|
90
75
|
accent: "rgb(241, 245, 249)",
|
|
91
76
|
accentForeground: "rgb(15, 23, 42)",
|
|
92
|
-
input: "rgb(226, 232, 240)"
|
|
93
|
-
|
|
94
|
-
secondaryForeground: "rgb(15, 23, 42)"
|
|
95
|
-
}, u = {
|
|
77
|
+
input: "rgb(226, 232, 240)"
|
|
78
|
+
}, l = {
|
|
96
79
|
all: "all 150ms cubic-bezier(0.4, 0, 0.2, 1)",
|
|
97
80
|
transform: "transform 150ms cubic-bezier(0.4, 0, 0.2, 1)"
|
|
98
|
-
},
|
|
99
|
-
0: "0",
|
|
100
|
-
5: "0.05",
|
|
101
|
-
10: "0.1",
|
|
102
|
-
20: "0.2",
|
|
103
|
-
25: "0.25",
|
|
104
|
-
30: "0.3",
|
|
105
|
-
40: "0.4",
|
|
81
|
+
}, u = {
|
|
106
82
|
50: "0.5",
|
|
107
|
-
60: "0.6",
|
|
108
83
|
70: "0.7",
|
|
109
|
-
75: "0.75",
|
|
110
|
-
80: "0.8",
|
|
111
|
-
90: "0.9",
|
|
112
|
-
95: "0.95",
|
|
113
84
|
100: "1"
|
|
114
|
-
},
|
|
115
|
-
|
|
116
|
-
1: "1px",
|
|
117
|
-
2: "2px",
|
|
118
|
-
4: "4px",
|
|
119
|
-
8: "8px",
|
|
120
|
-
DEFAULT: "3px"
|
|
85
|
+
}, o = {
|
|
86
|
+
2: "2px"
|
|
121
87
|
}, e = {
|
|
122
|
-
|
|
123
|
-
1: "1px",
|
|
124
|
-
2: "2px",
|
|
125
|
-
4: "4px",
|
|
126
|
-
8: "8px"
|
|
88
|
+
2: "2px"
|
|
127
89
|
}, a = {
|
|
128
90
|
sm: "0 1px 2px 0 rgb(0 0 0 / 0.05)",
|
|
129
91
|
md: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
|
|
130
92
|
lg: "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",
|
|
131
93
|
// 0 0 0 ringOffsetWidth ringOffsetColor
|
|
132
94
|
// 0 0 0 ringWidth + ringOffsetWidth ringColor
|
|
133
|
-
ring: `0 0 0 ${e[2]} ${r.background}, 0 0 0 calc(${
|
|
95
|
+
ring: `0 0 0 ${e[2]} ${r.background}, 0 0 0 calc(${o[2]} + ${e[2]}) ${r.ring}`
|
|
134
96
|
}, h = {
|
|
135
|
-
0: "0",
|
|
136
|
-
10: "10",
|
|
137
|
-
20: "20",
|
|
138
|
-
30: "30",
|
|
139
|
-
40: "40",
|
|
140
97
|
50: "50"
|
|
141
98
|
}, f = {
|
|
142
99
|
sm: "blur(0 1px 2px 0 rgb(0 0 0 / 0.05))"
|
|
@@ -144,19 +101,19 @@ const o = {
|
|
|
144
101
|
export {
|
|
145
102
|
f as blur,
|
|
146
103
|
d as borderRadius,
|
|
147
|
-
|
|
104
|
+
x as borderWidth,
|
|
148
105
|
a as boxShadow,
|
|
149
106
|
r as colors,
|
|
150
|
-
|
|
107
|
+
n as fontSize,
|
|
151
108
|
t as fontSizeLineHeight,
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
109
|
+
i as height,
|
|
110
|
+
c as letterSpacing,
|
|
111
|
+
g as lineHeight,
|
|
112
|
+
b as maxWidth,
|
|
113
|
+
u as opacity,
|
|
157
114
|
m as spacing,
|
|
158
|
-
|
|
115
|
+
l as transition,
|
|
159
116
|
s as weights,
|
|
160
|
-
|
|
117
|
+
p as width,
|
|
161
118
|
h as zIndex
|
|
162
119
|
};
|
package/lib/sheet.template.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { MenuIcon as s, LargeXIcon as b } from "@webstudio-is/icons/svg";
|
|
3
|
-
import { $ as o,
|
|
3
|
+
import { $ as o, PlaceholderValue as n, css as i } from "@webstudio-is/template";
|
|
4
4
|
import { radix as t } from "./shared/proxy.js";
|
|
5
|
-
import {
|
|
5
|
+
import { fontSize as d, lineHeight as p, letterSpacing as u, fontSizeLineHeight as w, colors as a, spacing as l, borderRadius as f, opacity as c, height as g, boxShadow as h, width as x, zIndex as m, borderWidth as $, maxWidth as y, blur as S } from "./shared/theme.js";
|
|
6
6
|
import { getButtonStyle as D } from "./shared/styles.js";
|
|
7
7
|
const B = {
|
|
8
8
|
category: "radix",
|
|
@@ -18,9 +18,9 @@ const B = {
|
|
|
18
18
|
"ws:style": i`
|
|
19
19
|
position: fixed;
|
|
20
20
|
inset: 0;
|
|
21
|
-
z-index: ${
|
|
21
|
+
z-index: ${m[50]};
|
|
22
22
|
background-color: rgb(255 255 255 / 0.8);
|
|
23
|
-
backdrop-filter: ${
|
|
23
|
+
backdrop-filter: ${S.sm};
|
|
24
24
|
/* To allow positioning Content */
|
|
25
25
|
display: flex;
|
|
26
26
|
flex-direction: column;
|
|
@@ -31,19 +31,19 @@ const B = {
|
|
|
31
31
|
{
|
|
32
32
|
"ws:label": "Sheet Content",
|
|
33
33
|
"ws:style": i`
|
|
34
|
-
width: ${
|
|
35
|
-
z-index: ${
|
|
34
|
+
width: ${x.full};
|
|
35
|
+
z-index: ${m[50]};
|
|
36
36
|
display: flex;
|
|
37
37
|
flex-direction: column;
|
|
38
38
|
gap: ${l[4]};
|
|
39
|
-
border: ${
|
|
39
|
+
border: ${$.DEFAULT} solid ${a.border};
|
|
40
40
|
background-color: ${a.background};
|
|
41
41
|
padding: ${l[6]};
|
|
42
|
-
box-shadow: ${
|
|
42
|
+
box-shadow: ${h.lg};
|
|
43
43
|
position: relative;
|
|
44
44
|
/* side=left */
|
|
45
45
|
margin-right: auto;
|
|
46
|
-
max-width: ${
|
|
46
|
+
max-width: ${y.sm};
|
|
47
47
|
flex-grow: 1;
|
|
48
48
|
`,
|
|
49
49
|
children: [
|
|
@@ -63,9 +63,9 @@ const B = {
|
|
|
63
63
|
{
|
|
64
64
|
"ws:label": "Sheet Title",
|
|
65
65
|
"ws:style": i`
|
|
66
|
-
font-size: ${
|
|
67
|
-
line-height: ${
|
|
68
|
-
letter-spacing: ${
|
|
66
|
+
font-size: ${d.lg};
|
|
67
|
+
line-height: ${p.none};
|
|
68
|
+
letter-spacing: ${u.tight};
|
|
69
69
|
margin: 0;
|
|
70
70
|
`,
|
|
71
71
|
children: new n("Sheet Title")
|
|
@@ -76,8 +76,8 @@ const B = {
|
|
|
76
76
|
{
|
|
77
77
|
"ws:label": "Sheet Description",
|
|
78
78
|
"ws:style": i`
|
|
79
|
-
font-size: ${
|
|
80
|
-
line-height: ${
|
|
79
|
+
font-size: ${d.sm};
|
|
80
|
+
line-height: ${w.sm};
|
|
81
81
|
color: ${a.mutedForeground};
|
|
82
82
|
margin: 0;
|
|
83
83
|
`,
|
|
@@ -97,21 +97,21 @@ const B = {
|
|
|
97
97
|
position: absolute;
|
|
98
98
|
right: ${l[4]};
|
|
99
99
|
top: ${l[4]};
|
|
100
|
-
border-radius: ${
|
|
101
|
-
opacity: ${
|
|
100
|
+
border-radius: ${f.sm};
|
|
101
|
+
opacity: ${c[70]};
|
|
102
102
|
display: flex;
|
|
103
103
|
align-items: center;
|
|
104
104
|
justify-content: center;
|
|
105
|
-
height: ${
|
|
106
|
-
width: ${
|
|
105
|
+
height: ${g[4]};
|
|
106
|
+
width: ${g[4]};
|
|
107
107
|
border: 0;
|
|
108
108
|
background-color: transparent;
|
|
109
109
|
outline: none;
|
|
110
110
|
&:hover {
|
|
111
|
-
opacity: ${
|
|
111
|
+
opacity: ${c[100]};
|
|
112
112
|
}
|
|
113
113
|
&:focus-visible {
|
|
114
|
-
box-shadow: ${
|
|
114
|
+
box-shadow: ${h.ring};
|
|
115
115
|
}
|
|
116
116
|
`,
|
|
117
117
|
children: /* @__PURE__ */ e(o.HtmlEmbed, { "ws:label": "Close Icon", code: b })
|
package/lib/switch.js
CHANGED
|
@@ -1,8 +1,23 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as f } from "react";
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import { Thumb as h, Root as a } from "@radix-ui/react-switch";
|
|
4
|
+
import { useControllableState as n } from "@radix-ui/react-use-controllable-state";
|
|
5
|
+
const d = f(({ defaultChecked: e, ...o }, t) => {
|
|
6
|
+
const [r, c] = n({
|
|
7
|
+
prop: o.checked ?? e ?? !1,
|
|
8
|
+
defaultProp: !1
|
|
9
|
+
});
|
|
10
|
+
return /* @__PURE__ */ m(
|
|
11
|
+
a,
|
|
12
|
+
{
|
|
13
|
+
...o,
|
|
14
|
+
ref: t,
|
|
15
|
+
checked: r,
|
|
16
|
+
onCheckedChange: c
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
}), u = h;
|
|
5
20
|
export {
|
|
6
21
|
d as Switch,
|
|
7
|
-
|
|
22
|
+
u as SwitchThumb
|
|
8
23
|
};
|
package/lib/switch.template.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { css as r } from "@webstudio-is/template";
|
|
3
3
|
import { radix as e } from "./shared/proxy.js";
|
|
4
|
-
import {
|
|
4
|
+
import { height as d, width as s, borderRadius as a, colors as t, boxShadow as i, transition as n, borderWidth as c, opacity as l } from "./shared/theme.js";
|
|
5
5
|
const m = {
|
|
6
6
|
category: "radix",
|
|
7
7
|
description: "A control that allows the user to toggle between checked and not checked.",
|
|
@@ -17,15 +17,15 @@ const m = {
|
|
|
17
17
|
cursor: pointer;
|
|
18
18
|
align-items: center;
|
|
19
19
|
border-radius: ${a.full};
|
|
20
|
-
border: ${
|
|
21
|
-
transition: ${
|
|
20
|
+
border: ${c[2]} solid transparent;
|
|
21
|
+
transition: ${n.all};
|
|
22
22
|
&:focus-visible {
|
|
23
23
|
outline: none;
|
|
24
|
-
box-shadow: ${
|
|
24
|
+
box-shadow: ${i.ring};
|
|
25
25
|
}
|
|
26
26
|
&:disabled {
|
|
27
27
|
cursor: not-allowed;
|
|
28
|
-
opacity: ${
|
|
28
|
+
opacity: ${l[50]};
|
|
29
29
|
}
|
|
30
30
|
&[data-state="checked"] {
|
|
31
31
|
background-color: ${t.primary};
|
|
@@ -40,12 +40,12 @@ const m = {
|
|
|
40
40
|
"ws:style": r`
|
|
41
41
|
pointer-events: none;
|
|
42
42
|
display: block;
|
|
43
|
-
height: ${
|
|
44
|
-
width: ${
|
|
43
|
+
height: ${d[5]};
|
|
44
|
+
width: ${s[5]};
|
|
45
45
|
border-radius: ${a.full};
|
|
46
46
|
background-color: ${t.background};
|
|
47
|
-
box-shadow: ${
|
|
48
|
-
transition: ${
|
|
47
|
+
box-shadow: ${i.lg};
|
|
48
|
+
transition: ${n.transform};
|
|
49
49
|
&[data-state="checked"] {
|
|
50
50
|
transform: translateX(20px);
|
|
51
51
|
}
|
package/lib/switch.ws.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { SwitchIcon as
|
|
2
|
-
import { defaultStates as
|
|
1
|
+
import { SwitchIcon as t, TriggerIcon as c } from "@webstudio-is/icons/svg";
|
|
2
|
+
import { defaultStates as e } from "@webstudio-is/sdk";
|
|
3
3
|
import { button as o, span as a } from "@webstudio-is/sdk/normalize.css";
|
|
4
|
-
import { radix as
|
|
5
|
-
import { buttonReset as
|
|
4
|
+
import { radix as n } from "./shared/meta.js";
|
|
5
|
+
import { buttonReset as s } from "./shared/preset-styles.js";
|
|
6
6
|
import { propsSwitch as r, propsSwitchThumb as i } from "./__generated__/switch.props.js";
|
|
7
7
|
const b = {
|
|
8
|
-
icon:
|
|
8
|
+
icon: t,
|
|
9
9
|
contentModel: {
|
|
10
10
|
category: "instance",
|
|
11
11
|
children: ["instance"],
|
|
12
|
-
descendants: [
|
|
12
|
+
descendants: [n.SwitchThumb]
|
|
13
13
|
},
|
|
14
14
|
states: [
|
|
15
|
-
...
|
|
15
|
+
...e,
|
|
16
16
|
{
|
|
17
17
|
label: "Checked",
|
|
18
18
|
selector: "[data-state=checked]",
|
|
@@ -25,16 +25,18 @@ const b = {
|
|
|
25
25
|
}
|
|
26
26
|
],
|
|
27
27
|
presetStyle: {
|
|
28
|
-
button: [o,
|
|
29
|
-
}
|
|
30
|
-
|
|
28
|
+
button: [o, s].flat()
|
|
29
|
+
},
|
|
30
|
+
initialProps: ["id", "class", "name", "value", "checked", "required"],
|
|
31
|
+
props: r
|
|
32
|
+
}, k = {
|
|
31
33
|
icon: c,
|
|
32
34
|
contentModel: {
|
|
33
35
|
category: "none",
|
|
34
36
|
children: ["instance"]
|
|
35
37
|
},
|
|
36
38
|
states: [
|
|
37
|
-
...
|
|
39
|
+
...e,
|
|
38
40
|
{
|
|
39
41
|
label: "Checked",
|
|
40
42
|
selector: "[data-state=checked]",
|
|
@@ -48,16 +50,10 @@ const b = {
|
|
|
48
50
|
],
|
|
49
51
|
presetStyle: {
|
|
50
52
|
span: a
|
|
51
|
-
}
|
|
52
|
-
}, k = {
|
|
53
|
-
props: r,
|
|
54
|
-
initialProps: ["id", "className", "name", "value", "checked", "required"]
|
|
55
|
-
}, f = {
|
|
53
|
+
},
|
|
56
54
|
props: i
|
|
57
55
|
};
|
|
58
56
|
export {
|
|
59
57
|
b as metaSwitch,
|
|
60
|
-
|
|
61
|
-
k as propsMetaSwitch,
|
|
62
|
-
f as propsMetaSwitchThumb
|
|
58
|
+
k as metaSwitchThumb
|
|
63
59
|
};
|
package/lib/tabs.js
CHANGED
|
@@ -2,13 +2,13 @@ import { jsx as i } from "react/jsx-runtime";
|
|
|
2
2
|
import u from "await-interaction-response";
|
|
3
3
|
import { forwardRef as c, useCallback as f } from "react";
|
|
4
4
|
import { useControllableState as b } from "@radix-ui/react-use-controllable-state";
|
|
5
|
-
import {
|
|
5
|
+
import { List as p, Root as T, Trigger as d, Content as h } from "@radix-ui/react-tabs";
|
|
6
6
|
import { getIndexWithinAncestorFromProps as g } from "@webstudio-is/sdk/runtime";
|
|
7
7
|
import { getClosestInstance as l } from "@webstudio-is/react-sdk/runtime";
|
|
8
8
|
const k = c(({ defaultValue: e, ...n }, o) => {
|
|
9
9
|
const [t, a] = b({
|
|
10
10
|
prop: n.value,
|
|
11
|
-
defaultProp: e,
|
|
11
|
+
defaultProp: e ?? "",
|
|
12
12
|
onChange: n.onValueChange
|
|
13
13
|
}), s = f(
|
|
14
14
|
async (m) => {
|
|
@@ -17,7 +17,7 @@ const k = c(({ defaultValue: e, ...n }, o) => {
|
|
|
17
17
|
[a]
|
|
18
18
|
);
|
|
19
19
|
return /* @__PURE__ */ i(
|
|
20
|
-
|
|
20
|
+
T,
|
|
21
21
|
{
|
|
22
22
|
ref: o,
|
|
23
23
|
...n,
|
|
@@ -25,7 +25,7 @@ const k = c(({ defaultValue: e, ...n }, o) => {
|
|
|
25
25
|
onValueChange: s
|
|
26
26
|
}
|
|
27
27
|
);
|
|
28
|
-
}), w =
|
|
28
|
+
}), w = p, y = c(({ value: e, ...n }, o) => {
|
|
29
29
|
const t = g(n);
|
|
30
30
|
return /* @__PURE__ */ i(d, { ref: o, value: e ?? t ?? "", ...n });
|
|
31
31
|
}), A = c(({ value: e, ...n }, o) => {
|
package/lib/tabs.template.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsxs as s, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { PlaceholderValue as o, css as a } from "@webstudio-is/template";
|
|
3
3
|
import { radix as e } from "./shared/proxy.js";
|
|
4
|
-
import { borderRadius as l,
|
|
4
|
+
import { height as g, borderRadius as l, colors as n, spacing as i, fontSize as h, fontSizeLineHeight as u, weights as b, transition as p, boxShadow as r, opacity as m } from "./shared/theme.js";
|
|
5
5
|
const d = a`
|
|
6
6
|
display: inline-flex;
|
|
7
7
|
align-items: center;
|
|
8
8
|
justify-content: center;
|
|
9
9
|
white-space: nowrap;
|
|
10
10
|
border-radius: ${l.md};
|
|
11
|
-
padding: ${
|
|
12
|
-
font-size: ${
|
|
13
|
-
line-height: ${
|
|
14
|
-
font-weight: ${
|
|
15
|
-
transition: ${
|
|
11
|
+
padding: ${i[1.5]} ${i[3]};
|
|
12
|
+
font-size: ${h.sm};
|
|
13
|
+
line-height: ${u.sm};
|
|
14
|
+
font-weight: ${b.medium};
|
|
15
|
+
transition: ${p.all};
|
|
16
16
|
&:focus-visible {
|
|
17
17
|
outline: 2px solid transparent;
|
|
18
18
|
outline-offset: 2px;
|
|
@@ -20,15 +20,15 @@ const d = a`
|
|
|
20
20
|
}
|
|
21
21
|
&:disabled {
|
|
22
22
|
pointer-events: none;
|
|
23
|
-
opacity: ${
|
|
23
|
+
opacity: ${m[50]};
|
|
24
24
|
}
|
|
25
25
|
&[data-state="active"] {
|
|
26
|
-
background-color: ${
|
|
27
|
-
color: ${
|
|
26
|
+
background-color: ${n.background};
|
|
27
|
+
color: ${n.foreground};
|
|
28
28
|
box-shadow: ${r.sm};
|
|
29
29
|
}
|
|
30
30
|
`, c = a`
|
|
31
|
-
margin-top: ${
|
|
31
|
+
margin-top: ${i[2]};
|
|
32
32
|
&:focus-visible {
|
|
33
33
|
outline: none;
|
|
34
34
|
box-shadow: ${r.ring};
|
|
@@ -43,13 +43,13 @@ const d = a`
|
|
|
43
43
|
{
|
|
44
44
|
"ws:style": a`
|
|
45
45
|
display: inline-flex;
|
|
46
|
-
height: ${
|
|
46
|
+
height: ${g[10]};
|
|
47
47
|
align-items: center;
|
|
48
48
|
justify-content: center;
|
|
49
49
|
border-radius: ${l.md};
|
|
50
|
-
background-color: ${
|
|
51
|
-
padding: ${
|
|
52
|
-
color: ${
|
|
50
|
+
background-color: ${n.muted};
|
|
51
|
+
padding: ${i[1]};
|
|
52
|
+
color: ${n.mutedForeground};
|
|
53
53
|
`,
|
|
54
54
|
children: [
|
|
55
55
|
/* @__PURE__ */ t(e.TabsTrigger, { "ws:style": d, children: new o("Account") }),
|
package/lib/tabs.ws.js
CHANGED
|
@@ -3,28 +3,26 @@ import { defaultStates as a } from "@webstudio-is/sdk";
|
|
|
3
3
|
import { div as e, button as c } from "@webstudio-is/sdk/normalize.css";
|
|
4
4
|
import { radix as t } from "./shared/meta.js";
|
|
5
5
|
import { buttonReset as i } from "./shared/preset-styles.js";
|
|
6
|
-
import { propsTabs as p, propsTabsList as b, propsTabsTrigger as
|
|
7
|
-
const
|
|
6
|
+
import { propsTabs as p, propsTabsList as b, propsTabsTrigger as l, propsTabsContent as T } from "./__generated__/tabs.props.js";
|
|
7
|
+
const x = {
|
|
8
8
|
icon: n,
|
|
9
9
|
contentModel: {
|
|
10
10
|
category: "instance",
|
|
11
11
|
children: ["instance"],
|
|
12
12
|
descendants: [t.TabsList, t.TabsContent]
|
|
13
13
|
},
|
|
14
|
-
presetStyle: {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}, x = {
|
|
14
|
+
presetStyle: { div: e },
|
|
15
|
+
props: p
|
|
16
|
+
}, C = {
|
|
18
17
|
icon: o,
|
|
19
18
|
contentModel: {
|
|
20
19
|
category: "none",
|
|
21
20
|
children: ["instance"],
|
|
22
21
|
descendants: [t.TabsTrigger]
|
|
23
22
|
},
|
|
24
|
-
presetStyle: {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}, C = {
|
|
23
|
+
presetStyle: { div: e },
|
|
24
|
+
props: b
|
|
25
|
+
}, S = {
|
|
28
26
|
icon: s,
|
|
29
27
|
label: "Tab Trigger",
|
|
30
28
|
indexWithinAncestor: t.Tabs,
|
|
@@ -42,8 +40,9 @@ const M = {
|
|
|
42
40
|
],
|
|
43
41
|
presetStyle: {
|
|
44
42
|
button: [c, i].flat()
|
|
45
|
-
}
|
|
46
|
-
|
|
43
|
+
},
|
|
44
|
+
props: l
|
|
45
|
+
}, u = {
|
|
47
46
|
label: "Tab Content",
|
|
48
47
|
icon: r,
|
|
49
48
|
indexWithinAncestor: t.Tabs,
|
|
@@ -51,25 +50,12 @@ const M = {
|
|
|
51
50
|
category: "none",
|
|
52
51
|
children: ["instance", "rich-text"]
|
|
53
52
|
},
|
|
54
|
-
presetStyle: {
|
|
55
|
-
div: e
|
|
56
|
-
}
|
|
57
|
-
}, u = {
|
|
58
|
-
props: p
|
|
59
|
-
}, I = {
|
|
60
|
-
props: b
|
|
61
|
-
}, L = {
|
|
53
|
+
presetStyle: { div: e },
|
|
62
54
|
props: T
|
|
63
|
-
}, v = {
|
|
64
|
-
props: l
|
|
65
55
|
};
|
|
66
56
|
export {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
u as propsMetaTabs,
|
|
72
|
-
v as propsMetaTabsContent,
|
|
73
|
-
I as propsMetaTabsList,
|
|
74
|
-
L as propsMetaTabsTrigger
|
|
57
|
+
x as metaTabs,
|
|
58
|
+
u as metaTabsContent,
|
|
59
|
+
C as metaTabsList,
|
|
60
|
+
S as metaTabsTrigger
|
|
75
61
|
};
|
package/lib/tooltip.ws.js
CHANGED
|
@@ -1,43 +1,35 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TooltipIcon as t, TriggerIcon as n, ContentIcon as e } from "@webstudio-is/icons/svg";
|
|
2
2
|
import { div as i } from "@webstudio-is/sdk/normalize.css";
|
|
3
3
|
import { radix as o } from "./shared/meta.js";
|
|
4
|
-
import { propsTooltip as r, propsTooltipTrigger as p, propsTooltipContent as
|
|
4
|
+
import { propsTooltip as r, propsTooltipTrigger as p, propsTooltipContent as c } from "./__generated__/tooltip.props.js";
|
|
5
5
|
const g = {
|
|
6
|
-
icon:
|
|
6
|
+
icon: n,
|
|
7
7
|
contentModel: {
|
|
8
8
|
category: "none",
|
|
9
9
|
children: ["instance"]
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
},
|
|
11
|
+
props: p
|
|
12
|
+
}, T = {
|
|
13
|
+
icon: e,
|
|
13
14
|
contentModel: {
|
|
14
15
|
category: "none",
|
|
15
16
|
children: ["instance"]
|
|
16
17
|
},
|
|
17
|
-
presetStyle: {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
presetStyle: { div: i },
|
|
19
|
+
initialProps: ["side", "sideOffset", "align", "alignOffset"],
|
|
20
|
+
props: c
|
|
20
21
|
}, m = {
|
|
21
|
-
icon:
|
|
22
|
+
icon: t,
|
|
22
23
|
contentModel: {
|
|
23
24
|
category: "instance",
|
|
24
25
|
children: ["instance"],
|
|
25
26
|
descendants: [o.TooltipTrigger, o.TooltipContent]
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
props: r
|
|
29
|
-
initialProps: ["open", "delayDuration", "disableHoverableContent"]
|
|
30
|
-
}, C = {
|
|
31
|
-
props: p
|
|
32
|
-
}, M = {
|
|
33
|
-
props: s,
|
|
34
|
-
initialProps: ["side", "sideOffset", "align", "alignOffset"]
|
|
27
|
+
},
|
|
28
|
+
initialProps: ["open", "delayDuration", "disableHoverableContent"],
|
|
29
|
+
props: r
|
|
35
30
|
};
|
|
36
31
|
export {
|
|
37
32
|
m as metaTooltip,
|
|
38
|
-
|
|
39
|
-
g as metaTooltipTrigger
|
|
40
|
-
f as propsMetaTooltip,
|
|
41
|
-
M as propsMetaTooltipContent,
|
|
42
|
-
C as propsMetaTooltipTrigger
|
|
33
|
+
T as metaTooltipContent,
|
|
34
|
+
g as metaTooltipTrigger
|
|
43
35
|
};
|
|
@@ -2,3 +2,4 @@ import type { PropMeta } from "@webstudio-is/sdk";
|
|
|
2
2
|
export declare const propsPopover: Record<string, PropMeta>;
|
|
3
3
|
export declare const propsPopoverTrigger: Record<string, PropMeta>;
|
|
4
4
|
export declare const propsPopoverContent: Record<string, PropMeta>;
|
|
5
|
+
export declare const propsPopoverClose: Record<string, PropMeta>;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import { type WsComponentMeta
|
|
1
|
+
import { type WsComponentMeta } from "@webstudio-is/sdk";
|
|
2
2
|
export declare const metaAccordion: WsComponentMeta;
|
|
3
3
|
export declare const metaAccordionItem: WsComponentMeta;
|
|
4
4
|
export declare const metaAccordionHeader: WsComponentMeta;
|
|
5
5
|
export declare const metaAccordionTrigger: WsComponentMeta;
|
|
6
6
|
export declare const metaAccordionContent: WsComponentMeta;
|
|
7
|
-
export declare const propsMetaAccordion: WsComponentPropsMeta;
|
|
8
|
-
export declare const propsMetaAccordionItem: WsComponentPropsMeta;
|
|
9
|
-
export declare const propsMetaAccordionHeader: WsComponentPropsMeta;
|
|
10
|
-
export declare const propsMetaAccordionTrigger: WsComponentPropsMeta;
|
|
11
|
-
export declare const propsMetaAccordionContent: WsComponentPropsMeta;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { type WsComponentMeta
|
|
1
|
+
import { type WsComponentMeta } from "@webstudio-is/sdk";
|
|
2
2
|
export declare const metaCheckbox: WsComponentMeta;
|
|
3
3
|
export declare const metaCheckboxIndicator: WsComponentMeta;
|
|
4
|
-
export declare const propsMetaCheckbox: WsComponentPropsMeta;
|
|
5
|
-
export declare const propsMetaCheckboxIndicator: WsComponentPropsMeta;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import type { WsComponentMeta
|
|
1
|
+
import type { WsComponentMeta } from "@webstudio-is/sdk";
|
|
2
2
|
export declare const metaCollapsible: WsComponentMeta;
|
|
3
3
|
export declare const metaCollapsibleTrigger: WsComponentMeta;
|
|
4
4
|
export declare const metaCollapsibleContent: WsComponentMeta;
|
|
5
|
-
export declare const propsMetaCollapsible: WsComponentPropsMeta;
|
|
6
|
-
export declare const propsMetaCollapsibleTrigger: WsComponentPropsMeta;
|
|
7
|
-
export declare const propsMetaCollapsibleContent: WsComponentPropsMeta;
|