@mekari/pixel3-styled-system 0.0.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/.turbo/turbo-build.log +16 -0
- package/chunks/packages__accordion__src__accordion.css +10 -0
- package/chunks/packages__avatar2__src__modules__avatar.recipes.css +166 -0
- package/chunks/packages__avatar__src__avatar.style.css +150 -0
- package/chunks/packages__avatar__src__avatar.styles.css +171 -0
- package/chunks/packages__avatar__src__modules__avatar.recipes.css +191 -0
- package/chunks/packages__core__node_modules__@mekari__pixel3-accordion__src__accordion.css +10 -0
- package/chunks/packages__core__node_modules__@mekari__pixel3-avatar2__src__modules__avatar.recipes.css +166 -0
- package/chunks/packages__core__node_modules__@mekari__pixel3-avatar__src__avatar.css +16 -0
- package/chunks/packages__core__node_modules__@mekari__pixel3-avatar__src__avatar.style.css +150 -0
- package/chunks/packages__core__node_modules__@mekari__pixel3-avatar__src__avatar.styles.css +171 -0
- package/chunks/packages__core__node_modules__@mekari__pixel3-avatar__src__modules__avatar.recipes.css +191 -0
- package/css/conditions.mjs +34 -0
- package/css/css.d.ts +9 -0
- package/css/css.mjs +44 -0
- package/css/cva.d.ts +6 -0
- package/css/cva.mjs +85 -0
- package/css/cx.d.ts +5 -0
- package/css/cx.mjs +15 -0
- package/css/index.d.ts +5 -0
- package/css/index.mjs +4 -0
- package/css/sva.d.ts +4 -0
- package/css/sva.mjs +35 -0
- package/global.css +59 -0
- package/helpers.mjs +300 -0
- package/jsx/aspect-ratio.d.ts +10 -0
- package/jsx/aspect-ratio.mjs +16 -0
- package/jsx/bleed.d.ts +10 -0
- package/jsx/bleed.mjs +16 -0
- package/jsx/box.d.ts +10 -0
- package/jsx/box.mjs +16 -0
- package/jsx/center.d.ts +10 -0
- package/jsx/center.mjs +16 -0
- package/jsx/circle.d.ts +10 -0
- package/jsx/circle.mjs +16 -0
- package/jsx/container.d.ts +10 -0
- package/jsx/container.mjs +16 -0
- package/jsx/divider.d.ts +10 -0
- package/jsx/divider.mjs +16 -0
- package/jsx/factory-helper.mjs +22 -0
- package/jsx/factory.d.ts +4 -0
- package/jsx/factory.mjs +85 -0
- package/jsx/flex.d.ts +10 -0
- package/jsx/flex.mjs +16 -0
- package/jsx/float.d.ts +10 -0
- package/jsx/float.mjs +16 -0
- package/jsx/grid-item.d.ts +10 -0
- package/jsx/grid-item.mjs +16 -0
- package/jsx/grid.d.ts +10 -0
- package/jsx/grid.mjs +16 -0
- package/jsx/hstack.d.ts +10 -0
- package/jsx/hstack.mjs +16 -0
- package/jsx/index.d.ts +27 -0
- package/jsx/index.mjs +22 -0
- package/jsx/is-valid-prop.d.ts +5 -0
- package/jsx/is-valid-prop.mjs +17 -0
- package/jsx/link-box.d.ts +10 -0
- package/jsx/link-box.mjs +16 -0
- package/jsx/link-overlay.d.ts +10 -0
- package/jsx/link-overlay.mjs +16 -0
- package/jsx/spacer.d.ts +10 -0
- package/jsx/spacer.mjs +16 -0
- package/jsx/square.d.ts +10 -0
- package/jsx/square.mjs +16 -0
- package/jsx/stack.d.ts +10 -0
- package/jsx/stack.mjs +16 -0
- package/jsx/visually-hidden.d.ts +10 -0
- package/jsx/visually-hidden.mjs +16 -0
- package/jsx/vstack.d.ts +10 -0
- package/jsx/vstack.mjs +16 -0
- package/jsx/wrap.d.ts +10 -0
- package/jsx/wrap.mjs +16 -0
- package/package.json +40 -0
- package/patterns/aspect-ratio.d.ts +21 -0
- package/patterns/aspect-ratio.mjs +35 -0
- package/patterns/bleed.d.ts +22 -0
- package/patterns/bleed.mjs +19 -0
- package/patterns/box.d.ts +21 -0
- package/patterns/box.mjs +12 -0
- package/patterns/center.d.ts +21 -0
- package/patterns/center.mjs +18 -0
- package/patterns/circle.d.ts +21 -0
- package/patterns/circle.mjs +22 -0
- package/patterns/container.d.ts +21 -0
- package/patterns/container.mjs +18 -0
- package/patterns/divider.d.ts +23 -0
- package/patterns/divider.mjs +21 -0
- package/patterns/flex.d.ts +27 -0
- package/patterns/flex.mjs +23 -0
- package/patterns/float.d.ts +24 -0
- package/patterns/float.mjs +45 -0
- package/patterns/grid-item.d.ts +26 -0
- package/patterns/grid-item.mjs +22 -0
- package/patterns/grid.d.ts +25 -0
- package/patterns/grid.mjs +22 -0
- package/patterns/hstack.d.ts +22 -0
- package/patterns/hstack.mjs +20 -0
- package/patterns/index.d.ts +21 -0
- package/patterns/index.mjs +20 -0
- package/patterns/link-box.d.ts +21 -0
- package/patterns/link-box.mjs +19 -0
- package/patterns/link-overlay.d.ts +21 -0
- package/patterns/link-overlay.mjs +24 -0
- package/patterns/spacer.d.ts +21 -0
- package/patterns/spacer.mjs +18 -0
- package/patterns/square.d.ts +21 -0
- package/patterns/square.mjs +21 -0
- package/patterns/stack.d.ts +24 -0
- package/patterns/stack.mjs +20 -0
- package/patterns/visually-hidden.d.ts +21 -0
- package/patterns/visually-hidden.mjs +15 -0
- package/patterns/vstack.d.ts +22 -0
- package/patterns/vstack.mjs +20 -0
- package/patterns/wrap.d.ts +25 -0
- package/patterns/wrap.mjs +22 -0
- package/recipes/accordion.d.ts +27 -0
- package/recipes/accordion.mjs +50 -0
- package/recipes/avatar-group-recipe.d.ts +27 -0
- package/recipes/avatar-group-recipe.mjs +43 -0
- package/recipes/avatar-group-slot-recipe.d.ts +27 -0
- package/recipes/avatar-group-slot-recipe.mjs +43 -0
- package/recipes/avatar-recipe.d.ts +30 -0
- package/recipes/avatar-recipe.mjs +122 -0
- package/recipes/avatar-slot-recipe.d.ts +29 -0
- package/recipes/avatar-slot-recipe.mjs +116 -0
- package/recipes/badge-recipe.d.ts +29 -0
- package/recipes/badge-recipe.mjs +160 -0
- package/recipes/button-group-recipe.d.ts +27 -0
- package/recipes/button-group-recipe.mjs +22 -0
- package/recipes/button-recipe.d.ts +28 -0
- package/recipes/button-recipe.mjs +94 -0
- package/recipes/checkbox-slot-recipe.d.ts +27 -0
- package/recipes/checkbox-slot-recipe.mjs +38 -0
- package/recipes/create-recipe.d.ts +1 -0
- package/recipes/create-recipe.mjs +79 -0
- package/recipes/icon-recipe.d.ts +27 -0
- package/recipes/icon-recipe.mjs +29 -0
- package/recipes/index.d.ts +30 -0
- package/recipes/index.mjs +29 -0
- package/recipes/input-addon-recipe.d.ts +29 -0
- package/recipes/input-addon-recipe.mjs +107 -0
- package/recipes/input-addon-slot-recipe.d.ts +28 -0
- package/recipes/input-addon-slot-recipe.mjs +45 -0
- package/recipes/input-group-recipe.d.ts +27 -0
- package/recipes/input-group-recipe.mjs +30 -0
- package/recipes/input-group-slot-recipe.d.ts +27 -0
- package/recipes/input-group-slot-recipe.mjs +30 -0
- package/recipes/input-recipe.d.ts +30 -0
- package/recipes/input-recipe.mjs +63 -0
- package/recipes/input-slot-recipe.d.ts +28 -0
- package/recipes/input-slot-recipe.mjs +53 -0
- package/recipes/popover-content-recipe.d.ts +28 -0
- package/recipes/popover-content-recipe.mjs +34 -0
- package/recipes/popover-list-item-recipe.d.ts +27 -0
- package/recipes/popover-list-item-recipe.mjs +22 -0
- package/recipes/popover-list-recipe.d.ts +27 -0
- package/recipes/popover-list-recipe.mjs +22 -0
- package/recipes/progress-slot-recipe.d.ts +28 -0
- package/recipes/progress-slot-recipe.mjs +57 -0
- package/recipes/radio-slot-recipe.d.ts +27 -0
- package/recipes/radio-slot-recipe.mjs +38 -0
- package/recipes/select-slot-recipe.d.ts +27 -0
- package/recipes/select-slot-recipe.mjs +51 -0
- package/recipes/selected-border-recipe.d.ts +28 -0
- package/recipes/selected-border-recipe.mjs +88 -0
- package/recipes/shared-slot-recipe.d.ts +27 -0
- package/recipes/shared-slot-recipe.mjs +30 -0
- package/recipes/spinner-recipe.d.ts +27 -0
- package/recipes/spinner-recipe.mjs +29 -0
- package/recipes/tab-list-recipe.d.ts +27 -0
- package/recipes/tab-list-recipe.mjs +22 -0
- package/recipes/tab-recipe.d.ts +28 -0
- package/recipes/tab-recipe.mjs +87 -0
- package/recipes/table-container-recipe.d.ts +27 -0
- package/recipes/table-container-recipe.mjs +22 -0
- package/recipes/table-head-recipe.d.ts +27 -0
- package/recipes/table-head-recipe.mjs +22 -0
- package/recipes/table-recipe.d.ts +27 -0
- package/recipes/table-recipe.mjs +22 -0
- package/recipes/tag-recipe.d.ts +28 -0
- package/recipes/tag-recipe.mjs +66 -0
- package/recipes/tag-slot-recipe.d.ts +28 -0
- package/recipes/tag-slot-recipe.mjs +66 -0
- package/recipes/text-recipe.d.ts +28 -0
- package/recipes/text-recipe.mjs +40 -0
- package/recipes/textarea-recipe.d.ts +27 -0
- package/recipes/textarea-recipe.mjs +26 -0
- package/recipes/toggle-slot-recipe.d.ts +27 -0
- package/recipes/toggle-slot-recipe.mjs +38 -0
- package/recipes/tooltip-recipe.d.ts +27 -0
- package/recipes/tooltip-recipe.mjs +22 -0
- package/reset.css +214 -0
- package/styles.css +246 -0
- package/tokens/index.css +179 -0
- package/tokens/index.d.ts +9 -0
- package/tokens/index.mjs +848 -0
- package/tokens/keyframes.css +23 -0
- package/tokens/tokens.d.ts +57 -0
- package/types/composition.d.ts +111 -0
- package/types/conditions.d.ts +256 -0
- package/types/csstype.d.ts +20749 -0
- package/types/global.d.ts +19 -0
- package/types/index.d.ts +8 -0
- package/types/jsx.d.ts +54 -0
- package/types/parts.d.ts +8 -0
- package/types/pattern.d.ts +63 -0
- package/types/prop-type.d.ts +317 -0
- package/types/recipe.d.ts +146 -0
- package/types/selectors.d.ts +59 -0
- package/types/style-props.d.ts +653 -0
- package/types/system-types.d.ts +93 -0
|
@@ -0,0 +1,19 @@
|
|
|
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 defineLayerStyles(definition: CompositionStyles['layerStyles']): Panda.LayerStyles
|
|
17
|
+
export function definePattern<T extends PatternProperties>(config: PatternConfig<T>): Panda.PatternConfig
|
|
18
|
+
export function defineParts<T extends Parts>(parts: T): (config: Partial<Record<keyof T, SystemStyleObject>>) => Partial<Record<keyof T, SystemStyleObject>>
|
|
19
|
+
}
|
package/types/index.d.ts
ADDED
package/types/jsx.d.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { Component, FunctionalComponent, NativeElements } from 'vue'
|
|
3
|
+
|
|
4
|
+
import type { RecipeDefinition, RecipeSelection, RecipeVariantRecord } from './recipe';
|
|
5
|
+
import type { Assign, DistributiveOmit, DistributiveUnion, JsxHTMLProps, JsxStyleProps, Pretty } from './system-types';
|
|
6
|
+
|
|
7
|
+
export type IntrinsicElement = keyof NativeElements
|
|
8
|
+
|
|
9
|
+
export type ElementType = IntrinsicElement | Component
|
|
10
|
+
|
|
11
|
+
export type ComponentProps<T extends ElementType> = T extends IntrinsicElement
|
|
12
|
+
? NativeElements[T]
|
|
13
|
+
: T extends Component<infer Props>
|
|
14
|
+
? Props
|
|
15
|
+
: never
|
|
16
|
+
|
|
17
|
+
export interface StyledComponent<T extends ElementType, P extends Dict = {}> extends FunctionalComponent<
|
|
18
|
+
JsxHTMLProps<ComponentProps<T>, Assign<JsxStyleProps, P>>
|
|
19
|
+
> {}
|
|
20
|
+
|
|
21
|
+
interface RecipeFn {
|
|
22
|
+
__type: any
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface JsxFactoryOptions<TProps extends Dict> {
|
|
26
|
+
dataAttr?: boolean
|
|
27
|
+
defaultProps?: TProps
|
|
28
|
+
shouldForwardProp?(prop: string, variantKeys: string[]): boolean
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type JsxRecipeProps<T extends ElementType, P extends RecipeFn> = JsxHTMLProps<ComponentProps<T>, Assign<JsxStyleProps, P['__type']>>;
|
|
32
|
+
|
|
33
|
+
export type JsxElement<T extends ElementType, P> = T extends StyledComponent<infer A, infer B>
|
|
34
|
+
? StyledComponent<A, Pretty<DistributiveUnion<P, B>>>
|
|
35
|
+
: StyledComponent<T, P>
|
|
36
|
+
|
|
37
|
+
export interface JsxFactory {
|
|
38
|
+
<T extends ElementType>(component: T): StyledComponent<T, {}>
|
|
39
|
+
<T extends ElementType, P extends RecipeVariantRecord>(component: T, recipe: RecipeDefinition<P>, options?: JsxFactoryOptions<JsxRecipeProps<T, RecipeSelection<P>>>): JsxElement<
|
|
40
|
+
T,
|
|
41
|
+
RecipeSelection<P>
|
|
42
|
+
>
|
|
43
|
+
<T extends ElementType, P extends RecipeFn>(component: T, recipeFn: P, options?: JsxFactoryOptions<JsxRecipeProps<T, P['__type']>> ): JsxElement<T, P['__type']>
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export type JsxElements = {
|
|
47
|
+
[K in IntrinsicElement]: StyledComponent<K, {}>
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export type Styled = JsxFactory & JsxElements
|
|
51
|
+
|
|
52
|
+
export type HTMLStyledProps<T extends ElementType> = JsxHTMLProps<ComponentProps<T>, JsxStyleProps>
|
|
53
|
+
|
|
54
|
+
export type StyledVariantProps<T extends StyledComponent<any, any>> = T extends StyledComponent<any, infer Props> ? Props : never
|
package/types/parts.d.ts
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
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
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface PatternProperties {
|
|
19
|
+
[key: string]: PatternProperty
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
type Props<T> = Record<LiteralUnion<keyof T>, any>
|
|
23
|
+
|
|
24
|
+
export interface PatternConfig<T extends PatternProperties = PatternProperties> {
|
|
25
|
+
/**
|
|
26
|
+
* The description of the pattern. This will be used in the JSDoc comment.
|
|
27
|
+
*/
|
|
28
|
+
description?: string
|
|
29
|
+
/**
|
|
30
|
+
* The JSX element rendered by the pattern
|
|
31
|
+
* @default 'div'
|
|
32
|
+
*/
|
|
33
|
+
jsxElement?: string
|
|
34
|
+
/**
|
|
35
|
+
* The properties of the pattern.
|
|
36
|
+
*/
|
|
37
|
+
properties?: T
|
|
38
|
+
/**
|
|
39
|
+
* The css object this pattern will generate.
|
|
40
|
+
*/
|
|
41
|
+
transform?: (props: Props<T>, helpers: PatternHelpers) => SystemStyleObject
|
|
42
|
+
/**
|
|
43
|
+
* The jsx element name this pattern will generate.
|
|
44
|
+
*/
|
|
45
|
+
jsxName?: string
|
|
46
|
+
/**
|
|
47
|
+
* The jsx elements to track for this pattern. Can be string or Regexp.
|
|
48
|
+
*
|
|
49
|
+
* @default capitalize(pattern.name)
|
|
50
|
+
* @example ['Button', 'Link', /Button$/]
|
|
51
|
+
*/
|
|
52
|
+
jsx?: Array<string | RegExp>
|
|
53
|
+
/**
|
|
54
|
+
* Whether to only generate types for the specified properties.
|
|
55
|
+
* This will disallow css properties
|
|
56
|
+
*/
|
|
57
|
+
strict?: boolean
|
|
58
|
+
/**
|
|
59
|
+
* @experimental
|
|
60
|
+
* Disallow certain css properties for this pattern
|
|
61
|
+
*/
|
|
62
|
+
blocklist?: LiteralUnion<CssProperty>[]
|
|
63
|
+
}
|
|
@@ -0,0 +1,317 @@
|
|
|
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
|
+
interface PropertyValueTypes {
|
|
7
|
+
aspectRatio: "auto" | "square" | "landscape" | "portrait" | "wide" | "ultrawide" | "golden";
|
|
8
|
+
zIndex: Tokens["zIndex"];
|
|
9
|
+
top: Tokens["spacing"];
|
|
10
|
+
left: Tokens["spacing"];
|
|
11
|
+
insetInline: Tokens["spacing"];
|
|
12
|
+
insetBlock: Tokens["spacing"];
|
|
13
|
+
inset: "auto" | Tokens["spacing"];
|
|
14
|
+
insetBlockEnd: Tokens["spacing"];
|
|
15
|
+
insetBlockStart: Tokens["spacing"];
|
|
16
|
+
insetInlineEnd: Tokens["spacing"];
|
|
17
|
+
insetInlineStart: Tokens["spacing"];
|
|
18
|
+
right: Tokens["spacing"];
|
|
19
|
+
bottom: Tokens["spacing"];
|
|
20
|
+
insetX: Tokens["spacing"] | CssProperties["insetInline"];
|
|
21
|
+
insetY: Tokens["spacing"] | CssProperties["insetBlock"];
|
|
22
|
+
float: "left" | "right" | "start" | "end";
|
|
23
|
+
hideFrom: Tokens["breakpoints"];
|
|
24
|
+
hideBelow: Tokens["breakpoints"];
|
|
25
|
+
flexBasis: Tokens["spacing"] | "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";
|
|
26
|
+
flex: "1" | "auto" | "initial" | "none";
|
|
27
|
+
gridTemplateColumns: "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12";
|
|
28
|
+
gridTemplateRows: "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12";
|
|
29
|
+
gridColumn: "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "full";
|
|
30
|
+
gridRow: "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "full";
|
|
31
|
+
gridAutoColumns: "min" | "max" | "fr";
|
|
32
|
+
gridAutoRows: "min" | "max" | "fr";
|
|
33
|
+
gap: Tokens["spacing"];
|
|
34
|
+
gridGap: Tokens["spacing"];
|
|
35
|
+
gridRowGap: Tokens["spacing"];
|
|
36
|
+
gridColumnGap: Tokens["spacing"];
|
|
37
|
+
rowGap: Tokens["spacing"];
|
|
38
|
+
columnGap: Tokens["spacing"];
|
|
39
|
+
padding: Tokens["spacing"];
|
|
40
|
+
paddingLeft: Tokens["spacing"];
|
|
41
|
+
paddingRight: Tokens["spacing"];
|
|
42
|
+
paddingTop: Tokens["spacing"];
|
|
43
|
+
paddingBottom: Tokens["spacing"];
|
|
44
|
+
paddingBlock: Tokens["spacing"];
|
|
45
|
+
paddingBlockEnd: Tokens["spacing"];
|
|
46
|
+
paddingBlockStart: Tokens["spacing"];
|
|
47
|
+
paddingInline: Tokens["spacing"];
|
|
48
|
+
paddingInlineEnd: Tokens["spacing"];
|
|
49
|
+
paddingInlineStart: Tokens["spacing"];
|
|
50
|
+
marginLeft: "auto" | Tokens["spacing"];
|
|
51
|
+
marginRight: "auto" | Tokens["spacing"];
|
|
52
|
+
marginTop: "auto" | Tokens["spacing"];
|
|
53
|
+
marginBottom: "auto" | Tokens["spacing"];
|
|
54
|
+
margin: "auto" | Tokens["spacing"];
|
|
55
|
+
marginBlock: "auto" | Tokens["spacing"];
|
|
56
|
+
marginBlockEnd: "auto" | Tokens["spacing"];
|
|
57
|
+
marginBlockStart: "auto" | Tokens["spacing"];
|
|
58
|
+
marginInline: "auto" | Tokens["spacing"];
|
|
59
|
+
marginInlineEnd: "auto" | Tokens["spacing"];
|
|
60
|
+
marginInlineStart: "auto" | Tokens["spacing"];
|
|
61
|
+
outlineWidth: Tokens["borderWidths"];
|
|
62
|
+
outlineColor: Tokens["colors"];
|
|
63
|
+
outline: Tokens["borders"];
|
|
64
|
+
outlineOffset: Tokens["spacing"];
|
|
65
|
+
divideX: string;
|
|
66
|
+
divideY: string;
|
|
67
|
+
divideColor: Tokens["colors"];
|
|
68
|
+
divideStyle: CssProperties["borderStyle"];
|
|
69
|
+
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";
|
|
70
|
+
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";
|
|
71
|
+
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";
|
|
72
|
+
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";
|
|
73
|
+
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";
|
|
74
|
+
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";
|
|
75
|
+
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";
|
|
76
|
+
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";
|
|
77
|
+
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";
|
|
78
|
+
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";
|
|
79
|
+
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";
|
|
80
|
+
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";
|
|
81
|
+
color: Tokens["colors"];
|
|
82
|
+
fontFamily: Tokens["fonts"];
|
|
83
|
+
fontSize: Tokens["fontSizes"];
|
|
84
|
+
fontWeight: Tokens["fontWeights"];
|
|
85
|
+
fontSmoothing: "antialiased" | "subpixel-antialiased";
|
|
86
|
+
letterSpacing: Tokens["letterSpacings"];
|
|
87
|
+
lineHeight: Tokens["lineHeights"];
|
|
88
|
+
textDecorationColor: Tokens["colors"];
|
|
89
|
+
textEmphasisColor: Tokens["colors"];
|
|
90
|
+
textIndent: Tokens["spacing"];
|
|
91
|
+
textShadow: Tokens["shadows"];
|
|
92
|
+
textWrap: "wrap" | "balance" | "nowrap";
|
|
93
|
+
truncate: boolean;
|
|
94
|
+
listStyleImage: Tokens["assets"];
|
|
95
|
+
background: Tokens["colors"];
|
|
96
|
+
backgroundColor: Tokens["colors"];
|
|
97
|
+
backgroundImage: Tokens["assets"];
|
|
98
|
+
backgroundGradient: Tokens["gradients"] | "to-t" | "to-tr" | "to-r" | "to-br" | "to-b" | "to-bl" | "to-l" | "to-tl";
|
|
99
|
+
textGradient: Tokens["gradients"] | "to-t" | "to-tr" | "to-r" | "to-br" | "to-b" | "to-bl" | "to-l" | "to-tl";
|
|
100
|
+
gradientFrom: Tokens["colors"];
|
|
101
|
+
gradientTo: Tokens["colors"];
|
|
102
|
+
gradientVia: Tokens["colors"];
|
|
103
|
+
borderRadius: Tokens["radii"];
|
|
104
|
+
borderTopLeftRadius: Tokens["radii"];
|
|
105
|
+
borderTopRightRadius: Tokens["radii"];
|
|
106
|
+
borderBottomRightRadius: Tokens["radii"];
|
|
107
|
+
borderBottomLeftRadius: Tokens["radii"];
|
|
108
|
+
borderTopRadius: Tokens["radii"] | CssProperties["borderRadius"];
|
|
109
|
+
borderRightRadius: Tokens["radii"] | CssProperties["borderRadius"];
|
|
110
|
+
borderBottomRadius: Tokens["radii"] | CssProperties["borderRadius"];
|
|
111
|
+
borderLeftRadius: Tokens["radii"] | CssProperties["borderRadius"];
|
|
112
|
+
borderStartStartRadius: Tokens["radii"];
|
|
113
|
+
borderStartEndRadius: Tokens["radii"];
|
|
114
|
+
borderStartRadius: Tokens["radii"] | CssProperties["borderRadius"];
|
|
115
|
+
borderEndStartRadius: Tokens["radii"];
|
|
116
|
+
borderEndEndRadius: Tokens["radii"];
|
|
117
|
+
borderEndRadius: Tokens["radii"] | CssProperties["borderRadius"];
|
|
118
|
+
border: Tokens["borders"];
|
|
119
|
+
borderWidth: Tokens["borderWidths"];
|
|
120
|
+
borderTopWidth: Tokens["borderWidths"];
|
|
121
|
+
borderLeftWidth: Tokens["borderWidths"];
|
|
122
|
+
borderRightWidth: Tokens["borderWidths"];
|
|
123
|
+
borderBottomWidth: Tokens["borderWidths"];
|
|
124
|
+
borderColor: Tokens["colors"];
|
|
125
|
+
borderInline: Tokens["borders"];
|
|
126
|
+
borderInlineWidth: Tokens["borderWidths"];
|
|
127
|
+
borderInlineColor: Tokens["colors"];
|
|
128
|
+
borderBlock: Tokens["borders"];
|
|
129
|
+
borderBlockWidth: Tokens["borderWidths"];
|
|
130
|
+
borderBlockColor: Tokens["colors"];
|
|
131
|
+
borderLeft: Tokens["borders"];
|
|
132
|
+
borderLeftColor: Tokens["colors"];
|
|
133
|
+
borderInlineStart: Tokens["borders"];
|
|
134
|
+
borderInlineStartWidth: Tokens["borderWidths"];
|
|
135
|
+
borderInlineStartColor: Tokens["colors"];
|
|
136
|
+
borderRight: Tokens["borders"];
|
|
137
|
+
borderRightColor: Tokens["colors"];
|
|
138
|
+
borderInlineEnd: Tokens["borders"];
|
|
139
|
+
borderInlineEndWidth: Tokens["borderWidths"];
|
|
140
|
+
borderInlineEndColor: Tokens["colors"];
|
|
141
|
+
borderTop: Tokens["borders"];
|
|
142
|
+
borderTopColor: Tokens["colors"];
|
|
143
|
+
borderBottom: Tokens["borders"];
|
|
144
|
+
borderBottomColor: Tokens["colors"];
|
|
145
|
+
borderBlockEnd: Tokens["borders"];
|
|
146
|
+
borderBlockEndColor: Tokens["colors"];
|
|
147
|
+
borderBlockStart: Tokens["borders"];
|
|
148
|
+
borderBlockStartColor: Tokens["colors"];
|
|
149
|
+
opacity: Tokens["opacity"];
|
|
150
|
+
boxShadow: Tokens["shadows"];
|
|
151
|
+
boxShadowColor: Tokens["colors"];
|
|
152
|
+
filter: "auto";
|
|
153
|
+
dropShadow: Tokens["dropShadows"];
|
|
154
|
+
blur: Tokens["blurs"];
|
|
155
|
+
backdropFilter: "auto";
|
|
156
|
+
backdropBlur: Tokens["blurs"];
|
|
157
|
+
borderSpacing: Tokens["spacing"];
|
|
158
|
+
borderSpacingX: Tokens["spacing"];
|
|
159
|
+
borderSpacingY: Tokens["spacing"];
|
|
160
|
+
transitionTimingFunction: Tokens["easings"];
|
|
161
|
+
transitionDelay: Tokens["durations"];
|
|
162
|
+
transitionDuration: Tokens["durations"];
|
|
163
|
+
transition: "all" | "common" | "background" | "colors" | "opacity" | "shadow" | "transform";
|
|
164
|
+
animation: Tokens["animations"];
|
|
165
|
+
animationName: Tokens["animationName"];
|
|
166
|
+
animationDelay: Tokens["durations"];
|
|
167
|
+
scale: "auto" | CssProperties["scale"];
|
|
168
|
+
translate: "auto" | CssProperties["translate"];
|
|
169
|
+
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";
|
|
170
|
+
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";
|
|
171
|
+
accentColor: Tokens["colors"];
|
|
172
|
+
caretColor: Tokens["colors"];
|
|
173
|
+
scrollbar: "visible" | "hidden";
|
|
174
|
+
scrollMargin: Tokens["spacing"];
|
|
175
|
+
scrollMarginX: Tokens["spacing"] | CssProperties["scrollMarginInline"];
|
|
176
|
+
scrollMarginY: Tokens["spacing"] | CssProperties["scrollMarginBlock"];
|
|
177
|
+
scrollMarginLeft: Tokens["spacing"];
|
|
178
|
+
scrollMarginRight: Tokens["spacing"];
|
|
179
|
+
scrollMarginTop: Tokens["spacing"];
|
|
180
|
+
scrollMarginBottom: Tokens["spacing"];
|
|
181
|
+
scrollMarginBlock: Tokens["spacing"];
|
|
182
|
+
scrollMarginBlockEnd: Tokens["spacing"];
|
|
183
|
+
scrollMarginBlockStart: Tokens["spacing"];
|
|
184
|
+
scrollMarginInline: Tokens["spacing"];
|
|
185
|
+
scrollMarginInlineEnd: Tokens["spacing"];
|
|
186
|
+
scrollMarginInlineStart: Tokens["spacing"];
|
|
187
|
+
scrollPadding: Tokens["spacing"];
|
|
188
|
+
scrollPaddingBlock: Tokens["spacing"];
|
|
189
|
+
scrollPaddingBlockStart: Tokens["spacing"];
|
|
190
|
+
scrollPaddingBlockEnd: Tokens["spacing"];
|
|
191
|
+
scrollPaddingInline: Tokens["spacing"];
|
|
192
|
+
scrollPaddingInlineEnd: Tokens["spacing"];
|
|
193
|
+
scrollPaddingInlineStart: Tokens["spacing"];
|
|
194
|
+
scrollPaddingX: Tokens["spacing"] | CssProperties["scrollPaddingInline"];
|
|
195
|
+
scrollPaddingY: Tokens["spacing"] | CssProperties["scrollPaddingBlock"];
|
|
196
|
+
scrollPaddingLeft: Tokens["spacing"];
|
|
197
|
+
scrollPaddingRight: Tokens["spacing"];
|
|
198
|
+
scrollPaddingTop: Tokens["spacing"];
|
|
199
|
+
scrollPaddingBottom: Tokens["spacing"];
|
|
200
|
+
scrollSnapType: "none" | "x" | "y" | "both";
|
|
201
|
+
scrollSnapStrictness: "mandatory" | "proximity";
|
|
202
|
+
scrollSnapMargin: Tokens["spacing"];
|
|
203
|
+
scrollSnapMarginTop: Tokens["spacing"];
|
|
204
|
+
scrollSnapMarginBottom: Tokens["spacing"];
|
|
205
|
+
scrollSnapMarginLeft: Tokens["spacing"];
|
|
206
|
+
scrollSnapMarginRight: Tokens["spacing"];
|
|
207
|
+
fill: Tokens["colors"];
|
|
208
|
+
stroke: Tokens["colors"];
|
|
209
|
+
strokeWidth: Tokens["borderWidths"];
|
|
210
|
+
srOnly: boolean;
|
|
211
|
+
debug: boolean;
|
|
212
|
+
colorPalette: "currentcolor" | "dark" | "white" | "background" | "overlay" | "brand" | "gray" | "blue" | "red" | "green" | "orange" | "sky" | "teal" | "violet" | "amber" | "rose" | "stone" | "lime" | "pink" | "apricot" | "aqua" | "leaf" | "fuchsia" | "ice" | "ash";
|
|
213
|
+
textStyle: "overline" | "body.sm" | "body.md" | "label.sm" | "label.md" | "h3" | "h2" | "h1";
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
type CssValue<T> = T extends keyof CssProperties ? CssProperties[T] : never
|
|
219
|
+
|
|
220
|
+
type Shorthand<T> = T extends keyof PropertyValueTypes ? PropertyValueTypes[T] | CssValue<T> : CssValue<T>
|
|
221
|
+
|
|
222
|
+
export interface PropertyTypes extends PropertyValueTypes {
|
|
223
|
+
|
|
224
|
+
pos: Shorthand<"position">;
|
|
225
|
+
insetEnd: Shorthand<"insetInlineEnd">;
|
|
226
|
+
end: Shorthand<"insetInlineEnd">;
|
|
227
|
+
insetStart: Shorthand<"insetInlineStart">;
|
|
228
|
+
start: Shorthand<"insetInlineStart">;
|
|
229
|
+
flexDir: Shorthand<"flexDirection">;
|
|
230
|
+
p: Shorthand<"padding">;
|
|
231
|
+
pl: Shorthand<"paddingLeft">;
|
|
232
|
+
pr: Shorthand<"paddingRight">;
|
|
233
|
+
pt: Shorthand<"paddingTop">;
|
|
234
|
+
pb: Shorthand<"paddingBottom">;
|
|
235
|
+
py: Shorthand<"paddingBlock">;
|
|
236
|
+
paddingY: Shorthand<"paddingBlock">;
|
|
237
|
+
paddingX: Shorthand<"paddingInline">;
|
|
238
|
+
px: Shorthand<"paddingInline">;
|
|
239
|
+
pe: Shorthand<"paddingInlineEnd">;
|
|
240
|
+
paddingEnd: Shorthand<"paddingInlineEnd">;
|
|
241
|
+
ps: Shorthand<"paddingInlineStart">;
|
|
242
|
+
paddingStart: Shorthand<"paddingInlineStart">;
|
|
243
|
+
ml: Shorthand<"marginLeft">;
|
|
244
|
+
mr: Shorthand<"marginRight">;
|
|
245
|
+
mt: Shorthand<"marginTop">;
|
|
246
|
+
mb: Shorthand<"marginBottom">;
|
|
247
|
+
m: Shorthand<"margin">;
|
|
248
|
+
my: Shorthand<"marginBlock">;
|
|
249
|
+
marginY: Shorthand<"marginBlock">;
|
|
250
|
+
mx: Shorthand<"marginInline">;
|
|
251
|
+
marginX: Shorthand<"marginInline">;
|
|
252
|
+
me: Shorthand<"marginInlineEnd">;
|
|
253
|
+
marginEnd: Shorthand<"marginInlineEnd">;
|
|
254
|
+
ms: Shorthand<"marginInlineStart">;
|
|
255
|
+
marginStart: Shorthand<"marginInlineStart">;
|
|
256
|
+
ringWidth: Shorthand<"outlineWidth">;
|
|
257
|
+
ringColor: Shorthand<"outlineColor">;
|
|
258
|
+
ring: Shorthand<"outline">;
|
|
259
|
+
ringOffset: Shorthand<"outlineOffset">;
|
|
260
|
+
w: Shorthand<"width">;
|
|
261
|
+
minW: Shorthand<"minWidth">;
|
|
262
|
+
maxW: Shorthand<"maxWidth">;
|
|
263
|
+
h: Shorthand<"height">;
|
|
264
|
+
minH: Shorthand<"minHeight">;
|
|
265
|
+
maxH: Shorthand<"maxHeight">;
|
|
266
|
+
bgPosition: Shorthand<"backgroundPosition">;
|
|
267
|
+
bgPositionX: Shorthand<"backgroundPositionX">;
|
|
268
|
+
bgPositionY: Shorthand<"backgroundPositionY">;
|
|
269
|
+
bgAttachment: Shorthand<"backgroundAttachment">;
|
|
270
|
+
bgClip: Shorthand<"backgroundClip">;
|
|
271
|
+
bg: Shorthand<"background">;
|
|
272
|
+
bgColor: Shorthand<"backgroundColor">;
|
|
273
|
+
bgOrigin: Shorthand<"backgroundOrigin">;
|
|
274
|
+
bgImage: Shorthand<"backgroundImage">;
|
|
275
|
+
bgRepeat: Shorthand<"backgroundRepeat">;
|
|
276
|
+
bgBlendMode: Shorthand<"backgroundBlendMode">;
|
|
277
|
+
bgSize: Shorthand<"backgroundSize">;
|
|
278
|
+
bgGradient: Shorthand<"backgroundGradient">;
|
|
279
|
+
rounded: Shorthand<"borderRadius">;
|
|
280
|
+
roundedTopLeft: Shorthand<"borderTopLeftRadius">;
|
|
281
|
+
roundedTopRight: Shorthand<"borderTopRightRadius">;
|
|
282
|
+
roundedBottomRight: Shorthand<"borderBottomRightRadius">;
|
|
283
|
+
roundedBottomLeft: Shorthand<"borderBottomLeftRadius">;
|
|
284
|
+
roundedTop: Shorthand<"borderTopRadius">;
|
|
285
|
+
roundedRight: Shorthand<"borderRightRadius">;
|
|
286
|
+
roundedBottom: Shorthand<"borderBottomRadius">;
|
|
287
|
+
roundedLeft: Shorthand<"borderLeftRadius">;
|
|
288
|
+
roundedStartStart: Shorthand<"borderStartStartRadius">;
|
|
289
|
+
roundedStartEnd: Shorthand<"borderStartEndRadius">;
|
|
290
|
+
roundedStart: Shorthand<"borderStartRadius">;
|
|
291
|
+
roundedEndStart: Shorthand<"borderEndStartRadius">;
|
|
292
|
+
roundedEndEnd: Shorthand<"borderEndEndRadius">;
|
|
293
|
+
roundedEnd: Shorthand<"borderEndRadius">;
|
|
294
|
+
borderX: Shorthand<"borderInline">;
|
|
295
|
+
borderXWidth: Shorthand<"borderInlineWidth">;
|
|
296
|
+
borderXColor: Shorthand<"borderInlineColor">;
|
|
297
|
+
borderY: Shorthand<"borderBlock">;
|
|
298
|
+
borderYWidth: Shorthand<"borderBlockWidth">;
|
|
299
|
+
borderYColor: Shorthand<"borderBlockColor">;
|
|
300
|
+
borderStart: Shorthand<"borderInlineStart">;
|
|
301
|
+
borderStartWidth: Shorthand<"borderInlineStartWidth">;
|
|
302
|
+
borderStartColor: Shorthand<"borderInlineStartColor">;
|
|
303
|
+
borderEnd: Shorthand<"borderInlineEnd">;
|
|
304
|
+
borderEndWidth: Shorthand<"borderInlineEndWidth">;
|
|
305
|
+
borderEndColor: Shorthand<"borderInlineEndColor">;
|
|
306
|
+
shadow: Shorthand<"boxShadow">;
|
|
307
|
+
shadowColor: Shorthand<"boxShadowColor">;
|
|
308
|
+
x: Shorthand<"translateX">;
|
|
309
|
+
y: Shorthand<"translateY">;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
export type PropertyValue<T extends string> = T extends keyof PropertyTypes
|
|
314
|
+
? ConditionalValue<PropertyTypes[T] | CssValue<T> | (string & {})>
|
|
315
|
+
: T extends keyof CssProperties
|
|
316
|
+
? ConditionalValue<CssProperties[T] | (string & {})>
|
|
317
|
+
: ConditionalValue<string | number>
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { SystemStyleObject, DistributiveOmit, Pretty } from './system-types';
|
|
3
|
+
|
|
4
|
+
type StringToBoolean<T> = T extends 'true' | 'false' ? boolean : T
|
|
5
|
+
|
|
6
|
+
export type RecipeVariantRecord = Record<any, Record<any, SystemStyleObject>>
|
|
7
|
+
|
|
8
|
+
export type RecipeSelection<T extends RecipeVariantRecord> = keyof any extends keyof T
|
|
9
|
+
? {}
|
|
10
|
+
: {
|
|
11
|
+
[K in keyof T]?: StringToBoolean<keyof T[K]> | undefined
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type RecipeVariantFn<T extends RecipeVariantRecord> = (props?: RecipeSelection<T>) => string
|
|
15
|
+
|
|
16
|
+
export type RecipeVariantProps<
|
|
17
|
+
T extends RecipeVariantFn<RecipeVariantRecord> | SlotRecipeVariantFn<string, SlotRecipeVariantRecord<string>>,
|
|
18
|
+
> = Pretty<Parameters<T>[0]>
|
|
19
|
+
|
|
20
|
+
type RecipeVariantMap<T extends RecipeVariantRecord> = {
|
|
21
|
+
[K in keyof T]: Array<keyof T[K]>
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* -----------------------------------------------------------------------------
|
|
25
|
+
* Recipe / Standard
|
|
26
|
+
* -----------------------------------------------------------------------------*/
|
|
27
|
+
|
|
28
|
+
export interface RecipeRuntimeFn<T extends RecipeVariantRecord> extends RecipeVariantFn<T> {
|
|
29
|
+
__type: RecipeSelection<T>
|
|
30
|
+
variantKeys: (keyof T)[]
|
|
31
|
+
variantMap: RecipeVariantMap<T>
|
|
32
|
+
raw: (props?: RecipeSelection<T>) => SystemStyleObject
|
|
33
|
+
config: RecipeConfig<T>
|
|
34
|
+
splitVariantProps<Props extends RecipeSelection<T>>(
|
|
35
|
+
props: Props,
|
|
36
|
+
): [RecipeSelection<T>, Pretty<DistributiveOmit<Props, keyof T>>]
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
type OneOrMore<T> = T | Array<T>
|
|
40
|
+
|
|
41
|
+
export type RecipeCompoundSelection<T> = {
|
|
42
|
+
[K in keyof T]?: OneOrMore<StringToBoolean<keyof T[K]>> | undefined
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export type RecipeCompoundVariant<T> = T & {
|
|
46
|
+
css: SystemStyleObject
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface RecipeDefinition<T extends RecipeVariantRecord> {
|
|
50
|
+
/**
|
|
51
|
+
* The base styles of the recipe.
|
|
52
|
+
*/
|
|
53
|
+
base?: SystemStyleObject
|
|
54
|
+
/**
|
|
55
|
+
* The multi-variant styles of the recipe.
|
|
56
|
+
*/
|
|
57
|
+
variants?: T
|
|
58
|
+
/**
|
|
59
|
+
* The default variants of the recipe.
|
|
60
|
+
*/
|
|
61
|
+
defaultVariants?: RecipeSelection<T>
|
|
62
|
+
/**
|
|
63
|
+
* The styles to apply when a combination of variants is selected.
|
|
64
|
+
*/
|
|
65
|
+
compoundVariants?: Pretty<RecipeCompoundVariant<RecipeCompoundSelection<T>>>[]
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export type RecipeCreatorFn = <T extends RecipeVariantRecord>(config: RecipeDefinition<T>) => RecipeRuntimeFn<T>
|
|
69
|
+
|
|
70
|
+
interface RecipeConfigMeta {
|
|
71
|
+
/**
|
|
72
|
+
* The name of the recipe.
|
|
73
|
+
*/
|
|
74
|
+
className: string
|
|
75
|
+
/**
|
|
76
|
+
* The description of the recipe. This will be used in the JSDoc comment.
|
|
77
|
+
*/
|
|
78
|
+
description?: string
|
|
79
|
+
/**
|
|
80
|
+
* The jsx elements to track for this recipe. Can be string or Regexp.
|
|
81
|
+
*
|
|
82
|
+
* @default capitalize(recipe.name)
|
|
83
|
+
* @example ['Button', 'Link', /Button$/]
|
|
84
|
+
*/
|
|
85
|
+
jsx?: Array<string | RegExp>
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export interface RecipeConfig<T extends RecipeVariantRecord = RecipeVariantRecord>
|
|
89
|
+
extends RecipeDefinition<T>,
|
|
90
|
+
RecipeConfigMeta {}
|
|
91
|
+
|
|
92
|
+
/* -----------------------------------------------------------------------------
|
|
93
|
+
* Recipe / Slot
|
|
94
|
+
* -----------------------------------------------------------------------------*/
|
|
95
|
+
|
|
96
|
+
type SlotRecord<S extends string, T> = Partial<Record<S, T>>
|
|
97
|
+
|
|
98
|
+
export type SlotRecipeVariantRecord<S extends string> = Record<any, Record<any, SlotRecord<S, SystemStyleObject>>>
|
|
99
|
+
|
|
100
|
+
export type SlotRecipeVariantFn<S extends string, T extends RecipeVariantRecord> = (
|
|
101
|
+
props?: RecipeSelection<T>,
|
|
102
|
+
) => SlotRecord<S, string>
|
|
103
|
+
|
|
104
|
+
export interface SlotRecipeRuntimeFn<S extends string, T extends SlotRecipeVariantRecord<S>>
|
|
105
|
+
extends SlotRecipeVariantFn<S, T> {
|
|
106
|
+
raw: (props?: RecipeSelection<T>) => Record<S, SystemStyleObject>
|
|
107
|
+
variantKeys: (keyof T)[]
|
|
108
|
+
variantMap: RecipeVariantMap<T>
|
|
109
|
+
splitVariantProps<Props extends RecipeSelection<T>>(props: Props): [RecipeSelection<T>, Pretty<Omit<Props, keyof T>>]
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export type SlotRecipeCompoundVariant<S extends string, T> = T & {
|
|
113
|
+
css: SlotRecord<S, SystemStyleObject>
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export interface SlotRecipeDefinition<S extends string, T extends SlotRecipeVariantRecord<S>> {
|
|
117
|
+
/**
|
|
118
|
+
* The parts/slots of the recipe.
|
|
119
|
+
*/
|
|
120
|
+
slots: S[] | Readonly<S[]>
|
|
121
|
+
/**
|
|
122
|
+
* The base styles of the recipe.
|
|
123
|
+
*/
|
|
124
|
+
base?: SlotRecord<S, SystemStyleObject>
|
|
125
|
+
/**
|
|
126
|
+
* The multi-variant styles of the recipe.
|
|
127
|
+
*/
|
|
128
|
+
variants?: T
|
|
129
|
+
/**
|
|
130
|
+
* The default variants of the recipe.
|
|
131
|
+
*/
|
|
132
|
+
defaultVariants?: RecipeSelection<T>
|
|
133
|
+
/**
|
|
134
|
+
* The styles to apply when a combination of variants is selected.
|
|
135
|
+
*/
|
|
136
|
+
compoundVariants?: Pretty<SlotRecipeCompoundVariant<S, RecipeCompoundSelection<T>>>[]
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export type SlotRecipeCreatorFn = <S extends string, T extends SlotRecipeVariantRecord<S>>(
|
|
140
|
+
config: SlotRecipeDefinition<S, T>,
|
|
141
|
+
) => SlotRecipeRuntimeFn<S, T>
|
|
142
|
+
|
|
143
|
+
export type SlotRecipeConfig<
|
|
144
|
+
S extends string = string,
|
|
145
|
+
T extends SlotRecipeVariantRecord<S> = SlotRecipeVariantRecord<S>,
|
|
146
|
+
> = SlotRecipeDefinition<S, T> & RecipeConfigMeta
|