@seed-design/lynx-css 0.10.1 → 0.11.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 +1219 -179
- package/all.min.css +1 -1
- package/package.json +9 -3
- package/recipes/accordion.css +10 -0
- package/recipes/accordion.d.ts +1 -1
- package/recipes/accordion.mjs +4 -0
- package/recipes/action-button.css +21 -13
- package/recipes/action-button.mjs +30 -11
- package/recipes/callout.css +18 -0
- package/recipes/callout.d.ts +4 -0
- package/recipes/callout.mjs +30 -1
- package/recipes/checkbox.css +18 -6
- package/recipes/checkbox.d.ts +1 -1
- package/recipes/checkbox.mjs +4 -0
- package/recipes/checkmark.css +10 -6
- package/recipes/chip.css +18 -0
- package/recipes/chip.mjs +30 -0
- package/recipes/input-button.css +209 -0
- package/recipes/input-button.d.ts +40 -0
- package/recipes/input-button.mjs +99 -0
- package/recipes/list-header.css +22 -0
- package/recipes/list-header.d.ts +22 -0
- package/recipes/list-header.mjs +29 -0
- package/recipes/list-item.css +120 -0
- package/recipes/list-item.d.ts +32 -0
- package/recipes/list-item.mjs +93 -0
- package/recipes/list.css +5 -0
- package/recipes/list.d.ts +19 -0
- package/recipes/list.mjs +22 -0
- package/recipes/menu-item.css +119 -0
- package/recipes/menu-item.d.ts +36 -0
- package/recipes/menu-item.mjs +91 -0
- package/recipes/menu-sheet-item.css +69 -0
- package/recipes/menu-sheet-item.d.ts +32 -0
- package/recipes/menu-sheet-item.mjs +69 -0
- package/recipes/menu-sheet.css +104 -0
- package/recipes/menu-sheet.d.ts +28 -0
- package/recipes/menu-sheet.mjs +88 -0
- package/recipes/menu.css +101 -0
- package/recipes/menu.d.ts +32 -0
- package/recipes/menu.mjs +85 -0
- package/recipes/page-banner.css +136 -99
- package/recipes/page-banner.d.ts +4 -0
- package/recipes/page-banner.mjs +61 -1
- package/recipes/radio.css +3 -0
- package/recipes/radiomark.css +4 -1
- package/recipes/reaction-button.css +145 -0
- package/recipes/reaction-button.d.ts +40 -0
- package/recipes/reaction-button.mjs +101 -0
- package/recipes/segmented-control.css +16 -2
- package/recipes/segmented-control.d.ts +1 -1
- package/recipes/segmented-control.mjs +8 -0
- package/recipes/select-box.css +12 -0
- package/recipes/select-box.d.ts +1 -1
- package/recipes/select-box.mjs +4 -0
- package/recipes/text-input.css +66 -59
- package/scale-feedback/index.d.ts +2 -0
- package/scale-feedback/index.mjs +3 -0
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
.seed-input-button__root {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: row;
|
|
4
|
+
width: 100%;
|
|
5
|
+
align-items: center;
|
|
6
|
+
position: relative;
|
|
7
|
+
overflow: hidden
|
|
8
|
+
}
|
|
9
|
+
.seed-input-button__button {
|
|
10
|
+
position: absolute;
|
|
11
|
+
top: 0;
|
|
12
|
+
right: 0;
|
|
13
|
+
bottom: 0;
|
|
14
|
+
left: 0;
|
|
15
|
+
background-color: var(--seed-color-bg-transparent)
|
|
16
|
+
}
|
|
17
|
+
.seed-input-button__baseStroke {
|
|
18
|
+
position: absolute;
|
|
19
|
+
top: 0;
|
|
20
|
+
right: 0;
|
|
21
|
+
bottom: 0;
|
|
22
|
+
left: 0;
|
|
23
|
+
border-style: solid;
|
|
24
|
+
border-width: 1px;
|
|
25
|
+
border-color: var(--seed-color-stroke-neutral-weak);
|
|
26
|
+
pointer-events: none
|
|
27
|
+
}
|
|
28
|
+
.seed-input-button__stroke {
|
|
29
|
+
position: absolute;
|
|
30
|
+
top: 0;
|
|
31
|
+
right: 0;
|
|
32
|
+
bottom: 0;
|
|
33
|
+
left: 0;
|
|
34
|
+
border-style: solid;
|
|
35
|
+
border-width: 2px;
|
|
36
|
+
border-color: transparent;
|
|
37
|
+
transition: border-color 0.1s var(--seed-timing-function-easing);
|
|
38
|
+
pointer-events: none
|
|
39
|
+
}
|
|
40
|
+
.seed-input-button__value {
|
|
41
|
+
flex-grow: 1;
|
|
42
|
+
min-width: 0;
|
|
43
|
+
color: var(--seed-color-fg-neutral);
|
|
44
|
+
font-weight: var(--seed-font-weight-regular);
|
|
45
|
+
overflow: hidden;
|
|
46
|
+
text-overflow: ellipsis;
|
|
47
|
+
white-space: nowrap;
|
|
48
|
+
pointer-events: none
|
|
49
|
+
}
|
|
50
|
+
.seed-input-button__placeholder {
|
|
51
|
+
flex-grow: 1;
|
|
52
|
+
min-width: 0;
|
|
53
|
+
color: var(--seed-color-fg-placeholder);
|
|
54
|
+
font-weight: var(--seed-font-weight-regular);
|
|
55
|
+
overflow: hidden;
|
|
56
|
+
text-overflow: ellipsis;
|
|
57
|
+
white-space: nowrap;
|
|
58
|
+
pointer-events: none
|
|
59
|
+
}
|
|
60
|
+
.seed-input-button__prefixText {
|
|
61
|
+
flex-shrink: 0;
|
|
62
|
+
color: var(--seed-color-fg-neutral-subtle);
|
|
63
|
+
font-weight: var(--seed-font-weight-regular);
|
|
64
|
+
pointer-events: none
|
|
65
|
+
}
|
|
66
|
+
.seed-input-button__prefixIcon {
|
|
67
|
+
flex-shrink: 0;
|
|
68
|
+
color: var(--seed-color-fg-neutral-muted);
|
|
69
|
+
pointer-events: none
|
|
70
|
+
}
|
|
71
|
+
.seed-input-button__suffixText {
|
|
72
|
+
flex-shrink: 0;
|
|
73
|
+
color: var(--seed-color-fg-neutral-subtle);
|
|
74
|
+
font-weight: var(--seed-font-weight-regular);
|
|
75
|
+
pointer-events: none
|
|
76
|
+
}
|
|
77
|
+
.seed-input-button__suffixIcon {
|
|
78
|
+
flex-shrink: 0;
|
|
79
|
+
color: var(--seed-color-fg-neutral-muted);
|
|
80
|
+
pointer-events: none
|
|
81
|
+
}
|
|
82
|
+
.seed-input-button__clearButton {
|
|
83
|
+
flex-shrink: 0;
|
|
84
|
+
color: var(--seed-color-fg-neutral-subtle)
|
|
85
|
+
}
|
|
86
|
+
.seed-input-button__root--size_large {
|
|
87
|
+
height: var(--seed-dimension-x13);
|
|
88
|
+
gap: var(--seed-dimension-x2_5);
|
|
89
|
+
padding-left: var(--seed-dimension-x4);
|
|
90
|
+
padding-right: var(--seed-dimension-x4);
|
|
91
|
+
border-radius: var(--seed-radius-r3)
|
|
92
|
+
}
|
|
93
|
+
.seed-input-button__button--size_large {
|
|
94
|
+
border-radius: var(--seed-radius-r3)
|
|
95
|
+
}
|
|
96
|
+
.seed-input-button__baseStroke--size_large {
|
|
97
|
+
border-radius: var(--seed-radius-r3)
|
|
98
|
+
}
|
|
99
|
+
.seed-input-button__stroke--size_large {
|
|
100
|
+
border-radius: var(--seed-radius-r3)
|
|
101
|
+
}
|
|
102
|
+
.seed-input-button__value--size_large {
|
|
103
|
+
font-size: var(--seed-font-size-t5);
|
|
104
|
+
line-height: var(--seed-line-height-t5)
|
|
105
|
+
}
|
|
106
|
+
.seed-input-button__placeholder--size_large {
|
|
107
|
+
font-size: var(--seed-font-size-t5);
|
|
108
|
+
line-height: var(--seed-line-height-t5)
|
|
109
|
+
}
|
|
110
|
+
.seed-input-button__prefixText--size_large {
|
|
111
|
+
font-size: var(--seed-font-size-t5);
|
|
112
|
+
line-height: var(--seed-line-height-t5)
|
|
113
|
+
}
|
|
114
|
+
.seed-input-button__prefixIcon--size_large {
|
|
115
|
+
width: var(--seed-dimension-x5);
|
|
116
|
+
height: var(--seed-dimension-x5)
|
|
117
|
+
}
|
|
118
|
+
.seed-input-button__suffixText--size_large {
|
|
119
|
+
font-size: var(--seed-font-size-t5);
|
|
120
|
+
line-height: var(--seed-line-height-t5)
|
|
121
|
+
}
|
|
122
|
+
.seed-input-button__suffixIcon--size_large {
|
|
123
|
+
width: var(--seed-dimension-x5);
|
|
124
|
+
height: var(--seed-dimension-x5)
|
|
125
|
+
}
|
|
126
|
+
.seed-input-button__clearButton--size_large {
|
|
127
|
+
width: 22px;
|
|
128
|
+
height: 22px
|
|
129
|
+
}
|
|
130
|
+
.seed-input-button__root--size_medium {
|
|
131
|
+
height: var(--seed-dimension-x10);
|
|
132
|
+
gap: var(--seed-dimension-x2);
|
|
133
|
+
padding-left: var(--seed-dimension-x3_5);
|
|
134
|
+
padding-right: var(--seed-dimension-x3_5);
|
|
135
|
+
border-radius: var(--seed-radius-r2)
|
|
136
|
+
}
|
|
137
|
+
.seed-input-button__button--size_medium {
|
|
138
|
+
border-radius: var(--seed-radius-r2)
|
|
139
|
+
}
|
|
140
|
+
.seed-input-button__baseStroke--size_medium {
|
|
141
|
+
border-radius: var(--seed-radius-r2)
|
|
142
|
+
}
|
|
143
|
+
.seed-input-button__stroke--size_medium {
|
|
144
|
+
border-radius: var(--seed-radius-r2)
|
|
145
|
+
}
|
|
146
|
+
.seed-input-button__value--size_medium {
|
|
147
|
+
font-size: var(--seed-font-size-t4);
|
|
148
|
+
line-height: var(--seed-line-height-t4)
|
|
149
|
+
}
|
|
150
|
+
.seed-input-button__placeholder--size_medium {
|
|
151
|
+
font-size: var(--seed-font-size-t4);
|
|
152
|
+
line-height: var(--seed-line-height-t4)
|
|
153
|
+
}
|
|
154
|
+
.seed-input-button__prefixText--size_medium {
|
|
155
|
+
font-size: var(--seed-font-size-t4);
|
|
156
|
+
line-height: var(--seed-line-height-t4)
|
|
157
|
+
}
|
|
158
|
+
.seed-input-button__prefixIcon--size_medium {
|
|
159
|
+
width: var(--seed-dimension-x4);
|
|
160
|
+
height: var(--seed-dimension-x4)
|
|
161
|
+
}
|
|
162
|
+
.seed-input-button__suffixText--size_medium {
|
|
163
|
+
font-size: var(--seed-font-size-t4);
|
|
164
|
+
line-height: var(--seed-line-height-t4)
|
|
165
|
+
}
|
|
166
|
+
.seed-input-button__suffixIcon--size_medium {
|
|
167
|
+
width: var(--seed-dimension-x4);
|
|
168
|
+
height: var(--seed-dimension-x4)
|
|
169
|
+
}
|
|
170
|
+
.seed-input-button__clearButton--size_medium {
|
|
171
|
+
width: var(--seed-dimension-x4_5);
|
|
172
|
+
height: var(--seed-dimension-x4_5)
|
|
173
|
+
}
|
|
174
|
+
.seed-input-button__button--pressed_true {
|
|
175
|
+
background-color: var(--seed-color-bg-transparent-pressed)
|
|
176
|
+
}
|
|
177
|
+
.seed-input-button__stroke--invalid_true {
|
|
178
|
+
border-color: var(--seed-color-stroke-critical-solid)
|
|
179
|
+
}
|
|
180
|
+
.seed-input-button__button--disabled_true {
|
|
181
|
+
background-color: var(--seed-color-bg-disabled)
|
|
182
|
+
}
|
|
183
|
+
.seed-input-button__value--disabled_true {
|
|
184
|
+
color: var(--seed-color-fg-disabled)
|
|
185
|
+
}
|
|
186
|
+
.seed-input-button__placeholder--disabled_true {
|
|
187
|
+
color: var(--seed-color-fg-disabled)
|
|
188
|
+
}
|
|
189
|
+
.seed-input-button__prefixText--disabled_true {
|
|
190
|
+
color: var(--seed-color-fg-disabled)
|
|
191
|
+
}
|
|
192
|
+
.seed-input-button__prefixIcon--disabled_true {
|
|
193
|
+
color: var(--seed-color-fg-disabled)
|
|
194
|
+
}
|
|
195
|
+
.seed-input-button__suffixText--disabled_true {
|
|
196
|
+
color: var(--seed-color-fg-disabled)
|
|
197
|
+
}
|
|
198
|
+
.seed-input-button__suffixIcon--disabled_true {
|
|
199
|
+
color: var(--seed-color-fg-disabled)
|
|
200
|
+
}
|
|
201
|
+
.seed-input-button__button--readOnly_true {
|
|
202
|
+
background-color: var(--seed-color-bg-disabled)
|
|
203
|
+
}
|
|
204
|
+
.seed-input-button__value--readOnly_true {
|
|
205
|
+
color: var(--seed-color-fg-neutral)
|
|
206
|
+
}
|
|
207
|
+
.seed-input-button__placeholder--readOnly_true {
|
|
208
|
+
color: var(--seed-color-fg-placeholder)
|
|
209
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
declare interface InputButtonVariant {
|
|
2
|
+
/**
|
|
3
|
+
* @default "large"
|
|
4
|
+
*/
|
|
5
|
+
size: "large" | "medium";
|
|
6
|
+
/**
|
|
7
|
+
* @default false
|
|
8
|
+
*/
|
|
9
|
+
pressed: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
13
|
+
invalid: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
17
|
+
disabled: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
21
|
+
readOnly: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare type InputButtonVariantMap = {
|
|
25
|
+
[key in keyof InputButtonVariant]: Array<InputButtonVariant[key]>;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export declare type InputButtonVariantProps = Partial<InputButtonVariant>;
|
|
29
|
+
|
|
30
|
+
export declare type InputButtonSlotName = "root" | "button" | "baseStroke" | "stroke" | "value" | "placeholder" | "prefixText" | "prefixIcon" | "suffixText" | "suffixIcon" | "clearButton";
|
|
31
|
+
|
|
32
|
+
export declare const inputButtonVariantMap: InputButtonVariantMap;
|
|
33
|
+
|
|
34
|
+
export declare const inputButton: ((
|
|
35
|
+
props?: InputButtonVariantProps,
|
|
36
|
+
) => Record<InputButtonSlotName, string>) & {
|
|
37
|
+
splitVariantProps: <T extends InputButtonVariantProps>(
|
|
38
|
+
props: T,
|
|
39
|
+
) => [InputButtonVariantProps, Omit<T, keyof InputButtonVariantProps>];
|
|
40
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import './input-button.css';
|
|
2
|
+
import { createClassName, mergeVariants, splitVariantProps } from "./shared.mjs";
|
|
3
|
+
|
|
4
|
+
const inputButtonSlotNames = [
|
|
5
|
+
[
|
|
6
|
+
"root",
|
|
7
|
+
"seed-input-button__root"
|
|
8
|
+
],
|
|
9
|
+
[
|
|
10
|
+
"button",
|
|
11
|
+
"seed-input-button__button"
|
|
12
|
+
],
|
|
13
|
+
[
|
|
14
|
+
"baseStroke",
|
|
15
|
+
"seed-input-button__baseStroke"
|
|
16
|
+
],
|
|
17
|
+
[
|
|
18
|
+
"stroke",
|
|
19
|
+
"seed-input-button__stroke"
|
|
20
|
+
],
|
|
21
|
+
[
|
|
22
|
+
"value",
|
|
23
|
+
"seed-input-button__value"
|
|
24
|
+
],
|
|
25
|
+
[
|
|
26
|
+
"placeholder",
|
|
27
|
+
"seed-input-button__placeholder"
|
|
28
|
+
],
|
|
29
|
+
[
|
|
30
|
+
"prefixText",
|
|
31
|
+
"seed-input-button__prefixText"
|
|
32
|
+
],
|
|
33
|
+
[
|
|
34
|
+
"prefixIcon",
|
|
35
|
+
"seed-input-button__prefixIcon"
|
|
36
|
+
],
|
|
37
|
+
[
|
|
38
|
+
"suffixText",
|
|
39
|
+
"seed-input-button__suffixText"
|
|
40
|
+
],
|
|
41
|
+
[
|
|
42
|
+
"suffixIcon",
|
|
43
|
+
"seed-input-button__suffixIcon"
|
|
44
|
+
],
|
|
45
|
+
[
|
|
46
|
+
"clearButton",
|
|
47
|
+
"seed-input-button__clearButton"
|
|
48
|
+
]
|
|
49
|
+
];
|
|
50
|
+
|
|
51
|
+
const defaultVariant = {
|
|
52
|
+
"size": "large",
|
|
53
|
+
"pressed": false,
|
|
54
|
+
"invalid": false,
|
|
55
|
+
"disabled": false,
|
|
56
|
+
"readOnly": false
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const compoundVariants = [];
|
|
60
|
+
|
|
61
|
+
export const inputButtonVariantMap = {
|
|
62
|
+
"size": [
|
|
63
|
+
"large",
|
|
64
|
+
"medium"
|
|
65
|
+
],
|
|
66
|
+
"pressed": [
|
|
67
|
+
true,
|
|
68
|
+
false
|
|
69
|
+
],
|
|
70
|
+
"invalid": [
|
|
71
|
+
true,
|
|
72
|
+
false
|
|
73
|
+
],
|
|
74
|
+
"disabled": [
|
|
75
|
+
true,
|
|
76
|
+
false
|
|
77
|
+
],
|
|
78
|
+
"readOnly": [
|
|
79
|
+
true,
|
|
80
|
+
false
|
|
81
|
+
]
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export const inputButtonVariantKeys = Object.keys(inputButtonVariantMap);
|
|
85
|
+
|
|
86
|
+
export function inputButton(props) {
|
|
87
|
+
return Object.fromEntries(
|
|
88
|
+
inputButtonSlotNames.map(([slot, className]) => {
|
|
89
|
+
return [
|
|
90
|
+
slot,
|
|
91
|
+
createClassName(className, mergeVariants(defaultVariant, props), compoundVariants),
|
|
92
|
+
];
|
|
93
|
+
}),
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
Object.assign(inputButton, { splitVariantProps: (props) => splitVariantProps(props, inputButtonVariantMap) });
|
|
98
|
+
|
|
99
|
+
// @recipe(seed): input-button
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
.seed-list-header {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: row;
|
|
4
|
+
align-items: center;
|
|
5
|
+
justify-content: space-between;
|
|
6
|
+
width: 100%;
|
|
7
|
+
gap: var(--seed-dimension-x2_5);
|
|
8
|
+
padding-left: var(--seed-dimension-spacing-x-global-gutter);
|
|
9
|
+
padding-right: var(--seed-dimension-spacing-x-global-gutter);
|
|
10
|
+
padding-top: var(--seed-dimension-x2);
|
|
11
|
+
padding-bottom: var(--seed-dimension-x2);
|
|
12
|
+
font-size: var(--seed-font-size-t4);
|
|
13
|
+
line-height: var(--seed-line-height-t4)
|
|
14
|
+
}
|
|
15
|
+
.seed-list-header--variant_mediumWeak {
|
|
16
|
+
font-weight: var(--seed-font-weight-medium);
|
|
17
|
+
color: var(--seed-color-fg-neutral-subtle)
|
|
18
|
+
}
|
|
19
|
+
.seed-list-header--variant_boldSolid {
|
|
20
|
+
font-weight: var(--seed-font-weight-bold);
|
|
21
|
+
color: var(--seed-color-fg-neutral)
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
declare interface ListHeaderVariant {
|
|
2
|
+
/**
|
|
3
|
+
* @default "mediumWeak"
|
|
4
|
+
*/
|
|
5
|
+
variant: "mediumWeak" | "boldSolid";
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
declare type ListHeaderVariantMap = {
|
|
9
|
+
[key in keyof ListHeaderVariant]: Array<ListHeaderVariant[key]>;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export declare type ListHeaderVariantProps = Partial<ListHeaderVariant>;
|
|
13
|
+
|
|
14
|
+
export declare const listHeaderVariantMap: ListHeaderVariantMap;
|
|
15
|
+
|
|
16
|
+
export declare const listHeader: ((
|
|
17
|
+
props?: ListHeaderVariantProps,
|
|
18
|
+
) => string) & {
|
|
19
|
+
splitVariantProps: <T extends ListHeaderVariantProps>(
|
|
20
|
+
props: T,
|
|
21
|
+
) => [ListHeaderVariantProps, Omit<T, keyof ListHeaderVariantProps>];
|
|
22
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import './list-header.css';
|
|
2
|
+
import { createClassName, mergeVariants, splitVariantProps } from "./shared.mjs";
|
|
3
|
+
|
|
4
|
+
const defaultVariant = {
|
|
5
|
+
"variant": "mediumWeak"
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const compoundVariants = [];
|
|
9
|
+
|
|
10
|
+
export const listHeaderVariantMap = {
|
|
11
|
+
"variant": [
|
|
12
|
+
"mediumWeak",
|
|
13
|
+
"boldSolid"
|
|
14
|
+
]
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const listHeaderVariantKeys = Object.keys(listHeaderVariantMap);
|
|
18
|
+
|
|
19
|
+
export function listHeader(props) {
|
|
20
|
+
return createClassName(
|
|
21
|
+
"seed-list-header",
|
|
22
|
+
mergeVariants(defaultVariant, props),
|
|
23
|
+
compoundVariants,
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
Object.assign(listHeader, { splitVariantProps: (props) => splitVariantProps(props, listHeaderVariantMap) });
|
|
28
|
+
|
|
29
|
+
// @recipe(seed): list-header
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
.seed-list-item__interactionRoot {
|
|
2
|
+
display: flex;
|
|
3
|
+
width: 100%
|
|
4
|
+
}
|
|
5
|
+
.seed-list-item__root {
|
|
6
|
+
position: relative;
|
|
7
|
+
display: flex;
|
|
8
|
+
width: 100%;
|
|
9
|
+
padding-left: var(--seed-dimension-spacing-x-global-gutter);
|
|
10
|
+
padding-right: var(--seed-dimension-spacing-x-global-gutter);
|
|
11
|
+
padding-top: var(--seed-dimension-x3);
|
|
12
|
+
padding-bottom: var(--seed-dimension-x3)
|
|
13
|
+
}
|
|
14
|
+
.seed-list-item__highlightedOverlay {
|
|
15
|
+
position: absolute;
|
|
16
|
+
top: 0;
|
|
17
|
+
right: 0;
|
|
18
|
+
bottom: 0;
|
|
19
|
+
left: 0;
|
|
20
|
+
border-radius: 0;
|
|
21
|
+
background-color: var(--seed-color-bg-brand-weak);
|
|
22
|
+
opacity: 0;
|
|
23
|
+
transition: opacity var(--seed-duration-color-transition) var(--seed-timing-function-easing)
|
|
24
|
+
}
|
|
25
|
+
.seed-list-item__pressedOverlay {
|
|
26
|
+
position: absolute;
|
|
27
|
+
top: 0;
|
|
28
|
+
right: 0;
|
|
29
|
+
bottom: 0;
|
|
30
|
+
left: 0;
|
|
31
|
+
border-radius: 0;
|
|
32
|
+
background-color: var(--seed-color-bg-transparent-pressed);
|
|
33
|
+
opacity: 0;
|
|
34
|
+
transition: opacity var(--seed-duration-color-transition) var(--seed-timing-function-easing), left var(--seed-duration-d3) var(--seed-timing-function-easing), right var(--seed-duration-d3) var(--seed-timing-function-easing), border-radius var(--seed-duration-d3) var(--seed-timing-function-easing)
|
|
35
|
+
}
|
|
36
|
+
.seed-list-item__layout {
|
|
37
|
+
position: relative;
|
|
38
|
+
display: flex;
|
|
39
|
+
flex-direction: row;
|
|
40
|
+
align-items: center;
|
|
41
|
+
width: 100%;
|
|
42
|
+
transform: scale(1);
|
|
43
|
+
transition: transform var(--seed-duration-pressed-scale) var(--seed-timing-function-pressed-scale)
|
|
44
|
+
}
|
|
45
|
+
.seed-list-item__prefix {
|
|
46
|
+
display: flex;
|
|
47
|
+
flex-direction: row;
|
|
48
|
+
align-items: center;
|
|
49
|
+
flex-shrink: 0;
|
|
50
|
+
padding-right: var(--seed-dimension-x3)
|
|
51
|
+
}
|
|
52
|
+
.seed-list-item__suffix {
|
|
53
|
+
display: flex;
|
|
54
|
+
flex-direction: row;
|
|
55
|
+
align-items: center;
|
|
56
|
+
flex-shrink: 0;
|
|
57
|
+
gap: var(--seed-dimension-x1);
|
|
58
|
+
color: var(--seed-color-fg-neutral-subtle);
|
|
59
|
+
font-size: var(--seed-font-size-t5);
|
|
60
|
+
line-height: var(--seed-line-height-t5);
|
|
61
|
+
font-weight: var(--seed-font-weight-regular)
|
|
62
|
+
}
|
|
63
|
+
.seed-list-item__content {
|
|
64
|
+
display: flex;
|
|
65
|
+
flex-direction: column;
|
|
66
|
+
align-items: flex-start;
|
|
67
|
+
flex-grow: 1;
|
|
68
|
+
gap: var(--seed-dimension-x0_5);
|
|
69
|
+
padding-right: var(--seed-dimension-x2_5)
|
|
70
|
+
}
|
|
71
|
+
.seed-list-item__title {
|
|
72
|
+
flex-shrink: 0;
|
|
73
|
+
color: var(--seed-color-fg-neutral);
|
|
74
|
+
font-size: var(--seed-font-size-t5);
|
|
75
|
+
line-height: var(--seed-line-height-t5);
|
|
76
|
+
font-weight: var(--seed-font-weight-regular)
|
|
77
|
+
}
|
|
78
|
+
.seed-list-item__detail {
|
|
79
|
+
color: var(--seed-color-fg-neutral-subtle);
|
|
80
|
+
font-size: var(--seed-font-size-t3);
|
|
81
|
+
line-height: var(--seed-line-height-t3);
|
|
82
|
+
font-weight: var(--seed-font-weight-regular)
|
|
83
|
+
}
|
|
84
|
+
.seed-list-item__prefixIcon {
|
|
85
|
+
width: 22px;
|
|
86
|
+
height: 22px;
|
|
87
|
+
color: var(--seed-color-fg-neutral)
|
|
88
|
+
}
|
|
89
|
+
.seed-list-item__suffixIcon {
|
|
90
|
+
width: 18px;
|
|
91
|
+
height: 18px;
|
|
92
|
+
color: var(--seed-color-fg-neutral-subtle)
|
|
93
|
+
}
|
|
94
|
+
.seed-list-item__highlightedOverlay--highlighted_true {
|
|
95
|
+
opacity: 1
|
|
96
|
+
}
|
|
97
|
+
.seed-list-item__pressedOverlay--highlighted_true {
|
|
98
|
+
background-color: var(--seed-color-bg-brand-weak-pressed)
|
|
99
|
+
}
|
|
100
|
+
.seed-list-item__pressedOverlay--pressed_true {
|
|
101
|
+
right: var(--seed-dimension-x1_5);
|
|
102
|
+
left: var(--seed-dimension-x1_5);
|
|
103
|
+
border-radius: var(--seed-dimension-x2_5);
|
|
104
|
+
opacity: 1
|
|
105
|
+
}
|
|
106
|
+
.seed-list-item__layout--pressed_true {
|
|
107
|
+
transform: scale(var(--seed-scale-s98))
|
|
108
|
+
}
|
|
109
|
+
.seed-list-item__title--disabled_true {
|
|
110
|
+
color: var(--seed-color-fg-disabled)
|
|
111
|
+
}
|
|
112
|
+
.seed-list-item__detail--disabled_true {
|
|
113
|
+
color: var(--seed-color-fg-disabled)
|
|
114
|
+
}
|
|
115
|
+
.seed-list-item__prefixIcon--disabled_true {
|
|
116
|
+
color: var(--seed-color-fg-disabled)
|
|
117
|
+
}
|
|
118
|
+
.seed-list-item__suffixIcon--disabled_true {
|
|
119
|
+
color: var(--seed-color-fg-disabled)
|
|
120
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
declare interface ListItemVariant {
|
|
2
|
+
/**
|
|
3
|
+
* @default false
|
|
4
|
+
*/
|
|
5
|
+
highlighted: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* @default false
|
|
8
|
+
*/
|
|
9
|
+
pressed: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
declare type ListItemVariantMap = {
|
|
17
|
+
[key in keyof ListItemVariant]: Array<ListItemVariant[key]>;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export declare type ListItemVariantProps = Partial<ListItemVariant>;
|
|
21
|
+
|
|
22
|
+
export declare type ListItemSlotName = "interactionRoot" | "root" | "highlightedOverlay" | "pressedOverlay" | "layout" | "content" | "title" | "detail" | "prefix" | "suffix" | "prefixIcon" | "suffixIcon";
|
|
23
|
+
|
|
24
|
+
export declare const listItemVariantMap: ListItemVariantMap;
|
|
25
|
+
|
|
26
|
+
export declare const listItem: ((
|
|
27
|
+
props?: ListItemVariantProps,
|
|
28
|
+
) => Record<ListItemSlotName, string>) & {
|
|
29
|
+
splitVariantProps: <T extends ListItemVariantProps>(
|
|
30
|
+
props: T,
|
|
31
|
+
) => [ListItemVariantProps, Omit<T, keyof ListItemVariantProps>];
|
|
32
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import './list-item.css';
|
|
2
|
+
import { createClassName, mergeVariants, splitVariantProps } from "./shared.mjs";
|
|
3
|
+
|
|
4
|
+
const listItemSlotNames = [
|
|
5
|
+
[
|
|
6
|
+
"interactionRoot",
|
|
7
|
+
"seed-list-item__interactionRoot"
|
|
8
|
+
],
|
|
9
|
+
[
|
|
10
|
+
"root",
|
|
11
|
+
"seed-list-item__root"
|
|
12
|
+
],
|
|
13
|
+
[
|
|
14
|
+
"highlightedOverlay",
|
|
15
|
+
"seed-list-item__highlightedOverlay"
|
|
16
|
+
],
|
|
17
|
+
[
|
|
18
|
+
"pressedOverlay",
|
|
19
|
+
"seed-list-item__pressedOverlay"
|
|
20
|
+
],
|
|
21
|
+
[
|
|
22
|
+
"layout",
|
|
23
|
+
"seed-list-item__layout"
|
|
24
|
+
],
|
|
25
|
+
[
|
|
26
|
+
"content",
|
|
27
|
+
"seed-list-item__content"
|
|
28
|
+
],
|
|
29
|
+
[
|
|
30
|
+
"title",
|
|
31
|
+
"seed-list-item__title"
|
|
32
|
+
],
|
|
33
|
+
[
|
|
34
|
+
"detail",
|
|
35
|
+
"seed-list-item__detail"
|
|
36
|
+
],
|
|
37
|
+
[
|
|
38
|
+
"prefix",
|
|
39
|
+
"seed-list-item__prefix"
|
|
40
|
+
],
|
|
41
|
+
[
|
|
42
|
+
"suffix",
|
|
43
|
+
"seed-list-item__suffix"
|
|
44
|
+
],
|
|
45
|
+
[
|
|
46
|
+
"prefixIcon",
|
|
47
|
+
"seed-list-item__prefixIcon"
|
|
48
|
+
],
|
|
49
|
+
[
|
|
50
|
+
"suffixIcon",
|
|
51
|
+
"seed-list-item__suffixIcon"
|
|
52
|
+
]
|
|
53
|
+
];
|
|
54
|
+
|
|
55
|
+
const defaultVariant = {
|
|
56
|
+
"highlighted": false,
|
|
57
|
+
"pressed": false,
|
|
58
|
+
"disabled": false
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const compoundVariants = [];
|
|
62
|
+
|
|
63
|
+
export const listItemVariantMap = {
|
|
64
|
+
"highlighted": [
|
|
65
|
+
true,
|
|
66
|
+
false
|
|
67
|
+
],
|
|
68
|
+
"pressed": [
|
|
69
|
+
true,
|
|
70
|
+
false
|
|
71
|
+
],
|
|
72
|
+
"disabled": [
|
|
73
|
+
true,
|
|
74
|
+
false
|
|
75
|
+
]
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export const listItemVariantKeys = Object.keys(listItemVariantMap);
|
|
79
|
+
|
|
80
|
+
export function listItem(props) {
|
|
81
|
+
return Object.fromEntries(
|
|
82
|
+
listItemSlotNames.map(([slot, className]) => {
|
|
83
|
+
return [
|
|
84
|
+
slot,
|
|
85
|
+
createClassName(className, mergeVariants(defaultVariant, props), compoundVariants),
|
|
86
|
+
];
|
|
87
|
+
}),
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
Object.assign(listItem, { splitVariantProps: (props) => splitVariantProps(props, listItemVariantMap) });
|
|
92
|
+
|
|
93
|
+
// @recipe(seed): list-item
|
package/recipes/list.css
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
declare interface ListVariant {
|
|
2
|
+
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
declare type ListVariantMap = {
|
|
6
|
+
[key in keyof ListVariant]: Array<ListVariant[key]>;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export declare type ListVariantProps = Partial<ListVariant>;
|
|
10
|
+
|
|
11
|
+
export declare const listVariantMap: ListVariantMap;
|
|
12
|
+
|
|
13
|
+
export declare const list: ((
|
|
14
|
+
props?: ListVariantProps,
|
|
15
|
+
) => string) & {
|
|
16
|
+
splitVariantProps: <T extends ListVariantProps>(
|
|
17
|
+
props: T,
|
|
18
|
+
) => [ListVariantProps, Omit<T, keyof ListVariantProps>];
|
|
19
|
+
}
|