@webstudio-is/sdk-components-react-radix 0.85.0 → 0.87.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 (149) hide show
  1. package/lib/__generated__/accordion.props.js +2134 -0
  2. package/lib/__generated__/button.props.js +454 -0
  3. package/lib/__generated__/dialog.props.js +0 -7
  4. package/lib/__generated__/input.props.js +451 -0
  5. package/lib/__generated__/label.props.js +421 -0
  6. package/lib/__generated__/popover.props.js +0 -7
  7. package/lib/__generated__/sheet.props.js +0 -7
  8. package/lib/__generated__/textarea.props.js +431 -0
  9. package/lib/__generated__/tooltip.props.js +0 -7
  10. package/lib/accordion.js +51 -0
  11. package/lib/accordion.ws.js +243 -0
  12. package/lib/button.js +8 -0
  13. package/lib/button.ws.js +133 -0
  14. package/lib/cjs/__generated__/accordion.props.js +2154 -0
  15. package/lib/cjs/__generated__/button.props.js +474 -0
  16. package/lib/cjs/__generated__/dialog.props.js +0 -7
  17. package/lib/cjs/__generated__/input.props.js +471 -0
  18. package/lib/cjs/__generated__/label.props.js +441 -0
  19. package/lib/cjs/__generated__/popover.props.js +0 -7
  20. package/lib/cjs/__generated__/sheet.props.js +0 -7
  21. package/lib/cjs/__generated__/textarea.props.js +451 -0
  22. package/lib/cjs/__generated__/tooltip.props.js +0 -7
  23. package/lib/cjs/accordion.js +60 -0
  24. package/lib/cjs/accordion.ws.js +261 -0
  25. package/lib/cjs/button.js +28 -0
  26. package/lib/cjs/button.ws.js +160 -0
  27. package/lib/cjs/collapsible.js +2 -16
  28. package/lib/cjs/collapsible.ws.js +1 -8
  29. package/lib/cjs/components.js +14 -0
  30. package/lib/cjs/dialog.js +38 -6
  31. package/lib/cjs/dialog.ws.js +15 -26
  32. package/lib/cjs/hooks.js +15 -1
  33. package/lib/cjs/input.js +28 -0
  34. package/lib/cjs/input.ws.js +103 -0
  35. package/lib/cjs/label.js +37 -0
  36. package/lib/cjs/label.ws.js +74 -0
  37. package/lib/cjs/metas.js +14 -0
  38. package/lib/cjs/popover.js +37 -5
  39. package/lib/cjs/popover.ws.js +15 -18
  40. package/lib/cjs/props.js +14 -0
  41. package/lib/cjs/sheet.js +34 -1
  42. package/lib/cjs/sheet.ws.js +33 -19
  43. package/lib/cjs/tabs.js +20 -1
  44. package/lib/cjs/tabs.ws.js +3 -25
  45. package/lib/cjs/textarea.js +28 -0
  46. package/lib/cjs/textarea.ws.js +98 -0
  47. package/lib/cjs/theme/tailwind-classes.js +186 -23
  48. package/lib/cjs/theme/tailwind-colors.js +10 -1
  49. package/lib/cjs/tooltip.js +36 -4
  50. package/lib/cjs/tooltip.ws.js +15 -18
  51. package/lib/collapsible.js +2 -16
  52. package/lib/collapsible.ws.js +1 -8
  53. package/lib/components.js +20 -0
  54. package/lib/dialog.js +38 -6
  55. package/lib/dialog.ws.js +15 -26
  56. package/lib/hooks.js +15 -1
  57. package/lib/input.js +8 -0
  58. package/lib/input.ws.js +75 -0
  59. package/lib/label.js +9 -0
  60. package/lib/label.ws.js +46 -0
  61. package/lib/metas.js +20 -0
  62. package/lib/popover.js +37 -5
  63. package/lib/popover.ws.js +15 -18
  64. package/lib/props.js +20 -0
  65. package/lib/sheet.js +34 -1
  66. package/lib/sheet.ws.js +33 -19
  67. package/lib/tabs.js +24 -2
  68. package/lib/tabs.ws.js +3 -25
  69. package/lib/textarea.js +8 -0
  70. package/lib/textarea.ws.js +70 -0
  71. package/lib/theme/tailwind-classes.js +191 -24
  72. package/lib/theme/tailwind-colors.js +10 -1
  73. package/lib/tooltip.js +36 -4
  74. package/lib/tooltip.ws.js +15 -18
  75. package/lib/types/__generated__/accordion.props.d.ts +6 -0
  76. package/lib/types/__generated__/button.props.d.ts +2 -0
  77. package/lib/types/__generated__/input.props.d.ts +2 -0
  78. package/lib/types/__generated__/label.props.d.ts +2 -0
  79. package/lib/types/__generated__/textarea.props.d.ts +2 -0
  80. package/lib/types/accordion.d.ts +12 -0
  81. package/lib/types/accordion.ws.d.ts +11 -0
  82. package/lib/types/button.d.ts +7 -0
  83. package/lib/types/button.stories.d.ts +20 -0
  84. package/lib/types/button.ws.d.ts +7 -0
  85. package/lib/types/components.d.ts +5 -0
  86. package/lib/types/dialog.d.ts +5 -11
  87. package/lib/types/input.d.ts +2 -0
  88. package/lib/types/input.stories.d.ts +20 -0
  89. package/lib/types/input.ws.d.ts +3 -0
  90. package/lib/types/label.d.ts +3 -0
  91. package/lib/types/label.stories.d.ts +9 -0
  92. package/lib/types/label.ws.d.ts +3 -0
  93. package/lib/types/metas.d.ts +5 -0
  94. package/lib/types/popover.d.ts +4 -10
  95. package/lib/types/props.d.ts +5 -0
  96. package/lib/types/sheet.d.ts +4 -4
  97. package/lib/types/tabs.d.ts +2 -0
  98. package/lib/types/textarea.d.ts +2 -0
  99. package/lib/types/textarea.stories.d.ts +14 -0
  100. package/lib/types/textarea.ws.d.ts +3 -0
  101. package/lib/types/theme/tailwind-classes.d.ts +16 -5
  102. package/lib/types/theme/tailwind-colors.d.ts +9 -0
  103. package/lib/types/tooltip.d.ts +3 -9
  104. package/package.json +9 -7
  105. package/src/__generated__/accordion.props.ts +2382 -0
  106. package/src/__generated__/button.props.ts +503 -0
  107. package/src/__generated__/dialog.props.ts +0 -7
  108. package/src/__generated__/input.props.ts +500 -0
  109. package/src/__generated__/label.props.ts +470 -0
  110. package/src/__generated__/popover.props.ts +0 -7
  111. package/src/__generated__/sheet.props.ts +0 -7
  112. package/src/__generated__/textarea.props.ts +480 -0
  113. package/src/__generated__/tooltip.props.ts +0 -7
  114. package/src/accordion.stories.tsx +21 -0
  115. package/src/accordion.tsx +81 -0
  116. package/src/accordion.ws.ts +270 -0
  117. package/src/button.stories.ts +35 -0
  118. package/src/button.tsx +25 -0
  119. package/src/button.ws.ts +155 -0
  120. package/src/collapsible.tsx +2 -16
  121. package/src/collapsible.ws.ts +1 -8
  122. package/src/components.ts +11 -0
  123. package/src/dialog.stories.tsx +21 -0
  124. package/src/dialog.tsx +50 -24
  125. package/src/dialog.ws.tsx +15 -26
  126. package/src/hooks.ts +15 -1
  127. package/src/input.stories.ts +31 -0
  128. package/src/input.tsx +12 -0
  129. package/src/input.ws.ts +78 -0
  130. package/src/label.stories.ts +22 -0
  131. package/src/label.tsx +15 -0
  132. package/src/label.ws.ts +48 -0
  133. package/src/metas.ts +11 -0
  134. package/src/popover.stories.tsx +21 -0
  135. package/src/popover.tsx +49 -23
  136. package/src/popover.ws.tsx +15 -18
  137. package/src/props.ts +11 -0
  138. package/src/sheet.tsx +39 -0
  139. package/src/sheet.ws.tsx +33 -19
  140. package/src/tabs.tsx +32 -1
  141. package/src/tabs.ws.ts +1 -23
  142. package/src/textarea.stories.ts +27 -0
  143. package/src/textarea.tsx +12 -0
  144. package/src/textarea.ws.ts +74 -0
  145. package/src/theme/tailwind-classes.ts +233 -38
  146. package/src/theme/tailwind-colors.ts +9 -16
  147. package/src/tooltip.stories.tsx +21 -0
  148. package/src/tooltip.tsx +46 -20
  149. package/src/tooltip.ws.tsx +15 -18
@@ -49,6 +49,7 @@ var import_react_sdk = require("@webstudio-is/react-sdk");
49
49
  var tc = __toESM(require("./theme/tailwind-classes"), 1);
50
50
  var import_sheet = require("./__generated__/sheet.props");
51
51
  var import_css_normalize = require("@webstudio-is/react-sdk/css-normalize");
52
+ var import_button = require("./button.ws");
52
53
  const contentPresetStyle = {
53
54
  div: import_css_normalize.div,
54
55
  nav: import_css_normalize.nav
@@ -68,7 +69,6 @@ const descriptionPresetStyle = {
68
69
  const metaSheetTrigger = {
69
70
  category: "hidden",
70
71
  type: "container",
71
- label: "Sheet Trigger",
72
72
  icon: import_svg.TriggerIcon,
73
73
  stylable: false,
74
74
  detachable: false
@@ -76,7 +76,6 @@ const metaSheetTrigger = {
76
76
  const metaSheetContent = {
77
77
  category: "hidden",
78
78
  type: "container",
79
- label: "Sheet Content",
80
79
  icon: import_svg.ContentIcon,
81
80
  detachable: false,
82
81
  presetStyle: contentPresetStyle,
@@ -91,7 +90,6 @@ const metaSheetOverlay = {
91
90
  category: "hidden",
92
91
  type: "container",
93
92
  presetStyle,
94
- label: "Sheet Overlay",
95
93
  icon: import_svg.OverlayIcon,
96
94
  detachable: false
97
95
  };
@@ -99,27 +97,23 @@ const metaSheetTitle = {
99
97
  category: "hidden",
100
98
  type: "container",
101
99
  presetStyle: titlePresetStyle,
102
- label: "Sheet Title",
103
100
  icon: import_svg.HeadingIcon
104
101
  };
105
102
  const metaSheetDescription = {
106
103
  category: "hidden",
107
104
  type: "container",
108
105
  presetStyle: descriptionPresetStyle,
109
- label: "Sheet Description",
110
106
  icon: import_svg.TextIcon
111
107
  };
112
108
  const metaSheetClose = {
113
109
  category: "hidden",
114
110
  type: "container",
115
111
  presetStyle: buttonPresetStyle,
116
- label: "Sheet Close",
117
112
  icon: import_svg.ButtonElementIcon
118
113
  };
119
114
  const metaSheet = {
120
115
  category: "radix",
121
116
  type: "container",
122
- label: "Sheet",
123
117
  icon: import_svg.HamburgerMenuIcon,
124
118
  order: 15,
125
119
  stylable: false,
@@ -128,27 +122,47 @@ const metaSheet = {
128
122
  type: "instance",
129
123
  component: "Sheet",
130
124
  dataSources: {
131
- // We don't have support for boolean or undefined, instead of binding on open we bind on a string
132
- isOpen: { type: "variable", initialValue: "initial" }
125
+ sheetOpen: { type: "variable", initialValue: false }
133
126
  },
134
127
  props: [
135
128
  {
136
129
  type: "dataSource",
137
- name: "isOpen",
138
- dataSourceName: "isOpen"
130
+ name: "open",
131
+ dataSourceName: "sheetOpen"
132
+ },
133
+ {
134
+ name: "onOpenChange",
135
+ type: "action",
136
+ value: [
137
+ { type: "execute", args: ["open"], code: `sheetOpen = open` }
138
+ ]
139
139
  }
140
140
  ],
141
141
  children: [
142
142
  {
143
143
  type: "instance",
144
144
  component: "SheetTrigger",
145
- children: [
146
- {
147
- type: "instance",
148
- component: "Button",
149
- children: [{ type: "text", value: "Button" }]
150
- }
151
- ]
145
+ children: (0, import_button.template)({
146
+ props: [
147
+ { name: "variant", type: "string", value: "ghost" },
148
+ { name: "size", type: "string", value: "icon" }
149
+ ],
150
+ children: [
151
+ {
152
+ type: "instance",
153
+ component: "HtmlEmbed",
154
+ label: "Hamburger Menu Svg",
155
+ props: [
156
+ {
157
+ type: "string",
158
+ name: "code",
159
+ value: import_svg.HamburgerMenuIcon
160
+ }
161
+ ],
162
+ children: []
163
+ }
164
+ ]
165
+ })
152
166
  },
153
167
  {
154
168
  type: "instance",
@@ -290,7 +304,7 @@ const metaSheet = {
290
304
  };
291
305
  const propsMetaSheet = {
292
306
  props: import_sheet.propsSheet,
293
- initialProps: ["isOpen", "modal"]
307
+ initialProps: ["open", "modal"]
294
308
  };
295
309
  const propsMetaSheetTrigger = {
296
310
  props: import_sheet.propsSheetTrigger
package/lib/cjs/tabs.js CHANGED
@@ -21,7 +21,8 @@ __export(tabs_exports, {
21
21
  Tabs: () => Tabs,
22
22
  TabsContent: () => TabsContent,
23
23
  TabsList: () => TabsList,
24
- TabsTrigger: () => TabsTrigger
24
+ TabsTrigger: () => TabsTrigger,
25
+ hooksTabs: () => hooksTabs
25
26
  });
26
27
  module.exports = __toCommonJS(tabs_exports);
27
28
  var import_jsx_runtime = require("react/jsx-runtime");
@@ -39,3 +40,21 @@ const TabsContent = (0, import_react.forwardRef)(({ value, ...props }, ref) => {
39
40
  const index = (0, import_react_sdk.getIndexWithinAncestorFromComponentProps)(props);
40
41
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_tabs.Content, { ref, value: value ?? index, ...props });
41
42
  });
43
+ const namespace = "@webstudio-is/sdk-components-react-radix";
44
+ const hooksTabs = {
45
+ onNavigatorSelect: (context, event) => {
46
+ for (const instance of event.instancePath) {
47
+ if (instance.component === `${namespace}:TabsContent`) {
48
+ const tabs = (0, import_react_sdk.getClosestInstance)(
49
+ event.instancePath,
50
+ instance,
51
+ `${namespace}:Tabs`
52
+ );
53
+ const contentValue = context.getPropValue(instance.id, "value") ?? context.indexesWithinAncestors.get(instance.id)?.toString();
54
+ if (tabs && contentValue) {
55
+ context.setPropVariable(tabs.id, "value", contentValue);
56
+ }
57
+ }
58
+ }
59
+ }
60
+ };
@@ -74,7 +74,6 @@ const tabsContentStyles = [
74
74
  const metaTabs = {
75
75
  category: "radix",
76
76
  type: "container",
77
- label: "Tabs",
78
77
  icon: import_svg.TabsIcon,
79
78
  presetStyle,
80
79
  template: [
@@ -90,11 +89,7 @@ const metaTabs = {
90
89
  name: "onValueChange",
91
90
  type: "action",
92
91
  value: [
93
- {
94
- type: "execute",
95
- args: ["value"],
96
- code: `tabsValue = value`
97
- }
92
+ { type: "execute", args: ["value"], code: `tabsValue = value` }
98
93
  ]
99
94
  }
100
95
  ],
@@ -162,7 +157,6 @@ const metaTabsList = {
162
157
  category: "hidden",
163
158
  detachable: false,
164
159
  type: "container",
165
- label: "Tabs List",
166
160
  icon: import_svg.HeaderIcon,
167
161
  requiredAncestors: ["Tabs"],
168
162
  presetStyle
@@ -170,34 +164,18 @@ const metaTabsList = {
170
164
  const metaTabsTrigger = {
171
165
  category: "hidden",
172
166
  type: "container",
173
- label: "Tabs Trigger",
174
167
  icon: import_svg.TriggerIcon,
175
168
  requiredAncestors: ["TabsList"],
176
169
  invalidAncestors: ["TabsTrigger"],
177
- indexWithinAncestor: "Tabs",
178
- template: [
179
- {
180
- type: "instance",
181
- component: "TabsTrigger",
182
- children: [{ type: "text", value: "New Tab" }]
183
- }
184
- ]
170
+ indexWithinAncestor: "Tabs"
185
171
  };
186
172
  const metaTabsContent = {
187
173
  category: "hidden",
188
174
  type: "container",
189
- label: "Tabs Content",
190
175
  icon: import_svg.ContentIcon,
191
176
  requiredAncestors: ["Tabs"],
192
177
  indexWithinAncestor: "Tabs",
193
- presetStyle,
194
- template: [
195
- {
196
- type: "instance",
197
- component: "TabsContent",
198
- children: [{ type: "text", value: "New Tab Content" }]
199
- }
200
- ]
178
+ presetStyle
201
179
  };
202
180
  const propsMetaTabs = {
203
181
  props: import_tabs.propsTabs
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var textarea_exports = {};
20
+ __export(textarea_exports, {
21
+ Textarea: () => Textarea
22
+ });
23
+ module.exports = __toCommonJS(textarea_exports);
24
+ var import_jsx_runtime = require("react/jsx-runtime");
25
+ var import_react = require("react");
26
+ const Textarea = (0, import_react.forwardRef)(({ children: _children, ...props }, ref) => {
27
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("textarea", { ref, ...props });
28
+ });
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var textarea_ws_exports = {};
30
+ __export(textarea_ws_exports, {
31
+ meta: () => meta,
32
+ propsMeta: () => propsMeta
33
+ });
34
+ module.exports = __toCommonJS(textarea_ws_exports);
35
+ var import_svg = require("@webstudio-is/icons/svg");
36
+ var import_react_sdk = require("@webstudio-is/react-sdk");
37
+ var import_css_normalize = require("@webstudio-is/react-sdk/css-normalize");
38
+ var import_textarea = require("./__generated__/textarea.props");
39
+ var tc = __toESM(require("./theme/tailwind-classes"), 1);
40
+ const presetStyle = {
41
+ textarea: import_css_normalize.textarea
42
+ };
43
+ const meta = {
44
+ category: "radix",
45
+ type: "control",
46
+ invalidAncestors: ["Button"],
47
+ icon: import_svg.FormTextAreaIcon,
48
+ presetStyle,
49
+ states: [
50
+ ...import_react_sdk.defaultStates,
51
+ { selector: ":disabled", label: "Disabled" },
52
+ { selector: "::placeholder", label: "Placeholder" },
53
+ // @todo share https://github.com/webstudio-is/webstudio-builder/issues/2102
54
+ { selector: ":valid", label: "Valid" },
55
+ { selector: ":invalid", label: "Invalid" },
56
+ { selector: ":required", label: "Required" },
57
+ { selector: ":optional", label: "Optional" },
58
+ { selector: ":enabled", label: "Enabled" },
59
+ { selector: ":read-only", label: "Read Only" },
60
+ { selector: ":read-write", label: "Read Write" }
61
+ ],
62
+ order: 1,
63
+ template: [
64
+ {
65
+ type: "instance",
66
+ component: "Textarea",
67
+ styles: [
68
+ // flex min-h-[80px] w-full rounded-md
69
+ // border border-input bg-background
70
+ // px-3 py-2 text-sm ring-offset-background
71
+ // placeholder:text-muted-foreground
72
+ // focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring
73
+ // focus-visible:ring-offset-2
74
+ // disabled:cursor-not-allowed disabled:opacity-50
75
+ tc.flex(),
76
+ tc.minH(20),
77
+ tc.w("full"),
78
+ tc.rounded("md"),
79
+ tc.border(),
80
+ tc.border("input"),
81
+ tc.bg("background"),
82
+ tc.px(3),
83
+ tc.py(2),
84
+ tc.text("sm"),
85
+ tc.state(tc.text("mutedForeground"), "::placeholder"),
86
+ tc.focusVisible(
87
+ [tc.outline("none"), tc.ring("ring", 2, "background", 2)].flat()
88
+ ),
89
+ tc.disabled([tc.cursor("not-allowed"), tc.opacity(50)].flat())
90
+ ].flat(),
91
+ children: []
92
+ }
93
+ ]
94
+ };
95
+ const propsMeta = {
96
+ props: import_textarea.props,
97
+ initialProps: ["id", "name", "placeholder", "required", "autoFocus"]
98
+ };
@@ -22,7 +22,9 @@ __export(tailwind_classes_exports, {
22
22
  backdropBlur: () => backdropBlur,
23
23
  bg: () => bg,
24
24
  border: () => border,
25
+ borderB: () => borderB,
25
26
  bottom: () => bottom,
27
+ cursor: () => cursor,
26
28
  disabled: () => disabled,
27
29
  fixed: () => fixed,
28
30
  flex: () => flex,
@@ -43,6 +45,7 @@ __export(tailwind_classes_exports, {
43
45
  m: () => m,
44
46
  maxW: () => maxW,
45
47
  mb: () => mb,
48
+ minH: () => minH,
46
49
  ml: () => ml,
47
50
  mr: () => mr,
48
51
  mt: () => mt,
@@ -52,7 +55,11 @@ __export(tailwind_classes_exports, {
52
55
  outline: () => outline,
53
56
  overflow: () => overflow,
54
57
  p: () => p,
58
+ pb: () => pb,
59
+ pl: () => pl,
55
60
  pointerEvents: () => pointerEvents,
61
+ pr: () => pr,
62
+ pt: () => pt,
56
63
  px: () => px,
57
64
  py: () => py,
58
65
  relative: () => relative,
@@ -65,6 +72,8 @@ __export(tailwind_classes_exports, {
65
72
  top: () => top,
66
73
  tracking: () => tracking,
67
74
  transition: () => transition,
75
+ underline: () => underline,
76
+ underlineOffset: () => underlineOffset,
68
77
  w: () => w,
69
78
  whitespace: () => whitespace,
70
79
  z: () => z
@@ -147,38 +156,93 @@ const rounded = (radius) => {
147
156
  }
148
157
  ];
149
158
  };
150
- const border = (borderWidth) => {
151
- const key = `${borderWidth ?? "DEFAULT"}`;
152
- const valueString = (0, import_tailwind_theme.theme)("borderWidth")?.[key] ?? "1px";
153
- const value = (0, import_css_data.parseCssValue)("borderTopWidth", valueString);
159
+ const border = (borderWidthOrColor) => {
160
+ if (typeof borderWidthOrColor === "number" || borderWidthOrColor === void 0) {
161
+ const key = `${borderWidthOrColor ?? "DEFAULT"}`;
162
+ const valueString = (0, import_tailwind_theme.theme)("borderWidth")?.[key] ?? "1px";
163
+ const value2 = (0, import_css_data.parseCssValue)("borderTopWidth", valueString);
164
+ return [
165
+ ...preflight(),
166
+ { property: "borderTopWidth", value: value2 },
167
+ { property: "borderRightWidth", value: value2 },
168
+ { property: "borderBottomWidth", value: value2 },
169
+ { property: "borderLeftWidth", value: value2 }
170
+ ];
171
+ }
172
+ const value = (0, import_css_data.parseCssValue)("color", (0, import_tailwind_theme.theme)("colors")[borderWidthOrColor]);
154
173
  return [
155
- ...preflight(),
156
- { property: "borderTopWidth", value },
157
- { property: "borderRightWidth", value },
158
- { property: "borderBottomWidth", value },
159
- { property: "borderLeftWidth", value }
174
+ {
175
+ property: "borderTopColor",
176
+ value
177
+ },
178
+ {
179
+ property: "borderRightColor",
180
+ value
181
+ },
182
+ {
183
+ property: "borderBottomColor",
184
+ value
185
+ },
186
+ {
187
+ property: "borderLeftColor",
188
+ value
189
+ }
160
190
  ];
161
191
  };
162
- const px = (padding) => {
163
- const key = `${padding}`;
164
- const valueString = (0, import_tailwind_theme.theme)("padding")?.[key] ?? "0";
165
- const value = (0, import_css_data.parseCssValue)("paddingLeft", valueString);
192
+ const borderB = (borderWidthOrColor) => {
193
+ let widthValue = { type: "unit", value: 1, unit: "number" };
194
+ let colorValue = (0, import_css_data.parseCssValue)(
195
+ "color",
196
+ (0, import_tailwind_theme.theme)("colors")["border"]
197
+ );
198
+ if (typeof borderWidthOrColor === "number" || borderWidthOrColor === void 0) {
199
+ const key = `${borderWidthOrColor ?? "DEFAULT"}`;
200
+ const valueString = (0, import_tailwind_theme.theme)("borderWidth")[key] ?? "1px";
201
+ widthValue = (0, import_css_data.parseCssValue)("borderTopWidth", valueString);
202
+ } else {
203
+ colorValue = (0, import_css_data.parseCssValue)("color", (0, import_tailwind_theme.theme)("colors")[borderWidthOrColor]);
204
+ }
166
205
  return [
167
- { property: "paddingLeft", value },
168
- { property: "paddingRight", value }
206
+ {
207
+ property: "borderBottomWidth",
208
+ value: widthValue
209
+ },
210
+ {
211
+ property: "borderBottomStyle",
212
+ value: { type: "keyword", value: "solid" }
213
+ },
214
+ {
215
+ property: "borderBottomColor",
216
+ value: colorValue
217
+ }
169
218
  ];
170
219
  };
171
- const py = (padding) => {
220
+ const paddingProperty = (property) => (padding) => {
172
221
  const key = `${padding}`;
173
- const valueString = (0, import_tailwind_theme.theme)("padding")[key];
174
- const value = (0, import_css_data.parseCssValue)("paddingTop", valueString);
175
- return [
176
- { property: "paddingTop", value },
177
- { property: "paddingBottom", value }
178
- ];
222
+ const valueString = (0, import_tailwind_theme.theme)("padding")?.[key] ?? "0";
223
+ const value = (0, import_css_data.parseCssValue)(property, valueString);
224
+ return [{ property, value }];
225
+ };
226
+ const pt = (padding) => {
227
+ return paddingProperty("paddingTop")(padding);
228
+ };
229
+ const pb = (padding) => {
230
+ return paddingProperty("paddingBottom")(padding);
231
+ };
232
+ const pl = (padding) => {
233
+ return paddingProperty("paddingLeft")(padding);
234
+ };
235
+ const pr = (padding) => {
236
+ return paddingProperty("paddingRight")(padding);
237
+ };
238
+ const px = (padding) => {
239
+ return [pl(padding), pr(padding)].flat();
240
+ };
241
+ const py = (padding) => {
242
+ return [pt(padding), pb(padding)].flat();
179
243
  };
180
244
  const p = (padding) => {
181
- return [...px(padding), ...py(padding)];
245
+ return [px(padding), py(padding)].flat();
182
246
  };
183
247
  const marginProperty = (property) => (margin) => {
184
248
  const key = `${margin}`;
@@ -219,6 +283,12 @@ const h = (spacing) => {
219
283
  const value = (0, import_css_data.parseCssValue)("height", valueString);
220
284
  return [{ property: "height", value }];
221
285
  };
286
+ const minH = (spacing) => {
287
+ const key = `${spacing}`;
288
+ const valueString = (0, import_tailwind_theme.theme)("height")?.[key] ?? "0";
289
+ const value = (0, import_css_data.parseCssValue)("minHeight", valueString);
290
+ return [{ property: "minHeight", value }];
291
+ };
222
292
  const opacity = (opacity2) => {
223
293
  const key = `${opacity2}`;
224
294
  const valueString = (0, import_tailwind_theme.theme)("opacity")?.[key] ?? "0";
@@ -230,6 +300,16 @@ const opacity = (opacity2) => {
230
300
  }
231
301
  ];
232
302
  };
303
+ const cursor = (cursor2) => {
304
+ const valueString = (0, import_tailwind_theme.theme)("cursor")?.[cursor2] ?? "auto";
305
+ const value = (0, import_css_data.parseCssValue)("cursor", valueString);
306
+ return [
307
+ {
308
+ property: "cursor",
309
+ value
310
+ }
311
+ ];
312
+ };
233
313
  const maxW = (spacing) => {
234
314
  const key = `${spacing}`;
235
315
  const valueString = (0, import_tailwind_theme.theme)("maxWidth")?.[key] ?? "0";
@@ -336,6 +416,70 @@ const flex = (flexParam) => {
336
416
  if (flexParam === void 0) {
337
417
  return [{ property: "display", value: { type: "keyword", value: "flex" } }];
338
418
  }
419
+ if (flexParam === 1) {
420
+ return [
421
+ {
422
+ property: "flexGrow",
423
+ value: { type: "unit", value: 1, unit: "number" }
424
+ },
425
+ {
426
+ property: "flexShrink",
427
+ value: { type: "unit", value: 1, unit: "number" }
428
+ },
429
+ {
430
+ property: "flexBasis",
431
+ value: { type: "unit", value: 0, unit: "%" }
432
+ }
433
+ ];
434
+ }
435
+ if (flexParam === "auto") {
436
+ return [
437
+ {
438
+ property: "flexGrow",
439
+ value: { type: "unit", value: 1, unit: "number" }
440
+ },
441
+ {
442
+ property: "flexShrink",
443
+ value: { type: "unit", value: 1, unit: "number" }
444
+ },
445
+ {
446
+ property: "flexBasis",
447
+ value: { type: "keyword", value: "auto" }
448
+ }
449
+ ];
450
+ }
451
+ if (flexParam === "initial") {
452
+ return [
453
+ {
454
+ property: "flexGrow",
455
+ value: { type: "unit", value: 0, unit: "number" }
456
+ },
457
+ {
458
+ property: "flexShrink",
459
+ value: { type: "unit", value: 1, unit: "number" }
460
+ },
461
+ {
462
+ property: "flexBasis",
463
+ value: { type: "keyword", value: "auto" }
464
+ }
465
+ ];
466
+ }
467
+ if (flexParam === "none") {
468
+ return [
469
+ {
470
+ property: "flexGrow",
471
+ value: { type: "unit", value: 0, unit: "number" }
472
+ },
473
+ {
474
+ property: "flexShrink",
475
+ value: { type: "unit", value: 0, unit: "number" }
476
+ },
477
+ {
478
+ property: "flexBasis",
479
+ value: { type: "keyword", value: "auto" }
480
+ }
481
+ ];
482
+ }
339
483
  return [
340
484
  {
341
485
  property: "flexDirection",
@@ -434,6 +578,25 @@ const text = (sizeOrColor) => {
434
578
  }
435
579
  ];
436
580
  };
581
+ const underline = () => {
582
+ return [
583
+ {
584
+ property: "textDecorationLine",
585
+ value: { type: "keyword", value: "underline" }
586
+ }
587
+ ];
588
+ };
589
+ const underlineOffset = (offset) => {
590
+ const key = `${offset}`;
591
+ const valueString = (0, import_tailwind_theme.theme)("textUnderlineOffset")[key];
592
+ const value = (0, import_css_data.parseCssValue)("textUnderlineOffset", valueString);
593
+ return [
594
+ {
595
+ property: "textUnderlineOffset",
596
+ value
597
+ }
598
+ ];
599
+ };
437
600
  const weights = {
438
601
  thin: "100",
439
602
  extralight: "200",
@@ -31,5 +31,14 @@ const colors = {
31
31
  foreground: "hsl(222.2 84% 4.9%)",
32
32
  ring: "rgb(148, 163, 184)",
33
33
  mutedForeground: "rgb(100, 116, 139)",
34
- muted: `hsl(210 40% 96.1%)`
34
+ muted: `hsl(210 40% 96.1%)`,
35
+ primary: "rgb(15, 23, 42)",
36
+ primaryForeground: "hsl(210 40% 98%)",
37
+ destructive: "rgb(239, 68, 68)",
38
+ destructiveForeground: "rgb(248, 250, 252)",
39
+ accent: "rgb(241, 245, 249)",
40
+ accentForeground: "rgb(15, 23, 42)",
41
+ input: "rgb(226, 232, 240)",
42
+ secondary: "rgb(241, 245, 249)",
43
+ secondaryForeground: "rgb(15, 23, 42)"
35
44
  };