@the-portland-company/shell 0.88.0 → 0.90.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/CHANGELOG.md CHANGED
@@ -1,3 +1,27 @@
1
+ ## 0.90.0
2
+
3
+ `PageHeader` matches the Spec (Reference/UI-Platform "Page header" and "Page header and width").
4
+
5
+ - **Surface and color.** The filled `--app-tab-header-bg` bar, white title, `text-slate-100` and bottom border are gone: the header sits on the page background and the title is Graphite (`--color-text`, fallback `#2F3136`). The title is now an `h1`.
6
+ - **Breadcrumbs.** The `breadcrumbs` prop is deprecated: accepted, renders nothing, `console.warn` once in dev.
7
+ - **Eyebrow.** Reads the mode color through `--color-accent-fg`, which follows the Mode's stamped primary (`--mode-accent`, the same token the tab strip uses for `modes.<mode>.primary`) and is pinned AA-safe for Petition. Never the white `modes.<mode>.accent`.
8
+ - **Spacing.** 22px above the header; 24px desktop gutter, 16px below `md`. `md:ml-60` sidebar offset unchanged.
9
+ - **Width.** `maxW` is deprecated and ignored (warns once in dev); the header spans its container.
10
+ - **Email guard.** A string `title` / `subtitle` containing an email address warns once in dev.
11
+ - Unchanged: 30px bold title, 11px uppercase eyebrow, 15px G4 subtitle, actions right, tabBar beneath.
12
+ - Tests: `__tests__/pageHeaderEyebrow.test.tsx`.
13
+
14
+ ## 0.89.0
15
+
16
+ Card follows the theme, and the form set gains Checkbox and FileInput. Follow-up to the 0.88.0 migrations.
17
+
18
+ - **Card tokens.** Surface, border and text come from new `--app-card-bg`, `--app-card-border`, `--app-card-fg` and `--app-card-fg-muted` (chrome.css). Light: `#FFFFFF`, `#D7DADF`, `#2F3136`, `#5C6B80`. Dark (under `.dark`): `#161616`, `#333333`, `#E8E8E8`, `#A3A3A3`. Both pairs clear 4.5:1. This fixes the white cards on surveys dark mode and the petitions contrast failure on dark pages. The Brand `.dark {}` can still override the tokens.
19
+ - **Card props.** `subtitle`, `aside`, `actions`, `footer`, `bodyClassName`, `padding` (`none | sm | md | lg`, default `md`). A plain `<Card title>` renders as before (p-6, h3 title). Any of `subtitle`, `aside`, `actions`, `footer`, `bodyClassName` switches to a bordered header / body / footer layout, which is what dashboard `RdParts` and settings `ui/kit` Card need.
20
+ - **New `Checkbox`.** `label`, `description`, `indeterminate`, `invalid`, forwards its ref, 44px-tall clickable row, accent fill, `data-shell-field`. Exported from the root and `/native`.
21
+ - **New `FileInput`.** The `type="file"` control with the Input label/helper/error chrome, 44px tall, secondary-button styling on the native button. `Input` still rejects `file` and `checkbox`; its docs point to these.
22
+ - **ESLint guard.** `no-raw-control-styling` now flags `<input type="checkbox">` and `<input type="file">` with `className` or `style` unless the file imports `Checkbox` / `FileInput` (importing `Input` no longer excuses them). `no-local-primitives` also covers `Checkbox` and `FileInput`.
23
+ - Tests: `__tests__/cardCheckboxFileInput.test.tsx` (including light and dark contrast of the card tokens), `__tests__/eslintGuard.test.ts`.
24
+
1
25
  ## 0.88.0
2
26
 
3
27
  Shared form primitives, so apps stop hand-rolling them.
package/README.md CHANGED
@@ -139,7 +139,8 @@ All `<ShellChrome>` props are optional — only supply what your app has. The ch
139
139
  | `<BrandLogo>` | `<img>` wrapper for the branded mode logo. |
140
140
  | `<BrandIcon name="...">` | Renders `/brand/icons/<name>.svg` from your `public/`. |
141
141
  | `<CommitCopyButton>` | Footer commit/version display with copy-to-clipboard. |
142
- | `<Card>`, `<PageHeader>` | Page-level layout primitives. |
142
+ | `<Card>` | Page-level layout primitive. |
143
+ | `<PageHeader>` | The page header (Reference/UI-Platform → "Page header"): no filled surface, 22px below the top bar, 24px gutter (16px below `md`), spans its container. Eyebrow in the mode color, 30px bold Graphite `h1` title, 15px G4 subtitle, `actions` right, `tabBar` beneath. `breadcrumbs` and `maxW` are **deprecated** (accepted, ignored, warn once in dev); width comes from `FormColumn` (960px) or the fluid frame. Warns in dev if `title` / `subtitle` is a string holding an email address. |
143
144
  | `<FormColumn>` | The one constrained layout inside the frame's fluid `<main>`: a left-aligned column, `max-width: 960px`, for form and settings pages. Also exported from `./native`. |
144
145
  | `<NavTabStrip>` (from `./native`) | The canonical page tab strip: underlined text tabs with a 2px underline in the mode color. Render it in the page body, below the page header. |
145
146
  | `<PageContainer>`, `<BreadcrumbBar>`, `<HeaderTabBar>` | **Deprecated for apps** (each warns in dev). The frame owns a fluid `<main>` (24px gutter, 16px below `md`, no max-width); there are no breadcrumbs; the tab strip is `NavTabStrip`. |
@@ -173,7 +174,7 @@ All `<ShellChrome>` props are optional — only supply what your app has. The ch
173
174
 
174
175
  ## Form primitives
175
176
 
176
- Shared `Button`, `Input`, `Select` and `Textarea`, styled from the shell's tokens (`--app-btn-*`, `--app-field-*`, `--color-*`). 5px radius, 12px horizontal padding.
177
+ Shared `Button`, `Input`, `Select`, `Textarea`, `Checkbox`, `FileInput` and `Card`, styled from the shell's tokens (`--app-btn-*`, `--app-field-*`, `--color-*`). 5px radius, 12px horizontal padding.
177
178
 
178
179
  | Export | Props |
179
180
  |---|---|
@@ -181,6 +182,11 @@ Shared `Button`, `Input`, `Select` and `Textarea`, styled from the shell's token
181
182
  | `<Input>` | All native input props plus `label`, `helperText`, `error`, `invalid`, `wrapperClassName`. 44px tall. Forwards its ref to the `<input>`. |
182
183
  | `<Select>` | Same as `Input`, with `<option>` children. 44px tall. Forwards its ref to the `<select>`. |
183
184
  | `<Textarea>` | Same as `Input`, 88px minimum height. Forwards its ref to the `<textarea>`. |
185
+ | `<Checkbox>` | All native checkbox props plus `label`, `description`, `indeterminate`, `invalid`, `wrapperClassName`. The whole row is a 44px touch target; accent fill; `data-shell-field`. Forwards its ref to the `<input>`. |
186
+ | `<FileInput>` | The `type="file"` control: `label`, `helperText`, `error`, `invalid`, `accept`, `multiple`, `wrapperClassName`. 44px tall. Forwards its ref. `Input` does not accept `type="file"` or `"checkbox"`. |
187
+ | `<Card>` | `title`, `subtitle`, `aside`, `actions`, `footer`, `bodyClassName`, `padding` (`none \| sm \| md \| lg`, default `md`), `minH`, plus any div props. Plain `<Card title>` is a padded box with an h3; any of `subtitle`, `aside`, `actions`, `footer`, `bodyClassName` gives a bordered header / body / footer. |
188
+
189
+ **Card and dark mode.** Card and Checkbox read `--app-card-bg`, `--app-card-border`, `--app-card-fg` and `--app-card-fg-muted` from `chrome.css`: light on `:root`, dark under `.dark`. Do not paint a card white in app CSS; override these tokens if an app needs a different surface.
184
190
 
185
191
  An `error` message marks the control invalid (`aria-invalid`, red border) and replaces the helper text; the label, helper and error are wired with `htmlFor` and `aria-describedby`.
186
192
 
@@ -209,8 +215,8 @@ Run `shell-version-check` in CI too (it is a package `bin`, so `npx shell-versio
209
215
 
210
216
  | Rule (`politogy-shell/…`) | Fails on |
211
217
  |---|---|
212
- | `no-local-primitives` | Declaring or exporting a local `Button`, `Card`, `Input`, `Select`, `Textarea`, `PageHeader` or `FormColumn` (re-exports from the shell are fine). |
213
- | `no-raw-control-styling` | JSX `<button>`, `<input>`, `<select>`, `<textarea>` with `className` or `style`. Allowed in a file that imports the shell primitive of the same kind (wrapping). |
218
+ | `no-local-primitives` | Declaring or exporting a local `Button`, `Card`, `Input`, `Select`, `Textarea`, `Checkbox`, `FileInput`, `PageHeader` or `FormColumn` (re-exports from the shell are fine). |
219
+ | `no-raw-control-styling` | JSX `<button>`, `<input>`, `<select>`, `<textarea>` with `className` or `style`. Allowed in a file that imports the shell primitive of the same kind (wrapping). `<input type="checkbox">` needs `Checkbox` and `<input type="file">` needs `FileInput`; importing `Input` does not excuse them. |
214
220
  | `no-global-control-classes` | `className` strings matching `\b(btn\|input)(-[a-z]+)?\b`, including inside `clsx(...)`, ternaries and template literals. |
215
221
 
216
222
  Escape hatch: put `// shell-primitive-exempt: <reason>` on the line above (or the same line as) the offending code. A reason is required. Prefer adding the missing variant to the shell instead.