@seed-design/css 0.0.1-rc.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/README.md +1 -0
- package/package.json +42 -0
- package/recipes/action-button.d.ts +32 -0
- package/recipes/action-button.mjs +87 -0
- package/recipes/action-chip.d.ts +28 -0
- package/recipes/action-chip.mjs +60 -0
- package/recipes/action-sheet-item.d.ts +24 -0
- package/recipes/action-sheet-item.mjs +38 -0
- package/recipes/action-sheet.d.ts +21 -0
- package/recipes/action-sheet.mjs +59 -0
- package/recipes/app-bar-main.d.ts +36 -0
- package/recipes/app-bar-main.mjs +61 -0
- package/recipes/app-bar.d.ts +36 -0
- package/recipes/app-bar.mjs +68 -0
- package/recipes/app-screen.d.ts +36 -0
- package/recipes/app-screen.mjs +66 -0
- package/recipes/avatar-stack.d.ts +24 -0
- package/recipes/avatar-stack.mjs +45 -0
- package/recipes/avatar.d.ts +24 -0
- package/recipes/avatar.mjs +55 -0
- package/recipes/badge.d.ts +36 -0
- package/recipes/badge.mjs +126 -0
- package/recipes/bottom-sheet.d.ts +21 -0
- package/recipes/bottom-sheet.mjs +63 -0
- package/recipes/callout.d.ts +24 -0
- package/recipes/callout.mjs +61 -0
- package/recipes/checkbox.d.ts +32 -0
- package/recipes/checkbox.mjs +77 -0
- package/recipes/chip-tabs.d.ts +32 -0
- package/recipes/chip-tabs.mjs +68 -0
- package/recipes/className.mjs +25 -0
- package/recipes/control-chip.d.ts +28 -0
- package/recipes/control-chip.mjs +60 -0
- package/recipes/dialog.d.ts +21 -0
- package/recipes/dialog.mjs +59 -0
- package/recipes/extended-action-sheet-item.d.ts +24 -0
- package/recipes/extended-action-sheet-item.mjs +38 -0
- package/recipes/extended-action-sheet.d.ts +21 -0
- package/recipes/extended-action-sheet.mjs +63 -0
- package/recipes/extended-fab.d.ts +28 -0
- package/recipes/extended-fab.mjs +43 -0
- package/recipes/fab.d.ts +21 -0
- package/recipes/fab.mjs +31 -0
- package/recipes/help-bubble.d.ts +21 -0
- package/recipes/help-bubble.mjs +55 -0
- package/recipes/identity-placeholder.d.ts +24 -0
- package/recipes/identity-placeholder.mjs +41 -0
- package/recipes/inline-banner.d.ts +24 -0
- package/recipes/inline-banner.mjs +63 -0
- package/recipes/link-with-icon.d.ts +24 -0
- package/recipes/link-with-icon.mjs +39 -0
- package/recipes/manner-temp-badge.d.ts +24 -0
- package/recipes/manner-temp-badge.mjs +42 -0
- package/recipes/mergeVariants.mjs +9 -0
- package/recipes/progress-circle.d.ts +28 -0
- package/recipes/progress-circle.mjs +54 -0
- package/recipes/pull-to-refresh.d.ts +21 -0
- package/recipes/pull-to-refresh.mjs +35 -0
- package/recipes/radio.d.ts +24 -0
- package/recipes/radio.mjs +42 -0
- package/recipes/reaction-button.d.ts +24 -0
- package/recipes/reaction-button.mjs +38 -0
- package/recipes/segmented-control.d.ts +21 -0
- package/recipes/segmented-control.mjs +39 -0
- package/recipes/select-box-group.d.ts +21 -0
- package/recipes/select-box-group.mjs +31 -0
- package/recipes/select-box.d.ts +21 -0
- package/recipes/select-box.mjs +59 -0
- package/recipes/skeleton.d.ts +24 -0
- package/recipes/skeleton.mjs +40 -0
- package/recipes/snackbar-region.d.ts +21 -0
- package/recipes/snackbar-region.mjs +31 -0
- package/recipes/snackbar.d.ts +24 -0
- package/recipes/snackbar.mjs +51 -0
- package/recipes/splitVariantProps.mjs +12 -0
- package/recipes/switch.d.ts +24 -0
- package/recipes/switch.mjs +50 -0
- package/recipes/tabs.d.ts +36 -0
- package/recipes/tabs.mjs +81 -0
- package/recipes/text-field.d.ts +24 -0
- package/recipes/text-field.mjs +103 -0
- package/recipes/text.d.ts +28 -0
- package/recipes/text.mjs +64 -0
- package/recipes/toggle-button.d.ts +28 -0
- package/recipes/toggle-button.mjs +43 -0
- package/recipes/visually-hidden.d.ts +21 -0
- package/recipes/visually-hidden.mjs +31 -0
- package/seed.css +5017 -0
- package/seed.min.css +1 -0
- package/vars/color/bg.d.ts +37 -0
- package/vars/color/bg.mjs +37 -0
- package/vars/color/fg.d.ts +16 -0
- package/vars/color/fg.mjs +16 -0
- package/vars/color/index.d.ts +5 -0
- package/vars/color/index.mjs +5 -0
- package/vars/color/manner-temp/index.d.ts +6 -0
- package/vars/color/manner-temp/index.mjs +6 -0
- package/vars/color/manner-temp/l1.d.ts +2 -0
- package/vars/color/manner-temp/l1.mjs +2 -0
- package/vars/color/manner-temp/l2.d.ts +2 -0
- package/vars/color/manner-temp/l2.mjs +2 -0
- package/vars/color/manner-temp/l3.d.ts +2 -0
- package/vars/color/manner-temp/l3.mjs +2 -0
- package/vars/color/manner-temp/l4.d.ts +2 -0
- package/vars/color/manner-temp/l4.mjs +2 -0
- package/vars/color/manner-temp/l5.d.ts +2 -0
- package/vars/color/manner-temp/l5.mjs +2 -0
- package/vars/color/manner-temp/l6.d.ts +2 -0
- package/vars/color/manner-temp/l6.mjs +2 -0
- package/vars/color/palette.d.ts +78 -0
- package/vars/color/palette.mjs +78 -0
- package/vars/color/stroke.d.ts +10 -0
- package/vars/color/stroke.mjs +10 -0
- package/vars/component/action-button.d.ts +491 -0
- package/vars/component/action-button.mjs +491 -0
- package/vars/component/action-chip.d.ts +128 -0
- package/vars/component/action-chip.mjs +128 -0
- package/vars/component/action-sheet-close-button.d.ts +23 -0
- package/vars/component/action-sheet-close-button.mjs +23 -0
- package/vars/component/action-sheet-item.d.ts +36 -0
- package/vars/component/action-sheet-item.mjs +36 -0
- package/vars/component/action-sheet.d.ts +45 -0
- package/vars/component/action-sheet.mjs +45 -0
- package/vars/component/avatar-stack.d.ts +60 -0
- package/vars/component/avatar-stack.mjs +60 -0
- package/vars/component/avatar.d.ts +83 -0
- package/vars/component/avatar.mjs +83 -0
- package/vars/component/badge.d.ts +223 -0
- package/vars/component/badge.mjs +223 -0
- package/vars/component/bottom-sheet.d.ts +61 -0
- package/vars/component/bottom-sheet.mjs +61 -0
- package/vars/component/callout.d.ts +173 -0
- package/vars/component/callout.mjs +173 -0
- package/vars/component/checkbox.d.ts +171 -0
- package/vars/component/checkbox.mjs +171 -0
- package/vars/component/chip-tab.d.ts +98 -0
- package/vars/component/chip-tab.mjs +98 -0
- package/vars/component/chip-tablist.d.ts +23 -0
- package/vars/component/chip-tablist.mjs +23 -0
- package/vars/component/control-chip.d.ts +156 -0
- package/vars/component/control-chip.mjs +156 -0
- package/vars/component/dialog.d.ts +49 -0
- package/vars/component/dialog.mjs +49 -0
- package/vars/component/extended-action-sheet-close-button.d.ts +25 -0
- package/vars/component/extended-action-sheet-close-button.mjs +25 -0
- package/vars/component/extended-action-sheet-item.d.ts +46 -0
- package/vars/component/extended-action-sheet-item.mjs +46 -0
- package/vars/component/extended-action-sheet.d.ts +48 -0
- package/vars/component/extended-action-sheet.mjs +48 -0
- package/vars/component/extended-fab.d.ts +82 -0
- package/vars/component/extended-fab.mjs +82 -0
- package/vars/component/fab.d.ts +21 -0
- package/vars/component/fab.mjs +21 -0
- package/vars/component/help-bubble.d.ts +36 -0
- package/vars/component/help-bubble.mjs +36 -0
- package/vars/component/identity-placeholder.d.ts +12 -0
- package/vars/component/identity-placeholder.mjs +12 -0
- package/vars/component/index.d.ts +40 -0
- package/vars/component/index.mjs +40 -0
- package/vars/component/inline-banner.d.ts +191 -0
- package/vars/component/inline-banner.mjs +191 -0
- package/vars/component/link-with-icon.d.ts +46 -0
- package/vars/component/link-with-icon.mjs +46 -0
- package/vars/component/manner-temp-badge.d.ts +77 -0
- package/vars/component/manner-temp-badge.mjs +77 -0
- package/vars/component/progress-circle.d.ts +67 -0
- package/vars/component/progress-circle.mjs +67 -0
- package/vars/component/radio.d.ts +77 -0
- package/vars/component/radio.mjs +77 -0
- package/vars/component/reaction-button.d.ts +134 -0
- package/vars/component/reaction-button.mjs +134 -0
- package/vars/component/segmented-control-item.d.ts +34 -0
- package/vars/component/segmented-control-item.mjs +34 -0
- package/vars/component/segmented-control.d.ts +18 -0
- package/vars/component/segmented-control.mjs +18 -0
- package/vars/component/select-box.d.ts +92 -0
- package/vars/component/select-box.mjs +92 -0
- package/vars/component/skeleton.d.ts +42 -0
- package/vars/component/skeleton.mjs +42 -0
- package/vars/component/snackbar.d.ts +58 -0
- package/vars/component/snackbar.mjs +58 -0
- package/vars/component/switch.d.ts +65 -0
- package/vars/component/switch.mjs +65 -0
- package/vars/component/tab.d.ts +53 -0
- package/vars/component/tab.mjs +53 -0
- package/vars/component/tablist.d.ts +51 -0
- package/vars/component/tablist.mjs +51 -0
- package/vars/component/text-field.d.ts +295 -0
- package/vars/component/text-field.mjs +295 -0
- package/vars/component/toggle-button.d.ts +205 -0
- package/vars/component/toggle-button.mjs +205 -0
- package/vars/component/top-navigation.d.ts +86 -0
- package/vars/component/top-navigation.mjs +86 -0
- package/vars/component/typography.d.ts +200 -0
- package/vars/component/typography.mjs +200 -0
- package/vars/dimension/index.d.ts +22 -0
- package/vars/dimension/index.mjs +22 -0
- package/vars/dimension/spacing-x.d.ts +2 -0
- package/vars/dimension/spacing-x.mjs +2 -0
- package/vars/dimension/spacing-y.d.ts +2 -0
- package/vars/dimension/spacing-y.mjs +2 -0
- package/vars/duration.d.ts +6 -0
- package/vars/duration.mjs +6 -0
- package/vars/font-size.d.ts +13 -0
- package/vars/font-size.mjs +13 -0
- package/vars/font-weight.d.ts +3 -0
- package/vars/font-weight.mjs +3 -0
- package/vars/gradient.d.ts +1 -0
- package/vars/gradient.mjs +1 -0
- package/vars/index.d.ts +32 -0
- package/vars/index.mjs +1 -0
- package/vars/line-height.d.ts +10 -0
- package/vars/line-height.mjs +10 -0
- package/vars/radius.d.ts +11 -0
- package/vars/radius.mjs +11 -0
- package/vars/timing-function.d.ts +6 -0
- package/vars/timing-function.mjs +6 -0
- package/vars/vars.d.ts +9 -0
- package/vars/vars.mjs +9 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { createClassName } from "./className.mjs";
|
|
2
|
+
import { mergeVariants } from "./mergeVariants.mjs";
|
|
3
|
+
import { splitVariantProps } from "./splitVariantProps.mjs";
|
|
4
|
+
|
|
5
|
+
const selectBoxSlotNames = [
|
|
6
|
+
[
|
|
7
|
+
"root",
|
|
8
|
+
"seed-select-box__root"
|
|
9
|
+
],
|
|
10
|
+
[
|
|
11
|
+
"content",
|
|
12
|
+
"seed-select-box__content"
|
|
13
|
+
],
|
|
14
|
+
[
|
|
15
|
+
"label",
|
|
16
|
+
"seed-select-box__label"
|
|
17
|
+
],
|
|
18
|
+
[
|
|
19
|
+
"description",
|
|
20
|
+
"seed-select-box__description"
|
|
21
|
+
],
|
|
22
|
+
[
|
|
23
|
+
"checkboxControl",
|
|
24
|
+
"seed-select-box__checkboxControl"
|
|
25
|
+
],
|
|
26
|
+
[
|
|
27
|
+
"checkboxIcon",
|
|
28
|
+
"seed-select-box__checkboxIcon"
|
|
29
|
+
],
|
|
30
|
+
[
|
|
31
|
+
"radioControl",
|
|
32
|
+
"seed-select-box__radioControl"
|
|
33
|
+
],
|
|
34
|
+
[
|
|
35
|
+
"radioIcon",
|
|
36
|
+
"seed-select-box__radioIcon"
|
|
37
|
+
]
|
|
38
|
+
];
|
|
39
|
+
|
|
40
|
+
const defaultVariant = {};
|
|
41
|
+
|
|
42
|
+
const compoundVariants = [];
|
|
43
|
+
|
|
44
|
+
export const selectBoxVariantMap = {};
|
|
45
|
+
|
|
46
|
+
export const selectBoxVariantKeys = Object.keys(selectBoxVariantMap);
|
|
47
|
+
|
|
48
|
+
export function selectBox(props) {
|
|
49
|
+
return Object.fromEntries(
|
|
50
|
+
selectBoxSlotNames.map(([slot, className]) => {
|
|
51
|
+
return [
|
|
52
|
+
slot,
|
|
53
|
+
createClassName(className, mergeVariants(defaultVariant, props), compoundVariants),
|
|
54
|
+
];
|
|
55
|
+
}),
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
Object.assign(selectBox, { splitVariantProps: (props) => splitVariantProps(props, selectBoxVariantMap) });
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare interface SkeletonVariant {
|
|
2
|
+
/**
|
|
3
|
+
* @default 8
|
|
4
|
+
*/
|
|
5
|
+
radius: "0" | "8" | "16" | "full";
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
declare type SkeletonVariantMap = {
|
|
9
|
+
[key in keyof SkeletonVariant]: Array<SkeletonVariant[key]>;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export declare type SkeletonVariantProps = Partial<SkeletonVariant>;
|
|
13
|
+
|
|
14
|
+
export declare type SkeletonSlotName = "root";
|
|
15
|
+
|
|
16
|
+
export declare const skeletonVariantMap: SkeletonVariantMap;
|
|
17
|
+
|
|
18
|
+
export declare const skeleton: ((
|
|
19
|
+
props?: SkeletonVariantProps,
|
|
20
|
+
) => Record<SkeletonSlotName, string>) & {
|
|
21
|
+
splitVariantProps: <T extends SkeletonVariantProps>(
|
|
22
|
+
props: T,
|
|
23
|
+
) => [SkeletonVariantProps, Omit<T, keyof SkeletonVariantProps>];
|
|
24
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { createClassName } from "./className.mjs";
|
|
2
|
+
import { mergeVariants } from "./mergeVariants.mjs";
|
|
3
|
+
import { splitVariantProps } from "./splitVariantProps.mjs";
|
|
4
|
+
|
|
5
|
+
const skeletonSlotNames = [
|
|
6
|
+
[
|
|
7
|
+
"root",
|
|
8
|
+
"seed-skeleton__root"
|
|
9
|
+
]
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
const defaultVariant = {
|
|
13
|
+
"radius": 8
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const compoundVariants = [];
|
|
17
|
+
|
|
18
|
+
export const skeletonVariantMap = {
|
|
19
|
+
"radius": [
|
|
20
|
+
"0",
|
|
21
|
+
"8",
|
|
22
|
+
"16",
|
|
23
|
+
"full"
|
|
24
|
+
]
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const skeletonVariantKeys = Object.keys(skeletonVariantMap);
|
|
28
|
+
|
|
29
|
+
export function skeleton(props) {
|
|
30
|
+
return Object.fromEntries(
|
|
31
|
+
skeletonSlotNames.map(([slot, className]) => {
|
|
32
|
+
return [
|
|
33
|
+
slot,
|
|
34
|
+
createClassName(className, mergeVariants(defaultVariant, props), compoundVariants),
|
|
35
|
+
];
|
|
36
|
+
}),
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
Object.assign(skeleton, { splitVariantProps: (props) => splitVariantProps(props, skeletonVariantMap) });
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare interface SnackbarRegionVariant {
|
|
2
|
+
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
declare type SnackbarRegionVariantMap = {
|
|
6
|
+
[key in keyof SnackbarRegionVariant]: Array<SnackbarRegionVariant[key]>;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export declare type SnackbarRegionVariantProps = Partial<SnackbarRegionVariant>;
|
|
10
|
+
|
|
11
|
+
export declare type SnackbarRegionSlotName = "root";
|
|
12
|
+
|
|
13
|
+
export declare const snackbarRegionVariantMap: SnackbarRegionVariantMap;
|
|
14
|
+
|
|
15
|
+
export declare const snackbarRegion: ((
|
|
16
|
+
props?: SnackbarRegionVariantProps,
|
|
17
|
+
) => Record<SnackbarRegionSlotName, string>) & {
|
|
18
|
+
splitVariantProps: <T extends SnackbarRegionVariantProps>(
|
|
19
|
+
props: T,
|
|
20
|
+
) => [SnackbarRegionVariantProps, Omit<T, keyof SnackbarRegionVariantProps>];
|
|
21
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { createClassName } from "./className.mjs";
|
|
2
|
+
import { mergeVariants } from "./mergeVariants.mjs";
|
|
3
|
+
import { splitVariantProps } from "./splitVariantProps.mjs";
|
|
4
|
+
|
|
5
|
+
const snackbarRegionSlotNames = [
|
|
6
|
+
[
|
|
7
|
+
"root",
|
|
8
|
+
"seed-snackbar-region__root"
|
|
9
|
+
]
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
const defaultVariant = {};
|
|
13
|
+
|
|
14
|
+
const compoundVariants = [];
|
|
15
|
+
|
|
16
|
+
export const snackbarRegionVariantMap = {};
|
|
17
|
+
|
|
18
|
+
export const snackbarRegionVariantKeys = Object.keys(snackbarRegionVariantMap);
|
|
19
|
+
|
|
20
|
+
export function snackbarRegion(props) {
|
|
21
|
+
return Object.fromEntries(
|
|
22
|
+
snackbarRegionSlotNames.map(([slot, className]) => {
|
|
23
|
+
return [
|
|
24
|
+
slot,
|
|
25
|
+
createClassName(className, mergeVariants(defaultVariant, props), compoundVariants),
|
|
26
|
+
];
|
|
27
|
+
}),
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
Object.assign(snackbarRegion, { splitVariantProps: (props) => splitVariantProps(props, snackbarRegionVariantMap) });
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare interface SnackbarVariant {
|
|
2
|
+
/**
|
|
3
|
+
* @default default
|
|
4
|
+
*/
|
|
5
|
+
variant: "default" | "positive" | "critical";
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
declare type SnackbarVariantMap = {
|
|
9
|
+
[key in keyof SnackbarVariant]: Array<SnackbarVariant[key]>;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export declare type SnackbarVariantProps = Partial<SnackbarVariant>;
|
|
13
|
+
|
|
14
|
+
export declare type SnackbarSlotName = "root" | "message" | "prefixIcon" | "actionButton";
|
|
15
|
+
|
|
16
|
+
export declare const snackbarVariantMap: SnackbarVariantMap;
|
|
17
|
+
|
|
18
|
+
export declare const snackbar: ((
|
|
19
|
+
props?: SnackbarVariantProps,
|
|
20
|
+
) => Record<SnackbarSlotName, string>) & {
|
|
21
|
+
splitVariantProps: <T extends SnackbarVariantProps>(
|
|
22
|
+
props: T,
|
|
23
|
+
) => [SnackbarVariantProps, Omit<T, keyof SnackbarVariantProps>];
|
|
24
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { createClassName } from "./className.mjs";
|
|
2
|
+
import { mergeVariants } from "./mergeVariants.mjs";
|
|
3
|
+
import { splitVariantProps } from "./splitVariantProps.mjs";
|
|
4
|
+
|
|
5
|
+
const snackbarSlotNames = [
|
|
6
|
+
[
|
|
7
|
+
"root",
|
|
8
|
+
"seed-snackbar__root"
|
|
9
|
+
],
|
|
10
|
+
[
|
|
11
|
+
"message",
|
|
12
|
+
"seed-snackbar__message"
|
|
13
|
+
],
|
|
14
|
+
[
|
|
15
|
+
"prefixIcon",
|
|
16
|
+
"seed-snackbar__prefixIcon"
|
|
17
|
+
],
|
|
18
|
+
[
|
|
19
|
+
"actionButton",
|
|
20
|
+
"seed-snackbar__actionButton"
|
|
21
|
+
]
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
const defaultVariant = {
|
|
25
|
+
"variant": "default"
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const compoundVariants = [];
|
|
29
|
+
|
|
30
|
+
export const snackbarVariantMap = {
|
|
31
|
+
"variant": [
|
|
32
|
+
"default",
|
|
33
|
+
"positive",
|
|
34
|
+
"critical"
|
|
35
|
+
]
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const snackbarVariantKeys = Object.keys(snackbarVariantMap);
|
|
39
|
+
|
|
40
|
+
export function snackbar(props) {
|
|
41
|
+
return Object.fromEntries(
|
|
42
|
+
snackbarSlotNames.map(([slot, className]) => {
|
|
43
|
+
return [
|
|
44
|
+
slot,
|
|
45
|
+
createClassName(className, mergeVariants(defaultVariant, props), compoundVariants),
|
|
46
|
+
];
|
|
47
|
+
}),
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
Object.assign(snackbar, { splitVariantProps: (props) => splitVariantProps(props, snackbarVariantMap) });
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export function splitVariantProps(props, variantMap) {
|
|
2
|
+
const variantProps = {};
|
|
3
|
+
const otherProps = {};
|
|
4
|
+
for (const key in props) {
|
|
5
|
+
if (variantMap[key] != null) {
|
|
6
|
+
variantProps[key] = props[key];
|
|
7
|
+
} else {
|
|
8
|
+
otherProps[key] = props[key];
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return [variantProps, otherProps];
|
|
12
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare interface SwitchVariant {
|
|
2
|
+
/**
|
|
3
|
+
* @default medium
|
|
4
|
+
*/
|
|
5
|
+
size: "medium" | "small";
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
declare type SwitchVariantMap = {
|
|
9
|
+
[key in keyof SwitchVariant]: Array<SwitchVariant[key]>;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export declare type SwitchVariantProps = Partial<SwitchVariant>;
|
|
13
|
+
|
|
14
|
+
export declare type SwitchSlotName = "root" | "control" | "thumb" | "label";
|
|
15
|
+
|
|
16
|
+
export declare const switchVariantMap: SwitchVariantMap;
|
|
17
|
+
|
|
18
|
+
export declare const switchStyle: ((
|
|
19
|
+
props?: SwitchVariantProps,
|
|
20
|
+
) => Record<SwitchSlotName, string>) & {
|
|
21
|
+
splitVariantProps: <T extends SwitchVariantProps>(
|
|
22
|
+
props: T,
|
|
23
|
+
) => [SwitchVariantProps, Omit<T, keyof SwitchVariantProps>];
|
|
24
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { createClassName } from "./className.mjs";
|
|
2
|
+
import { mergeVariants } from "./mergeVariants.mjs";
|
|
3
|
+
import { splitVariantProps } from "./splitVariantProps.mjs";
|
|
4
|
+
|
|
5
|
+
const switchSlotNames = [
|
|
6
|
+
[
|
|
7
|
+
"root",
|
|
8
|
+
"seed-switch__root"
|
|
9
|
+
],
|
|
10
|
+
[
|
|
11
|
+
"control",
|
|
12
|
+
"seed-switch__control"
|
|
13
|
+
],
|
|
14
|
+
[
|
|
15
|
+
"thumb",
|
|
16
|
+
"seed-switch__thumb"
|
|
17
|
+
],
|
|
18
|
+
[
|
|
19
|
+
"label",
|
|
20
|
+
"seed-switch__label"
|
|
21
|
+
]
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
const defaultVariant = {
|
|
25
|
+
"size": "medium"
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const compoundVariants = [];
|
|
29
|
+
|
|
30
|
+
export const switchVariantMap = {
|
|
31
|
+
"size": [
|
|
32
|
+
"medium",
|
|
33
|
+
"small"
|
|
34
|
+
]
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const switchVariantKeys = Object.keys(switchVariantMap);
|
|
38
|
+
|
|
39
|
+
export function switchStyle(props) {
|
|
40
|
+
return Object.fromEntries(
|
|
41
|
+
switchSlotNames.map(([slot, className]) => {
|
|
42
|
+
return [
|
|
43
|
+
slot,
|
|
44
|
+
createClassName(className, mergeVariants(defaultVariant, props), compoundVariants),
|
|
45
|
+
];
|
|
46
|
+
}),
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
Object.assign(switchStyle, { splitVariantProps: (props) => splitVariantProps(props, switchVariantMap) });
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
declare interface TabsVariant {
|
|
2
|
+
/**
|
|
3
|
+
* @default fill
|
|
4
|
+
*/
|
|
5
|
+
triggerLayout: "fill" | "hug";
|
|
6
|
+
/**
|
|
7
|
+
* @default hug
|
|
8
|
+
*/
|
|
9
|
+
contentLayout: "fill" | "hug";
|
|
10
|
+
/**
|
|
11
|
+
* @default small
|
|
12
|
+
*/
|
|
13
|
+
size: "small" | "medium";
|
|
14
|
+
/**
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
17
|
+
stickyList: boolean;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
declare type TabsVariantMap = {
|
|
21
|
+
[key in keyof TabsVariant]: Array<TabsVariant[key]>;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export declare type TabsVariantProps = Partial<TabsVariant>;
|
|
25
|
+
|
|
26
|
+
export declare type TabsSlotName = "root" | "list" | "carousel" | "carouselCamera" | "content" | "indicator" | "trigger" | "triggerNotification";
|
|
27
|
+
|
|
28
|
+
export declare const tabsVariantMap: TabsVariantMap;
|
|
29
|
+
|
|
30
|
+
export declare const tabs: ((
|
|
31
|
+
props?: TabsVariantProps,
|
|
32
|
+
) => Record<TabsSlotName, string>) & {
|
|
33
|
+
splitVariantProps: <T extends TabsVariantProps>(
|
|
34
|
+
props: T,
|
|
35
|
+
) => [TabsVariantProps, Omit<T, keyof TabsVariantProps>];
|
|
36
|
+
}
|
package/recipes/tabs.mjs
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { createClassName } from "./className.mjs";
|
|
2
|
+
import { mergeVariants } from "./mergeVariants.mjs";
|
|
3
|
+
import { splitVariantProps } from "./splitVariantProps.mjs";
|
|
4
|
+
|
|
5
|
+
const tabsSlotNames = [
|
|
6
|
+
[
|
|
7
|
+
"root",
|
|
8
|
+
"seed-tabs__root"
|
|
9
|
+
],
|
|
10
|
+
[
|
|
11
|
+
"list",
|
|
12
|
+
"seed-tabs__list"
|
|
13
|
+
],
|
|
14
|
+
[
|
|
15
|
+
"carousel",
|
|
16
|
+
"seed-tabs__carousel"
|
|
17
|
+
],
|
|
18
|
+
[
|
|
19
|
+
"carouselCamera",
|
|
20
|
+
"seed-tabs__carouselCamera"
|
|
21
|
+
],
|
|
22
|
+
[
|
|
23
|
+
"content",
|
|
24
|
+
"seed-tabs__content"
|
|
25
|
+
],
|
|
26
|
+
[
|
|
27
|
+
"indicator",
|
|
28
|
+
"seed-tabs__indicator"
|
|
29
|
+
],
|
|
30
|
+
[
|
|
31
|
+
"trigger",
|
|
32
|
+
"seed-tabs__trigger"
|
|
33
|
+
],
|
|
34
|
+
[
|
|
35
|
+
"triggerNotification",
|
|
36
|
+
"seed-tabs__triggerNotification"
|
|
37
|
+
]
|
|
38
|
+
];
|
|
39
|
+
|
|
40
|
+
const defaultVariant = {
|
|
41
|
+
"triggerLayout": "fill",
|
|
42
|
+
"contentLayout": "hug",
|
|
43
|
+
"size": "small",
|
|
44
|
+
"stickyList": false
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const compoundVariants = [];
|
|
48
|
+
|
|
49
|
+
export const tabsVariantMap = {
|
|
50
|
+
"triggerLayout": [
|
|
51
|
+
"fill",
|
|
52
|
+
"hug"
|
|
53
|
+
],
|
|
54
|
+
"contentLayout": [
|
|
55
|
+
"fill",
|
|
56
|
+
"hug"
|
|
57
|
+
],
|
|
58
|
+
"size": [
|
|
59
|
+
"small",
|
|
60
|
+
"medium"
|
|
61
|
+
],
|
|
62
|
+
"stickyList": [
|
|
63
|
+
true,
|
|
64
|
+
false
|
|
65
|
+
]
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export const tabsVariantKeys = Object.keys(tabsVariantMap);
|
|
69
|
+
|
|
70
|
+
export function tabs(props) {
|
|
71
|
+
return Object.fromEntries(
|
|
72
|
+
tabsSlotNames.map(([slot, className]) => {
|
|
73
|
+
return [
|
|
74
|
+
slot,
|
|
75
|
+
createClassName(className, mergeVariants(defaultVariant, props), compoundVariants),
|
|
76
|
+
];
|
|
77
|
+
}),
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
Object.assign(tabs, { splitVariantProps: (props) => splitVariantProps(props, tabsVariantMap) });
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare interface TextFieldVariant {
|
|
2
|
+
/**
|
|
3
|
+
* @default medium
|
|
4
|
+
*/
|
|
5
|
+
size: "xlarge" | "large" | "medium";
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
declare type TextFieldVariantMap = {
|
|
9
|
+
[key in keyof TextFieldVariant]: Array<TextFieldVariant[key]>;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export declare type TextFieldVariantProps = Partial<TextFieldVariant>;
|
|
13
|
+
|
|
14
|
+
export declare type TextFieldSlotName = "root" | "header" | "label" | "indicator" | "field" | "value" | "prefixText" | "prefixIcon" | "suffixText" | "suffixIcon" | "footer" | "description" | "errorMessage" | "errorIcon" | "characterCountArea" | "characterCount" | "maxCharacterCount";
|
|
15
|
+
|
|
16
|
+
export declare const textFieldVariantMap: TextFieldVariantMap;
|
|
17
|
+
|
|
18
|
+
export declare const textField: ((
|
|
19
|
+
props?: TextFieldVariantProps,
|
|
20
|
+
) => Record<TextFieldSlotName, string>) & {
|
|
21
|
+
splitVariantProps: <T extends TextFieldVariantProps>(
|
|
22
|
+
props: T,
|
|
23
|
+
) => [TextFieldVariantProps, Omit<T, keyof TextFieldVariantProps>];
|
|
24
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { createClassName } from "./className.mjs";
|
|
2
|
+
import { mergeVariants } from "./mergeVariants.mjs";
|
|
3
|
+
import { splitVariantProps } from "./splitVariantProps.mjs";
|
|
4
|
+
|
|
5
|
+
const textFieldSlotNames = [
|
|
6
|
+
[
|
|
7
|
+
"root",
|
|
8
|
+
"seed-text-field__root"
|
|
9
|
+
],
|
|
10
|
+
[
|
|
11
|
+
"header",
|
|
12
|
+
"seed-text-field__header"
|
|
13
|
+
],
|
|
14
|
+
[
|
|
15
|
+
"label",
|
|
16
|
+
"seed-text-field__label"
|
|
17
|
+
],
|
|
18
|
+
[
|
|
19
|
+
"indicator",
|
|
20
|
+
"seed-text-field__indicator"
|
|
21
|
+
],
|
|
22
|
+
[
|
|
23
|
+
"field",
|
|
24
|
+
"seed-text-field__field"
|
|
25
|
+
],
|
|
26
|
+
[
|
|
27
|
+
"value",
|
|
28
|
+
"seed-text-field__value"
|
|
29
|
+
],
|
|
30
|
+
[
|
|
31
|
+
"prefixText",
|
|
32
|
+
"seed-text-field__prefixText"
|
|
33
|
+
],
|
|
34
|
+
[
|
|
35
|
+
"prefixIcon",
|
|
36
|
+
"seed-text-field__prefixIcon"
|
|
37
|
+
],
|
|
38
|
+
[
|
|
39
|
+
"suffixText",
|
|
40
|
+
"seed-text-field__suffixText"
|
|
41
|
+
],
|
|
42
|
+
[
|
|
43
|
+
"suffixIcon",
|
|
44
|
+
"seed-text-field__suffixIcon"
|
|
45
|
+
],
|
|
46
|
+
[
|
|
47
|
+
"footer",
|
|
48
|
+
"seed-text-field__footer"
|
|
49
|
+
],
|
|
50
|
+
[
|
|
51
|
+
"description",
|
|
52
|
+
"seed-text-field__description"
|
|
53
|
+
],
|
|
54
|
+
[
|
|
55
|
+
"errorMessage",
|
|
56
|
+
"seed-text-field__errorMessage"
|
|
57
|
+
],
|
|
58
|
+
[
|
|
59
|
+
"errorIcon",
|
|
60
|
+
"seed-text-field__errorIcon"
|
|
61
|
+
],
|
|
62
|
+
[
|
|
63
|
+
"characterCountArea",
|
|
64
|
+
"seed-text-field__characterCountArea"
|
|
65
|
+
],
|
|
66
|
+
[
|
|
67
|
+
"characterCount",
|
|
68
|
+
"seed-text-field__characterCount"
|
|
69
|
+
],
|
|
70
|
+
[
|
|
71
|
+
"maxCharacterCount",
|
|
72
|
+
"seed-text-field__maxCharacterCount"
|
|
73
|
+
]
|
|
74
|
+
];
|
|
75
|
+
|
|
76
|
+
const defaultVariant = {
|
|
77
|
+
"size": "medium"
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
const compoundVariants = [];
|
|
81
|
+
|
|
82
|
+
export const textFieldVariantMap = {
|
|
83
|
+
"size": [
|
|
84
|
+
"xlarge",
|
|
85
|
+
"large",
|
|
86
|
+
"medium"
|
|
87
|
+
]
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export const textFieldVariantKeys = Object.keys(textFieldVariantMap);
|
|
91
|
+
|
|
92
|
+
export function textField(props) {
|
|
93
|
+
return Object.fromEntries(
|
|
94
|
+
textFieldSlotNames.map(([slot, className]) => {
|
|
95
|
+
return [
|
|
96
|
+
slot,
|
|
97
|
+
createClassName(className, mergeVariants(defaultVariant, props), compoundVariants),
|
|
98
|
+
];
|
|
99
|
+
}),
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
Object.assign(textField, { splitVariantProps: (props) => splitVariantProps(props, textFieldVariantMap) });
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
declare interface TextVariant {
|
|
2
|
+
/**
|
|
3
|
+
* @default t5Regular
|
|
4
|
+
*/
|
|
5
|
+
textStyle: "screenTitle" | "articleBody" | "t1Regular" | "t1Medium" | "t1Bold" | "t2Regular" | "t2Medium" | "t2Bold" | "t3Regular" | "t3Medium" | "t3Bold" | "t4Regular" | "t4Medium" | "t4Bold" | "t5Regular" | "t5Medium" | "t5Bold" | "t6Bold" | "t7Bold" | "t8Bold" | "t9Bold" | "t10Bold";
|
|
6
|
+
/**
|
|
7
|
+
* @default none
|
|
8
|
+
*/
|
|
9
|
+
maxLines: "none" | "single" | "multi";
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
declare type TextVariantMap = {
|
|
13
|
+
[key in keyof TextVariant]: Array<TextVariant[key]>;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export declare type TextVariantProps = Partial<TextVariant>;
|
|
17
|
+
|
|
18
|
+
export declare type TextSlotName = "root";
|
|
19
|
+
|
|
20
|
+
export declare const textVariantMap: TextVariantMap;
|
|
21
|
+
|
|
22
|
+
export declare const text: ((
|
|
23
|
+
props?: TextVariantProps,
|
|
24
|
+
) => Record<TextSlotName, string>) & {
|
|
25
|
+
splitVariantProps: <T extends TextVariantProps>(
|
|
26
|
+
props: T,
|
|
27
|
+
) => [TextVariantProps, Omit<T, keyof TextVariantProps>];
|
|
28
|
+
}
|
package/recipes/text.mjs
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { createClassName } from "./className.mjs";
|
|
2
|
+
import { mergeVariants } from "./mergeVariants.mjs";
|
|
3
|
+
import { splitVariantProps } from "./splitVariantProps.mjs";
|
|
4
|
+
|
|
5
|
+
const textSlotNames = [
|
|
6
|
+
[
|
|
7
|
+
"root",
|
|
8
|
+
"seed-text__root"
|
|
9
|
+
]
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
const defaultVariant = {
|
|
13
|
+
"textStyle": "t5Regular",
|
|
14
|
+
"maxLines": "none"
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const compoundVariants = [];
|
|
18
|
+
|
|
19
|
+
export const textVariantMap = {
|
|
20
|
+
"textStyle": [
|
|
21
|
+
"screenTitle",
|
|
22
|
+
"articleBody",
|
|
23
|
+
"t1Regular",
|
|
24
|
+
"t1Medium",
|
|
25
|
+
"t1Bold",
|
|
26
|
+
"t2Regular",
|
|
27
|
+
"t2Medium",
|
|
28
|
+
"t2Bold",
|
|
29
|
+
"t3Regular",
|
|
30
|
+
"t3Medium",
|
|
31
|
+
"t3Bold",
|
|
32
|
+
"t4Regular",
|
|
33
|
+
"t4Medium",
|
|
34
|
+
"t4Bold",
|
|
35
|
+
"t5Regular",
|
|
36
|
+
"t5Medium",
|
|
37
|
+
"t5Bold",
|
|
38
|
+
"t6Bold",
|
|
39
|
+
"t7Bold",
|
|
40
|
+
"t8Bold",
|
|
41
|
+
"t9Bold",
|
|
42
|
+
"t10Bold"
|
|
43
|
+
],
|
|
44
|
+
"maxLines": [
|
|
45
|
+
"none",
|
|
46
|
+
"single",
|
|
47
|
+
"multi"
|
|
48
|
+
]
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const textVariantKeys = Object.keys(textVariantMap);
|
|
52
|
+
|
|
53
|
+
export function text(props) {
|
|
54
|
+
return Object.fromEntries(
|
|
55
|
+
textSlotNames.map(([slot, className]) => {
|
|
56
|
+
return [
|
|
57
|
+
slot,
|
|
58
|
+
createClassName(className, mergeVariants(defaultVariant, props), compoundVariants),
|
|
59
|
+
];
|
|
60
|
+
}),
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
Object.assign(text, { splitVariantProps: (props) => splitVariantProps(props, textVariantMap) });
|