@webstudio-is/react-sdk 0.60.0 → 0.62.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 (233) hide show
  1. package/lib/app/custom-components/__generated__/form.props.js +412 -0
  2. package/lib/app/custom-components/__generated__/image.props.js +442 -0
  3. package/lib/app/custom-components/__generated__/link-block.props.js +432 -0
  4. package/lib/app/custom-components/__generated__/link.props.js +432 -0
  5. package/lib/app/custom-components/__generated__/rich-text-link.props.js +432 -0
  6. package/lib/app/custom-components/form.js +54 -0
  7. package/lib/app/custom-components/form.ws.js +81 -0
  8. package/lib/app/custom-components/index.js +10 -4
  9. package/lib/cjs/app/custom-components/__generated__/form.props.js +432 -0
  10. package/lib/cjs/app/custom-components/__generated__/image.props.js +462 -0
  11. package/lib/cjs/app/custom-components/__generated__/link-block.props.js +452 -0
  12. package/lib/cjs/app/custom-components/__generated__/link.props.js +452 -0
  13. package/lib/cjs/app/custom-components/__generated__/rich-text-link.props.js +452 -0
  14. package/lib/cjs/app/custom-components/form.js +70 -0
  15. package/lib/cjs/app/custom-components/form.ws.js +101 -0
  16. package/lib/cjs/app/custom-components/index.js +12 -6
  17. package/lib/cjs/components/__generated__/checkbox-field.props.js +419 -0
  18. package/lib/cjs/components/__generated__/checkbox.props.js +459 -0
  19. package/lib/cjs/components/__generated__/error-message.props.js +418 -0
  20. package/lib/cjs/components/__generated__/input.props.js +8 -3
  21. package/lib/cjs/components/__generated__/label.props.js +420 -0
  22. package/lib/cjs/components/__generated__/radio-button-field.props.js +419 -0
  23. package/lib/cjs/components/__generated__/radio-button.props.js +459 -0
  24. package/lib/cjs/components/__generated__/success-message.props.js +418 -0
  25. package/lib/cjs/components/__generated__/textarea.props.js +432 -0
  26. package/lib/cjs/components/blockquote.ws.js +36 -48
  27. package/lib/cjs/components/body.ws.js +20 -17
  28. package/lib/cjs/components/button.ws.js +8 -3
  29. package/lib/cjs/components/checkbox-field.js +29 -0
  30. package/lib/cjs/components/checkbox-field.ws.js +53 -0
  31. package/lib/cjs/components/checkbox.js +29 -0
  32. package/lib/cjs/components/checkbox.ws.js +55 -0
  33. package/lib/cjs/components/code.ws.js +20 -28
  34. package/lib/cjs/components/component-meta.js +3 -1
  35. package/lib/cjs/components/components-utils.js +9 -1
  36. package/lib/cjs/components/components.js +17 -1
  37. package/lib/cjs/components/error-message.js +29 -0
  38. package/lib/cjs/components/error-message.ws.js +40 -0
  39. package/lib/cjs/components/form.js +1 -1
  40. package/lib/cjs/components/form.ws.js +35 -9
  41. package/lib/cjs/components/heading.ws.js +1 -1
  42. package/lib/cjs/components/image.ws.js +8 -9
  43. package/lib/cjs/components/index.js +43 -2
  44. package/lib/cjs/components/input.ws.js +15 -3
  45. package/lib/cjs/components/italic.ws.js +5 -5
  46. package/lib/cjs/components/label.js +29 -0
  47. package/lib/cjs/components/label.ws.js +54 -0
  48. package/lib/cjs/components/link-block.ws.js +6 -6
  49. package/lib/cjs/components/link.ws.js +9 -10
  50. package/lib/cjs/components/list-item.ws.js +2 -1
  51. package/lib/cjs/components/list.ws.js +22 -22
  52. package/lib/cjs/components/paragraph.ws.js +1 -1
  53. package/lib/cjs/components/radio-button-field.js +29 -0
  54. package/lib/cjs/components/radio-button-field.ws.js +53 -0
  55. package/lib/cjs/components/radio-button.js +29 -0
  56. package/lib/cjs/components/radio-button.ws.js +55 -0
  57. package/lib/cjs/components/separator.ws.js +20 -20
  58. package/lib/cjs/components/success-message.js +29 -0
  59. package/lib/cjs/components/success-message.ws.js +40 -0
  60. package/lib/cjs/components/text-block.ws.js +6 -7
  61. package/lib/cjs/components/textarea.js +29 -0
  62. package/lib/cjs/components/textarea.ws.js +56 -0
  63. package/lib/cjs/css/css.js +6 -9
  64. package/lib/cjs/css/normalize.js +168 -185
  65. package/lib/cjs/css/presets.js +14 -34
  66. package/lib/cjs/css/style-rules.js +17 -0
  67. package/lib/cjs/embed-template.js +160 -0
  68. package/lib/cjs/index.js +1 -0
  69. package/lib/components/__generated__/checkbox-field.props.js +399 -0
  70. package/lib/components/__generated__/checkbox.props.js +439 -0
  71. package/lib/components/__generated__/error-message.props.js +398 -0
  72. package/lib/components/__generated__/input.props.js +8 -3
  73. package/lib/components/__generated__/label.props.js +400 -0
  74. package/lib/components/__generated__/radio-button-field.props.js +399 -0
  75. package/lib/components/__generated__/radio-button.props.js +439 -0
  76. package/lib/components/__generated__/success-message.props.js +398 -0
  77. package/lib/components/__generated__/textarea.props.js +412 -0
  78. package/lib/components/blockquote.ws.js +36 -48
  79. package/lib/components/body.ws.js +20 -17
  80. package/lib/components/button.ws.js +8 -3
  81. package/lib/components/checkbox-field.js +9 -0
  82. package/lib/components/checkbox-field.ws.js +33 -0
  83. package/lib/components/checkbox.js +9 -0
  84. package/lib/components/checkbox.ws.js +35 -0
  85. package/lib/components/code.ws.js +20 -28
  86. package/lib/components/component-meta.js +3 -1
  87. package/lib/components/components-utils.js +9 -1
  88. package/lib/components/components.js +17 -1
  89. package/lib/components/error-message.js +9 -0
  90. package/lib/components/error-message.ws.js +20 -0
  91. package/lib/components/form.js +1 -1
  92. package/lib/components/form.ws.js +35 -9
  93. package/lib/components/heading.ws.js +1 -1
  94. package/lib/components/image.ws.js +8 -9
  95. package/lib/components/index.js +43 -2
  96. package/lib/components/input.ws.js +15 -3
  97. package/lib/components/italic.ws.js +5 -5
  98. package/lib/components/label.js +9 -0
  99. package/lib/components/label.ws.js +34 -0
  100. package/lib/components/link-block.ws.js +7 -7
  101. package/lib/components/link.ws.js +9 -10
  102. package/lib/components/list-item.ws.js +2 -1
  103. package/lib/components/list.ws.js +22 -22
  104. package/lib/components/paragraph.ws.js +1 -1
  105. package/lib/components/radio-button-field.js +9 -0
  106. package/lib/components/radio-button-field.ws.js +33 -0
  107. package/lib/components/radio-button.js +9 -0
  108. package/lib/components/radio-button.ws.js +35 -0
  109. package/lib/components/separator.ws.js +20 -20
  110. package/lib/components/success-message.js +9 -0
  111. package/lib/components/success-message.ws.js +20 -0
  112. package/lib/components/text-block.ws.js +6 -7
  113. package/lib/components/textarea.js +9 -0
  114. package/lib/components/textarea.ws.js +36 -0
  115. package/lib/css/css.js +8 -11
  116. package/lib/css/normalize.js +168 -185
  117. package/lib/css/presets.js +14 -34
  118. package/lib/css/style-rules.js +17 -0
  119. package/lib/embed-template.js +140 -0
  120. package/lib/index.js +1 -0
  121. package/lib/types/app/custom-components/__generated__/form.props.d.ts +2 -0
  122. package/lib/types/app/custom-components/__generated__/image.props.d.ts +2 -0
  123. package/lib/types/app/custom-components/__generated__/link-block.props.d.ts +2 -0
  124. package/lib/types/app/custom-components/__generated__/link.props.d.ts +2 -0
  125. package/lib/types/app/custom-components/__generated__/rich-text-link.props.d.ts +2 -0
  126. package/lib/types/app/custom-components/form.d.ts +5 -0
  127. package/lib/types/app/custom-components/form.ws.d.ts +3 -0
  128. package/lib/types/app/custom-components/index.d.ts +6 -1
  129. package/lib/types/components/__generated__/checkbox-field.props.d.ts +2 -0
  130. package/lib/types/components/__generated__/checkbox.props.d.ts +2 -0
  131. package/lib/types/components/__generated__/error-message.props.d.ts +2 -0
  132. package/lib/types/components/__generated__/label.props.d.ts +2 -0
  133. package/lib/types/components/__generated__/radio-button-field.props.d.ts +2 -0
  134. package/lib/types/components/__generated__/radio-button.props.d.ts +2 -0
  135. package/lib/types/components/__generated__/success-message.props.d.ts +2 -0
  136. package/lib/types/components/__generated__/textarea.props.d.ts +2 -0
  137. package/lib/types/components/box.stories.d.ts +2 -2
  138. package/lib/types/components/checkbox-field.d.ts +3 -0
  139. package/lib/types/components/checkbox-field.ws.d.ts +3 -0
  140. package/lib/types/components/checkbox.d.ts +3 -0
  141. package/lib/types/components/checkbox.ws.d.ts +3 -0
  142. package/lib/types/components/component-meta.d.ts +23 -5
  143. package/lib/types/components/components-utils.d.ts +5 -20
  144. package/lib/types/components/components.d.ts +8 -0
  145. package/lib/types/components/error-message.d.ts +3 -0
  146. package/lib/types/components/error-message.ws.d.ts +3 -0
  147. package/lib/types/components/index.d.ts +1 -0
  148. package/lib/types/components/input.d.ts +3 -1
  149. package/lib/types/components/input.stories.d.ts +6 -2
  150. package/lib/types/components/label.d.ts +3 -0
  151. package/lib/types/components/label.ws.d.ts +3 -0
  152. package/lib/types/components/radio-button-field.d.ts +3 -0
  153. package/lib/types/components/radio-button-field.ws.d.ts +3 -0
  154. package/lib/types/components/radio-button.d.ts +3 -0
  155. package/lib/types/components/radio-button.ws.d.ts +3 -0
  156. package/lib/types/components/success-message.d.ts +3 -0
  157. package/lib/types/components/success-message.ws.d.ts +3 -0
  158. package/lib/types/components/textarea.d.ts +3 -0
  159. package/lib/types/components/textarea.ws.d.ts +3 -0
  160. package/lib/types/css/normalize.d.ts +8977 -2286
  161. package/lib/types/css/presets.d.ts +2 -38
  162. package/lib/types/css/style-rules.d.ts +11 -9
  163. package/lib/types/embed-template.d.ts +1725 -0
  164. package/lib/types/embed-template.test.d.ts +1 -0
  165. package/lib/types/index.d.ts +1 -0
  166. package/package.json +15 -14
  167. package/src/app/custom-components/__generated__/form.props.ts +457 -0
  168. package/src/app/custom-components/__generated__/image.props.ts +487 -0
  169. package/src/app/custom-components/__generated__/link-block.props.ts +477 -0
  170. package/src/app/custom-components/__generated__/link.props.ts +477 -0
  171. package/src/app/custom-components/__generated__/rich-text-link.props.ts +477 -0
  172. package/src/app/custom-components/form.tsx +94 -0
  173. package/src/app/custom-components/form.ws.tsx +86 -0
  174. package/src/app/custom-components/index.ts +9 -4
  175. package/src/components/__generated__/checkbox-field.props.ts +444 -0
  176. package/src/components/__generated__/checkbox.props.ts +484 -0
  177. package/src/components/__generated__/error-message.props.ts +443 -0
  178. package/src/components/__generated__/input.props.ts +8 -3
  179. package/src/components/__generated__/label.props.ts +445 -0
  180. package/src/components/__generated__/radio-button-field.props.ts +444 -0
  181. package/src/components/__generated__/radio-button.props.ts +484 -0
  182. package/src/components/__generated__/success-message.props.ts +443 -0
  183. package/src/components/__generated__/textarea.props.ts +457 -0
  184. package/src/components/blockquote.ws.tsx +42 -52
  185. package/src/components/body.ws.tsx +26 -23
  186. package/src/components/bold.ws.tsx +6 -3
  187. package/src/components/box.ws.ts +6 -3
  188. package/src/components/button.ws.tsx +13 -5
  189. package/src/components/checkbox-field.tsx +10 -0
  190. package/src/components/checkbox-field.ws.tsx +38 -0
  191. package/src/components/checkbox.tsx +13 -0
  192. package/src/components/checkbox.ws.tsx +40 -0
  193. package/src/components/code.ws.tsx +26 -32
  194. package/src/components/component-meta.ts +6 -3
  195. package/src/components/components-utils.ts +16 -10
  196. package/src/components/components.ts +8 -0
  197. package/src/components/error-message.tsx +10 -0
  198. package/src/components/error-message.ws.tsx +24 -0
  199. package/src/components/form.tsx +5 -1
  200. package/src/components/form.ws.tsx +39 -10
  201. package/src/components/heading.ws.tsx +7 -4
  202. package/src/components/image.ws.tsx +14 -12
  203. package/src/components/index.ts +47 -0
  204. package/src/components/input.tsx +3 -1
  205. package/src/components/input.ws.tsx +19 -4
  206. package/src/components/italic.ws.tsx +11 -8
  207. package/src/components/label.tsx +10 -0
  208. package/src/components/label.ws.tsx +39 -0
  209. package/src/components/link-block.ws.tsx +13 -10
  210. package/src/components/link.ws.tsx +15 -13
  211. package/src/components/list-item.ws.tsx +8 -4
  212. package/src/components/list.ws.tsx +28 -25
  213. package/src/components/paragraph.ws.tsx +7 -4
  214. package/src/components/radio-button-field.tsx +10 -0
  215. package/src/components/radio-button-field.ws.tsx +38 -0
  216. package/src/components/radio-button.tsx +13 -0
  217. package/src/components/radio-button.ws.tsx +40 -0
  218. package/src/components/separator.ws.tsx +26 -25
  219. package/src/components/span.ws.tsx +6 -3
  220. package/src/components/subscript.ws.tsx +6 -3
  221. package/src/components/success-message.tsx +10 -0
  222. package/src/components/success-message.ws.tsx +24 -0
  223. package/src/components/superscript.ws.tsx +6 -3
  224. package/src/components/text-block.ws.tsx +12 -11
  225. package/src/components/textarea.tsx +13 -0
  226. package/src/components/textarea.ws.tsx +41 -0
  227. package/src/css/css.ts +8 -11
  228. package/src/css/normalize.ts +166 -188
  229. package/src/css/presets.ts +15 -37
  230. package/src/css/style-rules.ts +24 -0
  231. package/src/embed-template.test.ts +210 -0
  232. package/src/embed-template.ts +187 -0
  233. package/src/index.ts +1 -0
@@ -43,6 +43,7 @@ __export(normalize_exports, {
43
43
  img: () => img,
44
44
  input: () => input,
45
45
  kbd: () => kbd,
46
+ label: () => label,
46
47
  legend: () => legend,
47
48
  li: () => li,
48
49
  main: () => main,
@@ -68,13 +69,10 @@ __export(normalize_exports, {
68
69
  module.exports = __toCommonJS(normalize_exports);
69
70
  var import_presets = require("./presets");
70
71
  const boxSizing = {
71
- type: "keyword",
72
- value: "border-box"
73
- };
74
- const baseStyle = {
75
- boxSizing,
76
- ...import_presets.borders
72
+ property: "boxSizing",
73
+ value: { type: "keyword", value: "border-box" }
77
74
  };
75
+ const baseStyle = [boxSizing, ...import_presets.borders];
78
76
  const div = baseStyle;
79
77
  const address = baseStyle;
80
78
  const article = baseStyle;
@@ -86,6 +84,7 @@ const main = baseStyle;
86
84
  const nav = baseStyle;
87
85
  const section = baseStyle;
88
86
  const form = baseStyle;
87
+ const label = baseStyle;
89
88
  const h1 = baseStyle;
90
89
  const h2 = baseStyle;
91
90
  const h3 = baseStyle;
@@ -100,259 +99,243 @@ const ul = baseStyle;
100
99
  const ol = baseStyle;
101
100
  const p = baseStyle;
102
101
  const span = baseStyle;
103
- const html = {
102
+ const html = [
104
103
  /* 1 */
105
- lineHeight: {
106
- type: "unit",
107
- value: 1.15,
108
- unit: "number"
104
+ {
105
+ property: "lineHeight",
106
+ value: { type: "unit", value: 1.15, unit: "number" }
109
107
  },
110
108
  /* 2 */
111
- textSizeAdjust: {
112
- type: "unit",
113
- value: 100,
114
- unit: "%"
109
+ {
110
+ property: "textSizeAdjust",
111
+ value: { type: "unit", value: 100, unit: "%" }
115
112
  },
116
113
  /* 3 */
117
- tabSize: {
118
- type: "unit",
119
- value: 4,
120
- unit: "number"
114
+ {
115
+ property: "tabSize",
116
+ value: { type: "unit", value: 4, unit: "number" }
121
117
  },
122
118
  boxSizing,
123
119
  ...import_presets.borders
124
- };
125
- const body = {
120
+ ];
121
+ const body = [
126
122
  /* 1 */
127
- marginTop: {
128
- type: "unit",
129
- value: 0,
130
- unit: "number"
131
- },
132
- marginRight: {
133
- type: "unit",
134
- value: 0,
135
- unit: "number"
136
- },
137
- marginBottom: {
138
- type: "unit",
139
- value: 0,
140
- unit: "number"
141
- },
142
- marginLeft: {
143
- type: "unit",
144
- value: 0,
145
- unit: "number"
123
+ {
124
+ property: "marginTop",
125
+ value: { type: "unit", value: 0, unit: "number" }
126
+ },
127
+ {
128
+ property: "marginRight",
129
+ value: { type: "unit", value: 0, unit: "number" }
130
+ },
131
+ {
132
+ property: "marginBottom",
133
+ value: { type: "unit", value: 0, unit: "number" }
134
+ },
135
+ {
136
+ property: "marginLeft",
137
+ value: { type: "unit", value: 0, unit: "number" }
146
138
  },
147
139
  /* 2 */
148
- fontFamily: {
149
- type: "keyword",
150
- value: `system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'`
140
+ {
141
+ property: "fontFamily",
142
+ value: {
143
+ type: "keyword",
144
+ value: `system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'`
145
+ }
151
146
  },
152
147
  boxSizing,
153
148
  ...import_presets.borders
154
- };
155
- const hr = {
149
+ ];
150
+ const hr = [
156
151
  /* 1 */
157
- height: {
158
- type: "unit",
159
- value: 0,
160
- unit: "number"
152
+ {
153
+ property: "height",
154
+ value: { type: "unit", value: 0, unit: "number" }
161
155
  },
162
156
  /* 2 */
163
- color: { type: "keyword", value: "inherit" },
157
+ {
158
+ property: "color",
159
+ value: { type: "keyword", value: "inherit" }
160
+ },
164
161
  boxSizing,
165
162
  ...import_presets.borders
166
- };
167
- const b = {
168
- fontWeight: {
169
- type: "keyword",
170
- value: "bolder"
163
+ ];
164
+ const b = [
165
+ {
166
+ property: "fontWeight",
167
+ value: { type: "keyword", value: "700" }
171
168
  },
172
169
  boxSizing,
173
170
  ...import_presets.borders
174
- };
171
+ ];
175
172
  const strong = b;
176
- const code = {
173
+ const code = [
177
174
  /* 1 */
178
- fontFamily: {
179
- type: "keyword",
180
- value: `ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace`
175
+ {
176
+ property: "fontFamily",
177
+ value: {
178
+ type: "keyword",
179
+ value: `ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace`
180
+ }
181
181
  },
182
182
  /* 2 */
183
- fontSize: {
184
- type: "unit",
185
- value: 1,
186
- unit: "em"
183
+ {
184
+ property: "fontSize",
185
+ value: { type: "unit", value: 1, unit: "em" }
187
186
  },
188
187
  boxSizing,
189
188
  ...import_presets.borders
190
- };
189
+ ];
191
190
  const kbd = code;
192
191
  const samp = code;
193
192
  const pre = code;
194
- const small = {
195
- fontSize: {
196
- type: "unit",
197
- value: 80,
198
- unit: "%"
193
+ const small = [
194
+ {
195
+ property: "fontSize",
196
+ value: { type: "unit", value: 80, unit: "%" }
199
197
  },
200
198
  boxSizing,
201
199
  ...import_presets.borders
202
- };
203
- const subSupBase = {
204
- fontSize: {
205
- type: "unit",
206
- value: 75,
207
- unit: "%"
200
+ ];
201
+ const subSupBase = [
202
+ {
203
+ property: "fontSize",
204
+ value: { type: "unit", value: 75, unit: "%" }
208
205
  },
209
- lineHeight: {
210
- type: "unit",
211
- value: 0,
212
- unit: "number"
206
+ {
207
+ property: "lineHeight",
208
+ value: { type: "unit", value: 0, unit: "number" }
213
209
  },
214
- position: {
215
- type: "keyword",
216
- value: "relative"
210
+ {
211
+ property: "position",
212
+ value: { type: "keyword", value: "relative" }
217
213
  },
218
- verticalAlign: {
219
- type: "keyword",
220
- value: "baseline"
214
+ {
215
+ property: "verticalAlign",
216
+ value: { type: "keyword", value: "baseline" }
221
217
  },
222
218
  boxSizing,
223
219
  ...import_presets.borders
224
- };
225
- const sub = {
220
+ ];
221
+ const sub = [
226
222
  ...subSupBase,
227
- bottom: {
228
- type: "unit",
229
- value: -0.25,
230
- unit: "em"
223
+ {
224
+ property: "bottom",
225
+ value: { type: "unit", value: -0.25, unit: "em" }
231
226
  }
232
- };
233
- const sup = {
227
+ ];
228
+ const sup = [
234
229
  ...subSupBase,
235
- top: {
236
- type: "unit",
237
- value: -0.5,
238
- unit: "em"
230
+ {
231
+ property: "top",
232
+ value: { type: "unit", value: -0.5, unit: "em" }
239
233
  }
240
- };
241
- const table = {
234
+ ];
235
+ const table = [
242
236
  /* 1 */
243
- textIndent: {
244
- type: "unit",
245
- value: 0,
246
- unit: "number"
237
+ {
238
+ property: "textIndent",
239
+ value: { type: "unit", value: 0, unit: "number" }
247
240
  },
248
241
  ...import_presets.borders,
249
242
  /* 2 */
250
- borderTopColor: {
251
- type: "keyword",
252
- value: "inherit"
243
+ {
244
+ property: "borderTopColor",
245
+ value: { type: "keyword", value: "inherit" }
253
246
  },
254
- borderRightColor: {
255
- type: "keyword",
256
- value: "inherit"
247
+ {
248
+ property: "borderRightColor",
249
+ value: { type: "keyword", value: "inherit" }
257
250
  },
258
- borderBottomColor: {
259
- type: "keyword",
260
- value: "inherit"
251
+ {
252
+ property: "borderBottomColor",
253
+ value: { type: "keyword", value: "inherit" }
261
254
  },
262
- borderLeftColor: {
263
- type: "keyword",
264
- value: "inherit"
255
+ {
256
+ property: "borderLeftColor",
257
+ value: { type: "keyword", value: "inherit" }
265
258
  },
266
259
  boxSizing
267
- };
268
- const buttonBase = {
260
+ ];
261
+ const buttonBase = [
269
262
  /* 1 */
270
- fontFamily: {
271
- type: "keyword",
272
- value: "inherit"
263
+ {
264
+ property: "fontFamily",
265
+ value: { type: "keyword", value: "inherit" }
273
266
  },
274
- fontSize: {
275
- type: "unit",
276
- value: 100,
277
- unit: "%"
267
+ {
268
+ property: "fontSize",
269
+ value: { type: "unit", value: 100, unit: "%" }
278
270
  },
279
- lineHeight: {
280
- type: "unit",
281
- value: 1.15,
282
- unit: "number"
271
+ {
272
+ property: "lineHeight",
273
+ value: { type: "unit", value: 1.15, unit: "number" }
283
274
  },
284
275
  /* 2 */
285
- marginTop: {
286
- type: "unit",
287
- value: 0,
288
- unit: "number"
289
- },
290
- marginRight: {
291
- type: "unit",
292
- value: 0,
293
- unit: "number"
294
- },
295
- marginBottom: {
296
- type: "unit",
297
- value: 0,
298
- unit: "number"
299
- },
300
- marginLeft: {
301
- type: "unit",
302
- value: 0,
303
- unit: "number"
276
+ {
277
+ property: "marginTop",
278
+ value: { type: "unit", value: 0, unit: "number" }
279
+ },
280
+ {
281
+ property: "marginRight",
282
+ value: { type: "unit", value: 0, unit: "number" }
283
+ },
284
+ {
285
+ property: "marginBottom",
286
+ value: { type: "unit", value: 0, unit: "number" }
287
+ },
288
+ {
289
+ property: "marginLeft",
290
+ value: { type: "unit", value: 0, unit: "number" }
304
291
  },
305
292
  boxSizing,
306
293
  ...import_presets.borders
307
- };
294
+ ];
308
295
  const input = buttonBase;
309
296
  const optgroup = buttonBase;
310
297
  const textarea = buttonBase;
311
- const button = {
298
+ const button = [
312
299
  ...buttonBase,
313
- textTransform: {
314
- type: "keyword",
315
- value: "none"
300
+ {
301
+ property: "textTransform",
302
+ value: { type: "keyword", value: "none" }
316
303
  }
317
- };
304
+ ];
318
305
  const select = button;
319
- const legend = {
320
- paddingTop: {
321
- type: "unit",
322
- value: 0,
323
- unit: "number"
324
- },
325
- paddingRight: {
326
- type: "unit",
327
- value: 0,
328
- unit: "number"
329
- },
330
- paddingBottom: {
331
- type: "unit",
332
- value: 0,
333
- unit: "number"
334
- },
335
- paddingLeft: {
336
- type: "unit",
337
- value: 0,
338
- unit: "number"
306
+ const legend = [
307
+ {
308
+ property: "paddingTop",
309
+ value: { type: "unit", value: 0, unit: "number" }
310
+ },
311
+ {
312
+ property: "paddingRight",
313
+ value: { type: "unit", value: 0, unit: "number" }
314
+ },
315
+ {
316
+ property: "paddingBottom",
317
+ value: { type: "unit", value: 0, unit: "number" }
318
+ },
319
+ {
320
+ property: "paddingLeft",
321
+ value: { type: "unit", value: 0, unit: "number" }
339
322
  },
340
323
  boxSizing,
341
324
  ...import_presets.borders
342
- };
343
- const progress = {
344
- verticalAlign: {
345
- type: "keyword",
346
- value: "baseline"
325
+ ];
326
+ const progress = [
327
+ {
328
+ property: "verticalAlign",
329
+ value: { type: "keyword", value: "baseline" }
347
330
  },
348
331
  boxSizing,
349
332
  ...import_presets.borders
350
- };
351
- const summary = {
352
- display: {
353
- type: "keyword",
354
- value: "list-item"
333
+ ];
334
+ const summary = [
335
+ {
336
+ property: "display",
337
+ value: { type: "keyword", value: "list-item" }
355
338
  },
356
339
  boxSizing,
357
340
  ...import_presets.borders
358
- };
341
+ ];
@@ -21,41 +21,21 @@ __export(presets_exports, {
21
21
  borders: () => borders
22
22
  });
23
23
  module.exports = __toCommonJS(presets_exports);
24
- const borders = {
25
- borderTopColor: {
26
- type: "keyword",
27
- value: "currentColor"
24
+ const borders = [
25
+ {
26
+ property: "borderTopWidth",
27
+ value: { type: "unit", value: 1, unit: "px" }
28
28
  },
29
- borderRightColor: {
30
- type: "keyword",
31
- value: "currentColor"
29
+ {
30
+ property: "borderRightWidth",
31
+ value: { type: "unit", value: 1, unit: "px" }
32
32
  },
33
- borderBottomColor: {
34
- type: "keyword",
35
- value: "currentColor"
33
+ {
34
+ property: "borderBottomWidth",
35
+ value: { type: "unit", value: 1, unit: "px" }
36
36
  },
37
- borderLeftColor: {
38
- type: "keyword",
39
- value: "currentColor"
40
- },
41
- borderTopWidth: {
42
- type: "unit",
43
- value: 1,
44
- unit: "px"
45
- },
46
- borderRightWidth: {
47
- type: "unit",
48
- value: 1,
49
- unit: "px"
50
- },
51
- borderBottomWidth: {
52
- type: "unit",
53
- value: 1,
54
- unit: "px"
55
- },
56
- borderLeftWidth: {
57
- type: "unit",
58
- value: 1,
59
- unit: "px"
37
+ {
38
+ property: "borderLeftWidth",
39
+ value: { type: "unit", value: 1, unit: "px" }
60
40
  }
61
- };
41
+ ];
@@ -18,9 +18,11 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var style_rules_exports = {};
20
20
  __export(style_rules_exports, {
21
+ getPresetStyleRules: () => getPresetStyleRules,
21
22
  getStyleRules: () => getStyleRules
22
23
  });
23
24
  module.exports = __toCommonJS(style_rules_exports);
25
+ var import_tree = require("../tree");
24
26
  const getStyleRules = (styles, styleSourceSelections) => {
25
27
  if (styles === void 0 || styleSourceSelections === void 0) {
26
28
  return [];
@@ -67,3 +69,18 @@ const getStyleRules = (styles, styleSourceSelections) => {
67
69
  }
68
70
  return styleRules;
69
71
  };
72
+ const getPresetStyleRules = (component, presetStyle) => {
73
+ const presetStyleRules = /* @__PURE__ */ new Map();
74
+ for (const [tag, styles] of Object.entries(presetStyle)) {
75
+ for (const styleDecl of styles) {
76
+ const selector = `${tag}:where([${import_tree.componentAttribute}=${component}])${styleDecl.state ?? ""}`;
77
+ let rule = presetStyleRules.get(selector);
78
+ if (rule === void 0) {
79
+ rule = {};
80
+ presetStyleRules.set(selector, rule);
81
+ }
82
+ rule[styleDecl.property] = styleDecl.value;
83
+ }
84
+ }
85
+ return presetStyleRules;
86
+ };