barua-ui 0.2.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.
@@ -0,0 +1,364 @@
1
+ /* ==========================================================================
2
+ Barua UI — Feedback
3
+ Alert, Banner, Toast/Snackbar/Notification, Status Indicator,
4
+ Progress Bar, Circular Progress, Spinner, Skeleton, result states.
5
+ ========================================================================== */
6
+
7
+ @layer components {
8
+ /* ---- Alert ---------------------------------------------------------------
9
+ Variants: info (default) / success / warning / danger.
10
+ --------------------------------------------------------------------------- */
11
+ .b-alert {
12
+ display: flex;
13
+ gap: var(--b-space-3);
14
+ padding: var(--b-space-3) var(--b-space-4);
15
+ font-size: var(--b-text-subheadline);
16
+ color: var(--b-text);
17
+ background: var(--b-color-info-soft);
18
+ border: 1px solid color-mix(in srgb, var(--b-color-info) 25%, transparent);
19
+ border-radius: var(--b-radius-lg);
20
+ }
21
+ .b-alert__icon { flex: none; color: var(--b-color-info); margin-block-start: 0.1em; }
22
+ .b-alert__icon svg, .b-alert__icon { width: 1.15rem; height: 1.15rem; }
23
+ .b-alert__content { flex: 1; min-width: 0; }
24
+ .b-alert__title { font-weight: var(--b-weight-semibold); }
25
+ .b-alert__desc { color: var(--b-text-secondary); font-size: var(--b-text-footnote); }
26
+ .b-alert__close {
27
+ flex: none;
28
+ align-self: flex-start;
29
+ background: none;
30
+ border: none;
31
+ color: var(--b-text-tertiary);
32
+ cursor: pointer;
33
+ padding: 0.1rem;
34
+ border-radius: var(--b-radius-xs);
35
+ }
36
+ .b-alert__close:hover { color: var(--b-text); }
37
+
38
+ .b-alert--success {
39
+ background: var(--b-color-success-soft);
40
+ border-color: color-mix(in srgb, var(--b-color-success) 30%, transparent);
41
+ }
42
+ .b-alert--success .b-alert__icon { color: var(--b-color-success); }
43
+ .b-alert--warning {
44
+ background: var(--b-color-warning-soft);
45
+ border-color: color-mix(in srgb, var(--b-color-warning) 35%, transparent);
46
+ }
47
+ .b-alert--warning .b-alert__icon { color: var(--b-color-warning); }
48
+ .b-alert--danger {
49
+ background: var(--b-color-danger-soft);
50
+ border-color: color-mix(in srgb, var(--b-color-danger) 30%, transparent);
51
+ }
52
+ .b-alert--danger .b-alert__icon { color: var(--b-color-danger); }
53
+
54
+ /* ---- Banner (full-width announcement) ------------------------------------- */
55
+ .b-banner {
56
+ display: flex;
57
+ align-items: center;
58
+ justify-content: center;
59
+ gap: var(--b-space-3);
60
+ padding: var(--b-space-2) var(--b-space-4);
61
+ font-size: var(--b-text-footnote);
62
+ font-weight: var(--b-weight-medium);
63
+ text-align: center;
64
+ color: var(--b-color-on-accent);
65
+ background: linear-gradient(90deg, var(--b-color-accent), color-mix(in srgb, var(--b-color-indigo) 80%, var(--b-color-accent)));
66
+ }
67
+ .b-banner a { color: inherit; text-decoration: underline; text-underline-offset: 0.2em; }
68
+ .b-banner__close {
69
+ background: none; border: none;
70
+ color: inherit; opacity: 0.8; cursor: pointer;
71
+ }
72
+ .b-banner--neutral {
73
+ color: var(--b-text);
74
+ background: var(--b-surface-2);
75
+ border-bottom: 1px solid var(--b-separator);
76
+ }
77
+
78
+ /* ---- Toast / Snackbar / Notification ---------------------------------------- */
79
+ .b-toast-region {
80
+ position: fixed;
81
+ inset-block-end: var(--b-space-4);
82
+ inset-inline-end: var(--b-space-4);
83
+ z-index: var(--b-z-toast);
84
+ display: flex;
85
+ flex-direction: column;
86
+ align-items: flex-end;
87
+ gap: var(--b-space-2);
88
+ pointer-events: none;
89
+ }
90
+ .b-toast-region--center { inset-inline: 0; align-items: center; }
91
+ .b-toast {
92
+ display: flex;
93
+ align-items: center;
94
+ gap: var(--b-space-3);
95
+ min-width: 16rem;
96
+ max-width: min(24rem, calc(100vw - 2rem));
97
+ padding: var(--b-space-3) var(--b-space-4);
98
+ font-size: var(--b-text-subheadline);
99
+ background: color-mix(in srgb, var(--b-elevated) 88%, transparent);
100
+ -webkit-backdrop-filter: var(--b-glass);
101
+ backdrop-filter: var(--b-glass);
102
+ border: 1px solid var(--b-hairline);
103
+ border-radius: var(--b-radius-lg);
104
+ box-shadow: var(--b-glass-edge), var(--b-elevation-4);
105
+ pointer-events: auto;
106
+ animation: b-toast-in var(--b-duration-slow) var(--b-ease-spring);
107
+ }
108
+ .b-toast.is-leaving { animation: b-toast-out var(--b-duration-normal) var(--b-ease-in) forwards; }
109
+ .b-toast__icon { flex: none; width: 1.15rem; height: 1.15rem; }
110
+ .b-toast__icon svg { width: 100%; height: 100%; }
111
+ .b-toast--success .b-toast__icon { color: var(--b-color-success); }
112
+ .b-toast--danger .b-toast__icon { color: var(--b-color-danger); }
113
+ .b-toast--warning .b-toast__icon { color: var(--b-color-warning); }
114
+ .b-toast__content { flex: 1; min-width: 0; }
115
+ .b-toast__title { font-weight: var(--b-weight-semibold); }
116
+ .b-toast__desc { font-size: var(--b-text-footnote); color: var(--b-text-secondary); }
117
+ .b-toast__action {
118
+ flex: none;
119
+ color: var(--b-color-accent-text);
120
+ font-weight: var(--b-weight-semibold);
121
+ background: none; border: none;
122
+ cursor: pointer;
123
+ font-size: var(--b-text-footnote);
124
+ }
125
+ @keyframes b-toast-in {
126
+ from { opacity: 0; translate: 0 12px; scale: 0.96; }
127
+ }
128
+ @keyframes b-toast-out {
129
+ to { opacity: 0; translate: 0 8px; scale: 0.96; }
130
+ }
131
+
132
+ /* Rich notification (title + body + actions) */
133
+ .b-notification {
134
+ display: flex;
135
+ gap: var(--b-space-3);
136
+ width: min(22rem, calc(100vw - 2rem));
137
+ max-width: 100%;
138
+ padding: var(--b-space-4);
139
+ background: color-mix(in srgb, var(--b-elevated) 90%, transparent);
140
+ -webkit-backdrop-filter: var(--b-glass);
141
+ backdrop-filter: var(--b-glass);
142
+ border: 1px solid var(--b-hairline);
143
+ border-radius: var(--b-radius-xl);
144
+ box-shadow: var(--b-glass-edge), var(--b-elevation-4);
145
+ }
146
+ .b-notification__body { flex: 1; min-width: 0; }
147
+ .b-notification__app {
148
+ font-size: var(--b-text-caption);
149
+ font-weight: var(--b-weight-semibold);
150
+ text-transform: uppercase;
151
+ letter-spacing: var(--b-tracking-wide);
152
+ color: var(--b-text-tertiary);
153
+ }
154
+ .b-notification__title { font-weight: var(--b-weight-semibold); font-size: var(--b-text-subheadline); }
155
+ .b-notification__desc { font-size: var(--b-text-footnote); color: var(--b-text-secondary); }
156
+ .b-notification__time { font-size: var(--b-text-caption); color: var(--b-text-tertiary); flex: none; }
157
+
158
+
159
+ /* ---- Tip (TipKit-style callout) ------------------------------------------ */
160
+ .b-tip {
161
+ display: flex;
162
+ gap: var(--b-space-3);
163
+ padding: var(--b-space-4);
164
+ background: var(--b-material-regular-bg);
165
+ -webkit-backdrop-filter: var(--b-glass);
166
+ backdrop-filter: var(--b-glass);
167
+ border: 1px solid var(--b-hairline);
168
+ border-radius: var(--b-radius-lg);
169
+ box-shadow: var(--b-glass-edge), var(--b-shadow-sm);
170
+ }
171
+ .b-tip__icon {
172
+ flex: none;
173
+ display: grid;
174
+ place-items: center;
175
+ width: 2.25rem;
176
+ height: 2.25rem;
177
+ color: var(--b-color-accent-text);
178
+ background: var(--b-color-accent-soft);
179
+ border-radius: var(--b-radius-md);
180
+ }
181
+ .b-tip__icon svg { width: 1.2rem; height: 1.2rem; }
182
+ .b-tip__content { flex: 1; min-width: 0; }
183
+ .b-tip__title { font-size: var(--b-text-subheadline); font-weight: var(--b-weight-semibold); }
184
+ .b-tip__desc { font-size: var(--b-text-footnote); color: var(--b-text-secondary); }
185
+ .b-tip__actions { display: flex; gap: var(--b-space-3); margin-block-start: var(--b-space-2); }
186
+ .b-tip__close {
187
+ flex: none;
188
+ align-self: flex-start;
189
+ background: none;
190
+ border: none;
191
+ color: var(--b-text-tertiary);
192
+ cursor: pointer;
193
+ padding: 0.1rem;
194
+ }
195
+ .b-tip__close:hover { color: var(--b-text); }
196
+
197
+ /* ---- Status Indicator --------------------------------------------------------- */
198
+ .b-status {
199
+ display: inline-flex;
200
+ align-items: center;
201
+ gap: var(--b-space-2);
202
+ font-size: var(--b-text-footnote);
203
+ font-weight: var(--b-weight-medium);
204
+ }
205
+ .b-status::before {
206
+ content: "";
207
+ width: 0.5rem; height: 0.5rem;
208
+ border-radius: 50%;
209
+ background: var(--b-gray-2);
210
+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--b-gray-2) 20%, transparent);
211
+ }
212
+ .b-status--online::before, .b-status--success::before {
213
+ background: var(--b-color-success);
214
+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--b-color-success) 22%, transparent);
215
+ }
216
+ .b-status--busy::before, .b-status--danger::before {
217
+ background: var(--b-color-danger);
218
+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--b-color-danger) 22%, transparent);
219
+ }
220
+ .b-status--away::before, .b-status--warning::before {
221
+ background: var(--b-color-warning);
222
+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--b-color-warning) 25%, transparent);
223
+ }
224
+ .b-status--pulse::before { animation: b-pulse 1.6s var(--b-ease-standard) infinite; }
225
+ @keyframes b-pulse {
226
+ 50% { opacity: 0.55; }
227
+ }
228
+
229
+ /* ---- Progress Bar --------------------------------------------------------------- */
230
+ .b-progress {
231
+ width: 100%;
232
+ height: 0.375rem;
233
+ background: var(--b-fill-tertiary);
234
+ border-radius: var(--b-radius-full);
235
+ overflow: hidden;
236
+ }
237
+ .b-progress__fill {
238
+ height: 100%;
239
+ width: var(--b-progress, 0%);
240
+ background: var(--b-color-accent);
241
+ border-radius: inherit;
242
+ transition: width var(--b-duration-slow) var(--b-ease-out);
243
+ }
244
+ .b-progress--sm { height: 0.25rem; }
245
+ .b-progress--lg { height: 0.625rem; }
246
+ .b-progress--success .b-progress__fill { background: var(--b-color-success); }
247
+ .b-progress--warning .b-progress__fill { background: var(--b-color-warning); }
248
+ .b-progress--danger .b-progress__fill { background: var(--b-color-danger); }
249
+ .b-progress--indeterminate .b-progress__fill {
250
+ width: 40%;
251
+ animation: b-indeterminate 1.4s var(--b-ease-standard) infinite;
252
+ }
253
+ @keyframes b-indeterminate {
254
+ from { translate: -110% 0; }
255
+ to { translate: 260% 0; }
256
+ }
257
+
258
+ /* ---- Circular Progress / Gauge ring ----------------------------------------------- */
259
+ .b-circular {
260
+ --b-progress: 0;
261
+ --b-circular-size: 3rem;
262
+ --b-circular-track: 4px;
263
+ position: relative;
264
+ display: inline-grid;
265
+ place-items: center;
266
+ width: var(--b-circular-size);
267
+ height: var(--b-circular-size);
268
+ border-radius: 50%;
269
+ background:
270
+ conic-gradient(var(--b-color-accent) calc(var(--b-progress) * 1%), transparent 0);
271
+ -webkit-mask: radial-gradient(farthest-side,
272
+ transparent calc(100% - var(--b-circular-track)),
273
+ #000 calc(100% - var(--b-circular-track) + 0.5px));
274
+ mask: radial-gradient(farthest-side,
275
+ transparent calc(100% - var(--b-circular-track)),
276
+ #000 calc(100% - var(--b-circular-track) + 0.5px));
277
+ }
278
+ .b-circular::before {
279
+ content: "";
280
+ position: absolute;
281
+ inset: 0;
282
+ border-radius: 50%;
283
+ background: var(--b-fill-tertiary);
284
+ z-index: -1;
285
+ }
286
+ .b-circular-wrap {
287
+ position: relative;
288
+ display: inline-grid;
289
+ place-items: center;
290
+ }
291
+ .b-circular-wrap > .b-circular { grid-area: 1 / 1; }
292
+ .b-circular-wrap > .b-circular__label {
293
+ grid-area: 1 / 1;
294
+ font-size: var(--b-text-caption);
295
+ font-weight: var(--b-weight-semibold);
296
+ font-variant-numeric: tabular-nums;
297
+ }
298
+
299
+ /* ---- Loading Spinner ----------------------------------------------------------------- */
300
+ .b-spinner {
301
+ display: inline-block;
302
+ width: 1.25rem;
303
+ height: 1.25rem;
304
+ border: 2px solid var(--b-fill);
305
+ border-top-color: var(--b-color-accent);
306
+ border-radius: 50%;
307
+ animation: b-spin 0.7s linear infinite;
308
+ }
309
+ .b-spinner--sm { width: 1rem; height: 1rem; }
310
+ .b-spinner--lg { width: 2rem; height: 2rem; border-width: 3px; }
311
+
312
+ /* ---- Skeleton -------------------------------------------------------------------------- */
313
+ .b-skeleton {
314
+ position: relative;
315
+ overflow: hidden;
316
+ background: var(--b-fill-tertiary);
317
+ border-radius: var(--b-radius-sm);
318
+ min-height: 1em;
319
+ }
320
+ .b-skeleton::after {
321
+ content: "";
322
+ position: absolute;
323
+ inset: 0;
324
+ translate: -100% 0;
325
+ background: linear-gradient(90deg, transparent,
326
+ light-dark(rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.06)), transparent);
327
+ animation: b-shimmer 1.6s var(--b-ease-standard) infinite;
328
+ }
329
+ .b-skeleton--text { height: 0.9em; margin-block: 0.25em; }
330
+ .b-skeleton--title { height: 1.4em; width: 40%; }
331
+ .b-skeleton--circle { border-radius: 50%; aspect-ratio: 1; }
332
+ .b-skeleton--card { border-radius: var(--b-radius-xl); aspect-ratio: 16 / 7; }
333
+ @keyframes b-shimmer {
334
+ to { translate: 100% 0; }
335
+ }
336
+
337
+ /* ---- Result states (Success / Error / Warning / Confirmation) --------------------------
338
+ Full-panel outcome message. Compose: .b-result + modifier.
339
+ ------------------------------------------------------------------------------------------ */
340
+ .b-result {
341
+ display: flex;
342
+ flex-direction: column;
343
+ align-items: center;
344
+ gap: var(--b-space-2);
345
+ padding: var(--b-space-10) var(--b-space-6);
346
+ text-align: center;
347
+ }
348
+ .b-result__icon {
349
+ display: grid;
350
+ place-items: center;
351
+ width: 3.5rem; height: 3.5rem;
352
+ margin-block-end: var(--b-space-2);
353
+ border-radius: 50%;
354
+ font-size: 1.5rem;
355
+ }
356
+ .b-result__icon svg { width: 1.75rem; height: 1.75rem; }
357
+ .b-result--success .b-result__icon { color: var(--b-color-success); background: var(--b-color-success-soft); }
358
+ .b-result--error .b-result__icon { color: var(--b-color-danger); background: var(--b-color-danger-soft); }
359
+ .b-result--warning .b-result__icon { color: var(--b-color-warning); background: var(--b-color-warning-soft); }
360
+ .b-result--confirm .b-result__icon { color: var(--b-color-accent-text); background: var(--b-color-accent-soft); }
361
+ .b-result__title { font-size: var(--b-text-title3); font-weight: var(--b-weight-bold); }
362
+ .b-result__desc { max-width: 30rem; color: var(--b-text-secondary); font-size: var(--b-text-subheadline); }
363
+ .b-result__actions { display: flex; gap: var(--b-space-2); margin-block-start: var(--b-space-4); }
364
+ }