@kwtv/components 0.2.0 → 0.4.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 +52 -9
- package/package.json +2 -2
- package/src/astro/Accordion.astro +10 -6
- package/src/astro/AccordionItem.astro +55 -45
- package/src/astro/ActiveFilterTags.astro +41 -28
- package/src/astro/Alert.astro +45 -41
- package/src/astro/Badge.astro +80 -76
- package/src/astro/Band.astro +104 -58
- package/src/astro/Breadcrumb.astro +38 -30
- package/src/astro/Button.astro +135 -129
- package/src/astro/Card.astro +72 -62
- package/src/astro/CartLine.astro +72 -58
- package/src/astro/Checkbox.astro +36 -32
- package/src/astro/Chip.astro +68 -64
- package/src/astro/ChipRail.astro +6 -1
- package/src/astro/DotGrid.astro +55 -42
- package/src/astro/EmptyState.astro +29 -23
- package/src/astro/FilterGroup.astro +29 -26
- package/src/astro/Filters.astro +57 -47
- package/src/astro/Footer.astro +195 -178
- package/src/astro/FooterColumn.astro +39 -35
- package/src/astro/Header.astro +80 -67
- package/src/astro/Icon.astro +4 -2
- package/src/astro/IconButton.astro +67 -61
- package/src/astro/Marquee.astro +43 -41
- package/src/astro/NavDropdown.astro +169 -149
- package/src/astro/NavLink.astro +59 -56
- package/src/astro/Newsletter.astro +64 -56
- package/src/astro/Pager.astro +71 -46
- package/src/astro/PickCard.astro +72 -68
- package/src/astro/ProductCard.astro +134 -119
- package/src/astro/Radio.astro +36 -32
- package/src/astro/Skeleton.astro +60 -42
- package/src/astro/Social.astro +26 -21
- package/src/astro/StepIndicator.astro +70 -54
- package/src/astro/Sticker.astro +74 -49
- package/src/astro/Swatch.astro +44 -40
- package/src/astro/SwipeCarousel.astro +5 -1
- package/src/astro/Table.astro +66 -56
- package/src/astro/TableCard.astro +45 -37
- package/src/astro/TextField.astro +104 -91
- package/src/astro/Totals.astro +39 -35
- package/src/react/Drawer.css +60 -56
- package/src/react/Drawer.tsx +1 -5
- package/src/react/Modal.css +97 -93
- package/src/react/Modal.tsx +4 -6
- package/src/react/NewsCarousel.css +108 -104
- package/src/react/NewsCarousel.tsx +7 -1
- package/src/react/QuantityStepper.css +84 -80
- package/src/react/Select.css +159 -155
- package/src/react/Select.tsx +8 -2
- package/src/react/Toast.css +128 -124
- package/src/react/Toast.tsx +38 -4
- package/src/styles/base.css +30 -26
- package/src/styles/controls.css +183 -179
- package/src/styles/motion.css +203 -199
package/src/styles/motion.css
CHANGED
|
@@ -14,225 +14,229 @@
|
|
|
14
14
|
* Import `@kwtv/tokens/tokens.css` before this file.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
here; Burgundy replaced both, so the alternative tone is Sage instead. */
|
|
19
|
-
.pl-root {
|
|
20
|
-
--play: var(--accent);
|
|
21
|
-
}
|
|
22
|
-
.pl-root[data-tone="sage"] {
|
|
23
|
-
--play: var(--primary);
|
|
24
|
-
}
|
|
17
|
+
@layer reset, tokens, base, components, motion, utilities;
|
|
25
18
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
.pl-lift:focus-within {
|
|
36
|
-
transform: translateY(-5px) rotate(var(--tilt));
|
|
37
|
-
box-shadow: var(--shadow-lg);
|
|
38
|
-
}
|
|
39
|
-
.pl-lift :is(img, .ui-product__img) {
|
|
40
|
-
transition: transform var(--duration-base) var(--ease-standard);
|
|
41
|
-
}
|
|
42
|
-
.pl-lift:hover :is(img, .ui-product__img) {
|
|
43
|
-
transform: scale(1.04);
|
|
44
|
-
}
|
|
19
|
+
@layer motion {
|
|
20
|
+
/* The default tone is the accent. Rust and Clay used to be the two choices
|
|
21
|
+
here; Burgundy replaced both, so the alternative tone is Sage instead. */
|
|
22
|
+
.pl-root {
|
|
23
|
+
--play: var(--accent);
|
|
24
|
+
}
|
|
25
|
+
.pl-root[data-tone="sage"] {
|
|
26
|
+
--play: var(--primary);
|
|
27
|
+
}
|
|
45
28
|
|
|
46
|
-
/*
|
|
47
|
-
.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
.pl-ul:focus-visible::after {
|
|
66
|
-
transform: scaleX(1);
|
|
67
|
-
}
|
|
68
|
-
.pl-hero .pl-ul::after {
|
|
69
|
-
background: var(--sage-text);
|
|
70
|
-
}
|
|
29
|
+
/* Hover lift. −5 px, shadow-lg, photo scales slightly. --tilt rotates, never
|
|
30
|
+
past 6deg, and never on text. */
|
|
31
|
+
.pl-lift {
|
|
32
|
+
--tilt: 0deg;
|
|
33
|
+
transition:
|
|
34
|
+
transform var(--duration-base) var(--ease-standard),
|
|
35
|
+
box-shadow var(--duration-base) var(--ease-standard);
|
|
36
|
+
}
|
|
37
|
+
.pl-lift:hover,
|
|
38
|
+
.pl-lift:focus-within {
|
|
39
|
+
transform: translateY(-5px) rotate(var(--tilt));
|
|
40
|
+
box-shadow: var(--shadow-lg);
|
|
41
|
+
}
|
|
42
|
+
.pl-lift :is(img, .ui-product__img) {
|
|
43
|
+
transition: transform var(--duration-base) var(--ease-standard);
|
|
44
|
+
}
|
|
45
|
+
.pl-lift:hover :is(img, .ui-product__img) {
|
|
46
|
+
transform: scale(1.04);
|
|
47
|
+
}
|
|
71
48
|
|
|
72
|
-
/*
|
|
73
|
-
.pl-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
49
|
+
/* Drawn underline. 3 px, left to right, 200 ms. Sage in the hero. */
|
|
50
|
+
.pl-ul {
|
|
51
|
+
position: relative;
|
|
52
|
+
text-decoration: none;
|
|
53
|
+
color: inherit;
|
|
54
|
+
}
|
|
55
|
+
.pl-ul::after {
|
|
56
|
+
content: "";
|
|
57
|
+
position: absolute;
|
|
58
|
+
left: 0;
|
|
59
|
+
right: 0;
|
|
60
|
+
bottom: -2px;
|
|
61
|
+
height: 3px;
|
|
62
|
+
background: var(--play);
|
|
63
|
+
transform: scaleX(0);
|
|
64
|
+
transform-origin: left;
|
|
65
|
+
transition: transform var(--duration-base) var(--ease-standard);
|
|
66
|
+
}
|
|
67
|
+
.pl-ul:hover::after,
|
|
68
|
+
.pl-ul:focus-visible::after {
|
|
69
|
+
transform: scaleX(1);
|
|
70
|
+
}
|
|
71
|
+
.pl-hero .pl-ul::after {
|
|
72
|
+
background: var(--sage-text);
|
|
73
|
+
}
|
|
81
74
|
|
|
82
|
-
/*
|
|
83
|
-
.pl-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
.pl-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
.pl-tr {
|
|
92
|
-
transition: box-shadow var(--duration-fast) var(--ease-standard);
|
|
93
|
-
}
|
|
94
|
-
.pl-tr:hover {
|
|
95
|
-
box-shadow: inset 3px 0 0 var(--play);
|
|
96
|
-
}
|
|
75
|
+
/* Arrow nudge. +5 px on the parent's hover. */
|
|
76
|
+
.pl-arrow {
|
|
77
|
+
display: inline-flex;
|
|
78
|
+
transition: transform var(--duration-fast) var(--ease-standard);
|
|
79
|
+
}
|
|
80
|
+
:hover > .pl-arrow,
|
|
81
|
+
:focus-visible > .pl-arrow {
|
|
82
|
+
transform: translateX(5px);
|
|
83
|
+
}
|
|
97
84
|
|
|
98
|
-
/*
|
|
99
|
-
.pl-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
@keyframes pl-rise {
|
|
103
|
-
from {
|
|
104
|
-
opacity: 0;
|
|
105
|
-
transform: translateY(10px);
|
|
85
|
+
/* Row nudge. +6 px, and a table row gets a 3 px edge. */
|
|
86
|
+
.pl-row {
|
|
87
|
+
display: block;
|
|
88
|
+
transition: transform var(--duration-fast) var(--ease-standard);
|
|
106
89
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
transform:
|
|
90
|
+
.pl-row:hover,
|
|
91
|
+
.pl-row:focus-visible {
|
|
92
|
+
transform: translateX(6px);
|
|
110
93
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
transition: transform var(--duration-fast) var(--ease-standard);
|
|
114
|
-
}
|
|
115
|
-
.pl-press:active {
|
|
116
|
-
transform: scale(0.97);
|
|
117
|
-
}
|
|
118
|
-
.pl-btn-bounce:hover {
|
|
119
|
-
animation: pl-wiggle var(--duration-slower) var(--ease-spring);
|
|
120
|
-
}
|
|
121
|
-
@keyframes pl-wiggle {
|
|
122
|
-
25% {
|
|
123
|
-
transform: rotate(-2deg);
|
|
94
|
+
.pl-tr {
|
|
95
|
+
transition: box-shadow var(--duration-fast) var(--ease-standard);
|
|
124
96
|
}
|
|
125
|
-
|
|
126
|
-
|
|
97
|
+
.pl-tr:hover {
|
|
98
|
+
box-shadow: inset 3px 0 0 var(--play);
|
|
127
99
|
}
|
|
128
|
-
}
|
|
129
100
|
|
|
130
|
-
/*
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
to {
|
|
134
|
-
background-position: 28px 28px;
|
|
101
|
+
/* Entrance and press. Rise is staggered by animation-delay at the call site. */
|
|
102
|
+
.pl-rise {
|
|
103
|
+
animation: pl-rise var(--duration-slow) var(--ease-enter) both;
|
|
135
104
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
105
|
+
@keyframes pl-rise {
|
|
106
|
+
from {
|
|
107
|
+
opacity: 0;
|
|
108
|
+
transform: translateY(10px);
|
|
109
|
+
}
|
|
110
|
+
to {
|
|
111
|
+
opacity: 1;
|
|
112
|
+
transform: translateY(0);
|
|
113
|
+
}
|
|
140
114
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
50% {
|
|
144
|
-
transform: translateY(4px);
|
|
115
|
+
.pl-press {
|
|
116
|
+
transition: transform var(--duration-fast) var(--ease-standard);
|
|
145
117
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
118
|
+
.pl-press:active {
|
|
119
|
+
transform: scale(0.97);
|
|
120
|
+
}
|
|
121
|
+
.pl-btn-bounce:hover {
|
|
122
|
+
animation: pl-wiggle var(--duration-slower) var(--ease-spring);
|
|
123
|
+
}
|
|
124
|
+
@keyframes pl-wiggle {
|
|
125
|
+
25% {
|
|
126
|
+
transform: rotate(-2deg);
|
|
127
|
+
}
|
|
128
|
+
75% {
|
|
129
|
+
transform: rotate(2deg);
|
|
130
|
+
}
|
|
150
131
|
}
|
|
151
|
-
}
|
|
152
132
|
|
|
153
|
-
/*
|
|
154
|
-
.
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
font-weight: var(--weight-medium);
|
|
176
|
-
text-decoration: none;
|
|
177
|
-
white-space: nowrap;
|
|
178
|
-
}
|
|
179
|
-
.pl-chip:hover {
|
|
180
|
-
border-color: var(--border-strong);
|
|
181
|
-
color: var(--text);
|
|
182
|
-
}
|
|
183
|
-
.pl-chip:focus-visible {
|
|
184
|
-
outline: 2px solid var(--focus);
|
|
185
|
-
outline-offset: 2px;
|
|
186
|
-
}
|
|
187
|
-
.pl-chip[data-on="1"] {
|
|
188
|
-
border-color: var(--sage-xdark);
|
|
189
|
-
background: var(--sage-xdark);
|
|
190
|
-
color: var(--ivory-light);
|
|
191
|
-
}
|
|
133
|
+
/* Decorative loops for the composed home-page pieces. All aria-hidden at the
|
|
134
|
+
call site. */
|
|
135
|
+
@keyframes pl-drift {
|
|
136
|
+
to {
|
|
137
|
+
background-position: 28px 28px;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
@keyframes pl-spin {
|
|
141
|
+
to {
|
|
142
|
+
transform: rotate(360deg);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
@keyframes pl-bob {
|
|
146
|
+
50% {
|
|
147
|
+
transform: translateY(4px);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
@keyframes pl-marquee {
|
|
151
|
+
to {
|
|
152
|
+
transform: translateX(-50%);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
192
155
|
|
|
193
|
-
/*
|
|
194
|
-
.pl-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
156
|
+
/* Horizontal category rail. The current item is marked with data-on. */
|
|
157
|
+
.pl-chips {
|
|
158
|
+
display: flex;
|
|
159
|
+
gap: var(--space-2);
|
|
160
|
+
overflow-x: auto;
|
|
161
|
+
padding: var(--space-0-5, 2px) var(--space-5) var(--space-2);
|
|
162
|
+
scrollbar-width: none;
|
|
163
|
+
}
|
|
164
|
+
.pl-chips::-webkit-scrollbar {
|
|
165
|
+
display: none;
|
|
166
|
+
}
|
|
167
|
+
.pl-chip {
|
|
168
|
+
flex: none;
|
|
169
|
+
min-height: 44px;
|
|
170
|
+
padding: var(--space-2) var(--space-3-5, 14px);
|
|
171
|
+
display: inline-flex;
|
|
172
|
+
align-items: center;
|
|
173
|
+
border: 1px solid var(--border);
|
|
174
|
+
border-radius: var(--radius-full);
|
|
175
|
+
background: var(--surface);
|
|
176
|
+
color: var(--text);
|
|
177
|
+
font-size: var(--text-sm);
|
|
178
|
+
font-weight: var(--weight-medium);
|
|
179
|
+
text-decoration: none;
|
|
180
|
+
white-space: nowrap;
|
|
181
|
+
}
|
|
182
|
+
.pl-chip:hover {
|
|
183
|
+
border-color: var(--border-strong);
|
|
184
|
+
color: var(--text);
|
|
185
|
+
}
|
|
186
|
+
.pl-chip:focus-visible {
|
|
187
|
+
outline: 2px solid var(--focus);
|
|
188
|
+
outline-offset: 2px;
|
|
189
|
+
}
|
|
190
|
+
.pl-chip[data-on="1"] {
|
|
191
|
+
border-color: var(--sage-xdark);
|
|
192
|
+
background: var(--sage-xdark);
|
|
193
|
+
color: var(--ivory-light);
|
|
194
|
+
}
|
|
214
195
|
|
|
215
|
-
/*
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
196
|
+
/* Mobile product rail. Consumers use a regular grid at wider viewports. */
|
|
197
|
+
.pl-carousel {
|
|
198
|
+
display: flex;
|
|
199
|
+
gap: var(--space-3);
|
|
200
|
+
overflow-x: auto;
|
|
201
|
+
scroll-snap-type: x mandatory;
|
|
202
|
+
-webkit-overflow-scrolling: touch;
|
|
203
|
+
scrollbar-width: none;
|
|
204
|
+
padding: 0 var(--space-5) var(--space-2);
|
|
205
|
+
}
|
|
206
|
+
.pl-carousel::-webkit-scrollbar {
|
|
207
|
+
display: none;
|
|
208
|
+
}
|
|
209
|
+
.pl-carousel > * {
|
|
210
|
+
flex: 0 0 86%;
|
|
211
|
+
scroll-snap-align: center;
|
|
212
|
+
}
|
|
213
|
+
.pl-carousel:focus-visible {
|
|
214
|
+
outline: 2px solid var(--focus);
|
|
215
|
+
outline-offset: 2px;
|
|
216
|
+
}
|
|
223
217
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
.pl-root
|
|
227
|
-
.pl-root *::
|
|
218
|
+
/* The kill switch and the OS setting both stop every loop and transition in
|
|
219
|
+
the layer, so it degrades to the plain components. */
|
|
220
|
+
.pl-root[data-motion="off"] *,
|
|
221
|
+
.pl-root[data-motion="off"] *::after,
|
|
222
|
+
.pl-root[data-motion="off"] *::before {
|
|
228
223
|
animation: none !important;
|
|
229
224
|
transition: none !important;
|
|
230
225
|
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
226
|
+
|
|
227
|
+
@media (prefers-reduced-motion: reduce) {
|
|
228
|
+
.pl-root *,
|
|
229
|
+
.pl-root *::after,
|
|
230
|
+
.pl-root *::before {
|
|
231
|
+
animation: none !important;
|
|
232
|
+
transition: none !important;
|
|
233
|
+
}
|
|
234
|
+
.pl-lift:hover,
|
|
235
|
+
.pl-lift:focus-within {
|
|
236
|
+
transform: none;
|
|
237
|
+
}
|
|
238
|
+
.pl-ul::after {
|
|
239
|
+
transform: scaleX(1);
|
|
240
|
+
}
|
|
237
241
|
}
|
|
238
242
|
}
|