@becket-ui/tokens 0.1.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/LICENSE +21 -0
- package/dist/preset.d.ts +7 -0
- package/dist/preset.js +1846 -0
- package/dist/preset.js.map +1 -0
- package/index.css +3033 -0
- package/index.d.ts +10 -0
- package/index.mjs +13 -0
- package/package.json +108 -0
- package/styled-system/css/conditions.mjs +36 -0
- package/styled-system/css/css.d.ts +22 -0
- package/styled-system/css/css.mjs +45 -0
- package/styled-system/css/cva.d.ts +6 -0
- package/styled-system/css/cva.mjs +87 -0
- package/styled-system/css/cx.d.ts +5 -0
- package/styled-system/css/cx.mjs +15 -0
- package/styled-system/css/index.d.ts +5 -0
- package/styled-system/css/index.mjs +4 -0
- package/styled-system/css/sva.d.ts +4 -0
- package/styled-system/css/sva.mjs +46 -0
- package/styled-system/helpers.mjs +328 -0
- package/styled-system/jsx/aspect-ratio.d.ts +10 -0
- package/styled-system/jsx/aspect-ratio.mjs +14 -0
- package/styled-system/jsx/bleed.d.ts +10 -0
- package/styled-system/jsx/bleed.mjs +14 -0
- package/styled-system/jsx/box.d.ts +10 -0
- package/styled-system/jsx/box.mjs +14 -0
- package/styled-system/jsx/center.d.ts +10 -0
- package/styled-system/jsx/center.mjs +14 -0
- package/styled-system/jsx/circle.d.ts +10 -0
- package/styled-system/jsx/circle.mjs +14 -0
- package/styled-system/jsx/container.d.ts +10 -0
- package/styled-system/jsx/container.mjs +14 -0
- package/styled-system/jsx/cq.d.ts +10 -0
- package/styled-system/jsx/cq.mjs +14 -0
- package/styled-system/jsx/create-style-context.d.ts +54 -0
- package/styled-system/jsx/create-style-context.mjs +121 -0
- package/styled-system/jsx/divider.d.ts +10 -0
- package/styled-system/jsx/divider.mjs +14 -0
- package/styled-system/jsx/factory-helper.mjs +22 -0
- package/styled-system/jsx/factory.d.ts +3 -0
- package/styled-system/jsx/factory.mjs +89 -0
- package/styled-system/jsx/flex.d.ts +10 -0
- package/styled-system/jsx/flex.mjs +14 -0
- package/styled-system/jsx/float.d.ts +10 -0
- package/styled-system/jsx/float.mjs +14 -0
- package/styled-system/jsx/grid-item.d.ts +10 -0
- package/styled-system/jsx/grid-item.mjs +14 -0
- package/styled-system/jsx/grid.d.ts +10 -0
- package/styled-system/jsx/grid.mjs +14 -0
- package/styled-system/jsx/hstack.d.ts +10 -0
- package/styled-system/jsx/hstack.mjs +14 -0
- package/styled-system/jsx/index.d.ts +25 -0
- package/styled-system/jsx/index.mjs +23 -0
- package/styled-system/jsx/is-valid-prop.d.ts +11 -0
- package/styled-system/jsx/is-valid-prop.mjs +17 -0
- package/styled-system/jsx/link-overlay.d.ts +10 -0
- package/styled-system/jsx/link-overlay.mjs +14 -0
- package/styled-system/jsx/spacer.d.ts +10 -0
- package/styled-system/jsx/spacer.mjs +14 -0
- package/styled-system/jsx/square.d.ts +10 -0
- package/styled-system/jsx/square.mjs +14 -0
- package/styled-system/jsx/stack.d.ts +10 -0
- package/styled-system/jsx/stack.mjs +14 -0
- package/styled-system/jsx/visually-hidden.d.ts +10 -0
- package/styled-system/jsx/visually-hidden.mjs +14 -0
- package/styled-system/jsx/vstack.d.ts +10 -0
- package/styled-system/jsx/vstack.mjs +14 -0
- package/styled-system/jsx/wrap.d.ts +10 -0
- package/styled-system/jsx/wrap.mjs +14 -0
- package/styled-system/patterns/aspect-ratio.d.ts +20 -0
- package/styled-system/patterns/aspect-ratio.mjs +38 -0
- package/styled-system/patterns/bleed.d.ts +21 -0
- package/styled-system/patterns/bleed.mjs +24 -0
- package/styled-system/patterns/box.d.ts +20 -0
- package/styled-system/patterns/box.mjs +15 -0
- package/styled-system/patterns/center.d.ts +20 -0
- package/styled-system/patterns/center.mjs +21 -0
- package/styled-system/patterns/circle.d.ts +20 -0
- package/styled-system/patterns/circle.mjs +25 -0
- package/styled-system/patterns/container.d.ts +20 -0
- package/styled-system/patterns/container.mjs +21 -0
- package/styled-system/patterns/cq.d.ts +21 -0
- package/styled-system/patterns/cq.mjs +21 -0
- package/styled-system/patterns/divider.d.ts +22 -0
- package/styled-system/patterns/divider.mjs +25 -0
- package/styled-system/patterns/flex.d.ts +26 -0
- package/styled-system/patterns/flex.mjs +26 -0
- package/styled-system/patterns/float.d.ts +23 -0
- package/styled-system/patterns/float.mjs +52 -0
- package/styled-system/patterns/grid-item.d.ts +25 -0
- package/styled-system/patterns/grid-item.mjs +25 -0
- package/styled-system/patterns/grid.d.ts +24 -0
- package/styled-system/patterns/grid.mjs +27 -0
- package/styled-system/patterns/hstack.d.ts +21 -0
- package/styled-system/patterns/hstack.mjs +24 -0
- package/styled-system/patterns/index.d.ts +21 -0
- package/styled-system/patterns/index.mjs +20 -0
- package/styled-system/patterns/link-overlay.d.ts +20 -0
- package/styled-system/patterns/link-overlay.mjs +24 -0
- package/styled-system/patterns/spacer.d.ts +20 -0
- package/styled-system/patterns/spacer.mjs +25 -0
- package/styled-system/patterns/square.d.ts +20 -0
- package/styled-system/patterns/square.mjs +24 -0
- package/styled-system/patterns/stack.d.ts +23 -0
- package/styled-system/patterns/stack.mjs +24 -0
- package/styled-system/patterns/visually-hidden.d.ts +20 -0
- package/styled-system/patterns/visually-hidden.mjs +18 -0
- package/styled-system/patterns/vstack.d.ts +21 -0
- package/styled-system/patterns/vstack.mjs +24 -0
- package/styled-system/patterns/wrap.d.ts +24 -0
- package/styled-system/patterns/wrap.mjs +25 -0
- package/styled-system/recipes/badge.d.ts +48 -0
- package/styled-system/recipes/badge.mjs +91 -0
- package/styled-system/recipes/button.d.ts +52 -0
- package/styled-system/recipes/button.mjs +122 -0
- package/styled-system/recipes/card.d.ts +44 -0
- package/styled-system/recipes/card.mjs +76 -0
- package/styled-system/recipes/checkbox.d.ts +36 -0
- package/styled-system/recipes/checkbox.mjs +62 -0
- package/styled-system/recipes/create-recipe.mjs +82 -0
- package/styled-system/recipes/dialog.d.ts +33 -0
- package/styled-system/recipes/dialog.mjs +53 -0
- package/styled-system/recipes/drawer.d.ts +36 -0
- package/styled-system/recipes/drawer.mjs +62 -0
- package/styled-system/recipes/field.d.ts +40 -0
- package/styled-system/recipes/field.mjs +61 -0
- package/styled-system/recipes/heading.d.ts +40 -0
- package/styled-system/recipes/heading.mjs +54 -0
- package/styled-system/recipes/hide.d.ts +38 -0
- package/styled-system/recipes/hide.mjs +246 -0
- package/styled-system/recipes/index.d.ts +23 -0
- package/styled-system/recipes/index.mjs +22 -0
- package/styled-system/recipes/link.d.ts +40 -0
- package/styled-system/recipes/link.mjs +36 -0
- package/styled-system/recipes/menu.d.ts +33 -0
- package/styled-system/recipes/menu.mjs +45 -0
- package/styled-system/recipes/radio.d.ts +36 -0
- package/styled-system/recipes/radio.mjs +70 -0
- package/styled-system/recipes/select-recipe.d.ts +40 -0
- package/styled-system/recipes/select-recipe.mjs +37 -0
- package/styled-system/recipes/separator.d.ts +36 -0
- package/styled-system/recipes/separator.mjs +31 -0
- package/styled-system/recipes/spinner.d.ts +36 -0
- package/styled-system/recipes/spinner.mjs +32 -0
- package/styled-system/recipes/switch-recipe.d.ts +40 -0
- package/styled-system/recipes/switch-recipe.mjs +93 -0
- package/styled-system/recipes/table.d.ts +36 -0
- package/styled-system/recipes/table.mjs +70 -0
- package/styled-system/recipes/tabs.d.ts +33 -0
- package/styled-system/recipes/tabs.mjs +45 -0
- package/styled-system/recipes/tag.d.ts +48 -0
- package/styled-system/recipes/tag.mjs +89 -0
- package/styled-system/recipes/text-field-recipe.d.ts +40 -0
- package/styled-system/recipes/text-field-recipe.mjs +37 -0
- package/styled-system/recipes/textarea-recipe.d.ts +40 -0
- package/styled-system/recipes/textarea-recipe.mjs +37 -0
- package/styled-system/recipes/tooltip.d.ts +36 -0
- package/styled-system/recipes/tooltip.mjs +33 -0
- package/styled-system/styles.css +2986 -0
- package/styled-system/tokens/index.d.ts +9 -0
- package/styled-system/tokens/index.mjs +2128 -0
- package/styled-system/tokens/tokens.d.ts +63 -0
- package/styled-system/types/composition.d.ts +227 -0
- package/styled-system/types/conditions.d.ts +310 -0
- package/styled-system/types/csstype.d.ts +22570 -0
- package/styled-system/types/global.d.ts +20 -0
- package/styled-system/types/index.d.ts +8 -0
- package/styled-system/types/jsx.d.ts +69 -0
- package/styled-system/types/parts.d.ts +8 -0
- package/styled-system/types/pattern.d.ts +78 -0
- package/styled-system/types/prop-type.d.ts +251 -0
- package/styled-system/types/recipe.d.ts +181 -0
- package/styled-system/types/selectors.d.ts +59 -0
- package/styled-system/types/static-css.d.ts +56 -0
- package/styled-system/types/style-props.d.ts +8089 -0
- package/styled-system/types/system-types.d.ts +151 -0
- package/theme/index.d.ts +56 -0
- package/theme/index.mjs +168 -0
- package/theme.example.css +68 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
|
|
2
|
+
import { createRecipe } from './create-recipe.mjs';
|
|
3
|
+
|
|
4
|
+
const radioDefaultVariants = {
|
|
5
|
+
"size": "md"
|
|
6
|
+
}
|
|
7
|
+
const radioCompoundVariants = []
|
|
8
|
+
|
|
9
|
+
const radioSlotNames = [
|
|
10
|
+
[
|
|
11
|
+
"group",
|
|
12
|
+
"radio__group"
|
|
13
|
+
],
|
|
14
|
+
[
|
|
15
|
+
"legend",
|
|
16
|
+
"radio__legend"
|
|
17
|
+
],
|
|
18
|
+
[
|
|
19
|
+
"root",
|
|
20
|
+
"radio__root"
|
|
21
|
+
],
|
|
22
|
+
[
|
|
23
|
+
"control",
|
|
24
|
+
"radio__control"
|
|
25
|
+
],
|
|
26
|
+
[
|
|
27
|
+
"indicator",
|
|
28
|
+
"radio__indicator"
|
|
29
|
+
],
|
|
30
|
+
[
|
|
31
|
+
"text",
|
|
32
|
+
"radio__text"
|
|
33
|
+
],
|
|
34
|
+
[
|
|
35
|
+
"label",
|
|
36
|
+
"radio__label"
|
|
37
|
+
],
|
|
38
|
+
[
|
|
39
|
+
"description",
|
|
40
|
+
"radio__description"
|
|
41
|
+
]
|
|
42
|
+
]
|
|
43
|
+
const radioSlotFns = /* @__PURE__ */ radioSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, radioDefaultVariants, getSlotCompoundVariant(radioCompoundVariants, slotName))])
|
|
44
|
+
|
|
45
|
+
const radioFn = memo((props = {}) => {
|
|
46
|
+
return Object.fromEntries(radioSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
const radioVariantKeys = [
|
|
50
|
+
"size"
|
|
51
|
+
]
|
|
52
|
+
const getVariantProps = (variants) => ({ ...radioDefaultVariants, ...compact(variants) })
|
|
53
|
+
|
|
54
|
+
export const radio = /* @__PURE__ */ Object.assign(radioFn, {
|
|
55
|
+
__recipe__: false,
|
|
56
|
+
__name__: 'radio',
|
|
57
|
+
raw: (props) => props,
|
|
58
|
+
classNameMap: {},
|
|
59
|
+
variantKeys: radioVariantKeys,
|
|
60
|
+
variantMap: {
|
|
61
|
+
"size": [
|
|
62
|
+
"sm",
|
|
63
|
+
"md"
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
splitVariantProps(props) {
|
|
67
|
+
return splitProps(props, radioVariantKeys)
|
|
68
|
+
},
|
|
69
|
+
getVariantProps
|
|
70
|
+
})
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { ConditionalValue } from '../types/index';
|
|
3
|
+
import type { DistributiveOmit, Pretty } from '../types/system-types';
|
|
4
|
+
|
|
5
|
+
interface SelectRecipeVariant {
|
|
6
|
+
/**
|
|
7
|
+
* @default "md"
|
|
8
|
+
*/
|
|
9
|
+
size: "sm" | "md" | "lg"
|
|
10
|
+
/**
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
13
|
+
invalid: boolean
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
type SelectRecipeVariantMap = {
|
|
17
|
+
[key in keyof SelectRecipeVariant]: Array<SelectRecipeVariant[key]>
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
export type SelectRecipeVariantProps = {
|
|
23
|
+
[key in keyof SelectRecipeVariant]?: ConditionalValue<SelectRecipeVariant[key]> | undefined
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface SelectRecipeRecipe {
|
|
27
|
+
|
|
28
|
+
__type: SelectRecipeVariantProps
|
|
29
|
+
(props?: SelectRecipeVariantProps): string
|
|
30
|
+
raw: (props?: SelectRecipeVariantProps) => SelectRecipeVariantProps
|
|
31
|
+
variantMap: SelectRecipeVariantMap
|
|
32
|
+
variantKeys: Array<keyof SelectRecipeVariant>
|
|
33
|
+
splitVariantProps<Props extends SelectRecipeVariantProps>(props: Props): [SelectRecipeVariantProps, Pretty<DistributiveOmit<Props, keyof SelectRecipeVariantProps>>]
|
|
34
|
+
getVariantProps: (props?: SelectRecipeVariantProps) => SelectRecipeVariantProps
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Native select. Label / helper / error live on Field.
|
|
39
|
+
*/
|
|
40
|
+
export declare const selectRecipe: SelectRecipeRecipe
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { memo, splitProps } from '../helpers.mjs';
|
|
2
|
+
import { createRecipe, mergeRecipes } from './create-recipe.mjs';
|
|
3
|
+
|
|
4
|
+
const selectRecipeFn = /* @__PURE__ */ createRecipe('select', {
|
|
5
|
+
"size": "md",
|
|
6
|
+
"invalid": false
|
|
7
|
+
}, [])
|
|
8
|
+
|
|
9
|
+
const selectRecipeVariantMap = {
|
|
10
|
+
"size": [
|
|
11
|
+
"sm",
|
|
12
|
+
"md",
|
|
13
|
+
"lg"
|
|
14
|
+
],
|
|
15
|
+
"invalid": [
|
|
16
|
+
"true",
|
|
17
|
+
"false"
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const selectRecipeVariantKeys = Object.keys(selectRecipeVariantMap)
|
|
22
|
+
|
|
23
|
+
export const selectRecipe = /* @__PURE__ */ Object.assign(memo(selectRecipeFn.recipeFn), {
|
|
24
|
+
__recipe__: true,
|
|
25
|
+
__name__: 'selectRecipe',
|
|
26
|
+
__getCompoundVariantCss__: selectRecipeFn.__getCompoundVariantCss__,
|
|
27
|
+
raw: (props) => props,
|
|
28
|
+
variantKeys: selectRecipeVariantKeys,
|
|
29
|
+
variantMap: selectRecipeVariantMap,
|
|
30
|
+
merge(recipe) {
|
|
31
|
+
return mergeRecipes(this, recipe)
|
|
32
|
+
},
|
|
33
|
+
splitVariantProps(props) {
|
|
34
|
+
return splitProps(props, selectRecipeVariantKeys)
|
|
35
|
+
},
|
|
36
|
+
getVariantProps: selectRecipeFn.getVariantProps,
|
|
37
|
+
})
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { ConditionalValue } from '../types/index';
|
|
3
|
+
import type { DistributiveOmit, Pretty } from '../types/system-types';
|
|
4
|
+
|
|
5
|
+
interface SeparatorVariant {
|
|
6
|
+
/**
|
|
7
|
+
* @default "horizontal"
|
|
8
|
+
*/
|
|
9
|
+
orientation: "horizontal" | "vertical"
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
type SeparatorVariantMap = {
|
|
13
|
+
[key in keyof SeparatorVariant]: Array<SeparatorVariant[key]>
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
export type SeparatorVariantProps = {
|
|
19
|
+
[key in keyof SeparatorVariant]?: ConditionalValue<SeparatorVariant[key]> | undefined
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface SeparatorRecipe {
|
|
23
|
+
|
|
24
|
+
__type: SeparatorVariantProps
|
|
25
|
+
(props?: SeparatorVariantProps): string
|
|
26
|
+
raw: (props?: SeparatorVariantProps) => SeparatorVariantProps
|
|
27
|
+
variantMap: SeparatorVariantMap
|
|
28
|
+
variantKeys: Array<keyof SeparatorVariant>
|
|
29
|
+
splitVariantProps<Props extends SeparatorVariantProps>(props: Props): [SeparatorVariantProps, Pretty<DistributiveOmit<Props, keyof SeparatorVariantProps>>]
|
|
30
|
+
getVariantProps: (props?: SeparatorVariantProps) => SeparatorVariantProps
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Horizontal or vertical rule
|
|
35
|
+
*/
|
|
36
|
+
export declare const separator: SeparatorRecipe
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { memo, splitProps } from '../helpers.mjs';
|
|
2
|
+
import { createRecipe, mergeRecipes } from './create-recipe.mjs';
|
|
3
|
+
|
|
4
|
+
const separatorFn = /* @__PURE__ */ createRecipe('separator', {
|
|
5
|
+
"orientation": "horizontal"
|
|
6
|
+
}, [])
|
|
7
|
+
|
|
8
|
+
const separatorVariantMap = {
|
|
9
|
+
"orientation": [
|
|
10
|
+
"horizontal",
|
|
11
|
+
"vertical"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const separatorVariantKeys = Object.keys(separatorVariantMap)
|
|
16
|
+
|
|
17
|
+
export const separator = /* @__PURE__ */ Object.assign(memo(separatorFn.recipeFn), {
|
|
18
|
+
__recipe__: true,
|
|
19
|
+
__name__: 'separator',
|
|
20
|
+
__getCompoundVariantCss__: separatorFn.__getCompoundVariantCss__,
|
|
21
|
+
raw: (props) => props,
|
|
22
|
+
variantKeys: separatorVariantKeys,
|
|
23
|
+
variantMap: separatorVariantMap,
|
|
24
|
+
merge(recipe) {
|
|
25
|
+
return mergeRecipes(this, recipe)
|
|
26
|
+
},
|
|
27
|
+
splitVariantProps(props) {
|
|
28
|
+
return splitProps(props, separatorVariantKeys)
|
|
29
|
+
},
|
|
30
|
+
getVariantProps: separatorFn.getVariantProps,
|
|
31
|
+
})
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { ConditionalValue } from '../types/index';
|
|
3
|
+
import type { DistributiveOmit, Pretty } from '../types/system-types';
|
|
4
|
+
|
|
5
|
+
interface SpinnerVariant {
|
|
6
|
+
/**
|
|
7
|
+
* @default "md"
|
|
8
|
+
*/
|
|
9
|
+
size: "sm" | "md" | "lg"
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
type SpinnerVariantMap = {
|
|
13
|
+
[key in keyof SpinnerVariant]: Array<SpinnerVariant[key]>
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
export type SpinnerVariantProps = {
|
|
19
|
+
[key in keyof SpinnerVariant]?: ConditionalValue<SpinnerVariant[key]> | undefined
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface SpinnerRecipe {
|
|
23
|
+
|
|
24
|
+
__type: SpinnerVariantProps
|
|
25
|
+
(props?: SpinnerVariantProps): string
|
|
26
|
+
raw: (props?: SpinnerVariantProps) => SpinnerVariantProps
|
|
27
|
+
variantMap: SpinnerVariantMap
|
|
28
|
+
variantKeys: Array<keyof SpinnerVariant>
|
|
29
|
+
splitVariantProps<Props extends SpinnerVariantProps>(props: Props): [SpinnerVariantProps, Pretty<DistributiveOmit<Props, keyof SpinnerVariantProps>>]
|
|
30
|
+
getVariantProps: (props?: SpinnerVariantProps) => SpinnerVariantProps
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Pure CSS loading spinner
|
|
35
|
+
*/
|
|
36
|
+
export declare const spinner: SpinnerRecipe
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { memo, splitProps } from '../helpers.mjs';
|
|
2
|
+
import { createRecipe, mergeRecipes } from './create-recipe.mjs';
|
|
3
|
+
|
|
4
|
+
const spinnerFn = /* @__PURE__ */ createRecipe('spinner', {
|
|
5
|
+
"size": "md"
|
|
6
|
+
}, [])
|
|
7
|
+
|
|
8
|
+
const spinnerVariantMap = {
|
|
9
|
+
"size": [
|
|
10
|
+
"sm",
|
|
11
|
+
"md",
|
|
12
|
+
"lg"
|
|
13
|
+
]
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const spinnerVariantKeys = Object.keys(spinnerVariantMap)
|
|
17
|
+
|
|
18
|
+
export const spinner = /* @__PURE__ */ Object.assign(memo(spinnerFn.recipeFn), {
|
|
19
|
+
__recipe__: true,
|
|
20
|
+
__name__: 'spinner',
|
|
21
|
+
__getCompoundVariantCss__: spinnerFn.__getCompoundVariantCss__,
|
|
22
|
+
raw: (props) => props,
|
|
23
|
+
variantKeys: spinnerVariantKeys,
|
|
24
|
+
variantMap: spinnerVariantMap,
|
|
25
|
+
merge(recipe) {
|
|
26
|
+
return mergeRecipes(this, recipe)
|
|
27
|
+
},
|
|
28
|
+
splitVariantProps(props) {
|
|
29
|
+
return splitProps(props, spinnerVariantKeys)
|
|
30
|
+
},
|
|
31
|
+
getVariantProps: spinnerFn.getVariantProps,
|
|
32
|
+
})
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { ConditionalValue } from '../types/index';
|
|
3
|
+
import type { DistributiveOmit, Pretty } from '../types/system-types';
|
|
4
|
+
|
|
5
|
+
interface SwitchRecipeVariant {
|
|
6
|
+
/**
|
|
7
|
+
* @default "md"
|
|
8
|
+
*/
|
|
9
|
+
size: "sm" | "md" | "lg"
|
|
10
|
+
/**
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
13
|
+
checked: boolean
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
type SwitchRecipeVariantMap = {
|
|
17
|
+
[key in keyof SwitchRecipeVariant]: Array<SwitchRecipeVariant[key]>
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
type SwitchRecipeSlot = "root" | "track" | "thumb" | "wrap" | "label"
|
|
21
|
+
|
|
22
|
+
export type SwitchRecipeVariantProps = {
|
|
23
|
+
[key in keyof SwitchRecipeVariant]?: SwitchRecipeVariant[key] | undefined
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface SwitchRecipeRecipe {
|
|
27
|
+
__slot: SwitchRecipeSlot
|
|
28
|
+
__type: SwitchRecipeVariantProps
|
|
29
|
+
(props?: SwitchRecipeVariantProps): Pretty<Record<SwitchRecipeSlot, string>>
|
|
30
|
+
raw: (props?: SwitchRecipeVariantProps) => SwitchRecipeVariantProps
|
|
31
|
+
variantMap: SwitchRecipeVariantMap
|
|
32
|
+
variantKeys: Array<keyof SwitchRecipeVariant>
|
|
33
|
+
splitVariantProps<Props extends SwitchRecipeVariantProps>(props: Props): [SwitchRecipeVariantProps, Pretty<DistributiveOmit<Props, keyof SwitchRecipeVariantProps>>]
|
|
34
|
+
getVariantProps: (props?: SwitchRecipeVariantProps) => SwitchRecipeVariantProps
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Accessible switch control with track and thumb slots
|
|
39
|
+
*/
|
|
40
|
+
export declare const switchRecipe: SwitchRecipeRecipe
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
|
|
2
|
+
import { createRecipe } from './create-recipe.mjs';
|
|
3
|
+
|
|
4
|
+
const switchRecipeDefaultVariants = {
|
|
5
|
+
"size": "md",
|
|
6
|
+
"checked": false
|
|
7
|
+
}
|
|
8
|
+
const switchRecipeCompoundVariants = [
|
|
9
|
+
{
|
|
10
|
+
"size": "sm",
|
|
11
|
+
"checked": true,
|
|
12
|
+
"css": {
|
|
13
|
+
"thumb": {
|
|
14
|
+
"transform": "translateX(0.75rem)"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"size": "md",
|
|
20
|
+
"checked": true,
|
|
21
|
+
"css": {
|
|
22
|
+
"thumb": {
|
|
23
|
+
"transform": "translateX(1.25rem)"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"size": "lg",
|
|
29
|
+
"checked": true,
|
|
30
|
+
"css": {
|
|
31
|
+
"thumb": {
|
|
32
|
+
"transform": "translateX(1.5rem)"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
const switchRecipeSlotNames = [
|
|
39
|
+
[
|
|
40
|
+
"root",
|
|
41
|
+
"switch__root"
|
|
42
|
+
],
|
|
43
|
+
[
|
|
44
|
+
"track",
|
|
45
|
+
"switch__track"
|
|
46
|
+
],
|
|
47
|
+
[
|
|
48
|
+
"thumb",
|
|
49
|
+
"switch__thumb"
|
|
50
|
+
],
|
|
51
|
+
[
|
|
52
|
+
"wrap",
|
|
53
|
+
"switch__wrap"
|
|
54
|
+
],
|
|
55
|
+
[
|
|
56
|
+
"label",
|
|
57
|
+
"switch__label"
|
|
58
|
+
]
|
|
59
|
+
]
|
|
60
|
+
const switchRecipeSlotFns = /* @__PURE__ */ switchRecipeSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, switchRecipeDefaultVariants, getSlotCompoundVariant(switchRecipeCompoundVariants, slotName))])
|
|
61
|
+
|
|
62
|
+
const switchRecipeFn = memo((props = {}) => {
|
|
63
|
+
return Object.fromEntries(switchRecipeSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
const switchRecipeVariantKeys = [
|
|
67
|
+
"size",
|
|
68
|
+
"checked"
|
|
69
|
+
]
|
|
70
|
+
const getVariantProps = (variants) => ({ ...switchRecipeDefaultVariants, ...compact(variants) })
|
|
71
|
+
|
|
72
|
+
export const switchRecipe = /* @__PURE__ */ Object.assign(switchRecipeFn, {
|
|
73
|
+
__recipe__: false,
|
|
74
|
+
__name__: 'switchRecipe',
|
|
75
|
+
raw: (props) => props,
|
|
76
|
+
classNameMap: {},
|
|
77
|
+
variantKeys: switchRecipeVariantKeys,
|
|
78
|
+
variantMap: {
|
|
79
|
+
"size": [
|
|
80
|
+
"sm",
|
|
81
|
+
"md",
|
|
82
|
+
"lg"
|
|
83
|
+
],
|
|
84
|
+
"checked": [
|
|
85
|
+
"true",
|
|
86
|
+
"false"
|
|
87
|
+
]
|
|
88
|
+
},
|
|
89
|
+
splitVariantProps(props) {
|
|
90
|
+
return splitProps(props, switchRecipeVariantKeys)
|
|
91
|
+
},
|
|
92
|
+
getVariantProps
|
|
93
|
+
})
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { ConditionalValue } from '../types/index';
|
|
3
|
+
import type { DistributiveOmit, Pretty } from '../types/system-types';
|
|
4
|
+
|
|
5
|
+
interface TableVariant {
|
|
6
|
+
/**
|
|
7
|
+
* @default "md"
|
|
8
|
+
*/
|
|
9
|
+
size: "sm" | "md"
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
type TableVariantMap = {
|
|
13
|
+
[key in keyof TableVariant]: Array<TableVariant[key]>
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
type TableSlot = "root" | "caption" | "thead" | "tbody" | "tfoot" | "tr" | "th" | "td"
|
|
17
|
+
|
|
18
|
+
export type TableVariantProps = {
|
|
19
|
+
[key in keyof TableVariant]?: ConditionalValue<TableVariant[key]> | undefined
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface TableRecipe {
|
|
23
|
+
__slot: TableSlot
|
|
24
|
+
__type: TableVariantProps
|
|
25
|
+
(props?: TableVariantProps): Pretty<Record<TableSlot, string>>
|
|
26
|
+
raw: (props?: TableVariantProps) => TableVariantProps
|
|
27
|
+
variantMap: TableVariantMap
|
|
28
|
+
variantKeys: Array<keyof TableVariant>
|
|
29
|
+
splitVariantProps<Props extends TableVariantProps>(props: Props): [TableVariantProps, Pretty<DistributiveOmit<Props, keyof TableVariantProps>>]
|
|
30
|
+
getVariantProps: (props?: TableVariantProps) => TableVariantProps
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Semantic table slots
|
|
35
|
+
*/
|
|
36
|
+
export declare const table: TableRecipe
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
|
|
2
|
+
import { createRecipe } from './create-recipe.mjs';
|
|
3
|
+
|
|
4
|
+
const tableDefaultVariants = {
|
|
5
|
+
"size": "md"
|
|
6
|
+
}
|
|
7
|
+
const tableCompoundVariants = []
|
|
8
|
+
|
|
9
|
+
const tableSlotNames = [
|
|
10
|
+
[
|
|
11
|
+
"root",
|
|
12
|
+
"table__root"
|
|
13
|
+
],
|
|
14
|
+
[
|
|
15
|
+
"caption",
|
|
16
|
+
"table__caption"
|
|
17
|
+
],
|
|
18
|
+
[
|
|
19
|
+
"thead",
|
|
20
|
+
"table__thead"
|
|
21
|
+
],
|
|
22
|
+
[
|
|
23
|
+
"tbody",
|
|
24
|
+
"table__tbody"
|
|
25
|
+
],
|
|
26
|
+
[
|
|
27
|
+
"tfoot",
|
|
28
|
+
"table__tfoot"
|
|
29
|
+
],
|
|
30
|
+
[
|
|
31
|
+
"tr",
|
|
32
|
+
"table__tr"
|
|
33
|
+
],
|
|
34
|
+
[
|
|
35
|
+
"th",
|
|
36
|
+
"table__th"
|
|
37
|
+
],
|
|
38
|
+
[
|
|
39
|
+
"td",
|
|
40
|
+
"table__td"
|
|
41
|
+
]
|
|
42
|
+
]
|
|
43
|
+
const tableSlotFns = /* @__PURE__ */ tableSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, tableDefaultVariants, getSlotCompoundVariant(tableCompoundVariants, slotName))])
|
|
44
|
+
|
|
45
|
+
const tableFn = memo((props = {}) => {
|
|
46
|
+
return Object.fromEntries(tableSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
const tableVariantKeys = [
|
|
50
|
+
"size"
|
|
51
|
+
]
|
|
52
|
+
const getVariantProps = (variants) => ({ ...tableDefaultVariants, ...compact(variants) })
|
|
53
|
+
|
|
54
|
+
export const table = /* @__PURE__ */ Object.assign(tableFn, {
|
|
55
|
+
__recipe__: false,
|
|
56
|
+
__name__: 'table',
|
|
57
|
+
raw: (props) => props,
|
|
58
|
+
classNameMap: {},
|
|
59
|
+
variantKeys: tableVariantKeys,
|
|
60
|
+
variantMap: {
|
|
61
|
+
"size": [
|
|
62
|
+
"sm",
|
|
63
|
+
"md"
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
splitVariantProps(props) {
|
|
67
|
+
return splitProps(props, tableVariantKeys)
|
|
68
|
+
},
|
|
69
|
+
getVariantProps
|
|
70
|
+
})
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { ConditionalValue } from '../types/index';
|
|
3
|
+
import type { DistributiveOmit, Pretty } from '../types/system-types';
|
|
4
|
+
|
|
5
|
+
interface TabsVariant {
|
|
6
|
+
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
type TabsVariantMap = {
|
|
10
|
+
[key in keyof TabsVariant]: Array<TabsVariant[key]>
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
type TabsSlot = "root" | "list" | "tab" | "panel"
|
|
14
|
+
|
|
15
|
+
export type TabsVariantProps = {
|
|
16
|
+
[key in keyof TabsVariant]?: ConditionalValue<TabsVariant[key]> | undefined
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface TabsRecipe {
|
|
20
|
+
__slot: TabsSlot
|
|
21
|
+
__type: TabsVariantProps
|
|
22
|
+
(props?: TabsVariantProps): Pretty<Record<TabsSlot, string>>
|
|
23
|
+
raw: (props?: TabsVariantProps) => TabsVariantProps
|
|
24
|
+
variantMap: TabsVariantMap
|
|
25
|
+
variantKeys: Array<keyof TabsVariant>
|
|
26
|
+
splitVariantProps<Props extends TabsVariantProps>(props: Props): [TabsVariantProps, Pretty<DistributiveOmit<Props, keyof TabsVariantProps>>]
|
|
27
|
+
getVariantProps: (props?: TabsVariantProps) => TabsVariantProps
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* ARIA tabs with list, tab, and panel slots
|
|
32
|
+
*/
|
|
33
|
+
export declare const tabs: TabsRecipe
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
|
|
2
|
+
import { createRecipe } from './create-recipe.mjs';
|
|
3
|
+
|
|
4
|
+
const tabsDefaultVariants = {}
|
|
5
|
+
const tabsCompoundVariants = []
|
|
6
|
+
|
|
7
|
+
const tabsSlotNames = [
|
|
8
|
+
[
|
|
9
|
+
"root",
|
|
10
|
+
"tabs__root"
|
|
11
|
+
],
|
|
12
|
+
[
|
|
13
|
+
"list",
|
|
14
|
+
"tabs__list"
|
|
15
|
+
],
|
|
16
|
+
[
|
|
17
|
+
"tab",
|
|
18
|
+
"tabs__tab"
|
|
19
|
+
],
|
|
20
|
+
[
|
|
21
|
+
"panel",
|
|
22
|
+
"tabs__panel"
|
|
23
|
+
]
|
|
24
|
+
]
|
|
25
|
+
const tabsSlotFns = /* @__PURE__ */ tabsSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, tabsDefaultVariants, getSlotCompoundVariant(tabsCompoundVariants, slotName))])
|
|
26
|
+
|
|
27
|
+
const tabsFn = memo((props = {}) => {
|
|
28
|
+
return Object.fromEntries(tabsSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
const tabsVariantKeys = []
|
|
32
|
+
const getVariantProps = (variants) => ({ ...tabsDefaultVariants, ...compact(variants) })
|
|
33
|
+
|
|
34
|
+
export const tabs = /* @__PURE__ */ Object.assign(tabsFn, {
|
|
35
|
+
__recipe__: false,
|
|
36
|
+
__name__: 'tabs',
|
|
37
|
+
raw: (props) => props,
|
|
38
|
+
classNameMap: {},
|
|
39
|
+
variantKeys: tabsVariantKeys,
|
|
40
|
+
variantMap: {},
|
|
41
|
+
splitVariantProps(props) {
|
|
42
|
+
return splitProps(props, tabsVariantKeys)
|
|
43
|
+
},
|
|
44
|
+
getVariantProps
|
|
45
|
+
})
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { ConditionalValue } from '../types/index';
|
|
3
|
+
import type { DistributiveOmit, Pretty } from '../types/system-types';
|
|
4
|
+
|
|
5
|
+
interface TagVariant {
|
|
6
|
+
/**
|
|
7
|
+
* @default "md"
|
|
8
|
+
*/
|
|
9
|
+
size: "sm" | "md" | "lg"
|
|
10
|
+
/**
|
|
11
|
+
* @default "neutral"
|
|
12
|
+
*/
|
|
13
|
+
visual: "primary" | "secondary" | "neutral" | "outline"
|
|
14
|
+
/**
|
|
15
|
+
* @default "full"
|
|
16
|
+
*/
|
|
17
|
+
borderRadius: "none" | "sm" | "md" | "lg" | "xl" | "full"
|
|
18
|
+
/**
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
21
|
+
withGradient: boolean
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
type TagVariantMap = {
|
|
25
|
+
[key in keyof TagVariant]: Array<TagVariant[key]>
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
export type TagVariantProps = {
|
|
31
|
+
[key in keyof TagVariant]?: TagVariant[key] | undefined
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface TagRecipe {
|
|
35
|
+
|
|
36
|
+
__type: TagVariantProps
|
|
37
|
+
(props?: TagVariantProps): string
|
|
38
|
+
raw: (props?: TagVariantProps) => TagVariantProps
|
|
39
|
+
variantMap: TagVariantMap
|
|
40
|
+
variantKeys: Array<keyof TagVariant>
|
|
41
|
+
splitVariantProps<Props extends TagVariantProps>(props: Props): [TagVariantProps, Pretty<DistributiveOmit<Props, keyof TagVariantProps>>]
|
|
42
|
+
getVariantProps: (props?: TagVariantProps) => TagVariantProps
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Non-interactive metadata chip (Tag)
|
|
47
|
+
*/
|
|
48
|
+
export declare const tag: TagRecipe
|