cetec-design-system 0.0.2 → 0.0.4

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 (298) hide show
  1. package/package.json +12 -2
  2. package/styled-system/css/conditions.js +36 -0
  3. package/styled-system/css/conditions.mjs +36 -0
  4. package/styled-system/css/css.d.ts +22 -0
  5. package/styled-system/css/css.js +45 -0
  6. package/styled-system/css/css.mjs +45 -0
  7. package/styled-system/css/cva.d.ts +6 -0
  8. package/styled-system/css/cva.js +87 -0
  9. package/styled-system/css/cva.mjs +87 -0
  10. package/styled-system/css/cx.d.ts +5 -0
  11. package/styled-system/css/cx.js +15 -0
  12. package/styled-system/css/cx.mjs +15 -0
  13. package/styled-system/css/index.d.ts +5 -0
  14. package/styled-system/css/index.js +4 -0
  15. package/styled-system/css/index.mjs +4 -0
  16. package/styled-system/css/sva.d.ts +4 -0
  17. package/styled-system/css/sva.js +41 -0
  18. package/styled-system/css/sva.mjs +41 -0
  19. package/styled-system/debug/config.json +8379 -0
  20. package/styled-system/debug/src__App.ast.json +1291 -0
  21. package/styled-system/debug/src__App.css +830 -0
  22. package/styled-system/debug/src__components__Button__Button.stories.ast.json +244 -0
  23. package/styled-system/debug/src__components__Button__Button.stories.css +372 -0
  24. package/styled-system/debug/src__components__Code__Code.ast.json +32 -0
  25. package/styled-system/debug/src__components__Code__Code.css +25 -0
  26. package/styled-system/debug/src__components__Code__Pre.ast.json +53 -0
  27. package/styled-system/debug/src__components__Code__Pre.css +45 -0
  28. package/styled-system/debug/src__components__Code__copy-to-clipboard-button.ast.json +68 -0
  29. package/styled-system/debug/src__components__Code__copy-to-clipboard-button.css +167 -0
  30. package/styled-system/debug/src__components__Heading__Heading.ast.json +59 -0
  31. package/styled-system/debug/src__components__Heading__Heading.css +25 -0
  32. package/styled-system/debug/src__components__Icon__Icon.ast.json +28 -0
  33. package/styled-system/debug/src__components__Icon__Icon.css +9 -0
  34. package/styled-system/debug/src__components__Icon__iconStyle.ast.json +27 -0
  35. package/styled-system/debug/src__components__Icon__iconStyle.css +5 -0
  36. package/styled-system/debug/src__components__Input__Input.ast.json +50 -0
  37. package/styled-system/debug/src__components__Input__Input.css +79 -0
  38. package/styled-system/debug/src__components__Label__Label.ast.json +45 -0
  39. package/styled-system/debug/src__components__Label__Label.css +40 -0
  40. package/styled-system/debug/src__components__Link__Link.ast.json +72 -0
  41. package/styled-system/debug/src__components__Link__Link.css +39 -0
  42. package/styled-system/debug/src__components__Link__linkStyles.ast.json +59 -0
  43. package/styled-system/debug/src__components__Link__linkStyles.css +77 -0
  44. package/styled-system/debug/src__components__Spinner__spinnerStyles.ast.json +56 -0
  45. package/styled-system/debug/src__components__Spinner__spinnerStyles.css +69 -0
  46. package/styled-system/debug/src__components__Text__Text.ast.json +57 -0
  47. package/styled-system/debug/src__components__Text__Text.css +22 -0
  48. package/styled-system/debug/src__components__Text__Text.stories.ast.json +60 -0
  49. package/styled-system/debug/src__components__Text__Text.stories.css +40 -0
  50. package/styled-system/debug/src__components__Textarea__Textarea.ast.json +50 -0
  51. package/styled-system/debug/src__components__Textarea__Textarea.css +92 -0
  52. package/styled-system/debug/src__components__ThemeSwitcher__ThemeSwitcher.ast.json +42 -0
  53. package/styled-system/debug/src__components__ThemeSwitcher__ThemeSwitcher.css +101 -0
  54. package/styled-system/helpers.js +336 -0
  55. package/styled-system/helpers.mjs +336 -0
  56. package/styled-system/jsx/aspect-ratio.d.ts +10 -0
  57. package/styled-system/jsx/aspect-ratio.js +14 -0
  58. package/styled-system/jsx/aspect-ratio.mjs +14 -0
  59. package/styled-system/jsx/bleed.d.ts +10 -0
  60. package/styled-system/jsx/bleed.js +14 -0
  61. package/styled-system/jsx/bleed.mjs +14 -0
  62. package/styled-system/jsx/box.d.ts +10 -0
  63. package/styled-system/jsx/box.mjs +14 -0
  64. package/styled-system/jsx/center.d.ts +10 -0
  65. package/styled-system/jsx/center.js +14 -0
  66. package/styled-system/jsx/center.mjs +14 -0
  67. package/styled-system/jsx/circle.d.ts +10 -0
  68. package/styled-system/jsx/circle.js +14 -0
  69. package/styled-system/jsx/circle.mjs +14 -0
  70. package/styled-system/jsx/container.d.ts +10 -0
  71. package/styled-system/jsx/container.js +14 -0
  72. package/styled-system/jsx/container.mjs +14 -0
  73. package/styled-system/jsx/cq.d.ts +10 -0
  74. package/styled-system/jsx/cq.js +14 -0
  75. package/styled-system/jsx/cq.mjs +14 -0
  76. package/styled-system/jsx/divider.d.ts +10 -0
  77. package/styled-system/jsx/divider.mjs +14 -0
  78. package/styled-system/jsx/factory-helper.js +22 -0
  79. package/styled-system/jsx/factory-helper.mjs +22 -0
  80. package/styled-system/jsx/factory.d.ts +3 -0
  81. package/styled-system/jsx/factory.js +80 -0
  82. package/styled-system/jsx/factory.mjs +80 -0
  83. package/styled-system/jsx/flex.d.ts +10 -0
  84. package/styled-system/jsx/flex.js +14 -0
  85. package/styled-system/jsx/flex.mjs +14 -0
  86. package/styled-system/jsx/float.d.ts +10 -0
  87. package/styled-system/jsx/float.js +14 -0
  88. package/styled-system/jsx/float.mjs +14 -0
  89. package/styled-system/jsx/grid-item.d.ts +10 -0
  90. package/styled-system/jsx/grid-item.js +14 -0
  91. package/styled-system/jsx/grid-item.mjs +14 -0
  92. package/styled-system/jsx/grid.d.ts +10 -0
  93. package/styled-system/jsx/grid.js +14 -0
  94. package/styled-system/jsx/grid.mjs +14 -0
  95. package/styled-system/jsx/hstack.d.ts +10 -0
  96. package/styled-system/jsx/hstack.js +14 -0
  97. package/styled-system/jsx/hstack.mjs +14 -0
  98. package/styled-system/jsx/icon.d.ts +10 -0
  99. package/styled-system/jsx/icon.js +14 -0
  100. package/styled-system/jsx/icon.mjs +14 -0
  101. package/styled-system/jsx/index.d.ts +23 -0
  102. package/styled-system/jsx/index.js +21 -0
  103. package/styled-system/jsx/index.mjs +21 -0
  104. package/styled-system/jsx/is-valid-prop.d.ts +11 -0
  105. package/styled-system/jsx/is-valid-prop.js +17 -0
  106. package/styled-system/jsx/is-valid-prop.mjs +17 -0
  107. package/styled-system/jsx/link-overlay.d.ts +10 -0
  108. package/styled-system/jsx/link-overlay.js +14 -0
  109. package/styled-system/jsx/link-overlay.mjs +14 -0
  110. package/styled-system/jsx/spacer.d.ts +10 -0
  111. package/styled-system/jsx/spacer.js +14 -0
  112. package/styled-system/jsx/spacer.mjs +14 -0
  113. package/styled-system/jsx/square.d.ts +10 -0
  114. package/styled-system/jsx/square.js +14 -0
  115. package/styled-system/jsx/square.mjs +14 -0
  116. package/styled-system/jsx/stack.d.ts +10 -0
  117. package/styled-system/jsx/stack.js +14 -0
  118. package/styled-system/jsx/stack.mjs +14 -0
  119. package/styled-system/jsx/visually-hidden.d.ts +10 -0
  120. package/styled-system/jsx/visually-hidden.js +14 -0
  121. package/styled-system/jsx/visually-hidden.mjs +14 -0
  122. package/styled-system/jsx/vstack.d.ts +10 -0
  123. package/styled-system/jsx/vstack.js +14 -0
  124. package/styled-system/jsx/vstack.mjs +14 -0
  125. package/styled-system/jsx/wrap.d.ts +10 -0
  126. package/styled-system/jsx/wrap.js +14 -0
  127. package/styled-system/jsx/wrap.mjs +14 -0
  128. package/styled-system/patterns/aspect-ratio.d.ts +21 -0
  129. package/styled-system/patterns/aspect-ratio.js +38 -0
  130. package/styled-system/patterns/aspect-ratio.mjs +38 -0
  131. package/styled-system/patterns/bleed.d.ts +22 -0
  132. package/styled-system/patterns/bleed.js +24 -0
  133. package/styled-system/patterns/bleed.mjs +24 -0
  134. package/styled-system/patterns/box.d.ts +21 -0
  135. package/styled-system/patterns/box.mjs +15 -0
  136. package/styled-system/patterns/center.d.ts +21 -0
  137. package/styled-system/patterns/center.js +21 -0
  138. package/styled-system/patterns/center.mjs +21 -0
  139. package/styled-system/patterns/circle.d.ts +21 -0
  140. package/styled-system/patterns/circle.js +25 -0
  141. package/styled-system/patterns/circle.mjs +25 -0
  142. package/styled-system/patterns/container.d.ts +21 -0
  143. package/styled-system/patterns/container.js +24 -0
  144. package/styled-system/patterns/container.mjs +24 -0
  145. package/styled-system/patterns/cq.d.ts +22 -0
  146. package/styled-system/patterns/cq.js +21 -0
  147. package/styled-system/patterns/cq.mjs +21 -0
  148. package/styled-system/patterns/divider.d.ts +23 -0
  149. package/styled-system/patterns/divider.mjs +25 -0
  150. package/styled-system/patterns/flex.d.ts +27 -0
  151. package/styled-system/patterns/flex.js +26 -0
  152. package/styled-system/patterns/flex.mjs +26 -0
  153. package/styled-system/patterns/float.d.ts +24 -0
  154. package/styled-system/patterns/float.js +52 -0
  155. package/styled-system/patterns/float.mjs +52 -0
  156. package/styled-system/patterns/grid-item.d.ts +26 -0
  157. package/styled-system/patterns/grid-item.js +25 -0
  158. package/styled-system/patterns/grid-item.mjs +25 -0
  159. package/styled-system/patterns/grid.d.ts +25 -0
  160. package/styled-system/patterns/grid.js +27 -0
  161. package/styled-system/patterns/grid.mjs +27 -0
  162. package/styled-system/patterns/hstack.d.ts +22 -0
  163. package/styled-system/patterns/hstack.js +24 -0
  164. package/styled-system/patterns/hstack.mjs +24 -0
  165. package/styled-system/patterns/icon.d.ts +21 -0
  166. package/styled-system/patterns/icon.js +20 -0
  167. package/styled-system/patterns/icon.mjs +20 -0
  168. package/styled-system/patterns/index.d.ts +20 -0
  169. package/styled-system/patterns/index.js +19 -0
  170. package/styled-system/patterns/index.mjs +19 -0
  171. package/styled-system/patterns/link-overlay.d.ts +21 -0
  172. package/styled-system/patterns/link-overlay.js +24 -0
  173. package/styled-system/patterns/link-overlay.mjs +24 -0
  174. package/styled-system/patterns/spacer.d.ts +21 -0
  175. package/styled-system/patterns/spacer.js +21 -0
  176. package/styled-system/patterns/spacer.mjs +21 -0
  177. package/styled-system/patterns/square.d.ts +21 -0
  178. package/styled-system/patterns/square.js +24 -0
  179. package/styled-system/patterns/square.mjs +24 -0
  180. package/styled-system/patterns/stack.d.ts +24 -0
  181. package/styled-system/patterns/stack.js +24 -0
  182. package/styled-system/patterns/stack.mjs +24 -0
  183. package/styled-system/patterns/visually-hidden.d.ts +21 -0
  184. package/styled-system/patterns/visually-hidden.js +18 -0
  185. package/styled-system/patterns/visually-hidden.mjs +18 -0
  186. package/styled-system/patterns/vstack.d.ts +22 -0
  187. package/styled-system/patterns/vstack.js +24 -0
  188. package/styled-system/patterns/vstack.mjs +24 -0
  189. package/styled-system/patterns/wrap.d.ts +25 -0
  190. package/styled-system/patterns/wrap.js +25 -0
  191. package/styled-system/patterns/wrap.mjs +25 -0
  192. package/styled-system/recipes/box.d.ts +28 -0
  193. package/styled-system/recipes/box.js +24 -0
  194. package/styled-system/recipes/box.mjs +24 -0
  195. package/styled-system/recipes/button.d.ts +35 -0
  196. package/styled-system/recipes/button.js +41 -0
  197. package/styled-system/recipes/button.mjs +41 -0
  198. package/styled-system/recipes/checkbox.d.ts +28 -0
  199. package/styled-system/recipes/checkbox.js +40 -0
  200. package/styled-system/recipes/checkbox.mjs +40 -0
  201. package/styled-system/recipes/code.d.ts +28 -0
  202. package/styled-system/recipes/code.js +24 -0
  203. package/styled-system/recipes/code.mjs +24 -0
  204. package/styled-system/recipes/create-recipe.js +82 -0
  205. package/styled-system/recipes/create-recipe.mjs +82 -0
  206. package/styled-system/recipes/divider.d.ts +35 -0
  207. package/styled-system/recipes/divider.js +38 -0
  208. package/styled-system/recipes/divider.mjs +38 -0
  209. package/styled-system/recipes/heading.d.ts +31 -0
  210. package/styled-system/recipes/heading.js +33 -0
  211. package/styled-system/recipes/heading.mjs +33 -0
  212. package/styled-system/recipes/icon-button.d.ts +35 -0
  213. package/styled-system/recipes/icon-button.js +41 -0
  214. package/styled-system/recipes/icon-button.mjs +41 -0
  215. package/styled-system/recipes/index.d.ts +16 -0
  216. package/styled-system/recipes/index.js +15 -0
  217. package/styled-system/recipes/index.mjs +15 -0
  218. package/styled-system/recipes/input.d.ts +31 -0
  219. package/styled-system/recipes/input.js +31 -0
  220. package/styled-system/recipes/input.mjs +31 -0
  221. package/styled-system/recipes/label.d.ts +38 -0
  222. package/styled-system/recipes/label.js +83 -0
  223. package/styled-system/recipes/label.mjs +83 -0
  224. package/styled-system/recipes/link.d.ts +38 -0
  225. package/styled-system/recipes/link.js +83 -0
  226. package/styled-system/recipes/link.mjs +83 -0
  227. package/styled-system/recipes/pre.d.ts +28 -0
  228. package/styled-system/recipes/pre.js +24 -0
  229. package/styled-system/recipes/pre.mjs +24 -0
  230. package/styled-system/recipes/radio.d.ts +28 -0
  231. package/styled-system/recipes/radio.js +40 -0
  232. package/styled-system/recipes/radio.mjs +40 -0
  233. package/styled-system/recipes/spinner.d.ts +31 -0
  234. package/styled-system/recipes/spinner.js +32 -0
  235. package/styled-system/recipes/spinner.mjs +32 -0
  236. package/styled-system/recipes/switchbox.d.ts +28 -0
  237. package/styled-system/recipes/switchbox.mjs +40 -0
  238. package/styled-system/recipes/text.d.ts +37 -0
  239. package/styled-system/recipes/text.js +80 -0
  240. package/styled-system/recipes/text.mjs +80 -0
  241. package/styled-system/recipes/textarea.d.ts +31 -0
  242. package/styled-system/recipes/textarea.js +32 -0
  243. package/styled-system/recipes/textarea.mjs +32 -0
  244. package/styled-system/recipes/textinput.d.ts +32 -0
  245. package/styled-system/recipes/textinput.mjs +35 -0
  246. package/styled-system/styles.css +672 -0
  247. package/styled-system/tokens/index.d.ts +9 -0
  248. package/styled-system/tokens/index.js +1480 -0
  249. package/styled-system/tokens/index.mjs +1480 -0
  250. package/styled-system/tokens/tokens.d.ts +60 -0
  251. package/styled-system/types/composition.d.ts +164 -0
  252. package/styled-system/types/conditions.d.ts +306 -0
  253. package/styled-system/types/csstype.d.ts +21298 -0
  254. package/styled-system/types/global.d.ts +20 -0
  255. package/styled-system/types/index.d.ts +8 -0
  256. package/styled-system/types/jsx.d.ts +52 -0
  257. package/styled-system/types/parts.d.ts +8 -0
  258. package/styled-system/types/pattern.d.ts +78 -0
  259. package/styled-system/types/prop-type.d.ts +235 -0
  260. package/styled-system/types/recipe.d.ts +181 -0
  261. package/styled-system/types/selectors.d.ts +59 -0
  262. package/styled-system/types/static-css.d.ts +56 -0
  263. package/styled-system/types/style-props.d.ts +7468 -0
  264. package/styled-system/types/system-types.d.ts +109 -0
  265. package/.github/CODEOWNERS +0 -1
  266. package/.husky/task-runner.json +0 -10
  267. package/.nvmrc +0 -1
  268. package/.prettierrc +0 -8
  269. package/.storybook/main.ts +0 -18
  270. package/.storybook/preview-body.html +0 -0
  271. package/.storybook/preview-head.tsx +0 -1
  272. package/.storybook/preview.tsx +0 -21
  273. package/index.html +0 -13
  274. package/panda.config.ts +0 -201
  275. package/postcss.config.cjs +0 -5
  276. package/src/App.tsx +0 -429
  277. package/src/contexts/ThemeContext.tsx +0 -77
  278. package/src/main.tsx +0 -10
  279. package/src/recipes/box.ts +0 -16
  280. package/src/recipes/button.ts +0 -220
  281. package/src/recipes/checkbox.ts +0 -88
  282. package/src/recipes/code.ts +0 -37
  283. package/src/recipes/divider.ts +0 -40
  284. package/src/recipes/index.ts +0 -10
  285. package/src/recipes/input.ts +0 -56
  286. package/src/recipes/radio.ts +0 -71
  287. package/src/recipes/spinner.ts +0 -42
  288. package/src/recipes/text.ts +0 -185
  289. package/src/recipes/textarea.ts +0 -77
  290. package/src/styles/conditions.ts +0 -108
  291. package/src/styles/font-imports.css +0 -35
  292. package/src/styles/globalStyle.ts +0 -85
  293. package/src/styles/index.css +0 -3
  294. package/src/styles/semanticTokens.ts +0 -110
  295. package/src/styles/tokens.ts +0 -580
  296. package/src/vite-env.d.ts +0 -1
  297. package/tsconfig.json +0 -33
  298. package/vite.config.ts +0 -39
@@ -0,0 +1,42 @@
1
+ {
2
+ "css": [],
3
+ "cva": [],
4
+ "sva": [],
5
+ "jsx": [
6
+ {
7
+ "type": "jsx",
8
+ "name": "Icon",
9
+ "box": {
10
+ "type": "map",
11
+ "value": {},
12
+ "node": "JsxSelfClosingElement",
13
+ "line": 18,
14
+ "column": 7
15
+ },
16
+ "data": [
17
+ {}
18
+ ]
19
+ }
20
+ ],
21
+ "recipe": {
22
+ "iconButton": [
23
+ {
24
+ "type": "jsx-recipe",
25
+ "name": "IconButton",
26
+ "box": {
27
+ "type": "map",
28
+ "value": {},
29
+ "node": "JsxOpeningElement",
30
+ "line": 13,
31
+ "column": 5
32
+ },
33
+ "data": [
34
+ {
35
+ "variant": "ghost"
36
+ }
37
+ ]
38
+ }
39
+ ]
40
+ },
41
+ "pattern": {}
42
+ }
@@ -0,0 +1,101 @@
1
+ @layer recipes {
2
+ @layer _base {
3
+ .icon-button {
4
+ appearance: none;
5
+ -webkit-appearance: none;
6
+ min-width: var(--sizes-0);
7
+ -webkit-user-select: none;
8
+ user-select: none;
9
+ vertical-align: middle;
10
+ display: flex;
11
+ gap: var(--spacing-4);
12
+ border-radius: var(--radii-4);
13
+ outline-offset: var(--spacing-1);
14
+ text-decoration: none;
15
+ white-space: nowrap;
16
+ cursor: pointer;
17
+ --transition-duration: var(--durations-fast);
18
+ transition-duration: var(--durations-fast);
19
+ --transition-prop: background, border-color, color, box-shadow;
20
+ transition-property: background, border-color, color, box-shadow;
21
+ --transition-easing: var(--easings-default);
22
+ transition-timing-function: var(--easings-default);
23
+ align-items: center;
24
+ font-family: var(--fonts-sans);
25
+ font-size: var(--font-sizes-16);
26
+ font-weight: var(--font-weights-medium);
27
+ line-height: var(--line-heights-default);
28
+ border-width: 1px;
29
+ border-style: solid;
30
+ border-color: var(--colors-transparent);
31
+ outline-width: 2px;
32
+ outline-style: solid;
33
+ outline-color: var(--colors-transparent);
34
+ }
35
+
36
+ .icon-button:is(:disabled, [disabled], [data-disabled]) {
37
+ opacity: 0.4;
38
+ cursor: not-allowed;
39
+ }
40
+
41
+ .icon-button svg {
42
+ fill: var(--colors-current);
43
+ width: var(--sizes-24);
44
+ height: var(--sizes-24);
45
+ }
46
+
47
+ .icon-button:is(:focus-visible, [data-focus-visible]) {
48
+ outline-color: var(--colors-slate-80);
49
+ }
50
+
51
+ [data-color-mode=dark] .icon-button:is(:focus-visible, [data-focus-visible]) {
52
+ outline-color: var(--colors-slate-5);
53
+ }
54
+ }
55
+
56
+ .icon-button--variant_ghost {
57
+ background: var(--colors-transparent);
58
+ color: var(--colors-slate-90);
59
+ }
60
+
61
+ [data-color-mode=dark] .icon-button--variant_ghost {
62
+ color: var(--colors-slate-5);
63
+ }
64
+
65
+ .icon-button--variant_ghost:is([data-selected]) {
66
+ background: var(--colors-slate-90);
67
+ color: var(--colors-slate-5);
68
+ border-color: var(--colors-transparent);
69
+ }
70
+
71
+ [data-color-mode=dark] .icon-button--variant_ghost:is([data-selected]) {
72
+ background: var(--colors-slate-5);
73
+ color: var(--colors-slate-90);
74
+ }
75
+
76
+ .icon-button--variant_ghost:is(:hover, [data-hover]) {
77
+ background: var(--colors-slate-10);
78
+ }
79
+
80
+ [data-color-mode=dark] .icon-button--variant_ghost:is(:hover, [data-hover]) {
81
+ background: var(--colors-slate-60);
82
+ }
83
+
84
+ .icon-button--variant_ghost:is(:active, [data-active]) {
85
+ background: var(--colors-slate-20);
86
+ border-color: var(--colors-transparent);
87
+ }
88
+
89
+ [data-color-mode=dark] .icon-button--variant_ghost:is(:active, [data-active]) {
90
+ background: var(--colors-slate-70);
91
+ }
92
+
93
+ .icon-button--variant_ghost:is(:disabled, [disabled], [data-disabled]):is(:hover, [data-hover]) {
94
+ background: var(--colors-transparent);
95
+ }
96
+
97
+ .icon-button--size_standard {
98
+ padding: var(--spacing-3);
99
+ font-size: var(--font-sizes-16);
100
+ }
101
+ }
@@ -0,0 +1,336 @@
1
+ // src/assert.ts
2
+ function isObject(value) {
3
+ return typeof value === "object" && value != null && !Array.isArray(value);
4
+ }
5
+ var isObjectOrArray = (obj) => typeof obj === "object" && obj !== null;
6
+
7
+ // src/compact.ts
8
+ function compact(value) {
9
+ return Object.fromEntries(Object.entries(value ?? {}).filter(([_, value2]) => value2 !== void 0));
10
+ }
11
+
12
+ // src/condition.ts
13
+ var isBaseCondition = (v) => v === "base";
14
+ function filterBaseConditions(c) {
15
+ return c.slice().filter((v) => !isBaseCondition(v));
16
+ }
17
+
18
+ // src/hash.ts
19
+ function toChar(code) {
20
+ return String.fromCharCode(code + (code > 25 ? 39 : 97));
21
+ }
22
+ function toName(code) {
23
+ let name = "";
24
+ let x;
25
+ for (x = Math.abs(code); x > 52; x = x / 52 | 0)
26
+ name = toChar(x % 52) + name;
27
+ return toChar(x % 52) + name;
28
+ }
29
+ function toPhash(h, x) {
30
+ let i = x.length;
31
+ while (i)
32
+ h = h * 33 ^ x.charCodeAt(--i);
33
+ return h;
34
+ }
35
+ function toHash(value) {
36
+ return toName(toPhash(5381, value) >>> 0);
37
+ }
38
+
39
+ // src/important.ts
40
+ var importantRegex = /\s*!(important)?/i;
41
+ function isImportant(value) {
42
+ return typeof value === "string" ? importantRegex.test(value) : false;
43
+ }
44
+ function withoutImportant(value) {
45
+ return typeof value === "string" ? value.replace(importantRegex, "").trim() : value;
46
+ }
47
+ function withoutSpace(str) {
48
+ return typeof str === "string" ? str.replaceAll(" ", "_") : str;
49
+ }
50
+
51
+ // src/memo.ts
52
+ var memo = (fn) => {
53
+ const cache = /* @__PURE__ */ new Map();
54
+ const get = (...args) => {
55
+ const key = JSON.stringify(args);
56
+ if (cache.has(key)) {
57
+ return cache.get(key);
58
+ }
59
+ const result = fn(...args);
60
+ cache.set(key, result);
61
+ return result;
62
+ };
63
+ return get;
64
+ };
65
+
66
+ // src/merge-props.ts
67
+ function mergeProps(...sources) {
68
+ return sources.reduce((prev, obj) => {
69
+ if (!obj)
70
+ return prev;
71
+ Object.keys(obj).forEach((key) => {
72
+ const prevValue = prev[key];
73
+ const value = obj[key];
74
+ if (isObject(prevValue) && isObject(value)) {
75
+ prev[key] = mergeProps(prevValue, value);
76
+ } else {
77
+ prev[key] = value;
78
+ }
79
+ });
80
+ return prev;
81
+ }, {});
82
+ }
83
+
84
+ // src/walk-object.ts
85
+ var isNotNullish = (element) => element != null;
86
+ function walkObject(target, predicate, options = {}) {
87
+ const { stop, getKey } = options;
88
+ function inner(value, path = []) {
89
+ if (isObjectOrArray(value)) {
90
+ const result = {};
91
+ for (const [prop, child] of Object.entries(value)) {
92
+ const key = getKey?.(prop, child) ?? prop;
93
+ const childPath = [...path, key];
94
+ if (stop?.(value, childPath)) {
95
+ return predicate(value, path);
96
+ }
97
+ const next = inner(child, childPath);
98
+ if (isNotNullish(next)) {
99
+ result[key] = next;
100
+ }
101
+ }
102
+ return result;
103
+ }
104
+ return predicate(value, path);
105
+ }
106
+ return inner(target);
107
+ }
108
+ function mapObject(obj, fn) {
109
+ if (Array.isArray(obj))
110
+ return obj.map((value) => fn(value));
111
+ if (!isObject(obj))
112
+ return fn(obj);
113
+ return walkObject(obj, (value) => fn(value));
114
+ }
115
+
116
+ // src/normalize-style-object.ts
117
+ function toResponsiveObject(values, breakpoints) {
118
+ return values.reduce(
119
+ (acc, current, index) => {
120
+ const key = breakpoints[index];
121
+ if (current != null) {
122
+ acc[key] = current;
123
+ }
124
+ return acc;
125
+ },
126
+ {}
127
+ );
128
+ }
129
+ function normalizeStyleObject(styles, context, shorthand = true) {
130
+ const { utility, conditions } = context;
131
+ const { hasShorthand, resolveShorthand } = utility;
132
+ return walkObject(
133
+ styles,
134
+ (value) => {
135
+ return Array.isArray(value) ? toResponsiveObject(value, conditions.breakpoints.keys) : value;
136
+ },
137
+ {
138
+ stop: (value) => Array.isArray(value),
139
+ getKey: shorthand ? (prop) => hasShorthand ? resolveShorthand(prop) : prop : void 0
140
+ }
141
+ );
142
+ }
143
+
144
+ // src/classname.ts
145
+ var fallbackCondition = {
146
+ shift: (v) => v,
147
+ finalize: (v) => v,
148
+ breakpoints: { keys: [] }
149
+ };
150
+ var sanitize = (value) => typeof value === "string" ? value.replaceAll(/[\n\s]+/g, " ") : value;
151
+ function createCss(context) {
152
+ const { utility, hash, conditions: conds = fallbackCondition } = context;
153
+ const formatClassName = (str) => [utility.prefix, str].filter(Boolean).join("-");
154
+ const hashFn = (conditions, className) => {
155
+ let result;
156
+ if (hash) {
157
+ const baseArray = [...conds.finalize(conditions), className];
158
+ result = formatClassName(utility.toHash(baseArray, toHash));
159
+ } else {
160
+ const baseArray = [...conds.finalize(conditions), formatClassName(className)];
161
+ result = baseArray.join(":");
162
+ }
163
+ return result;
164
+ };
165
+ return memo(({ base, ...styles } = {}) => {
166
+ const styleObject = Object.assign(styles, base);
167
+ const normalizedObject = normalizeStyleObject(styleObject, context);
168
+ const classNames = /* @__PURE__ */ new Set();
169
+ walkObject(normalizedObject, (value, paths) => {
170
+ if (value == null)
171
+ return;
172
+ const important = isImportant(value);
173
+ const [prop, ...allConditions] = conds.shift(paths);
174
+ const conditions = filterBaseConditions(allConditions);
175
+ const transformed = utility.transform(prop, withoutImportant(sanitize(value)));
176
+ let className = hashFn(conditions, transformed.className);
177
+ if (important)
178
+ className = `${className}!`;
179
+ classNames.add(className);
180
+ });
181
+ return Array.from(classNames).join(" ");
182
+ });
183
+ }
184
+ function compactStyles(...styles) {
185
+ return styles.flat().filter((style) => isObject(style) && Object.keys(compact(style)).length > 0);
186
+ }
187
+ function createMergeCss(context) {
188
+ function resolve(styles) {
189
+ const allStyles = compactStyles(...styles);
190
+ if (allStyles.length === 1)
191
+ return allStyles;
192
+ return allStyles.map((style) => normalizeStyleObject(style, context));
193
+ }
194
+ function mergeCss(...styles) {
195
+ return mergeProps(...resolve(styles));
196
+ }
197
+ function assignCss(...styles) {
198
+ return Object.assign({}, ...resolve(styles));
199
+ }
200
+ return { mergeCss: memo(mergeCss), assignCss };
201
+ }
202
+
203
+ // src/hypenate-property.ts
204
+ var wordRegex = /([A-Z])/g;
205
+ var msRegex = /^ms-/;
206
+ var hypenateProperty = memo((property) => {
207
+ if (property.startsWith("--"))
208
+ return property;
209
+ return property.replace(wordRegex, "-$1").replace(msRegex, "-ms-").toLowerCase();
210
+ });
211
+
212
+ // src/is-css-function.ts
213
+ var fns = ["min", "max", "clamp", "calc"];
214
+ var fnRegExp = new RegExp(`^(${fns.join("|")})\\(.*\\)`);
215
+ var isCssFunction = (v) => typeof v === "string" && fnRegExp.test(v);
216
+
217
+ // src/is-css-unit.ts
218
+ var lengthUnits = "cm,mm,Q,in,pc,pt,px,em,ex,ch,rem,lh,rlh,vw,vh,vmin,vmax,vb,vi,svw,svh,lvw,lvh,dvw,dvh,cqw,cqh,cqi,cqb,cqmin,cqmax,%";
219
+ var lengthUnitsPattern = `(?:${lengthUnits.split(",").join("|")})`;
220
+ var lengthRegExp = new RegExp(`^[+-]?[0-9]*.?[0-9]+(?:[eE][+-]?[0-9]+)?${lengthUnitsPattern}$`);
221
+ var isCssUnit = (v) => typeof v === "string" && lengthRegExp.test(v);
222
+
223
+ // src/is-css-var.ts
224
+ var isCssVar = (v) => typeof v === "string" && /^var\(--.+\)$/.test(v);
225
+
226
+ // src/pattern-fns.ts
227
+ var patternFns = {
228
+ map: mapObject,
229
+ isCssFunction,
230
+ isCssVar,
231
+ isCssUnit
232
+ };
233
+ var getPatternStyles = (pattern, styles) => {
234
+ if (!pattern?.defaultValues)
235
+ return styles;
236
+ const defaults = typeof pattern.defaultValues === "function" ? pattern.defaultValues(styles) : pattern.defaultValues;
237
+ return Object.assign({}, defaults, compact(styles));
238
+ };
239
+
240
+ // src/slot.ts
241
+ var getSlotRecipes = (recipe = {}) => {
242
+ const init = (slot) => ({
243
+ className: [recipe.className, slot].filter(Boolean).join("__"),
244
+ base: recipe.base?.[slot] ?? {},
245
+ variants: {},
246
+ defaultVariants: recipe.defaultVariants ?? {},
247
+ compoundVariants: recipe.compoundVariants ? getSlotCompoundVariant(recipe.compoundVariants, slot) : []
248
+ });
249
+ const slots = recipe.slots ?? [];
250
+ const recipeParts = slots.map((slot) => [slot, init(slot)]);
251
+ for (const [variantsKey, variantsSpec] of Object.entries(recipe.variants ?? {})) {
252
+ for (const [variantKey, variantSpec] of Object.entries(variantsSpec)) {
253
+ recipeParts.forEach(([slot, slotRecipe]) => {
254
+ slotRecipe.variants[variantsKey] ??= {};
255
+ slotRecipe.variants[variantsKey][variantKey] = variantSpec[slot] ?? {};
256
+ });
257
+ }
258
+ }
259
+ return Object.fromEntries(recipeParts);
260
+ };
261
+ var getSlotCompoundVariant = (compoundVariants, slotName) => compoundVariants.filter((compoundVariant) => compoundVariant.css[slotName]).map((compoundVariant) => ({ ...compoundVariant, css: compoundVariant.css[slotName] }));
262
+
263
+ // src/split-props.ts
264
+ function splitProps(props, ...keys) {
265
+ const descriptors = Object.getOwnPropertyDescriptors(props);
266
+ const dKeys = Object.keys(descriptors);
267
+ const split = (k) => {
268
+ const clone = {};
269
+ for (let i = 0; i < k.length; i++) {
270
+ const key = k[i];
271
+ if (descriptors[key]) {
272
+ Object.defineProperty(clone, key, descriptors[key]);
273
+ delete descriptors[key];
274
+ }
275
+ }
276
+ return clone;
277
+ };
278
+ const fn = (key) => split(Array.isArray(key) ? key : dKeys.filter(key));
279
+ return keys.map(fn).concat(split(dKeys));
280
+ }
281
+
282
+ // src/uniq.ts
283
+ var uniq = (...items) => {
284
+ const set = items.reduce((acc, currItems) => {
285
+ if (currItems) {
286
+ currItems.forEach((item) => acc.add(item));
287
+ }
288
+ return acc;
289
+ }, /* @__PURE__ */ new Set([]));
290
+ return Array.from(set);
291
+ };
292
+ export {
293
+ compact,
294
+ createCss,
295
+ createMergeCss,
296
+ filterBaseConditions,
297
+ getPatternStyles,
298
+ getSlotCompoundVariant,
299
+ getSlotRecipes,
300
+ hypenateProperty,
301
+ isBaseCondition,
302
+ isObject,
303
+ mapObject,
304
+ memo,
305
+ mergeProps,
306
+ patternFns,
307
+ splitProps,
308
+ toHash,
309
+ uniq,
310
+ walkObject,
311
+ withoutSpace
312
+ };
313
+
314
+
315
+
316
+ // src/normalize-html.ts
317
+ var htmlProps = ["htmlSize", "htmlTranslate", "htmlWidth", "htmlHeight"];
318
+ function convert(key) {
319
+ return htmlProps.includes(key) ? key.replace("html", "").toLowerCase() : key;
320
+ }
321
+ function normalizeHTMLProps(props) {
322
+ return Object.fromEntries(Object.entries(props).map(([key, value]) => [convert(key), value]));
323
+ }
324
+ normalizeHTMLProps.keys = htmlProps;
325
+ export {
326
+ normalizeHTMLProps
327
+ };
328
+
329
+
330
+ export function __spreadValues(a, b) {
331
+ return { ...a, ...b }
332
+ }
333
+
334
+ export function __objRest(source, exclude) {
335
+ return Object.fromEntries(Object.entries(source).filter(([key]) => !exclude.includes(key)))
336
+ }