@discourser/design-system 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/README.md +213 -0
- package/dist/index.cjs +1250 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +456 -0
- package/dist/index.d.ts +456 -0
- package/dist/index.js +1234 -0
- package/dist/index.js.map +1 -0
- package/package.json +123 -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 +41 -0
- package/styled-system/helpers.mjs +336 -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/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 +80 -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 +24 -0
- package/styled-system/jsx/index.mjs +22 -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 +21 -0
- package/styled-system/patterns/aspect-ratio.mjs +38 -0
- package/styled-system/patterns/bleed.d.ts +22 -0
- package/styled-system/patterns/bleed.mjs +24 -0
- package/styled-system/patterns/box.d.ts +21 -0
- package/styled-system/patterns/box.mjs +15 -0
- package/styled-system/patterns/center.d.ts +21 -0
- package/styled-system/patterns/center.mjs +21 -0
- package/styled-system/patterns/circle.d.ts +21 -0
- package/styled-system/patterns/circle.mjs +25 -0
- package/styled-system/patterns/container.d.ts +21 -0
- package/styled-system/patterns/container.mjs +21 -0
- package/styled-system/patterns/cq.d.ts +22 -0
- package/styled-system/patterns/cq.mjs +21 -0
- package/styled-system/patterns/divider.d.ts +23 -0
- package/styled-system/patterns/divider.mjs +25 -0
- package/styled-system/patterns/flex.d.ts +27 -0
- package/styled-system/patterns/flex.mjs +26 -0
- package/styled-system/patterns/float.d.ts +24 -0
- package/styled-system/patterns/float.mjs +52 -0
- package/styled-system/patterns/grid-item.d.ts +26 -0
- package/styled-system/patterns/grid-item.mjs +25 -0
- package/styled-system/patterns/grid.d.ts +25 -0
- package/styled-system/patterns/grid.mjs +27 -0
- package/styled-system/patterns/hstack.d.ts +22 -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 +21 -0
- package/styled-system/patterns/link-overlay.mjs +24 -0
- package/styled-system/patterns/spacer.d.ts +21 -0
- package/styled-system/patterns/spacer.mjs +21 -0
- package/styled-system/patterns/square.d.ts +21 -0
- package/styled-system/patterns/square.mjs +24 -0
- package/styled-system/patterns/stack.d.ts +24 -0
- package/styled-system/patterns/stack.mjs +24 -0
- package/styled-system/patterns/visually-hidden.d.ts +21 -0
- package/styled-system/patterns/visually-hidden.mjs +18 -0
- package/styled-system/patterns/vstack.d.ts +22 -0
- package/styled-system/patterns/vstack.mjs +24 -0
- package/styled-system/patterns/wrap.d.ts +25 -0
- package/styled-system/patterns/wrap.mjs +25 -0
- package/styled-system/recipes/button.d.ts +39 -0
- package/styled-system/recipes/button.mjs +40 -0
- package/styled-system/recipes/card.d.ts +39 -0
- package/styled-system/recipes/card.mjs +36 -0
- package/styled-system/recipes/create-recipe.mjs +82 -0
- package/styled-system/recipes/dialog.d.ts +35 -0
- package/styled-system/recipes/dialog.mjs +63 -0
- package/styled-system/recipes/icon-button.d.ts +39 -0
- package/styled-system/recipes/icon-button.mjs +39 -0
- package/styled-system/recipes/index.d.ts +7 -0
- package/styled-system/recipes/index.mjs +6 -0
- package/styled-system/recipes/input.d.ts +40 -0
- package/styled-system/recipes/input.mjs +40 -0
- package/styled-system/recipes/switch-control.d.ts +35 -0
- package/styled-system/recipes/switch-control.mjs +53 -0
- package/styled-system/recipes/switch.d.ts +35 -0
- package/styled-system/recipes/switch.mjs +53 -0
- package/styled-system/tokens/index.d.ts +9 -0
- package/styled-system/tokens/index.mjs +924 -0
- package/styled-system/tokens/tokens.d.ts +48 -0
- package/styled-system/types/composition.d.ts +164 -0
- package/styled-system/types/conditions.d.ts +306 -0
- package/styled-system/types/csstype.d.ts +21298 -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 +52 -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 +224 -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 +7468 -0
- package/styled-system/types/system-types.d.ts +109 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
import type * as Panda from '@pandacss/dev'
|
|
4
|
+
import type { RecipeVariantRecord, RecipeConfig, SlotRecipeVariantRecord, SlotRecipeConfig } from './recipe';
|
|
5
|
+
import type { Parts } from './parts';
|
|
6
|
+
import type { PatternConfig, PatternProperties } from './pattern';
|
|
7
|
+
import type { GlobalStyleObject, SystemStyleObject } from './system-types';
|
|
8
|
+
import type { CompositionStyles } from './composition';
|
|
9
|
+
|
|
10
|
+
declare module '@pandacss/dev' {
|
|
11
|
+
export function defineRecipe<V extends RecipeVariantRecord>(config: RecipeConfig<V>): Panda.RecipeConfig
|
|
12
|
+
export function defineSlotRecipe<S extends string, V extends SlotRecipeVariantRecord<S>>(config: SlotRecipeConfig<S, V>): Panda.SlotRecipeConfig
|
|
13
|
+
export function defineStyles(definition: SystemStyleObject): SystemStyleObject
|
|
14
|
+
export function defineGlobalStyles(definition: GlobalStyleObject): Panda.GlobalStyleObject
|
|
15
|
+
export function defineTextStyles(definition: CompositionStyles['textStyles']): Panda.TextStyles
|
|
16
|
+
export function defineAnimationStyles(definition: CompositionStyles['animationStyles']): Panda.AnimationStyles
|
|
17
|
+
export function defineLayerStyles(definition: CompositionStyles['layerStyles']): Panda.LayerStyles
|
|
18
|
+
export function definePattern<T extends PatternProperties>(config: PatternConfig<T>): Panda.PatternConfig
|
|
19
|
+
export function defineParts<T extends Parts>(parts: T): (config: Partial<Record<keyof T, SystemStyleObject>>) => Partial<Record<keyof T, SystemStyleObject>>
|
|
20
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { ComponentPropsWithoutRef, ElementType, ElementRef, JSX, Ref } from 'react'
|
|
3
|
+
import type { RecipeDefinition, RecipeSelection, RecipeVariantRecord } from './recipe';
|
|
4
|
+
import type { Assign, DistributiveOmit, DistributiveUnion, JsxHTMLProps, JsxStyleProps, Pretty } from './system-types';
|
|
5
|
+
|
|
6
|
+
interface Dict {
|
|
7
|
+
[k: string]: unknown
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type ComponentProps<T extends ElementType> = DistributiveOmit<ComponentPropsWithoutRef<T>, 'ref'> & {
|
|
11
|
+
ref?: Ref<ElementRef<T>>
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface StyledComponent<T extends ElementType, P extends Dict = {}> {
|
|
15
|
+
(props: JsxHTMLProps<ComponentProps<T>, Assign<JsxStyleProps, P>>): JSX.Element
|
|
16
|
+
displayName?: string
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface RecipeFn {
|
|
20
|
+
__type: any
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface JsxFactoryOptions<TProps extends Dict> {
|
|
24
|
+
dataAttr?: boolean
|
|
25
|
+
defaultProps?: TProps
|
|
26
|
+
shouldForwardProp?(prop: string, variantKeys: string[]): boolean
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type JsxRecipeProps<T extends ElementType, P extends Dict> = JsxHTMLProps<ComponentProps<T>, P>;
|
|
30
|
+
|
|
31
|
+
export type JsxElement<T extends ElementType, P extends Dict> = T extends StyledComponent<infer A, infer B>
|
|
32
|
+
? StyledComponent<A, Pretty<DistributiveUnion<P, B>>>
|
|
33
|
+
: StyledComponent<T, P>
|
|
34
|
+
|
|
35
|
+
export interface JsxFactory {
|
|
36
|
+
<T extends ElementType>(component: T): StyledComponent<T, {}>
|
|
37
|
+
<T extends ElementType, P extends RecipeVariantRecord>(component: T, recipe: RecipeDefinition<P>, options?: JsxFactoryOptions<JsxRecipeProps<T, RecipeSelection<P>>>): JsxElement<
|
|
38
|
+
T,
|
|
39
|
+
RecipeSelection<P>
|
|
40
|
+
>
|
|
41
|
+
<T extends ElementType, P extends RecipeFn>(component: T, recipeFn: P, options?: JsxFactoryOptions<JsxRecipeProps<T, P['__type']>>): JsxElement<T, P['__type']>
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export type JsxElements = {
|
|
45
|
+
[K in keyof JSX.IntrinsicElements]: StyledComponent<K, {}>
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export type Styled = JsxFactory & JsxElements
|
|
49
|
+
|
|
50
|
+
export type HTMLStyledProps<T extends ElementType> = JsxHTMLProps<ComponentProps<T>, JsxStyleProps>
|
|
51
|
+
|
|
52
|
+
export type StyledVariantProps<T extends StyledComponent<any, any>> = T extends StyledComponent<any, infer Props> ? Props : never
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { CssProperty, SystemStyleObject } from './system-types';
|
|
3
|
+
import type { TokenCategory } from '../tokens/index';
|
|
4
|
+
|
|
5
|
+
type Primitive = string | number | boolean | null | undefined
|
|
6
|
+
type LiteralUnion<T, K extends Primitive = string> = T | (K & Record<never, never>)
|
|
7
|
+
|
|
8
|
+
export type PatternProperty =
|
|
9
|
+
| { type: 'property'; value: CssProperty }
|
|
10
|
+
| { type: 'enum'; value: string[] }
|
|
11
|
+
| { type: 'token'; value: TokenCategory; property?: CssProperty }
|
|
12
|
+
| { type: 'string' | 'boolean' | 'number' }
|
|
13
|
+
|
|
14
|
+
export interface PatternHelpers {
|
|
15
|
+
map: (value: any, fn: (value: string) => string | undefined) => any
|
|
16
|
+
isCssUnit: (value: any) => boolean
|
|
17
|
+
isCssVar: (value: any) => boolean
|
|
18
|
+
isCssFunction: (value: any) => boolean
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface PatternProperties {
|
|
22
|
+
[key: string]: PatternProperty
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
type InferProps<T> = Record<LiteralUnion<keyof T>, any>
|
|
26
|
+
|
|
27
|
+
export type PatternDefaultValue<T> = Partial<InferProps<T>>
|
|
28
|
+
|
|
29
|
+
export type PatternDefaultValueFn<T> = (props: InferProps<T>) => PatternDefaultValue<T>
|
|
30
|
+
|
|
31
|
+
export interface PatternConfig<T extends PatternProperties = PatternProperties> {
|
|
32
|
+
/**
|
|
33
|
+
* The description of the pattern. This will be used in the JSDoc comment.
|
|
34
|
+
*/
|
|
35
|
+
description?: string
|
|
36
|
+
/**
|
|
37
|
+
* The JSX element rendered by the pattern
|
|
38
|
+
* @default 'div'
|
|
39
|
+
*/
|
|
40
|
+
jsxElement?: string
|
|
41
|
+
/**
|
|
42
|
+
* The properties of the pattern.
|
|
43
|
+
*/
|
|
44
|
+
properties?: T
|
|
45
|
+
/**
|
|
46
|
+
* The default values of the pattern.
|
|
47
|
+
*/
|
|
48
|
+
defaultValues?: PatternDefaultValue<T> | PatternDefaultValueFn<T>
|
|
49
|
+
/**
|
|
50
|
+
* The css object this pattern will generate.
|
|
51
|
+
*/
|
|
52
|
+
transform?: (props: InferProps<T>, helpers: PatternHelpers) => SystemStyleObject
|
|
53
|
+
/**
|
|
54
|
+
* Whether the pattern is deprecated.
|
|
55
|
+
*/
|
|
56
|
+
deprecated?: boolean | string
|
|
57
|
+
/**
|
|
58
|
+
* The jsx element name this pattern will generate.
|
|
59
|
+
*/
|
|
60
|
+
jsxName?: string
|
|
61
|
+
/**
|
|
62
|
+
* The jsx elements to track for this pattern. Can be string or Regexp.
|
|
63
|
+
*
|
|
64
|
+
* @default capitalize(pattern.name)
|
|
65
|
+
* @example ['Button', 'Link', /Button$/]
|
|
66
|
+
*/
|
|
67
|
+
jsx?: Array<string | RegExp>
|
|
68
|
+
/**
|
|
69
|
+
* Whether to only generate types for the specified properties.
|
|
70
|
+
* This will disallow css properties
|
|
71
|
+
*/
|
|
72
|
+
strict?: boolean
|
|
73
|
+
/**
|
|
74
|
+
* @experimental
|
|
75
|
+
* Disallow certain css properties for this pattern
|
|
76
|
+
*/
|
|
77
|
+
blocklist?: LiteralUnion<CssProperty>[]
|
|
78
|
+
}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { ConditionalValue } from './conditions';
|
|
3
|
+
import type { CssProperties } from './system-types';
|
|
4
|
+
import type { Tokens } from '../tokens/index';
|
|
5
|
+
|
|
6
|
+
export interface UtilityValues {
|
|
7
|
+
top: Tokens["spacing"];
|
|
8
|
+
left: Tokens["spacing"];
|
|
9
|
+
inset: "auto" | Tokens["spacing"];
|
|
10
|
+
insetInline: Tokens["spacing"];
|
|
11
|
+
insetBlock: Tokens["spacing"];
|
|
12
|
+
insetBlockEnd: Tokens["spacing"];
|
|
13
|
+
insetBlockStart: Tokens["spacing"];
|
|
14
|
+
insetInlineEnd: Tokens["spacing"];
|
|
15
|
+
insetInlineStart: Tokens["spacing"];
|
|
16
|
+
right: Tokens["spacing"];
|
|
17
|
+
bottom: Tokens["spacing"];
|
|
18
|
+
float: "start" | "end" | CssProperties["float"];
|
|
19
|
+
hideFrom: Tokens["breakpoints"];
|
|
20
|
+
hideBelow: Tokens["breakpoints"];
|
|
21
|
+
flexBasis: Tokens["sizes"] | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6" | "1/12" | "2/12" | "3/12" | "4/12" | "5/12" | "6/12" | "7/12" | "8/12" | "9/12" | "10/12" | "11/12" | "full";
|
|
22
|
+
flex: "1" | "auto" | "initial" | "none";
|
|
23
|
+
gridAutoColumns: "min" | "max" | "fr";
|
|
24
|
+
gridAutoRows: "min" | "max" | "fr";
|
|
25
|
+
gap: Tokens["spacing"];
|
|
26
|
+
gridGap: Tokens["spacing"];
|
|
27
|
+
gridRowGap: Tokens["spacing"];
|
|
28
|
+
gridColumnGap: Tokens["spacing"];
|
|
29
|
+
rowGap: Tokens["spacing"];
|
|
30
|
+
columnGap: Tokens["spacing"];
|
|
31
|
+
padding: Tokens["spacing"];
|
|
32
|
+
paddingLeft: Tokens["spacing"];
|
|
33
|
+
paddingRight: Tokens["spacing"];
|
|
34
|
+
paddingTop: Tokens["spacing"];
|
|
35
|
+
paddingBottom: Tokens["spacing"];
|
|
36
|
+
paddingBlock: Tokens["spacing"];
|
|
37
|
+
paddingBlockEnd: Tokens["spacing"];
|
|
38
|
+
paddingBlockStart: Tokens["spacing"];
|
|
39
|
+
paddingInline: Tokens["spacing"];
|
|
40
|
+
paddingInlineEnd: Tokens["spacing"];
|
|
41
|
+
paddingInlineStart: Tokens["spacing"];
|
|
42
|
+
marginLeft: "auto" | Tokens["spacing"];
|
|
43
|
+
marginRight: "auto" | Tokens["spacing"];
|
|
44
|
+
marginTop: "auto" | Tokens["spacing"];
|
|
45
|
+
marginBottom: "auto" | Tokens["spacing"];
|
|
46
|
+
margin: "auto" | Tokens["spacing"];
|
|
47
|
+
marginBlock: "auto" | Tokens["spacing"];
|
|
48
|
+
marginBlockEnd: "auto" | Tokens["spacing"];
|
|
49
|
+
marginBlockStart: "auto" | Tokens["spacing"];
|
|
50
|
+
marginInline: "auto" | Tokens["spacing"];
|
|
51
|
+
marginInlineEnd: "auto" | Tokens["spacing"];
|
|
52
|
+
marginInlineStart: "auto" | Tokens["spacing"];
|
|
53
|
+
spaceX: "auto" | Tokens["spacing"] | CssProperties["marginInlineStart"];
|
|
54
|
+
spaceY: "auto" | Tokens["spacing"] | CssProperties["marginBlockStart"];
|
|
55
|
+
outlineColor: Tokens["colors"];
|
|
56
|
+
outlineOffset: Tokens["spacing"];
|
|
57
|
+
divideColor: Tokens["colors"];
|
|
58
|
+
divideStyle: CssProperties["borderStyle"];
|
|
59
|
+
width: "auto" | Tokens["sizes"] | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6" | "1/12" | "2/12" | "3/12" | "4/12" | "5/12" | "6/12" | "7/12" | "8/12" | "9/12" | "10/12" | "11/12" | "screen";
|
|
60
|
+
inlineSize: "auto" | Tokens["sizes"] | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6" | "1/12" | "2/12" | "3/12" | "4/12" | "5/12" | "6/12" | "7/12" | "8/12" | "9/12" | "10/12" | "11/12" | "screen";
|
|
61
|
+
minWidth: "auto" | Tokens["sizes"] | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6" | "1/12" | "2/12" | "3/12" | "4/12" | "5/12" | "6/12" | "7/12" | "8/12" | "9/12" | "10/12" | "11/12" | "screen";
|
|
62
|
+
minInlineSize: "auto" | Tokens["sizes"] | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6" | "1/12" | "2/12" | "3/12" | "4/12" | "5/12" | "6/12" | "7/12" | "8/12" | "9/12" | "10/12" | "11/12" | "screen";
|
|
63
|
+
maxWidth: "auto" | Tokens["sizes"] | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6" | "1/12" | "2/12" | "3/12" | "4/12" | "5/12" | "6/12" | "7/12" | "8/12" | "9/12" | "10/12" | "11/12" | "screen";
|
|
64
|
+
maxInlineSize: "auto" | Tokens["sizes"] | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6" | "1/12" | "2/12" | "3/12" | "4/12" | "5/12" | "6/12" | "7/12" | "8/12" | "9/12" | "10/12" | "11/12" | "screen";
|
|
65
|
+
height: "auto" | Tokens["sizes"] | "svh" | "lvh" | "dvh" | "screen" | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6";
|
|
66
|
+
blockSize: "auto" | Tokens["sizes"] | "svh" | "lvh" | "dvh" | "screen" | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6";
|
|
67
|
+
minHeight: "auto" | Tokens["sizes"] | "svh" | "lvh" | "dvh" | "screen" | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6";
|
|
68
|
+
minBlockSize: "auto" | Tokens["sizes"] | "svh" | "lvh" | "dvh" | "screen" | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6";
|
|
69
|
+
maxHeight: "auto" | Tokens["sizes"] | "svh" | "lvh" | "dvh" | "screen" | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6";
|
|
70
|
+
maxBlockSize: "auto" | Tokens["sizes"] | "svh" | "lvh" | "dvh" | "screen" | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6";
|
|
71
|
+
color: Tokens["colors"];
|
|
72
|
+
fontFamily: Tokens["fonts"];
|
|
73
|
+
fontSize: Tokens["fontSizes"];
|
|
74
|
+
fontWeight: Tokens["fontWeights"];
|
|
75
|
+
fontSmoothing: "antialiased" | "subpixel-antialiased";
|
|
76
|
+
letterSpacing: Tokens["letterSpacings"];
|
|
77
|
+
lineHeight: Tokens["lineHeights"];
|
|
78
|
+
textDecorationColor: Tokens["colors"];
|
|
79
|
+
textEmphasisColor: Tokens["colors"];
|
|
80
|
+
textIndent: Tokens["spacing"];
|
|
81
|
+
textShadow: Tokens["shadows"];
|
|
82
|
+
textShadowColor: Tokens["colors"];
|
|
83
|
+
textWrap: "wrap" | "balance" | "nowrap";
|
|
84
|
+
truncate: boolean;
|
|
85
|
+
background: Tokens["colors"];
|
|
86
|
+
backgroundColor: Tokens["colors"];
|
|
87
|
+
backgroundGradient: "to-t" | "to-tr" | "to-r" | "to-br" | "to-b" | "to-bl" | "to-l" | "to-tl";
|
|
88
|
+
textGradient: "to-t" | "to-tr" | "to-r" | "to-br" | "to-b" | "to-bl" | "to-l" | "to-tl";
|
|
89
|
+
gradientFrom: Tokens["colors"];
|
|
90
|
+
gradientTo: Tokens["colors"];
|
|
91
|
+
gradientVia: Tokens["colors"];
|
|
92
|
+
borderRadius: Tokens["radii"];
|
|
93
|
+
borderTopLeftRadius: Tokens["radii"];
|
|
94
|
+
borderTopRightRadius: Tokens["radii"];
|
|
95
|
+
borderBottomRightRadius: Tokens["radii"];
|
|
96
|
+
borderBottomLeftRadius: Tokens["radii"];
|
|
97
|
+
borderTopRadius: Tokens["radii"] | CssProperties["borderRadius"];
|
|
98
|
+
borderRightRadius: Tokens["radii"] | CssProperties["borderRadius"];
|
|
99
|
+
borderBottomRadius: Tokens["radii"] | CssProperties["borderRadius"];
|
|
100
|
+
borderLeftRadius: Tokens["radii"] | CssProperties["borderRadius"];
|
|
101
|
+
borderStartStartRadius: Tokens["radii"];
|
|
102
|
+
borderStartEndRadius: Tokens["radii"];
|
|
103
|
+
borderStartRadius: Tokens["radii"] | CssProperties["borderRadius"];
|
|
104
|
+
borderEndStartRadius: Tokens["radii"];
|
|
105
|
+
borderEndEndRadius: Tokens["radii"];
|
|
106
|
+
borderEndRadius: Tokens["radii"] | CssProperties["borderRadius"];
|
|
107
|
+
borderColor: Tokens["colors"];
|
|
108
|
+
borderInlineColor: Tokens["colors"];
|
|
109
|
+
borderBlockColor: Tokens["colors"];
|
|
110
|
+
borderLeftColor: Tokens["colors"];
|
|
111
|
+
borderInlineStartColor: Tokens["colors"];
|
|
112
|
+
borderRightColor: Tokens["colors"];
|
|
113
|
+
borderInlineEndColor: Tokens["colors"];
|
|
114
|
+
borderTopColor: Tokens["colors"];
|
|
115
|
+
borderBottomColor: Tokens["colors"];
|
|
116
|
+
borderBlockEndColor: Tokens["colors"];
|
|
117
|
+
borderBlockStartColor: Tokens["colors"];
|
|
118
|
+
boxShadow: Tokens["shadows"];
|
|
119
|
+
boxShadowColor: Tokens["colors"];
|
|
120
|
+
filter: "auto";
|
|
121
|
+
backdropFilter: "auto";
|
|
122
|
+
borderSpacing: Tokens["spacing"] | "auto";
|
|
123
|
+
borderSpacingX: Tokens["spacing"];
|
|
124
|
+
borderSpacingY: Tokens["spacing"];
|
|
125
|
+
transitionTimingFunction: Tokens["easings"];
|
|
126
|
+
transitionDelay: Tokens["durations"];
|
|
127
|
+
transitionDuration: Tokens["durations"];
|
|
128
|
+
transition: "all" | "common" | "background" | "colors" | "opacity" | "shadow" | "transform";
|
|
129
|
+
animationName: "spin" | "ping" | "pulse" | "bounce";
|
|
130
|
+
animationTimingFunction: Tokens["easings"];
|
|
131
|
+
animationDuration: Tokens["durations"];
|
|
132
|
+
animationDelay: Tokens["durations"];
|
|
133
|
+
rotate: "auto" | "auto-3d" | CssProperties["rotate"];
|
|
134
|
+
rotateX: CssProperties["rotate"];
|
|
135
|
+
rotateY: CssProperties["rotate"];
|
|
136
|
+
rotateZ: CssProperties["rotate"];
|
|
137
|
+
scale: "auto" | CssProperties["scale"];
|
|
138
|
+
translate: "auto" | "auto-3d" | CssProperties["translate"];
|
|
139
|
+
translateX: Tokens["spacing"] | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "full" | "-1/2" | "-1/3" | "-2/3" | "-1/4" | "-2/4" | "-3/4" | "-full";
|
|
140
|
+
translateY: Tokens["spacing"] | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "full" | "-1/2" | "-1/3" | "-2/3" | "-1/4" | "-2/4" | "-3/4" | "-full";
|
|
141
|
+
translateZ: Tokens["spacing"] | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "full" | "-1/2" | "-1/3" | "-2/3" | "-1/4" | "-2/4" | "-3/4" | "-full";
|
|
142
|
+
accentColor: Tokens["colors"];
|
|
143
|
+
caretColor: Tokens["colors"];
|
|
144
|
+
scrollbar: "visible" | "hidden";
|
|
145
|
+
scrollbarColor: Tokens["colors"];
|
|
146
|
+
scrollbarWidth: Tokens["sizes"];
|
|
147
|
+
scrollMargin: Tokens["spacing"];
|
|
148
|
+
scrollMarginLeft: Tokens["spacing"];
|
|
149
|
+
scrollMarginRight: Tokens["spacing"];
|
|
150
|
+
scrollMarginTop: Tokens["spacing"];
|
|
151
|
+
scrollMarginBottom: Tokens["spacing"];
|
|
152
|
+
scrollMarginBlock: Tokens["spacing"];
|
|
153
|
+
scrollMarginBlockEnd: Tokens["spacing"];
|
|
154
|
+
scrollMarginBlockStart: Tokens["spacing"];
|
|
155
|
+
scrollMarginInline: Tokens["spacing"];
|
|
156
|
+
scrollMarginInlineEnd: Tokens["spacing"];
|
|
157
|
+
scrollMarginInlineStart: Tokens["spacing"];
|
|
158
|
+
scrollPadding: Tokens["spacing"];
|
|
159
|
+
scrollPaddingBlock: Tokens["spacing"];
|
|
160
|
+
scrollPaddingBlockStart: Tokens["spacing"];
|
|
161
|
+
scrollPaddingBlockEnd: Tokens["spacing"];
|
|
162
|
+
scrollPaddingInline: Tokens["spacing"];
|
|
163
|
+
scrollPaddingInlineEnd: Tokens["spacing"];
|
|
164
|
+
scrollPaddingInlineStart: Tokens["spacing"];
|
|
165
|
+
scrollPaddingLeft: Tokens["spacing"];
|
|
166
|
+
scrollPaddingRight: Tokens["spacing"];
|
|
167
|
+
scrollPaddingTop: Tokens["spacing"];
|
|
168
|
+
scrollPaddingBottom: Tokens["spacing"];
|
|
169
|
+
scrollSnapType: "none" | "x" | "y" | "both";
|
|
170
|
+
scrollSnapStrictness: "mandatory" | "proximity";
|
|
171
|
+
scrollSnapMargin: Tokens["spacing"];
|
|
172
|
+
scrollSnapMarginTop: Tokens["spacing"];
|
|
173
|
+
scrollSnapMarginBottom: Tokens["spacing"];
|
|
174
|
+
scrollSnapMarginLeft: Tokens["spacing"];
|
|
175
|
+
scrollSnapMarginRight: Tokens["spacing"];
|
|
176
|
+
fill: Tokens["colors"];
|
|
177
|
+
stroke: Tokens["colors"];
|
|
178
|
+
srOnly: boolean;
|
|
179
|
+
debug: boolean;
|
|
180
|
+
containerName: CssProperties["containerName"];
|
|
181
|
+
colorPalette: "primary" | "secondary" | "tertiary" | "neutral" | "neutralVariant" | "error" | "onPrimary" | "primaryContainer" | "onPrimaryContainer" | "onSecondary" | "secondaryContainer" | "onSecondaryContainer" | "onTertiary" | "tertiaryContainer" | "onTertiaryContainer" | "onError" | "errorContainer" | "onErrorContainer" | "surface" | "onSurface" | "surfaceVariant" | "onSurfaceVariant" | "surfaceContainerLowest" | "surfaceContainerLow" | "surfaceContainer" | "surfaceContainerHigh" | "surfaceContainerHighest" | "outline" | "outlineVariant" | "inverseSurface" | "inverseOnSurface" | "inversePrimary" | "background" | "onBackground" | "scrim" | "shadow";
|
|
182
|
+
textStyle: "displayLarge" | "displayMedium" | "displaySmall" | "headlineLarge" | "headlineMedium" | "headlineSmall" | "titleLarge" | "titleMedium" | "titleSmall" | "bodyLarge" | "bodyMedium" | "bodySmall" | "labelLarge" | "labelMedium" | "labelSmall";
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
type WithColorOpacityModifier<T> = [T] extends [string] ? `${T}/${string}` & { __colorOpacityModifier?: true } : never
|
|
188
|
+
|
|
189
|
+
type ImportantMark = "!" | "!important"
|
|
190
|
+
type WhitespaceImportant = ` ${ImportantMark}`
|
|
191
|
+
type Important = ImportantMark | WhitespaceImportant
|
|
192
|
+
type WithImportant<T> = [T] extends [string] ? `${T}${Important}` & { __important?: true } : never
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Only relevant when using `strictTokens` or `strictPropertyValues` in your config.
|
|
196
|
+
* - Allows you to use an escape hatch (e.g. `[123px]`) to use any string as a value.
|
|
197
|
+
* - Allows you to use a color opacity modifier (e.g. `red/300`) with known color values.
|
|
198
|
+
* - Allows you to use an important mark (e.g. `!` or `!important`) in the value.
|
|
199
|
+
*
|
|
200
|
+
* This is useful when you want to use a value that is not defined in the config or want to opt-out of the defaults.
|
|
201
|
+
*
|
|
202
|
+
* @example
|
|
203
|
+
* css({
|
|
204
|
+
* fontSize: '[123px]', // ⚠️ will not throw even if you haven't defined 123px as a token
|
|
205
|
+
* })
|
|
206
|
+
*
|
|
207
|
+
* @see https://panda-css.com/docs/concepts/writing-styles#stricttokens
|
|
208
|
+
* @see https://panda-css.com/docs/concepts/writing-styles#strictpropertyvalues
|
|
209
|
+
*/
|
|
210
|
+
export type WithEscapeHatch<T> = T | `[${string}]` | WithColorOpacityModifier<T> | WithImportant<T>
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Will restrict the value of properties that have predefined values to those values only.
|
|
214
|
+
*
|
|
215
|
+
* @example
|
|
216
|
+
* css({
|
|
217
|
+
* display: 'abc', // ❌ will throw
|
|
218
|
+
* })
|
|
219
|
+
*
|
|
220
|
+
* @see https://panda-css.com/docs/concepts/writing-styles#strictpropertyvalues
|
|
221
|
+
*/
|
|
222
|
+
export type OnlyKnown<Key, Value> = Value extends boolean
|
|
223
|
+
? Value
|
|
224
|
+
: Value extends `${infer _}` ? Value : never
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { RecipeRule } from './static-css';
|
|
3
|
+
import type { SystemStyleObject, DistributiveOmit, Pretty } from './system-types';
|
|
4
|
+
|
|
5
|
+
type StringToBoolean<T> = T extends 'true' | 'false' ? boolean : T
|
|
6
|
+
|
|
7
|
+
export type RecipeVariantRecord = Record<any, Record<any, SystemStyleObject>>
|
|
8
|
+
|
|
9
|
+
export type RecipeSelection<T extends RecipeVariantRecord> = keyof any extends keyof T
|
|
10
|
+
? {}
|
|
11
|
+
: {
|
|
12
|
+
[K in keyof T]?: StringToBoolean<keyof T[K]> | undefined
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type RecipeVariantFn<T extends RecipeVariantRecord> = (props?: RecipeSelection<T>) => string
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Extract the variant as optional props from a `cva` function.
|
|
19
|
+
* Intended to be used with a JSX component, prefer `RecipeVariant` for a more strict type.
|
|
20
|
+
*/
|
|
21
|
+
export type RecipeVariantProps<
|
|
22
|
+
T extends RecipeVariantFn<RecipeVariantRecord> | SlotRecipeVariantFn<string, SlotRecipeVariantRecord<string>>,
|
|
23
|
+
> = Pretty<Parameters<T>[0]>
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Extract the variants from a `cva` function.
|
|
27
|
+
*/
|
|
28
|
+
export type RecipeVariant<
|
|
29
|
+
T extends RecipeVariantFn<RecipeVariantRecord> | SlotRecipeVariantFn<string, SlotRecipeVariantRecord<string>>,
|
|
30
|
+
> = Exclude<Pretty<Required<RecipeVariantProps<T>>>, undefined>
|
|
31
|
+
|
|
32
|
+
type RecipeVariantMap<T extends RecipeVariantRecord> = {
|
|
33
|
+
[K in keyof T]: Array<keyof T[K]>
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* -----------------------------------------------------------------------------
|
|
37
|
+
* Recipe / Standard
|
|
38
|
+
* -----------------------------------------------------------------------------*/
|
|
39
|
+
|
|
40
|
+
export interface RecipeRuntimeFn<T extends RecipeVariantRecord> extends RecipeVariantFn<T> {
|
|
41
|
+
__type: RecipeSelection<T>
|
|
42
|
+
variantKeys: (keyof T)[]
|
|
43
|
+
variantMap: RecipeVariantMap<T>
|
|
44
|
+
raw: (props?: RecipeSelection<T>) => SystemStyleObject
|
|
45
|
+
config: RecipeConfig<T>
|
|
46
|
+
splitVariantProps<Props extends RecipeSelection<T>>(
|
|
47
|
+
props: Props,
|
|
48
|
+
): [RecipeSelection<T>, Pretty<DistributiveOmit<Props, keyof T>>]
|
|
49
|
+
getVariantProps: (props?: RecipeSelection<T>) => RecipeSelection<T>
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
type OneOrMore<T> = T | Array<T>
|
|
53
|
+
|
|
54
|
+
export type RecipeCompoundSelection<T> = {
|
|
55
|
+
[K in keyof T]?: OneOrMore<StringToBoolean<keyof T[K]>> | undefined
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export type RecipeCompoundVariant<T> = T & {
|
|
59
|
+
css: SystemStyleObject
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface RecipeDefinition<T extends RecipeVariantRecord = RecipeVariantRecord> {
|
|
63
|
+
/**
|
|
64
|
+
* The base styles of the recipe.
|
|
65
|
+
*/
|
|
66
|
+
base?: SystemStyleObject
|
|
67
|
+
/**
|
|
68
|
+
* Whether the recipe is deprecated.
|
|
69
|
+
*/
|
|
70
|
+
deprecated?: boolean | string
|
|
71
|
+
/**
|
|
72
|
+
* The multi-variant styles of the recipe.
|
|
73
|
+
*/
|
|
74
|
+
variants?: T
|
|
75
|
+
/**
|
|
76
|
+
* The default variants of the recipe.
|
|
77
|
+
*/
|
|
78
|
+
defaultVariants?: RecipeSelection<T>
|
|
79
|
+
/**
|
|
80
|
+
* The styles to apply when a combination of variants is selected.
|
|
81
|
+
*/
|
|
82
|
+
compoundVariants?: Pretty<RecipeCompoundVariant<RecipeCompoundSelection<T>>>[]
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export type RecipeCreatorFn = <T extends RecipeVariantRecord>(config: RecipeDefinition<T>) => RecipeRuntimeFn<T>
|
|
86
|
+
|
|
87
|
+
interface RecipeConfigMeta {
|
|
88
|
+
/**
|
|
89
|
+
* The class name of the recipe.
|
|
90
|
+
*/
|
|
91
|
+
className: string
|
|
92
|
+
/**
|
|
93
|
+
* The description of the recipe. This will be used in the JSDoc comment.
|
|
94
|
+
*/
|
|
95
|
+
description?: string
|
|
96
|
+
/**
|
|
97
|
+
* The jsx elements to track for this recipe. Can be string or Regexp.
|
|
98
|
+
*
|
|
99
|
+
* @default capitalize(recipe.name)
|
|
100
|
+
* @example ['Button', 'Link', /Button$/]
|
|
101
|
+
*/
|
|
102
|
+
jsx?: Array<string | RegExp>
|
|
103
|
+
/**
|
|
104
|
+
* Variants to pre-generate, will be include in the final `config.staticCss`
|
|
105
|
+
*/
|
|
106
|
+
staticCss?: RecipeRule[]
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export interface RecipeConfig<T extends RecipeVariantRecord = RecipeVariantRecord>
|
|
110
|
+
extends RecipeDefinition<T>,
|
|
111
|
+
RecipeConfigMeta {}
|
|
112
|
+
|
|
113
|
+
/* -----------------------------------------------------------------------------
|
|
114
|
+
* Recipe / Slot
|
|
115
|
+
* -----------------------------------------------------------------------------*/
|
|
116
|
+
|
|
117
|
+
type SlotRecord<S extends string, T> = Partial<Record<S, T>>
|
|
118
|
+
|
|
119
|
+
export type SlotRecipeVariantRecord<S extends string> = Record<any, Record<any, SlotRecord<S, SystemStyleObject>>>
|
|
120
|
+
|
|
121
|
+
export type SlotRecipeVariantFn<S extends string, T extends RecipeVariantRecord> = (
|
|
122
|
+
props?: RecipeSelection<T>,
|
|
123
|
+
) => SlotRecord<S, string>
|
|
124
|
+
|
|
125
|
+
export interface SlotRecipeRuntimeFn<S extends string, T extends SlotRecipeVariantRecord<S>>
|
|
126
|
+
extends SlotRecipeVariantFn<S, T> {
|
|
127
|
+
raw: (props?: RecipeSelection<T>) => Record<S, SystemStyleObject>
|
|
128
|
+
variantKeys: (keyof T)[]
|
|
129
|
+
variantMap: RecipeVariantMap<T>
|
|
130
|
+
splitVariantProps<Props extends RecipeSelection<T>>(
|
|
131
|
+
props: Props,
|
|
132
|
+
): [RecipeSelection<T>, Pretty<DistributiveOmit<Props, keyof T>>]
|
|
133
|
+
getVariantProps: (props?: RecipeSelection<T>) => RecipeSelection<T>
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export type SlotRecipeCompoundVariant<S extends string, T> = T & {
|
|
137
|
+
css: SlotRecord<S, SystemStyleObject>
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export interface SlotRecipeDefinition<
|
|
141
|
+
S extends string = string,
|
|
142
|
+
T extends SlotRecipeVariantRecord<S> = SlotRecipeVariantRecord<S>,
|
|
143
|
+
> {
|
|
144
|
+
/**
|
|
145
|
+
* An optional class name that can be used to target slots in the DOM.
|
|
146
|
+
*/
|
|
147
|
+
className?: string
|
|
148
|
+
/**
|
|
149
|
+
* Whether the recipe is deprecated.
|
|
150
|
+
*/
|
|
151
|
+
deprecated?: boolean | string
|
|
152
|
+
/**
|
|
153
|
+
* The parts/slots of the recipe.
|
|
154
|
+
*/
|
|
155
|
+
slots: S[] | Readonly<S[]>
|
|
156
|
+
/**
|
|
157
|
+
* The base styles of the recipe.
|
|
158
|
+
*/
|
|
159
|
+
base?: SlotRecord<S, SystemStyleObject>
|
|
160
|
+
/**
|
|
161
|
+
* The multi-variant styles of the recipe.
|
|
162
|
+
*/
|
|
163
|
+
variants?: T
|
|
164
|
+
/**
|
|
165
|
+
* The default variants of the recipe.
|
|
166
|
+
*/
|
|
167
|
+
defaultVariants?: RecipeSelection<T>
|
|
168
|
+
/**
|
|
169
|
+
* The styles to apply when a combination of variants is selected.
|
|
170
|
+
*/
|
|
171
|
+
compoundVariants?: Pretty<SlotRecipeCompoundVariant<S, RecipeCompoundSelection<T>>>[]
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export type SlotRecipeCreatorFn = <S extends string, T extends SlotRecipeVariantRecord<S>>(
|
|
175
|
+
config: SlotRecipeDefinition<S, T>,
|
|
176
|
+
) => SlotRecipeRuntimeFn<S, T>
|
|
177
|
+
|
|
178
|
+
export type SlotRecipeConfig<
|
|
179
|
+
S extends string = string,
|
|
180
|
+
T extends SlotRecipeVariantRecord<S> = SlotRecipeVariantRecord<S>,
|
|
181
|
+
> = SlotRecipeDefinition<S, T> & RecipeConfigMeta
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { Pseudos } from './csstype';
|
|
3
|
+
|
|
4
|
+
type AriaAttributes =
|
|
5
|
+
| '[aria-disabled]'
|
|
6
|
+
| '[aria-hidden]'
|
|
7
|
+
| '[aria-invalid]'
|
|
8
|
+
| '[aria-readonly]'
|
|
9
|
+
| '[aria-required]'
|
|
10
|
+
| '[aria-selected]'
|
|
11
|
+
| '[aria-checked]'
|
|
12
|
+
| '[aria-expanded]'
|
|
13
|
+
| '[aria-pressed]'
|
|
14
|
+
| `[aria-current=${'page' | 'step' | 'location' | 'date' | 'time'}]`
|
|
15
|
+
| '[aria-invalid]'
|
|
16
|
+
| `[aria-sort=${'ascending' | 'descending'}]`
|
|
17
|
+
|
|
18
|
+
type DataAttributes =
|
|
19
|
+
| '[data-selected]'
|
|
20
|
+
| '[data-highlighted]'
|
|
21
|
+
| '[data-hover]'
|
|
22
|
+
| '[data-active]'
|
|
23
|
+
| '[data-checked]'
|
|
24
|
+
| '[data-disabled]'
|
|
25
|
+
| '[data-readonly]'
|
|
26
|
+
| '[data-focus]'
|
|
27
|
+
| '[data-focus-visible]'
|
|
28
|
+
| '[data-focus-visible-added]'
|
|
29
|
+
| '[data-invalid]'
|
|
30
|
+
| '[data-pressed]'
|
|
31
|
+
| '[data-expanded]'
|
|
32
|
+
| '[data-grabbed]'
|
|
33
|
+
| '[data-dragged]'
|
|
34
|
+
| '[data-orientation=horizontal]'
|
|
35
|
+
| '[data-orientation=vertical]'
|
|
36
|
+
| '[data-in-range]'
|
|
37
|
+
| '[data-out-of-range]'
|
|
38
|
+
| '[data-placeholder-shown]'
|
|
39
|
+
| `[data-part=${string}]`
|
|
40
|
+
| `[data-attr=${string}]`
|
|
41
|
+
| `[data-placement=${string}]`
|
|
42
|
+
| `[data-theme=${string}]`
|
|
43
|
+
| `[data-size=${string}]`
|
|
44
|
+
| `[data-state=${string}]`
|
|
45
|
+
| '[data-empty]'
|
|
46
|
+
| '[data-loading]'
|
|
47
|
+
| '[data-loaded]'
|
|
48
|
+
| '[data-enter]'
|
|
49
|
+
| '[data-entering]'
|
|
50
|
+
| '[data-exited]'
|
|
51
|
+
| '[data-exiting]'
|
|
52
|
+
|
|
53
|
+
type AttributeSelector = `&${Pseudos | DataAttributes | AriaAttributes}`
|
|
54
|
+
type ParentSelector = `${DataAttributes | AriaAttributes} &`
|
|
55
|
+
|
|
56
|
+
type AtRuleType = 'media' | 'layer' | 'container' | 'supports' | 'page' | 'scope' | 'starting-style'
|
|
57
|
+
|
|
58
|
+
export type AnySelector = `${string}&` | `&${string}` | `@${AtRuleType}${string}`
|
|
59
|
+
export type Selectors = AttributeSelector | ParentSelector
|