@webstudio-is/sdk-components-react-radix 0.185.0 → 0.191.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 (47) hide show
  1. package/lib/__generated__/accordion.props.js +2631 -0
  2. package/lib/__generated__/checkbox.props.js +1084 -0
  3. package/lib/__generated__/collapsible.props.js +1024 -0
  4. package/lib/__generated__/dialog.props.js +2599 -0
  5. package/lib/__generated__/label.props.js +519 -0
  6. package/lib/__generated__/navigation-menu.props.js +3660 -0
  7. package/lib/__generated__/popover.props.js +564 -0
  8. package/lib/__generated__/radio-group.props.js +1619 -0
  9. package/lib/__generated__/select.props.js +3681 -0
  10. package/lib/__generated__/switch.props.js +1084 -0
  11. package/lib/__generated__/tabs.props.js +2121 -0
  12. package/lib/__generated__/tooltip.props.js +575 -0
  13. package/lib/accordion.js +36 -0
  14. package/lib/accordion.ws.js +254 -0
  15. package/lib/checkbox.js +8 -0
  16. package/lib/checkbox.ws.js +141 -0
  17. package/lib/collapsible.js +26 -0
  18. package/lib/collapsible.ws.js +92 -0
  19. package/lib/components.js +60 -406
  20. package/lib/dialog.js +84 -0
  21. package/lib/dialog.ws.js +260 -0
  22. package/lib/hooks.js +20 -655
  23. package/lib/label.js +7 -0
  24. package/lib/label.ws.js +43 -0
  25. package/lib/metas.js +62 -4570
  26. package/lib/navigation-menu.js +59 -0
  27. package/lib/navigation-menu.ws.js +481 -0
  28. package/lib/popover.js +48 -0
  29. package/lib/popover.ws.js +96 -0
  30. package/lib/props.js +60 -24208
  31. package/lib/radio-group.js +9 -0
  32. package/lib/radio-group.ws.js +159 -0
  33. package/lib/select.js +46 -0
  34. package/lib/select.ws.js +308 -0
  35. package/lib/sheet.js +43 -0
  36. package/lib/sheet.ws.js +217 -0
  37. package/lib/switch.js +8 -0
  38. package/lib/switch.ws.js +140 -0
  39. package/lib/tabs.js +31 -0
  40. package/lib/tabs.ws.js +187 -0
  41. package/lib/theme/__generated__/tailwind-theme.js +503 -0
  42. package/lib/theme/styles.js +52 -0
  43. package/lib/theme/tailwind-classes.js +474 -0
  44. package/lib/tooltip.js +45 -0
  45. package/lib/tooltip.ws.js +97 -0
  46. package/lib/types/theme/styles.d.ts +92 -44
  47. package/package.json +19 -20
package/lib/metas.js CHANGED
@@ -1,4572 +1,64 @@
1
- // src/collapsible.ws.ts
2
- import {
3
- CollapsibleIcon,
4
- TriggerIcon,
5
- ContentIcon
6
- } from "@webstudio-is/icons/svg";
7
- import { div } from "@webstudio-is/sdk/normalize.css";
8
-
9
- // src/__generated__/collapsible.props.ts
10
- var propsCollapsible = {
11
- about: { required: false, control: "text", type: "string" },
12
- accessKey: {
13
- required: false,
14
- control: "text",
15
- type: "string",
16
- description: "Keyboard shortcut to activate or add focus to the element."
17
- },
18
- "aria-activedescendant": {
19
- description: "Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application.",
20
- required: false,
21
- control: "text",
22
- type: "string"
23
- },
24
- "aria-atomic": {
25
- description: "Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute.",
26
- required: false,
27
- control: "boolean",
28
- type: "boolean"
29
- },
30
- "aria-autocomplete": {
31
- description: "Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be\npresented if they are made.",
32
- required: false,
33
- control: "select",
34
- type: "string",
35
- options: ["list", "none", "inline", "both"]
36
- },
37
- "aria-braillelabel": {
38
- description: "Defines a string value that labels the current element, which is intended to be converted into Braille.",
39
- required: false,
40
- control: "text",
41
- type: "string"
42
- },
43
- "aria-brailleroledescription": {
44
- description: "Defines a human-readable, author-localized abbreviated description for the role of an element, which is intended to be converted into Braille.",
45
- required: false,
46
- control: "text",
47
- type: "string"
48
- },
49
- "aria-busy": { required: false, control: "boolean", type: "boolean" },
50
- "aria-checked": {
51
- description: 'Indicates the current "checked" state of checkboxes, radio buttons, and other widgets.',
52
- required: false,
53
- control: "text",
54
- type: "string"
55
- },
56
- "aria-colcount": {
57
- description: "Defines the total number of columns in a table, grid, or treegrid.",
58
- required: false,
59
- control: "number",
60
- type: "number"
61
- },
62
- "aria-colindex": {
63
- description: "Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid.",
64
- required: false,
65
- control: "number",
66
- type: "number"
67
- },
68
- "aria-colindextext": {
69
- description: "Defines a human readable text alternative of aria-colindex.",
70
- required: false,
71
- control: "text",
72
- type: "string"
73
- },
74
- "aria-colspan": {
75
- description: "Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.",
76
- required: false,
77
- control: "number",
78
- type: "number"
79
- },
80
- "aria-controls": {
81
- description: "Identifies the element (or elements) whose contents or presence are controlled by the current element.",
82
- required: false,
83
- control: "text",
84
- type: "string"
85
- },
86
- "aria-current": {
87
- description: "Indicates the element that represents the current item within a container or set of related elements.",
88
- required: false,
89
- control: "text",
90
- type: "string"
91
- },
92
- "aria-describedby": {
93
- description: "Identifies the element (or elements) that describes the object.",
94
- required: false,
95
- control: "text",
96
- type: "string"
97
- },
98
- "aria-description": {
99
- description: "Defines a string value that describes or annotates the current element.",
100
- required: false,
101
- control: "text",
102
- type: "string"
103
- },
104
- "aria-details": {
105
- description: "Identifies the element that provides a detailed, extended description for the object.",
106
- required: false,
107
- control: "text",
108
- type: "string"
109
- },
110
- "aria-disabled": {
111
- description: "Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.",
112
- required: false,
113
- control: "boolean",
114
- type: "boolean"
115
- },
116
- "aria-dropeffect": {
117
- description: "Indicates what functions can be performed when a dragged object is released on the drop target.",
118
- required: false,
119
- control: "select",
120
- type: "string",
121
- options: ["link", "none", "copy", "execute", "move", "popup"]
122
- },
123
- "aria-errormessage": {
124
- description: "Identifies the element that provides an error message for the object.",
125
- required: false,
126
- control: "text",
127
- type: "string"
128
- },
129
- "aria-expanded": {
130
- description: "Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.",
131
- required: false,
132
- control: "boolean",
133
- type: "boolean"
134
- },
135
- "aria-flowto": {
136
- description: "Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion,\nallows assistive technology to override the general default of reading in document source order.",
137
- required: false,
138
- control: "text",
139
- type: "string"
140
- },
141
- "aria-grabbed": {
142
- description: `Indicates an element's "grabbed" state in a drag-and-drop operation.`,
143
- required: false,
144
- control: "boolean",
145
- type: "boolean"
146
- },
147
- "aria-haspopup": {
148
- description: "Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.",
149
- required: false,
150
- control: "text",
151
- type: "string"
152
- },
153
- "aria-hidden": {
154
- description: "Indicates whether the element is exposed to an accessibility API.",
155
- required: false,
156
- control: "boolean",
157
- type: "boolean"
158
- },
159
- "aria-invalid": {
160
- description: "Indicates the entered value does not conform to the format expected by the application.",
161
- required: false,
162
- control: "text",
163
- type: "string"
164
- },
165
- "aria-keyshortcuts": {
166
- description: "Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element.",
167
- required: false,
168
- control: "text",
169
- type: "string"
170
- },
171
- "aria-label": {
172
- description: "Provides the accessible name that describes an interactive element if no other accessible name exists, for example in a button that contains an image with no text.",
173
- required: false,
174
- control: "text",
175
- type: "string"
176
- },
177
- "aria-labelledby": {
178
- description: "Identifies the element (or elements) that labels the current element.",
179
- required: false,
180
- control: "text",
181
- type: "string"
182
- },
183
- "aria-level": {
184
- description: "Defines the hierarchical level of an element within a structure.",
185
- required: false,
186
- control: "number",
187
- type: "number"
188
- },
189
- "aria-live": {
190
- description: "Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region.",
191
- required: false,
192
- control: "radio",
193
- type: "string",
194
- options: ["off", "assertive", "polite"]
195
- },
196
- "aria-modal": {
197
- description: "Indicates whether an element is modal when displayed.",
198
- required: false,
199
- control: "boolean",
200
- type: "boolean"
201
- },
202
- "aria-multiline": {
203
- description: "Indicates whether a text box accepts multiple lines of input or only a single line.",
204
- required: false,
205
- control: "boolean",
206
- type: "boolean"
207
- },
208
- "aria-multiselectable": {
209
- description: "Indicates that the user may select more than one item from the current selectable descendants.",
210
- required: false,
211
- control: "boolean",
212
- type: "boolean"
213
- },
214
- "aria-orientation": {
215
- description: "Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous.",
216
- required: false,
217
- control: "radio",
218
- type: "string",
219
- options: ["horizontal", "vertical"]
220
- },
221
- "aria-owns": {
222
- description: "Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship\nbetween DOM elements where the DOM hierarchy cannot be used to represent the relationship.",
223
- required: false,
224
- control: "text",
225
- type: "string"
226
- },
227
- "aria-placeholder": {
228
- description: "Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value.\nA hint could be a sample value or a brief description of the expected format.",
229
- required: false,
230
- control: "text",
231
- type: "string"
232
- },
233
- "aria-posinset": {
234
- description: "Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.",
235
- required: false,
236
- control: "number",
237
- type: "number"
238
- },
239
- "aria-pressed": {
240
- description: 'Indicates the current "pressed" state of toggle buttons.',
241
- required: false,
242
- control: "text",
243
- type: "string"
244
- },
245
- "aria-readonly": {
246
- description: "Indicates that the element is not editable, but is otherwise operable.",
247
- required: false,
248
- control: "boolean",
249
- type: "boolean"
250
- },
251
- "aria-relevant": {
252
- description: "Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.",
253
- required: false,
254
- control: "select",
255
- type: "string",
256
- options: [
257
- "text",
258
- "additions",
259
- "additions removals",
260
- "additions text",
261
- "all",
262
- "removals",
263
- "removals additions",
264
- "removals text",
265
- "text additions",
266
- "text removals"
267
- ]
268
- },
269
- "aria-required": {
270
- description: "Indicates that user input is required on the element before a form may be submitted.",
271
- required: false,
272
- control: "boolean",
273
- type: "boolean"
274
- },
275
- "aria-roledescription": {
276
- description: "Defines a human-readable, author-localized description for the role of an element.",
277
- required: false,
278
- control: "text",
279
- type: "string"
280
- },
281
- "aria-rowcount": {
282
- description: "Defines the total number of rows in a table, grid, or treegrid.",
283
- required: false,
284
- control: "number",
285
- type: "number"
286
- },
287
- "aria-rowindex": {
288
- description: "Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid.",
289
- required: false,
290
- control: "number",
291
- type: "number"
292
- },
293
- "aria-rowindextext": {
294
- description: "Defines a human readable text alternative of aria-rowindex.",
295
- required: false,
296
- control: "text",
297
- type: "string"
298
- },
299
- "aria-rowspan": {
300
- description: "Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.",
301
- required: false,
302
- control: "number",
303
- type: "number"
304
- },
305
- "aria-selected": {
306
- description: 'Indicates the current "selected" state of various widgets.',
307
- required: false,
308
- control: "boolean",
309
- type: "boolean"
310
- },
311
- "aria-setsize": {
312
- description: "Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.",
313
- required: false,
314
- control: "number",
315
- type: "number"
316
- },
317
- "aria-sort": {
318
- description: "Indicates if items in a table or grid are sorted in ascending or descending order.",
319
- required: false,
320
- control: "select",
321
- type: "string",
322
- options: ["none", "ascending", "descending", "other"]
323
- },
324
- "aria-valuemax": {
325
- description: "Defines the maximum allowed value for a range widget.",
326
- required: false,
327
- control: "number",
328
- type: "number"
329
- },
330
- "aria-valuemin": {
331
- description: "Defines the minimum allowed value for a range widget.",
332
- required: false,
333
- control: "number",
334
- type: "number"
335
- },
336
- "aria-valuenow": {
337
- description: "Defines the current value for a range widget.",
338
- required: false,
339
- control: "number",
340
- type: "number"
341
- },
342
- "aria-valuetext": {
343
- description: "Defines the human readable text alternative of aria-valuenow for a range widget.",
344
- required: false,
345
- control: "text",
346
- type: "string"
347
- },
348
- autoCapitalize: {
349
- required: false,
350
- control: "text",
351
- type: "string",
352
- description: "Sets whether input is automatically capitalized when entered by user."
353
- },
354
- autoCorrect: { required: false, control: "text", type: "string" },
355
- autoFocus: {
356
- required: false,
357
- control: "boolean",
358
- type: "boolean",
359
- description: "Indicates that an element should be focused on page load, or when its parent dialog is displayed."
360
- },
361
- autoSave: { required: false, control: "text", type: "string" },
362
- className: { required: false, control: "text", type: "string" },
363
- color: {
364
- required: false,
365
- control: "color",
366
- type: "string",
367
- description: "This attribute sets the text color using either a named color or a color specified in the hexadecimal #RRGGBB format. Note: This is a legacy attribute. Please use the CSS color property instead."
368
- },
369
- content: {
370
- required: false,
371
- control: "text",
372
- type: "string",
373
- description: "A value associated with http-equiv orname depending on the context."
374
- },
375
- contextMenu: {
376
- required: false,
377
- control: "text",
378
- type: "string",
379
- description: "Defines the ID of a menu element which willserve as the element's context menu."
380
- },
381
- datatype: { required: false, control: "text", type: "string" },
382
- defaultValue: { required: false, control: "text", type: "string" },
383
- dir: {
384
- required: false,
385
- control: "text",
386
- type: "string",
387
- description: "Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)"
388
- },
389
- disabled: {
390
- required: false,
391
- control: "boolean",
392
- type: "boolean",
393
- description: "Indicates whether the user can interact with the element."
394
- },
395
- draggable: {
396
- required: false,
397
- control: "boolean",
398
- type: "boolean",
399
- description: "Defines whether the element can be dragged."
400
- },
401
- hidden: {
402
- required: false,
403
- control: "boolean",
404
- type: "boolean",
405
- description: "Prevents rendering of given element, while keeping child elements, e.g. script elements, active."
406
- },
407
- id: {
408
- required: false,
409
- control: "text",
410
- type: "string",
411
- description: "Often used with CSS to style a specific element. The value of this attribute must be unique."
412
- },
413
- inputMode: {
414
- description: "Hints at the type of data that might be entered by the user while editing the element or its contents",
415
- required: false,
416
- control: "select",
417
- type: "string",
418
- options: [
419
- "search",
420
- "text",
421
- "none",
422
- "tel",
423
- "url",
424
- "email",
425
- "numeric",
426
- "decimal"
427
- ]
428
- },
429
- is: {
430
- description: "Specify that a standard HTML element should behave like a defined custom built-in element",
431
- required: false,
432
- control: "text",
433
- type: "string"
434
- },
435
- itemID: { required: false, control: "text", type: "string" },
436
- itemProp: { required: false, control: "text", type: "string" },
437
- itemRef: { required: false, control: "text", type: "string" },
438
- itemScope: { required: false, control: "boolean", type: "boolean" },
439
- itemType: { required: false, control: "text", type: "string" },
440
- lang: {
441
- required: false,
442
- control: "text",
443
- type: "string",
444
- description: "Defines the language used in the element."
445
- },
446
- nonce: { required: false, control: "text", type: "string" },
447
- open: {
448
- required: false,
449
- control: "boolean",
450
- type: "boolean",
451
- description: "Show or hide the content of this component on the canvas. This will not affect the initial state of the component."
452
- },
453
- prefix: { required: false, control: "text", type: "string" },
454
- property: { required: false, control: "text", type: "string" },
455
- radioGroup: { required: false, control: "text", type: "string" },
456
- rel: {
457
- required: false,
458
- control: "text",
459
- type: "string",
460
- description: "Specifies the relationship of the target object to the link object."
461
- },
462
- resource: { required: false, control: "text", type: "string" },
463
- results: { required: false, control: "number", type: "number" },
464
- rev: { required: false, control: "text", type: "string" },
465
- role: {
466
- required: false,
467
- control: "text",
468
- type: "string",
469
- description: "Defines an explicit role for an element for use by assistive technologies."
470
- },
471
- security: { required: false, control: "text", type: "string" },
472
- slot: {
473
- required: false,
474
- control: "text",
475
- type: "string",
476
- description: "Assigns a slot in a shadow DOM shadow tree to an element."
477
- },
478
- spellCheck: {
479
- required: false,
480
- control: "boolean",
481
- type: "boolean",
482
- description: "Indicates whether spell checking is allowed for the element."
483
- },
484
- suppressContentEditableWarning: {
485
- required: false,
486
- control: "boolean",
487
- type: "boolean"
488
- },
489
- suppressHydrationWarning: {
490
- required: false,
491
- control: "boolean",
492
- type: "boolean"
493
- },
494
- tabIndex: {
495
- required: false,
496
- control: "number",
497
- type: "number",
498
- description: "Overrides the browser's default tab order and follows the one specified instead."
499
- },
500
- title: {
501
- required: false,
502
- control: "text",
503
- type: "string",
504
- description: "Text to be displayed in a tooltip when hovering over the element."
505
- },
506
- translate: {
507
- required: false,
508
- control: "radio",
509
- type: "string",
510
- options: ["yes", "no"],
511
- description: "Specify whether an element's attribute values and the values of its text node children are to be translated when the page is localized, or whether to leave them unchanged."
512
- },
513
- typeof: { required: false, control: "text", type: "string" },
514
- unselectable: {
515
- required: false,
516
- control: "radio",
517
- type: "string",
518
- options: ["on", "off"]
519
- },
520
- vocab: { required: false, control: "text", type: "string" }
521
- };
522
-
523
- // src/theme/__generated__/tailwind-theme.ts
524
- var spacing = {
525
- "0": { type: "unit", unit: "px", value: 0 },
526
- "1": { type: "unit", unit: "rem", value: 0.25 },
527
- "2": { type: "unit", unit: "rem", value: 0.5 },
528
- "3": { type: "unit", unit: "rem", value: 0.75 },
529
- "4": { type: "unit", unit: "rem", value: 1 },
530
- "5": { type: "unit", unit: "rem", value: 1.25 },
531
- "6": { type: "unit", unit: "rem", value: 1.5 },
532
- "7": { type: "unit", unit: "rem", value: 1.75 },
533
- "8": { type: "unit", unit: "rem", value: 2 },
534
- "9": { type: "unit", unit: "rem", value: 2.25 },
535
- "10": { type: "unit", unit: "rem", value: 2.5 },
536
- "11": { type: "unit", unit: "rem", value: 2.75 },
537
- "12": { type: "unit", unit: "rem", value: 3 },
538
- "14": { type: "unit", unit: "rem", value: 3.5 },
539
- "16": { type: "unit", unit: "rem", value: 4 },
540
- "20": { type: "unit", unit: "rem", value: 5 },
541
- "24": { type: "unit", unit: "rem", value: 6 },
542
- "28": { type: "unit", unit: "rem", value: 7 },
543
- "32": { type: "unit", unit: "rem", value: 8 },
544
- "36": { type: "unit", unit: "rem", value: 9 },
545
- "40": { type: "unit", unit: "rem", value: 10 },
546
- "44": { type: "unit", unit: "rem", value: 11 },
547
- "48": { type: "unit", unit: "rem", value: 12 },
548
- "52": { type: "unit", unit: "rem", value: 13 },
549
- "56": { type: "unit", unit: "rem", value: 14 },
550
- "60": { type: "unit", unit: "rem", value: 15 },
551
- "64": { type: "unit", unit: "rem", value: 16 },
552
- "72": { type: "unit", unit: "rem", value: 18 },
553
- "80": { type: "unit", unit: "rem", value: 20 },
554
- "96": { type: "unit", unit: "rem", value: 24 },
555
- px: { type: "unit", unit: "px", value: 1 },
556
- "0.5": { type: "unit", unit: "rem", value: 0.125 },
557
- "1.5": { type: "unit", unit: "rem", value: 0.375 },
558
- "2.5": { type: "unit", unit: "rem", value: 0.625 },
559
- "3.5": { type: "unit", unit: "rem", value: 0.875 }
560
- };
561
- var padding = {
562
- ...spacing
563
- };
564
- var margin = {
565
- ...spacing,
566
- auto: { type: "keyword", value: "auto" }
567
- };
568
- var width = {
569
- ...spacing,
570
- auto: { type: "keyword", value: "auto" },
571
- "1/2": { type: "unit", unit: "%", value: 50 },
572
- "1/3": { type: "unit", unit: "%", value: 33.333333 },
573
- "2/3": { type: "unit", unit: "%", value: 66.666667 },
574
- "1/4": { type: "unit", unit: "%", value: 25 },
575
- "2/4": { type: "unit", unit: "%", value: 50 },
576
- "3/4": { type: "unit", unit: "%", value: 75 },
577
- "1/5": { type: "unit", unit: "%", value: 20 },
578
- "2/5": { type: "unit", unit: "%", value: 40 },
579
- "3/5": { type: "unit", unit: "%", value: 60 },
580
- "4/5": { type: "unit", unit: "%", value: 80 },
581
- "1/6": { type: "unit", unit: "%", value: 16.666667 },
582
- "2/6": { type: "unit", unit: "%", value: 33.333333 },
583
- "3/6": { type: "unit", unit: "%", value: 50 },
584
- "4/6": { type: "unit", unit: "%", value: 66.666667 },
585
- "5/6": { type: "unit", unit: "%", value: 83.333333 },
586
- "1/12": { type: "unit", unit: "%", value: 8.333333 },
587
- "2/12": { type: "unit", unit: "%", value: 16.666667 },
588
- "3/12": { type: "unit", unit: "%", value: 25 },
589
- "4/12": { type: "unit", unit: "%", value: 33.333333 },
590
- "5/12": { type: "unit", unit: "%", value: 41.666667 },
591
- "6/12": { type: "unit", unit: "%", value: 50 },
592
- "7/12": { type: "unit", unit: "%", value: 58.333333 },
593
- "8/12": { type: "unit", unit: "%", value: 66.666667 },
594
- "9/12": { type: "unit", unit: "%", value: 75 },
595
- "10/12": { type: "unit", unit: "%", value: 83.333333 },
596
- "11/12": { type: "unit", unit: "%", value: 91.666667 },
597
- full: { type: "unit", unit: "%", value: 100 },
598
- screen: { type: "unit", unit: "vw", value: 100 },
599
- min: { type: "keyword", value: "min-content" },
600
- max: { type: "keyword", value: "max-content" },
601
- fit: { type: "keyword", value: "fit-content" }
602
- };
603
- var maxWidth = {
604
- "0": { type: "unit", unit: "rem", value: 0 },
605
- none: { type: "keyword", value: "none" },
606
- xs: { type: "unit", unit: "rem", value: 20 },
607
- sm: { type: "unit", unit: "rem", value: 24 },
608
- md: { type: "unit", unit: "rem", value: 28 },
609
- lg: { type: "unit", unit: "rem", value: 32 },
610
- xl: { type: "unit", unit: "rem", value: 36 },
611
- "2xl": { type: "unit", unit: "rem", value: 42 },
612
- "3xl": { type: "unit", unit: "rem", value: 48 },
613
- "4xl": { type: "unit", unit: "rem", value: 56 },
614
- "5xl": { type: "unit", unit: "rem", value: 64 },
615
- "6xl": { type: "unit", unit: "rem", value: 72 },
616
- "7xl": { type: "unit", unit: "rem", value: 80 },
617
- full: { type: "unit", unit: "%", value: 100 },
618
- min: { type: "keyword", value: "min-content" },
619
- max: { type: "keyword", value: "max-content" },
620
- fit: { type: "keyword", value: "fit-content" },
621
- prose: { type: "unit", unit: "ch", value: 65 }
622
- };
623
- var height = {
624
- ...spacing,
625
- auto: { type: "keyword", value: "auto" },
626
- "1/2": { type: "unit", unit: "%", value: 50 },
627
- "1/3": { type: "unit", unit: "%", value: 33.333333 },
628
- "2/3": { type: "unit", unit: "%", value: 66.666667 },
629
- "1/4": { type: "unit", unit: "%", value: 25 },
630
- "2/4": { type: "unit", unit: "%", value: 50 },
631
- "3/4": { type: "unit", unit: "%", value: 75 },
632
- "1/5": { type: "unit", unit: "%", value: 20 },
633
- "2/5": { type: "unit", unit: "%", value: 40 },
634
- "3/5": { type: "unit", unit: "%", value: 60 },
635
- "4/5": { type: "unit", unit: "%", value: 80 },
636
- "1/6": { type: "unit", unit: "%", value: 16.666667 },
637
- "2/6": { type: "unit", unit: "%", value: 33.333333 },
638
- "3/6": { type: "unit", unit: "%", value: 50 },
639
- "4/6": { type: "unit", unit: "%", value: 66.666667 },
640
- "5/6": { type: "unit", unit: "%", value: 83.333333 },
641
- full: { type: "unit", unit: "%", value: 100 },
642
- screen: { type: "unit", unit: "vh", value: 100 },
643
- min: { type: "keyword", value: "min-content" },
644
- max: { type: "keyword", value: "max-content" },
645
- fit: { type: "keyword", value: "fit-content" }
646
- };
647
- var inset = {
648
- ...spacing,
649
- auto: { type: "keyword", value: "auto" },
650
- "1/2": { type: "unit", unit: "%", value: 50 },
651
- "1/3": { type: "unit", unit: "%", value: 33.333333 },
652
- "2/3": { type: "unit", unit: "%", value: 66.666667 },
653
- "1/4": { type: "unit", unit: "%", value: 25 },
654
- "2/4": { type: "unit", unit: "%", value: 50 },
655
- "3/4": { type: "unit", unit: "%", value: 75 },
656
- full: { type: "unit", unit: "%", value: 100 }
657
- };
658
- var borderWidth = {
659
- "0": { type: "unit", unit: "px", value: 0 },
660
- "2": { type: "unit", unit: "px", value: 2 },
661
- "4": { type: "unit", unit: "px", value: 4 },
662
- "8": { type: "unit", unit: "px", value: 8 },
663
- DEFAULT: { type: "unit", unit: "px", value: 1 }
664
- };
665
- var borderRadius = {
666
- none: { type: "unit", unit: "px", value: 0 },
667
- sm: { type: "unit", unit: "rem", value: 0.125 },
668
- DEFAULT: { type: "unit", unit: "rem", value: 0.5 },
669
- md: { type: "unit", unit: "rem", value: 0.375 },
670
- lg: { type: "unit", unit: "rem", value: 0.5 },
671
- xl: { type: "unit", unit: "rem", value: 0.75 },
672
- "2xl": { type: "unit", unit: "rem", value: 1 },
673
- "3xl": { type: "unit", unit: "rem", value: 1.5 },
674
- full: { type: "unit", unit: "px", value: 9999 }
675
- };
676
- var colors = {
677
- transparent: { type: "keyword", value: "transparent" },
678
- current: { type: "keyword", value: "currentColor" },
679
- inherit: { type: "keyword", value: "inherit" },
680
- popover: { type: "rgb", alpha: 1, r: 255, g: 255, b: 255 },
681
- popoverForeground: { type: "rgb", alpha: 1, r: 2, g: 8, b: 23 },
682
- border: { type: "rgb", alpha: 1, r: 226, g: 232, b: 240 },
683
- background: { type: "rgb", alpha: 1, r: 255, g: 255, b: 255 },
684
- foreground: { type: "rgb", alpha: 1, r: 2, g: 8, b: 23 },
685
- ring: { type: "rgb", alpha: 1, r: 148, g: 163, b: 184 },
686
- mutedForeground: { type: "rgb", alpha: 1, r: 100, g: 116, b: 139 },
687
- muted: { type: "rgb", alpha: 1, r: 241, g: 245, b: 249 },
688
- primary: { type: "rgb", alpha: 1, r: 15, g: 23, b: 42 },
689
- primaryForeground: { type: "rgb", alpha: 1, r: 248, g: 250, b: 252 },
690
- destructive: { type: "rgb", alpha: 1, r: 239, g: 68, b: 68 },
691
- destructiveForeground: { type: "rgb", alpha: 1, r: 248, g: 250, b: 252 },
692
- accent: { type: "rgb", alpha: 1, r: 241, g: 245, b: 249 },
693
- accentForeground: { type: "rgb", alpha: 1, r: 15, g: 23, b: 42 },
694
- input: { type: "rgb", alpha: 1, r: 226, g: 232, b: 240 },
695
- secondary: { type: "rgb", alpha: 1, r: 241, g: 245, b: 249 },
696
- secondaryForeground: { type: "rgb", alpha: 1, r: 15, g: 23, b: 42 }
697
- };
698
- var zIndex = {
699
- "0": { type: "unit", unit: "number", value: 0 },
700
- "10": { type: "unit", unit: "number", value: 10 },
701
- "20": { type: "unit", unit: "number", value: 20 },
702
- "30": { type: "unit", unit: "number", value: 30 },
703
- "40": { type: "unit", unit: "number", value: 40 },
704
- "50": { type: "unit", unit: "number", value: 50 },
705
- auto: { type: "keyword", value: "auto" }
706
- };
707
- var opacity = {
708
- "0": { type: "unit", unit: "number", value: 0 },
709
- "5": { type: "unit", unit: "number", value: 0.05 },
710
- "10": { type: "unit", unit: "number", value: 0.1 },
711
- "20": { type: "unit", unit: "number", value: 0.2 },
712
- "25": { type: "unit", unit: "number", value: 0.25 },
713
- "30": { type: "unit", unit: "number", value: 0.3 },
714
- "40": { type: "unit", unit: "number", value: 0.4 },
715
- "50": { type: "unit", unit: "number", value: 0.5 },
716
- "60": { type: "unit", unit: "number", value: 0.6 },
717
- "70": { type: "unit", unit: "number", value: 0.7 },
718
- "75": { type: "unit", unit: "number", value: 0.75 },
719
- "80": { type: "unit", unit: "number", value: 0.8 },
720
- "90": { type: "unit", unit: "number", value: 0.9 },
721
- "95": { type: "unit", unit: "number", value: 0.95 },
722
- "100": { type: "unit", unit: "number", value: 1 }
723
- };
724
- var cursor = {
725
- auto: { type: "keyword", value: "auto" },
726
- default: { type: "keyword", value: "default" },
727
- pointer: { type: "keyword", value: "pointer" },
728
- wait: { type: "keyword", value: "wait" },
729
- text: { type: "keyword", value: "text" },
730
- move: { type: "keyword", value: "move" },
731
- help: { type: "keyword", value: "help" },
732
- "not-allowed": { type: "keyword", value: "not-allowed" },
733
- none: { type: "keyword", value: "none" },
734
- "context-menu": { type: "keyword", value: "context-menu" },
735
- progress: { type: "keyword", value: "progress" },
736
- cell: { type: "keyword", value: "cell" },
737
- crosshair: { type: "keyword", value: "crosshair" },
738
- "vertical-text": { type: "keyword", value: "vertical-text" },
739
- alias: { type: "keyword", value: "alias" },
740
- copy: { type: "keyword", value: "copy" },
741
- "no-drop": { type: "keyword", value: "no-drop" },
742
- grab: { type: "keyword", value: "grab" },
743
- grabbing: { type: "keyword", value: "grabbing" },
744
- "all-scroll": { type: "keyword", value: "all-scroll" },
745
- "col-resize": { type: "keyword", value: "col-resize" },
746
- "row-resize": { type: "keyword", value: "row-resize" },
747
- "n-resize": { type: "keyword", value: "n-resize" },
748
- "e-resize": { type: "keyword", value: "e-resize" },
749
- "s-resize": { type: "keyword", value: "s-resize" },
750
- "w-resize": { type: "keyword", value: "w-resize" },
751
- "ne-resize": { type: "keyword", value: "ne-resize" },
752
- "nw-resize": { type: "keyword", value: "nw-resize" },
753
- "se-resize": { type: "keyword", value: "se-resize" },
754
- "sw-resize": { type: "keyword", value: "sw-resize" },
755
- "ew-resize": { type: "keyword", value: "ew-resize" },
756
- "ns-resize": { type: "keyword", value: "ns-resize" },
757
- "nesw-resize": { type: "keyword", value: "nesw-resize" },
758
- "nwse-resize": { type: "keyword", value: "nwse-resize" },
759
- "zoom-in": { type: "keyword", value: "zoom-in" },
760
- "zoom-out": { type: "keyword", value: "zoom-out" }
761
- };
762
- var lineHeight = {
763
- "3": { type: "unit", unit: "rem", value: 0.75 },
764
- "4": { type: "unit", unit: "rem", value: 1 },
765
- "5": { type: "unit", unit: "rem", value: 1.25 },
766
- "6": { type: "unit", unit: "rem", value: 1.5 },
767
- "7": { type: "unit", unit: "rem", value: 1.75 },
768
- "8": { type: "unit", unit: "rem", value: 2 },
769
- "9": { type: "unit", unit: "rem", value: 2.25 },
770
- "10": { type: "unit", unit: "rem", value: 2.5 },
771
- none: { type: "unit", unit: "number", value: 1 },
772
- tight: { type: "unit", unit: "number", value: 1.25 },
773
- snug: { type: "unit", unit: "number", value: 1.375 },
774
- normal: { type: "unit", unit: "number", value: 1.5 },
775
- relaxed: { type: "unit", unit: "number", value: 1.625 },
776
- loose: { type: "unit", unit: "number", value: 2 }
777
- };
778
- var letterSpacing = {
779
- tighter: { type: "unit", unit: "em", value: -0.05 },
780
- tight: { type: "unit", unit: "em", value: -0.025 },
781
- normal: { type: "unit", unit: "em", value: 0 },
782
- wide: { type: "unit", unit: "em", value: 0.025 },
783
- wider: { type: "unit", unit: "em", value: 0.05 },
784
- widest: { type: "unit", unit: "em", value: 0.1 }
785
- };
786
- var listStyleType = {
787
- none: { type: "keyword", value: "none" },
788
- disc: { type: "keyword", value: "disc" },
789
- decimal: { type: "keyword", value: "decimal" }
790
- };
791
- var lineClamp = {
792
- "1": { type: "unit", unit: "number", value: 1 },
793
- "2": { type: "unit", unit: "number", value: 2 },
794
- "3": { type: "unit", unit: "number", value: 3 },
795
- "4": { type: "unit", unit: "number", value: 4 },
796
- "5": { type: "unit", unit: "number", value: 5 },
797
- "6": { type: "unit", unit: "number", value: 6 }
798
- };
799
- var ringWidth = {
800
- "0": { type: "unit", unit: "px", value: 0 },
801
- "1": { type: "unit", unit: "px", value: 1 },
802
- "2": { type: "unit", unit: "px", value: 2 },
803
- "4": { type: "unit", unit: "px", value: 4 },
804
- "8": { type: "unit", unit: "px", value: 8 },
805
- DEFAULT: { type: "unit", unit: "px", value: 3 }
806
- };
807
- var ringOffsetWidth = {
808
- "0": { type: "unit", unit: "px", value: 0 },
809
- "1": { type: "unit", unit: "px", value: 1 },
810
- "2": { type: "unit", unit: "px", value: 2 },
811
- "4": { type: "unit", unit: "px", value: 4 },
812
- "8": { type: "unit", unit: "px", value: 8 }
813
- };
814
- var boxShadow = {
815
- sm: {
816
- type: "layers",
817
- value: [
818
- {
819
- type: "tuple",
820
- value: [
821
- { type: "unit", value: 0, unit: "number" },
822
- { type: "unit", value: 1, unit: "px" },
823
- { type: "unit", value: 2, unit: "px" },
824
- { type: "unit", value: 0, unit: "number" },
825
- { type: "rgb", alpha: 0.05, r: 0, g: 0, b: 0 }
826
- ]
827
- }
828
- ]
829
- },
830
- DEFAULT: {
831
- type: "layers",
832
- value: [
833
- {
834
- type: "tuple",
835
- value: [
836
- { type: "unit", value: 0, unit: "number" },
837
- { type: "unit", value: 1, unit: "px" },
838
- { type: "unit", value: 3, unit: "px" },
839
- { type: "unit", value: 0, unit: "number" },
840
- { type: "rgb", alpha: 0.1, r: 0, g: 0, b: 0 }
841
- ]
842
- },
843
- {
844
- type: "tuple",
845
- value: [
846
- { type: "unit", value: 0, unit: "number" },
847
- { type: "unit", value: 1, unit: "px" },
848
- { type: "unit", value: 2, unit: "px" },
849
- { type: "unit", value: -1, unit: "px" },
850
- { type: "rgb", alpha: 0.1, r: 0, g: 0, b: 0 }
851
- ]
852
- }
853
- ]
854
- },
855
- md: {
856
- type: "layers",
857
- value: [
858
- {
859
- type: "tuple",
860
- value: [
861
- { type: "unit", value: 0, unit: "number" },
862
- { type: "unit", value: 4, unit: "px" },
863
- { type: "unit", value: 6, unit: "px" },
864
- { type: "unit", value: -1, unit: "px" },
865
- { type: "rgb", alpha: 0.1, r: 0, g: 0, b: 0 }
866
- ]
867
- },
868
- {
869
- type: "tuple",
870
- value: [
871
- { type: "unit", value: 0, unit: "number" },
872
- { type: "unit", value: 2, unit: "px" },
873
- { type: "unit", value: 4, unit: "px" },
874
- { type: "unit", value: -2, unit: "px" },
875
- { type: "rgb", alpha: 0.1, r: 0, g: 0, b: 0 }
876
- ]
877
- }
878
- ]
879
- },
880
- lg: {
881
- type: "layers",
882
- value: [
883
- {
884
- type: "tuple",
885
- value: [
886
- { type: "unit", value: 0, unit: "number" },
887
- { type: "unit", value: 10, unit: "px" },
888
- { type: "unit", value: 15, unit: "px" },
889
- { type: "unit", value: -3, unit: "px" },
890
- { type: "rgb", alpha: 0.1, r: 0, g: 0, b: 0 }
891
- ]
892
- },
893
- {
894
- type: "tuple",
895
- value: [
896
- { type: "unit", value: 0, unit: "number" },
897
- { type: "unit", value: 4, unit: "px" },
898
- { type: "unit", value: 6, unit: "px" },
899
- { type: "unit", value: -4, unit: "px" },
900
- { type: "rgb", alpha: 0.1, r: 0, g: 0, b: 0 }
901
- ]
902
- }
903
- ]
904
- },
905
- xl: {
906
- type: "layers",
907
- value: [
908
- {
909
- type: "tuple",
910
- value: [
911
- { type: "unit", value: 0, unit: "number" },
912
- { type: "unit", value: 20, unit: "px" },
913
- { type: "unit", value: 25, unit: "px" },
914
- { type: "unit", value: -5, unit: "px" },
915
- { type: "rgb", alpha: 0.1, r: 0, g: 0, b: 0 }
916
- ]
917
- },
918
- {
919
- type: "tuple",
920
- value: [
921
- { type: "unit", value: 0, unit: "number" },
922
- { type: "unit", value: 8, unit: "px" },
923
- { type: "unit", value: 10, unit: "px" },
924
- { type: "unit", value: -6, unit: "px" },
925
- { type: "rgb", alpha: 0.1, r: 0, g: 0, b: 0 }
926
- ]
927
- }
928
- ]
929
- },
930
- "2xl": {
931
- type: "layers",
932
- value: [
933
- {
934
- type: "tuple",
935
- value: [
936
- { type: "unit", value: 0, unit: "number" },
937
- { type: "unit", value: 25, unit: "px" },
938
- { type: "unit", value: 50, unit: "px" },
939
- { type: "unit", value: -12, unit: "px" },
940
- { type: "rgb", alpha: 0.25, r: 0, g: 0, b: 0 }
941
- ]
942
- }
943
- ]
944
- },
945
- inner: {
946
- type: "layers",
947
- value: [
948
- {
949
- type: "tuple",
950
- value: [
951
- { type: "keyword", value: "inset" },
952
- { type: "unit", value: 0, unit: "number" },
953
- { type: "unit", value: 2, unit: "px" },
954
- { type: "unit", value: 4, unit: "px" },
955
- { type: "unit", value: 0, unit: "number" },
956
- { type: "rgb", alpha: 0.05, r: 0, g: 0, b: 0 }
957
- ]
958
- }
959
- ]
960
- },
961
- none: {
962
- type: "layers",
963
- value: [{ type: "tuple", value: [{ type: "keyword", value: "none" }] }]
964
- }
965
- };
966
- var blur = {
967
- sm: { type: "unparsed", value: "blur(0 1px 2px 0 rgb(0 0 0 / 0.05))" },
968
- DEFAULT: {
969
- type: "unparsed",
970
- value: "blur(0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1))"
971
- },
972
- md: {
973
- type: "unparsed",
974
- value: "blur(0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1))"
975
- },
976
- lg: {
977
- type: "unparsed",
978
- value: "blur(0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1))"
979
- },
980
- xl: {
981
- type: "unparsed",
982
- value: "blur(0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1))"
983
- },
984
- "2xl": {
985
- type: "unparsed",
986
- value: "blur(0 25px 50px -12px rgb(0 0 0 / 0.25))"
987
- },
988
- inner: {
989
- type: "unparsed",
990
- value: "blur(inset 0 2px 4px 0 rgb(0 0 0 / 0.05))"
991
- },
992
- none: { type: "unparsed", value: "blur(none)" }
993
- };
994
- var fontSize = {
995
- xs: { type: "unit", unit: "rem", value: 0.75 },
996
- sm: { type: "unit", unit: "rem", value: 0.875 },
997
- base: { type: "unit", unit: "rem", value: 1 },
998
- lg: { type: "unit", unit: "rem", value: 1.125 },
999
- xl: { type: "unit", unit: "rem", value: 1.25 },
1000
- "2xl": { type: "unit", unit: "rem", value: 1.5 },
1001
- "3xl": { type: "unit", unit: "rem", value: 1.875 },
1002
- "4xl": { type: "unit", unit: "rem", value: 2.25 },
1003
- "5xl": { type: "unit", unit: "rem", value: 3 },
1004
- "6xl": { type: "unit", unit: "rem", value: 3.75 },
1005
- "7xl": { type: "unit", unit: "rem", value: 4.5 },
1006
- "8xl": { type: "unit", unit: "rem", value: 6 },
1007
- "9xl": { type: "unit", unit: "rem", value: 8 }
1008
- };
1009
- var fontSizeLineHeight = {
1010
- xs: { type: "unit", unit: "rem", value: 1 },
1011
- sm: { type: "unit", unit: "rem", value: 1.25 },
1012
- base: { type: "unit", unit: "rem", value: 1.5 },
1013
- lg: { type: "unit", unit: "rem", value: 1.75 },
1014
- xl: { type: "unit", unit: "rem", value: 1.75 },
1015
- "2xl": { type: "unit", unit: "rem", value: 2 },
1016
- "3xl": { type: "unit", unit: "rem", value: 2.25 },
1017
- "4xl": { type: "unit", unit: "rem", value: 2.5 },
1018
- "5xl": { type: "unit", unit: "number", value: 1 },
1019
- "6xl": { type: "unit", unit: "number", value: 1 },
1020
- "7xl": { type: "unit", unit: "number", value: 1 },
1021
- "8xl": { type: "unit", unit: "number", value: 1 },
1022
- "9xl": { type: "unit", unit: "number", value: 1 }
1023
- };
1024
-
1025
- // src/theme/tailwind-classes.ts
1026
- var property = (property2, value) => {
1027
- if (value.startsWith("--")) {
1028
- return {
1029
- property: property2,
1030
- value: { type: "var", value: value.slice(2) }
1031
- };
1032
- }
1033
- return {
1034
- property: property2,
1035
- value: { type: "unparsed", value }
1036
- };
1037
- };
1038
- var preflight = () => {
1039
- const borderColorValue = colors.border;
1040
- return [
1041
- {
1042
- property: "borderTopStyle",
1043
- value: { type: "keyword", value: "solid" }
1044
- },
1045
- {
1046
- property: "borderRightStyle",
1047
- value: { type: "keyword", value: "solid" }
1048
- },
1049
- {
1050
- property: "borderBottomStyle",
1051
- value: { type: "keyword", value: "solid" }
1052
- },
1053
- {
1054
- property: "borderLeftStyle",
1055
- value: { type: "keyword", value: "solid" }
1056
- },
1057
- {
1058
- property: "borderTopColor",
1059
- value: borderColorValue
1060
- },
1061
- {
1062
- property: "borderRightColor",
1063
- value: borderColorValue
1064
- },
1065
- {
1066
- property: "borderBottomColor",
1067
- value: borderColorValue
1068
- },
1069
- {
1070
- property: "borderLeftColor",
1071
- value: borderColorValue
1072
- }
1073
- ];
1074
- };
1075
- var z = (value) => {
1076
- return [
1077
- {
1078
- property: "zIndex",
1079
- value: zIndex[value]
1080
- }
1081
- ];
1082
- };
1083
- var overflow = (value) => [
1084
- {
1085
- property: "overflowX",
1086
- value: { type: "keyword", value }
1087
- },
1088
- {
1089
- property: "overflowY",
1090
- value: { type: "keyword", value }
1091
- }
1092
- ];
1093
- var rounded = (value = "DEFAULT") => {
1094
- const styleValue = borderRadius[value];
1095
- return [
1096
- { property: "borderTopLeftRadius", value: styleValue },
1097
- { property: "borderTopRightRadius", value: styleValue },
1098
- { property: "borderBottomRightRadius", value: styleValue },
1099
- { property: "borderBottomLeftRadius", value: styleValue }
1100
- ];
1101
- };
1102
- var border = (borderWidthOrColor) => {
1103
- if (typeof borderWidthOrColor === "number" || borderWidthOrColor === void 0) {
1104
- const styleValue2 = borderWidth[borderWidthOrColor ?? "DEFAULT"];
1105
- return [
1106
- ...preflight(),
1107
- { property: "borderTopWidth", value: styleValue2 },
1108
- { property: "borderRightWidth", value: styleValue2 },
1109
- { property: "borderBottomWidth", value: styleValue2 },
1110
- { property: "borderLeftWidth", value: styleValue2 }
1111
- ];
1112
- }
1113
- const styleValue = colors[borderWidthOrColor];
1114
- return [
1115
- { property: "borderTopColor", value: styleValue },
1116
- { property: "borderRightColor", value: styleValue },
1117
- { property: "borderBottomColor", value: styleValue },
1118
- { property: "borderLeftColor", value: styleValue }
1119
- ];
1120
- };
1121
- var borderB = (borderWidthOrColor) => {
1122
- let widthValue = { type: "unit", value: 1, unit: "number" };
1123
- let colorValue = colors.border;
1124
- if (typeof borderWidthOrColor === "number" || borderWidthOrColor === void 0) {
1125
- widthValue = borderWidth[borderWidthOrColor ?? "DEFAULT"];
1126
- } else {
1127
- colorValue = colors[borderWidthOrColor];
1128
- }
1129
- return [
1130
- {
1131
- property: "borderBottomWidth",
1132
- value: widthValue
1133
- },
1134
- {
1135
- property: "borderBottomStyle",
1136
- value: { type: "keyword", value: "solid" }
1137
- },
1138
- {
1139
- property: "borderBottomColor",
1140
- value: colorValue
1141
- }
1142
- ];
1143
- };
1144
- var paddingProperty = (property2) => (padding2) => {
1145
- return [{ property: property2, value: padding[padding2] }];
1146
- };
1147
- var pt = (padding2) => {
1148
- return paddingProperty("paddingTop")(padding2);
1149
- };
1150
- var pb = (padding2) => {
1151
- return paddingProperty("paddingBottom")(padding2);
1152
- };
1153
- var pl = (padding2) => {
1154
- return paddingProperty("paddingLeft")(padding2);
1155
- };
1156
- var pr = (padding2) => {
1157
- return paddingProperty("paddingRight")(padding2);
1158
- };
1159
- var px = (padding2) => {
1160
- return [pl(padding2), pr(padding2)].flat();
1161
- };
1162
- var py = (padding2) => {
1163
- return [pt(padding2), pb(padding2)].flat();
1164
- };
1165
- var p = (padding2) => {
1166
- return [px(padding2), py(padding2)].flat();
1167
- };
1168
- var marginProperty = (property2) => (margin2) => {
1169
- return [{ property: property2, value: margin[margin2] }];
1170
- };
1171
- var ml = (margin2) => {
1172
- return marginProperty("marginLeft")(margin2);
1173
- };
1174
- var mr = (margin2) => {
1175
- return marginProperty("marginRight")(margin2);
1176
- };
1177
- var mt = (margin2) => {
1178
- return marginProperty("marginTop")(margin2);
1179
- };
1180
- var mb = (margin2) => {
1181
- return marginProperty("marginBottom")(margin2);
1182
- };
1183
- var mx = (margin2) => {
1184
- return [ml(margin2), mr(margin2)].flat();
1185
- };
1186
- var my = (margin2) => {
1187
- return [mt(margin2), mb(margin2)].flat();
1188
- };
1189
- var m = (margin2) => {
1190
- return [mx(margin2), my(margin2)].flat();
1191
- };
1192
- var w = (spacing2) => {
1193
- return [{ property: "width", value: width[spacing2] }];
1194
- };
1195
- var h = (spacing2) => {
1196
- return [{ property: "height", value: height[spacing2] }];
1197
- };
1198
- var opacity2 = (opacity3) => {
1199
- return [
1200
- {
1201
- property: "opacity",
1202
- value: opacity[opacity3]
1203
- }
1204
- ];
1205
- };
1206
- var cursor2 = (cursor3) => {
1207
- return [
1208
- {
1209
- property: "cursor",
1210
- value: cursor[cursor3]
1211
- }
1212
- ];
1213
- };
1214
- var maxW = (spacing2) => {
1215
- return [{ property: "maxWidth", value: maxWidth[spacing2] }];
1216
- };
1217
- var positionStyle = (property2, spacing2) => {
1218
- return { property: property2, value: inset[spacing2] };
1219
- };
1220
- var top = (spacing2) => [positionStyle("top", spacing2)];
1221
- var right = (spacing2) => [positionStyle("right", spacing2)];
1222
- var left = (spacing2) => [positionStyle("left", spacing2)];
1223
- var inset2 = (spacing2) => [
1224
- positionStyle("left", spacing2),
1225
- positionStyle("right", spacing2),
1226
- positionStyle("top", spacing2),
1227
- positionStyle("bottom", spacing2)
1228
- ];
1229
- var aspect = (value) => {
1230
- let unparsed = value;
1231
- if (value === "square") {
1232
- unparsed = "1 / 1";
1233
- }
1234
- if (value === "video") {
1235
- unparsed = "16 / 9";
1236
- }
1237
- return [
1238
- {
1239
- property: "aspectRatio",
1240
- value: { type: "unparsed", value: unparsed }
1241
- }
1242
- ];
1243
- };
1244
- var backdropBlur = (blur2) => {
1245
- return [{ property: "backdropFilter", value: blur[blur2] }];
1246
- };
1247
- var list = (listStyle) => {
1248
- return [{ property: "listStyleType", value: listStyleType[listStyle] }];
1249
- };
1250
- var select = (_selectValue) => {
1251
- return [
1252
- {
1253
- property: "userSelect",
1254
- value: {
1255
- type: "keyword",
1256
- value: "none"
1257
- }
1258
- }
1259
- ];
1260
- };
1261
- var bg = (color, alpha) => {
1262
- const value = colors[color];
1263
- if (alpha !== void 0 && value.type === "rgb") {
1264
- value.alpha = alpha / 100;
1265
- }
1266
- return [
1267
- {
1268
- property: "backgroundColor",
1269
- value
1270
- }
1271
- ];
1272
- };
1273
- var fixed = () => {
1274
- return [{ property: "position", value: { type: "keyword", value: "fixed" } }];
1275
- };
1276
- var relative = () => {
1277
- return [
1278
- { property: "position", value: { type: "keyword", value: "relative" } }
1279
- ];
1280
- };
1281
- var absolute = () => {
1282
- return [
1283
- { property: "position", value: { type: "keyword", value: "absolute" } }
1284
- ];
1285
- };
1286
- var alignItems = {
1287
- start: "flex-start",
1288
- end: "flex-end",
1289
- center: "center",
1290
- baseline: "baseline",
1291
- stretch: "stretch"
1292
- };
1293
- var items = (alignItemsParam) => {
1294
- return [
1295
- {
1296
- property: "alignItems",
1297
- value: {
1298
- type: "keyword",
1299
- value: alignItems[alignItemsParam]
1300
- }
1301
- }
1302
- ];
1303
- };
1304
- var justifyContent = {
1305
- start: "flex-start",
1306
- end: "flex-end",
1307
- center: "center",
1308
- between: "space-between",
1309
- around: "space-around",
1310
- evenly: "space-evenly",
1311
- stretch: "stretch"
1312
- };
1313
- var justify = (justifyContentParam) => {
1314
- return [
1315
- {
1316
- property: "justifyContent",
1317
- value: {
1318
- type: "keyword",
1319
- value: justifyContent[justifyContentParam]
1320
- }
1321
- }
1322
- ];
1323
- };
1324
- var inlineFlex = () => {
1325
- return [
1326
- { property: "display", value: { type: "keyword", value: "inline-flex" } }
1327
- ];
1328
- };
1329
- var block = () => {
1330
- return [{ property: "display", value: { type: "keyword", value: "block" } }];
1331
- };
1332
- var flexDirection = { row: "row", col: "column" };
1333
- var flex = (flexParam) => {
1334
- if (flexParam === void 0) {
1335
- return [{ property: "display", value: { type: "keyword", value: "flex" } }];
1336
- }
1337
- if (flexParam === 1) {
1338
- return [
1339
- {
1340
- property: "flexGrow",
1341
- value: { type: "unit", value: 1, unit: "number" }
1342
- },
1343
- {
1344
- property: "flexShrink",
1345
- value: { type: "unit", value: 1, unit: "number" }
1346
- },
1347
- {
1348
- property: "flexBasis",
1349
- value: { type: "unit", value: 0, unit: "%" }
1350
- }
1351
- ];
1352
- }
1353
- if (flexParam === "auto") {
1354
- return [
1355
- {
1356
- property: "flexGrow",
1357
- value: { type: "unit", value: 1, unit: "number" }
1358
- },
1359
- {
1360
- property: "flexShrink",
1361
- value: { type: "unit", value: 1, unit: "number" }
1362
- },
1363
- {
1364
- property: "flexBasis",
1365
- value: { type: "keyword", value: "auto" }
1366
- }
1367
- ];
1368
- }
1369
- if (flexParam === "initial") {
1370
- return [
1371
- {
1372
- property: "flexGrow",
1373
- value: { type: "unit", value: 0, unit: "number" }
1374
- },
1375
- {
1376
- property: "flexShrink",
1377
- value: { type: "unit", value: 1, unit: "number" }
1378
- },
1379
- {
1380
- property: "flexBasis",
1381
- value: { type: "keyword", value: "auto" }
1382
- }
1383
- ];
1384
- }
1385
- if (flexParam === "none") {
1386
- return [
1387
- {
1388
- property: "flexGrow",
1389
- value: { type: "unit", value: 0, unit: "number" }
1390
- },
1391
- {
1392
- property: "flexShrink",
1393
- value: { type: "unit", value: 0, unit: "number" }
1394
- },
1395
- {
1396
- property: "flexBasis",
1397
- value: { type: "keyword", value: "auto" }
1398
- }
1399
- ];
1400
- }
1401
- return [
1402
- {
1403
- property: "flexDirection",
1404
- value: {
1405
- type: "keyword",
1406
- value: flexDirection[flexParam]
1407
- }
1408
- }
1409
- ];
1410
- };
1411
- var grow = () => {
1412
- return [
1413
- {
1414
- property: "flexGrow",
1415
- value: { type: "unit", value: 1, unit: "number" }
1416
- }
1417
- ];
1418
- };
1419
- var shrink = (value) => {
1420
- return [
1421
- {
1422
- property: "flexGrow",
1423
- value: { type: "unit", value, unit: "number" }
1424
- }
1425
- ];
1426
- };
1427
- var gap = (gapValue) => {
1428
- const value = spacing[gapValue];
1429
- return [
1430
- { property: "rowGap", value },
1431
- { property: "columnGap", value }
1432
- ];
1433
- };
1434
- var lineClamp2 = (lineClampValue) => {
1435
- return [
1436
- ...overflow("hidden"),
1437
- {
1438
- property: "display",
1439
- value: {
1440
- type: "keyword",
1441
- value: "-webkit-box"
1442
- }
1443
- },
1444
- {
1445
- property: "-webkit-box-orient",
1446
- value: {
1447
- type: "keyword",
1448
- value: "vertical"
1449
- }
1450
- },
1451
- {
1452
- property: "-webkit-line-clamp",
1453
- value: lineClamp[lineClampValue]
1454
- }
1455
- ];
1456
- };
1457
- var leading = (lineHeight2) => {
1458
- return [{ property: "lineHeight", value: lineHeight[lineHeight2] }];
1459
- };
1460
- var tracking = (letterSpacing2) => {
1461
- return [
1462
- { property: "letterSpacing", value: letterSpacing[letterSpacing2] }
1463
- ];
1464
- };
1465
- var outline = (_value) => {
1466
- return [
1467
- {
1468
- property: "outlineWidth",
1469
- value: { type: "unit", value: 2, unit: "px" }
1470
- },
1471
- {
1472
- property: "outlineStyle",
1473
- value: { type: "keyword", value: "solid" }
1474
- },
1475
- {
1476
- property: "outlineColor",
1477
- value: { type: "keyword", value: "transparent" }
1478
- },
1479
- {
1480
- property: "outlineOffset",
1481
- value: { type: "unit", value: 2, unit: "px" }
1482
- }
1483
- ];
1484
- };
1485
- var textSizes = Object.keys(fontSize);
1486
- var isTextSize = (value) => textSizes.includes(value);
1487
- var text = (sizeOrColor) => {
1488
- if (isTextSize(sizeOrColor)) {
1489
- return [
1490
- { property: "fontSize", value: fontSize[sizeOrColor] },
1491
- { property: "lineHeight", value: fontSizeLineHeight[sizeOrColor] }
1492
- ];
1493
- }
1494
- return [
1495
- {
1496
- property: "color",
1497
- value: colors[sizeOrColor]
1498
- }
1499
- ];
1500
- };
1501
- var noUnderline = () => {
1502
- return [
1503
- {
1504
- property: "textDecorationLine",
1505
- value: { type: "keyword", value: "none" }
1506
- }
1507
- ];
1508
- };
1509
- var underline = () => {
1510
- return [
1511
- {
1512
- property: "textDecorationLine",
1513
- value: { type: "keyword", value: "underline" }
1514
- }
1515
- ];
1516
- };
1517
- var weights = {
1518
- thin: "100",
1519
- extralight: "200",
1520
- light: "300",
1521
- normal: "400",
1522
- medium: "500",
1523
- semibold: "600",
1524
- bold: "700",
1525
- extrabold: "800",
1526
- black: "900"
1527
- };
1528
- var font = (weight) => {
1529
- return [
1530
- {
1531
- property: "fontWeight",
1532
- value: { type: "keyword", value: weights[weight] }
1533
- }
1534
- ];
1535
- };
1536
- var whitespace = (value) => {
1537
- let whiteSpaceCollapse = "collapse";
1538
- let textWrapMode = "wrap";
1539
- if (value === "normal") {
1540
- [whiteSpaceCollapse, textWrapMode] = ["collapse", "wrap"];
1541
- }
1542
- if (value === "pre") {
1543
- [whiteSpaceCollapse, textWrapMode] = ["preserve", "nowrap"];
1544
- }
1545
- if (value === "pre-wrap") {
1546
- [whiteSpaceCollapse, textWrapMode] = ["preserve", "wrap"];
1547
- }
1548
- if (value === "pre-line") {
1549
- [whiteSpaceCollapse, textWrapMode] = ["preserve-breaks", "wrap"];
1550
- }
1551
- if (value === "break-spaces") {
1552
- [whiteSpaceCollapse, textWrapMode] = ["break-spaces", "wrap"];
1553
- }
1554
- return [
1555
- {
1556
- property: "whiteSpaceCollapse",
1557
- value: { type: "keyword", value: whiteSpaceCollapse }
1558
- },
1559
- {
1560
- property: "textWrapMode",
1561
- value: { type: "keyword", value: textWrapMode }
1562
- }
1563
- ];
1564
- };
1565
- var shadow = (shadowSize) => {
1566
- return [
1567
- {
1568
- property: "boxShadow",
1569
- value: boxShadow[shadowSize]
1570
- }
1571
- ];
1572
- };
1573
- var ring = (ringColor, ringWidth2, ringOffsetColor = "background", ringOffsetWidth2 = 0) => {
1574
- const ringWidthStyleValue = ringWidth[ringWidth2];
1575
- const ringOffsetWidthStyleValue = ringOffsetWidth[ringOffsetWidth2];
1576
- const ringColorStyleValue = colors[ringColor];
1577
- const ringOffsetColorStyleValue = colors[ringOffsetColor];
1578
- const ringOffsetShadow = {
1579
- type: "tuple",
1580
- value: [
1581
- { type: "unit", value: 0, unit: "number" },
1582
- { type: "unit", value: 0, unit: "number" },
1583
- { type: "unit", value: 0, unit: "number" },
1584
- ringOffsetWidthStyleValue,
1585
- ringOffsetColorStyleValue
1586
- ]
1587
- };
1588
- const ringWidthValue = ringWidthStyleValue.type === "unit" ? ringWidthStyleValue.value : 0;
1589
- const ringOffsetWidthValue = ringOffsetWidthStyleValue.type === "unit" ? ringOffsetWidthStyleValue.value : 0;
1590
- const ringShadow = {
1591
- type: "tuple",
1592
- value: [
1593
- { type: "unit", value: 0, unit: "number" },
1594
- { type: "unit", value: 0, unit: "number" },
1595
- { type: "unit", value: 0, unit: "number" },
1596
- {
1597
- type: "unit",
1598
- value: ringWidthValue + ringOffsetWidthValue,
1599
- unit: ringWidthStyleValue.type === "unit" ? ringWidthStyleValue.unit : "number"
1600
- },
1601
- ringColorStyleValue
1602
- ]
1603
- };
1604
- return [
1605
- {
1606
- property: "boxShadow",
1607
- value: {
1608
- type: "layers",
1609
- value: [ringOffsetShadow, ringShadow]
1610
- }
1611
- }
1612
- ];
1613
- };
1614
- var pointerEvents = (value) => {
1615
- return [{ property: "pointerEvents", value: { type: "keyword", value } }];
1616
- };
1617
- var transition = (value) => {
1618
- if (value === "none") {
1619
- return [
1620
- {
1621
- property: "transitionProperty",
1622
- value: { type: "keyword", value: "all" }
1623
- }
1624
- ];
1625
- }
1626
- return [
1627
- {
1628
- property: "transitionProperty",
1629
- value: { type: "keyword", value }
1630
- },
1631
- {
1632
- property: "transitionTimingFunction",
1633
- value: { type: "unparsed", value: "cubic-bezier(0.4, 0, 0.2, 1)" }
1634
- },
1635
- {
1636
- property: "transitionDuration",
1637
- value: { type: "unparsed", value: "150ms" }
1638
- }
1639
- ];
1640
- };
1641
- var duration = (ms) => {
1642
- return [
1643
- {
1644
- property: "transitionDuration",
1645
- value: { type: "unit", value: ms, unit: "ms" }
1646
- }
1647
- ];
1648
- };
1649
- var hover = (value) => {
1650
- return value.map((decl) => ({
1651
- ...decl,
1652
- state: ":hover"
1653
- }));
1654
- };
1655
- var focus = (value) => {
1656
- return value.map((decl) => ({
1657
- ...decl,
1658
- state: ":focus"
1659
- }));
1660
- };
1661
- var focusVisible = (value) => {
1662
- return value.map((decl) => ({
1663
- ...decl,
1664
- state: ":focus-visible"
1665
- }));
1666
- };
1667
- var disabled = (value) => {
1668
- return value.map((decl) => ({
1669
- ...decl,
1670
- state: ":disabled"
1671
- }));
1672
- };
1673
- var state = (value, state2) => {
1674
- return value.map((decl) => ({
1675
- ...decl,
1676
- state: state2
1677
- }));
1678
- };
1679
-
1680
- // src/theme/styles.ts
1681
- var getButtonStyles = (variant, size = "default") => {
1682
- const styles = [
1683
- // 'inline-flex items-center justify-center rounded-md text-sm font-medium
1684
- // ring-offset-background transition-colors
1685
- // focus-visible:outline-none focus-visible:ring-2
1686
- // focus-visible:ring-ring focus-visible:ring-offset-2
1687
- // disabled:pointer-events-none disabled:opacity-50'
1688
- border(0),
1689
- bg("transparent"),
1690
- inlineFlex(),
1691
- items("center"),
1692
- justify("center"),
1693
- rounded("md"),
1694
- text("sm"),
1695
- font("medium"),
1696
- text("current"),
1697
- focusVisible(
1698
- [outline("none"), ring("ring", 2, "background", 2)].flat()
1699
- ),
1700
- state([pointerEvents("none"), opacity2(50)].flat(), ":disabled")
1701
- ].flat();
1702
- let variantStyles = [];
1703
- if (variant === "ghost") {
1704
- variantStyles = [
1705
- state([bg("accent"), text("accentForeground")].flat(), ":hover")
1706
- ].flat();
1707
- }
1708
- if (variant === "outline") {
1709
- variantStyles = [
1710
- border(),
1711
- border("input"),
1712
- bg("background"),
1713
- state(
1714
- [bg("accent", 90), text("accentForeground")].flat(),
1715
- ":hover"
1716
- )
1717
- ].flat();
1718
- }
1719
- let sizeStyles = [];
1720
- if (size === "icon") {
1721
- sizeStyles = [h(10), w(10), px(1.5), py(0)].flat();
1722
- }
1723
- if (size === "sm") {
1724
- sizeStyles = [h(10), px(3)].flat();
1725
- }
1726
- if (size === "default") {
1727
- sizeStyles = [h(10), px(4), py(2)].flat();
1728
- }
1729
- return [...styles, ...variantStyles, ...sizeStyles];
1730
- };
1731
- var buttonReset = [
1732
- {
1733
- property: "backgroundColor",
1734
- value: { type: "keyword", value: "transparent" }
1735
- },
1736
- {
1737
- property: "backgroundImage",
1738
- value: { type: "keyword", value: "none" }
1739
- },
1740
- border(0),
1741
- p(0)
1742
- ].flat();
1743
-
1744
- // src/collapsible.ws.ts
1745
- var presetStyle = {
1746
- div
1747
- };
1748
- var metaCollapsible = {
1749
- category: "radix",
1750
- order: 5,
1751
- type: "container",
1752
- presetStyle,
1753
- icon: CollapsibleIcon,
1754
- description: "An interactive component which expands and collapses some content, triggered by a button.",
1755
- template: [
1756
- {
1757
- type: "instance",
1758
- component: "Collapsible",
1759
- props: [],
1760
- children: [
1761
- {
1762
- type: "instance",
1763
- component: "CollapsibleTrigger",
1764
- children: [
1765
- {
1766
- type: "instance",
1767
- component: "Button",
1768
- styles: getButtonStyles("outline"),
1769
- children: [
1770
- {
1771
- type: "text",
1772
- value: "Click to toggle content",
1773
- placeholder: true
1774
- }
1775
- ]
1776
- }
1777
- ]
1778
- },
1779
- {
1780
- type: "instance",
1781
- component: "CollapsibleContent",
1782
- children: [
1783
- {
1784
- type: "instance",
1785
- component: "Text",
1786
- children: [
1787
- {
1788
- type: "text",
1789
- value: "Collapsible Content",
1790
- placeholder: true
1791
- }
1792
- ]
1793
- }
1794
- ]
1795
- }
1796
- ]
1797
- }
1798
- ]
1799
- };
1800
- var metaCollapsibleTrigger = {
1801
- category: "hidden",
1802
- type: "container",
1803
- icon: TriggerIcon,
1804
- stylable: false,
1805
- detachable: false
1806
- };
1807
- var metaCollapsibleContent = {
1808
- category: "hidden",
1809
- type: "container",
1810
- presetStyle,
1811
- icon: ContentIcon,
1812
- detachable: false
1813
- };
1814
- var propsMetaCollapsible = {
1815
- props: {
1816
- ...propsCollapsible,
1817
- onOpenChange: {
1818
- type: "action",
1819
- control: "action",
1820
- required: false
1821
- }
1822
- },
1823
- initialProps: ["open", "onOpenChange"]
1824
- };
1825
-
1826
- // src/dialog.ws.ts
1827
- import {
1828
- DialogIcon,
1829
- TriggerIcon as TriggerIcon2,
1830
- ContentIcon as ContentIcon2,
1831
- OverlayIcon,
1832
- HeadingIcon,
1833
- TextIcon,
1834
- ButtonElementIcon,
1835
- LargeXIcon
1836
- } from "@webstudio-is/icons/svg";
1837
- import {
1838
- defaultStates
1839
- } from "@webstudio-is/react-sdk";
1840
- import { div as div2, button, h2, p as p2 } from "@webstudio-is/sdk/normalize.css";
1841
- var presetStyle2 = {
1842
- div: div2
1843
- };
1844
- var titlePresetStyle = {
1845
- h2
1846
- };
1847
- var descriptionPresetStyle = {
1848
- p: p2
1849
- };
1850
- var metaDialogTrigger = {
1851
- category: "hidden",
1852
- type: "container",
1853
- icon: TriggerIcon2,
1854
- stylable: false,
1855
- detachable: false
1856
- };
1857
- var metaDialogContent = {
1858
- category: "hidden",
1859
- type: "container",
1860
- presetStyle: presetStyle2,
1861
- icon: ContentIcon2,
1862
- detachable: false
1863
- };
1864
- var metaDialogOverlay = {
1865
- category: "hidden",
1866
- type: "container",
1867
- presetStyle: presetStyle2,
1868
- icon: OverlayIcon,
1869
- detachable: false
1870
- };
1871
- var metaDialogTitle = {
1872
- category: "hidden",
1873
- type: "container",
1874
- presetStyle: titlePresetStyle,
1875
- icon: HeadingIcon
1876
- };
1877
- var metaDialogDescription = {
1878
- category: "hidden",
1879
- type: "container",
1880
- presetStyle: descriptionPresetStyle,
1881
- icon: TextIcon
1882
- };
1883
- var metaDialogClose = {
1884
- category: "hidden",
1885
- type: "container",
1886
- presetStyle: {
1887
- button: [buttonReset, button].flat()
1888
- },
1889
- states: defaultStates,
1890
- icon: ButtonElementIcon,
1891
- label: "Close Button"
1892
- };
1893
- var metaDialog = {
1894
- category: "radix",
1895
- order: 4,
1896
- type: "container",
1897
- icon: DialogIcon,
1898
- stylable: false,
1899
- description: "Displays content with an overlay that covers the window, triggered by a button. Clicking the overlay will close the dialog.",
1900
- template: [
1901
- {
1902
- type: "instance",
1903
- component: "Dialog",
1904
- children: [
1905
- {
1906
- type: "instance",
1907
- component: "DialogTrigger",
1908
- children: [
1909
- {
1910
- type: "instance",
1911
- component: "Button",
1912
- styles: getButtonStyles("outline"),
1913
- children: [{ type: "text", value: "Button", placeholder: true }]
1914
- }
1915
- ]
1916
- },
1917
- {
1918
- type: "instance",
1919
- component: "DialogOverlay",
1920
- /**
1921
- * fixed inset-0 z-50 bg-background/80 backdrop-blur-sm
1922
- * flex
1923
- **/
1924
- styles: [
1925
- fixed(),
1926
- inset2(0),
1927
- z(50),
1928
- bg("background", 80),
1929
- backdropBlur("sm"),
1930
- // To allow positioning Content
1931
- flex(),
1932
- overflow("auto")
1933
- ].flat(),
1934
- children: [
1935
- {
1936
- type: "instance",
1937
- component: "DialogContent",
1938
- /**
1939
- * fixed w-full z-50
1940
- * grid gap-4 max-w-lg
1941
- * m-auto
1942
- * border bg-background p-6 shadow-lg
1943
- **/
1944
- styles: [
1945
- w("full"),
1946
- z(50),
1947
- flex(),
1948
- flex("col"),
1949
- gap(4),
1950
- m("auto"),
1951
- maxW("lg"),
1952
- border(),
1953
- bg("background"),
1954
- p(6),
1955
- shadow("lg"),
1956
- relative()
1957
- ].flat(),
1958
- children: [
1959
- {
1960
- type: "instance",
1961
- component: "Box",
1962
- label: "Dialog Header",
1963
- styles: [flex(), flex("col"), gap(1)].flat(),
1964
- children: [
1965
- {
1966
- type: "instance",
1967
- component: "DialogTitle",
1968
- /**
1969
- * text-lg leading-none tracking-tight
1970
- **/
1971
- styles: [
1972
- my(0),
1973
- leading("none"),
1974
- text("lg"),
1975
- tracking("tight")
1976
- ].flat(),
1977
- children: [
1978
- {
1979
- type: "text",
1980
- value: "Dialog Title you can edit",
1981
- placeholder: true
1982
- }
1983
- ]
1984
- },
1985
- {
1986
- type: "instance",
1987
- component: "DialogDescription",
1988
- /**
1989
- * text-sm text-muted-foreground
1990
- **/
1991
- styles: [
1992
- my(0),
1993
- text("sm"),
1994
- text("mutedForeground")
1995
- ].flat(),
1996
- children: [
1997
- {
1998
- type: "text",
1999
- value: "Dialog description text you can edit",
2000
- placeholder: true
2001
- }
2002
- ]
2003
- }
2004
- ]
2005
- },
2006
- {
2007
- type: "instance",
2008
- component: "Text",
2009
- children: [
2010
- {
2011
- type: "text",
2012
- value: "The text you can edit",
2013
- placeholder: true
2014
- }
2015
- ]
2016
- },
2017
- {
2018
- type: "instance",
2019
- component: "DialogClose",
2020
- /**
2021
- * absolute right-4 top-4
2022
- * rounded-sm opacity-70
2023
- * ring-offset-background
2024
- * hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2
2025
- * flex items-center justify-center h-4 w-4
2026
- **/
2027
- styles: [
2028
- absolute(),
2029
- right(4),
2030
- top(4),
2031
- rounded("sm"),
2032
- opacity2(70),
2033
- flex(),
2034
- items("center"),
2035
- justify("center"),
2036
- h(4),
2037
- w(4),
2038
- border(0),
2039
- bg("transparent"),
2040
- outline("none"),
2041
- hover(opacity2(100)),
2042
- focus(ring("ring", 2, "background", 2))
2043
- ].flat(),
2044
- children: [
2045
- {
2046
- type: "instance",
2047
- component: "HtmlEmbed",
2048
- label: "Close Icon",
2049
- props: [
2050
- {
2051
- type: "string",
2052
- name: "code",
2053
- value: LargeXIcon
2054
- }
2055
- ],
2056
- children: []
2057
- }
2058
- ]
2059
- }
2060
- ]
2061
- }
2062
- ]
2063
- }
2064
- ]
2065
- }
2066
- ]
2067
- };
2068
-
2069
- // src/sheet.ws.ts
2070
- import { HamburgerMenuIcon, LargeXIcon as LargeXIcon2 } from "@webstudio-is/icons/svg";
2071
- var meta = {
2072
- category: "radix",
2073
- order: 1,
2074
- type: "container",
2075
- icon: HamburgerMenuIcon,
2076
- stylable: false,
2077
- 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.",
2078
- template: [
2079
- {
2080
- type: "instance",
2081
- component: "Dialog",
2082
- label: "Sheet",
2083
- props: [],
2084
- children: [
2085
- {
2086
- type: "instance",
2087
- component: "DialogTrigger",
2088
- label: "Sheet Trigger",
2089
- children: [
2090
- {
2091
- type: "instance",
2092
- component: "Button",
2093
- styles: getButtonStyles("ghost", "icon"),
2094
- children: [
2095
- {
2096
- type: "instance",
2097
- component: "HtmlEmbed",
2098
- label: "Hamburger Menu Svg",
2099
- props: [
2100
- {
2101
- type: "string",
2102
- name: "code",
2103
- value: HamburgerMenuIcon
2104
- }
2105
- ],
2106
- children: []
2107
- }
2108
- ]
2109
- }
2110
- ]
2111
- },
2112
- {
2113
- type: "instance",
2114
- component: "DialogOverlay",
2115
- label: "Sheet Overlay",
2116
- /**
2117
- * fixed inset-0 z-50 bg-background/80 backdrop-blur-sm
2118
- * flex
2119
- **/
2120
- styles: [
2121
- fixed(),
2122
- inset2(0),
2123
- z(50),
2124
- bg("background", 80),
2125
- backdropBlur("sm"),
2126
- // To allow positioning Content
2127
- flex(),
2128
- flex("col"),
2129
- overflow("auto")
2130
- ].flat(),
2131
- children: [
2132
- {
2133
- type: "instance",
2134
- component: "DialogContent",
2135
- label: "Sheet Content",
2136
- /**
2137
- * fixed w-full z-50
2138
- * grid gap-4 max-w-lg
2139
- * m-auto
2140
- * border bg-background p-6 shadow-lg
2141
- **/
2142
- styles: [
2143
- w("full"),
2144
- z(50),
2145
- flex(),
2146
- flex("col"),
2147
- gap(4),
2148
- border(),
2149
- bg("background"),
2150
- p(6),
2151
- shadow("lg"),
2152
- relative(),
2153
- // side=left
2154
- mr("auto"),
2155
- maxW("sm"),
2156
- grow()
2157
- ].flat(),
2158
- children: [
2159
- {
2160
- type: "instance",
2161
- component: "Box",
2162
- label: "Navigation",
2163
- props: [
2164
- { name: "tag", type: "string", value: "nav" },
2165
- { name: "role", type: "string", value: "navigation" }
2166
- ],
2167
- children: [
2168
- {
2169
- type: "instance",
2170
- component: "Box",
2171
- label: "Sheet Header",
2172
- styles: [flex(), flex("col"), gap(1)].flat(),
2173
- children: [
2174
- {
2175
- type: "instance",
2176
- component: "DialogTitle",
2177
- label: "Sheet Title",
2178
- /**
2179
- * text-lg leading-none tracking-tight
2180
- **/
2181
- styles: [
2182
- my(0),
2183
- leading("none"),
2184
- text("lg"),
2185
- tracking("tight")
2186
- ].flat(),
2187
- children: [
2188
- {
2189
- type: "text",
2190
- value: "Sheet Title",
2191
- placeholder: true
2192
- }
2193
- ]
2194
- },
2195
- {
2196
- type: "instance",
2197
- component: "DialogDescription",
2198
- label: "Sheet Description",
2199
- /**
2200
- * text-sm text-muted-foreground
2201
- **/
2202
- styles: [
2203
- my(0),
2204
- text("sm"),
2205
- text("mutedForeground")
2206
- ].flat(),
2207
- children: [
2208
- {
2209
- type: "text",
2210
- value: "Sheet description text you can edit",
2211
- placeholder: true
2212
- }
2213
- ]
2214
- }
2215
- ]
2216
- },
2217
- {
2218
- type: "instance",
2219
- component: "Text",
2220
- children: [
2221
- {
2222
- type: "text",
2223
- value: "The text you can edit",
2224
- placeholder: true
2225
- }
2226
- ]
2227
- }
2228
- ]
2229
- },
2230
- {
2231
- type: "instance",
2232
- component: "DialogClose",
2233
- label: "Close Button",
2234
- /**
2235
- * absolute right-4 top-4
2236
- * rounded-sm opacity-70
2237
- * ring-offset-background
2238
- * hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2
2239
- * flex items-center justify-center h-4 w-4
2240
- **/
2241
- styles: [
2242
- absolute(),
2243
- right(4),
2244
- top(4),
2245
- rounded("sm"),
2246
- opacity2(70),
2247
- flex(),
2248
- items("center"),
2249
- justify("center"),
2250
- h(4),
2251
- w(4),
2252
- border(0),
2253
- bg("transparent"),
2254
- outline("none"),
2255
- hover(opacity2(100)),
2256
- focus(ring("ring", 2, "background", 2))
2257
- ].flat(),
2258
- children: [
2259
- {
2260
- type: "instance",
2261
- component: "HtmlEmbed",
2262
- label: "Close Icon",
2263
- props: [
2264
- {
2265
- type: "string",
2266
- name: "code",
2267
- value: LargeXIcon2
2268
- }
2269
- ],
2270
- children: []
2271
- }
2272
- ]
2273
- }
2274
- ]
2275
- }
2276
- ]
2277
- }
2278
- ]
2279
- }
2280
- ]
2281
- };
2282
-
2283
- // src/popover.ws.ts
2284
- import { PopoverIcon, TriggerIcon as TriggerIcon3, ContentIcon as ContentIcon3 } from "@webstudio-is/icons/svg";
2285
- import "@webstudio-is/react-sdk";
2286
- import { div as div3 } from "@webstudio-is/sdk/normalize.css";
2287
- var presetStyle3 = {
2288
- div: div3
2289
- };
2290
- var metaPopoverTrigger = {
2291
- category: "hidden",
2292
- type: "container",
2293
- icon: TriggerIcon3,
2294
- stylable: false,
2295
- detachable: false
2296
- };
2297
- var metaPopoverContent = {
2298
- category: "hidden",
2299
- type: "container",
2300
- presetStyle: presetStyle3,
2301
- icon: ContentIcon3,
2302
- detachable: false
2303
- };
2304
- var metaPopover = {
2305
- category: "radix",
2306
- order: 6,
2307
- type: "container",
2308
- icon: PopoverIcon,
2309
- stylable: false,
2310
- description: "Displays rich content in a portal, triggered by a button.",
2311
- template: [
2312
- {
2313
- type: "instance",
2314
- component: "Popover",
2315
- props: [],
2316
- children: [
2317
- {
2318
- type: "instance",
2319
- component: "PopoverTrigger",
2320
- children: [
2321
- {
2322
- type: "instance",
2323
- component: "Button",
2324
- styles: getButtonStyles("outline"),
2325
- children: [{ type: "text", value: "Button", placeholder: true }]
2326
- }
2327
- ]
2328
- },
2329
- {
2330
- type: "instance",
2331
- component: "PopoverContent",
2332
- /**
2333
- * z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none
2334
- **/
2335
- styles: [
2336
- z(50),
2337
- w(72),
2338
- rounded("md"),
2339
- border(),
2340
- bg("popover"),
2341
- p(4),
2342
- text("popoverForeground"),
2343
- shadow("md"),
2344
- outline("none")
2345
- ].flat(),
2346
- children: [
2347
- {
2348
- type: "instance",
2349
- component: "Text",
2350
- children: [
2351
- {
2352
- type: "text",
2353
- value: "The text you can edit",
2354
- placeholder: true
2355
- }
2356
- ]
2357
- }
2358
- ]
2359
- }
2360
- ]
2361
- }
2362
- ]
2363
- };
2364
-
2365
- // src/tooltip.ws.ts
2366
- import { TooltipIcon, TriggerIcon as TriggerIcon4, ContentIcon as ContentIcon4 } from "@webstudio-is/icons/svg";
2367
- import "@webstudio-is/react-sdk";
2368
- import { div as div4 } from "@webstudio-is/sdk/normalize.css";
2369
- var presetStyle4 = {
2370
- div: div4
2371
- };
2372
- var metaTooltipTrigger = {
2373
- category: "hidden",
2374
- detachable: false,
2375
- type: "container",
2376
- icon: TriggerIcon4,
2377
- stylable: false
2378
- };
2379
- var metaTooltipContent = {
2380
- category: "hidden",
2381
- detachable: false,
2382
- type: "container",
2383
- presetStyle: presetStyle4,
2384
- icon: ContentIcon4
2385
- };
2386
- var metaTooltip = {
2387
- category: "radix",
2388
- order: 7,
2389
- type: "container",
2390
- icon: TooltipIcon,
2391
- stylable: false,
2392
- 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.",
2393
- template: [
2394
- {
2395
- type: "instance",
2396
- component: "Tooltip",
2397
- props: [],
2398
- children: [
2399
- {
2400
- type: "instance",
2401
- component: "TooltipTrigger",
2402
- children: [
2403
- {
2404
- type: "instance",
2405
- component: "Button",
2406
- styles: getButtonStyles("outline"),
2407
- children: [{ type: "text", value: "Button", placeholder: true }]
2408
- }
2409
- ]
2410
- },
2411
- {
2412
- type: "instance",
2413
- component: "TooltipContent",
2414
- /**
2415
- * z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md
2416
- **/
2417
- styles: [
2418
- z(50),
2419
- overflow("hidden"),
2420
- rounded("md"),
2421
- border(),
2422
- bg("popover"),
2423
- px(3),
2424
- py(1.5),
2425
- text("sm"),
2426
- text("popoverForeground"),
2427
- shadow("md")
2428
- ].flat(),
2429
- children: [
2430
- {
2431
- type: "instance",
2432
- component: "Text",
2433
- children: [
2434
- {
2435
- type: "text",
2436
- value: "The text you can edit",
2437
- placeholder: true
2438
- }
2439
- ]
2440
- }
2441
- ]
2442
- }
2443
- ]
2444
- }
2445
- ]
2446
- };
2447
-
2448
- // src/tabs.ws.ts
2449
- import {
2450
- ContentIcon as ContentIcon5,
2451
- HeaderIcon,
2452
- TabsIcon,
2453
- TriggerIcon as TriggerIcon5
2454
- } from "@webstudio-is/icons/svg";
2455
- import {
2456
- defaultStates as defaultStates2
2457
- } from "@webstudio-is/react-sdk";
2458
- import { button as button2, div as div5 } from "@webstudio-is/sdk/normalize.css";
2459
- var presetStyle5 = {
2460
- div: div5
2461
- };
2462
- var tabsTriggerStyles = [
2463
- inlineFlex(),
2464
- items("center"),
2465
- justify("center"),
2466
- whitespace("nowrap"),
2467
- rounded("md"),
2468
- px(3),
2469
- py(1.5),
2470
- text("sm"),
2471
- font("medium"),
2472
- transition("all"),
2473
- focusVisible(
2474
- [outline("none"), ring("ring", 2, "background", 2)].flat()
2475
- ),
2476
- disabled([pointerEvents("none"), opacity2(50)].flat()),
2477
- state(
2478
- [bg("background"), text("foreground"), shadow("sm")].flat(),
2479
- "[data-state=active]"
2480
- )
2481
- ].flat();
2482
- var tabsContentStyles = [
2483
- mt(2),
2484
- focusVisible(
2485
- [outline("none"), ring("ring", 2, "background", 2)].flat()
2486
- )
2487
- ].flat();
2488
- var metaTabs = {
2489
- category: "radix",
2490
- order: 2,
2491
- type: "container",
2492
- icon: TabsIcon,
2493
- presetStyle: presetStyle5,
2494
- 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.",
2495
- template: [
2496
- {
2497
- type: "instance",
2498
- component: "Tabs",
2499
- props: [{ type: "string", name: "defaultValue", value: "0" }],
2500
- children: [
2501
- {
2502
- type: "instance",
2503
- component: "TabsList",
2504
- // inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground
2505
- styles: [
2506
- inlineFlex(),
2507
- h(10),
2508
- items("center"),
2509
- justify("center"),
2510
- rounded("md"),
2511
- bg("muted"),
2512
- p(1),
2513
- text("mutedForeground")
2514
- ].flat(),
2515
- children: [
2516
- {
2517
- type: "instance",
2518
- component: "TabsTrigger",
2519
- styles: tabsTriggerStyles,
2520
- children: [{ type: "text", value: "Account", placeholder: true }]
2521
- },
2522
- {
2523
- type: "instance",
2524
- component: "TabsTrigger",
2525
- styles: tabsTriggerStyles,
2526
- children: [
2527
- { type: "text", value: "Password", placeholder: true }
2528
- ]
2529
- }
2530
- ]
2531
- },
2532
- {
2533
- type: "instance",
2534
- component: "TabsContent",
2535
- styles: tabsContentStyles,
2536
- children: [
2537
- {
2538
- type: "text",
2539
- value: "Make changes to your account here.",
2540
- placeholder: true
2541
- }
2542
- ]
2543
- },
2544
- {
2545
- type: "instance",
2546
- component: "TabsContent",
2547
- styles: tabsContentStyles,
2548
- children: [
2549
- {
2550
- type: "text",
2551
- value: "Change your password here.",
2552
- placeholder: true
2553
- }
2554
- ]
2555
- }
2556
- ]
2557
- }
2558
- ]
2559
- };
2560
- var metaTabsList = {
2561
- category: "hidden",
2562
- detachable: false,
2563
- type: "container",
2564
- icon: HeaderIcon,
2565
- requiredAncestors: ["Tabs"],
2566
- presetStyle: presetStyle5
2567
- };
2568
- var metaTabsTrigger = {
2569
- category: "hidden",
2570
- type: "container",
2571
- icon: TriggerIcon5,
2572
- requiredAncestors: ["TabsList"],
2573
- invalidAncestors: ["TabsTrigger"],
2574
- indexWithinAncestor: "Tabs",
2575
- label: "Tab Trigger",
2576
- states: [
2577
- ...defaultStates2,
2578
- {
2579
- category: "component-states",
2580
- label: "Active",
2581
- selector: "[data-state=active]"
2582
- }
2583
- ],
2584
- presetStyle: {
2585
- button: [button2, buttonReset].flat()
2586
- }
2587
- };
2588
- var metaTabsContent = {
2589
- category: "hidden",
2590
- type: "container",
2591
- label: "Tab Content",
2592
- icon: ContentIcon5,
2593
- requiredAncestors: ["Tabs"],
2594
- indexWithinAncestor: "Tabs",
2595
- presetStyle: presetStyle5
2596
- };
2597
-
2598
- // src/label.ws.ts
2599
- import { LabelIcon } from "@webstudio-is/icons/svg";
2600
- import {
2601
- defaultStates as defaultStates3
2602
- } from "@webstudio-is/react-sdk";
2603
- import { label } from "@webstudio-is/sdk/normalize.css";
2604
-
2605
- // src/__generated__/label.props.ts
2606
- var props = {
2607
- about: { required: false, control: "text", type: "string" },
2608
- accessKey: {
2609
- required: false,
2610
- control: "text",
2611
- type: "string",
2612
- description: "Keyboard shortcut to activate or add focus to the element."
2613
- },
2614
- "aria-activedescendant": {
2615
- description: "Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application.",
2616
- required: false,
2617
- control: "text",
2618
- type: "string"
2619
- },
2620
- "aria-atomic": {
2621
- description: "Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute.",
2622
- required: false,
2623
- control: "boolean",
2624
- type: "boolean"
2625
- },
2626
- "aria-autocomplete": {
2627
- description: "Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be\npresented if they are made.",
2628
- required: false,
2629
- control: "select",
2630
- type: "string",
2631
- options: ["list", "none", "inline", "both"]
2632
- },
2633
- "aria-braillelabel": {
2634
- description: "Defines a string value that labels the current element, which is intended to be converted into Braille.",
2635
- required: false,
2636
- control: "text",
2637
- type: "string"
2638
- },
2639
- "aria-brailleroledescription": {
2640
- description: "Defines a human-readable, author-localized abbreviated description for the role of an element, which is intended to be converted into Braille.",
2641
- required: false,
2642
- control: "text",
2643
- type: "string"
2644
- },
2645
- "aria-busy": { required: false, control: "boolean", type: "boolean" },
2646
- "aria-checked": {
2647
- description: 'Indicates the current "checked" state of checkboxes, radio buttons, and other widgets.',
2648
- required: false,
2649
- control: "text",
2650
- type: "string"
2651
- },
2652
- "aria-colcount": {
2653
- description: "Defines the total number of columns in a table, grid, or treegrid.",
2654
- required: false,
2655
- control: "number",
2656
- type: "number"
2657
- },
2658
- "aria-colindex": {
2659
- description: "Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid.",
2660
- required: false,
2661
- control: "number",
2662
- type: "number"
2663
- },
2664
- "aria-colindextext": {
2665
- description: "Defines a human readable text alternative of aria-colindex.",
2666
- required: false,
2667
- control: "text",
2668
- type: "string"
2669
- },
2670
- "aria-colspan": {
2671
- description: "Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.",
2672
- required: false,
2673
- control: "number",
2674
- type: "number"
2675
- },
2676
- "aria-controls": {
2677
- description: "Identifies the element (or elements) whose contents or presence are controlled by the current element.",
2678
- required: false,
2679
- control: "text",
2680
- type: "string"
2681
- },
2682
- "aria-current": {
2683
- description: "Indicates the element that represents the current item within a container or set of related elements.",
2684
- required: false,
2685
- control: "text",
2686
- type: "string"
2687
- },
2688
- "aria-describedby": {
2689
- description: "Identifies the element (or elements) that describes the object.",
2690
- required: false,
2691
- control: "text",
2692
- type: "string"
2693
- },
2694
- "aria-description": {
2695
- description: "Defines a string value that describes or annotates the current element.",
2696
- required: false,
2697
- control: "text",
2698
- type: "string"
2699
- },
2700
- "aria-details": {
2701
- description: "Identifies the element that provides a detailed, extended description for the object.",
2702
- required: false,
2703
- control: "text",
2704
- type: "string"
2705
- },
2706
- "aria-disabled": {
2707
- description: "Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.",
2708
- required: false,
2709
- control: "boolean",
2710
- type: "boolean"
2711
- },
2712
- "aria-dropeffect": {
2713
- description: "Indicates what functions can be performed when a dragged object is released on the drop target.",
2714
- required: false,
2715
- control: "select",
2716
- type: "string",
2717
- options: ["link", "none", "copy", "execute", "move", "popup"]
2718
- },
2719
- "aria-errormessage": {
2720
- description: "Identifies the element that provides an error message for the object.",
2721
- required: false,
2722
- control: "text",
2723
- type: "string"
2724
- },
2725
- "aria-expanded": {
2726
- description: "Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.",
2727
- required: false,
2728
- control: "boolean",
2729
- type: "boolean"
2730
- },
2731
- "aria-flowto": {
2732
- description: "Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion,\nallows assistive technology to override the general default of reading in document source order.",
2733
- required: false,
2734
- control: "text",
2735
- type: "string"
2736
- },
2737
- "aria-grabbed": {
2738
- description: `Indicates an element's "grabbed" state in a drag-and-drop operation.`,
2739
- required: false,
2740
- control: "boolean",
2741
- type: "boolean"
2742
- },
2743
- "aria-haspopup": {
2744
- description: "Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.",
2745
- required: false,
2746
- control: "text",
2747
- type: "string"
2748
- },
2749
- "aria-hidden": {
2750
- description: "Indicates whether the element is exposed to an accessibility API.",
2751
- required: false,
2752
- control: "boolean",
2753
- type: "boolean"
2754
- },
2755
- "aria-invalid": {
2756
- description: "Indicates the entered value does not conform to the format expected by the application.",
2757
- required: false,
2758
- control: "text",
2759
- type: "string"
2760
- },
2761
- "aria-keyshortcuts": {
2762
- description: "Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element.",
2763
- required: false,
2764
- control: "text",
2765
- type: "string"
2766
- },
2767
- "aria-label": {
2768
- description: "Provides the accessible name that describes an interactive element if no other accessible name exists, for example in a button that contains an image with no text.",
2769
- required: false,
2770
- control: "text",
2771
- type: "string"
2772
- },
2773
- "aria-labelledby": {
2774
- description: "Identifies the element (or elements) that labels the current element.",
2775
- required: false,
2776
- control: "text",
2777
- type: "string"
2778
- },
2779
- "aria-level": {
2780
- description: "Defines the hierarchical level of an element within a structure.",
2781
- required: false,
2782
- control: "number",
2783
- type: "number"
2784
- },
2785
- "aria-live": {
2786
- description: "Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region.",
2787
- required: false,
2788
- control: "radio",
2789
- type: "string",
2790
- options: ["off", "assertive", "polite"]
2791
- },
2792
- "aria-modal": {
2793
- description: "Indicates whether an element is modal when displayed.",
2794
- required: false,
2795
- control: "boolean",
2796
- type: "boolean"
2797
- },
2798
- "aria-multiline": {
2799
- description: "Indicates whether a text box accepts multiple lines of input or only a single line.",
2800
- required: false,
2801
- control: "boolean",
2802
- type: "boolean"
2803
- },
2804
- "aria-multiselectable": {
2805
- description: "Indicates that the user may select more than one item from the current selectable descendants.",
2806
- required: false,
2807
- control: "boolean",
2808
- type: "boolean"
2809
- },
2810
- "aria-orientation": {
2811
- description: "Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous.",
2812
- required: false,
2813
- control: "radio",
2814
- type: "string",
2815
- options: ["horizontal", "vertical"]
2816
- },
2817
- "aria-owns": {
2818
- description: "Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship\nbetween DOM elements where the DOM hierarchy cannot be used to represent the relationship.",
2819
- required: false,
2820
- control: "text",
2821
- type: "string"
2822
- },
2823
- "aria-placeholder": {
2824
- description: "Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value.\nA hint could be a sample value or a brief description of the expected format.",
2825
- required: false,
2826
- control: "text",
2827
- type: "string"
2828
- },
2829
- "aria-posinset": {
2830
- description: "Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.",
2831
- required: false,
2832
- control: "number",
2833
- type: "number"
2834
- },
2835
- "aria-pressed": {
2836
- description: 'Indicates the current "pressed" state of toggle buttons.',
2837
- required: false,
2838
- control: "text",
2839
- type: "string"
2840
- },
2841
- "aria-readonly": {
2842
- description: "Indicates that the element is not editable, but is otherwise operable.",
2843
- required: false,
2844
- control: "boolean",
2845
- type: "boolean"
2846
- },
2847
- "aria-relevant": {
2848
- description: "Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.",
2849
- required: false,
2850
- control: "select",
2851
- type: "string",
2852
- options: [
2853
- "text",
2854
- "additions",
2855
- "additions removals",
2856
- "additions text",
2857
- "all",
2858
- "removals",
2859
- "removals additions",
2860
- "removals text",
2861
- "text additions",
2862
- "text removals"
2863
- ]
2864
- },
2865
- "aria-required": {
2866
- description: "Indicates that user input is required on the element before a form may be submitted.",
2867
- required: false,
2868
- control: "boolean",
2869
- type: "boolean"
2870
- },
2871
- "aria-roledescription": {
2872
- description: "Defines a human-readable, author-localized description for the role of an element.",
2873
- required: false,
2874
- control: "text",
2875
- type: "string"
2876
- },
2877
- "aria-rowcount": {
2878
- description: "Defines the total number of rows in a table, grid, or treegrid.",
2879
- required: false,
2880
- control: "number",
2881
- type: "number"
2882
- },
2883
- "aria-rowindex": {
2884
- description: "Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid.",
2885
- required: false,
2886
- control: "number",
2887
- type: "number"
2888
- },
2889
- "aria-rowindextext": {
2890
- description: "Defines a human readable text alternative of aria-rowindex.",
2891
- required: false,
2892
- control: "text",
2893
- type: "string"
2894
- },
2895
- "aria-rowspan": {
2896
- description: "Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.",
2897
- required: false,
2898
- control: "number",
2899
- type: "number"
2900
- },
2901
- "aria-selected": {
2902
- description: 'Indicates the current "selected" state of various widgets.',
2903
- required: false,
2904
- control: "boolean",
2905
- type: "boolean"
2906
- },
2907
- "aria-setsize": {
2908
- description: "Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.",
2909
- required: false,
2910
- control: "number",
2911
- type: "number"
2912
- },
2913
- "aria-sort": {
2914
- description: "Indicates if items in a table or grid are sorted in ascending or descending order.",
2915
- required: false,
2916
- control: "select",
2917
- type: "string",
2918
- options: ["none", "ascending", "descending", "other"]
2919
- },
2920
- "aria-valuemax": {
2921
- description: "Defines the maximum allowed value for a range widget.",
2922
- required: false,
2923
- control: "number",
2924
- type: "number"
2925
- },
2926
- "aria-valuemin": {
2927
- description: "Defines the minimum allowed value for a range widget.",
2928
- required: false,
2929
- control: "number",
2930
- type: "number"
2931
- },
2932
- "aria-valuenow": {
2933
- description: "Defines the current value for a range widget.",
2934
- required: false,
2935
- control: "number",
2936
- type: "number"
2937
- },
2938
- "aria-valuetext": {
2939
- description: "Defines the human readable text alternative of aria-valuenow for a range widget.",
2940
- required: false,
2941
- control: "text",
2942
- type: "string"
2943
- },
2944
- autoCapitalize: {
2945
- required: false,
2946
- control: "text",
2947
- type: "string",
2948
- description: "Sets whether input is automatically capitalized when entered by user."
2949
- },
2950
- autoCorrect: { required: false, control: "text", type: "string" },
2951
- autoFocus: {
2952
- required: false,
2953
- control: "boolean",
2954
- type: "boolean",
2955
- description: "Indicates that an element should be focused on page load, or when its parent dialog is displayed."
2956
- },
2957
- autoSave: { required: false, control: "text", type: "string" },
2958
- className: { required: false, control: "text", type: "string" },
2959
- color: {
2960
- required: false,
2961
- control: "color",
2962
- type: "string",
2963
- description: "This attribute sets the text color using either a named color or a color specified in the hexadecimal #RRGGBB format. Note: This is a legacy attribute. Please use the CSS color property instead."
2964
- },
2965
- content: {
2966
- required: false,
2967
- control: "text",
2968
- type: "string",
2969
- description: "A value associated with http-equiv orname depending on the context."
2970
- },
2971
- contextMenu: {
2972
- required: false,
2973
- control: "text",
2974
- type: "string",
2975
- description: "Defines the ID of a menu element which willserve as the element's context menu."
2976
- },
2977
- datatype: { required: false, control: "text", type: "string" },
2978
- defaultValue: { required: false, control: "text", type: "string" },
2979
- dir: {
2980
- required: false,
2981
- control: "text",
2982
- type: "string",
2983
- description: "Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)"
2984
- },
2985
- draggable: {
2986
- required: false,
2987
- control: "boolean",
2988
- type: "boolean",
2989
- description: "Defines whether the element can be dragged."
2990
- },
2991
- form: {
2992
- required: false,
2993
- control: "text",
2994
- type: "string",
2995
- description: "Indicates the form that is the owner of the element."
2996
- },
2997
- hidden: {
2998
- required: false,
2999
- control: "boolean",
3000
- type: "boolean",
3001
- description: "Prevents rendering of given element, while keeping child elements, e.g. script elements, active."
3002
- },
3003
- htmlFor: {
3004
- required: false,
3005
- control: "text",
3006
- type: "string",
3007
- description: "Associates this Label with an Input. The value of the \u201CFor\u201D attribute should match the ID attribute of the corresponding Input element"
3008
- },
3009
- id: {
3010
- required: false,
3011
- control: "text",
3012
- type: "string",
3013
- description: "Often used with CSS to style a specific element. The value of this attribute must be unique."
3014
- },
3015
- inputMode: {
3016
- description: "Hints at the type of data that might be entered by the user while editing the element or its contents",
3017
- required: false,
3018
- control: "select",
3019
- type: "string",
3020
- options: [
3021
- "search",
3022
- "text",
3023
- "none",
3024
- "tel",
3025
- "url",
3026
- "email",
3027
- "numeric",
3028
- "decimal"
3029
- ]
3030
- },
3031
- is: {
3032
- description: "Specify that a standard HTML element should behave like a defined custom built-in element",
3033
- required: false,
3034
- control: "text",
3035
- type: "string"
3036
- },
3037
- itemID: { required: false, control: "text", type: "string" },
3038
- itemProp: { required: false, control: "text", type: "string" },
3039
- itemRef: { required: false, control: "text", type: "string" },
3040
- itemScope: { required: false, control: "boolean", type: "boolean" },
3041
- itemType: { required: false, control: "text", type: "string" },
3042
- lang: {
3043
- required: false,
3044
- control: "text",
3045
- type: "string",
3046
- description: "Defines the language used in the element."
3047
- },
3048
- nonce: { required: false, control: "text", type: "string" },
3049
- prefix: { required: false, control: "text", type: "string" },
3050
- property: { required: false, control: "text", type: "string" },
3051
- radioGroup: { required: false, control: "text", type: "string" },
3052
- rel: {
3053
- required: false,
3054
- control: "text",
3055
- type: "string",
3056
- description: "Specifies the relationship of the target object to the link object."
3057
- },
3058
- resource: { required: false, control: "text", type: "string" },
3059
- results: { required: false, control: "number", type: "number" },
3060
- rev: { required: false, control: "text", type: "string" },
3061
- role: {
3062
- required: false,
3063
- control: "text",
3064
- type: "string",
3065
- description: "Defines an explicit role for an element for use by assistive technologies."
3066
- },
3067
- security: { required: false, control: "text", type: "string" },
3068
- slot: {
3069
- required: false,
3070
- control: "text",
3071
- type: "string",
3072
- description: "Assigns a slot in a shadow DOM shadow tree to an element."
3073
- },
3074
- spellCheck: {
3075
- required: false,
3076
- control: "boolean",
3077
- type: "boolean",
3078
- description: "Indicates whether spell checking is allowed for the element."
3079
- },
3080
- suppressContentEditableWarning: {
3081
- required: false,
3082
- control: "boolean",
3083
- type: "boolean"
3084
- },
3085
- suppressHydrationWarning: {
3086
- required: false,
3087
- control: "boolean",
3088
- type: "boolean"
3089
- },
3090
- tabIndex: {
3091
- required: false,
3092
- control: "number",
3093
- type: "number",
3094
- description: "Overrides the browser's default tab order and follows the one specified instead."
3095
- },
3096
- title: {
3097
- required: false,
3098
- control: "text",
3099
- type: "string",
3100
- description: "Text to be displayed in a tooltip when hovering over the element."
3101
- },
3102
- translate: {
3103
- required: false,
3104
- control: "radio",
3105
- type: "string",
3106
- options: ["yes", "no"],
3107
- description: "Specify whether an element's attribute values and the values of its text node children are to be translated when the page is localized, or whether to leave them unchanged."
3108
- },
3109
- typeof: { required: false, control: "text", type: "string" },
3110
- unselectable: {
3111
- required: false,
3112
- control: "radio",
3113
- type: "string",
3114
- options: ["on", "off"]
3115
- },
3116
- vocab: { required: false, control: "text", type: "string" }
3117
- };
3118
-
3119
- // src/label.ws.ts
3120
- var presetStyle6 = {
3121
- label
3122
- };
3123
- var meta2 = {
3124
- category: "radix",
3125
- order: 102,
3126
- type: "container",
3127
- icon: LabelIcon,
3128
- presetStyle: presetStyle6,
3129
- states: defaultStates3,
3130
- 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.",
3131
- template: [
3132
- {
3133
- type: "instance",
3134
- component: "Label",
3135
- styles: [
3136
- // text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70
3137
- text("sm"),
3138
- font("medium"),
3139
- leading("none")
3140
- // We are not supporting peer like styles yet
3141
- ].flat(),
3142
- children: [{ type: "text", value: "Form Label", placeholder: true }]
3143
- }
3144
- ]
3145
- };
3146
- var propsMeta = {
3147
- props: {
3148
- ...props,
3149
- htmlFor: {
3150
- ...props.htmlFor,
3151
- label: "For"
3152
- }
3153
- },
3154
- initialProps: ["id", "className", "htmlFor"]
3155
- };
3156
-
3157
- // src/accordion.ws.ts
3158
- import {
3159
- AccordionIcon,
3160
- ItemIcon,
3161
- HeaderIcon as HeaderIcon2,
3162
- TriggerIcon as TriggerIcon6,
3163
- ContentIcon as ContentIcon6,
3164
- ChevronDownIcon
3165
- } from "@webstudio-is/icons/svg";
3166
- import {
3167
- defaultStates as defaultStates4
3168
- } from "@webstudio-is/react-sdk";
3169
- import { div as div6, h3, button as button3 } from "@webstudio-is/sdk/normalize.css";
3170
- var presetStyle7 = {
3171
- div: div6
3172
- };
3173
- var accordionItemStyles = [borderB()].flat();
3174
- var createAccordionTrigger = ({
3175
- children
3176
- }) => ({
3177
- type: "instance",
3178
- component: "AccordionHeader",
3179
- // flex
3180
- styles: [flex()].flat(),
3181
- children: [
3182
- {
3183
- type: "instance",
3184
- component: "AccordionTrigger",
3185
- // flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180
3186
- styles: [
3187
- flex(),
3188
- flex(1),
3189
- items("center"),
3190
- justify("between"),
3191
- py(4),
3192
- font("medium"),
3193
- hover([underline()].flat()),
3194
- property("--accordion-trigger-icon-transform", "0deg"),
3195
- state(
3196
- [property("--accordion-trigger-icon-transform", "180deg")],
3197
- "[data-state=open]"
3198
- )
3199
- ].flat(),
3200
- children: [
3201
- {
3202
- type: "instance",
3203
- component: "Text",
3204
- children
3205
- },
3206
- {
3207
- type: "instance",
3208
- component: "Box",
3209
- label: "Icon Container",
3210
- // h-4 w-4 shrink-0 transition-transform duration-200
3211
- styles: [
3212
- property("rotate", "--accordion-trigger-icon-transform"),
3213
- h(4),
3214
- w(4),
3215
- shrink(0),
3216
- transition("all"),
3217
- duration(200)
3218
- ].flat(),
3219
- children: [
3220
- {
3221
- type: "instance",
3222
- component: "HtmlEmbed",
3223
- label: "Chevron Icon",
3224
- props: [
3225
- {
3226
- type: "string",
3227
- name: "code",
3228
- value: ChevronDownIcon
3229
- }
3230
- ],
3231
- children: []
3232
- }
3233
- ]
3234
- }
3235
- ]
3236
- }
3237
- ]
3238
- });
3239
- var accordionContentStyles = [
3240
- overflow("hidden"),
3241
- text("sm"),
3242
- // transition does not work with display: none
3243
- // tc.transition("all"),
3244
- pb(4)
3245
- ].flat();
3246
- var metaAccordion = {
3247
- category: "radix",
3248
- order: 3,
3249
- type: "container",
3250
- icon: AccordionIcon,
3251
- presetStyle: presetStyle7,
3252
- description: "A vertically stacked set of interactive headings that each reveal an associated section of content. Clicking on the heading will open the item and close other items.",
3253
- template: [
3254
- {
3255
- type: "instance",
3256
- component: "Accordion",
3257
- props: [
3258
- { type: "boolean", name: "collapsible", value: true },
3259
- { type: "string", name: "defaultValue", value: "0" }
3260
- ],
3261
- children: [
3262
- {
3263
- type: "instance",
3264
- component: "AccordionItem",
3265
- styles: accordionItemStyles,
3266
- children: [
3267
- createAccordionTrigger({
3268
- children: [
3269
- { type: "text", value: "Is it accessible?", placeholder: true }
3270
- ]
3271
- }),
3272
- {
3273
- type: "instance",
3274
- component: "AccordionContent",
3275
- styles: accordionContentStyles,
3276
- children: [
3277
- {
3278
- type: "text",
3279
- value: "Yes. It adheres to the WAI-ARIA design pattern.",
3280
- placeholder: true
3281
- }
3282
- ]
3283
- }
3284
- ]
3285
- },
3286
- {
3287
- type: "instance",
3288
- component: "AccordionItem",
3289
- styles: accordionItemStyles,
3290
- children: [
3291
- createAccordionTrigger({
3292
- children: [
3293
- { type: "text", value: "Is it styled?", placeholder: true }
3294
- ]
3295
- }),
3296
- {
3297
- type: "instance",
3298
- component: "AccordionContent",
3299
- styles: accordionContentStyles,
3300
- children: [
3301
- {
3302
- type: "text",
3303
- value: "Yes. It comes with default styles that matches the other components' aesthetic.",
3304
- placeholder: true
3305
- }
3306
- ]
3307
- }
3308
- ]
3309
- },
3310
- {
3311
- type: "instance",
3312
- component: "AccordionItem",
3313
- styles: accordionItemStyles,
3314
- children: [
3315
- createAccordionTrigger({
3316
- children: [
3317
- { type: "text", value: "Is it animated?", placeholder: true }
3318
- ]
3319
- }),
3320
- {
3321
- type: "instance",
3322
- component: "AccordionContent",
3323
- styles: accordionContentStyles,
3324
- children: [
3325
- {
3326
- type: "text",
3327
- value: "Yes. It's animated by default, but you can disable it if you prefer.",
3328
- placeholder: true
3329
- }
3330
- ]
3331
- }
3332
- ]
3333
- }
3334
- ]
3335
- }
3336
- ]
3337
- };
3338
- var metaAccordionItem = {
3339
- category: "hidden",
3340
- type: "container",
3341
- label: "Item",
3342
- icon: ItemIcon,
3343
- requiredAncestors: ["Accordion"],
3344
- indexWithinAncestor: "Accordion",
3345
- presetStyle: presetStyle7
3346
- };
3347
- var metaAccordionHeader = {
3348
- category: "hidden",
3349
- type: "container",
3350
- label: "Item Header",
3351
- icon: HeaderIcon2,
3352
- requiredAncestors: ["AccordionItem"],
3353
- detachable: false,
3354
- presetStyle: {
3355
- h3: [h3, my(0)].flat()
3356
- }
3357
- };
3358
- var metaAccordionTrigger = {
3359
- category: "hidden",
3360
- type: "container",
3361
- label: "Item Trigger",
3362
- icon: TriggerIcon6,
3363
- requiredAncestors: ["AccordionHeader"],
3364
- detachable: false,
3365
- states: [
3366
- ...defaultStates4,
3367
- {
3368
- category: "component-states",
3369
- label: "Open",
3370
- selector: "[data-state=open]"
3371
- }
3372
- ],
3373
- presetStyle: {
3374
- button: [button3, buttonReset].flat()
3375
- }
3376
- };
3377
- var metaAccordionContent = {
3378
- category: "hidden",
3379
- type: "container",
3380
- label: "Item Content",
3381
- icon: ContentIcon6,
3382
- requiredAncestors: ["AccordionItem"],
3383
- detachable: false,
3384
- presetStyle: presetStyle7
3385
- };
3386
-
3387
- // src/navigation-menu.ws.ts
3388
- import {
3389
- ContentIcon as ContentIcon7,
3390
- ListIcon,
3391
- ListItemIcon,
3392
- TriggerIcon as TriggerIcon7,
3393
- BoxIcon,
3394
- ChevronDownIcon as ChevronDownIcon2,
3395
- ViewportIcon,
3396
- NavigationMenuIcon
3397
- } from "@webstudio-is/icons/svg";
3398
- import { div as div7 } from "@webstudio-is/sdk/normalize.css";
3399
- var presetStyle8 = {
3400
- div: div7
3401
- };
3402
- var components = [
3403
- {
3404
- title: "Sheet",
3405
- href: "/docs/components/sheet",
3406
- description: "Extends the Dialog component to display content that complements the main content of the screen."
3407
- },
3408
- {
3409
- title: "Navigation Menu",
3410
- href: "/docs/components/navigation-menu",
3411
- description: "A collection of links for navigating websites."
3412
- },
3413
- {
3414
- title: "Tabs",
3415
- href: "/docs/components/tabs",
3416
- description: "A set of layered sections of content\u2014known as tab panels\u2014that are displayed one at a time."
3417
- },
3418
- {
3419
- title: "Accordion",
3420
- href: "/docs/components/accordion",
3421
- description: "A vertically stacked set of interactive headings that each reveal a section of content."
3422
- },
3423
- {
3424
- title: "Dialog",
3425
- href: "/docs/components/dialog",
3426
- description: "A window overlaid on either the primary window or another dialog window, rendering the content underneath inert."
3427
- },
3428
- {
3429
- title: "Collapsible",
3430
- href: "/docs/components/collapsible",
3431
- description: "An interactive component which expands/collapses a panel."
3432
- },
3433
- {
3434
- title: "Popover",
3435
- href: "/docs/components/popover",
3436
- description: "Displays rich content in a portal, triggered by a button."
3437
- },
3438
- {
3439
- title: "Tooltip",
3440
- href: "/docs/components/tooltip",
3441
- description: "A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it."
3442
- },
3443
- {
3444
- title: "Button",
3445
- href: "/docs/components/button",
3446
- description: "Displays a button or a component that looks like a button."
3447
- }
3448
- ];
3449
- var navItem = (props2) => [
3450
- {
3451
- type: "instance",
3452
- component: "NavigationMenuLink",
3453
- children: [
3454
- {
3455
- type: "instance",
3456
- component: "Link",
3457
- // block select-none space-y-1 rounded-md p-3 leading-none
3458
- // no-underline outline-none transition-colors
3459
- // hover:bg-accent hover:text-accent-foreground
3460
- // focus:bg-accent focus:text-accent-foreground
3461
- styles: [
3462
- text("inherit"),
3463
- flex(),
3464
- flex("col"),
3465
- select("none"),
3466
- gap(1),
3467
- rounded("md"),
3468
- p(3),
3469
- leading("none"),
3470
- noUnderline(),
3471
- outline("none"),
3472
- hover([bg("accent"), text("accentForeground")].flat()),
3473
- focus([bg("accent"), text("accentForeground")].flat())
3474
- ].flat(),
3475
- props: [
3476
- {
3477
- name: "href",
3478
- type: "string",
3479
- value: `https://ui.shadcn.com${props2.href}`
3480
- }
3481
- ],
3482
- children: [
3483
- {
3484
- type: "instance",
3485
- component: "Text",
3486
- // text-sm font-medium leading-none
3487
- styles: [
3488
- text("sm"),
3489
- font("medium"),
3490
- leading("none")
3491
- ].flat(),
3492
- children: [
3493
- {
3494
- type: "text",
3495
- value: props2.title,
3496
- placeholder: true
3497
- }
3498
- ]
3499
- },
3500
- {
3501
- type: "instance",
3502
- component: "Paragraph",
3503
- // line-clamp-2 text-sm leading-snug text-muted-foreground
3504
- styles: [
3505
- m(0),
3506
- lineClamp2(2),
3507
- text("sm"),
3508
- leading("snug"),
3509
- text("mutedForeground")
3510
- ].flat(),
3511
- children: [
3512
- {
3513
- type: "text",
3514
- value: props2.description,
3515
- placeholder: true
3516
- }
3517
- ]
3518
- }
3519
- ]
3520
- }
3521
- ]
3522
- }
3523
- ];
3524
- var navItemsList = (props2) => [
3525
- {
3526
- type: "instance",
3527
- component: "Box",
3528
- label: "Flex Column",
3529
- styles: [w(64), flex(), gap(4), flex("col")].flat(),
3530
- children: Array.from(
3531
- Array(props2.count),
3532
- (_, index) => navItem(components[index + props2.offset])
3533
- ).flat()
3534
- }
3535
- ];
3536
- var menuItemLink = (props2) => [
3537
- {
3538
- type: "instance",
3539
- component: "NavigationMenuItem",
3540
- children: [
3541
- {
3542
- type: "instance",
3543
- component: "NavigationMenuLink",
3544
- children: [
3545
- {
3546
- type: "instance",
3547
- component: "Link",
3548
- styles: [
3549
- getButtonStyles("ghost", "sm"),
3550
- noUnderline(),
3551
- text("current")
3552
- ].flat(),
3553
- children: [{ type: "text", value: props2.title, placeholder: true }]
3554
- }
3555
- ]
3556
- }
3557
- ]
3558
- }
3559
- ];
3560
- var menuItem = (props2) => [
3561
- {
3562
- type: "instance",
3563
- component: "NavigationMenuItem",
3564
- children: [
3565
- {
3566
- type: "instance",
3567
- component: "NavigationMenuTrigger",
3568
- children: [
3569
- {
3570
- type: "instance",
3571
- component: "Button",
3572
- styles: [
3573
- getButtonStyles("ghost", "sm"),
3574
- property("--navigation-menu-trigger-icon-transform", "0deg"),
3575
- state(
3576
- [
3577
- property(
3578
- "--navigation-menu-trigger-icon-transform",
3579
- "180deg"
3580
- )
3581
- ],
3582
- "[data-state=open]"
3583
- )
3584
- ].flat(),
3585
- children: [
3586
- {
3587
- type: "instance",
3588
- component: "Text",
3589
- children: [
3590
- { type: "text", value: props2.title, placeholder: true }
3591
- ]
3592
- },
3593
- {
3594
- type: "instance",
3595
- component: "Box",
3596
- label: "Icon Container",
3597
- // h-4 w-4 shrink-0 transition-transform duration-200
3598
- styles: [
3599
- ml(1),
3600
- property(
3601
- "rotate",
3602
- "--navigation-menu-trigger-icon-transform"
3603
- ),
3604
- h(4),
3605
- w(4),
3606
- shrink(0),
3607
- transition("all"),
3608
- duration(200)
3609
- ].flat(),
3610
- children: [
3611
- {
3612
- type: "instance",
3613
- component: "HtmlEmbed",
3614
- label: "Chevron Icon",
3615
- props: [
3616
- {
3617
- type: "string",
3618
- name: "code",
3619
- value: ChevronDownIcon2
3620
- }
3621
- ],
3622
- children: []
3623
- }
3624
- ]
3625
- }
3626
- ]
3627
- }
3628
- ]
3629
- },
3630
- {
3631
- type: "instance",
3632
- component: "NavigationMenuContent",
3633
- // left-0 top-0 absolute w-max
3634
- styles: [
3635
- left(0),
3636
- top(0),
3637
- absolute(),
3638
- w("max"),
3639
- p(4)
3640
- ].flat(),
3641
- children: [
3642
- {
3643
- type: "instance",
3644
- component: "Box",
3645
- label: "Content",
3646
- styles: [flex(), gap(4), p(props2.padding)].flat(),
3647
- children: props2.children
3648
- }
3649
- ]
3650
- }
3651
- ]
3652
- }
3653
- ];
3654
- var metaNavigationMenu = {
3655
- category: "radix",
3656
- order: 2,
3657
- type: "container",
3658
- description: "A collection of links for navigating websites.",
3659
- icon: NavigationMenuIcon,
3660
- presetStyle: presetStyle8,
3661
- template: [
3662
- {
3663
- type: "instance",
3664
- component: "NavigationMenu",
3665
- props: [],
3666
- // relative
3667
- // Omiting this: z-10 flex max-w-max flex-1 items-center justify-center
3668
- styles: [relative(), maxW("max")].flat(),
3669
- children: [
3670
- {
3671
- type: "instance",
3672
- component: "NavigationMenuList",
3673
- styles: [
3674
- // ul defaults in tailwind
3675
- p(0),
3676
- m(0),
3677
- // shadcdn styles
3678
- flex(),
3679
- flex(1),
3680
- list("none"),
3681
- items("center"),
3682
- justify("center"),
3683
- gap(1)
3684
- ].flat(),
3685
- children: [
3686
- ...menuItem({
3687
- title: "About",
3688
- padding: 2,
3689
- children: [
3690
- {
3691
- type: "instance",
3692
- component: "Box",
3693
- styles: [
3694
- bg("border"),
3695
- p(4),
3696
- w(48),
3697
- rounded("md")
3698
- ].flat(),
3699
- children: [
3700
- {
3701
- type: "text",
3702
- value: "",
3703
- placeholder: true
3704
- }
3705
- ]
3706
- },
3707
- ...navItemsList({ count: 3, offset: 0 })
3708
- ]
3709
- }),
3710
- ...menuItem({
3711
- title: "Components",
3712
- padding: 0,
3713
- children: [
3714
- ...navItemsList({ count: 3, offset: 3 }),
3715
- ...navItemsList({ count: 3, offset: 6 })
3716
- ]
3717
- }),
3718
- ...menuItemLink({ title: "Standalone" })
3719
- ]
3720
- },
3721
- {
3722
- type: "instance",
3723
- component: "Box",
3724
- label: "Viewport Container",
3725
- // absolute left-0 top-full flex justify-center
3726
- styles: [
3727
- absolute(),
3728
- left(0),
3729
- top("full"),
3730
- flex(),
3731
- justify("center")
3732
- ].flat(),
3733
- children: [
3734
- {
3735
- type: "instance",
3736
- component: "NavigationMenuViewport",
3737
- /*
3738
- origin-top-center relative mt-1.5 w-full
3739
- overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg
3740
- h-[var(--radix-navigation-menu-viewport-height)]
3741
- w-[var(--radix-navigation-menu-viewport-width)]
3742
- // anims
3743
- [animation-duration:150ms!important] [transition-duration:150ms!important]
3744
- data-[state=open]:animate-in data-[state=closed]:animate-out
3745
- data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90
3746
- */
3747
- styles: [
3748
- relative(),
3749
- mt(1.5),
3750
- overflow("hidden"),
3751
- rounded("md"),
3752
- border(),
3753
- bg("popover"),
3754
- text("popoverForeground"),
3755
- shadow("lg"),
3756
- property(
3757
- "height",
3758
- "--radix-navigation-menu-viewport-height"
3759
- ),
3760
- property("width", "--radix-navigation-menu-viewport-width")
3761
- ].flat(),
3762
- children: []
3763
- }
3764
- ]
3765
- }
3766
- ]
3767
- }
3768
- ]
3769
- };
3770
- var metaNavigationMenuList = {
3771
- category: "hidden",
3772
- detachable: false,
3773
- type: "container",
3774
- icon: ListIcon,
3775
- requiredAncestors: ["NavigationMenu"],
3776
- presetStyle: presetStyle8,
3777
- label: "Menu List"
3778
- };
3779
- var metaNavigationMenuItem = {
3780
- category: "hidden",
3781
- type: "container",
3782
- icon: ListItemIcon,
3783
- requiredAncestors: ["NavigationMenu"],
3784
- presetStyle: presetStyle8,
3785
- indexWithinAncestor: "NavigationMenu",
3786
- label: "Menu Item"
3787
- };
3788
- var metaNavigationMenuTrigger = {
3789
- category: "hidden",
3790
- detachable: false,
3791
- stylable: false,
3792
- type: "container",
3793
- icon: TriggerIcon7,
3794
- requiredAncestors: ["NavigationMenuItem"],
3795
- presetStyle: presetStyle8,
3796
- label: "Menu Trigger"
3797
- };
3798
- var metaNavigationMenuContent = {
3799
- category: "hidden",
3800
- detachable: false,
3801
- type: "container",
3802
- icon: ContentIcon7,
3803
- requiredAncestors: ["NavigationMenuItem"],
3804
- indexWithinAncestor: "NavigationMenu",
3805
- presetStyle: presetStyle8,
3806
- label: "Menu Content"
3807
- };
3808
- var metaNavigationMenuLink = {
3809
- category: "hidden",
3810
- detachable: true,
3811
- type: "container",
3812
- stylable: false,
3813
- icon: BoxIcon,
3814
- // https://github.com/webstudio-is/webstudio/issues/2193
3815
- // requiredAncestors: ["NavigationMenuContent", "NavigationMenuItem"],
3816
- // Temporary restrict to NavigationMenu
3817
- requiredAncestors: ["NavigationMenu"],
3818
- presetStyle: presetStyle8,
3819
- label: "Accessible Link Wrapper"
3820
- };
3821
- var metaNavigationMenuViewport = {
3822
- category: "hidden",
3823
- detachable: true,
3824
- type: "container",
3825
- icon: ViewportIcon,
3826
- requiredAncestors: ["NavigationMenu"],
3827
- presetStyle: presetStyle8,
3828
- label: "Menu Viewport"
3829
- };
3830
-
3831
- // src/select.ws.ts
3832
- import {
3833
- SelectIcon,
3834
- TriggerIcon as TriggerIcon8,
3835
- FormTextFieldIcon,
3836
- ContentIcon as ContentIcon8,
3837
- ItemIcon as ItemIcon2,
3838
- ViewportIcon as ViewportIcon2,
3839
- TextIcon as TextIcon2,
3840
- CheckMarkIcon
3841
- } from "@webstudio-is/icons/svg";
3842
- import { button as button4, div as div8, span } from "@webstudio-is/sdk/normalize.css";
3843
- var presetStyle9 = {
3844
- div: div8
3845
- };
3846
- var createSelectItem = ({
3847
- props: props2,
3848
- children
3849
- }) => ({
3850
- type: "instance",
3851
- component: "SelectItem",
3852
- props: props2,
3853
- // relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none
3854
- // focus:bg-accent focus:text-accent-foreground
3855
- // data-[disabled]:pointer-events-none data-[disabled]:opacity-50
3856
- styles: [
3857
- relative(),
3858
- flex(),
3859
- w("full"),
3860
- cursor2("default"),
3861
- select("none"),
3862
- items("center"),
3863
- rounded("md"),
3864
- py(1.5),
3865
- pl(8),
3866
- pr(2),
3867
- text("sm"),
3868
- outline("none"),
3869
- focus([bg("accent"), text("accentForeground")].flat()),
3870
- state(
3871
- [pointerEvents("none"), opacity2(50)].flat(),
3872
- "[data-disabled]"
3873
- )
3874
- ].flat(),
3875
- children: [
3876
- {
3877
- type: "instance",
3878
- component: "SelectItemIndicator",
3879
- // absolute left-2 flex h-3.5 w-3.5 items-center justify-center
3880
- styles: [
3881
- absolute(),
3882
- left(2),
3883
- flex(),
3884
- h(3.5),
3885
- w(3.5),
3886
- items("center"),
3887
- justify("center")
3888
- ].flat(),
3889
- children: [
3890
- {
3891
- type: "instance",
3892
- component: "HtmlEmbed",
3893
- label: "Indicator Icon",
3894
- props: [
3895
- {
3896
- type: "string",
3897
- name: "code",
3898
- value: CheckMarkIcon
3899
- }
3900
- ],
3901
- children: []
3902
- }
3903
- ]
3904
- },
3905
- {
3906
- type: "instance",
3907
- component: "SelectItemText",
3908
- children
3909
- }
3910
- ]
3911
- });
3912
- var metaSelect = {
3913
- category: "radix",
3914
- order: 10,
3915
- type: "container",
3916
- icon: SelectIcon,
3917
- stylable: false,
3918
- description: "Use within a form to give your users a list of options to choose from.",
3919
- template: [
3920
- {
3921
- type: "instance",
3922
- component: "Select",
3923
- variables: {
3924
- selectValue: { initialValue: "" }
3925
- },
3926
- props: [
3927
- {
3928
- name: "value",
3929
- type: "expression",
3930
- code: "selectValue"
3931
- },
3932
- {
3933
- name: "onValueChange",
3934
- type: "action",
3935
- value: [
3936
- { type: "execute", args: ["value"], code: `selectValue = value` }
3937
- ]
3938
- }
3939
- ],
3940
- children: [
3941
- {
3942
- type: "instance",
3943
- component: "SelectTrigger",
3944
- // flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background
3945
- // placeholder:text-muted-foreground
3946
- // focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2
3947
- // disabled:cursor-not-allowed disabled:opacity-50
3948
- styles: [
3949
- flex(),
3950
- h(10),
3951
- w("full"),
3952
- items("center"),
3953
- justify("between"),
3954
- rounded("md"),
3955
- border(),
3956
- border("input"),
3957
- bg("background"),
3958
- px(3),
3959
- py(2),
3960
- text("sm"),
3961
- state([text("mutedForeground")].flat(), "::placeholder"),
3962
- focus(
3963
- [outline("none"), ring("ring", 2, "background", 2)].flat()
3964
- ),
3965
- disabled([cursor2("not-allowed"), opacity2(50)].flat())
3966
- ].flat(),
3967
- children: [
3968
- {
3969
- type: "instance",
3970
- component: "SelectValue",
3971
- props: [{ name: "placeholder", type: "string", value: "Theme" }],
3972
- children: []
3973
- }
3974
- ]
3975
- },
3976
- {
3977
- type: "instance",
3978
- component: "SelectContent",
3979
- // relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md
3980
- // data-[state=open]:animate-in
3981
- // data-[state=closed]:animate-out data-[state=closed]:fade-out-0
3982
- // data-[state=open]:fade-in-0
3983
- // data-[state=closed]:zoom-out-95
3984
- // data-[state=open]:zoom-in-95
3985
- // data-[side=bottom]:slide-in-from-top-2
3986
- // data-[side=left]:slide-in-from-right-2
3987
- // data-[side=right]:slide-in-from-left-2
3988
- // data-[side=top]:slide-in-from-bottom-2
3989
- // position=popper
3990
- // data-[side=bottom]:translate-y-1
3991
- // data-[side=left]:-translate-x-1
3992
- // data-[side=right]:translate-x-1
3993
- // data-[side=top]:-translate-y-1
3994
- styles: [
3995
- relative(),
3996
- z(50),
3997
- property("minWidth", "8rem"),
3998
- overflow("hidden"),
3999
- rounded("md"),
4000
- border(),
4001
- bg("popover"),
4002
- text("popoverForeground"),
4003
- shadow("md")
4004
- ].flat(),
4005
- children: [
4006
- {
4007
- type: "instance",
4008
- component: "SelectViewport",
4009
- // p-1
4010
- // position=popper
4011
- // h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]
4012
- styles: [
4013
- p(1),
4014
- property("height", "--radix-select-trigger-height"),
4015
- w("full"),
4016
- property("minWidth", "--radix-select-trigger-width")
4017
- ].flat(),
4018
- children: [
4019
- createSelectItem({
4020
- props: [{ name: "value", type: "string", value: "light" }],
4021
- children: [
4022
- { type: "text", value: "Light", placeholder: true }
4023
- ]
4024
- }),
4025
- createSelectItem({
4026
- props: [{ name: "value", type: "string", value: "dark" }],
4027
- children: [
4028
- { type: "text", value: "Dark", placeholder: true }
4029
- ]
4030
- }),
4031
- createSelectItem({
4032
- props: [{ name: "value", type: "string", value: "system" }],
4033
- children: [
4034
- { type: "text", value: "System", placeholder: true }
4035
- ]
4036
- })
4037
- ]
4038
- }
4039
- ]
4040
- }
4041
- ]
4042
- }
4043
- ]
4044
- };
4045
- var metaSelectTrigger = {
4046
- category: "hidden",
4047
- type: "container",
4048
- icon: TriggerIcon8,
4049
- detachable: false,
4050
- presetStyle: {
4051
- button: button4
4052
- }
4053
- };
4054
- var metaSelectValue = {
4055
- category: "hidden",
4056
- type: "container",
4057
- label: "Value",
4058
- icon: FormTextFieldIcon,
4059
- detachable: false,
4060
- presetStyle: {
4061
- span
4062
- }
4063
- };
4064
- var metaSelectContent = {
4065
- category: "hidden",
4066
- type: "container",
4067
- icon: ContentIcon8,
4068
- detachable: false,
4069
- presetStyle: presetStyle9
4070
- };
4071
- var metaSelectViewport = {
4072
- category: "hidden",
4073
- type: "container",
4074
- icon: ViewportIcon2,
4075
- detachable: false,
4076
- presetStyle: presetStyle9
4077
- };
4078
- var metaSelectItem = {
4079
- category: "hidden",
4080
- type: "container",
4081
- icon: ItemIcon2,
4082
- requiredAncestors: ["SelectViewport"],
4083
- presetStyle: presetStyle9
4084
- };
4085
- var metaSelectItemIndicator = {
4086
- category: "hidden",
4087
- type: "container",
4088
- label: "Indicator",
4089
- icon: CheckMarkIcon,
4090
- detachable: false,
4091
- requiredAncestors: ["SelectItem"],
4092
- presetStyle: {
4093
- span
4094
- }
4095
- };
4096
- var metaSelectItemText = {
4097
- category: "hidden",
4098
- type: "container",
4099
- label: "Item Text",
4100
- icon: TextIcon2,
4101
- detachable: false,
4102
- requiredAncestors: ["SelectItem"],
4103
- presetStyle: {
4104
- span
4105
- }
4106
- };
4107
-
4108
- // src/switch.ws.ts
4109
- import { SwitchIcon, TriggerIcon as TriggerIcon9 } from "@webstudio-is/icons/svg";
4110
- import {
4111
- defaultStates as defaultStates5
4112
- } from "@webstudio-is/react-sdk";
4113
- import { button as button5, span as span2 } from "@webstudio-is/sdk/normalize.css";
4114
- var metaSwitch = {
4115
- category: "radix",
4116
- order: 11,
4117
- type: "container",
4118
- description: "A control that allows the user to toggle between checked and not checked.",
4119
- icon: SwitchIcon,
4120
- states: [
4121
- ...defaultStates5,
4122
- {
4123
- label: "Checked",
4124
- selector: "[data-state=checked]",
4125
- category: "component-states"
4126
- },
4127
- {
4128
- label: "Unchecked",
4129
- selector: "[data-state=unchecked]",
4130
- category: "component-states"
4131
- }
4132
- ],
4133
- presetStyle: {
4134
- button: [button5, buttonReset].flat()
4135
- },
4136
- template: [
4137
- {
4138
- type: "instance",
4139
- component: "Switch",
4140
- variables: {
4141
- switchChecked: { initialValue: false }
4142
- },
4143
- props: [
4144
- {
4145
- name: "checked",
4146
- type: "expression",
4147
- code: "switchChecked"
4148
- },
4149
- {
4150
- name: "onCheckedChange",
4151
- type: "action",
4152
- value: [
4153
- {
4154
- type: "execute",
4155
- args: ["checked"],
4156
- code: `switchChecked = checked`
4157
- }
4158
- ]
4159
- }
4160
- ],
4161
- // peer inline-flex h-[24px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors
4162
- // focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background
4163
- // disabled:cursor-not-allowed disabled:opacity-50
4164
- // data-[state=checked]:bg-primary
4165
- // data-[state=unchecked]:bg-input
4166
- styles: [
4167
- // We are not supporting peer like styles yet
4168
- inlineFlex(),
4169
- property("height", "24px"),
4170
- property("width", "44px"),
4171
- shrink(0),
4172
- cursor2("pointer"),
4173
- items("center"),
4174
- rounded("full"),
4175
- border(2),
4176
- border("transparent"),
4177
- transition("all"),
4178
- focusVisible(
4179
- [outline("none"), ring("ring", 2, "background", 2)].flat()
4180
- ),
4181
- disabled([cursor2("not-allowed"), opacity2(50)].flat()),
4182
- state([bg("primary")].flat(), "[data-state=checked]"),
4183
- state([bg("input")].flat(), "[data-state=unchecked]")
4184
- ].flat(),
4185
- children: [
4186
- {
4187
- type: "instance",
4188
- component: "SwitchThumb",
4189
- // pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform
4190
- // data-[state=checked]:translate-x-5
4191
- // data-[state=unchecked]:translate-x-0
4192
- styles: [
4193
- pointerEvents("none"),
4194
- block(),
4195
- h(5),
4196
- w(5),
4197
- rounded("full"),
4198
- bg("background"),
4199
- shadow("lg"),
4200
- transition("transform"),
4201
- state(
4202
- [property("transform", "translateX(20px)")].flat(),
4203
- "[data-state=checked]"
4204
- ),
4205
- state(
4206
- [property("transform", "translateX(0px)")].flat(),
4207
- "[data-state=unchecked]"
4208
- )
4209
- ].flat(),
4210
- children: []
4211
- }
4212
- ]
4213
- }
4214
- ]
4215
- };
4216
- var metaSwitchThumb = {
4217
- category: "hidden",
4218
- type: "container",
4219
- detachable: false,
4220
- icon: TriggerIcon9,
4221
- states: [
4222
- ...defaultStates5,
4223
- {
4224
- label: "Checked",
4225
- selector: "[data-state=checked]",
4226
- category: "component-states"
4227
- },
4228
- {
4229
- label: "Unchecked",
4230
- selector: "[data-state=unchecked]",
4231
- category: "component-states"
4232
- }
4233
- ],
4234
- presetStyle: {
4235
- span: span2
4236
- }
4237
- };
4238
-
4239
- // src/checkbox.ws.ts
4240
- import {
4241
- CheckMarkIcon as CheckMarkIcon2,
4242
- CheckboxCheckedIcon,
4243
- TriggerIcon as TriggerIcon10
4244
- } from "@webstudio-is/icons/svg";
4245
- import {
4246
- defaultStates as defaultStates6
4247
- } from "@webstudio-is/react-sdk";
4248
- import { button as button6, span as span3 } from "@webstudio-is/sdk/normalize.css";
4249
- var metaCheckbox = {
4250
- category: "radix",
4251
- order: 101,
4252
- type: "container",
4253
- icon: CheckboxCheckedIcon,
4254
- description: "Use within a form to allow your users to toggle between checked and not checked. Group checkboxes by matching their \u201CName\u201D properties. Unlike radios, any number of checkboxes in a group can be checked.",
4255
- states: [
4256
- ...defaultStates6,
4257
- {
4258
- label: "Checked",
4259
- selector: "[data-state=checked]",
4260
- category: "component-states"
4261
- },
4262
- {
4263
- label: "Unchecked",
4264
- selector: "[data-state=unchecked]",
4265
- category: "component-states"
4266
- }
4267
- ],
4268
- presetStyle: {
4269
- button: [button6, buttonReset].flat()
4270
- },
4271
- template: [
4272
- {
4273
- type: "instance",
4274
- component: "Label",
4275
- label: "Checkbox Field",
4276
- styles: [flex(), gap(2), items("center")].flat(),
4277
- children: [
4278
- {
4279
- type: "instance",
4280
- component: "Checkbox",
4281
- variables: {
4282
- checkboxChecked: { initialValue: false }
4283
- },
4284
- props: [
4285
- {
4286
- name: "checked",
4287
- type: "expression",
4288
- code: "checkboxChecked"
4289
- },
4290
- {
4291
- name: "onCheckedChange",
4292
- type: "action",
4293
- value: [
4294
- {
4295
- type: "execute",
4296
- args: ["checked"],
4297
- code: `checkboxChecked = checked`
4298
- }
4299
- ]
4300
- }
4301
- ],
4302
- // peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background
4303
- // focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2
4304
- // disabled:cursor-not-allowed disabled:opacity-50
4305
- // data-[state=checked]:bg-primary
4306
- // data-[state=checked]:text-primary-foreground",
4307
- styles: [
4308
- // We are not supporting peer like styles yet
4309
- h(4),
4310
- w(4),
4311
- shrink(0),
4312
- rounded("sm"),
4313
- border(),
4314
- border("primary"),
4315
- focusVisible(
4316
- [outline("none"), ring("ring", 2, "background", 2)].flat()
4317
- ),
4318
- disabled([cursor2("not-allowed"), opacity2(50)].flat()),
4319
- state(
4320
- [bg("primary"), text("primaryForeground")].flat(),
4321
- "[data-state=checked]"
4322
- )
4323
- ].flat(),
4324
- children: [
4325
- {
4326
- type: "instance",
4327
- component: "CheckboxIndicator",
4328
- // flex items-center justify-center text-current
4329
- styles: [
4330
- flex(),
4331
- items("center"),
4332
- justify("center"),
4333
- text("current")
4334
- ].flat(),
4335
- children: [
4336
- {
4337
- type: "instance",
4338
- component: "HtmlEmbed",
4339
- label: "Indicator Icon",
4340
- props: [
4341
- {
4342
- type: "string",
4343
- name: "code",
4344
- value: CheckMarkIcon2
4345
- }
4346
- ],
4347
- children: []
4348
- }
4349
- ]
4350
- }
4351
- ]
4352
- },
4353
- {
4354
- type: "instance",
4355
- component: "Text",
4356
- label: "Checkbox Label",
4357
- props: [{ name: "tag", type: "string", value: "span" }],
4358
- children: [{ type: "text", value: "Checkbox", placeholder: true }]
4359
- }
4360
- ]
4361
- }
4362
- ]
4363
- };
4364
- var metaCheckboxIndicator = {
4365
- category: "hidden",
4366
- type: "container",
4367
- detachable: false,
4368
- icon: TriggerIcon10,
4369
- states: defaultStates6,
4370
- presetStyle: {
4371
- span: span3
4372
- }
4373
- };
4374
-
4375
- // src/radio-group.ws.ts
4376
- import {
4377
- ItemIcon as ItemIcon3,
4378
- RadioCheckedIcon,
4379
- RadioDotIcon,
4380
- TriggerIcon as TriggerIcon11
4381
- } from "@webstudio-is/icons/svg";
4382
- import {
4383
- defaultStates as defaultStates7
4384
- } from "@webstudio-is/react-sdk";
4385
- import { button as button7, div as div9, span as span4 } from "@webstudio-is/sdk/normalize.css";
4386
- var createRadioGroupItem = ({
4387
- value,
4388
- label: label2
4389
- }) => ({
4390
- type: "instance",
4391
- component: "Label",
4392
- // flex items-center space-x-2
4393
- styles: [flex(), items("center"), gap(2)].flat(),
4394
- children: [
4395
- {
4396
- type: "instance",
4397
- component: "RadioGroupItem",
4398
- props: [{ name: "value", type: "string", value }],
4399
- // aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background
4400
- // focus:outline-none
4401
- // focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2
4402
- // disabled:cursor-not-allowed disabled:opacity-50
4403
- styles: [
4404
- aspect("square"),
4405
- h(4),
4406
- w(4),
4407
- rounded("full"),
4408
- border(),
4409
- border("primary"),
4410
- text("primary"),
4411
- focusVisible(
4412
- [outline("none"), ring("ring", 2, "background", 2)].flat()
4413
- ),
4414
- disabled([cursor2("not-allowed"), opacity2(50)].flat())
4415
- ].flat(),
4416
- children: [
4417
- {
4418
- type: "instance",
4419
- component: "RadioGroupIndicator",
4420
- children: [
4421
- {
4422
- type: "instance",
4423
- component: "HtmlEmbed",
4424
- label: "Indicator Icon",
4425
- props: [
4426
- {
4427
- type: "string",
4428
- name: "code",
4429
- value: RadioDotIcon
4430
- }
4431
- ],
4432
- children: []
4433
- }
4434
- ]
4435
- }
4436
- ]
4437
- },
4438
- {
4439
- type: "instance",
4440
- component: "Text",
4441
- children: [{ type: "text", value: label2, placeholder: true }]
4442
- }
4443
- ]
4444
- });
4445
- var metaRadioGroup = {
4446
- category: "radix",
4447
- order: 100,
4448
- type: "container",
4449
- description: "A set of checkable buttons\u2014known as radio buttons\u2014where no more than one of the buttons can be checked at a time.",
4450
- icon: RadioCheckedIcon,
4451
- states: [
4452
- ...defaultStates7,
4453
- {
4454
- label: "Checked",
4455
- selector: "[data-state=checked]",
4456
- category: "component-states"
4457
- },
4458
- {
4459
- label: "Unchecked",
4460
- selector: "[data-state=unchecked]",
4461
- category: "component-states"
4462
- }
4463
- ],
4464
- presetStyle: {
4465
- div: div9
4466
- },
4467
- template: [
4468
- {
4469
- type: "instance",
4470
- component: "RadioGroup",
4471
- variables: {
4472
- radioGroupValue: { initialValue: "" }
4473
- },
4474
- // grid gap-2
4475
- styles: [flex(), flex("col"), gap(2)].flat(),
4476
- props: [
4477
- {
4478
- type: "expression",
4479
- name: "value",
4480
- code: "radioGroupValue"
4481
- },
4482
- {
4483
- name: "onValueChange",
4484
- type: "action",
4485
- value: [
4486
- {
4487
- type: "execute",
4488
- args: ["value"],
4489
- code: `radioGroupValue = value`
4490
- }
4491
- ]
4492
- }
4493
- ],
4494
- children: [
4495
- createRadioGroupItem({ value: "default", label: "Default" }),
4496
- createRadioGroupItem({ value: "comfortable", label: "Comfortable" }),
4497
- createRadioGroupItem({ value: "compact", label: "Compact" })
4498
- ]
4499
- }
4500
- ]
4501
- };
4502
- var metaRadioGroupItem = {
4503
- category: "hidden",
4504
- type: "container",
4505
- requiredAncestors: ["RadioGroup"],
4506
- icon: ItemIcon3,
4507
- states: defaultStates7,
4508
- presetStyle: {
4509
- button: [button7, buttonReset].flat()
4510
- }
4511
- };
4512
- var metaRadioGroupIndicator = {
4513
- category: "hidden",
4514
- type: "container",
4515
- detachable: false,
4516
- icon: TriggerIcon11,
4517
- states: defaultStates7,
4518
- presetStyle: {
4519
- span: span4
4520
- }
4521
- };
1
+ import { metaCollapsible as t, metaCollapsibleContent as o, metaCollapsibleTrigger as i } from "./collapsible.ws.js";
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";
4522
14
  export {
4523
- metaAccordion as Accordion,
4524
- metaAccordionContent as AccordionContent,
4525
- metaAccordionHeader as AccordionHeader,
4526
- metaAccordionItem as AccordionItem,
4527
- metaAccordionTrigger as AccordionTrigger,
4528
- metaCheckbox as Checkbox,
4529
- metaCheckboxIndicator as CheckboxIndicator,
4530
- metaCollapsible as Collapsible,
4531
- metaCollapsibleContent as CollapsibleContent,
4532
- metaCollapsibleTrigger as CollapsibleTrigger,
4533
- metaDialog as Dialog,
4534
- metaDialogClose as DialogClose,
4535
- metaDialogContent as DialogContent,
4536
- metaDialogDescription as DialogDescription,
4537
- metaDialogOverlay as DialogOverlay,
4538
- metaDialogTitle as DialogTitle,
4539
- metaDialogTrigger as DialogTrigger,
4540
- meta2 as Label,
4541
- metaNavigationMenu as NavigationMenu,
4542
- metaNavigationMenuContent as NavigationMenuContent,
4543
- metaNavigationMenuItem as NavigationMenuItem,
4544
- metaNavigationMenuLink as NavigationMenuLink,
4545
- metaNavigationMenuList as NavigationMenuList,
4546
- metaNavigationMenuTrigger as NavigationMenuTrigger,
4547
- metaNavigationMenuViewport as NavigationMenuViewport,
4548
- metaPopover as Popover,
4549
- metaPopoverContent as PopoverContent,
4550
- metaPopoverTrigger as PopoverTrigger,
4551
- metaRadioGroup as RadioGroup,
4552
- metaRadioGroupIndicator as RadioGroupIndicator,
4553
- metaRadioGroupItem as RadioGroupItem,
4554
- metaSelect as Select,
4555
- metaSelectContent as SelectContent,
4556
- metaSelectItem as SelectItem,
4557
- metaSelectItemIndicator as SelectItemIndicator,
4558
- metaSelectItemText as SelectItemText,
4559
- metaSelectTrigger as SelectTrigger,
4560
- metaSelectValue as SelectValue,
4561
- metaSelectViewport as SelectViewport,
4562
- meta as Sheet,
4563
- metaSwitch as Switch,
4564
- metaSwitchThumb as SwitchThumb,
4565
- metaTabs as Tabs,
4566
- metaTabsContent as TabsContent,
4567
- metaTabsList as TabsList,
4568
- metaTabsTrigger as TabsTrigger,
4569
- metaTooltip as Tooltip,
4570
- metaTooltipContent as TooltipContent,
4571
- metaTooltipTrigger as TooltipTrigger
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,
22
+ t as Collapsible,
23
+ o as CollapsibleContent,
24
+ i as CollapsibleTrigger,
25
+ n as Dialog,
26
+ m as DialogClose,
27
+ s as DialogContent,
28
+ l as DialogDescription,
29
+ g as DialogOverlay,
30
+ c as DialogTitle,
31
+ 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
4572
64
  };