@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
|
@@ -2,11 +2,17 @@ import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.mj
|
|
|
2
2
|
import { createRecipe } from './create-recipe.mjs';
|
|
3
3
|
|
|
4
4
|
const dialogDefaultVariants = {
|
|
5
|
-
"size": "md"
|
|
5
|
+
"size": "md",
|
|
6
|
+
"scrollBehavior": "outside",
|
|
7
|
+
"placement": "center"
|
|
6
8
|
}
|
|
7
9
|
const dialogCompoundVariants = []
|
|
8
10
|
|
|
9
11
|
const dialogSlotNames = [
|
|
12
|
+
[
|
|
13
|
+
"trigger",
|
|
14
|
+
"dialog__trigger"
|
|
15
|
+
],
|
|
10
16
|
[
|
|
11
17
|
"backdrop",
|
|
12
18
|
"dialog__backdrop"
|
|
@@ -30,6 +36,18 @@ const dialogSlotNames = [
|
|
|
30
36
|
[
|
|
31
37
|
"closeTrigger",
|
|
32
38
|
"dialog__closeTrigger"
|
|
39
|
+
],
|
|
40
|
+
[
|
|
41
|
+
"header",
|
|
42
|
+
"dialog__header"
|
|
43
|
+
],
|
|
44
|
+
[
|
|
45
|
+
"body",
|
|
46
|
+
"dialog__body"
|
|
47
|
+
],
|
|
48
|
+
[
|
|
49
|
+
"footer",
|
|
50
|
+
"dialog__footer"
|
|
33
51
|
]
|
|
34
52
|
]
|
|
35
53
|
const dialogSlotFns = /* @__PURE__ */ dialogSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, dialogDefaultVariants, getSlotCompoundVariant(dialogCompoundVariants, slotName))])
|
|
@@ -39,7 +57,9 @@ const dialogFn = memo((props = {}) => {
|
|
|
39
57
|
})
|
|
40
58
|
|
|
41
59
|
const dialogVariantKeys = [
|
|
42
|
-
"size"
|
|
60
|
+
"size",
|
|
61
|
+
"placement",
|
|
62
|
+
"scrollBehavior"
|
|
43
63
|
]
|
|
44
64
|
const getVariantProps = (variants) => ({ ...dialogDefaultVariants, ...compact(variants) })
|
|
45
65
|
|
|
@@ -47,13 +67,25 @@ export const dialog = /* @__PURE__ */ Object.assign(dialogFn, {
|
|
|
47
67
|
__recipe__: false,
|
|
48
68
|
__name__: 'dialog',
|
|
49
69
|
raw: (props) => props,
|
|
70
|
+
classNameMap: {},
|
|
50
71
|
variantKeys: dialogVariantKeys,
|
|
51
72
|
variantMap: {
|
|
52
73
|
"size": [
|
|
74
|
+
"xs",
|
|
53
75
|
"sm",
|
|
54
76
|
"md",
|
|
55
77
|
"lg",
|
|
56
|
-
"
|
|
78
|
+
"xl",
|
|
79
|
+
"full"
|
|
80
|
+
],
|
|
81
|
+
"placement": [
|
|
82
|
+
"center",
|
|
83
|
+
"top",
|
|
84
|
+
"bottom"
|
|
85
|
+
],
|
|
86
|
+
"scrollBehavior": [
|
|
87
|
+
"inside",
|
|
88
|
+
"outside"
|
|
57
89
|
]
|
|
58
90
|
},
|
|
59
91
|
splitVariantProps(props) {
|
|
@@ -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 DrawerVariant {
|
|
6
|
+
/**
|
|
7
|
+
* @default "sm"
|
|
8
|
+
*/
|
|
9
|
+
size: "xs" | "sm" | "md" | "lg" | "xl" | "full"
|
|
10
|
+
/**
|
|
11
|
+
* @default "end"
|
|
12
|
+
*/
|
|
13
|
+
placement: "start" | "end" | "top" | "bottom"
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
type DrawerVariantMap = {
|
|
17
|
+
[key in keyof DrawerVariant]: Array<DrawerVariant[key]>
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
type DrawerSlot = "trigger" | "backdrop" | "positioner" | "content" | "title" | "description" | "closeTrigger" | "header" | "body" | "footer"
|
|
21
|
+
|
|
22
|
+
export type DrawerVariantProps = {
|
|
23
|
+
[key in keyof DrawerVariant]?: ConditionalValue<DrawerVariant[key]> | undefined
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface DrawerRecipe {
|
|
27
|
+
__slot: DrawerSlot
|
|
28
|
+
__type: DrawerVariantProps
|
|
29
|
+
(props?: DrawerVariantProps): Pretty<Record<DrawerSlot, string>>
|
|
30
|
+
raw: (props?: DrawerVariantProps) => DrawerVariantProps
|
|
31
|
+
variantMap: DrawerVariantMap
|
|
32
|
+
variantKeys: Array<keyof DrawerVariant>
|
|
33
|
+
splitVariantProps<Props extends DrawerVariantProps>(props: Props): [DrawerVariantProps, Pretty<DistributiveOmit<Props, keyof DrawerVariantProps>>]
|
|
34
|
+
getVariantProps: (props?: DrawerVariantProps) => DrawerVariantProps
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
export declare const drawer: DrawerRecipe
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
|
|
2
|
+
import { createRecipe } from './create-recipe.mjs';
|
|
3
|
+
|
|
4
|
+
const drawerDefaultVariants = {
|
|
5
|
+
"placement": "end",
|
|
6
|
+
"size": "sm"
|
|
7
|
+
}
|
|
8
|
+
const drawerCompoundVariants = []
|
|
9
|
+
|
|
10
|
+
const drawerSlotNames = [
|
|
11
|
+
[
|
|
12
|
+
"trigger",
|
|
13
|
+
"drawer__trigger"
|
|
14
|
+
],
|
|
15
|
+
[
|
|
16
|
+
"backdrop",
|
|
17
|
+
"drawer__backdrop"
|
|
18
|
+
],
|
|
19
|
+
[
|
|
20
|
+
"positioner",
|
|
21
|
+
"drawer__positioner"
|
|
22
|
+
],
|
|
23
|
+
[
|
|
24
|
+
"content",
|
|
25
|
+
"drawer__content"
|
|
26
|
+
],
|
|
27
|
+
[
|
|
28
|
+
"title",
|
|
29
|
+
"drawer__title"
|
|
30
|
+
],
|
|
31
|
+
[
|
|
32
|
+
"description",
|
|
33
|
+
"drawer__description"
|
|
34
|
+
],
|
|
35
|
+
[
|
|
36
|
+
"closeTrigger",
|
|
37
|
+
"drawer__closeTrigger"
|
|
38
|
+
],
|
|
39
|
+
[
|
|
40
|
+
"header",
|
|
41
|
+
"drawer__header"
|
|
42
|
+
],
|
|
43
|
+
[
|
|
44
|
+
"body",
|
|
45
|
+
"drawer__body"
|
|
46
|
+
],
|
|
47
|
+
[
|
|
48
|
+
"footer",
|
|
49
|
+
"drawer__footer"
|
|
50
|
+
]
|
|
51
|
+
]
|
|
52
|
+
const drawerSlotFns = /* @__PURE__ */ drawerSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, drawerDefaultVariants, getSlotCompoundVariant(drawerCompoundVariants, slotName))])
|
|
53
|
+
|
|
54
|
+
const drawerFn = memo((props = {}) => {
|
|
55
|
+
return Object.fromEntries(drawerSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
const drawerVariantKeys = [
|
|
59
|
+
"size",
|
|
60
|
+
"placement"
|
|
61
|
+
]
|
|
62
|
+
const getVariantProps = (variants) => ({ ...drawerDefaultVariants, ...compact(variants) })
|
|
63
|
+
|
|
64
|
+
export const drawer = /* @__PURE__ */ Object.assign(drawerFn, {
|
|
65
|
+
__recipe__: false,
|
|
66
|
+
__name__: 'drawer',
|
|
67
|
+
raw: (props) => props,
|
|
68
|
+
classNameMap: {},
|
|
69
|
+
variantKeys: drawerVariantKeys,
|
|
70
|
+
variantMap: {
|
|
71
|
+
"size": [
|
|
72
|
+
"xs",
|
|
73
|
+
"sm",
|
|
74
|
+
"md",
|
|
75
|
+
"lg",
|
|
76
|
+
"xl",
|
|
77
|
+
"full"
|
|
78
|
+
],
|
|
79
|
+
"placement": [
|
|
80
|
+
"start",
|
|
81
|
+
"end",
|
|
82
|
+
"top",
|
|
83
|
+
"bottom"
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
splitVariantProps(props) {
|
|
87
|
+
return splitProps(props, drawerVariantKeys)
|
|
88
|
+
},
|
|
89
|
+
getVariantProps
|
|
90
|
+
})
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { ConditionalValue } from '../types/index';
|
|
3
|
+
import type { DistributiveOmit, Pretty } from '../types/system-types';
|
|
4
|
+
|
|
5
|
+
interface FieldVariant {
|
|
6
|
+
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
type FieldVariantMap = {
|
|
10
|
+
[key in keyof FieldVariant]: Array<FieldVariant[key]>
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
type FieldSlot = "root" | "errorText" | "helperText" | "input" | "label" | "select" | "textarea" | "requiredIndicator"
|
|
14
|
+
|
|
15
|
+
export type FieldVariantProps = {
|
|
16
|
+
[key in keyof FieldVariant]?: ConditionalValue<FieldVariant[key]> | undefined
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface FieldRecipe {
|
|
20
|
+
__slot: FieldSlot
|
|
21
|
+
__type: FieldVariantProps
|
|
22
|
+
(props?: FieldVariantProps): Pretty<Record<FieldSlot, string>>
|
|
23
|
+
raw: (props?: FieldVariantProps) => FieldVariantProps
|
|
24
|
+
variantMap: FieldVariantMap
|
|
25
|
+
variantKeys: Array<keyof FieldVariant>
|
|
26
|
+
splitVariantProps<Props extends FieldVariantProps>(props: Props): [FieldVariantProps, Pretty<DistributiveOmit<Props, keyof FieldVariantProps>>]
|
|
27
|
+
getVariantProps: (props?: FieldVariantProps) => FieldVariantProps
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
export declare const field: FieldRecipe
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
|
|
2
|
+
import { createRecipe } from './create-recipe.mjs';
|
|
3
|
+
|
|
4
|
+
const fieldDefaultVariants = {}
|
|
5
|
+
const fieldCompoundVariants = []
|
|
6
|
+
|
|
7
|
+
const fieldSlotNames = [
|
|
8
|
+
[
|
|
9
|
+
"root",
|
|
10
|
+
"field__root"
|
|
11
|
+
],
|
|
12
|
+
[
|
|
13
|
+
"errorText",
|
|
14
|
+
"field__errorText"
|
|
15
|
+
],
|
|
16
|
+
[
|
|
17
|
+
"helperText",
|
|
18
|
+
"field__helperText"
|
|
19
|
+
],
|
|
20
|
+
[
|
|
21
|
+
"input",
|
|
22
|
+
"field__input"
|
|
23
|
+
],
|
|
24
|
+
[
|
|
25
|
+
"label",
|
|
26
|
+
"field__label"
|
|
27
|
+
],
|
|
28
|
+
[
|
|
29
|
+
"select",
|
|
30
|
+
"field__select"
|
|
31
|
+
],
|
|
32
|
+
[
|
|
33
|
+
"textarea",
|
|
34
|
+
"field__textarea"
|
|
35
|
+
],
|
|
36
|
+
[
|
|
37
|
+
"requiredIndicator",
|
|
38
|
+
"field__requiredIndicator"
|
|
39
|
+
]
|
|
40
|
+
]
|
|
41
|
+
const fieldSlotFns = /* @__PURE__ */ fieldSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, fieldDefaultVariants, getSlotCompoundVariant(fieldCompoundVariants, slotName))])
|
|
42
|
+
|
|
43
|
+
const fieldFn = memo((props = {}) => {
|
|
44
|
+
return Object.fromEntries(fieldSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
const fieldVariantKeys = []
|
|
48
|
+
const getVariantProps = (variants) => ({ ...fieldDefaultVariants, ...compact(variants) })
|
|
49
|
+
|
|
50
|
+
export const field = /* @__PURE__ */ Object.assign(fieldFn, {
|
|
51
|
+
__recipe__: false,
|
|
52
|
+
__name__: 'field',
|
|
53
|
+
raw: (props) => props,
|
|
54
|
+
classNameMap: {},
|
|
55
|
+
variantKeys: fieldVariantKeys,
|
|
56
|
+
variantMap: {},
|
|
57
|
+
splitVariantProps(props) {
|
|
58
|
+
return splitProps(props, fieldVariantKeys)
|
|
59
|
+
},
|
|
60
|
+
getVariantProps
|
|
61
|
+
})
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { ConditionalValue } from '../types/index';
|
|
3
|
+
import type { DistributiveOmit, Pretty } from '../types/system-types';
|
|
4
|
+
|
|
5
|
+
interface GroupVariant {
|
|
6
|
+
/**
|
|
7
|
+
* @default "horizontal"
|
|
8
|
+
*/
|
|
9
|
+
orientation: "horizontal" | "vertical"
|
|
10
|
+
attached: boolean
|
|
11
|
+
grow: boolean
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
type GroupVariantMap = {
|
|
15
|
+
[key in keyof GroupVariant]: Array<GroupVariant[key]>
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
export type GroupVariantProps = {
|
|
21
|
+
[key in keyof GroupVariant]?: GroupVariant[key] | undefined
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface GroupRecipe {
|
|
25
|
+
|
|
26
|
+
__type: GroupVariantProps
|
|
27
|
+
(props?: GroupVariantProps): string
|
|
28
|
+
raw: (props?: GroupVariantProps) => GroupVariantProps
|
|
29
|
+
variantMap: GroupVariantMap
|
|
30
|
+
variantKeys: Array<keyof GroupVariant>
|
|
31
|
+
splitVariantProps<Props extends GroupVariantProps>(props: Props): [GroupVariantProps, Pretty<DistributiveOmit<Props, keyof GroupVariantProps>>]
|
|
32
|
+
getVariantProps: (props?: GroupVariantProps) => GroupVariantProps
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
export declare const group: GroupRecipe
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { memo, splitProps } from '../helpers.mjs';
|
|
2
|
+
import { createRecipe, mergeRecipes } from './create-recipe.mjs';
|
|
3
|
+
|
|
4
|
+
const groupFn = /* @__PURE__ */ createRecipe('group', {
|
|
5
|
+
"orientation": "horizontal"
|
|
6
|
+
}, [
|
|
7
|
+
{
|
|
8
|
+
"orientation": "horizontal",
|
|
9
|
+
"attached": true,
|
|
10
|
+
"css": {
|
|
11
|
+
"& > *:first-child": {
|
|
12
|
+
"borderEndRadius": "0",
|
|
13
|
+
"marginEnd": "-1px"
|
|
14
|
+
},
|
|
15
|
+
"& > *:last-child": {
|
|
16
|
+
"borderStartRadius": "0"
|
|
17
|
+
},
|
|
18
|
+
"& > *:not(:first-child):not(:last-child)": {
|
|
19
|
+
"borderRadius": "0",
|
|
20
|
+
"marginEnd": "-1px"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"orientation": "vertical",
|
|
26
|
+
"attached": true,
|
|
27
|
+
"css": {
|
|
28
|
+
"& > *:first-child": {
|
|
29
|
+
"borderBottomRadius": "0",
|
|
30
|
+
"marginBottom": "-1px"
|
|
31
|
+
},
|
|
32
|
+
"& > *:last-child": {
|
|
33
|
+
"borderTopRadius": "0"
|
|
34
|
+
},
|
|
35
|
+
"& > *:not(:first-child):not(:last-child)": {
|
|
36
|
+
"borderRadius": "0",
|
|
37
|
+
"marginBottom": "-1px"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
])
|
|
42
|
+
|
|
43
|
+
const groupVariantMap = {
|
|
44
|
+
"orientation": [
|
|
45
|
+
"horizontal",
|
|
46
|
+
"vertical"
|
|
47
|
+
],
|
|
48
|
+
"attached": [
|
|
49
|
+
"true"
|
|
50
|
+
],
|
|
51
|
+
"grow": [
|
|
52
|
+
"true"
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const groupVariantKeys = Object.keys(groupVariantMap)
|
|
57
|
+
|
|
58
|
+
export const group = /* @__PURE__ */ Object.assign(memo(groupFn.recipeFn), {
|
|
59
|
+
__recipe__: true,
|
|
60
|
+
__name__: 'group',
|
|
61
|
+
__getCompoundVariantCss__: groupFn.__getCompoundVariantCss__,
|
|
62
|
+
raw: (props) => props,
|
|
63
|
+
variantKeys: groupVariantKeys,
|
|
64
|
+
variantMap: groupVariantMap,
|
|
65
|
+
merge(recipe) {
|
|
66
|
+
return mergeRecipes(this, recipe)
|
|
67
|
+
},
|
|
68
|
+
splitVariantProps(props) {
|
|
69
|
+
return splitProps(props, groupVariantKeys)
|
|
70
|
+
},
|
|
71
|
+
getVariantProps: groupFn.getVariantProps,
|
|
72
|
+
})
|
|
@@ -1,7 +1,25 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
export * from './button';
|
|
3
|
-
export * from './card';
|
|
4
|
-
export * from './icon-button';
|
|
5
3
|
export * from './input';
|
|
4
|
+
export * from './group';
|
|
5
|
+
export * from './spinner';
|
|
6
|
+
export * from './absolute-center';
|
|
7
|
+
export * from './badge';
|
|
8
|
+
export * from './skeleton';
|
|
9
|
+
export * from './textarea';
|
|
10
|
+
export * from './field';
|
|
11
|
+
export * from './card';
|
|
12
|
+
export * from './accordion';
|
|
13
|
+
export * from './drawer';
|
|
14
|
+
export * from './tabs';
|
|
15
|
+
export * from './switch-component';
|
|
16
|
+
export * from './checkbox';
|
|
17
|
+
export * from './radio-group';
|
|
18
|
+
export * from './select';
|
|
19
|
+
export * from './slider';
|
|
20
|
+
export * from './avatar';
|
|
21
|
+
export * from './progress';
|
|
22
|
+
export * from './toast';
|
|
6
23
|
export * from './dialog';
|
|
7
|
-
export * from './
|
|
24
|
+
export * from './popover';
|
|
25
|
+
export * from './tooltip';
|
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
export * from './button.mjs';
|
|
2
|
-
export * from './card.mjs';
|
|
3
|
-
export * from './icon-button.mjs';
|
|
4
2
|
export * from './input.mjs';
|
|
3
|
+
export * from './group.mjs';
|
|
4
|
+
export * from './spinner.mjs';
|
|
5
|
+
export * from './absolute-center.mjs';
|
|
6
|
+
export * from './badge.mjs';
|
|
7
|
+
export * from './skeleton.mjs';
|
|
8
|
+
export * from './textarea.mjs';
|
|
9
|
+
export * from './field.mjs';
|
|
10
|
+
export * from './card.mjs';
|
|
11
|
+
export * from './accordion.mjs';
|
|
12
|
+
export * from './drawer.mjs';
|
|
13
|
+
export * from './tabs.mjs';
|
|
14
|
+
export * from './switch-component.mjs';
|
|
15
|
+
export * from './checkbox.mjs';
|
|
16
|
+
export * from './radio-group.mjs';
|
|
17
|
+
export * from './select.mjs';
|
|
18
|
+
export * from './slider.mjs';
|
|
19
|
+
export * from './avatar.mjs';
|
|
20
|
+
export * from './progress.mjs';
|
|
21
|
+
export * from './toast.mjs';
|
|
5
22
|
export * from './dialog.mjs';
|
|
6
|
-
export * from './
|
|
23
|
+
export * from './popover.mjs';
|
|
24
|
+
export * from './tooltip.mjs';
|
|
@@ -4,25 +4,27 @@ import type { DistributiveOmit, Pretty } from '../types/system-types';
|
|
|
4
4
|
|
|
5
5
|
interface InputVariant {
|
|
6
6
|
/**
|
|
7
|
-
* @default "
|
|
7
|
+
* @default "outline"
|
|
8
8
|
*/
|
|
9
|
-
variant: "
|
|
9
|
+
variant: "outline" | "surface" | "subtle" | "flushed"
|
|
10
10
|
/**
|
|
11
11
|
* @default "md"
|
|
12
12
|
*/
|
|
13
|
-
size: "sm" | "md"
|
|
14
|
-
state: "error" | "disabled"
|
|
13
|
+
size: "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
|
|
15
14
|
}
|
|
16
15
|
|
|
17
16
|
type InputVariantMap = {
|
|
18
17
|
[key in keyof InputVariant]: Array<InputVariant[key]>
|
|
19
18
|
}
|
|
20
19
|
|
|
20
|
+
|
|
21
|
+
|
|
21
22
|
export type InputVariantProps = {
|
|
22
23
|
[key in keyof InputVariant]?: ConditionalValue<InputVariant[key]> | undefined
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
export interface InputRecipe {
|
|
27
|
+
|
|
26
28
|
__type: InputVariantProps
|
|
27
29
|
(props?: InputVariantProps): string
|
|
28
30
|
raw: (props?: InputVariantProps) => InputVariantProps
|
|
@@ -32,9 +34,5 @@ export interface InputRecipe {
|
|
|
32
34
|
getVariantProps: (props?: InputVariantProps) => InputVariantProps
|
|
33
35
|
}
|
|
34
36
|
|
|
35
|
-
/**
|
|
36
|
-
* Material Design 3 text field component
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
*/
|
|
40
38
|
export declare const input: InputRecipe
|
|
@@ -2,22 +2,25 @@ import { memo, splitProps } from '../helpers.mjs';
|
|
|
2
2
|
import { createRecipe, mergeRecipes } from './create-recipe.mjs';
|
|
3
3
|
|
|
4
4
|
const inputFn = /* @__PURE__ */ createRecipe('input', {
|
|
5
|
-
"
|
|
6
|
-
"
|
|
5
|
+
"size": "md",
|
|
6
|
+
"variant": "outline"
|
|
7
7
|
}, [])
|
|
8
8
|
|
|
9
9
|
const inputVariantMap = {
|
|
10
10
|
"variant": [
|
|
11
|
-
"
|
|
12
|
-
"
|
|
11
|
+
"outline",
|
|
12
|
+
"surface",
|
|
13
|
+
"subtle",
|
|
14
|
+
"flushed"
|
|
13
15
|
],
|
|
14
16
|
"size": [
|
|
17
|
+
"2xs",
|
|
18
|
+
"xs",
|
|
15
19
|
"sm",
|
|
16
|
-
"md"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
"disabled"
|
|
20
|
+
"md",
|
|
21
|
+
"lg",
|
|
22
|
+
"xl",
|
|
23
|
+
"2xl"
|
|
21
24
|
]
|
|
22
25
|
}
|
|
23
26
|
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { ConditionalValue } from '../types/index';
|
|
3
|
+
import type { DistributiveOmit, Pretty } from '../types/system-types';
|
|
4
|
+
|
|
5
|
+
interface PopoverVariant {
|
|
6
|
+
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
type PopoverVariantMap = {
|
|
10
|
+
[key in keyof PopoverVariant]: Array<PopoverVariant[key]>
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
type PopoverSlot = "arrow" | "arrowTip" | "anchor" | "trigger" | "indicator" | "positioner" | "content" | "title" | "description" | "closeTrigger" | "header" | "body" | "footer"
|
|
14
|
+
|
|
15
|
+
export type PopoverVariantProps = {
|
|
16
|
+
[key in keyof PopoverVariant]?: ConditionalValue<PopoverVariant[key]> | undefined
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface PopoverRecipe {
|
|
20
|
+
__slot: PopoverSlot
|
|
21
|
+
__type: PopoverVariantProps
|
|
22
|
+
(props?: PopoverVariantProps): Pretty<Record<PopoverSlot, string>>
|
|
23
|
+
raw: (props?: PopoverVariantProps) => PopoverVariantProps
|
|
24
|
+
variantMap: PopoverVariantMap
|
|
25
|
+
variantKeys: Array<keyof PopoverVariant>
|
|
26
|
+
splitVariantProps<Props extends PopoverVariantProps>(props: Props): [PopoverVariantProps, Pretty<DistributiveOmit<Props, keyof PopoverVariantProps>>]
|
|
27
|
+
getVariantProps: (props?: PopoverVariantProps) => PopoverVariantProps
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
export declare const popover: PopoverRecipe
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
|
|
2
|
+
import { createRecipe } from './create-recipe.mjs';
|
|
3
|
+
|
|
4
|
+
const popoverDefaultVariants = {}
|
|
5
|
+
const popoverCompoundVariants = []
|
|
6
|
+
|
|
7
|
+
const popoverSlotNames = [
|
|
8
|
+
[
|
|
9
|
+
"arrow",
|
|
10
|
+
"popover__arrow"
|
|
11
|
+
],
|
|
12
|
+
[
|
|
13
|
+
"arrowTip",
|
|
14
|
+
"popover__arrowTip"
|
|
15
|
+
],
|
|
16
|
+
[
|
|
17
|
+
"anchor",
|
|
18
|
+
"popover__anchor"
|
|
19
|
+
],
|
|
20
|
+
[
|
|
21
|
+
"trigger",
|
|
22
|
+
"popover__trigger"
|
|
23
|
+
],
|
|
24
|
+
[
|
|
25
|
+
"indicator",
|
|
26
|
+
"popover__indicator"
|
|
27
|
+
],
|
|
28
|
+
[
|
|
29
|
+
"positioner",
|
|
30
|
+
"popover__positioner"
|
|
31
|
+
],
|
|
32
|
+
[
|
|
33
|
+
"content",
|
|
34
|
+
"popover__content"
|
|
35
|
+
],
|
|
36
|
+
[
|
|
37
|
+
"title",
|
|
38
|
+
"popover__title"
|
|
39
|
+
],
|
|
40
|
+
[
|
|
41
|
+
"description",
|
|
42
|
+
"popover__description"
|
|
43
|
+
],
|
|
44
|
+
[
|
|
45
|
+
"closeTrigger",
|
|
46
|
+
"popover__closeTrigger"
|
|
47
|
+
],
|
|
48
|
+
[
|
|
49
|
+
"header",
|
|
50
|
+
"popover__header"
|
|
51
|
+
],
|
|
52
|
+
[
|
|
53
|
+
"body",
|
|
54
|
+
"popover__body"
|
|
55
|
+
],
|
|
56
|
+
[
|
|
57
|
+
"footer",
|
|
58
|
+
"popover__footer"
|
|
59
|
+
]
|
|
60
|
+
]
|
|
61
|
+
const popoverSlotFns = /* @__PURE__ */ popoverSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, popoverDefaultVariants, getSlotCompoundVariant(popoverCompoundVariants, slotName))])
|
|
62
|
+
|
|
63
|
+
const popoverFn = memo((props = {}) => {
|
|
64
|
+
return Object.fromEntries(popoverSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
const popoverVariantKeys = []
|
|
68
|
+
const getVariantProps = (variants) => ({ ...popoverDefaultVariants, ...compact(variants) })
|
|
69
|
+
|
|
70
|
+
export const popover = /* @__PURE__ */ Object.assign(popoverFn, {
|
|
71
|
+
__recipe__: false,
|
|
72
|
+
__name__: 'popover',
|
|
73
|
+
raw: (props) => props,
|
|
74
|
+
classNameMap: {},
|
|
75
|
+
variantKeys: popoverVariantKeys,
|
|
76
|
+
variantMap: {},
|
|
77
|
+
splitVariantProps(props) {
|
|
78
|
+
return splitProps(props, popoverVariantKeys)
|
|
79
|
+
},
|
|
80
|
+
getVariantProps
|
|
81
|
+
})
|