@webstudio-is/sdk-components-react-radix 0.90.0 → 0.92.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 (199) hide show
  1. package/lib/__generated__/accordion.props.js +6 -12
  2. package/lib/__generated__/checkbox.props.js +3 -6
  3. package/lib/__generated__/collapsible.props.js +4 -8
  4. package/lib/__generated__/dialog.props.js +8 -16
  5. package/lib/__generated__/label.props.js +2 -4
  6. package/lib/__generated__/navigation-menu.props.js +8 -16
  7. package/lib/__generated__/popover.props.js +4 -8
  8. package/lib/__generated__/radio-group.props.js +4 -8
  9. package/lib/__generated__/select.props.js +15 -19
  10. package/lib/__generated__/sheet.props.js +8 -16
  11. package/lib/__generated__/switch.props.js +3 -6
  12. package/lib/__generated__/tabs.props.js +5 -10
  13. package/lib/__generated__/tooltip.props.js +4 -8
  14. package/lib/accordion.js +7 -14
  15. package/{src/accordion.stories.tsx → lib/accordion.stories.js} +9 -12
  16. package/lib/accordion.ws.js +11 -22
  17. package/lib/checkbox.js +3 -6
  18. package/lib/checkbox.stories.js +19 -0
  19. package/lib/checkbox.ws.js +5 -10
  20. package/lib/collapsible.js +5 -10
  21. package/{src/collapsible.stories.tsx → lib/collapsible.stories.js} +9 -12
  22. package/lib/collapsible.ws.js +7 -14
  23. package/lib/components.js +13 -62
  24. package/lib/dialog.js +9 -18
  25. package/{src/dialog.stories.tsx → lib/dialog.stories.js} +9 -12
  26. package/lib/dialog.ws.js +17 -30
  27. package/lib/hooks.js +2 -4
  28. package/lib/label.js +2 -4
  29. package/lib/label.stories.js +19 -0
  30. package/lib/label.ws.js +3 -6
  31. package/lib/metas.js +55 -105
  32. package/lib/navigation-menu.js +9 -18
  33. package/{src/navigation-menu.stories.tsx → lib/navigation-menu.stories.js} +9 -12
  34. package/lib/navigation-menu.ws.js +16 -31
  35. package/lib/popover.js +5 -10
  36. package/{src/popover.stories.tsx → lib/popover.stories.js} +9 -12
  37. package/lib/popover.ws.js +7 -14
  38. package/lib/props-descriptions.js +2 -4
  39. package/lib/props.js +54 -103
  40. package/lib/radio-group.js +4 -8
  41. package/lib/radio-group.stories.js +19 -0
  42. package/lib/radio-group.ws.js +7 -14
  43. package/lib/select.js +10 -20
  44. package/{src/select.stories.tsx → lib/select.stories.js} +9 -12
  45. package/lib/select.ws.js +17 -34
  46. package/lib/sheet.js +9 -18
  47. package/{src/sheet.stories.tsx → lib/sheet.stories.js} +9 -12
  48. package/lib/sheet.ws.js +2 -4
  49. package/lib/switch.js +3 -6
  50. package/lib/switch.stories.js +19 -0
  51. package/lib/switch.ws.js +5 -10
  52. package/lib/tabs.js +6 -12
  53. package/{src/tabs.stories.tsx → lib/tabs.stories.js} +9 -12
  54. package/lib/tabs.ws.js +9 -18
  55. package/lib/theme/__generated__/tailwind-theme.js +517 -0
  56. package/lib/theme/styles.js +3 -6
  57. package/lib/theme/tailwind-classes.js +149 -301
  58. package/lib/theme/tailwind-colors.js +2 -4
  59. package/lib/tooltip.js +5 -10
  60. package/{src/tooltip.stories.tsx → lib/tooltip.stories.js} +9 -12
  61. package/lib/tooltip.ws.js +7 -14
  62. package/lib/types/__generated__/accordion.props.d.ts +1 -1
  63. package/lib/types/__generated__/checkbox.props.d.ts +1 -1
  64. package/lib/types/__generated__/collapsible.props.d.ts +1 -1
  65. package/lib/types/__generated__/dialog.props.d.ts +1 -1
  66. package/lib/types/__generated__/label.props.d.ts +1 -1
  67. package/lib/types/__generated__/navigation-menu.props.d.ts +1 -1
  68. package/lib/types/__generated__/popover.props.d.ts +1 -1
  69. package/lib/types/__generated__/radio-group.props.d.ts +1 -1
  70. package/lib/types/__generated__/select.props.d.ts +1 -1
  71. package/lib/types/__generated__/sheet.props.d.ts +1 -1
  72. package/lib/types/__generated__/switch.props.d.ts +1 -1
  73. package/lib/types/__generated__/tabs.props.d.ts +1 -1
  74. package/lib/types/__generated__/tooltip.props.d.ts +1 -1
  75. package/lib/types/accordion.d.ts +1 -1
  76. package/lib/types/sheet.d.ts +1 -1
  77. package/lib/types/theme/__generated__/tailwind-theme.d.ts +26 -0
  78. package/lib/types/theme/styles.d.ts +60 -60
  79. package/lib/types/theme/tailwind-classes.d.ts +33 -33
  80. package/package.json +20 -23
  81. package/lib/__generated__/button.props.js +0 -565
  82. package/lib/__generated__/input.props.js +0 -668
  83. package/lib/__generated__/textarea.props.js +0 -577
  84. package/lib/cjs/__generated__/accordion.props.js +0 -2645
  85. package/lib/cjs/__generated__/button.props.js +0 -585
  86. package/lib/cjs/__generated__/checkbox.props.js +0 -1103
  87. package/lib/cjs/__generated__/collapsible.props.js +0 -1050
  88. package/lib/cjs/__generated__/dialog.props.js +0 -2623
  89. package/lib/cjs/__generated__/input.props.js +0 -688
  90. package/lib/cjs/__generated__/label.props.js +0 -541
  91. package/lib/cjs/__generated__/navigation-menu.props.js +0 -2585
  92. package/lib/cjs/__generated__/popover.props.js +0 -582
  93. package/lib/cjs/__generated__/radio-group.props.js +0 -1647
  94. package/lib/cjs/__generated__/select.props.js +0 -3698
  95. package/lib/cjs/__generated__/sheet.props.js +0 -2642
  96. package/lib/cjs/__generated__/switch.props.js +0 -1103
  97. package/lib/cjs/__generated__/tabs.props.js +0 -2144
  98. package/lib/cjs/__generated__/textarea.props.js +0 -597
  99. package/lib/cjs/__generated__/tooltip.props.js +0 -593
  100. package/lib/cjs/accordion.js +0 -67
  101. package/lib/cjs/accordion.ws.js +0 -285
  102. package/lib/cjs/checkbox.js +0 -31
  103. package/lib/cjs/checkbox.ws.js +0 -174
  104. package/lib/cjs/collapsible.js +0 -53
  105. package/lib/cjs/collapsible.ws.js +0 -122
  106. package/lib/cjs/components.js +0 -82
  107. package/lib/cjs/dialog.js +0 -89
  108. package/lib/cjs/dialog.ws.js +0 -314
  109. package/lib/cjs/hooks.js +0 -43
  110. package/lib/cjs/label.js +0 -37
  111. package/lib/cjs/label.ws.js +0 -75
  112. package/lib/cjs/metas.js +0 -84
  113. package/lib/cjs/navigation-menu.js +0 -107
  114. package/lib/cjs/navigation-menu.ws.js +0 -514
  115. package/lib/cjs/package.json +0 -1
  116. package/lib/cjs/popover.js +0 -90
  117. package/lib/cjs/popover.ws.js +0 -142
  118. package/lib/cjs/props-descriptions.js +0 -56
  119. package/lib/cjs/props.js +0 -82
  120. package/lib/cjs/radio-group.js +0 -30
  121. package/lib/cjs/radio-group.ws.js +0 -191
  122. package/lib/cjs/select.js +0 -83
  123. package/lib/cjs/select.ws.js +0 -350
  124. package/lib/cjs/sheet.js +0 -96
  125. package/lib/cjs/sheet.ws.js +0 -257
  126. package/lib/cjs/switch.js +0 -27
  127. package/lib/cjs/switch.ws.js +0 -173
  128. package/lib/cjs/tabs.js +0 -59
  129. package/lib/cjs/tabs.ws.js +0 -196
  130. package/lib/cjs/theme/radix-common-types.js +0 -16
  131. package/lib/cjs/theme/styles.js +0 -96
  132. package/lib/cjs/theme/tailwind-classes.js +0 -819
  133. package/lib/cjs/theme/tailwind-colors.js +0 -45
  134. package/lib/cjs/theme/tailwind-theme.js +0 -46
  135. package/lib/cjs/tooltip.js +0 -87
  136. package/lib/cjs/tooltip.ws.js +0 -143
  137. package/lib/theme/radix-common-types.js +0 -0
  138. package/lib/theme/tailwind-theme.js +0 -16
  139. package/lib/types/__generated__/button.props.d.ts +0 -2
  140. package/lib/types/__generated__/input.props.d.ts +0 -2
  141. package/lib/types/__generated__/textarea.props.d.ts +0 -2
  142. package/lib/types/theme/radix-common-types.d.ts +0 -85
  143. package/lib/types/theme/tailwind-theme.d.ts +0 -72
  144. package/src/__generated__/accordion.props.ts +0 -2949
  145. package/src/__generated__/button.props.ts +0 -635
  146. package/src/__generated__/checkbox.props.ts +0 -1217
  147. package/src/__generated__/collapsible.props.ts +0 -1156
  148. package/src/__generated__/dialog.props.ts +0 -2923
  149. package/src/__generated__/input.props.ts +0 -748
  150. package/src/__generated__/label.props.ts +0 -585
  151. package/src/__generated__/navigation-menu.props.ts +0 -2882
  152. package/src/__generated__/popover.props.ts +0 -626
  153. package/src/__generated__/radio-group.props.ts +0 -1828
  154. package/src/__generated__/select.props.ts +0 -4130
  155. package/src/__generated__/sheet.props.ts +0 -2942
  156. package/src/__generated__/switch.props.ts +0 -1217
  157. package/src/__generated__/tabs.props.ts +0 -2386
  158. package/src/__generated__/textarea.props.ts +0 -645
  159. package/src/__generated__/tooltip.props.ts +0 -639
  160. package/src/accordion.tsx +0 -88
  161. package/src/accordion.ws.ts +0 -296
  162. package/src/checkbox.stories.ts +0 -22
  163. package/src/checkbox.tsx +0 -22
  164. package/src/checkbox.ws.ts +0 -154
  165. package/src/collapsible.tsx +0 -62
  166. package/src/collapsible.ws.ts +0 -115
  167. package/src/components.ts +0 -50
  168. package/src/dialog.tsx +0 -92
  169. package/src/dialog.ws.tsx +0 -318
  170. package/src/hooks.ts +0 -22
  171. package/src/label.stories.ts +0 -22
  172. package/src/label.tsx +0 -15
  173. package/src/label.ws.ts +0 -50
  174. package/src/metas.ts +0 -74
  175. package/src/navigation-menu.tsx +0 -130
  176. package/src/navigation-menu.ws.ts +0 -524
  177. package/src/popover.tsx +0 -96
  178. package/src/popover.ws.tsx +0 -128
  179. package/src/props-descriptions.ts +0 -43
  180. package/src/props.ts +0 -73
  181. package/src/radio-group.stories.ts +0 -22
  182. package/src/radio-group.tsx +0 -17
  183. package/src/radio-group.ws.ts +0 -178
  184. package/src/select.tsx +0 -112
  185. package/src/select.ws.ts +0 -349
  186. package/src/sheet.tsx +0 -79
  187. package/src/sheet.ws.tsx +0 -236
  188. package/src/switch.stories.ts +0 -22
  189. package/src/switch.tsx +0 -10
  190. package/src/switch.ws.ts +0 -146
  191. package/src/tabs.tsx +0 -64
  192. package/src/tabs.ws.ts +0 -198
  193. package/src/theme/radix-common-types.ts +0 -496
  194. package/src/theme/styles.ts +0 -76
  195. package/src/theme/tailwind-classes.ts +0 -1026
  196. package/src/theme/tailwind-colors.ts +0 -39
  197. package/src/theme/tailwind-theme.ts +0 -24
  198. package/src/tooltip.tsx +0 -95
  199. package/src/tooltip.ws.tsx +0 -130
@@ -1,82 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var components_exports = {};
20
- __export(components_exports, {
21
- Accordion: () => import_accordion.Accordion,
22
- AccordionContent: () => import_accordion.AccordionContent,
23
- AccordionHeader: () => import_accordion.AccordionHeader,
24
- AccordionItem: () => import_accordion.AccordionItem,
25
- AccordionTrigger: () => import_accordion.AccordionTrigger,
26
- Checkbox: () => import_checkbox.Checkbox,
27
- CheckboxIndicator: () => import_checkbox.CheckboxIndicator,
28
- Collapsible: () => import_collapsible.Collapsible,
29
- CollapsibleContent: () => import_collapsible.CollapsibleContent,
30
- CollapsibleTrigger: () => import_collapsible.CollapsibleTrigger,
31
- Dialog: () => import_dialog.Dialog,
32
- DialogClose: () => import_dialog.DialogClose,
33
- DialogContent: () => import_dialog.DialogContent,
34
- DialogDescription: () => import_dialog.DialogDescription,
35
- DialogOverlay: () => import_dialog.DialogOverlay,
36
- DialogTitle: () => import_dialog.DialogTitle,
37
- DialogTrigger: () => import_dialog.DialogTrigger,
38
- Label: () => import_label.Label,
39
- NavigationMenu: () => import_navigation_menu.NavigationMenu,
40
- NavigationMenuContent: () => import_navigation_menu.NavigationMenuContent,
41
- NavigationMenuItem: () => import_navigation_menu.NavigationMenuItem,
42
- NavigationMenuLink: () => import_navigation_menu.NavigationMenuLink,
43
- NavigationMenuList: () => import_navigation_menu.NavigationMenuList,
44
- NavigationMenuTrigger: () => import_navigation_menu.NavigationMenuTrigger,
45
- NavigationMenuViewport: () => import_navigation_menu.NavigationMenuViewport,
46
- Popover: () => import_popover.Popover,
47
- PopoverContent: () => import_popover.PopoverContent,
48
- PopoverTrigger: () => import_popover.PopoverTrigger,
49
- RadioGroup: () => import_radio_group.RadioGroup,
50
- RadioGroupIndicator: () => import_radio_group.RadioGroupIndicator,
51
- RadioGroupItem: () => import_radio_group.RadioGroupItem,
52
- Select: () => import_select.Select,
53
- SelectContent: () => import_select.SelectContent,
54
- SelectItem: () => import_select.SelectItem,
55
- SelectItemIndicator: () => import_select.SelectItemIndicator,
56
- SelectItemText: () => import_select.SelectItemText,
57
- SelectTrigger: () => import_select.SelectTrigger,
58
- SelectValue: () => import_select.SelectValue,
59
- SelectViewport: () => import_select.SelectViewport,
60
- Switch: () => import_switch.Switch,
61
- SwitchThumb: () => import_switch.SwitchThumb,
62
- Tabs: () => import_tabs.Tabs,
63
- TabsContent: () => import_tabs.TabsContent,
64
- TabsList: () => import_tabs.TabsList,
65
- TabsTrigger: () => import_tabs.TabsTrigger,
66
- Tooltip: () => import_tooltip.Tooltip,
67
- TooltipContent: () => import_tooltip.TooltipContent,
68
- TooltipTrigger: () => import_tooltip.TooltipTrigger
69
- });
70
- module.exports = __toCommonJS(components_exports);
71
- var import_collapsible = require("./collapsible");
72
- var import_dialog = require("./dialog");
73
- var import_popover = require("./popover");
74
- var import_tooltip = require("./tooltip");
75
- var import_tabs = require("./tabs");
76
- var import_label = require("./label");
77
- var import_accordion = require("./accordion");
78
- var import_navigation_menu = require("./navigation-menu");
79
- var import_select = require("./select");
80
- var import_switch = require("./switch");
81
- var import_checkbox = require("./checkbox");
82
- var import_radio_group = require("./radio-group");
package/lib/cjs/dialog.js DELETED
@@ -1,89 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var dialog_exports = {};
30
- __export(dialog_exports, {
31
- Dialog: () => Dialog,
32
- DialogClose: () => DialogClose,
33
- DialogContent: () => DialogContent,
34
- DialogDescription: () => DialogDescription,
35
- DialogOverlay: () => DialogOverlay,
36
- DialogTitle: () => DialogTitle,
37
- DialogTrigger: () => DialogTrigger,
38
- hooksDialog: () => hooksDialog
39
- });
40
- module.exports = __toCommonJS(dialog_exports);
41
- var import_jsx_runtime = require("react/jsx-runtime");
42
- var import_react = require("react");
43
- var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"), 1);
44
- var import_react_sdk = require("@webstudio-is/react-sdk");
45
- const Dialog = (0, import_react.forwardRef)((props, _ref) => {
46
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogPrimitive.Root, { ...props });
47
- });
48
- const DialogTrigger = (0, import_react.forwardRef)(({ children, ...props }, ref) => {
49
- const firstChild = import_react.Children.toArray(children)[0];
50
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogPrimitive.Trigger, { ref, asChild: true, ...props, children: firstChild ?? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { children: "Add button or link" }) });
51
- });
52
- const DialogOverlay = (0, import_react.forwardRef)((props, ref) => {
53
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogPrimitive.DialogPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogPrimitive.Overlay, { ref, ...props }) });
54
- });
55
- const DialogContent = DialogPrimitive.Content;
56
- const DialogClose = DialogPrimitive.Close;
57
- const DialogTitle = DialogPrimitive.Title;
58
- const DialogDescription = DialogPrimitive.Description;
59
- const namespace = "@webstudio-is/sdk-components-react-radix";
60
- const hooksDialog = {
61
- onNavigatorUnselect: (context, event) => {
62
- for (const instance of event.instancePath) {
63
- if (instance.component === `${namespace}:DialogOverlay`) {
64
- const dialog = (0, import_react_sdk.getClosestInstance)(
65
- event.instancePath,
66
- instance,
67
- `${namespace}:Dialog`
68
- );
69
- if (dialog) {
70
- context.setPropVariable(dialog.id, "open", false);
71
- }
72
- }
73
- }
74
- },
75
- onNavigatorSelect: (context, event) => {
76
- for (const instance of event.instancePath) {
77
- if (instance.component === `${namespace}:DialogOverlay`) {
78
- const dialog = (0, import_react_sdk.getClosestInstance)(
79
- event.instancePath,
80
- instance,
81
- `${namespace}:Dialog`
82
- );
83
- if (dialog) {
84
- context.setPropVariable(dialog.id, "open", true);
85
- }
86
- }
87
- }
88
- }
89
- };
@@ -1,314 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var dialog_ws_exports = {};
30
- __export(dialog_ws_exports, {
31
- metaDialog: () => metaDialog,
32
- metaDialogClose: () => metaDialogClose,
33
- metaDialogContent: () => metaDialogContent,
34
- metaDialogDescription: () => metaDialogDescription,
35
- metaDialogOverlay: () => metaDialogOverlay,
36
- metaDialogTitle: () => metaDialogTitle,
37
- metaDialogTrigger: () => metaDialogTrigger,
38
- propsMetaDialog: () => propsMetaDialog,
39
- propsMetaDialogClose: () => propsMetaDialogClose,
40
- propsMetaDialogContent: () => propsMetaDialogContent,
41
- propsMetaDialogDescription: () => propsMetaDialogDescription,
42
- propsMetaDialogOverlay: () => propsMetaDialogOverlay,
43
- propsMetaDialogTitle: () => propsMetaDialogTitle,
44
- propsMetaDialogTrigger: () => propsMetaDialogTrigger
45
- });
46
- module.exports = __toCommonJS(dialog_ws_exports);
47
- var import_svg = require("@webstudio-is/icons/svg");
48
- var import_react_sdk = require("@webstudio-is/react-sdk");
49
- var import_css_normalize = require("@webstudio-is/react-sdk/css-normalize");
50
- var tc = __toESM(require("./theme/tailwind-classes"), 1);
51
- var import_dialog = require("./__generated__/dialog.props");
52
- var import_styles = require("./theme/styles");
53
- const presetStyle = {
54
- div: import_css_normalize.div
55
- };
56
- const titlePresetStyle = {
57
- h2: import_css_normalize.h2
58
- };
59
- const descriptionPresetStyle = {
60
- p: import_css_normalize.p
61
- };
62
- const metaDialogTrigger = {
63
- category: "hidden",
64
- type: "container",
65
- icon: import_svg.TriggerIcon,
66
- stylable: false,
67
- detachable: false
68
- };
69
- const metaDialogContent = {
70
- category: "hidden",
71
- type: "container",
72
- presetStyle,
73
- icon: import_svg.ContentIcon,
74
- detachable: false
75
- };
76
- const metaDialogOverlay = {
77
- category: "hidden",
78
- type: "container",
79
- presetStyle,
80
- icon: import_svg.OverlayIcon,
81
- detachable: false
82
- };
83
- const metaDialogTitle = {
84
- category: "hidden",
85
- type: "container",
86
- presetStyle: titlePresetStyle,
87
- icon: import_svg.HeadingIcon
88
- };
89
- const metaDialogDescription = {
90
- category: "hidden",
91
- type: "container",
92
- presetStyle: descriptionPresetStyle,
93
- icon: import_svg.TextIcon
94
- };
95
- const metaDialogClose = {
96
- category: "hidden",
97
- type: "container",
98
- presetStyle: {
99
- button: [import_styles.buttonReset, import_css_normalize.button].flat()
100
- },
101
- icon: import_svg.ButtonElementIcon,
102
- label: "Close Button"
103
- };
104
- const metaDialog = {
105
- category: "radix",
106
- order: 4,
107
- type: "container",
108
- icon: import_svg.DialogIcon,
109
- stylable: false,
110
- description: "Displays content with an overlay that covers the window, triggered by a button. Clicking the overlay will close the dialog.",
111
- template: [
112
- {
113
- type: "instance",
114
- component: "Dialog",
115
- dataSources: {
116
- dialogOpen: { type: "variable", initialValue: false }
117
- },
118
- props: [
119
- {
120
- type: "dataSource",
121
- name: "open",
122
- dataSourceName: "dialogOpen"
123
- },
124
- {
125
- name: "onOpenChange",
126
- type: "action",
127
- value: [
128
- { type: "execute", args: ["open"], code: `dialogOpen = open` }
129
- ]
130
- }
131
- ],
132
- children: [
133
- {
134
- type: "instance",
135
- component: "DialogTrigger",
136
- children: [
137
- {
138
- type: "instance",
139
- component: "Button",
140
- styles: (0, import_styles.getButtonStyles)("outline"),
141
- children: [{ type: "text", value: "Button" }]
142
- }
143
- ]
144
- },
145
- {
146
- type: "instance",
147
- component: "DialogOverlay",
148
- /**
149
- * fixed inset-0 z-50 bg-background/80 backdrop-blur-sm
150
- * flex
151
- **/
152
- styles: [
153
- tc.fixed(),
154
- tc.inset(0),
155
- tc.z(50),
156
- tc.bg("background", 80),
157
- tc.backdropBlur("sm"),
158
- // To allow positioning Content
159
- tc.flex(),
160
- tc.overflow("auto")
161
- ].flat(),
162
- children: [
163
- {
164
- type: "instance",
165
- component: "DialogContent",
166
- /**
167
- * fixed w-full z-50
168
- * grid gap-4 max-w-lg
169
- * m-auto
170
- * border bg-background p-6 shadow-lg
171
- **/
172
- styles: [
173
- tc.w("full"),
174
- tc.z(50),
175
- tc.flex(),
176
- tc.flex("col"),
177
- tc.gap(4),
178
- tc.m("auto"),
179
- tc.maxW("lg"),
180
- tc.border(),
181
- tc.bg("background"),
182
- tc.p(6),
183
- tc.shadow("lg"),
184
- tc.relative()
185
- ].flat(),
186
- children: [
187
- {
188
- type: "instance",
189
- component: "Box",
190
- label: "Dialog Header",
191
- styles: [tc.flex(), tc.flex("col"), tc.gap(1)].flat(),
192
- children: [
193
- {
194
- type: "instance",
195
- component: "DialogTitle",
196
- /**
197
- * text-lg leading-none tracking-tight
198
- **/
199
- styles: [
200
- tc.my(0),
201
- tc.leading("none"),
202
- tc.text("lg"),
203
- tc.tracking("tight")
204
- ].flat(),
205
- children: [
206
- {
207
- type: "text",
208
- value: "Dialog Title"
209
- }
210
- ]
211
- },
212
- {
213
- type: "instance",
214
- component: "DialogDescription",
215
- /**
216
- * text-sm text-muted-foreground
217
- **/
218
- styles: [
219
- tc.my(0),
220
- tc.text("sm"),
221
- tc.text("mutedForeground")
222
- ].flat(),
223
- children: [
224
- {
225
- type: "text",
226
- value: "Dialog description text you can edit"
227
- }
228
- ]
229
- }
230
- ]
231
- },
232
- {
233
- type: "instance",
234
- component: "Text",
235
- children: [{ type: "text", value: "The text you can edit" }]
236
- },
237
- {
238
- type: "instance",
239
- component: "DialogClose",
240
- /**
241
- * absolute right-4 top-4
242
- * rounded-sm opacity-70
243
- * ring-offset-background
244
- * hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2
245
- * flex items-center justify-center h-4 w-4
246
- **/
247
- styles: [
248
- tc.absolute(),
249
- tc.right(4),
250
- tc.top(4),
251
- tc.rounded("sm"),
252
- tc.opacity(70),
253
- tc.flex(),
254
- tc.items("center"),
255
- tc.justify("center"),
256
- tc.h(4),
257
- tc.w(4),
258
- tc.border(0),
259
- tc.bg("transparent"),
260
- tc.outline("none"),
261
- tc.hover(tc.opacity(100)),
262
- tc.focus(tc.ring("ring", 2, "background", 2))
263
- ].flat(),
264
- children: [
265
- {
266
- type: "instance",
267
- component: "HtmlEmbed",
268
- label: "Close Icon",
269
- props: [
270
- {
271
- type: "string",
272
- name: "code",
273
- value: import_svg.LargeXIcon
274
- }
275
- ],
276
- children: []
277
- }
278
- ]
279
- }
280
- ]
281
- }
282
- ]
283
- }
284
- ]
285
- }
286
- ]
287
- };
288
- const propsMetaDialog = {
289
- props: import_dialog.propsDialog,
290
- initialProps: ["open"]
291
- };
292
- const propsMetaDialogTrigger = {
293
- props: import_dialog.propsDialogTrigger
294
- };
295
- const propsMetaDialogContent = {
296
- props: import_dialog.propsDialogContent,
297
- initialProps: []
298
- };
299
- const propsMetaDialogOverlay = {
300
- props: import_dialog.propsDialogOverlay,
301
- initialProps: []
302
- };
303
- const propsMetaDialogClose = {
304
- props: import_dialog.propsDialogClose,
305
- initialProps: []
306
- };
307
- const propsMetaDialogTitle = {
308
- props: import_dialog.propsDialogTitle,
309
- initialProps: []
310
- };
311
- const propsMetaDialogDescription = {
312
- props: import_dialog.propsDialogDescription,
313
- initialProps: []
314
- };
package/lib/cjs/hooks.js DELETED
@@ -1,43 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var hooks_exports = {};
20
- __export(hooks_exports, {
21
- hooks: () => hooks
22
- });
23
- module.exports = __toCommonJS(hooks_exports);
24
- var import_collapsible = require("./collapsible");
25
- var import_tabs = require("./tabs");
26
- var import_dialog = require("./dialog");
27
- var import_popover = require("./popover");
28
- var import_sheet = require("./sheet");
29
- var import_tooltip = require("./tooltip");
30
- var import_accordion = require("./accordion");
31
- var import_navigation_menu = require("./navigation-menu");
32
- var import_select = require("./select");
33
- const hooks = [
34
- import_collapsible.hooksCollapsible,
35
- import_tabs.hooksTabs,
36
- import_dialog.hooksDialog,
37
- import_popover.hooksPopover,
38
- import_sheet.hooksSheet,
39
- import_tooltip.hooksTooltip,
40
- import_accordion.hooksAccordion,
41
- import_navigation_menu.hooksNavigationMenu,
42
- import_select.hooksSelect
43
- ];
package/lib/cjs/label.js DELETED
@@ -1,37 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var label_exports = {};
30
- __export(label_exports, {
31
- Label: () => Label
32
- });
33
- module.exports = __toCommonJS(label_exports);
34
- var import_jsx_runtime = require("react/jsx-runtime");
35
- var import_react = require("react");
36
- var LabelPrimitive = __toESM(require("@radix-ui/react-label"), 1);
37
- const Label = (0, import_react.forwardRef)((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LabelPrimitive.Root, { ref, ...props }));
@@ -1,75 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var label_ws_exports = {};
30
- __export(label_ws_exports, {
31
- meta: () => meta,
32
- propsMeta: () => propsMeta
33
- });
34
- module.exports = __toCommonJS(label_ws_exports);
35
- var import_svg = require("@webstudio-is/icons/svg");
36
- var import_react_sdk = require("@webstudio-is/react-sdk");
37
- var import_css_normalize = require("@webstudio-is/react-sdk/css-normalize");
38
- var import_label = require("./__generated__/label.props");
39
- var tc = __toESM(require("./theme/tailwind-classes"), 1);
40
- const presetStyle = {
41
- label: import_css_normalize.label
42
- };
43
- const meta = {
44
- category: "radix",
45
- order: 102,
46
- type: "container",
47
- icon: import_svg.LabelIcon,
48
- presetStyle,
49
- states: import_react_sdk.defaultStates,
50
- 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.",
51
- template: [
52
- {
53
- type: "instance",
54
- component: "Label",
55
- styles: [
56
- // text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70
57
- tc.text("sm"),
58
- tc.font("medium"),
59
- tc.leading("none")
60
- // We are not supporting peer like styles yet
61
- ].flat(),
62
- children: [{ type: "text", value: "Form Label" }]
63
- }
64
- ]
65
- };
66
- const propsMeta = {
67
- props: {
68
- ...import_label.props,
69
- htmlFor: {
70
- ...import_label.props.htmlFor,
71
- label: "For"
72
- }
73
- },
74
- initialProps: ["id", "htmlFor"]
75
- };