@pyck/styled-system 0.0.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/dist/css/conditions.mjs +36 -0
- package/dist/css/css.d.ts +22 -0
- package/dist/css/css.mjs +45 -0
- package/dist/css/cva.d.ts +6 -0
- package/dist/css/cva.mjs +87 -0
- package/dist/css/cx.d.ts +5 -0
- package/dist/css/cx.mjs +15 -0
- package/dist/css/index.d.ts +5 -0
- package/dist/css/index.mjs +4 -0
- package/dist/css/sva.d.ts +4 -0
- package/dist/css/sva.mjs +46 -0
- package/dist/helpers.mjs +328 -0
- package/dist/jsx/aspect-ratio.d.ts +10 -0
- package/dist/jsx/aspect-ratio.mjs +14 -0
- package/dist/jsx/bleed.d.ts +10 -0
- package/dist/jsx/bleed.mjs +14 -0
- package/dist/jsx/box.d.ts +10 -0
- package/dist/jsx/box.mjs +14 -0
- package/dist/jsx/center.d.ts +10 -0
- package/dist/jsx/center.mjs +14 -0
- package/dist/jsx/circle.d.ts +10 -0
- package/dist/jsx/circle.mjs +14 -0
- package/dist/jsx/container.d.ts +10 -0
- package/dist/jsx/container.mjs +14 -0
- package/dist/jsx/cq.d.ts +10 -0
- package/dist/jsx/cq.mjs +14 -0
- package/dist/jsx/create-style-context.d.ts +54 -0
- package/dist/jsx/create-style-context.mjs +118 -0
- package/dist/jsx/divider.d.ts +10 -0
- package/dist/jsx/divider.mjs +14 -0
- package/dist/jsx/factory-helper.mjs +22 -0
- package/dist/jsx/factory.d.ts +3 -0
- package/dist/jsx/factory.mjs +89 -0
- package/dist/jsx/flex.d.ts +10 -0
- package/dist/jsx/flex.mjs +14 -0
- package/dist/jsx/float.d.ts +10 -0
- package/dist/jsx/float.mjs +14 -0
- package/dist/jsx/grid-item.d.ts +10 -0
- package/dist/jsx/grid-item.mjs +14 -0
- package/dist/jsx/grid.d.ts +10 -0
- package/dist/jsx/grid.mjs +14 -0
- package/dist/jsx/hstack.d.ts +10 -0
- package/dist/jsx/hstack.mjs +14 -0
- package/dist/jsx/index.d.ts +25 -0
- package/dist/jsx/index.mjs +23 -0
- package/dist/jsx/is-valid-prop.d.ts +11 -0
- package/dist/jsx/is-valid-prop.mjs +17 -0
- package/dist/jsx/link-overlay.d.ts +10 -0
- package/dist/jsx/link-overlay.mjs +14 -0
- package/dist/jsx/spacer.d.ts +10 -0
- package/dist/jsx/spacer.mjs +14 -0
- package/dist/jsx/square.d.ts +10 -0
- package/dist/jsx/square.mjs +14 -0
- package/dist/jsx/stack.d.ts +10 -0
- package/dist/jsx/stack.mjs +14 -0
- package/dist/jsx/visually-hidden.d.ts +10 -0
- package/dist/jsx/visually-hidden.mjs +14 -0
- package/dist/jsx/vstack.d.ts +10 -0
- package/dist/jsx/vstack.mjs +14 -0
- package/dist/jsx/wrap.d.ts +10 -0
- package/dist/jsx/wrap.mjs +14 -0
- package/dist/patterns/aspect-ratio.d.ts +20 -0
- package/dist/patterns/aspect-ratio.mjs +38 -0
- package/dist/patterns/bleed.d.ts +21 -0
- package/dist/patterns/bleed.mjs +24 -0
- package/dist/patterns/box.d.ts +20 -0
- package/dist/patterns/box.mjs +15 -0
- package/dist/patterns/center.d.ts +20 -0
- package/dist/patterns/center.mjs +21 -0
- package/dist/patterns/circle.d.ts +20 -0
- package/dist/patterns/circle.mjs +25 -0
- package/dist/patterns/container.d.ts +20 -0
- package/dist/patterns/container.mjs +22 -0
- package/dist/patterns/cq.d.ts +21 -0
- package/dist/patterns/cq.mjs +21 -0
- package/dist/patterns/divider.d.ts +22 -0
- package/dist/patterns/divider.mjs +25 -0
- package/dist/patterns/flex.d.ts +26 -0
- package/dist/patterns/flex.mjs +26 -0
- package/dist/patterns/float.d.ts +23 -0
- package/dist/patterns/float.mjs +52 -0
- package/dist/patterns/grid-item.d.ts +25 -0
- package/dist/patterns/grid-item.mjs +25 -0
- package/dist/patterns/grid.d.ts +24 -0
- package/dist/patterns/grid.mjs +25 -0
- package/dist/patterns/hstack.d.ts +21 -0
- package/dist/patterns/hstack.mjs +24 -0
- package/dist/patterns/index.d.ts +21 -0
- package/dist/patterns/index.mjs +20 -0
- package/dist/patterns/link-overlay.d.ts +20 -0
- package/dist/patterns/link-overlay.mjs +24 -0
- package/dist/patterns/spacer.d.ts +20 -0
- package/dist/patterns/spacer.mjs +21 -0
- package/dist/patterns/square.d.ts +20 -0
- package/dist/patterns/square.mjs +24 -0
- package/dist/patterns/stack.d.ts +23 -0
- package/dist/patterns/stack.mjs +24 -0
- package/dist/patterns/visually-hidden.d.ts +20 -0
- package/dist/patterns/visually-hidden.mjs +18 -0
- package/dist/patterns/vstack.d.ts +21 -0
- package/dist/patterns/vstack.mjs +24 -0
- package/dist/patterns/wrap.d.ts +24 -0
- package/dist/patterns/wrap.mjs +25 -0
- package/dist/recipes/absolute-center.d.ts +34 -0
- package/dist/recipes/absolute-center.mjs +32 -0
- package/dist/recipes/action-bar.d.ts +31 -0
- package/dist/recipes/action-bar.mjs +49 -0
- package/dist/recipes/avatar.d.ts +43 -0
- package/dist/recipes/avatar.mjs +75 -0
- package/dist/recipes/badge.d.ts +38 -0
- package/dist/recipes/badge.mjs +40 -0
- package/dist/recipes/breadcrumb.d.ts +38 -0
- package/dist/recipes/breadcrumb.mjs +70 -0
- package/dist/recipes/button.d.ts +38 -0
- package/dist/recipes/button.mjs +44 -0
- package/dist/recipes/card.d.ts +34 -0
- package/dist/recipes/card.mjs +63 -0
- package/dist/recipes/carousel.d.ts +35 -0
- package/dist/recipes/carousel.mjs +93 -0
- package/dist/recipes/checkbox.d.ts +38 -0
- package/dist/recipes/checkbox.mjs +67 -0
- package/dist/recipes/checkmark.d.ts +38 -0
- package/dist/recipes/checkmark.mjs +39 -0
- package/dist/recipes/clipboard.d.ts +31 -0
- package/dist/recipes/clipboard.mjs +53 -0
- package/dist/recipes/collapsible.d.ts +34 -0
- package/dist/recipes/collapsible.mjs +54 -0
- package/dist/recipes/combobox.d.ts +38 -0
- package/dist/recipes/combobox.mjs +112 -0
- package/dist/recipes/create-recipe.mjs +82 -0
- package/dist/recipes/data-list.d.ts +31 -0
- package/dist/recipes/data-list.mjs +53 -0
- package/dist/recipes/date-picker.d.ts +31 -0
- package/dist/recipes/date-picker.mjs +133 -0
- package/dist/recipes/dialog.d.ts +46 -0
- package/dist/recipes/dialog.mjs +106 -0
- package/dist/recipes/drawer.d.ts +38 -0
- package/dist/recipes/drawer.mjs +90 -0
- package/dist/recipes/drilldown-menu.d.ts +31 -0
- package/dist/recipes/drilldown-menu.mjs +53 -0
- package/dist/recipes/field.d.ts +31 -0
- package/dist/recipes/field.mjs +61 -0
- package/dist/recipes/fieldset.d.ts +31 -0
- package/dist/recipes/fieldset.mjs +73 -0
- package/dist/recipes/floating-panel.d.ts +31 -0
- package/dist/recipes/floating-panel.mjs +73 -0
- package/dist/recipes/form.d.ts +31 -0
- package/dist/recipes/form.mjs +24 -0
- package/dist/recipes/group.d.ts +36 -0
- package/dist/recipes/group.mjs +72 -0
- package/dist/recipes/heading.d.ts +31 -0
- package/dist/recipes/heading.mjs +38 -0
- package/dist/recipes/icon.d.ts +34 -0
- package/dist/recipes/icon.mjs +36 -0
- package/dist/recipes/index.d.ts +58 -0
- package/dist/recipes/index.mjs +57 -0
- package/dist/recipes/input-addon.d.ts +38 -0
- package/dist/recipes/input-addon.mjs +39 -0
- package/dist/recipes/input-group.d.ts +34 -0
- package/dist/recipes/input-group.mjs +49 -0
- package/dist/recipes/input.d.ts +38 -0
- package/dist/recipes/input.mjs +42 -0
- package/dist/recipes/kbd.d.ts +38 -0
- package/dist/recipes/kbd.mjs +42 -0
- package/dist/recipes/link.d.ts +34 -0
- package/dist/recipes/link.mjs +30 -0
- package/dist/recipes/mark.d.ts +34 -0
- package/dist/recipes/mark.mjs +32 -0
- package/dist/recipes/menu.d.ts +34 -0
- package/dist/recipes/menu.mjs +97 -0
- package/dist/recipes/number-input.d.ts +38 -0
- package/dist/recipes/number-input.mjs +78 -0
- package/dist/recipes/pagination.d.ts +31 -0
- package/dist/recipes/pagination.mjs +57 -0
- package/dist/recipes/popover.d.ts +31 -0
- package/dist/recipes/popover.mjs +81 -0
- package/dist/recipes/progress-circle.d.ts +34 -0
- package/dist/recipes/progress-circle.mjs +75 -0
- package/dist/recipes/progress.d.ts +44 -0
- package/dist/recipes/progress.mjs +98 -0
- package/dist/recipes/radio-card-group.d.ts +38 -0
- package/dist/recipes/radio-card-group.mjs +69 -0
- package/dist/recipes/radio-group.d.ts +38 -0
- package/dist/recipes/radio-group.mjs +68 -0
- package/dist/recipes/scroll-area.d.ts +38 -0
- package/dist/recipes/scroll-area.mjs +70 -0
- package/dist/recipes/segment-group.d.ts +35 -0
- package/dist/recipes/segment-group.mjs +69 -0
- package/dist/recipes/select.d.ts +38 -0
- package/dist/recipes/select.mjs +111 -0
- package/dist/recipes/skeleton.d.ts +39 -0
- package/dist/recipes/skeleton.mjs +40 -0
- package/dist/recipes/slider.d.ts +42 -0
- package/dist/recipes/slider.mjs +94 -0
- package/dist/recipes/spinner.d.ts +34 -0
- package/dist/recipes/spinner.mjs +36 -0
- package/dist/recipes/stat.d.ts +31 -0
- package/dist/recipes/stat.mjs +41 -0
- package/dist/recipes/steps.d.ts +42 -0
- package/dist/recipes/steps.mjs +97 -0
- package/dist/recipes/switch-recipe.d.ts +38 -0
- package/dist/recipes/switch-recipe.mjs +65 -0
- package/dist/recipes/table.d.ts +40 -0
- package/dist/recipes/table.mjs +83 -0
- package/dist/recipes/tabs.d.ts +39 -0
- package/dist/recipes/tabs.mjs +72 -0
- package/dist/recipes/tags-input.d.ts +38 -0
- package/dist/recipes/tags-input.mjs +86 -0
- package/dist/recipes/text.d.ts +31 -0
- package/dist/recipes/text.mjs +38 -0
- package/dist/recipes/textarea.d.ts +38 -0
- package/dist/recipes/textarea.mjs +41 -0
- package/dist/recipes/toast.d.ts +31 -0
- package/dist/recipes/toast.mjs +53 -0
- package/dist/recipes/toggle-group.d.ts +31 -0
- package/dist/recipes/toggle-group.mjs +44 -0
- package/dist/recipes/tooltip.d.ts +34 -0
- package/dist/recipes/tooltip.mjs +57 -0
- package/dist/recipes/tree-view.d.ts +34 -0
- package/dist/recipes/tree-view.mjs +97 -0
- package/dist/tokens/index.d.ts +9 -0
- package/dist/tokens/index.mjs +3060 -0
- package/dist/tokens/tokens.d.ts +63 -0
- package/dist/types/composition.d.ts +227 -0
- package/dist/types/conditions.d.ts +314 -0
- package/dist/types/csstype.d.ts +22570 -0
- package/dist/types/global.d.ts +20 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/jsx.d.ts +69 -0
- package/dist/types/parts.d.ts +8 -0
- package/dist/types/pattern.d.ts +78 -0
- package/dist/types/prop-type.d.ts +253 -0
- package/dist/types/recipe.d.ts +181 -0
- package/dist/types/selectors.d.ts +59 -0
- package/dist/types/static-css.d.ts +56 -0
- package/dist/types/style-props.d.ts +8091 -0
- package/dist/types/system-types.d.ts +151 -0
- package/package.json +76 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
|
|
2
|
+
import { createRecipe } from './create-recipe.mjs';
|
|
3
|
+
|
|
4
|
+
const carouselDefaultVariants = {
|
|
5
|
+
"size": "md"
|
|
6
|
+
}
|
|
7
|
+
const carouselCompoundVariants = []
|
|
8
|
+
|
|
9
|
+
const carouselSlotNames = [
|
|
10
|
+
[
|
|
11
|
+
"root",
|
|
12
|
+
"carousel__root"
|
|
13
|
+
],
|
|
14
|
+
[
|
|
15
|
+
"itemGroup",
|
|
16
|
+
"carousel__itemGroup"
|
|
17
|
+
],
|
|
18
|
+
[
|
|
19
|
+
"item",
|
|
20
|
+
"carousel__item"
|
|
21
|
+
],
|
|
22
|
+
[
|
|
23
|
+
"control",
|
|
24
|
+
"carousel__control"
|
|
25
|
+
],
|
|
26
|
+
[
|
|
27
|
+
"nextTrigger",
|
|
28
|
+
"carousel__nextTrigger"
|
|
29
|
+
],
|
|
30
|
+
[
|
|
31
|
+
"prevTrigger",
|
|
32
|
+
"carousel__prevTrigger"
|
|
33
|
+
],
|
|
34
|
+
[
|
|
35
|
+
"indicatorGroup",
|
|
36
|
+
"carousel__indicatorGroup"
|
|
37
|
+
],
|
|
38
|
+
[
|
|
39
|
+
"indicator",
|
|
40
|
+
"carousel__indicator"
|
|
41
|
+
],
|
|
42
|
+
[
|
|
43
|
+
"autoplayTrigger",
|
|
44
|
+
"carousel__autoplayTrigger"
|
|
45
|
+
],
|
|
46
|
+
[
|
|
47
|
+
"progressText",
|
|
48
|
+
"carousel__progressText"
|
|
49
|
+
],
|
|
50
|
+
[
|
|
51
|
+
"progressText",
|
|
52
|
+
"carousel__progressText"
|
|
53
|
+
],
|
|
54
|
+
[
|
|
55
|
+
"autoplayIndicator",
|
|
56
|
+
"carousel__autoplayIndicator"
|
|
57
|
+
],
|
|
58
|
+
[
|
|
59
|
+
"image",
|
|
60
|
+
"carousel__image"
|
|
61
|
+
]
|
|
62
|
+
]
|
|
63
|
+
const carouselSlotFns = /* @__PURE__ */ carouselSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, carouselDefaultVariants, getSlotCompoundVariant(carouselCompoundVariants, slotName))])
|
|
64
|
+
|
|
65
|
+
const carouselFn = memo((props = {}) => {
|
|
66
|
+
return Object.fromEntries(carouselSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
const carouselVariantKeys = [
|
|
70
|
+
"inline",
|
|
71
|
+
"size"
|
|
72
|
+
]
|
|
73
|
+
const getVariantProps = (variants) => ({ ...carouselDefaultVariants, ...compact(variants) })
|
|
74
|
+
|
|
75
|
+
export const carousel = /* @__PURE__ */ Object.assign(carouselFn, {
|
|
76
|
+
__recipe__: false,
|
|
77
|
+
__name__: 'carousel',
|
|
78
|
+
raw: (props) => props,
|
|
79
|
+
classNameMap: {},
|
|
80
|
+
variantKeys: carouselVariantKeys,
|
|
81
|
+
variantMap: {
|
|
82
|
+
"inline": [
|
|
83
|
+
"true"
|
|
84
|
+
],
|
|
85
|
+
"size": [
|
|
86
|
+
"md"
|
|
87
|
+
]
|
|
88
|
+
},
|
|
89
|
+
splitVariantProps(props) {
|
|
90
|
+
return splitProps(props, carouselVariantKeys)
|
|
91
|
+
},
|
|
92
|
+
getVariantProps
|
|
93
|
+
})
|
|
@@ -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 CheckboxVariant {
|
|
6
|
+
/**
|
|
7
|
+
* @default "md"
|
|
8
|
+
*/
|
|
9
|
+
size: "xs" | "sm" | "md" | "lg"
|
|
10
|
+
/**
|
|
11
|
+
* @default "surface"
|
|
12
|
+
*/
|
|
13
|
+
variant: "solid" | "surface" | "subtle"
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
type CheckboxVariantMap = {
|
|
17
|
+
[key in keyof CheckboxVariant]: Array<CheckboxVariant[key]>
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
type CheckboxSlot = "root" | "label" | "control" | "indicator" | "group"
|
|
21
|
+
|
|
22
|
+
export type CheckboxVariantProps = {
|
|
23
|
+
[key in keyof CheckboxVariant]?: ConditionalValue<CheckboxVariant[key]> | undefined
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface CheckboxRecipe {
|
|
27
|
+
__slot: CheckboxSlot
|
|
28
|
+
__type: CheckboxVariantProps
|
|
29
|
+
(props?: CheckboxVariantProps): Pretty<Record<CheckboxSlot, string>>
|
|
30
|
+
raw: (props?: CheckboxVariantProps) => CheckboxVariantProps
|
|
31
|
+
variantMap: CheckboxVariantMap
|
|
32
|
+
variantKeys: Array<keyof CheckboxVariant>
|
|
33
|
+
splitVariantProps<Props extends CheckboxVariantProps>(props: Props): [CheckboxVariantProps, Pretty<DistributiveOmit<Props, keyof CheckboxVariantProps>>]
|
|
34
|
+
getVariantProps: (props?: CheckboxVariantProps) => CheckboxVariantProps
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
export declare const checkbox: CheckboxRecipe
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
|
|
2
|
+
import { createRecipe } from './create-recipe.mjs';
|
|
3
|
+
|
|
4
|
+
const checkboxDefaultVariants = {
|
|
5
|
+
"variant": "surface",
|
|
6
|
+
"size": "md"
|
|
7
|
+
}
|
|
8
|
+
const checkboxCompoundVariants = []
|
|
9
|
+
|
|
10
|
+
const checkboxSlotNames = [
|
|
11
|
+
[
|
|
12
|
+
"root",
|
|
13
|
+
"checkbox__root"
|
|
14
|
+
],
|
|
15
|
+
[
|
|
16
|
+
"label",
|
|
17
|
+
"checkbox__label"
|
|
18
|
+
],
|
|
19
|
+
[
|
|
20
|
+
"control",
|
|
21
|
+
"checkbox__control"
|
|
22
|
+
],
|
|
23
|
+
[
|
|
24
|
+
"indicator",
|
|
25
|
+
"checkbox__indicator"
|
|
26
|
+
],
|
|
27
|
+
[
|
|
28
|
+
"group",
|
|
29
|
+
"checkbox__group"
|
|
30
|
+
]
|
|
31
|
+
]
|
|
32
|
+
const checkboxSlotFns = /* @__PURE__ */ checkboxSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, checkboxDefaultVariants, getSlotCompoundVariant(checkboxCompoundVariants, slotName))])
|
|
33
|
+
|
|
34
|
+
const checkboxFn = memo((props = {}) => {
|
|
35
|
+
return Object.fromEntries(checkboxSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
const checkboxVariantKeys = [
|
|
39
|
+
"size",
|
|
40
|
+
"variant"
|
|
41
|
+
]
|
|
42
|
+
const getVariantProps = (variants) => ({ ...checkboxDefaultVariants, ...compact(variants) })
|
|
43
|
+
|
|
44
|
+
export const checkbox = /* @__PURE__ */ Object.assign(checkboxFn, {
|
|
45
|
+
__recipe__: false,
|
|
46
|
+
__name__: 'checkbox',
|
|
47
|
+
raw: (props) => props,
|
|
48
|
+
classNameMap: {},
|
|
49
|
+
variantKeys: checkboxVariantKeys,
|
|
50
|
+
variantMap: {
|
|
51
|
+
"size": [
|
|
52
|
+
"xs",
|
|
53
|
+
"sm",
|
|
54
|
+
"md",
|
|
55
|
+
"lg"
|
|
56
|
+
],
|
|
57
|
+
"variant": [
|
|
58
|
+
"solid",
|
|
59
|
+
"surface",
|
|
60
|
+
"subtle"
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
splitVariantProps(props) {
|
|
64
|
+
return splitProps(props, checkboxVariantKeys)
|
|
65
|
+
},
|
|
66
|
+
getVariantProps
|
|
67
|
+
})
|
|
@@ -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 CheckmarkVariant {
|
|
6
|
+
/**
|
|
7
|
+
* @default "md"
|
|
8
|
+
*/
|
|
9
|
+
size: "xs" | "sm" | "md" | "lg"
|
|
10
|
+
/**
|
|
11
|
+
* @default "surface"
|
|
12
|
+
*/
|
|
13
|
+
variant: "solid" | "surface" | "subtle"
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
type CheckmarkVariantMap = {
|
|
17
|
+
[key in keyof CheckmarkVariant]: Array<CheckmarkVariant[key]>
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
export type CheckmarkVariantProps = {
|
|
23
|
+
[key in keyof CheckmarkVariant]?: ConditionalValue<CheckmarkVariant[key]> | undefined
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface CheckmarkRecipe {
|
|
27
|
+
|
|
28
|
+
__type: CheckmarkVariantProps
|
|
29
|
+
(props?: CheckmarkVariantProps): string
|
|
30
|
+
raw: (props?: CheckmarkVariantProps) => CheckmarkVariantProps
|
|
31
|
+
variantMap: CheckmarkVariantMap
|
|
32
|
+
variantKeys: Array<keyof CheckmarkVariant>
|
|
33
|
+
splitVariantProps<Props extends CheckmarkVariantProps>(props: Props): [CheckmarkVariantProps, Pretty<DistributiveOmit<Props, keyof CheckmarkVariantProps>>]
|
|
34
|
+
getVariantProps: (props?: CheckmarkVariantProps) => CheckmarkVariantProps
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
export declare const checkmark: CheckmarkRecipe
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { memo, splitProps } from '../helpers.mjs';
|
|
2
|
+
import { createRecipe, mergeRecipes } from './create-recipe.mjs';
|
|
3
|
+
|
|
4
|
+
const checkmarkFn = /* @__PURE__ */ createRecipe('checkmark', {
|
|
5
|
+
"variant": "surface",
|
|
6
|
+
"size": "md"
|
|
7
|
+
}, [])
|
|
8
|
+
|
|
9
|
+
const checkmarkVariantMap = {
|
|
10
|
+
"size": [
|
|
11
|
+
"xs",
|
|
12
|
+
"sm",
|
|
13
|
+
"md",
|
|
14
|
+
"lg"
|
|
15
|
+
],
|
|
16
|
+
"variant": [
|
|
17
|
+
"solid",
|
|
18
|
+
"surface",
|
|
19
|
+
"subtle"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const checkmarkVariantKeys = Object.keys(checkmarkVariantMap)
|
|
24
|
+
|
|
25
|
+
export const checkmark = /* @__PURE__ */ Object.assign(memo(checkmarkFn.recipeFn), {
|
|
26
|
+
__recipe__: true,
|
|
27
|
+
__name__: 'checkmark',
|
|
28
|
+
__getCompoundVariantCss__: checkmarkFn.__getCompoundVariantCss__,
|
|
29
|
+
raw: (props) => props,
|
|
30
|
+
variantKeys: checkmarkVariantKeys,
|
|
31
|
+
variantMap: checkmarkVariantMap,
|
|
32
|
+
merge(recipe) {
|
|
33
|
+
return mergeRecipes(this, recipe)
|
|
34
|
+
},
|
|
35
|
+
splitVariantProps(props) {
|
|
36
|
+
return splitProps(props, checkmarkVariantKeys)
|
|
37
|
+
},
|
|
38
|
+
getVariantProps: checkmarkFn.getVariantProps,
|
|
39
|
+
})
|
|
@@ -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 ClipboardVariant {
|
|
6
|
+
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
type ClipboardVariantMap = {
|
|
10
|
+
[key in keyof ClipboardVariant]: Array<ClipboardVariant[key]>
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
type ClipboardSlot = "root" | "control" | "trigger" | "indicator" | "input" | "label"
|
|
14
|
+
|
|
15
|
+
export type ClipboardVariantProps = {
|
|
16
|
+
[key in keyof ClipboardVariant]?: ConditionalValue<ClipboardVariant[key]> | undefined
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface ClipboardRecipe {
|
|
20
|
+
__slot: ClipboardSlot
|
|
21
|
+
__type: ClipboardVariantProps
|
|
22
|
+
(props?: ClipboardVariantProps): Pretty<Record<ClipboardSlot, string>>
|
|
23
|
+
raw: (props?: ClipboardVariantProps) => ClipboardVariantProps
|
|
24
|
+
variantMap: ClipboardVariantMap
|
|
25
|
+
variantKeys: Array<keyof ClipboardVariant>
|
|
26
|
+
splitVariantProps<Props extends ClipboardVariantProps>(props: Props): [ClipboardVariantProps, Pretty<DistributiveOmit<Props, keyof ClipboardVariantProps>>]
|
|
27
|
+
getVariantProps: (props?: ClipboardVariantProps) => ClipboardVariantProps
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
export declare const clipboard: ClipboardRecipe
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
|
|
2
|
+
import { createRecipe } from './create-recipe.mjs';
|
|
3
|
+
|
|
4
|
+
const clipboardDefaultVariants = {}
|
|
5
|
+
const clipboardCompoundVariants = []
|
|
6
|
+
|
|
7
|
+
const clipboardSlotNames = [
|
|
8
|
+
[
|
|
9
|
+
"root",
|
|
10
|
+
"clipboard__root"
|
|
11
|
+
],
|
|
12
|
+
[
|
|
13
|
+
"control",
|
|
14
|
+
"clipboard__control"
|
|
15
|
+
],
|
|
16
|
+
[
|
|
17
|
+
"trigger",
|
|
18
|
+
"clipboard__trigger"
|
|
19
|
+
],
|
|
20
|
+
[
|
|
21
|
+
"indicator",
|
|
22
|
+
"clipboard__indicator"
|
|
23
|
+
],
|
|
24
|
+
[
|
|
25
|
+
"input",
|
|
26
|
+
"clipboard__input"
|
|
27
|
+
],
|
|
28
|
+
[
|
|
29
|
+
"label",
|
|
30
|
+
"clipboard__label"
|
|
31
|
+
]
|
|
32
|
+
]
|
|
33
|
+
const clipboardSlotFns = /* @__PURE__ */ clipboardSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, clipboardDefaultVariants, getSlotCompoundVariant(clipboardCompoundVariants, slotName))])
|
|
34
|
+
|
|
35
|
+
const clipboardFn = memo((props = {}) => {
|
|
36
|
+
return Object.fromEntries(clipboardSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
const clipboardVariantKeys = []
|
|
40
|
+
const getVariantProps = (variants) => ({ ...clipboardDefaultVariants, ...compact(variants) })
|
|
41
|
+
|
|
42
|
+
export const clipboard = /* @__PURE__ */ Object.assign(clipboardFn, {
|
|
43
|
+
__recipe__: false,
|
|
44
|
+
__name__: 'clipboard',
|
|
45
|
+
raw: (props) => props,
|
|
46
|
+
classNameMap: {},
|
|
47
|
+
variantKeys: clipboardVariantKeys,
|
|
48
|
+
variantMap: {},
|
|
49
|
+
splitVariantProps(props) {
|
|
50
|
+
return splitProps(props, clipboardVariantKeys)
|
|
51
|
+
},
|
|
52
|
+
getVariantProps
|
|
53
|
+
})
|
|
@@ -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 CollapsibleVariant {
|
|
6
|
+
/**
|
|
7
|
+
* @default "vertical"
|
|
8
|
+
*/
|
|
9
|
+
orientation: "vertical" | "horizontal"
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
type CollapsibleVariantMap = {
|
|
13
|
+
[key in keyof CollapsibleVariant]: Array<CollapsibleVariant[key]>
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
type CollapsibleSlot = "root" | "trigger" | "content" | "indicator"
|
|
17
|
+
|
|
18
|
+
export type CollapsibleVariantProps = {
|
|
19
|
+
[key in keyof CollapsibleVariant]?: ConditionalValue<CollapsibleVariant[key]> | undefined
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface CollapsibleRecipe {
|
|
23
|
+
__slot: CollapsibleSlot
|
|
24
|
+
__type: CollapsibleVariantProps
|
|
25
|
+
(props?: CollapsibleVariantProps): Pretty<Record<CollapsibleSlot, string>>
|
|
26
|
+
raw: (props?: CollapsibleVariantProps) => CollapsibleVariantProps
|
|
27
|
+
variantMap: CollapsibleVariantMap
|
|
28
|
+
variantKeys: Array<keyof CollapsibleVariant>
|
|
29
|
+
splitVariantProps<Props extends CollapsibleVariantProps>(props: Props): [CollapsibleVariantProps, Pretty<DistributiveOmit<Props, keyof CollapsibleVariantProps>>]
|
|
30
|
+
getVariantProps: (props?: CollapsibleVariantProps) => CollapsibleVariantProps
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
export declare const collapsible: CollapsibleRecipe
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
|
|
2
|
+
import { createRecipe } from './create-recipe.mjs';
|
|
3
|
+
|
|
4
|
+
const collapsibleDefaultVariants = {
|
|
5
|
+
"orientation": "vertical"
|
|
6
|
+
}
|
|
7
|
+
const collapsibleCompoundVariants = []
|
|
8
|
+
|
|
9
|
+
const collapsibleSlotNames = [
|
|
10
|
+
[
|
|
11
|
+
"root",
|
|
12
|
+
"collapsible__root"
|
|
13
|
+
],
|
|
14
|
+
[
|
|
15
|
+
"trigger",
|
|
16
|
+
"collapsible__trigger"
|
|
17
|
+
],
|
|
18
|
+
[
|
|
19
|
+
"content",
|
|
20
|
+
"collapsible__content"
|
|
21
|
+
],
|
|
22
|
+
[
|
|
23
|
+
"indicator",
|
|
24
|
+
"collapsible__indicator"
|
|
25
|
+
]
|
|
26
|
+
]
|
|
27
|
+
const collapsibleSlotFns = /* @__PURE__ */ collapsibleSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, collapsibleDefaultVariants, getSlotCompoundVariant(collapsibleCompoundVariants, slotName))])
|
|
28
|
+
|
|
29
|
+
const collapsibleFn = memo((props = {}) => {
|
|
30
|
+
return Object.fromEntries(collapsibleSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
const collapsibleVariantKeys = [
|
|
34
|
+
"orientation"
|
|
35
|
+
]
|
|
36
|
+
const getVariantProps = (variants) => ({ ...collapsibleDefaultVariants, ...compact(variants) })
|
|
37
|
+
|
|
38
|
+
export const collapsible = /* @__PURE__ */ Object.assign(collapsibleFn, {
|
|
39
|
+
__recipe__: false,
|
|
40
|
+
__name__: 'collapsible',
|
|
41
|
+
raw: (props) => props,
|
|
42
|
+
classNameMap: {},
|
|
43
|
+
variantKeys: collapsibleVariantKeys,
|
|
44
|
+
variantMap: {
|
|
45
|
+
"orientation": [
|
|
46
|
+
"vertical",
|
|
47
|
+
"horizontal"
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
splitVariantProps(props) {
|
|
51
|
+
return splitProps(props, collapsibleVariantKeys)
|
|
52
|
+
},
|
|
53
|
+
getVariantProps
|
|
54
|
+
})
|
|
@@ -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 ComboboxVariant {
|
|
6
|
+
/**
|
|
7
|
+
* @default "surface"
|
|
8
|
+
*/
|
|
9
|
+
variant: "outline" | "surface" | "plain"
|
|
10
|
+
/**
|
|
11
|
+
* @default "md"
|
|
12
|
+
*/
|
|
13
|
+
size: "xs" | "sm" | "md" | "lg" | "xl"
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
type ComboboxVariantMap = {
|
|
17
|
+
[key in keyof ComboboxVariant]: Array<ComboboxVariant[key]>
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
type ComboboxSlot = "root" | "clearTrigger" | "content" | "control" | "input" | "item" | "itemGroup" | "itemGroupLabel" | "itemIndicator" | "itemText" | "label" | "list" | "positioner" | "trigger" | "empty" | "indicatorGroup"
|
|
21
|
+
|
|
22
|
+
export type ComboboxVariantProps = {
|
|
23
|
+
[key in keyof ComboboxVariant]?: ConditionalValue<ComboboxVariant[key]> | undefined
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface ComboboxRecipe {
|
|
27
|
+
__slot: ComboboxSlot
|
|
28
|
+
__type: ComboboxVariantProps
|
|
29
|
+
(props?: ComboboxVariantProps): Pretty<Record<ComboboxSlot, string>>
|
|
30
|
+
raw: (props?: ComboboxVariantProps) => ComboboxVariantProps
|
|
31
|
+
variantMap: ComboboxVariantMap
|
|
32
|
+
variantKeys: Array<keyof ComboboxVariant>
|
|
33
|
+
splitVariantProps<Props extends ComboboxVariantProps>(props: Props): [ComboboxVariantProps, Pretty<DistributiveOmit<Props, keyof ComboboxVariantProps>>]
|
|
34
|
+
getVariantProps: (props?: ComboboxVariantProps) => ComboboxVariantProps
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
export declare const combobox: ComboboxRecipe
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
|
|
2
|
+
import { createRecipe } from './create-recipe.mjs';
|
|
3
|
+
|
|
4
|
+
const comboboxDefaultVariants = {
|
|
5
|
+
"size": "md",
|
|
6
|
+
"variant": "surface"
|
|
7
|
+
}
|
|
8
|
+
const comboboxCompoundVariants = []
|
|
9
|
+
|
|
10
|
+
const comboboxSlotNames = [
|
|
11
|
+
[
|
|
12
|
+
"root",
|
|
13
|
+
"combobox__root"
|
|
14
|
+
],
|
|
15
|
+
[
|
|
16
|
+
"clearTrigger",
|
|
17
|
+
"combobox__clearTrigger"
|
|
18
|
+
],
|
|
19
|
+
[
|
|
20
|
+
"content",
|
|
21
|
+
"combobox__content"
|
|
22
|
+
],
|
|
23
|
+
[
|
|
24
|
+
"control",
|
|
25
|
+
"combobox__control"
|
|
26
|
+
],
|
|
27
|
+
[
|
|
28
|
+
"input",
|
|
29
|
+
"combobox__input"
|
|
30
|
+
],
|
|
31
|
+
[
|
|
32
|
+
"item",
|
|
33
|
+
"combobox__item"
|
|
34
|
+
],
|
|
35
|
+
[
|
|
36
|
+
"itemGroup",
|
|
37
|
+
"combobox__itemGroup"
|
|
38
|
+
],
|
|
39
|
+
[
|
|
40
|
+
"itemGroupLabel",
|
|
41
|
+
"combobox__itemGroupLabel"
|
|
42
|
+
],
|
|
43
|
+
[
|
|
44
|
+
"itemIndicator",
|
|
45
|
+
"combobox__itemIndicator"
|
|
46
|
+
],
|
|
47
|
+
[
|
|
48
|
+
"itemText",
|
|
49
|
+
"combobox__itemText"
|
|
50
|
+
],
|
|
51
|
+
[
|
|
52
|
+
"label",
|
|
53
|
+
"combobox__label"
|
|
54
|
+
],
|
|
55
|
+
[
|
|
56
|
+
"list",
|
|
57
|
+
"combobox__list"
|
|
58
|
+
],
|
|
59
|
+
[
|
|
60
|
+
"positioner",
|
|
61
|
+
"combobox__positioner"
|
|
62
|
+
],
|
|
63
|
+
[
|
|
64
|
+
"trigger",
|
|
65
|
+
"combobox__trigger"
|
|
66
|
+
],
|
|
67
|
+
[
|
|
68
|
+
"empty",
|
|
69
|
+
"combobox__empty"
|
|
70
|
+
],
|
|
71
|
+
[
|
|
72
|
+
"indicatorGroup",
|
|
73
|
+
"combobox__indicatorGroup"
|
|
74
|
+
]
|
|
75
|
+
]
|
|
76
|
+
const comboboxSlotFns = /* @__PURE__ */ comboboxSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, comboboxDefaultVariants, getSlotCompoundVariant(comboboxCompoundVariants, slotName))])
|
|
77
|
+
|
|
78
|
+
const comboboxFn = memo((props = {}) => {
|
|
79
|
+
return Object.fromEntries(comboboxSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
const comboboxVariantKeys = [
|
|
83
|
+
"variant",
|
|
84
|
+
"size"
|
|
85
|
+
]
|
|
86
|
+
const getVariantProps = (variants) => ({ ...comboboxDefaultVariants, ...compact(variants) })
|
|
87
|
+
|
|
88
|
+
export const combobox = /* @__PURE__ */ Object.assign(comboboxFn, {
|
|
89
|
+
__recipe__: false,
|
|
90
|
+
__name__: 'combobox',
|
|
91
|
+
raw: (props) => props,
|
|
92
|
+
classNameMap: {},
|
|
93
|
+
variantKeys: comboboxVariantKeys,
|
|
94
|
+
variantMap: {
|
|
95
|
+
"variant": [
|
|
96
|
+
"outline",
|
|
97
|
+
"surface",
|
|
98
|
+
"plain"
|
|
99
|
+
],
|
|
100
|
+
"size": [
|
|
101
|
+
"xs",
|
|
102
|
+
"sm",
|
|
103
|
+
"md",
|
|
104
|
+
"lg",
|
|
105
|
+
"xl"
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
splitVariantProps(props) {
|
|
109
|
+
return splitProps(props, comboboxVariantKeys)
|
|
110
|
+
},
|
|
111
|
+
getVariantProps
|
|
112
|
+
})
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { finalizeConditions, sortConditions } from '../css/conditions.mjs';
|
|
2
|
+
import { css } from '../css/css.mjs';
|
|
3
|
+
import { assertCompoundVariant, getCompoundVariantCss } from '../css/cva.mjs';
|
|
4
|
+
import { cx } from '../css/cx.mjs';
|
|
5
|
+
import { compact, createCss, splitProps, uniq, withoutSpace } from '../helpers.mjs';
|
|
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","sm","md","lg","xl","2xl"] }
|
|
34
|
+
},
|
|
35
|
+
utility: {
|
|
36
|
+
|
|
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
|
+
}
|