@booki-aui/styles 0.2.0 → 0.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@booki-aui/styles",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Booki default look — Paper and Ink tokens and data-slot styles, with the agent cursor. Optional.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/booki.css CHANGED
@@ -191,6 +191,12 @@
191
191
 
192
192
  /* ── Shared form chrome ──────────────────────────────────────────────── */
193
193
 
194
+ @media (pointer: coarse) {
195
+ :root {
196
+ --bk-control-h: 2.75rem;
197
+ }
198
+ }
199
+
194
200
  :where([data-slot]) {
195
201
  & :is(label) {
196
202
  display: grid;
@@ -249,15 +255,7 @@
249
255
  font-size: 0.875rem;
250
256
  }
251
257
  }
252
- }
253
-
254
- @media (pointer: coarse) {
255
- :root {
256
- --bk-control-h: 2.75rem;
257
- }
258
- }
259
258
 
260
- :where([data-slot]) {
261
259
  & select {
262
260
  appearance: none;
263
261
  padding-right: 2rem;
@@ -311,85 +309,97 @@
311
309
  opacity: 0.55;
312
310
  cursor: not-allowed;
313
311
  }
314
- }
315
312
 
316
- :where([data-slot]) button,
317
- :where([data-slot="payment-confirm-actions"]) button,
318
- :where([data-slot="sca-prompt-actions"]) button,
319
- :where([data-slot="exception-banner-actions"]) button,
320
- :where([data-slot="approval-gate-actions"]) button,
321
- :where([data-slot="attestation-status-actions"]) button,
322
- :where([data-slot="attestation-status-approve"]),
323
- :where([data-slot="attestation-status-reject"]),
324
- :where([data-slot="attestation-status-escalate"]),
325
- :where([data-slot="country-toggle"]) button {
326
- appearance: none;
327
- box-sizing: border-box;
328
- display: inline-flex;
329
- align-items: center;
330
- justify-content: center;
331
- gap: 0.4rem;
332
- min-height: var(--bk-control-h);
333
- padding: 0.4rem 0.9rem;
334
- border: 1px solid transparent;
335
- border-radius: var(--bk-radius-sm);
336
- background: var(--bk-primary);
337
- color: var(--bk-primary-fg);
338
- font: inherit;
339
- font-size: 0.8125rem;
340
- font-weight: var(--bk-font-weight-medium);
341
- letter-spacing: -0.01em;
342
- line-height: 1.2;
343
- cursor: pointer;
344
- transition:
345
- background-color var(--bk-duration) var(--bk-ease-out),
346
- border-color var(--bk-duration) var(--bk-ease-out),
347
- color var(--bk-duration) var(--bk-ease-out),
348
- box-shadow var(--bk-duration) var(--bk-ease-out),
349
- transform var(--bk-duration) ease-out;
350
- }
313
+ /* Buttons. The attestation decisions are parts of a component in the scope,
314
+ so "& :where(…)" reaches them and keeps their specificity at zero. */
315
+ & button,
316
+ & :where([data-slot="attestation-status-approve"]),
317
+ & :where([data-slot="attestation-status-reject"]),
318
+ & :where([data-slot="attestation-status-escalate"]) {
319
+ appearance: none;
320
+ box-sizing: border-box;
321
+ display: inline-flex;
322
+ align-items: center;
323
+ justify-content: center;
324
+ gap: 0.4rem;
325
+ min-height: var(--bk-control-h);
326
+ padding: 0.4rem 0.9rem;
327
+ border: 1px solid transparent;
328
+ border-radius: var(--bk-radius-sm);
329
+ background: var(--bk-primary);
330
+ color: var(--bk-primary-fg);
331
+ font: inherit;
332
+ font-size: 0.8125rem;
333
+ font-weight: var(--bk-font-weight-medium);
334
+ letter-spacing: -0.01em;
335
+ line-height: 1.2;
336
+ cursor: pointer;
337
+ transition:
338
+ background-color var(--bk-duration) var(--bk-ease-out),
339
+ border-color var(--bk-duration) var(--bk-ease-out),
340
+ color var(--bk-duration) var(--bk-ease-out),
341
+ box-shadow var(--bk-duration) var(--bk-ease-out),
342
+ transform var(--bk-duration) ease-out;
343
+ }
351
344
 
352
- :where([data-slot]) button:focus-visible,
353
- :where([data-slot="attestation-status-approve"]):focus-visible,
354
- :where([data-slot="attestation-status-reject"]):focus-visible,
355
- :where([data-slot="attestation-status-escalate"]):focus-visible {
356
- outline: 2px solid var(--bk-ring);
357
- outline-offset: 2px;
358
- }
345
+ & button:focus-visible,
346
+ & :where([data-slot="attestation-status-approve"]):focus-visible,
347
+ & :where([data-slot="attestation-status-reject"]):focus-visible,
348
+ & :where([data-slot="attestation-status-escalate"]):focus-visible {
349
+ outline: 2px solid var(--bk-ring);
350
+ outline-offset: 2px;
351
+ }
359
352
 
360
- /* Zero specificity, like the base rule: a button that carries its own class
361
- (a ui-sdk part, the host's own) keeps its look on hover. With plain
362
- :where([data-slot]) button:hover this outranked every class and turned such
363
- buttons into dark primaries with dark text. */
364
- @media (hover: hover) and (pointer: fine) {
365
- :where([data-slot] button:hover:not(:disabled)),
366
- :where([data-slot="attestation-status-approve"]:hover:not(:disabled)) {
367
- background: color-mix(in srgb, var(--bk-primary) 88%, var(--bk-primary-fg));
353
+ /* Zero specificity, like the base rule: a button that carries its own class
354
+ (a ui-sdk part, the host's own) keeps its look on hover. With a plain
355
+ "button:hover" this outranked every class and turned such buttons into
356
+ dark primaries with dark text. */
357
+ @media (hover: hover) and (pointer: fine) {
358
+ & :where(button:hover:not(:disabled)),
359
+ & :where([data-slot="attestation-status-approve"]:hover:not(:disabled)) {
360
+ background: color-mix(in srgb, var(--bk-primary) 88%, var(--bk-primary-fg));
361
+ }
368
362
  }
369
- }
370
363
 
371
- :where([data-slot] button:active:not(:disabled)),
372
- :where([data-slot="attestation-status-approve"]:active:not(:disabled)),
373
- :where([data-slot="attestation-status-reject"]:active:not(:disabled)),
374
- :where([data-slot="attestation-status-escalate"]:active:not(:disabled)) {
375
- transform: scale(0.97);
376
- }
364
+ & :where(button:active:not(:disabled)),
365
+ & :where([data-slot="attestation-status-approve"]:active:not(:disabled)),
366
+ & :where([data-slot="attestation-status-reject"]:active:not(:disabled)),
367
+ & :where([data-slot="attestation-status-escalate"]:active:not(:disabled)) {
368
+ transform: scale(0.97);
369
+ }
377
370
 
378
- :where([data-slot]) button[data-variant="secondary"],
379
- :where([data-slot="attestation-status-reject"]),
380
- :where([data-slot="attestation-status-escalate"]) {
381
- background: var(--bk-card);
382
- border-color: var(--bk-border);
383
- color: var(--bk-fg);
384
- box-shadow: var(--bk-shadow-xs);
385
- }
371
+ & button[data-variant="secondary"],
372
+ & :where([data-slot="attestation-status-reject"]),
373
+ & :where([data-slot="attestation-status-escalate"]) {
374
+ background: var(--bk-card);
375
+ border-color: var(--bk-border);
376
+ color: var(--bk-fg);
377
+ box-shadow: var(--bk-shadow-xs);
378
+ }
386
379
 
387
- @media (hover: hover) and (pointer: fine) {
388
- :where([data-slot]) button[data-variant="secondary"]:hover:not(:disabled),
389
- :where([data-slot="attestation-status-reject"]):hover:not(:disabled),
390
- :where([data-slot="attestation-status-escalate"]):hover:not(:disabled) {
391
- background: var(--bk-muted);
392
- border-color: var(--bk-border-strong);
380
+ @media (hover: hover) and (pointer: fine) {
381
+ & button[data-variant="secondary"]:hover:not(:disabled),
382
+ & :where([data-slot="attestation-status-reject"]):hover:not(:disabled),
383
+ & :where([data-slot="attestation-status-escalate"]):hover:not(:disabled) {
384
+ background: var(--bk-muted);
385
+ border-color: var(--bk-border-strong);
386
+ }
387
+ }
388
+
389
+ /* Field description / error (ui-sdk Field children) */
390
+ & p {
391
+ margin: 0;
392
+ font-size: 0.75rem;
393
+ line-height: 1.4;
394
+ font-weight: 400;
395
+ color: var(--bk-muted-fg);
396
+ }
397
+
398
+ & [data-slot$="-error"],
399
+ & [role="alert"]:not([data-slot="exception-banner"]) {
400
+ margin: 0;
401
+ font-size: 0.8125rem;
402
+ color: var(--bk-danger);
393
403
  }
394
404
  }
395
405
 
@@ -410,24 +420,6 @@
410
420
  order: 3;
411
421
  }
412
422
 
413
- :where([data-slot]) {
414
- /* Field description / error (ui-sdk Field children) */
415
- & p {
416
- margin: 0;
417
- font-size: 0.75rem;
418
- line-height: 1.4;
419
- font-weight: 400;
420
- color: var(--bk-muted-fg);
421
- }
422
-
423
- & [data-slot$="-error"],
424
- & [role="alert"]:not([data-slot="exception-banner"]) {
425
- margin: 0;
426
- font-size: 0.8125rem;
427
- color: var(--bk-danger);
428
- }
429
- }
430
-
431
423
  /* ── Text link ───────────────────────────────────────────────────────── */
432
424
 
433
425
  [data-slot="text-link"] {
@@ -1549,19 +1541,23 @@
1549
1541
  /* ── Reduced motion ──────────────────────────────────────────────────── */
1550
1542
 
1551
1543
  @media (prefers-reduced-motion: reduce) {
1552
- :where([data-slot]) :is(input, select, textarea, button),
1553
- :where([data-slot="attestation-status-approve"]),
1554
- :where([data-slot="attestation-status-reject"]),
1555
- :where([data-slot="attestation-status-escalate"]),
1556
- :where([data-slot="country-toggle"]) button,
1557
- [data-slot="voucher-lines-table"] tbody tr {
1558
- transition: none;
1544
+ :where([data-slot]) {
1545
+ & :is(input, select, textarea, button),
1546
+ & :where([data-slot="attestation-status-approve"]),
1547
+ & :where([data-slot="attestation-status-reject"]),
1548
+ & :where([data-slot="attestation-status-escalate"]) {
1549
+ transition: none;
1550
+ }
1551
+
1552
+ & button:active:not(:disabled),
1553
+ & :where([data-slot="attestation-status-approve"]):active:not(:disabled),
1554
+ & :where([data-slot="attestation-status-reject"]):active:not(:disabled),
1555
+ & :where([data-slot="attestation-status-escalate"]):active:not(:disabled) {
1556
+ transform: none;
1557
+ }
1559
1558
  }
1560
1559
 
1561
- :where([data-slot]) button:active:not(:disabled),
1562
- :where([data-slot="attestation-status-approve"]):active:not(:disabled),
1563
- :where([data-slot="attestation-status-reject"]):active:not(:disabled),
1564
- :where([data-slot="attestation-status-escalate"]):active:not(:disabled) {
1565
- transform: none;
1560
+ [data-slot="voucher-lines-table"] tbody tr {
1561
+ transition: none;
1566
1562
  }
1567
1563
  }