@webstudio-is/sdk-components-react-radix 0.196.0 → 0.198.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 (88) hide show
  1. package/lib/__generated__/select.props.js +6 -0
  2. package/lib/__generated__/tabs.props.js +2 -2
  3. package/lib/accordion.template.js +95 -0
  4. package/lib/accordion.ws.js +53 -205
  5. package/lib/checkbox.template.js +63 -0
  6. package/lib/checkbox.ws.js +22 -119
  7. package/lib/collapsible.template.js +16 -0
  8. package/lib/collapsible.ws.js +21 -71
  9. package/lib/dialog.template.js +119 -0
  10. package/lib/dialog.ws.js +60 -237
  11. package/lib/label.template.js +23 -0
  12. package/lib/label.ws.js +12 -36
  13. package/lib/metas.js +48 -50
  14. package/lib/navigation-menu.template.js +283 -0
  15. package/lib/navigation-menu.ws.js +54 -420
  16. package/lib/popover.template.js +33 -0
  17. package/lib/popover.ws.js +19 -79
  18. package/lib/radio-group.template.js +66 -0
  19. package/lib/radio-group.ws.js +27 -125
  20. package/lib/select.template.js +121 -0
  21. package/lib/select.ws.js +61 -262
  22. package/lib/shared/preset-styles.js +38 -0
  23. package/lib/shared/proxy.js +5 -0
  24. package/lib/shared/styles.js +51 -0
  25. package/lib/shared/theme.js +162 -0
  26. package/lib/sheet.template.js +129 -0
  27. package/lib/switch.js +1 -1
  28. package/lib/switch.template.js +63 -0
  29. package/lib/switch.ws.js +22 -106
  30. package/lib/tabs.template.js +66 -0
  31. package/lib/tabs.ws.js +36 -131
  32. package/lib/templates.js +28 -1
  33. package/lib/tooltip.template.js +33 -0
  34. package/lib/tooltip.ws.js +24 -84
  35. package/lib/types/__generated__/accordion.props.d.ts +1 -1
  36. package/lib/types/__generated__/checkbox.props.d.ts +1 -1
  37. package/lib/types/__generated__/collapsible.props.d.ts +1 -1
  38. package/lib/types/__generated__/dialog.props.d.ts +1 -1
  39. package/lib/types/__generated__/label.props.d.ts +1 -1
  40. package/lib/types/__generated__/navigation-menu.props.d.ts +1 -1
  41. package/lib/types/__generated__/popover.props.d.ts +1 -1
  42. package/lib/types/__generated__/radio-group.props.d.ts +1 -1
  43. package/lib/types/__generated__/select.props.d.ts +1 -1
  44. package/lib/types/__generated__/switch.props.d.ts +1 -1
  45. package/lib/types/__generated__/tabs.props.d.ts +1 -1
  46. package/lib/types/__generated__/tooltip.props.d.ts +1 -1
  47. package/lib/types/accordion.template.d.ts +10 -0
  48. package/lib/types/accordion.ws.d.ts +1 -1
  49. package/lib/types/checkbox.d.ts +1 -1
  50. package/lib/types/checkbox.template.d.ts +2 -0
  51. package/lib/types/checkbox.ws.d.ts +1 -1
  52. package/lib/types/collapsible.template.d.ts +2 -0
  53. package/lib/types/collapsible.ws.d.ts +1 -1
  54. package/lib/types/dialog.template.d.ts +10 -0
  55. package/lib/types/dialog.ws.d.ts +1 -9
  56. package/lib/types/label.template.d.ts +10 -0
  57. package/lib/types/label.ws.d.ts +1 -1
  58. package/lib/types/metas.d.ts +0 -1
  59. package/lib/types/navigation-menu.template.d.ts +2 -0
  60. package/lib/types/navigation-menu.ws.d.ts +1 -1
  61. package/lib/types/popover.template.d.ts +10 -0
  62. package/lib/types/popover.ws.d.ts +1 -9
  63. package/lib/types/radio-group.template.d.ts +2 -0
  64. package/lib/types/radio-group.ws.d.ts +1 -1
  65. package/lib/types/select.template.d.ts +2 -0
  66. package/lib/types/select.ws.d.ts +1 -1
  67. package/lib/types/shared/preset-styles.d.ts +2 -0
  68. package/lib/types/shared/proxy.d.ts +17 -0
  69. package/lib/types/shared/styles.d.ts +2 -0
  70. package/lib/types/shared/theme.d.ts +212 -0
  71. package/lib/types/{sheet.ws.d.ts → sheet.template.d.ts} +2 -2
  72. package/lib/types/switch.template.d.ts +2 -0
  73. package/lib/types/switch.ws.d.ts +1 -1
  74. package/lib/types/tabs.template.d.ts +2 -0
  75. package/lib/types/tabs.ws.d.ts +1 -1
  76. package/lib/types/templates.d.ts +13 -0
  77. package/lib/types/tooltip.template.d.ts +10 -0
  78. package/lib/types/tooltip.ws.d.ts +1 -9
  79. package/package.json +25 -22
  80. package/lib/sheet.ws.js +0 -217
  81. package/lib/theme/__generated__/tailwind-theme.js +0 -503
  82. package/lib/theme/styles.js +0 -52
  83. package/lib/theme/tailwind-classes.js +0 -474
  84. package/lib/types/__generated__/sheet.props.d.ts +0 -8
  85. package/lib/types/theme/__generated__/tailwind-theme.d.ts +0 -26
  86. package/lib/types/theme/styles.d.ts +0 -278
  87. package/lib/types/theme/tailwind-classes.d.ts +0 -104
  88. package/lib/types/theme/tailwind-colors.d.ts +0 -31
package/lib/metas.js CHANGED
@@ -1,24 +1,23 @@
1
1
  import { metaCollapsible as t, metaCollapsibleContent as o, metaCollapsibleTrigger as i } from "./collapsible.ws.js";
2
2
  import { metaDialog as n, metaDialogClose as m, metaDialogContent as s, metaDialogDescription as l, metaDialogOverlay as g, metaDialogTitle as c, metaDialogTrigger as p } from "./dialog.ws.js";
3
- import { meta as C } from "./sheet.ws.js";
4
- import { metaPopover as u, metaPopoverContent as v, metaPopoverTrigger as b } from "./popover.ws.js";
5
- import { metaTooltip as x, metaTooltipContent as I, metaTooltipTrigger as D } from "./tooltip.ws.js";
6
- import { metaTabs as N, metaTabsContent as f, metaTabsList as h, metaTabsTrigger as A } from "./tabs.ws.js";
7
- import { meta as L } from "./label.ws.js";
8
- import { metaAccordion as G, metaAccordionContent as P, metaAccordionHeader as R, metaAccordionItem as V, metaAccordionTrigger as y } from "./accordion.ws.js";
9
- import { metaNavigationMenu as O, metaNavigationMenuContent as j, metaNavigationMenuItem as q, metaNavigationMenuLink as z, metaNavigationMenuList as B, metaNavigationMenuTrigger as E, metaNavigationMenuViewport as F } from "./navigation-menu.ws.js";
10
- import { metaSelect as K, metaSelectContent as Q, metaSelectItem as U, metaSelectItemIndicator as W, metaSelectItemText as X, metaSelectTrigger as Y, metaSelectValue as Z, metaSelectViewport as _ } from "./select.ws.js";
11
- import { metaSwitch as ee, metaSwitchThumb as ae } from "./switch.ws.js";
12
- import { metaCheckbox as oe, metaCheckboxIndicator as ie } from "./checkbox.ws.js";
13
- import { metaRadioGroup as ne, metaRadioGroupIndicator as me, metaRadioGroupItem as se } from "./radio-group.ws.js";
3
+ import { metaPopover as C, metaPopoverContent as d, metaPopoverTrigger as u } from "./popover.ws.js";
4
+ import { metaTooltip as b, metaTooltipContent as S, metaTooltipTrigger as x } from "./tooltip.ws.js";
5
+ import { metaTabs as D, metaTabsContent as M, metaTabsList as N, metaTabsTrigger as f } from "./tabs.ws.js";
6
+ import { meta as A } from "./label.ws.js";
7
+ import { metaAccordion as L, metaAccordionContent as k, metaAccordionHeader as G, metaAccordionItem as P, metaAccordionTrigger as R } from "./accordion.ws.js";
8
+ import { metaNavigationMenu as y, metaNavigationMenuContent as H, metaNavigationMenuItem as O, metaNavigationMenuLink as j, metaNavigationMenuList as q, metaNavigationMenuTrigger as z, metaNavigationMenuViewport as B } from "./navigation-menu.ws.js";
9
+ import { metaSelect as F, metaSelectContent as J, metaSelectItem as K, metaSelectItemIndicator as Q, metaSelectItemText as U, metaSelectTrigger as W, metaSelectValue as X, metaSelectViewport as Y } from "./select.ws.js";
10
+ import { metaSwitch as _, metaSwitchThumb as $ } from "./switch.ws.js";
11
+ import { metaCheckbox as ae, metaCheckboxIndicator as te } from "./checkbox.ws.js";
12
+ import { metaRadioGroup as ie, metaRadioGroupIndicator as re, metaRadioGroupItem as ne } from "./radio-group.ws.js";
14
13
  export {
15
- G as Accordion,
16
- P as AccordionContent,
17
- R as AccordionHeader,
18
- V as AccordionItem,
19
- y as AccordionTrigger,
20
- oe as Checkbox,
21
- ie as CheckboxIndicator,
14
+ L as Accordion,
15
+ k as AccordionContent,
16
+ G as AccordionHeader,
17
+ P as AccordionItem,
18
+ R as AccordionTrigger,
19
+ ae as Checkbox,
20
+ te as CheckboxIndicator,
22
21
  t as Collapsible,
23
22
  o as CollapsibleContent,
24
23
  i as CollapsibleTrigger,
@@ -29,36 +28,35 @@ export {
29
28
  g as DialogOverlay,
30
29
  c as DialogTitle,
31
30
  p as DialogTrigger,
32
- L as Label,
33
- O as NavigationMenu,
34
- j as NavigationMenuContent,
35
- q as NavigationMenuItem,
36
- z as NavigationMenuLink,
37
- B as NavigationMenuList,
38
- E as NavigationMenuTrigger,
39
- F as NavigationMenuViewport,
40
- u as Popover,
41
- v as PopoverContent,
42
- b as PopoverTrigger,
43
- ne as RadioGroup,
44
- me as RadioGroupIndicator,
45
- se as RadioGroupItem,
46
- K as Select,
47
- Q as SelectContent,
48
- U as SelectItem,
49
- W as SelectItemIndicator,
50
- X as SelectItemText,
51
- Y as SelectTrigger,
52
- Z as SelectValue,
53
- _ as SelectViewport,
54
- C as Sheet,
55
- ee as Switch,
56
- ae as SwitchThumb,
57
- N as Tabs,
58
- f as TabsContent,
59
- h as TabsList,
60
- A as TabsTrigger,
61
- x as Tooltip,
62
- I as TooltipContent,
63
- D as TooltipTrigger
31
+ A as Label,
32
+ y as NavigationMenu,
33
+ H as NavigationMenuContent,
34
+ O as NavigationMenuItem,
35
+ j as NavigationMenuLink,
36
+ q as NavigationMenuList,
37
+ z as NavigationMenuTrigger,
38
+ B as NavigationMenuViewport,
39
+ C as Popover,
40
+ d as PopoverContent,
41
+ u as PopoverTrigger,
42
+ ie as RadioGroup,
43
+ re as RadioGroupIndicator,
44
+ ne as RadioGroupItem,
45
+ F as Select,
46
+ J as SelectContent,
47
+ K as SelectItem,
48
+ Q as SelectItemIndicator,
49
+ U as SelectItemText,
50
+ W as SelectTrigger,
51
+ X as SelectValue,
52
+ Y as SelectViewport,
53
+ _ as Switch,
54
+ $ as SwitchThumb,
55
+ D as Tabs,
56
+ M as TabsContent,
57
+ N as TabsList,
58
+ f as TabsTrigger,
59
+ b as Tooltip,
60
+ S as TooltipContent,
61
+ x as TooltipTrigger
64
62
  };
@@ -0,0 +1,283 @@
1
+ import { jsxs as s, jsx as e } from "react/jsx-runtime";
2
+ import { ChevronDownIcon as w } from "@webstudio-is/icons/svg";
3
+ import { $ as n, css as t, PlaceholderValue as l } from "@webstudio-is/template";
4
+ import { radix as r } from "./shared/proxy.js";
5
+ import { getButtonStyle as u } from "./shared/styles.js";
6
+ import { spacing as i, colors as a, width as h, borderRadius as p, borderWidth as v, boxShadow as b, height as y, transition as x, lineHeight as c, fontSize as m, weights as $ } from "./shared/theme.js";
7
+ const k = [
8
+ {
9
+ title: "Sheet",
10
+ href: "/docs/components/sheet",
11
+ description: "Extends the Dialog component to display content that complements the main content of the screen."
12
+ },
13
+ {
14
+ title: "Navigation Menu",
15
+ href: "/docs/components/navigation-menu",
16
+ description: "A collection of links for navigating websites."
17
+ },
18
+ {
19
+ title: "Tabs",
20
+ href: "/docs/components/tabs",
21
+ description: "A set of layered sections of content—known as tab panels—that are displayed one at a time."
22
+ },
23
+ {
24
+ title: "Accordion",
25
+ href: "/docs/components/accordion",
26
+ description: "A vertically stacked set of interactive headings that each reveal a section of content."
27
+ },
28
+ {
29
+ title: "Dialog",
30
+ href: "/docs/components/dialog",
31
+ description: "A window overlaid on either the primary window or another dialog window, rendering the content underneath inert."
32
+ },
33
+ {
34
+ title: "Collapsible",
35
+ href: "/docs/components/collapsible",
36
+ description: "An interactive component which expands/collapses a panel."
37
+ },
38
+ {
39
+ title: "Popover",
40
+ href: "/docs/components/popover",
41
+ description: "Displays rich content in a portal, triggered by a button."
42
+ },
43
+ {
44
+ title: "Tooltip",
45
+ href: "/docs/components/tooltip",
46
+ description: "A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it."
47
+ },
48
+ {
49
+ title: "Button",
50
+ href: "/docs/components/button",
51
+ description: "Displays a button or a component that looks like a button."
52
+ }
53
+ ], M = (o) => /* @__PURE__ */ e(r.NavigationMenuLink, { children: /* @__PURE__ */ s(
54
+ n.Link,
55
+ {
56
+ href: `https://ui.shadcn.com${o.href}`,
57
+ "ws:style": t`
58
+ color: inherit;
59
+ display: flex;
60
+ flex-direction: column;
61
+ user-select: none;
62
+ gap: ${i[1]};
63
+ border-radius: ${p.md};
64
+ padding: ${i[3]};
65
+ line-height: ${c.none};
66
+ text-decoration-line: none;
67
+ outline: none;
68
+ &:hover,
69
+ &:focus {
70
+ background-color: ${a.accent};
71
+ color: ${a.accentForeground};
72
+ }
73
+ `,
74
+ children: [
75
+ /* @__PURE__ */ e(
76
+ n.Text,
77
+ {
78
+ "ws:style": t`
79
+ font-size: ${m.sm};
80
+ font-weight: ${$.medium};
81
+ line-height: ${c.none};
82
+ `,
83
+ children: new l(o.title)
84
+ }
85
+ ),
86
+ /* @__PURE__ */ e(
87
+ n.Paragraph,
88
+ {
89
+ "ws:style": t`
90
+ margin: 0;
91
+ overflow: hidden;
92
+ display: -webkit-box;
93
+ -webkit-box-orient: vertical;
94
+ -webkit-line-clamp: 2;
95
+ font-size: ${m.sm};
96
+ line-height: ${c.snug};
97
+ color: ${a.mutedForeground};
98
+ `,
99
+ children: new l(o.description)
100
+ }
101
+ )
102
+ ]
103
+ }
104
+ ) }, o.title), d = (o) => /* @__PURE__ */ e(
105
+ n.Box,
106
+ {
107
+ "ws:label": "Flex Column",
108
+ "ws:style": t`
109
+ width: ${h[64]};
110
+ display: flex;
111
+ gap: ${i[4]};
112
+ flex-direction: column;
113
+ `,
114
+ children: k.slice(o.offset, o.offset + o.count).map(M)
115
+ }
116
+ ), C = /* @__PURE__ */ s(
117
+ n.Box,
118
+ {
119
+ "ws:label": "Content",
120
+ "ws:style": t`
121
+ display: flex;
122
+ gap: ${i[4]};
123
+ padding: ${i[2]};
124
+ `,
125
+ children: [
126
+ /* @__PURE__ */ e(
127
+ n.Box,
128
+ {
129
+ "ws:style": t`
130
+ background-color: ${a.border};
131
+ padding: ${i[4]};
132
+ width: ${h[48]};
133
+ border-radius: ${p.md};
134
+ `,
135
+ children: new l("")
136
+ }
137
+ ),
138
+ d({ count: 3, offset: 0 })
139
+ ]
140
+ }
141
+ ), A = /* @__PURE__ */ s(
142
+ n.Box,
143
+ {
144
+ "ws:label": "Content",
145
+ "ws:style": t`
146
+ display: flex;
147
+ gap: ${i[4]};
148
+ `,
149
+ children: [
150
+ d({ count: 3, offset: 3 }),
151
+ d({ count: 3, offset: 6 })
152
+ ]
153
+ }
154
+ ), g = (o, f) => /* @__PURE__ */ s(r.NavigationMenuItem, { children: [
155
+ /* @__PURE__ */ e(r.NavigationMenuTrigger, { children: /* @__PURE__ */ s(
156
+ n.Button,
157
+ {
158
+ "ws:style": [
159
+ ...u("ghost", "sm"),
160
+ ...t`
161
+ --navigation-menu-trigger-icon-transform: 0deg;
162
+ &[data-state="open"] {
163
+ --navigation-menu-trigger-icon-transform: 180deg;
164
+ }
165
+ `
166
+ ],
167
+ children: [
168
+ /* @__PURE__ */ e(n.Text, { children: new l(o) }),
169
+ /* @__PURE__ */ e(
170
+ n.Box,
171
+ {
172
+ "ws:label": "Icon Container",
173
+ "ws:style": t`
174
+ margin-left: ${i[1]};
175
+ rotate: var(--navigation-menu-trigger-icon-transform);
176
+ height: ${y[4]};
177
+ width: ${h[4]};
178
+ flex-shrink: 0;
179
+ transition: ${x.all};
180
+ transition-duration: 200ms;
181
+ `,
182
+ children: /* @__PURE__ */ e(n.HtmlEmbed, { "ws:label": "Chevron Icon", code: w })
183
+ }
184
+ )
185
+ ]
186
+ }
187
+ ) }),
188
+ /* @__PURE__ */ e(
189
+ r.NavigationMenuContent,
190
+ {
191
+ "ws:style": t`
192
+ left: 0;
193
+ top: 0;
194
+ positon: absolute;
195
+ width: max-content;
196
+ padding: ${i[4]};
197
+ `,
198
+ children: f
199
+ }
200
+ )
201
+ ] }), N = (o) => /* @__PURE__ */ e(r.NavigationMenuItem, { children: /* @__PURE__ */ e(r.NavigationMenuLink, { children: /* @__PURE__ */ e(
202
+ n.Link,
203
+ {
204
+ "ws:style": [
205
+ ...u("ghost", "sm"),
206
+ ...t`
207
+ text-decoration-line: none;
208
+ color: currentColor;
209
+ `
210
+ ],
211
+ children: new l(o)
212
+ }
213
+ ) }) }), S = {
214
+ category: "radix",
215
+ description: "A collection of links for navigating websites.",
216
+ order: 2,
217
+ template: /* @__PURE__ */ s(
218
+ r.NavigationMenu,
219
+ {
220
+ "ws:style": t`
221
+ position: relative;
222
+ max-width: max-content;
223
+ `,
224
+ children: [
225
+ /* @__PURE__ */ s(
226
+ r.NavigationMenuList,
227
+ {
228
+ "ws:style": t`
229
+ /* ul defaults in tailwind */
230
+ padding: 0;
231
+ margin: 0;
232
+ /* shadcdn styles */
233
+ display: flex;
234
+ flex: 1 1 0;
235
+ list-style-type: none;
236
+ align-items: center;
237
+ justify-content: center;
238
+ gap: ${i[1]};
239
+ `,
240
+ children: [
241
+ g("About", C),
242
+ g("Components", A),
243
+ N("Standalone")
244
+ ]
245
+ }
246
+ ),
247
+ /* @__PURE__ */ e(
248
+ n.Box,
249
+ {
250
+ "ws:label": "Viewport Container",
251
+ "ws:style": t`
252
+ position: absolute;
253
+ left: 0;
254
+ top: 100%;
255
+ display: flex;
256
+ justify-content: center;
257
+ `,
258
+ children: /* @__PURE__ */ e(
259
+ r.NavigationMenuViewport,
260
+ {
261
+ "ws:style": t`
262
+ position: relative;
263
+ margin-top: ${i[1.5]};
264
+ overflow: hidden;
265
+ border-radius: ${p.md};
266
+ border: ${v.DEFAULT} solid ${a.border};
267
+ background-color: ${a.popover};
268
+ color: ${a.popoverForeground};
269
+ box-shadow: ${b.lg};
270
+ height: var(--radix-navigation-menu-viewport-height);
271
+ width: var(--radix-navigation-menu-viewport-width);
272
+ `
273
+ }
274
+ )
275
+ }
276
+ )
277
+ ]
278
+ }
279
+ )
280
+ };
281
+ export {
282
+ S as meta
283
+ };