@sonic-equipment/ui 0.0.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/.eslintrc.js +4 -0
- package/.turbo/turbo-build.log +39 -0
- package/dist/app.css +12 -0
- package/dist/base.css +240 -0
- package/dist/button.css +49 -0
- package/dist/button.js +12 -0
- package/dist/checkbox.css +63 -0
- package/dist/checkbox.js +10 -0
- package/dist/dts/button/button.d.ts +12 -0
- package/dist/dts/button/button.d.ts.map +1 -0
- package/dist/dts/checkbox/checkbox.d.ts +5 -0
- package/dist/dts/checkbox/checkbox.d.ts.map +1 -0
- package/dist/dts/color-filter/color-filter.d.ts +14 -0
- package/dist/dts/color-filter/color-filter.d.ts.map +1 -0
- package/dist/dts/filter/filter.d.ts +8 -0
- package/dist/dts/filter/filter.d.ts.map +1 -0
- package/dist/dts/product-card/product-card.d.ts +10 -0
- package/dist/dts/product-card/product-card.d.ts.map +1 -0
- package/dist/dts/product-listing/product-listing.d.ts +38 -0
- package/dist/dts/product-listing/product-listing.d.ts.map +1 -0
- package/dist/product-card.js +7 -0
- package/dist/product-listing.css +63 -0
- package/dist/product-listing.js +23 -0
- package/dist/reset.css +387 -0
- package/package.json +65 -0
- package/rollup.config.js +71 -0
- package/src/app.css +10 -0
- package/src/button/button.module.css +49 -0
- package/src/button/button.tsx +37 -0
- package/src/checkbox/checkbox.module.css +68 -0
- package/src/checkbox/checkbox.tsx +19 -0
- package/src/color-filter/color-filter.tsx +40 -0
- package/src/filter/filter.tsx +23 -0
- package/src/product-card/product-card.tsx +16 -0
- package/src/product-listing/product-listing.tsx +80 -0
- package/src/reset.css +377 -0
- package/src/tokens/border.css +18 -0
- package/src/tokens/breakpoints.css +30 -0
- package/src/tokens/colors.css +31 -0
- package/src/tokens/font-face.css +150 -0
- package/src/tokens/fonts.css +28 -0
- package/src/tokens/index.css +6 -0
- package/src/tokens/spacing.css +23 -0
- package/tsconfig.json +9 -0
- package/typings.d.ts +1 -0
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
> @sonic-equipment/ui@0.0.0 build /Users/jeroenslor/Projects/sonic-equipment/packages/ui
|
|
4
|
+
> rollup --config
|
|
5
|
+
|
|
6
|
+
[36m
|
|
7
|
+
[1msrc/reset.css[22m → [1mdist/reset.css[22m...[39m
|
|
8
|
+
[1m[33m(!) The emitted file "reset.css" overwrites a previously emitted file of the same name.[39m[22m
|
|
9
|
+
[32mcreated [1mdist/reset.css[22m in [1m700ms[22m[39m
|
|
10
|
+
[36m
|
|
11
|
+
[1msrc/tokens/index.css[22m → [1mdist/base.css[22m...[39m
|
|
12
|
+
[1m[33m(!) The emitted file "base.css" overwrites a previously emitted file of the same name.[39m[22m
|
|
13
|
+
[32mcreated [1mdist/base.css[22m in [1m458ms[22m[39m
|
|
14
|
+
[36m
|
|
15
|
+
[1msrc/app.css[22m → [1mdist/app.css[22m...[39m
|
|
16
|
+
[1m[33m(!) The emitted file "app.css" overwrites a previously emitted file of the same name.[39m[22m
|
|
17
|
+
[32mcreated [1mdist/app.css[22m in [1m400ms[22m[39m
|
|
18
|
+
[36m
|
|
19
|
+
[1msrc/button/button.tsx[22m → [1mdist/button.js[22m...[39m
|
|
20
|
+
[1m[33m(!) Unresolved dependencies[39m[22m
|
|
21
|
+
[90mhttps://rollupjs.org/troubleshooting/#warning-treating-module-as-external-dependency[39m
|
|
22
|
+
[1mclsx[22m (imported by "src/button/button.tsx")
|
|
23
|
+
[1mreact-aria-components[22m (imported by "src/button/button.tsx")
|
|
24
|
+
[32mcreated [1mdist/button.js[22m in [1m462ms[22m[39m
|
|
25
|
+
[36m
|
|
26
|
+
[1msrc/checkbox/checkbox.tsx[22m → [1mdist/checkbox.js[22m...[39m
|
|
27
|
+
[1m[33m(!) Unresolved dependencies[39m[22m
|
|
28
|
+
[90mhttps://rollupjs.org/troubleshooting/#warning-treating-module-as-external-dependency[39m
|
|
29
|
+
[1mreact-aria-components[22m (imported by "src/checkbox/checkbox.tsx")
|
|
30
|
+
[32mcreated [1mdist/checkbox.js[22m in [1m387ms[22m[39m
|
|
31
|
+
[36m
|
|
32
|
+
[1msrc/product-card/product-card.tsx[22m → [1mdist/product-card.js[22m...[39m
|
|
33
|
+
[32mcreated [1mdist/product-card.js[22m in [1m367ms[22m[39m
|
|
34
|
+
[36m
|
|
35
|
+
[1msrc/product-listing/product-listing.tsx[22m → [1mdist/product-listing.js[22m...[39m
|
|
36
|
+
[1m[33m(!) Unresolved dependencies[39m[22m
|
|
37
|
+
[90mhttps://rollupjs.org/troubleshooting/#warning-treating-module-as-external-dependency[39m
|
|
38
|
+
[1mreact-aria-components[22m (imported by "src/checkbox/checkbox.tsx")
|
|
39
|
+
[32mcreated [1mdist/product-listing.js[22m in [1m392ms[22m[39m
|
package/dist/app.css
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
html {
|
|
2
|
+
font-family: var(--font-family-sonic);
|
|
3
|
+
font-size: var(--font-size-base);
|
|
4
|
+
-webkit-text-size-adjust: none;
|
|
5
|
+
-moz-text-size-adjust: none;
|
|
6
|
+
text-size-adjust: none;
|
|
7
|
+
|
|
8
|
+
font-synthesis: none;
|
|
9
|
+
text-rendering: optimizeLegibility;
|
|
10
|
+
-webkit-font-smoothing: antialiased;
|
|
11
|
+
-moz-osx-font-smoothing: grayscale;
|
|
12
|
+
}
|
package/dist/base.css
ADDED
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--font-family-sonic: 'Pancetta', sans-serif;
|
|
3
|
+
|
|
4
|
+
--font-size-20: 0.75rem; /* 12px */
|
|
5
|
+
--font-size-24: 0.875rem; /* 14px */
|
|
6
|
+
--font-size-28: 1rem; /* 16px */
|
|
7
|
+
--font-size-32: 1.125rem; /* 18px */
|
|
8
|
+
--font-size-36: 1.25rem; /* 20px */
|
|
9
|
+
--font-size-40: 1.5rem; /* 24px */
|
|
10
|
+
--font-size-48: 1.875rem;/* 30px */
|
|
11
|
+
--font-size-56: 2.25rem; /* 36px */
|
|
12
|
+
--font-size-64: 3rem; /* 48px */
|
|
13
|
+
--font-size-72: 3.75rem; /* 60px */
|
|
14
|
+
--font-size-80: 4.5rem; /* 72px */
|
|
15
|
+
--font-size-96: 6rem; /* 96px */
|
|
16
|
+
--font-size-112: 8rem; /* 128px */
|
|
17
|
+
--font-size-base: var(--font-size-28);
|
|
18
|
+
|
|
19
|
+
--font-weight-thin: 100;
|
|
20
|
+
--font-weight-extralight: 200;
|
|
21
|
+
--font-weight-light: 300;
|
|
22
|
+
--font-weight-normal: 400;
|
|
23
|
+
--font-weight-medium: 500;
|
|
24
|
+
--font-weight-semibold: 600;
|
|
25
|
+
--font-weight-bold: 700;
|
|
26
|
+
--font-weight-extrabold: 800;
|
|
27
|
+
--font-weight-black: 900;
|
|
28
|
+
}
|
|
29
|
+
/*********************************************************
|
|
30
|
+
*
|
|
31
|
+
* Pancetta
|
|
32
|
+
*
|
|
33
|
+
*********************************************************/
|
|
34
|
+
@font-face {
|
|
35
|
+
font-display: swap;
|
|
36
|
+
font-family: "Pancetta";
|
|
37
|
+
src: url("https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711100022/fonts/pancetta/pancettapro-thin-webfont.woff2") format("woff2"),
|
|
38
|
+
url("https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711100018/fonts/pancetta/pancettapro-thin-webfont.woff") format("woff");
|
|
39
|
+
font-weight: 100;
|
|
40
|
+
font-style: normal;
|
|
41
|
+
}
|
|
42
|
+
@font-face {
|
|
43
|
+
font-display: swap;
|
|
44
|
+
font-family: "Pancetta";
|
|
45
|
+
src: url("https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711100030/fonts/pancetta/pancettapro-thinitalic-webfont.woff2") format("woff2"),
|
|
46
|
+
url("https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711100042/fonts/pancetta/pancettapro-thinitalic-webfont.woff") format("woff");
|
|
47
|
+
font-weight: 100;
|
|
48
|
+
font-style: italic;
|
|
49
|
+
}
|
|
50
|
+
@font-face {
|
|
51
|
+
font-display: swap;
|
|
52
|
+
font-family: "Pancetta";
|
|
53
|
+
src: url("https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711099957/fonts/pancetta/pancettapro-extralight-webfont.woff2") format("woff2"),
|
|
54
|
+
url("https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711099944/fonts/pancetta/pancettapro-extralight-webfont.woff") format("woff");
|
|
55
|
+
font-weight: 200;
|
|
56
|
+
font-style: normal;
|
|
57
|
+
}
|
|
58
|
+
@font-face {
|
|
59
|
+
font-display: swap;
|
|
60
|
+
font-family: "Pancetta";
|
|
61
|
+
src: url("https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711099964/fonts/pancetta/pancettapro-extralightitalic-webfont.woff2") format("woff2"),
|
|
62
|
+
url("https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711099960/fonts/pancetta/pancettapro-extralightitalic-webfont.woff") format("woff");
|
|
63
|
+
font-weight: 200;
|
|
64
|
+
font-style: italic;
|
|
65
|
+
}
|
|
66
|
+
@font-face {
|
|
67
|
+
font-display: swap;
|
|
68
|
+
font-family: "Pancetta";
|
|
69
|
+
src: url("https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711099985/fonts/pancetta/pancettapro-light-webfont.woff2") format("woff2"),
|
|
70
|
+
url("https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711099977/fonts/pancetta/pancettapro-light-webfont.woff") format("woff");
|
|
71
|
+
font-weight: 300;
|
|
72
|
+
font-style: normal;
|
|
73
|
+
}
|
|
74
|
+
@font-face {
|
|
75
|
+
font-display: swap;
|
|
76
|
+
font-family: "Pancetta";
|
|
77
|
+
src: url("https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711100009/fonts/pancetta/pancettapro-lightitalic-webfont.woff2") format("woff2"),
|
|
78
|
+
url("https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711099989/fonts/pancetta/pancettapro-lightitalic-webfont.woff") format("woff");
|
|
79
|
+
font-weight: 300;
|
|
80
|
+
font-style: italic;
|
|
81
|
+
}
|
|
82
|
+
@font-face {
|
|
83
|
+
font-display: swap;
|
|
84
|
+
font-family: "Pancetta";
|
|
85
|
+
src: url("https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711100013/fonts/pancetta/pancettapro-regular-webfont.woff2") format("woff2"),
|
|
86
|
+
url("https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711100005/fonts/pancetta/pancettapro-regular-webfont.woff") format("woff");
|
|
87
|
+
font-weight: 400;
|
|
88
|
+
font-style: normal;
|
|
89
|
+
}
|
|
90
|
+
@font-face {
|
|
91
|
+
font-display: swap;
|
|
92
|
+
font-family: "Pancetta";
|
|
93
|
+
src: url("https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711099973/fonts/pancetta/pancettapro-italic-webfont.woff2") format("woff2"),
|
|
94
|
+
url("https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711099969/fonts/pancetta/pancettapro-italic-webfont.woff") format("woff");
|
|
95
|
+
font-weight: 400;
|
|
96
|
+
font-style: italic;
|
|
97
|
+
}
|
|
98
|
+
@font-face {
|
|
99
|
+
font-display: swap;
|
|
100
|
+
font-family: "Pancetta";
|
|
101
|
+
src: url("https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711099997/fonts/pancetta/pancettapro-medium-webfont.woff2") format("woff2"),
|
|
102
|
+
url("https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711099981/fonts/pancetta/pancettapro-medium-webfont.woff") format("woff");
|
|
103
|
+
font-weight: 500;
|
|
104
|
+
font-style: normal;
|
|
105
|
+
}
|
|
106
|
+
@font-face {
|
|
107
|
+
font-display: swap;
|
|
108
|
+
font-family: "Pancetta";
|
|
109
|
+
src: url("https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711100001/fonts/pancetta/pancettapro-mediumitalic-webfont.woff2") format("woff2"),
|
|
110
|
+
url("https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711099993/fonts/pancetta/pancettapro-mediumitalic-webfont.woff") format("woff");
|
|
111
|
+
font-weight: 500;
|
|
112
|
+
font-style: italic;
|
|
113
|
+
}
|
|
114
|
+
@font-face {
|
|
115
|
+
font-display: swap;
|
|
116
|
+
font-family: "Pancetta";
|
|
117
|
+
src: url("https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711100038/fonts/pancetta/pancettapro-semibold-webfont.woff2") format("woff2"),
|
|
118
|
+
url("https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711100034/fonts/pancetta/pancettapro-semibold-webfont.woff") format("woff");
|
|
119
|
+
font-weight: 600;
|
|
120
|
+
font-style: normal;
|
|
121
|
+
}
|
|
122
|
+
@font-face {
|
|
123
|
+
font-display: swap;
|
|
124
|
+
font-family: "Pancetta";
|
|
125
|
+
src: url("https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711100026/fonts/pancetta/pancettapro-semibolditalic-webfont.woff2") format("woff2"),
|
|
126
|
+
url("https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711100047/fonts/pancetta/pancettapro-semibolditalic-webfont.woff") format("woff");
|
|
127
|
+
font-weight: 600;
|
|
128
|
+
font-style: italic;
|
|
129
|
+
}
|
|
130
|
+
@font-face {
|
|
131
|
+
font-display: swap;
|
|
132
|
+
font-family: "Pancetta";
|
|
133
|
+
src: url("https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711099948/fonts/pancetta/pancettapro-bold-webfont.woff2") format("woff2"),
|
|
134
|
+
url("https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711099932/fonts/pancetta/pancettapro-bold-webfont.woff") format("woff");
|
|
135
|
+
font-weight: 700;
|
|
136
|
+
font-style: normal;
|
|
137
|
+
}
|
|
138
|
+
@font-face {
|
|
139
|
+
font-display: swap;
|
|
140
|
+
font-family: "Pancetta";
|
|
141
|
+
src: url("https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711099952/fonts/pancetta/pancettapro-bolditalic-webfont.woff2") format("woff2"),
|
|
142
|
+
url("https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711099936/fonts/pancetta/pancettapro-bolditalic-webfont.woff") format("woff");
|
|
143
|
+
font-weight: 700;
|
|
144
|
+
font-style: italic;
|
|
145
|
+
}
|
|
146
|
+
@font-face {
|
|
147
|
+
font-display: swap;
|
|
148
|
+
font-family: "Pancetta";
|
|
149
|
+
src: url("https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711099929/fonts/pancetta/pancettapro-black-webfont.woff2") format("woff2"),
|
|
150
|
+
url("https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711099921/fonts/pancetta/pancettapro-black-webfont.woff") format("woff");
|
|
151
|
+
font-weight: 900;
|
|
152
|
+
font-style: normal;
|
|
153
|
+
}
|
|
154
|
+
@font-face {
|
|
155
|
+
font-display: swap;
|
|
156
|
+
font-family: "Pancetta";
|
|
157
|
+
src: url("https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711099941/fonts/pancetta/pancettapro-blackitalic-webfont.woff2") format("woff2"),
|
|
158
|
+
url("https://res.cloudinary.com/dkz9eknwh/raw/upload/v1711099924/fonts/pancetta/pancettapro-blackitalic-webfont.woff") format("woff");
|
|
159
|
+
font-weight: 900;
|
|
160
|
+
font-style: italic;
|
|
161
|
+
}
|
|
162
|
+
:root {
|
|
163
|
+
--breakpoint-sm: 640px;
|
|
164
|
+
--breakpoint-md: 768px;
|
|
165
|
+
--breakpoint-lg: 1024px;
|
|
166
|
+
--breakpoint-xl: 1280px;
|
|
167
|
+
--breakpoint-xxl: 1536px;
|
|
168
|
+
}
|
|
169
|
+
:root {
|
|
170
|
+
--space-2: 2px;
|
|
171
|
+
--space-4: 4px;
|
|
172
|
+
--space-6: 6px;
|
|
173
|
+
--space-8: 8px;
|
|
174
|
+
--space-12: 12px;
|
|
175
|
+
--space-16: 16px;
|
|
176
|
+
--space-20: 20px;
|
|
177
|
+
--space-26: 24px;
|
|
178
|
+
--space-28: 28px;
|
|
179
|
+
--space-32: 32px;
|
|
180
|
+
--space-36: 36px;
|
|
181
|
+
--space-40: 40px;
|
|
182
|
+
--space-48: 48px;
|
|
183
|
+
--space-64: 64px;
|
|
184
|
+
--space-80: 80px;
|
|
185
|
+
--space-96: 96px;
|
|
186
|
+
--space-112: 112px;
|
|
187
|
+
--space-128: 128px;
|
|
188
|
+
--space-160: 160px;
|
|
189
|
+
--space-192: 192px;
|
|
190
|
+
--space-224: 224px;
|
|
191
|
+
}
|
|
192
|
+
:root {
|
|
193
|
+
--white: #ffffff;
|
|
194
|
+
--red-50: #fff0f1;
|
|
195
|
+
--red-100: #ffdee0;
|
|
196
|
+
--red-200: #ffc3c7;
|
|
197
|
+
--red-300: #ff999f;
|
|
198
|
+
--red-400: #ff5e67;
|
|
199
|
+
--red-500: #ff2b37;
|
|
200
|
+
--red-600: #f60c1a;
|
|
201
|
+
--red-700: #e30613;
|
|
202
|
+
--red-800: #ab0913;
|
|
203
|
+
--red-900: #8d0f16;
|
|
204
|
+
--red-950: #4d0206;
|
|
205
|
+
|
|
206
|
+
--gray-100: #ededed;
|
|
207
|
+
--gray-500: #bcbcbc;
|
|
208
|
+
--gray-900: #6f6f6f;
|
|
209
|
+
|
|
210
|
+
--black: #000000;
|
|
211
|
+
|
|
212
|
+
--brand-color-black: var(--black);
|
|
213
|
+
|
|
214
|
+
--brand-color-red: var(--red-700);
|
|
215
|
+
--brand-color-dark-red: var(--red-800);
|
|
216
|
+
|
|
217
|
+
--brand-color-light-gray: var(--gray-100);
|
|
218
|
+
--brand-color-medium-gray: var(--gray-500);
|
|
219
|
+
--brand-color-dark-gray: var(--gray-900);
|
|
220
|
+
|
|
221
|
+
--focus-ring-color: var(--brand-color-red);
|
|
222
|
+
}
|
|
223
|
+
:root {
|
|
224
|
+
--border-radius-0: 0px;
|
|
225
|
+
--border-radius-1: 2px;
|
|
226
|
+
--border-radius-2: 4px;
|
|
227
|
+
--border-radius-3: 6px;
|
|
228
|
+
--border-radius-4: 8px;
|
|
229
|
+
--border-radius-5: 12px;
|
|
230
|
+
--border-radius-6: 16px;
|
|
231
|
+
--border-radius-7: 20px;
|
|
232
|
+
--border-radius-8: 22px;
|
|
233
|
+
--border-radius-9: 30px;
|
|
234
|
+
--border-radius-full: 9999px;
|
|
235
|
+
|
|
236
|
+
--border-width-0: 0px;
|
|
237
|
+
--border-width-1: 1px;
|
|
238
|
+
--border-width-2: 2px;
|
|
239
|
+
--border-width-3: 4px;
|
|
240
|
+
}
|
package/dist/button.css
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
.button-module-YrVJX {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
flex-shrink: 0;
|
|
6
|
+
-webkit-user-select: none;
|
|
7
|
+
-moz-user-select: none;
|
|
8
|
+
user-select: none;
|
|
9
|
+
vertical-align: top;
|
|
10
|
+
text-transform: uppercase;
|
|
11
|
+
font-style: italic;
|
|
12
|
+
font-weight: var(--font-weight-bold);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/*********************************************************
|
|
16
|
+
*
|
|
17
|
+
* Sizes
|
|
18
|
+
*
|
|
19
|
+
*********************************************************/
|
|
20
|
+
|
|
21
|
+
.button-module-JKC7O {
|
|
22
|
+
min-height: 40px;
|
|
23
|
+
border-radius: var(--border-radius-7);
|
|
24
|
+
padding-inline: var(--space-20);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.button-module-QYp75 {
|
|
28
|
+
min-height: 44px;
|
|
29
|
+
border-radius: var(--border-radius-8);
|
|
30
|
+
padding-inline: var(--space-20);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/*********************************************************
|
|
34
|
+
*
|
|
35
|
+
* Variants
|
|
36
|
+
*
|
|
37
|
+
*********************************************************/
|
|
38
|
+
|
|
39
|
+
/* Solid */
|
|
40
|
+
|
|
41
|
+
.button-module-trXaT:where(.button-module-2nlh8) {
|
|
42
|
+
background-color: var(--brand-color-red);
|
|
43
|
+
color: var(--white);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.button-module-trXaT:where(.button-module-2nlh8):where([data-hovered]),
|
|
47
|
+
.button-module-trXaT:where(.button-module-2nlh8):where([data-pressed]) {
|
|
48
|
+
background-color: var(--brand-color-dark-red);
|
|
49
|
+
}
|
package/dist/button.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import { Button as Button$1 } from 'react-aria-components';
|
|
4
|
+
|
|
5
|
+
var styles = {"button":"button-module-YrVJX","md":"button-module-JKC7O","lg":"button-module-QYp75","solid":"button-module-trXaT","primary":"button-module-2nlh8"};
|
|
6
|
+
|
|
7
|
+
function Button({ children, variant = "solid", size = "md", color = "primary", className, ...props }) {
|
|
8
|
+
return (jsx(Button$1, { ...props, className: clsx(styles.button, styles[variant], styles[size], styles[color], className), children: children }));
|
|
9
|
+
}
|
|
10
|
+
Button.displayName = "Button";
|
|
11
|
+
|
|
12
|
+
export { Button };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
.checkbox-module-FLuy1 {
|
|
2
|
+
--selected-color: var(--brand-color-red);
|
|
3
|
+
--selected-color-pressed: var(--brand-color-dark-red);
|
|
4
|
+
--checkmark-color: var(--white);
|
|
5
|
+
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
gap: 0.571rem;
|
|
9
|
+
font-size: var(--font-size-24);
|
|
10
|
+
line-height: 14px;
|
|
11
|
+
color: var(--brand-color-black);
|
|
12
|
+
forced-color-adjust: none;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.checkbox-module-FLuy1 .checkbox-module-v6JLF {
|
|
16
|
+
width: 16px;
|
|
17
|
+
height: 16px;
|
|
18
|
+
border: 2px solid var(--brand-color-medium-gray);
|
|
19
|
+
border-radius: var(--border-radius-1);
|
|
20
|
+
transition: all 200ms;
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
justify-content: center;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.checkbox-module-FLuy1 svg {
|
|
27
|
+
width: 1rem;
|
|
28
|
+
height: 1rem;
|
|
29
|
+
fill: none;
|
|
30
|
+
stroke: var(--checkmark-color);
|
|
31
|
+
stroke-width: 3px;
|
|
32
|
+
stroke-dasharray: 22px;
|
|
33
|
+
stroke-dashoffset: 66;
|
|
34
|
+
transition: all 200ms;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.checkbox-module-FLuy1[data-pressed] .checkbox-module-v6JLF {
|
|
38
|
+
border-color: var(--brand-color-dark-gray);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.checkbox-module-FLuy1[data-focus-visible] .checkbox-module-v6JLF {
|
|
42
|
+
outline: 2px solid var(--focus-ring-color);
|
|
43
|
+
outline-offset: 2px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.checkbox-module-FLuy1[data-selected] .checkbox-module-v6JLF, .checkbox-module-FLuy1[data-indeterminate] .checkbox-module-v6JLF {
|
|
47
|
+
border-color: var(--selected-color);
|
|
48
|
+
background: var(--selected-color);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.checkbox-module-FLuy1[data-selected][data-pressed] .checkbox-module-v6JLF, .checkbox-module-FLuy1[data-indeterminate][data-pressed] .checkbox-module-v6JLF {
|
|
52
|
+
border-color: var(--selected-color-pressed);
|
|
53
|
+
background: var(--selected-color-pressed);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.checkbox-module-FLuy1[data-selected] svg, .checkbox-module-FLuy1[data-indeterminate] svg {
|
|
57
|
+
stroke-dashoffset: 44;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.checkbox-module-FLuy1[data-indeterminate] svg {
|
|
61
|
+
stroke: none;
|
|
62
|
+
fill: var(--checkmark-color);
|
|
63
|
+
}
|
package/dist/checkbox.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Checkbox as Checkbox$1 } from 'react-aria-components';
|
|
3
|
+
|
|
4
|
+
var styles = {"checkbox":"checkbox-module-FLuy1","box":"checkbox-module-v6JLF"};
|
|
5
|
+
|
|
6
|
+
function Checkbox({ children, ...props }) {
|
|
7
|
+
return (jsxs(Checkbox$1, { ...props, className: styles.checkbox, children: [jsx("div", { className: styles.box, children: jsx("svg", { viewBox: "0 0 18 18", "aria-hidden": "true", children: jsx("polyline", { points: "1 9 7 14 15 4" }) }) }), children] }));
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { Checkbox };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Button as AriaButton } from "react-aria-components";
|
|
2
|
+
import { ComponentPropsWithoutRef } from "react";
|
|
3
|
+
export type ButtonProps = ComponentPropsWithoutRef<typeof AriaButton> & {
|
|
4
|
+
variant?: "solid" | "outline" | "ghost";
|
|
5
|
+
size?: "md" | "lg";
|
|
6
|
+
color?: "primary" | "secondary" | "tertiary" | "quaternary";
|
|
7
|
+
};
|
|
8
|
+
export declare function Button({ children, variant, size, color, className, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare namespace Button {
|
|
10
|
+
var displayName: string;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/button/button.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAE7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAGjD,MAAM,MAAM,WAAW,GAAG,wBAAwB,CAAC,OAAO,UAAU,CAAC,GAAG;IACtE,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;IACxC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,YAAY,CAAC;CAC7D,CAAC;AAEF,wBAAgB,MAAM,CAAC,EACrB,QAAQ,EACR,OAAiB,EACjB,IAAW,EACX,KAAiB,EACjB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,WAAW,2CAeb;yBAtBe,MAAM"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Checkbox as AriaCheckbox } from "react-aria-components";
|
|
2
|
+
import { ComponentPropsWithoutRef } from "react";
|
|
3
|
+
export type CheckboxProps = ComponentPropsWithoutRef<typeof AriaCheckbox>;
|
|
4
|
+
export declare function Checkbox({ children, ...props }: CheckboxProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
//# sourceMappingURL=checkbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../../src/checkbox/checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,EAAE,wBAAwB,EAAa,MAAM,OAAO,CAAC;AAG5D,MAAM,MAAM,aAAa,GAAG,wBAAwB,CAAC,OAAO,YAAY,CAAC,CAAC;AAE1E,wBAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,2CAW7D"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FilterProps } from "../filter/filter";
|
|
2
|
+
export type ColorFilterProps = FilterProps & {
|
|
3
|
+
options: [
|
|
4
|
+
{
|
|
5
|
+
value: string;
|
|
6
|
+
label: string;
|
|
7
|
+
count: number;
|
|
8
|
+
}
|
|
9
|
+
];
|
|
10
|
+
activeFilters: string[];
|
|
11
|
+
onFilterChange: (value: string[]) => void;
|
|
12
|
+
};
|
|
13
|
+
export declare function ColorFilter({ options, activeFilters, onFilterChange, }: ColorFilterProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
//# sourceMappingURL=color-filter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-filter.d.ts","sourceRoot":"","sources":["../../../src/color-filter/color-filter.tsx"],"names":[],"mappings":"AACA,OAAO,EAAU,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEvD,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG;IAC3C,OAAO,EAAE;QACP;YACE,KAAK,EAAE,MAAM,CAAC;YACd,KAAK,EAAE,MAAM,CAAC;YACd,KAAK,EAAE,MAAM,CAAC;SACf;KACF,CAAC;IACF,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CAC3C,CAAC;AAEF,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,aAAa,EACb,cAAc,GACf,EAAE,gBAAgB,2CAoBlB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PropsWithChildren } from "react";
|
|
2
|
+
export type FilterProps = PropsWithChildren<{
|
|
3
|
+
title?: string;
|
|
4
|
+
isCollapseable?: boolean;
|
|
5
|
+
initialIsCollapsed?: boolean;
|
|
6
|
+
}>;
|
|
7
|
+
export declare function Filter({ title, children, isCollapseable, initialIsCollapsed, }: FilterProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=filter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../../src/filter/filter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE1C,MAAM,MAAM,WAAW,GAAG,iBAAiB,CAAC;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC,CAAC;AAEH,wBAAgB,MAAM,CAAC,EACrB,KAAK,EACL,QAAQ,EACR,cAAqB,EACrB,kBAA0B,GAC3B,EAAE,WAAW,2CASb"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type ProductCardProps = {
|
|
2
|
+
product: {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
};
|
|
6
|
+
onAddToCart?: (productId: string) => void;
|
|
7
|
+
onAddToList?: (productId: string) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare function ProductCard({ product }: ProductCardProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=product-card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-card.d.ts","sourceRoot":"","sources":["../../../src/product-card/product-card.tsx"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE;QACP,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C,CAAC;AAEF,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,EAAE,gBAAgB,2CAMxD"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ComponentType } from "react";
|
|
2
|
+
import { ProductCardProps } from "../product-card/product-card";
|
|
3
|
+
export type Filters = {
|
|
4
|
+
color: {
|
|
5
|
+
options: [
|
|
6
|
+
{
|
|
7
|
+
value: string;
|
|
8
|
+
label: string;
|
|
9
|
+
count: number;
|
|
10
|
+
}
|
|
11
|
+
];
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export type ActiveFilters = {
|
|
15
|
+
color: string[];
|
|
16
|
+
};
|
|
17
|
+
export type Sort = {
|
|
18
|
+
by: string;
|
|
19
|
+
direction: string;
|
|
20
|
+
};
|
|
21
|
+
export type ProductListingProps = {
|
|
22
|
+
productCard: ComponentType<ProductCardProps>;
|
|
23
|
+
products: {
|
|
24
|
+
id: string;
|
|
25
|
+
title: string;
|
|
26
|
+
}[];
|
|
27
|
+
total: number;
|
|
28
|
+
filters: Filters;
|
|
29
|
+
activeFilters: ActiveFilters;
|
|
30
|
+
sort: {
|
|
31
|
+
by: string;
|
|
32
|
+
direction: string;
|
|
33
|
+
};
|
|
34
|
+
onFilterChange: (filters: ActiveFilters) => void;
|
|
35
|
+
onSortChange: (sort: Sort) => void;
|
|
36
|
+
};
|
|
37
|
+
export declare function ProductListing({ productCard: ProductCard, products, filters, activeFilters, onFilterChange, onSortChange, }: ProductListingProps): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
//# sourceMappingURL=product-listing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-listing.d.ts","sourceRoot":"","sources":["../../../src/product-listing/product-listing.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE,MAAM,MAAM,OAAO,GAAG;IACpB,KAAK,EAAE;QACL,OAAO,EAAE;YACP;gBACE,KAAK,EAAE,MAAM,CAAC;gBACd,KAAK,EAAE,MAAM,CAAC;gBACd,KAAK,EAAE,MAAM,CAAC;aACf;SACF,CAAC;KACH,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,IAAI,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,WAAW,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAC7C,QAAQ,EAAE;QACR,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;KACf,EAAE,CAAC;IACJ,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,aAAa,CAAC;IAC7B,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAC;QACX,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,cAAc,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;IACjD,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;CACpC,CAAC;AAEF,wBAAgB,cAAc,CAAC,EAC7B,WAAW,EAAE,WAAW,EACxB,QAAQ,EACR,OAAO,EACP,aAAa,EACb,cAAc,EACd,YAAY,GACb,EAAE,mBAAmB,2CA8BrB"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
.checkbox-module-FLuy1 {
|
|
2
|
+
--selected-color: var(--brand-color-red);
|
|
3
|
+
--selected-color-pressed: var(--brand-color-dark-red);
|
|
4
|
+
--checkmark-color: var(--white);
|
|
5
|
+
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
gap: 0.571rem;
|
|
9
|
+
font-size: var(--font-size-24);
|
|
10
|
+
line-height: 14px;
|
|
11
|
+
color: var(--brand-color-black);
|
|
12
|
+
forced-color-adjust: none;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.checkbox-module-FLuy1 .checkbox-module-v6JLF {
|
|
16
|
+
width: 16px;
|
|
17
|
+
height: 16px;
|
|
18
|
+
border: 2px solid var(--brand-color-medium-gray);
|
|
19
|
+
border-radius: var(--border-radius-1);
|
|
20
|
+
transition: all 200ms;
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
justify-content: center;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.checkbox-module-FLuy1 svg {
|
|
27
|
+
width: 1rem;
|
|
28
|
+
height: 1rem;
|
|
29
|
+
fill: none;
|
|
30
|
+
stroke: var(--checkmark-color);
|
|
31
|
+
stroke-width: 3px;
|
|
32
|
+
stroke-dasharray: 22px;
|
|
33
|
+
stroke-dashoffset: 66;
|
|
34
|
+
transition: all 200ms;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.checkbox-module-FLuy1[data-pressed] .checkbox-module-v6JLF {
|
|
38
|
+
border-color: var(--brand-color-dark-gray);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.checkbox-module-FLuy1[data-focus-visible] .checkbox-module-v6JLF {
|
|
42
|
+
outline: 2px solid var(--focus-ring-color);
|
|
43
|
+
outline-offset: 2px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.checkbox-module-FLuy1[data-selected] .checkbox-module-v6JLF, .checkbox-module-FLuy1[data-indeterminate] .checkbox-module-v6JLF {
|
|
47
|
+
border-color: var(--selected-color);
|
|
48
|
+
background: var(--selected-color);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.checkbox-module-FLuy1[data-selected][data-pressed] .checkbox-module-v6JLF, .checkbox-module-FLuy1[data-indeterminate][data-pressed] .checkbox-module-v6JLF {
|
|
52
|
+
border-color: var(--selected-color-pressed);
|
|
53
|
+
background: var(--selected-color-pressed);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.checkbox-module-FLuy1[data-selected] svg, .checkbox-module-FLuy1[data-indeterminate] svg {
|
|
57
|
+
stroke-dashoffset: 44;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.checkbox-module-FLuy1[data-indeterminate] svg {
|
|
61
|
+
stroke: none;
|
|
62
|
+
fill: var(--checkmark-color);
|
|
63
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Checkbox as Checkbox$1 } from 'react-aria-components';
|
|
3
|
+
|
|
4
|
+
var styles = {"checkbox":"checkbox-module-FLuy1","box":"checkbox-module-v6JLF"};
|
|
5
|
+
|
|
6
|
+
function Checkbox({ children, ...props }) {
|
|
7
|
+
return (jsxs(Checkbox$1, { ...props, className: styles.checkbox, children: [jsx("div", { className: styles.box, children: jsx("svg", { viewBox: "0 0 18 18", "aria-hidden": "true", children: jsx("polyline", { points: "1 9 7 14 15 4" }) }) }), children] }));
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function Filter({ title, children, isCollapseable = true, initialIsCollapsed = false, }) {
|
|
11
|
+
return (jsxs("div", { children: [jsx("div", { children: jsx("h3", { children: title }) }), jsx("div", { children: children })] }));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function ColorFilter({ options, activeFilters, onFilterChange, }) {
|
|
15
|
+
return (jsx(Filter, { title: "Color", children: jsx("ul", { children: options.map((option) => (jsx("li", { children: jsx(Checkbox, { onChange: (isSelected) => onFilterChange(isSelected ? [option.value] : []), value: option.value, isSelected: activeFilters.includes(option.value), children: option.label }) }, option.value))) }) }));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function ProductListing({ productCard: ProductCard, products, filters, activeFilters, onFilterChange, onSortChange, }) {
|
|
19
|
+
return (jsxs("div", { children: [jsx("h1", { children: "Product listing" }), jsxs("aside", { children: [jsx("h2", { children: "Filter" }), jsx("div", { children: jsx(ColorFilter, { options: filters.color.options, activeFilters: activeFilters.color, onFilterChange: (color) => onFilterChange({ color }) }) })] }), jsx("main", { children: jsxs("select", { children: [jsx("option", { value: "", children: "Sort By" }) // translations
|
|
20
|
+
, " // translations", jsx("option", { value: "price", children: "Price" }), jsx("option", { value: "title", children: "Title" })] }) }), jsx("ul", { children: products.map((product) => (jsx("li", { children: jsx(ProductCard, { product: product }) }, product.id))) })] }));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export { ProductListing };
|