@webstudio-is/sdk-components-react-radix 0.88.0 → 0.89.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.
Files changed (96) hide show
  1. package/lib/__generated__/accordion.props.js +605 -109
  2. package/lib/__generated__/button.props.js +161 -29
  3. package/lib/__generated__/checkbox.props.js +284 -51
  4. package/lib/__generated__/collapsible.props.js +234 -42
  5. package/lib/__generated__/dialog.props.js +611 -110
  6. package/lib/__generated__/input.props.js +264 -47
  7. package/lib/__generated__/label.props.js +123 -22
  8. package/lib/__generated__/navigation-menu.props.js +563 -102
  9. package/lib/__generated__/popover.props.js +129 -25
  10. package/lib/__generated__/radio-group.props.js +421 -76
  11. package/lib/__generated__/select.props.js +876 -160
  12. package/lib/__generated__/sheet.props.js +591 -110
  13. package/lib/__generated__/switch.props.js +284 -51
  14. package/lib/__generated__/tabs.props.js +506 -91
  15. package/lib/__generated__/textarea.props.js +177 -31
  16. package/lib/__generated__/tooltip.props.js +131 -27
  17. package/lib/accordion.ws.js +1 -0
  18. package/lib/checkbox.ws.js +2 -0
  19. package/lib/cjs/__generated__/accordion.props.js +605 -109
  20. package/lib/cjs/__generated__/button.props.js +161 -29
  21. package/lib/cjs/__generated__/checkbox.props.js +284 -51
  22. package/lib/cjs/__generated__/collapsible.props.js +234 -42
  23. package/lib/cjs/__generated__/dialog.props.js +611 -110
  24. package/lib/cjs/__generated__/input.props.js +264 -47
  25. package/lib/cjs/__generated__/label.props.js +123 -22
  26. package/lib/cjs/__generated__/navigation-menu.props.js +563 -102
  27. package/lib/cjs/__generated__/popover.props.js +129 -25
  28. package/lib/cjs/__generated__/radio-group.props.js +421 -76
  29. package/lib/cjs/__generated__/select.props.js +875 -159
  30. package/lib/cjs/__generated__/sheet.props.js +591 -110
  31. package/lib/cjs/__generated__/switch.props.js +284 -51
  32. package/lib/cjs/__generated__/tabs.props.js +506 -91
  33. package/lib/cjs/__generated__/textarea.props.js +177 -31
  34. package/lib/cjs/__generated__/tooltip.props.js +131 -27
  35. package/lib/cjs/accordion.ws.js +1 -0
  36. package/lib/cjs/checkbox.ws.js +2 -0
  37. package/lib/cjs/collapsible.ws.js +1 -0
  38. package/lib/cjs/dialog.ws.js +1 -0
  39. package/lib/cjs/label.ws.js +1 -0
  40. package/lib/cjs/navigation-menu.ws.js +1 -0
  41. package/lib/cjs/popover.ws.js +1 -0
  42. package/lib/cjs/props-descriptions.js +56 -0
  43. package/lib/cjs/radio-group.ws.js +3 -0
  44. package/lib/cjs/select.js +3 -1
  45. package/lib/cjs/select.ws.js +1 -0
  46. package/lib/cjs/sheet.ws.js +1 -0
  47. package/lib/cjs/switch.ws.js +2 -0
  48. package/lib/cjs/tabs.ws.js +1 -0
  49. package/lib/cjs/tooltip.ws.js +1 -0
  50. package/lib/collapsible.ws.js +1 -0
  51. package/lib/dialog.ws.js +1 -0
  52. package/lib/label.ws.js +1 -0
  53. package/lib/navigation-menu.ws.js +1 -0
  54. package/lib/popover.ws.js +1 -0
  55. package/lib/props-descriptions.js +36 -0
  56. package/lib/radio-group.ws.js +3 -0
  57. package/lib/select.js +3 -1
  58. package/lib/select.ws.js +1 -0
  59. package/lib/sheet.ws.js +1 -0
  60. package/lib/switch.ws.js +2 -0
  61. package/lib/tabs.ws.js +1 -0
  62. package/lib/tooltip.ws.js +1 -0
  63. package/lib/types/props-descriptions.d.ts +29 -0
  64. package/lib/types/select.d.ts +4 -2
  65. package/package.json +6 -6
  66. package/src/__generated__/accordion.props.ts +675 -103
  67. package/src/__generated__/button.props.ts +180 -27
  68. package/src/__generated__/checkbox.props.ts +317 -48
  69. package/src/__generated__/collapsible.props.ts +261 -40
  70. package/src/__generated__/dialog.props.ts +682 -104
  71. package/src/__generated__/input.props.ts +292 -44
  72. package/src/__generated__/label.props.ts +137 -21
  73. package/src/__generated__/navigation-menu.props.ts +629 -96
  74. package/src/__generated__/popover.props.ts +142 -21
  75. package/src/__generated__/radio-group.props.ts +470 -71
  76. package/src/__generated__/select.props.ts +979 -153
  77. package/src/__generated__/sheet.props.ts +657 -99
  78. package/src/__generated__/switch.props.ts +317 -48
  79. package/src/__generated__/tabs.props.ts +565 -86
  80. package/src/__generated__/textarea.props.ts +195 -30
  81. package/src/__generated__/tooltip.props.ts +145 -23
  82. package/src/accordion.ws.ts +2 -0
  83. package/src/checkbox.ws.ts +3 -0
  84. package/src/collapsible.ws.ts +2 -0
  85. package/src/dialog.ws.tsx +2 -0
  86. package/src/label.ws.ts +2 -0
  87. package/src/navigation-menu.ws.ts +1 -0
  88. package/src/popover.ws.tsx +1 -0
  89. package/src/props-descriptions.ts +43 -0
  90. package/src/radio-group.ws.ts +4 -0
  91. package/src/select.tsx +8 -3
  92. package/src/select.ws.ts +2 -0
  93. package/src/sheet.ws.tsx +2 -0
  94. package/src/switch.ws.ts +3 -0
  95. package/src/tabs.ws.ts +2 -0
  96. package/src/tooltip.ws.tsx +2 -0
@@ -125,6 +125,7 @@ const metaSelect = {
125
125
  type: "container",
126
126
  icon: import_svg.SelectIcon,
127
127
  stylable: false,
128
+ description: "Use within a form to give your users a list of options to choose from.",
128
129
  template: [
129
130
  {
130
131
  type: "instance",
@@ -40,6 +40,7 @@ const meta = {
40
40
  type: "container",
41
41
  icon: import_svg.HamburgerMenuIcon,
42
42
  stylable: false,
43
+ description: "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.",
43
44
  template: [
44
45
  {
45
46
  type: "instance",
@@ -44,6 +44,7 @@ const metaSwitch = {
44
44
  category: "radix",
45
45
  order: 11,
46
46
  type: "container",
47
+ description: "A control that allows the user to toggle between checked and not checked.",
47
48
  icon: import_svg.SwitchIcon,
48
49
  states: [
49
50
  ...import_react_sdk.defaultStates,
@@ -144,6 +145,7 @@ const metaSwitch = {
144
145
  const metaSwitchThumb = {
145
146
  category: "hidden",
146
147
  type: "container",
148
+ detachable: false,
147
149
  icon: import_svg.TriggerIcon,
148
150
  states: [
149
151
  ...import_react_sdk.defaultStates,
@@ -78,6 +78,7 @@ const metaTabs = {
78
78
  type: "container",
79
79
  icon: import_svg.TabsIcon,
80
80
  presetStyle,
81
+ description: "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.",
81
82
  template: [
82
83
  {
83
84
  type: "instance",
@@ -65,6 +65,7 @@ const metaTooltip = {
65
65
  type: "container",
66
66
  icon: import_svg.TooltipIcon,
67
67
  stylable: false,
68
+ description: "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.",
68
69
  template: [
69
70
  {
70
71
  type: "instance",
@@ -19,6 +19,7 @@ const metaCollapsible = {
19
19
  type: "container",
20
20
  presetStyle,
21
21
  icon: CollapsibleIcon,
22
+ description: "An interactive component which expands and collapses some content, triggered by a button.",
22
23
  template: [
23
24
  {
24
25
  type: "instance",
package/lib/dialog.ws.js CHANGED
@@ -79,6 +79,7 @@ const metaDialog = {
79
79
  type: "container",
80
80
  icon: DialogIcon,
81
81
  stylable: false,
82
+ description: "Displays content with an overlay that covers the window, triggered by a button. Clicking the overlay will close the dialog.",
82
83
  template: [
83
84
  {
84
85
  type: "instance",
package/lib/label.ws.js CHANGED
@@ -15,6 +15,7 @@ const meta = {
15
15
  icon: LabelIcon,
16
16
  presetStyle,
17
17
  states: defaultStates,
18
+ description: "An accessible label to describe the purpose of an input. Match the \u201CFor\u201D property on the label with the \u201CID\u201D of the input to connect them.",
18
19
  template: [
19
20
  {
20
21
  type: "instance",
@@ -275,6 +275,7 @@ const metaNavigationMenu = {
275
275
  category: "radix",
276
276
  order: 2,
277
277
  type: "container",
278
+ description: "A collection of links for navigating websites.",
278
279
  icon: NavigationMenuIcon,
279
280
  presetStyle,
280
281
  template: [
package/lib/popover.ws.js CHANGED
@@ -32,6 +32,7 @@ const metaPopover = {
32
32
  type: "container",
33
33
  icon: PopoverIcon,
34
34
  stylable: false,
35
+ description: "Displays rich content in a portal, triggered by a button.",
35
36
  template: [
36
37
  {
37
38
  type: "instance",
@@ -0,0 +1,36 @@
1
+ const open = "Show or hide the content of this component on the canvas. This will not affect the initial state of the component.";
2
+ const alignOffset = "The offset in pixels from the \u201Cstart\u201C or \u201Cend\u201C alignment options.";
3
+ const sideOffset = "The distance in pixels between the Content and the Trigger.";
4
+ const side = "The preferred alignment against the Trigger. May change when collisions occur.";
5
+ const propsDescriptions = {
6
+ Dialog: {
7
+ open
8
+ },
9
+ Sheet: {
10
+ open
11
+ },
12
+ Collapsible: {
13
+ open
14
+ },
15
+ Popover: {
16
+ open
17
+ },
18
+ PopoverContent: {
19
+ alignOffset,
20
+ sideOffset,
21
+ side
22
+ },
23
+ Tooltip: {
24
+ open,
25
+ delayDuration: "The delay before the Tooltip shows after the Trigger is hovered, in milliseconds. If no value is specified, the default is 700ms",
26
+ disableHoverableContent: "When toggled, prevents the Tooltip content from showing when the Trigger is hovered."
27
+ },
28
+ TooltipContent: {
29
+ alignOffset,
30
+ sideOffset,
31
+ side
32
+ }
33
+ };
34
+ export {
35
+ propsDescriptions
36
+ };
@@ -79,6 +79,7 @@ const metaRadioGroup = {
79
79
  category: "radix",
80
80
  order: 100,
81
81
  type: "container",
82
+ description: "A set of checkable buttons\u2014known as radio buttons\u2014where no more than one of the buttons can be checked at a time.",
82
83
  icon: RadioCheckedIcon,
83
84
  states: [
84
85
  ...defaultStates,
@@ -134,6 +135,7 @@ const metaRadioGroup = {
134
135
  const metaRadioGroupItem = {
135
136
  category: "hidden",
136
137
  type: "container",
138
+ requiredAncestors: ["RadioGroup"],
137
139
  icon: ItemIcon,
138
140
  states: defaultStates,
139
141
  presetStyle: {
@@ -143,6 +145,7 @@ const metaRadioGroupItem = {
143
145
  const metaRadioGroupIndicator = {
144
146
  category: "hidden",
145
147
  type: "container",
148
+ detachable: false,
146
149
  icon: TriggerIcon,
147
150
  states: defaultStates,
148
151
  presetStyle: {
package/lib/select.js CHANGED
@@ -21,7 +21,9 @@ const Select = forwardRef(({ value, ...props }, _ref) => {
21
21
  return /* @__PURE__ */ jsx(Root, { value, ...props });
22
22
  });
23
23
  const SelectTrigger = Trigger;
24
- const SelectValue = Value;
24
+ const SelectValue = forwardRef((props, ref) => {
25
+ return /* @__PURE__ */ jsx(Value, { ref, ...props });
26
+ });
25
27
  const SelectContent = forwardRef((props, ref) => {
26
28
  return /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(Content, { ref, ...props, position: "popper" }) });
27
29
  });
package/lib/select.ws.js CHANGED
@@ -95,6 +95,7 @@ const metaSelect = {
95
95
  type: "container",
96
96
  icon: SelectIcon,
97
97
  stylable: false,
98
+ description: "Use within a form to give your users a list of options to choose from.",
98
99
  template: [
99
100
  {
100
101
  type: "instance",
package/lib/sheet.ws.js CHANGED
@@ -7,6 +7,7 @@ const meta = {
7
7
  type: "container",
8
8
  icon: HamburgerMenuIcon,
9
9
  stylable: false,
10
+ description: "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.",
10
11
  template: [
11
12
  {
12
13
  type: "instance",
package/lib/switch.ws.js CHANGED
@@ -10,6 +10,7 @@ const metaSwitch = {
10
10
  category: "radix",
11
11
  order: 11,
12
12
  type: "container",
13
+ description: "A control that allows the user to toggle between checked and not checked.",
13
14
  icon: SwitchIcon,
14
15
  states: [
15
16
  ...defaultStates,
@@ -110,6 +111,7 @@ const metaSwitch = {
110
111
  const metaSwitchThumb = {
111
112
  category: "hidden",
112
113
  type: "container",
114
+ detachable: false,
113
115
  icon: TriggerIcon,
114
116
  states: [
115
117
  ...defaultStates,
package/lib/tabs.ws.js CHANGED
@@ -48,6 +48,7 @@ const metaTabs = {
48
48
  type: "container",
49
49
  icon: TabsIcon,
50
50
  presetStyle,
51
+ description: "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.",
51
52
  template: [
52
53
  {
53
54
  type: "instance",
package/lib/tooltip.ws.js CHANGED
@@ -32,6 +32,7 @@ const metaTooltip = {
32
32
  type: "container",
33
33
  icon: TooltipIcon,
34
34
  stylable: false,
35
+ description: "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.",
35
36
  template: [
36
37
  {
37
38
  type: "instance",
@@ -0,0 +1,29 @@
1
+ export declare const propsDescriptions: {
2
+ Dialog: {
3
+ open: string;
4
+ };
5
+ Sheet: {
6
+ open: string;
7
+ };
8
+ Collapsible: {
9
+ open: string;
10
+ };
11
+ Popover: {
12
+ open: string;
13
+ };
14
+ PopoverContent: {
15
+ alignOffset: string;
16
+ sideOffset: string;
17
+ side: string;
18
+ };
19
+ Tooltip: {
20
+ open: string;
21
+ delayDuration: string;
22
+ disableHoverableContent: string;
23
+ };
24
+ TooltipContent: {
25
+ alignOffset: string;
26
+ sideOffset: string;
27
+ side: string;
28
+ };
29
+ };
@@ -1,9 +1,11 @@
1
1
  import { type ForwardRefExoticComponent, type ComponentPropsWithRef } from "react";
2
- import { Value, Trigger, Item, ItemIndicator, ItemText, Viewport } from "@radix-ui/react-select";
2
+ import { Trigger, Item, ItemIndicator, ItemText, Viewport } from "@radix-ui/react-select";
3
3
  import { type Hook } from "@webstudio-is/react-sdk";
4
4
  export declare const Select: ForwardRefExoticComponent<import("@radix-ui/react-select").SelectProps & import("react").RefAttributes<HTMLDivElement>>;
5
5
  export declare const SelectTrigger: ForwardRefExoticComponent<ComponentPropsWithRef<typeof Trigger>>;
6
- export declare const SelectValue: ForwardRefExoticComponent<ComponentPropsWithRef<typeof Value>>;
6
+ export declare const SelectValue: ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-select").SelectValueProps & import("react").RefAttributes<HTMLSpanElement>, "ref">, "placeholder"> & {
7
+ placeholder?: string | undefined;
8
+ } & import("react").RefAttributes<HTMLDivElement>>;
7
9
  export declare const SelectContent: ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-select").SelectContentProps & import("react").RefAttributes<HTMLDivElement>, "ref">, "position" | "side"> & import("react").RefAttributes<HTMLDivElement>>;
8
10
  export declare const SelectViewport: ForwardRefExoticComponent<ComponentPropsWithRef<typeof Viewport>>;
9
11
  export declare const SelectItem: ForwardRefExoticComponent<ComponentPropsWithRef<typeof Item>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webstudio-is/sdk-components-react-radix",
3
- "version": "0.88.0",
3
+ "version": "0.89.0",
4
4
  "description": "Webstudio wrapper for radix library",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",
@@ -56,10 +56,10 @@
56
56
  "@radix-ui/react-tabs": "^1.0.4",
57
57
  "@radix-ui/react-tooltip": "^1.0.6",
58
58
  "tailwindcss": "^3.3.3",
59
- "@webstudio-is/css-data": "^0.88.0",
60
- "@webstudio-is/generate-arg-types": "^0.88.0",
61
- "@webstudio-is/icons": "^0.88.0",
62
- "@webstudio-is/react-sdk": "^0.88.0"
59
+ "@webstudio-is/css-data": "^0.89.0",
60
+ "@webstudio-is/generate-arg-types": "^0.89.0",
61
+ "@webstudio-is/icons": "^0.89.0",
62
+ "@webstudio-is/react-sdk": "^0.89.0"
63
63
  },
64
64
  "devDependencies": {
65
65
  "@storybook/react": "^7.2.1",
@@ -69,7 +69,7 @@
69
69
  "react-dom": "^18.2.0",
70
70
  "typescript": "^5.1.6",
71
71
  "@webstudio-is/scripts": "^0.0.0",
72
- "@webstudio-is/sdk-components-react": "^0.88.0",
72
+ "@webstudio-is/sdk-components-react": "^0.89.0",
73
73
  "@webstudio-is/storybook-config": "^0.0.0",
74
74
  "@webstudio-is/tsconfig": "^1.0.7"
75
75
  },