@discourser/design-system 0.1.7 → 0.2.1
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 +411 -16
- package/dist/index.cjs +776 -145
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21793 -151
- package/dist/index.d.ts +21793 -151
- package/dist/index.js +753 -142
- package/dist/index.js.map +1 -1
- package/package.json +10 -7
- package/styled-system/css/conditions.mjs +1 -1
- package/styled-system/css/css.mjs +1 -1
- package/styled-system/css/sva.mjs +9 -4
- package/styled-system/helpers.mjs +12 -20
- package/styled-system/jsx/create-style-context.d.ts +54 -0
- package/styled-system/jsx/create-style-context.mjs +118 -0
- package/styled-system/jsx/factory.mjs +14 -5
- package/styled-system/jsx/index.d.ts +1 -0
- package/styled-system/jsx/index.mjs +1 -0
- package/styled-system/jsx/is-valid-prop.mjs +2 -2
- package/styled-system/patterns/aspect-ratio.d.ts +0 -1
- package/styled-system/patterns/bleed.d.ts +0 -1
- package/styled-system/patterns/box.d.ts +0 -1
- package/styled-system/patterns/center.d.ts +0 -1
- package/styled-system/patterns/circle.d.ts +0 -1
- package/styled-system/patterns/container.d.ts +0 -1
- package/styled-system/patterns/cq.d.ts +0 -1
- package/styled-system/patterns/divider.d.ts +1 -2
- package/styled-system/patterns/flex.d.ts +0 -1
- package/styled-system/patterns/float.d.ts +1 -2
- package/styled-system/patterns/grid-item.d.ts +0 -1
- package/styled-system/patterns/grid.d.ts +0 -1
- package/styled-system/patterns/grid.mjs +1 -1
- package/styled-system/patterns/hstack.d.ts +0 -1
- package/styled-system/patterns/hstack.mjs +1 -1
- package/styled-system/patterns/link-overlay.d.ts +0 -1
- package/styled-system/patterns/spacer.d.ts +0 -1
- package/styled-system/patterns/square.d.ts +0 -1
- package/styled-system/patterns/stack.d.ts +0 -1
- package/styled-system/patterns/stack.mjs +1 -1
- package/styled-system/patterns/visually-hidden.d.ts +0 -1
- package/styled-system/patterns/vstack.d.ts +0 -1
- package/styled-system/patterns/vstack.mjs +1 -1
- package/styled-system/patterns/wrap.d.ts +0 -1
- package/styled-system/patterns/wrap.mjs +1 -1
- package/styled-system/recipes/absolute-center.d.ts +34 -0
- package/styled-system/recipes/absolute-center.mjs +32 -0
- package/styled-system/recipes/accordion.d.ts +38 -0
- package/styled-system/recipes/accordion.mjs +67 -0
- package/styled-system/recipes/avatar.d.ts +42 -0
- package/styled-system/recipes/avatar.mjs +71 -0
- package/styled-system/recipes/badge.d.ts +38 -0
- package/styled-system/recipes/badge.mjs +41 -0
- package/styled-system/recipes/button.d.ts +6 -7
- package/styled-system/recipes/button.mjs +11 -7
- package/styled-system/recipes/card.d.ts +6 -11
- package/styled-system/recipes/card.mjs +50 -23
- package/styled-system/recipes/checkbox.d.ts +38 -0
- package/styled-system/recipes/checkbox.mjs +68 -0
- package/styled-system/recipes/dialog.d.ts +13 -6
- package/styled-system/recipes/dialog.mjs +35 -3
- package/styled-system/recipes/drawer.d.ts +38 -0
- package/styled-system/recipes/drawer.mjs +90 -0
- package/styled-system/recipes/field.d.ts +31 -0
- package/styled-system/recipes/field.mjs +61 -0
- package/styled-system/recipes/group.d.ts +36 -0
- package/styled-system/recipes/group.mjs +72 -0
- package/styled-system/recipes/index.d.ts +21 -3
- package/styled-system/recipes/index.mjs +21 -3
- package/styled-system/recipes/input.d.ts +6 -8
- package/styled-system/recipes/input.mjs +12 -9
- package/styled-system/recipes/popover.d.ts +31 -0
- package/styled-system/recipes/popover.mjs +81 -0
- package/styled-system/recipes/progress.d.ts +44 -0
- package/styled-system/recipes/progress.mjs +98 -0
- package/styled-system/recipes/radio-group.d.ts +38 -0
- package/styled-system/recipes/radio-group.mjs +68 -0
- package/styled-system/recipes/select.d.ts +38 -0
- package/styled-system/recipes/select.mjs +111 -0
- package/styled-system/recipes/skeleton.d.ts +39 -0
- package/styled-system/recipes/skeleton.mjs +40 -0
- package/styled-system/recipes/slider.d.ts +42 -0
- package/styled-system/recipes/slider.mjs +94 -0
- package/styled-system/recipes/spinner.d.ts +34 -0
- package/styled-system/recipes/spinner.mjs +36 -0
- package/styled-system/recipes/switch-component.d.ts +38 -0
- package/styled-system/recipes/switch-component.mjs +65 -0
- package/styled-system/recipes/tabs.d.ts +39 -0
- package/styled-system/recipes/tabs.mjs +71 -0
- package/styled-system/recipes/textarea.d.ts +38 -0
- package/styled-system/recipes/textarea.mjs +41 -0
- package/styled-system/recipes/toast.d.ts +31 -0
- package/styled-system/recipes/toast.mjs +53 -0
- package/styled-system/recipes/tooltip.d.ts +31 -0
- package/styled-system/recipes/tooltip.mjs +49 -0
- package/styled-system/tokens/index.mjs +3483 -635
- package/styled-system/tokens/tokens.d.ts +31 -19
- package/styled-system/types/composition.d.ts +83 -23
- package/styled-system/types/conditions.d.ts +15 -11
- package/styled-system/types/jsx.d.ts +27 -10
- package/styled-system/types/pattern.d.ts +4 -4
- package/styled-system/types/prop-type.d.ts +30 -3
- package/styled-system/types/style-props.d.ts +262 -225
- package/styled-system/types/system-types.d.ts +162 -2
- package/styled-system/recipes/icon-button.d.ts +0 -39
- package/styled-system/recipes/icon-button.mjs +0 -39
- package/styled-system/recipes/switch-control.d.ts +0 -35
- package/styled-system/recipes/switch-control.mjs +0 -53
- package/styled-system/recipes/switch.d.ts +0 -35
- package/styled-system/recipes/switch.mjs +0 -53
|
@@ -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 PopoverVariant {
|
|
6
|
+
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
type PopoverVariantMap = {
|
|
10
|
+
[key in keyof PopoverVariant]: Array<PopoverVariant[key]>
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
type PopoverSlot = "arrow" | "arrowTip" | "anchor" | "trigger" | "indicator" | "positioner" | "content" | "title" | "description" | "closeTrigger" | "header" | "body" | "footer"
|
|
14
|
+
|
|
15
|
+
export type PopoverVariantProps = {
|
|
16
|
+
[key in keyof PopoverVariant]?: ConditionalValue<PopoverVariant[key]> | undefined
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface PopoverRecipe {
|
|
20
|
+
__slot: PopoverSlot
|
|
21
|
+
__type: PopoverVariantProps
|
|
22
|
+
(props?: PopoverVariantProps): Pretty<Record<PopoverSlot, string>>
|
|
23
|
+
raw: (props?: PopoverVariantProps) => PopoverVariantProps
|
|
24
|
+
variantMap: PopoverVariantMap
|
|
25
|
+
variantKeys: Array<keyof PopoverVariant>
|
|
26
|
+
splitVariantProps<Props extends PopoverVariantProps>(props: Props): [PopoverVariantProps, Pretty<DistributiveOmit<Props, keyof PopoverVariantProps>>]
|
|
27
|
+
getVariantProps: (props?: PopoverVariantProps) => PopoverVariantProps
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
export declare const popover: PopoverRecipe
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
|
|
2
|
+
import { createRecipe } from './create-recipe.mjs';
|
|
3
|
+
|
|
4
|
+
const popoverDefaultVariants = {}
|
|
5
|
+
const popoverCompoundVariants = []
|
|
6
|
+
|
|
7
|
+
const popoverSlotNames = [
|
|
8
|
+
[
|
|
9
|
+
"arrow",
|
|
10
|
+
"popover__arrow"
|
|
11
|
+
],
|
|
12
|
+
[
|
|
13
|
+
"arrowTip",
|
|
14
|
+
"popover__arrowTip"
|
|
15
|
+
],
|
|
16
|
+
[
|
|
17
|
+
"anchor",
|
|
18
|
+
"popover__anchor"
|
|
19
|
+
],
|
|
20
|
+
[
|
|
21
|
+
"trigger",
|
|
22
|
+
"popover__trigger"
|
|
23
|
+
],
|
|
24
|
+
[
|
|
25
|
+
"indicator",
|
|
26
|
+
"popover__indicator"
|
|
27
|
+
],
|
|
28
|
+
[
|
|
29
|
+
"positioner",
|
|
30
|
+
"popover__positioner"
|
|
31
|
+
],
|
|
32
|
+
[
|
|
33
|
+
"content",
|
|
34
|
+
"popover__content"
|
|
35
|
+
],
|
|
36
|
+
[
|
|
37
|
+
"title",
|
|
38
|
+
"popover__title"
|
|
39
|
+
],
|
|
40
|
+
[
|
|
41
|
+
"description",
|
|
42
|
+
"popover__description"
|
|
43
|
+
],
|
|
44
|
+
[
|
|
45
|
+
"closeTrigger",
|
|
46
|
+
"popover__closeTrigger"
|
|
47
|
+
],
|
|
48
|
+
[
|
|
49
|
+
"header",
|
|
50
|
+
"popover__header"
|
|
51
|
+
],
|
|
52
|
+
[
|
|
53
|
+
"body",
|
|
54
|
+
"popover__body"
|
|
55
|
+
],
|
|
56
|
+
[
|
|
57
|
+
"footer",
|
|
58
|
+
"popover__footer"
|
|
59
|
+
]
|
|
60
|
+
]
|
|
61
|
+
const popoverSlotFns = /* @__PURE__ */ popoverSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, popoverDefaultVariants, getSlotCompoundVariant(popoverCompoundVariants, slotName))])
|
|
62
|
+
|
|
63
|
+
const popoverFn = memo((props = {}) => {
|
|
64
|
+
return Object.fromEntries(popoverSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
const popoverVariantKeys = []
|
|
68
|
+
const getVariantProps = (variants) => ({ ...popoverDefaultVariants, ...compact(variants) })
|
|
69
|
+
|
|
70
|
+
export const popover = /* @__PURE__ */ Object.assign(popoverFn, {
|
|
71
|
+
__recipe__: false,
|
|
72
|
+
__name__: 'popover',
|
|
73
|
+
raw: (props) => props,
|
|
74
|
+
classNameMap: {},
|
|
75
|
+
variantKeys: popoverVariantKeys,
|
|
76
|
+
variantMap: {},
|
|
77
|
+
splitVariantProps(props) {
|
|
78
|
+
return splitProps(props, popoverVariantKeys)
|
|
79
|
+
},
|
|
80
|
+
getVariantProps
|
|
81
|
+
})
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { ConditionalValue } from '../types/index';
|
|
3
|
+
import type { DistributiveOmit, Pretty } from '../types/system-types';
|
|
4
|
+
|
|
5
|
+
interface ProgressVariant {
|
|
6
|
+
/**
|
|
7
|
+
* @default "solid"
|
|
8
|
+
*/
|
|
9
|
+
variant: "solid" | "subtle"
|
|
10
|
+
/**
|
|
11
|
+
* @default "rounded"
|
|
12
|
+
*/
|
|
13
|
+
shape: "square" | "rounded" | "full"
|
|
14
|
+
striped: boolean
|
|
15
|
+
animated: boolean
|
|
16
|
+
/**
|
|
17
|
+
* @default "md"
|
|
18
|
+
*/
|
|
19
|
+
size: "xs" | "sm" | "md" | "lg" | "xl"
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
type ProgressVariantMap = {
|
|
23
|
+
[key in keyof ProgressVariant]: Array<ProgressVariant[key]>
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
type ProgressSlot = "root" | "label" | "track" | "range" | "valueText" | "view" | "circle" | "circleTrack" | "circleRange"
|
|
27
|
+
|
|
28
|
+
export type ProgressVariantProps = {
|
|
29
|
+
[key in keyof ProgressVariant]?: ConditionalValue<ProgressVariant[key]> | undefined
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface ProgressRecipe {
|
|
33
|
+
__slot: ProgressSlot
|
|
34
|
+
__type: ProgressVariantProps
|
|
35
|
+
(props?: ProgressVariantProps): Pretty<Record<ProgressSlot, string>>
|
|
36
|
+
raw: (props?: ProgressVariantProps) => ProgressVariantProps
|
|
37
|
+
variantMap: ProgressVariantMap
|
|
38
|
+
variantKeys: Array<keyof ProgressVariant>
|
|
39
|
+
splitVariantProps<Props extends ProgressVariantProps>(props: Props): [ProgressVariantProps, Pretty<DistributiveOmit<Props, keyof ProgressVariantProps>>]
|
|
40
|
+
getVariantProps: (props?: ProgressVariantProps) => ProgressVariantProps
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
export declare const progress: ProgressRecipe
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
|
|
2
|
+
import { createRecipe } from './create-recipe.mjs';
|
|
3
|
+
|
|
4
|
+
const progressDefaultVariants = {
|
|
5
|
+
"variant": "solid",
|
|
6
|
+
"size": "md",
|
|
7
|
+
"shape": "rounded"
|
|
8
|
+
}
|
|
9
|
+
const progressCompoundVariants = []
|
|
10
|
+
|
|
11
|
+
const progressSlotNames = [
|
|
12
|
+
[
|
|
13
|
+
"root",
|
|
14
|
+
"progress__root"
|
|
15
|
+
],
|
|
16
|
+
[
|
|
17
|
+
"label",
|
|
18
|
+
"progress__label"
|
|
19
|
+
],
|
|
20
|
+
[
|
|
21
|
+
"track",
|
|
22
|
+
"progress__track"
|
|
23
|
+
],
|
|
24
|
+
[
|
|
25
|
+
"range",
|
|
26
|
+
"progress__range"
|
|
27
|
+
],
|
|
28
|
+
[
|
|
29
|
+
"valueText",
|
|
30
|
+
"progress__valueText"
|
|
31
|
+
],
|
|
32
|
+
[
|
|
33
|
+
"view",
|
|
34
|
+
"progress__view"
|
|
35
|
+
],
|
|
36
|
+
[
|
|
37
|
+
"circle",
|
|
38
|
+
"progress__circle"
|
|
39
|
+
],
|
|
40
|
+
[
|
|
41
|
+
"circleTrack",
|
|
42
|
+
"progress__circleTrack"
|
|
43
|
+
],
|
|
44
|
+
[
|
|
45
|
+
"circleRange",
|
|
46
|
+
"progress__circleRange"
|
|
47
|
+
]
|
|
48
|
+
]
|
|
49
|
+
const progressSlotFns = /* @__PURE__ */ progressSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, progressDefaultVariants, getSlotCompoundVariant(progressCompoundVariants, slotName))])
|
|
50
|
+
|
|
51
|
+
const progressFn = memo((props = {}) => {
|
|
52
|
+
return Object.fromEntries(progressSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
const progressVariantKeys = [
|
|
56
|
+
"variant",
|
|
57
|
+
"shape",
|
|
58
|
+
"striped",
|
|
59
|
+
"animated",
|
|
60
|
+
"size"
|
|
61
|
+
]
|
|
62
|
+
const getVariantProps = (variants) => ({ ...progressDefaultVariants, ...compact(variants) })
|
|
63
|
+
|
|
64
|
+
export const progress = /* @__PURE__ */ Object.assign(progressFn, {
|
|
65
|
+
__recipe__: false,
|
|
66
|
+
__name__: 'progress',
|
|
67
|
+
raw: (props) => props,
|
|
68
|
+
classNameMap: {},
|
|
69
|
+
variantKeys: progressVariantKeys,
|
|
70
|
+
variantMap: {
|
|
71
|
+
"variant": [
|
|
72
|
+
"solid",
|
|
73
|
+
"subtle"
|
|
74
|
+
],
|
|
75
|
+
"shape": [
|
|
76
|
+
"square",
|
|
77
|
+
"rounded",
|
|
78
|
+
"full"
|
|
79
|
+
],
|
|
80
|
+
"striped": [
|
|
81
|
+
"true"
|
|
82
|
+
],
|
|
83
|
+
"animated": [
|
|
84
|
+
"true"
|
|
85
|
+
],
|
|
86
|
+
"size": [
|
|
87
|
+
"xs",
|
|
88
|
+
"sm",
|
|
89
|
+
"md",
|
|
90
|
+
"lg",
|
|
91
|
+
"xl"
|
|
92
|
+
]
|
|
93
|
+
},
|
|
94
|
+
splitVariantProps(props) {
|
|
95
|
+
return splitProps(props, progressVariantKeys)
|
|
96
|
+
},
|
|
97
|
+
getVariantProps
|
|
98
|
+
})
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { ConditionalValue } from '../types/index';
|
|
3
|
+
import type { DistributiveOmit, Pretty } from '../types/system-types';
|
|
4
|
+
|
|
5
|
+
interface RadioGroupVariant {
|
|
6
|
+
/**
|
|
7
|
+
* @default "solid"
|
|
8
|
+
*/
|
|
9
|
+
variant: "solid"
|
|
10
|
+
/**
|
|
11
|
+
* @default "md"
|
|
12
|
+
*/
|
|
13
|
+
size: "sm" | "md" | "lg"
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
type RadioGroupVariantMap = {
|
|
17
|
+
[key in keyof RadioGroupVariant]: Array<RadioGroupVariant[key]>
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
type RadioGroupSlot = "root" | "label" | "item" | "itemText" | "itemControl" | "indicator"
|
|
21
|
+
|
|
22
|
+
export type RadioGroupVariantProps = {
|
|
23
|
+
[key in keyof RadioGroupVariant]?: ConditionalValue<RadioGroupVariant[key]> | undefined
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface RadioGroupRecipe {
|
|
27
|
+
__slot: RadioGroupSlot
|
|
28
|
+
__type: RadioGroupVariantProps
|
|
29
|
+
(props?: RadioGroupVariantProps): Pretty<Record<RadioGroupSlot, string>>
|
|
30
|
+
raw: (props?: RadioGroupVariantProps) => RadioGroupVariantProps
|
|
31
|
+
variantMap: RadioGroupVariantMap
|
|
32
|
+
variantKeys: Array<keyof RadioGroupVariant>
|
|
33
|
+
splitVariantProps<Props extends RadioGroupVariantProps>(props: Props): [RadioGroupVariantProps, Pretty<DistributiveOmit<Props, keyof RadioGroupVariantProps>>]
|
|
34
|
+
getVariantProps: (props?: RadioGroupVariantProps) => RadioGroupVariantProps
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
export declare const radioGroup: RadioGroupRecipe
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
|
|
2
|
+
import { createRecipe } from './create-recipe.mjs';
|
|
3
|
+
|
|
4
|
+
const radioGroupDefaultVariants = {
|
|
5
|
+
"variant": "solid",
|
|
6
|
+
"size": "md"
|
|
7
|
+
}
|
|
8
|
+
const radioGroupCompoundVariants = []
|
|
9
|
+
|
|
10
|
+
const radioGroupSlotNames = [
|
|
11
|
+
[
|
|
12
|
+
"root",
|
|
13
|
+
"radio-group__root"
|
|
14
|
+
],
|
|
15
|
+
[
|
|
16
|
+
"label",
|
|
17
|
+
"radio-group__label"
|
|
18
|
+
],
|
|
19
|
+
[
|
|
20
|
+
"item",
|
|
21
|
+
"radio-group__item"
|
|
22
|
+
],
|
|
23
|
+
[
|
|
24
|
+
"itemText",
|
|
25
|
+
"radio-group__itemText"
|
|
26
|
+
],
|
|
27
|
+
[
|
|
28
|
+
"itemControl",
|
|
29
|
+
"radio-group__itemControl"
|
|
30
|
+
],
|
|
31
|
+
[
|
|
32
|
+
"indicator",
|
|
33
|
+
"radio-group__indicator"
|
|
34
|
+
]
|
|
35
|
+
]
|
|
36
|
+
const radioGroupSlotFns = /* @__PURE__ */ radioGroupSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, radioGroupDefaultVariants, getSlotCompoundVariant(radioGroupCompoundVariants, slotName))])
|
|
37
|
+
|
|
38
|
+
const radioGroupFn = memo((props = {}) => {
|
|
39
|
+
return Object.fromEntries(radioGroupSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
const radioGroupVariantKeys = [
|
|
43
|
+
"variant",
|
|
44
|
+
"size"
|
|
45
|
+
]
|
|
46
|
+
const getVariantProps = (variants) => ({ ...radioGroupDefaultVariants, ...compact(variants) })
|
|
47
|
+
|
|
48
|
+
export const radioGroup = /* @__PURE__ */ Object.assign(radioGroupFn, {
|
|
49
|
+
__recipe__: false,
|
|
50
|
+
__name__: 'radioGroup',
|
|
51
|
+
raw: (props) => props,
|
|
52
|
+
classNameMap: {},
|
|
53
|
+
variantKeys: radioGroupVariantKeys,
|
|
54
|
+
variantMap: {
|
|
55
|
+
"variant": [
|
|
56
|
+
"solid"
|
|
57
|
+
],
|
|
58
|
+
"size": [
|
|
59
|
+
"sm",
|
|
60
|
+
"md",
|
|
61
|
+
"lg"
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
splitVariantProps(props) {
|
|
65
|
+
return splitProps(props, radioGroupVariantKeys)
|
|
66
|
+
},
|
|
67
|
+
getVariantProps
|
|
68
|
+
})
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { ConditionalValue } from '../types/index';
|
|
3
|
+
import type { DistributiveOmit, Pretty } from '../types/system-types';
|
|
4
|
+
|
|
5
|
+
interface SelectVariant {
|
|
6
|
+
/**
|
|
7
|
+
* @default "outline"
|
|
8
|
+
*/
|
|
9
|
+
variant: "outline" | "surface"
|
|
10
|
+
/**
|
|
11
|
+
* @default "md"
|
|
12
|
+
*/
|
|
13
|
+
size: "xs" | "sm" | "md" | "lg" | "xl"
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
type SelectVariantMap = {
|
|
17
|
+
[key in keyof SelectVariant]: Array<SelectVariant[key]>
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
type SelectSlot = "label" | "positioner" | "trigger" | "indicator" | "clearTrigger" | "item" | "itemText" | "itemIndicator" | "itemGroup" | "itemGroupLabel" | "list" | "content" | "root" | "control" | "valueText" | "indicatorGroup"
|
|
21
|
+
|
|
22
|
+
export type SelectVariantProps = {
|
|
23
|
+
[key in keyof SelectVariant]?: ConditionalValue<SelectVariant[key]> | undefined
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface SelectRecipe {
|
|
27
|
+
__slot: SelectSlot
|
|
28
|
+
__type: SelectVariantProps
|
|
29
|
+
(props?: SelectVariantProps): Pretty<Record<SelectSlot, string>>
|
|
30
|
+
raw: (props?: SelectVariantProps) => SelectVariantProps
|
|
31
|
+
variantMap: SelectVariantMap
|
|
32
|
+
variantKeys: Array<keyof SelectVariant>
|
|
33
|
+
splitVariantProps<Props extends SelectVariantProps>(props: Props): [SelectVariantProps, Pretty<DistributiveOmit<Props, keyof SelectVariantProps>>]
|
|
34
|
+
getVariantProps: (props?: SelectVariantProps) => SelectVariantProps
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
export declare const select: SelectRecipe
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
|
|
2
|
+
import { createRecipe } from './create-recipe.mjs';
|
|
3
|
+
|
|
4
|
+
const selectDefaultVariants = {
|
|
5
|
+
"size": "md",
|
|
6
|
+
"variant": "outline"
|
|
7
|
+
}
|
|
8
|
+
const selectCompoundVariants = []
|
|
9
|
+
|
|
10
|
+
const selectSlotNames = [
|
|
11
|
+
[
|
|
12
|
+
"label",
|
|
13
|
+
"select__label"
|
|
14
|
+
],
|
|
15
|
+
[
|
|
16
|
+
"positioner",
|
|
17
|
+
"select__positioner"
|
|
18
|
+
],
|
|
19
|
+
[
|
|
20
|
+
"trigger",
|
|
21
|
+
"select__trigger"
|
|
22
|
+
],
|
|
23
|
+
[
|
|
24
|
+
"indicator",
|
|
25
|
+
"select__indicator"
|
|
26
|
+
],
|
|
27
|
+
[
|
|
28
|
+
"clearTrigger",
|
|
29
|
+
"select__clearTrigger"
|
|
30
|
+
],
|
|
31
|
+
[
|
|
32
|
+
"item",
|
|
33
|
+
"select__item"
|
|
34
|
+
],
|
|
35
|
+
[
|
|
36
|
+
"itemText",
|
|
37
|
+
"select__itemText"
|
|
38
|
+
],
|
|
39
|
+
[
|
|
40
|
+
"itemIndicator",
|
|
41
|
+
"select__itemIndicator"
|
|
42
|
+
],
|
|
43
|
+
[
|
|
44
|
+
"itemGroup",
|
|
45
|
+
"select__itemGroup"
|
|
46
|
+
],
|
|
47
|
+
[
|
|
48
|
+
"itemGroupLabel",
|
|
49
|
+
"select__itemGroupLabel"
|
|
50
|
+
],
|
|
51
|
+
[
|
|
52
|
+
"list",
|
|
53
|
+
"select__list"
|
|
54
|
+
],
|
|
55
|
+
[
|
|
56
|
+
"content",
|
|
57
|
+
"select__content"
|
|
58
|
+
],
|
|
59
|
+
[
|
|
60
|
+
"root",
|
|
61
|
+
"select__root"
|
|
62
|
+
],
|
|
63
|
+
[
|
|
64
|
+
"control",
|
|
65
|
+
"select__control"
|
|
66
|
+
],
|
|
67
|
+
[
|
|
68
|
+
"valueText",
|
|
69
|
+
"select__valueText"
|
|
70
|
+
],
|
|
71
|
+
[
|
|
72
|
+
"indicatorGroup",
|
|
73
|
+
"select__indicatorGroup"
|
|
74
|
+
]
|
|
75
|
+
]
|
|
76
|
+
const selectSlotFns = /* @__PURE__ */ selectSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, selectDefaultVariants, getSlotCompoundVariant(selectCompoundVariants, slotName))])
|
|
77
|
+
|
|
78
|
+
const selectFn = memo((props = {}) => {
|
|
79
|
+
return Object.fromEntries(selectSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
const selectVariantKeys = [
|
|
83
|
+
"variant",
|
|
84
|
+
"size"
|
|
85
|
+
]
|
|
86
|
+
const getVariantProps = (variants) => ({ ...selectDefaultVariants, ...compact(variants) })
|
|
87
|
+
|
|
88
|
+
export const select = /* @__PURE__ */ Object.assign(selectFn, {
|
|
89
|
+
__recipe__: false,
|
|
90
|
+
__name__: 'select',
|
|
91
|
+
raw: (props) => props,
|
|
92
|
+
classNameMap: {},
|
|
93
|
+
variantKeys: selectVariantKeys,
|
|
94
|
+
variantMap: {
|
|
95
|
+
"variant": [
|
|
96
|
+
"outline",
|
|
97
|
+
"surface"
|
|
98
|
+
],
|
|
99
|
+
"size": [
|
|
100
|
+
"xs",
|
|
101
|
+
"sm",
|
|
102
|
+
"md",
|
|
103
|
+
"lg",
|
|
104
|
+
"xl"
|
|
105
|
+
]
|
|
106
|
+
},
|
|
107
|
+
splitVariantProps(props) {
|
|
108
|
+
return splitProps(props, selectVariantKeys)
|
|
109
|
+
},
|
|
110
|
+
getVariantProps
|
|
111
|
+
})
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { ConditionalValue } from '../types/index';
|
|
3
|
+
import type { DistributiveOmit, Pretty } from '../types/system-types';
|
|
4
|
+
|
|
5
|
+
interface SkeletonVariant {
|
|
6
|
+
/**
|
|
7
|
+
* @default true
|
|
8
|
+
*/
|
|
9
|
+
loading: boolean
|
|
10
|
+
circle: boolean
|
|
11
|
+
/**
|
|
12
|
+
* @default "pulse"
|
|
13
|
+
*/
|
|
14
|
+
variant: "pulse" | "shine" | "none"
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
type SkeletonVariantMap = {
|
|
18
|
+
[key in keyof SkeletonVariant]: Array<SkeletonVariant[key]>
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
export type SkeletonVariantProps = {
|
|
24
|
+
[key in keyof SkeletonVariant]?: ConditionalValue<SkeletonVariant[key]> | undefined
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface SkeletonRecipe {
|
|
28
|
+
|
|
29
|
+
__type: SkeletonVariantProps
|
|
30
|
+
(props?: SkeletonVariantProps): string
|
|
31
|
+
raw: (props?: SkeletonVariantProps) => SkeletonVariantProps
|
|
32
|
+
variantMap: SkeletonVariantMap
|
|
33
|
+
variantKeys: Array<keyof SkeletonVariant>
|
|
34
|
+
splitVariantProps<Props extends SkeletonVariantProps>(props: Props): [SkeletonVariantProps, Pretty<DistributiveOmit<Props, keyof SkeletonVariantProps>>]
|
|
35
|
+
getVariantProps: (props?: SkeletonVariantProps) => SkeletonVariantProps
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
export declare const skeleton: SkeletonRecipe
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { memo, splitProps } from '../helpers.mjs';
|
|
2
|
+
import { createRecipe, mergeRecipes } from './create-recipe.mjs';
|
|
3
|
+
|
|
4
|
+
const skeletonFn = /* @__PURE__ */ createRecipe('skeleton', {
|
|
5
|
+
"variant": "pulse",
|
|
6
|
+
"loading": true
|
|
7
|
+
}, [])
|
|
8
|
+
|
|
9
|
+
const skeletonVariantMap = {
|
|
10
|
+
"loading": [
|
|
11
|
+
"true",
|
|
12
|
+
"false"
|
|
13
|
+
],
|
|
14
|
+
"circle": [
|
|
15
|
+
"true"
|
|
16
|
+
],
|
|
17
|
+
"variant": [
|
|
18
|
+
"pulse",
|
|
19
|
+
"shine",
|
|
20
|
+
"none"
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const skeletonVariantKeys = Object.keys(skeletonVariantMap)
|
|
25
|
+
|
|
26
|
+
export const skeleton = /* @__PURE__ */ Object.assign(memo(skeletonFn.recipeFn), {
|
|
27
|
+
__recipe__: true,
|
|
28
|
+
__name__: 'skeleton',
|
|
29
|
+
__getCompoundVariantCss__: skeletonFn.__getCompoundVariantCss__,
|
|
30
|
+
raw: (props) => props,
|
|
31
|
+
variantKeys: skeletonVariantKeys,
|
|
32
|
+
variantMap: skeletonVariantMap,
|
|
33
|
+
merge(recipe) {
|
|
34
|
+
return mergeRecipes(this, recipe)
|
|
35
|
+
},
|
|
36
|
+
splitVariantProps(props) {
|
|
37
|
+
return splitProps(props, skeletonVariantKeys)
|
|
38
|
+
},
|
|
39
|
+
getVariantProps: skeletonFn.getVariantProps,
|
|
40
|
+
})
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { ConditionalValue } from '../types/index';
|
|
3
|
+
import type { DistributiveOmit, Pretty } from '../types/system-types';
|
|
4
|
+
|
|
5
|
+
interface SliderVariant {
|
|
6
|
+
/**
|
|
7
|
+
* @default "md"
|
|
8
|
+
*/
|
|
9
|
+
size: "sm" | "md" | "lg"
|
|
10
|
+
/**
|
|
11
|
+
* @default "outline"
|
|
12
|
+
*/
|
|
13
|
+
variant: "outline"
|
|
14
|
+
/**
|
|
15
|
+
* @default "horizontal"
|
|
16
|
+
*/
|
|
17
|
+
orientation: "vertical" | "horizontal"
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
type SliderVariantMap = {
|
|
21
|
+
[key in keyof SliderVariant]: Array<SliderVariant[key]>
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
type SliderSlot = "root" | "label" | "thumb" | "valueText" | "track" | "range" | "control" | "markerGroup" | "marker" | "draggingIndicator" | "markerIndicator"
|
|
25
|
+
|
|
26
|
+
export type SliderVariantProps = {
|
|
27
|
+
[key in keyof SliderVariant]?: ConditionalValue<SliderVariant[key]> | undefined
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface SliderRecipe {
|
|
31
|
+
__slot: SliderSlot
|
|
32
|
+
__type: SliderVariantProps
|
|
33
|
+
(props?: SliderVariantProps): Pretty<Record<SliderSlot, string>>
|
|
34
|
+
raw: (props?: SliderVariantProps) => SliderVariantProps
|
|
35
|
+
variantMap: SliderVariantMap
|
|
36
|
+
variantKeys: Array<keyof SliderVariant>
|
|
37
|
+
splitVariantProps<Props extends SliderVariantProps>(props: Props): [SliderVariantProps, Pretty<DistributiveOmit<Props, keyof SliderVariantProps>>]
|
|
38
|
+
getVariantProps: (props?: SliderVariantProps) => SliderVariantProps
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
export declare const slider: SliderRecipe
|