@setsquare/ui 0.2.4 → 0.5.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.
Files changed (71) hide show
  1. package/CHANGELOG.md +132 -0
  2. package/NOTICE +1 -1
  3. package/README.md +17 -7
  4. package/dist/index.d.ts +11 -4
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +5 -1
  7. package/dist/index.js.map +1 -1
  8. package/dist/lib/page-items.d.ts +10 -0
  9. package/dist/lib/page-items.d.ts.map +1 -0
  10. package/dist/lib/page-items.js +26 -0
  11. package/dist/lib/page-items.js.map +1 -0
  12. package/dist/lint/index.d.ts +5 -0
  13. package/dist/lint/index.d.ts.map +1 -1
  14. package/dist/lint/index.js +84 -3
  15. package/dist/lint/index.js.map +1 -1
  16. package/dist/shell/sidebar.d.ts +23 -0
  17. package/dist/shell/sidebar.d.ts.map +1 -1
  18. package/dist/shell/sidebar.js +22 -3
  19. package/dist/shell/sidebar.js.map +1 -1
  20. package/dist/styles/theme.css +550 -0
  21. package/dist/styles/tokens.css +17 -0
  22. package/dist/testing/index.d.ts +57 -2
  23. package/dist/testing/index.d.ts.map +1 -1
  24. package/dist/testing/index.js +276 -11
  25. package/dist/testing/index.js.map +1 -1
  26. package/dist/tokens.json +45 -0
  27. package/dist/ui/breadcrumbs.d.ts +9 -1
  28. package/dist/ui/breadcrumbs.d.ts.map +1 -1
  29. package/dist/ui/breadcrumbs.js +3 -3
  30. package/dist/ui/breadcrumbs.js.map +1 -1
  31. package/dist/ui/button-styles.d.ts.map +1 -1
  32. package/dist/ui/button-styles.js +16 -6
  33. package/dist/ui/button-styles.js.map +1 -1
  34. package/dist/ui/combo-box.d.ts +6 -1
  35. package/dist/ui/combo-box.d.ts.map +1 -1
  36. package/dist/ui/combo-box.js +2 -2
  37. package/dist/ui/combo-box.js.map +1 -1
  38. package/dist/ui/drop-indicator.d.ts +21 -0
  39. package/dist/ui/drop-indicator.d.ts.map +1 -0
  40. package/dist/ui/drop-indicator.js +20 -0
  41. package/dist/ui/drop-indicator.js.map +1 -0
  42. package/dist/ui/feature-card.d.ts.map +1 -1
  43. package/dist/ui/feature-card.js.map +1 -1
  44. package/dist/ui/grid-list.d.ts +10 -3
  45. package/dist/ui/grid-list.d.ts.map +1 -1
  46. package/dist/ui/grid-list.js +18 -7
  47. package/dist/ui/grid-list.js.map +1 -1
  48. package/dist/ui/pagination.d.ts +69 -14
  49. package/dist/ui/pagination.d.ts.map +1 -1
  50. package/dist/ui/pagination.js +177 -32
  51. package/dist/ui/pagination.js.map +1 -1
  52. package/dist/ui/switch.d.ts +2 -1
  53. package/dist/ui/switch.d.ts.map +1 -1
  54. package/dist/ui/switch.js +5 -2
  55. package/dist/ui/switch.js.map +1 -1
  56. package/dist/ui/tabs.d.ts +82 -15
  57. package/dist/ui/tabs.d.ts.map +1 -1
  58. package/dist/ui/tabs.js +274 -16
  59. package/dist/ui/tabs.js.map +1 -1
  60. package/dist/ui/time-of-day-icon.d.ts.map +1 -1
  61. package/dist/ui/time-of-day-icon.js.map +1 -1
  62. package/dist/ui/toolbar.d.ts +22 -0
  63. package/dist/ui/toolbar.d.ts.map +1 -0
  64. package/dist/ui/toolbar.js +22 -0
  65. package/dist/ui/toolbar.js.map +1 -0
  66. package/dist/ui/tree.d.ts +98 -0
  67. package/dist/ui/tree.d.ts.map +1 -0
  68. package/dist/ui/tree.js +75 -0
  69. package/dist/ui/tree.js.map +1 -0
  70. package/package.json +21 -25
  71. package/templates/next/page-transition.tsx +1 -1
@@ -0,0 +1,98 @@
1
+ import type { ReactNode } from 'react';
2
+ import { TreeSection as RACTreeSection, type TreeItemProps as RACTreeItemProps, type TreeProps as RACTreeProps } from 'react-aria-components';
3
+ import { type IconProp } from './icon.js';
4
+ /** A tree is named by a visible heading (`aria-labelledby`) or, when it has none, by `aria-label`. */
5
+ type TreeName = {
6
+ 'aria-label': string;
7
+ } | {
8
+ 'aria-labelledby': string;
9
+ };
10
+ export type TreeProps<T extends object> = Omit<RACTreeProps<T>, 'className' | 'aria-label' | 'aria-labelledby'> & TreeName & {
11
+ className?: string;
12
+ };
13
+ /**
14
+ * Nested things people open, close and act on: the blocks of a page, the steps of a workflow and their outcomes,
15
+ * operations grouped by resource. React Aria's Tree, a `treegrid` and one tab stop. ↑ ↓ move between rows, → opens a
16
+ * row and ← closes it, Home and End go to the ends, and typing jumps to the next row whose name starts with what you
17
+ * typed. On an open row, → moves to the row's own buttons.
18
+ *
19
+ * It draws no box of its own: rows sit on whatever surface holds the tree (a panel, a card), `--nav-item-gap`
20
+ * apart, like a nav list. The tree is `relative` because it scrolls, and because React Aria positions its drop
21
+ * indicators absolutely.
22
+ *
23
+ * Drag and drop: pass `dragAndDropHooks` from React Aria's `useDragAndDrop`, with
24
+ * `renderDropIndicator: (target) => <DropIndicator target={target} />`. Every draggable row then shows a drag
25
+ * button, which is how a keyboard or screen reader drag starts: Enter on it, ↑ ↓ to a drop place, Enter to drop,
26
+ * Esc to cancel.
27
+ */
28
+ export declare function Tree<T extends object>({ className, ...props }: TreeProps<T>): import("react").JSX.Element;
29
+ export interface TreeItemProps<T extends object = object> extends Omit<RACTreeItemProps<T>, 'className' | 'children' | 'textValue' | 'style'> {
30
+ /** What the row is called. A string is also its `textValue`. */
31
+ title: ReactNode;
32
+ /** Required when `title` isn't a string: the words typeahead matches and a screen reader reads. */
33
+ textValue?: string;
34
+ /** What kind of thing the row is: a block's type, a step's verb. 16px, `brand` while the row is selected. */
35
+ icon?: IconProp;
36
+ /**
37
+ * A few words after the title, on the same line: a block's heading, a count. When they don't fit beside the
38
+ * title they move under it and wrap there. They're never cut short, so text spacing and zoom lose none of them
39
+ * (1.4.12). A string is added to the row's accessible name, so the words are never only seen.
40
+ */
41
+ description?: ReactNode;
42
+ /**
43
+ * A `StatusBadge` for this row: a check result ("2nd H1"), a draft, a lock. It sits after the description,
44
+ * before the actions. Always an icon and a word.
45
+ */
46
+ status?: ReactNode;
47
+ /**
48
+ * The status in words for a screen reader ("2nd H1, must fix"). React Aria names a row from its `textValue`
49
+ * alone, so without this the status is only seen, never heard. Added to the row's name after the description.
50
+ */
51
+ statusLabel?: string;
52
+ /**
53
+ * Buttons for this row only. Name them with the row ("Actions for Fixtures"). They show on the selected row,
54
+ * the row with focus and the row under the pointer, so the tree stays quiet; keyboard focus on a row shows them
55
+ * before → reaches them. `alwaysShowActions` keeps them showing, for a row that can't be selected.
56
+ */
57
+ actions?: ReactNode;
58
+ alwaysShowActions?: boolean;
59
+ /** The rows inside this one: `TreeItem`s, or a React Aria `Collection` of them. */
60
+ children?: ReactNode;
61
+ /** Words for the drag button, when the row can be dragged. React Aria's own ("Drag {title}") by default. */
62
+ dragLabel?: string;
63
+ /**
64
+ * `false` leaves the drag button off a row that can't move, such as a column in a page layout, in a tree that
65
+ * otherwise drags. React Aria has no per-row switch for dragging (only for `disabledBehavior="all"`, which also
66
+ * takes the row out of focus), so the tree's `getItems` should give such a row a type its drop targets refuse.
67
+ */
68
+ allowsDragging?: boolean;
69
+ className?: string;
70
+ }
71
+ /**
72
+ * One row and the rows inside it, on one line while it fits: chevron, icon, title, description, status, then its
73
+ * buttons. Each level indents by `--tree-indent` (16px). A row is at least `--nav-item-height` tall and `--target-min` at AAA,
74
+ * rounded, with the `accent` ground on hover. Selected: `brand-subtle`, the 3px `sidebar-primary` marker, a bold
75
+ * title and a `brand` icon, as in a GridList and the sidebar; with multiple selection, a ticked box too.
76
+ *
77
+ * A row that only holds other rows, such as a column in a page layout, can be focused and opened but never
78
+ * selected: put its id in the Tree's `disabledKeys` and set `disabledBehavior="selection"`. React Aria then
79
+ * leaves it focusable and doesn't mark it disabled, so it isn't dimmed.
80
+ *
81
+ * While a drag is over the row, as a place to drop into, it gets the `brand-subtle` ground and a 2px `brand`
82
+ * outline inside its edge. The row being dragged fades to 50%.
83
+ */
84
+ export declare function TreeItem<T extends object = object>({ title, textValue, icon, description, status, statusLabel, actions, alwaysShowActions, children, dragLabel, allowsDragging: rowDrags, className, ...props }: TreeItemProps<T>): import("react").JSX.Element;
85
+ /** React Aria doesn't export its TreeSection's props by name. */
86
+ type RACTreeSectionProps<T extends object> = Parameters<typeof RACTreeSection<T>>[0];
87
+ export interface TreeSectionProps<T extends object> extends Omit<RACTreeSectionProps<T>, 'className'> {
88
+ className?: string;
89
+ }
90
+ /** A group of top-level rows under a `TreeHeader`: operations by resource, steps by phase. */
91
+ export declare function TreeSection<T extends object>({ className, ...props }: TreeSectionProps<T>): import("react").JSX.Element;
92
+ /** The name of a `TreeSection`, read before its rows. Not a target: arrow keys pass over it. */
93
+ export declare function TreeHeader({ children, className }: {
94
+ children: ReactNode;
95
+ className?: string;
96
+ }): import("react").JSX.Element;
97
+ export {};
98
+ //# sourceMappingURL=tree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../../src/ui/tree.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,EAML,WAAW,IAAI,cAAc,EAC7B,KAAK,aAAa,IAAI,gBAAgB,EACtC,KAAK,SAAS,IAAI,YAAY,EAC/B,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAc,KAAK,QAAQ,EAAE,MAAM,WAAW,CAAC;AAEtD,sGAAsG;AACtG,KAAK,QAAQ,GAAG;IAAE,YAAY,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,iBAAiB,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzE,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,MAAM,IAAI,IAAI,CAC5C,YAAY,CAAC,CAAC,CAAC,EACf,WAAW,GAAG,YAAY,GAAG,iBAAiB,CAC/C,GACC,QAAQ,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,EAAE,EAAE,SAAS,EAAE,GAA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AAC;AAErF,MAAM,WAAW,gBAAgB,CAAC,CAAC,SAAS,MAAM,CAAE,SAAQ,IAAI,CAC9D,mBAAmB,CAAC,CAAC,CAAC,EACtB,WAAW,CACZ;IACC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,8FAA8F;AAC9F,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,CAAC,CAAC,CAAC,+BAEzF;AAED,gGAAgG;AAChG,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,+BAW9F"}
@@ -0,0 +1,75 @@
1
+ 'use client';
2
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { ChevronRight, GripVertical } from 'lucide-react';
4
+ import { Button as RACButton, Tree as RACTree, TreeHeader as RACTreeHeader, TreeItem as RACTreeItem, TreeItemContent, TreeSection as RACTreeSection, } from 'react-aria-components';
5
+ import { cn } from '../lib/cn.js';
6
+ import { SelectionCheckbox } from './checkbox.js';
7
+ import { renderIcon } from './icon.js';
8
+ /**
9
+ * Nested things people open, close and act on: the blocks of a page, the steps of a workflow and their outcomes,
10
+ * operations grouped by resource. React Aria's Tree, a `treegrid` and one tab stop. ↑ ↓ move between rows, → opens a
11
+ * row and ← closes it, Home and End go to the ends, and typing jumps to the next row whose name starts with what you
12
+ * typed. On an open row, → moves to the row's own buttons.
13
+ *
14
+ * It draws no box of its own: rows sit on whatever surface holds the tree (a panel, a card), `--nav-item-gap`
15
+ * apart, like a nav list. The tree is `relative` because it scrolls, and because React Aria positions its drop
16
+ * indicators absolutely.
17
+ *
18
+ * Drag and drop: pass `dragAndDropHooks` from React Aria's `useDragAndDrop`, with
19
+ * `renderDropIndicator: (target) => <DropIndicator target={target} />`. Every draggable row then shows a drag
20
+ * button, which is how a keyboard or screen reader drag starts: Enter on it, ↑ ↓ to a drop place, Enter to drop,
21
+ * Esc to cancel.
22
+ */
23
+ export function Tree({ className, ...props }) {
24
+ return (_jsx(RACTree, { ...props, className: cn('relative flex max-h-[inherit] flex-col gap-(--nav-item-gap) overflow-auto text-sm outline-none data-focus-visible:focus-ring',
25
+ // Dropping onto the tree itself (an empty tree, or the end of it).
26
+ 'data-drop-target:bg-brand-subtle data-drop-target:outline-2 data-drop-target:outline-solid data-drop-target:outline-brand data-drop-target:-outline-offset-2', className) }));
27
+ }
28
+ /** The column the chevron, or the space for one, takes: one target wide, so every title lines up. */
29
+ const lead = 'w-[max(var(--target-min),var(--control-height-sm))] shrink-0';
30
+ /**
31
+ * One row and the rows inside it, on one line while it fits: chevron, icon, title, description, status, then its
32
+ * buttons. Each level indents by `--tree-indent` (16px). A row is at least `--nav-item-height` tall and `--target-min` at AAA,
33
+ * rounded, with the `accent` ground on hover. Selected: `brand-subtle`, the 3px `sidebar-primary` marker, a bold
34
+ * title and a `brand` icon, as in a GridList and the sidebar; with multiple selection, a ticked box too.
35
+ *
36
+ * A row that only holds other rows, such as a column in a page layout, can be focused and opened but never
37
+ * selected: put its id in the Tree's `disabledKeys` and set `disabledBehavior="selection"`. React Aria then
38
+ * leaves it focusable and doesn't mark it disabled, so it isn't dimmed.
39
+ *
40
+ * While a drag is over the row, as a place to drop into, it gets the `brand-subtle` ground and a 2px `brand`
41
+ * outline inside its edge. The row being dragged fades to 50%.
42
+ */
43
+ export function TreeItem({ title, textValue, icon, description, status, statusLabel, actions, alwaysShowActions, children, dragLabel, allowsDragging: rowDrags = true, className, ...props }) {
44
+ const text = textValue ?? (typeof title === 'string' ? title : '');
45
+ const named = [
46
+ props['aria-label'] ?? text,
47
+ typeof description === 'string' ? description : '',
48
+ statusLabel ?? '',
49
+ ]
50
+ .filter(Boolean)
51
+ .join(', ');
52
+ return (_jsxs(RACTreeItem, { ...props, textValue: text, "aria-label": named || undefined, style: ({ level }) => ({ '--tree-level': level }), className: cn(
53
+ // React Aria sets data-hovered only on a row that can be selected or has an action: the pointer then.
54
+ 'group/tree-item relative flex min-h-[max(var(--target-min),var(--nav-item-height))] cursor-default items-center gap-0.5 rounded-md py-1 ps-[calc((var(--tree-level)-1)*var(--tree-indent))] pe-1 outline-none', 'data-hovered:cursor-pointer data-disabled:cursor-not-allowed data-hovered:bg-accent data-selected:bg-brand-subtle data-selected:shadow-[inset_3px_0_0_var(--sidebar-primary)] data-focus-visible:focus-ring-inset data-disabled:opacity-60', 'data-dragging:opacity-50 data-drop-target:bg-brand-subtle data-drop-target:outline-2 data-drop-target:outline-solid data-drop-target:outline-brand data-drop-target:-outline-offset-2',
55
+ // Forced colours drop the selected ground and the inset marker: draw the marker in Highlight instead.
56
+ "forced-colors:data-selected:before:absolute forced-colors:data-selected:before:inset-y-1 forced-colors:data-selected:before:start-0 forced-colors:data-selected:before:w-[3px] forced-colors:data-selected:before:bg-[Highlight] forced-colors:data-selected:before:forced-color-adjust-none forced-colors:data-selected:before:content-['']", className), children: [_jsx(TreeItemContent, { children: ({ hasChildItems, selectionMode, selectionBehavior, allowsDragging: treeDrags }) => {
57
+ const allowsDragging = treeDrags && rowDrags;
58
+ return (_jsxs(_Fragment, { children: [hasChildItems ? (_jsx(RACButton, { slot: "chevron", className: cn('group/tree-chevron relative flex min-h-target cursor-pointer items-center justify-center outline-none', lead), children: _jsx("span", { className: "flex size-control-sm items-center justify-center rounded-md text-muted-foreground group-data-hovered/tree-chevron:bg-muted group-data-hovered/tree-chevron:text-foreground", children: _jsx(ChevronRight, { "aria-hidden": "true", className: "size-4 group-data-expanded/tree-item:rotate-90" }) }) })) : (_jsx("span", { "aria-hidden": "true", className: lead })), selectionMode === 'multiple' && selectionBehavior === 'toggle' && (_jsx(SelectionCheckbox, {})), _jsxs("span", { className: "flex min-w-0 flex-1 flex-wrap items-center gap-x-2 px-2", children: [icon &&
59
+ renderIcon(icon, 'size-4 shrink-0 text-muted-foreground group-data-selected/tree-item:text-brand'), _jsx("span", { className: "min-w-0 leading-5 font-semibold [overflow-wrap:anywhere] text-foreground group-data-selected/tree-item:font-bold", children: title }), description && (_jsx("span", { className: "min-w-0 leading-5 [overflow-wrap:anywhere] text-muted-foreground", children: description })), status && (_jsx("span", { className: "flex flex-wrap items-center gap-1", children: status }))] }), (actions || allowsDragging) && (_jsxs("span", { className: cn('flex shrink-0 items-center gap-0.5', !alwaysShowActions &&
60
+ // Faded out, not hidden: they stay focusable, so focus can land on them (and shows
61
+ // them) and React Aria can hand focus back to the drag button when a drag ends. No
62
+ // pointer events until they show: group-hover needs a device that hovers, so on touch
63
+ // a tap selects the row first.
64
+ 'pointer-events-none opacity-0', 'group-hover/tree-item:pointer-events-auto group-hover/tree-item:opacity-100', 'group-focus-within/tree-item:pointer-events-auto group-focus-within/tree-item:opacity-100', 'group-data-selected/tree-item:pointer-events-auto group-data-selected/tree-item:opacity-100', 'group-data-dragging/tree-item:opacity-100'), children: [allowsDragging && (_jsx(RACButton, { slot: "drag", "aria-label": dragLabel, className: "group/tree-drag relative flex min-h-target min-w-target shrink-0 cursor-grab items-center justify-center outline-none", children: _jsx("span", { className: "flex size-control-sm items-center justify-center rounded-md text-muted-foreground group-data-focus-visible/tree-drag:focus-ring group-data-hovered/tree-drag:bg-muted group-data-hovered/tree-drag:text-foreground", children: _jsx(GripVertical, { "aria-hidden": "true", className: "size-4" }) }) })), actions] }))] }));
65
+ } }), children] }));
66
+ }
67
+ /** A group of top-level rows under a `TreeHeader`: operations by resource, steps by phase. */
68
+ export function TreeSection({ className, ...props }) {
69
+ return _jsx(RACTreeSection, { ...props, className: className });
70
+ }
71
+ /** The name of a `TreeSection`, read before its rows. Not a target: arrow keys pass over it. */
72
+ export function TreeHeader({ children, className }) {
73
+ return (_jsx(RACTreeHeader, { className: cn('px-3 pt-3 pb-1 text-caption-strong text-muted-foreground first:pt-1', className), children: children }));
74
+ }
75
+ //# sourceMappingURL=tree.js.map
@@ -0,0 +1 @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,kEAAkE,YAC/E,WAAW,GACP,CACR,EACA,MAAM,IAAI,CAGT,eAAM,SAAS,EAAC,mCAAmC,YAAE,MAAM,GAAQ,CACpE,IACI,EACN,CAAC,OAAO,IAAI,cAAc,CAAC,IAAI,CAC9B,gBACE,SAAS,EAAE,EAAE,CACX,oCAAoC,EACpC,CAAC,iBAAiB;oCAChB,mFAAmF;oCACnF,mFAAmF;oCACnF,sFAAsF;oCACtF,+BAA+B;oCAC/B,+BAA+B,EACjC,6EAA6E,EAC7E,2FAA2F,EAC3F,6FAA6F,EAC7F,2CAA2C,CAC5C,aAEA,cAAc,IAAI,CACjB,KAAC,SAAS,IACR,IAAI,EAAC,MAAM,gBACC,SAAS,EACrB,SAAS,EAAC,uHAAuH,YAEjI,eAAM,SAAS,EAAC,oNAAoN,YAClO,KAAC,YAAY,mBAAa,MAAM,EAAC,SAAS,EAAC,QAAQ,GAAG,GACjD,GACG,CACb,EACA,OAAO,IACH,CACR,IACA,CACJ,CAAC;gBACJ,CAAC,GACe,EACjB,QAAQ,IACG,CACf,CAAC;AACJ,CAAC;AAYD,8FAA8F;AAC9F,MAAM,UAAU,WAAW,CAAmB,EAAE,SAAS,EAAE,GAAG,KAAK,EAAuB;IACxF,OAAO,KAAC,cAAc,OAAK,KAAK,EAAE,SAAS,EAAE,SAAS,GAAI,CAAC;AAC7D,CAAC;AAED,gGAAgG;AAChG,MAAM,UAAU,UAAU,CAAC,EAAE,QAAQ,EAAE,SAAS,EAA+C;IAC7F,OAAO,CACL,KAAC,aAAa,IACZ,SAAS,EAAE,EAAE,CACX,qEAAqE,EACrE,SAAS,CACV,YAEA,QAAQ,GACK,CACjB,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@setsquare/ui",
3
- "version": "0.2.4",
3
+ "version": "0.5.0",
4
4
  "description": "React Aria components, design tokens, a dashboard shell and a site shell, with a switch between WCAG 2.2 AA and AAA sizing, spacing and contrast.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/Worktree-Amigos/setsquare-ui#readme",
@@ -11,7 +11,6 @@
11
11
  "type": "git",
12
12
  "url": "git+https://github.com/Worktree-Amigos/setsquare-ui.git"
13
13
  },
14
- "packageManager": "pnpm@11.21.0",
15
14
  "type": "module",
16
15
  "main": "./dist/index.js",
17
16
  "types": "./dist/index.d.ts",
@@ -59,29 +58,11 @@
59
58
  "wcag",
60
59
  "nextjs"
61
60
  ],
62
- "scripts": {
63
- "build": "node scripts/build-css.mjs && tsc -p tsconfig.json",
64
- "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.test.json",
65
- "typecheck:react18": "node scripts/typecheck-react18.mjs",
66
- "lint": "oxlint && node scripts/check-contrast.mjs",
67
- "format": "oxfmt",
68
- "format:check": "oxfmt --check",
69
- "test": "vitest run",
70
- "test:browser": "node test/browser/run.mjs",
71
- "docs:build": "node scripts/build-docs.mjs",
72
- "package:verify": "node scripts/verify-package.mjs",
73
- "ci:local": "node scripts/ci-local.mjs",
74
- "test:axe": "node test/browser/axe.mjs",
75
- "docs:site": "pnpm --filter @setsquare/ui-docs dev",
76
- "docs:site:build": "pnpm --filter @setsquare/ui-docs build",
77
- "test:site": "node test/site/pages.mjs",
78
- "test:setsquare": "node test/setsquare/run.mjs"
79
- },
80
61
  "peerDependencies": {
81
62
  "@internationalized/date": "^3.12.4",
82
- "react": ">=18.3.0",
63
+ "react": ">=19.2.0",
83
64
  "react-aria-components": "^1.21.1",
84
- "react-dom": ">=18.3.0",
65
+ "react-dom": ">=19.2.0",
85
66
  "tailwindcss": "^4.3.0"
86
67
  },
87
68
  "peerDependenciesMeta": {
@@ -110,15 +91,30 @@
110
91
  "oxfmt": "0.70.0",
111
92
  "oxlint": "1.85.0",
112
93
  "react": "19.3.0",
113
- "react-18": "npm:react@18.3.1",
114
94
  "react-aria-components": "1.21.1",
115
95
  "react-dom": "19.3.0",
116
- "react-dom-18": "npm:react-dom@18.3.1",
117
96
  "tailwindcss": "4.3.3",
118
97
  "typescript": "7.0.2",
119
98
  "vitest": "5.0.2"
120
99
  },
121
100
  "publishConfig": {
122
101
  "access": "public"
102
+ },
103
+ "scripts": {
104
+ "build": "node scripts/build-css.mjs && tsc -p tsconfig.json && pnpm --filter @setsquare/ui-flows build && pnpm --filter @setsquare/ui-blocks build",
105
+ "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.test.json && pnpm --filter @setsquare/ui-flows typecheck && pnpm --filter @setsquare/ui-blocks typecheck",
106
+ "lint": "oxlint && node scripts/check-contrast.mjs",
107
+ "format": "oxfmt",
108
+ "format:check": "oxfmt --check",
109
+ "test": "vitest run",
110
+ "test:browser": "node test/browser/run.mjs",
111
+ "docs:build": "node scripts/build-docs.mjs",
112
+ "package:verify": "node scripts/verify-package.mjs",
113
+ "ci:local": "node scripts/ci-local.mjs",
114
+ "test:axe": "node test/browser/axe.mjs",
115
+ "docs:site": "pnpm --filter @setsquare/ui-docs dev",
116
+ "docs:site:build": "pnpm --filter @setsquare/ui-docs build",
117
+ "test:site": "node test/site/pages.mjs",
118
+ "test:setsquare": "node test/setsquare/run.mjs"
123
119
  }
124
- }
120
+ }
@@ -1,4 +1,4 @@
1
- // Next.js only (React 19.3+): not part of the design-system bundle, which runs on React 18.
1
+ // Next.js only (React 19.3+, for <ViewTransition>): not part of the design-system bundle.
2
2
  // Wrap each page.tsx's ShellMain — <PageTransition><ShellMain>…</ShellMain></PageTransition> — never the other way
3
3
  // round: a ViewTransition only enters and exits if it comes before every DOM node, and ShellMain is a <main>.
4
4
  // Never in a layout.tsx either, where enter and exit never fire.