@feitio/core 0.0.0-stage → 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/LICENSE +21 -0
- package/README.md +31 -2
- package/css/base.css +303 -0
- package/css/components.css +2174 -0
- package/css/feitio.css +5 -0
- package/css/fonts.css +5 -0
- package/css/tokens.css +106 -0
- package/icons/calendar.svg +1 -0
- package/icons/check.svg +1 -0
- package/icons/chevron-down.svg +1 -0
- package/icons/chevron-right.svg +1 -0
- package/icons/close.svg +1 -0
- package/icons/info.svg +1 -0
- package/icons/menu.svg +1 -0
- package/icons/new-tab.svg +1 -0
- package/icons/plus.svg +1 -0
- package/icons/search.svg +1 -0
- package/icons/sliders.svg +1 -0
- package/icons/sprite.svg +15 -0
- package/icons/task.svg +1 -0
- package/icons/warn.svg +1 -0
- package/illustrations/empty-basket.svg +9 -0
- package/illustrations/torn-paper.svg +9 -0
- package/js/tokens.ts +55 -0
- package/package.json +47 -4
- package/tokens/base.tokens.json +108 -0
- package/tokens/themes/casa.dark.tokens.json +24 -0
- package/tokens/themes/casa.light.tokens.json +61 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Henrique Artur
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,32 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @feitio/core
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The foundation of Feitio, a handmade, humanist design system: the design tokens, the layered base
|
|
4
|
+
and component CSS, the hand-drawn icons and the illustrations. Plain CSS, for any page.
|
|
5
|
+
|
|
6
|
+
```sh
|
|
7
|
+
npm install @feitio/core
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
```html
|
|
11
|
+
<link rel="stylesheet" href="node_modules/@feitio/core/css/fonts.css">
|
|
12
|
+
<link rel="stylesheet" href="node_modules/@feitio/core/css/feitio.css">
|
|
13
|
+
|
|
14
|
+
<button type="submit" class="feitio-button" data-variant="primary">Save changes</button>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Or, with a bundler: `import '@feitio/core/css/feitio.css';`
|
|
18
|
+
|
|
19
|
+
- **Themes and modes by attribute**: `data-theme="casa"`, `data-mode="dark"`,
|
|
20
|
+
`data-density="compact"`, on the root or on a single block.
|
|
21
|
+
- **Tokens**: every value is a `--feitio-` custom property. The source is in `tokens/` (Design
|
|
22
|
+
Tokens format), and `js/tokens.ts` names each one for TypeScript.
|
|
23
|
+
- **Icons**: `icons/sprite.svg`, each icon a symbol named `feitio-<name>`.
|
|
24
|
+
- **Illustrations**: `illustrations/*.svg`, ink in `currentColor`.
|
|
25
|
+
|
|
26
|
+
Components: [`@feitio/astro`](https://www.npmjs.com/package/@feitio/astro) and
|
|
27
|
+
[`@feitio/react`](https://www.npmjs.com/package/@feitio/react). Behaviors for plain HTML:
|
|
28
|
+
[`@feitio/vanilla`](https://www.npmjs.com/package/@feitio/vanilla).
|
|
29
|
+
|
|
30
|
+
Guidelines, every component and when not to use it: https://made-by-maid.github.io/feitio/
|
|
31
|
+
|
|
32
|
+
MIT. The Alegreya fonts are under the SIL Open Font License and are not part of this package.
|
package/css/base.css
ADDED
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Feitio base: the page itself and the few shapes every port shares. It reads only the tokens of
|
|
3
|
+
* css/tokens.css; colors come from the theme (`data-theme`, `data-mode`), never from here.
|
|
4
|
+
*/
|
|
5
|
+
@layer feitio.reset, feitio.tokens, feitio.base, feitio.shapes;
|
|
6
|
+
|
|
7
|
+
@layer feitio.reset {
|
|
8
|
+
*,
|
|
9
|
+
*::before,
|
|
10
|
+
*::after {
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
body,
|
|
15
|
+
h1,
|
|
16
|
+
h2,
|
|
17
|
+
h3,
|
|
18
|
+
h4,
|
|
19
|
+
p,
|
|
20
|
+
ul,
|
|
21
|
+
ol,
|
|
22
|
+
dl,
|
|
23
|
+
dd,
|
|
24
|
+
figure,
|
|
25
|
+
blockquote {
|
|
26
|
+
margin: 0;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
img,
|
|
30
|
+
svg,
|
|
31
|
+
video {
|
|
32
|
+
display: block;
|
|
33
|
+
max-width: 100%;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
button,
|
|
37
|
+
input,
|
|
38
|
+
select,
|
|
39
|
+
textarea {
|
|
40
|
+
font: inherit;
|
|
41
|
+
color: inherit;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* Hidden is hidden: a component's own display must never bring back what the hidden attribute hides. */
|
|
45
|
+
[hidden] {
|
|
46
|
+
/* biome-ignore lint/complexity/noImportantStyles: an element's own display would otherwise beat the browser's hidden. */
|
|
47
|
+
display: none !important;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@layer feitio.base {
|
|
52
|
+
:root {
|
|
53
|
+
/* The uneven corners together, ready for border-radius. */
|
|
54
|
+
--feitio-radius: var(--feitio-radius-top-left) var(--feitio-radius-top-right)
|
|
55
|
+
var(--feitio-radius-bottom-right) var(--feitio-radius-bottom-left);
|
|
56
|
+
|
|
57
|
+
/* Inside controls and tables: comfortable by default, compact where data-density says so. */
|
|
58
|
+
--feitio-control-padding-block: 0.75rem;
|
|
59
|
+
--feitio-control-padding-inline: 1.35rem;
|
|
60
|
+
--feitio-cell-padding-block: 0.85rem;
|
|
61
|
+
--feitio-cell-padding-inline: 0.9rem;
|
|
62
|
+
--feitio-control-min-size: 44px;
|
|
63
|
+
/* The small and large controls, the same in every density: a small button keeps a 40px hit area. */
|
|
64
|
+
--feitio-control-min-size-small: 32px;
|
|
65
|
+
--feitio-control-padding-block-small: 0.3rem;
|
|
66
|
+
--feitio-control-padding-inline-small: 0.75rem;
|
|
67
|
+
--feitio-control-min-size-large: 52px;
|
|
68
|
+
--feitio-control-padding-block-large: 0.9rem;
|
|
69
|
+
--feitio-control-padding-inline-large: 1.75rem;
|
|
70
|
+
|
|
71
|
+
/* Lets sizes that are auto (a block that grows) transition too, where the browser supports it. */
|
|
72
|
+
interpolate-size: allow-keywords;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/*
|
|
76
|
+
* Every change of state is a transition, never a jump: colors when day turns to night, spacing
|
|
77
|
+
* when the density changes, sizes when content grows. One duration and one curve for all of it.
|
|
78
|
+
*/
|
|
79
|
+
*,
|
|
80
|
+
*::before,
|
|
81
|
+
*::after {
|
|
82
|
+
transition-property:
|
|
83
|
+
color, background-color, border-color, outline-color, text-decoration-color, fill, stroke,
|
|
84
|
+
box-shadow, opacity, transform, translate, rotate, scale, padding, margin, gap, inline-size,
|
|
85
|
+
block-size, min-block-size, border-radius;
|
|
86
|
+
transition-duration: var(--feitio-duration-change);
|
|
87
|
+
transition-timing-function: var(--feitio-easing-change);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
[data-density="compact"] {
|
|
91
|
+
--feitio-control-padding-block: 0.45rem;
|
|
92
|
+
--feitio-control-padding-inline: 0.9rem;
|
|
93
|
+
--feitio-cell-padding-block: 0.4rem;
|
|
94
|
+
--feitio-cell-padding-inline: 0.6rem;
|
|
95
|
+
--feitio-control-min-size: 40px;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/*
|
|
99
|
+
* The scrollbar follows the ink: thin, in soft ink over a clear track, in every scrolling box.
|
|
100
|
+
* The browser's grey bar is the one thing on a page Feitio did not draw.
|
|
101
|
+
*/
|
|
102
|
+
:root {
|
|
103
|
+
scrollbar-color: color-mix(in oklch, var(--feitio-color-text) 35%, transparent) transparent;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
* {
|
|
107
|
+
scrollbar-width: thin;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/* Browsers without scrollbar-color (older Safari) get the same look through their own pseudo. */
|
|
111
|
+
@supports not (scrollbar-color: auto) {
|
|
112
|
+
/* This pseudo only reads the physical width and height. */
|
|
113
|
+
::-webkit-scrollbar {
|
|
114
|
+
width: 10px;
|
|
115
|
+
height: 10px;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
::-webkit-scrollbar-track {
|
|
119
|
+
background: transparent;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
::-webkit-scrollbar-thumb {
|
|
123
|
+
background: color-mix(in oklch, var(--feitio-color-text) 35%, transparent);
|
|
124
|
+
background-clip: padding-box;
|
|
125
|
+
border: 2px solid transparent;
|
|
126
|
+
border-radius: var(--feitio-radius);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
body {
|
|
131
|
+
background: var(--feitio-color-surface);
|
|
132
|
+
color: var(--feitio-color-text);
|
|
133
|
+
font-family: var(--feitio-font-text);
|
|
134
|
+
font-size: var(--feitio-font-size-body);
|
|
135
|
+
line-height: var(--feitio-line-height-text);
|
|
136
|
+
-webkit-font-smoothing: antialiased;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
h1,
|
|
140
|
+
h2,
|
|
141
|
+
h3,
|
|
142
|
+
h4 {
|
|
143
|
+
font-family: var(--feitio-font-ui);
|
|
144
|
+
font-weight: var(--feitio-font-weight-heavy);
|
|
145
|
+
line-height: var(--feitio-line-height-heading);
|
|
146
|
+
text-wrap: balance;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
h1 {
|
|
150
|
+
font-size: clamp(2.4rem, 6vw, var(--feitio-font-size-h1));
|
|
151
|
+
letter-spacing: -0.02em;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
h2 {
|
|
155
|
+
font-size: var(--feitio-font-size-h2);
|
|
156
|
+
font-weight: var(--feitio-font-weight-bold);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
h3,
|
|
160
|
+
h4 {
|
|
161
|
+
font-size: var(--feitio-font-size-h3);
|
|
162
|
+
font-weight: var(--feitio-font-weight-bold);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
p {
|
|
166
|
+
text-wrap: pretty;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
a {
|
|
170
|
+
color: var(--feitio-color-accent-strong);
|
|
171
|
+
text-underline-offset: 0.2em;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
small {
|
|
175
|
+
font-family: var(--feitio-font-ui);
|
|
176
|
+
font-size: var(--feitio-font-size-small);
|
|
177
|
+
color: var(--feitio-color-text-soft);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
hr {
|
|
181
|
+
border: 0;
|
|
182
|
+
border-top: 1px solid var(--feitio-color-line);
|
|
183
|
+
margin-block: var(--feitio-space-5);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
:focus-visible {
|
|
187
|
+
outline: var(--feitio-focus-width) solid var(--feitio-color-accent);
|
|
188
|
+
outline-offset: var(--feitio-focus-offset);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
::selection {
|
|
192
|
+
background: color-mix(in oklch, var(--feitio-color-accent) 30%, transparent);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/*
|
|
196
|
+
* Where things move every instant (dragging, drawing, resizing, scrolling a huge list), a piece
|
|
197
|
+
* cannot wait for a transition: it would lag behind the finger. data-motion="direct" turns motion
|
|
198
|
+
* off in that area only.
|
|
199
|
+
*/
|
|
200
|
+
[data-motion="direct"],
|
|
201
|
+
[data-motion="direct"] * {
|
|
202
|
+
/* biome-ignore lint/complexity/noImportantStyles: a direct area must beat the transition every element gets. */
|
|
203
|
+
transition: none !important;
|
|
204
|
+
/* biome-ignore lint/complexity/noImportantStyles: same as above, for animations. */
|
|
205
|
+
animation: none !important;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
@media (prefers-reduced-motion: reduce) {
|
|
209
|
+
*,
|
|
210
|
+
*::before,
|
|
211
|
+
*::after {
|
|
212
|
+
/* biome-ignore lint/complexity/noImportantStyles: asking for less motion must beat any animation, wherever it comes from. */
|
|
213
|
+
animation: none !important;
|
|
214
|
+
/* biome-ignore lint/complexity/noImportantStyles: same as above, for transitions. */
|
|
215
|
+
transition: none !important;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
@layer feitio.shapes {
|
|
221
|
+
/* A reading column: never wider than a comfortable line. */
|
|
222
|
+
.feitio-measure {
|
|
223
|
+
max-inline-size: var(--feitio-measure-reading);
|
|
224
|
+
margin-inline: auto;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/* Paper cut by hand: the uneven corners. */
|
|
228
|
+
.feitio-paper {
|
|
229
|
+
border-radius: var(--feitio-radius);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/* A block on the page. */
|
|
233
|
+
.feitio-block {
|
|
234
|
+
background: var(--feitio-color-surface-raised);
|
|
235
|
+
border-radius: var(--feitio-radius);
|
|
236
|
+
padding: var(--feitio-space-5) var(--feitio-space-4);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/* Lifted paper, for what floats: menus, dialogs, a highlighted card. */
|
|
240
|
+
.feitio-lift {
|
|
241
|
+
background: var(--feitio-color-surface-top);
|
|
242
|
+
border: var(--feitio-border-width) solid var(--feitio-color-text);
|
|
243
|
+
border-radius: var(--feitio-radius);
|
|
244
|
+
box-shadow: var(--feitio-shadow-lift);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/* Paper being placed: how lifted paper arrives, only when someone acts. */
|
|
248
|
+
.feitio-place {
|
|
249
|
+
animation: feitio-place var(--feitio-duration-place) var(--feitio-easing-place);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/* A process note: why something is the way it is. */
|
|
253
|
+
.feitio-note {
|
|
254
|
+
padding-inline-start: var(--feitio-space-3);
|
|
255
|
+
border-inline-start: var(--feitio-border-width) solid var(--feitio-color-accent);
|
|
256
|
+
font-style: italic;
|
|
257
|
+
color: var(--feitio-color-accent-strong);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/* Hand-drawn icons: the line is thick and the drawing leans a little. */
|
|
261
|
+
.feitio-icon {
|
|
262
|
+
/* Inline, next to the word: the reset makes svg a block. */
|
|
263
|
+
display: inline-block;
|
|
264
|
+
vertical-align: -0.25em;
|
|
265
|
+
inline-size: 1.35em;
|
|
266
|
+
block-size: 1.35em;
|
|
267
|
+
flex: none;
|
|
268
|
+
fill: none;
|
|
269
|
+
stroke: currentColor;
|
|
270
|
+
stroke-width: 2.3;
|
|
271
|
+
stroke-linecap: round;
|
|
272
|
+
stroke-linejoin: round;
|
|
273
|
+
rotate: -3deg;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
@keyframes feitio-place {
|
|
278
|
+
from {
|
|
279
|
+
opacity: 0;
|
|
280
|
+
transform: translate(-3px, -8px) rotate(-1.5deg);
|
|
281
|
+
box-shadow: 0 0 0 var(--feitio-color-shadow);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
to {
|
|
285
|
+
opacity: 1;
|
|
286
|
+
transform: none;
|
|
287
|
+
box-shadow: var(--feitio-shadow-lift);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
@layer feitio.shapes {
|
|
292
|
+
/* Hand-drawn illustrations for empty screens and big errors: ink, with a touch of orange. */
|
|
293
|
+
.feitio-illustration {
|
|
294
|
+
inline-size: 8rem;
|
|
295
|
+
block-size: auto;
|
|
296
|
+
color: var(--feitio-color-text);
|
|
297
|
+
rotate: -3deg;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.feitio-hot {
|
|
301
|
+
stroke: var(--feitio-color-accent);
|
|
302
|
+
}
|
|
303
|
+
}
|