@setsquare/ui 0.2.3 → 0.4.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 +71 -0
- package/NOTICE +1 -1
- package/README.md +13 -6
- package/dist/index.d.ts +10 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/page-items.d.ts +10 -0
- package/dist/lib/page-items.d.ts.map +1 -0
- package/dist/lib/page-items.js +26 -0
- package/dist/lib/page-items.js.map +1 -0
- package/dist/lint/index.d.ts.map +1 -1
- package/dist/lint/index.js +4 -0
- package/dist/lint/index.js.map +1 -1
- package/dist/shell/sidebar.d.ts +23 -0
- package/dist/shell/sidebar.d.ts.map +1 -1
- package/dist/shell/sidebar.js +22 -3
- package/dist/shell/sidebar.js.map +1 -1
- package/dist/styles/theme.css +655 -0
- package/dist/styles/tokens.css +9 -0
- package/dist/testing/index.d.ts +3 -2
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +30 -2
- package/dist/testing/index.js.map +1 -1
- package/dist/tokens.json +25 -0
- package/dist/ui/feature-card.d.ts +85 -0
- package/dist/ui/feature-card.d.ts.map +1 -0
- package/dist/ui/feature-card.js +65 -0
- package/dist/ui/feature-card.js.map +1 -0
- package/dist/ui/pagination.d.ts +69 -14
- package/dist/ui/pagination.d.ts.map +1 -1
- package/dist/ui/pagination.js +177 -32
- package/dist/ui/pagination.js.map +1 -1
- package/dist/ui/tabs.d.ts +82 -15
- package/dist/ui/tabs.d.ts.map +1 -1
- package/dist/ui/tabs.js +274 -16
- package/dist/ui/tabs.js.map +1 -1
- package/dist/ui/time-of-day-icon.d.ts +18 -0
- package/dist/ui/time-of-day-icon.d.ts.map +1 -0
- package/dist/ui/time-of-day-icon.js +26 -0
- package/dist/ui/time-of-day-icon.js.map +1 -0
- package/dist/ui/tree.d.ts +53 -0
- package/dist/ui/tree.d.ts.map +1 -0
- package/dist/ui/tree.js +36 -0
- package/dist/ui/tree.js.map +1 -0
- package/package.json +21 -25
- package/templates/next/page-transition.tsx +1 -1
package/dist/ui/tabs.js
CHANGED
|
@@ -1,37 +1,295 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
2
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { createContext, useCallback, useContext, useEffect, useRef, useState, } from 'react';
|
|
5
|
+
import { Tab as RACTab, TabList as RACTabList, TabListStateContext, TabPanel as RACTabPanel, Tabs as RACTabs, } from 'react-aria-components';
|
|
4
6
|
import { cn } from '../lib/cn.js';
|
|
7
|
+
import { fill, withLabels } from '../lib/labels.js';
|
|
8
|
+
import { renderIcon } from './icon.js';
|
|
9
|
+
const tabsLabels = {
|
|
10
|
+
count: ', {count}',
|
|
11
|
+
badge: ', {badge}',
|
|
12
|
+
tipCount: '{name} ({count})',
|
|
13
|
+
tipBadge: '{name} · {badge}',
|
|
14
|
+
badgeRise: '{name}: {badge}',
|
|
15
|
+
};
|
|
16
|
+
const SharedContext = createContext(null);
|
|
17
|
+
const TravelContext = createContext({ moved: false, direction: 'forward' });
|
|
18
|
+
/** React 19.2's `<Activity>`. A canvas that renders the bundle with React 18 has none; there the panel's `hidden`. */
|
|
19
|
+
const Activity = React.Activity ?? (({ children }) => _jsx(_Fragment, { children: children }));
|
|
20
|
+
/** Below this width a vertical tablist becomes a row above its panel (1.4.10). */
|
|
21
|
+
const RAIL_MIN = 480;
|
|
5
22
|
/**
|
|
6
23
|
* Views of the same thing, one at a time: a TabList and a TabPanel for each tab. Arrow keys move between tabs and
|
|
7
24
|
* show each as focus reaches it; Tab moves on to the panel. Use them for peers people switch between, not for
|
|
8
25
|
* steps in order (that's a form) or for navigation between pages (that's links).
|
|
26
|
+
*
|
|
27
|
+
* `orientation="vertical"` puts the tabs in a rail beside the panel. Narrower than 480px the rail becomes a row
|
|
28
|
+
* above it, and the arrow keys and `aria-orientation` follow.
|
|
9
29
|
*/
|
|
10
|
-
export function Tabs({ className, ...props }) {
|
|
11
|
-
|
|
30
|
+
export function Tabs({ display = 'expanding', hiddenPanels = 'visited', orientation = 'horizontal', onBadgeClear, announceBadges = false, labels: given, className, children, ...props }) {
|
|
31
|
+
const ref = useRef(null);
|
|
32
|
+
const [narrow, setNarrow] = useState(false);
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
const el = ref.current;
|
|
35
|
+
if (orientation !== 'vertical' || !el || typeof ResizeObserver === 'undefined')
|
|
36
|
+
return;
|
|
37
|
+
const observer = new ResizeObserver(([entry]) => {
|
|
38
|
+
const width = entry?.contentRect.width ?? el.clientWidth;
|
|
39
|
+
setNarrow(width > 0 && width < RAIL_MIN);
|
|
40
|
+
});
|
|
41
|
+
observer.observe(el);
|
|
42
|
+
return () => observer.disconnect();
|
|
43
|
+
}, [orientation]);
|
|
44
|
+
const effective = orientation === 'vertical' && !narrow ? 'vertical' : 'horizontal';
|
|
45
|
+
const [tip, setTipState] = useState(null);
|
|
46
|
+
const tipClosed = useRef(0);
|
|
47
|
+
const setTip = useCallback((id) => setTipState((open) => {
|
|
48
|
+
if (id == null && open != null)
|
|
49
|
+
tipClosed.current = Date.now();
|
|
50
|
+
return id;
|
|
51
|
+
}), []);
|
|
52
|
+
const closeTip = useCallback((id) => setTipState((open) => {
|
|
53
|
+
if (open !== id)
|
|
54
|
+
return open;
|
|
55
|
+
tipClosed.current = Date.now();
|
|
56
|
+
return null;
|
|
57
|
+
}), []);
|
|
58
|
+
// Escape closes a tooltip wherever focus is (1.4.13).
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
if (tip == null)
|
|
61
|
+
return;
|
|
62
|
+
const onKey = (e) => {
|
|
63
|
+
if (e.key === 'Escape')
|
|
64
|
+
setTip(null);
|
|
65
|
+
};
|
|
66
|
+
document.addEventListener('keydown', onKey);
|
|
67
|
+
return () => document.removeEventListener('keydown', onKey);
|
|
68
|
+
}, [tip, setTip]);
|
|
69
|
+
const [message, setMessage] = useState('');
|
|
70
|
+
const shared = {
|
|
71
|
+
display,
|
|
72
|
+
hiddenPanels,
|
|
73
|
+
orientation: effective,
|
|
74
|
+
labels: withLabels(tabsLabels, given),
|
|
75
|
+
onBadgeClear,
|
|
76
|
+
announce: (text) => announceBadges && setMessage(text),
|
|
77
|
+
tip,
|
|
78
|
+
setTip,
|
|
79
|
+
closeTip,
|
|
80
|
+
tipClosed,
|
|
81
|
+
};
|
|
82
|
+
return (_jsxs(RACTabs, { ...props, ref: ref, orientation: effective, className: cn('relative flex', effective === 'vertical' ? 'flex-row items-start gap-7' : 'flex-col gap-5', className), children: [_jsx(SharedContext.Provider, { value: shared, children: _jsx(TravelTracker, { children: children }) }), announceBadges && (_jsx("span", { role: "status", className: "sr-only", children: message }))] }));
|
|
83
|
+
}
|
|
84
|
+
/** Which way the selection last moved, so the panel can come in from that side. */
|
|
85
|
+
function TravelTracker({ children }) {
|
|
86
|
+
const state = useContext(TabListStateContext);
|
|
87
|
+
const key = state?.selectedKey ?? null;
|
|
88
|
+
const [seen, setSeen] = useState({ key, from: null });
|
|
89
|
+
if (state && seen.key !== key)
|
|
90
|
+
setSeen({ key, from: seen.key });
|
|
91
|
+
const index = (k) => (k == null ? -1 : (state?.collection.getItem(k)?.index ?? -1));
|
|
92
|
+
const travel = {
|
|
93
|
+
moved: seen.from != null,
|
|
94
|
+
direction: index(seen.key) >= index(seen.from) ? 'forward' : 'back',
|
|
95
|
+
};
|
|
96
|
+
return _jsx(TravelContext.Provider, { value: travel, children: children });
|
|
97
|
+
}
|
|
98
|
+
function useShared() {
|
|
99
|
+
const shared = useContext(SharedContext);
|
|
100
|
+
if (!shared)
|
|
101
|
+
throw new Error('TabList, Tab and TabPanel go inside Tabs.');
|
|
102
|
+
return shared;
|
|
12
103
|
}
|
|
13
104
|
/**
|
|
14
|
-
* The
|
|
15
|
-
*
|
|
105
|
+
* The tabs. In a row they wrap rather than scroll when they don't fit, so no tab is ever hidden off the edge at
|
|
106
|
+
* 320px (1.4.10). In a rail they are 104px wide tiles, and the selected one grows downwards to show its name.
|
|
16
107
|
*/
|
|
17
108
|
export function TabList({ className, ...props }) {
|
|
18
|
-
return
|
|
109
|
+
return _jsx(RACTabList, { ...props, className: cn('tabs-list', className) });
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* A tab in three layers. The tab is the target (Layer 1), at least --target-min both ways. The pill inside it
|
|
113
|
+
* (Layer 2) takes the hover ground and the focus ring. Selected, it takes the brand-subtle ground and a bold name,
|
|
114
|
+
* and its icon turns brand; where the name doesn't open to mark it (text and icon only), a brand marker does, so
|
|
115
|
+
* selection never rests on the fill alone.
|
|
116
|
+
*
|
|
117
|
+
* A tab whose name isn't showing has a tooltip: on hover after 500ms (at once if another just closed), on keyboard
|
|
118
|
+
* focus at once, closed by Escape from anywhere. The tooltip is hidden from assistive tech, because the tab's name
|
|
119
|
+
* is already its own collapsed label.
|
|
120
|
+
*/
|
|
121
|
+
export function Tab({ id, icon, count, badge, className, visualClassName, children, textValue, ...props }) {
|
|
122
|
+
const shared = useShared();
|
|
123
|
+
const state = useContext(TabListStateContext);
|
|
124
|
+
const name = textValue ?? (typeof children === 'string' ? children : '');
|
|
125
|
+
const display = icon ? shared.display : 'text';
|
|
126
|
+
const rail = shared.orientation === 'vertical';
|
|
127
|
+
const { labels } = shared;
|
|
128
|
+
// A tooltip only where the name isn't showing: every tab in icon only, the closed ones when expanding.
|
|
129
|
+
const selected = state?.selectedKey === id;
|
|
130
|
+
const tip = useTip(id, display === 'icon' || (display === 'expanding' && !selected));
|
|
131
|
+
return (_jsx(RACTab, { ...props, ...tip.handlers, id: id, className: cn('group/tab relative inline-flex min-h-target min-w-target cursor-pointer items-center outline-none data-disabled:cursor-not-allowed', rail && 'flex w-full', className), children: ({ isSelected }) => (_jsx(TabInner, { id: id, name: name, display: display, rail: rail, icon: icon, count: count, badge: badge, isSelected: isSelected, tipOpen: tip.open, visualClassName: visualClassName, labels: labels, children: children })) }));
|
|
132
|
+
}
|
|
133
|
+
function TabInner({ id, name, display, rail, icon, count, badge, isSelected, tipOpen, visualClassName, labels, children, }) {
|
|
134
|
+
const mark = useBadge(id, name, badge, isSelected);
|
|
135
|
+
const shown = mark.shown;
|
|
136
|
+
// Never over text: open in a row, the name sits beside the icon, so the badge follows the name. In a rail the name
|
|
137
|
+
// is under the icon, clear of it. With no icon (text) it always follows the name.
|
|
138
|
+
const inline = shown && (display === 'text' || (display === 'expanding' && isSelected && !rail));
|
|
139
|
+
// Back on the icon after following the name: it waits for the name to fade first.
|
|
140
|
+
const [wasInline, setWasInline] = useState(inline);
|
|
141
|
+
const [returning, setReturning] = useState(false);
|
|
142
|
+
if (wasInline !== inline) {
|
|
143
|
+
setWasInline(inline);
|
|
144
|
+
setReturning(!inline);
|
|
145
|
+
}
|
|
146
|
+
const badgeText = badge?.short ?? badge?.label ?? '';
|
|
147
|
+
const tip = shown && badge
|
|
148
|
+
? fill(labels.tipBadge, { name, badge: badgeText })
|
|
149
|
+
: count != null
|
|
150
|
+
? fill(labels.tipCount, { name, count })
|
|
151
|
+
: name;
|
|
152
|
+
return (_jsxs(_Fragment, { children: [_jsxs("span", { "data-display": display, className: cn('tabs-paint group-data-focus-visible/tab:focus-ring group-data-disabled/tab:opacity-50', visualClassName), children: [display !== 'text' && icon && (_jsxs("span", { className: "tabs-icon", children: [renderIcon(icon, 'size-5'), shown && badge && !inline && (_jsx(BadgeMark, { badge: badge, ...mark, returning: returning }))] })), _jsx("span", { className: "tabs-name", children: _jsxs("span", { className: "tabs-name-row", children: [_jsxs("span", { className: "tabs-name-text", children: [_jsx("span", { children: children }), _jsx("span", { "aria-hidden": "true", children: children })] }), count != null && (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": "true", className: "tabs-count", children: count }), _jsx("span", { className: "sr-only", children: fill(labels.count, { count }) })] })), shown && badge && inline && _jsx(BadgeMark, { badge: badge, ...mark, inline: true }), shown && badge && (_jsx("span", { className: "sr-only", children: fill(labels.badge, { badge: badge.label }) }))] }) })] }), tipOpen && (_jsx("span", { "aria-hidden": "true", "data-side": rail ? 'right' : 'bottom', className: "tabs-tip", children: tip }))] }));
|
|
153
|
+
}
|
|
154
|
+
/** Whether the badge shows, and the pulse and clearing bookkeeping behind it. */
|
|
155
|
+
function useBadge(id, name, badge, isSelected) {
|
|
156
|
+
const shared = useShared();
|
|
157
|
+
const present = !!badge && (!!badge.dot || (badge.count ?? 0) > 0);
|
|
158
|
+
const count = badge?.count;
|
|
159
|
+
const important = !!badge?.important;
|
|
160
|
+
const [s, setS] = useState(() => ({
|
|
161
|
+
count,
|
|
162
|
+
present,
|
|
163
|
+
pulse: present && important ? 1 : 0,
|
|
164
|
+
seen: present && important && isSelected ? 1 : 0,
|
|
165
|
+
cleared: false,
|
|
166
|
+
clearing: false,
|
|
167
|
+
}));
|
|
168
|
+
// From the last render to this one: a badge that appears or rises pulses again, unless its tab is open.
|
|
169
|
+
let next = s;
|
|
170
|
+
if (count !== s.count || present !== s.present) {
|
|
171
|
+
const appeared = present && !s.present;
|
|
172
|
+
const rose = present && s.present && (count ?? 0) > (s.count ?? 0);
|
|
173
|
+
const pulse = important && (appeared || rose) ? s.pulse + 1 : s.pulse;
|
|
174
|
+
next = { ...s, count, present, pulse, cleared: false, clearing: false };
|
|
175
|
+
}
|
|
176
|
+
if (isSelected && next.seen !== next.pulse)
|
|
177
|
+
next = { ...next, seen: next.pulse };
|
|
178
|
+
if (next !== s)
|
|
179
|
+
setS(next);
|
|
180
|
+
// A rise in an important badge is announced, when Tabs asks for it.
|
|
181
|
+
const lastCount = useRef(count);
|
|
182
|
+
useEffect(() => {
|
|
183
|
+
if (important &&
|
|
184
|
+
present &&
|
|
185
|
+
count != null &&
|
|
186
|
+
lastCount.current != null &&
|
|
187
|
+
count > lastCount.current)
|
|
188
|
+
shared.announce(fill(shared.labels.badgeRise, { name, badge: badge?.label ?? '' }));
|
|
189
|
+
lastCount.current = count;
|
|
190
|
+
});
|
|
191
|
+
// Clear on open: it fades after a moment, is gone at 1s, and the app is told. Leaving the tab doesn't stop it.
|
|
192
|
+
const clearable = present && !!badge?.clearOnOpen && !next.cleared;
|
|
193
|
+
const timer = useRef(undefined);
|
|
194
|
+
const onClear = useRef(shared.onBadgeClear);
|
|
195
|
+
useEffect(() => {
|
|
196
|
+
onClear.current = shared.onBadgeClear;
|
|
197
|
+
});
|
|
198
|
+
useEffect(() => {
|
|
199
|
+
if (!isSelected || !clearable || timer.current)
|
|
200
|
+
return;
|
|
201
|
+
setS((p) => ({ ...p, clearing: true }));
|
|
202
|
+
timer.current = setTimeout(() => {
|
|
203
|
+
timer.current = undefined;
|
|
204
|
+
setS((p) => ({ ...p, clearing: false, cleared: true }));
|
|
205
|
+
onClear.current?.(id);
|
|
206
|
+
}, 1000);
|
|
207
|
+
}, [isSelected, clearable, id]);
|
|
208
|
+
useEffect(() => () => clearTimeout(timer.current), []);
|
|
209
|
+
return {
|
|
210
|
+
shown: present && !next.cleared,
|
|
211
|
+
pulse: next.pulse,
|
|
212
|
+
pulsing: important && !isSelected && next.seen !== next.pulse,
|
|
213
|
+
clearing: next.clearing,
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
function BadgeMark({ badge, inline, pulse, pulsing, clearing, returning, }) {
|
|
217
|
+
const dot = !!badge.dot && badge.count == null;
|
|
218
|
+
return (_jsx("span", { "aria-hidden": "true", "data-place": inline ? 'inline' : 'pinned', "data-dot": dot ? '' : undefined, "data-important": badge.important ? '' : undefined, "data-pulse": pulsing ? '' : undefined, "data-clearing": clearing ? '' : undefined, "data-returning": returning && !pulsing ? '' : undefined, className: "tabs-badge", children: dot ? null : (badge.count ?? 0) > 99 ? '99+' : badge.count }, pulse));
|
|
19
219
|
}
|
|
220
|
+
// ---------------------------------------------------------------- tooltips
|
|
20
221
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* surface because it is also the focus ring.
|
|
222
|
+
* Hover: after 500ms, or at once if a tooltip is open or closed in the last 500ms; it closes 120ms after the
|
|
223
|
+
* pointer leaves, and the pointer can move onto it (it sits inside the tab, over an 8px bridge). Keyboard focus:
|
|
224
|
+
* at once. A press closes it, and touch never opens it (React Aria's hover ignores touch).
|
|
25
225
|
*/
|
|
26
|
-
|
|
27
|
-
|
|
226
|
+
function useTip(id, allowed) {
|
|
227
|
+
const { tip, setTip, closeTip, tipClosed } = useShared();
|
|
228
|
+
const open = tip === id;
|
|
229
|
+
const timer = useRef(undefined);
|
|
230
|
+
const pressed = useRef(false);
|
|
231
|
+
const focused = useRef(false);
|
|
232
|
+
useEffect(() => () => clearTimeout(timer.current), []);
|
|
233
|
+
useEffect(() => {
|
|
234
|
+
if (!allowed && open)
|
|
235
|
+
closeTip(id);
|
|
236
|
+
}, [allowed, open, closeTip, id]);
|
|
237
|
+
const handlers = {
|
|
238
|
+
onHoverStart: (e) => {
|
|
239
|
+
if (e.pointerType !== 'mouse' || pressed.current || !allowed)
|
|
240
|
+
return;
|
|
241
|
+
clearTimeout(timer.current);
|
|
242
|
+
if (tip != null || Date.now() - tipClosed.current < 500)
|
|
243
|
+
setTip(id);
|
|
244
|
+
else
|
|
245
|
+
timer.current = setTimeout(() => setTip(id), 500);
|
|
246
|
+
},
|
|
247
|
+
onHoverEnd: () => {
|
|
248
|
+
pressed.current = false;
|
|
249
|
+
clearTimeout(timer.current);
|
|
250
|
+
if (!focused.current)
|
|
251
|
+
timer.current = setTimeout(() => closeTip(id), 120);
|
|
252
|
+
},
|
|
253
|
+
onFocus: (e) => {
|
|
254
|
+
if (!allowed || !e.target.matches(':focus-visible'))
|
|
255
|
+
return;
|
|
256
|
+
focused.current = true;
|
|
257
|
+
clearTimeout(timer.current);
|
|
258
|
+
setTip(id);
|
|
259
|
+
},
|
|
260
|
+
onBlur: () => {
|
|
261
|
+
focused.current = false;
|
|
262
|
+
clearTimeout(timer.current);
|
|
263
|
+
closeTip(id);
|
|
264
|
+
},
|
|
265
|
+
onPressStart: (e) => {
|
|
266
|
+
if (e.pointerType === 'keyboard')
|
|
267
|
+
return;
|
|
268
|
+
pressed.current = true;
|
|
269
|
+
clearTimeout(timer.current);
|
|
270
|
+
closeTip(id);
|
|
271
|
+
},
|
|
272
|
+
};
|
|
273
|
+
return { open: open && allowed, handlers };
|
|
28
274
|
}
|
|
29
275
|
/**
|
|
30
276
|
* A tab's content. With nothing focusable inside, React Aria makes the panel itself a tab stop so a keyboard
|
|
31
277
|
* reaches it after the tabs; it shows the focus ring then. Positioned, so hidden text inside it is placed against
|
|
32
|
-
* it.
|
|
278
|
+
* it. It comes in from the side the selection moved towards (a fade alone at AAA).
|
|
33
279
|
*/
|
|
34
|
-
export function TabPanel({ className, ...props }) {
|
|
35
|
-
|
|
280
|
+
export function TabPanel({ className, id, ...props }) {
|
|
281
|
+
const { hiddenPanels } = useShared();
|
|
282
|
+
const travel = useContext(TravelContext);
|
|
283
|
+
const state = useContext(TabListStateContext);
|
|
284
|
+
const selected = state?.selectedKey === id;
|
|
285
|
+
const [visited, setVisited] = useState(false);
|
|
286
|
+
if (selected && !visited)
|
|
287
|
+
setVisited(true);
|
|
288
|
+
const panel = (_jsx(RACTabPanel, { ...props, id: id, shouldForceMount: hiddenPanels !== 'unmount', "data-travel": selected && travel.moved ? travel.direction : undefined, className: cn('tabs-panel relative rounded-md outline-none data-focus-visible:focus-ring data-inert:hidden', className) }));
|
|
289
|
+
if (hiddenPanels === 'unmount')
|
|
290
|
+
return panel;
|
|
291
|
+
if (!selected && hiddenPanels === 'visited' && !visited)
|
|
292
|
+
return null;
|
|
293
|
+
return _jsx(Activity, { mode: selected ? 'visible' : 'hidden', children: panel });
|
|
36
294
|
}
|
|
37
295
|
//# sourceMappingURL=tabs.js.map
|
package/dist/ui/tabs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.js","sourceRoot":"","sources":["../../src/ui/tabs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AM,QAAQ,GAAG,KAAK,EAAE,WAAW,KAAK,EAAE,CAAC;IAC3C,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9C,IAAI,QAAQ,IAAI,CAAC,OAAO;QAAE,UAAU,CAAC,IAAI,CAAC,CAAC;IAE3C,MAAM,KAAK,GAAG,CACZ,KAAC,WAAW,OACN,KAAK,EACT,EAAE,EAAE,EAAE,EACN,gBAAgB,EAAE,YAAY,KAAK,SAAS,iBAC/B,QAAQ,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EACpE,SAAS,EAAE,EAAE,CACX,6FAA6F,EAC7F,SAAS,CACV,GACD,CACH,CAAC;IACF,IAAI,YAAY,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IAC7C,IAAI,CAAC,QAAQ,IAAI,YAAY,KAAK,SAAS,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IACrE,OAAO,KAAC,QAAQ,IAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,YAAG,KAAK,GAAY,CAAC;AAC7E,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type SVGProps } from 'react';
|
|
2
|
+
export type TimeOfDay = 'morning' | 'afternoon' | 'evening';
|
|
3
|
+
/**
|
|
4
|
+
* The part of the day an hour falls in: morning from 5 to 12, afternoon from 12 to 18, evening otherwise. Pass a
|
|
5
|
+
* date in the person's own time zone: on a server, `new Date()` is the server's clock.
|
|
6
|
+
*/
|
|
7
|
+
export declare function timeOfDay(date?: Date): TimeOfDay;
|
|
8
|
+
export interface TimeOfDayIconProps extends Omit<SVGProps<SVGSVGElement>, 'children'> {
|
|
9
|
+
period: TimeOfDay;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A rising sun, a sun or a moon, drawn in as it first renders: the sun comes up and its rays appear, the sun's
|
|
13
|
+
* rays turn in, the moon turns in and two stars twinkle. Once, in under three seconds. At AAA the parts only
|
|
14
|
+
* fade in; under reduced motion it is drawn at once. Decorative: hidden from assistive tech, so the words
|
|
15
|
+
* beside it say what it shows. 32 by 32, in the current colour. Server-safe.
|
|
16
|
+
*/
|
|
17
|
+
export declare function TimeOfDayIcon({ period, className, ...props }: TimeOfDayIconProps): import("react").JSX.Element;
|
|
18
|
+
//# sourceMappingURL=time-of-day-icon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time-of-day-icon.d.ts","sourceRoot":"","sources":["../../src/ui/time-of-day-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG7C,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,CAAC;AAE5D;;;GAGG;AACH,wBAAgB,SAAS,CAAC,IAAI,GAAE,IAAiB,GAAG,SAAS,CAK5D;AAED,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,UAAU,CAAC;IACnF,MAAM,EAAE,SAAS,CAAC;CACnB;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,kBAAkB,+BAoFhF"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useId } from 'react';
|
|
3
|
+
import { cn } from '../lib/cn.js';
|
|
4
|
+
/**
|
|
5
|
+
* The part of the day an hour falls in: morning from 5 to 12, afternoon from 12 to 18, evening otherwise. Pass a
|
|
6
|
+
* date in the person's own time zone: on a server, `new Date()` is the server's clock.
|
|
7
|
+
*/
|
|
8
|
+
export function timeOfDay(date = new Date()) {
|
|
9
|
+
const hour = date.getHours();
|
|
10
|
+
if (hour >= 5 && hour < 12)
|
|
11
|
+
return 'morning';
|
|
12
|
+
if (hour >= 12 && hour < 18)
|
|
13
|
+
return 'afternoon';
|
|
14
|
+
return 'evening';
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A rising sun, a sun or a moon, drawn in as it first renders: the sun comes up and its rays appear, the sun's
|
|
18
|
+
* rays turn in, the moon turns in and two stars twinkle. Once, in under three seconds. At AAA the parts only
|
|
19
|
+
* fade in; under reduced motion it is drawn at once. Decorative: hidden from assistive tech, so the words
|
|
20
|
+
* beside it say what it shows. 32 by 32, in the current colour. Server-safe.
|
|
21
|
+
*/
|
|
22
|
+
export function TimeOfDayIcon({ period, className, ...props }) {
|
|
23
|
+
const clip = useId();
|
|
24
|
+
return (_jsxs("svg", { viewBox: "0 0 32 32", width: "32", height: "32", fill: "none", stroke: "currentColor", strokeWidth: 1.75, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...props, className: cn('overflow-visible', className), children: [period === 'morning' && (_jsxs(_Fragment, { children: [_jsx("defs", { children: _jsx("clipPath", { id: clip, children: _jsx("rect", { x: "0", y: "0", width: "32", height: "21.2" }) }) }), _jsx("g", { clipPath: `url(#${clip})`, children: _jsx("path", { className: "arrive-sunrise", style: { animationDelay: '220ms' }, d: "M9.5 21.2a6.5 6.5 0 0 1 13 0" }) }), _jsx("path", { className: "arrive-pop", style: { animationDelay: '760ms' }, d: "M16 8.6v2.6" }), _jsx("path", { className: "arrive-pop", style: { animationDelay: '840ms' }, d: "M8.1 11.9l1.8 1.8" }), _jsx("path", { className: "arrive-pop", style: { animationDelay: '840ms' }, d: "M23.9 11.9l-1.8 1.8" }), _jsx("path", { className: "arrive-pop", style: { animationDelay: '920ms' }, d: "M4.6 17.4l2.4 0.8" }), _jsx("path", { className: "arrive-pop", style: { animationDelay: '920ms' }, d: "M27.4 17.4l-2.4 0.8" }), _jsx("path", { d: "M4 21.2h24" }), _jsx("path", { d: "M9 25.6h5M18 25.6h5", opacity: "0.55" })] })), period === 'afternoon' && (_jsxs(_Fragment, { children: [_jsx("circle", { className: "arrive-pop", style: { animationDelay: '180ms' }, cx: "16", cy: "16", r: "5.5" }), _jsx("g", { className: "arrive-spin-in", style: { animationDelay: '260ms' }, children: _jsx("path", { d: "M16 4.6v3M16 24.4v3M4.6 16h3M24.4 16h3M7.9 7.9l2.1 2.1M22 22l2.1 2.1M7.9 24.1l2.1-2.1M22 10l2.1-2.1" }) })] })), period === 'evening' && (_jsxs(_Fragment, { children: [_jsx("g", { transform: "translate(1.6 2.4) scale(0.88)", children: _jsx("path", { className: "arrive-moon-in", style: { animationDelay: '200ms' }, d: "M16 4a8 8 0 0 0 12 12 12 12 0 1 1-12-12Z" }) }), _jsx("path", { className: "arrive-twinkle", style: { animationDelay: '700ms' }, d: "M23.5 5.1v4.8M21.1 7.5h4.8" }), _jsx("path", { className: "arrive-twinkle", style: { animationDelay: '950ms' }, d: "M28 11.8v2.8M26.6 13.2h2.8" })] }))] }));
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=time-of-day-icon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time-of-day-icon.js","sourceRoot":"","sources":["../../src/ui/time-of-day-icon.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAiB,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAIlC;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,IAAI,GAAS,IAAI,IAAI,EAAE;IAC/C,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC7B,IAAI,IAAI,IAAI,CAAC,IAAI,IAAI,GAAG,EAAE;QAAE,OAAO,SAAS,CAAC;IAC7C,IAAI,IAAI,IAAI,EAAE,IAAI,IAAI,GAAG,EAAE;QAAE,OAAO,WAAW,CAAC;IAChD,OAAO,SAAS,CAAC;AACnB,CAAC;AAM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C,YAAY,EACtB,KAAK,EAAE,EAAE,cAAc,EAAE,OAAO,EAAE,EAClC,CAAC,EAAC,qBAAqB,GACvB,EACF,eAAM,CAAC,EAAC,YAAY,GAAG,EACvB,eAAM,CAAC,EAAC,qBAAqB,EAAC,OAAO,EAAC,MAAM,GAAG,IAC9C,CACJ,EACA,MAAM,KAAK,WAAW,IAAI,CACzB,8BACE,iBACE,SAAS,EAAC,YAAY,EACtB,KAAK,EAAE,EAAE,cAAc,EAAE,OAAO,EAAE,EAClC,EAAE,EAAC,IAAI,EACP,EAAE,EAAC,IAAI,EACP,CAAC,EAAC,KAAK,GACP,EACF,YAAG,SAAS,EAAC,gBAAgB,EAAC,KAAK,EAAE,EAAE,cAAc,EAAE,OAAO,EAAE,YAC9D,eAAM,CAAC,EAAC,qGAAqG,GAAG,GAC9G,IACH,CACJ,EACA,MAAM,KAAK,SAAS,IAAI,CACvB,8BACE,YAAG,SAAS,EAAC,gCAAgC,YAC3C,eACE,SAAS,EAAC,gBAAgB,EAC1B,KAAK,EAAE,EAAE,cAAc,EAAE,OAAO,EAAE,EAClC,CAAC,EAAC,0CAA0C,GAC5C,GACA,EACJ,eACE,SAAS,EAAC,gBAAgB,EAC1B,KAAK,EAAE,EAAE,cAAc,EAAE,OAAO,EAAE,EAClC,CAAC,EAAC,4BAA4B,GAC9B,EACF,eACE,SAAS,EAAC,gBAAgB,EAC1B,KAAK,EAAE,EAAE,cAAc,EAAE,OAAO,EAAE,EAClC,CAAC,EAAC,4BAA4B,GAC9B,IACD,CACJ,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { TreeSection as RACTreeSection, type TreeItemProps as RACTreeItemProps, type TreeProps as RACTreeProps } from 'react-aria-components';
|
|
3
|
+
/** A tree is named by a visible heading (`aria-labelledby`) or, when it has none, by `aria-label`. */
|
|
4
|
+
type TreeName = {
|
|
5
|
+
'aria-label': string;
|
|
6
|
+
} | {
|
|
7
|
+
'aria-labelledby': string;
|
|
8
|
+
};
|
|
9
|
+
export type TreeProps<T extends object> = Omit<RACTreeProps<T>, 'className' | 'aria-label' | 'aria-labelledby'> & TreeName & {
|
|
10
|
+
className?: string;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Nested things people open, close and act on: the steps of a workflow and their outcomes, operations grouped by
|
|
14
|
+
* resource. React Aria's Tree, a `treegrid` and one tab stop. ↑ ↓ move between rows, → opens a row and ← closes
|
|
15
|
+
* it, Home and End go to the ends, and typing jumps to the next row whose name starts with what you typed. On an
|
|
16
|
+
* open row, → moves to the row's own buttons. The tree is `relative` because it scrolls, and because React Aria
|
|
17
|
+
* positions its drop indicators absolutely.
|
|
18
|
+
*/
|
|
19
|
+
export declare function Tree<T extends object>({ className, ...props }: TreeProps<T>): import("react").JSX.Element;
|
|
20
|
+
export interface TreeItemProps<T extends object = object> extends Omit<RACTreeItemProps<T>, 'className' | 'children' | 'textValue' | 'style'> {
|
|
21
|
+
/** What the row is called. A string is also its `textValue`. */
|
|
22
|
+
title: ReactNode;
|
|
23
|
+
/** Required when `title` isn't a string: the words typeahead matches and a screen reader reads. */
|
|
24
|
+
textValue?: string;
|
|
25
|
+
/** Second line: a type, a count, a status in words. */
|
|
26
|
+
description?: ReactNode;
|
|
27
|
+
/** Buttons for this row only. Name them with the row ("More actions for Create candidate"). */
|
|
28
|
+
actions?: ReactNode;
|
|
29
|
+
/** The rows inside this one: `TreeItem`s, or a React Aria `Collection` of them. */
|
|
30
|
+
children?: ReactNode;
|
|
31
|
+
className?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* One row and the rows inside it. A row with children has a chevron: a target at least `--target-min` square
|
|
35
|
+
* around a `--control-height-sm` paint, which React Aria keeps out of the tab order, since → and ← do the same.
|
|
36
|
+
* Each level indents by the chevron's width. Selected: brand-subtle and the 3px sidebar-primary marker, as in a
|
|
37
|
+
* GridList; with multiple selection, a ticked box too.
|
|
38
|
+
*/
|
|
39
|
+
export declare function TreeItem<T extends object = object>({ title, textValue, description, actions, children, className, ...props }: TreeItemProps<T>): import("react").JSX.Element;
|
|
40
|
+
/** React Aria doesn't export its TreeSection's props by name. */
|
|
41
|
+
type RACTreeSectionProps<T extends object> = Parameters<typeof RACTreeSection<T>>[0];
|
|
42
|
+
export interface TreeSectionProps<T extends object> extends Omit<RACTreeSectionProps<T>, 'className'> {
|
|
43
|
+
className?: string;
|
|
44
|
+
}
|
|
45
|
+
/** A group of top-level rows under a `TreeHeader`: operations by resource, steps by phase. */
|
|
46
|
+
export declare function TreeSection<T extends object>({ className, ...props }: TreeSectionProps<T>): import("react").JSX.Element;
|
|
47
|
+
/** The name of a `TreeSection`, read before its rows. Not a target: arrow keys pass over it. */
|
|
48
|
+
export declare function TreeHeader({ children, className }: {
|
|
49
|
+
children: ReactNode;
|
|
50
|
+
className?: string;
|
|
51
|
+
}): import("react").JSX.Element;
|
|
52
|
+
export {};
|
|
53
|
+
//# 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;AAI/B,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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AE,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"}
|
package/dist/ui/tree.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ChevronRight } 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
|
+
/**
|
|
8
|
+
* Nested things people open, close and act on: the steps of a workflow and their outcomes, operations grouped by
|
|
9
|
+
* resource. React Aria's Tree, a `treegrid` and one tab stop. ↑ ↓ move between rows, → opens a row and ← closes
|
|
10
|
+
* it, Home and End go to the ends, and typing jumps to the next row whose name starts with what you typed. On an
|
|
11
|
+
* open row, → moves to the row's own buttons. The tree is `relative` because it scrolls, and because React Aria
|
|
12
|
+
* positions its drop indicators absolutely.
|
|
13
|
+
*/
|
|
14
|
+
export function Tree({ className, ...props }) {
|
|
15
|
+
return (_jsx(RACTree, { ...props, className: cn('relative flex max-h-[inherit] flex-col overflow-auto rounded-lg border border-border bg-card text-sm outline-none data-focus-visible:focus-ring', className) }));
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* One row and the rows inside it. A row with children has a chevron: a target at least `--target-min` square
|
|
19
|
+
* around a `--control-height-sm` paint, which React Aria keeps out of the tab order, since → and ← do the same.
|
|
20
|
+
* Each level indents by the chevron's width. Selected: brand-subtle and the 3px sidebar-primary marker, as in a
|
|
21
|
+
* GridList; with multiple selection, a ticked box too.
|
|
22
|
+
*/
|
|
23
|
+
export function TreeItem({ title, textValue, description, actions, children, className, ...props }) {
|
|
24
|
+
return (_jsxs(RACTreeItem, { ...props, textValue: textValue ?? (typeof title === 'string' ? title : ''), style: ({ level }) => ({ '--tree-level': level }), className: cn(
|
|
25
|
+
// React Aria sets data-hovered only on a row that can be selected or has an action: the pointer then.
|
|
26
|
+
'group/tree-item relative flex min-h-[calc(var(--control-height)+12px)] cursor-default items-center gap-2 border-b border-border py-1.5 ps-[calc(4px+(var(--tree-level)-1)*max(var(--target-min),var(--control-height-sm)))] pe-3 outline-none last:border-b-0', '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', className), children: [_jsx(TreeItemContent, { children: ({ hasChildItems, selectionMode, selectionBehavior }) => (_jsxs(_Fragment, { children: [hasChildItems ? (_jsx(RACButton, { slot: "chevron", className: "group/tree-chevron relative flex min-h-target min-w-target shrink-0 cursor-pointer 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-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: "w-[max(var(--target-min),var(--control-height-sm))] shrink-0" })), selectionMode === 'multiple' && selectionBehavior === 'toggle' && (_jsx(SelectionCheckbox, {})), _jsxs("span", { className: "flex min-w-0 flex-1 flex-col", children: [_jsx("span", { className: "leading-5 font-medium text-foreground", children: title }), description && (_jsx("span", { className: "text-[13px] leading-5 text-muted-foreground", children: description }))] }), actions && _jsx("span", { className: "flex shrink-0 items-center gap-1", children: actions })] })) }), children] }));
|
|
27
|
+
}
|
|
28
|
+
/** A group of top-level rows under a `TreeHeader`: operations by resource, steps by phase. */
|
|
29
|
+
export function TreeSection({ className, ...props }) {
|
|
30
|
+
return _jsx(RACTreeSection, { ...props, className: className });
|
|
31
|
+
}
|
|
32
|
+
/** The name of a `TreeSection`, read before its rows. Not a target: arrow keys pass over it. */
|
|
33
|
+
export function TreeHeader({ children, className }) {
|
|
34
|
+
return (_jsx(RACTreeHeader, { className: cn('border-b border-border bg-muted px-3 py-1.5 text-caption-strong text-muted-foreground', className), children: children }));
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=tree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree.js","sourceRoot":"","sources":["../../src/ui/tree.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EACL,MAAM,IAAI,SAAS,EACnB,IAAI,IAAI,OAAO,EACf,UAAU,IAAI,aAAa,EAC3B,QAAQ,IAAI,WAAW,EACvB,eAAe,EACf,WAAW,IAAI,cAAc,GAG9B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAWlD;;;;;;GAMG;AACH,MAAM,UAAU,IAAI,CAAmB,EAAE,SAAS,EAAE,GAAG,KAAK,EAAgB;IAC1E,OAAO,CACL,KAAC,OAAO,OACD,KAAyB,EAC9B,SAAS,EAAE,EAAE,CACX,iJAAiJ,EACjJ,SAAS,CACV,GACD,CACH,CAAC;AACJ,CAAC;AAmBD;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAA4B,EAClD,KAAK,EACL,SAAS,EACT,WAAW,EACX,OAAO,EACP,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACS;IACjB,OAAO,CACL,MAAC,WAAW,OACN,KAAK,EACT,SAAS,EAAE,SAAS,IAAI,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,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7F,OAAO,CACL,KAAC,aAAa,IACZ,SAAS,EAAE,EAAE,CACX,uFAAuF,EACvF,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.
|
|
3
|
+
"version": "0.4.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": ">=
|
|
63
|
+
"react": ">=19.2.0",
|
|
83
64
|
"react-aria-components": "^1.21.1",
|
|
84
|
-
"react-dom": ">=
|
|
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",
|
|
105
|
+
"typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.test.json && pnpm --filter @setsquare/ui-flows 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
|
|
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.
|