@softure-ai/theme-notion 0.10.1 → 0.10.2
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 +20 -0
- package/README.md +45 -6
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/notion/FoldRow.d.ts +2 -0
- package/dist/notion/FoldRow.d.ts.map +1 -1
- package/dist/notion/FoldRow.js +3 -2
- package/dist/notion/FoldRow.js.map +1 -1
- package/dist/notion/LaunchScreen.d.ts +13 -0
- package/dist/notion/LaunchScreen.d.ts.map +1 -0
- package/dist/notion/LaunchScreen.js +11 -0
- package/dist/notion/LaunchScreen.js.map +1 -0
- package/dist/notion/Timeline.d.ts +15 -3
- package/dist/notion/Timeline.d.ts.map +1 -1
- package/dist/notion/Timeline.js +16 -4
- package/dist/notion/Timeline.js.map +1 -1
- package/dist/ui/dialog.d.ts +4 -2
- package/dist/ui/dialog.d.ts.map +1 -1
- package/dist/ui/dialog.js +4 -4
- package/dist/ui/dialog.js.map +1 -1
- package/dist/ui/scroll-area.d.ts +2 -1
- package/dist/ui/scroll-area.d.ts.map +1 -1
- package/dist/ui/scroll-area.js +2 -2
- package/dist/ui/scroll-area.js.map +1 -1
- package/dist/ui/tabs.d.ts +2 -1
- package/dist/ui/tabs.d.ts.map +1 -1
- package/dist/ui/tabs.js +36 -3
- package/dist/ui/tabs.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +2 -1
- package/src/notion/FoldRow.tsx +8 -2
- package/src/notion/LaunchScreen.tsx +37 -0
- package/src/notion/Timeline.tsx +65 -12
- package/src/ui/dialog.tsx +8 -1
- package/src/ui/scroll-area.tsx +5 -1
- package/src/ui/tabs.tsx +40 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,26 @@ Newest first. Each version lists what changed for an app that uses the theme. Wh
|
|
|
4
4
|
production, the version gets a line `verified in: <app>@<commit>` ([docs/05](../../docs/05-adoption-playbook.md),
|
|
5
5
|
"Definition of done").
|
|
6
6
|
|
|
7
|
+
## 0.10.2
|
|
8
|
+
|
|
9
|
+
- A wide dialog (#902): `DialogContent` gains `size` (`"default"` or `"wide"`). `wide` is half the viewport from
|
|
10
|
+
`lg` (`lg:max-w-1/2`), `max-w-lg` between `sm` and `lg`, and keeps the 1 rem gutter on phones. Default dialogs
|
|
11
|
+
render the same classes.
|
|
12
|
+
- `DialogFooter showCloseButton` takes its text from the message layer (#903): `closeLabel`, defaulting to
|
|
13
|
+
`notionMessages.en.dialog.close`, replaces the literal "Close".
|
|
14
|
+
- A folding timeline entry (#907): `TimelineItem` gains `fold` (`{ isOpen?, isOpenInitially?, onOpenChange? }`, type
|
|
15
|
+
`TimelineItemFold`). The body becomes a disclosure button (`aria-expanded`, `aria-controls`, a turning chevron), at
|
|
16
|
+
least the touch target high, that shows and hides the entry's `children`; `fold` and `onSelect` exclude each other.
|
|
17
|
+
`FoldRow` gains `size="touch"`: the summary is at least 44 px high (`min-h-touch-target`). Defaults render the
|
|
18
|
+
same classes (`min-h-row-height` moves to the end of the summary's class list).
|
|
19
|
+
- A scrollable tab strip (#908): `TabsList` (and `tabsListVariants`) gains `scrollable`. The list keeps to its
|
|
20
|
+
container's width, scrolls sideways, keeps each trigger at its own width (and room under the line variant's
|
|
21
|
+
underline), and scrolls the active tab into the middle when it changes; the `Tabs` root takes
|
|
22
|
+
`has-data-[scrollable=true]:min-w-0`, so a grid or flex parent no longer widens to the tabs. `ScrollArea` gains
|
|
23
|
+
`scrollbars` (`"vertical"`, `"horizontal"` or `"both"`).
|
|
24
|
+
- `LaunchScreen` (#911): an installed app's icon, name, progress bar and percentage on the theme's background while
|
|
25
|
+
its first page loads, streamed from `app/loading.tsx`; `@softure-ai/pwa`'s `buildLaunchProgressScript()` moves it.
|
|
26
|
+
|
|
7
27
|
## 0.10.1
|
|
8
28
|
|
|
9
29
|
- The content of 0.10.0, which was never published: its release stopped at the gates (ESLint ran out of memory in
|
package/README.md
CHANGED
|
@@ -74,7 +74,7 @@ import { CircleCheck } from "lucide-react";
|
|
|
74
74
|
|
|
75
75
|
**Copy.** The components' built-in texts are accessible names in English (`notionMessages.en`). Pass the app's own
|
|
76
76
|
wording by props: `Breadcrumb aria-label`, `BreadcrumbEllipsis label`, `PageHeader crumbsLabel`,
|
|
77
|
-
`DialogContent closeLabel`, `SheetContent closeLabel`, `SidePanel closeLabel`, `Steps stateLabels`,
|
|
77
|
+
`DialogContent closeLabel`, `DialogFooter closeLabel` (the `showCloseButton` button's text), `SheetContent closeLabel`, `SidePanel closeLabel`, `Steps stateLabels`,
|
|
78
78
|
`Sidebar mobileTitle mobileDescription`, `SidebarTrigger label`, `SidebarRail label`, `Spinner aria-label`,
|
|
79
79
|
`CommandDialog title description` (`title` also names its search field), `Command label` (the search field's
|
|
80
80
|
name outside a `CommandDialog`; without it the field has none), `SortableList instructions announcements`, `SortableHandle label`.
|
|
@@ -139,7 +139,8 @@ stages with a state, below), `Timeline` (dated entries on a vertical rail, below
|
|
|
139
139
|
`SortableList`, `SortableItem`, `SortableHandle` and `SortableActivator` (rows reordered by dragging, below),
|
|
140
140
|
`MiniProgress` (a compact bar with its figure inside, for a table cell or a tile, below),
|
|
141
141
|
`UpdatePrompt` (the offer to reload into a new build, for an installed app, below),
|
|
142
|
-
`InstallBar` (the offer to install the app on a phone, below)
|
|
142
|
+
`InstallBar` (the offer to install the app on a phone, below),
|
|
143
|
+
`LaunchScreen` (an installed app's icon, name and progress while its first page loads, below).
|
|
143
144
|
|
|
144
145
|
**Touch sizes.** The controls a phone view taps most reach the `touch-target` token (44 px, Apple's HIG and WCAG
|
|
145
146
|
2.5.5): `Button` sizes `touch` (44 px high, padded like `lg`) and `icon-touch` (44 × 44), `SelectTrigger`
|
|
@@ -173,7 +174,8 @@ right; opened, it shows a `DetailTable` and its `children`. The opened content i
|
|
|
173
174
|
(`p-3`), so a table sits centred under the row; `isInset` indents it under the title instead (24 px on the left) and
|
|
174
175
|
sets `data-inset` on the content, like `StatsFold`. A row with a summary of its own (icons, a status) passes `summary`,
|
|
175
176
|
drawn after the chevron in place of `title`, `facts` and `badges`; `details` and `detailsLabel` are optional together,
|
|
176
|
-
so the content can be several tables or a list.
|
|
177
|
+
so the content can be several tables or a list. `size="touch"` makes the summary at least the `touch-target` height
|
|
178
|
+
(44 px) instead of the row height, for a phone list.
|
|
177
179
|
|
|
178
180
|
```tsx
|
|
179
181
|
<FoldRow title="Dentist" facts={["12.01.2027"]} badges={[]} detailsLabel="Visit details" details={rows} />
|
|
@@ -324,7 +326,11 @@ tag fill, the time above the title); `compact` is a minor entry between two majo
|
|
|
324
326
|
colour on the page, the time after the title, the description and badges on one wrapping line). `line: "dashed"` dashes the rail through an entry for something
|
|
325
327
|
missing. With `onSelect` the body is a button; `actionLabel` is read before its visible text ("Show on the map"), so
|
|
326
328
|
the button's name says what it does and still contains every word it shows; `aside` sits at the right edge outside that
|
|
327
|
-
button, so a mark with its own popover never nests in it.
|
|
329
|
+
button, so a mark with its own popover never nests in it. With `fold` the entry folds open and closed instead: the body is
|
|
330
|
+
a disclosure button (`aria-expanded`, `aria-controls`, a chevron that turns when open) at least the `touch-target`
|
|
331
|
+
height, and `children` show only while it is open; `fold: {}` keeps its own state (closed, or open with
|
|
332
|
+
`isOpenInitially`), `fold: { isOpen, onOpenChange }` lets the app keep it. `fold` and `onSelect` exclude each other.
|
|
333
|
+
The colour never carries a meaning alone: put the state in
|
|
328
334
|
words in `badges`. `data` sets an app's own `data-*` attributes on the item. `data-slot="timeline"`,
|
|
329
335
|
`timeline-item` (with `data-item`, `data-size`, `data-line`), `timeline-rail`, `timeline-marker`, `timeline-item-body`
|
|
330
336
|
and the body's parts mark the parts.
|
|
@@ -341,6 +347,8 @@ and the body's parts mark the parts.
|
|
|
341
347
|
},
|
|
342
348
|
{ key: "sapa", icon: CircleDashed, color: "yellow", line: "dashed", time: "11–12 Dec", title: "Sa Pa",
|
|
343
349
|
badges: <Status color="yellow" icon={CircleDashed}>No stay</Status> },
|
|
350
|
+
{ key: "train", icon: TrainFront, color: "blue", time: "10 Dec, 22:00", title: "Train to Sa Pa",
|
|
351
|
+
fold: {}, children: <p>Car 4, berth 12.</p> },
|
|
344
352
|
]}
|
|
345
353
|
/>
|
|
346
354
|
```
|
|
@@ -412,6 +420,23 @@ const { offer, install, close } = useInstallOffer({ app: "fire" }); // @softure-
|
|
|
412
420
|
<InstallBar offer={offer} onInstall={() => void install()} onClose={close} {...messages.install} />
|
|
413
421
|
```
|
|
414
422
|
|
|
423
|
+
**`LaunchScreen`.** What an installed app on `@softure-ai/pwa` shows from its first byte until the page arrives,
|
|
424
|
+
streamed at once from the root `app/loading.tsx`: full screen on the theme's `background` (light and dark), the app's
|
|
425
|
+
icon (`size-16`, `rounded-2xl`, decorative), its name, a `Progress` (`w-48`) named by `label`, and the percentage
|
|
426
|
+
(hidden from screen readers: the bar reports the value). It renders at 0; the inline `script`
|
|
427
|
+
(`buildLaunchProgressScript()` from `@softure-ai/pwa`) moves the bar's value, its indicator and the percentage through
|
|
428
|
+
`data-slot="progress"`, `progress-indicator` and `launch-screen-percent`, and stops once the page replaced the screen:
|
|
429
|
+
|
|
430
|
+
```tsx
|
|
431
|
+
// app/loading.tsx
|
|
432
|
+
import { buildLaunchProgressScript, ICONS_PATH } from "@softure-ai/pwa";
|
|
433
|
+
const ICON = `${ICONS_PATH}/icon-192.png`; // the manifest's icon, drawn by the icon route
|
|
434
|
+
const SCRIPT = buildLaunchProgressScript();
|
|
435
|
+
export default function Loading() {
|
|
436
|
+
return <LaunchScreen name={messages.app.name} iconSrc={ICON} label={messages.pwa.launch.label} script={SCRIPT} />;
|
|
437
|
+
}
|
|
438
|
+
```
|
|
439
|
+
|
|
415
440
|
**`SortableList`.** A list whose rows are reordered by dragging, built on the headless `@dnd-kit/core` and
|
|
416
441
|
`@dnd-kit/sortable`. On a touch screen a long press (`holdDelay`, 500 ms) lifts a row; moving more than `tolerance`
|
|
417
442
|
(8 px) before that scrolls instead, and a tap still activates the row. A mouse drags the same way; from the keyboard
|
|
@@ -498,17 +523,31 @@ Deltas from stock shadcn:
|
|
|
498
523
|
</CommandDialog>
|
|
499
524
|
```
|
|
500
525
|
|
|
501
|
-
- `dialog`, `alert-dialog`: radius 10, `shadow-dialog`, no border. `
|
|
526
|
+
- `dialog`, `alert-dialog`: radius 10, `shadow-dialog`, no border. `DialogContent size="wide"` is half the
|
|
527
|
+
viewport wide from `lg` (`lg:max-w-1/2`) and `max-w-lg` between `sm` and `lg`, for a form with a list above its
|
|
528
|
+
fields; the default stays `max-w-lg`. `card`: `shadow-card` instead of a border.
|
|
502
529
|
- `checkbox` 16 px with a 1.5 px border, `radio-group` drawn the same (round, a `primary` dot), `switch` 26 × 16
|
|
503
530
|
(thumb shadow in `SWITCH_THUMB_SHADOW_CLASS`, for a native switch drawn the same), `tooltip` dark without an arrow,
|
|
504
531
|
`tabs` default to the `line` variant, `progress` 6 px.
|
|
532
|
+
- `tabs`: `TabsList scrollable` is a tab strip wider than a phone screen. It keeps to its container's width
|
|
533
|
+
(`w-full min-w-0`, and the `Tabs` root gets `min-w-0`, so a grid or flex parent does not widen to the tabs), scrolls
|
|
534
|
+
sideways by touch, wheel and the arrow keys (focus moves to the next tab), keeps every trigger at its own width and
|
|
535
|
+
scrolls the active tab into the middle whenever it changes; it combines with `size="touch"`. Sets
|
|
536
|
+
`data-scrollable="true"` on the list.
|
|
537
|
+
|
|
538
|
+
```tsx
|
|
539
|
+
<Tabs value={tab} onValueChange={setTab}>
|
|
540
|
+
<TabsList scrollable size="touch">…</TabsList>
|
|
541
|
+
</Tabs>
|
|
542
|
+
```
|
|
505
543
|
- `table`: a 34 px header in `muted-foreground`, a line under the last row too.
|
|
506
544
|
- `sidebar`: a controlled sidebar keeps no cookie; the phone sheet's title and description are props; the menu
|
|
507
545
|
skeleton's width is stable per item (shadcn draws a random one during render).
|
|
508
546
|
- `item`: inside an `ItemGroup` (a `role="list"`) every `Item` renders `role="listitem"`; an `asChild` item keeps its
|
|
509
547
|
child's role (a link stays a link), so wrap it in an element with `role="listitem"`. `scroll-area`: the viewport
|
|
510
548
|
takes `tabIndex={0}` so keyboard users can scroll it; `viewportProps` reach the viewport (`tabIndex: -1` removes
|
|
511
|
-
the tab stop when the content has its own focusable elements).
|
|
549
|
+
the tab stop when the content has its own focusable elements). `scrollbars` (`"vertical"` by default,
|
|
550
|
+
`"horizontal"` or `"both"`) chooses the bars it draws.
|
|
512
551
|
- `sonner`: no `next-themes`; `theme` is a prop. Focus everywhere: `ring-2 ring-ring` instead of `ring-[3px]`.
|
|
513
552
|
|
|
514
553
|
A component the app needs beyond these: add it in this package (`npx shadcn@latest add <name>` in a scratch app,
|
package/dist/index.d.ts
CHANGED
|
@@ -45,6 +45,7 @@ export { DetailTable, type DetailRow, type DetailTableProps } from "./notion/Det
|
|
|
45
45
|
export { FilterChip, FilterChipAdd, type FilterChipAddProps, type FilterChipProps } from "./notion/FilterChip.js";
|
|
46
46
|
export { FoldRow, type FoldRowBadge, type FoldRowProps } from "./notion/FoldRow.js";
|
|
47
47
|
export { InstallBar, type InstallBarOffer, type InstallBarProps } from "./notion/InstallBar.js";
|
|
48
|
+
export { LaunchScreen, type LaunchScreenProps } from "./notion/LaunchScreen.js";
|
|
48
49
|
export { PALETTE_COLORS, type PaletteColor } from "./notion/palette.js";
|
|
49
50
|
export { MarkPopover, type MarkPopoverProps } from "./notion/MarkPopover.js";
|
|
50
51
|
export { MiniProgress, type MiniProgressProps } from "./notion/MiniProgress.js";
|
|
@@ -58,7 +59,7 @@ export { StatCards, StatPills, StatsFold, type StatCard, type StatCardAside, typ
|
|
|
58
59
|
export { Status, type StatusProps } from "./notion/Status.js";
|
|
59
60
|
export { Steps, type StepItem, type StepState, type StepsLayout, type StepsProps } from "./notion/Steps.js";
|
|
60
61
|
export { TabBar, type TabBarItem, type TabBarProps } from "./notion/TabBar.js";
|
|
61
|
-
export { Timeline, type TimelineItem, type TimelineItemSize, type TimelineLine, type TimelineProps } from "./notion/Timeline.js";
|
|
62
|
+
export { Timeline, type TimelineItem, type TimelineItemFold, type TimelineItemSize, type TimelineLine, type TimelineProps } from "./notion/Timeline.js";
|
|
62
63
|
export { UpdatePrompt, type UpdatePromptProps } from "./notion/UpdatePrompt.js";
|
|
63
64
|
export { TONES, TONE_COLORS, TONE_EDGE, TONE_FILL, TONE_TEXT, type Tone } from "./notion/tones.js";
|
|
64
65
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1E,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CA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sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,YAAY,GAClB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,SAAS,EACT,SAAS,EACT,SAAS,EACT,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,cAAc,GACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,KAAK,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC5G,OAAO,EAAE,MAAM,EAAE,KAAK,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,KAAK,YAAY,EAAE,KAAK,gBAAgB,EAAE,KAAK,gBAAgB,EAAE,KAAK,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACxJ,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,IAAI,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -47,6 +47,7 @@ export { DetailTable } from "./notion/DetailTable.js";
|
|
|
47
47
|
export { FilterChip, FilterChipAdd } from "./notion/FilterChip.js";
|
|
48
48
|
export { FoldRow } from "./notion/FoldRow.js";
|
|
49
49
|
export { InstallBar } from "./notion/InstallBar.js";
|
|
50
|
+
export { LaunchScreen } from "./notion/LaunchScreen.js";
|
|
50
51
|
export { PALETTE_COLORS } from "./notion/palette.js";
|
|
51
52
|
export { MarkPopover } from "./notion/MarkPopover.js";
|
|
52
53
|
export { MiniProgress } from "./notion/MiniProgress.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,wGAAwG;AACxG,oGAAoG;AACpG,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,cAAc,EAAuB,MAAM,qBAAqB,CAAC;AAE1E,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAA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AAmB,CAAC;AAC5G,OAAO,EAAE,MAAM,EAAqC,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAA0G,MAAM,sBAAsB,CAAC;AACxJ,OAAO,EAAE,YAAY,EAA0B,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAa,MAAM,mBAAmB,CAAC"}
|
package/dist/notion/FoldRow.d.ts
CHANGED
|
@@ -34,6 +34,8 @@ export type FoldRowDetailsProps = {
|
|
|
34
34
|
export type FoldRowProps = FoldRowSummaryProps & FoldRowDetailsProps & {
|
|
35
35
|
/** Indents the opened content to line up with the title after the chevron; by default it is padded equally. */
|
|
36
36
|
readonly isInset?: boolean;
|
|
37
|
+
/** `touch` makes the summary at least the touch target high (44 px) instead of the row height. */
|
|
38
|
+
readonly size?: "default" | "touch";
|
|
37
39
|
/** More content under the table when opened. */
|
|
38
40
|
readonly children?: ReactNode;
|
|
39
41
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FoldRow.d.ts","sourceRoot":"","sources":["../../src/notion/FoldRow.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"FoldRow.d.ts","sourceRoot":"","sources":["../../src/notion/FoldRow.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE/D,OAAO,EAAe,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAEpD,MAAM,WAAW,YAAY;IAC3B,gEAAgE;IAChE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC;CACtB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s, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { ChevronRight } from "lucide-react";
|
|
3
|
+
import { cn } from "../lib/utils.js";
|
|
3
4
|
import { Badge } from "../ui/badge.js";
|
|
4
5
|
import { DetailTable } from "./DetailTable.js";
|
|
5
6
|
import { ICON_STROKE_WIDTH } from "./icon-stroke.js";
|
|
@@ -17,7 +18,7 @@ function FoldRowChevron() {
|
|
|
17
18
|
}
|
|
18
19
|
// An item as one folding list row: a native `<details>` that opens in place to its details, with no client state.
|
|
19
20
|
export function FoldRow(props) {
|
|
20
|
-
const { isInset = false, children } = props;
|
|
21
|
-
return (_jsxs("details", { "data-slot": "fold-row", className: "group/fold-row border-b border-border", children: [_jsx("summary", { "data-slot": "fold-row-summary", className: "flex
|
|
21
|
+
const { isInset = false, size = "default", children } = props;
|
|
22
|
+
return (_jsxs("details", { "data-slot": "fold-row", className: "group/fold-row border-b border-border", children: [_jsx("summary", { "data-slot": "fold-row-summary", className: cn("flex cursor-pointer list-none flex-wrap items-center gap-x-2 gap-y-1 rounded-md px-1 py-1 transition-colors duration-120 group-open/fold-row:bg-accent hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none [&::-webkit-details-marker]:hidden", size === "touch" ? "min-h-touch-target" : "min-h-row-height"), children: props.summary === undefined ? (_jsx(FoldRowFixedSummary, { title: props.title, facts: props.facts, badges: props.badges ?? [] })) : (_jsxs(_Fragment, { children: [_jsx(FoldRowChevron, {}), _jsx("span", { "data-slot": "fold-row-summary-slot", className: "flex min-w-0 flex-1 flex-wrap items-center gap-x-2 gap-y-1", children: props.summary })] })) }), _jsxs("div", { "data-slot": "fold-row-content", "data-inset": isInset, className: isInset ? INSET_CONTENT_CLASS : CONTENT_CLASS, children: [props.details === undefined ? null : _jsx(DetailTable, { label: props.detailsLabel, rows: props.details }), children] })] }));
|
|
22
23
|
}
|
|
23
24
|
//# sourceMappingURL=FoldRow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FoldRow.js","sourceRoot":"","sources":["../../src/notion/FoldRow.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAkB,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAa,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"FoldRow.js","sourceRoot":"","sources":["../../src/notion/FoldRow.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAkB,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAa,MAAM,YAAY,CAAC;AAiDpD,MAAM,aAAa,GAAG,sCAAsC,CAAC;AAC7D,MAAM,mBAAmB,GAAG,iDAAiD,CAAC;AAE9E,SAAS,mBAAmB,CAAC,EAC3B,KAAK,EACL,KAAK,GAAG,EAAE,EACV,MAAM,GAKP;IACC,OAAO,CACL,8BAEE,6BAAgB,kBAAkB,EAAC,SAAS,EAAC,iCAAiC,aAC5E,KAAC,cAAc,KAAG,EAClB,eAAM,SAAS,EAAC,wBAAwB,YAAE,KAAK,GAAQ,IAClD,EACN,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAE1B,4BAA4B,eAAe,EAAC,SAAS,EAAC,+BAA+B,YAClF,IAAI,IADI,KAAK,CAET,CACR,CAAC,EACD,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CA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uB,EACjC,SAAS,EAAC,4DAA4D,YAErE,KAAK,CAAC,OAAO,GACT,IACN,CACJ,GACO,EACV,4BAAe,kBAAkB,gBAAa,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,aAAa,aAC5G,KAAK,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAC,WAAW,IAAC,KAAK,EAAE,KAAK,CAAC,YAAY,EAAE,IAAI,EAAE,KAAK,CAAC,OAAO,GAAI,EACpG,QAAQ,IACL,IACE,CACX,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface LaunchScreenProps {
|
|
2
|
+
/** The app's name, shown under its icon. */
|
|
3
|
+
readonly name: string;
|
|
4
|
+
/** The app's icon, e.g. `${ICONS_PATH}/icon-192.png` from `@softure-ai/pwa`: the manifest's mark. */
|
|
5
|
+
readonly iconSrc: string;
|
|
6
|
+
/** The progress bar's accessible name (`pwaMessages.en.launch.label` in `@softure-ai/pwa`). */
|
|
7
|
+
readonly label: string;
|
|
8
|
+
/** The counter's inline script (`buildLaunchProgressScript()` from `@softure-ai/pwa`); without it the bar stays at 0. */
|
|
9
|
+
readonly script?: string;
|
|
10
|
+
readonly className?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function LaunchScreen({ name, iconSrc, label, script, className }: LaunchScreenProps): import("react").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=LaunchScreen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LaunchScreen.d.ts","sourceRoot":"","sources":["../../src/notion/LaunchScreen.tsx"],"names":[],"mappings":"AAGA,MAAM,WAAW,iBAAiB;IAChC,4CAA4C;IAC5C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,qGAAqG;IACrG,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,+FAA+F;IAC/F,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,yHAAyH;IACzH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAMD,wBAAgB,YAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,iBAAiB,+BAiB1F"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../lib/utils.js";
|
|
3
|
+
import { Progress } from "../ui/progress.js";
|
|
4
|
+
// The screen an installed app shows from its first byte until the page arrives, streamed from `app/loading.tsx`: the
|
|
5
|
+
// app's icon and name, a progress bar and a percentage on the theme's background, full screen in light and dark. The
|
|
6
|
+
// counter script moves the bar, its indicator and the percentage through their `data-slot`s; the percentage is
|
|
7
|
+
// hidden from screen readers (the bar reports the value) and keeps the script's text if React hydrates the screen.
|
|
8
|
+
export function LaunchScreen({ name, iconSrc, label, script, className }) {
|
|
9
|
+
return (_jsxs("div", { "data-slot": "launch-screen", className: cn("fixed inset-0 z-50 flex flex-col items-center justify-center gap-4 bg-background p-6 text-foreground", className), children: [_jsx("img", { "data-slot": "launch-screen-icon", src: iconSrc, alt: "", width: 64, height: 64, className: "size-16 rounded-2xl" }), _jsx("p", { "data-slot": "launch-screen-name", className: "text-lg font-semibold", children: name }), _jsx(Progress, { value: 0, "aria-label": label, className: "w-48" }), _jsx("p", { "data-slot": "launch-screen-percent", "aria-hidden": "true", suppressHydrationWarning: true, className: "text-sm text-muted-foreground tabular-nums", children: "0%" }), script === undefined ? null : _jsx("script", { dangerouslySetInnerHTML: { __html: script } })] }));
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=LaunchScreen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LaunchScreen.js","sourceRoot":"","sources":["../../src/notion/LaunchScreen.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAc7C,qHAAqH;AACrH,qHAAqH;AACrH,+GAA+G;AAC/G,mHAAmH;AACnH,MAAM,UAAU,YAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAqB;IACzF,OAAO,CACL,4BACY,eAAe,EACzB,SAAS,EAAE,EAAE,CAAC,sGAAsG,EAAE,SAAS,CAAC,aAEhI,2BAAe,oBAAoB,EAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAC,EAAE,EAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAC,qBAAqB,GAAG,EAClH,yBAAa,oBAAoB,EAAC,SAAS,EAAC,uBAAuB,YAChE,IAAI,GACH,EACJ,KAAC,QAAQ,IAAC,KAAK,EAAE,CAAC,gBAAc,KAAK,EAAE,SAAS,EAAC,MAAM,GAAG,EAC1D,yBAAa,uBAAuB,iBAAa,MAAM,EAAC,wBAAwB,QAAC,SAAS,EAAC,4CAA4C,mBAEnI,EACH,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,iBAAQ,uBAAuB,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,GAAI,IAClF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type LucideIcon } from "lucide-react";
|
|
2
2
|
import type { ReactNode } from "react";
|
|
3
3
|
import type { PaletteColor } from "./palette.js";
|
|
4
4
|
export type TimelineItemSize = "default" | "compact";
|
|
5
5
|
export type TimelineLine = "solid" | "dashed";
|
|
6
|
-
export interface
|
|
6
|
+
export interface TimelineItemFold {
|
|
7
|
+
readonly isOpen?: boolean;
|
|
8
|
+
readonly isOpenInitially?: boolean;
|
|
9
|
+
readonly onOpenChange?: (isOpen: boolean) => void;
|
|
10
|
+
}
|
|
11
|
+
interface TimelineItemBase {
|
|
7
12
|
readonly key: string;
|
|
8
13
|
readonly title: ReactNode;
|
|
9
14
|
readonly time?: ReactNode;
|
|
@@ -15,14 +20,21 @@ export interface TimelineItem {
|
|
|
15
20
|
readonly color?: PaletteColor;
|
|
16
21
|
readonly size?: TimelineItemSize;
|
|
17
22
|
readonly line?: TimelineLine;
|
|
18
|
-
readonly onSelect?: () => void;
|
|
19
23
|
readonly actionLabel?: string;
|
|
20
24
|
readonly data?: Readonly<Record<`data-${string}`, string | undefined>>;
|
|
21
25
|
}
|
|
26
|
+
export type TimelineItem = TimelineItemBase & ({
|
|
27
|
+
readonly onSelect?: () => void;
|
|
28
|
+
readonly fold?: never;
|
|
29
|
+
} | {
|
|
30
|
+
readonly fold: TimelineItemFold;
|
|
31
|
+
readonly onSelect?: never;
|
|
32
|
+
});
|
|
22
33
|
export interface TimelineProps {
|
|
23
34
|
readonly label: string;
|
|
24
35
|
readonly items: readonly TimelineItem[];
|
|
25
36
|
readonly className?: string;
|
|
26
37
|
}
|
|
27
38
|
export declare function Timeline({ label, items, className }: TimelineProps): import("react").JSX.Element;
|
|
39
|
+
export {};
|
|
28
40
|
//# sourceMappingURL=Timeline.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Timeline.d.ts","sourceRoot":"","sources":["../../src/notion/Timeline.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"Timeline.d.ts","sourceRoot":"","sources":["../../src/notion/Timeline.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAIjD,MAAM,MAAM,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,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAA;CAAE,CACjE,CAAC;AAEJ,MAAM,WAAW,aAAa;IAE5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,SAAS,YAAY,EAAE,CAAC;IACxC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAyED,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,aAAa,+BAQlE"}
|
package/dist/notion/Timeline.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronRight } from "lucide-react";
|
|
2
3
|
import { cn } from "../lib/utils.js";
|
|
4
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../ui/collapsible.js";
|
|
3
5
|
import { ICON_STROKE_WIDTH } from "./icon-stroke.js";
|
|
4
6
|
// Literal class names per palette colour, so Tailwind generates each one (the theme's `@source` covers this folder).
|
|
5
7
|
const MARKER_FILL = {
|
|
@@ -51,6 +53,9 @@ const BODY_CLASS = {
|
|
|
51
53
|
compact: "flex min-w-0 flex-col rounded-md px-2 py-1 text-start",
|
|
52
54
|
};
|
|
53
55
|
const BUTTON_CLASS = "cursor-pointer text-foreground transition-colors duration-120 hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none";
|
|
56
|
+
// A folding body is at least the touch target high and leaves room for the chevron at its right edge.
|
|
57
|
+
const FOLD_BODY_CLASS = "group/timeline-fold relative min-h-touch-target pr-7";
|
|
58
|
+
const FOLD_CHEVRON_CLASS = "absolute top-2 right-1.5 size-4 text-muted-foreground transition-transform duration-150 group-data-[state=open]/timeline-fold:rotate-90";
|
|
54
59
|
const ITEM_PADDING = {
|
|
55
60
|
default: "pb-2",
|
|
56
61
|
compact: "pb-1",
|
|
@@ -65,20 +70,27 @@ function TimelineEntry({ item }) {
|
|
|
65
70
|
const size = item.size ?? "default";
|
|
66
71
|
const line = item.line ?? "solid";
|
|
67
72
|
const color = item.color ?? "gray";
|
|
68
|
-
return (_jsxs("li", { ...item.data, "data-slot": "timeline-item", "data-item": item.key, "data-size": size, "data-line": line, className: cn(ITEM_CLASS, ITEM_PADDING[size]), children: [_jsx("span", { "aria-hidden": "true", "data-slot": "timeline-rail", className: cn(RAIL_CLASS, RAIL_LINE[line]) }), _jsx(TimelineMarker, { icon: item.icon, color: color, size: size }),
|
|
73
|
+
return (_jsxs("li", { ...item.data, "data-slot": "timeline-item", "data-item": item.key, "data-size": size, "data-line": line, className: cn(ITEM_CLASS, ITEM_PADDING[size]), children: [_jsx("span", { "aria-hidden": "true", "data-slot": "timeline-rail", className: cn(RAIL_CLASS, RAIL_LINE[line]) }), _jsx(TimelineMarker, { icon: item.icon, color: color, size: size }), _jsx("div", { className: cn("flex min-w-0 flex-col", item.aside === undefined && "col-span-2"), children: item.fold === undefined ? (_jsxs(_Fragment, { children: [_jsx(TimelineBody, { item: item, size: size }), item.children === undefined ? null : (_jsx("div", { "data-slot": "timeline-item-content", className: "px-2 pb-1", children: item.children }))] })) : (_jsx(TimelineFold, { item: item, fold: item.fold, size: size })) }), item.aside === undefined ? null : (_jsx("div", { "data-slot": "timeline-item-aside", className: "flex shrink-0 items-start gap-1 pt-1", children: item.aside }))] }));
|
|
69
74
|
}
|
|
70
75
|
function TimelineMarker({ icon: Icon, color, size }) {
|
|
71
76
|
const look = size === "default" ? MARKER_FILL[color] : MARKER_TEXT[color];
|
|
72
77
|
return (_jsx("span", { "aria-hidden": "true", "data-slot": "timeline-marker", "data-color": color, className: cn(MARKER_CLASS[size], look), children: Icon === undefined ? (_jsx("span", { className: cn("rounded-full", size === "default" ? "size-2 bg-current" : cn("size-2", MARKER_DOT[color])) })) : (_jsx(Icon, { strokeWidth: ICON_STROKE_WIDTH })) }));
|
|
73
78
|
}
|
|
74
|
-
function
|
|
79
|
+
function TimelineBodyContent({ item, size }) {
|
|
75
80
|
const time = item.time === undefined ? null : (_jsx("span", { "data-slot": "timeline-item-time", className: "text-small text-muted-foreground tabular-nums", children: item.time }));
|
|
76
81
|
const description = item.description === undefined ? null : (_jsx("span", { "data-slot": "timeline-item-description", className: "text-small text-muted-foreground [overflow-wrap:anywhere]", children: item.description }));
|
|
77
82
|
const badges = item.badges === undefined ? null : (_jsx("span", { "data-slot": "timeline-item-badges", className: cn("flex flex-wrap items-center gap-x-3 gap-y-1", size === "default" && "mt-0.5"), children: item.badges }));
|
|
78
|
-
|
|
83
|
+
return (_jsxs(_Fragment, { children: [size === "default" ? (_jsxs(_Fragment, { children: [time, _jsx("span", { "data-slot": "timeline-item-title", className: "text-ui-medium [overflow-wrap:anywhere]", children: item.title })] })) : (_jsxs("span", { className: "flex flex-wrap items-baseline gap-x-2", children: [_jsx("span", { "data-slot": "timeline-item-title", className: "text-ui-medium [overflow-wrap:anywhere]", children: item.title }), time] })), size === "default" ? (_jsxs(_Fragment, { children: [description, badges] })) : description === null || badges === null ? ((description ?? badges)) : (_jsxs("span", { className: "flex flex-wrap items-center gap-x-3", children: [description, badges] }))] }));
|
|
84
|
+
}
|
|
85
|
+
function TimelineBody({ item, size }) {
|
|
86
|
+
const content = _jsx(TimelineBodyContent, { item: item, size: size });
|
|
79
87
|
if (item.onSelect === undefined) {
|
|
80
88
|
return (_jsx("div", { "data-slot": "timeline-item-body", className: BODY_CLASS[size], children: content }));
|
|
81
89
|
}
|
|
82
90
|
return (_jsxs("button", { type: "button", "data-slot": "timeline-item-body", className: cn(BODY_CLASS[size], BUTTON_CLASS), onClick: item.onSelect, children: [item.actionLabel === undefined ? null : _jsx("span", { className: "sr-only", children: `${item.actionLabel}: ` }), content] }));
|
|
83
91
|
}
|
|
92
|
+
// The body as a disclosure button (`aria-expanded`, `aria-controls`) that folds the entry's content open and closed.
|
|
93
|
+
function TimelineFold({ item, fold, size }) {
|
|
94
|
+
return (_jsxs(Collapsible, { ...(fold.isOpen === undefined ? {} : { open: fold.isOpen }), defaultOpen: fold.isOpenInitially ?? false, ...(fold.onOpenChange === undefined ? {} : { onOpenChange: fold.onOpenChange }), className: "flex min-w-0 flex-col", children: [_jsxs(CollapsibleTrigger, { "data-slot": "timeline-item-body", className: cn(BODY_CLASS[size], BUTTON_CLASS, FOLD_BODY_CLASS), children: [item.actionLabel === undefined ? null : _jsx("span", { className: "sr-only", children: `${item.actionLabel}: ` }), _jsx(TimelineBodyContent, { item: item, size: size }), _jsx(ChevronRight, { "aria-hidden": "true", strokeWidth: ICON_STROKE_WIDTH, className: FOLD_CHEVRON_CLASS })] }), _jsx(CollapsibleContent, { "data-slot": "timeline-item-content", className: "px-2 pb-1", children: item.children })] }));
|
|
95
|
+
}
|
|
84
96
|
//# sourceMappingURL=Timeline.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Timeline.js","sourceRoot":"","sources":["../../src/notion/Timeline.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Timeline.js","sourceRoot":"","sources":["../../src/notion/Timeline.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAmB,MAAM,cAAc,CAAC;AAG7D,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE3F,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AA4DrD,qHAAqH;AACrH,MAAM,WAAW,GAA2C;IAC1D,IAAI,EAAE,sCAAsC;IAC5C,KAAK,EAAE,wCAAwC;IAC/C,MAAM,EAAE,0CAA0C;IAClD,MAAM,EAAE,0CAA0C;IAClD,KAAK,EAAE,wCAAwC;IAC/C,IAAI,EAAE,sCAAsC;IAC5C,MAAM,EAAE,0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C,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,eAAM,SAAS,EAAC,SAAS,YAAE,GAAG,IAAI,CAAC,WAAW,IAAI,GAAQ,EACnG,KAAC,mBAAmB,IAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,GAAI,EAC/C,KAAC,YAAY,mBAAa,MAAM,EAAC,WAAW,EAAE,iBAAiB,EAAE,SAAS,EAAE,kBAAkB,GAAI,IAC/E,EACrB,KAAC,kBAAkB,iBAAW,uBAAuB,EAAC,SAAS,EAAC,WAAW,YACxE,IAAI,CAAC,QAAQ,GACK,IACT,CACf,CAAC;AACJ,CAAC"}
|
package/dist/ui/dialog.d.ts
CHANGED
|
@@ -5,14 +5,16 @@ declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogP
|
|
|
5
5
|
declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): React.JSX.Element;
|
|
6
6
|
declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): React.JSX.Element;
|
|
7
7
|
declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): React.JSX.Element;
|
|
8
|
-
declare function DialogContent({ className, children, showCloseButton, closeLabel, closeButtonSize, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
8
|
+
declare function DialogContent({ className, children, showCloseButton, closeLabel, closeButtonSize, size, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
9
9
|
showCloseButton?: boolean;
|
|
10
10
|
closeLabel?: string;
|
|
11
11
|
closeButtonSize?: "default" | "touch";
|
|
12
|
+
size?: "default" | "wide";
|
|
12
13
|
}): React.JSX.Element;
|
|
13
14
|
declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
14
|
-
declare function DialogFooter({ className, showCloseButton, children, ...props }: React.ComponentProps<"div"> & {
|
|
15
|
+
declare function DialogFooter({ className, showCloseButton, closeLabel, children, ...props }: React.ComponentProps<"div"> & {
|
|
15
16
|
showCloseButton?: boolean;
|
|
17
|
+
closeLabel?: string;
|
|
16
18
|
}): React.JSX.Element;
|
|
17
19
|
declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): React.JSX.Element;
|
|
18
20
|
declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): React.JSX.Element;
|
package/dist/ui/dialog.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../src/ui/dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAA;AAIpD,iBAAS,MAAM,CAAC,EACd,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,qBAEnD;AAED,iBAAS,aAAa,CAAC,EACrB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,qBAEtD;AAED,iBAAS,YAAY,CAAC,EACpB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,MAAM,CAAC,qBAErD;AAED,iBAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,qBAEpD;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,qBAWtD;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,QAAQ,EACR,eAAsB,EACtB,UAAkC,EAClC,eAA2B,EAC3B,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,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AI,CAAC,EAAE,SAAS,GAAG,MAAM,CAAA;CAC1B,qBA8BA;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAQzE;AAED,iBAAS,YAAY,CAAC,EACpB,SAAS,EACT,eAAuB,EACvB,UAAkC,EAClC,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IAC/B,eAAe,CAAC,EAAE,OAAO,CAAA;IAEzB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,qBAkBA;AAED,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,qBAQpD;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,WAAW,CAAC,qBAQ1D;AAED,OAAO,EACL,MAAM,EACN,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,WAAW,EACX,aAAa,GACd,CAAA"}
|
package/dist/ui/dialog.js
CHANGED
|
@@ -21,15 +21,15 @@ function DialogClose({ ...props }) {
|
|
|
21
21
|
function DialogOverlay({ className, ...props }) {
|
|
22
22
|
return (_jsx(DialogPrimitive.Overlay, { "data-slot": "dialog-overlay", className: cn("fixed inset-0 z-50 bg-overlay data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0", className), ...props }));
|
|
23
23
|
}
|
|
24
|
-
function DialogContent({ className, children, showCloseButton = true, closeLabel = messages.dialog.close, closeButtonSize = "default", ...props }) {
|
|
25
|
-
return (_jsxs(DialogPortal, { "data-slot": "dialog-portal", children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, { "data-slot": "dialog-content", className: cn("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl bg-background p-6 shadow-dialog duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg", className), ...props, children: [children, showCloseButton && (_jsxs(DialogPrimitive.Close, { "data-slot": "dialog-close", className: cn("absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", closeButtonSize === "touch" &&
|
|
24
|
+
function DialogContent({ className, children, showCloseButton = true, closeLabel = messages.dialog.close, closeButtonSize = "default", size = "default", ...props }) {
|
|
25
|
+
return (_jsxs(DialogPortal, { "data-slot": "dialog-portal", children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, { "data-slot": "dialog-content", className: cn("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl bg-background p-6 shadow-dialog duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg", size === "wide" && "lg:max-w-1/2", className), ...props, children: [children, showCloseButton && (_jsxs(DialogPrimitive.Close, { "data-slot": "dialog-close", className: cn("absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", closeButtonSize === "touch" &&
|
|
26
26
|
"top-0.5 right-0.5 inline-flex size-touch-target items-center justify-center rounded-md"), children: [_jsx(XIcon, {}), _jsx("span", { className: "sr-only", children: closeLabel })] }))] })] }));
|
|
27
27
|
}
|
|
28
28
|
function DialogHeader({ className, ...props }) {
|
|
29
29
|
return (_jsx("div", { "data-slot": "dialog-header", className: cn("flex flex-col gap-2 text-center sm:text-left", className), ...props }));
|
|
30
30
|
}
|
|
31
|
-
function DialogFooter({ className, showCloseButton = false, children, ...props }) {
|
|
32
|
-
return (_jsxs("div", { "data-slot": "dialog-footer", className: cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className), ...props, children: [children, showCloseButton && (_jsx(DialogPrimitive.Close, { asChild: true, children: _jsx(Button, { variant: "outline", children:
|
|
31
|
+
function DialogFooter({ className, showCloseButton = false, closeLabel = messages.dialog.close, children, ...props }) {
|
|
32
|
+
return (_jsxs("div", { "data-slot": "dialog-footer", className: cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className), ...props, children: [children, showCloseButton && (_jsx(DialogPrimitive.Close, { asChild: true, children: _jsx(Button, { variant: "outline", children: closeLabel }) }))] }));
|
|
33
33
|
}
|
|
34
34
|
function DialogTitle({ className, ...props }) {
|
|
35
35
|
return (_jsx(DialogPrimitive.Title, { "data-slot": "dialog-title", className: cn("text-lg leading-none font-semibold", className), ...props }));
|
package/dist/ui/dialog.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.js","sourceRoot":"","sources":["../../src/ui/dialog.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,EAAE,IAAI,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAA;AACpC,OAAO,EAAE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AC;AAED,SAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACiD;IACzD,OAAO,CACL,KAAC,eAAe,CAAC,WAAW,iBAChB,oBAAoB,EAC9B,SAAS,EAAE,EAAE,CAAC,+BAA+B,EAAE,SAAS,CAAC,KACrD,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,OAAO,EACL,MAAM,EACN,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,WAAW,EACX,aAAa,GACd,CAAA"}
|
package/dist/ui/scroll-area.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { ScrollArea as ScrollAreaPrimitive } from "radix-ui";
|
|
3
|
-
declare function ScrollArea({ className, children, viewportProps, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.Root> & {
|
|
3
|
+
declare function ScrollArea({ className, children, viewportProps, scrollbars, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.Root> & {
|
|
4
4
|
viewportProps?: React.ComponentProps<typeof ScrollAreaPrimitive.Viewport>;
|
|
5
|
+
scrollbars?: "vertical" | "horizontal" | "both";
|
|
5
6
|
}): React.JSX.Element;
|
|
6
7
|
declare function ScrollBar({ className, orientation, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>): React.JSX.Element;
|
|
7
8
|
export { ScrollArea, ScrollBar };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll-area.d.ts","sourceRoot":"","sources":["../../src/ui/scroll-area.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,UAAU,IAAI,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAE5D,iBAAS,UAAU,CAAC,EAClB,SAAS,EACT,QAAQ,EACR,aAAa,EACb,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,mBAAmB,CAAC,IAAI,CAAC,GAAG;IACzD,aAAa,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,mBAAmB,CAAC,QAAQ,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"scroll-area.d.ts","sourceRoot":"","sources":["../../src/ui/scroll-area.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,UAAU,IAAI,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAE5D,iBAAS,UAAU,CAAC,EAClB,SAAS,EACT,QAAQ,EACR,aAAa,EACb,UAAuB,EACvB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,mBAAmB,CAAC,IAAI,CAAC,GAAG;IACzD,aAAa,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,mBAAmB,CAAC,QAAQ,CAAC,CAAA;IAEzE,UAAU,CAAC,EAAE,UAAU,GAAG,YAAY,GAAG,MAAM,CAAA;CAChD,qBAwBA;AAED,iBAAS,SAAS,CAAC,EACjB,SAAS,EACT,WAAwB,EACxB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,mBAAmB,CAAC,mBAAmB,CAAC,qBAqBtE;AAED,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,CAAA"}
|
package/dist/ui/scroll-area.js
CHANGED
|
@@ -3,8 +3,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { cn } from "../lib/utils.js";
|
|
5
5
|
import { ScrollArea as ScrollAreaPrimitive } from "radix-ui";
|
|
6
|
-
function ScrollArea({ className, children, viewportProps, ...props }) {
|
|
7
|
-
return (_jsxs(ScrollAreaPrimitive.Root, { "data-slot": "scroll-area", className: cn("relative", className), ...props, children: [_jsx(ScrollAreaPrimitive.Viewport, { tabIndex: 0, "data-slot": "scroll-area-viewport", ...viewportProps, className: cn("size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-1", viewportProps?.className), children: children }), _jsx(ScrollBar, {}), _jsx(ScrollAreaPrimitive.Corner, {})] }));
|
|
6
|
+
function ScrollArea({ className, children, viewportProps, scrollbars = "vertical", ...props }) {
|
|
7
|
+
return (_jsxs(ScrollAreaPrimitive.Root, { "data-slot": "scroll-area", className: cn("relative", className), ...props, children: [_jsx(ScrollAreaPrimitive.Viewport, { tabIndex: 0, "data-slot": "scroll-area-viewport", ...viewportProps, className: cn("size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-1", viewportProps?.className), children: children }), scrollbars !== "horizontal" && _jsx(ScrollBar, {}), scrollbars !== "vertical" && _jsx(ScrollBar, { orientation: "horizontal" }), _jsx(ScrollAreaPrimitive.Corner, {})] }));
|
|
8
8
|
}
|
|
9
9
|
function ScrollBar({ className, orientation = "vertical", ...props }) {
|
|
10
10
|
return (_jsx(ScrollAreaPrimitive.ScrollAreaScrollbar, { "data-slot": "scroll-area-scrollbar", orientation: orientation, className: cn("flex touch-none p-px transition-colors select-none", orientation === "vertical" &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll-area.js","sourceRoot":"","sources":["../../src/ui/scroll-area.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAA;AACpC,OAAO,EAAE,UAAU,IAAI,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAE5D,SAAS,UAAU,CAAC,EAClB,SAAS,EACT,QAAQ,EACR,aAAa,EACb,GAAG,KAAK,
|
|
1
|
+
{"version":3,"file":"scroll-area.js","sourceRoot":"","sources":["../../src/ui/scroll-area.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,O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d.ts
CHANGED
|
@@ -6,8 +6,9 @@ declare function Tabs({ className, orientation, ...props }: React.ComponentProps
|
|
|
6
6
|
declare const tabsListVariants: (props?: ({
|
|
7
7
|
variant?: "default" | "line" | null | undefined;
|
|
8
8
|
size?: "default" | "touch" | null | undefined;
|
|
9
|
+
scrollable?: boolean | null | undefined;
|
|
9
10
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
|
-
declare function TabsList({ className, variant, size, ...props }: React.ComponentProps<typeof TabsPrimitive.List> & VariantProps<typeof tabsListVariants>): React.JSX.Element;
|
|
11
|
+
declare function TabsList({ className, variant, size, scrollable, ref, ...props }: React.ComponentProps<typeof TabsPrimitive.List> & VariantProps<typeof tabsListVariants>): React.JSX.Element;
|
|
11
12
|
declare function TabsTrigger({ className, size, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger> & {
|
|
12
13
|
size?: TabsTriggerSize;
|
|
13
14
|
}): React.JSX.Element;
|
package/dist/ui/tabs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../src/ui/tabs.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAEjE,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,UAAU,CAAA;AAEhD,KAAK,eAAe,GAAG,SAAS,GAAG,OAAO,CAAA;AAK1C,iBAAS,IAAI,CAAC,EACZ,SAAS,EACT,WAA0B,EAC1B,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,aAAa,CAAC,IAAI,CAAC,qBAajD;AAED,QAAA,MAAM,gBAAgB
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../src/ui/tabs.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAEjE,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,UAAU,CAAA;AAEhD,KAAK,eAAe,GAAG,SAAS,GAAG,OAAO,CAAA;AAK1C,iBAAS,IAAI,CAAC,EACZ,SAAS,EACT,WAA0B,EAC1B,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,aAAa,CAAC,IAAI,CAAC,qBAajD;AAED,QAAA,MAAM,gBAAgB;;;;8EAyBrB,CAAA;AAmBD,iBAAS,QAAQ,CAAC,EAChB,SAAS,EACT,OAAgB,EAChB,IAAgB,EAChB,UAAkB,EAClB,GAAG,EACH,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,aAAa,CAAC,IAAI,CAAC,GAChD,YAAY,CAAC,OAAO,gBAAgB,CAAC,qBAwBtC;AAED,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,IAAI,EACJ,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,aAAa,CAAC,OAAO,CAAC,GAAG;IACtD,IAAI,CAAC,EAAE,eAAe,CAAA;CACvB,qBAiBA;AAED,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,aAAa,CAAC,OAAO,CAAC,qBAQpD;AAED,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,CAAA"}
|
package/dist/ui/tabs.js
CHANGED
|
@@ -7,7 +7,7 @@ import { Tabs as TabsPrimitive } from "radix-ui";
|
|
|
7
7
|
// A list's size reaches its triggers through context, so a trigger's own size can win over it.
|
|
8
8
|
const TabsTriggerSizeContext = React.createContext("default");
|
|
9
9
|
function Tabs({ className, orientation = "horizontal", ...props }) {
|
|
10
|
-
return (_jsx(TabsPrimitive.Root, { "data-slot": "tabs", "data-orientation": orientation, orientation: orientation, className: cn("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col", className), ...props }));
|
|
10
|
+
return (_jsx(TabsPrimitive.Root, { "data-slot": "tabs", "data-orientation": orientation, orientation: orientation, className: cn("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col has-data-[scrollable=true]:min-w-0", className), ...props }));
|
|
11
11
|
}
|
|
12
12
|
const tabsListVariants = cva("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none", {
|
|
13
13
|
variants: {
|
|
@@ -20,14 +20,47 @@ const tabsListVariants = cva("group/tabs-list inline-flex w-fit items-center jus
|
|
|
20
20
|
// The triggers set the height: a fixed one would cap them at 35 px.
|
|
21
21
|
touch: "group-data-[orientation=horizontal]/tabs:h-auto",
|
|
22
22
|
},
|
|
23
|
+
// Keeps to its container's width and scrolls sideways; the line variant keeps room for the active underline.
|
|
24
|
+
scrollable: {
|
|
25
|
+
false: "",
|
|
26
|
+
true: "relative w-full max-w-full min-w-0 justify-start overflow-x-auto overflow-y-hidden overscroll-x-contain [scrollbar-width:thin] group-data-[orientation=horizontal]/tabs:h-auto data-[variant=line]:pb-1.5 *:flex-none",
|
|
27
|
+
},
|
|
23
28
|
},
|
|
24
29
|
defaultVariants: {
|
|
25
30
|
variant: "line",
|
|
26
31
|
size: "default",
|
|
32
|
+
scrollable: false,
|
|
27
33
|
},
|
|
28
34
|
});
|
|
29
|
-
|
|
30
|
-
|
|
35
|
+
// Scrolls a scrollable list so its active trigger sits in the middle, now and whenever the active tab changes.
|
|
36
|
+
function useCentredActiveTrigger(list, isScrollable) {
|
|
37
|
+
React.useEffect(() => {
|
|
38
|
+
const element = list.current;
|
|
39
|
+
if (!isScrollable || element === null)
|
|
40
|
+
return;
|
|
41
|
+
const centreActiveTrigger = () => {
|
|
42
|
+
const active = element.querySelector('[data-slot="tabs-trigger"][data-state="active"]');
|
|
43
|
+
if (active === null)
|
|
44
|
+
return;
|
|
45
|
+
element.scrollLeft = active.offsetLeft - (element.clientWidth - active.offsetWidth) / 2;
|
|
46
|
+
};
|
|
47
|
+
centreActiveTrigger();
|
|
48
|
+
const observer = new MutationObserver(centreActiveTrigger);
|
|
49
|
+
observer.observe(element, { subtree: true, attributeFilter: ["data-state"] });
|
|
50
|
+
return () => observer.disconnect();
|
|
51
|
+
}, [list, isScrollable]);
|
|
52
|
+
}
|
|
53
|
+
function TabsList({ className, variant = "line", size = "default", scrollable = false, ref, ...props }) {
|
|
54
|
+
const listRef = React.useRef(null);
|
|
55
|
+
const setListRef = React.useCallback((node) => {
|
|
56
|
+
listRef.current = node;
|
|
57
|
+
if (typeof ref === "function")
|
|
58
|
+
ref(node);
|
|
59
|
+
else if (ref)
|
|
60
|
+
ref.current = node;
|
|
61
|
+
}, [ref]);
|
|
62
|
+
useCentredActiveTrigger(listRef, scrollable === true);
|
|
63
|
+
return (_jsx(TabsTriggerSizeContext.Provider, { value: size ?? "default", children: _jsx(TabsPrimitive.List, { "data-slot": "tabs-list", "data-variant": variant, "data-scrollable": scrollable === true ? "true" : undefined, ref: setListRef, className: cn(tabsListVariants({ variant, size, scrollable }), className), ...props }) }));
|
|
31
64
|
}
|
|
32
65
|
function TabsTrigger({ className, size, ...props }) {
|
|
33
66
|
const listSize = React.useContext(TabsTriggerSizeContext);
|
package/dist/ui/tabs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.js","sourceRoot":"","sources":["../../src/ui/tabs.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAA;AACpC,OAAO,EAAE,IAAI,IAAI,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KAAC,aAAa,CAAC,OAAO,iBACV,cAAc,EACxB,SAAS,EAAE,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,KAC3C,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@softure-ai/theme-notion",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.2",
|
|
4
4
|
"description": "SOFTURE AI Notion theme: shadcn/ui components (new-york v4, Radix, Tailwind CSS v4, lucide) with the Notion design system's tokens and deltas, ready to import.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
package/src/index.ts
CHANGED
|
@@ -49,6 +49,7 @@ export { DetailTable, type DetailRow, type DetailTableProps } from "./notion/Det
|
|
|
49
49
|
export { FilterChip, FilterChipAdd, type FilterChipAddProps, type FilterChipProps } from "./notion/FilterChip.js";
|
|
50
50
|
export { FoldRow, type FoldRowBadge, type FoldRowProps } from "./notion/FoldRow.js";
|
|
51
51
|
export { InstallBar, type InstallBarOffer, type InstallBarProps } from "./notion/InstallBar.js";
|
|
52
|
+
export { LaunchScreen, type LaunchScreenProps } from "./notion/LaunchScreen.js";
|
|
52
53
|
export { PALETTE_COLORS, type PaletteColor } from "./notion/palette.js";
|
|
53
54
|
export { MarkPopover, type MarkPopoverProps } from "./notion/MarkPopover.js";
|
|
54
55
|
export { MiniProgress, type MiniProgressProps } from "./notion/MiniProgress.js";
|
|
@@ -84,6 +85,6 @@ export {
|
|
|
84
85
|
export { Status, type StatusProps } from "./notion/Status.js";
|
|
85
86
|
export { Steps, type StepItem, type StepState, type StepsLayout, type StepsProps } from "./notion/Steps.js";
|
|
86
87
|
export { TabBar, type TabBarItem, type TabBarProps } from "./notion/TabBar.js";
|
|
87
|
-
export { Timeline, type TimelineItem, type TimelineItemSize, type TimelineLine, type TimelineProps } from "./notion/Timeline.js";
|
|
88
|
+
export { Timeline, type TimelineItem, type TimelineItemFold, type TimelineItemSize, type TimelineLine, type TimelineProps } from "./notion/Timeline.js";
|
|
88
89
|
export { UpdatePrompt, type UpdatePromptProps } from "./notion/UpdatePrompt.js";
|
|
89
90
|
export { TONES, TONE_COLORS, TONE_EDGE, TONE_FILL, TONE_TEXT, type Tone } from "./notion/tones.js";
|
package/src/notion/FoldRow.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ChevronRight } from "lucide-react";
|
|
2
2
|
import type { ReactNode } from "react";
|
|
3
3
|
|
|
4
|
+
import { cn } from "../lib/utils.js";
|
|
4
5
|
import { Badge } from "../ui/badge.js";
|
|
5
6
|
|
|
6
7
|
import { DetailTable, type DetailRow } from "./DetailTable.js";
|
|
@@ -48,6 +49,8 @@ export type FoldRowProps = FoldRowSummaryProps &
|
|
|
48
49
|
FoldRowDetailsProps & {
|
|
49
50
|
/** Indents the opened content to line up with the title after the chevron; by default it is padded equally. */
|
|
50
51
|
readonly isInset?: boolean;
|
|
52
|
+
/** `touch` makes the summary at least the touch target high (44 px) instead of the row height. */
|
|
53
|
+
readonly size?: "default" | "touch";
|
|
51
54
|
/** More content under the table when opened. */
|
|
52
55
|
readonly children?: ReactNode;
|
|
53
56
|
};
|
|
@@ -111,12 +114,15 @@ function FoldRowChevron() {
|
|
|
111
114
|
|
|
112
115
|
// An item as one folding list row: a native `<details>` that opens in place to its details, with no client state.
|
|
113
116
|
export function FoldRow(props: FoldRowProps) {
|
|
114
|
-
const { isInset = false, children } = props;
|
|
117
|
+
const { isInset = false, size = "default", children } = props;
|
|
115
118
|
return (
|
|
116
119
|
<details data-slot="fold-row" className="group/fold-row border-b border-border">
|
|
117
120
|
<summary
|
|
118
121
|
data-slot="fold-row-summary"
|
|
119
|
-
className=
|
|
122
|
+
className={cn(
|
|
123
|
+
"flex cursor-pointer list-none flex-wrap items-center gap-x-2 gap-y-1 rounded-md px-1 py-1 transition-colors duration-120 group-open/fold-row:bg-accent hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none [&::-webkit-details-marker]:hidden",
|
|
124
|
+
size === "touch" ? "min-h-touch-target" : "min-h-row-height",
|
|
125
|
+
)}
|
|
120
126
|
>
|
|
121
127
|
{props.summary === undefined ? (
|
|
122
128
|
<FoldRowFixedSummary title={props.title} facts={props.facts} badges={props.badges ?? []} />
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.js";
|
|
2
|
+
import { Progress } from "../ui/progress.js";
|
|
3
|
+
|
|
4
|
+
export interface LaunchScreenProps {
|
|
5
|
+
/** The app's name, shown under its icon. */
|
|
6
|
+
readonly name: string;
|
|
7
|
+
/** The app's icon, e.g. `${ICONS_PATH}/icon-192.png` from `@softure-ai/pwa`: the manifest's mark. */
|
|
8
|
+
readonly iconSrc: string;
|
|
9
|
+
/** The progress bar's accessible name (`pwaMessages.en.launch.label` in `@softure-ai/pwa`). */
|
|
10
|
+
readonly label: string;
|
|
11
|
+
/** The counter's inline script (`buildLaunchProgressScript()` from `@softure-ai/pwa`); without it the bar stays at 0. */
|
|
12
|
+
readonly script?: string;
|
|
13
|
+
readonly className?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// The screen an installed app shows from its first byte until the page arrives, streamed from `app/loading.tsx`: the
|
|
17
|
+
// app's icon and name, a progress bar and a percentage on the theme's background, full screen in light and dark. The
|
|
18
|
+
// counter script moves the bar, its indicator and the percentage through their `data-slot`s; the percentage is
|
|
19
|
+
// hidden from screen readers (the bar reports the value) and keeps the script's text if React hydrates the screen.
|
|
20
|
+
export function LaunchScreen({ name, iconSrc, label, script, className }: LaunchScreenProps) {
|
|
21
|
+
return (
|
|
22
|
+
<div
|
|
23
|
+
data-slot="launch-screen"
|
|
24
|
+
className={cn("fixed inset-0 z-50 flex flex-col items-center justify-center gap-4 bg-background p-6 text-foreground", className)}
|
|
25
|
+
>
|
|
26
|
+
<img data-slot="launch-screen-icon" src={iconSrc} alt="" width={64} height={64} className="size-16 rounded-2xl" />
|
|
27
|
+
<p data-slot="launch-screen-name" className="text-lg font-semibold">
|
|
28
|
+
{name}
|
|
29
|
+
</p>
|
|
30
|
+
<Progress value={0} aria-label={label} className="w-48" />
|
|
31
|
+
<p data-slot="launch-screen-percent" aria-hidden="true" suppressHydrationWarning className="text-sm text-muted-foreground tabular-nums">
|
|
32
|
+
0%
|
|
33
|
+
</p>
|
|
34
|
+
{script === undefined ? null : <script dangerouslySetInnerHTML={{ __html: script }} />}
|
|
35
|
+
</div>
|
|
36
|
+
);
|
|
37
|
+
}
|
package/src/notion/Timeline.tsx
CHANGED
|
@@ -1,18 +1,28 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { ChevronRight, type LucideIcon } from "lucide-react";
|
|
2
2
|
import type { ReactNode } from "react";
|
|
3
3
|
|
|
4
4
|
import { cn } from "../lib/utils.js";
|
|
5
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../ui/collapsible.js";
|
|
5
6
|
|
|
6
7
|
import { ICON_STROKE_WIDTH } from "./icon-stroke.js";
|
|
7
8
|
import type { PaletteColor } from "./palette.js";
|
|
8
9
|
|
|
10
|
+
|
|
9
11
|
// `default`: a major entry with a filled round marker; `compact`: a minor entry between two major ones.
|
|
10
12
|
export type TimelineItemSize = "default" | "compact";
|
|
11
13
|
|
|
12
14
|
// The rail through an entry: `dashed` for something missing (a gap).
|
|
13
15
|
export type TimelineLine = "solid" | "dashed";
|
|
14
16
|
|
|
15
|
-
export interface
|
|
17
|
+
export interface TimelineItemFold {
|
|
18
|
+
// The open state when the app keeps it; left out, the entry keeps its own.
|
|
19
|
+
readonly isOpen?: boolean;
|
|
20
|
+
// Whether an entry that keeps its own state starts open; closed by default.
|
|
21
|
+
readonly isOpenInitially?: boolean;
|
|
22
|
+
readonly onOpenChange?: (isOpen: boolean) => void;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface TimelineItemBase {
|
|
16
26
|
// Unique within the timeline; kept on the item as `data-item`.
|
|
17
27
|
readonly key: string;
|
|
18
28
|
readonly title: ReactNode;
|
|
@@ -32,14 +42,21 @@ export interface TimelineItem {
|
|
|
32
42
|
readonly color?: PaletteColor;
|
|
33
43
|
readonly size?: TimelineItemSize;
|
|
34
44
|
readonly line?: TimelineLine;
|
|
35
|
-
//
|
|
36
|
-
//
|
|
37
|
-
readonly onSelect?: () => void;
|
|
45
|
+
// Read before the body button's visible text ("Show on the map"), so the button's name starts with what it does and
|
|
46
|
+
// still contains every word it shows.
|
|
38
47
|
readonly actionLabel?: string;
|
|
39
48
|
// `data-*` attributes set on the item, for an app's own hooks.
|
|
40
49
|
readonly data?: Readonly<Record<`data-${string}`, string | undefined>>;
|
|
41
50
|
}
|
|
42
51
|
|
|
52
|
+
// What the body does: nothing, call `onSelect` as a button, or fold `children` open and closed as a disclosure button
|
|
53
|
+
// (`aria-expanded`), at least the touch target high.
|
|
54
|
+
export type TimelineItem = TimelineItemBase &
|
|
55
|
+
(
|
|
56
|
+
| { readonly onSelect?: () => void; readonly fold?: never }
|
|
57
|
+
| { readonly fold: TimelineItemFold; readonly onSelect?: never }
|
|
58
|
+
);
|
|
59
|
+
|
|
43
60
|
export interface TimelineProps {
|
|
44
61
|
// The list's accessible name.
|
|
45
62
|
readonly label: string;
|
|
@@ -105,6 +122,11 @@ const BODY_CLASS: Readonly<Record<TimelineItemSize, string>> = {
|
|
|
105
122
|
const BUTTON_CLASS =
|
|
106
123
|
"cursor-pointer text-foreground transition-colors duration-120 hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none";
|
|
107
124
|
|
|
125
|
+
// A folding body is at least the touch target high and leaves room for the chevron at its right edge.
|
|
126
|
+
const FOLD_BODY_CLASS = "group/timeline-fold relative min-h-touch-target pr-7";
|
|
127
|
+
const FOLD_CHEVRON_CLASS =
|
|
128
|
+
"absolute top-2 right-1.5 size-4 text-muted-foreground transition-transform duration-150 group-data-[state=open]/timeline-fold:rotate-90";
|
|
129
|
+
|
|
108
130
|
const ITEM_PADDING: Readonly<Record<TimelineItemSize, string>> = {
|
|
109
131
|
default: "pb-2",
|
|
110
132
|
compact: "pb-1",
|
|
@@ -132,11 +154,17 @@ function TimelineEntry({ item }: { readonly item: TimelineItem }) {
|
|
|
132
154
|
<span aria-hidden="true" data-slot="timeline-rail" className={cn(RAIL_CLASS, RAIL_LINE[line])} />
|
|
133
155
|
<TimelineMarker icon={item.icon} color={color} size={size} />
|
|
134
156
|
<div className={cn("flex min-w-0 flex-col", item.aside === undefined && "col-span-2")}>
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
{item.children
|
|
139
|
-
|
|
157
|
+
{item.fold === undefined ? (
|
|
158
|
+
<>
|
|
159
|
+
<TimelineBody item={item} size={size} />
|
|
160
|
+
{item.children === undefined ? null : (
|
|
161
|
+
<div data-slot="timeline-item-content" className="px-2 pb-1">
|
|
162
|
+
{item.children}
|
|
163
|
+
</div>
|
|
164
|
+
)}
|
|
165
|
+
</>
|
|
166
|
+
) : (
|
|
167
|
+
<TimelineFold item={item} fold={item.fold} size={size} />
|
|
140
168
|
)}
|
|
141
169
|
</div>
|
|
142
170
|
{item.aside === undefined ? null : (
|
|
@@ -161,7 +189,7 @@ function TimelineMarker({ icon: Icon, color, size }: { readonly icon?: LucideIco
|
|
|
161
189
|
);
|
|
162
190
|
}
|
|
163
191
|
|
|
164
|
-
function
|
|
192
|
+
function TimelineBodyContent({ item, size }: { readonly item: TimelineItem; readonly size: TimelineItemSize }) {
|
|
165
193
|
const time =
|
|
166
194
|
item.time === undefined ? null : (
|
|
167
195
|
<span data-slot="timeline-item-time" className="text-small text-muted-foreground tabular-nums">
|
|
@@ -180,7 +208,7 @@ function TimelineBody({ item, size }: { readonly item: TimelineItem; readonly si
|
|
|
180
208
|
{item.badges}
|
|
181
209
|
</span>
|
|
182
210
|
);
|
|
183
|
-
|
|
211
|
+
return (
|
|
184
212
|
<>
|
|
185
213
|
{size === "default" ? (
|
|
186
214
|
<>
|
|
@@ -213,6 +241,10 @@ function TimelineBody({ item, size }: { readonly item: TimelineItem; readonly si
|
|
|
213
241
|
)}
|
|
214
242
|
</>
|
|
215
243
|
);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
function TimelineBody({ item, size }: { readonly item: TimelineItem; readonly size: TimelineItemSize }) {
|
|
247
|
+
const content = <TimelineBodyContent item={item} size={size} />;
|
|
216
248
|
if (item.onSelect === undefined) {
|
|
217
249
|
return (
|
|
218
250
|
<div data-slot="timeline-item-body" className={BODY_CLASS[size]}>
|
|
@@ -227,3 +259,24 @@ function TimelineBody({ item, size }: { readonly item: TimelineItem; readonly si
|
|
|
227
259
|
</button>
|
|
228
260
|
);
|
|
229
261
|
}
|
|
262
|
+
|
|
263
|
+
// The body as a disclosure button (`aria-expanded`, `aria-controls`) that folds the entry's content open and closed.
|
|
264
|
+
function TimelineFold({ item, fold, size }: { readonly item: TimelineItem; readonly fold: TimelineItemFold; readonly size: TimelineItemSize }) {
|
|
265
|
+
return (
|
|
266
|
+
<Collapsible
|
|
267
|
+
{...(fold.isOpen === undefined ? {} : { open: fold.isOpen })}
|
|
268
|
+
defaultOpen={fold.isOpenInitially ?? false}
|
|
269
|
+
{...(fold.onOpenChange === undefined ? {} : { onOpenChange: fold.onOpenChange })}
|
|
270
|
+
className="flex min-w-0 flex-col"
|
|
271
|
+
>
|
|
272
|
+
<CollapsibleTrigger data-slot="timeline-item-body" className={cn(BODY_CLASS[size], BUTTON_CLASS, FOLD_BODY_CLASS)}>
|
|
273
|
+
{item.actionLabel === undefined ? null : <span className="sr-only">{`${item.actionLabel}: `}</span>}
|
|
274
|
+
<TimelineBodyContent item={item} size={size} />
|
|
275
|
+
<ChevronRight aria-hidden="true" strokeWidth={ICON_STROKE_WIDTH} className={FOLD_CHEVRON_CLASS} />
|
|
276
|
+
</CollapsibleTrigger>
|
|
277
|
+
<CollapsibleContent data-slot="timeline-item-content" className="px-2 pb-1">
|
|
278
|
+
{item.children}
|
|
279
|
+
</CollapsibleContent>
|
|
280
|
+
</Collapsible>
|
|
281
|
+
);
|
|
282
|
+
}
|
package/src/ui/dialog.tsx
CHANGED
|
@@ -54,6 +54,7 @@ function DialogContent({
|
|
|
54
54
|
showCloseButton = true,
|
|
55
55
|
closeLabel = messages.dialog.close,
|
|
56
56
|
closeButtonSize = "default",
|
|
57
|
+
size = "default",
|
|
57
58
|
...props
|
|
58
59
|
}: React.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
59
60
|
showCloseButton?: boolean
|
|
@@ -61,6 +62,8 @@ function DialogContent({
|
|
|
61
62
|
closeLabel?: string
|
|
62
63
|
// `touch` draws the close button 44 x 44, centred on the same icon.
|
|
63
64
|
closeButtonSize?: "default" | "touch"
|
|
65
|
+
// `wide` is half the viewport from `lg`, `max-w-lg` below it.
|
|
66
|
+
size?: "default" | "wide"
|
|
64
67
|
}) {
|
|
65
68
|
return (
|
|
66
69
|
<DialogPortal data-slot="dialog-portal">
|
|
@@ -69,6 +72,7 @@ function DialogContent({
|
|
|
69
72
|
data-slot="dialog-content"
|
|
70
73
|
className={cn(
|
|
71
74
|
"fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl bg-background p-6 shadow-dialog duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg",
|
|
75
|
+
size === "wide" && "lg:max-w-1/2",
|
|
72
76
|
className
|
|
73
77
|
)}
|
|
74
78
|
{...props}
|
|
@@ -105,10 +109,13 @@ function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
105
109
|
function DialogFooter({
|
|
106
110
|
className,
|
|
107
111
|
showCloseButton = false,
|
|
112
|
+
closeLabel = messages.dialog.close,
|
|
108
113
|
children,
|
|
109
114
|
...props
|
|
110
115
|
}: React.ComponentProps<"div"> & {
|
|
111
116
|
showCloseButton?: boolean
|
|
117
|
+
// The close button's text, from the app's message layer.
|
|
118
|
+
closeLabel?: string
|
|
112
119
|
}) {
|
|
113
120
|
return (
|
|
114
121
|
<div
|
|
@@ -122,7 +129,7 @@ function DialogFooter({
|
|
|
122
129
|
{children}
|
|
123
130
|
{showCloseButton && (
|
|
124
131
|
<DialogPrimitive.Close asChild>
|
|
125
|
-
<Button variant="outline">
|
|
132
|
+
<Button variant="outline">{closeLabel}</Button>
|
|
126
133
|
</DialogPrimitive.Close>
|
|
127
134
|
)}
|
|
128
135
|
</div>
|
package/src/ui/scroll-area.tsx
CHANGED
|
@@ -8,9 +8,12 @@ function ScrollArea({
|
|
|
8
8
|
className,
|
|
9
9
|
children,
|
|
10
10
|
viewportProps,
|
|
11
|
+
scrollbars = "vertical",
|
|
11
12
|
...props
|
|
12
13
|
}: React.ComponentProps<typeof ScrollAreaPrimitive.Root> & {
|
|
13
14
|
viewportProps?: React.ComponentProps<typeof ScrollAreaPrimitive.Viewport>
|
|
15
|
+
// Which bars it draws: `horizontal` for a strip wider than its box, `both` for a table.
|
|
16
|
+
scrollbars?: "vertical" | "horizontal" | "both"
|
|
14
17
|
}) {
|
|
15
18
|
return (
|
|
16
19
|
<ScrollAreaPrimitive.Root
|
|
@@ -30,7 +33,8 @@ function ScrollArea({
|
|
|
30
33
|
>
|
|
31
34
|
{children}
|
|
32
35
|
</ScrollAreaPrimitive.Viewport>
|
|
33
|
-
<ScrollBar />
|
|
36
|
+
{scrollbars !== "horizontal" && <ScrollBar />}
|
|
37
|
+
{scrollbars !== "vertical" && <ScrollBar orientation="horizontal" />}
|
|
34
38
|
<ScrollAreaPrimitive.Corner />
|
|
35
39
|
</ScrollAreaPrimitive.Root>
|
|
36
40
|
)
|
package/src/ui/tabs.tsx
CHANGED
|
@@ -21,7 +21,7 @@ function Tabs({
|
|
|
21
21
|
data-orientation={orientation}
|
|
22
22
|
orientation={orientation}
|
|
23
23
|
className={cn(
|
|
24
|
-
"group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",
|
|
24
|
+
"group/tabs flex gap-2 data-[orientation=horizontal]:flex-col has-data-[scrollable=true]:min-w-0",
|
|
25
25
|
className
|
|
26
26
|
)}
|
|
27
27
|
{...props}
|
|
@@ -42,27 +42,65 @@ const tabsListVariants = cva(
|
|
|
42
42
|
// The triggers set the height: a fixed one would cap them at 35 px.
|
|
43
43
|
touch: "group-data-[orientation=horizontal]/tabs:h-auto",
|
|
44
44
|
},
|
|
45
|
+
// Keeps to its container's width and scrolls sideways; the line variant keeps room for the active underline.
|
|
46
|
+
scrollable: {
|
|
47
|
+
false: "",
|
|
48
|
+
true: "relative w-full max-w-full min-w-0 justify-start overflow-x-auto overflow-y-hidden overscroll-x-contain [scrollbar-width:thin] group-data-[orientation=horizontal]/tabs:h-auto data-[variant=line]:pb-1.5 *:flex-none",
|
|
49
|
+
},
|
|
45
50
|
},
|
|
46
51
|
defaultVariants: {
|
|
47
52
|
variant: "line",
|
|
48
53
|
size: "default",
|
|
54
|
+
scrollable: false,
|
|
49
55
|
},
|
|
50
56
|
}
|
|
51
57
|
)
|
|
52
58
|
|
|
59
|
+
// Scrolls a scrollable list so its active trigger sits in the middle, now and whenever the active tab changes.
|
|
60
|
+
function useCentredActiveTrigger(list: React.RefObject<HTMLDivElement | null>, isScrollable: boolean) {
|
|
61
|
+
React.useEffect(() => {
|
|
62
|
+
const element = list.current
|
|
63
|
+
if (!isScrollable || element === null) return
|
|
64
|
+
const centreActiveTrigger = () => {
|
|
65
|
+
const active = element.querySelector<HTMLElement>('[data-slot="tabs-trigger"][data-state="active"]')
|
|
66
|
+
if (active === null) return
|
|
67
|
+
element.scrollLeft = active.offsetLeft - (element.clientWidth - active.offsetWidth) / 2
|
|
68
|
+
}
|
|
69
|
+
centreActiveTrigger()
|
|
70
|
+
const observer = new MutationObserver(centreActiveTrigger)
|
|
71
|
+
observer.observe(element, { subtree: true, attributeFilter: ["data-state"] })
|
|
72
|
+
return () => observer.disconnect()
|
|
73
|
+
}, [list, isScrollable])
|
|
74
|
+
}
|
|
75
|
+
|
|
53
76
|
function TabsList({
|
|
54
77
|
className,
|
|
55
78
|
variant = "line",
|
|
56
79
|
size = "default",
|
|
80
|
+
scrollable = false,
|
|
81
|
+
ref,
|
|
57
82
|
...props
|
|
58
83
|
}: React.ComponentProps<typeof TabsPrimitive.List> &
|
|
59
84
|
VariantProps<typeof tabsListVariants>) {
|
|
85
|
+
const listRef = React.useRef<HTMLDivElement | null>(null)
|
|
86
|
+
const setListRef = React.useCallback(
|
|
87
|
+
(node: HTMLDivElement | null) => {
|
|
88
|
+
listRef.current = node
|
|
89
|
+
if (typeof ref === "function") ref(node)
|
|
90
|
+
else if (ref) ref.current = node
|
|
91
|
+
},
|
|
92
|
+
[ref]
|
|
93
|
+
)
|
|
94
|
+
useCentredActiveTrigger(listRef, scrollable === true)
|
|
95
|
+
|
|
60
96
|
return (
|
|
61
97
|
<TabsTriggerSizeContext.Provider value={size ?? "default"}>
|
|
62
98
|
<TabsPrimitive.List
|
|
63
99
|
data-slot="tabs-list"
|
|
64
100
|
data-variant={variant}
|
|
65
|
-
|
|
101
|
+
data-scrollable={scrollable === true ? "true" : undefined}
|
|
102
|
+
ref={setListRef}
|
|
103
|
+
className={cn(tabsListVariants({ variant, size, scrollable }), className)}
|
|
66
104
|
{...props}
|
|
67
105
|
/>
|
|
68
106
|
</TabsTriggerSizeContext.Provider>
|