@discourser/design-system 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +213 -0
- package/dist/index.cjs +1250 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +456 -0
- package/dist/index.d.ts +456 -0
- package/dist/index.js +1234 -0
- package/dist/index.js.map +1 -0
- package/package.json +123 -0
- package/styled-system/css/conditions.mjs +36 -0
- package/styled-system/css/css.d.ts +22 -0
- package/styled-system/css/css.mjs +45 -0
- package/styled-system/css/cva.d.ts +6 -0
- package/styled-system/css/cva.mjs +87 -0
- package/styled-system/css/cx.d.ts +5 -0
- package/styled-system/css/cx.mjs +15 -0
- package/styled-system/css/index.d.ts +5 -0
- package/styled-system/css/index.mjs +4 -0
- package/styled-system/css/sva.d.ts +4 -0
- package/styled-system/css/sva.mjs +41 -0
- package/styled-system/helpers.mjs +336 -0
- package/styled-system/jsx/aspect-ratio.d.ts +10 -0
- package/styled-system/jsx/aspect-ratio.mjs +14 -0
- package/styled-system/jsx/bleed.d.ts +10 -0
- package/styled-system/jsx/bleed.mjs +14 -0
- package/styled-system/jsx/box.d.ts +10 -0
- package/styled-system/jsx/box.mjs +14 -0
- package/styled-system/jsx/center.d.ts +10 -0
- package/styled-system/jsx/center.mjs +14 -0
- package/styled-system/jsx/circle.d.ts +10 -0
- package/styled-system/jsx/circle.mjs +14 -0
- package/styled-system/jsx/container.d.ts +10 -0
- package/styled-system/jsx/container.mjs +14 -0
- package/styled-system/jsx/cq.d.ts +10 -0
- package/styled-system/jsx/cq.mjs +14 -0
- package/styled-system/jsx/divider.d.ts +10 -0
- package/styled-system/jsx/divider.mjs +14 -0
- package/styled-system/jsx/factory-helper.mjs +22 -0
- package/styled-system/jsx/factory.d.ts +3 -0
- package/styled-system/jsx/factory.mjs +80 -0
- package/styled-system/jsx/flex.d.ts +10 -0
- package/styled-system/jsx/flex.mjs +14 -0
- package/styled-system/jsx/float.d.ts +10 -0
- package/styled-system/jsx/float.mjs +14 -0
- package/styled-system/jsx/grid-item.d.ts +10 -0
- package/styled-system/jsx/grid-item.mjs +14 -0
- package/styled-system/jsx/grid.d.ts +10 -0
- package/styled-system/jsx/grid.mjs +14 -0
- package/styled-system/jsx/hstack.d.ts +10 -0
- package/styled-system/jsx/hstack.mjs +14 -0
- package/styled-system/jsx/index.d.ts +24 -0
- package/styled-system/jsx/index.mjs +22 -0
- package/styled-system/jsx/is-valid-prop.d.ts +11 -0
- package/styled-system/jsx/is-valid-prop.mjs +17 -0
- package/styled-system/jsx/link-overlay.d.ts +10 -0
- package/styled-system/jsx/link-overlay.mjs +14 -0
- package/styled-system/jsx/spacer.d.ts +10 -0
- package/styled-system/jsx/spacer.mjs +14 -0
- package/styled-system/jsx/square.d.ts +10 -0
- package/styled-system/jsx/square.mjs +14 -0
- package/styled-system/jsx/stack.d.ts +10 -0
- package/styled-system/jsx/stack.mjs +14 -0
- package/styled-system/jsx/visually-hidden.d.ts +10 -0
- package/styled-system/jsx/visually-hidden.mjs +14 -0
- package/styled-system/jsx/vstack.d.ts +10 -0
- package/styled-system/jsx/vstack.mjs +14 -0
- package/styled-system/jsx/wrap.d.ts +10 -0
- package/styled-system/jsx/wrap.mjs +14 -0
- package/styled-system/patterns/aspect-ratio.d.ts +21 -0
- package/styled-system/patterns/aspect-ratio.mjs +38 -0
- package/styled-system/patterns/bleed.d.ts +22 -0
- package/styled-system/patterns/bleed.mjs +24 -0
- package/styled-system/patterns/box.d.ts +21 -0
- package/styled-system/patterns/box.mjs +15 -0
- package/styled-system/patterns/center.d.ts +21 -0
- package/styled-system/patterns/center.mjs +21 -0
- package/styled-system/patterns/circle.d.ts +21 -0
- package/styled-system/patterns/circle.mjs +25 -0
- package/styled-system/patterns/container.d.ts +21 -0
- package/styled-system/patterns/container.mjs +21 -0
- package/styled-system/patterns/cq.d.ts +22 -0
- package/styled-system/patterns/cq.mjs +21 -0
- package/styled-system/patterns/divider.d.ts +23 -0
- package/styled-system/patterns/divider.mjs +25 -0
- package/styled-system/patterns/flex.d.ts +27 -0
- package/styled-system/patterns/flex.mjs +26 -0
- package/styled-system/patterns/float.d.ts +24 -0
- package/styled-system/patterns/float.mjs +52 -0
- package/styled-system/patterns/grid-item.d.ts +26 -0
- package/styled-system/patterns/grid-item.mjs +25 -0
- package/styled-system/patterns/grid.d.ts +25 -0
- package/styled-system/patterns/grid.mjs +27 -0
- package/styled-system/patterns/hstack.d.ts +22 -0
- package/styled-system/patterns/hstack.mjs +24 -0
- package/styled-system/patterns/index.d.ts +21 -0
- package/styled-system/patterns/index.mjs +20 -0
- package/styled-system/patterns/link-overlay.d.ts +21 -0
- package/styled-system/patterns/link-overlay.mjs +24 -0
- package/styled-system/patterns/spacer.d.ts +21 -0
- package/styled-system/patterns/spacer.mjs +21 -0
- package/styled-system/patterns/square.d.ts +21 -0
- package/styled-system/patterns/square.mjs +24 -0
- package/styled-system/patterns/stack.d.ts +24 -0
- package/styled-system/patterns/stack.mjs +24 -0
- package/styled-system/patterns/visually-hidden.d.ts +21 -0
- package/styled-system/patterns/visually-hidden.mjs +18 -0
- package/styled-system/patterns/vstack.d.ts +22 -0
- package/styled-system/patterns/vstack.mjs +24 -0
- package/styled-system/patterns/wrap.d.ts +25 -0
- package/styled-system/patterns/wrap.mjs +25 -0
- package/styled-system/recipes/button.d.ts +39 -0
- package/styled-system/recipes/button.mjs +40 -0
- package/styled-system/recipes/card.d.ts +39 -0
- package/styled-system/recipes/card.mjs +36 -0
- package/styled-system/recipes/create-recipe.mjs +82 -0
- package/styled-system/recipes/dialog.d.ts +35 -0
- package/styled-system/recipes/dialog.mjs +63 -0
- package/styled-system/recipes/icon-button.d.ts +39 -0
- package/styled-system/recipes/icon-button.mjs +39 -0
- package/styled-system/recipes/index.d.ts +7 -0
- package/styled-system/recipes/index.mjs +6 -0
- package/styled-system/recipes/input.d.ts +40 -0
- package/styled-system/recipes/input.mjs +40 -0
- package/styled-system/recipes/switch-control.d.ts +35 -0
- package/styled-system/recipes/switch-control.mjs +53 -0
- package/styled-system/recipes/switch.d.ts +35 -0
- package/styled-system/recipes/switch.mjs +53 -0
- package/styled-system/tokens/index.d.ts +9 -0
- package/styled-system/tokens/index.mjs +924 -0
- package/styled-system/tokens/tokens.d.ts +48 -0
- package/styled-system/types/composition.d.ts +164 -0
- package/styled-system/types/conditions.d.ts +306 -0
- package/styled-system/types/csstype.d.ts +21298 -0
- package/styled-system/types/global.d.ts +20 -0
- package/styled-system/types/index.d.ts +8 -0
- package/styled-system/types/jsx.d.ts +52 -0
- package/styled-system/types/parts.d.ts +8 -0
- package/styled-system/types/pattern.d.ts +78 -0
- package/styled-system/types/prop-type.d.ts +224 -0
- package/styled-system/types/recipe.d.ts +181 -0
- package/styled-system/types/selectors.d.ts +59 -0
- package/styled-system/types/static-css.d.ts +56 -0
- package/styled-system/types/style-props.d.ts +7468 -0
- package/styled-system/types/system-types.d.ts +109 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { ConditionalValue } from '../types/index';
|
|
3
|
+
import type { DistributiveOmit, Pretty } from '../types/system-types';
|
|
4
|
+
|
|
5
|
+
interface SwitchControlVariant {
|
|
6
|
+
/**
|
|
7
|
+
* @default "md"
|
|
8
|
+
*/
|
|
9
|
+
size: "sm" | "md"
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
type SwitchControlVariantMap = {
|
|
13
|
+
[key in keyof SwitchControlVariant]: Array<SwitchControlVariant[key]>
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type SwitchControlVariantProps = {
|
|
17
|
+
[key in keyof SwitchControlVariant]?: ConditionalValue<SwitchControlVariant[key]> | undefined
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface SwitchControlRecipe {
|
|
21
|
+
__type: SwitchControlVariantProps
|
|
22
|
+
(props?: SwitchControlVariantProps): Pretty<Record<"root" | "control" | "thumb" | "label", string>>
|
|
23
|
+
raw: (props?: SwitchControlVariantProps) => SwitchControlVariantProps
|
|
24
|
+
variantMap: SwitchControlVariantMap
|
|
25
|
+
variantKeys: Array<keyof SwitchControlVariant>
|
|
26
|
+
splitVariantProps<Props extends SwitchControlVariantProps>(props: Props): [SwitchControlVariantProps, Pretty<DistributiveOmit<Props, keyof SwitchControlVariantProps>>]
|
|
27
|
+
getVariantProps: (props?: SwitchControlVariantProps) => SwitchControlVariantProps
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Material Design 3 switch component
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
*/
|
|
35
|
+
export declare const switchControl: SwitchControlRecipe
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
|
|
2
|
+
import { createRecipe } from './create-recipe.mjs';
|
|
3
|
+
|
|
4
|
+
const switchControlDefaultVariants = {
|
|
5
|
+
"size": "md"
|
|
6
|
+
}
|
|
7
|
+
const switchControlCompoundVariants = []
|
|
8
|
+
|
|
9
|
+
const switchControlSlotNames = [
|
|
10
|
+
[
|
|
11
|
+
"root",
|
|
12
|
+
"switchControl__root"
|
|
13
|
+
],
|
|
14
|
+
[
|
|
15
|
+
"control",
|
|
16
|
+
"switchControl__control"
|
|
17
|
+
],
|
|
18
|
+
[
|
|
19
|
+
"thumb",
|
|
20
|
+
"switchControl__thumb"
|
|
21
|
+
],
|
|
22
|
+
[
|
|
23
|
+
"label",
|
|
24
|
+
"switchControl__label"
|
|
25
|
+
]
|
|
26
|
+
]
|
|
27
|
+
const switchControlSlotFns = /* @__PURE__ */ switchControlSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, switchControlDefaultVariants, getSlotCompoundVariant(switchControlCompoundVariants, slotName))])
|
|
28
|
+
|
|
29
|
+
const switchControlFn = memo((props = {}) => {
|
|
30
|
+
return Object.fromEntries(switchControlSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
const switchControlVariantKeys = [
|
|
34
|
+
"size"
|
|
35
|
+
]
|
|
36
|
+
const getVariantProps = (variants) => ({ ...switchControlDefaultVariants, ...compact(variants) })
|
|
37
|
+
|
|
38
|
+
export const switchControl = /* @__PURE__ */ Object.assign(switchControlFn, {
|
|
39
|
+
__recipe__: false,
|
|
40
|
+
__name__: 'switchControl',
|
|
41
|
+
raw: (props) => props,
|
|
42
|
+
variantKeys: switchControlVariantKeys,
|
|
43
|
+
variantMap: {
|
|
44
|
+
"size": [
|
|
45
|
+
"sm",
|
|
46
|
+
"md"
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
splitVariantProps(props) {
|
|
50
|
+
return splitProps(props, switchControlVariantKeys)
|
|
51
|
+
},
|
|
52
|
+
getVariantProps
|
|
53
|
+
})
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { ConditionalValue } from '../types/index';
|
|
3
|
+
import type { DistributiveOmit, Pretty } from '../types/system-types';
|
|
4
|
+
|
|
5
|
+
interface SwitchVariant {
|
|
6
|
+
/**
|
|
7
|
+
* @default "md"
|
|
8
|
+
*/
|
|
9
|
+
size: "sm" | "md"
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
type SwitchVariantMap = {
|
|
13
|
+
[key in keyof SwitchVariant]: Array<SwitchVariant[key]>
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type SwitchVariantProps = {
|
|
17
|
+
[key in keyof SwitchVariant]?: ConditionalValue<SwitchVariant[key]> | undefined
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface SwitchRecipe {
|
|
21
|
+
__type: SwitchVariantProps
|
|
22
|
+
(props?: SwitchVariantProps): Pretty<Record<"root" | "control" | "thumb" | "label", string>>
|
|
23
|
+
raw: (props?: SwitchVariantProps) => SwitchVariantProps
|
|
24
|
+
variantMap: SwitchVariantMap
|
|
25
|
+
variantKeys: Array<keyof SwitchVariant>
|
|
26
|
+
splitVariantProps<Props extends SwitchVariantProps>(props: Props): [SwitchVariantProps, Pretty<DistributiveOmit<Props, keyof SwitchVariantProps>>]
|
|
27
|
+
getVariantProps: (props?: SwitchVariantProps) => SwitchVariantProps
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Material Design 3 switch component
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
*/
|
|
35
|
+
export declare const switch: SwitchRecipe
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
|
|
2
|
+
import { createRecipe } from './create-recipe.mjs';
|
|
3
|
+
|
|
4
|
+
const switchDefaultVariants = {
|
|
5
|
+
"size": "md"
|
|
6
|
+
}
|
|
7
|
+
const switchCompoundVariants = []
|
|
8
|
+
|
|
9
|
+
const switchSlotNames = [
|
|
10
|
+
[
|
|
11
|
+
"root",
|
|
12
|
+
"switchControl__root"
|
|
13
|
+
],
|
|
14
|
+
[
|
|
15
|
+
"control",
|
|
16
|
+
"switchControl__control"
|
|
17
|
+
],
|
|
18
|
+
[
|
|
19
|
+
"thumb",
|
|
20
|
+
"switchControl__thumb"
|
|
21
|
+
],
|
|
22
|
+
[
|
|
23
|
+
"label",
|
|
24
|
+
"switchControl__label"
|
|
25
|
+
]
|
|
26
|
+
]
|
|
27
|
+
const switchSlotFns = /* @__PURE__ */ switchSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, switchDefaultVariants, getSlotCompoundVariant(switchCompoundVariants, slotName))])
|
|
28
|
+
|
|
29
|
+
const switchFn = memo((props = {}) => {
|
|
30
|
+
return Object.fromEntries(switchSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
const switchVariantKeys = [
|
|
34
|
+
"size"
|
|
35
|
+
]
|
|
36
|
+
const getVariantProps = (variants) => ({ ...switchDefaultVariants, ...compact(variants) })
|
|
37
|
+
|
|
38
|
+
export const switch = /* @__PURE__ */ Object.assign(switchFn, {
|
|
39
|
+
__recipe__: false,
|
|
40
|
+
__name__: 'switch',
|
|
41
|
+
raw: (props) => props,
|
|
42
|
+
variantKeys: switchVariantKeys,
|
|
43
|
+
variantMap: {
|
|
44
|
+
"size": [
|
|
45
|
+
"sm",
|
|
46
|
+
"md"
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
splitVariantProps(props) {
|
|
50
|
+
return splitProps(props, switchVariantKeys)
|
|
51
|
+
},
|
|
52
|
+
getVariantProps
|
|
53
|
+
})
|