@eagami/ui 2.6.0 → 2.8.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/fesm2022/eagami-ui.mjs +161 -105
- package/fesm2022/eagami-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/src/styles/_mixins.scss +45 -0
- package/src/styles/tokens/_colors.scss +8 -0
- package/src/styles/tokens/_shape.scss +6 -0
- package/src/styles/tokens/_typography.scss +12 -2
- package/types/eagami-ui.d.ts +1618 -1560
package/package.json
CHANGED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// Shared SCSS mixins for the library. Consume from a component stylesheet with:
|
|
2
|
+
// @use '../../styles/mixins' as ea;
|
|
3
|
+
// .ea-foo__close { @include ea.icon-button; }
|
|
4
|
+
|
|
5
|
+
// Standard icon button: clear, close/dismiss, password-toggle, nav, etc. The box
|
|
6
|
+
// is `--ea-icon-button-size` (em) so it scales with the host component's size and
|
|
7
|
+
// is consistent across components at a given size tier. The glyph is enlarged so
|
|
8
|
+
// it reads clearly inside the box regardless of how much padding the icon's own
|
|
9
|
+
// viewBox carries (the feather `x`, for instance, only fills its middle half).
|
|
10
|
+
@mixin icon-button {
|
|
11
|
+
display: inline-flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
flex-shrink: 0;
|
|
15
|
+
width: var(--ea-icon-button-size, 1.75em);
|
|
16
|
+
height: var(--ea-icon-button-size, 1.75em);
|
|
17
|
+
padding: 0;
|
|
18
|
+
border: none;
|
|
19
|
+
border-radius: var(--radius-sm);
|
|
20
|
+
background: none;
|
|
21
|
+
color: var(--color-text-secondary);
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
transition: var(--transition-colors);
|
|
24
|
+
|
|
25
|
+
// Glyph sized via font-size (not width) so it overrides the icon's inline 1em
|
|
26
|
+
// host size and still scales with the box.
|
|
27
|
+
> * {
|
|
28
|
+
font-size: 1.25em;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&:hover {
|
|
32
|
+
background-color: var(--color-state-hover);
|
|
33
|
+
color: var(--color-text-primary);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&:focus-visible {
|
|
37
|
+
outline: none;
|
|
38
|
+
box-shadow: var(--shadow-focus-ring);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&:disabled {
|
|
42
|
+
cursor: not-allowed;
|
|
43
|
+
opacity: 0.5;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -78,6 +78,9 @@
|
|
|
78
78
|
--color-bg-subtle: var(--color-neutral-50);
|
|
79
79
|
--color-bg-stripe: var(--color-neutral-50);
|
|
80
80
|
--color-bg-muted: var(--color-neutral-100);
|
|
81
|
+
// Stronger neutral fill for placeholder surfaces (e.g. avatar) that must read
|
|
82
|
+
// clearly against the page; muted is too faint on a white base
|
|
83
|
+
--color-bg-emphasis: var(--color-neutral-300);
|
|
81
84
|
--color-bg-elevated: var(--color-neutral-0);
|
|
82
85
|
--color-bg-overlay: rgba(0, 0, 0, 0.5);
|
|
83
86
|
|
|
@@ -92,6 +95,7 @@
|
|
|
92
95
|
--color-border-subtle: var(--color-neutral-200);
|
|
93
96
|
--color-border-default: var(--color-neutral-200);
|
|
94
97
|
--color-border-strong: var(--color-neutral-400);
|
|
98
|
+
--color-divider: var(--color-border-subtle);
|
|
95
99
|
--color-border-focus: var(--color-primary-500);
|
|
96
100
|
|
|
97
101
|
// brand-default/-hover/-active are the brand colour as a surface (solid bg
|
|
@@ -170,6 +174,7 @@
|
|
|
170
174
|
// tracks, skeletons). Hover/active fills route through the translucent
|
|
171
175
|
// --color-state-* tokens instead, so they never collide with this shade.
|
|
172
176
|
--color-bg-muted: var(--color-neutral-700);
|
|
177
|
+
--color-bg-emphasis: var(--color-neutral-600);
|
|
173
178
|
|
|
174
179
|
// White wash so an interactive lift reads on any dark surface, including the
|
|
175
180
|
// neutral-700 tier where bg-muted/-subtle/-elevated all coincide. This is the
|
|
@@ -187,6 +192,9 @@
|
|
|
187
192
|
);
|
|
188
193
|
--color-border-default: var(--color-neutral-400);
|
|
189
194
|
--color-border-strong: var(--color-neutral-300);
|
|
195
|
+
// Dividers read as barely-there against dark surfaces at border-subtle, so
|
|
196
|
+
// they step one neutral lighter for a visible-but-quiet rule.
|
|
197
|
+
--color-divider: var(--color-neutral-600);
|
|
190
198
|
|
|
191
199
|
// Surface roles step one shade lighter than light mode so the button clears
|
|
192
200
|
// WCAG 1.4.11 (3:1) on the near-black canvas while keeping a white label
|
|
@@ -13,4 +13,10 @@
|
|
|
13
13
|
--border-width-thin: 1px;
|
|
14
14
|
--border-width-medium: 2px;
|
|
15
15
|
--border-width-thick: 4px;
|
|
16
|
+
|
|
17
|
+
// Hit-target box for icon buttons (clear / close / dismiss / toggle). em-based
|
|
18
|
+
// so it scales with the host component's size; since all sized components share
|
|
19
|
+
// a font-size per tier, this is also consistent across components at a tier
|
|
20
|
+
// (md = 1.75 * 16px = 28px).
|
|
21
|
+
--ea-icon-button-size: 1.75em;
|
|
16
22
|
}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
:root {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
// The `* Fallback` faces are Arial tuned with metric overrides to match the
|
|
3
|
+
// web fonts, so they must sit right after each web font in the stack: that way
|
|
4
|
+
// text laid out before the font loads has the same metrics and `font-display:
|
|
5
|
+
// swap` causes no layout shift when the real font arrives.
|
|
6
|
+
--font-family-sans:
|
|
7
|
+
'DM Sans', 'DM Sans Fallback', 'Segoe UI', system-ui, -apple-system, sans-serif;
|
|
8
|
+
--font-family-brand:
|
|
9
|
+
'Syne', 'Syne Fallback', 'DM Sans', 'DM Sans Fallback', system-ui, sans-serif;
|
|
4
10
|
--font-family-serif: 'Georgia', 'Times New Roman', serif;
|
|
5
11
|
--font-family-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
6
12
|
|
|
@@ -35,6 +41,10 @@
|
|
|
35
41
|
--letter-spacing-wider: 0.05em;
|
|
36
42
|
--letter-spacing-widest: 0.1em;
|
|
37
43
|
|
|
44
|
+
// Leading/status icon sized relative to the text beside it; em keeps it in
|
|
45
|
+
// proportion as the surrounding font-size changes
|
|
46
|
+
--icon-inline-size: 1.5em;
|
|
47
|
+
|
|
38
48
|
--text-display-size: var(--font-size-5xl);
|
|
39
49
|
--text-display-weight: var(--font-weight-bold);
|
|
40
50
|
--text-display-lh: var(--line-height-tight);
|