cetec-design-system 0.0.20 → 0.0.21

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 (266) hide show
  1. package/package.json +2 -3
  2. package/styled-system/css/conditions.js +0 -36
  3. package/styled-system/css/conditions.mjs +0 -36
  4. package/styled-system/css/css.d.ts +0 -22
  5. package/styled-system/css/css.js +0 -45
  6. package/styled-system/css/css.mjs +0 -45
  7. package/styled-system/css/cva.d.ts +0 -6
  8. package/styled-system/css/cva.js +0 -87
  9. package/styled-system/css/cva.mjs +0 -87
  10. package/styled-system/css/cx.d.ts +0 -5
  11. package/styled-system/css/cx.js +0 -15
  12. package/styled-system/css/cx.mjs +0 -15
  13. package/styled-system/css/index.d.ts +0 -5
  14. package/styled-system/css/index.js +0 -4
  15. package/styled-system/css/index.mjs +0 -4
  16. package/styled-system/css/sva.d.ts +0 -4
  17. package/styled-system/css/sva.js +0 -41
  18. package/styled-system/css/sva.mjs +0 -41
  19. package/styled-system/debug/config.json +0 -8379
  20. package/styled-system/debug/src__App.ast.json +0 -1291
  21. package/styled-system/debug/src__App.css +0 -830
  22. package/styled-system/debug/src__components__Button__Button.stories.ast.json +0 -244
  23. package/styled-system/debug/src__components__Button__Button.stories.css +0 -372
  24. package/styled-system/debug/src__components__Code__Code.ast.json +0 -32
  25. package/styled-system/debug/src__components__Code__Code.css +0 -25
  26. package/styled-system/debug/src__components__Code__Pre.ast.json +0 -53
  27. package/styled-system/debug/src__components__Code__Pre.css +0 -45
  28. package/styled-system/debug/src__components__Code__copy-to-clipboard-button.ast.json +0 -68
  29. package/styled-system/debug/src__components__Code__copy-to-clipboard-button.css +0 -167
  30. package/styled-system/debug/src__components__Heading__Heading.ast.json +0 -59
  31. package/styled-system/debug/src__components__Heading__Heading.css +0 -25
  32. package/styled-system/debug/src__components__Icon__Icon.ast.json +0 -28
  33. package/styled-system/debug/src__components__Icon__Icon.css +0 -9
  34. package/styled-system/debug/src__components__Icon__iconStyle.ast.json +0 -27
  35. package/styled-system/debug/src__components__Icon__iconStyle.css +0 -5
  36. package/styled-system/debug/src__components__Input__Input.ast.json +0 -50
  37. package/styled-system/debug/src__components__Input__Input.css +0 -79
  38. package/styled-system/debug/src__components__Label__Label.ast.json +0 -45
  39. package/styled-system/debug/src__components__Label__Label.css +0 -40
  40. package/styled-system/debug/src__components__Link__Link.ast.json +0 -72
  41. package/styled-system/debug/src__components__Link__Link.css +0 -39
  42. package/styled-system/debug/src__components__Link__linkStyles.ast.json +0 -59
  43. package/styled-system/debug/src__components__Link__linkStyles.css +0 -77
  44. package/styled-system/debug/src__components__Spinner__spinnerStyles.ast.json +0 -56
  45. package/styled-system/debug/src__components__Spinner__spinnerStyles.css +0 -69
  46. package/styled-system/debug/src__components__Text__Text.ast.json +0 -57
  47. package/styled-system/debug/src__components__Text__Text.css +0 -22
  48. package/styled-system/debug/src__components__Text__Text.stories.ast.json +0 -60
  49. package/styled-system/debug/src__components__Text__Text.stories.css +0 -40
  50. package/styled-system/debug/src__components__Textarea__Textarea.ast.json +0 -50
  51. package/styled-system/debug/src__components__Textarea__Textarea.css +0 -92
  52. package/styled-system/debug/src__components__ThemeSwitcher__ThemeSwitcher.ast.json +0 -42
  53. package/styled-system/debug/src__components__ThemeSwitcher__ThemeSwitcher.css +0 -101
  54. package/styled-system/helpers.js +0 -336
  55. package/styled-system/helpers.mjs +0 -336
  56. package/styled-system/jsx/aspect-ratio.d.ts +0 -10
  57. package/styled-system/jsx/aspect-ratio.js +0 -14
  58. package/styled-system/jsx/aspect-ratio.mjs +0 -14
  59. package/styled-system/jsx/bleed.d.ts +0 -10
  60. package/styled-system/jsx/bleed.js +0 -14
  61. package/styled-system/jsx/bleed.mjs +0 -14
  62. package/styled-system/jsx/box.d.ts +0 -10
  63. package/styled-system/jsx/box.mjs +0 -14
  64. package/styled-system/jsx/center.d.ts +0 -10
  65. package/styled-system/jsx/center.js +0 -14
  66. package/styled-system/jsx/center.mjs +0 -14
  67. package/styled-system/jsx/circle.d.ts +0 -10
  68. package/styled-system/jsx/circle.js +0 -14
  69. package/styled-system/jsx/circle.mjs +0 -14
  70. package/styled-system/jsx/container.d.ts +0 -10
  71. package/styled-system/jsx/container.js +0 -14
  72. package/styled-system/jsx/container.mjs +0 -14
  73. package/styled-system/jsx/cq.d.ts +0 -10
  74. package/styled-system/jsx/cq.js +0 -14
  75. package/styled-system/jsx/cq.mjs +0 -14
  76. package/styled-system/jsx/divider.d.ts +0 -10
  77. package/styled-system/jsx/divider.mjs +0 -14
  78. package/styled-system/jsx/factory-helper.js +0 -22
  79. package/styled-system/jsx/factory-helper.mjs +0 -22
  80. package/styled-system/jsx/factory.d.ts +0 -3
  81. package/styled-system/jsx/factory.js +0 -80
  82. package/styled-system/jsx/factory.mjs +0 -80
  83. package/styled-system/jsx/flex.d.ts +0 -10
  84. package/styled-system/jsx/flex.js +0 -14
  85. package/styled-system/jsx/flex.mjs +0 -14
  86. package/styled-system/jsx/float.d.ts +0 -10
  87. package/styled-system/jsx/float.js +0 -14
  88. package/styled-system/jsx/float.mjs +0 -14
  89. package/styled-system/jsx/grid-item.d.ts +0 -10
  90. package/styled-system/jsx/grid-item.js +0 -14
  91. package/styled-system/jsx/grid-item.mjs +0 -14
  92. package/styled-system/jsx/grid.d.ts +0 -10
  93. package/styled-system/jsx/grid.js +0 -14
  94. package/styled-system/jsx/grid.mjs +0 -14
  95. package/styled-system/jsx/hstack.d.ts +0 -10
  96. package/styled-system/jsx/hstack.js +0 -14
  97. package/styled-system/jsx/hstack.mjs +0 -14
  98. package/styled-system/jsx/icon.d.ts +0 -10
  99. package/styled-system/jsx/icon.js +0 -14
  100. package/styled-system/jsx/icon.mjs +0 -14
  101. package/styled-system/jsx/index.d.ts +0 -23
  102. package/styled-system/jsx/index.js +0 -21
  103. package/styled-system/jsx/index.mjs +0 -21
  104. package/styled-system/jsx/is-valid-prop.d.ts +0 -11
  105. package/styled-system/jsx/is-valid-prop.js +0 -17
  106. package/styled-system/jsx/is-valid-prop.mjs +0 -17
  107. package/styled-system/jsx/link-overlay.d.ts +0 -10
  108. package/styled-system/jsx/link-overlay.js +0 -14
  109. package/styled-system/jsx/link-overlay.mjs +0 -14
  110. package/styled-system/jsx/spacer.d.ts +0 -10
  111. package/styled-system/jsx/spacer.js +0 -14
  112. package/styled-system/jsx/spacer.mjs +0 -14
  113. package/styled-system/jsx/square.d.ts +0 -10
  114. package/styled-system/jsx/square.js +0 -14
  115. package/styled-system/jsx/square.mjs +0 -14
  116. package/styled-system/jsx/stack.d.ts +0 -10
  117. package/styled-system/jsx/stack.js +0 -14
  118. package/styled-system/jsx/stack.mjs +0 -14
  119. package/styled-system/jsx/visually-hidden.d.ts +0 -10
  120. package/styled-system/jsx/visually-hidden.js +0 -14
  121. package/styled-system/jsx/visually-hidden.mjs +0 -14
  122. package/styled-system/jsx/vstack.d.ts +0 -10
  123. package/styled-system/jsx/vstack.js +0 -14
  124. package/styled-system/jsx/vstack.mjs +0 -14
  125. package/styled-system/jsx/wrap.d.ts +0 -10
  126. package/styled-system/jsx/wrap.js +0 -14
  127. package/styled-system/jsx/wrap.mjs +0 -14
  128. package/styled-system/patterns/aspect-ratio.d.ts +0 -21
  129. package/styled-system/patterns/aspect-ratio.js +0 -38
  130. package/styled-system/patterns/aspect-ratio.mjs +0 -38
  131. package/styled-system/patterns/bleed.d.ts +0 -22
  132. package/styled-system/patterns/bleed.js +0 -24
  133. package/styled-system/patterns/bleed.mjs +0 -24
  134. package/styled-system/patterns/box.d.ts +0 -21
  135. package/styled-system/patterns/box.mjs +0 -15
  136. package/styled-system/patterns/center.d.ts +0 -21
  137. package/styled-system/patterns/center.js +0 -21
  138. package/styled-system/patterns/center.mjs +0 -21
  139. package/styled-system/patterns/circle.d.ts +0 -21
  140. package/styled-system/patterns/circle.js +0 -25
  141. package/styled-system/patterns/circle.mjs +0 -25
  142. package/styled-system/patterns/container.d.ts +0 -21
  143. package/styled-system/patterns/container.js +0 -24
  144. package/styled-system/patterns/container.mjs +0 -24
  145. package/styled-system/patterns/cq.d.ts +0 -22
  146. package/styled-system/patterns/cq.js +0 -21
  147. package/styled-system/patterns/cq.mjs +0 -21
  148. package/styled-system/patterns/divider.d.ts +0 -23
  149. package/styled-system/patterns/divider.mjs +0 -25
  150. package/styled-system/patterns/flex.d.ts +0 -27
  151. package/styled-system/patterns/flex.js +0 -26
  152. package/styled-system/patterns/flex.mjs +0 -26
  153. package/styled-system/patterns/float.d.ts +0 -24
  154. package/styled-system/patterns/float.js +0 -52
  155. package/styled-system/patterns/float.mjs +0 -52
  156. package/styled-system/patterns/grid-item.d.ts +0 -26
  157. package/styled-system/patterns/grid-item.js +0 -25
  158. package/styled-system/patterns/grid-item.mjs +0 -25
  159. package/styled-system/patterns/grid.d.ts +0 -25
  160. package/styled-system/patterns/grid.js +0 -27
  161. package/styled-system/patterns/grid.mjs +0 -27
  162. package/styled-system/patterns/hstack.d.ts +0 -22
  163. package/styled-system/patterns/hstack.js +0 -24
  164. package/styled-system/patterns/hstack.mjs +0 -24
  165. package/styled-system/patterns/icon.d.ts +0 -21
  166. package/styled-system/patterns/icon.js +0 -20
  167. package/styled-system/patterns/icon.mjs +0 -20
  168. package/styled-system/patterns/index.d.ts +0 -20
  169. package/styled-system/patterns/index.js +0 -19
  170. package/styled-system/patterns/index.mjs +0 -19
  171. package/styled-system/patterns/link-overlay.d.ts +0 -21
  172. package/styled-system/patterns/link-overlay.js +0 -24
  173. package/styled-system/patterns/link-overlay.mjs +0 -24
  174. package/styled-system/patterns/spacer.d.ts +0 -21
  175. package/styled-system/patterns/spacer.js +0 -21
  176. package/styled-system/patterns/spacer.mjs +0 -21
  177. package/styled-system/patterns/square.d.ts +0 -21
  178. package/styled-system/patterns/square.js +0 -24
  179. package/styled-system/patterns/square.mjs +0 -24
  180. package/styled-system/patterns/stack.d.ts +0 -24
  181. package/styled-system/patterns/stack.js +0 -24
  182. package/styled-system/patterns/stack.mjs +0 -24
  183. package/styled-system/patterns/visually-hidden.d.ts +0 -21
  184. package/styled-system/patterns/visually-hidden.js +0 -18
  185. package/styled-system/patterns/visually-hidden.mjs +0 -18
  186. package/styled-system/patterns/vstack.d.ts +0 -22
  187. package/styled-system/patterns/vstack.js +0 -24
  188. package/styled-system/patterns/vstack.mjs +0 -24
  189. package/styled-system/patterns/wrap.d.ts +0 -25
  190. package/styled-system/patterns/wrap.js +0 -25
  191. package/styled-system/patterns/wrap.mjs +0 -25
  192. package/styled-system/recipes/box.d.ts +0 -28
  193. package/styled-system/recipes/box.js +0 -24
  194. package/styled-system/recipes/box.mjs +0 -24
  195. package/styled-system/recipes/button.d.ts +0 -35
  196. package/styled-system/recipes/button.js +0 -41
  197. package/styled-system/recipes/button.mjs +0 -41
  198. package/styled-system/recipes/checkbox.d.ts +0 -28
  199. package/styled-system/recipes/checkbox.js +0 -40
  200. package/styled-system/recipes/checkbox.mjs +0 -40
  201. package/styled-system/recipes/code.d.ts +0 -28
  202. package/styled-system/recipes/code.js +0 -24
  203. package/styled-system/recipes/code.mjs +0 -24
  204. package/styled-system/recipes/create-recipe.js +0 -82
  205. package/styled-system/recipes/create-recipe.mjs +0 -82
  206. package/styled-system/recipes/divider.d.ts +0 -35
  207. package/styled-system/recipes/divider.js +0 -38
  208. package/styled-system/recipes/divider.mjs +0 -38
  209. package/styled-system/recipes/heading.d.ts +0 -31
  210. package/styled-system/recipes/heading.js +0 -33
  211. package/styled-system/recipes/heading.mjs +0 -33
  212. package/styled-system/recipes/icon-button.d.ts +0 -35
  213. package/styled-system/recipes/icon-button.js +0 -41
  214. package/styled-system/recipes/icon-button.mjs +0 -41
  215. package/styled-system/recipes/index.d.ts +0 -17
  216. package/styled-system/recipes/index.js +0 -15
  217. package/styled-system/recipes/index.mjs +0 -16
  218. package/styled-system/recipes/input.d.ts +0 -31
  219. package/styled-system/recipes/input.js +0 -31
  220. package/styled-system/recipes/input.mjs +0 -31
  221. package/styled-system/recipes/label.d.ts +0 -38
  222. package/styled-system/recipes/label.js +0 -83
  223. package/styled-system/recipes/label.mjs +0 -83
  224. package/styled-system/recipes/link.d.ts +0 -38
  225. package/styled-system/recipes/link.js +0 -83
  226. package/styled-system/recipes/link.mjs +0 -83
  227. package/styled-system/recipes/pre.d.ts +0 -28
  228. package/styled-system/recipes/pre.js +0 -24
  229. package/styled-system/recipes/pre.mjs +0 -24
  230. package/styled-system/recipes/radio-input.d.ts +0 -28
  231. package/styled-system/recipes/radio-input.mjs +0 -24
  232. package/styled-system/recipes/radio.d.ts +0 -28
  233. package/styled-system/recipes/radio.js +0 -40
  234. package/styled-system/recipes/radio.mjs +0 -40
  235. package/styled-system/recipes/spinner.d.ts +0 -31
  236. package/styled-system/recipes/spinner.js +0 -32
  237. package/styled-system/recipes/spinner.mjs +0 -32
  238. package/styled-system/recipes/switchbox.d.ts +0 -28
  239. package/styled-system/recipes/switchbox.mjs +0 -44
  240. package/styled-system/recipes/text.d.ts +0 -37
  241. package/styled-system/recipes/text.js +0 -80
  242. package/styled-system/recipes/text.mjs +0 -80
  243. package/styled-system/recipes/textarea.d.ts +0 -32
  244. package/styled-system/recipes/textarea.js +0 -32
  245. package/styled-system/recipes/textarea.mjs +0 -35
  246. package/styled-system/recipes/textinput.d.ts +0 -32
  247. package/styled-system/recipes/textinput.mjs +0 -35
  248. package/styled-system/styles.css +0 -2184
  249. package/styled-system/tokens/index.d.ts +0 -9
  250. package/styled-system/tokens/index.js +0 -1480
  251. package/styled-system/tokens/index.mjs +0 -1580
  252. package/styled-system/tokens/tokens.d.ts +0 -63
  253. package/styled-system/types/composition.d.ts +0 -164
  254. package/styled-system/types/conditions.d.ts +0 -306
  255. package/styled-system/types/csstype.d.ts +0 -21298
  256. package/styled-system/types/global.d.ts +0 -20
  257. package/styled-system/types/index.d.ts +0 -8
  258. package/styled-system/types/jsx.d.ts +0 -52
  259. package/styled-system/types/parts.d.ts +0 -8
  260. package/styled-system/types/pattern.d.ts +0 -78
  261. package/styled-system/types/prop-type.d.ts +0 -235
  262. package/styled-system/types/recipe.d.ts +0 -181
  263. package/styled-system/types/selectors.d.ts +0 -59
  264. package/styled-system/types/static-css.d.ts +0 -56
  265. package/styled-system/types/style-props.d.ts +0 -7468
  266. package/styled-system/types/system-types.d.ts +0 -109
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cetec-design-system",
3
- "version": "0.0.20",
3
+ "version": "0.0.21",
4
4
  "scripts": {
5
5
  "cssgen": "npx panda cssgen 'src/**/*.css'",
6
6
  "prepare": "npx panda codegen",
@@ -18,8 +18,7 @@
18
18
  "./src/styles/*",
19
19
  "./src/recipes/*",
20
20
  "./src/tokens/*",
21
- "./src/utils/*",
22
- "./styled-system/*"
21
+ "./src/utils/*"
23
22
  ],
24
23
  "dependencies": {
25
24
  "@fontsource-variable/recursive": "^5.1.1",
@@ -1,36 +0,0 @@
1
- import { withoutSpace } from '../helpers.js';
2
-
3
- const conditionsStr = "_hover,_focus,_focusWithin,_focusVisible,_disabled,_active,_visited,_target,_readOnly,_readWrite,_empty,_checked,_enabled,_expanded,_highlighted,_before,_after,_firstLetter,_firstLine,_marker,_selection,_file,_backdrop,_first,_last,_only,_even,_odd,_firstOfType,_lastOfType,_onlyOfType,_peerFocus,_peerHover,_peerActive,_peerFocusWithin,_peerFocusVisible,_peerDisabled,_peerChecked,_peerInvalid,_peerExpanded,_peerPlaceholderShown,_groupFocus,_groupHover,_groupActive,_groupFocusWithin,_groupFocusVisible,_groupDisabled,_groupChecked,_groupExpanded,_groupInvalid,_indeterminate,_required,_valid,_invalid,_autofill,_inRange,_outOfRange,_placeholder,_placeholderShown,_pressed,_selected,_default,_optional,_open,_closed,_fullscreen,_loading,_currentPage,_currentStep,_motionReduce,_motionSafe,_print,_landscape,_portrait,_dark,_light,_osDark,_osLight,_highContrast,_lessContrast,_moreContrast,_ltr,_rtl,_scrollbar,_scrollbarThumb,_scrollbarTrack,_horizontal,_vertical,_starting,_error,_hidden,_current,_today,_collapsed,_containerSmall,_containerMedium,_containerLarge,xs,xsOnly,xsDown,sm,smOnly,smDown,md,mdOnly,mdDown,lg,lgOnly,lgDown,xl,xlOnly,xlDown,2xl,2xlOnly,2xlDown,xsToSm,xsToMd,xsToLg,xsToXl,xsTo2xl,smToMd,smToLg,smToXl,smTo2xl,mdToLg,mdToXl,mdTo2xl,lgToXl,lgTo2xl,xlTo2xl,@/xs,@/sm,@/md,@/lg,@/xl,@/2xl,@/3xl,@/4xl,@/5xl,@/6xl,@/7xl,@/8xl,base"
4
- const conditions = new Set(conditionsStr.split(','))
5
-
6
- const conditionRegex = /^@|&|&$/
7
-
8
- export function isCondition(value){
9
- return conditions.has(value) || conditionRegex.test(value)
10
- }
11
-
12
- const underscoreRegex = /^_/
13
- const conditionsSelectorRegex = /&|@/
14
-
15
- export function finalizeConditions(paths){
16
- return paths.map((path) => {
17
- if (conditions.has(path)){
18
- return path.replace(underscoreRegex, '')
19
- }
20
-
21
- if (conditionsSelectorRegex.test(path)){
22
- return `[${withoutSpace(path.trim())}]`
23
- }
24
-
25
- return path
26
- })}
27
-
28
- export function sortConditions(paths){
29
- return paths.sort((a, b) => {
30
- const aa = isCondition(a)
31
- const bb = isCondition(b)
32
- if (aa && !bb) return 1
33
- if (!aa && bb) return -1
34
- return 0
35
- })
36
- }
@@ -1,36 +0,0 @@
1
- import { withoutSpace } from '../helpers.mjs';
2
-
3
- const conditionsStr = "_hover,_focus,_focusWithin,_focusVisible,_disabled,_active,_visited,_target,_readOnly,_readWrite,_empty,_checked,_enabled,_expanded,_highlighted,_before,_after,_firstLetter,_firstLine,_marker,_selection,_file,_backdrop,_first,_last,_only,_even,_odd,_firstOfType,_lastOfType,_onlyOfType,_peerFocus,_peerHover,_peerActive,_peerFocusWithin,_peerFocusVisible,_peerDisabled,_peerChecked,_peerInvalid,_peerExpanded,_peerPlaceholderShown,_groupFocus,_groupHover,_groupActive,_groupFocusWithin,_groupFocusVisible,_groupDisabled,_groupChecked,_groupExpanded,_groupInvalid,_indeterminate,_required,_valid,_invalid,_autofill,_inRange,_outOfRange,_placeholder,_placeholderShown,_pressed,_selected,_default,_optional,_open,_closed,_fullscreen,_loading,_currentPage,_currentStep,_motionReduce,_motionSafe,_print,_landscape,_portrait,_dark,_light,_osDark,_osLight,_highContrast,_lessContrast,_moreContrast,_ltr,_rtl,_scrollbar,_scrollbarThumb,_scrollbarTrack,_horizontal,_vertical,_starting,_error,_hidden,_current,_today,_collapsed,_containerSmall,_containerMedium,_containerLarge,xs,xsOnly,xsDown,sm,smOnly,smDown,md,mdOnly,mdDown,lg,lgOnly,lgDown,xl,xlOnly,xlDown,2xl,2xlOnly,2xlDown,xsToSm,xsToMd,xsToLg,xsToXl,xsTo2xl,smToMd,smToLg,smToXl,smTo2xl,mdToLg,mdToXl,mdTo2xl,lgToXl,lgTo2xl,xlTo2xl,@/xs,@/sm,@/md,@/lg,@/xl,@/2xl,@/3xl,@/4xl,@/5xl,@/6xl,@/7xl,@/8xl,base"
4
- const conditions = new Set(conditionsStr.split(','))
5
-
6
- const conditionRegex = /^@|&|&$/
7
-
8
- export function isCondition(value){
9
- return conditions.has(value) || conditionRegex.test(value)
10
- }
11
-
12
- const underscoreRegex = /^_/
13
- const conditionsSelectorRegex = /&|@/
14
-
15
- export function finalizeConditions(paths){
16
- return paths.map((path) => {
17
- if (conditions.has(path)){
18
- return path.replace(underscoreRegex, '')
19
- }
20
-
21
- if (conditionsSelectorRegex.test(path)){
22
- return `[${withoutSpace(path.trim())}]`
23
- }
24
-
25
- return path
26
- })}
27
-
28
- export function sortConditions(paths){
29
- return paths.sort((a, b) => {
30
- const aa = isCondition(a)
31
- const bb = isCondition(b)
32
- if (aa && !bb) return 1
33
- if (!aa && bb) return -1
34
- return 0
35
- })
36
- }
@@ -1,22 +0,0 @@
1
- /* eslint-disable */
2
- import type { SystemStyleObject } from '../types/index';
3
-
4
- type Styles = SystemStyleObject | undefined | null | false
5
-
6
- interface CssRawFunction {
7
- (styles: Styles): SystemStyleObject
8
- (styles: Styles[]): SystemStyleObject
9
- (...styles: Array<Styles | Styles[]>): SystemStyleObject
10
- (styles: Styles): SystemStyleObject
11
- }
12
-
13
- interface CssFunction {
14
- (styles: Styles): string
15
- (styles: Styles[]): string
16
- (...styles: Array<Styles | Styles[]>): string
17
- (styles: Styles): string
18
-
19
- raw: CssRawFunction
20
- }
21
-
22
- export declare const css: CssFunction;
@@ -1,45 +0,0 @@
1
- import { createCss, createMergeCss, hypenateProperty, withoutSpace } from '../helpers.js';
2
- import { sortConditions, finalizeConditions } from './conditions.js';
3
-
4
- const utilities = "aspectRatio:asp,boxDecorationBreak:bx-db,zIndex:z,boxSizing:bx-s,objectPosition:obj-p,objectFit:obj-f,overscrollBehavior:ovs-b,overscrollBehaviorX:ovs-bx,overscrollBehaviorY:ovs-by,position:pos/1,top:top,left:left,inset:inset,insetInline:inset-x/insetX,insetBlock:inset-y/insetY,insetBlockEnd:inset-be,insetBlockStart:inset-bs,insetInlineEnd:inset-e/insetEnd/end,insetInlineStart:inset-s/insetStart/start,right:right,bottom:bottom,float:float,visibility:vis,display:d,hideFrom:hide,hideBelow:show,flexBasis:flex-b,flex:flex,flexDirection:flex-d/flexDir,flexGrow:flex-g,flexShrink:flex-sh,gridTemplateColumns:grid-tc,gridTemplateRows:grid-tr,gridColumn:grid-c,gridRow:grid-r,gridColumnStart:grid-cs,gridColumnEnd:grid-ce,gridAutoFlow:grid-af,gridAutoColumns:grid-ac,gridAutoRows:grid-ar,gap:gap,gridGap:grid-g,gridRowGap:grid-rg,gridColumnGap:grid-cg,rowGap:rg,columnGap:cg,justifyContent:jc,alignContent:ac,alignItems:ai,alignSelf:as,padding:p/1,paddingLeft:pl/1,paddingRight:pr/1,paddingTop:pt/1,paddingBottom:pb/1,paddingBlock:py/1/paddingY,paddingBlockEnd:pbe,paddingBlockStart:pbs,paddingInline:px/paddingX/1,paddingInlineEnd:pe/1/paddingEnd,paddingInlineStart:ps/1/paddingStart,marginLeft:ml/1,marginRight:mr/1,marginTop:mt/1,marginBottom:mb/1,margin:m/1,marginBlock:my/1/marginY,marginBlockEnd:mbe,marginBlockStart:mbs,marginInline:mx/1/marginX,marginInlineEnd:me/1/marginEnd,marginInlineStart:ms/1/marginStart,spaceX:sx,spaceY:sy,outlineWidth:ring-w/ringWidth,outlineColor:ring-c/ringColor,outline:ring/1,outlineOffset:ring-o/ringOffset,divideX:dvd-x,divideY:dvd-y,divideColor:dvd-c,divideStyle:dvd-s,width:w/1,inlineSize:w-is,minWidth:min-w/minW,minInlineSize:min-w-is,maxWidth:max-w/maxW,maxInlineSize:max-w-is,height:h/1,blockSize:h-bs,minHeight:min-h/minH,minBlockSize:min-h-bs,maxHeight:max-h/maxH,maxBlockSize:max-b,color:c,fontFamily:ff,fontSize:fs,fontSizeAdjust:fs-a,fontPalette:fp,fontKerning:fk,fontFeatureSettings:ff-s,fontWeight:fw,fontSmoothing:fsmt,fontVariant:fv,fontVariantAlternates:fv-alt,fontVariantCaps:fv-caps,fontVariationSettings:fv-s,fontVariantNumeric:fv-num,letterSpacing:ls,lineHeight:lh,textAlign:ta,textDecoration:td,textDecorationColor:td-c,textEmphasisColor:te-c,textDecorationStyle:td-s,textDecorationThickness:td-t,textUnderlineOffset:tu-o,textTransform:tt,textIndent:ti,textShadow:tsh,textShadowColor:tsh-c/textShadowColor,textOverflow:tov,verticalAlign:va,wordBreak:wb,textWrap:tw,truncate:trunc,lineClamp:lc,listStyleType:li-t,listStylePosition:li-pos,listStyleImage:li-img,listStyle:li-s,backgroundPosition:bg-p/bgPosition,backgroundPositionX:bg-p-x/bgPositionX,backgroundPositionY:bg-p-y/bgPositionY,backgroundAttachment:bg-a/bgAttachment,backgroundClip:bg-cp/bgClip,background:bg/1,backgroundColor:bg-c/bgColor,backgroundOrigin:bg-o/bgOrigin,backgroundImage:bg-i/bgImage,backgroundRepeat:bg-r/bgRepeat,backgroundBlendMode:bg-bm/bgBlendMode,backgroundSize:bg-s/bgSize,backgroundGradient:bg-grad/bgGradient,textGradient:txt-grad,gradientFromPosition:grad-from-pos,gradientToPosition:grad-to-pos,gradientFrom:grad-from,gradientTo:grad-to,gradientVia:grad-via,gradientViaPosition:grad-via-pos,borderRadius:bdr/rounded,borderTopLeftRadius:bdr-tl/roundedTopLeft,borderTopRightRadius:bdr-tr/roundedTopRight,borderBottomRightRadius:bdr-br/roundedBottomRight,borderBottomLeftRadius:bdr-bl/roundedBottomLeft,borderTopRadius:bdr-t/roundedTop,borderRightRadius:bdr-r/roundedRight,borderBottomRadius:bdr-b/roundedBottom,borderLeftRadius:bdr-l/roundedLeft,borderStartStartRadius:bdr-ss/roundedStartStart,borderStartEndRadius:bdr-se/roundedStartEnd,borderStartRadius:bdr-s/roundedStart,borderEndStartRadius:bdr-es/roundedEndStart,borderEndEndRadius:bdr-ee/roundedEndEnd,borderEndRadius:bdr-e/roundedEnd,border:bd,borderWidth:bd-w,borderTopWidth:bd-t-w,borderLeftWidth:bd-l-w,borderRightWidth:bd-r-w,borderBottomWidth:bd-b-w,borderColor:bd-c,borderInline:bd-x/borderX,borderInlineWidth:bd-x-w/borderXWidth,borderInlineColor:bd-x-c/borderXColor,borderBlock:bd-y/borderY,borderBlockWidth:bd-y-w/borderYWidth,borderBlockColor:bd-y-c/borderYColor,borderLeft:bd-l,borderLeftColor:bd-l-c,borderInlineStart:bd-s/borderStart,borderInlineStartWidth:bd-s-w/borderStartWidth,borderInlineStartColor:bd-s-c/borderStartColor,borderRight:bd-r,borderRightColor:bd-r-c,borderInlineEnd:bd-e/borderEnd,borderInlineEndWidth:bd-e-w/borderEndWidth,borderInlineEndColor:bd-e-c/borderEndColor,borderTop:bd-t,borderTopColor:bd-t-c,borderBottom:bd-b,borderBottomColor:bd-b-c,borderBlockEnd:bd-be,borderBlockEndColor:bd-be-c,borderBlockStart:bd-bs,borderBlockStartColor:bd-bs-c,opacity:op,boxShadow:bx-sh/shadow,boxShadowColor:bx-sh-c/shadowColor,mixBlendMode:mix-bm,filter:filter,brightness:brightness,contrast:contrast,grayscale:grayscale,hueRotate:hue-rotate,invert:invert,saturate:saturate,sepia:sepia,dropShadow:drop-shadow,blur:blur,backdropFilter:bkdp,backdropBlur:bkdp-blur,backdropBrightness:bkdp-brightness,backdropContrast:bkdp-contrast,backdropGrayscale:bkdp-grayscale,backdropHueRotate:bkdp-hue-rotate,backdropInvert:bkdp-invert,backdropOpacity:bkdp-opacity,backdropSaturate:bkdp-saturate,backdropSepia:bkdp-sepia,borderCollapse:bd-cl,borderSpacing:bd-sp,borderSpacingX:bd-sx,borderSpacingY:bd-sy,tableLayout:tbl,transitionTimingFunction:trs-tmf,transitionDelay:trs-dly,transitionDuration:trs-dur,transitionProperty:trs-prop,transition:trs,animation:anim,animationName:anim-n,animationTimingFunction:anim-tmf,animationDuration:anim-dur,animationDelay:anim-dly,animationPlayState:anim-ps,animationComposition:anim-comp,animationFillMode:anim-fm,animationDirection:anim-dir,animationIterationCount:anim-ic,animationRange:anim-r,animationState:anim-s,animationRangeStart:anim-rs,animationRangeEnd:anim-re,animationTimeline:anim-tl,transformOrigin:trf-o,transformBox:trf-b,transformStyle:trf-s,transform:trf,rotate:rotate,rotateX:rotate-x,rotateY:rotate-y,rotateZ:rotate-z,scale:scale,scaleX:scale-x,scaleY:scale-y,translate:translate,translateX:translate-x/x,translateY:translate-y/y,translateZ:translate-z/z,accentColor:ac-c,caretColor:ca-c,scrollBehavior:scr-bhv,scrollbar:scr-bar,scrollbarColor:scr-bar-c,scrollbarGutter:scr-bar-g,scrollbarWidth:scr-bar-w,scrollMargin:scr-m,scrollMarginLeft:scr-ml,scrollMarginRight:scr-mr,scrollMarginTop:scr-mt,scrollMarginBottom:scr-mb,scrollMarginBlock:scr-my/scrollMarginY,scrollMarginBlockEnd:scr-mbe,scrollMarginBlockStart:scr-mbt,scrollMarginInline:scr-mx/scrollMarginX,scrollMarginInlineEnd:scr-me,scrollMarginInlineStart:scr-ms,scrollPadding:scr-p,scrollPaddingBlock:scr-py/scrollPaddingY,scrollPaddingBlockStart:scr-pbs,scrollPaddingBlockEnd:scr-pbe,scrollPaddingInline:scr-px/scrollPaddingX,scrollPaddingInlineEnd:scr-pe,scrollPaddingInlineStart:scr-ps,scrollPaddingLeft:scr-pl,scrollPaddingRight:scr-pr,scrollPaddingTop:scr-pt,scrollPaddingBottom:scr-pb,scrollSnapAlign:scr-sa,scrollSnapStop:scrs-s,scrollSnapType:scrs-t,scrollSnapStrictness:scrs-strt,scrollSnapMargin:scrs-m,scrollSnapMarginTop:scrs-mt,scrollSnapMarginBottom:scrs-mb,scrollSnapMarginLeft:scrs-ml,scrollSnapMarginRight:scrs-mr,scrollSnapCoordinate:scrs-c,scrollSnapDestination:scrs-d,scrollSnapPointsX:scrs-px,scrollSnapPointsY:scrs-py,scrollSnapTypeX:scrs-tx,scrollSnapTypeY:scrs-ty,scrollTimeline:scrtl,scrollTimelineAxis:scrtl-a,scrollTimelineName:scrtl-n,touchAction:tch-a,userSelect:us,overflow:ov,overflowWrap:ov-wrap,overflowX:ov-x,overflowY:ov-y,overflowAnchor:ov-a,overflowBlock:ov-b,overflowInline:ov-i,overflowClipBox:ovcp-bx,overflowClipMargin:ovcp-m,overscrollBehaviorBlock:ovs-bb,overscrollBehaviorInline:ovs-bi,fill:fill,stroke:stk,strokeWidth:stk-w,strokeDasharray:stk-dsh,strokeDashoffset:stk-do,strokeLinecap:stk-lc,strokeLinejoin:stk-lj,strokeMiterlimit:stk-ml,strokeOpacity:stk-op,srOnly:sr,debug:debug,appearance:ap,backfaceVisibility:bfv,clipPath:cp-path,hyphens:hy,mask:msk,maskImage:msk-i,maskSize:msk-s,textSizeAdjust:txt-adj,container:cq,containerName:cq-n,containerType:cq-t,textStyle:textStyle"
5
-
6
- const classNameByProp = new Map()
7
- const shorthands = new Map()
8
- utilities.split(',').forEach((utility) => {
9
- const [prop, meta] = utility.split(':')
10
- const [className, ...shorthandList] = meta.split('/')
11
- classNameByProp.set(prop, className)
12
- if (shorthandList.length) {
13
- shorthandList.forEach((shorthand) => {
14
- shorthands.set(shorthand === '1' ? className : shorthand, prop)
15
- })
16
- }
17
- })
18
-
19
- const resolveShorthand = (prop) => shorthands.get(prop) || prop
20
-
21
- const context = {
22
-
23
- conditions: {
24
- shift: sortConditions,
25
- finalize: finalizeConditions,
26
- breakpoints: { keys: ["base","xs","sm","md","lg","xl","2xl"] }
27
- },
28
- utility: {
29
-
30
- transform: (prop, value) => {
31
- const key = resolveShorthand(prop)
32
- const propKey = classNameByProp.get(key) || hypenateProperty(key)
33
- return { className: `${propKey}_${withoutSpace(value)}` }
34
- },
35
- hasShorthand: true,
36
- toHash: (path, hashFn) => hashFn(path.join(":")),
37
- resolveShorthand: resolveShorthand,
38
- }
39
- }
40
-
41
- const cssFn = createCss(context)
42
- export const css = (...styles) => cssFn(mergeCss(...styles))
43
- css.raw = (...styles) => mergeCss(...styles)
44
-
45
- export const { mergeCss, assignCss } = createMergeCss(context)
@@ -1,45 +0,0 @@
1
- import { createCss, createMergeCss, hypenateProperty, withoutSpace } from '../helpers.mjs';
2
- import { sortConditions, finalizeConditions } from './conditions.mjs';
3
-
4
- const utilities = "aspectRatio:asp,boxDecorationBreak:bx-db,zIndex:z,boxSizing:bx-s,objectPosition:obj-p,objectFit:obj-f,overscrollBehavior:ovs-b,overscrollBehaviorX:ovs-bx,overscrollBehaviorY:ovs-by,position:pos/1,top:top,left:left,inset:inset,insetInline:inset-x/insetX,insetBlock:inset-y/insetY,insetBlockEnd:inset-be,insetBlockStart:inset-bs,insetInlineEnd:inset-e/insetEnd/end,insetInlineStart:inset-s/insetStart/start,right:right,bottom:bottom,float:float,visibility:vis,display:d,hideFrom:hide,hideBelow:show,flexBasis:flex-b,flex:flex,flexDirection:flex-d/flexDir,flexGrow:flex-g,flexShrink:flex-sh,gridTemplateColumns:grid-tc,gridTemplateRows:grid-tr,gridColumn:grid-c,gridRow:grid-r,gridColumnStart:grid-cs,gridColumnEnd:grid-ce,gridAutoFlow:grid-af,gridAutoColumns:grid-ac,gridAutoRows:grid-ar,gap:gap,gridGap:grid-g,gridRowGap:grid-rg,gridColumnGap:grid-cg,rowGap:rg,columnGap:cg,justifyContent:jc,alignContent:ac,alignItems:ai,alignSelf:as,padding:p/1,paddingLeft:pl/1,paddingRight:pr/1,paddingTop:pt/1,paddingBottom:pb/1,paddingBlock:py/1/paddingY,paddingBlockEnd:pbe,paddingBlockStart:pbs,paddingInline:px/paddingX/1,paddingInlineEnd:pe/1/paddingEnd,paddingInlineStart:ps/1/paddingStart,marginLeft:ml/1,marginRight:mr/1,marginTop:mt/1,marginBottom:mb/1,margin:m/1,marginBlock:my/1/marginY,marginBlockEnd:mbe,marginBlockStart:mbs,marginInline:mx/1/marginX,marginInlineEnd:me/1/marginEnd,marginInlineStart:ms/1/marginStart,spaceX:sx,spaceY:sy,outlineWidth:ring-w/ringWidth,outlineColor:ring-c/ringColor,outline:ring/1,outlineOffset:ring-o/ringOffset,divideX:dvd-x,divideY:dvd-y,divideColor:dvd-c,divideStyle:dvd-s,width:w/1,inlineSize:w-is,minWidth:min-w/minW,minInlineSize:min-w-is,maxWidth:max-w/maxW,maxInlineSize:max-w-is,height:h/1,blockSize:h-bs,minHeight:min-h/minH,minBlockSize:min-h-bs,maxHeight:max-h/maxH,maxBlockSize:max-b,color:c,fontFamily:ff,fontSize:fs,fontSizeAdjust:fs-a,fontPalette:fp,fontKerning:fk,fontFeatureSettings:ff-s,fontWeight:fw,fontSmoothing:fsmt,fontVariant:fv,fontVariantAlternates:fv-alt,fontVariantCaps:fv-caps,fontVariationSettings:fv-s,fontVariantNumeric:fv-num,letterSpacing:ls,lineHeight:lh,textAlign:ta,textDecoration:td,textDecorationColor:td-c,textEmphasisColor:te-c,textDecorationStyle:td-s,textDecorationThickness:td-t,textUnderlineOffset:tu-o,textTransform:tt,textIndent:ti,textShadow:tsh,textShadowColor:tsh-c/textShadowColor,textOverflow:tov,verticalAlign:va,wordBreak:wb,textWrap:tw,truncate:trunc,lineClamp:lc,listStyleType:li-t,listStylePosition:li-pos,listStyleImage:li-img,listStyle:li-s,backgroundPosition:bg-p/bgPosition,backgroundPositionX:bg-p-x/bgPositionX,backgroundPositionY:bg-p-y/bgPositionY,backgroundAttachment:bg-a/bgAttachment,backgroundClip:bg-cp/bgClip,background:bg/1,backgroundColor:bg-c/bgColor,backgroundOrigin:bg-o/bgOrigin,backgroundImage:bg-i/bgImage,backgroundRepeat:bg-r/bgRepeat,backgroundBlendMode:bg-bm/bgBlendMode,backgroundSize:bg-s/bgSize,backgroundGradient:bg-grad/bgGradient,textGradient:txt-grad,gradientFromPosition:grad-from-pos,gradientToPosition:grad-to-pos,gradientFrom:grad-from,gradientTo:grad-to,gradientVia:grad-via,gradientViaPosition:grad-via-pos,borderRadius:bdr/rounded,borderTopLeftRadius:bdr-tl/roundedTopLeft,borderTopRightRadius:bdr-tr/roundedTopRight,borderBottomRightRadius:bdr-br/roundedBottomRight,borderBottomLeftRadius:bdr-bl/roundedBottomLeft,borderTopRadius:bdr-t/roundedTop,borderRightRadius:bdr-r/roundedRight,borderBottomRadius:bdr-b/roundedBottom,borderLeftRadius:bdr-l/roundedLeft,borderStartStartRadius:bdr-ss/roundedStartStart,borderStartEndRadius:bdr-se/roundedStartEnd,borderStartRadius:bdr-s/roundedStart,borderEndStartRadius:bdr-es/roundedEndStart,borderEndEndRadius:bdr-ee/roundedEndEnd,borderEndRadius:bdr-e/roundedEnd,border:bd,borderWidth:bd-w,borderTopWidth:bd-t-w,borderLeftWidth:bd-l-w,borderRightWidth:bd-r-w,borderBottomWidth:bd-b-w,borderColor:bd-c,borderInline:bd-x/borderX,borderInlineWidth:bd-x-w/borderXWidth,borderInlineColor:bd-x-c/borderXColor,borderBlock:bd-y/borderY,borderBlockWidth:bd-y-w/borderYWidth,borderBlockColor:bd-y-c/borderYColor,borderLeft:bd-l,borderLeftColor:bd-l-c,borderInlineStart:bd-s/borderStart,borderInlineStartWidth:bd-s-w/borderStartWidth,borderInlineStartColor:bd-s-c/borderStartColor,borderRight:bd-r,borderRightColor:bd-r-c,borderInlineEnd:bd-e/borderEnd,borderInlineEndWidth:bd-e-w/borderEndWidth,borderInlineEndColor:bd-e-c/borderEndColor,borderTop:bd-t,borderTopColor:bd-t-c,borderBottom:bd-b,borderBottomColor:bd-b-c,borderBlockEnd:bd-be,borderBlockEndColor:bd-be-c,borderBlockStart:bd-bs,borderBlockStartColor:bd-bs-c,opacity:op,boxShadow:bx-sh/shadow,boxShadowColor:bx-sh-c/shadowColor,mixBlendMode:mix-bm,filter:filter,brightness:brightness,contrast:contrast,grayscale:grayscale,hueRotate:hue-rotate,invert:invert,saturate:saturate,sepia:sepia,dropShadow:drop-shadow,blur:blur,backdropFilter:bkdp,backdropBlur:bkdp-blur,backdropBrightness:bkdp-brightness,backdropContrast:bkdp-contrast,backdropGrayscale:bkdp-grayscale,backdropHueRotate:bkdp-hue-rotate,backdropInvert:bkdp-invert,backdropOpacity:bkdp-opacity,backdropSaturate:bkdp-saturate,backdropSepia:bkdp-sepia,borderCollapse:bd-cl,borderSpacing:bd-sp,borderSpacingX:bd-sx,borderSpacingY:bd-sy,tableLayout:tbl,transitionTimingFunction:trs-tmf,transitionDelay:trs-dly,transitionDuration:trs-dur,transitionProperty:trs-prop,transition:trs,animation:anim,animationName:anim-n,animationTimingFunction:anim-tmf,animationDuration:anim-dur,animationDelay:anim-dly,animationPlayState:anim-ps,animationComposition:anim-comp,animationFillMode:anim-fm,animationDirection:anim-dir,animationIterationCount:anim-ic,animationRange:anim-r,animationState:anim-s,animationRangeStart:anim-rs,animationRangeEnd:anim-re,animationTimeline:anim-tl,transformOrigin:trf-o,transformBox:trf-b,transformStyle:trf-s,transform:trf,rotate:rotate,rotateX:rotate-x,rotateY:rotate-y,rotateZ:rotate-z,scale:scale,scaleX:scale-x,scaleY:scale-y,translate:translate,translateX:translate-x/x,translateY:translate-y/y,translateZ:translate-z/z,accentColor:ac-c,caretColor:ca-c,scrollBehavior:scr-bhv,scrollbar:scr-bar,scrollbarColor:scr-bar-c,scrollbarGutter:scr-bar-g,scrollbarWidth:scr-bar-w,scrollMargin:scr-m,scrollMarginLeft:scr-ml,scrollMarginRight:scr-mr,scrollMarginTop:scr-mt,scrollMarginBottom:scr-mb,scrollMarginBlock:scr-my/scrollMarginY,scrollMarginBlockEnd:scr-mbe,scrollMarginBlockStart:scr-mbt,scrollMarginInline:scr-mx/scrollMarginX,scrollMarginInlineEnd:scr-me,scrollMarginInlineStart:scr-ms,scrollPadding:scr-p,scrollPaddingBlock:scr-py/scrollPaddingY,scrollPaddingBlockStart:scr-pbs,scrollPaddingBlockEnd:scr-pbe,scrollPaddingInline:scr-px/scrollPaddingX,scrollPaddingInlineEnd:scr-pe,scrollPaddingInlineStart:scr-ps,scrollPaddingLeft:scr-pl,scrollPaddingRight:scr-pr,scrollPaddingTop:scr-pt,scrollPaddingBottom:scr-pb,scrollSnapAlign:scr-sa,scrollSnapStop:scrs-s,scrollSnapType:scrs-t,scrollSnapStrictness:scrs-strt,scrollSnapMargin:scrs-m,scrollSnapMarginTop:scrs-mt,scrollSnapMarginBottom:scrs-mb,scrollSnapMarginLeft:scrs-ml,scrollSnapMarginRight:scrs-mr,scrollSnapCoordinate:scrs-c,scrollSnapDestination:scrs-d,scrollSnapPointsX:scrs-px,scrollSnapPointsY:scrs-py,scrollSnapTypeX:scrs-tx,scrollSnapTypeY:scrs-ty,scrollTimeline:scrtl,scrollTimelineAxis:scrtl-a,scrollTimelineName:scrtl-n,touchAction:tch-a,userSelect:us,overflow:ov,overflowWrap:ov-wrap,overflowX:ov-x,overflowY:ov-y,overflowAnchor:ov-a,overflowBlock:ov-b,overflowInline:ov-i,overflowClipBox:ovcp-bx,overflowClipMargin:ovcp-m,overscrollBehaviorBlock:ovs-bb,overscrollBehaviorInline:ovs-bi,fill:fill,stroke:stk,strokeWidth:stk-w,strokeDasharray:stk-dsh,strokeDashoffset:stk-do,strokeLinecap:stk-lc,strokeLinejoin:stk-lj,strokeMiterlimit:stk-ml,strokeOpacity:stk-op,srOnly:sr,debug:debug,appearance:ap,backfaceVisibility:bfv,clipPath:cp-path,hyphens:hy,mask:msk,maskImage:msk-i,maskSize:msk-s,textSizeAdjust:txt-adj,container:cq,containerName:cq-n,containerType:cq-t,textStyle:textStyle"
5
-
6
- const classNameByProp = new Map()
7
- const shorthands = new Map()
8
- utilities.split(',').forEach((utility) => {
9
- const [prop, meta] = utility.split(':')
10
- const [className, ...shorthandList] = meta.split('/')
11
- classNameByProp.set(prop, className)
12
- if (shorthandList.length) {
13
- shorthandList.forEach((shorthand) => {
14
- shorthands.set(shorthand === '1' ? className : shorthand, prop)
15
- })
16
- }
17
- })
18
-
19
- const resolveShorthand = (prop) => shorthands.get(prop) || prop
20
-
21
- const context = {
22
-
23
- conditions: {
24
- shift: sortConditions,
25
- finalize: finalizeConditions,
26
- breakpoints: { keys: ["base","xs","sm","md","lg","xl","2xl"] }
27
- },
28
- utility: {
29
-
30
- transform: (prop, value) => {
31
- const key = resolveShorthand(prop)
32
- const propKey = classNameByProp.get(key) || hypenateProperty(key)
33
- return { className: `${propKey}_${withoutSpace(value)}` }
34
- },
35
- hasShorthand: true,
36
- toHash: (path, hashFn) => hashFn(path.join(":")),
37
- resolveShorthand: resolveShorthand,
38
- }
39
- }
40
-
41
- const cssFn = createCss(context)
42
- export const css = (...styles) => cssFn(mergeCss(...styles))
43
- css.raw = (...styles) => mergeCss(...styles)
44
-
45
- export const { mergeCss, assignCss } = createMergeCss(context)
@@ -1,6 +0,0 @@
1
- /* eslint-disable */
2
- import type { RecipeCreatorFn } from '../types/recipe';
3
-
4
- export declare const cva: RecipeCreatorFn
5
-
6
- export type { RecipeVariant, RecipeVariantProps } from '../types/recipe';
@@ -1,87 +0,0 @@
1
- import { compact, mergeProps, memo, splitProps, uniq } from '../helpers.js';
2
- import { css, mergeCss } from './css.js';
3
-
4
- const defaults = (conf) => ({
5
- base: {},
6
- variants: {},
7
- defaultVariants: {},
8
- compoundVariants: [],
9
- ...conf,
10
- })
11
-
12
- export function cva(config) {
13
- const { base, variants, defaultVariants, compoundVariants } = defaults(config)
14
- const getVariantProps = (variants) => ({ ...defaultVariants, ...compact(variants) })
15
-
16
- function resolve(props = {}) {
17
- const computedVariants = getVariantProps(props)
18
- let variantCss = { ...base }
19
- for (const [key, value] of Object.entries(computedVariants)) {
20
- if (variants[key]?.[value]) {
21
- variantCss = mergeCss(variantCss, variants[key][value])
22
- }
23
- }
24
- const compoundVariantCss = getCompoundVariantCss(compoundVariants, computedVariants)
25
- return mergeCss(variantCss, compoundVariantCss)
26
- }
27
-
28
- function merge(__cva) {
29
- const override = defaults(__cva.config)
30
- const variantKeys = uniq(__cva.variantKeys, Object.keys(variants))
31
- return cva({
32
- base: mergeCss(base, override.base),
33
- variants: Object.fromEntries(
34
- variantKeys.map((key) => [key, mergeCss(variants[key], override.variants[key])]),
35
- ),
36
- defaultVariants: mergeProps(defaultVariants, override.defaultVariants),
37
- compoundVariants: [...compoundVariants, ...override.compoundVariants],
38
- })
39
- }
40
-
41
- function cvaFn(props) {
42
- return css(resolve(props))
43
- }
44
-
45
- const variantKeys = Object.keys(variants)
46
-
47
- function splitVariantProps(props) {
48
- return splitProps(props, variantKeys)
49
- }
50
-
51
- const variantMap = Object.fromEntries(Object.entries(variants).map(([key, value]) => [key, Object.keys(value)]))
52
-
53
- return Object.assign(memo(cvaFn), {
54
- __cva__: true,
55
- variantMap,
56
- variantKeys,
57
- raw: resolve,
58
- config,
59
- merge,
60
- splitVariantProps,
61
- getVariantProps
62
- })
63
- }
64
-
65
- export function getCompoundVariantCss(compoundVariants, variantMap) {
66
- let result = {}
67
- compoundVariants.forEach((compoundVariant) => {
68
- const isMatching = Object.entries(compoundVariant).every(([key, value]) => {
69
- if (key === 'css') return true
70
-
71
- const values = Array.isArray(value) ? value : [value]
72
- return values.some((value) => variantMap[key] === value)
73
- })
74
-
75
- if (isMatching) {
76
- result = mergeCss(result, compoundVariant.css)
77
- }
78
- })
79
-
80
- return result
81
- }
82
-
83
- export function assertCompoundVariant(name, compoundVariants, variants, prop) {
84
- if (compoundVariants.length > 0 && typeof variants?.[prop] === 'object') {
85
- throw new Error(`[recipe:${name}:${prop}] Conditions are not supported when using compound variants.`)
86
- }
87
- }
@@ -1,87 +0,0 @@
1
- import { compact, mergeProps, memo, splitProps, uniq } from '../helpers.mjs';
2
- import { css, mergeCss } from './css.mjs';
3
-
4
- const defaults = (conf) => ({
5
- base: {},
6
- variants: {},
7
- defaultVariants: {},
8
- compoundVariants: [],
9
- ...conf,
10
- })
11
-
12
- export function cva(config) {
13
- const { base, variants, defaultVariants, compoundVariants } = defaults(config)
14
- const getVariantProps = (variants) => ({ ...defaultVariants, ...compact(variants) })
15
-
16
- function resolve(props = {}) {
17
- const computedVariants = getVariantProps(props)
18
- let variantCss = { ...base }
19
- for (const [key, value] of Object.entries(computedVariants)) {
20
- if (variants[key]?.[value]) {
21
- variantCss = mergeCss(variantCss, variants[key][value])
22
- }
23
- }
24
- const compoundVariantCss = getCompoundVariantCss(compoundVariants, computedVariants)
25
- return mergeCss(variantCss, compoundVariantCss)
26
- }
27
-
28
- function merge(__cva) {
29
- const override = defaults(__cva.config)
30
- const variantKeys = uniq(__cva.variantKeys, Object.keys(variants))
31
- return cva({
32
- base: mergeCss(base, override.base),
33
- variants: Object.fromEntries(
34
- variantKeys.map((key) => [key, mergeCss(variants[key], override.variants[key])]),
35
- ),
36
- defaultVariants: mergeProps(defaultVariants, override.defaultVariants),
37
- compoundVariants: [...compoundVariants, ...override.compoundVariants],
38
- })
39
- }
40
-
41
- function cvaFn(props) {
42
- return css(resolve(props))
43
- }
44
-
45
- const variantKeys = Object.keys(variants)
46
-
47
- function splitVariantProps(props) {
48
- return splitProps(props, variantKeys)
49
- }
50
-
51
- const variantMap = Object.fromEntries(Object.entries(variants).map(([key, value]) => [key, Object.keys(value)]))
52
-
53
- return Object.assign(memo(cvaFn), {
54
- __cva__: true,
55
- variantMap,
56
- variantKeys,
57
- raw: resolve,
58
- config,
59
- merge,
60
- splitVariantProps,
61
- getVariantProps
62
- })
63
- }
64
-
65
- export function getCompoundVariantCss(compoundVariants, variantMap) {
66
- let result = {}
67
- compoundVariants.forEach((compoundVariant) => {
68
- const isMatching = Object.entries(compoundVariant).every(([key, value]) => {
69
- if (key === 'css') return true
70
-
71
- const values = Array.isArray(value) ? value : [value]
72
- return values.some((value) => variantMap[key] === value)
73
- })
74
-
75
- if (isMatching) {
76
- result = mergeCss(result, compoundVariant.css)
77
- }
78
- })
79
-
80
- return result
81
- }
82
-
83
- export function assertCompoundVariant(name, compoundVariants, variants, prop) {
84
- if (compoundVariants.length > 0 && typeof variants?.[prop] === 'object') {
85
- throw new Error(`[recipe:${name}:${prop}] Conditions are not supported when using compound variants.`)
86
- }
87
- }
@@ -1,5 +0,0 @@
1
- /* eslint-disable */
2
- type Argument = string | boolean | null | undefined
3
-
4
- /** Conditionally join classNames into a single string */
5
- export declare function cx(...args: Argument[]): string
@@ -1,15 +0,0 @@
1
- function cx() {
2
- let str = '',
3
- i = 0,
4
- arg
5
-
6
- for (; i < arguments.length; ) {
7
- if ((arg = arguments[i++]) && typeof arg === 'string') {
8
- str && (str += ' ')
9
- str += arg
10
- }
11
- }
12
- return str
13
- }
14
-
15
- export { cx }
@@ -1,15 +0,0 @@
1
- function cx() {
2
- let str = '',
3
- i = 0,
4
- arg
5
-
6
- for (; i < arguments.length; ) {
7
- if ((arg = arguments[i++]) && typeof arg === 'string') {
8
- str && (str += ' ')
9
- str += arg
10
- }
11
- }
12
- return str
13
- }
14
-
15
- export { cx }
@@ -1,5 +0,0 @@
1
- /* eslint-disable */
2
- export * from './css';
3
- export * from './cx';
4
- export * from './cva';
5
- export * from './sva';
@@ -1,4 +0,0 @@
1
- export * from './css.js';
2
- export * from './cx.js';
3
- export * from './cva.js';
4
- export * from './sva.js';
@@ -1,4 +0,0 @@
1
- export * from './css.mjs';
2
- export * from './cx.mjs';
3
- export * from './cva.mjs';
4
- export * from './sva.mjs';
@@ -1,4 +0,0 @@
1
- /* eslint-disable */
2
- import type { SlotRecipeCreatorFn } from '../types/recipe';
3
-
4
- export declare const sva: SlotRecipeCreatorFn
@@ -1,41 +0,0 @@
1
- import { compact, getSlotRecipes, memo, splitProps } from '../helpers.js';
2
- import { cva } from './cva.js';
3
- import { cx } from './cx.js';
4
-
5
- const slotClass = (className, slot) => className + '__' + slot
6
-
7
- export function sva(config) {
8
- const slots = Object.entries(getSlotRecipes(config)).map(([slot, slotCva]) => [slot, cva(slotCva)])
9
- const defaultVariants = config.defaultVariants ?? {}
10
-
11
- function svaFn(props) {
12
- const result = slots.map(([slot, cvaFn]) => [slot, cx(cvaFn(props), config.className && slotClass(config.className, slot))])
13
- return Object.fromEntries(result)
14
- }
15
-
16
- function raw(props) {
17
- const result = slots.map(([slot, cvaFn]) => [slot, cvaFn.raw(props)])
18
- return Object.fromEntries(result)
19
- }
20
-
21
- const variants = config.variants ?? {};
22
- const variantKeys = Object.keys(variants);
23
-
24
- function splitVariantProps(props) {
25
- return splitProps(props, variantKeys);
26
- }
27
- const getVariantProps = (variants) => ({ ...(defaultVariants || {}), ...compact(variants) })
28
-
29
- const variantMap = Object.fromEntries(
30
- Object.entries(variants).map(([key, value]) => [key, Object.keys(value)])
31
- );
32
-
33
- return Object.assign(memo(svaFn), {
34
- __cva__: false,
35
- raw,
36
- variantMap,
37
- variantKeys,
38
- splitVariantProps,
39
- getVariantProps,
40
- })
41
- }
@@ -1,41 +0,0 @@
1
- import { compact, getSlotRecipes, memo, splitProps } from '../helpers.mjs';
2
- import { cva } from './cva.mjs';
3
- import { cx } from './cx.mjs';
4
-
5
- const slotClass = (className, slot) => className + '__' + slot
6
-
7
- export function sva(config) {
8
- const slots = Object.entries(getSlotRecipes(config)).map(([slot, slotCva]) => [slot, cva(slotCva)])
9
- const defaultVariants = config.defaultVariants ?? {}
10
-
11
- function svaFn(props) {
12
- const result = slots.map(([slot, cvaFn]) => [slot, cx(cvaFn(props), config.className && slotClass(config.className, slot))])
13
- return Object.fromEntries(result)
14
- }
15
-
16
- function raw(props) {
17
- const result = slots.map(([slot, cvaFn]) => [slot, cvaFn.raw(props)])
18
- return Object.fromEntries(result)
19
- }
20
-
21
- const variants = config.variants ?? {};
22
- const variantKeys = Object.keys(variants);
23
-
24
- function splitVariantProps(props) {
25
- return splitProps(props, variantKeys);
26
- }
27
- const getVariantProps = (variants) => ({ ...(defaultVariants || {}), ...compact(variants) })
28
-
29
- const variantMap = Object.fromEntries(
30
- Object.entries(variants).map(([key, value]) => [key, Object.keys(value)])
31
- );
32
-
33
- return Object.assign(memo(svaFn), {
34
- __cva__: false,
35
- raw,
36
- variantMap,
37
- variantKeys,
38
- splitVariantProps,
39
- getVariantProps,
40
- })
41
- }