@svadmin/surface 0.8.19 → 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 (191) 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/openui.d.ts +64 -0
  39. package/dist/openui.js +168 -0
  40. package/dist/schema.d.ts +108 -0
  41. package/dist/schema.js +73 -0
  42. package/dist/server-sqlite.d.ts +1 -0
  43. package/dist/server-sqlite.js +2 -0
  44. package/dist/server.d.ts +4 -0
  45. package/dist/server.js +4 -0
  46. package/dist/source-cache.d.ts +30 -0
  47. package/dist/source-cache.js +135 -0
  48. package/dist/styled-system/css/conditions.js +36 -0
  49. package/dist/styled-system/css/css.d.ts +22 -0
  50. package/dist/styled-system/css/css.js +45 -0
  51. package/dist/styled-system/css/cva.d.ts +6 -0
  52. package/dist/styled-system/css/cva.js +87 -0
  53. package/dist/styled-system/css/cx.d.ts +5 -0
  54. package/dist/styled-system/css/cx.js +15 -0
  55. package/dist/styled-system/css/index.d.ts +5 -0
  56. package/dist/styled-system/css/index.js +4 -0
  57. package/dist/styled-system/css/sva.d.ts +4 -0
  58. package/dist/styled-system/css/sva.js +46 -0
  59. package/dist/styled-system/design-contract.d.ts +13 -0
  60. package/dist/styled-system/design-contract.js +11 -0
  61. package/dist/styled-system/helpers.js +316 -0
  62. package/dist/styled-system/patterns/aspect-ratio.d.ts +20 -0
  63. package/dist/styled-system/patterns/aspect-ratio.js +38 -0
  64. package/dist/styled-system/patterns/bleed.d.ts +21 -0
  65. package/dist/styled-system/patterns/bleed.js +24 -0
  66. package/dist/styled-system/patterns/box.d.ts +20 -0
  67. package/dist/styled-system/patterns/box.js +15 -0
  68. package/dist/styled-system/patterns/center.d.ts +20 -0
  69. package/dist/styled-system/patterns/center.js +21 -0
  70. package/dist/styled-system/patterns/circle.d.ts +20 -0
  71. package/dist/styled-system/patterns/circle.js +25 -0
  72. package/dist/styled-system/patterns/container.d.ts +20 -0
  73. package/dist/styled-system/patterns/container.js +21 -0
  74. package/dist/styled-system/patterns/cq.d.ts +21 -0
  75. package/dist/styled-system/patterns/cq.js +21 -0
  76. package/dist/styled-system/patterns/divider.d.ts +22 -0
  77. package/dist/styled-system/patterns/divider.js +25 -0
  78. package/dist/styled-system/patterns/flex.d.ts +26 -0
  79. package/dist/styled-system/patterns/flex.js +26 -0
  80. package/dist/styled-system/patterns/float.d.ts +23 -0
  81. package/dist/styled-system/patterns/float.js +52 -0
  82. package/dist/styled-system/patterns/grid-item.d.ts +25 -0
  83. package/dist/styled-system/patterns/grid-item.js +25 -0
  84. package/dist/styled-system/patterns/grid.d.ts +24 -0
  85. package/dist/styled-system/patterns/grid.js +27 -0
  86. package/dist/styled-system/patterns/hstack.d.ts +21 -0
  87. package/dist/styled-system/patterns/hstack.js +24 -0
  88. package/dist/styled-system/patterns/index.d.ts +21 -0
  89. package/dist/styled-system/patterns/index.js +20 -0
  90. package/dist/styled-system/patterns/link-overlay.d.ts +20 -0
  91. package/dist/styled-system/patterns/link-overlay.js +24 -0
  92. package/dist/styled-system/patterns/spacer.d.ts +20 -0
  93. package/dist/styled-system/patterns/spacer.js +25 -0
  94. package/dist/styled-system/patterns/square.d.ts +20 -0
  95. package/dist/styled-system/patterns/square.js +24 -0
  96. package/dist/styled-system/patterns/stack.d.ts +23 -0
  97. package/dist/styled-system/patterns/stack.js +24 -0
  98. package/dist/styled-system/patterns/visually-hidden.d.ts +20 -0
  99. package/dist/styled-system/patterns/visually-hidden.js +18 -0
  100. package/dist/styled-system/patterns/vstack.d.ts +21 -0
  101. package/dist/styled-system/patterns/vstack.js +24 -0
  102. package/dist/styled-system/patterns/wrap.d.ts +24 -0
  103. package/dist/styled-system/patterns/wrap.js +25 -0
  104. package/dist/styled-system/recipes/content-header.d.ts +31 -0
  105. package/dist/styled-system/recipes/content-header.js +65 -0
  106. package/dist/styled-system/recipes/content-page.d.ts +34 -0
  107. package/dist/styled-system/recipes/content-page.js +43 -0
  108. package/dist/styled-system/recipes/create-recipe.js +82 -0
  109. package/dist/styled-system/recipes/index.d.ts +17 -0
  110. package/dist/styled-system/recipes/index.js +16 -0
  111. package/dist/styled-system/recipes/metric-block.d.ts +34 -0
  112. package/dist/styled-system/recipes/metric-block.js +76 -0
  113. package/dist/styled-system/recipes/product-list.d.ts +31 -0
  114. package/dist/styled-system/recipes/product-list.js +73 -0
  115. package/dist/styled-system/recipes/product-section.d.ts +31 -0
  116. package/dist/styled-system/recipes/product-section.js +49 -0
  117. package/dist/styled-system/recipes/product-settings-row.d.ts +34 -0
  118. package/dist/styled-system/recipes/product-settings-row.js +58 -0
  119. package/dist/styled-system/recipes/product-settings.d.ts +31 -0
  120. package/dist/styled-system/recipes/product-settings.js +57 -0
  121. package/dist/styled-system/recipes/product-status.d.ts +34 -0
  122. package/dist/styled-system/recipes/product-status.js +45 -0
  123. package/dist/styled-system/recipes/product-toolbar.d.ts +31 -0
  124. package/dist/styled-system/recipes/product-toolbar.js +41 -0
  125. package/dist/styled-system/recipes/product-workspace.d.ts +34 -0
  126. package/dist/styled-system/recipes/product-workspace.js +58 -0
  127. package/dist/styled-system/recipes/surface-metric.d.ts +38 -0
  128. package/dist/styled-system/recipes/surface-metric.js +63 -0
  129. package/dist/styled-system/recipes/surface-table.d.ts +34 -0
  130. package/dist/styled-system/recipes/surface-table.js +62 -0
  131. package/dist/styled-system/recipes/ui-badge.d.ts +31 -0
  132. package/dist/styled-system/recipes/ui-badge.js +38 -0
  133. package/dist/styled-system/recipes/ui-button.d.ts +32 -0
  134. package/dist/styled-system/recipes/ui-button.js +43 -0
  135. package/dist/styled-system/recipes/ui-input.d.ts +31 -0
  136. package/dist/styled-system/recipes/ui-input.js +49 -0
  137. package/dist/styled-system/recipes/ui-textarea.d.ts +31 -0
  138. package/dist/styled-system/recipes/ui-textarea.js +24 -0
  139. package/dist/styled-system/styles.css +1257 -0
  140. package/dist/styled-system/tokens/index.d.ts +9 -0
  141. package/dist/styled-system/tokens/index.js +268 -0
  142. package/dist/styled-system/tokens/tokens.d.ts +36 -0
  143. package/dist/styled-system/types/composition.d.ts +227 -0
  144. package/dist/styled-system/types/conditions.d.ts +236 -0
  145. package/dist/styled-system/types/csstype.d.ts +22570 -0
  146. package/dist/styled-system/types/index.d.ts +6 -0
  147. package/dist/styled-system/types/parts.d.ts +8 -0
  148. package/dist/styled-system/types/pattern.d.ts +78 -0
  149. package/dist/styled-system/types/prop-type.d.ts +223 -0
  150. package/dist/styled-system/types/recipe.d.ts +181 -0
  151. package/dist/styled-system/types/selectors.d.ts +59 -0
  152. package/dist/styled-system/types/static-css.d.ts +56 -0
  153. package/dist/styled-system/types/style-props.d.ts +8088 -0
  154. package/dist/styled-system/types/system-types.d.ts +151 -0
  155. package/dist/styles/editor.css +124 -0
  156. package/dist/styles/editor.generated.d.ts +8 -0
  157. package/dist/styles/editor.generated.js +9 -0
  158. package/dist/styles.css +1262 -0
  159. package/dist/svar-catalog.d.ts +3 -0
  160. package/dist/svar-catalog.js +7 -0
  161. package/dist/svar-context.d.ts +9 -0
  162. package/dist/svar-context.js +1 -0
  163. package/dist/svar-schema.d.ts +21 -0
  164. package/dist/svar-schema.js +36 -0
  165. package/dist/svar.d.ts +4 -0
  166. package/dist/svar.js +3 -0
  167. package/dist/svelte.d.ts +4 -2
  168. package/dist/svelte.js +2 -1
  169. package/dist/types.d.ts +4 -0
  170. package/dist/validation.js +2 -102
  171. package/dist/wire.d.ts +13 -0
  172. package/dist/wire.js +30 -0
  173. package/dist/workflows/action-contracts.d.ts +7 -0
  174. package/dist/workflows/action-contracts.js +54 -0
  175. package/dist/workflows/catalog.d.ts +20 -0
  176. package/dist/workflows/catalog.js +50 -0
  177. package/dist/workflows/client.d.ts +45 -0
  178. package/dist/workflows/client.js +125 -0
  179. package/dist/workflows/context.d.ts +9 -0
  180. package/dist/workflows/context.js +5 -0
  181. package/dist/workflows/openui-guard.d.ts +19 -0
  182. package/dist/workflows/openui-guard.js +209 -0
  183. package/dist/workflows/service.d.ts +58 -0
  184. package/dist/workflows/service.js +296 -0
  185. package/dist/workflows/sqlite-store.d.ts +20 -0
  186. package/dist/workflows/sqlite-store.js +91 -0
  187. package/dist/workflows/types.d.ts +103 -0
  188. package/dist/workflows/types.js +8 -0
  189. package/dist/workflows.d.ts +5 -0
  190. package/dist/workflows.js +4 -0
  191. package/package.json +52 -8
@@ -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 UiBadgeVariant {
6
+ variant: "default" | "secondary" | "destructive" | "subtle" | "subtle-success" | "subtle-warning" | "subtle-destructive" | "subtle-pill" | "outline" | "ghost" | "link"
7
+ }
8
+
9
+ type UiBadgeVariantMap = {
10
+ [key in keyof UiBadgeVariant]: Array<UiBadgeVariant[key]>
11
+ }
12
+
13
+
14
+
15
+ export type UiBadgeVariantProps = {
16
+ [key in keyof UiBadgeVariant]?: ConditionalValue<UiBadgeVariant[key]> | undefined
17
+ }
18
+
19
+ export interface UiBadgeRecipe {
20
+
21
+ __type: UiBadgeVariantProps
22
+ (props?: UiBadgeVariantProps): string
23
+ raw: (props?: UiBadgeVariantProps) => UiBadgeVariantProps
24
+ variantMap: UiBadgeVariantMap
25
+ variantKeys: Array<keyof UiBadgeVariant>
26
+ splitVariantProps<Props extends UiBadgeVariantProps>(props: Props): [UiBadgeVariantProps, Pretty<DistributiveOmit<Props, keyof UiBadgeVariantProps>>]
27
+ getVariantProps: (props?: UiBadgeVariantProps) => UiBadgeVariantProps
28
+ }
29
+
30
+
31
+ export declare const uiBadge: UiBadgeRecipe
@@ -0,0 +1,38 @@
1
+ import { memo, splitProps } from '../helpers.js';
2
+ import { createRecipe, mergeRecipes } from './create-recipe.js';
3
+
4
+ const uiBadgeFn = /* @__PURE__ */ createRecipe('ui-badge', {}, [])
5
+
6
+ const uiBadgeVariantMap = {
7
+ "variant": [
8
+ "default",
9
+ "secondary",
10
+ "destructive",
11
+ "subtle",
12
+ "subtle-success",
13
+ "subtle-warning",
14
+ "subtle-destructive",
15
+ "subtle-pill",
16
+ "outline",
17
+ "ghost",
18
+ "link"
19
+ ]
20
+ }
21
+
22
+ const uiBadgeVariantKeys = Object.keys(uiBadgeVariantMap)
23
+
24
+ export const uiBadge = /* @__PURE__ */ Object.assign(memo(uiBadgeFn.recipeFn), {
25
+ __recipe__: true,
26
+ __name__: 'uiBadge',
27
+ __getCompoundVariantCss__: uiBadgeFn.__getCompoundVariantCss__,
28
+ raw: (props) => props,
29
+ variantKeys: uiBadgeVariantKeys,
30
+ variantMap: uiBadgeVariantMap,
31
+ merge(recipe) {
32
+ return mergeRecipes(this, recipe)
33
+ },
34
+ splitVariantProps(props) {
35
+ return splitProps(props, uiBadgeVariantKeys)
36
+ },
37
+ getVariantProps: uiBadgeFn.getVariantProps,
38
+ })
@@ -0,0 +1,32 @@
1
+ /* eslint-disable */
2
+ import type { ConditionalValue } from '../types/index';
3
+ import type { DistributiveOmit, Pretty } from '../types/system-types';
4
+
5
+ interface UiButtonVariant {
6
+ variant: "default" | "outline" | "secondary" | "ghost" | "destructive" | "link"
7
+ size: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg"
8
+ }
9
+
10
+ type UiButtonVariantMap = {
11
+ [key in keyof UiButtonVariant]: Array<UiButtonVariant[key]>
12
+ }
13
+
14
+
15
+
16
+ export type UiButtonVariantProps = {
17
+ [key in keyof UiButtonVariant]?: ConditionalValue<UiButtonVariant[key]> | undefined
18
+ }
19
+
20
+ export interface UiButtonRecipe {
21
+
22
+ __type: UiButtonVariantProps
23
+ (props?: UiButtonVariantProps): string
24
+ raw: (props?: UiButtonVariantProps) => UiButtonVariantProps
25
+ variantMap: UiButtonVariantMap
26
+ variantKeys: Array<keyof UiButtonVariant>
27
+ splitVariantProps<Props extends UiButtonVariantProps>(props: Props): [UiButtonVariantProps, Pretty<DistributiveOmit<Props, keyof UiButtonVariantProps>>]
28
+ getVariantProps: (props?: UiButtonVariantProps) => UiButtonVariantProps
29
+ }
30
+
31
+
32
+ export declare const uiButton: UiButtonRecipe
@@ -0,0 +1,43 @@
1
+ import { memo, splitProps } from '../helpers.js';
2
+ import { createRecipe, mergeRecipes } from './create-recipe.js';
3
+
4
+ const uiButtonFn = /* @__PURE__ */ createRecipe('ui-button', {}, [])
5
+
6
+ const uiButtonVariantMap = {
7
+ "variant": [
8
+ "default",
9
+ "outline",
10
+ "secondary",
11
+ "ghost",
12
+ "destructive",
13
+ "link"
14
+ ],
15
+ "size": [
16
+ "default",
17
+ "xs",
18
+ "sm",
19
+ "lg",
20
+ "icon",
21
+ "icon-xs",
22
+ "icon-sm",
23
+ "icon-lg"
24
+ ]
25
+ }
26
+
27
+ const uiButtonVariantKeys = Object.keys(uiButtonVariantMap)
28
+
29
+ export const uiButton = /* @__PURE__ */ Object.assign(memo(uiButtonFn.recipeFn), {
30
+ __recipe__: true,
31
+ __name__: 'uiButton',
32
+ __getCompoundVariantCss__: uiButtonFn.__getCompoundVariantCss__,
33
+ raw: (props) => props,
34
+ variantKeys: uiButtonVariantKeys,
35
+ variantMap: uiButtonVariantMap,
36
+ merge(recipe) {
37
+ return mergeRecipes(this, recipe)
38
+ },
39
+ splitVariantProps(props) {
40
+ return splitProps(props, uiButtonVariantKeys)
41
+ },
42
+ getVariantProps: uiButtonFn.getVariantProps,
43
+ })
@@ -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 UiInputVariant {
6
+
7
+ }
8
+
9
+ type UiInputVariantMap = {
10
+ [key in keyof UiInputVariant]: Array<UiInputVariant[key]>
11
+ }
12
+
13
+ type UiInputSlot = "root" | "control" | "visual" | "button" | "name"
14
+
15
+ export type UiInputVariantProps = {
16
+ [key in keyof UiInputVariant]?: ConditionalValue<UiInputVariant[key]> | undefined
17
+ }
18
+
19
+ export interface UiInputRecipe {
20
+ __slot: UiInputSlot
21
+ __type: UiInputVariantProps
22
+ (props?: UiInputVariantProps): Pretty<Record<UiInputSlot, string>>
23
+ raw: (props?: UiInputVariantProps) => UiInputVariantProps
24
+ variantMap: UiInputVariantMap
25
+ variantKeys: Array<keyof UiInputVariant>
26
+ splitVariantProps<Props extends UiInputVariantProps>(props: Props): [UiInputVariantProps, Pretty<DistributiveOmit<Props, keyof UiInputVariantProps>>]
27
+ getVariantProps: (props?: UiInputVariantProps) => UiInputVariantProps
28
+ }
29
+
30
+
31
+ export declare const uiInput: UiInputRecipe
@@ -0,0 +1,49 @@
1
+ import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.js';
2
+ import { createRecipe } from './create-recipe.js';
3
+
4
+ const uiInputDefaultVariants = {}
5
+ const uiInputCompoundVariants = []
6
+
7
+ const uiInputSlotNames = [
8
+ [
9
+ "root",
10
+ "ui-input__root"
11
+ ],
12
+ [
13
+ "control",
14
+ "ui-input__control"
15
+ ],
16
+ [
17
+ "visual",
18
+ "ui-input__visual"
19
+ ],
20
+ [
21
+ "button",
22
+ "ui-input__button"
23
+ ],
24
+ [
25
+ "name",
26
+ "ui-input__name"
27
+ ]
28
+ ]
29
+ const uiInputSlotFns = /* @__PURE__ */ uiInputSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, uiInputDefaultVariants, getSlotCompoundVariant(uiInputCompoundVariants, slotName))])
30
+
31
+ const uiInputFn = memo((props = {}) => {
32
+ return Object.fromEntries(uiInputSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
33
+ })
34
+
35
+ const uiInputVariantKeys = []
36
+ const getVariantProps = (variants) => ({ ...uiInputDefaultVariants, ...compact(variants) })
37
+
38
+ export const uiInput = /* @__PURE__ */ Object.assign(uiInputFn, {
39
+ __recipe__: false,
40
+ __name__: 'uiInput',
41
+ raw: (props) => props,
42
+ classNameMap: {},
43
+ variantKeys: uiInputVariantKeys,
44
+ variantMap: {},
45
+ splitVariantProps(props) {
46
+ return splitProps(props, uiInputVariantKeys)
47
+ },
48
+ getVariantProps
49
+ })
@@ -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 UiTextareaVariant {
6
+
7
+ }
8
+
9
+ type UiTextareaVariantMap = {
10
+ [key in keyof UiTextareaVariant]: Array<UiTextareaVariant[key]>
11
+ }
12
+
13
+
14
+
15
+ export type UiTextareaVariantProps = {
16
+ [key in keyof UiTextareaVariant]?: ConditionalValue<UiTextareaVariant[key]> | undefined
17
+ }
18
+
19
+ export interface UiTextareaRecipe {
20
+
21
+ __type: UiTextareaVariantProps
22
+ (props?: UiTextareaVariantProps): string
23
+ raw: (props?: UiTextareaVariantProps) => UiTextareaVariantProps
24
+ variantMap: UiTextareaVariantMap
25
+ variantKeys: Array<keyof UiTextareaVariant>
26
+ splitVariantProps<Props extends UiTextareaVariantProps>(props: Props): [UiTextareaVariantProps, Pretty<DistributiveOmit<Props, keyof UiTextareaVariantProps>>]
27
+ getVariantProps: (props?: UiTextareaVariantProps) => UiTextareaVariantProps
28
+ }
29
+
30
+
31
+ export declare const uiTextarea: UiTextareaRecipe
@@ -0,0 +1,24 @@
1
+ import { memo, splitProps } from '../helpers.js';
2
+ import { createRecipe, mergeRecipes } from './create-recipe.js';
3
+
4
+ const uiTextareaFn = /* @__PURE__ */ createRecipe('ui-textarea', {}, [])
5
+
6
+ const uiTextareaVariantMap = {}
7
+
8
+ const uiTextareaVariantKeys = Object.keys(uiTextareaVariantMap)
9
+
10
+ export const uiTextarea = /* @__PURE__ */ Object.assign(memo(uiTextareaFn.recipeFn), {
11
+ __recipe__: true,
12
+ __name__: 'uiTextarea',
13
+ __getCompoundVariantCss__: uiTextareaFn.__getCompoundVariantCss__,
14
+ raw: (props) => props,
15
+ variantKeys: uiTextareaVariantKeys,
16
+ variantMap: uiTextareaVariantMap,
17
+ merge(recipe) {
18
+ return mergeRecipes(this, recipe)
19
+ },
20
+ splitVariantProps(props) {
21
+ return splitProps(props, uiTextareaVariantKeys)
22
+ },
23
+ getVariantProps: uiTextareaFn.getVariantProps,
24
+ })