@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.
- package/README.md +70 -38
- package/STYLING.md +31 -0
- package/compatibility.json +23 -2
- package/dist/agent-contract.d.ts +37 -0
- package/dist/agent-contract.js +203 -0
- package/dist/agent.d.ts +38 -7
- package/dist/agent.js +98 -59
- package/dist/binding.d.ts +2 -0
- package/dist/binding.js +7 -1
- package/dist/builtin-definitions.d.ts +6 -0
- package/dist/builtin-definitions.js +40 -0
- package/dist/builtin-schemas.d.ts +25 -0
- package/dist/builtin-schemas.js +13 -0
- package/dist/catalog.d.ts +4 -61
- package/dist/catalog.js +20 -44
- package/dist/components/MetricWidget.svelte +12 -8
- package/dist/components/ResourceFormBody.svelte +97 -0
- package/dist/components/ResourceFormBody.svelte.d.ts +13 -0
- package/dist/components/ResourceFormWidget.svelte +19 -0
- package/dist/components/ResourceFormWidget.svelte.d.ts +4 -0
- package/dist/components/ResourceTableWidget.svelte +14 -12
- package/dist/components/SurfaceEditPreview.svelte +107 -0
- package/dist/components/SurfaceEditPreview.svelte.d.ts +20 -0
- package/dist/components/SurfaceRenderer.svelte +120 -163
- package/dist/components/SurfaceRenderer.svelte.d.ts +4 -0
- package/dist/components/SurfaceWorkflowProvider.svelte +22 -0
- package/dist/components/SurfaceWorkflowProvider.svelte.d.ts +17 -0
- package/dist/components/SvarGridWidget.svelte +47 -0
- package/dist/components/SvarGridWidget.svelte.d.ts +4 -0
- package/dist/components/SvarSurfaceProvider.svelte +12 -0
- package/dist/components/SvarSurfaceProvider.svelte.d.ts +11 -0
- package/dist/edits.d.ts +57 -0
- package/dist/edits.js +166 -0
- package/dist/index.d.ts +8 -2
- package/dist/index.js +5 -1
- package/dist/interactive.d.ts +6 -0
- package/dist/interactive.js +15 -0
- package/dist/json.js +1 -2
- package/dist/openui.d.ts +64 -0
- package/dist/openui.js +168 -0
- package/dist/schema.d.ts +108 -0
- package/dist/schema.js +73 -0
- package/dist/server-sqlite.d.ts +1 -0
- package/dist/server-sqlite.js +2 -0
- package/dist/server.d.ts +4 -0
- package/dist/server.js +4 -0
- package/dist/source-cache.d.ts +30 -0
- package/dist/source-cache.js +135 -0
- package/dist/styled-system/css/conditions.js +36 -0
- package/dist/styled-system/css/css.d.ts +22 -0
- package/dist/styled-system/css/css.js +45 -0
- package/dist/styled-system/css/cva.d.ts +6 -0
- package/dist/styled-system/css/cva.js +87 -0
- package/dist/styled-system/css/cx.d.ts +5 -0
- package/dist/styled-system/css/cx.js +15 -0
- package/dist/styled-system/css/index.d.ts +5 -0
- package/dist/styled-system/css/index.js +4 -0
- package/dist/styled-system/css/sva.d.ts +4 -0
- package/dist/styled-system/css/sva.js +46 -0
- package/dist/styled-system/design-contract.d.ts +13 -0
- package/dist/styled-system/design-contract.js +11 -0
- package/dist/styled-system/helpers.js +316 -0
- package/dist/styled-system/patterns/aspect-ratio.d.ts +20 -0
- package/dist/styled-system/patterns/aspect-ratio.js +38 -0
- package/dist/styled-system/patterns/bleed.d.ts +21 -0
- package/dist/styled-system/patterns/bleed.js +24 -0
- package/dist/styled-system/patterns/box.d.ts +20 -0
- package/dist/styled-system/patterns/box.js +15 -0
- package/dist/styled-system/patterns/center.d.ts +20 -0
- package/dist/styled-system/patterns/center.js +21 -0
- package/dist/styled-system/patterns/circle.d.ts +20 -0
- package/dist/styled-system/patterns/circle.js +25 -0
- package/dist/styled-system/patterns/container.d.ts +20 -0
- package/dist/styled-system/patterns/container.js +21 -0
- package/dist/styled-system/patterns/cq.d.ts +21 -0
- package/dist/styled-system/patterns/cq.js +21 -0
- package/dist/styled-system/patterns/divider.d.ts +22 -0
- package/dist/styled-system/patterns/divider.js +25 -0
- package/dist/styled-system/patterns/flex.d.ts +26 -0
- package/dist/styled-system/patterns/flex.js +26 -0
- package/dist/styled-system/patterns/float.d.ts +23 -0
- package/dist/styled-system/patterns/float.js +52 -0
- package/dist/styled-system/patterns/grid-item.d.ts +25 -0
- package/dist/styled-system/patterns/grid-item.js +25 -0
- package/dist/styled-system/patterns/grid.d.ts +24 -0
- package/dist/styled-system/patterns/grid.js +27 -0
- package/dist/styled-system/patterns/hstack.d.ts +21 -0
- package/dist/styled-system/patterns/hstack.js +24 -0
- package/dist/styled-system/patterns/index.d.ts +21 -0
- package/dist/styled-system/patterns/index.js +20 -0
- package/dist/styled-system/patterns/link-overlay.d.ts +20 -0
- package/dist/styled-system/patterns/link-overlay.js +24 -0
- package/dist/styled-system/patterns/spacer.d.ts +20 -0
- package/dist/styled-system/patterns/spacer.js +25 -0
- package/dist/styled-system/patterns/square.d.ts +20 -0
- package/dist/styled-system/patterns/square.js +24 -0
- package/dist/styled-system/patterns/stack.d.ts +23 -0
- package/dist/styled-system/patterns/stack.js +24 -0
- package/dist/styled-system/patterns/visually-hidden.d.ts +20 -0
- package/dist/styled-system/patterns/visually-hidden.js +18 -0
- package/dist/styled-system/patterns/vstack.d.ts +21 -0
- package/dist/styled-system/patterns/vstack.js +24 -0
- package/dist/styled-system/patterns/wrap.d.ts +24 -0
- package/dist/styled-system/patterns/wrap.js +25 -0
- package/dist/styled-system/recipes/content-header.d.ts +31 -0
- package/dist/styled-system/recipes/content-header.js +65 -0
- package/dist/styled-system/recipes/content-page.d.ts +34 -0
- package/dist/styled-system/recipes/content-page.js +43 -0
- package/dist/styled-system/recipes/create-recipe.js +82 -0
- package/dist/styled-system/recipes/index.d.ts +17 -0
- package/dist/styled-system/recipes/index.js +16 -0
- package/dist/styled-system/recipes/metric-block.d.ts +34 -0
- package/dist/styled-system/recipes/metric-block.js +76 -0
- package/dist/styled-system/recipes/product-list.d.ts +31 -0
- package/dist/styled-system/recipes/product-list.js +73 -0
- package/dist/styled-system/recipes/product-section.d.ts +31 -0
- package/dist/styled-system/recipes/product-section.js +49 -0
- package/dist/styled-system/recipes/product-settings-row.d.ts +34 -0
- package/dist/styled-system/recipes/product-settings-row.js +58 -0
- package/dist/styled-system/recipes/product-settings.d.ts +31 -0
- package/dist/styled-system/recipes/product-settings.js +57 -0
- package/dist/styled-system/recipes/product-status.d.ts +34 -0
- package/dist/styled-system/recipes/product-status.js +45 -0
- package/dist/styled-system/recipes/product-toolbar.d.ts +31 -0
- package/dist/styled-system/recipes/product-toolbar.js +41 -0
- package/dist/styled-system/recipes/product-workspace.d.ts +34 -0
- package/dist/styled-system/recipes/product-workspace.js +58 -0
- package/dist/styled-system/recipes/surface-metric.d.ts +38 -0
- package/dist/styled-system/recipes/surface-metric.js +63 -0
- package/dist/styled-system/recipes/surface-table.d.ts +34 -0
- package/dist/styled-system/recipes/surface-table.js +62 -0
- package/dist/styled-system/recipes/ui-badge.d.ts +31 -0
- package/dist/styled-system/recipes/ui-badge.js +38 -0
- package/dist/styled-system/recipes/ui-button.d.ts +32 -0
- package/dist/styled-system/recipes/ui-button.js +43 -0
- package/dist/styled-system/recipes/ui-input.d.ts +31 -0
- package/dist/styled-system/recipes/ui-input.js +49 -0
- package/dist/styled-system/recipes/ui-textarea.d.ts +31 -0
- package/dist/styled-system/recipes/ui-textarea.js +24 -0
- package/dist/styled-system/styles.css +1257 -0
- package/dist/styled-system/tokens/index.d.ts +9 -0
- package/dist/styled-system/tokens/index.js +268 -0
- package/dist/styled-system/tokens/tokens.d.ts +36 -0
- package/dist/styled-system/types/composition.d.ts +227 -0
- package/dist/styled-system/types/conditions.d.ts +236 -0
- package/dist/styled-system/types/csstype.d.ts +22570 -0
- package/dist/styled-system/types/index.d.ts +6 -0
- package/dist/styled-system/types/parts.d.ts +8 -0
- package/dist/styled-system/types/pattern.d.ts +78 -0
- package/dist/styled-system/types/prop-type.d.ts +223 -0
- package/dist/styled-system/types/recipe.d.ts +181 -0
- package/dist/styled-system/types/selectors.d.ts +59 -0
- package/dist/styled-system/types/static-css.d.ts +56 -0
- package/dist/styled-system/types/style-props.d.ts +8088 -0
- package/dist/styled-system/types/system-types.d.ts +151 -0
- package/dist/styles/editor.css +124 -0
- package/dist/styles/editor.generated.d.ts +8 -0
- package/dist/styles/editor.generated.js +9 -0
- package/dist/styles.css +1262 -0
- package/dist/svar-catalog.d.ts +3 -0
- package/dist/svar-catalog.js +7 -0
- package/dist/svar-context.d.ts +9 -0
- package/dist/svar-context.js +1 -0
- package/dist/svar-schema.d.ts +21 -0
- package/dist/svar-schema.js +36 -0
- package/dist/svar.d.ts +4 -0
- package/dist/svar.js +3 -0
- package/dist/svelte.d.ts +4 -2
- package/dist/svelte.js +2 -1
- package/dist/types.d.ts +5 -1
- package/dist/validation.js +2 -102
- package/dist/wire.d.ts +13 -0
- package/dist/wire.js +30 -0
- package/dist/workflows/action-contracts.d.ts +7 -0
- package/dist/workflows/action-contracts.js +54 -0
- package/dist/workflows/catalog.d.ts +20 -0
- package/dist/workflows/catalog.js +50 -0
- package/dist/workflows/client.d.ts +45 -0
- package/dist/workflows/client.js +125 -0
- package/dist/workflows/context.d.ts +9 -0
- package/dist/workflows/context.js +5 -0
- package/dist/workflows/openui-guard.d.ts +19 -0
- package/dist/workflows/openui-guard.js +209 -0
- package/dist/workflows/service.d.ts +58 -0
- package/dist/workflows/service.js +296 -0
- package/dist/workflows/sqlite-store.d.ts +20 -0
- package/dist/workflows/sqlite-store.js +91 -0
- package/dist/workflows/types.d.ts +103 -0
- package/dist/workflows/types.js +8 -0
- package/dist/workflows.d.ts +5 -0
- package/dist/workflows.js +4 -0
- 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
|