@slashsuite/ui-react 0.0.0-stage → 0.12.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/LICENSE +21 -0
- package/MIGRATING.md +540 -0
- package/README.md +549 -2
- package/dist/AppShell.d.ts +127 -0
- package/dist/AppShell.js +119 -0
- package/dist/AppShellMenu.d.ts +26 -0
- package/dist/AppShellMenu.js +66 -0
- package/dist/Avatar.d.ts +75 -0
- package/dist/Avatar.js +95 -0
- package/dist/AvatarStack.d.ts +31 -0
- package/dist/AvatarStack.js +34 -0
- package/dist/Badge.d.ts +15 -0
- package/dist/Badge.js +15 -0
- package/dist/BottomSheet.d.ts +36 -0
- package/dist/BottomSheet.js +142 -0
- package/dist/Breadcrumbs.d.ts +27 -0
- package/dist/Breadcrumbs.js +29 -0
- package/dist/BulletList.d.ts +18 -0
- package/dist/BulletList.js +18 -0
- package/dist/Button.d.ts +121 -0
- package/dist/Button.js +182 -0
- package/dist/ButtonGroup.d.ts +15 -0
- package/dist/ButtonGroup.js +10 -0
- package/dist/Callout.d.ts +43 -0
- package/dist/Callout.js +45 -0
- package/dist/Card.d.ts +148 -0
- package/dist/Card.js +171 -0
- package/dist/CardBadge.d.ts +7 -0
- package/dist/CardBadge.js +12 -0
- package/dist/CardBody.d.ts +28 -0
- package/dist/CardBody.js +30 -0
- package/dist/CardGrid.d.ts +53 -0
- package/dist/CardGrid.js +52 -0
- package/dist/CardParts.d.ts +40 -0
- package/dist/CardParts.js +41 -0
- package/dist/ChatComposer.d.ts +35 -0
- package/dist/ChatComposer.js +50 -0
- package/dist/ChatMessage.d.ts +26 -0
- package/dist/ChatMessage.js +21 -0
- package/dist/ChatThread.d.ts +25 -0
- package/dist/ChatThread.js +60 -0
- package/dist/Checkbox.d.ts +42 -0
- package/dist/Checkbox.js +63 -0
- package/dist/Chevron.d.ts +5 -0
- package/dist/Chevron.js +6 -0
- package/dist/Cluster.d.ts +70 -0
- package/dist/Cluster.js +47 -0
- package/dist/Code.d.ts +6 -0
- package/dist/Code.js +5 -0
- package/dist/CodeBlock.d.ts +46 -0
- package/dist/CodeBlock.js +21 -0
- package/dist/CodeBody.d.ts +20 -0
- package/dist/CodeBody.js +38 -0
- package/dist/CodeExample.d.ts +25 -0
- package/dist/CodeExample.js +17 -0
- package/dist/CodeText.d.ts +11 -0
- package/dist/CodeText.js +64 -0
- package/dist/ColourSchemeToggle.d.ts +36 -0
- package/dist/ColourSchemeToggle.js +64 -0
- package/dist/Container.d.ts +22 -0
- package/dist/Container.js +26 -0
- package/dist/CopyButton.d.ts +17 -0
- package/dist/CopyButton.js +39 -0
- package/dist/CopyLine.d.ts +9 -0
- package/dist/CopyLine.js +7 -0
- package/dist/DateCalendar.d.ts +23 -0
- package/dist/DateCalendar.js +89 -0
- package/dist/DateField.d.ts +124 -0
- package/dist/DateField.js +111 -0
- package/dist/DateFieldCalendar.d.ts +24 -0
- package/dist/DateFieldCalendar.js +50 -0
- package/dist/DateRangePicker.d.ts +47 -0
- package/dist/DateRangePicker.js +44 -0
- package/dist/Dialog.d.ts +56 -0
- package/dist/Dialog.js +94 -0
- package/dist/Disclosure.d.ts +29 -0
- package/dist/Disclosure.js +23 -0
- package/dist/Divider.d.ts +4 -0
- package/dist/Divider.js +5 -0
- package/dist/DocsLayout.d.ts +69 -0
- package/dist/DocsLayout.js +64 -0
- package/dist/Drawer.d.ts +30 -0
- package/dist/Drawer.js +24 -0
- package/dist/EmptyState.d.ts +47 -0
- package/dist/EmptyState.js +34 -0
- package/dist/Field.d.ts +44 -0
- package/dist/Field.js +51 -0
- package/dist/FieldDialog.d.ts +26 -0
- package/dist/FieldDialog.js +31 -0
- package/dist/Fieldset.d.ts +21 -0
- package/dist/Fieldset.js +22 -0
- package/dist/FileDrop.d.ts +17 -0
- package/dist/FileDrop.js +14 -0
- package/dist/FormRow.d.ts +46 -0
- package/dist/FormRow.js +39 -0
- package/dist/Hero.d.ts +23 -0
- package/dist/Hero.js +28 -0
- package/dist/Icon.d.ts +40 -0
- package/dist/Icon.js +30 -0
- package/dist/IconButton.d.ts +72 -0
- package/dist/IconButton.js +65 -0
- package/dist/Image.d.ts +58 -0
- package/dist/Image.js +69 -0
- package/dist/InlineEdit.d.ts +22 -0
- package/dist/InlineEdit.js +60 -0
- package/dist/Input.d.ts +40 -0
- package/dist/Input.js +42 -0
- package/dist/InputShell.d.ts +24 -0
- package/dist/InputShell.js +40 -0
- package/dist/Kbd.d.ts +6 -0
- package/dist/Kbd.js +5 -0
- package/dist/KeyValueList.d.ts +34 -0
- package/dist/KeyValueList.js +35 -0
- package/dist/Lightbox.d.ts +45 -0
- package/dist/Lightbox.js +46 -0
- package/dist/ListRow.d.ts +26 -0
- package/dist/ListRow.js +151 -0
- package/dist/Markdown.d.ts +11 -0
- package/dist/Markdown.js +49 -0
- package/dist/MediaTile.d.ts +66 -0
- package/dist/MediaTile.js +50 -0
- package/dist/Menu.d.ts +64 -0
- package/dist/Menu.js +86 -0
- package/dist/MetaList.d.ts +23 -0
- package/dist/MetaList.js +20 -0
- package/dist/Morph.d.ts +41 -0
- package/dist/Morph.js +107 -0
- package/dist/NavigationProgress.d.ts +20 -0
- package/dist/NavigationProgress.js +26 -0
- package/dist/OutlineRegion.d.ts +60 -0
- package/dist/OutlineRegion.js +51 -0
- package/dist/PageFade.d.ts +30 -0
- package/dist/PageFade.js +46 -0
- package/dist/PageHeader.d.ts +26 -0
- package/dist/PageHeader.js +18 -0
- package/dist/PageLayouts.d.ts +100 -0
- package/dist/PageLayouts.js +78 -0
- package/dist/Pagination.d.ts +38 -0
- package/dist/Pagination.js +65 -0
- package/dist/Pill.d.ts +79 -0
- package/dist/Pill.js +121 -0
- package/dist/ProgressBar.d.ts +47 -0
- package/dist/ProgressBar.js +47 -0
- package/dist/RadioGroup.d.ts +55 -0
- package/dist/RadioGroup.js +53 -0
- package/dist/ScrollStrip.d.ts +21 -0
- package/dist/ScrollStrip.js +12 -0
- package/dist/SearchInput.d.ts +9 -0
- package/dist/SearchInput.js +55 -0
- package/dist/Section.d.ts +93 -0
- package/dist/Section.js +55 -0
- package/dist/SegmentedControl.d.ts +47 -0
- package/dist/SegmentedControl.js +78 -0
- package/dist/Select.d.ts +28 -0
- package/dist/Select.js +19 -0
- package/dist/Show.d.ts +33 -0
- package/dist/Show.js +27 -0
- package/dist/SideColumn.d.ts +50 -0
- package/dist/SideColumn.js +45 -0
- package/dist/SidebarLayout.d.ts +32 -0
- package/dist/SidebarLayout.js +77 -0
- package/dist/SiteFooter.d.ts +31 -0
- package/dist/SiteFooter.js +24 -0
- package/dist/SiteSearch.d.ts +40 -0
- package/dist/SiteSearch.js +150 -0
- package/dist/SortableList.d.ts +86 -0
- package/dist/SortableList.js +191 -0
- package/dist/SplitBar.d.ts +29 -0
- package/dist/SplitBar.js +22 -0
- package/dist/Stack.d.ts +114 -0
- package/dist/Stack.js +76 -0
- package/dist/StackedBar.d.ts +64 -0
- package/dist/StackedBar.js +58 -0
- package/dist/StatTile.d.ts +33 -0
- package/dist/StatTile.js +44 -0
- package/dist/StatusPages.d.ts +49 -0
- package/dist/StatusPages.js +63 -0
- package/dist/Steps.d.ts +29 -0
- package/dist/Steps.js +43 -0
- package/dist/StickyBar.d.ts +12 -0
- package/dist/StickyBar.js +10 -0
- package/dist/Switch.d.ts +56 -0
- package/dist/Switch.js +91 -0
- package/dist/Table.d.ts +92 -0
- package/dist/Table.js +92 -0
- package/dist/TableCells.d.ts +97 -0
- package/dist/TableCells.js +104 -0
- package/dist/TableEditCell.d.ts +31 -0
- package/dist/TableEditCell.js +17 -0
- package/dist/TableExpandCell.d.ts +25 -0
- package/dist/TableExpandCell.js +15 -0
- package/dist/Tabs.d.ts +38 -0
- package/dist/Tabs.js +46 -0
- package/dist/TextLink.d.ts +51 -0
- package/dist/TextLink.js +38 -0
- package/dist/Textarea.d.ts +11 -0
- package/dist/Textarea.js +11 -0
- package/dist/Timeline.d.ts +31 -0
- package/dist/Timeline.js +38 -0
- package/dist/ToastRegion.d.ts +44 -0
- package/dist/ToastRegion.js +37 -0
- package/dist/Tooltip.d.ts +46 -0
- package/dist/Tooltip.js +181 -0
- package/dist/TrendChart.d.ts +36 -0
- package/dist/TrendChart.js +58 -0
- package/dist/Video.d.ts +13 -0
- package/dist/Video.js +9 -0
- package/dist/blocked.d.ts +31 -0
- package/dist/blocked.js +31 -0
- package/dist/cardContext.d.ts +8 -0
- package/dist/cardContext.js +14 -0
- package/dist/cardWait.d.ts +13 -0
- package/dist/cardWait.js +16 -0
- package/dist/colourScheme.d.ts +22 -0
- package/dist/colourScheme.js +53 -0
- package/dist/control.d.ts +29 -0
- package/dist/control.js +37 -0
- package/dist/copyScript.d.ts +13 -0
- package/dist/copyScript.js +13 -0
- package/dist/cx.d.ts +19 -0
- package/dist/cx.js +21 -0
- package/dist/density.d.ts +38 -0
- package/dist/density.js +77 -0
- package/dist/emptySlot.d.ts +11 -0
- package/dist/emptySlot.js +16 -0
- package/dist/fieldControl.d.ts +23 -0
- package/dist/fieldControl.js +24 -0
- package/dist/fieldWait.d.ts +30 -0
- package/dist/fieldWait.js +27 -0
- package/dist/foldedColumn.d.ts +18 -0
- package/dist/foldedColumn.js +51 -0
- package/dist/headingLevel.d.ts +10 -0
- package/dist/headingLevel.js +18 -0
- package/dist/highlight.d.ts +18 -0
- package/dist/highlight.js +306 -0
- package/dist/highlightConsole.d.ts +9 -0
- package/dist/highlightConsole.js +42 -0
- package/dist/highlightHtml.d.ts +7 -0
- package/dist/highlightHtml.js +132 -0
- package/dist/highlightKit.d.ts +16 -0
- package/dist/highlightKit.js +23 -0
- package/dist/highlightYaml.d.ts +3 -0
- package/dist/highlightYaml.js +143 -0
- package/dist/icons.d.ts +16 -0
- package/dist/icons.js +108 -0
- package/dist/index.d.ts +99 -0
- package/dist/index.js +92 -0
- package/dist/isoDate.d.ts +5 -0
- package/dist/isoDate.js +16 -0
- package/dist/labelWords.d.ts +20 -0
- package/dist/labelWords.js +28 -0
- package/dist/layoutWait.d.ts +15 -0
- package/dist/layoutWait.js +18 -0
- package/dist/link.d.ts +82 -0
- package/dist/link.js +68 -0
- package/dist/listRowProps.d.ts +108 -0
- package/dist/listRowProps.js +1 -0
- package/dist/listRowWait.d.ts +6 -0
- package/dist/listRowWait.js +14 -0
- package/dist/modal.d.ts +25 -0
- package/dist/modal.js +61 -0
- package/dist/navFold.d.ts +15 -0
- package/dist/navFold.js +46 -0
- package/dist/pillTip.d.ts +8 -0
- package/dist/pillTip.js +25 -0
- package/dist/props.d.ts +26 -0
- package/dist/props.js +14 -0
- package/dist/scrollEdges.d.ts +12 -0
- package/dist/scrollEdges.js +40 -0
- package/dist/scrollStop.d.ts +32 -0
- package/dist/scrollStop.js +79 -0
- package/dist/sheetSnap.d.ts +27 -0
- package/dist/sheetSnap.js +45 -0
- package/dist/shownDate.d.ts +88 -0
- package/dist/shownDate.js +186 -0
- package/dist/size.d.ts +45 -0
- package/dist/size.js +12 -0
- package/dist/skeleton.d.ts +83 -0
- package/dist/skeleton.js +88 -0
- package/dist/stackGap.d.ts +9 -0
- package/dist/stackGap.js +16 -0
- package/dist/stickyColumn.d.ts +38 -0
- package/dist/stickyColumn.js +38 -0
- package/dist/switcher.d.ts +93 -0
- package/dist/switcher.js +78 -0
- package/dist/tableColumns.d.ts +31 -0
- package/dist/tableColumns.js +72 -0
- package/dist/tableEmpty.d.ts +15 -0
- package/dist/tableEmpty.js +26 -0
- package/dist/tableRow.d.ts +67 -0
- package/dist/tableRow.js +49 -0
- package/dist/tableSort.d.ts +22 -0
- package/dist/tableSort.js +19 -0
- package/dist/textBox.d.ts +10 -0
- package/dist/textBox.js +23 -0
- package/dist/tone.d.ts +11 -0
- package/dist/tone.js +1 -0
- package/dist/trend.d.ts +26 -0
- package/dist/trend.js +64 -0
- package/dist/typography.d.ts +203 -0
- package/dist/typography.js +242 -0
- package/dist/useImageFailed.d.ts +19 -0
- package/dist/useImageFailed.js +21 -0
- package/package.json +84 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jacobus Langner
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/MIGRATING.md
ADDED
|
@@ -0,0 +1,540 @@
|
|
|
1
|
+
# Migrating @slashsuite/ui-react
|
|
2
|
+
|
|
3
|
+
## @hackcove is now @slashsuite: the npm scope moves
|
|
4
|
+
|
|
5
|
+
If the app is still on 0.10, run the codemod (below, "Running the codemod") first: it matches imports from `@hackcove/ui-react`, so after the swap it finds nothing and says nothing.
|
|
6
|
+
|
|
7
|
+
Every Slash package moves from the `@hackcove` npm scope to `@slashsuite`, and keeps the part after the scope:
|
|
8
|
+
`@hackcove/ui-react` is `@slashsuite/ui-react`, `@hackcove/themes` is `@slashsuite/themes`. There is no alias
|
|
9
|
+
package and no re-export. The old names stay on npm at their last version.
|
|
10
|
+
|
|
11
|
+
1. Swap the dependencies: `bun remove @hackcove/ui-react @hackcove/themes && bun add @slashsuite/ui-react @slashsuite/themes`.
|
|
12
|
+
2. Find and replace the import specifier `"@hackcove/ui-react"` with `"@slashsuite/ui-react"`, and the theme path
|
|
13
|
+
`@hackcove/themes/` with `@slashsuite/themes/` (in the CSS `@import`).
|
|
14
|
+
3. Change the Tailwind `@source` path to `node_modules/@slashsuite/ui-react/dist`.
|
|
15
|
+
|
|
16
|
+
## 0.10 to 0.11: one API pass
|
|
17
|
+
|
|
18
|
+
Each idea has one name, one value set and one default. Every old name below is gone in 0.11, with no
|
|
19
|
+
alias. A codemod rewrites the mechanical swaps (marked **codemod** below) and prints a `file:line`
|
|
20
|
+
for each one a person has to decide (marked **by hand**); how to run it is at the end of this section.
|
|
21
|
+
|
|
22
|
+
### Tone, text and passthrough
|
|
23
|
+
|
|
24
|
+
There is one tone vocabulary, `Tone` (`neutral`, `info`, `positive`, `warn`, `danger`), exported
|
|
25
|
+
from the package. `neutral` is every default. `tone` is the one ink prop on `Text`, `Caption` and
|
|
26
|
+
`Overline`; their `TextTone` adds `muted` and `accent`.
|
|
27
|
+
|
|
28
|
+
| Old | New | |
|
|
29
|
+
| --- | --- | --- |
|
|
30
|
+
| `import type { CalloutTone }` | `import type { Tone }` | codemod |
|
|
31
|
+
| `Callout` with no `tone` (was `info`) | `neutral`; write `tone="info"` to keep the blue box | codemod pins `tone="info"` |
|
|
32
|
+
| `Text color="muted"` (and `Caption`, `Overline`) | `tone="muted"`, one step darker (`text-slate-500`) | codemod |
|
|
33
|
+
| `color="tertiary"` | `tone="muted"` (the same ink) | codemod |
|
|
34
|
+
| `color="brand"` | `tone="accent"` | codemod |
|
|
35
|
+
| `Text color="secondary"` | nothing: it is the default | codemod |
|
|
36
|
+
| `Caption color="secondary"`, `Overline color="secondary"` | no swap: pick `tone` or leave the role's ink | by hand |
|
|
37
|
+
| `color="default"` on an inline role | no exact swap: `Text strong` adds the weight in the primary ink | by hand |
|
|
38
|
+
| `color` on `Display`, `Lead`, `PageHeading`, `SectionHeading`, `SubsectionHeading` | removed: each heading has its fixed ink | by hand |
|
|
39
|
+
| `TypographyColor` | removed | by hand |
|
|
40
|
+
| `Text` and `Caption` are a `<span>` | a `<p>`; `as="span"` is the inline form, inside a row, a cell, a button or a sentence | codemod drops `as="p"` and pins `as="span"` where there is no `as` |
|
|
41
|
+
| `Icon tone="inherit"` | leave `tone` out | codemod |
|
|
42
|
+
| `ProgressBar`, `SplitBar`, `StatTile` `tone="negative"` (and `toneA`, `toneB`) | `danger` | codemod |
|
|
43
|
+
| `StackedBar`, `Legend`, `TrendChart` `tone: "violet"` | `accent`, the theme's accent ink | codemod |
|
|
44
|
+
| `StackedBar segments` | `items` | codemod |
|
|
45
|
+
| `BulletList` with `<li>` or `Text as="li"` children | `BulletItem` children | by hand |
|
|
46
|
+
| `Callout`, `StatTile`, `Badge`, `Kbd`, `Code`, `Divider`, `BulletList`, `KeyValueList`, `KeyValue`, `PageFade`, `Morph`, `CopyLine` took their element's every attribute | `id`, `data-*` and `aria-*` only | by hand (any other prop is reported) |
|
|
47
|
+
| `PageHeaderProps`, `HeroProps`, `ListRowProps`, `DialogProps`, `DrawerProps`, `BottomSheetProps`, `LightboxProps`, `TabsProps`, `FieldDialogProps`, `ImageProps`, `MediaTileProps`, `ScrollStripProps`, `TypographyProps`, `DateFieldProps`, `DateRangePickerProps` | not exported: `ComponentProps<typeof Dialog>` | by hand |
|
|
48
|
+
| `ButtonLook` | not exported | by hand |
|
|
49
|
+
|
|
50
|
+
New, nothing to change: `Callout icon`; every component takes an `id` on its root; `StackRowFrom`,
|
|
51
|
+
`ClusterGrowMinWidth`, `TextAlign` and `TextMinWidth` are exported.
|
|
52
|
+
|
|
53
|
+
Not flagged by TypeScript: a `Callout` with no `tone` is now neutral (grey, not blue), `tone="muted"`
|
|
54
|
+
is one step darker than `color="muted"` was, a chart's `violet` part is now the accent, and a bare
|
|
55
|
+
`Text` or `Caption` is now a block `<p>`, which also must not sit inside another `<p>`, a `<span>`,
|
|
56
|
+
a `<button>`, an `<a>` or a `<label>`.
|
|
57
|
+
|
|
58
|
+
### The router link adapter
|
|
59
|
+
|
|
60
|
+
The app names its router's link once, on `LinkProvider`, and every part that links takes a plain
|
|
61
|
+
`href`. `render` is gone from `Button`, `IconButton`, `TextLink`, `Pill`, `Card`, `ListRow`,
|
|
62
|
+
`AppShellBrand`, a `Crumb` and a `Tabs` or `SegmentedControl` link item; `renderHome` is gone from
|
|
63
|
+
the status pages.
|
|
64
|
+
|
|
65
|
+
| Old | New | |
|
|
66
|
+
| --- | --- | --- |
|
|
67
|
+
| a `render` on each link | wrap the app once: TanStack Router `createRouter({ InnerWrap: ({ children }) => <LinkProvider link={(p) => <Link to="." {...p} />}>{children}</LinkProvider> })` (`to="."` satisfies the typed `to`; the `href` wins), or React Router `<LinkProvider link={({ href, ...p }) => <Link to={href} {...p} />}>` | by hand, once |
|
|
68
|
+
| `render={(p) => <Link to="/quotes" {...p} />}` | `href="/quotes"` | codemod |
|
|
69
|
+
| `to="/stores/$storeId" params={{ storeId: id }}` | ``href={`/stores/${encodeURIComponent(id)}`}`` | by hand |
|
|
70
|
+
| `search={{ project, env }}`, `hash="for-shops"` | `href={"/?" + new URLSearchParams({ project, env })}`, `href="/about#for-shops"` | by hand |
|
|
71
|
+
| `{ label, render }` crumbs and items | `{ label, href }` | codemod for a literal `to`, else by hand |
|
|
72
|
+
| `LinkRenderProps`, `LinkRender` | `LinkAdapterProps`, `LinkAdapter`; the props carry `href`, so an adapter spreads them and sets no `href` of its own | codemod, and reported |
|
|
73
|
+
| `viewTransition` on one `Link` | `defaultViewTransition` on `createRouter` | by hand |
|
|
74
|
+
|
|
75
|
+
New, nothing to change: `MediaTile` and `Avatar` take `href` and `external` beside `onClick`, and
|
|
76
|
+
their `onClick` is handed the click event. A `SiteSearch` result is a client-side navigation under
|
|
77
|
+
a `LinkProvider`. Only an in-app path (one that starts with a single `/`) reaches the adapter; an
|
|
78
|
+
`external` link, a full URL, a `#hash` and a relative path stay a plain `<a>`.
|
|
79
|
+
|
|
80
|
+
### The status pages' home link
|
|
81
|
+
|
|
82
|
+
Every status page but `Maintenance` links "Back to home" by itself, to the `home` on
|
|
83
|
+
`LinkProvider` (`/` by default). A page takes no home prop.
|
|
84
|
+
|
|
85
|
+
| Old | New | |
|
|
86
|
+
| --- | --- | --- |
|
|
87
|
+
| `<NotFound homeHref="/" />`, and the same on each page | `<NotFound />` | codemod |
|
|
88
|
+
| `renderHome={(p) => <a href="/" {...p} />}`, `renderHome={(p) => <Link to="/" {...p} />}` | nothing: the default, through the adapter | codemod |
|
|
89
|
+
| a home that is not `/` (`homeHref={SITE}`) | `<LinkProvider home={SITE}>` once, around the app or in TanStack's `InnerWrap` | by hand |
|
|
90
|
+
|
|
91
|
+
TypeScript does not flag these:
|
|
92
|
+
|
|
93
|
+
- `action` with no `homeHref` had no home link. The page now shows both, the action first, and
|
|
94
|
+
there is no way to hide it.
|
|
95
|
+
- A `NotFound`, `ErrorPage`, `Offline` or `Forbidden` that had no `homeHref` gains "Back to home".
|
|
96
|
+
- `Maintenance` draws no home link, even where it had a `homeHref`.
|
|
97
|
+
|
|
98
|
+
### Buttons and pills
|
|
99
|
+
|
|
100
|
+
| Old | New | |
|
|
101
|
+
| --- | --- | --- |
|
|
102
|
+
| `Button tone="default"`, `IconButton tone="default"` | leave `tone` out: `neutral` is the default | codemod |
|
|
103
|
+
| `IconButton badge={3}` | `IconButton count={3}` | codemod |
|
|
104
|
+
| `<IconButton label="Close"><Icon name="close" /></IconButton>` | `<IconButton label="Close" icon="close" />`: `icon` is required and there are no children | codemod for an `<Icon name>` child, else by hand |
|
|
105
|
+
| an icon as a `Button`'s first child | `<Button icon="plus">Add a line</Button>` | by hand |
|
|
106
|
+
| `busy={saving} busyLabel="Saving"` | `busy={saving && "Saving"}` | codemod |
|
|
107
|
+
| `Pill tone="slate"` | leave `tone` out (`neutral`) | codemod |
|
|
108
|
+
| `Pill tone="amber"`, `"emerald"`, `"blue"`, `"red"`, `"violet"` | `"warn"`, `"positive"`, `"info"`, `"danger"`, `"accent"` | codemod |
|
|
109
|
+
| `Pill tone="sky"` | `tone="info"` (the blue tint) | codemod, and reported |
|
|
110
|
+
| `Pill label="Weight"` (the name half) | `Pill name="Weight"` | codemod |
|
|
111
|
+
| a tone kept in code, `const tones: PillTone[] = ["amber", "slate"]` | the new values, `["warn", "neutral"]` | codemod for a value or list typed `PillTone`, `BarTone`, `ButtonTone`, `IconButtonTone` or `CellTone`; any other `tone={…}` whose old values are gone is reported |
|
|
112
|
+
| any `div` attribute on `ButtonGroup` | only `id`, `data-*` and `aria-*` | by hand |
|
|
113
|
+
|
|
114
|
+
New, nothing to change: `Button` takes `ref`; `Pill` takes `size`. A `Button`, `IconButton` or
|
|
115
|
+
`Pill` with no `size` takes the size of the `Card`, `ListRow` or `Table` it sits in, else `md`.
|
|
116
|
+
|
|
117
|
+
TypeScript does not flag these:
|
|
118
|
+
|
|
119
|
+
- `CopyButton`'s default words are `Copy` and `Copied` (were `copy` and `copied`), so an e2e or a
|
|
120
|
+
test that finds it by the name `copy` needs the capital.
|
|
121
|
+
- `Pill tone="sky"` drew its own sky tint; `info` is the blue one.
|
|
122
|
+
|
|
123
|
+
### Layouts and navigation
|
|
124
|
+
|
|
125
|
+
| Old | New | |
|
|
126
|
+
| --- | --- | --- |
|
|
127
|
+
| `subtitle` on `PageHeader`, `ListLayout`, `DetailLayout`, `FormLayout`, `ProseLayout`, `CenteredLayout` | `description` | codemod |
|
|
128
|
+
| `SidebarLayout rail`, `railLabel` | `aside`, `asideLabel` | codemod |
|
|
129
|
+
| `FullBleedLayout panel`, `panelLabel` | `aside`, `asideLabel` | codemod |
|
|
130
|
+
| `DetailLayout stickyAside` | `sticky` | codemod |
|
|
131
|
+
| `ListLayout isEmpty={rows.length === 0}` | nothing: `empty` shows when there are no children | codemod drops it, and reports it |
|
|
132
|
+
| `AppShell hideChromeInPrint` | `printChrome={false}` | codemod |
|
|
133
|
+
| `action` on `NotFound`, `ErrorPage`, `Offline`, `Maintenance`, `Forbidden` | `actions` | codemod |
|
|
134
|
+
| `FilterGroup legend` | `label` | codemod |
|
|
135
|
+
| `Breadcrumbs crumbs` | `items` | codemod |
|
|
136
|
+
| `AvatarStack people` | `items` | codemod |
|
|
137
|
+
| `active: true` on a `Tabs` or `SegmentedControl` link item | `selected: true` | codemod for an inline `items`, else by hand |
|
|
138
|
+
| `Tabs variant="pill" orientation="vertical"` | `Tabs orientation="vertical"` | codemod |
|
|
139
|
+
| `Tabs variant="pill"` across (and its `size`) | `Tabs`: across is always underline | codemod drops it, and reports it |
|
|
140
|
+
| `Container elementRef` | `ref` | codemod |
|
|
141
|
+
| `NavigationProgress active` | `loading`, the one name for a pending state | codemod |
|
|
142
|
+
| any other HTML attribute on `Avatar` or `AppShell` (`onError`, a `div` handler) | only `id`, `data-*` and `aria-*` | by hand |
|
|
143
|
+
| `avatarColourClass`, `initialsOf` | not exported: `Avatar` draws both from `name` | by hand |
|
|
144
|
+
|
|
145
|
+
New, nothing to change: `Breadcrumbs label` (default `Breadcrumb`), `Lightbox closeLabel`,
|
|
146
|
+
`previousLabel` and `nextLabel`, `MediaTile removeLabel` (default `Remove`) and
|
|
147
|
+
`SortableSection emptyLabel` (default `Drop here`). `SortableList`, `SortableSection` and
|
|
148
|
+
`SortableItem` pass every `aria-*`.
|
|
149
|
+
|
|
150
|
+
TypeScript does not flag these:
|
|
151
|
+
|
|
152
|
+
- A pill row across (`variant="pill"` in an `AppShell` `nav`, a `PageHeader` `tabs` slot or a
|
|
153
|
+
section nav) is now an underline row. Only the vertical rail is pills.
|
|
154
|
+
- `active` on a link item in an array held in a variable (`const items = [{ ..., active: true }]`)
|
|
155
|
+
still compiles, since it is not an object literal at the `Tabs`, and is ignored: rename it to
|
|
156
|
+
`selected`, or no tab is marked current.
|
|
157
|
+
- A `ListLayout` whose children are an empty array, `null` or `false` now shows `empty` without
|
|
158
|
+
`isEmpty`; one that passed `isEmpty` while it still had children now shows the children.
|
|
159
|
+
|
|
160
|
+
### EpicHeader and groupByEpic are gone
|
|
161
|
+
|
|
162
|
+
No consumer used either. There is no replacement component and no codemod swap; the codemod
|
|
163
|
+
reports an import of either and changes nothing.
|
|
164
|
+
|
|
165
|
+
| Removed | Write instead |
|
|
166
|
+
| --- | --- |
|
|
167
|
+
| `<EpicHeader color={c} label="HC-42 Voice Inbox" />` over a group | The group's title as `<SubsectionHeading as="h3" size="sm">` (or an `Overline` for a small label) over the group. A status beside it is a `Pill tone=… dot`. In a table, the group is a `<TableGroupRow label=… colSpan=… />`. There is no raw-colour dot. |
|
|
168
|
+
| `groupByEpic(items, (i) => i.epic)` | App logic, not UI: `Object.groupBy(items, (i) => i.epic ?? "")` or a `Map`, then sort the keys your way (the old order was real refs ascending, `null` last). |
|
|
169
|
+
|
|
170
|
+
### ToolCallCard is gone
|
|
171
|
+
|
|
172
|
+
No app used it. `ChatThread`, `ChatMessage` and `ChatComposer` stay.
|
|
173
|
+
|
|
174
|
+
| Removed | Write instead |
|
|
175
|
+
| --- | --- |
|
|
176
|
+
| `<ToolCallCard name="search" status="done" summary="…">…</ToolCallCard>` | A `Disclosure bordered` whose `summary` names the tool (a `Code`) and carries a `Pill` for how it went (`tone="positive"` Done, `tone="danger"` Failed, a neutral Running), with the detail as its children. |
|
|
177
|
+
|
|
178
|
+
### Running text is 1rem
|
|
179
|
+
|
|
180
|
+
Text is 1rem: an app that wants the old density sets `AppShell density="compact"` once. Nothing
|
|
181
|
+
else sets the step, and no component takes a type size of its own.
|
|
182
|
+
|
|
183
|
+
| | 0.10 | 0.11 | 0.11 under `AppShell density="compact"` |
|
|
184
|
+
| --- | --- | --- | --- |
|
|
185
|
+
| `Text` | 14px (`text-sm/5`) | 16px (`text-base/6`) | 14px |
|
|
186
|
+
| `Caption` | 12px | 14px | 12px |
|
|
187
|
+
| `SectionHeading` | 16px | 20px | 16px |
|
|
188
|
+
| `SubsectionHeading` `sm`, `md`, `lg` | 14, 16, 18px | 16, 18, 20px | 14, 16, 18px |
|
|
189
|
+
| `Input`, `Select`, `Textarea`, `DateField`, `Button` `sm`, `md`, `lg` | 12, 14, 16px | 14, 16, 18px | 12, 14, 16px |
|
|
190
|
+
|
|
191
|
+
TypeScript does not flag these, since no name changes:
|
|
192
|
+
|
|
193
|
+
- Every page reads one step larger unless its `AppShell` sets `density="compact"`. The codemod
|
|
194
|
+
reports every `AppShell` with no `density` so a person chooses; it writes nothing.
|
|
195
|
+
- A text field is never under 16px on a touch screen, at any size or step, so iOS Safari does not
|
|
196
|
+
zoom the page when it takes the focus.
|
|
197
|
+
- `Prose` now sets only its line height: `Text` inside it is 16px, as it is outside.
|
|
198
|
+
|
|
199
|
+
### Controls
|
|
200
|
+
|
|
201
|
+
Every labelled control takes the same words: `hint` for the muted line, `error` for the red one
|
|
202
|
+
(it marks the control invalid and replaces the hint), `disabled` and `required`, and `checked` or
|
|
203
|
+
`defaultChecked` with `onChange(checked)` on the two toggles.
|
|
204
|
+
|
|
205
|
+
| Old | New | |
|
|
206
|
+
| --- | --- | --- |
|
|
207
|
+
| `description` on `Checkbox`, `Switch`, `Radio`, `DateField`, `DateRangePicker` | `hint` | codemod |
|
|
208
|
+
| `isInvalid errorMessage="…"` on `DateField`, `DateRangePicker` | `error="…"` | codemod |
|
|
209
|
+
| `isInvalid` alone | `error` with the reason: the field says why | by hand |
|
|
210
|
+
| `errorMessage` alone, rewording the built-in message | nothing: the built-in message stands | by hand, and reported |
|
|
211
|
+
| `isDisabled`, `isRequired` on `RadioGroup`, `Radio`, `DateField`, `DateRangePicker` | `disabled`, `required` | codemod |
|
|
212
|
+
| `Checkbox onChange={(e) => f(e.target.checked)}` | `onChange={f}`: it gets the new state | codemod for that shape, else by hand |
|
|
213
|
+
| `Checkbox align="start"` or `align="center"` | leave it out: the box sits on the label's first line | codemod drops it |
|
|
214
|
+
| `ColourSchemeToggle initial` | `defaultValue` | codemod |
|
|
215
|
+
| `Input icon={<Icon name="search" />}` | `icon="search"` | codemod for an `<Icon name>`, else by hand |
|
|
216
|
+
| `<Select><option value="a">A</option></Select>` | `<Select items={[{ value: "a", label: "A" }]} />` | codemod for literal options, else by hand |
|
|
217
|
+
| `Select width="auto"` | nothing: `auto` is the default outside a `Field` and still right inside one | nothing to change; codemod reports a `Select` with no `width` and no `Field` round it in the file |
|
|
218
|
+
| `Field hideLabel` | `labelHidden` | codemod |
|
|
219
|
+
| `FieldDialog label="…" inputLabel="…"` | `label` alone, which names the input | codemod drops `inputLabel` |
|
|
220
|
+
| `FormRow action` | `actions` | codemod |
|
|
221
|
+
|
|
222
|
+
New, nothing to change: `RadioGroup hint`; `error` on `Checkbox` and `Switch`; `Switch
|
|
223
|
+
defaultChecked`; `Disclosure open` and `onOpenChange`; `Input clearLabel` (default `Clear search`);
|
|
224
|
+
`monthLabel` and `yearLabel` on a calendar `DateField` and on `DateRangePicker` (default `Month`
|
|
225
|
+
and `Year`); `ref` on `Input`, `Select` and `Checkbox`. `Textarea` takes `ref` as a plain prop, as
|
|
226
|
+
before. `RadioGroup`, `DateField` and `DateRangePicker` pass every `aria-*` and `data-*`.
|
|
227
|
+
|
|
228
|
+
TypeScript does not flag these:
|
|
229
|
+
|
|
230
|
+
- The peers are `react` and `react-dom` `>=19`.
|
|
231
|
+
- A `Select` with no `width` outside a `Field` is now as wide as its longest choice, not the full
|
|
232
|
+
row: pass `width="full"` to keep it.
|
|
233
|
+
- A `Checkbox` with a one-line label sits on the line's top, where `align="center"` centred it: the
|
|
234
|
+
same place for a label that fits on one line.
|
|
235
|
+
|
|
236
|
+
### Containers and rows
|
|
237
|
+
|
|
238
|
+
A container now sets what sits in it: a `Stack`'s gap, a heading's level and, in a `sm` card or
|
|
239
|
+
row, the size of the buttons in it. An explicit prop on the child always wins.
|
|
240
|
+
|
|
241
|
+
| Old | New | |
|
|
242
|
+
| --- | --- | --- |
|
|
243
|
+
| `Stack`, `Section` with no `gap` | the same at page level; inside a `Card`, `Dialog`, `Drawer`, `BottomSheet`, `Callout` or `ListRow` the gap is `xs` | codemod writes `gap="md"` where there is none, so nothing moves |
|
|
244
|
+
| `Cluster` with no `wrap` | now wraps: `wrap={false}` keeps one line | codemod writes `wrap={false}`; drops `wrap` |
|
|
245
|
+
| `Cluster` with no `gap` | now `sm` (was `xs`) | codemod writes `gap="xs"` |
|
|
246
|
+
| `MetaList nowrap` | leave it out: an item never breaks inside itself | codemod drops it |
|
|
247
|
+
| `ListRow active` | `highlighted` | codemod |
|
|
248
|
+
| `ListRow detail` | `panel` | codemod |
|
|
249
|
+
| `ListRow static` | leave it out: a row with no `href` and no `onClick` is static by itself, and a button row needs `onClick` | codemod drops it |
|
|
250
|
+
| `Card as="section"`, `Card as="div"` | leave `as` out: a card with a `title` or an `aria-label` is a `section`, any other a `div` | codemod drops it |
|
|
251
|
+
| `Card dashed` whose only child is an `EmptyState` | the `EmptyState` alone: it draws its own dashed frame | codemod for a `Card` with no prop but `dashed`, else by hand |
|
|
252
|
+
| `Card dashed` or `dashed="filled"` round anything else | an `EmptyState` with a `title` | by hand, and reported |
|
|
253
|
+
| `Dialog size` | `width` | codemod |
|
|
254
|
+
| `Drawer size` | `width` | codemod |
|
|
255
|
+
|
|
256
|
+
New, nothing to change: `level` on `Card` and `Section`, and `EmptyState`'s now comes from where
|
|
257
|
+
it sits; `EmptyState icon`; `Drawer description`; `SiteSearch resultsLabel` (default `Results`).
|
|
258
|
+
|
|
259
|
+
TypeScript does not flag these:
|
|
260
|
+
|
|
261
|
+
- A `Card` title is an `h3` inside a `Section`, and an `EmptyState` title one below the heading
|
|
262
|
+
that holds it, where both were always an `h2`. A test that finds one by `level: 2` needs the new
|
|
263
|
+
level, or a `level` prop to pin it.
|
|
264
|
+
- A `Card` with neither a `title` nor an `aria-label` (or `aria-labelledby`) is a `div`, so it is
|
|
265
|
+
no landmark; one with a name stays a `section`.
|
|
266
|
+
- A `Button`, `IconButton` or `Pill` with no `size` in a `Card size="sm"` or a `ListRow size="sm"`
|
|
267
|
+
is now `sm`. The codemod reports every `Card size="sm"` and `ListRow size="sm"` so a person
|
|
268
|
+
checks what is inside.
|
|
269
|
+
- A `ListRow` with neither `href` nor `onClick` is now a plain row with no hover fill and no button.
|
|
270
|
+
- A `Stack` with no `gap` inside a card, dialog, drawer, sheet, callout or row is now `xs` apart.
|
|
271
|
+
- A standalone `EmptyState` now draws a dashed frame round itself.
|
|
272
|
+
|
|
273
|
+
### Tables
|
|
274
|
+
|
|
275
|
+
A table is named by `label`, says a column of figures once in its head, and is plain inside a
|
|
276
|
+
`Card` with no prop.
|
|
277
|
+
|
|
278
|
+
| Old | New | |
|
|
279
|
+
| --- | --- | --- |
|
|
280
|
+
| `Table caption` | `label`, now required | codemod renames; reports a `Table` with none |
|
|
281
|
+
| `Table variant="plain"` | leave it out: a table inside a `Card` is plain | codemod drops it |
|
|
282
|
+
| `TableHeaderCell srLabel` | `label` | codemod |
|
|
283
|
+
| `TableHeaderCell align="end"` over a column of `numeric` cells | `TableHeaderCell numeric`: the title and every cell under it are end aligned in tabular figures | codemod, where the first body row's cell in that column is `numeric` |
|
|
284
|
+
| `TableCell numeric align="end"` | `numeric` alone: it implies `end` | codemod drops `align="end"` |
|
|
285
|
+
| `TableCell tone="default"` | leave it out: `neutral` is the default | codemod drops it |
|
|
286
|
+
| `TableCell tone="neutral"` (`text-slate-600`) | `neutral`, now `text-slate-700`, the one plain cell ink | nothing to change |
|
|
287
|
+
|
|
288
|
+
New, nothing to change: `TableRow selected` (the `ListRow` selected fill and `aria-current`) and
|
|
289
|
+
`Table size` (the row padding, `sm` by default).
|
|
290
|
+
|
|
291
|
+
TypeScript does not flag these:
|
|
292
|
+
|
|
293
|
+
- A `Table` inside a `Card` that was not `plain` now draws plain: no card of its own, no head strip
|
|
294
|
+
and no row hover.
|
|
295
|
+
- A `numeric` cell with no `align` is now end aligned. The codemod writes `align="start"` on one,
|
|
296
|
+
so nothing moves until you drop it.
|
|
297
|
+
- A `Button`, `IconButton` or `Pill` with no `size` in a `Table` is now `sm`; a field keeps `md`. The codemod reports every `Table` so a person checks what is inside.
|
|
298
|
+
- A cell that was `tone="neutral"` is one step darker.
|
|
299
|
+
|
|
300
|
+
### Forms
|
|
301
|
+
|
|
302
|
+
A form's error is drawn and announced by the library, and a form inside a `Dialog` is wired by it.
|
|
303
|
+
|
|
304
|
+
New, nothing to change: `Dialog onSubmit` (one form round the body, the error and the footer, so a
|
|
305
|
+
`Button type="submit"` in the footer needs no `form` attribute and the body no form id) and
|
|
306
|
+
`Dialog error`; `FormLayout error`, directly above its `actions`.
|
|
307
|
+
|
|
308
|
+
| Old | New | |
|
|
309
|
+
| --- | --- | --- |
|
|
310
|
+
| `<FilterGroup label={x}>{chips}</FilterGroup>` | `<Fieldset label={x}><ButtonGroup>{chips}</ButtonGroup></Fieldset>` | codemod |
|
|
311
|
+
| `Input align="end"` | `Input numeric`: right-aligned tabular figures and `inputMode="decimal"` unless you pass your own | codemod, and drops an `inputMode="decimal"` beside it |
|
|
312
|
+
| `Input align="start"` | leave it out | codemod drops it |
|
|
313
|
+
| `Input align` with any other value | `numeric` on a field for a figure, nothing on any other | by hand, and reported |
|
|
314
|
+
| `ControlAlign` | no replacement | by hand, and reported |
|
|
315
|
+
|
|
316
|
+
`Fieldset` is the one labelled group: checkboxes that answer one question, a set of fields, or the
|
|
317
|
+
chips of one facet. It takes `hint` and `error` as a `Field` does. A `RadioGroup` is its own group
|
|
318
|
+
and goes in no `Fieldset`.
|
|
319
|
+
|
|
320
|
+
An amount is `<Input prefix="R" numeric />` and a count `<Input numeric inputMode="numeric" />`.
|
|
321
|
+
Never `type="number"` for a figure a person types.
|
|
322
|
+
|
|
323
|
+
TypeScript does not flag these:
|
|
324
|
+
|
|
325
|
+
- A `Callout tone="danger"` is `role="alert"` and a `Callout tone="warn"` is `role="status"`, so a
|
|
326
|
+
test that asks for the only `alert` on a page can now find two. Find it by its text or scope it to
|
|
327
|
+
a region.
|
|
328
|
+
- A `Fieldset` legend has the `Field` label's look, where a `FilterGroup` legend was small
|
|
329
|
+
uppercase, and its chips sit 2px further apart (a `ButtonGroup`'s gap).
|
|
330
|
+
- A `numeric` field sets its digits in tabular figures, where `align="end"` did not.
|
|
331
|
+
|
|
332
|
+
### Layout and composition
|
|
333
|
+
|
|
334
|
+
| Old | New | |
|
|
335
|
+
| --- | --- | --- |
|
|
336
|
+
| `Text truncate`, `Caption truncate` | `lines={1}` (`lines` also clamps to 2, 3 or 4 lines) | codemod; a `truncate={expression}` is reported |
|
|
337
|
+
| `Overline truncate` | removed: an overline is a short label | by hand (reported) |
|
|
338
|
+
| `<AppShellHideBelow breakpoint="lg">` | `<Show from="lg">` | codemod |
|
|
339
|
+
| `<AppShellHideBelow>` (no `breakpoint`) | `<Show from="sm">` | codemod |
|
|
340
|
+
| `AppShellHideBelow` with more than one child | `Show` draws no row: put a `Cluster gap="xs"` inside it | codemod renames it, and reports it |
|
|
341
|
+
| `AppShellBreakpoint` | `Breakpoint` | codemod |
|
|
342
|
+
| `CardGrid columns="2:1"` or `"1:2"` | `SideColumn asideWidth="third"`: the main area two thirds, the aside one | by hand (reported) |
|
|
343
|
+
| `RegionFrame width={1600} height={920}` (the picture's own size on its `<img>`) | drop both: `width` is now the frame's (`sm`, `md`, `lg`, `full`) and `aspect` its shape | by hand (reported) |
|
|
344
|
+
|
|
345
|
+
`AppShellHideBelow` drew its children in a `gap-2` row. `Show` draws no box at all (it is
|
|
346
|
+
`display: contents` when shown), so in `controls`, which is a `gap-2` row itself, nothing moves; inside a
|
|
347
|
+
wider row (a `Cluster gap="md"`) the items take that row's gap, so wrap them in a `Cluster` inside the
|
|
348
|
+
`Show` to keep them together. `SideColumn asideWidth="third"` puts the narrow column on the end
|
|
349
|
+
side; a `CardGrid columns="1:2"` that had it first reorders its two children.
|
|
350
|
+
|
|
351
|
+
New, nothing to change: `Show` (with `below`, and `as="span"`), `SideColumn asideWidth="third"`
|
|
352
|
+
and `sticky`, `Stack width="compact"` (28rem, one card's width), `Stack align="start"`
|
|
353
|
+
(children keep their own width), `Stack divided` (a line between rows, no gap), and the `StackAlign`
|
|
354
|
+
and `TextLines` types. Also new: `Section size="sm"` (a small titled group) and `size="lg"` (a
|
|
355
|
+
landing page's section), `Cluster as="ul"` and `as="ol"`, `Steps size="lg"`, `SiteFooter`,
|
|
356
|
+
`DocsLayout` (with the `DocsNavGroup`, `DocsHeading` and `DocsNeighbour` types), `BulletList
|
|
357
|
+
ordered`, and `RegionFrame aspect` and `width`. `AppShell` now clears the safe-area insets, lands
|
|
358
|
+
every `id` inside it below the header, and folds a `nav` that does not fit its row into the Menu
|
|
359
|
+
from `md`: drop any `env(safe-area-inset-*)` padding and `scroll-margin-top` rule of your own.
|
|
360
|
+
|
|
361
|
+
### Running the codemod
|
|
362
|
+
|
|
363
|
+
The codemod lives in this repository at `tools/codemod` and is not published. From a checkout of
|
|
364
|
+
it, after `bun install` once, point it at the app's source folder:
|
|
365
|
+
|
|
366
|
+
```bash
|
|
367
|
+
bun <checkout>/tools/codemod/src/run.ts src # a dry run: lists what it would change
|
|
368
|
+
bun <checkout>/tools/codemod/src/run.ts src --write # rewrites the files
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
It reads every `.ts`, `.tsx`, `.js` and `.jsx` file under the folder (not `node_modules`, `dist` or
|
|
372
|
+
a `.d.ts`), and changes only elements and types imported from `@hackcove/ui-react`, an aliased or
|
|
373
|
+
namespace import included. It edits the attributes in place and leaves the rest of the file as it
|
|
374
|
+
was, so run the app's formatter after it.
|
|
375
|
+
|
|
376
|
+
Each `file:line` it prints is a **by hand** row above, on a line of the rewritten file. Work through
|
|
377
|
+
them, then typecheck: what TypeScript still flags sits on or next to a line the codemod printed. The
|
|
378
|
+
lists under "TypeScript does not flag these" are what is left to check by eye.
|
|
379
|
+
|
|
380
|
+
The pins it writes (`as="span"`, `gap="md"`, `wrap={false}`, `align="start"`) keep the 0.10 look.
|
|
381
|
+
Once the app is on 0.11, the second step takes them out: see "0.11 to 0.12: drop the pins".
|
|
382
|
+
|
|
383
|
+
## 0.11 to 0.12: drop the pins
|
|
384
|
+
|
|
385
|
+
The 0.11 codemod pinned the old look so nothing moved in the bump. Those pins are not the look
|
|
386
|
+
0.11 was designed for: drop them, in their own change, once the app is on 0.11. A second codemod
|
|
387
|
+
step does it:
|
|
388
|
+
|
|
389
|
+
```bash
|
|
390
|
+
bun <checkout>/tools/codemod/src/run.ts src --unpin # a dry run
|
|
391
|
+
bun <checkout>/tools/codemod/src/run.ts src --unpin --write # rewrites the files
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
`--unpin` runs only these rules, never the 0.11 pass, which would write every pin back. It cannot
|
|
395
|
+
tell a pin it wrote from one a person wrote, so it removes a pin only where the new default draws
|
|
396
|
+
the same thing, and prints a `file:line` for each one a person decides.
|
|
397
|
+
|
|
398
|
+
| Pin | What removing it changes | |
|
|
399
|
+
| --- | --- | --- |
|
|
400
|
+
| `Text as="span"`, `Caption as="span"` | the text is a `<p>`, a block on its own line: the same in a column, but anything inline beside it moves to the next line, and a long `Text` alone in a plain block (a `Card`, a `Callout`, a `div`) now wraps at 72 characters, the measure for reading | codemod removes it when the element sits directly in a `Stack`, `Section` or `Field`, or is the one child of a `Card`, `Dialog`, `Drawer`, `BottomSheet`, `Callout`, `Fieldset`, `div`, `section`, `article`, `main`, `header`, `footer` or `li`; anywhere else (a row, a cell, a button, a sentence, a `map`, next to a sibling in a plain block) it stays and is reported |
|
|
401
|
+
| `Stack gap="md"`, `Section gap="md"` | nothing at page level, where `md` is the default; inside a `Card`, `Dialog`, `Drawer`, `BottomSheet`, `Callout`, `ListRow` or `CenteredLayout` (which draws a `Card`) the gap closes to `xs`, the new look | codemod removes it when no such container holds it in the same file; inside one it stays and is reported, and so does a `Section` with a `size` other than `md`, whose size sets its gap. A component rendered inside a `Card` from another file takes `xs` too: the codemod reads one file at a time |
|
|
402
|
+
| `Cluster wrap={false}` | the row wraps onto a second line when it runs out of room | by hand: every one is reported, remove it unless the row must stay on one line |
|
|
403
|
+
| `align="start"` on a `numeric` `TableCell` or `TableEditCell` | the figures line up at the end of the cell | codemod removes it when `numeric` is bare or `{true}`; when `numeric` is an expression it stays and is reported |
|
|
404
|
+
| `Field htmlFor` with the control's matching `id` | nothing on screen: a `Field` makes its own id and gives it to the `Input`, `Select`, `Textarea` or `FileDrop` inside it, so the label still names the control. The control's DOM id becomes a generated one, so search the app for the old id (a stylesheet, a test selector, a link from another page) before you merge | codemod removes both when they name only each other in the file (no `aria-describedby`, `href="#…"`, `getElementById` or second use); `htmlFor={id}` with `id={id}` goes too when `id` is a `const id = useId()`, whose line is then reported as unused. An id from a prop or a `useId` that is not React's, a template string, a raw `<input>` or anything else stays and is reported. The 0.11 pass runs this rule as well, so an app still going 0.10 to 0.11 gets it in one run |
|
|
405
|
+
|
|
406
|
+
## 0.9 → 0.10: Avatar `2xl` is 64px, the old 96px is `3xl`
|
|
407
|
+
|
|
408
|
+
`Avatar` gained a 64px size. The sizes keep their order (`xs`, `sm`, `md`, `lg`, `xl`, `2xl`, `3xl`),
|
|
409
|
+
so the new one is `2xl` and the 96px one moved up to `3xl`. There is no alias, and **TypeScript does
|
|
410
|
+
not flag it**: `size="2xl"` still compiles and now draws 64px, not 96px.
|
|
411
|
+
|
|
412
|
+
1. Find every `size="2xl"` on an `Avatar` or an `AvatarStack` and write `size="3xl"`.
|
|
413
|
+
2. Where a 64px avatar was wanted all along (a local one drawn with `size-16`), use `size="2xl"`.
|
|
414
|
+
|
|
415
|
+
New, nothing to change: `Avatar` takes `onClick` (the whole avatar becomes one button, named by `name`);
|
|
416
|
+
`MediaTile` takes `aspect="natural"` and `onRemove`; `Image` takes `aspect="natural"` and `framed`
|
|
417
|
+
(a white mat that stays white in every theme). A theme of your own needs one rule for the mat, as
|
|
418
|
+
the `@slashsuite/themes` files have:
|
|
419
|
+
`.your-scope .bg-white\/100 { background-color: #ffffff; }`.
|
|
420
|
+
|
|
421
|
+
`AppShell` renders its own `<main>`, so a page inside it must not render another; a page's root is a `<div>` or a fragment.
|
|
422
|
+
|
|
423
|
+
`ColourSchemeToggle` is named by its content now, so it is right before hydration with no script: a
|
|
424
|
+
test that reads its `aria-label` attribute reads the name instead (`getByRole("button", { name })`,
|
|
425
|
+
`toHaveAccessibleName`). The name is the same; `title` appears only after hydration.
|
|
426
|
+
|
|
427
|
+
## 0.7 → 0.8: `@hackcove/ui` is now `@hackcove/ui-react`
|
|
428
|
+
|
|
429
|
+
Nothing else changed: 0.8.0 is the 0.7.1 components under a new name, so the React package pairs
|
|
430
|
+
with the React Native one that comes later (`@hackcove/ui-react-native`). There is no alias package
|
|
431
|
+
and no re-export, so the old name stays at 0.7.1.
|
|
432
|
+
|
|
433
|
+
1. Swap the dependency: `bun remove @hackcove/ui && bun add @hackcove/ui-react`.
|
|
434
|
+
2. Find and replace the import specifier `"@hackcove/ui"` with `"@hackcove/ui-react"` (and any
|
|
435
|
+
`@hackcove/ui/…` path with `@hackcove/ui-react/…`).
|
|
436
|
+
3. Change the Tailwind `@source` path to `node_modules/@hackcove/ui-react/dist`.
|
|
437
|
+
|
|
438
|
+
## 0.6 → 0.6.1: ListRow active on a panel, notices in a column, OutlineRegion
|
|
439
|
+
|
|
440
|
+
Nothing breaks; a consumer changes only what it had built for itself.
|
|
441
|
+
|
|
442
|
+
- `ListRow active` now fills the row one step deeper than hover (`bg-slate-100`), so it shows on a
|
|
443
|
+
`bg-slate-50` surface such as a `FullBleedLayout` panel. A local row drawn only to get a visible
|
|
444
|
+
focus is now `<ListRow size="sm" divided active={focused}>`.
|
|
445
|
+
- `Callout banner` is for the top of a `Card flush` only. A notice in a page's column (a
|
|
446
|
+
`FullBleedLayout`, padded or not) is a plain `Callout`, first in the column's `Stack`:
|
|
447
|
+
`<FullBleedLayout padded …><Stack gap="sm"><Callout tone="danger" role="alert">…</Callout>…</Stack></FullBleedLayout>`.
|
|
448
|
+
- New: `RegionFrame` and `OutlineRegion` mark areas of a picture. Draw the picture as
|
|
449
|
+
`<RegionFrame src={…} alt={…}>` (any `<img>` prop, such as `onLoad` or `loading`, passes on) and put
|
|
450
|
+
`<OutlineRegion rect={{ x, y, width, height }} within={{ width, height }} label="…" hatched />` inside
|
|
451
|
+
it, in the picture's own pixels. It replaces a hand-drawn box with an arbitrary colour.
|
|
452
|
+
|
|
453
|
+
## 0.5 → 0.6: one Text role, paired parts folded
|
|
454
|
+
|
|
455
|
+
`Body` is now `Text`, and `Text strong` takes over from `BodyStrong`. `Subtitle`, `Empty` and
|
|
456
|
+
`ModalHeading` were near-copies of other parts and are gone with no alias: each is one of the
|
|
457
|
+
remaining parts with a prop. TypeScript names every use; the swaps are mechanical.
|
|
458
|
+
|
|
459
|
+
| Removed or renamed | Write instead |
|
|
460
|
+
| --- | --- |
|
|
461
|
+
| `<Body>…</Body>` | `<Text>…</Text>` (same props: `as`, `color`, `tone`, `numeric`, `mono`, `truncate`, `preserveNewlines`) |
|
|
462
|
+
| `<BodyStrong>…</BodyStrong>` | `<Text strong>…</Text>` |
|
|
463
|
+
| `<Subtitle>…</Subtitle>` | `<Text as="p">…</Text>` |
|
|
464
|
+
| `<Empty>…</Empty>` | `<Text as="p" color="muted">…</Text>` |
|
|
465
|
+
| `<ModalHeading>…</ModalHeading>` | `<SectionHeading>…</SectionHeading>` |
|
|
466
|
+
|
|
467
|
+
A block of `Text` stops at a readable line length (`max-w-[72ch]`), as `Body` did. `Subtitle` and
|
|
468
|
+
`BodyStrong` had no such measure, so a long line in a wide column now wraps at about 72 characters.
|
|
469
|
+
`PageHeader` and `Dialog` draw their own subtitle and description, and keep the full width.
|
|
470
|
+
|
|
471
|
+
The small labels of `Card`, `FilterGroup` and `StatTile` now render as an `Overline`. The `Card`
|
|
472
|
+
title looks the same; a `FilterGroup` legend is semibold (it was medium) and a `StatTile` label's
|
|
473
|
+
letter spacing is `tracking-wide` (it was `tracking-wider`).
|
|
474
|
+
|
|
475
|
+
### Paired parts folded into one (HC-169)
|
|
476
|
+
|
|
477
|
+
Each pair below was one look drawn by two exports. The survivor takes a prop, the other is gone with
|
|
478
|
+
no alias, and the class-string helpers are no longer exported: a router link is drawn through
|
|
479
|
+
`render`, never by copying a class. A swap keeps the look unless its row says otherwise.
|
|
480
|
+
|
|
481
|
+
| Removed or renamed | Write instead |
|
|
482
|
+
| --- | --- |
|
|
483
|
+
| `<ButtonLink href="/new">New</ButtonLink>` | `<Button href="/new">New</Button>` (same `variant`, `size`, `tone`, `external`) |
|
|
484
|
+
| `<ButtonLink render={(p) => <Link to="/new" {...p} />}>New</ButtonLink>` | `<Button render={(p) => <Link to="/new" {...p} />}>New</Button>` |
|
|
485
|
+
| `<DatePicker label="Due" value={d} onChange={setD} />` | `<DateField calendar label="Due" value={d} onChange={setD} />` (`defaultOpen` opens the calendar on mount) |
|
|
486
|
+
| `type DatePickerProps` | `type DateFieldProps` |
|
|
487
|
+
| `<InlineLinks>{links}</InlineLinks>` | `<MetaList nowrap>{links}</MetaList>` |
|
|
488
|
+
| `<InlineLinks separator="•">{links}</InlineLinks>` | `<MetaList nowrap separator="•">{links}</MetaList>` (`"none"` as before) |
|
|
489
|
+
| `type InlineLinksSeparator` | `type MetaListSeparator` |
|
|
490
|
+
| `<NavTabs label="Main" items={nav} />` | `<Tabs variant="pill" label="Main" items={nav} />` (each item `{ label, href \| render, active? }`, as before) |
|
|
491
|
+
| `<NavTabs orientation="vertical" label="Docs" items={nav} />` | `<Tabs variant="pill" orientation="vertical" label="Docs" items={nav} />` |
|
|
492
|
+
| `type NavTab` | none: let the `items` array infer, or type it as `Tab[]` only for buttons |
|
|
493
|
+
| `navTabClass(active)` on a router link | a link item with `render={(p) => <Link to="/x" {...p} />}` |
|
|
494
|
+
| `<PageTitle title="Builds" subtitle="…" />` | `<PageHeader title="Builds" subtitle="…" />` (adds `PageHeader`'s bottom margin, none as a `Stack` child) |
|
|
495
|
+
| `<ToggleChip pressed={on} onClick={flip}>Open</ToggleChip>` | `<Button variant="outline" size="sm" pressed={on} onClick={flip}>Open</Button>` (the chip keeps its colours, neutral off and filled on; only the corner radius changes, to a `Button`'s; `dot` has no swap, name the category in the label) |
|
|
496
|
+
| `buttonClass(variant, opts)` on a router link | `<Button variant={variant} render={(p) => <Link to="/x" {...p} />}>…</Button>` |
|
|
497
|
+
| `crumbLinkClass` on a router link | a crumb `{ label, href }` or `{ label, render }` |
|
|
498
|
+
| `<Link className={rowLinkClass}>` in a row's first cell | `<TextLink stretch render={(p) => <Link to="/x" {...p} />}>…</TextLink>` |
|
|
499
|
+
| `<Link className={linkClass}>` | `<TextLink render={(p) => <Link to="/x" {...p} />}>…</TextLink>` |
|
|
500
|
+
| `<Link className={cx(linkClass, linkStretchClass)}>` | `<TextLink stretch render={(p) => <Link to="/x" {...p} />}>…</TextLink>` |
|
|
501
|
+
| `<html className={cx(schemeClass(s), appShellRootClass)}>` | `<html className={appShellRootClassFor(s)}>` (or `appShellRootClassFor("light")` for no scheme) |
|
|
502
|
+
|
|
503
|
+
`SegmentedControl` stays. `startPageTransition` stays exported: `PageFade` pages call it.
|
|
504
|
+
|
|
505
|
+
## 0.4 → 0.5: one size scale
|
|
506
|
+
|
|
507
|
+
Every `size` is now `sm`, `md` or `lg`, and `md` is the default (README, "Sizes"). TypeScript finds
|
|
508
|
+
each renamed value for you; the changed defaults it cannot, so read the second table and pin the old
|
|
509
|
+
value where the old look was the point.
|
|
510
|
+
|
|
511
|
+
### Renamed values
|
|
512
|
+
|
|
513
|
+
| Component | Old | New |
|
|
514
|
+
| --- | --- | --- |
|
|
515
|
+
| `TextLink` | `size="xs"` | `size="sm"` |
|
|
516
|
+
| `TextLink` | `size="sm"` | `size="md"` |
|
|
517
|
+
| `SubsectionHeading` | `size="base"` | `size="md"` |
|
|
518
|
+
| `Stack`, `Section`, `ProseLayout` gap | `gap="section"` | `gap="xl"` |
|
|
519
|
+
|
|
520
|
+
### Changed defaults
|
|
521
|
+
|
|
522
|
+
| Component | Old default | New default | To keep the old look |
|
|
523
|
+
| --- | --- | --- | --- |
|
|
524
|
+
| `SubsectionHeading` | `sm` | `md` (`text-base/6 font-semibold`) | `size="sm"` |
|
|
525
|
+
| `Section` gap | `sm` (`gap-4`) | `md` (`gap-6`) | `gap="sm"` |
|
|
526
|
+
| `Cluster` gap | `sm` (`gap-4`) | `xs` (`gap-2`) | `gap="sm"` |
|
|
527
|
+
| `ProgressBar` | `sm` | `md` | `size="sm"` |
|
|
528
|
+
| `SplitBar`, `StackedBar` | `lg` | `md` | `size="lg"` |
|
|
529
|
+
| `Avatar` `md` | 28px | 32px (`size-8`) | none; `sm` is 24px |
|
|
530
|
+
| `IconButton`, `ColourSchemeToggle` | 36px | 38px, the `md` control height | `size="sm"` (26px) for a row |
|
|
531
|
+
| `NavTabs`, `Tabs variant="pill"` | 32px | 38px, the `md` control height | `size="sm"` |
|
|
532
|
+
|
|
533
|
+
### New sizes
|
|
534
|
+
|
|
535
|
+
- `lg` on `Button`, `ButtonLink`, `Input` (also `type="search"`), `Select`, `Textarea`, `Checkbox`,
|
|
536
|
+
`Card`, `ListRow`, `FileDrop` and `TextLink`; `lg` on `Dialog` is 640px wide.
|
|
537
|
+
- A `size` prop on `RadioGroup`, `DatePicker`, `DateField`, `IconButton`, `ColourSchemeToggle`,
|
|
538
|
+
`SegmentedControl`, `NavTabs` and `Tabs variant="pill"`.
|
|
539
|
+
- `ToggleChip` takes `size` and defaults to `sm`, its look before; `md` and `lg` match a `Button`.
|
|
540
|
+
- `Size` is exported; `ControlSize` is now an alias of it.
|