@webstudio-is/sdk-components-react-radix 0.88.0 → 0.90.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 +605 -109
- package/lib/__generated__/button.props.js +161 -29
- package/lib/__generated__/checkbox.props.js +284 -51
- package/lib/__generated__/collapsible.props.js +234 -42
- package/lib/__generated__/dialog.props.js +611 -110
- package/lib/__generated__/input.props.js +264 -47
- package/lib/__generated__/label.props.js +123 -22
- package/lib/__generated__/navigation-menu.props.js +563 -102
- package/lib/__generated__/popover.props.js +129 -25
- package/lib/__generated__/radio-group.props.js +421 -76
- package/lib/__generated__/select.props.js +876 -160
- package/lib/__generated__/sheet.props.js +591 -110
- package/lib/__generated__/switch.props.js +284 -51
- package/lib/__generated__/tabs.props.js +506 -91
- package/lib/__generated__/textarea.props.js +177 -31
- package/lib/__generated__/tooltip.props.js +131 -27
- package/lib/accordion.ws.js +21 -9
- package/lib/checkbox.ws.js +2 -0
- package/lib/cjs/__generated__/accordion.props.js +605 -109
- package/lib/cjs/__generated__/button.props.js +161 -29
- package/lib/cjs/__generated__/checkbox.props.js +284 -51
- package/lib/cjs/__generated__/collapsible.props.js +234 -42
- package/lib/cjs/__generated__/dialog.props.js +611 -110
- package/lib/cjs/__generated__/input.props.js +264 -47
- package/lib/cjs/__generated__/label.props.js +123 -22
- package/lib/cjs/__generated__/navigation-menu.props.js +563 -102
- package/lib/cjs/__generated__/popover.props.js +129 -25
- package/lib/cjs/__generated__/radio-group.props.js +421 -76
- package/lib/cjs/__generated__/select.props.js +875 -159
- package/lib/cjs/__generated__/sheet.props.js +591 -110
- package/lib/cjs/__generated__/switch.props.js +284 -51
- package/lib/cjs/__generated__/tabs.props.js +506 -91
- package/lib/cjs/__generated__/textarea.props.js +177 -31
- package/lib/cjs/__generated__/tooltip.props.js +131 -27
- package/lib/cjs/accordion.ws.js +19 -9
- package/lib/cjs/checkbox.ws.js +2 -0
- package/lib/cjs/collapsible.ws.js +1 -0
- package/lib/cjs/dialog.ws.js +19 -5
- package/lib/cjs/label.ws.js +1 -0
- package/lib/cjs/navigation-menu.ws.js +1 -0
- package/lib/cjs/popover.ws.js +1 -0
- package/lib/cjs/props-descriptions.js +56 -0
- package/lib/cjs/radio-group.ws.js +3 -0
- package/lib/cjs/select.js +3 -1
- package/lib/cjs/select.ws.js +1 -0
- package/lib/cjs/sheet.ws.js +16 -1
- package/lib/cjs/switch.ws.js +2 -0
- package/lib/cjs/tabs.ws.js +12 -2
- package/lib/cjs/theme/styles.js +0 -4
- package/lib/cjs/tooltip.ws.js +1 -0
- package/lib/collapsible.ws.js +1 -0
- package/lib/dialog.ws.js +22 -7
- package/lib/label.ws.js +1 -0
- package/lib/navigation-menu.ws.js +1 -0
- package/lib/popover.ws.js +1 -0
- package/lib/props-descriptions.js +36 -0
- package/lib/radio-group.ws.js +3 -0
- package/lib/select.js +3 -1
- package/lib/select.ws.js +1 -0
- package/lib/sheet.ws.js +17 -2
- package/lib/switch.ws.js +2 -0
- package/lib/tabs.ws.js +14 -2
- package/lib/theme/styles.js +0 -4
- package/lib/tooltip.ws.js +1 -0
- package/lib/types/accordion.ws.d.ts +1 -1
- package/lib/types/props-descriptions.d.ts +29 -0
- package/lib/types/select.d.ts +4 -2
- package/lib/types/tabs.ws.d.ts +1 -1
- package/package.json +6 -6
- package/src/__generated__/accordion.props.ts +675 -103
- package/src/__generated__/button.props.ts +180 -27
- package/src/__generated__/checkbox.props.ts +317 -48
- package/src/__generated__/collapsible.props.ts +261 -40
- package/src/__generated__/dialog.props.ts +682 -104
- package/src/__generated__/input.props.ts +292 -44
- package/src/__generated__/label.props.ts +137 -21
- package/src/__generated__/navigation-menu.props.ts +629 -96
- package/src/__generated__/popover.props.ts +142 -21
- package/src/__generated__/radio-group.props.ts +470 -71
- package/src/__generated__/select.props.ts +979 -153
- package/src/__generated__/sheet.props.ts +657 -99
- package/src/__generated__/switch.props.ts +317 -48
- package/src/__generated__/tabs.props.ts +565 -86
- package/src/__generated__/textarea.props.ts +195 -30
- package/src/__generated__/tooltip.props.ts +145 -23
- package/src/accordion.ws.ts +22 -11
- package/src/checkbox.ws.ts +3 -0
- package/src/collapsible.ws.ts +2 -0
- package/src/dialog.ws.tsx +22 -7
- package/src/label.ws.ts +2 -0
- package/src/navigation-menu.ws.ts +1 -0
- package/src/popover.ws.tsx +1 -0
- package/src/props-descriptions.ts +43 -0
- package/src/radio-group.ws.ts +4 -0
- package/src/select.tsx +8 -3
- package/src/select.ws.ts +2 -0
- package/src/sheet.ws.tsx +18 -2
- package/src/switch.ws.ts +3 -0
- package/src/tabs.ws.ts +17 -6
- package/src/theme/styles.ts +0 -4
- package/src/tooltip.ws.tsx +2 -0
package/src/dialog.ws.tsx
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
HeadingIcon,
|
|
7
7
|
TextIcon,
|
|
8
8
|
ButtonElementIcon,
|
|
9
|
+
LargeXIcon,
|
|
9
10
|
} from "@webstudio-is/icons/svg";
|
|
10
11
|
import {
|
|
11
12
|
type PresetStyle,
|
|
@@ -23,16 +24,12 @@ import {
|
|
|
23
24
|
propsDialogTitle,
|
|
24
25
|
propsDialogDescription,
|
|
25
26
|
} from "./__generated__/dialog.props";
|
|
26
|
-
import { getButtonStyles } from "./theme/styles";
|
|
27
|
+
import { buttonReset, getButtonStyles } from "./theme/styles";
|
|
27
28
|
|
|
28
29
|
const presetStyle = {
|
|
29
30
|
div,
|
|
30
31
|
} satisfies PresetStyle<"div">;
|
|
31
32
|
|
|
32
|
-
const buttonPresetStyle = {
|
|
33
|
-
button,
|
|
34
|
-
} satisfies PresetStyle<"button">;
|
|
35
|
-
|
|
36
33
|
const titlePresetStyle = {
|
|
37
34
|
h2,
|
|
38
35
|
} satisfies PresetStyle<"h2">;
|
|
@@ -83,7 +80,9 @@ export const metaDialogDescription: WsComponentMeta = {
|
|
|
83
80
|
export const metaDialogClose: WsComponentMeta = {
|
|
84
81
|
category: "hidden",
|
|
85
82
|
type: "container",
|
|
86
|
-
presetStyle:
|
|
83
|
+
presetStyle: {
|
|
84
|
+
button: [buttonReset, button].flat(),
|
|
85
|
+
},
|
|
87
86
|
icon: ButtonElementIcon,
|
|
88
87
|
label: "Close Button",
|
|
89
88
|
};
|
|
@@ -102,6 +101,8 @@ export const metaDialog: WsComponentMeta = {
|
|
|
102
101
|
type: "container",
|
|
103
102
|
icon: DialogIcon,
|
|
104
103
|
stylable: false,
|
|
104
|
+
description:
|
|
105
|
+
"Displays content with an overlay that covers the window, triggered by a button. Clicking the overlay will close the dialog.",
|
|
105
106
|
template: [
|
|
106
107
|
{
|
|
107
108
|
type: "instance",
|
|
@@ -257,7 +258,21 @@ export const metaDialog: WsComponentMeta = {
|
|
|
257
258
|
tc.hover(tc.opacity(100)),
|
|
258
259
|
tc.focus(tc.ring("ring", 2, "background", 2)),
|
|
259
260
|
].flat(),
|
|
260
|
-
children: [
|
|
261
|
+
children: [
|
|
262
|
+
{
|
|
263
|
+
type: "instance",
|
|
264
|
+
component: "HtmlEmbed",
|
|
265
|
+
label: "Close Icon",
|
|
266
|
+
props: [
|
|
267
|
+
{
|
|
268
|
+
type: "string",
|
|
269
|
+
name: "code",
|
|
270
|
+
value: LargeXIcon,
|
|
271
|
+
},
|
|
272
|
+
],
|
|
273
|
+
children: [],
|
|
274
|
+
},
|
|
275
|
+
],
|
|
261
276
|
},
|
|
262
277
|
],
|
|
263
278
|
},
|
package/src/label.ws.ts
CHANGED
|
@@ -20,6 +20,8 @@ export const meta: WsComponentMeta = {
|
|
|
20
20
|
icon: LabelIcon,
|
|
21
21
|
presetStyle,
|
|
22
22
|
states: defaultStates,
|
|
23
|
+
description:
|
|
24
|
+
"An accessible label to describe the purpose of an input. Match the “For” property on the label with the “ID” of the input to connect them.",
|
|
23
25
|
template: [
|
|
24
26
|
{
|
|
25
27
|
type: "instance",
|
package/src/popover.ws.tsx
CHANGED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
const open =
|
|
2
|
+
"Show or hide the content of this component on the canvas. This will not affect the initial state of the component.";
|
|
3
|
+
|
|
4
|
+
const alignOffset =
|
|
5
|
+
"The offset in pixels from the “start“ or “end“ alignment options.";
|
|
6
|
+
|
|
7
|
+
const sideOffset =
|
|
8
|
+
"The distance in pixels between the Content and the Trigger.";
|
|
9
|
+
|
|
10
|
+
const side =
|
|
11
|
+
"The preferred alignment against the Trigger. May change when collisions occur.";
|
|
12
|
+
|
|
13
|
+
export const propsDescriptions = {
|
|
14
|
+
Dialog: {
|
|
15
|
+
open,
|
|
16
|
+
},
|
|
17
|
+
Sheet: {
|
|
18
|
+
open,
|
|
19
|
+
},
|
|
20
|
+
Collapsible: {
|
|
21
|
+
open,
|
|
22
|
+
},
|
|
23
|
+
Popover: {
|
|
24
|
+
open,
|
|
25
|
+
},
|
|
26
|
+
PopoverContent: {
|
|
27
|
+
alignOffset,
|
|
28
|
+
sideOffset,
|
|
29
|
+
side,
|
|
30
|
+
},
|
|
31
|
+
Tooltip: {
|
|
32
|
+
open,
|
|
33
|
+
delayDuration:
|
|
34
|
+
"The delay before the Tooltip shows after the Trigger is hovered, in milliseconds. If no value is specified, the default is 700ms",
|
|
35
|
+
disableHoverableContent:
|
|
36
|
+
"When toggled, prevents the Tooltip content from showing when the Trigger is hovered.",
|
|
37
|
+
},
|
|
38
|
+
TooltipContent: {
|
|
39
|
+
alignOffset,
|
|
40
|
+
sideOffset,
|
|
41
|
+
side,
|
|
42
|
+
},
|
|
43
|
+
};
|
package/src/radio-group.ws.ts
CHANGED
|
@@ -86,6 +86,8 @@ export const metaRadioGroup: WsComponentMeta = {
|
|
|
86
86
|
category: "radix",
|
|
87
87
|
order: 100,
|
|
88
88
|
type: "container",
|
|
89
|
+
description:
|
|
90
|
+
"A set of checkable buttons—known as radio buttons—where no more than one of the buttons can be checked at a time.",
|
|
89
91
|
icon: RadioCheckedIcon,
|
|
90
92
|
states: [
|
|
91
93
|
...defaultStates,
|
|
@@ -142,6 +144,7 @@ export const metaRadioGroup: WsComponentMeta = {
|
|
|
142
144
|
export const metaRadioGroupItem: WsComponentMeta = {
|
|
143
145
|
category: "hidden",
|
|
144
146
|
type: "container",
|
|
147
|
+
requiredAncestors: ["RadioGroup"],
|
|
145
148
|
icon: ItemIcon,
|
|
146
149
|
states: defaultStates,
|
|
147
150
|
presetStyle: {
|
|
@@ -152,6 +155,7 @@ export const metaRadioGroupItem: WsComponentMeta = {
|
|
|
152
155
|
export const metaRadioGroupIndicator: WsComponentMeta = {
|
|
153
156
|
category: "hidden",
|
|
154
157
|
type: "container",
|
|
158
|
+
detachable: false,
|
|
155
159
|
icon: TriggerIcon,
|
|
156
160
|
states: defaultStates,
|
|
157
161
|
presetStyle: {
|
package/src/select.tsx
CHANGED
|
@@ -37,9 +37,14 @@ export const SelectTrigger: ForwardRefExoticComponent<
|
|
|
37
37
|
ComponentPropsWithRef<typeof Trigger>
|
|
38
38
|
> = Trigger;
|
|
39
39
|
|
|
40
|
-
export const SelectValue
|
|
41
|
-
|
|
42
|
-
>
|
|
40
|
+
export const SelectValue = forwardRef<
|
|
41
|
+
HTMLDivElement,
|
|
42
|
+
Omit<ComponentPropsWithoutRef<typeof Value>, "placeholder"> & {
|
|
43
|
+
placeholder?: string;
|
|
44
|
+
}
|
|
45
|
+
>((props, ref) => {
|
|
46
|
+
return <Value ref={ref} {...props} />;
|
|
47
|
+
});
|
|
43
48
|
|
|
44
49
|
export const SelectContent = forwardRef<
|
|
45
50
|
HTMLDivElement,
|
package/src/select.ws.ts
CHANGED
package/src/sheet.ws.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HamburgerMenuIcon } from "@webstudio-is/icons/svg";
|
|
1
|
+
import { HamburgerMenuIcon, LargeXIcon } from "@webstudio-is/icons/svg";
|
|
2
2
|
import type { WsComponentMeta } from "@webstudio-is/react-sdk";
|
|
3
3
|
import * as tc from "./theme/tailwind-classes";
|
|
4
4
|
import { getButtonStyles } from "./theme/styles";
|
|
@@ -17,6 +17,8 @@ export const meta: WsComponentMeta = {
|
|
|
17
17
|
type: "container",
|
|
18
18
|
icon: HamburgerMenuIcon,
|
|
19
19
|
stylable: false,
|
|
20
|
+
description:
|
|
21
|
+
"Displays content in a menu that slides out from the side of the screen, triggered by a button. Use this component for a typical mobile hamburger menu.",
|
|
20
22
|
template: [
|
|
21
23
|
{
|
|
22
24
|
type: "instance",
|
|
@@ -208,7 +210,21 @@ export const meta: WsComponentMeta = {
|
|
|
208
210
|
tc.hover(tc.opacity(100)),
|
|
209
211
|
tc.focus(tc.ring("ring", 2, "background", 2)),
|
|
210
212
|
].flat(),
|
|
211
|
-
children: [
|
|
213
|
+
children: [
|
|
214
|
+
{
|
|
215
|
+
type: "instance",
|
|
216
|
+
component: "HtmlEmbed",
|
|
217
|
+
label: "Close Icon",
|
|
218
|
+
props: [
|
|
219
|
+
{
|
|
220
|
+
type: "string",
|
|
221
|
+
name: "code",
|
|
222
|
+
value: LargeXIcon,
|
|
223
|
+
},
|
|
224
|
+
],
|
|
225
|
+
children: [],
|
|
226
|
+
},
|
|
227
|
+
],
|
|
212
228
|
},
|
|
213
229
|
],
|
|
214
230
|
},
|
package/src/switch.ws.ts
CHANGED
|
@@ -13,6 +13,8 @@ export const metaSwitch: WsComponentMeta = {
|
|
|
13
13
|
category: "radix",
|
|
14
14
|
order: 11,
|
|
15
15
|
type: "container",
|
|
16
|
+
description:
|
|
17
|
+
"A control that allows the user to toggle between checked and not checked.",
|
|
16
18
|
icon: SwitchIcon,
|
|
17
19
|
states: [
|
|
18
20
|
...defaultStates,
|
|
@@ -114,6 +116,7 @@ export const metaSwitch: WsComponentMeta = {
|
|
|
114
116
|
export const metaSwitchThumb: WsComponentMeta = {
|
|
115
117
|
category: "hidden",
|
|
116
118
|
type: "container",
|
|
119
|
+
detachable: false,
|
|
117
120
|
icon: TriggerIcon,
|
|
118
121
|
states: [
|
|
119
122
|
...defaultStates,
|
package/src/tabs.ws.ts
CHANGED
|
@@ -4,11 +4,12 @@ import {
|
|
|
4
4
|
TabsIcon,
|
|
5
5
|
TriggerIcon,
|
|
6
6
|
} from "@webstudio-is/icons/svg";
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
import {
|
|
8
|
+
defaultStates,
|
|
9
|
+
type EmbedTemplateStyleDecl,
|
|
10
|
+
type PresetStyle,
|
|
11
|
+
type WsComponentMeta,
|
|
12
|
+
type WsComponentPropsMeta,
|
|
12
13
|
} from "@webstudio-is/react-sdk";
|
|
13
14
|
import { button, div } from "@webstudio-is/react-sdk/css-normalize";
|
|
14
15
|
import * as tc from "./theme/tailwind-classes";
|
|
@@ -72,6 +73,8 @@ export const metaTabs: WsComponentMeta = {
|
|
|
72
73
|
type: "container",
|
|
73
74
|
icon: TabsIcon,
|
|
74
75
|
presetStyle,
|
|
76
|
+
description:
|
|
77
|
+
"A set of panels with content that are displayed one at a time. Duplicate both a tab trigger and tab content to add more tabs. Triggers and content are connected according to their order in the Navigator.",
|
|
75
78
|
template: [
|
|
76
79
|
{
|
|
77
80
|
type: "instance",
|
|
@@ -155,6 +158,14 @@ export const metaTabsTrigger: WsComponentMeta = {
|
|
|
155
158
|
invalidAncestors: ["TabsTrigger"],
|
|
156
159
|
indexWithinAncestor: "Tabs",
|
|
157
160
|
label: "Tab Trigger",
|
|
161
|
+
states: [
|
|
162
|
+
...defaultStates,
|
|
163
|
+
{
|
|
164
|
+
category: "component-states",
|
|
165
|
+
label: "Active",
|
|
166
|
+
selector: "[data-state=active]",
|
|
167
|
+
},
|
|
168
|
+
],
|
|
158
169
|
presetStyle: {
|
|
159
170
|
button: [button, buttonReset].flat(),
|
|
160
171
|
},
|
|
@@ -163,11 +174,11 @@ export const metaTabsTrigger: WsComponentMeta = {
|
|
|
163
174
|
export const metaTabsContent: WsComponentMeta = {
|
|
164
175
|
category: "hidden",
|
|
165
176
|
type: "container",
|
|
177
|
+
label: "Tab Content",
|
|
166
178
|
icon: ContentIcon,
|
|
167
179
|
requiredAncestors: ["Tabs"],
|
|
168
180
|
indexWithinAncestor: "Tabs",
|
|
169
181
|
presetStyle,
|
|
170
|
-
label: "Tab Content",
|
|
171
182
|
};
|
|
172
183
|
|
|
173
184
|
export const propsMetaTabs: WsComponentPropsMeta = {
|
package/src/theme/styles.ts
CHANGED
|
@@ -71,10 +71,6 @@ export const buttonReset: EmbedTemplateStyleDecl[] = [
|
|
|
71
71
|
property: "backgroundImage",
|
|
72
72
|
value: { type: "keyword", value: "none" },
|
|
73
73
|
} as const,
|
|
74
|
-
{
|
|
75
|
-
property: "cursor",
|
|
76
|
-
value: { type: "keyword", value: "pointer" },
|
|
77
|
-
} as const,
|
|
78
74
|
tc.border(0),
|
|
79
75
|
tc.p(0),
|
|
80
76
|
].flat();
|
package/src/tooltip.ws.tsx
CHANGED
|
@@ -48,6 +48,8 @@ export const metaTooltip: WsComponentMeta = {
|
|
|
48
48
|
type: "container",
|
|
49
49
|
icon: TooltipIcon,
|
|
50
50
|
stylable: false,
|
|
51
|
+
description:
|
|
52
|
+
"Displays content that is related to the trigger, when the trigger is hovered with the mouse or focused with the keyboard. You are reading an example of a tooltip right now.",
|
|
51
53
|
template: [
|
|
52
54
|
{
|
|
53
55
|
type: "instance",
|