@sincpro/web-ui 2.1.0 → 2.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/README.md +111 -0
- package/dist/components/attachments/Attachments.d.ts +7 -1
- package/dist/components/attachments/Attachments.js +8 -2
- package/dist/components/board/Board.d.ts +32 -2
- package/dist/components/board/Board.js +27 -4
- package/dist/components/board/index.d.ts +1 -1
- package/dist/components/board/index.js +2 -1
- package/dist/components/listing/GroupingLevels.js +11 -9
- package/dist/components/listing/RecordCard.js +1 -1
- package/dist/components/listing/Row.js +2 -2
- package/dist/components/navigation/NavigationTree.js +37 -10
- package/dist/components/search/CriteriaBuilder.js +3 -2
- package/dist/components/search/CriteriaChips.js +6 -5
- package/dist/components/search/JoinWord.js +1 -1
- package/dist/components/search/SearchBar.js +68 -29
- package/dist/components/shell/AppFrame.d.ts +18 -2
- package/dist/components/shell/AppFrame.js +143 -12
- package/dist/components/shell/Sidebar.d.ts +39 -0
- package/dist/components/shell/Sidebar.js +57 -0
- package/dist/components/shell/TopBar.d.ts +10 -1
- package/dist/components/shell/TopBar.js +18 -13
- package/dist/components/shell/brandMark.d.ts +17 -0
- package/dist/components/shell/brandMark.js +9 -0
- package/dist/components/shell/index.d.ts +3 -0
- package/dist/components/shell/index.js +6 -0
- package/dist/components/shell/sidebarDrawer.d.ts +26 -0
- package/dist/components/shell/sidebarDrawer.js +22 -0
- package/dist/foundations/copy.d.ts +13 -0
- package/dist/foundations/copy.es.js +12 -5
- package/dist/foundations/copy.js +12 -5
- package/dist/foundations/variants.js +19 -2
- package/dist/primitives/block/Block.js +1 -1
- package/dist/primitives/button/Button.d.ts +3 -1
- package/dist/primitives/button/Button.js +6 -6
- package/dist/primitives/choice/SegmentedControl.d.ts +4 -1
- package/dist/primitives/choice/SegmentedControl.js +35 -7
- package/dist/primitives/dialog/Dialog.d.ts +1 -1
- package/dist/primitives/dialog/Dialog.js +2 -2
- package/dist/primitives/field/CardNumberInput.js +1 -1
- package/dist/primitives/field/Checks.d.ts +14 -0
- package/dist/primitives/field/Checks.js +12 -4
- package/dist/primitives/field/DropZone.d.ts +22 -3
- package/dist/primitives/field/DropZone.js +33 -12
- package/dist/primitives/field/DurationInput.js +1 -1
- package/dist/primitives/field/Field.js +7 -7
- package/dist/primitives/field/PatternInput.js +1 -1
- package/dist/primitives/field/RichTextEditor.js +2 -2
- package/dist/primitives/field/SignatureInput.js +1 -1
- package/dist/primitives/field/aria.d.ts +2 -2
- package/dist/primitives/field/aria.js +5 -5
- package/dist/primitives/field/index.d.ts +1 -1
- package/dist/primitives/field/index.js +1 -1
- package/dist/primitives/menu/Menu.d.ts +29 -9
- package/dist/primitives/menu/Menu.js +77 -22
- package/dist/primitives/overlay/Popover.js +2 -2
- package/dist/primitives/picker/Picker.js +3 -3
- package/dist/primitives/picker/TagsField.js +1 -1
- package/dist/primitives/table/EditableTable.js +2 -2
- package/dist/primitives/table/ReportTable.js +1 -1
- package/dist/primitives/table/Table.js +2 -2
- package/dist/primitives/tabs/Tabs.js +2 -28
- package/dist/primitives/tag/Count.d.ts +23 -0
- package/dist/primitives/tag/Count.js +59 -0
- package/dist/primitives/tag/Tag.d.ts +9 -0
- package/dist/primitives/tag/Tag.js +14 -1
- package/dist/primitives/tag/Tags.js +6 -7
- package/dist/primitives/tag/index.d.ts +1 -0
- package/dist/primitives/tag/index.js +3 -0
- package/dist/primitives/value/Metric.d.ts +7 -2
- package/dist/primitives/value/Metric.js +14 -6
- package/dist/tokens.css +306 -72
- package/package.json +1 -1
package/dist/tokens.css
CHANGED
|
@@ -56,26 +56,29 @@
|
|
|
56
56
|
/* WARM white, not pure white: #FFFFFF on a full screen tires the eye and
|
|
57
57
|
cheapens the piece. It is called `ground` and not `base` because
|
|
58
58
|
`text-base` is already a Tailwind font size and the name would clash. */
|
|
59
|
-
--color-ground: #faf9f7;
|
|
59
|
+
--color-ground: var(--brand-ground, #faf9f7);
|
|
60
60
|
|
|
61
61
|
/* The raised surface IS white — that is what separates it from the ground.
|
|
62
62
|
Elevation here is done with a hairline border, not with a shadow: a shadow
|
|
63
63
|
on a light background is dirty grey. */
|
|
64
|
-
--color-surface: #ffffff;
|
|
64
|
+
--color-surface: var(--brand-surface, #ffffff);
|
|
65
65
|
|
|
66
66
|
/* The two hairlines. WARM grey — a neutral grey against a warm ground looks
|
|
67
67
|
bluish. They are not text: 1.26:1 and 1.49:1 on the ground, which is
|
|
68
68
|
exactly what a line that separates without shouting should measure. */
|
|
69
|
-
--color-line: #e4dfd7; /* 1.26:1 — common separator */
|
|
70
|
-
--color-line-strong:
|
|
69
|
+
--color-line: var(--brand-line, #e4dfd7); /* 1.26:1 — common separator */
|
|
70
|
+
--color-line-strong: var(
|
|
71
|
+
--brand-line-strong,
|
|
72
|
+
#d5cec2
|
|
73
|
+
); /* 1.49:1 — border of a box, table header */
|
|
71
74
|
|
|
72
75
|
/* Text: warm near-black. 16.96:1 on the ground, 17.85:1 on white. */
|
|
73
|
-
--color-ink: #1a1714;
|
|
76
|
+
--color-ink: var(--brand-ink, #1a1714);
|
|
74
77
|
|
|
75
78
|
/* Faint text — labels, metadata, units. 5.56:1 on the ground and 5.85:1 on
|
|
76
79
|
white: it passes AA for small text, which is exactly where it is used. The
|
|
77
80
|
#8A8178 from the dark theme gave 3.63:1 here and was discarded. */
|
|
78
|
-
--color-muted: #6b6459;
|
|
81
|
+
--color-muted: var(--brand-muted, #6b6459);
|
|
79
82
|
|
|
80
83
|
/* ---------------------------------------------------------------- *
|
|
81
84
|
* THE GOLD — and the rule that governs it on light.
|
|
@@ -92,14 +95,17 @@
|
|
|
92
95
|
* as the border that marks a state. If the gold needs to say something, it
|
|
93
96
|
* is the dark text on top of it that says it.
|
|
94
97
|
* ---------------------------------------------------------------- */
|
|
95
|
-
--color-accent: #c89b3c; /* 2.43:1 on the ground → NEVER text */
|
|
96
|
-
--color-accent-hover:
|
|
98
|
+
--color-accent: var(--brand-accent, #c89b3c); /* 2.43:1 on the ground → NEVER text */
|
|
99
|
+
--color-accent-hover: var(
|
|
100
|
+
--brand-accent-hover,
|
|
101
|
+
#b88a2e
|
|
102
|
+
); /* on light the hover DARKENS: ink on top gives 5.71:1 */
|
|
97
103
|
|
|
98
104
|
/* The text ON the gold. It is its own token and not `ink` because `ink` flips
|
|
99
105
|
to a light colour in the dark theme, and light text on gold is 2.4:1: the
|
|
100
106
|
primary action would stop being readable the moment the theme changed. The
|
|
101
107
|
gold button is dark-on-gold in BOTH themes. */
|
|
102
|
-
--color-on-accent: #1a1714; /* 6.98:1 on the gold */
|
|
108
|
+
--color-on-accent: var(--brand-on-accent, #1a1714); /* 6.98:1 on the gold */
|
|
103
109
|
|
|
104
110
|
/* Data blue. On light the brand blue reads in full, without lightening it:
|
|
105
111
|
13.52:1. In the dark theme it had to be lightened to #3D5CA8 so that a 6px
|
|
@@ -140,8 +146,11 @@
|
|
|
140
146
|
product read as assembled, not designed. It is now the chrome's own navy,
|
|
141
147
|
less saturated: still clearly blue, one family with the bar, and it reads
|
|
142
148
|
BETTER — 8.26:1 as text (was 7.48:1), white on top 8.69:1 (was 7.87:1). */
|
|
143
|
-
--color-primary: #2a4a85; /* 8.26:1 · white on top 8.69:1 */
|
|
144
|
-
--color-primary-hover:
|
|
149
|
+
--color-primary: var(--brand-primary, #2a4a85); /* 8.26:1 · white on top 8.69:1 */
|
|
150
|
+
--color-primary-hover: var(
|
|
151
|
+
--brand-primary-hover,
|
|
152
|
+
#1c3765
|
|
153
|
+
); /* 11.19:1 · white on top 11.77:1 */
|
|
145
154
|
|
|
146
155
|
/* Destructive. It is the SAME red as the `bad` state, on purpose: the red
|
|
147
156
|
that says «this went wrong» and the one that says «this is going to delete
|
|
@@ -224,15 +233,21 @@
|
|
|
224
233
|
practical consequence — the `brand-wash` is BORN out of the background
|
|
225
234
|
itself instead of being painted on top, which is why here the wash reads as
|
|
226
235
|
light and on black it read as a stain. */
|
|
227
|
-
--color-chrome: #141b2e; /* the base */
|
|
228
|
-
--color-chrome-raised: #1e2740; /* active tab, open menu */
|
|
236
|
+
--color-chrome: var(--brand-chrome, #141b2e); /* the base */
|
|
237
|
+
--color-chrome-raised: var(--brand-chrome-raised, #1e2740); /* active tab, open menu */
|
|
229
238
|
/* The hairline under the application bar. On light the chrome already
|
|
230
239
|
separates from the canvas by luminance, so it IS the chrome (invisible); in the
|
|
231
240
|
dark theme the two are both near-black and the hairline is what tells them apart. */
|
|
232
|
-
--color-chrome-edge:
|
|
241
|
+
--color-chrome-edge: var(
|
|
242
|
+
--brand-chrome-edge,
|
|
243
|
+
#141b2e
|
|
244
|
+
); /* 1.00:1 on the chrome — invisible on light, a hairline on dark */
|
|
233
245
|
--color-chrome-ink: #e8e4de; /* 13.53:1 — text */
|
|
234
246
|
--color-chrome-muted: #a39b90; /* 6.24:1 — faint text */
|
|
235
|
-
--color-chrome-accent:
|
|
247
|
+
--color-chrome-accent: var(
|
|
248
|
+
--brand-chrome-accent,
|
|
249
|
+
#c89b3c
|
|
250
|
+
); /* 6.70:1 — the gold, here it IS text */
|
|
236
251
|
|
|
237
252
|
/* ── The link had to change, and the reason is NOT contrast ──────────
|
|
238
253
|
The blue #6FA0EA gave 6.44:1 on this background: too dark, it sank into the
|
|
@@ -243,7 +258,10 @@
|
|
|
243
258
|
(220°) at 9.46:1 separates from the bar as clearly as the cyan did (9.94:1)
|
|
244
259
|
and stays in the palette. WCAG measures luminance and people see hue — here
|
|
245
260
|
both agree: light on dark, one family. */
|
|
246
|
-
--color-chrome-link:
|
|
261
|
+
--color-chrome-link: var(
|
|
262
|
+
--brand-chrome-link,
|
|
263
|
+
#a9c1f2
|
|
264
|
+
); /* 9.46:1 · same family as the navy, separated by luminance */
|
|
247
265
|
|
|
248
266
|
--color-chrome-good: #6fcf8b; /* 8.95:1 */
|
|
249
267
|
--color-chrome-warn: #e3b341; /* 8.80:1 */
|
|
@@ -337,23 +355,35 @@
|
|
|
337
355
|
* radius scale read as intentional:
|
|
338
356
|
* mark — a glyph-sized box. At 8px a 16px checkbox is already a circle
|
|
339
357
|
* control — what you touch and what measures one line of text
|
|
340
|
-
* box — a content box, a panel, a band
|
|
341
|
-
*
|
|
358
|
+
* box — a content box, a panel, a band — and what DROPS from a
|
|
359
|
+
* control: a menu, a list, the cuts panel
|
|
360
|
+
* panel — a window: a dialog, a notice, the workspace's frames
|
|
342
361
|
* pill — what is round because it is a capsule, not a box
|
|
343
362
|
*
|
|
344
363
|
* **The measured step.** 6/10/14 still read as the dense console. The median
|
|
345
364
|
* control across measured production systems is 8px, and the button shares
|
|
346
365
|
* it with the field: surveyed systems match those three (button, input,
|
|
347
366
|
* select) instead of rounding the button alone. The surface still grows.
|
|
348
|
-
* 12 is the next published peak and the modal step; 16 is
|
|
367
|
+
* 12 is the next published peak and the modal step; 16 is a window.
|
|
349
368
|
* The pill stays a capsule — a tag, a switch, an icon-only target — and
|
|
350
369
|
* is not a labeled button.
|
|
370
|
+
*
|
|
371
|
+
* **A dropdown is concentric with its rows.** A menu wraps 8px rows in
|
|
372
|
+
* 4px of padding, so its corner is 8 + 4 = 12. At 16 the outer curve ran
|
|
373
|
+
* away from the rows' and a 220px menu read as a balloon — «muy redondo»,
|
|
374
|
+
* said of the bar's menus, and measured: 16 outside, 8 inside, 4 between.
|
|
375
|
+
*
|
|
376
|
+
* **A brand turns ONE knob.** `--brand-radius` multiplies the whole scale,
|
|
377
|
+
* so the steps keep their proportion — and the dropdowns stay concentric:
|
|
378
|
+
* `0` is square everywhere (the pill too: «todo recto» means all of it),
|
|
379
|
+
* `1` is this scale, `1.5` rounder. A single step can still be set on its
|
|
380
|
+
* own (`--brand-radius-control: 6px`). Set on `:root`, like the colours.
|
|
351
381
|
* ------------------------------------------------------------------- */
|
|
352
|
-
--radius-mark: 4px;
|
|
353
|
-
--radius-control: 8px;
|
|
354
|
-
--radius-box: 12px;
|
|
355
|
-
--radius-panel: 16px;
|
|
356
|
-
--radius-pill: 9999px;
|
|
382
|
+
--radius-mark: var(--brand-radius-mark, calc(4px * var(--brand-radius, 1)));
|
|
383
|
+
--radius-control: var(--brand-radius-control, calc(8px * var(--brand-radius, 1)));
|
|
384
|
+
--radius-box: var(--brand-radius-box, calc(12px * var(--brand-radius, 1)));
|
|
385
|
+
--radius-panel: var(--brand-radius-panel, calc(16px * var(--brand-radius, 1)));
|
|
386
|
+
--radius-pill: var(--brand-radius-pill, calc(9999px * var(--brand-radius, 1)));
|
|
357
387
|
|
|
358
388
|
/* ---------------------------------------------------------------- *
|
|
359
389
|
* ELEVATION
|
|
@@ -461,6 +491,13 @@
|
|
|
461
491
|
`ListingBar`. */
|
|
462
492
|
--container-search: 30rem;
|
|
463
493
|
|
|
494
|
+
/* How wide the cuts panel may grow: filters, grouping and favourites side by side — three
|
|
495
|
+
columns of a facet each — and never wider than the screen, so on a phone the columns
|
|
496
|
+
stack and it reads as a popover. It is the SCREEN that decides, not the field: a list's
|
|
497
|
+
search field is often narrow (it shares the bar with sort, columns and «New»), and a
|
|
498
|
+
panel capped at the field's width stacked its three columns on a 1440px desk. */
|
|
499
|
+
--container-cuts: min(calc(var(--container-facet) * 3), calc(100vw - 3rem));
|
|
500
|
+
|
|
464
501
|
/* What a crumb ASKS for before being clipped, and what the whole trail asks for.
|
|
465
502
|
Both are requests and not widths: a narrower line drops them, and a
|
|
466
503
|
wider one lets them grow.
|
|
@@ -547,6 +584,15 @@
|
|
|
547
584
|
things, and what they have to let you compare is precisely the number. */
|
|
548
585
|
--container-metric: 7rem;
|
|
549
586
|
|
|
587
|
+
/* The body of a board tile while it reads or after it failed: a chart's own plot height
|
|
588
|
+
(`Chart` draws `h-72`, 18rem). The skeleton and the failure take the room the chart will
|
|
589
|
+
take, so the grid does not jump when one tile lands and its neighbour is still reading. */
|
|
590
|
+
--size-tile-body: 18rem;
|
|
591
|
+
|
|
592
|
+
/* A row of headline metrics while the board reads them: the height of one `Metric` with
|
|
593
|
+
its figure and label, so the tiles below do not move down when the numbers arrive. */
|
|
594
|
+
--size-metric: 3.75rem;
|
|
595
|
+
|
|
550
596
|
/* The width of the peek drawer. It is a system decision and not a component
|
|
551
597
|
one: 30rem is what fits of a record without leaving the list behind it
|
|
552
598
|
—which has to stay clickable— reduced to a useless strip. */
|
|
@@ -600,6 +646,11 @@
|
|
|
600
646
|
two modules whose sidebars differ in width read as two products. */
|
|
601
647
|
--container-sidebar: 15rem;
|
|
602
648
|
|
|
649
|
+
/* The same sidebar as a drawer on a phone: a little wider than the column — it has the
|
|
650
|
+
whole screen to itself — and never wider than the screen minus a strip of the page,
|
|
651
|
+
which is where a thumb taps to close it. */
|
|
652
|
+
--container-drawer: min(20rem, calc(100vw - 3rem));
|
|
653
|
+
|
|
603
654
|
/* The record sheet. The rail above it spans the whole window; the sheet does not: a form
|
|
604
655
|
stretched to 1,400 px puts the label and its value half a screen apart and turns every
|
|
605
656
|
input into a bar nobody fills. 72rem holds two columns of fields at a readable width —
|
|
@@ -667,6 +718,90 @@
|
|
|
667
718
|
--animate-reveal-late: reveal var(--duration-quick) var(--ease-out) 200ms both;
|
|
668
719
|
}
|
|
669
720
|
|
|
721
|
+
/* ==================================================================== *
|
|
722
|
+
* COMPONENT TOKENS — a component's look, open without forking it.
|
|
723
|
+
*
|
|
724
|
+
* The system tokens above decide the whole product. A product sometimes
|
|
725
|
+
* wants ONE piece different — square buttons for a till, a cooler menu, the
|
|
726
|
+
* cards without a border — and before this it had no way but to write its
|
|
727
|
+
* own component. Now each of the most-used components reads its look from
|
|
728
|
+
* a `--ui-<component>-<property>` variable first, and falls back to the
|
|
729
|
+
* system's token:
|
|
730
|
+
*
|
|
731
|
+
* :root {
|
|
732
|
+
* --ui-button-radius: 0; every button, square
|
|
733
|
+
* --ui-popover-bg: #f7f8fa; every menu and dropdown
|
|
734
|
+
* }
|
|
735
|
+
* .till {
|
|
736
|
+
* --ui-control-radius: 0; only inside this zone
|
|
737
|
+
* }
|
|
738
|
+
*
|
|
739
|
+
* `@theme inline` and not `@theme`: Tailwind writes the WHOLE chain into the
|
|
740
|
+
* utility (`border-radius: var(--ui-button-radius, var(--radius-control))`),
|
|
741
|
+
* so it resolves on the element itself. Declared on `:root`, the fallback
|
|
742
|
+
* would freeze the light palette there, and a dark subtree would inherit it.
|
|
743
|
+
* Set nothing and every piece looks exactly as it did.
|
|
744
|
+
*
|
|
745
|
+
* What a token does not cover, a PART does: every customizable piece carries
|
|
746
|
+
* `data-ui="<component>"` on its root and `data-ui="<component>.<part>"` on
|
|
747
|
+
* its parts, plus its variant (`data-role`, `data-size`, `data-surface`) —
|
|
748
|
+
* the stable names an application's CSS selects, instead of a class that
|
|
749
|
+
* changes with the next refactor. The list is in the README («Customizing a
|
|
750
|
+
* component») and `tests/componentTokens.test.tsx` holds both.
|
|
751
|
+
* ==================================================================== */
|
|
752
|
+
@theme inline {
|
|
753
|
+
/* Button and IconButton. */
|
|
754
|
+
--radius-ui-button: var(--ui-button-radius, var(--radius-control));
|
|
755
|
+
--radius-ui-icon-button: var(--ui-icon-button-radius, var(--radius-pill));
|
|
756
|
+
|
|
757
|
+
/* What is written into or chosen from: inputs, selects, pickers. */
|
|
758
|
+
--radius-ui-control: var(--ui-control-radius, var(--radius-control));
|
|
759
|
+
--color-ui-control: var(--ui-control-bg, var(--color-surface));
|
|
760
|
+
--color-ui-control-border: var(--ui-control-border, var(--color-line-strong));
|
|
761
|
+
|
|
762
|
+
/* Everything that drops from a control: menus, lists, the cuts panel, a popover. */
|
|
763
|
+
--radius-ui-popover: var(--ui-popover-radius, var(--radius-box));
|
|
764
|
+
--color-ui-popover: var(--ui-popover-bg, var(--color-surface));
|
|
765
|
+
--color-ui-popover-border: var(--ui-popover-border, var(--color-line-strong));
|
|
766
|
+
--shadow-ui-popover: var(--ui-popover-shadow, var(--shadow-float));
|
|
767
|
+
|
|
768
|
+
/* A row inside one of them: a menu item, an option. */
|
|
769
|
+
--radius-ui-option: var(--ui-option-radius, var(--radius-control));
|
|
770
|
+
--color-ui-option-active: var(
|
|
771
|
+
--ui-option-active-bg,
|
|
772
|
+
color-mix(in srgb, var(--color-primary) 8%, transparent)
|
|
773
|
+
);
|
|
774
|
+
|
|
775
|
+
/* A window: a dialog, a confirmation. */
|
|
776
|
+
--radius-ui-dialog: var(--ui-dialog-radius, var(--radius-panel));
|
|
777
|
+
--color-ui-dialog: var(--ui-dialog-bg, var(--color-surface));
|
|
778
|
+
|
|
779
|
+
/* A box of content: a block, a card of a list, a board tile, a metric. */
|
|
780
|
+
--radius-ui-card: var(--ui-card-radius, var(--radius-box));
|
|
781
|
+
--color-ui-card: var(--ui-card-bg, var(--color-surface));
|
|
782
|
+
--color-ui-card-border: var(--ui-card-border, var(--color-line));
|
|
783
|
+
|
|
784
|
+
/* A capsule: a tag, a chip of the search bar. */
|
|
785
|
+
--radius-ui-tag: var(--ui-tag-radius, var(--radius-pill));
|
|
786
|
+
|
|
787
|
+
/* The search bar's field. */
|
|
788
|
+
--radius-ui-search: var(--ui-search-radius, var(--radius-box));
|
|
789
|
+
|
|
790
|
+
/* The sidebar on the canvas (on the chrome it is the brand's `--brand-chrome`). */
|
|
791
|
+
--color-ui-sidebar: var(--ui-sidebar-bg, var(--color-ground));
|
|
792
|
+
--color-ui-sidebar-border: var(--ui-sidebar-border, var(--color-line));
|
|
793
|
+
|
|
794
|
+
/* A row of the navigation tree, and the one you are on. */
|
|
795
|
+
--radius-ui-nav: var(--ui-nav-radius, var(--radius-control));
|
|
796
|
+
--color-ui-nav-current: var(
|
|
797
|
+
--ui-nav-current-bg,
|
|
798
|
+
color-mix(in srgb, var(--color-primary) 10%, transparent)
|
|
799
|
+
);
|
|
800
|
+
|
|
801
|
+
/* A table's header band. */
|
|
802
|
+
--color-ui-table-head: var(--ui-table-head-bg, var(--color-ground));
|
|
803
|
+
}
|
|
804
|
+
|
|
670
805
|
@keyframes reveal {
|
|
671
806
|
from {
|
|
672
807
|
opacity: 0;
|
|
@@ -715,6 +850,36 @@
|
|
|
715
850
|
* gets a hairline (`chrome-edge`) because it and the canvas are both near
|
|
716
851
|
* black. The gold keeps being the primary action; `on-accent` keeps the text
|
|
717
852
|
* on it dark.
|
|
853
|
+
*
|
|
854
|
+
* ── A BRAND: set it once, every theme follows ───────────────────────
|
|
855
|
+
*
|
|
856
|
+
* The colours a brand owns — the canvas (`ground`, `surface`, `line`,
|
|
857
|
+
* `line-strong`, `ink`, `muted`), the action (`accent`, `accent-hover`,
|
|
858
|
+
* `on-accent`), the link and current place (`primary`, `primary-hover`), and the
|
|
859
|
+
* bar (`chrome`, `chrome-raised`, `chrome-edge`, `chrome-accent`, `chrome-link`)
|
|
860
|
+
* — read a `--brand-*` variable first, and fall back to the system's value:
|
|
861
|
+
*
|
|
862
|
+
* :root {
|
|
863
|
+
* --brand-accent: #d4a73a; --brand-dark-accent: #e0b850;
|
|
864
|
+
* --brand-chrome: #10203f; --brand-dark-chrome: #0a1428;
|
|
865
|
+
* --brand-ground: #f7f8fa; --brand-dark-ground: #121417;
|
|
866
|
+
* --brand-radius: 0.5; (the corners: 0 square · 1 · 1.5 rounder)
|
|
867
|
+
* }
|
|
868
|
+
*
|
|
869
|
+
* The canvas is brandable because a product's paper is part of its look — a
|
|
870
|
+
* cool white, a warmer grey. Before, a brand overrode `--color-ink` and
|
|
871
|
+
* `--color-line` directly, and lost them in the dark theme.
|
|
872
|
+
*
|
|
873
|
+
* `--brand-<token>` is the light palette's, `--brand-dark-<token>` the dark's.
|
|
874
|
+
* Set on `:root`, a variable is INHERITED by every subtree — so the four blocks
|
|
875
|
+
* that define a palette (`@theme`, the media query, `[data-theme="dark"]` and
|
|
876
|
+
* the nested `[data-theme="light"]`) all resolve to the brand, and nothing has
|
|
877
|
+
* to be repeated per theme. Before, a brand overrode `--color-*` and lost to
|
|
878
|
+
* whichever of those blocks matched the element it was on.
|
|
879
|
+
*
|
|
880
|
+
* The system measures ITS values (the numbers in the comments); a brand's
|
|
881
|
+
* contrast is the brand's to check — the Storybook a11y pass does, on every
|
|
882
|
+
* story, in both themes.
|
|
718
883
|
* ==================================================================== */
|
|
719
884
|
:root {
|
|
720
885
|
color-scheme: light dark;
|
|
@@ -723,18 +888,36 @@
|
|
|
723
888
|
@media (prefers-color-scheme: dark) {
|
|
724
889
|
:root:not([data-theme="light"]) {
|
|
725
890
|
color-scheme: dark;
|
|
726
|
-
--color-ground:
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
--color-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
--color-
|
|
891
|
+
--color-ground: var(
|
|
892
|
+
--brand-dark-ground,
|
|
893
|
+
#181614
|
|
894
|
+
); /* the canvas: warm near-black, not #000 */
|
|
895
|
+
--color-surface: var(
|
|
896
|
+
--brand-dark-surface,
|
|
897
|
+
#221f1c
|
|
898
|
+
); /* 1.10:1 above the ground — in the dark, raised is LIGHTER */
|
|
899
|
+
--color-line: var(--brand-dark-line, #302c28); /* 1.30:1 — common separator */
|
|
900
|
+
--color-line-strong: var(
|
|
901
|
+
--brand-dark-line-strong,
|
|
902
|
+
#443f38
|
|
903
|
+
); /* 1.73:1 — border of a box, table header */
|
|
904
|
+
--color-ink: var(--brand-dark-ink, #ece8e1); /* 14.78:1 */
|
|
905
|
+
--color-muted: var(--brand-dark-muted, #a39b90); /* 6.57:1 */
|
|
906
|
+
--color-accent: var(
|
|
907
|
+
--brand-dark-accent,
|
|
908
|
+
#c89b3c
|
|
909
|
+
); /* 7.05:1 — on dark the gold CAN be read, but it stays the primary action */
|
|
910
|
+
--color-accent-hover: var(
|
|
911
|
+
--brand-dark-accent-hover,
|
|
912
|
+
#dbb055
|
|
913
|
+
); /* on dark the hover LIGHTENS: on-accent on top gives 8.80:1 */
|
|
914
|
+
--color-on-accent: var(--brand-dark-on-accent, #1a1714); /* 6.98:1 on the gold */
|
|
735
915
|
--color-data: #8ea6d9; /* 7.40:1 */
|
|
736
|
-
--color-primary: #8fa9e8; /* 7.74:1 · surface on top 7.03:1 */
|
|
737
|
-
--color-primary-hover:
|
|
916
|
+
--color-primary: var(--brand-dark-primary, #8fa9e8); /* 7.74:1 · surface on top 7.03:1 */
|
|
917
|
+
--color-primary-hover: var(
|
|
918
|
+
--brand-dark-primary-hover,
|
|
919
|
+
#b0c3f1
|
|
920
|
+
); /* 10.25:1 · surface on top 9.31:1 */
|
|
738
921
|
--color-danger: #f08d7f; /* 7.58:1 · surface on top 6.89:1 */
|
|
739
922
|
--color-danger-hover: #f6ab9f; /* 9.66:1 · surface on top 8.78:1 */
|
|
740
923
|
--color-info: #5cc4d8; /* 8.89:1 */
|
|
@@ -750,13 +933,22 @@
|
|
|
750
933
|
--color-good: #6fcf8b; /* 9.43:1 */
|
|
751
934
|
--color-warn: #e3b341; /* 9.27:1 */
|
|
752
935
|
--color-bad: #f08d7f; /* 7.58:1 */
|
|
753
|
-
--color-chrome: #0b101e; /* the base: deeper than the canvas */
|
|
754
|
-
--color-chrome-raised:
|
|
755
|
-
|
|
936
|
+
--color-chrome: var(--brand-dark-chrome, #0b101e); /* the base: deeper than the canvas */
|
|
937
|
+
--color-chrome-raised: var(
|
|
938
|
+
--brand-dark-chrome-raised,
|
|
939
|
+
#18223a
|
|
940
|
+
); /* active tab, open menu */
|
|
941
|
+
--color-chrome-edge: var(
|
|
942
|
+
--brand-dark-chrome-edge,
|
|
943
|
+
#2b3656
|
|
944
|
+
); /* 1.59:1 on the chrome — the hairline that separates the bar from the canvas */
|
|
756
945
|
--color-chrome-ink: #e8e4de; /* 14.98:1 — text */
|
|
757
946
|
--color-chrome-muted: #a39b90; /* 6.91:1 — faint text */
|
|
758
|
-
--color-chrome-accent:
|
|
759
|
-
|
|
947
|
+
--color-chrome-accent: var(
|
|
948
|
+
--brand-dark-chrome-accent,
|
|
949
|
+
#c89b3c
|
|
950
|
+
); /* 7.42:1 — the gold, here it IS text */
|
|
951
|
+
--color-chrome-link: var(--brand-dark-chrome-link, #a9c1f2); /* 10.48:1 */
|
|
760
952
|
--color-chrome-good: #6fcf8b; /* 9.91:1 */
|
|
761
953
|
--color-chrome-warn: #e3b341; /* 9.75:1 */
|
|
762
954
|
--color-chrome-bad: #ff8a7a; /* 8.28:1 */
|
|
@@ -770,18 +962,36 @@
|
|
|
770
962
|
|
|
771
963
|
[data-theme="dark"] {
|
|
772
964
|
color-scheme: dark;
|
|
773
|
-
--color-ground:
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
--color-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
--color-
|
|
965
|
+
--color-ground: var(
|
|
966
|
+
--brand-dark-ground,
|
|
967
|
+
#181614
|
|
968
|
+
); /* the canvas: warm near-black, not #000 */
|
|
969
|
+
--color-surface: var(
|
|
970
|
+
--brand-dark-surface,
|
|
971
|
+
#221f1c
|
|
972
|
+
); /* 1.10:1 above the ground — in the dark, raised is LIGHTER */
|
|
973
|
+
--color-line: var(--brand-dark-line, #302c28); /* 1.30:1 — common separator */
|
|
974
|
+
--color-line-strong: var(
|
|
975
|
+
--brand-dark-line-strong,
|
|
976
|
+
#443f38
|
|
977
|
+
); /* 1.73:1 — border of a box, table header */
|
|
978
|
+
--color-ink: var(--brand-dark-ink, #ece8e1); /* 14.78:1 */
|
|
979
|
+
--color-muted: var(--brand-dark-muted, #a39b90); /* 6.57:1 */
|
|
980
|
+
--color-accent: var(
|
|
981
|
+
--brand-dark-accent,
|
|
982
|
+
#c89b3c
|
|
983
|
+
); /* 7.05:1 — on dark the gold CAN be read, but it stays the primary action */
|
|
984
|
+
--color-accent-hover: var(
|
|
985
|
+
--brand-dark-accent-hover,
|
|
986
|
+
#dbb055
|
|
987
|
+
); /* on dark the hover LIGHTENS: on-accent on top gives 8.80:1 */
|
|
988
|
+
--color-on-accent: var(--brand-dark-on-accent, #1a1714); /* 6.98:1 on the gold */
|
|
782
989
|
--color-data: #8ea6d9; /* 7.40:1 */
|
|
783
|
-
--color-primary: #8fa9e8; /* 7.74:1 · surface on top 7.03:1 */
|
|
784
|
-
--color-primary-hover:
|
|
990
|
+
--color-primary: var(--brand-dark-primary, #8fa9e8); /* 7.74:1 · surface on top 7.03:1 */
|
|
991
|
+
--color-primary-hover: var(
|
|
992
|
+
--brand-dark-primary-hover,
|
|
993
|
+
#b0c3f1
|
|
994
|
+
); /* 10.25:1 · surface on top 9.31:1 */
|
|
785
995
|
--color-danger: #f08d7f; /* 7.58:1 · surface on top 6.89:1 */
|
|
786
996
|
--color-danger-hover: #f6ab9f; /* 9.66:1 · surface on top 8.78:1 */
|
|
787
997
|
--color-info: #5cc4d8; /* 8.89:1 */
|
|
@@ -797,13 +1007,19 @@
|
|
|
797
1007
|
--color-good: #6fcf8b; /* 9.43:1 */
|
|
798
1008
|
--color-warn: #e3b341; /* 9.27:1 */
|
|
799
1009
|
--color-bad: #f08d7f; /* 7.58:1 */
|
|
800
|
-
--color-chrome: #0b101e; /* the base: deeper than the canvas */
|
|
801
|
-
--color-chrome-raised: #18223a; /* active tab, open menu */
|
|
802
|
-
--color-chrome-edge:
|
|
1010
|
+
--color-chrome: var(--brand-dark-chrome, #0b101e); /* the base: deeper than the canvas */
|
|
1011
|
+
--color-chrome-raised: var(--brand-dark-chrome-raised, #18223a); /* active tab, open menu */
|
|
1012
|
+
--color-chrome-edge: var(
|
|
1013
|
+
--brand-dark-chrome-edge,
|
|
1014
|
+
#2b3656
|
|
1015
|
+
); /* 1.59:1 on the chrome — the hairline that separates the bar from the canvas */
|
|
803
1016
|
--color-chrome-ink: #e8e4de; /* 14.98:1 — text */
|
|
804
1017
|
--color-chrome-muted: #a39b90; /* 6.91:1 — faint text */
|
|
805
|
-
--color-chrome-accent:
|
|
806
|
-
|
|
1018
|
+
--color-chrome-accent: var(
|
|
1019
|
+
--brand-dark-chrome-accent,
|
|
1020
|
+
#c89b3c
|
|
1021
|
+
); /* 7.42:1 — the gold, here it IS text */
|
|
1022
|
+
--color-chrome-link: var(--brand-dark-chrome-link, #a9c1f2); /* 10.48:1 */
|
|
807
1023
|
--color-chrome-good: #6fcf8b; /* 9.91:1 */
|
|
808
1024
|
--color-chrome-warn: #e3b341; /* 9.75:1 */
|
|
809
1025
|
--color-chrome-bad: #ff8a7a; /* 8.28:1 */
|
|
@@ -819,18 +1035,27 @@
|
|
|
819
1035
|
`tests/tokens.test.ts` keeps it equal to `@theme`. */
|
|
820
1036
|
[data-theme="light"] {
|
|
821
1037
|
color-scheme: light;
|
|
822
|
-
--color-ground: #faf9f7;
|
|
823
|
-
--color-surface: #ffffff;
|
|
824
|
-
--color-line: #e4dfd7; /* 1.26:1 — common separator */
|
|
825
|
-
--color-line-strong:
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
--color-
|
|
830
|
-
--color-
|
|
1038
|
+
--color-ground: var(--brand-ground, #faf9f7);
|
|
1039
|
+
--color-surface: var(--brand-surface, #ffffff);
|
|
1040
|
+
--color-line: var(--brand-line, #e4dfd7); /* 1.26:1 — common separator */
|
|
1041
|
+
--color-line-strong: var(
|
|
1042
|
+
--brand-line-strong,
|
|
1043
|
+
#d5cec2
|
|
1044
|
+
); /* 1.49:1 — border of a box, table header */
|
|
1045
|
+
--color-ink: var(--brand-ink, #1a1714);
|
|
1046
|
+
--color-muted: var(--brand-muted, #6b6459);
|
|
1047
|
+
--color-accent: var(--brand-accent, #c89b3c); /* 2.43:1 on the ground → NEVER text */
|
|
1048
|
+
--color-accent-hover: var(
|
|
1049
|
+
--brand-accent-hover,
|
|
1050
|
+
#b88a2e
|
|
1051
|
+
); /* on light the hover DARKENS: ink on top gives 5.71:1 */
|
|
1052
|
+
--color-on-accent: var(--brand-on-accent, #1a1714); /* 6.98:1 on the gold */
|
|
831
1053
|
--color-data: #1b2a4a; /* 13.52:1 */
|
|
832
|
-
--color-primary: #2a4a85; /* 8.26:1 · white on top 8.69:1 */
|
|
833
|
-
--color-primary-hover:
|
|
1054
|
+
--color-primary: var(--brand-primary, #2a4a85); /* 8.26:1 · white on top 8.69:1 */
|
|
1055
|
+
--color-primary-hover: var(
|
|
1056
|
+
--brand-primary-hover,
|
|
1057
|
+
#1c3765
|
|
1058
|
+
); /* 11.19:1 · white on top 11.77:1 */
|
|
834
1059
|
--color-danger: #9b3b30; /* 6.52:1 · white on top 6.86:1 */
|
|
835
1060
|
--color-danger-hover: #7c2d24; /* 8.84:1 · white on top 9.30:1 */
|
|
836
1061
|
--color-info: #0f5c6e; /* 7.19:1 · white on top 7.56:1 */
|
|
@@ -846,13 +1071,22 @@
|
|
|
846
1071
|
--color-good: #2f6b3c; /* 6.07:1 */
|
|
847
1072
|
--color-warn: #7e5e12; /* 5.71:1 */
|
|
848
1073
|
--color-bad: #9b3b30; /* 6.52:1 */
|
|
849
|
-
--color-chrome: #141b2e; /* the base */
|
|
850
|
-
--color-chrome-raised: #1e2740; /* active tab, open menu */
|
|
851
|
-
--color-chrome-edge:
|
|
1074
|
+
--color-chrome: var(--brand-chrome, #141b2e); /* the base */
|
|
1075
|
+
--color-chrome-raised: var(--brand-chrome-raised, #1e2740); /* active tab, open menu */
|
|
1076
|
+
--color-chrome-edge: var(
|
|
1077
|
+
--brand-chrome-edge,
|
|
1078
|
+
#141b2e
|
|
1079
|
+
); /* 1.00:1 on the chrome — invisible on light, a hairline on dark */
|
|
852
1080
|
--color-chrome-ink: #e8e4de; /* 13.53:1 — text */
|
|
853
1081
|
--color-chrome-muted: #a39b90; /* 6.24:1 — faint text */
|
|
854
|
-
--color-chrome-accent:
|
|
855
|
-
|
|
1082
|
+
--color-chrome-accent: var(
|
|
1083
|
+
--brand-chrome-accent,
|
|
1084
|
+
#c89b3c
|
|
1085
|
+
); /* 6.70:1 — the gold, here it IS text */
|
|
1086
|
+
--color-chrome-link: var(
|
|
1087
|
+
--brand-chrome-link,
|
|
1088
|
+
#a9c1f2
|
|
1089
|
+
); /* 9.46:1 · same family as the navy, separated by luminance */
|
|
856
1090
|
--color-chrome-good: #6fcf8b; /* 8.95:1 */
|
|
857
1091
|
--color-chrome-warn: #e3b341; /* 8.80:1 */
|
|
858
1092
|
--color-chrome-bad: #ff8a7a; /* 7.48:1 */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sincpro/web-ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "An enterprise web design system for business software — ERPs, back offices, management tools — in React and Tailwind: tokens, primitives, components and the two views every management screen is made of.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|