@seed-design/lynx-css 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/all.css +1730 -0
- package/all.min.css +1 -0
- package/base.css +625 -0
- package/base.min.css +1 -0
- package/package.json +60 -0
- package/recipes/action-button.css +489 -0
- package/recipes/action-button.d.ts +44 -0
- package/recipes/action-button.mjs +212 -0
- package/recipes/bottom-sheet-handle.css +18 -0
- package/recipes/bottom-sheet-handle.d.ts +21 -0
- package/recipes/bottom-sheet-handle.mjs +36 -0
- package/recipes/bottom-sheet.css +91 -0
- package/recipes/bottom-sheet.d.ts +28 -0
- package/recipes/bottom-sheet.mjs +76 -0
- package/recipes/checkbox-group.css +5 -0
- package/recipes/checkbox-group.d.ts +21 -0
- package/recipes/checkbox-group.mjs +36 -0
- package/recipes/checkbox.css +34 -0
- package/recipes/checkbox.d.ts +32 -0
- package/recipes/checkbox.mjs +53 -0
- package/recipes/checkmark.css +131 -0
- package/recipes/checkmark.d.ts +48 -0
- package/recipes/checkmark.mjs +220 -0
- package/recipes/progress-circle.css +80 -0
- package/recipes/progress-circle.d.ts +30 -0
- package/recipes/progress-circle.mjs +40 -0
- package/recipes/radio-group.css +5 -0
- package/recipes/radio-group.d.ts +21 -0
- package/recipes/radio-group.mjs +36 -0
- package/recipes/radio.css +34 -0
- package/recipes/radio.d.ts +32 -0
- package/recipes/radio.mjs +53 -0
- package/recipes/radiomark.css +94 -0
- package/recipes/radiomark.d.ts +40 -0
- package/recipes/radiomark.mjs +121 -0
- package/recipes/shared.mjs +48 -0
- package/recipes/switch.css +40 -0
- package/recipes/switch.d.ts +28 -0
- package/recipes/switch.mjs +49 -0
- package/recipes/switchmark.css +75 -0
- package/recipes/switchmark.d.ts +36 -0
- package/recipes/switchmark.mjs +90 -0
- package/recipes/tag-group-item.css +34 -0
- package/recipes/tag-group-item.d.ts +32 -0
- package/recipes/tag-group-item.mjs +55 -0
- package/recipes/tag-group.css +32 -0
- package/recipes/tag-group.d.ts +24 -0
- package/recipes/tag-group.mjs +48 -0
- package/vars/color/banner.d.ts +10 -0
- package/vars/color/banner.mjs +10 -0
- package/vars/color/bg.d.ts +76 -0
- package/vars/color/bg.mjs +41 -0
- package/vars/color/fg.d.ts +30 -0
- package/vars/color/fg.mjs +16 -0
- package/vars/color/index.d.ts +6 -0
- package/vars/color/index.mjs +6 -0
- package/vars/color/manner-temp/index.d.ts +10 -0
- package/vars/color/manner-temp/index.mjs +10 -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/l10.d.ts +2 -0
- package/vars/color/manner-temp/l10.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/manner-temp/l7.d.ts +2 -0
- package/vars/color/manner-temp/l7.mjs +2 -0
- package/vars/color/manner-temp/l8.d.ts +2 -0
- package/vars/color/manner-temp/l8.mjs +2 -0
- package/vars/color/manner-temp/l9.d.ts +2 -0
- package/vars/color/manner-temp/l9.mjs +2 -0
- package/vars/color/palette.d.ts +94 -0
- package/vars/color/palette.mjs +94 -0
- package/vars/color/stroke.d.ts +31 -0
- package/vars/color/stroke.mjs +16 -0
- package/vars/component/action-button.d.ts +660 -0
- package/vars/component/action-button.mjs +541 -0
- package/vars/component/action-chip.d.ts +132 -0
- package/vars/component/action-chip.mjs +132 -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 +46 -0
- package/vars/component/action-sheet.mjs +46 -0
- package/vars/component/avatar-stack.d.ts +110 -0
- package/vars/component/avatar-stack.mjs +110 -0
- package/vars/component/avatar.d.ts +204 -0
- package/vars/component/avatar.mjs +162 -0
- package/vars/component/badge.d.ts +316 -0
- package/vars/component/badge.mjs +236 -0
- package/vars/component/bottom-sheet-close-button.d.ts +21 -0
- package/vars/component/bottom-sheet-close-button.mjs +21 -0
- package/vars/component/bottom-sheet-handle.d.ts +24 -0
- package/vars/component/bottom-sheet-handle.mjs +24 -0
- package/vars/component/bottom-sheet.d.ts +86 -0
- package/vars/component/bottom-sheet.mjs +86 -0
- package/vars/component/callout.d.ts +229 -0
- package/vars/component/callout.mjs +197 -0
- package/vars/component/checkbox-group.d.ts +9 -0
- package/vars/component/checkbox-group.mjs +9 -0
- package/vars/component/checkbox.d.ts +53 -0
- package/vars/component/checkbox.mjs +53 -0
- package/vars/component/checkmark.d.ts +195 -0
- package/vars/component/checkmark.mjs +165 -0
- package/vars/component/chip-tab.d.ts +162 -0
- package/vars/component/chip-tab.mjs +162 -0
- package/vars/component/chip-tablist.d.ts +31 -0
- package/vars/component/chip-tablist.mjs +31 -0
- package/vars/component/chip.d.ts +321 -0
- package/vars/component/chip.mjs +303 -0
- package/vars/component/content-placeholder.d.ts +28 -0
- package/vars/component/content-placeholder.mjs +27 -0
- package/vars/component/contextual-floating-button.d.ts +144 -0
- package/vars/component/contextual-floating-button.mjs +132 -0
- package/vars/component/control-chip.d.ts +158 -0
- package/vars/component/control-chip.mjs +158 -0
- package/vars/component/dialog.d.ts +52 -0
- package/vars/component/dialog.mjs +52 -0
- package/vars/component/divider.d.ts +9 -0
- package/vars/component/divider.mjs +9 -0
- package/vars/component/extended-action-sheet-close-button.d.ts +24 -0
- package/vars/component/extended-action-sheet-close-button.mjs +24 -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 +55 -0
- package/vars/component/extended-action-sheet.mjs +55 -0
- package/vars/component/extended-fab.d.ts +88 -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/field-label.d.ts +25 -0
- package/vars/component/field-label.mjs +25 -0
- package/vars/component/field.d.ts +78 -0
- package/vars/component/field.mjs +72 -0
- package/vars/component/floating-action-button.d.ts +60 -0
- package/vars/component/floating-action-button.mjs +54 -0
- package/vars/component/help-bubble.d.ts +52 -0
- package/vars/component/help-bubble.mjs +50 -0
- package/vars/component/identity-placeholder.d.ts +12 -0
- package/vars/component/identity-placeholder.mjs +12 -0
- package/vars/component/image-frame-floater.d.ts +10 -0
- package/vars/component/image-frame-floater.mjs +9 -0
- package/vars/component/image-frame-indicator.d.ts +20 -0
- package/vars/component/image-frame-indicator.mjs +18 -0
- package/vars/component/image-frame-reaction-button.d.ts +35 -0
- package/vars/component/image-frame-reaction-button.mjs +26 -0
- package/vars/component/image-frame.d.ts +48 -0
- package/vars/component/image-frame.mjs +26 -0
- package/vars/component/index.d.ts +79 -0
- package/vars/component/index.mjs +79 -0
- package/vars/component/inline-banner.d.ts +191 -0
- package/vars/component/inline-banner.mjs +191 -0
- package/vars/component/input-button.d.ts +89 -0
- package/vars/component/input-button.mjs +88 -0
- package/vars/component/link-content.d.ts +58 -0
- package/vars/component/link-content.mjs +58 -0
- package/vars/component/list-header.d.ts +29 -0
- package/vars/component/list-header.mjs +29 -0
- package/vars/component/list-item.d.ts +89 -0
- package/vars/component/list-item.mjs +87 -0
- package/vars/component/manner-temp-badge.d.ts +117 -0
- package/vars/component/manner-temp-badge.mjs +117 -0
- package/vars/component/manner-temp.d.ts +88 -0
- package/vars/component/manner-temp.mjs +88 -0
- package/vars/component/menu-sheet-close-button.d.ts +24 -0
- package/vars/component/menu-sheet-close-button.mjs +24 -0
- package/vars/component/menu-sheet-item.d.ts +73 -0
- package/vars/component/menu-sheet-item.mjs +61 -0
- package/vars/component/menu-sheet.d.ts +56 -0
- package/vars/component/menu-sheet.mjs +56 -0
- package/vars/component/notification-badge.d.ts +48 -0
- package/vars/component/notification-badge.mjs +42 -0
- package/vars/component/page-banner.d.ts +382 -0
- package/vars/component/page-banner.mjs +336 -0
- package/vars/component/progress-circle.d.ts +88 -0
- package/vars/component/progress-circle.mjs +67 -0
- package/vars/component/radio-group.d.ts +9 -0
- package/vars/component/radio-group.mjs +9 -0
- package/vars/component/radio.d.ts +53 -0
- package/vars/component/radio.mjs +53 -0
- package/vars/component/radiomark.d.ts +117 -0
- package/vars/component/radiomark.mjs +117 -0
- package/vars/component/reaction-button.d.ts +136 -0
- package/vars/component/reaction-button.mjs +136 -0
- package/vars/component/scroll-fog.d.ts +11 -0
- package/vars/component/scroll-fog.mjs +11 -0
- package/vars/component/segmented-control-indicator.d.ts +24 -0
- package/vars/component/segmented-control-indicator.mjs +24 -0
- package/vars/component/segmented-control-item.d.ts +41 -0
- package/vars/component/segmented-control-item.mjs +41 -0
- package/vars/component/segmented-control.d.ts +11 -0
- package/vars/component/segmented-control.mjs +11 -0
- package/vars/component/select-box-checkmark.d.ts +40 -0
- package/vars/component/select-box-checkmark.mjs +40 -0
- package/vars/component/select-box-group.d.ts +10 -0
- package/vars/component/select-box-group.mjs +10 -0
- package/vars/component/select-box.d.ts +107 -0
- package/vars/component/select-box.mjs +102 -0
- package/vars/component/skeleton.d.ts +76 -0
- package/vars/component/skeleton.mjs +58 -0
- package/vars/component/slider-thumb.d.ts +25 -0
- package/vars/component/slider-thumb.mjs +25 -0
- package/vars/component/slider-tick.d.ts +23 -0
- package/vars/component/slider-tick.mjs +23 -0
- package/vars/component/slider.d.ts +78 -0
- package/vars/component/slider.mjs +75 -0
- package/vars/component/snackbar.d.ts +65 -0
- package/vars/component/snackbar.mjs +65 -0
- package/vars/component/switch.d.ts +53 -0
- package/vars/component/switch.mjs +53 -0
- package/vars/component/switchmark.d.ts +112 -0
- package/vars/component/switchmark.mjs +112 -0
- package/vars/component/tab.d.ts +47 -0
- package/vars/component/tab.mjs +47 -0
- package/vars/component/tablist.d.ts +51 -0
- package/vars/component/tablist.mjs +51 -0
- package/vars/component/tag-group-item.d.ts +122 -0
- package/vars/component/tag-group-item.mjs +122 -0
- package/vars/component/tag-group.d.ts +34 -0
- package/vars/component/tag-group.mjs +34 -0
- package/vars/component/text-button.d.ts +23 -0
- package/vars/component/text-button.mjs +23 -0
- package/vars/component/text-input.d.ts +224 -0
- package/vars/component/text-input.mjs +211 -0
- package/vars/component/toggle-button.d.ts +213 -0
- package/vars/component/toggle-button.mjs +207 -0
- package/vars/component/top-navigation-icon-button.d.ts +36 -0
- package/vars/component/top-navigation-icon-button.mjs +36 -0
- package/vars/component/top-navigation-text-button.d.ts +52 -0
- package/vars/component/top-navigation-text-button.mjs +51 -0
- package/vars/component/top-navigation.d.ts +102 -0
- package/vars/component/top-navigation.mjs +94 -0
- package/vars/component/typography.d.ts +542 -0
- package/vars/component/typography.mjs +461 -0
- package/vars/dimension/index.d.ts +22 -0
- package/vars/dimension/index.mjs +22 -0
- package/vars/dimension/spacing-x.d.ts +4 -0
- package/vars/dimension/spacing-x.mjs +2 -0
- package/vars/dimension/spacing-y.d.ts +8 -0
- package/vars/dimension/spacing-y.mjs +4 -0
- package/vars/duration.d.ts +8 -0
- package/vars/duration.mjs +8 -0
- package/vars/font-size.d.ts +30 -0
- package/vars/font-size.mjs +20 -0
- package/vars/font-weight.d.ts +3 -0
- package/vars/font-weight.mjs +3 -0
- package/vars/gradient.d.ts +19 -0
- package/vars/gradient.mjs +8 -0
- package/vars/index.d.ts +51 -0
- package/vars/index.mjs +1 -0
- package/vars/line-height.d.ts +30 -0
- package/vars/line-height.mjs +20 -0
- package/vars/radius.d.ts +11 -0
- package/vars/radius.mjs +11 -0
- package/vars/shadow.d.ts +4 -0
- package/vars/shadow.mjs +3 -0
- package/vars/timing-function.d.ts +7 -0
- package/vars/timing-function.mjs +7 -0
- package/vars/vars.d.ts +10 -0
- package/vars/vars.mjs +10 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import './radio.css';
|
|
2
|
+
import { createClassName, mergeVariants, splitVariantProps } from "./shared.mjs";
|
|
3
|
+
|
|
4
|
+
const radioSlotNames = [
|
|
5
|
+
[
|
|
6
|
+
"root",
|
|
7
|
+
"seed-radio__root"
|
|
8
|
+
],
|
|
9
|
+
[
|
|
10
|
+
"label",
|
|
11
|
+
"seed-radio__label"
|
|
12
|
+
]
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
const defaultVariant = {
|
|
16
|
+
"weight": "regular",
|
|
17
|
+
"size": "medium",
|
|
18
|
+
"disabled": false
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const compoundVariants = [];
|
|
22
|
+
|
|
23
|
+
export const radioVariantMap = {
|
|
24
|
+
"weight": [
|
|
25
|
+
"regular",
|
|
26
|
+
"bold"
|
|
27
|
+
],
|
|
28
|
+
"size": [
|
|
29
|
+
"medium",
|
|
30
|
+
"large"
|
|
31
|
+
],
|
|
32
|
+
"disabled": [
|
|
33
|
+
true,
|
|
34
|
+
false
|
|
35
|
+
]
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const radioVariantKeys = Object.keys(radioVariantMap);
|
|
39
|
+
|
|
40
|
+
export function radio(props) {
|
|
41
|
+
return Object.fromEntries(
|
|
42
|
+
radioSlotNames.map(([slot, className]) => {
|
|
43
|
+
return [
|
|
44
|
+
slot,
|
|
45
|
+
createClassName(className, mergeVariants(defaultVariant, props), compoundVariants),
|
|
46
|
+
];
|
|
47
|
+
}),
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
Object.assign(radio, { splitVariantProps: (props) => splitVariantProps(props, radioVariantMap) });
|
|
52
|
+
|
|
53
|
+
// @recipe(seed): radio
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
.seed-radiomark__root {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
flex: none;
|
|
7
|
+
margin-top: var(--radiomark-margin-top, 0);
|
|
8
|
+
border-width: 1px;
|
|
9
|
+
border-style: solid;
|
|
10
|
+
border-color: var(--seed-color-stroke-neutral-weak);
|
|
11
|
+
border-radius: var(--seed-radius-full);
|
|
12
|
+
transition: background-color var(--seed-duration-color-transition) var(--seed-timing-function-easing)
|
|
13
|
+
}
|
|
14
|
+
.seed-radiomark__icon {
|
|
15
|
+
border-radius: var(--seed-radius-full)
|
|
16
|
+
}
|
|
17
|
+
.seed-radiomark__root--size_medium {
|
|
18
|
+
width: var(--seed-dimension-x5);
|
|
19
|
+
height: var(--seed-dimension-x5)
|
|
20
|
+
}
|
|
21
|
+
.seed-radiomark__icon--size_medium {
|
|
22
|
+
width: var(--seed-dimension-x2);
|
|
23
|
+
height: var(--seed-dimension-x2)
|
|
24
|
+
}
|
|
25
|
+
.seed-radiomark__root--size_large {
|
|
26
|
+
width: var(--seed-dimension-x6);
|
|
27
|
+
height: var(--seed-dimension-x6)
|
|
28
|
+
}
|
|
29
|
+
.seed-radiomark__icon--size_large {
|
|
30
|
+
width: var(--seed-dimension-x2_5);
|
|
31
|
+
height: var(--seed-dimension-x2_5)
|
|
32
|
+
}
|
|
33
|
+
.seed-radiomark__icon--checked_false {
|
|
34
|
+
opacity: 0
|
|
35
|
+
}
|
|
36
|
+
.seed-radiomark__root--tone_brand-checked_true-disabled_false {
|
|
37
|
+
background-color: var(--seed-color-bg-brand-solid);
|
|
38
|
+
border-width: 0px;
|
|
39
|
+
border-color: #00000000
|
|
40
|
+
}
|
|
41
|
+
.seed-radiomark__icon--tone_brand-checked_true-disabled_false {
|
|
42
|
+
color: var(--seed-color-palette-static-white);
|
|
43
|
+
background-color: var(--seed-color-palette-static-white)
|
|
44
|
+
}
|
|
45
|
+
.seed-radiomark__root--tone_neutral-checked_true-disabled_false {
|
|
46
|
+
background-color: var(--seed-color-bg-neutral-inverted);
|
|
47
|
+
border-width: 0px;
|
|
48
|
+
border-color: #00000000
|
|
49
|
+
}
|
|
50
|
+
.seed-radiomark__icon--tone_neutral-checked_true-disabled_false {
|
|
51
|
+
color: var(--seed-color-fg-neutral-inverted);
|
|
52
|
+
background-color: var(--seed-color-fg-neutral-inverted)
|
|
53
|
+
}
|
|
54
|
+
.seed-radiomark__root--tone_brand-checked_false-disabled_true {
|
|
55
|
+
background-color: var(--seed-color-palette-gray-300)
|
|
56
|
+
}
|
|
57
|
+
.seed-radiomark__root--tone_neutral-checked_false-disabled_true {
|
|
58
|
+
background-color: var(--seed-color-palette-gray-300)
|
|
59
|
+
}
|
|
60
|
+
.seed-radiomark__root--tone_brand-checked_true-disabled_true {
|
|
61
|
+
background-color: var(--seed-color-bg-transparent);
|
|
62
|
+
border-width: 1px;
|
|
63
|
+
border-color: var(--seed-color-palette-gray-300)
|
|
64
|
+
}
|
|
65
|
+
.seed-radiomark__icon--tone_brand-checked_true-disabled_true {
|
|
66
|
+
color: var(--seed-color-palette-gray-300);
|
|
67
|
+
background-color: var(--seed-color-palette-gray-300)
|
|
68
|
+
}
|
|
69
|
+
.seed-radiomark__root--tone_neutral-checked_true-disabled_true {
|
|
70
|
+
background-color: var(--seed-color-bg-transparent);
|
|
71
|
+
border-width: 1px;
|
|
72
|
+
border-color: var(--seed-color-palette-gray-300)
|
|
73
|
+
}
|
|
74
|
+
.seed-radiomark__icon--tone_neutral-checked_true-disabled_true {
|
|
75
|
+
color: var(--seed-color-palette-gray-300);
|
|
76
|
+
background-color: var(--seed-color-palette-gray-300)
|
|
77
|
+
}
|
|
78
|
+
.seed-radiomark__icon--size_medium-checked_true-disabled_true {
|
|
79
|
+
width: var(--seed-dimension-x2_5);
|
|
80
|
+
height: var(--seed-dimension-x2_5)
|
|
81
|
+
}
|
|
82
|
+
.seed-radiomark__icon--size_large-checked_true-disabled_true {
|
|
83
|
+
width: var(--seed-dimension-x3);
|
|
84
|
+
height: var(--seed-dimension-x3)
|
|
85
|
+
}
|
|
86
|
+
.seed-radiomark__root--pressed_true-checked_false-disabled_false {
|
|
87
|
+
background-color: var(--seed-color-bg-transparent-pressed)
|
|
88
|
+
}
|
|
89
|
+
.seed-radiomark__root--tone_brand-pressed_true-checked_true-disabled_false {
|
|
90
|
+
background-color: var(--seed-color-bg-brand-solid-pressed)
|
|
91
|
+
}
|
|
92
|
+
.seed-radiomark__root--tone_neutral-pressed_true-checked_true-disabled_false {
|
|
93
|
+
background-color: var(--seed-color-bg-neutral-inverted-pressed)
|
|
94
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
declare interface RadiomarkVariant {
|
|
2
|
+
/**
|
|
3
|
+
* @default "brand"
|
|
4
|
+
*/
|
|
5
|
+
tone: "brand" | "neutral";
|
|
6
|
+
/**
|
|
7
|
+
* @default "medium"
|
|
8
|
+
*/
|
|
9
|
+
size: "medium" | "large";
|
|
10
|
+
/**
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
13
|
+
checked: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
17
|
+
disabled: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
21
|
+
pressed: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare type RadiomarkVariantMap = {
|
|
25
|
+
[key in keyof RadiomarkVariant]: Array<RadiomarkVariant[key]>;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export declare type RadiomarkVariantProps = Partial<RadiomarkVariant>;
|
|
29
|
+
|
|
30
|
+
export declare type RadiomarkSlotName = "root" | "icon";
|
|
31
|
+
|
|
32
|
+
export declare const radiomarkVariantMap: RadiomarkVariantMap;
|
|
33
|
+
|
|
34
|
+
export declare const radiomark: ((
|
|
35
|
+
props?: RadiomarkVariantProps,
|
|
36
|
+
) => Record<RadiomarkSlotName, string>) & {
|
|
37
|
+
splitVariantProps: <T extends RadiomarkVariantProps>(
|
|
38
|
+
props: T,
|
|
39
|
+
) => [RadiomarkVariantProps, Omit<T, keyof RadiomarkVariantProps>];
|
|
40
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import './radiomark.css';
|
|
2
|
+
import { createClassName, mergeVariants, splitVariantProps } from "./shared.mjs";
|
|
3
|
+
|
|
4
|
+
const radiomarkSlotNames = [
|
|
5
|
+
[
|
|
6
|
+
"root",
|
|
7
|
+
"seed-radiomark__root"
|
|
8
|
+
],
|
|
9
|
+
[
|
|
10
|
+
"icon",
|
|
11
|
+
"seed-radiomark__icon"
|
|
12
|
+
]
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
const defaultVariant = {
|
|
16
|
+
"tone": "brand",
|
|
17
|
+
"size": "medium",
|
|
18
|
+
"checked": false,
|
|
19
|
+
"disabled": false,
|
|
20
|
+
"pressed": false
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const compoundVariants = [
|
|
24
|
+
{
|
|
25
|
+
"tone": "brand",
|
|
26
|
+
"checked": true,
|
|
27
|
+
"disabled": false
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"tone": "neutral",
|
|
31
|
+
"checked": true,
|
|
32
|
+
"disabled": false
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"tone": "brand",
|
|
36
|
+
"checked": false,
|
|
37
|
+
"disabled": true
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"tone": "neutral",
|
|
41
|
+
"checked": false,
|
|
42
|
+
"disabled": true
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"tone": "brand",
|
|
46
|
+
"checked": true,
|
|
47
|
+
"disabled": true
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"tone": "neutral",
|
|
51
|
+
"checked": true,
|
|
52
|
+
"disabled": true
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"size": "medium",
|
|
56
|
+
"checked": true,
|
|
57
|
+
"disabled": true
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"size": "large",
|
|
61
|
+
"checked": true,
|
|
62
|
+
"disabled": true
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"pressed": true,
|
|
66
|
+
"checked": false,
|
|
67
|
+
"disabled": false
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"tone": "brand",
|
|
71
|
+
"pressed": true,
|
|
72
|
+
"checked": true,
|
|
73
|
+
"disabled": false
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"tone": "neutral",
|
|
77
|
+
"pressed": true,
|
|
78
|
+
"checked": true,
|
|
79
|
+
"disabled": false
|
|
80
|
+
}
|
|
81
|
+
];
|
|
82
|
+
|
|
83
|
+
export const radiomarkVariantMap = {
|
|
84
|
+
"tone": [
|
|
85
|
+
"brand",
|
|
86
|
+
"neutral"
|
|
87
|
+
],
|
|
88
|
+
"size": [
|
|
89
|
+
"medium",
|
|
90
|
+
"large"
|
|
91
|
+
],
|
|
92
|
+
"checked": [
|
|
93
|
+
true,
|
|
94
|
+
false
|
|
95
|
+
],
|
|
96
|
+
"disabled": [
|
|
97
|
+
true,
|
|
98
|
+
false
|
|
99
|
+
],
|
|
100
|
+
"pressed": [
|
|
101
|
+
true,
|
|
102
|
+
false
|
|
103
|
+
]
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export const radiomarkVariantKeys = Object.keys(radiomarkVariantMap);
|
|
107
|
+
|
|
108
|
+
export function radiomark(props) {
|
|
109
|
+
return Object.fromEntries(
|
|
110
|
+
radiomarkSlotNames.map(([slot, className]) => {
|
|
111
|
+
return [
|
|
112
|
+
slot,
|
|
113
|
+
createClassName(className, mergeVariants(defaultVariant, props), compoundVariants),
|
|
114
|
+
];
|
|
115
|
+
}),
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
Object.assign(radiomark, { splitVariantProps: (props) => splitVariantProps(props, radiomarkVariantMap) });
|
|
120
|
+
|
|
121
|
+
// @recipe(seed): radiomark
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export const createClassName = (className, variants, compoundVariants = []) => {
|
|
2
|
+
const variantKeys = Object.keys(variants)
|
|
3
|
+
|
|
4
|
+
const variantValues = variantKeys.map((key) => variants[key]);
|
|
5
|
+
|
|
6
|
+
const variantClassName = variantKeys
|
|
7
|
+
.map((key, index) => `${className}--${key}_${variantValues[index]}`)
|
|
8
|
+
.join(" ");
|
|
9
|
+
|
|
10
|
+
const compountVariantClassName = compoundVariants
|
|
11
|
+
.filter((compoundVariant) =>
|
|
12
|
+
Object.keys(compoundVariant).every((key) => compoundVariant[key] === variants[key]),
|
|
13
|
+
)
|
|
14
|
+
.map(
|
|
15
|
+
(compoundVariant) =>
|
|
16
|
+
`${className}--${Object.keys(compoundVariant)
|
|
17
|
+
.map((key) => {
|
|
18
|
+
return `${key}_${compoundVariant[key]}`;
|
|
19
|
+
})
|
|
20
|
+
.join("-")}`,
|
|
21
|
+
)
|
|
22
|
+
.join(" ");
|
|
23
|
+
|
|
24
|
+
return [className, variantClassName, compountVariantClassName].filter(Boolean).join(" ");
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export function mergeVariants(a, b) {
|
|
28
|
+
const result = { ...a };
|
|
29
|
+
for (const k in b) {
|
|
30
|
+
if (b[k] != null) {
|
|
31
|
+
result[k] = b[k];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return result;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function splitVariantProps(props, variantMap) {
|
|
38
|
+
const variantProps = {};
|
|
39
|
+
const otherProps = {};
|
|
40
|
+
for (const key in props) {
|
|
41
|
+
if (variantMap[key] != null) {
|
|
42
|
+
variantProps[key] = props[key];
|
|
43
|
+
} else {
|
|
44
|
+
otherProps[key] = props[key];
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return [variantProps, otherProps];
|
|
48
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
.seed-switch__root {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: flex-start;
|
|
4
|
+
position: relative
|
|
5
|
+
}
|
|
6
|
+
.seed-switch__label {
|
|
7
|
+
font-weight: var(--seed-font-weight-medium);
|
|
8
|
+
color: var(--seed-color-fg-neutral);
|
|
9
|
+
transition: opacity var(--seed-duration-d1) var(--seed-timing-function-easing)
|
|
10
|
+
}
|
|
11
|
+
.seed-switch__root--size_16 {
|
|
12
|
+
min-height: var(--seed-dimension-x6);
|
|
13
|
+
gap: var(--seed-dimension-x1_5)
|
|
14
|
+
}
|
|
15
|
+
.seed-switch__label--size_16 {
|
|
16
|
+
font-size: var(--seed-font-size-t3);
|
|
17
|
+
line-height: var(--seed-line-height-t3);
|
|
18
|
+
margin-top: calc(var(--seed-dimension-x6) / 2 - var(--seed-line-height-t3) / 2)
|
|
19
|
+
}
|
|
20
|
+
.seed-switch__root--size_24 {
|
|
21
|
+
min-height: var(--seed-dimension-x6);
|
|
22
|
+
gap: var(--seed-dimension-x2)
|
|
23
|
+
}
|
|
24
|
+
.seed-switch__label--size_24 {
|
|
25
|
+
font-size: var(--seed-font-size-t4);
|
|
26
|
+
line-height: var(--seed-line-height-t4);
|
|
27
|
+
margin-top: calc(var(--seed-dimension-x6) / 2 - var(--seed-line-height-t4) / 2)
|
|
28
|
+
}
|
|
29
|
+
.seed-switch__root--size_32 {
|
|
30
|
+
min-height: var(--seed-dimension-x8);
|
|
31
|
+
gap: var(--seed-dimension-x2_5)
|
|
32
|
+
}
|
|
33
|
+
.seed-switch__label--size_32 {
|
|
34
|
+
font-size: var(--seed-font-size-t5);
|
|
35
|
+
line-height: var(--seed-line-height-t5);
|
|
36
|
+
margin-top: calc(var(--seed-dimension-x8) / 2 - var(--seed-line-height-t5) / 2)
|
|
37
|
+
}
|
|
38
|
+
.seed-switch__label--disabled_true {
|
|
39
|
+
opacity: 0.58
|
|
40
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
declare interface SwitchVariant {
|
|
2
|
+
/**
|
|
3
|
+
* @default 32
|
|
4
|
+
*/
|
|
5
|
+
size: "16" | "24" | "32";
|
|
6
|
+
/**
|
|
7
|
+
* @default false
|
|
8
|
+
*/
|
|
9
|
+
disabled: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
declare type SwitchVariantMap = {
|
|
13
|
+
[key in keyof SwitchVariant]: Array<SwitchVariant[key]>;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export declare type SwitchVariantProps = Partial<SwitchVariant>;
|
|
17
|
+
|
|
18
|
+
export declare type SwitchSlotName = "root" | "label";
|
|
19
|
+
|
|
20
|
+
export declare const switchVariantMap: SwitchVariantMap;
|
|
21
|
+
|
|
22
|
+
export declare const switchStyle: ((
|
|
23
|
+
props?: SwitchVariantProps,
|
|
24
|
+
) => Record<SwitchSlotName, string>) & {
|
|
25
|
+
splitVariantProps: <T extends SwitchVariantProps>(
|
|
26
|
+
props: T,
|
|
27
|
+
) => [SwitchVariantProps, Omit<T, keyof SwitchVariantProps>];
|
|
28
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import './switch.css';
|
|
2
|
+
import { createClassName, mergeVariants, splitVariantProps } from "./shared.mjs";
|
|
3
|
+
|
|
4
|
+
const switchSlotNames = [
|
|
5
|
+
[
|
|
6
|
+
"root",
|
|
7
|
+
"seed-switch__root"
|
|
8
|
+
],
|
|
9
|
+
[
|
|
10
|
+
"label",
|
|
11
|
+
"seed-switch__label"
|
|
12
|
+
]
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
const defaultVariant = {
|
|
16
|
+
"size": 32,
|
|
17
|
+
"disabled": false
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const compoundVariants = [];
|
|
21
|
+
|
|
22
|
+
export const switchVariantMap = {
|
|
23
|
+
"size": [
|
|
24
|
+
"16",
|
|
25
|
+
"24",
|
|
26
|
+
"32"
|
|
27
|
+
],
|
|
28
|
+
"disabled": [
|
|
29
|
+
true,
|
|
30
|
+
false
|
|
31
|
+
]
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const switchVariantKeys = Object.keys(switchVariantMap);
|
|
35
|
+
|
|
36
|
+
export function switchStyle(props) {
|
|
37
|
+
return Object.fromEntries(
|
|
38
|
+
switchSlotNames.map(([slot, className]) => {
|
|
39
|
+
return [
|
|
40
|
+
slot,
|
|
41
|
+
createClassName(className, mergeVariants(defaultVariant, props), compoundVariants),
|
|
42
|
+
];
|
|
43
|
+
}),
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
Object.assign(switchStyle, { splitVariantProps: (props) => splitVariantProps(props, switchVariantMap) });
|
|
48
|
+
|
|
49
|
+
// @recipe(seed): switch
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
.seed-switchmark__root {
|
|
2
|
+
display: flex;
|
|
3
|
+
position: relative;
|
|
4
|
+
border-radius: var(--seed-radius-full);
|
|
5
|
+
background-color: var(--seed-color-palette-gray-600);
|
|
6
|
+
transition: background-color var(--seed-duration-d1) var(--seed-timing-function-easing) 20ms, opacity var(--seed-duration-d1) var(--seed-timing-function-easing)
|
|
7
|
+
}
|
|
8
|
+
.seed-switchmark__thumb {
|
|
9
|
+
border-radius: var(--seed-radius-full);
|
|
10
|
+
transition: transform var(--seed-duration-d3) var(--seed-timing-function-easing), background-color var(--seed-duration-d1) var(--seed-timing-function-easing) 20ms;
|
|
11
|
+
transform: scale(0.8)
|
|
12
|
+
}
|
|
13
|
+
.seed-switchmark__thumb--tone_neutral {
|
|
14
|
+
background-color: var(--seed-color-fg-neutral-inverted)
|
|
15
|
+
}
|
|
16
|
+
.seed-switchmark__thumb--tone_brand {
|
|
17
|
+
background-color: var(--seed-color-palette-static-white)
|
|
18
|
+
}
|
|
19
|
+
.seed-switchmark__root--size_16 {
|
|
20
|
+
min-width: 26px;
|
|
21
|
+
min-height: 16px;
|
|
22
|
+
margin-top: calc((var(--seed-dimension-x6) - 16px) / 2);
|
|
23
|
+
margin-bottom: calc((var(--seed-dimension-x6) - 16px) / 2);
|
|
24
|
+
padding: 2px 2px
|
|
25
|
+
}
|
|
26
|
+
.seed-switchmark__thumb--size_16 {
|
|
27
|
+
width: 12px;
|
|
28
|
+
height: 12px
|
|
29
|
+
}
|
|
30
|
+
.seed-switchmark__root--size_24 {
|
|
31
|
+
min-width: 38px;
|
|
32
|
+
min-height: 24px;
|
|
33
|
+
margin-top: calc((var(--seed-dimension-x6) - 24px) / 2);
|
|
34
|
+
margin-bottom: calc((var(--seed-dimension-x6) - 24px) / 2);
|
|
35
|
+
padding: 2px 2px
|
|
36
|
+
}
|
|
37
|
+
.seed-switchmark__thumb--size_24 {
|
|
38
|
+
width: 20px;
|
|
39
|
+
height: 20px
|
|
40
|
+
}
|
|
41
|
+
.seed-switchmark__root--size_32 {
|
|
42
|
+
min-width: 52px;
|
|
43
|
+
min-height: 32px;
|
|
44
|
+
margin-top: calc((var(--seed-dimension-x8) - 32px) / 2);
|
|
45
|
+
margin-bottom: calc((var(--seed-dimension-x8) - 32px) / 2);
|
|
46
|
+
padding: 3px 3px
|
|
47
|
+
}
|
|
48
|
+
.seed-switchmark__thumb--size_32 {
|
|
49
|
+
width: 26px;
|
|
50
|
+
height: 26px
|
|
51
|
+
}
|
|
52
|
+
.seed-switchmark__root--disabled_true {
|
|
53
|
+
opacity: 0.38
|
|
54
|
+
}
|
|
55
|
+
.seed-switchmark__root--tone_brand-checked_true {
|
|
56
|
+
background-color: var(--seed-color-bg-brand-solid)
|
|
57
|
+
}
|
|
58
|
+
.seed-switchmark__root--tone_neutral-checked_true-disabled_false {
|
|
59
|
+
background-color: var(--seed-color-bg-neutral-inverted)
|
|
60
|
+
}
|
|
61
|
+
.seed-switchmark__root--tone_neutral-checked_true-disabled_true {
|
|
62
|
+
background-color: var(--seed-color-palette-gray-600)
|
|
63
|
+
}
|
|
64
|
+
.seed-switchmark__thumb--tone_neutral-disabled_true {
|
|
65
|
+
background-color: var(--seed-color-palette-static-black-alpha-700)
|
|
66
|
+
}
|
|
67
|
+
.seed-switchmark__thumb--size_32-checked_true {
|
|
68
|
+
transform: scale(1) translateX(20px)
|
|
69
|
+
}
|
|
70
|
+
.seed-switchmark__thumb--size_24-checked_true {
|
|
71
|
+
transform: scale(1) translateX(14px)
|
|
72
|
+
}
|
|
73
|
+
.seed-switchmark__thumb--size_16-checked_true {
|
|
74
|
+
transform: scale(1) translateX(10px)
|
|
75
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
declare interface SwitchmarkVariant {
|
|
2
|
+
/**
|
|
3
|
+
* @default "brand"
|
|
4
|
+
*/
|
|
5
|
+
tone: "neutral" | "brand";
|
|
6
|
+
/**
|
|
7
|
+
* @default "32"
|
|
8
|
+
*/
|
|
9
|
+
size: "16" | "24" | "32";
|
|
10
|
+
/**
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
13
|
+
checked: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
17
|
+
disabled: boolean;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
declare type SwitchmarkVariantMap = {
|
|
21
|
+
[key in keyof SwitchmarkVariant]: Array<SwitchmarkVariant[key]>;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export declare type SwitchmarkVariantProps = Partial<SwitchmarkVariant>;
|
|
25
|
+
|
|
26
|
+
export declare type SwitchmarkSlotName = "root" | "thumb";
|
|
27
|
+
|
|
28
|
+
export declare const switchmarkVariantMap: SwitchmarkVariantMap;
|
|
29
|
+
|
|
30
|
+
export declare const switchmark: ((
|
|
31
|
+
props?: SwitchmarkVariantProps,
|
|
32
|
+
) => Record<SwitchmarkSlotName, string>) & {
|
|
33
|
+
splitVariantProps: <T extends SwitchmarkVariantProps>(
|
|
34
|
+
props: T,
|
|
35
|
+
) => [SwitchmarkVariantProps, Omit<T, keyof SwitchmarkVariantProps>];
|
|
36
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import './switchmark.css';
|
|
2
|
+
import { createClassName, mergeVariants, splitVariantProps } from "./shared.mjs";
|
|
3
|
+
|
|
4
|
+
const switchmarkSlotNames = [
|
|
5
|
+
[
|
|
6
|
+
"root",
|
|
7
|
+
"seed-switchmark__root"
|
|
8
|
+
],
|
|
9
|
+
[
|
|
10
|
+
"thumb",
|
|
11
|
+
"seed-switchmark__thumb"
|
|
12
|
+
]
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
const defaultVariant = {
|
|
16
|
+
"tone": "brand",
|
|
17
|
+
"size": "32",
|
|
18
|
+
"checked": false,
|
|
19
|
+
"disabled": false
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const compoundVariants = [
|
|
23
|
+
{
|
|
24
|
+
"tone": "brand",
|
|
25
|
+
"checked": true
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"tone": "neutral",
|
|
29
|
+
"checked": true,
|
|
30
|
+
"disabled": false
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"tone": "neutral",
|
|
34
|
+
"checked": true,
|
|
35
|
+
"disabled": true
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"tone": "neutral",
|
|
39
|
+
"disabled": true
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"size": "32",
|
|
43
|
+
"checked": true
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"size": "24",
|
|
47
|
+
"checked": true
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"size": "16",
|
|
51
|
+
"checked": true
|
|
52
|
+
}
|
|
53
|
+
];
|
|
54
|
+
|
|
55
|
+
export const switchmarkVariantMap = {
|
|
56
|
+
"tone": [
|
|
57
|
+
"neutral",
|
|
58
|
+
"brand"
|
|
59
|
+
],
|
|
60
|
+
"size": [
|
|
61
|
+
"16",
|
|
62
|
+
"24",
|
|
63
|
+
"32"
|
|
64
|
+
],
|
|
65
|
+
"checked": [
|
|
66
|
+
true,
|
|
67
|
+
false
|
|
68
|
+
],
|
|
69
|
+
"disabled": [
|
|
70
|
+
true,
|
|
71
|
+
false
|
|
72
|
+
]
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export const switchmarkVariantKeys = Object.keys(switchmarkVariantMap);
|
|
76
|
+
|
|
77
|
+
export function switchmark(props) {
|
|
78
|
+
return Object.fromEntries(
|
|
79
|
+
switchmarkSlotNames.map(([slot, className]) => {
|
|
80
|
+
return [
|
|
81
|
+
slot,
|
|
82
|
+
createClassName(className, mergeVariants(defaultVariant, props), compoundVariants),
|
|
83
|
+
];
|
|
84
|
+
}),
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
Object.assign(switchmark, { splitVariantProps: (props) => splitVariantProps(props, switchmarkVariantMap) });
|
|
89
|
+
|
|
90
|
+
// @recipe(seed): switchmark
|