@svadmin/ui 0.73.0 → 0.75.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 (303) hide show
  1. package/README.md +53 -28
  2. package/dist/app.css +3733 -4119
  3. package/dist/app.theme.css +3733 -4119
  4. package/dist/component-registry.d.ts +14977 -0
  5. package/dist/component-registry.js +216 -0
  6. package/dist/components/AboutSettings.svelte +7 -1
  7. package/dist/components/AboutSettings.svelte.d.ts +4 -1
  8. package/dist/components/ActivityFeed.svelte +9 -3
  9. package/dist/components/ActivityFeed.svelte.d.ts +3 -0
  10. package/dist/components/AdminApp.svelte +24 -15
  11. package/dist/components/AdminApp.svelte.d.ts +6 -0
  12. package/dist/components/ApiSettings.svelte +41 -5
  13. package/dist/components/ApprovalCenter.svelte +283 -0
  14. package/dist/components/ApprovalCenter.svelte.d.ts +10 -0
  15. package/dist/components/AuditLogViewer.svelte +3 -1
  16. package/dist/components/AutoForm.svelte +33 -3
  17. package/dist/components/AutoForm.svelte.d.ts +1 -0
  18. package/dist/components/AutoTable.svelte +610 -47
  19. package/dist/components/AutoTable.svelte.d.ts +17 -1
  20. package/dist/components/BoundRecordDetailDrawer.svelte +9 -0
  21. package/dist/components/BoundRecordDetailDrawer.svelte.d.ts +2 -0
  22. package/dist/components/Breadcrumbs.svelte +11 -1
  23. package/dist/components/CancelTaskButton.svelte +12 -42
  24. package/dist/components/ColorPicker.svelte +73 -0
  25. package/dist/components/ColorPicker.svelte.d.ts +15 -0
  26. package/dist/components/ComboboxField.svelte +114 -27
  27. package/dist/components/ComboboxField.svelte.d.ts +1 -0
  28. package/dist/components/DashboardView.svelte +99 -0
  29. package/dist/components/DashboardView.svelte.d.ts +14 -0
  30. package/dist/components/DatePicker.svelte +10 -0
  31. package/dist/components/DatePicker.svelte.d.ts +6 -0
  32. package/dist/components/DateRangeInput.svelte +85 -5
  33. package/dist/components/DateRangeInput.svelte.d.ts +10 -0
  34. package/dist/components/DateRangePicker.svelte +10 -0
  35. package/dist/components/DateRangePicker.svelte.d.ts +6 -0
  36. package/dist/components/DateTimeInput.svelte +85 -16
  37. package/dist/components/DateTimeInput.svelte.d.ts +19 -11
  38. package/dist/components/DateTimePicker.svelte +10 -0
  39. package/dist/components/DateTimePicker.svelte.d.ts +6 -0
  40. package/dist/components/DevTools.svelte +34 -26
  41. package/dist/components/DevframePanel.svelte +123 -0
  42. package/dist/components/DevframePanel.svelte.d.ts +3 -0
  43. package/dist/components/ErrorSummary.svelte +52 -0
  44. package/dist/components/ErrorSummary.svelte.d.ts +14 -0
  45. package/dist/components/FieldRenderer.svelte +82 -81
  46. package/dist/components/FileUpload.svelte +214 -52
  47. package/dist/components/FileUpload.svelte.d.ts +11 -0
  48. package/dist/components/FilterBuilder.svelte +88 -66
  49. package/dist/components/FilterCollectionInput.svelte +80 -0
  50. package/dist/components/FilterCollectionInput.svelte.d.ts +10 -0
  51. package/dist/components/GanttChart.svelte +66 -14
  52. package/dist/components/GanttChart.svelte.d.ts +6 -0
  53. package/dist/components/Header.svelte +18 -2
  54. package/dist/components/ImportWizard.svelte +339 -17
  55. package/dist/components/ImportWizard.svelte.d.ts +11 -0
  56. package/dist/components/JsonSchemaForm.svelte +120 -52
  57. package/dist/components/JsonSchemaForm.svelte.d.ts +7 -1
  58. package/dist/components/KanbanBoard.svelte +195 -40
  59. package/dist/components/KanbanBoard.svelte.d.ts +9 -2
  60. package/dist/components/Layout.svelte +4 -2
  61. package/dist/components/LazyAutoForm.svelte +28 -0
  62. package/dist/components/LazyAutoForm.svelte.d.ts +8 -0
  63. package/dist/components/LazyAutoTable.svelte +28 -0
  64. package/dist/components/LazyAutoTable.svelte.d.ts +8 -0
  65. package/dist/components/LazyPage.svelte +3 -3
  66. package/dist/components/LazyPage.svelte.d.ts +2 -2
  67. package/dist/components/LazySettingsPage.svelte +28 -0
  68. package/dist/components/LazySettingsPage.svelte.d.ts +8 -0
  69. package/dist/components/LazyShowPage.svelte +28 -0
  70. package/dist/components/LazyShowPage.svelte.d.ts +8 -0
  71. package/dist/components/ListPage.svelte +5 -1
  72. package/dist/components/ListPage.svelte.d.ts +3 -0
  73. package/dist/components/LoginPage.svelte +1 -1
  74. package/dist/components/MultiTabKeepAlive.svelte +11 -6
  75. package/dist/components/NotificationsSettings.svelte +69 -2
  76. package/dist/components/NotificationsSettings.svelte.d.ts +25 -1
  77. package/dist/components/PasswordInput.svelte +3 -3
  78. package/dist/components/PasswordInput.svelte.d.ts +2 -1
  79. package/dist/components/PermissionMatrix.svelte +20 -1
  80. package/dist/components/PivotExportButton.svelte +157 -0
  81. package/dist/components/PivotExportButton.svelte.d.ts +16 -0
  82. package/dist/components/PivotTable.svelte +229 -74
  83. package/dist/components/PivotTable.svelte.d.ts +19 -2
  84. package/dist/components/RadioGroup.svelte +121 -0
  85. package/dist/components/RadioGroup.svelte.d.ts +43 -0
  86. package/dist/components/RangeSlider.svelte +127 -0
  87. package/dist/components/RangeSlider.svelte.d.ts +22 -0
  88. package/dist/components/Rate.svelte +121 -0
  89. package/dist/components/Rate.svelte.d.ts +16 -0
  90. package/dist/components/RecordDetailDrawer.svelte +4 -2
  91. package/dist/components/RecordDetailDrawer.svelte.d.ts +2 -0
  92. package/dist/components/RelationPicker.svelte +341 -0
  93. package/dist/components/RelationPicker.svelte.d.ts +26 -0
  94. package/dist/components/ResourceOperationsPage.svelte +23 -19
  95. package/dist/components/ResourceOperationsPage.svelte.d.ts +2 -2
  96. package/dist/components/RetryTaskButton.svelte +12 -42
  97. package/dist/components/SecuritySettings.svelte +29 -5
  98. package/dist/components/SegmentedControl.svelte +145 -0
  99. package/dist/components/SegmentedControl.svelte.d.ts +38 -0
  100. package/dist/components/SettingsPage.svelte +3 -1
  101. package/dist/components/SettingsPage.svelte.d.ts +1 -0
  102. package/dist/components/ShowPage.svelte +18 -3
  103. package/dist/components/ShowPage.svelte.d.ts +3 -0
  104. package/dist/components/Sidebar.svelte +2 -2
  105. package/dist/components/Slider.svelte +100 -0
  106. package/dist/components/Slider.svelte.d.ts +19 -0
  107. package/dist/components/SpreadsheetView.svelte +1213 -95
  108. package/dist/components/SpreadsheetView.svelte.d.ts +19 -0
  109. package/dist/components/TagsInput.svelte +178 -0
  110. package/dist/components/TagsInput.svelte.d.ts +17 -0
  111. package/dist/components/TimePicker.svelte +10 -0
  112. package/dist/components/TimePicker.svelte.d.ts +6 -0
  113. package/dist/components/TooltipButton.svelte +3 -4
  114. package/dist/components/TreeSelect.svelte +267 -53
  115. package/dist/components/TreeSelect.svelte.d.ts +3 -0
  116. package/dist/components/TreeTable.svelte +484 -82
  117. package/dist/components/TreeTable.svelte.d.ts +24 -1
  118. package/dist/components/TwoFactorAuthPage.svelte +85 -48
  119. package/dist/components/TwoFactorAuthPage.svelte.d.ts +12 -1
  120. package/dist/components/VirtualTable.svelte +116 -20
  121. package/dist/components/VirtualTable.svelte.d.ts +5 -0
  122. package/dist/components/account/CompanyProfilePage.svelte +74 -38
  123. package/dist/components/account/GetStartedPage.svelte +2 -1
  124. package/dist/components/account/ImportMembersPage.svelte +22 -167
  125. package/dist/components/account/ImportMembersPage.svelte.d.ts +4 -1
  126. package/dist/components/account/MemberDirectory.svelte +156 -0
  127. package/dist/components/account/MemberDirectory.svelte.d.ts +19 -0
  128. package/dist/components/account/MembersStarterPage.svelte +9 -55
  129. package/dist/components/account/MembersStarterPage.svelte.d.ts +5 -1
  130. package/dist/components/account/SecurityLogPage.svelte +4 -1
  131. package/dist/components/account/SettingsPlainPage.svelte +7 -38
  132. package/dist/components/account/SettingsPlainPage.svelte.d.ts +4 -1
  133. package/dist/components/account/SettingsSidebarPage.svelte +7 -20
  134. package/dist/components/account/TeamMembersPage.svelte +4 -20
  135. package/dist/components/account/TeamMembersPage.svelte.d.ts +5 -1
  136. package/dist/components/account/UserProfilePage.svelte +3 -25
  137. package/dist/components/account/UserProfilePage.svelte.d.ts +17 -2
  138. package/dist/components/buttons/ExportButton.svelte +56 -12
  139. package/dist/components/buttons/ExportButton.svelte.d.ts +11 -0
  140. package/dist/components/content/ContentPageHeader.svelte +1 -1
  141. package/dist/components/content/ContentPageShell.svelte +1 -1
  142. package/dist/components/content/MetricBlock.svelte +1 -1
  143. package/dist/components/content/PageToolbar.svelte +1 -1
  144. package/dist/components/content/ReferenceNotice.svelte +5 -0
  145. package/dist/components/content/ReferenceNotice.svelte.d.ts +18 -0
  146. package/dist/components/content/SectionHeader.svelte +1 -1
  147. package/dist/components/content/SettingsFieldRow.svelte +1 -1
  148. package/dist/components/content/SettingsGroup.svelte +1 -1
  149. package/dist/components/content/StatusBadge.svelte +1 -1
  150. package/dist/components/content/WorkspaceLayout.svelte +1 -1
  151. package/dist/components/export-reference.d.ts +2 -0
  152. package/dist/components/export-reference.js +9 -0
  153. package/dist/components/fieldComponentMap.js +2 -5
  154. package/dist/components/fields/DateField.svelte +12 -13
  155. package/dist/components/fields/MarkdownField.svelte +14 -5
  156. package/dist/components/fields/date-display.d.ts +6 -0
  157. package/dist/components/fields/date-display.js +24 -0
  158. package/dist/components/network/TeamCrewTablePage.svelte +6 -1
  159. package/dist/components/network/UserCardsNFTPage.svelte +2 -0
  160. package/dist/components/profile/PublicProfilePage.svelte +2 -0
  161. package/dist/components/saved-list-views.d.ts +74 -1
  162. package/dist/components/saved-list-views.js +191 -3
  163. package/dist/components/table-contract.d.ts +12 -1
  164. package/dist/components/task-action.svelte.d.ts +13 -0
  165. package/dist/components/task-action.svelte.js +73 -0
  166. package/dist/components/ui/DesignSystemShowcase.svelte +164 -0
  167. package/dist/components/ui/DesignSystemShowcase.svelte.d.ts +3 -0
  168. package/dist/components/ui/badge/badge-variants.d.ts +3 -2
  169. package/dist/components/ui/badge/badge-variants.js +2 -3
  170. package/dist/components/ui/badge/badge.svelte +3 -0
  171. package/dist/components/ui/badge/badge.svelte.d.ts +1 -0
  172. package/dist/components/ui/button/button-variants.d.ts +5 -4
  173. package/dist/components/ui/button/button-variants.js +7 -5
  174. package/dist/components/ui/checkbox/checkbox.svelte +5 -1
  175. package/dist/components/ui/checkbox/checkbox.svelte.d.ts +5 -1
  176. package/dist/components/ui/dropdown-menu/dropdown-menu-trigger.svelte +1 -2
  177. package/dist/components/ui/input/input.svelte +7 -2
  178. package/dist/components/ui/input/input.svelte.d.ts +4 -1
  179. package/dist/components/ui/select/select.svelte +4 -1
  180. package/dist/components/ui/select/select.svelte.d.ts +2 -1
  181. package/dist/components/ui/textarea/textarea.svelte +2 -2
  182. package/dist/components.css +33 -2
  183. package/dist/date-input-policy.d.ts +4 -0
  184. package/dist/date-input-policy.js +35 -0
  185. package/dist/design-system-components.d.ts +100 -0
  186. package/dist/design-system-components.js +101 -0
  187. package/dist/design-system.js +1 -1
  188. package/dist/devtools-bridge.d.ts +80 -0
  189. package/dist/devtools-bridge.js +92 -0
  190. package/dist/editor-config.svelte.d.ts +4 -2
  191. package/dist/index.d.ts +37 -2
  192. package/dist/index.js +23 -2
  193. package/dist/recipes.d.ts +960 -4
  194. package/dist/recipes.js +264 -4
  195. package/dist/tree-table-model.d.ts +24 -0
  196. package/dist/tree-table-model.js +111 -0
  197. package/dist/types.d.ts +4 -4
  198. package/package.json +22 -10
  199. package/dist/styled-system/css/conditions.js +0 -36
  200. package/dist/styled-system/css/css.d.ts +0 -22
  201. package/dist/styled-system/css/css.js +0 -45
  202. package/dist/styled-system/css/cva.d.ts +0 -6
  203. package/dist/styled-system/css/cva.js +0 -87
  204. package/dist/styled-system/css/cx.d.ts +0 -5
  205. package/dist/styled-system/css/cx.js +0 -15
  206. package/dist/styled-system/css/index.d.ts +0 -5
  207. package/dist/styled-system/css/index.js +0 -4
  208. package/dist/styled-system/css/sva.d.ts +0 -4
  209. package/dist/styled-system/css/sva.js +0 -46
  210. package/dist/styled-system/helpers.js +0 -316
  211. package/dist/styled-system/patterns/aspect-ratio.d.ts +0 -20
  212. package/dist/styled-system/patterns/aspect-ratio.js +0 -38
  213. package/dist/styled-system/patterns/bleed.d.ts +0 -21
  214. package/dist/styled-system/patterns/bleed.js +0 -24
  215. package/dist/styled-system/patterns/box.d.ts +0 -20
  216. package/dist/styled-system/patterns/box.js +0 -15
  217. package/dist/styled-system/patterns/center.d.ts +0 -20
  218. package/dist/styled-system/patterns/center.js +0 -21
  219. package/dist/styled-system/patterns/circle.d.ts +0 -20
  220. package/dist/styled-system/patterns/circle.js +0 -25
  221. package/dist/styled-system/patterns/container.d.ts +0 -20
  222. package/dist/styled-system/patterns/container.js +0 -21
  223. package/dist/styled-system/patterns/cq.d.ts +0 -21
  224. package/dist/styled-system/patterns/cq.js +0 -21
  225. package/dist/styled-system/patterns/divider.d.ts +0 -22
  226. package/dist/styled-system/patterns/divider.js +0 -25
  227. package/dist/styled-system/patterns/flex.d.ts +0 -26
  228. package/dist/styled-system/patterns/flex.js +0 -26
  229. package/dist/styled-system/patterns/float.d.ts +0 -23
  230. package/dist/styled-system/patterns/float.js +0 -52
  231. package/dist/styled-system/patterns/grid-item.d.ts +0 -25
  232. package/dist/styled-system/patterns/grid-item.js +0 -25
  233. package/dist/styled-system/patterns/grid.d.ts +0 -24
  234. package/dist/styled-system/patterns/grid.js +0 -27
  235. package/dist/styled-system/patterns/hstack.d.ts +0 -21
  236. package/dist/styled-system/patterns/hstack.js +0 -24
  237. package/dist/styled-system/patterns/index.d.ts +0 -21
  238. package/dist/styled-system/patterns/index.js +0 -20
  239. package/dist/styled-system/patterns/link-overlay.d.ts +0 -20
  240. package/dist/styled-system/patterns/link-overlay.js +0 -24
  241. package/dist/styled-system/patterns/spacer.d.ts +0 -20
  242. package/dist/styled-system/patterns/spacer.js +0 -25
  243. package/dist/styled-system/patterns/square.d.ts +0 -20
  244. package/dist/styled-system/patterns/square.js +0 -24
  245. package/dist/styled-system/patterns/stack.d.ts +0 -23
  246. package/dist/styled-system/patterns/stack.js +0 -24
  247. package/dist/styled-system/patterns/visually-hidden.d.ts +0 -20
  248. package/dist/styled-system/patterns/visually-hidden.js +0 -18
  249. package/dist/styled-system/patterns/vstack.d.ts +0 -21
  250. package/dist/styled-system/patterns/vstack.js +0 -24
  251. package/dist/styled-system/patterns/wrap.d.ts +0 -24
  252. package/dist/styled-system/patterns/wrap.js +0 -25
  253. package/dist/styled-system/recipes/content-header.d.ts +0 -31
  254. package/dist/styled-system/recipes/content-header.js +0 -65
  255. package/dist/styled-system/recipes/content-page.d.ts +0 -34
  256. package/dist/styled-system/recipes/content-page.js +0 -43
  257. package/dist/styled-system/recipes/create-recipe.js +0 -82
  258. package/dist/styled-system/recipes/index.d.ts +0 -17
  259. package/dist/styled-system/recipes/index.js +0 -16
  260. package/dist/styled-system/recipes/metric-block.d.ts +0 -34
  261. package/dist/styled-system/recipes/metric-block.js +0 -76
  262. package/dist/styled-system/recipes/product-list.d.ts +0 -31
  263. package/dist/styled-system/recipes/product-list.js +0 -73
  264. package/dist/styled-system/recipes/product-section.d.ts +0 -31
  265. package/dist/styled-system/recipes/product-section.js +0 -49
  266. package/dist/styled-system/recipes/product-settings-row.d.ts +0 -34
  267. package/dist/styled-system/recipes/product-settings-row.js +0 -58
  268. package/dist/styled-system/recipes/product-settings.d.ts +0 -31
  269. package/dist/styled-system/recipes/product-settings.js +0 -57
  270. package/dist/styled-system/recipes/product-status.d.ts +0 -34
  271. package/dist/styled-system/recipes/product-status.js +0 -45
  272. package/dist/styled-system/recipes/product-toolbar.d.ts +0 -31
  273. package/dist/styled-system/recipes/product-toolbar.js +0 -41
  274. package/dist/styled-system/recipes/product-workspace.d.ts +0 -34
  275. package/dist/styled-system/recipes/product-workspace.js +0 -58
  276. package/dist/styled-system/recipes/surface-metric.d.ts +0 -38
  277. package/dist/styled-system/recipes/surface-metric.js +0 -63
  278. package/dist/styled-system/recipes/surface-table.d.ts +0 -34
  279. package/dist/styled-system/recipes/surface-table.js +0 -62
  280. package/dist/styled-system/recipes/ui-badge.d.ts +0 -31
  281. package/dist/styled-system/recipes/ui-badge.js +0 -38
  282. package/dist/styled-system/recipes/ui-button.d.ts +0 -32
  283. package/dist/styled-system/recipes/ui-button.js +0 -43
  284. package/dist/styled-system/recipes/ui-input.d.ts +0 -31
  285. package/dist/styled-system/recipes/ui-input.js +0 -49
  286. package/dist/styled-system/recipes/ui-textarea.d.ts +0 -31
  287. package/dist/styled-system/recipes/ui-textarea.js +0 -24
  288. package/dist/styled-system/styles.css +0 -1257
  289. package/dist/styled-system/tokens/index.d.ts +0 -9
  290. package/dist/styled-system/tokens/index.js +0 -268
  291. package/dist/styled-system/tokens/tokens.d.ts +0 -36
  292. package/dist/styled-system/types/composition.d.ts +0 -227
  293. package/dist/styled-system/types/conditions.d.ts +0 -236
  294. package/dist/styled-system/types/csstype.d.ts +0 -22570
  295. package/dist/styled-system/types/index.d.ts +0 -6
  296. package/dist/styled-system/types/parts.d.ts +0 -8
  297. package/dist/styled-system/types/pattern.d.ts +0 -78
  298. package/dist/styled-system/types/prop-type.d.ts +0 -223
  299. package/dist/styled-system/types/recipe.d.ts +0 -181
  300. package/dist/styled-system/types/selectors.d.ts +0 -59
  301. package/dist/styled-system/types/static-css.d.ts +0 -56
  302. package/dist/styled-system/types/style-props.d.ts +0 -8088
  303. package/dist/styled-system/types/system-types.d.ts +0 -151
@@ -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,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,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
- /* eslint-disable */
2
- import type { SlotRecipeCreatorFn } from '../types/recipe';
3
-
4
- export declare const sva: SlotRecipeCreatorFn
@@ -1,46 +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
- export function sva(config) {
6
- const slots = Object.entries(getSlotRecipes(config)).map(([slot, slotCva]) => [slot, cva(slotCva)])
7
- const defaultVariants = config.defaultVariants ?? {}
8
-
9
- const classNameMap = slots.reduce((acc, [slot, cvaFn]) => {
10
- if (config.className) acc[slot] = cvaFn.config.className
11
- return acc
12
- }, {})
13
-
14
- function svaFn(props) {
15
- const result = slots.map(([slot, cvaFn]) => [slot, cx(cvaFn(props), classNameMap[slot])])
16
- return Object.fromEntries(result)
17
- }
18
-
19
- function raw(props) {
20
- const result = slots.map(([slot, cvaFn]) => [slot, cvaFn.raw(props)])
21
- return Object.fromEntries(result)
22
- }
23
-
24
- const variants = config.variants ?? {};
25
- const variantKeys = Object.keys(variants);
26
-
27
- function splitVariantProps(props) {
28
- return splitProps(props, variantKeys);
29
- }
30
- const getVariantProps = (variants) => ({ ...defaultVariants, ...compact(variants) })
31
-
32
- const variantMap = Object.fromEntries(
33
- Object.entries(variants).map(([key, value]) => [key, Object.keys(value)])
34
- );
35
-
36
- return Object.assign(memo(svaFn), {
37
- __cva__: false,
38
- raw,
39
- config,
40
- variantMap,
41
- variantKeys,
42
- classNameMap,
43
- splitVariantProps,
44
- getVariantProps,
45
- })
46
- }
@@ -1,316 +0,0 @@
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) name = toChar(x % 52) + name;
26
- return toChar(x % 52) + name;
27
- }
28
- function toPhash(h, x) {
29
- let i = x.length;
30
- while (i) h = h * 33 ^ x.charCodeAt(--i);
31
- return h;
32
- }
33
- function toHash(value) {
34
- return toName(toPhash(5381, value) >>> 0);
35
- }
36
-
37
- // src/important.ts
38
- var importantRegex = /\s*!(important)?/i;
39
- function isImportant(value) {
40
- return typeof value === "string" ? importantRegex.test(value) : false;
41
- }
42
- function withoutImportant(value) {
43
- return typeof value === "string" ? value.replace(importantRegex, "").trim() : value;
44
- }
45
- function withoutSpace(str) {
46
- return typeof str === "string" ? str.replaceAll(" ", "_") : str;
47
- }
48
-
49
- // src/memo.ts
50
- var memo = (fn) => {
51
- const cache = /* @__PURE__ */ new Map();
52
- const get = (...args) => {
53
- const key = JSON.stringify(args);
54
- if (cache.has(key)) {
55
- return cache.get(key);
56
- }
57
- const result = fn(...args);
58
- cache.set(key, result);
59
- return result;
60
- };
61
- return get;
62
- };
63
-
64
- // src/merge-props.ts
65
- var MERGE_OMIT = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
66
- function mergeProps(...sources) {
67
- return sources.reduce((prev, obj) => {
68
- if (!obj) return prev;
69
- Object.keys(obj).forEach((key) => {
70
- if (MERGE_OMIT.has(key)) return;
71
- const prevValue = prev[key];
72
- const value = obj[key];
73
- if (isObject(prevValue) && isObject(value)) {
74
- prev[key] = mergeProps(prevValue, value);
75
- } else {
76
- prev[key] = value;
77
- }
78
- });
79
- return prev;
80
- }, {});
81
- }
82
-
83
- // src/walk-object.ts
84
- var isNotNullish = (element) => element != null;
85
- function walkObject(target, predicate, options = {}) {
86
- const { stop, getKey } = options;
87
- function inner(value, path = []) {
88
- if (isObjectOrArray(value)) {
89
- const result = {};
90
- for (const [prop, child] of Object.entries(value)) {
91
- const key = getKey?.(prop, child) ?? prop;
92
- const childPath = [...path, key];
93
- if (stop?.(value, childPath)) {
94
- return predicate(value, path);
95
- }
96
- const next = inner(child, childPath);
97
- if (isNotNullish(next)) {
98
- result[key] = next;
99
- }
100
- }
101
- return result;
102
- }
103
- return predicate(value, path);
104
- }
105
- return inner(target);
106
- }
107
- function mapObject(obj, fn) {
108
- if (Array.isArray(obj)) return obj.map((value) => fn(value));
109
- if (!isObject(obj)) return fn(obj);
110
- return walkObject(obj, (value) => fn(value));
111
- }
112
-
113
- // src/normalize-style-object.ts
114
- function toResponsiveObject(values, breakpoints) {
115
- return values.reduce(
116
- (acc, current, index) => {
117
- const key = breakpoints[index];
118
- if (current != null) {
119
- acc[key] = current;
120
- }
121
- return acc;
122
- },
123
- {}
124
- );
125
- }
126
- function normalizeStyleObject(styles, context, shorthand = true) {
127
- const { utility, conditions } = context;
128
- const { hasShorthand, resolveShorthand } = utility;
129
- return walkObject(
130
- styles,
131
- (value) => {
132
- return Array.isArray(value) ? toResponsiveObject(value, conditions.breakpoints.keys) : value;
133
- },
134
- {
135
- stop: (value) => Array.isArray(value),
136
- getKey: shorthand ? (prop) => hasShorthand ? resolveShorthand(prop) : prop : void 0
137
- }
138
- );
139
- }
140
-
141
- // src/classname.ts
142
- var fallbackCondition = {
143
- shift: (v) => v,
144
- finalize: (v) => v,
145
- breakpoints: { keys: [] }
146
- };
147
- var sanitize = (value) => typeof value === "string" ? value.replaceAll(/[\n\s]+/g, " ") : value;
148
- function createCss(context) {
149
- const { utility, hash, conditions: conds = fallbackCondition } = context;
150
- const formatClassName = (str) => [utility.prefix, str].filter(Boolean).join("-");
151
- const hashFn = (conditions, className) => {
152
- let result;
153
- if (hash) {
154
- const baseArray = [...conds.finalize(conditions), className];
155
- result = formatClassName(utility.toHash(baseArray, toHash));
156
- } else {
157
- const baseArray = [...conds.finalize(conditions), formatClassName(className)];
158
- result = baseArray.join(":");
159
- }
160
- return result;
161
- };
162
- return memo(({ base, ...styles } = {}) => {
163
- const styleObject = Object.assign(styles, base);
164
- const normalizedObject = normalizeStyleObject(styleObject, context);
165
- const classNames = /* @__PURE__ */ new Set();
166
- walkObject(normalizedObject, (value, paths) => {
167
- if (value == null) return;
168
- const important = isImportant(value);
169
- const [prop, ...allConditions] = conds.shift(paths);
170
- const conditions = filterBaseConditions(allConditions);
171
- const transformed = utility.transform(prop, withoutImportant(sanitize(value)));
172
- let className = hashFn(conditions, transformed.className);
173
- if (important) className = `${className}!`;
174
- classNames.add(className);
175
- });
176
- return Array.from(classNames).join(" ");
177
- });
178
- }
179
- function compactStyles(...styles) {
180
- return styles.flat().filter((style) => isObject(style) && Object.keys(compact(style)).length > 0);
181
- }
182
- function createMergeCss(context) {
183
- function resolve(styles) {
184
- const allStyles = compactStyles(...styles);
185
- if (allStyles.length === 1) return allStyles;
186
- return allStyles.map((style) => normalizeStyleObject(style, context));
187
- }
188
- function mergeCss(...styles) {
189
- return mergeProps(...resolve(styles));
190
- }
191
- function assignCss(...styles) {
192
- return Object.assign({}, ...resolve(styles));
193
- }
194
- return { mergeCss: memo(mergeCss), assignCss };
195
- }
196
-
197
- // src/hypenate-property.ts
198
- var wordRegex = /([A-Z])/g;
199
- var msRegex = /^ms-/;
200
- var hypenateProperty = memo((property) => {
201
- if (property.startsWith("--")) return property;
202
- return property.replace(wordRegex, "-$1").replace(msRegex, "-ms-").toLowerCase();
203
- });
204
-
205
- // src/is-css-function.ts
206
- var fns = ["min", "max", "clamp", "calc"];
207
- var fnRegExp = new RegExp(`^(${fns.join("|")})\\(.*\\)`);
208
- var isCssFunction = (v) => typeof v === "string" && fnRegExp.test(v);
209
-
210
- // src/is-css-unit.ts
211
- 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,%";
212
- var lengthUnitsPattern = `(?:${lengthUnits.split(",").join("|")})`;
213
- var lengthRegExp = new RegExp(`^[+-]?[0-9]*.?[0-9]+(?:[eE][+-]?[0-9]+)?${lengthUnitsPattern}$`);
214
- var isCssUnit = (v) => typeof v === "string" && lengthRegExp.test(v);
215
-
216
- // src/is-css-var.ts
217
- var isCssVar = (v) => typeof v === "string" && /^var\(--.+\)$/.test(v);
218
-
219
- // src/pattern-fns.ts
220
- var patternFns = {
221
- map: mapObject,
222
- isCssFunction,
223
- isCssVar,
224
- isCssUnit
225
- };
226
- var getPatternStyles = (pattern, styles) => {
227
- if (!pattern?.defaultValues) return styles;
228
- const defaults = typeof pattern.defaultValues === "function" ? pattern.defaultValues(styles) : pattern.defaultValues;
229
- return Object.assign({}, defaults, compact(styles));
230
- };
231
-
232
- // src/slot.ts
233
- var getSlotRecipes = (recipe = {}) => {
234
- const init = (slot) => ({
235
- className: [recipe.className, slot].filter(Boolean).join("__"),
236
- base: recipe.base?.[slot] ?? {},
237
- variants: {},
238
- defaultVariants: recipe.defaultVariants ?? {},
239
- compoundVariants: recipe.compoundVariants ? getSlotCompoundVariant(recipe.compoundVariants, slot) : []
240
- });
241
- const slots = recipe.slots ?? [];
242
- const recipeParts = slots.map((slot) => [slot, init(slot)]);
243
- for (const [variantsKey, variantsSpec] of Object.entries(recipe.variants ?? {})) {
244
- for (const [variantKey, variantSpec] of Object.entries(variantsSpec)) {
245
- recipeParts.forEach(([slot, slotRecipe]) => {
246
- slotRecipe.variants[variantsKey] ??= {};
247
- slotRecipe.variants[variantsKey][variantKey] = variantSpec[slot] ?? {};
248
- });
249
- }
250
- }
251
- return Object.fromEntries(recipeParts);
252
- };
253
- var getSlotCompoundVariant = (compoundVariants, slotName) => compoundVariants.filter((compoundVariant) => compoundVariant.css[slotName]).map((compoundVariant) => ({ ...compoundVariant, css: compoundVariant.css[slotName] }));
254
-
255
- // src/split-props.ts
256
- function splitProps(props, ...keys) {
257
- const descriptors = Object.getOwnPropertyDescriptors(props);
258
- const dKeys = Object.keys(descriptors);
259
- const split = (k) => {
260
- const clone = {};
261
- for (let i = 0; i < k.length; i++) {
262
- const key = k[i];
263
- if (descriptors[key]) {
264
- Object.defineProperty(clone, key, descriptors[key]);
265
- delete descriptors[key];
266
- }
267
- }
268
- return clone;
269
- };
270
- const fn = (key) => split(Array.isArray(key) ? key : dKeys.filter(key));
271
- return keys.map(fn).concat(split(dKeys));
272
- }
273
-
274
- // src/uniq.ts
275
- var uniq = (...items) => {
276
- const set = items.reduce((acc, currItems) => {
277
- if (currItems) {
278
- currItems.forEach((item) => acc.add(item));
279
- }
280
- return acc;
281
- }, /* @__PURE__ */ new Set([]));
282
- return Array.from(set);
283
- };
284
- export {
285
- compact,
286
- createCss,
287
- createMergeCss,
288
- filterBaseConditions,
289
- getPatternStyles,
290
- getSlotCompoundVariant,
291
- getSlotRecipes,
292
- hypenateProperty,
293
- isBaseCondition,
294
- isObject,
295
- mapObject,
296
- memo,
297
- mergeProps,
298
- patternFns,
299
- splitProps,
300
- toHash,
301
- uniq,
302
- walkObject,
303
- withoutSpace
304
- };
305
-
306
-
307
-
308
-
309
-
310
- export function __spreadValues(a, b) {
311
- return { ...a, ...b }
312
- }
313
-
314
- export function __objRest(source, exclude) {
315
- return Object.fromEntries(Object.entries(source).filter(([key]) => !exclude.includes(key)))
316
- }
@@ -1,20 +0,0 @@
1
- /* eslint-disable */
2
- import type { SystemStyleObject, ConditionalValue } from '../types/index';
3
- import type { Properties } from '../types/csstype';
4
- import type { SystemProperties } from '../types/style-props';
5
- import type { DistributiveOmit } from '../types/system-types';
6
- import type { Tokens } from '../tokens/index';
7
-
8
- export interface AspectRatioProperties {
9
- ratio?: ConditionalValue<number>
10
- }
11
-
12
- interface AspectRatioStyles extends AspectRatioProperties, DistributiveOmit<SystemStyleObject, keyof AspectRatioProperties | 'aspectRatio'> {}
13
-
14
- interface AspectRatioPatternFn {
15
- (styles?: AspectRatioStyles): string
16
- raw: (styles?: AspectRatioStyles) => SystemStyleObject
17
- }
18
-
19
-
20
- export declare const aspectRatio: AspectRatioPatternFn;
@@ -1,38 +0,0 @@
1
- import { getPatternStyles, patternFns } from '../helpers.js';
2
- import { css } from '../css/index.js';
3
-
4
- const aspectRatioConfig = {
5
- transform(props, { map }) {
6
- const { ratio = 4 / 3, ...rest } = props;
7
- return {
8
- position: "relative",
9
- _before: {
10
- content: `""`,
11
- display: "block",
12
- height: "0",
13
- paddingBottom: map(ratio, (r) => `${1 / r * 100}%`)
14
- },
15
- "&>*": {
16
- display: "flex",
17
- justifyContent: "center",
18
- alignItems: "center",
19
- overflow: "hidden",
20
- position: "absolute",
21
- inset: "0",
22
- width: "100%",
23
- height: "100%"
24
- },
25
- "&>img, &>video": {
26
- objectFit: "cover"
27
- },
28
- ...rest
29
- };
30
- }}
31
-
32
- export const getAspectRatioStyle = (styles = {}) => {
33
- const _styles = getPatternStyles(aspectRatioConfig, styles)
34
- return aspectRatioConfig.transform(_styles, patternFns)
35
- }
36
-
37
- export const aspectRatio = (styles) => css(getAspectRatioStyle(styles))
38
- aspectRatio.raw = getAspectRatioStyle
@@ -1,21 +0,0 @@
1
- /* eslint-disable */
2
- import type { SystemStyleObject, ConditionalValue } from '../types/index';
3
- import type { Properties } from '../types/csstype';
4
- import type { SystemProperties } from '../types/style-props';
5
- import type { DistributiveOmit } from '../types/system-types';
6
- import type { Tokens } from '../tokens/index';
7
-
8
- export interface BleedProperties {
9
- inline?: SystemProperties["marginInline"]
10
- block?: SystemProperties["marginBlock"]
11
- }
12
-
13
- interface BleedStyles extends BleedProperties, DistributiveOmit<SystemStyleObject, keyof BleedProperties > {}
14
-
15
- interface BleedPatternFn {
16
- (styles?: BleedStyles): string
17
- raw: (styles?: BleedStyles) => SystemStyleObject
18
- }
19
-
20
-
21
- export declare const bleed: BleedPatternFn;
@@ -1,24 +0,0 @@
1
- import { getPatternStyles, patternFns } from '../helpers.js';
2
- import { css } from '../css/index.js';
3
-
4
- const bleedConfig = {
5
- transform(props, { map, isCssUnit, isCssVar }) {
6
- const { inline, block, ...rest } = props;
7
- const valueFn = (v) => isCssUnit(v) || isCssVar(v) ? v : `token(spacing.${v}, ${v})`;
8
- return {
9
- "--bleed-x": map(inline, valueFn),
10
- "--bleed-y": map(block, valueFn),
11
- marginInline: "calc(var(--bleed-x, 0) * -1)",
12
- marginBlock: "calc(var(--bleed-y, 0) * -1)",
13
- ...rest
14
- };
15
- },
16
- defaultValues:{inline:'0',block:'0'}}
17
-
18
- export const getBleedStyle = (styles = {}) => {
19
- const _styles = getPatternStyles(bleedConfig, styles)
20
- return bleedConfig.transform(_styles, patternFns)
21
- }
22
-
23
- export const bleed = (styles) => css(getBleedStyle(styles))
24
- bleed.raw = getBleedStyle
@@ -1,20 +0,0 @@
1
- /* eslint-disable */
2
- import type { SystemStyleObject, ConditionalValue } from '../types/index';
3
- import type { Properties } from '../types/csstype';
4
- import type { SystemProperties } from '../types/style-props';
5
- import type { DistributiveOmit } from '../types/system-types';
6
- import type { Tokens } from '../tokens/index';
7
-
8
- export interface BoxProperties {
9
-
10
- }
11
-
12
- interface BoxStyles extends BoxProperties, DistributiveOmit<SystemStyleObject, keyof BoxProperties > {}
13
-
14
- interface BoxPatternFn {
15
- (styles?: BoxStyles): string
16
- raw: (styles?: BoxStyles) => SystemStyleObject
17
- }
18
-
19
-
20
- export declare const box: BoxPatternFn;
@@ -1,15 +0,0 @@
1
- import { getPatternStyles, patternFns } from '../helpers.js';
2
- import { css } from '../css/index.js';
3
-
4
- const boxConfig = {
5
- transform(props) {
6
- return props;
7
- }}
8
-
9
- export const getBoxStyle = (styles = {}) => {
10
- const _styles = getPatternStyles(boxConfig, styles)
11
- return boxConfig.transform(_styles, patternFns)
12
- }
13
-
14
- export const box = (styles) => css(getBoxStyle(styles))
15
- box.raw = getBoxStyle
@@ -1,20 +0,0 @@
1
- /* eslint-disable */
2
- import type { SystemStyleObject, ConditionalValue } from '../types/index';
3
- import type { Properties } from '../types/csstype';
4
- import type { SystemProperties } from '../types/style-props';
5
- import type { DistributiveOmit } from '../types/system-types';
6
- import type { Tokens } from '../tokens/index';
7
-
8
- export interface CenterProperties {
9
- inline?: ConditionalValue<boolean>
10
- }
11
-
12
- interface CenterStyles extends CenterProperties, DistributiveOmit<SystemStyleObject, keyof CenterProperties > {}
13
-
14
- interface CenterPatternFn {
15
- (styles?: CenterStyles): string
16
- raw: (styles?: CenterStyles) => SystemStyleObject
17
- }
18
-
19
-
20
- export declare const center: CenterPatternFn;
@@ -1,21 +0,0 @@
1
- import { getPatternStyles, patternFns } from '../helpers.js';
2
- import { css } from '../css/index.js';
3
-
4
- const centerConfig = {
5
- transform(props) {
6
- const { inline, ...rest } = props;
7
- return {
8
- display: inline ? "inline-flex" : "flex",
9
- alignItems: "center",
10
- justifyContent: "center",
11
- ...rest
12
- };
13
- }}
14
-
15
- export const getCenterStyle = (styles = {}) => {
16
- const _styles = getPatternStyles(centerConfig, styles)
17
- return centerConfig.transform(_styles, patternFns)
18
- }
19
-
20
- export const center = (styles) => css(getCenterStyle(styles))
21
- center.raw = getCenterStyle