@discourser/design-system 0.1.6 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +411 -16
- package/dist/index.cjs +1881 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +22098 -0
- package/dist/index.d.ts +22098 -0
- package/dist/index.js +1845 -0
- package/dist/index.js.map +1 -0
- package/package.json +10 -7
- package/styled-system/css/conditions.mjs +1 -1
- package/styled-system/css/css.mjs +1 -1
- package/styled-system/css/sva.mjs +9 -4
- package/styled-system/helpers.mjs +12 -20
- package/styled-system/jsx/create-style-context.d.ts +54 -0
- package/styled-system/jsx/create-style-context.mjs +118 -0
- package/styled-system/jsx/factory.mjs +14 -5
- package/styled-system/jsx/index.d.ts +1 -0
- package/styled-system/jsx/index.mjs +1 -0
- package/styled-system/jsx/is-valid-prop.mjs +2 -2
- package/styled-system/patterns/aspect-ratio.d.ts +0 -1
- package/styled-system/patterns/bleed.d.ts +0 -1
- package/styled-system/patterns/box.d.ts +0 -1
- package/styled-system/patterns/center.d.ts +0 -1
- package/styled-system/patterns/circle.d.ts +0 -1
- package/styled-system/patterns/container.d.ts +0 -1
- package/styled-system/patterns/cq.d.ts +0 -1
- package/styled-system/patterns/divider.d.ts +1 -2
- package/styled-system/patterns/flex.d.ts +0 -1
- package/styled-system/patterns/float.d.ts +1 -2
- package/styled-system/patterns/grid-item.d.ts +0 -1
- package/styled-system/patterns/grid.d.ts +0 -1
- package/styled-system/patterns/grid.mjs +1 -1
- package/styled-system/patterns/hstack.d.ts +0 -1
- package/styled-system/patterns/hstack.mjs +1 -1
- package/styled-system/patterns/link-overlay.d.ts +0 -1
- package/styled-system/patterns/spacer.d.ts +0 -1
- package/styled-system/patterns/square.d.ts +0 -1
- package/styled-system/patterns/stack.d.ts +0 -1
- package/styled-system/patterns/stack.mjs +1 -1
- package/styled-system/patterns/visually-hidden.d.ts +0 -1
- package/styled-system/patterns/vstack.d.ts +0 -1
- package/styled-system/patterns/vstack.mjs +1 -1
- package/styled-system/patterns/wrap.d.ts +0 -1
- package/styled-system/patterns/wrap.mjs +1 -1
- package/styled-system/recipes/absolute-center.d.ts +34 -0
- package/styled-system/recipes/absolute-center.mjs +32 -0
- package/styled-system/recipes/accordion.d.ts +38 -0
- package/styled-system/recipes/accordion.mjs +67 -0
- package/styled-system/recipes/avatar.d.ts +42 -0
- package/styled-system/recipes/avatar.mjs +71 -0
- package/styled-system/recipes/badge.d.ts +38 -0
- package/styled-system/recipes/badge.mjs +41 -0
- package/styled-system/recipes/button.d.ts +6 -7
- package/styled-system/recipes/button.mjs +11 -7
- package/styled-system/recipes/card.d.ts +6 -11
- package/styled-system/recipes/card.mjs +50 -23
- package/styled-system/recipes/checkbox.d.ts +38 -0
- package/styled-system/recipes/checkbox.mjs +68 -0
- package/styled-system/recipes/dialog.d.ts +13 -6
- package/styled-system/recipes/dialog.mjs +35 -3
- package/styled-system/recipes/drawer.d.ts +38 -0
- package/styled-system/recipes/drawer.mjs +90 -0
- package/styled-system/recipes/field.d.ts +31 -0
- package/styled-system/recipes/field.mjs +61 -0
- package/styled-system/recipes/group.d.ts +36 -0
- package/styled-system/recipes/group.mjs +72 -0
- package/styled-system/recipes/index.d.ts +21 -3
- package/styled-system/recipes/index.mjs +21 -3
- package/styled-system/recipes/input.d.ts +6 -8
- package/styled-system/recipes/input.mjs +12 -9
- package/styled-system/recipes/popover.d.ts +31 -0
- package/styled-system/recipes/popover.mjs +81 -0
- package/styled-system/recipes/progress.d.ts +44 -0
- package/styled-system/recipes/progress.mjs +98 -0
- package/styled-system/recipes/radio-group.d.ts +38 -0
- package/styled-system/recipes/radio-group.mjs +68 -0
- package/styled-system/recipes/select.d.ts +38 -0
- package/styled-system/recipes/select.mjs +111 -0
- package/styled-system/recipes/skeleton.d.ts +39 -0
- package/styled-system/recipes/skeleton.mjs +40 -0
- package/styled-system/recipes/slider.d.ts +42 -0
- package/styled-system/recipes/slider.mjs +94 -0
- package/styled-system/recipes/spinner.d.ts +34 -0
- package/styled-system/recipes/spinner.mjs +36 -0
- package/styled-system/recipes/switch-component.d.ts +38 -0
- package/styled-system/recipes/switch-component.mjs +65 -0
- package/styled-system/recipes/tabs.d.ts +39 -0
- package/styled-system/recipes/tabs.mjs +71 -0
- package/styled-system/recipes/textarea.d.ts +38 -0
- package/styled-system/recipes/textarea.mjs +41 -0
- package/styled-system/recipes/toast.d.ts +31 -0
- package/styled-system/recipes/toast.mjs +53 -0
- package/styled-system/recipes/tooltip.d.ts +31 -0
- package/styled-system/recipes/tooltip.mjs +49 -0
- package/styled-system/tokens/index.mjs +3483 -635
- package/styled-system/tokens/tokens.d.ts +31 -19
- package/styled-system/types/composition.d.ts +83 -23
- package/styled-system/types/conditions.d.ts +15 -11
- package/styled-system/types/jsx.d.ts +27 -10
- package/styled-system/types/pattern.d.ts +4 -4
- package/styled-system/types/prop-type.d.ts +30 -3
- package/styled-system/types/style-props.d.ts +262 -225
- package/styled-system/types/system-types.d.ts +162 -2
- package/styled-system/recipes/icon-button.d.ts +0 -39
- package/styled-system/recipes/icon-button.mjs +0 -39
- package/styled-system/recipes/switch-control.d.ts +0 -35
- package/styled-system/recipes/switch-control.mjs +0 -53
- package/styled-system/recipes/switch.d.ts +0 -35
- package/styled-system/recipes/switch.mjs +0 -53
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { ConditionalValue } from '../types/index';
|
|
3
|
+
import type { DistributiveOmit, Pretty } from '../types/system-types';
|
|
4
|
+
|
|
5
|
+
interface AccordionVariant {
|
|
6
|
+
/**
|
|
7
|
+
* @default "outline"
|
|
8
|
+
*/
|
|
9
|
+
variant: "outline" | "plain"
|
|
10
|
+
/**
|
|
11
|
+
* @default "md"
|
|
12
|
+
*/
|
|
13
|
+
size: "md"
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
type AccordionVariantMap = {
|
|
17
|
+
[key in keyof AccordionVariant]: Array<AccordionVariant[key]>
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
type AccordionSlot = "root" | "item" | "itemTrigger" | "itemContent" | "itemIndicator" | "itemBody"
|
|
21
|
+
|
|
22
|
+
export type AccordionVariantProps = {
|
|
23
|
+
[key in keyof AccordionVariant]?: ConditionalValue<AccordionVariant[key]> | undefined
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface AccordionRecipe {
|
|
27
|
+
__slot: AccordionSlot
|
|
28
|
+
__type: AccordionVariantProps
|
|
29
|
+
(props?: AccordionVariantProps): Pretty<Record<AccordionSlot, string>>
|
|
30
|
+
raw: (props?: AccordionVariantProps) => AccordionVariantProps
|
|
31
|
+
variantMap: AccordionVariantMap
|
|
32
|
+
variantKeys: Array<keyof AccordionVariant>
|
|
33
|
+
splitVariantProps<Props extends AccordionVariantProps>(props: Props): [AccordionVariantProps, Pretty<DistributiveOmit<Props, keyof AccordionVariantProps>>]
|
|
34
|
+
getVariantProps: (props?: AccordionVariantProps) => AccordionVariantProps
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
export declare const accordion: AccordionRecipe
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
|
|
2
|
+
import { createRecipe } from './create-recipe.mjs';
|
|
3
|
+
|
|
4
|
+
const accordionDefaultVariants = {
|
|
5
|
+
"size": "md",
|
|
6
|
+
"variant": "outline"
|
|
7
|
+
}
|
|
8
|
+
const accordionCompoundVariants = []
|
|
9
|
+
|
|
10
|
+
const accordionSlotNames = [
|
|
11
|
+
[
|
|
12
|
+
"root",
|
|
13
|
+
"accordion__root"
|
|
14
|
+
],
|
|
15
|
+
[
|
|
16
|
+
"item",
|
|
17
|
+
"accordion__item"
|
|
18
|
+
],
|
|
19
|
+
[
|
|
20
|
+
"itemTrigger",
|
|
21
|
+
"accordion__itemTrigger"
|
|
22
|
+
],
|
|
23
|
+
[
|
|
24
|
+
"itemContent",
|
|
25
|
+
"accordion__itemContent"
|
|
26
|
+
],
|
|
27
|
+
[
|
|
28
|
+
"itemIndicator",
|
|
29
|
+
"accordion__itemIndicator"
|
|
30
|
+
],
|
|
31
|
+
[
|
|
32
|
+
"itemBody",
|
|
33
|
+
"accordion__itemBody"
|
|
34
|
+
]
|
|
35
|
+
]
|
|
36
|
+
const accordionSlotFns = /* @__PURE__ */ accordionSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, accordionDefaultVariants, getSlotCompoundVariant(accordionCompoundVariants, slotName))])
|
|
37
|
+
|
|
38
|
+
const accordionFn = memo((props = {}) => {
|
|
39
|
+
return Object.fromEntries(accordionSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
const accordionVariantKeys = [
|
|
43
|
+
"variant",
|
|
44
|
+
"size"
|
|
45
|
+
]
|
|
46
|
+
const getVariantProps = (variants) => ({ ...accordionDefaultVariants, ...compact(variants) })
|
|
47
|
+
|
|
48
|
+
export const accordion = /* @__PURE__ */ Object.assign(accordionFn, {
|
|
49
|
+
__recipe__: false,
|
|
50
|
+
__name__: 'accordion',
|
|
51
|
+
raw: (props) => props,
|
|
52
|
+
classNameMap: {},
|
|
53
|
+
variantKeys: accordionVariantKeys,
|
|
54
|
+
variantMap: {
|
|
55
|
+
"variant": [
|
|
56
|
+
"outline",
|
|
57
|
+
"plain"
|
|
58
|
+
],
|
|
59
|
+
"size": [
|
|
60
|
+
"md"
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
splitVariantProps(props) {
|
|
64
|
+
return splitProps(props, accordionVariantKeys)
|
|
65
|
+
},
|
|
66
|
+
getVariantProps
|
|
67
|
+
})
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { ConditionalValue } from '../types/index';
|
|
3
|
+
import type { DistributiveOmit, Pretty } from '../types/system-types';
|
|
4
|
+
|
|
5
|
+
interface AvatarVariant {
|
|
6
|
+
/**
|
|
7
|
+
* @default "md"
|
|
8
|
+
*/
|
|
9
|
+
size: "full" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
|
|
10
|
+
/**
|
|
11
|
+
* @default "subtle"
|
|
12
|
+
*/
|
|
13
|
+
variant: "solid" | "surface" | "subtle" | "outline"
|
|
14
|
+
/**
|
|
15
|
+
* @default "full"
|
|
16
|
+
*/
|
|
17
|
+
shape: "square" | "rounded" | "full"
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
type AvatarVariantMap = {
|
|
21
|
+
[key in keyof AvatarVariant]: Array<AvatarVariant[key]>
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
type AvatarSlot = "root" | "image" | "fallback"
|
|
25
|
+
|
|
26
|
+
export type AvatarVariantProps = {
|
|
27
|
+
[key in keyof AvatarVariant]?: ConditionalValue<AvatarVariant[key]> | undefined
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface AvatarRecipe {
|
|
31
|
+
__slot: AvatarSlot
|
|
32
|
+
__type: AvatarVariantProps
|
|
33
|
+
(props?: AvatarVariantProps): Pretty<Record<AvatarSlot, string>>
|
|
34
|
+
raw: (props?: AvatarVariantProps) => AvatarVariantProps
|
|
35
|
+
variantMap: AvatarVariantMap
|
|
36
|
+
variantKeys: Array<keyof AvatarVariant>
|
|
37
|
+
splitVariantProps<Props extends AvatarVariantProps>(props: Props): [AvatarVariantProps, Pretty<DistributiveOmit<Props, keyof AvatarVariantProps>>]
|
|
38
|
+
getVariantProps: (props?: AvatarVariantProps) => AvatarVariantProps
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
export declare const avatar: AvatarRecipe
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
|
|
2
|
+
import { createRecipe } from './create-recipe.mjs';
|
|
3
|
+
|
|
4
|
+
const avatarDefaultVariants = {
|
|
5
|
+
"size": "md",
|
|
6
|
+
"shape": "full",
|
|
7
|
+
"variant": "subtle"
|
|
8
|
+
}
|
|
9
|
+
const avatarCompoundVariants = []
|
|
10
|
+
|
|
11
|
+
const avatarSlotNames = [
|
|
12
|
+
[
|
|
13
|
+
"root",
|
|
14
|
+
"avatar__root"
|
|
15
|
+
],
|
|
16
|
+
[
|
|
17
|
+
"image",
|
|
18
|
+
"avatar__image"
|
|
19
|
+
],
|
|
20
|
+
[
|
|
21
|
+
"fallback",
|
|
22
|
+
"avatar__fallback"
|
|
23
|
+
]
|
|
24
|
+
]
|
|
25
|
+
const avatarSlotFns = /* @__PURE__ */ avatarSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, avatarDefaultVariants, getSlotCompoundVariant(avatarCompoundVariants, slotName))])
|
|
26
|
+
|
|
27
|
+
const avatarFn = memo((props = {}) => {
|
|
28
|
+
return Object.fromEntries(avatarSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
const avatarVariantKeys = [
|
|
32
|
+
"size",
|
|
33
|
+
"variant",
|
|
34
|
+
"shape"
|
|
35
|
+
]
|
|
36
|
+
const getVariantProps = (variants) => ({ ...avatarDefaultVariants, ...compact(variants) })
|
|
37
|
+
|
|
38
|
+
export const avatar = /* @__PURE__ */ Object.assign(avatarFn, {
|
|
39
|
+
__recipe__: false,
|
|
40
|
+
__name__: 'avatar',
|
|
41
|
+
raw: (props) => props,
|
|
42
|
+
classNameMap: {},
|
|
43
|
+
variantKeys: avatarVariantKeys,
|
|
44
|
+
variantMap: {
|
|
45
|
+
"size": [
|
|
46
|
+
"full",
|
|
47
|
+
"2xs",
|
|
48
|
+
"xs",
|
|
49
|
+
"sm",
|
|
50
|
+
"md",
|
|
51
|
+
"lg",
|
|
52
|
+
"xl",
|
|
53
|
+
"2xl"
|
|
54
|
+
],
|
|
55
|
+
"variant": [
|
|
56
|
+
"solid",
|
|
57
|
+
"surface",
|
|
58
|
+
"subtle",
|
|
59
|
+
"outline"
|
|
60
|
+
],
|
|
61
|
+
"shape": [
|
|
62
|
+
"square",
|
|
63
|
+
"rounded",
|
|
64
|
+
"full"
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
splitVariantProps(props) {
|
|
68
|
+
return splitProps(props, avatarVariantKeys)
|
|
69
|
+
},
|
|
70
|
+
getVariantProps
|
|
71
|
+
})
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { ConditionalValue } from '../types/index';
|
|
3
|
+
import type { DistributiveOmit, Pretty } from '../types/system-types';
|
|
4
|
+
|
|
5
|
+
interface BadgeVariant {
|
|
6
|
+
/**
|
|
7
|
+
* @default "subtle"
|
|
8
|
+
*/
|
|
9
|
+
variant: "solid" | "surface" | "subtle" | "outline"
|
|
10
|
+
/**
|
|
11
|
+
* @default "md"
|
|
12
|
+
*/
|
|
13
|
+
size: "sm" | "md" | "lg" | "xl" | "2xl"
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
type BadgeVariantMap = {
|
|
17
|
+
[key in keyof BadgeVariant]: Array<BadgeVariant[key]>
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
export type BadgeVariantProps = {
|
|
23
|
+
[key in keyof BadgeVariant]?: ConditionalValue<BadgeVariant[key]> | undefined
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface BadgeRecipe {
|
|
27
|
+
|
|
28
|
+
__type: BadgeVariantProps
|
|
29
|
+
(props?: BadgeVariantProps): string
|
|
30
|
+
raw: (props?: BadgeVariantProps) => BadgeVariantProps
|
|
31
|
+
variantMap: BadgeVariantMap
|
|
32
|
+
variantKeys: Array<keyof BadgeVariant>
|
|
33
|
+
splitVariantProps<Props extends BadgeVariantProps>(props: Props): [BadgeVariantProps, Pretty<DistributiveOmit<Props, keyof BadgeVariantProps>>]
|
|
34
|
+
getVariantProps: (props?: BadgeVariantProps) => BadgeVariantProps
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
export declare const badge: BadgeRecipe
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { memo, splitProps } from '../helpers.mjs';
|
|
2
|
+
import { createRecipe, mergeRecipes } from './create-recipe.mjs';
|
|
3
|
+
|
|
4
|
+
const badgeFn = /* @__PURE__ */ createRecipe('badge', {
|
|
5
|
+
"variant": "subtle",
|
|
6
|
+
"size": "md"
|
|
7
|
+
}, [])
|
|
8
|
+
|
|
9
|
+
const badgeVariantMap = {
|
|
10
|
+
"variant": [
|
|
11
|
+
"solid",
|
|
12
|
+
"surface",
|
|
13
|
+
"subtle",
|
|
14
|
+
"outline"
|
|
15
|
+
],
|
|
16
|
+
"size": [
|
|
17
|
+
"sm",
|
|
18
|
+
"md",
|
|
19
|
+
"lg",
|
|
20
|
+
"xl",
|
|
21
|
+
"2xl"
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const badgeVariantKeys = Object.keys(badgeVariantMap)
|
|
26
|
+
|
|
27
|
+
export const badge = /* @__PURE__ */ Object.assign(memo(badgeFn.recipeFn), {
|
|
28
|
+
__recipe__: true,
|
|
29
|
+
__name__: 'badge',
|
|
30
|
+
__getCompoundVariantCss__: badgeFn.__getCompoundVariantCss__,
|
|
31
|
+
raw: (props) => props,
|
|
32
|
+
variantKeys: badgeVariantKeys,
|
|
33
|
+
variantMap: badgeVariantMap,
|
|
34
|
+
merge(recipe) {
|
|
35
|
+
return mergeRecipes(this, recipe)
|
|
36
|
+
},
|
|
37
|
+
splitVariantProps(props) {
|
|
38
|
+
return splitProps(props, badgeVariantKeys)
|
|
39
|
+
},
|
|
40
|
+
getVariantProps: badgeFn.getVariantProps,
|
|
41
|
+
})
|
|
@@ -4,24 +4,27 @@ import type { DistributiveOmit, Pretty } from '../types/system-types';
|
|
|
4
4
|
|
|
5
5
|
interface ButtonVariant {
|
|
6
6
|
/**
|
|
7
|
-
* @default "
|
|
7
|
+
* @default "solid"
|
|
8
8
|
*/
|
|
9
|
-
variant: "
|
|
9
|
+
variant: "solid" | "surface" | "subtle" | "outline" | "plain"
|
|
10
10
|
/**
|
|
11
11
|
* @default "md"
|
|
12
12
|
*/
|
|
13
|
-
size: "sm" | "md" | "lg"
|
|
13
|
+
size: "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
type ButtonVariantMap = {
|
|
17
17
|
[key in keyof ButtonVariant]: Array<ButtonVariant[key]>
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
|
|
21
|
+
|
|
20
22
|
export type ButtonVariantProps = {
|
|
21
23
|
[key in keyof ButtonVariant]?: ConditionalValue<ButtonVariant[key]> | undefined
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
export interface ButtonRecipe {
|
|
27
|
+
|
|
25
28
|
__type: ButtonVariantProps
|
|
26
29
|
(props?: ButtonVariantProps): string
|
|
27
30
|
raw: (props?: ButtonVariantProps) => ButtonVariantProps
|
|
@@ -31,9 +34,5 @@ export interface ButtonRecipe {
|
|
|
31
34
|
getVariantProps: (props?: ButtonVariantProps) => ButtonVariantProps
|
|
32
35
|
}
|
|
33
36
|
|
|
34
|
-
/**
|
|
35
|
-
* Material Design 3 button component
|
|
36
37
|
|
|
37
|
-
|
|
38
|
-
*/
|
|
39
38
|
export declare const button: ButtonRecipe
|
|
@@ -2,22 +2,26 @@ import { memo, splitProps } from '../helpers.mjs';
|
|
|
2
2
|
import { createRecipe, mergeRecipes } from './create-recipe.mjs';
|
|
3
3
|
|
|
4
4
|
const buttonFn = /* @__PURE__ */ createRecipe('button', {
|
|
5
|
-
"variant": "
|
|
5
|
+
"variant": "solid",
|
|
6
6
|
"size": "md"
|
|
7
7
|
}, [])
|
|
8
8
|
|
|
9
9
|
const buttonVariantMap = {
|
|
10
10
|
"variant": [
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
11
|
+
"solid",
|
|
12
|
+
"surface",
|
|
13
|
+
"subtle",
|
|
14
|
+
"outline",
|
|
15
|
+
"plain"
|
|
16
16
|
],
|
|
17
17
|
"size": [
|
|
18
|
+
"2xs",
|
|
19
|
+
"xs",
|
|
18
20
|
"sm",
|
|
19
21
|
"md",
|
|
20
|
-
"lg"
|
|
22
|
+
"lg",
|
|
23
|
+
"xl",
|
|
24
|
+
"2xl"
|
|
21
25
|
]
|
|
22
26
|
}
|
|
23
27
|
|
|
@@ -4,26 +4,25 @@ import type { DistributiveOmit, Pretty } from '../types/system-types';
|
|
|
4
4
|
|
|
5
5
|
interface CardVariant {
|
|
6
6
|
/**
|
|
7
|
-
* @default "
|
|
7
|
+
* @default "outline"
|
|
8
8
|
*/
|
|
9
|
-
variant: "elevated" | "
|
|
10
|
-
/**
|
|
11
|
-
* @default false
|
|
12
|
-
*/
|
|
13
|
-
interactive: boolean
|
|
9
|
+
variant: "elevated" | "outline" | "subtle"
|
|
14
10
|
}
|
|
15
11
|
|
|
16
12
|
type CardVariantMap = {
|
|
17
13
|
[key in keyof CardVariant]: Array<CardVariant[key]>
|
|
18
14
|
}
|
|
19
15
|
|
|
16
|
+
type CardSlot = "root" | "header" | "body" | "footer" | "title" | "description"
|
|
17
|
+
|
|
20
18
|
export type CardVariantProps = {
|
|
21
19
|
[key in keyof CardVariant]?: ConditionalValue<CardVariant[key]> | undefined
|
|
22
20
|
}
|
|
23
21
|
|
|
24
22
|
export interface CardRecipe {
|
|
23
|
+
__slot: CardSlot
|
|
25
24
|
__type: CardVariantProps
|
|
26
|
-
(props?: CardVariantProps): string
|
|
25
|
+
(props?: CardVariantProps): Pretty<Record<CardSlot, string>>
|
|
27
26
|
raw: (props?: CardVariantProps) => CardVariantProps
|
|
28
27
|
variantMap: CardVariantMap
|
|
29
28
|
variantKeys: Array<keyof CardVariant>
|
|
@@ -31,9 +30,5 @@ export interface CardRecipe {
|
|
|
31
30
|
getVariantProps: (props?: CardVariantProps) => CardVariantProps
|
|
32
31
|
}
|
|
33
32
|
|
|
34
|
-
/**
|
|
35
|
-
* Material Design 3 card component
|
|
36
33
|
|
|
37
|
-
|
|
38
|
-
*/
|
|
39
34
|
export declare const card: CardRecipe
|
|
@@ -1,36 +1,63 @@
|
|
|
1
|
-
import { memo, splitProps } from '../helpers.mjs';
|
|
2
|
-
import { createRecipe
|
|
1
|
+
import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
|
|
2
|
+
import { createRecipe } from './create-recipe.mjs';
|
|
3
3
|
|
|
4
|
-
const
|
|
5
|
-
"variant": "
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
const cardDefaultVariants = {
|
|
5
|
+
"variant": "outline"
|
|
6
|
+
}
|
|
7
|
+
const cardCompoundVariants = []
|
|
8
8
|
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
|
|
9
|
+
const cardSlotNames = [
|
|
10
|
+
[
|
|
11
|
+
"root",
|
|
12
|
+
"card__root"
|
|
13
|
+
],
|
|
14
|
+
[
|
|
15
|
+
"header",
|
|
16
|
+
"card__header"
|
|
17
|
+
],
|
|
18
|
+
[
|
|
19
|
+
"body",
|
|
20
|
+
"card__body"
|
|
21
|
+
],
|
|
22
|
+
[
|
|
23
|
+
"footer",
|
|
24
|
+
"card__footer"
|
|
25
|
+
],
|
|
26
|
+
[
|
|
27
|
+
"title",
|
|
28
|
+
"card__title"
|
|
14
29
|
],
|
|
15
|
-
|
|
16
|
-
"
|
|
30
|
+
[
|
|
31
|
+
"description",
|
|
32
|
+
"card__description"
|
|
17
33
|
]
|
|
18
|
-
|
|
34
|
+
]
|
|
35
|
+
const cardSlotFns = /* @__PURE__ */ cardSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, cardDefaultVariants, getSlotCompoundVariant(cardCompoundVariants, slotName))])
|
|
36
|
+
|
|
37
|
+
const cardFn = memo((props = {}) => {
|
|
38
|
+
return Object.fromEntries(cardSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
|
|
39
|
+
})
|
|
19
40
|
|
|
20
|
-
const cardVariantKeys =
|
|
41
|
+
const cardVariantKeys = [
|
|
42
|
+
"variant"
|
|
43
|
+
]
|
|
44
|
+
const getVariantProps = (variants) => ({ ...cardDefaultVariants, ...compact(variants) })
|
|
21
45
|
|
|
22
|
-
export const card = /* @__PURE__ */ Object.assign(
|
|
23
|
-
__recipe__:
|
|
46
|
+
export const card = /* @__PURE__ */ Object.assign(cardFn, {
|
|
47
|
+
__recipe__: false,
|
|
24
48
|
__name__: 'card',
|
|
25
|
-
__getCompoundVariantCss__: cardFn.__getCompoundVariantCss__,
|
|
26
49
|
raw: (props) => props,
|
|
50
|
+
classNameMap: {},
|
|
27
51
|
variantKeys: cardVariantKeys,
|
|
28
|
-
variantMap:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
52
|
+
variantMap: {
|
|
53
|
+
"variant": [
|
|
54
|
+
"elevated",
|
|
55
|
+
"outline",
|
|
56
|
+
"subtle"
|
|
57
|
+
]
|
|
58
|
+
},
|
|
32
59
|
splitVariantProps(props) {
|
|
33
60
|
return splitProps(props, cardVariantKeys)
|
|
34
61
|
},
|
|
35
|
-
getVariantProps
|
|
62
|
+
getVariantProps
|
|
36
63
|
})
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { ConditionalValue } from '../types/index';
|
|
3
|
+
import type { DistributiveOmit, Pretty } from '../types/system-types';
|
|
4
|
+
|
|
5
|
+
interface CheckboxVariant {
|
|
6
|
+
/**
|
|
7
|
+
* @default "md"
|
|
8
|
+
*/
|
|
9
|
+
size: "sm" | "md" | "lg"
|
|
10
|
+
/**
|
|
11
|
+
* @default "solid"
|
|
12
|
+
*/
|
|
13
|
+
variant: "solid" | "surface" | "subtle" | "outline" | "plain"
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
type CheckboxVariantMap = {
|
|
17
|
+
[key in keyof CheckboxVariant]: Array<CheckboxVariant[key]>
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
type CheckboxSlot = "root" | "label" | "control" | "indicator" | "group"
|
|
21
|
+
|
|
22
|
+
export type CheckboxVariantProps = {
|
|
23
|
+
[key in keyof CheckboxVariant]?: ConditionalValue<CheckboxVariant[key]> | undefined
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface CheckboxRecipe {
|
|
27
|
+
__slot: CheckboxSlot
|
|
28
|
+
__type: CheckboxVariantProps
|
|
29
|
+
(props?: CheckboxVariantProps): Pretty<Record<CheckboxSlot, string>>
|
|
30
|
+
raw: (props?: CheckboxVariantProps) => CheckboxVariantProps
|
|
31
|
+
variantMap: CheckboxVariantMap
|
|
32
|
+
variantKeys: Array<keyof CheckboxVariant>
|
|
33
|
+
splitVariantProps<Props extends CheckboxVariantProps>(props: Props): [CheckboxVariantProps, Pretty<DistributiveOmit<Props, keyof CheckboxVariantProps>>]
|
|
34
|
+
getVariantProps: (props?: CheckboxVariantProps) => CheckboxVariantProps
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
export declare const checkbox: CheckboxRecipe
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
|
|
2
|
+
import { createRecipe } from './create-recipe.mjs';
|
|
3
|
+
|
|
4
|
+
const checkboxDefaultVariants = {
|
|
5
|
+
"variant": "solid",
|
|
6
|
+
"size": "md"
|
|
7
|
+
}
|
|
8
|
+
const checkboxCompoundVariants = []
|
|
9
|
+
|
|
10
|
+
const checkboxSlotNames = [
|
|
11
|
+
[
|
|
12
|
+
"root",
|
|
13
|
+
"checkbox__root"
|
|
14
|
+
],
|
|
15
|
+
[
|
|
16
|
+
"label",
|
|
17
|
+
"checkbox__label"
|
|
18
|
+
],
|
|
19
|
+
[
|
|
20
|
+
"control",
|
|
21
|
+
"checkbox__control"
|
|
22
|
+
],
|
|
23
|
+
[
|
|
24
|
+
"indicator",
|
|
25
|
+
"checkbox__indicator"
|
|
26
|
+
],
|
|
27
|
+
[
|
|
28
|
+
"group",
|
|
29
|
+
"checkbox__group"
|
|
30
|
+
]
|
|
31
|
+
]
|
|
32
|
+
const checkboxSlotFns = /* @__PURE__ */ checkboxSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, checkboxDefaultVariants, getSlotCompoundVariant(checkboxCompoundVariants, slotName))])
|
|
33
|
+
|
|
34
|
+
const checkboxFn = memo((props = {}) => {
|
|
35
|
+
return Object.fromEntries(checkboxSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
const checkboxVariantKeys = [
|
|
39
|
+
"size",
|
|
40
|
+
"variant"
|
|
41
|
+
]
|
|
42
|
+
const getVariantProps = (variants) => ({ ...checkboxDefaultVariants, ...compact(variants) })
|
|
43
|
+
|
|
44
|
+
export const checkbox = /* @__PURE__ */ Object.assign(checkboxFn, {
|
|
45
|
+
__recipe__: false,
|
|
46
|
+
__name__: 'checkbox',
|
|
47
|
+
raw: (props) => props,
|
|
48
|
+
classNameMap: {},
|
|
49
|
+
variantKeys: checkboxVariantKeys,
|
|
50
|
+
variantMap: {
|
|
51
|
+
"size": [
|
|
52
|
+
"sm",
|
|
53
|
+
"md",
|
|
54
|
+
"lg"
|
|
55
|
+
],
|
|
56
|
+
"variant": [
|
|
57
|
+
"solid",
|
|
58
|
+
"surface",
|
|
59
|
+
"subtle",
|
|
60
|
+
"outline",
|
|
61
|
+
"plain"
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
splitVariantProps(props) {
|
|
65
|
+
return splitProps(props, checkboxVariantKeys)
|
|
66
|
+
},
|
|
67
|
+
getVariantProps
|
|
68
|
+
})
|
|
@@ -6,20 +6,31 @@ interface DialogVariant {
|
|
|
6
6
|
/**
|
|
7
7
|
* @default "md"
|
|
8
8
|
*/
|
|
9
|
-
size: "sm" | "md" | "lg" | "
|
|
9
|
+
size: "xs" | "sm" | "md" | "lg" | "xl" | "full"
|
|
10
|
+
/**
|
|
11
|
+
* @default "center"
|
|
12
|
+
*/
|
|
13
|
+
placement: "center" | "top" | "bottom"
|
|
14
|
+
/**
|
|
15
|
+
* @default "outside"
|
|
16
|
+
*/
|
|
17
|
+
scrollBehavior: "inside" | "outside"
|
|
10
18
|
}
|
|
11
19
|
|
|
12
20
|
type DialogVariantMap = {
|
|
13
21
|
[key in keyof DialogVariant]: Array<DialogVariant[key]>
|
|
14
22
|
}
|
|
15
23
|
|
|
24
|
+
type DialogSlot = "trigger" | "backdrop" | "positioner" | "content" | "title" | "description" | "closeTrigger" | "header" | "body" | "footer"
|
|
25
|
+
|
|
16
26
|
export type DialogVariantProps = {
|
|
17
27
|
[key in keyof DialogVariant]?: ConditionalValue<DialogVariant[key]> | undefined
|
|
18
28
|
}
|
|
19
29
|
|
|
20
30
|
export interface DialogRecipe {
|
|
31
|
+
__slot: DialogSlot
|
|
21
32
|
__type: DialogVariantProps
|
|
22
|
-
(props?: DialogVariantProps): Pretty<Record<
|
|
33
|
+
(props?: DialogVariantProps): Pretty<Record<DialogSlot, string>>
|
|
23
34
|
raw: (props?: DialogVariantProps) => DialogVariantProps
|
|
24
35
|
variantMap: DialogVariantMap
|
|
25
36
|
variantKeys: Array<keyof DialogVariant>
|
|
@@ -27,9 +38,5 @@ export interface DialogRecipe {
|
|
|
27
38
|
getVariantProps: (props?: DialogVariantProps) => DialogVariantProps
|
|
28
39
|
}
|
|
29
40
|
|
|
30
|
-
/**
|
|
31
|
-
* Material Design 3 dialog component
|
|
32
|
-
|
|
33
41
|
|
|
34
|
-
*/
|
|
35
42
|
export declare const dialog: DialogRecipe
|