@svadmin/surface 0.8.6 → 0.9.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 (192) hide show
  1. package/README.md +70 -38
  2. package/STYLING.md +31 -0
  3. package/compatibility.json +23 -2
  4. package/dist/agent-contract.d.ts +37 -0
  5. package/dist/agent-contract.js +203 -0
  6. package/dist/agent.d.ts +38 -7
  7. package/dist/agent.js +98 -59
  8. package/dist/binding.d.ts +2 -0
  9. package/dist/binding.js +7 -1
  10. package/dist/builtin-definitions.d.ts +6 -0
  11. package/dist/builtin-definitions.js +40 -0
  12. package/dist/builtin-schemas.d.ts +25 -0
  13. package/dist/builtin-schemas.js +13 -0
  14. package/dist/catalog.d.ts +4 -61
  15. package/dist/catalog.js +20 -44
  16. package/dist/components/MetricWidget.svelte +12 -8
  17. package/dist/components/ResourceFormBody.svelte +97 -0
  18. package/dist/components/ResourceFormBody.svelte.d.ts +13 -0
  19. package/dist/components/ResourceFormWidget.svelte +19 -0
  20. package/dist/components/ResourceFormWidget.svelte.d.ts +4 -0
  21. package/dist/components/ResourceTableWidget.svelte +14 -12
  22. package/dist/components/SurfaceEditPreview.svelte +107 -0
  23. package/dist/components/SurfaceEditPreview.svelte.d.ts +20 -0
  24. package/dist/components/SurfaceRenderer.svelte +120 -163
  25. package/dist/components/SurfaceRenderer.svelte.d.ts +4 -0
  26. package/dist/components/SurfaceWorkflowProvider.svelte +22 -0
  27. package/dist/components/SurfaceWorkflowProvider.svelte.d.ts +17 -0
  28. package/dist/components/SvarGridWidget.svelte +47 -0
  29. package/dist/components/SvarGridWidget.svelte.d.ts +4 -0
  30. package/dist/components/SvarSurfaceProvider.svelte +12 -0
  31. package/dist/components/SvarSurfaceProvider.svelte.d.ts +11 -0
  32. package/dist/edits.d.ts +57 -0
  33. package/dist/edits.js +166 -0
  34. package/dist/index.d.ts +8 -2
  35. package/dist/index.js +5 -1
  36. package/dist/interactive.d.ts +6 -0
  37. package/dist/interactive.js +15 -0
  38. package/dist/json.js +1 -2
  39. package/dist/openui.d.ts +64 -0
  40. package/dist/openui.js +168 -0
  41. package/dist/schema.d.ts +108 -0
  42. package/dist/schema.js +73 -0
  43. package/dist/server-sqlite.d.ts +1 -0
  44. package/dist/server-sqlite.js +2 -0
  45. package/dist/server.d.ts +4 -0
  46. package/dist/server.js +4 -0
  47. package/dist/source-cache.d.ts +30 -0
  48. package/dist/source-cache.js +135 -0
  49. package/dist/styled-system/css/conditions.js +36 -0
  50. package/dist/styled-system/css/css.d.ts +22 -0
  51. package/dist/styled-system/css/css.js +45 -0
  52. package/dist/styled-system/css/cva.d.ts +6 -0
  53. package/dist/styled-system/css/cva.js +87 -0
  54. package/dist/styled-system/css/cx.d.ts +5 -0
  55. package/dist/styled-system/css/cx.js +15 -0
  56. package/dist/styled-system/css/index.d.ts +5 -0
  57. package/dist/styled-system/css/index.js +4 -0
  58. package/dist/styled-system/css/sva.d.ts +4 -0
  59. package/dist/styled-system/css/sva.js +46 -0
  60. package/dist/styled-system/design-contract.d.ts +13 -0
  61. package/dist/styled-system/design-contract.js +11 -0
  62. package/dist/styled-system/helpers.js +316 -0
  63. package/dist/styled-system/patterns/aspect-ratio.d.ts +20 -0
  64. package/dist/styled-system/patterns/aspect-ratio.js +38 -0
  65. package/dist/styled-system/patterns/bleed.d.ts +21 -0
  66. package/dist/styled-system/patterns/bleed.js +24 -0
  67. package/dist/styled-system/patterns/box.d.ts +20 -0
  68. package/dist/styled-system/patterns/box.js +15 -0
  69. package/dist/styled-system/patterns/center.d.ts +20 -0
  70. package/dist/styled-system/patterns/center.js +21 -0
  71. package/dist/styled-system/patterns/circle.d.ts +20 -0
  72. package/dist/styled-system/patterns/circle.js +25 -0
  73. package/dist/styled-system/patterns/container.d.ts +20 -0
  74. package/dist/styled-system/patterns/container.js +21 -0
  75. package/dist/styled-system/patterns/cq.d.ts +21 -0
  76. package/dist/styled-system/patterns/cq.js +21 -0
  77. package/dist/styled-system/patterns/divider.d.ts +22 -0
  78. package/dist/styled-system/patterns/divider.js +25 -0
  79. package/dist/styled-system/patterns/flex.d.ts +26 -0
  80. package/dist/styled-system/patterns/flex.js +26 -0
  81. package/dist/styled-system/patterns/float.d.ts +23 -0
  82. package/dist/styled-system/patterns/float.js +52 -0
  83. package/dist/styled-system/patterns/grid-item.d.ts +25 -0
  84. package/dist/styled-system/patterns/grid-item.js +25 -0
  85. package/dist/styled-system/patterns/grid.d.ts +24 -0
  86. package/dist/styled-system/patterns/grid.js +27 -0
  87. package/dist/styled-system/patterns/hstack.d.ts +21 -0
  88. package/dist/styled-system/patterns/hstack.js +24 -0
  89. package/dist/styled-system/patterns/index.d.ts +21 -0
  90. package/dist/styled-system/patterns/index.js +20 -0
  91. package/dist/styled-system/patterns/link-overlay.d.ts +20 -0
  92. package/dist/styled-system/patterns/link-overlay.js +24 -0
  93. package/dist/styled-system/patterns/spacer.d.ts +20 -0
  94. package/dist/styled-system/patterns/spacer.js +25 -0
  95. package/dist/styled-system/patterns/square.d.ts +20 -0
  96. package/dist/styled-system/patterns/square.js +24 -0
  97. package/dist/styled-system/patterns/stack.d.ts +23 -0
  98. package/dist/styled-system/patterns/stack.js +24 -0
  99. package/dist/styled-system/patterns/visually-hidden.d.ts +20 -0
  100. package/dist/styled-system/patterns/visually-hidden.js +18 -0
  101. package/dist/styled-system/patterns/vstack.d.ts +21 -0
  102. package/dist/styled-system/patterns/vstack.js +24 -0
  103. package/dist/styled-system/patterns/wrap.d.ts +24 -0
  104. package/dist/styled-system/patterns/wrap.js +25 -0
  105. package/dist/styled-system/recipes/content-header.d.ts +31 -0
  106. package/dist/styled-system/recipes/content-header.js +65 -0
  107. package/dist/styled-system/recipes/content-page.d.ts +34 -0
  108. package/dist/styled-system/recipes/content-page.js +43 -0
  109. package/dist/styled-system/recipes/create-recipe.js +82 -0
  110. package/dist/styled-system/recipes/index.d.ts +17 -0
  111. package/dist/styled-system/recipes/index.js +16 -0
  112. package/dist/styled-system/recipes/metric-block.d.ts +34 -0
  113. package/dist/styled-system/recipes/metric-block.js +76 -0
  114. package/dist/styled-system/recipes/product-list.d.ts +31 -0
  115. package/dist/styled-system/recipes/product-list.js +73 -0
  116. package/dist/styled-system/recipes/product-section.d.ts +31 -0
  117. package/dist/styled-system/recipes/product-section.js +49 -0
  118. package/dist/styled-system/recipes/product-settings-row.d.ts +34 -0
  119. package/dist/styled-system/recipes/product-settings-row.js +58 -0
  120. package/dist/styled-system/recipes/product-settings.d.ts +31 -0
  121. package/dist/styled-system/recipes/product-settings.js +57 -0
  122. package/dist/styled-system/recipes/product-status.d.ts +34 -0
  123. package/dist/styled-system/recipes/product-status.js +45 -0
  124. package/dist/styled-system/recipes/product-toolbar.d.ts +31 -0
  125. package/dist/styled-system/recipes/product-toolbar.js +41 -0
  126. package/dist/styled-system/recipes/product-workspace.d.ts +34 -0
  127. package/dist/styled-system/recipes/product-workspace.js +58 -0
  128. package/dist/styled-system/recipes/surface-metric.d.ts +38 -0
  129. package/dist/styled-system/recipes/surface-metric.js +63 -0
  130. package/dist/styled-system/recipes/surface-table.d.ts +34 -0
  131. package/dist/styled-system/recipes/surface-table.js +62 -0
  132. package/dist/styled-system/recipes/ui-badge.d.ts +31 -0
  133. package/dist/styled-system/recipes/ui-badge.js +38 -0
  134. package/dist/styled-system/recipes/ui-button.d.ts +32 -0
  135. package/dist/styled-system/recipes/ui-button.js +43 -0
  136. package/dist/styled-system/recipes/ui-input.d.ts +31 -0
  137. package/dist/styled-system/recipes/ui-input.js +49 -0
  138. package/dist/styled-system/recipes/ui-textarea.d.ts +31 -0
  139. package/dist/styled-system/recipes/ui-textarea.js +24 -0
  140. package/dist/styled-system/styles.css +1257 -0
  141. package/dist/styled-system/tokens/index.d.ts +9 -0
  142. package/dist/styled-system/tokens/index.js +268 -0
  143. package/dist/styled-system/tokens/tokens.d.ts +36 -0
  144. package/dist/styled-system/types/composition.d.ts +227 -0
  145. package/dist/styled-system/types/conditions.d.ts +236 -0
  146. package/dist/styled-system/types/csstype.d.ts +22570 -0
  147. package/dist/styled-system/types/index.d.ts +6 -0
  148. package/dist/styled-system/types/parts.d.ts +8 -0
  149. package/dist/styled-system/types/pattern.d.ts +78 -0
  150. package/dist/styled-system/types/prop-type.d.ts +223 -0
  151. package/dist/styled-system/types/recipe.d.ts +181 -0
  152. package/dist/styled-system/types/selectors.d.ts +59 -0
  153. package/dist/styled-system/types/static-css.d.ts +56 -0
  154. package/dist/styled-system/types/style-props.d.ts +8088 -0
  155. package/dist/styled-system/types/system-types.d.ts +151 -0
  156. package/dist/styles/editor.css +124 -0
  157. package/dist/styles/editor.generated.d.ts +8 -0
  158. package/dist/styles/editor.generated.js +9 -0
  159. package/dist/styles.css +1262 -0
  160. package/dist/svar-catalog.d.ts +3 -0
  161. package/dist/svar-catalog.js +7 -0
  162. package/dist/svar-context.d.ts +9 -0
  163. package/dist/svar-context.js +1 -0
  164. package/dist/svar-schema.d.ts +21 -0
  165. package/dist/svar-schema.js +36 -0
  166. package/dist/svar.d.ts +4 -0
  167. package/dist/svar.js +3 -0
  168. package/dist/svelte.d.ts +4 -2
  169. package/dist/svelte.js +2 -1
  170. package/dist/types.d.ts +5 -1
  171. package/dist/validation.js +2 -102
  172. package/dist/wire.d.ts +13 -0
  173. package/dist/wire.js +30 -0
  174. package/dist/workflows/action-contracts.d.ts +7 -0
  175. package/dist/workflows/action-contracts.js +54 -0
  176. package/dist/workflows/catalog.d.ts +20 -0
  177. package/dist/workflows/catalog.js +50 -0
  178. package/dist/workflows/client.d.ts +45 -0
  179. package/dist/workflows/client.js +125 -0
  180. package/dist/workflows/context.d.ts +9 -0
  181. package/dist/workflows/context.js +5 -0
  182. package/dist/workflows/openui-guard.d.ts +19 -0
  183. package/dist/workflows/openui-guard.js +209 -0
  184. package/dist/workflows/service.d.ts +58 -0
  185. package/dist/workflows/service.js +296 -0
  186. package/dist/workflows/sqlite-store.d.ts +20 -0
  187. package/dist/workflows/sqlite-store.js +91 -0
  188. package/dist/workflows/types.d.ts +103 -0
  189. package/dist/workflows/types.js +8 -0
  190. package/dist/workflows.d.ts +5 -0
  191. package/dist/workflows.js +4 -0
  192. package/package.json +53 -9
@@ -0,0 +1,21 @@
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 VstackProperties {
9
+ justify?: SystemProperties["justifyContent"]
10
+ gap?: SystemProperties["gap"]
11
+ }
12
+
13
+ interface VstackStyles extends VstackProperties, DistributiveOmit<SystemStyleObject, keyof VstackProperties > {}
14
+
15
+ interface VstackPatternFn {
16
+ (styles?: VstackStyles): string
17
+ raw: (styles?: VstackStyles) => SystemStyleObject
18
+ }
19
+
20
+
21
+ export declare const vstack: VstackPatternFn;
@@ -0,0 +1,24 @@
1
+ import { getPatternStyles, patternFns } from '../helpers.js';
2
+ import { css } from '../css/index.js';
3
+
4
+ const vstackConfig = {
5
+ transform(props) {
6
+ const { justify, gap, ...rest } = props;
7
+ return {
8
+ display: "flex",
9
+ alignItems: "center",
10
+ justifyContent: justify,
11
+ gap,
12
+ flexDirection: "column",
13
+ ...rest
14
+ };
15
+ },
16
+ defaultValues:{gap:'8px'}}
17
+
18
+ export const getVstackStyle = (styles = {}) => {
19
+ const _styles = getPatternStyles(vstackConfig, styles)
20
+ return vstackConfig.transform(_styles, patternFns)
21
+ }
22
+
23
+ export const vstack = (styles) => css(getVstackStyle(styles))
24
+ vstack.raw = getVstackStyle
@@ -0,0 +1,24 @@
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 WrapProperties {
9
+ gap?: SystemProperties["gap"]
10
+ rowGap?: SystemProperties["gap"]
11
+ columnGap?: SystemProperties["gap"]
12
+ align?: SystemProperties["alignItems"]
13
+ justify?: SystemProperties["justifyContent"]
14
+ }
15
+
16
+ interface WrapStyles extends WrapProperties, DistributiveOmit<SystemStyleObject, keyof WrapProperties > {}
17
+
18
+ interface WrapPatternFn {
19
+ (styles?: WrapStyles): string
20
+ raw: (styles?: WrapStyles) => SystemStyleObject
21
+ }
22
+
23
+
24
+ export declare const wrap: WrapPatternFn;
@@ -0,0 +1,25 @@
1
+ import { getPatternStyles, patternFns } from '../helpers.js';
2
+ import { css } from '../css/index.js';
3
+
4
+ const wrapConfig = {
5
+ transform(props) {
6
+ const { columnGap, rowGap, gap = columnGap || rowGap ? void 0 : "8px", align, justify, ...rest } = props;
7
+ return {
8
+ display: "flex",
9
+ flexWrap: "wrap",
10
+ alignItems: align,
11
+ justifyContent: justify,
12
+ gap,
13
+ columnGap,
14
+ rowGap,
15
+ ...rest
16
+ };
17
+ }}
18
+
19
+ export const getWrapStyle = (styles = {}) => {
20
+ const _styles = getPatternStyles(wrapConfig, styles)
21
+ return wrapConfig.transform(_styles, patternFns)
22
+ }
23
+
24
+ export const wrap = (styles) => css(getWrapStyle(styles))
25
+ wrap.raw = getWrapStyle
@@ -0,0 +1,31 @@
1
+ /* eslint-disable */
2
+ import type { ConditionalValue } from '../types/index';
3
+ import type { DistributiveOmit, Pretty } from '../types/system-types';
4
+
5
+ interface ContentHeaderVariant {
6
+
7
+ }
8
+
9
+ type ContentHeaderVariantMap = {
10
+ [key in keyof ContentHeaderVariant]: Array<ContentHeaderVariant[key]>
11
+ }
12
+
13
+ type ContentHeaderSlot = "root" | "breadcrumbs" | "currentCrumb" | "row" | "heading" | "eyebrow" | "title" | "description" | "actions"
14
+
15
+ export type ContentHeaderVariantProps = {
16
+ [key in keyof ContentHeaderVariant]?: ConditionalValue<ContentHeaderVariant[key]> | undefined
17
+ }
18
+
19
+ export interface ContentHeaderRecipe {
20
+ __slot: ContentHeaderSlot
21
+ __type: ContentHeaderVariantProps
22
+ (props?: ContentHeaderVariantProps): Pretty<Record<ContentHeaderSlot, string>>
23
+ raw: (props?: ContentHeaderVariantProps) => ContentHeaderVariantProps
24
+ variantMap: ContentHeaderVariantMap
25
+ variantKeys: Array<keyof ContentHeaderVariant>
26
+ splitVariantProps<Props extends ContentHeaderVariantProps>(props: Props): [ContentHeaderVariantProps, Pretty<DistributiveOmit<Props, keyof ContentHeaderVariantProps>>]
27
+ getVariantProps: (props?: ContentHeaderVariantProps) => ContentHeaderVariantProps
28
+ }
29
+
30
+
31
+ export declare const contentHeader: ContentHeaderRecipe
@@ -0,0 +1,65 @@
1
+ import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.js';
2
+ import { createRecipe } from './create-recipe.js';
3
+
4
+ const contentHeaderDefaultVariants = {}
5
+ const contentHeaderCompoundVariants = []
6
+
7
+ const contentHeaderSlotNames = [
8
+ [
9
+ "root",
10
+ "content-header__root"
11
+ ],
12
+ [
13
+ "breadcrumbs",
14
+ "content-header__breadcrumbs"
15
+ ],
16
+ [
17
+ "currentCrumb",
18
+ "content-header__currentCrumb"
19
+ ],
20
+ [
21
+ "row",
22
+ "content-header__row"
23
+ ],
24
+ [
25
+ "heading",
26
+ "content-header__heading"
27
+ ],
28
+ [
29
+ "eyebrow",
30
+ "content-header__eyebrow"
31
+ ],
32
+ [
33
+ "title",
34
+ "content-header__title"
35
+ ],
36
+ [
37
+ "description",
38
+ "content-header__description"
39
+ ],
40
+ [
41
+ "actions",
42
+ "content-header__actions"
43
+ ]
44
+ ]
45
+ const contentHeaderSlotFns = /* @__PURE__ */ contentHeaderSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, contentHeaderDefaultVariants, getSlotCompoundVariant(contentHeaderCompoundVariants, slotName))])
46
+
47
+ const contentHeaderFn = memo((props = {}) => {
48
+ return Object.fromEntries(contentHeaderSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
49
+ })
50
+
51
+ const contentHeaderVariantKeys = []
52
+ const getVariantProps = (variants) => ({ ...contentHeaderDefaultVariants, ...compact(variants) })
53
+
54
+ export const contentHeader = /* @__PURE__ */ Object.assign(contentHeaderFn, {
55
+ __recipe__: false,
56
+ __name__: 'contentHeader',
57
+ raw: (props) => props,
58
+ classNameMap: {},
59
+ variantKeys: contentHeaderVariantKeys,
60
+ variantMap: {},
61
+ splitVariantProps(props) {
62
+ return splitProps(props, contentHeaderVariantKeys)
63
+ },
64
+ getVariantProps
65
+ })
@@ -0,0 +1,34 @@
1
+ /* eslint-disable */
2
+ import type { ConditionalValue } from '../types/index';
3
+ import type { DistributiveOmit, Pretty } from '../types/system-types';
4
+
5
+ interface ContentPageVariant {
6
+ /**
7
+ * @default "default"
8
+ */
9
+ width: "narrow" | "default" | "wide"
10
+ }
11
+
12
+ type ContentPageVariantMap = {
13
+ [key in keyof ContentPageVariant]: Array<ContentPageVariant[key]>
14
+ }
15
+
16
+ type ContentPageSlot = "root"
17
+
18
+ export type ContentPageVariantProps = {
19
+ [key in keyof ContentPageVariant]?: ConditionalValue<ContentPageVariant[key]> | undefined
20
+ }
21
+
22
+ export interface ContentPageRecipe {
23
+ __slot: ContentPageSlot
24
+ __type: ContentPageVariantProps
25
+ (props?: ContentPageVariantProps): Pretty<Record<ContentPageSlot, string>>
26
+ raw: (props?: ContentPageVariantProps) => ContentPageVariantProps
27
+ variantMap: ContentPageVariantMap
28
+ variantKeys: Array<keyof ContentPageVariant>
29
+ splitVariantProps<Props extends ContentPageVariantProps>(props: Props): [ContentPageVariantProps, Pretty<DistributiveOmit<Props, keyof ContentPageVariantProps>>]
30
+ getVariantProps: (props?: ContentPageVariantProps) => ContentPageVariantProps
31
+ }
32
+
33
+
34
+ export declare const contentPage: ContentPageRecipe
@@ -0,0 +1,43 @@
1
+ import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.js';
2
+ import { createRecipe } from './create-recipe.js';
3
+
4
+ const contentPageDefaultVariants = {
5
+ "width": "default"
6
+ }
7
+ const contentPageCompoundVariants = []
8
+
9
+ const contentPageSlotNames = [
10
+ [
11
+ "root",
12
+ "content-page__root"
13
+ ]
14
+ ]
15
+ const contentPageSlotFns = /* @__PURE__ */ contentPageSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, contentPageDefaultVariants, getSlotCompoundVariant(contentPageCompoundVariants, slotName))])
16
+
17
+ const contentPageFn = memo((props = {}) => {
18
+ return Object.fromEntries(contentPageSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
19
+ })
20
+
21
+ const contentPageVariantKeys = [
22
+ "width"
23
+ ]
24
+ const getVariantProps = (variants) => ({ ...contentPageDefaultVariants, ...compact(variants) })
25
+
26
+ export const contentPage = /* @__PURE__ */ Object.assign(contentPageFn, {
27
+ __recipe__: false,
28
+ __name__: 'contentPage',
29
+ raw: (props) => props,
30
+ classNameMap: {},
31
+ variantKeys: contentPageVariantKeys,
32
+ variantMap: {
33
+ "width": [
34
+ "narrow",
35
+ "default",
36
+ "wide"
37
+ ]
38
+ },
39
+ splitVariantProps(props) {
40
+ return splitProps(props, contentPageVariantKeys)
41
+ },
42
+ getVariantProps
43
+ })
@@ -0,0 +1,82 @@
1
+ import { finalizeConditions, sortConditions } from '../css/conditions.js';
2
+ import { css } from '../css/css.js';
3
+ import { assertCompoundVariant, getCompoundVariantCss } from '../css/cva.js';
4
+ import { cx } from '../css/cx.js';
5
+ import { compact, createCss, splitProps, uniq, withoutSpace } from '../helpers.js';
6
+
7
+ export const createRecipe = (name, defaultVariants, compoundVariants) => {
8
+ const getVariantProps = (variants) => {
9
+ return {
10
+ [name]: '__ignore__',
11
+ ...defaultVariants,
12
+ ...compact(variants),
13
+ };
14
+ };
15
+
16
+ const recipeFn = (variants, withCompoundVariants = true) => {
17
+ const transform = (prop, value) => {
18
+ assertCompoundVariant(name, compoundVariants, variants, prop)
19
+
20
+ if (value === '__ignore__') {
21
+ return { className: name }
22
+ }
23
+
24
+ value = withoutSpace(value)
25
+ return { className: `${name}--${prop}_${value}` }
26
+ }
27
+
28
+ const recipeCss = createCss({
29
+
30
+ conditions: {
31
+ shift: sortConditions,
32
+ finalize: finalizeConditions,
33
+ breakpoints: { keys: ["base"] }
34
+ },
35
+ utility: {
36
+ prefix: "svadmin",
37
+ toHash: (path, hashFn) => hashFn(path.join(":")),
38
+ transform,
39
+ }
40
+ })
41
+
42
+ const recipeStyles = getVariantProps(variants)
43
+
44
+ if (withCompoundVariants) {
45
+ const compoundVariantStyles = getCompoundVariantCss(compoundVariants, recipeStyles)
46
+ return cx(recipeCss(recipeStyles), css(compoundVariantStyles))
47
+ }
48
+
49
+ return recipeCss(recipeStyles)
50
+ }
51
+
52
+ return {
53
+ recipeFn,
54
+ getVariantProps,
55
+ __getCompoundVariantCss__: (variants) => {
56
+ return getCompoundVariantCss(compoundVariants, getVariantProps(variants));
57
+ },
58
+ }
59
+ }
60
+
61
+ export const mergeRecipes = (recipeA, recipeB) => {
62
+ if (recipeA && !recipeB) return recipeA
63
+ if (!recipeA && recipeB) return recipeB
64
+
65
+ const recipeFn = (...args) => cx(recipeA(...args), recipeB(...args))
66
+ const variantKeys = uniq(recipeA.variantKeys, recipeB.variantKeys)
67
+ const variantMap = variantKeys.reduce((acc, key) => {
68
+ acc[key] = uniq(recipeA.variantMap[key], recipeB.variantMap[key])
69
+ return acc
70
+ }, {})
71
+
72
+ return Object.assign(recipeFn, {
73
+ __recipe__: true,
74
+ __name__: `${recipeA.__name__} ${recipeB.__name__}`,
75
+ raw: (props) => props,
76
+ variantKeys,
77
+ variantMap,
78
+ splitVariantProps(props) {
79
+ return splitProps(props, variantKeys)
80
+ },
81
+ })
82
+ }
@@ -0,0 +1,17 @@
1
+ /* eslint-disable */
2
+ export * from './ui-button';
3
+ export * from './ui-badge';
4
+ export * from './ui-textarea';
5
+ export * from './surface-metric';
6
+ export * from './surface-table';
7
+ export * from './ui-input';
8
+ export * from './product-section';
9
+ export * from './product-toolbar';
10
+ export * from './product-workspace';
11
+ export * from './product-settings';
12
+ export * from './product-settings-row';
13
+ export * from './product-list';
14
+ export * from './product-status';
15
+ export * from './content-page';
16
+ export * from './content-header';
17
+ export * from './metric-block';
@@ -0,0 +1,16 @@
1
+ export * from './ui-button.js';
2
+ export * from './ui-badge.js';
3
+ export * from './ui-textarea.js';
4
+ export * from './surface-metric.js';
5
+ export * from './surface-table.js';
6
+ export * from './ui-input.js';
7
+ export * from './product-section.js';
8
+ export * from './product-toolbar.js';
9
+ export * from './product-workspace.js';
10
+ export * from './product-settings.js';
11
+ export * from './product-settings-row.js';
12
+ export * from './product-list.js';
13
+ export * from './product-status.js';
14
+ export * from './content-page.js';
15
+ export * from './content-header.js';
16
+ export * from './metric-block.js';
@@ -0,0 +1,34 @@
1
+ /* eslint-disable */
2
+ import type { ConditionalValue } from '../types/index';
3
+ import type { DistributiveOmit, Pretty } from '../types/system-types';
4
+
5
+ interface MetricBlockVariant {
6
+ /**
7
+ * @default "neutral"
8
+ */
9
+ trendTone: "positive" | "negative" | "warning" | "neutral"
10
+ }
11
+
12
+ type MetricBlockVariantMap = {
13
+ [key in keyof MetricBlockVariant]: Array<MetricBlockVariant[key]>
14
+ }
15
+
16
+ type MetricBlockSlot = "root" | "header" | "label" | "icon" | "skeleton" | "value" | "meta" | "trend" | "detail"
17
+
18
+ export type MetricBlockVariantProps = {
19
+ [key in keyof MetricBlockVariant]?: ConditionalValue<MetricBlockVariant[key]> | undefined
20
+ }
21
+
22
+ export interface MetricBlockRecipe {
23
+ __slot: MetricBlockSlot
24
+ __type: MetricBlockVariantProps
25
+ (props?: MetricBlockVariantProps): Pretty<Record<MetricBlockSlot, string>>
26
+ raw: (props?: MetricBlockVariantProps) => MetricBlockVariantProps
27
+ variantMap: MetricBlockVariantMap
28
+ variantKeys: Array<keyof MetricBlockVariant>
29
+ splitVariantProps<Props extends MetricBlockVariantProps>(props: Props): [MetricBlockVariantProps, Pretty<DistributiveOmit<Props, keyof MetricBlockVariantProps>>]
30
+ getVariantProps: (props?: MetricBlockVariantProps) => MetricBlockVariantProps
31
+ }
32
+
33
+
34
+ export declare const metricBlock: MetricBlockRecipe
@@ -0,0 +1,76 @@
1
+ import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.js';
2
+ import { createRecipe } from './create-recipe.js';
3
+
4
+ const metricBlockDefaultVariants = {
5
+ "trendTone": "neutral"
6
+ }
7
+ const metricBlockCompoundVariants = []
8
+
9
+ const metricBlockSlotNames = [
10
+ [
11
+ "root",
12
+ "metric-block__root"
13
+ ],
14
+ [
15
+ "header",
16
+ "metric-block__header"
17
+ ],
18
+ [
19
+ "label",
20
+ "metric-block__label"
21
+ ],
22
+ [
23
+ "icon",
24
+ "metric-block__icon"
25
+ ],
26
+ [
27
+ "skeleton",
28
+ "metric-block__skeleton"
29
+ ],
30
+ [
31
+ "value",
32
+ "metric-block__value"
33
+ ],
34
+ [
35
+ "meta",
36
+ "metric-block__meta"
37
+ ],
38
+ [
39
+ "trend",
40
+ "metric-block__trend"
41
+ ],
42
+ [
43
+ "detail",
44
+ "metric-block__detail"
45
+ ]
46
+ ]
47
+ const metricBlockSlotFns = /* @__PURE__ */ metricBlockSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, metricBlockDefaultVariants, getSlotCompoundVariant(metricBlockCompoundVariants, slotName))])
48
+
49
+ const metricBlockFn = memo((props = {}) => {
50
+ return Object.fromEntries(metricBlockSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
51
+ })
52
+
53
+ const metricBlockVariantKeys = [
54
+ "trendTone"
55
+ ]
56
+ const getVariantProps = (variants) => ({ ...metricBlockDefaultVariants, ...compact(variants) })
57
+
58
+ export const metricBlock = /* @__PURE__ */ Object.assign(metricBlockFn, {
59
+ __recipe__: false,
60
+ __name__: 'metricBlock',
61
+ raw: (props) => props,
62
+ classNameMap: {},
63
+ variantKeys: metricBlockVariantKeys,
64
+ variantMap: {
65
+ "trendTone": [
66
+ "positive",
67
+ "negative",
68
+ "warning",
69
+ "neutral"
70
+ ]
71
+ },
72
+ splitVariantProps(props) {
73
+ return splitProps(props, metricBlockVariantKeys)
74
+ },
75
+ getVariantProps
76
+ })
@@ -0,0 +1,31 @@
1
+ /* eslint-disable */
2
+ import type { ConditionalValue } from '../types/index';
3
+ import type { DistributiveOmit, Pretty } from '../types/system-types';
4
+
5
+ interface ProductListVariant {
6
+
7
+ }
8
+
9
+ type ProductListVariantMap = {
10
+ [key in keyof ProductListVariant]: Array<ProductListVariant[key]>
11
+ }
12
+
13
+ type ProductListSlot = "filters" | "filter" | "filterCount" | "table" | "identity" | "avatar" | "name" | "secondary" | "numeric" | "footer" | "help"
14
+
15
+ export type ProductListVariantProps = {
16
+ [key in keyof ProductListVariant]?: ConditionalValue<ProductListVariant[key]> | undefined
17
+ }
18
+
19
+ export interface ProductListRecipe {
20
+ __slot: ProductListSlot
21
+ __type: ProductListVariantProps
22
+ (props?: ProductListVariantProps): Pretty<Record<ProductListSlot, string>>
23
+ raw: (props?: ProductListVariantProps) => ProductListVariantProps
24
+ variantMap: ProductListVariantMap
25
+ variantKeys: Array<keyof ProductListVariant>
26
+ splitVariantProps<Props extends ProductListVariantProps>(props: Props): [ProductListVariantProps, Pretty<DistributiveOmit<Props, keyof ProductListVariantProps>>]
27
+ getVariantProps: (props?: ProductListVariantProps) => ProductListVariantProps
28
+ }
29
+
30
+
31
+ export declare const productList: ProductListRecipe
@@ -0,0 +1,73 @@
1
+ import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.js';
2
+ import { createRecipe } from './create-recipe.js';
3
+
4
+ const productListDefaultVariants = {}
5
+ const productListCompoundVariants = []
6
+
7
+ const productListSlotNames = [
8
+ [
9
+ "filters",
10
+ "product-list__filters"
11
+ ],
12
+ [
13
+ "filter",
14
+ "product-list__filter"
15
+ ],
16
+ [
17
+ "filterCount",
18
+ "product-list__filterCount"
19
+ ],
20
+ [
21
+ "table",
22
+ "product-list__table"
23
+ ],
24
+ [
25
+ "identity",
26
+ "product-list__identity"
27
+ ],
28
+ [
29
+ "avatar",
30
+ "product-list__avatar"
31
+ ],
32
+ [
33
+ "name",
34
+ "product-list__name"
35
+ ],
36
+ [
37
+ "secondary",
38
+ "product-list__secondary"
39
+ ],
40
+ [
41
+ "numeric",
42
+ "product-list__numeric"
43
+ ],
44
+ [
45
+ "footer",
46
+ "product-list__footer"
47
+ ],
48
+ [
49
+ "help",
50
+ "product-list__help"
51
+ ]
52
+ ]
53
+ const productListSlotFns = /* @__PURE__ */ productListSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, productListDefaultVariants, getSlotCompoundVariant(productListCompoundVariants, slotName))])
54
+
55
+ const productListFn = memo((props = {}) => {
56
+ return Object.fromEntries(productListSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
57
+ })
58
+
59
+ const productListVariantKeys = []
60
+ const getVariantProps = (variants) => ({ ...productListDefaultVariants, ...compact(variants) })
61
+
62
+ export const productList = /* @__PURE__ */ Object.assign(productListFn, {
63
+ __recipe__: false,
64
+ __name__: 'productList',
65
+ raw: (props) => props,
66
+ classNameMap: {},
67
+ variantKeys: productListVariantKeys,
68
+ variantMap: {},
69
+ splitVariantProps(props) {
70
+ return splitProps(props, productListVariantKeys)
71
+ },
72
+ getVariantProps
73
+ })
@@ -0,0 +1,31 @@
1
+ /* eslint-disable */
2
+ import type { ConditionalValue } from '../types/index';
3
+ import type { DistributiveOmit, Pretty } from '../types/system-types';
4
+
5
+ interface ProductSectionVariant {
6
+
7
+ }
8
+
9
+ type ProductSectionVariantMap = {
10
+ [key in keyof ProductSectionVariant]: Array<ProductSectionVariant[key]>
11
+ }
12
+
13
+ type ProductSectionSlot = "root" | "heading" | "title" | "description" | "actions"
14
+
15
+ export type ProductSectionVariantProps = {
16
+ [key in keyof ProductSectionVariant]?: ConditionalValue<ProductSectionVariant[key]> | undefined
17
+ }
18
+
19
+ export interface ProductSectionRecipe {
20
+ __slot: ProductSectionSlot
21
+ __type: ProductSectionVariantProps
22
+ (props?: ProductSectionVariantProps): Pretty<Record<ProductSectionSlot, string>>
23
+ raw: (props?: ProductSectionVariantProps) => ProductSectionVariantProps
24
+ variantMap: ProductSectionVariantMap
25
+ variantKeys: Array<keyof ProductSectionVariant>
26
+ splitVariantProps<Props extends ProductSectionVariantProps>(props: Props): [ProductSectionVariantProps, Pretty<DistributiveOmit<Props, keyof ProductSectionVariantProps>>]
27
+ getVariantProps: (props?: ProductSectionVariantProps) => ProductSectionVariantProps
28
+ }
29
+
30
+
31
+ export declare const productSection: ProductSectionRecipe