@atom63/inform 0.2.0-beta.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 +27 -0
- package/README.md +25 -0
- package/dist/chunk-KT6PQL7E.js +554 -0
- package/dist/chunk-KT6PQL7E.js.map +1 -0
- package/dist/chunk-OGT26DRQ.js +222 -0
- package/dist/chunk-OGT26DRQ.js.map +1 -0
- package/dist/flyout-stack-BvsgCm0f.d.ts +26 -0
- package/dist/index.d.ts +52 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/persistence-DkSUn_qI.d.ts +18 -0
- package/dist/react/index.d.ts +42 -0
- package/dist/react/index.js +128 -0
- package/dist/react/index.js.map +1 -0
- package/dist/surfaces/index.d.ts +160 -0
- package/dist/surfaces/index.js +3 -0
- package/dist/surfaces/index.js.map +1 -0
- package/dist/types-7x7Ygbcz.d.ts +75 -0
- package/package.json +92 -0
- package/src/styles.css +17 -0
- package/src/surfaces/inform-banner.css +28 -0
- package/src/surfaces/inform-corner-flyout.css +73 -0
- package/src/surfaces/inform-dialog.css +24 -0
- package/src/surfaces/inform-parts.css +176 -0
- package/src/surfaces/inform-spotlight.css +55 -0
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Inform parts — the pieces every surface shares: the line-sized gutter slots,
|
|
3
|
+
* the dismiss control, the text block, the action strip, media and severity.
|
|
4
|
+
*
|
|
5
|
+
* Every value reads an --a63-* token, so the surfaces follow theme, brand,
|
|
6
|
+
* mode and density like the rest of the system. No consumer Tailwind needed.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/*
|
|
10
|
+
* Gutter slot: exactly one line box tall. Laid out from the top of the row, its
|
|
11
|
+
* optical centre coincides with the first line of text beside it, with no
|
|
12
|
+
* per-surface offset. `1lh` resolves against the slot's own line-height, so
|
|
13
|
+
* the slot carries the text's typography instead of inheriting it.
|
|
14
|
+
*/
|
|
15
|
+
.a63-Inform-slot {
|
|
16
|
+
display: inline-flex;
|
|
17
|
+
flex-shrink: 0;
|
|
18
|
+
align-items: center;
|
|
19
|
+
justify-content: center;
|
|
20
|
+
inline-size: 1lh;
|
|
21
|
+
block-size: 1lh;
|
|
22
|
+
font-size: var(--typography-sm-font-size);
|
|
23
|
+
line-height: 1.375;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.a63-InformIconSlot svg {
|
|
27
|
+
inline-size: var(--a63-space-4);
|
|
28
|
+
block-size: var(--a63-space-4);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* ── Dismiss control ───────────────────────────────────────────────────── */
|
|
32
|
+
.a63-InformDismissButton {
|
|
33
|
+
position: relative;
|
|
34
|
+
margin: 0;
|
|
35
|
+
padding: 0;
|
|
36
|
+
border: 0;
|
|
37
|
+
border-radius: var(--a63-control-radius, var(--radius-md));
|
|
38
|
+
background: transparent;
|
|
39
|
+
color: var(--a63-text-secondary);
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
transition: color var(--a63-control-feedback-duration) var(--a63-control-feedback-ease);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/*
|
|
45
|
+
* The box stays one line tall for alignment, but an interactive slot still owes
|
|
46
|
+
* WCAG 2.2 (2.5.8) a 24px target: an invisible expansion of exactly
|
|
47
|
+
* (24px - 1lh) / 2 beyond every edge, which costs no layout.
|
|
48
|
+
*/
|
|
49
|
+
.a63-InformDismissButton::after {
|
|
50
|
+
position: absolute;
|
|
51
|
+
inset: calc((1lh - 1.5rem) / 2);
|
|
52
|
+
content: '';
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@media (hover: hover) {
|
|
56
|
+
.a63-InformDismissButton:hover {
|
|
57
|
+
color: var(--a63-text-primary);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.a63-InformDismissButton:focus-visible {
|
|
62
|
+
outline: 2px solid var(--a63-focus-ring);
|
|
63
|
+
outline-offset: 2px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* ── Row and text block ────────────────────────────────────────────────── */
|
|
67
|
+
.a63-Inform-row {
|
|
68
|
+
display: flex;
|
|
69
|
+
align-items: flex-start;
|
|
70
|
+
gap: var(--a63-space-3);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/*
|
|
74
|
+
* Title and body carry no margins of their own, so without the gap their line
|
|
75
|
+
* boxes touch and only the leading separates them.
|
|
76
|
+
*/
|
|
77
|
+
.a63-Inform-content {
|
|
78
|
+
display: flex;
|
|
79
|
+
flex: 1 1 0%;
|
|
80
|
+
flex-direction: column;
|
|
81
|
+
gap: var(--a63-space-1);
|
|
82
|
+
min-inline-size: 0;
|
|
83
|
+
font-size: var(--typography-sm-font-size);
|
|
84
|
+
line-height: 1.375;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.a63-Inform-title {
|
|
88
|
+
margin: 0;
|
|
89
|
+
font-weight: var(--font-weight-medium);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.a63-Inform-body {
|
|
93
|
+
margin: 0;
|
|
94
|
+
color: var(--a63-text-secondary);
|
|
95
|
+
text-wrap: pretty;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/* ── Actions ───────────────────────────────────────────────────────────── */
|
|
99
|
+
.a63-InformActions {
|
|
100
|
+
display: flex;
|
|
101
|
+
flex-wrap: wrap;
|
|
102
|
+
align-items: center;
|
|
103
|
+
gap: var(--a63-space-2);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/* ── Media ─────────────────────────────────────────────────────────────── */
|
|
107
|
+
|
|
108
|
+
/* A fixed square: a flyout's height feeds the stack's offsets. */
|
|
109
|
+
.a63-InformThumbnail {
|
|
110
|
+
display: block;
|
|
111
|
+
flex-shrink: 0;
|
|
112
|
+
inline-size: calc(var(--a63-space-6) * 2);
|
|
113
|
+
block-size: calc(var(--a63-space-6) * 2);
|
|
114
|
+
overflow: hidden;
|
|
115
|
+
border-radius: var(--a63-surface-radius, var(--radius-lg));
|
|
116
|
+
background-color: var(--a63-surface-muted);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/* A fixed aspect ratio, so a late decode does not shift the text. */
|
|
120
|
+
.a63-InformMedia {
|
|
121
|
+
inline-size: 100%;
|
|
122
|
+
aspect-ratio: 16 / 9;
|
|
123
|
+
overflow: hidden;
|
|
124
|
+
border-radius: var(--a63-surface-radius, var(--radius-lg));
|
|
125
|
+
background-color: var(--a63-surface-muted);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.a63-InformThumbnail :is(img, video),
|
|
129
|
+
.a63-InformMedia :is(img, video) {
|
|
130
|
+
display: block;
|
|
131
|
+
inline-size: 100%;
|
|
132
|
+
block-size: 100%;
|
|
133
|
+
object-fit: cover;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/* ── Severity ──────────────────────────────────────────────────────────── */
|
|
137
|
+
|
|
138
|
+
/*
|
|
139
|
+
* `info` is deliberately neutral: it is the default editorial voice. Only the
|
|
140
|
+
* louder severities spend color.
|
|
141
|
+
*
|
|
142
|
+
* A title in a raw status color fails WCAG AA contrast at this size (warning
|
|
143
|
+
* measured 3.4:1 on the light page, danger 3.0:1 on the dark one), so the
|
|
144
|
+
* text mixes the status color toward the primary text color. That darkens it
|
|
145
|
+
* in light mode and lightens it in dark mode, keeping the hue while clearing
|
|
146
|
+
* 4.5:1. The dialog variants out-rank the dialog title's own color.
|
|
147
|
+
*/
|
|
148
|
+
.a63-Inform-border-info {
|
|
149
|
+
border-color: var(--a63-border-subtle);
|
|
150
|
+
}
|
|
151
|
+
.a63-Inform-border-success {
|
|
152
|
+
border-color: color-mix(in oklab, var(--a63-status-success) 40%, transparent);
|
|
153
|
+
}
|
|
154
|
+
.a63-Inform-border-warning {
|
|
155
|
+
border-color: color-mix(in oklab, var(--a63-status-warning) 40%, transparent);
|
|
156
|
+
}
|
|
157
|
+
.a63-Inform-border-danger {
|
|
158
|
+
border-color: color-mix(in oklab, var(--a63-action-danger) 40%, transparent);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.a63-Inform-text-info,
|
|
162
|
+
.a63-InformDialog .a63-Inform-text-info {
|
|
163
|
+
color: var(--a63-text-primary);
|
|
164
|
+
}
|
|
165
|
+
.a63-Inform-text-success,
|
|
166
|
+
.a63-InformDialog .a63-Inform-text-success {
|
|
167
|
+
color: color-mix(in oklab, var(--a63-status-success) 70%, var(--a63-text-primary));
|
|
168
|
+
}
|
|
169
|
+
.a63-Inform-text-warning,
|
|
170
|
+
.a63-InformDialog .a63-Inform-text-warning {
|
|
171
|
+
color: color-mix(in oklab, var(--a63-status-warning) 70%, var(--a63-text-primary));
|
|
172
|
+
}
|
|
173
|
+
.a63-Inform-text-danger,
|
|
174
|
+
.a63-InformDialog .a63-Inform-text-danger {
|
|
175
|
+
color: color-mix(in oklab, var(--a63-action-danger) 70%, var(--a63-text-primary));
|
|
176
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Inform spotlight — a blocking guide step: a scrim with a cutout over the
|
|
3
|
+
* anchor, and a bubble placed beside it. The bubble is the same raised overlay
|
|
4
|
+
* surface as the corner flyout. Positions come from script (the anchor's
|
|
5
|
+
* viewport rect), so they are physical `top` / `left` values.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
.a63-InformSpotlight {
|
|
9
|
+
position: fixed;
|
|
10
|
+
inset: 0;
|
|
11
|
+
z-index: var(--z-layer-scrim);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/*
|
|
15
|
+
* The cutout is an empty box over the anchor carrying a huge shadow spread:
|
|
16
|
+
* visually a hole in the scrim, without clip-path math, and it keeps a
|
|
17
|
+
* token-driven radius.
|
|
18
|
+
*/
|
|
19
|
+
.a63-InformSpotlight-cutout {
|
|
20
|
+
position: absolute;
|
|
21
|
+
border-radius: var(--a63-surface-radius, var(--radius-lg));
|
|
22
|
+
box-shadow: 0 0 0 9999px var(--a63-scrim);
|
|
23
|
+
transition: opacity var(--a63-control-feedback-duration) var(--a63-control-feedback-ease);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.a63-InformSpotlight-bubble {
|
|
27
|
+
position: absolute;
|
|
28
|
+
box-sizing: border-box;
|
|
29
|
+
inline-size: min(20rem, calc(100vw - 2rem));
|
|
30
|
+
padding: var(--a63-space-4);
|
|
31
|
+
border: var(--a63-overlay-border-width) var(--a63-overlay-border-style) var(--a63-border-subtle);
|
|
32
|
+
border-radius: var(--a63-overlay-radius, var(--radius-2xl));
|
|
33
|
+
background-color: var(--a63-surface-overlay);
|
|
34
|
+
background-image: var(--a63-overlay-gloss), var(--a63-overlay-texture-image);
|
|
35
|
+
background-blend-mode: normal, var(--a63-overlay-texture-blend);
|
|
36
|
+
backdrop-filter: var(--a63-overlay-backdrop);
|
|
37
|
+
box-shadow: var(--a63-overlay-inner-shadow, none), var(--a63-overlay-shadow);
|
|
38
|
+
color: var(--a63-text-primary);
|
|
39
|
+
outline: none;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.a63-InformSpotlight-bubble:focus-visible {
|
|
43
|
+
outline: 2px solid var(--a63-focus-ring);
|
|
44
|
+
outline-offset: 2px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.a63-InformSpotlight-bubble .a63-InformActions {
|
|
48
|
+
margin-block-start: var(--a63-space-2);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@media (prefers-reduced-motion: reduce) {
|
|
52
|
+
.a63-InformSpotlight-cutout {
|
|
53
|
+
transition: none;
|
|
54
|
+
}
|
|
55
|
+
}
|