@kwtv/components 0.3.0 → 0.5.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 +35 -0
- package/package.json +2 -2
- package/src/astro/Accordion.astro +10 -6
- package/src/astro/AccordionItem.astro +47 -43
- package/src/astro/ActiveFilterTags.astro +29 -25
- package/src/astro/Alert.astro +46 -41
- package/src/astro/Badge.astro +80 -76
- package/src/astro/Band.astro +104 -58
- package/src/astro/Breadcrumb.astro +33 -29
- package/src/astro/Button.astro +132 -128
- package/src/astro/Card.astro +64 -60
- package/src/astro/CartLine.astro +59 -55
- package/src/astro/Checkbox.astro +37 -32
- package/src/astro/Chip.astro +68 -64
- package/src/astro/DotGrid.astro +50 -46
- package/src/astro/EmptyState.astro +26 -22
- package/src/astro/FilterGroup.astro +29 -25
- package/src/astro/Filters.astro +50 -46
- package/src/astro/Footer.astro +179 -175
- package/src/astro/FooterColumn.astro +39 -35
- package/src/astro/Header.astro +67 -63
- package/src/astro/Icon.astro +1 -1
- package/src/astro/IconButton.astro +64 -60
- package/src/astro/Marquee.astro +33 -29
- package/src/astro/NavDropdown.astro +120 -116
- package/src/astro/NavLink.astro +59 -55
- package/src/astro/Newsletter.astro +58 -54
- package/src/astro/Pager.astro +43 -39
- package/src/astro/PickCard.astro +72 -68
- package/src/astro/ProductCard.astro +120 -116
- package/src/astro/Radio.astro +36 -32
- package/src/astro/Skeleton.astro +43 -39
- package/src/astro/Social.astro +26 -22
- package/src/astro/StepIndicator.astro +55 -51
- package/src/astro/Sticker.astro +50 -46
- package/src/astro/Swatch.astro +44 -40
- package/src/astro/Table.astro +58 -54
- package/src/astro/TableCard.astro +39 -35
- package/src/astro/TextField.astro +92 -88
- package/src/astro/Totals.astro +39 -35
- package/src/react/Drawer.css +60 -56
- package/src/react/Modal.css +97 -93
- package/src/react/NewsCarousel.css +108 -104
- package/src/react/QuantityStepper.css +84 -80
- package/src/react/Select.css +159 -155
- package/src/react/Toast.css +128 -124
- package/src/styles/base.css +30 -26
- package/src/styles/controls.css +183 -179
- package/src/styles/motion.css +203 -199
|
@@ -1,93 +1,97 @@
|
|
|
1
1
|
/* Quantity stepper. All values from the design-system tokens. */
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
display: inline-flex;
|
|
5
|
-
align-items: center;
|
|
6
|
-
border: 1px solid var(--border);
|
|
7
|
-
border-radius: var(--radius-md);
|
|
8
|
-
background: var(--surface);
|
|
9
|
-
overflow: hidden;
|
|
10
|
-
}
|
|
3
|
+
@layer reset, tokens, base, components, motion, utilities;
|
|
11
4
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
font-size: var(--text-lg);
|
|
22
|
-
line-height: 1;
|
|
23
|
-
cursor: pointer;
|
|
24
|
-
transition: background-color var(--duration-fast) var(--ease-standard);
|
|
25
|
-
}
|
|
5
|
+
@layer components {
|
|
6
|
+
.ui-qty {
|
|
7
|
+
display: inline-flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
border: 1px solid var(--border);
|
|
10
|
+
border-radius: var(--radius-md);
|
|
11
|
+
background: var(--surface);
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
}
|
|
26
14
|
|
|
27
|
-
.ui-qty button
|
|
28
|
-
|
|
29
|
-
|
|
15
|
+
.ui-qty button {
|
|
16
|
+
display: inline-flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
width: 40px;
|
|
20
|
+
height: 40px;
|
|
21
|
+
background: none;
|
|
22
|
+
border: 0;
|
|
23
|
+
color: var(--text);
|
|
24
|
+
font-size: var(--text-lg);
|
|
25
|
+
line-height: 1;
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
transition: background-color var(--duration-fast) var(--ease-standard);
|
|
28
|
+
}
|
|
30
29
|
|
|
31
|
-
.ui-qty button:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
30
|
+
.ui-qty button:hover:not(:disabled) {
|
|
31
|
+
background: var(--surface-hover);
|
|
32
|
+
}
|
|
35
33
|
|
|
36
|
-
.ui-qty button:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
34
|
+
.ui-qty button:focus-visible {
|
|
35
|
+
outline: 2px solid var(--focus);
|
|
36
|
+
outline-offset: -2px;
|
|
37
|
+
}
|
|
40
38
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
/* `.ui-qty button` is (0,1,1) and would otherwise win over a lone class, so
|
|
46
|
-
these are scoped the same way rather than reaching for !important. */
|
|
47
|
-
.ui-qty button.ui-qty__remove {
|
|
48
|
-
color: var(--danger);
|
|
49
|
-
}
|
|
50
|
-
.ui-qty button.ui-qty__remove:hover:not(:disabled) {
|
|
51
|
-
background: var(--danger-bg);
|
|
52
|
-
}
|
|
53
|
-
.ui-qty__remove svg {
|
|
54
|
-
display: block;
|
|
55
|
-
}
|
|
39
|
+
.ui-qty button:disabled {
|
|
40
|
+
opacity: 0.4;
|
|
41
|
+
cursor: not-allowed;
|
|
42
|
+
}
|
|
56
43
|
|
|
57
|
-
.
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
44
|
+
/* The bin, shown instead of minus when the last one would be removed.
|
|
45
|
+
--danger, because it destroys the line rather than decrementing it. The
|
|
46
|
+
icon is not the only signal: the button carries an aria-label, and hover
|
|
47
|
+
fills it so the intent is obvious before the click. */
|
|
48
|
+
/* `.ui-qty button` is (0,1,1) and would otherwise win over a lone class, so
|
|
49
|
+
these are scoped the same way rather than reaching for !important. */
|
|
50
|
+
.ui-qty button.ui-qty__remove {
|
|
51
|
+
color: var(--danger);
|
|
52
|
+
}
|
|
53
|
+
.ui-qty button.ui-qty__remove:hover:not(:disabled) {
|
|
54
|
+
background: var(--danger-bg);
|
|
55
|
+
}
|
|
56
|
+
.ui-qty__remove svg {
|
|
57
|
+
display: block;
|
|
58
|
+
}
|
|
65
59
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
font-size: var(--text-base);
|
|
75
|
-
}
|
|
60
|
+
.ui-qty__val {
|
|
61
|
+
min-width: 40px;
|
|
62
|
+
text-align: center;
|
|
63
|
+
font-size: var(--text-sm);
|
|
64
|
+
font-weight: var(--weight-semibold);
|
|
65
|
+
font-variant-numeric: tabular-nums;
|
|
66
|
+
color: var(--text);
|
|
67
|
+
}
|
|
76
68
|
|
|
77
|
-
.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
69
|
+
/* Large, 48 px, for the product page. */
|
|
70
|
+
.ui-qty--lg button {
|
|
71
|
+
width: 48px;
|
|
72
|
+
height: 48px;
|
|
73
|
+
font-size: var(--text-xl);
|
|
74
|
+
}
|
|
75
|
+
.ui-qty--lg .ui-qty__val {
|
|
76
|
+
min-width: 48px;
|
|
77
|
+
font-size: var(--text-base);
|
|
78
|
+
}
|
|
88
79
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
80
|
+
.ui-sr-only {
|
|
81
|
+
position: absolute;
|
|
82
|
+
width: 1px;
|
|
83
|
+
height: 1px;
|
|
84
|
+
padding: 0;
|
|
85
|
+
margin: -1px;
|
|
86
|
+
overflow: hidden;
|
|
87
|
+
clip-path: inset(50%);
|
|
88
|
+
white-space: nowrap;
|
|
89
|
+
border: 0;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
@media (prefers-reduced-motion: reduce) {
|
|
93
|
+
.ui-qty button {
|
|
94
|
+
transition: none;
|
|
95
|
+
}
|
|
92
96
|
}
|
|
93
97
|
}
|
package/src/react/Select.css
CHANGED
|
@@ -1,183 +1,187 @@
|
|
|
1
1
|
/* Select. Trigger plus listbox. All values from the design-system tokens. */
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
display: flex;
|
|
5
|
-
flex-direction: column;
|
|
6
|
-
gap: var(--space-1-5);
|
|
7
|
-
}
|
|
3
|
+
@layer reset, tokens, base, components, motion, utilities;
|
|
8
4
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
@layer components {
|
|
6
|
+
.ui-field {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
gap: var(--space-1-5);
|
|
10
|
+
}
|
|
14
11
|
|
|
15
|
-
.ui-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
.ui-field__label {
|
|
13
|
+
font-size: var(--text-sm);
|
|
14
|
+
font-weight: var(--weight-medium);
|
|
15
|
+
color: var(--text);
|
|
16
|
+
}
|
|
19
17
|
|
|
20
|
-
.ui-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
18
|
+
.ui-field__req {
|
|
19
|
+
color: var(--danger);
|
|
20
|
+
margin-inline-start: var(--space-0-5);
|
|
21
|
+
}
|
|
25
22
|
|
|
26
|
-
.ui-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
line-height: var(--leading-xs);
|
|
32
|
-
color: var(--danger);
|
|
33
|
-
}
|
|
23
|
+
.ui-field__hint {
|
|
24
|
+
font-size: var(--text-xs);
|
|
25
|
+
line-height: var(--leading-xs);
|
|
26
|
+
color: var(--text-muted);
|
|
27
|
+
}
|
|
34
28
|
|
|
35
|
-
.ui-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
29
|
+
.ui-field__error {
|
|
30
|
+
display: inline-flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
gap: var(--space-1-5);
|
|
33
|
+
font-size: var(--text-xs);
|
|
34
|
+
line-height: var(--leading-xs);
|
|
35
|
+
color: var(--danger);
|
|
36
|
+
}
|
|
39
37
|
|
|
40
|
-
.ui-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
gap: var(--space-2);
|
|
45
|
-
width: 100%;
|
|
46
|
-
min-height: 40px;
|
|
47
|
-
padding: 0 var(--space-3);
|
|
48
|
-
background: var(--surface);
|
|
49
|
-
border: 1px solid var(--border-strong);
|
|
50
|
-
border-radius: var(--radius-md);
|
|
51
|
-
color: var(--text);
|
|
52
|
-
font-family: var(--font-sans);
|
|
53
|
-
font-size: var(--text-sm);
|
|
54
|
-
text-align: start;
|
|
55
|
-
cursor: pointer;
|
|
56
|
-
transition: border-color var(--duration-fast) var(--ease-standard);
|
|
57
|
-
}
|
|
38
|
+
.ui-select {
|
|
39
|
+
position: relative;
|
|
40
|
+
display: block;
|
|
41
|
+
}
|
|
58
42
|
|
|
59
|
-
.ui-select__btn
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
43
|
+
.ui-select__btn {
|
|
44
|
+
display: flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
justify-content: space-between;
|
|
47
|
+
gap: var(--space-2);
|
|
48
|
+
width: 100%;
|
|
49
|
+
min-height: 40px;
|
|
50
|
+
padding: 0 var(--space-3);
|
|
51
|
+
background: var(--surface);
|
|
52
|
+
border: 1px solid var(--border-strong);
|
|
53
|
+
border-radius: var(--radius-md);
|
|
54
|
+
color: var(--text);
|
|
55
|
+
font-family: var(--font-sans);
|
|
56
|
+
font-size: var(--text-sm);
|
|
57
|
+
text-align: start;
|
|
58
|
+
cursor: pointer;
|
|
59
|
+
transition: border-color var(--duration-fast) var(--ease-standard);
|
|
60
|
+
}
|
|
63
61
|
|
|
64
|
-
.ui-select__btn:
|
|
65
|
-
.ui-select__btn.is-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
box-shadow: 0 0 0 4px var(--focus-outer);
|
|
69
|
-
}
|
|
62
|
+
.ui-select__btn:hover,
|
|
63
|
+
.ui-select__btn.is-hover {
|
|
64
|
+
border-color: var(--border-strong);
|
|
65
|
+
}
|
|
70
66
|
|
|
71
|
-
.ui-select__btn:
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
67
|
+
.ui-select__btn:focus-visible,
|
|
68
|
+
.ui-select__btn.is-focus {
|
|
69
|
+
outline: 2px solid var(--focus);
|
|
70
|
+
outline-offset: 2px;
|
|
71
|
+
box-shadow: 0 0 0 4px var(--focus-outer);
|
|
72
|
+
}
|
|
75
73
|
|
|
76
|
-
.ui-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
74
|
+
.ui-select__btn:disabled {
|
|
75
|
+
opacity: 0.5;
|
|
76
|
+
cursor: not-allowed;
|
|
77
|
+
}
|
|
81
78
|
|
|
82
|
-
.ui-select__value
|
|
83
|
-
|
|
84
|
-
|
|
79
|
+
.ui-select__value {
|
|
80
|
+
overflow: hidden;
|
|
81
|
+
text-overflow: ellipsis;
|
|
82
|
+
white-space: nowrap;
|
|
83
|
+
}
|
|
85
84
|
|
|
86
|
-
.ui-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
color: var(--text-muted);
|
|
90
|
-
}
|
|
85
|
+
.ui-select__value--empty {
|
|
86
|
+
color: var(--text-muted);
|
|
87
|
+
}
|
|
91
88
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
89
|
+
.ui-select__chev {
|
|
90
|
+
display: inline-flex;
|
|
91
|
+
flex: none;
|
|
92
|
+
color: var(--text-muted);
|
|
93
|
+
}
|
|
98
94
|
|
|
99
|
-
/*
|
|
100
|
-
.ui-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
z-index: var(--z-dropdown);
|
|
106
|
-
max-height: 272px;
|
|
107
|
-
overflow-y: auto;
|
|
108
|
-
padding: var(--space-1);
|
|
109
|
-
background: var(--surface);
|
|
110
|
-
border: 1px solid var(--border);
|
|
111
|
-
border-radius: var(--radius-md);
|
|
112
|
-
box-shadow: var(--shadow-lg);
|
|
113
|
-
}
|
|
95
|
+
/* Invalid: 2 px danger border. */
|
|
96
|
+
.ui-select--invalid .ui-select__btn {
|
|
97
|
+
border-width: 2px;
|
|
98
|
+
border-color: var(--danger);
|
|
99
|
+
padding-inline: calc(var(--space-3) - 1px);
|
|
100
|
+
}
|
|
114
101
|
|
|
115
|
-
.
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
102
|
+
/* The list. 6 px offset, 272 px max height, 36 px rows. */
|
|
103
|
+
.ui-select__list {
|
|
104
|
+
position: absolute;
|
|
105
|
+
top: calc(100% + var(--space-1-5));
|
|
106
|
+
left: 0;
|
|
107
|
+
right: 0;
|
|
108
|
+
z-index: var(--z-dropdown);
|
|
109
|
+
max-height: 272px;
|
|
110
|
+
overflow-y: auto;
|
|
111
|
+
padding: var(--space-1);
|
|
112
|
+
background: var(--surface);
|
|
113
|
+
border: 1px solid var(--border);
|
|
114
|
+
border-radius: var(--radius-md);
|
|
115
|
+
box-shadow: var(--shadow-lg);
|
|
116
|
+
}
|
|
131
117
|
|
|
132
|
-
.ui-select__opt
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
118
|
+
.ui-select__opt {
|
|
119
|
+
display: flex;
|
|
120
|
+
align-items: center;
|
|
121
|
+
gap: var(--space-2);
|
|
122
|
+
width: 100%;
|
|
123
|
+
min-height: 36px;
|
|
124
|
+
padding: 0 var(--space-2);
|
|
125
|
+
background: transparent;
|
|
126
|
+
border: 0;
|
|
127
|
+
border-radius: var(--radius-sm);
|
|
128
|
+
color: var(--text);
|
|
129
|
+
font-family: var(--font-sans);
|
|
130
|
+
font-size: var(--text-sm);
|
|
131
|
+
text-align: start;
|
|
132
|
+
cursor: pointer;
|
|
133
|
+
}
|
|
137
134
|
|
|
138
|
-
|
|
139
|
-
.ui-select__opt
|
|
140
|
-
|
|
141
|
-
|
|
135
|
+
.ui-select__opt:hover,
|
|
136
|
+
.ui-select__opt.is-hover,
|
|
137
|
+
.ui-select__opt.is-focus {
|
|
138
|
+
background: var(--surface-hover);
|
|
139
|
+
}
|
|
142
140
|
|
|
143
|
-
.
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
color: var(--primary);
|
|
148
|
-
visibility: hidden;
|
|
149
|
-
}
|
|
141
|
+
/* Selection marked by the tick and a weight change, not the fill alone. */
|
|
142
|
+
.ui-select__opt[aria-selected="true"] {
|
|
143
|
+
font-weight: var(--weight-semibold);
|
|
144
|
+
}
|
|
150
145
|
|
|
151
|
-
.ui-
|
|
152
|
-
|
|
153
|
-
|
|
146
|
+
.ui-select__tick {
|
|
147
|
+
display: inline-flex;
|
|
148
|
+
flex: none;
|
|
149
|
+
width: 13px;
|
|
150
|
+
color: var(--primary);
|
|
151
|
+
visibility: hidden;
|
|
152
|
+
}
|
|
154
153
|
|
|
155
|
-
.ui-select__opt.
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
cursor: not-allowed;
|
|
159
|
-
}
|
|
154
|
+
.ui-select__opt[aria-selected="true"] .ui-select__tick {
|
|
155
|
+
visibility: visible;
|
|
156
|
+
}
|
|
160
157
|
|
|
161
|
-
|
|
162
|
-
.ui-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
font-size: var(--text-2xs);
|
|
167
|
-
font-weight: var(--weight-semibold);
|
|
168
|
-
letter-spacing: var(--tracking-wider);
|
|
169
|
-
text-transform: uppercase;
|
|
170
|
-
color: var(--text-muted);
|
|
171
|
-
}
|
|
158
|
+
.ui-select__opt.is-disabled,
|
|
159
|
+
.ui-select__opt[aria-disabled="true"] {
|
|
160
|
+
opacity: 0.5;
|
|
161
|
+
cursor: not-allowed;
|
|
162
|
+
}
|
|
172
163
|
|
|
173
|
-
|
|
174
|
-
.ui-
|
|
175
|
-
|
|
164
|
+
/* Group headings. Not selectable. */
|
|
165
|
+
.ui-select__grouplabel {
|
|
166
|
+
display: block;
|
|
167
|
+
padding: var(--space-2) var(--space-2) var(--space-1);
|
|
168
|
+
font-family: var(--font-mono);
|
|
169
|
+
font-size: var(--text-2xs);
|
|
170
|
+
font-weight: var(--weight-semibold);
|
|
171
|
+
letter-spacing: var(--tracking-wider);
|
|
172
|
+
text-transform: uppercase;
|
|
173
|
+
color: var(--text-muted);
|
|
176
174
|
}
|
|
177
|
-
}
|
|
178
175
|
|
|
179
|
-
@media (
|
|
180
|
-
|
|
181
|
-
|
|
176
|
+
@media (max-width: 700px), (pointer: coarse) {
|
|
177
|
+
.ui-select__opt {
|
|
178
|
+
min-height: 40px;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
@media (prefers-reduced-motion: reduce) {
|
|
183
|
+
.ui-select__btn {
|
|
184
|
+
transition: none;
|
|
185
|
+
}
|
|
182
186
|
}
|
|
183
187
|
}
|