@tristan2828/ui-foundation 4.91.0 → 4.92.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.
@@ -3,38 +3,38 @@
3
3
  <!-- index: written by `npm run docs:index` in the package from the headings below; never edit it by hand -->
4
4
  ## Index
5
5
 
6
- - [Palettes](#palettes) · lines 47–114
7
- - [Glow](#glow) · lines 116–134
8
- - [Semantic tones](#semantic-tones) · lines 136–164
9
- - [The three badge styles](#the-three-badge-styles) · lines 166–183
10
- - [Mapping an enum to tones](#mapping-an-enum-to-tones) · lines 185–214
11
- - [Glyphs and icons: 3:1](#glyphs-and-icons-31) · lines 216–229
12
- - [Logos and brand marks](#logos-and-brand-marks) · lines 231–275
13
- - [Categorical colour](#categorical-colour) · lines 277–347
14
- - [Heat scale](#heat-scale) · lines 349–410
15
- - [Depth ramps](#depth-ramps) · lines 412–495
16
- - [A stored colour](#a-stored-colour) · lines 497–545
17
- - [Shapes and sizes](#shapes-and-sizes) · lines 547–568
18
- - [Typography](#typography) · lines 570–690
19
- - [Written text (notes)](#written-text-notes) · lines 604–690
20
- - [Density](#density) · lines 692–785
21
- - [Rows on this device](#rows-on-this-device) · lines 758–785
22
- - [Widget cards (hub pages)](#widget-cards-hub-pages) · lines 787–901
23
- - [Module cards (a hub's places)](#module-cards-a-hubs-places) · lines 903–980
24
- - [Notices](#notices) · lines 982–1010
25
- - [A value over time](#a-value-over-time) · lines 1012–1098
26
- - [Several values over time](#several-values-over-time) · lines 1061–1098
27
- - [A list as a board](#a-list-as-a-board) · lines 1100–1151
28
- - [A list as cards](#a-list-as-cards) · lines 1153–1199
29
- - [Key numbers on a record](#key-numbers-on-a-record) · lines 1201–1230
30
- - [Parts of the page standards](#parts-of-the-page-standards) · lines 1232–1275
31
- - [An overview page](#an-overview-page) · lines 1277–1340
32
- - [A record's header and empty values](#a-records-header-and-empty-values) · lines 1341–1379
33
- - [A record's tabs, mark and rail](#a-records-tabs-mark-and-rail) · lines 1381–1426
34
- - [Picking at random](#picking-at-random) · lines 1428–1459
35
- - [Filling in what's missing](#filling-in-whats-missing) · lines 1461–1528
36
- - [Values edited in place: the presets' looks](#values-edited-in-place-the-presets-looks) · lines 1530–1555
37
- - [The sidebar and the phone's bar](#the-sidebar-and-the-phones-bar) · lines 1557–1630
6
+ - [Palettes](#palettes) · lines 47–154
7
+ - [Glow](#glow) · lines 156–175
8
+ - [Semantic tones](#semantic-tones) · lines 177–205
9
+ - [The three badge styles](#the-three-badge-styles) · lines 207–224
10
+ - [Mapping an enum to tones](#mapping-an-enum-to-tones) · lines 226–255
11
+ - [Glyphs and icons: 3:1](#glyphs-and-icons-31) · lines 257–270
12
+ - [Logos and brand marks](#logos-and-brand-marks) · lines 272–316
13
+ - [Categorical colour](#categorical-colour) · lines 318–388
14
+ - [Heat scale](#heat-scale) · lines 390–451
15
+ - [Depth ramps](#depth-ramps) · lines 453–538
16
+ - [A stored colour](#a-stored-colour) · lines 540–588
17
+ - [Shapes and sizes](#shapes-and-sizes) · lines 590–611
18
+ - [Typography](#typography) · lines 613–733
19
+ - [Written text (notes)](#written-text-notes) · lines 647–733
20
+ - [Density](#density) · lines 735–828
21
+ - [Rows on this device](#rows-on-this-device) · lines 801–828
22
+ - [Widget cards (hub pages)](#widget-cards-hub-pages) · lines 830–944
23
+ - [Module cards (a hub's places)](#module-cards-a-hubs-places) · lines 946–1023
24
+ - [Notices](#notices) · lines 1025–1053
25
+ - [A value over time](#a-value-over-time) · lines 1055–1141
26
+ - [Several values over time](#several-values-over-time) · lines 1104–1141
27
+ - [A list as a board](#a-list-as-a-board) · lines 1143–1194
28
+ - [A list as cards](#a-list-as-cards) · lines 1196–1242
29
+ - [Key numbers on a record](#key-numbers-on-a-record) · lines 1244–1273
30
+ - [Parts of the page standards](#parts-of-the-page-standards) · lines 1275–1318
31
+ - [An overview page](#an-overview-page) · lines 1320–1383
32
+ - [A record's header and empty values](#a-records-header-and-empty-values) · lines 1384–1422
33
+ - [A record's tabs, mark and rail](#a-records-tabs-mark-and-rail) · lines 1424–1469
34
+ - [Picking at random](#picking-at-random) · lines 1471–1502
35
+ - [Filling in what's missing](#filling-in-whats-missing) · lines 1504–1571
36
+ - [Values edited in place: the presets' looks](#values-edited-in-place-the-presets-looks) · lines 1573–1598
37
+ - [The sidebar and the phone's bar](#the-sidebar-and-the-phones-bar) · lines 1600–1673
38
38
 
39
39
  <!-- /index -->
40
40
 
@@ -46,9 +46,9 @@ composites don't grow that way; they are built against a real app's screen.
46
46
 
47
47
  ## Palettes
48
48
 
49
- A palette is an app's own dark look: its surfaces, text, accent and a
50
- second colour, chosen once for every app the foundation serves. There
51
- are four, in the order they were ranked:
49
+ A palette is an app's own look: its surfaces, text, accent and a
50
+ second colour. Four dark ones were chosen once for every app the
51
+ foundation serves, in the order they were ranked:
52
52
 
53
53
  | Name | `palette` | Accent | Second colour |
54
54
  |---|---|---|---|
@@ -57,24 +57,60 @@ are four, in the order they were ranked:
57
57
  | Graphite and Periwinkle | `graphite-periwinkle` | periwinkle on neutral grey | lilac |
58
58
  | Violet | `violet` | violet | magenta |
59
59
 
60
+ And one light one, which an app opts into by name (`LIGHT_PALETTES`):
61
+
62
+ | Name | `palette` | Surface | Text and accent |
63
+ |---|---|---|---|
64
+ | Palm LCD | `palm-lcd` | a Palm OS LCD's green, flat (cards are the same green) | dark ink; ink is also the primary fill and the field border |
65
+
60
66
  **How an app picks one.** `<FoundationProviders palette="indigo-cyan">`
61
67
  names the app's default. Add `palettePicker` and the app shell's header
62
- offers all four (with swatches); the one picked is remembered on that
63
- device, and a new device starts on the default. `usePalette()` reads the
64
- palette on screen. Without `palette`, nothing changes: light and dark
65
- follow the system, with the toggle in the header.
66
-
67
- **A palette is dark only.** With one, the theme is forced dark and the
68
- shell has no light/dark toggle. The light theme stays for apps without a
69
- palette. Printed notes still print light: the print override beats a
70
- palette's block.
68
+ offers the four dark ones (with swatches); the one picked is remembered
69
+ on that device, and a new device starts on the default. `usePalette()`
70
+ reads the palette on screen. Without `palette`, nothing changes: light and
71
+ dark follow the system, with the toggle in the header.
72
+
73
+ **A palette forces its theme.** A dark palette forces the dark theme and
74
+ the shell has no light/dark toggle. The light theme stays for apps
75
+ without a palette, and for Palm LCD. Printed notes still print light:
76
+ the print override beats a palette's block.
77
+
78
+ **Palm LCD is opt-in.** An app gets it only by naming it:
79
+ `<FoundationProviders palette="palm-lcd">`. It forces the light theme, so
80
+ the shell has no toggle. It is never in the picker: `palettePicker` is
81
+ ignored beside it, and so is a palette a device saved before. It has no
82
+ [glow](#glow). Everything is still a semantic token, so the app's code
83
+ uses no raw colours:
84
+
85
+ - **Surfaces.** `--background`, `--card` and `--popover` are the LCD green
86
+ (`#c9d1b2`). `--muted`, `--secondary` and `--accent` are a step darker.
87
+ - **Ink.** `--foreground` is the mockup's ink (`#1d2416`, 10.1:1).
88
+ `--primary` and `--ring` are ink too, with the green on the primary fill,
89
+ as a pressed button looks on the device.
90
+ - **Dimmed text.** `--muted-foreground` is `#464e39`, 5.50:1. The mockup's
91
+ `#5c6650` measured 3.82, under 4.5.
92
+ - **The dotted rules between rows.** The colour is a token: `--rule` and
93
+ `--border` are the LCD's line colour (`#a3ad8f`). The style is the
94
+ app's, a Tailwind border utility: `border-b border-dotted border-rule`.
95
+ A table's own rows wear the colour, solid.
96
+ - **Status text and links.** Status text is a quarter darker than the
97
+ mockup's green, rust and blue, so it still reads on its own tinted wash
98
+ (7.0:1 or more on the green). `--link` is the mockup's blue.
99
+ - **Glyphs and fills.** The light theme's categorical slots, heat steps
100
+ and depth steps were tuned for white, and measure 1.5 to 3 on the
101
+ green. Palm LCD has its own set, each darker than about oklch 0.57, so
102
+ it clears 3:1 on both greens. It keeps the light theme's floors for how
103
+ far apart they must look. Each depth ramp holds its Palm LCD slot's
104
+ hue and gets darker at every step, as in light ([Depth ramps](#depth-ramps)).
105
+ Every heat and depth fill takes white text.
71
106
 
72
107
  **Where it lives.** `styles/theme.css`: each palette's colours as
73
108
  primitives (`--palette-<name>-*`, ratios beside them), and one block per
74
- palette, `.dark[data-palette="<name>"]`, that sets only what differs from
75
- `.dark`. `data-palette` goes on `<html>`, so popups portaled to `<body>`
76
- wear it too. An installed app's colours follow it with
77
- `pwa({ palette })`.
109
+ palette that sets only what differs from its theme:
110
+ `.dark[data-palette="<name>"]` for the four, and `[data-palette="palm-lcd"]`,
111
+ on top of `:root`, for Palm LCD. `data-palette` goes on `<html>`, so popups
112
+ portaled to `<body>` wear it too. An installed app's colours follow it with
113
+ `pwa({ palette })`. For Palm LCD that is the ink and the green.
78
114
 
79
115
  **Why some tokens aren't the guide's colour as written.**
80
116
 
@@ -101,23 +137,28 @@ wear it too. An installed app's colours follow it with
101
137
  palette has, so it is kept as designed; axe doesn't check borders.
102
138
 
103
139
  The package's `e2e/fixtures-visual.spec.ts` runs every primitive,
104
- composite and tone story through axe in each palette, and measures every
105
- glyph, categorical slot and heat step against each palette's page and
106
- card.
140
+ composite and tone story through axe in each palette (Palm LCD in light,
141
+ the others in dark), and measures every glyph, categorical slot, heat
142
+ step and depth step against each palette's page and card.
143
+ `tests/category-slots.test.ts`, `heat-scale.test.ts` and
144
+ `depth-ramps.test.ts` hold Palm LCD's own shades to the light theme's
145
+ floors.
107
146
 
108
147
  **An app's own axe specs** check its palettes instead of light and dark:
109
148
  `defineA11ySuite({ …, palettes: ['indigo-cyan'] })` (and
110
149
  `defineDataEnvironmentBannerSuite`'s `palettes`) saves each as the
111
- device's choice before the page loads and checks it dark. Pass the app's
112
- default on every spec and `PALETTES` on the one that covers the shell.
113
- Without `palettes`, a palette app's light run fails: there is no light
114
- theme to find.
150
+ device's choice before the page loads and checks it in the theme it
151
+ forces: dark, or light for `palettes: ['palm-lcd']`. Pass the app's
152
+ default on every spec and, with the picker, `PALETTES` on the one that
153
+ covers the shell. Without `palettes`, a dark palette app's light run
154
+ fails: there is no light theme to find.
115
155
 
116
156
  ## Glow
117
157
 
118
- Under a palette only, from `--primary` so each palette glows in its own
119
- accent; an app without a palette never gets it. Everything else stays
120
- flat: no glow at the top of the page.
158
+ Under a dark palette only, from `--primary` so each palette glows in its
159
+ own accent. An app without a palette never gets it, and nor does Palm
160
+ LCD, the light one. Everything else stays flat: no glow at the top of the
161
+ page.
121
162
 
122
163
  - **The primary button** (Button's default variant) on hover, keyboard
123
164
  focus and press: one soft layer of the accent (`--primary-glow`: 38px
@@ -489,7 +530,9 @@ slot, as a fill and as a cell, against the page and a card in each.
489
530
  slot, the order of lightness, the distance between neighbours (ΔE 8, and
490
531
  6 with deuteranopia and protanopia), the distance from the neutral greys
491
532
  (6), text on every fill and every step against every palette's card and
492
- raised surface, and fails if a change to `theme.css` breaks one.
533
+ raised surface, and fails if a change to `theme.css` breaks one. Palm LCD,
534
+ the light palette, has its own ramps on the same rules (its slot's hue,
535
+ darker at every step, ΔE 6 from its own greys).
493
536
  `SideBySide` shows both themes at once, each ramp beside its theme's
494
537
  muted greys, under normal vision and simulated deuteranopia and
495
538
  protanopia.
@@ -46,15 +46,15 @@ function CloseMobileSidebarOnNavigate() {
46
46
  }, [key, setOpenMobile]);
47
47
  return null;
48
48
  }
49
- // The header's look control: an app with a palette is always dark, so it
50
- // has no light/dark toggle, and with the picker on it gets the look menu
49
+ // The header's look control: an app with a palette is always dark (or,
50
+ // with a light palette, always light), so it has no light/dark toggle, and with the picker on it gets the look menu
51
51
  // in its place (design-language.md "Palettes"). With the rows picker the
52
52
  // same menu offers the table rows (design-language.md "Density"); an app
53
53
  // without a palette keeps its toggle beside it.
54
54
  function LookControl() {
55
55
  const { palette, picker } = usePalette();
56
56
  const rows = useRows();
57
- const pickPalette = palette && picker ? palette : null;
57
+ const pickPalette = picker && isPaletteName(palette) ? palette : null;
58
58
  return (_jsxs(_Fragment, { children: [!palette && _jsx(ThemeToggle, {}), (pickPalette || rows.picker) && _jsx(LookMenu, { palette: pickPalette })] }));
59
59
  }
60
60
  // Each palette's swatch is its own background with its accent and second
@@ -1,6 +1,6 @@
1
1
  import { type QueryClient } from '@tanstack/react-query';
2
2
  import { type ReactNode } from 'react';
3
- import type { PaletteName } from '../../lib/palettes.js';
3
+ import { type AppPaletteName } from '../../lib/palettes.js';
4
4
  import { type ErrorReportingOptions } from '../../error-reporting/reporter.js';
5
5
  export declare function FoundationProviders({ mockMode, queryClient, errorReporting, palette, palettePicker, rowsPicker, children, }: {
6
6
  /** Whether the API is served by MSW — the app's own IS_MOCK_MODE. */
@@ -17,13 +17,15 @@ export declare function FoundationProviders({ mockMode, queryClient, errorReport
17
17
  /**
18
18
  * The app's palette (design-language.md "Palettes"). With one, the app
19
19
  * is always dark in that palette and the shell has no light/dark
20
- * toggle; printed notes still print light. Without, light and dark
21
- * follow the system, as before.
20
+ * toggle; printed notes still print light. A light palette
21
+ * (`'palm-lcd'`), which an app opts into only here, forces light
22
+ * instead. Without, light and dark follow the system, as before.
22
23
  */
23
- palette?: PaletteName;
24
+ palette?: AppPaletteName;
24
25
  /**
25
26
  * With `palette`: the shell offers all four palettes, and the one picked
26
27
  * is remembered on this device. A new device starts on `palette`.
28
+ * Ignored with a light palette, which is never in the picker.
27
29
  */
28
30
  palettePicker?: boolean;
29
31
  /**
@@ -7,11 +7,12 @@ import { MockModeBanner } from './mock-mode-banner.js';
7
7
  import { ThemeProvider } from '../theme-provider.js';
8
8
  import { PaletteProvider } from './palette-provider.js';
9
9
  import { RowsProvider } from './rows-provider.js';
10
+ import { paletteColorScheme } from '../../lib/palettes.js';
10
11
  import { ErrorReportingProvider } from '../../error-reporting/error-reporting-provider.js';
11
12
  import { resolveErrorReporting } from '../../error-reporting/reporter.js';
12
13
  import { browserStaleChunkReload } from '../../lib/stale-chunk-reload.js';
13
14
  // Everything an app's root needs around its router, in the order that
14
- // works: the theme outermost (and the palette, which forces it dark), the mock-mode banner above the router so it
15
+ // works: the theme outermost (and the palette, which forces it dark, or light for a light one), the mock-mode banner above the router so it
15
16
  // shows on every route (/login included), and AuthProvider inside
16
17
  // QueryClientProvider because it queries /auth/me through TanStack Query.
17
18
  // An app's DataEnvironmentBanner goes first among the children, before its
@@ -22,5 +23,5 @@ export function FoundationProviders({ mockMode, queryClient, errorReporting, pal
22
23
  const [client] = useState(() => queryClient ?? createQueryClient());
23
24
  const reporting = resolveErrorReporting(errorReporting);
24
25
  useEffect(() => browserStaleChunkReload().install(window), []);
25
- return (_jsx(ThemeProvider, { attribute: "class", defaultTheme: "system", enableSystem: true, forcedTheme: palette ? 'dark' : undefined, children: _jsx(PaletteProvider, { palette: palette, picker: palettePicker, children: _jsxs(RowsProvider, { picker: rowsPicker, children: [_jsx(MockModeBanner, { active: mockMode }), _jsx(QueryClientProvider, { client: client, children: _jsx(AuthProvider, { children: reporting ? _jsx(ErrorReportingProvider, { options: reporting, children: children }) : children }) })] }) }) }));
26
+ return (_jsx(ThemeProvider, { attribute: "class", defaultTheme: "system", enableSystem: true, forcedTheme: palette ? paletteColorScheme(palette) : undefined, children: _jsx(PaletteProvider, { palette: palette, picker: palettePicker, children: _jsxs(RowsProvider, { picker: rowsPicker, children: [_jsx(MockModeBanner, { active: mockMode }), _jsx(QueryClientProvider, { client: client, children: _jsx(AuthProvider, { children: reporting ? _jsx(ErrorReportingProvider, { options: reporting, children: children }) : children }) })] }) }) }));
26
27
  }
@@ -1,12 +1,13 @@
1
1
  import { type ReactNode } from 'react';
2
- import { type PaletteName, type PaletteStore } from '../../lib/palettes.js';
2
+ import { type AppPaletteName, type PaletteStore } from '../../lib/palettes.js';
3
3
  /**
4
4
  * Puts the palette on <html>. FoundationProviders renders it; an app
5
5
  * doesn't. Without `palette` it does nothing, and the app keeps light and
6
- * dark.
6
+ * dark. A light palette (`palm-lcd`) takes no picker: the picker's four
7
+ * are dark, so with one `picker` is ignored and the saved choice is too.
7
8
  */
8
- export declare function PaletteProvider({ palette: defaultPalette, picker, store, children, }: {
9
- palette?: PaletteName;
9
+ export declare function PaletteProvider({ palette: defaultPalette, picker: pickerAsked, store, children, }: {
10
+ palette?: AppPaletteName;
10
11
  picker?: boolean;
11
12
  /** For tests; the browser's localStorage by default. */
12
13
  store?: PaletteStore;
@@ -1,14 +1,16 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useCallback, useLayoutEffect, useMemo, useSyncExternalStore } from 'react';
3
3
  import { PaletteContext } from '../../hooks/use-palette.js';
4
- import { browserPaletteStore, subscribeToBrowserPaletteStore } from '../../lib/palettes.js';
4
+ import { browserPaletteStore, isLightPaletteName, subscribeToBrowserPaletteStore } from '../../lib/palettes.js';
5
5
  /**
6
6
  * Puts the palette on <html>. FoundationProviders renders it; an app
7
7
  * doesn't. Without `palette` it does nothing, and the app keeps light and
8
- * dark.
8
+ * dark. A light palette (`palm-lcd`) takes no picker: the picker's four
9
+ * are dark, so with one `picker` is ignored and the saved choice is too.
9
10
  */
10
- export function PaletteProvider({ palette: defaultPalette, picker = false, store = browserPaletteStore, children, }) {
11
+ export function PaletteProvider({ palette: defaultPalette, picker: pickerAsked = false, store = browserPaletteStore, children, }) {
11
12
  const subscribe = useCallback((listener) => (store === browserPaletteStore ? subscribeToBrowserPaletteStore(listener) : store.subscribe(listener)), [store]);
13
+ const picker = pickerAsked && !isLightPaletteName(defaultPalette);
12
14
  const saved = useSyncExternalStore(subscribe, store.get, () => null);
13
15
  const palette = defaultPalette ? ((picker && saved) || defaultPalette) : null;
14
16
  // Before paint, so the first frame is already in the palette.
@@ -1,12 +1,12 @@
1
- import type { PaletteName } from '../lib/palettes.js';
1
+ import type { AppPaletteName, PaletteName } from '../lib/palettes.js';
2
2
  export type PaletteState = {
3
3
  /** The palette on screen, or null for an app without one (light and dark as the system says). */
4
- palette: PaletteName | null;
4
+ palette: AppPaletteName | null;
5
5
  /** The app's own default. */
6
- defaultPalette: PaletteName | null;
7
- /** Whether this app lets a device pick (FoundationProviders' `palettePicker`). */
6
+ defaultPalette: AppPaletteName | null;
7
+ /** Whether this app lets a device pick (FoundationProviders' `palettePicker`). Never under a light palette. */
8
8
  picker: boolean;
9
- /** Saves `palette` as this device's choice. Does nothing without the picker. */
9
+ /** Saves `palette`, one of the four dark ones, as this device's choice. Does nothing without the picker. */
10
10
  setPalette: (palette: PaletteName) => void;
11
11
  };
12
12
  export declare const PaletteContext: import("react").Context<PaletteState>;
package/dist/index.d.ts CHANGED
@@ -115,7 +115,7 @@ export { useSessionClock, type SessionClock, type SessionClockOptions, type Sess
115
115
  export { usePrefersReducedMotion } from './hooks/use-prefers-reduced-motion.js';
116
116
  export { useMuted } from './hooks/use-muted.js';
117
117
  export { usePalette, type PaletteState } from './hooks/use-palette.js';
118
- export { PALETTE_LABELS, PALETTE_STORAGE_KEY, PALETTES, isPaletteName, type PaletteName } from './lib/palettes.js';
118
+ export { LIGHT_PALETTE_LABELS, LIGHT_PALETTES, PALETTE_LABELS, PALETTE_STORAGE_KEY, PALETTES, isLightPaletteName, isPaletteName, paletteColorScheme, type AppPaletteName, type LightPaletteName, type PaletteName, } from './lib/palettes.js';
119
119
  export { useRows, type RowsState } from './hooks/use-rows.js';
120
120
  export { ROWS, ROWS_LABELS, ROWS_STORAGE_KEY, isRowsName, type RowsName } from './lib/rows.js';
121
121
  export { createPushController, usePushPermission, type PushController, type PushControllerOptions, type PushEnvironment, type PushPermission, type PushStatus, } from './hooks/use-push-permission.js';
package/dist/index.js CHANGED
@@ -119,7 +119,7 @@ export { useSessionClock, } from './hooks/use-session-clock.js';
119
119
  export { usePrefersReducedMotion } from './hooks/use-prefers-reduced-motion.js';
120
120
  export { useMuted } from './hooks/use-muted.js';
121
121
  export { usePalette } from './hooks/use-palette.js';
122
- export { PALETTE_LABELS, PALETTE_STORAGE_KEY, PALETTES, isPaletteName } from './lib/palettes.js';
122
+ export { LIGHT_PALETTE_LABELS, LIGHT_PALETTES, PALETTE_LABELS, PALETTE_STORAGE_KEY, PALETTES, isLightPaletteName, isPaletteName, paletteColorScheme, } from './lib/palettes.js';
123
123
  export { useRows } from './hooks/use-rows.js';
124
124
  export { ROWS, ROWS_LABELS, ROWS_STORAGE_KEY, isRowsName } from './lib/rows.js';
125
125
  export { createPushController, usePushPermission, } from './hooks/use-push-permission.js';
@@ -6,6 +6,16 @@ export declare const PALETTE_LABELS: Record<PaletteName, string>;
6
6
  /** Where a device's chosen palette is kept. */
7
7
  export declare const PALETTE_STORAGE_KEY = "ui-foundation:palette";
8
8
  export declare function isPaletteName(value: unknown): value is PaletteName;
9
+ /** The light palettes, which an app opts into by name: never in the picker (design-language.md "Palettes"). */
10
+ export declare const LIGHT_PALETTES: readonly ["palm-lcd"];
11
+ export type LightPaletteName = (typeof LIGHT_PALETTES)[number];
12
+ /** Each light palette's name as a person reads it. */
13
+ export declare const LIGHT_PALETTE_LABELS: Record<LightPaletteName, string>;
14
+ /** Any palette an app can name: one of the four dark ones, or a light one. */
15
+ export type AppPaletteName = PaletteName | LightPaletteName;
16
+ export declare function isLightPaletteName(value: unknown): value is LightPaletteName;
17
+ /** The theme a palette forces: light for a light palette, dark for the four. */
18
+ export declare function paletteColorScheme(palette: AppPaletteName): 'light' | 'dark';
9
19
  export type PaletteStore = DeviceChoiceStore<PaletteName>;
10
20
  /** The store under usePalette, taking the storage so its rules are unit tested (tests/palettes.test.ts). */
11
21
  export declare function createPaletteStore(getStorage: () => StorageLike | undefined): PaletteStore;
@@ -6,6 +6,11 @@
6
6
  // palette rides on <html> as data-palette, so popups portaled to <body>
7
7
  // wear it too, and styles/theme.css's `.dark[data-palette]` blocks do the
8
8
  // rest (components/app/palette-provider.tsx, hooks/use-palette.ts).
9
+ //
10
+ // The light palettes (LIGHT_PALETTES, so far one: Palm LCD) are opt-in: an
11
+ // app gets one only by naming it as `palette`. It forces the light theme,
12
+ // it is never in the picker, and it has no glow. Its block is
13
+ // `[data-palette="<name>"]` on top of :root.
9
14
  import { browserStorage, createDeviceChoiceStore, otherTabsSubscriber } from './device-choice.js';
10
15
  export const PALETTES = ['indigo-cyan', 'indigo-rose', 'graphite-periwinkle', 'violet'];
11
16
  /** Each palette's name as a person reads it, in the guide's ranked order. */
@@ -20,6 +25,19 @@ export const PALETTE_STORAGE_KEY = 'ui-foundation:palette';
20
25
  export function isPaletteName(value) {
21
26
  return typeof value === 'string' && PALETTES.includes(value);
22
27
  }
28
+ /** The light palettes, which an app opts into by name: never in the picker (design-language.md "Palettes"). */
29
+ export const LIGHT_PALETTES = ['palm-lcd'];
30
+ /** Each light palette's name as a person reads it. */
31
+ export const LIGHT_PALETTE_LABELS = {
32
+ 'palm-lcd': 'Palm LCD',
33
+ };
34
+ export function isLightPaletteName(value) {
35
+ return typeof value === 'string' && LIGHT_PALETTES.includes(value);
36
+ }
37
+ /** The theme a palette forces: light for a light palette, dark for the four. */
38
+ export function paletteColorScheme(palette) {
39
+ return isLightPaletteName(palette) ? 'light' : 'dark';
40
+ }
23
41
  /** The store under usePalette, taking the storage so its rules are unit tested (tests/palettes.test.ts). */
24
42
  export function createPaletteStore(getStorage) {
25
43
  return createDeviceChoiceStore(PALETTE_STORAGE_KEY, isPaletteName, getStorage);
@@ -1,6 +1,6 @@
1
1
  import { expect, type Page } from '@playwright/test';
2
2
  import { type NavEntry } from '../components/app/app-shell-nav.js';
3
- import { type PaletteName } from '../lib/palettes.js';
3
+ import { type AppPaletteName } from '../lib/palettes.js';
4
4
  import type { MswOverride } from '../mocks/override.js';
5
5
  export type { MswHandle, MswOverride } from '../mocks/override.js';
6
6
  export { expect };
@@ -83,12 +83,14 @@ export type A11ySuiteOptions = {
83
83
  */
84
84
  checkSidebar?: boolean;
85
85
  /**
86
- * For an app with a palette (`<FoundationProviders palette>`), which is
87
- * dark only: the palettes to check instead of light and dark, each saved
88
- * as the device's choice before the page loads. Pass the app's default on
89
- * every spec and all of `PALETTES` on one (the shell's).
86
+ * For an app with a palette (`<FoundationProviders palette>`), which
87
+ * forces its theme: the palettes to check instead of light and dark, each
88
+ * saved as the device's choice before the page loads and checked in the
89
+ * theme it forces (dark, or light for `'palm-lcd'`). Pass the app's
90
+ * default on every spec and, with the picker, all of `PALETTES` on one
91
+ * (the shell's).
90
92
  */
91
- palettes?: readonly PaletteName[];
93
+ palettes?: readonly AppPaletteName[];
92
94
  };
93
95
  /**
94
96
  * Every data view on the page has loaded: at least one shows its data (or,
@@ -119,7 +121,7 @@ export declare function expectDataViewsLoaded(page: Page, { success }?: {
119
121
  * color-contrast rule against the rendered dark DOM is also what keeps the
120
122
  * dark-mode tokens readable. The theme follows the OS setting, so
121
123
  * emulateMedia switches it. An app with a palette passes `palettes`, and
122
- * each is checked (dark) in place of light and dark.
124
+ * each is checked (in the theme it forces) in place of light and dark.
123
125
  */
124
126
  export declare function defineA11ySuite({ formRoutes, viewRoutes, loggedOutRoutes, nav, checkSidebar, palettes, }: A11ySuiteOptions): void;
125
127
  export type MockModeBannerSuiteOptions = {
@@ -154,7 +156,7 @@ export type DataEnvironmentBannerSuiteOptions = {
154
156
  */
155
157
  dataLabel?: string | null;
156
158
  /** For an app with a palette: the palettes to check the banner in, in place of light and dark (as for `defineA11ySuite`). */
157
- palettes?: readonly PaletteName[];
159
+ palettes?: readonly AppPaletteName[];
158
160
  };
159
161
  /**
160
162
  * DataEnvironmentBanner: shown on every route, logged-out ones included,
@@ -14,7 +14,7 @@
14
14
  import AxeBuilder from '@axe-core/playwright';
15
15
  import { expect, test as base } from '@playwright/test';
16
16
  import { navPathname, navTargets } from '../components/app/app-shell-nav.js';
17
- import { PALETTE_STORAGE_KEY } from '../lib/palettes.js';
17
+ import { PALETTE_STORAGE_KEY, paletteColorScheme } from '../lib/palettes.js';
18
18
  export { expect };
19
19
  // A page load returns at the load event, but the app isn't up yet: React
20
20
  // renders only after MSW's worker.start(), which took up to 2.4 s past
@@ -177,7 +177,7 @@ async function navRoutes(page, isMobile) {
177
177
  const pagePaths = (routes) => [...new Set(routes.map(navPathname))].sort();
178
178
  function a11yThemes(palettes) {
179
179
  if (palettes?.length)
180
- return palettes.map((palette) => ({ label: palette, colorScheme: 'dark', palette }));
180
+ return palettes.map((palette) => ({ label: palette, colorScheme: paletteColorScheme(palette), palette }));
181
181
  return [
182
182
  { label: 'light', colorScheme: 'light' },
183
183
  { label: 'dark', colorScheme: 'dark' },
@@ -249,7 +249,7 @@ async function expectNavPageAccessible(page, route, theme) {
249
249
  * color-contrast rule against the rendered dark DOM is also what keeps the
250
250
  * dark-mode tokens readable. The theme follows the OS setting, so
251
251
  * emulateMedia switches it. An app with a palette passes `palettes`, and
252
- * each is checked (dark) in place of light and dark.
252
+ * each is checked (in the theme it forces) in place of light and dark.
253
253
  */
254
254
  export function defineA11ySuite({ formRoutes, viewRoutes = [], loggedOutRoutes = [], nav, checkSidebar = true, palettes, }) {
255
255
  // Each `to` as given, query string and all, so a page that opens on a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tristan2828/ui-foundation",
3
- "version": "4.91.0",
3
+ "version": "4.92.0",
4
4
  "description": "Shared UI foundation for contract-first, database-backed React apps: shadcn primitives, DataTable/EntityForm composites, auth, the gateway error seam, design tokens, lint rules and the AI playbook.",
5
5
  "license": "MIT",
6
6
  "repository": {
package/styles/index.css CHANGED
@@ -20,10 +20,11 @@
20
20
  composite's own rows and padding tighten under data-density="compact"
21
21
  on any ancestor, the way the table's tokens do. `density-compact:py-1`.
22
22
  Text never shrinks under it. */
23
- /* Under a palette only (FoundationProviders' `palette`, data-palette on
24
- <html>): the shared style guide's glow, which an app without one never
25
- gets. `palette:hover:shadow-(--primary-glow)`. */
26
- @custom-variant palette (&:where([data-palette] *));
23
+ /* Under a dark palette only (FoundationProviders' `palette`, data-palette
24
+ on <html>, with the dark theme it forces): the shared style guide's
25
+ glow, which an app without one never gets, and nor does Palm LCD, the
26
+ light palette. `palette:hover:shadow-(--primary-glow)`. */
27
+ @custom-variant palette (&:where(.dark[data-palette] *));
27
28
 
28
29
  @custom-variant density-compact (&:where([data-density="compact"], [data-density="compact"] *));
29
30
 
@@ -291,7 +292,7 @@
291
292
  font-weight: var(--type-heading-3-weight);
292
293
  }
293
294
 
294
- /* A hovered hub tile, widget or card, under a palette: its edge turns the
295
+ /* A hovered hub tile, widget or card, under a dark palette: its edge turns the
295
296
  accent and a soft halo of it shows (--edge-glow). On an element that
296
297
  draws its edge with ring-1 and its shadow with shadow-* (Card does), it
297
298
  recolours the ring and adds the halo to the shadow it already has.
@@ -302,21 +303,21 @@
302
303
  transition-property: box-shadow;
303
304
  transition-duration: var(--default-transition-duration);
304
305
  transition-timing-function: var(--default-transition-timing-function);
305
- &:where([data-palette] *):hover {
306
+ &:where(.dark[data-palette] *):hover {
306
307
  --tw-ring-color: color-mix(in srgb, var(--primary) 75%, var(--border));
307
308
  --tw-shadow: var(--card-shadow, 0 0 #0000), var(--edge-glow);
308
309
  }
309
310
  }
310
311
 
311
- /* A primary button's shine under a palette: a light band sweeping across
312
+ /* A primary button's shine under a dark palette: a light band sweeping across
312
313
  on hover (650ms), once. Not under reduced motion, and never on another
313
314
  variant. In components, so a button's own position utility still wins. */
314
315
  @layer components {
315
- [data-palette] [data-slot="button"][data-variant="default"] {
316
+ .dark[data-palette] [data-slot="button"][data-variant="default"] {
316
317
  position: relative;
317
318
  overflow: hidden;
318
319
  }
319
- [data-palette] [data-slot="button"][data-variant="default"]::after {
320
+ .dark[data-palette] [data-slot="button"][data-variant="default"]::after {
320
321
  content: "";
321
322
  position: absolute;
322
323
  inset: 0;
@@ -325,7 +326,7 @@
325
326
  transform: translateX(-130%);
326
327
  }
327
328
  @media (prefers-reduced-motion: no-preference) {
328
- [data-palette] [data-slot="button"][data-variant="default"]:hover::after {
329
+ .dark[data-palette] [data-slot="button"][data-variant="default"]:hover::after {
329
330
  animation: button-shine 650ms ease-out;
330
331
  }
331
332
  }
package/styles/theme.css CHANGED
@@ -156,7 +156,8 @@
156
156
  * to pink and purple to magenta, and dark ran the wrong way, a higher
157
157
  * step darker, ending in a step almost grey.) Chroma follows what the
158
158
  * gamut allows at each lightness, so each ramp reads as one tint, and no
159
- * step falls under oklch chroma 0.03. Every palette takes dark's.
159
+ * step falls under oklch chroma 0.03. Every dark palette takes dark's;
160
+ * Palm LCD, the light one, has its own on the same rule (its primitives).
160
161
  *
161
162
  * Why the gaps are smaller than the heat scale's: every step clears 3:1
162
163
  * on the card, which leaves light a lightness band of about oklch 0.19 to
@@ -300,7 +301,7 @@
300
301
 
301
302
  /*
302
303
  * Palette primitives (design-language.md "Palettes"). A palette is an
303
- * app's own dark look: these four were chosen for the shared style
304
+ * app's own look: these four dark ones were chosen for the shared style
304
305
  * guide, and an app names one (FoundationProviders' `palette`). Each is
305
306
  * the guide's colours as written, with one change: Violet's text on its
306
307
  * accent was #130925 (4.496:1, just under 4.5) and is #110823 (4.54:1).
@@ -386,6 +387,144 @@
386
387
  --palette-warning: #e0b152;
387
388
  --palette-danger: #df7a72;
388
389
 
390
+ /*
391
+ * Palm LCD, the one light palette (design-language.md "Palettes"): a
392
+ * Palm OS LCD's green surface and dark ink, from palm-datebook's mockup
393
+ * (docs/reference/mockup-2026-11.html). An app opts into it by name; it
394
+ * forces the light theme, is never in the picker and has no glow. Its
395
+ * block, `[data-palette="palm-lcd"]`, sits on :root. The mockup's
396
+ * surface, ink and rule line are kept as written; its dim text #5c6650
397
+ * measured 3.82 on the surface (under 4.5) and is #464e39, and its
398
+ * green, rust and blue words are a quarter darker, so they still read on
399
+ * their own tinted washes. Ratios on the surface (bg, and card: the same
400
+ * green, as on the device) / on raised:
401
+ *
402
+ * text (ink) 10.1 / 9.16
403
+ * dim 5.50 / 5.00; 4.78 on a highlighted row, 4.63 on a
404
+ * `#` heading's band
405
+ * dim-strong 6.23 / 5.67, 5.42 on a highlighted row: muted text
406
+ * inside a highlighted or hovered row
407
+ * accent (ink) the primary fill, the ring (10.1), the field border:
408
+ * as on the device, a button pressed on is ink with the
409
+ * green on it (on-accent 10.1)
410
+ * link 5.29 / 4.82, the mockup's blue
411
+ * success, warning, danger, info text
412
+ * 7.00 / 6.37, 7.33 / 6.67, 7.26 / 6.60, 7.18 / 6.53
413
+ * rule (line) 1.48: the dotted rule between rows, a colour only.
414
+ * An app writes the style: `border-b border-dotted
415
+ * border-rule`. --border is the same line, so a
416
+ * table's own rows wear it too (axe doesn't check borders)
417
+ *
418
+ * Glyphs and fills: the light theme's slots, heat and depth steps are
419
+ * tuned for white and measure 1.5 to 3 on this green, so Palm LCD has
420
+ * its own, each clearing 3:1 on bg and raised (a 3:1 shape needs to be
421
+ * darker than about oklch 0.56 here), with the light theme's floors
422
+ * kept (tests/category-slots.test.ts, heat-scale.test.ts,
423
+ * depth-ramps.test.ts). The slots and heat steps keep the light ones'
424
+ * hue within 20 and 25 degrees, lightness re-spread to fit. A depth
425
+ * ramp holds its Palm LCD slot's own hue across all five steps, as in
426
+ * light and dark: darker at every step, chroma a smooth share of what
427
+ * the gamut allows (0.032 at the least). Its band is oklch 0.06 to 0.57,
428
+ * narrower than light's, so neighbours are ΔE 8.16 apart at the least
429
+ * (6.21 with deuteranopia or protanopia), every step is ΔE 6.91 or more
430
+ * from --muted, --muted-foreground, --rule and --input, and 3.04:1 or
431
+ * more on both greens. Every heat and depth fill takes white text (5.29
432
+ * at the least on a depth step).
433
+ */
434
+ --palette-palm-lcd-background: #c9d1b2;
435
+ --palette-palm-lcd-panel: #c9d1b2;
436
+ --palette-palm-lcd-raised: #c0c8a6;
437
+ --palette-palm-lcd-band: #b8c19e;
438
+ --palette-palm-lcd-border: #a3ad8f;
439
+ --palette-palm-lcd-text: #1d2416;
440
+ --palette-palm-lcd-dim: #464e39;
441
+ --palette-palm-lcd-dim-strong: #3e4631;
442
+ --palette-palm-lcd-accent: #1d2416;
443
+ --palette-palm-lcd-on-accent: #c9d1b2;
444
+ --palette-palm-lcd-link: #2b4f7a;
445
+ --palette-palm-lcd-second: #2b4f7a;
446
+ --palette-palm-lcd-success: #1c4426;
447
+ --palette-palm-lcd-warning: #4a3500;
448
+ --palette-palm-lcd-danger: #5c2c16;
449
+ --palette-palm-lcd-info: #203b5c;
450
+ --palette-palm-lcd-category-1: oklch(0.532 0.243 264); /* blue */
451
+ --palette-palm-lcd-category-2: oklch(0.299 0.101 38); /* orange */
452
+ --palette-palm-lcd-category-3: oklch(0.392 0.089 160); /* green */
453
+ --palette-palm-lcd-category-4: oklch(0.501 0.07 304); /* purple */
454
+ --palette-palm-lcd-category-5: oklch(0.33 0.134 351); /* pink */
455
+ --palette-palm-lcd-category-6: oklch(0.526 0.124 55); /* brown */
456
+ --palette-palm-lcd-category-7: oklch(0.516 0.084 203); /* teal */
457
+ --palette-palm-lcd-category-8: oklch(0.54 0.204 21); /* red */
458
+ --palette-palm-lcd-category-9: oklch(0.352 0.071 91); /* gold */
459
+ --palette-palm-lcd-category-10: oklch(0.317 0.172 283); /* navy */
460
+ --palette-palm-lcd-category-11: oklch(0.515 0.132 126); /* lime */
461
+ --palette-palm-lcd-category-12: oklch(0.555 0.231 348); /* magenta */
462
+ --palette-palm-lcd-heat-1: oklch(0.529 0.256 263);
463
+ --palette-palm-lcd-heat-2: oklch(0.515 0.069 199);
464
+ --palette-palm-lcd-heat-3: oklch(0.504 0.122 122);
465
+ --palette-palm-lcd-heat-4: oklch(0.311 0.069 67);
466
+ --palette-palm-lcd-heat-5: oklch(0.301 0.125 355);
467
+ --palette-palm-lcd-category-1-depth-1: oklch(0.546 0.251 264); /* blue */
468
+ --palette-palm-lcd-category-1-depth-2: oklch(0.421 0.242 264);
469
+ --palette-palm-lcd-category-1-depth-3: oklch(0.268 0.169 264);
470
+ --palette-palm-lcd-category-1-depth-4: oklch(0.141 0.089 264);
471
+ --palette-palm-lcd-category-1-depth-5: oklch(0.063 0.055 264);
472
+ --palette-palm-lcd-category-2-depth-1: oklch(0.548 0.18 38); /* orange */
473
+ --palette-palm-lcd-category-2-depth-2: oklch(0.441 0.13 38);
474
+ --palette-palm-lcd-category-2-depth-3: oklch(0.335 0.089 38);
475
+ --palette-palm-lcd-category-2-depth-4: oklch(0.236 0.057 38);
476
+ --palette-palm-lcd-category-2-depth-5: oklch(0.068 0.035 38);
477
+ --palette-palm-lcd-category-3-depth-1: oklch(0.517 0.092 160); /* green */
478
+ --palette-palm-lcd-category-3-depth-2: oklch(0.439 0.078 160);
479
+ --palette-palm-lcd-category-3-depth-3: oklch(0.356 0.063 160);
480
+ --palette-palm-lcd-category-3-depth-4: oklch(0.265 0.047 160);
481
+ --palette-palm-lcd-category-3-depth-5: oklch(0.165 0.032 160);
482
+ --palette-palm-lcd-category-4-depth-1: oklch(0.568 0.296 304); /* purple */
483
+ --palette-palm-lcd-category-4-depth-2: oklch(0.429 0.202 304);
484
+ --palette-palm-lcd-category-4-depth-3: oklch(0.289 0.122 304);
485
+ --palette-palm-lcd-category-4-depth-4: oklch(0.163 0.064 304);
486
+ --palette-palm-lcd-category-4-depth-5: oklch(0.061 0.04 304);
487
+ --palette-palm-lcd-category-5-depth-1: oklch(0.554 0.198 351); /* pink */
488
+ --palette-palm-lcd-category-5-depth-2: oklch(0.45 0.168 351);
489
+ --palette-palm-lcd-category-5-depth-3: oklch(0.335 0.131 351);
490
+ --palette-palm-lcd-category-5-depth-4: oklch(0.212 0.089 351);
491
+ --palette-palm-lcd-category-5-depth-5: oklch(0.083 0.06 351);
492
+ --palette-palm-lcd-category-6-depth-1: oklch(0.54 0.133 55); /* brown */
493
+ --palette-palm-lcd-category-6-depth-2: oklch(0.438 0.102 55);
494
+ --palette-palm-lcd-category-6-depth-3: oklch(0.325 0.072 55);
495
+ --palette-palm-lcd-category-6-depth-4: oklch(0.22 0.048 55);
496
+ --palette-palm-lcd-category-6-depth-5: oklch(0.082 0.05 55);
497
+ --palette-palm-lcd-category-7-depth-1: oklch(0.517 0.088 203); /* teal */
498
+ --palette-palm-lcd-category-7-depth-2: oklch(0.438 0.075 203);
499
+ --palette-palm-lcd-category-7-depth-3: oklch(0.35 0.06 203);
500
+ --palette-palm-lcd-category-7-depth-4: oklch(0.254 0.044 203);
501
+ --palette-palm-lcd-category-7-depth-5: oklch(0.169 0.032 203);
502
+ --palette-palm-lcd-category-8-depth-1: oklch(0.541 0.101 21); /* red */
503
+ --palette-palm-lcd-category-8-depth-2: oklch(0.461 0.086 21);
504
+ --palette-palm-lcd-category-8-depth-3: oklch(0.369 0.07 21);
505
+ --palette-palm-lcd-category-8-depth-4: oklch(0.272 0.052 21);
506
+ --palette-palm-lcd-category-8-depth-5: oklch(0.151 0.032 21);
507
+ --palette-palm-lcd-category-9-depth-1: oklch(0.528 0.108 91); /* gold */
508
+ --palette-palm-lcd-category-9-depth-2: oklch(0.423 0.086 91);
509
+ --palette-palm-lcd-category-9-depth-3: oklch(0.31 0.064 91);
510
+ --palette-palm-lcd-category-9-depth-4: oklch(0.211 0.045 91);
511
+ --palette-palm-lcd-category-9-depth-5: oklch(0.089 0.096 91);
512
+ --palette-palm-lcd-category-10-depth-1: oklch(0.556 0.254 283); /* navy */
513
+ --palette-palm-lcd-category-10-depth-2: oklch(0.422 0.223 283);
514
+ --palette-palm-lcd-category-10-depth-3: oklch(0.286 0.133 283);
515
+ --palette-palm-lcd-category-10-depth-4: oklch(0.162 0.067 283);
516
+ --palette-palm-lcd-category-10-depth-5: oklch(0.065 0.036 283);
517
+ --palette-palm-lcd-category-11-depth-1: oklch(0.521 0.112 126); /* lime */
518
+ --palette-palm-lcd-category-11-depth-2: oklch(0.433 0.098 126);
519
+ --palette-palm-lcd-category-11-depth-3: oklch(0.335 0.08 126);
520
+ --palette-palm-lcd-category-11-depth-4: oklch(0.241 0.061 126);
521
+ --palette-palm-lcd-category-11-depth-5: oklch(0.134 0.044 126);
522
+ --palette-palm-lcd-category-12-depth-1: oklch(0.555 0.201 348); /* magenta */
523
+ --palette-palm-lcd-category-12-depth-2: oklch(0.45 0.17 348);
524
+ --palette-palm-lcd-category-12-depth-3: oklch(0.33 0.13 348);
525
+ --palette-palm-lcd-category-12-depth-4: oklch(0.206 0.087 348);
526
+ --palette-palm-lcd-category-12-depth-5: oklch(0.093 0.06 348);
527
+
389
528
  /* 9px (the shared style guide): buttons and cards on --radius, fields
390
529
  on --radius-md (about 7px). */
391
530
  --radius-base: 0.5625rem;
@@ -1000,7 +1139,8 @@
1000
1139
  /*
1001
1140
  * Palettes (design-language.md "Palettes"): an app's own dark look.
1002
1141
  * FoundationProviders' `palette` puts data-palette on <html> and forces
1003
- * the dark theme, so a block below always sits on top of .dark and sets
1142
+ * the dark theme (Palm LCD, the light one, is at the end of this file),
1143
+ * so a block below always sits on top of .dark and sets
1004
1144
  * only what differs from it. The solid fills (--destructive, --success,
1005
1145
  * --warning, --info, each with white -foreground), --info-text, the
1006
1146
  * highlight washes, the categorical slots, the heat scale and the depth
@@ -1185,3 +1325,200 @@
1185
1325
  --sidebar-border: var(--palette-violet-border);
1186
1326
  --sidebar-ring: var(--palette-violet-accent);
1187
1327
  }
1328
+
1329
+ /*
1330
+ * Palm LCD (design-language.md "Palettes"), the light palette an app opts
1331
+ * into by name: FoundationProviders forces the light theme with it, so this
1332
+ * block sits on :root and sets only what differs from it. The solid fills
1333
+ * (--destructive, --success, --warning, --info, each with white
1334
+ * -foreground) and the highlight washes stay :root's; the categorical
1335
+ * slots, heat scale and depth ramps are its own (white text on every
1336
+ * fill); --table-stripe, --table-highlight, --table-hover and
1337
+ * --card-header resolve from these values, as under .dark. The ratios are
1338
+ * beside its primitives above. No glow: index.css draws it under a dark
1339
+ * palette only.
1340
+ */
1341
+ [data-palette="palm-lcd"] {
1342
+ --background: var(--palette-palm-lcd-background);
1343
+ --foreground: var(--palette-palm-lcd-text);
1344
+ --card: var(--palette-palm-lcd-panel);
1345
+ --card-foreground: var(--palette-palm-lcd-text);
1346
+ --popover: var(--palette-palm-lcd-panel);
1347
+ --popover-foreground: var(--palette-palm-lcd-text);
1348
+ --primary: var(--palette-palm-lcd-accent);
1349
+ --primary-foreground: var(--palette-palm-lcd-on-accent);
1350
+ --secondary: var(--palette-palm-lcd-raised);
1351
+ --secondary-foreground: var(--palette-palm-lcd-text);
1352
+ --muted: var(--palette-palm-lcd-raised);
1353
+ --muted-foreground: var(--palette-palm-lcd-dim);
1354
+ --accent: var(--palette-palm-lcd-raised);
1355
+ --accent-foreground: var(--palette-palm-lcd-text);
1356
+ --accent-second: var(--palette-palm-lcd-second);
1357
+ --destructive-text: var(--palette-palm-lcd-danger);
1358
+ --success-text: var(--palette-palm-lcd-success);
1359
+ --warning-text: var(--palette-palm-lcd-warning);
1360
+ --info-text: var(--palette-palm-lcd-info);
1361
+ --link: var(--palette-palm-lcd-link);
1362
+ --heading-bar: var(--palette-palm-lcd-link);
1363
+ --rule: var(--palette-palm-lcd-border);
1364
+ --heading-band: var(--palette-palm-lcd-band);
1365
+ --table-highlight-muted-foreground: var(--palette-palm-lcd-dim-strong);
1366
+ --border: var(--palette-palm-lcd-border);
1367
+ --input: var(--palette-palm-lcd-accent);
1368
+ --ring: var(--palette-palm-lcd-accent);
1369
+ --chart-1: var(--palette-palm-lcd-border);
1370
+ --chart-2: var(--palette-palm-lcd-dim);
1371
+ --chart-3: var(--palette-palm-lcd-link);
1372
+ --chart-4: var(--palette-palm-lcd-second);
1373
+ --chart-5: var(--palette-palm-lcd-text);
1374
+ --sidebar: var(--palette-palm-lcd-panel);
1375
+ --sidebar-foreground: var(--palette-palm-lcd-text);
1376
+ --sidebar-primary: var(--palette-palm-lcd-accent);
1377
+ --sidebar-primary-foreground: var(--palette-palm-lcd-on-accent);
1378
+ --sidebar-accent: var(--palette-palm-lcd-raised);
1379
+ --sidebar-accent-foreground: var(--palette-palm-lcd-text);
1380
+ --sidebar-border: var(--palette-palm-lcd-border);
1381
+ --sidebar-ring: var(--palette-palm-lcd-accent);
1382
+ --category-1: var(--palette-palm-lcd-category-1);
1383
+ --category-2: var(--palette-palm-lcd-category-2);
1384
+ --category-3: var(--palette-palm-lcd-category-3);
1385
+ --category-4: var(--palette-palm-lcd-category-4);
1386
+ --category-5: var(--palette-palm-lcd-category-5);
1387
+ --category-6: var(--palette-palm-lcd-category-6);
1388
+ --category-7: var(--palette-palm-lcd-category-7);
1389
+ --category-8: var(--palette-palm-lcd-category-8);
1390
+ --category-9: var(--palette-palm-lcd-category-9);
1391
+ --category-10: var(--palette-palm-lcd-category-10);
1392
+ --category-11: var(--palette-palm-lcd-category-11);
1393
+ --category-12: var(--palette-palm-lcd-category-12);
1394
+ --heat-1: var(--palette-palm-lcd-heat-1);
1395
+ --heat-1-foreground: var(--white);
1396
+ --heat-2: var(--palette-palm-lcd-heat-2);
1397
+ --heat-2-foreground: var(--white);
1398
+ --heat-3: var(--palette-palm-lcd-heat-3);
1399
+ --heat-3-foreground: var(--white);
1400
+ --heat-4: var(--palette-palm-lcd-heat-4);
1401
+ --heat-4-foreground: var(--white);
1402
+ --heat-5: var(--palette-palm-lcd-heat-5);
1403
+ --heat-5-foreground: var(--white);
1404
+ --category-1-depth-1: var(--palette-palm-lcd-category-1-depth-1);
1405
+ --category-1-depth-1-foreground: var(--white);
1406
+ --category-1-depth-2: var(--palette-palm-lcd-category-1-depth-2);
1407
+ --category-1-depth-2-foreground: var(--white);
1408
+ --category-1-depth-3: var(--palette-palm-lcd-category-1-depth-3);
1409
+ --category-1-depth-3-foreground: var(--white);
1410
+ --category-1-depth-4: var(--palette-palm-lcd-category-1-depth-4);
1411
+ --category-1-depth-4-foreground: var(--white);
1412
+ --category-1-depth-5: var(--palette-palm-lcd-category-1-depth-5);
1413
+ --category-1-depth-5-foreground: var(--white);
1414
+ --category-2-depth-1: var(--palette-palm-lcd-category-2-depth-1);
1415
+ --category-2-depth-1-foreground: var(--white);
1416
+ --category-2-depth-2: var(--palette-palm-lcd-category-2-depth-2);
1417
+ --category-2-depth-2-foreground: var(--white);
1418
+ --category-2-depth-3: var(--palette-palm-lcd-category-2-depth-3);
1419
+ --category-2-depth-3-foreground: var(--white);
1420
+ --category-2-depth-4: var(--palette-palm-lcd-category-2-depth-4);
1421
+ --category-2-depth-4-foreground: var(--white);
1422
+ --category-2-depth-5: var(--palette-palm-lcd-category-2-depth-5);
1423
+ --category-2-depth-5-foreground: var(--white);
1424
+ --category-3-depth-1: var(--palette-palm-lcd-category-3-depth-1);
1425
+ --category-3-depth-1-foreground: var(--white);
1426
+ --category-3-depth-2: var(--palette-palm-lcd-category-3-depth-2);
1427
+ --category-3-depth-2-foreground: var(--white);
1428
+ --category-3-depth-3: var(--palette-palm-lcd-category-3-depth-3);
1429
+ --category-3-depth-3-foreground: var(--white);
1430
+ --category-3-depth-4: var(--palette-palm-lcd-category-3-depth-4);
1431
+ --category-3-depth-4-foreground: var(--white);
1432
+ --category-3-depth-5: var(--palette-palm-lcd-category-3-depth-5);
1433
+ --category-3-depth-5-foreground: var(--white);
1434
+ --category-4-depth-1: var(--palette-palm-lcd-category-4-depth-1);
1435
+ --category-4-depth-1-foreground: var(--white);
1436
+ --category-4-depth-2: var(--palette-palm-lcd-category-4-depth-2);
1437
+ --category-4-depth-2-foreground: var(--white);
1438
+ --category-4-depth-3: var(--palette-palm-lcd-category-4-depth-3);
1439
+ --category-4-depth-3-foreground: var(--white);
1440
+ --category-4-depth-4: var(--palette-palm-lcd-category-4-depth-4);
1441
+ --category-4-depth-4-foreground: var(--white);
1442
+ --category-4-depth-5: var(--palette-palm-lcd-category-4-depth-5);
1443
+ --category-4-depth-5-foreground: var(--white);
1444
+ --category-5-depth-1: var(--palette-palm-lcd-category-5-depth-1);
1445
+ --category-5-depth-1-foreground: var(--white);
1446
+ --category-5-depth-2: var(--palette-palm-lcd-category-5-depth-2);
1447
+ --category-5-depth-2-foreground: var(--white);
1448
+ --category-5-depth-3: var(--palette-palm-lcd-category-5-depth-3);
1449
+ --category-5-depth-3-foreground: var(--white);
1450
+ --category-5-depth-4: var(--palette-palm-lcd-category-5-depth-4);
1451
+ --category-5-depth-4-foreground: var(--white);
1452
+ --category-5-depth-5: var(--palette-palm-lcd-category-5-depth-5);
1453
+ --category-5-depth-5-foreground: var(--white);
1454
+ --category-6-depth-1: var(--palette-palm-lcd-category-6-depth-1);
1455
+ --category-6-depth-1-foreground: var(--white);
1456
+ --category-6-depth-2: var(--palette-palm-lcd-category-6-depth-2);
1457
+ --category-6-depth-2-foreground: var(--white);
1458
+ --category-6-depth-3: var(--palette-palm-lcd-category-6-depth-3);
1459
+ --category-6-depth-3-foreground: var(--white);
1460
+ --category-6-depth-4: var(--palette-palm-lcd-category-6-depth-4);
1461
+ --category-6-depth-4-foreground: var(--white);
1462
+ --category-6-depth-5: var(--palette-palm-lcd-category-6-depth-5);
1463
+ --category-6-depth-5-foreground: var(--white);
1464
+ --category-7-depth-1: var(--palette-palm-lcd-category-7-depth-1);
1465
+ --category-7-depth-1-foreground: var(--white);
1466
+ --category-7-depth-2: var(--palette-palm-lcd-category-7-depth-2);
1467
+ --category-7-depth-2-foreground: var(--white);
1468
+ --category-7-depth-3: var(--palette-palm-lcd-category-7-depth-3);
1469
+ --category-7-depth-3-foreground: var(--white);
1470
+ --category-7-depth-4: var(--palette-palm-lcd-category-7-depth-4);
1471
+ --category-7-depth-4-foreground: var(--white);
1472
+ --category-7-depth-5: var(--palette-palm-lcd-category-7-depth-5);
1473
+ --category-7-depth-5-foreground: var(--white);
1474
+ --category-8-depth-1: var(--palette-palm-lcd-category-8-depth-1);
1475
+ --category-8-depth-1-foreground: var(--white);
1476
+ --category-8-depth-2: var(--palette-palm-lcd-category-8-depth-2);
1477
+ --category-8-depth-2-foreground: var(--white);
1478
+ --category-8-depth-3: var(--palette-palm-lcd-category-8-depth-3);
1479
+ --category-8-depth-3-foreground: var(--white);
1480
+ --category-8-depth-4: var(--palette-palm-lcd-category-8-depth-4);
1481
+ --category-8-depth-4-foreground: var(--white);
1482
+ --category-8-depth-5: var(--palette-palm-lcd-category-8-depth-5);
1483
+ --category-8-depth-5-foreground: var(--white);
1484
+ --category-9-depth-1: var(--palette-palm-lcd-category-9-depth-1);
1485
+ --category-9-depth-1-foreground: var(--white);
1486
+ --category-9-depth-2: var(--palette-palm-lcd-category-9-depth-2);
1487
+ --category-9-depth-2-foreground: var(--white);
1488
+ --category-9-depth-3: var(--palette-palm-lcd-category-9-depth-3);
1489
+ --category-9-depth-3-foreground: var(--white);
1490
+ --category-9-depth-4: var(--palette-palm-lcd-category-9-depth-4);
1491
+ --category-9-depth-4-foreground: var(--white);
1492
+ --category-9-depth-5: var(--palette-palm-lcd-category-9-depth-5);
1493
+ --category-9-depth-5-foreground: var(--white);
1494
+ --category-10-depth-1: var(--palette-palm-lcd-category-10-depth-1);
1495
+ --category-10-depth-1-foreground: var(--white);
1496
+ --category-10-depth-2: var(--palette-palm-lcd-category-10-depth-2);
1497
+ --category-10-depth-2-foreground: var(--white);
1498
+ --category-10-depth-3: var(--palette-palm-lcd-category-10-depth-3);
1499
+ --category-10-depth-3-foreground: var(--white);
1500
+ --category-10-depth-4: var(--palette-palm-lcd-category-10-depth-4);
1501
+ --category-10-depth-4-foreground: var(--white);
1502
+ --category-10-depth-5: var(--palette-palm-lcd-category-10-depth-5);
1503
+ --category-10-depth-5-foreground: var(--white);
1504
+ --category-11-depth-1: var(--palette-palm-lcd-category-11-depth-1);
1505
+ --category-11-depth-1-foreground: var(--white);
1506
+ --category-11-depth-2: var(--palette-palm-lcd-category-11-depth-2);
1507
+ --category-11-depth-2-foreground: var(--white);
1508
+ --category-11-depth-3: var(--palette-palm-lcd-category-11-depth-3);
1509
+ --category-11-depth-3-foreground: var(--white);
1510
+ --category-11-depth-4: var(--palette-palm-lcd-category-11-depth-4);
1511
+ --category-11-depth-4-foreground: var(--white);
1512
+ --category-11-depth-5: var(--palette-palm-lcd-category-11-depth-5);
1513
+ --category-11-depth-5-foreground: var(--white);
1514
+ --category-12-depth-1: var(--palette-palm-lcd-category-12-depth-1);
1515
+ --category-12-depth-1-foreground: var(--white);
1516
+ --category-12-depth-2: var(--palette-palm-lcd-category-12-depth-2);
1517
+ --category-12-depth-2-foreground: var(--white);
1518
+ --category-12-depth-3: var(--palette-palm-lcd-category-12-depth-3);
1519
+ --category-12-depth-3-foreground: var(--white);
1520
+ --category-12-depth-4: var(--palette-palm-lcd-category-12-depth-4);
1521
+ --category-12-depth-4-foreground: var(--white);
1522
+ --category-12-depth-5: var(--palette-palm-lcd-category-12-depth-5);
1523
+ --category-12-depth-5-foreground: var(--white);
1524
+ }
package/vite/index.d.ts CHANGED
@@ -36,7 +36,7 @@ export type PwaOptions = {
36
36
  * below default to its accent, its text on the accent and its background
37
37
  * instead of the light theme's.
38
38
  */
39
- palette?: 'indigo-cyan' | 'indigo-rose' | 'graphite-periwinkle' | 'violet'
39
+ palette?: 'indigo-cyan' | 'indigo-rose' | 'graphite-periwinkle' | 'violet' | 'palm-lcd'
40
40
  /** `#rrggbb`. Defaults to the package's `--primary` token (or the palette's accent). */
41
41
  themeColor?: string
42
42
  /** The letter's colour on the SVG icon, `#rrggbb`. Defaults to `--primary-foreground`. */