@softure-ai/theme-notion 0.8.0 → 0.10.1
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 +58 -0
- package/README.md +133 -2
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/notion/InstallBar.d.ts +23 -0
- package/dist/notion/InstallBar.d.ts.map +1 -0
- package/dist/notion/InstallBar.js +16 -0
- package/dist/notion/InstallBar.js.map +1 -0
- package/dist/notion/MiniProgress.d.ts +13 -0
- package/dist/notion/MiniProgress.d.ts.map +1 -0
- package/dist/notion/MiniProgress.js +24 -0
- package/dist/notion/MiniProgress.js.map +1 -0
- package/dist/notion/SheetMenu.d.ts +9 -0
- package/dist/notion/SheetMenu.d.ts.map +1 -0
- package/dist/notion/SheetMenu.js +19 -0
- package/dist/notion/SheetMenu.js.map +1 -0
- package/dist/notion/Status.d.ts +2 -1
- package/dist/notion/Status.d.ts.map +1 -1
- package/dist/notion/Status.js +7 -2
- package/dist/notion/Status.js.map +1 -1
- package/dist/notion/UpdatePrompt.d.ts +13 -0
- package/dist/notion/UpdatePrompt.d.ts.map +1 -0
- package/dist/notion/UpdatePrompt.js +16 -0
- package/dist/notion/UpdatePrompt.js.map +1 -0
- package/dist/ui/accordion.d.ts +3 -1
- package/dist/ui/accordion.d.ts.map +1 -1
- package/dist/ui/accordion.js +2 -2
- package/dist/ui/accordion.js.map +1 -1
- package/dist/ui/badge.js +1 -1
- package/dist/ui/badge.js.map +1 -1
- package/dist/ui/button.d.ts +1 -1
- package/dist/ui/button.d.ts.map +1 -1
- package/dist/ui/button.js +2 -0
- package/dist/ui/button.js.map +1 -1
- package/dist/ui/dialog.d.ts +2 -1
- package/dist/ui/dialog.d.ts.map +1 -1
- package/dist/ui/dialog.js +3 -2
- package/dist/ui/dialog.js.map +1 -1
- package/dist/ui/dropdown-menu.d.ts +14 -5
- package/dist/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/ui/dropdown-menu.js +21 -10
- package/dist/ui/dropdown-menu.js.map +1 -1
- package/dist/ui/select.d.ts +8 -3
- package/dist/ui/select.d.ts.map +1 -1
- package/dist/ui/select.js +10 -5
- package/dist/ui/select.js.map +1 -1
- package/dist/ui/tabs.d.ts +6 -2
- package/dist/ui/tabs.d.ts.map +1 -1
- package/dist/ui/tabs.js +13 -4
- package/dist/ui/tabs.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +4 -0
- package/src/notion/InstallBar.tsx +75 -0
- package/src/notion/MiniProgress.tsx +67 -0
- package/src/notion/SheetMenu.tsx +41 -0
- package/src/notion/Status.tsx +14 -3
- package/src/notion/UpdatePrompt.tsx +47 -0
- package/src/ui/accordion.tsx +5 -1
- package/src/ui/badge.tsx +1 -1
- package/src/ui/button.tsx +3 -0
- package/src/ui/dialog.tsx +8 -1
- package/src/ui/dropdown-menu.tsx +55 -16
- package/src/ui/select.tsx +23 -5
- package/src/ui/tabs.tsx +27 -7
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,64 @@ 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.1
|
|
8
|
+
|
|
9
|
+
- The content of 0.10.0, which was never published: its release stopped at the gates (ESLint ran out of memory in
|
|
10
|
+
`release.yml`) before publishing, and a tag is never moved.
|
|
11
|
+
|
|
12
|
+
## 0.10.0
|
|
13
|
+
|
|
14
|
+
- Touch sizes for menus, tabs, accordion and dialog close (#880), the rest of #859. `DropdownMenuContent` gains
|
|
15
|
+
`size` (`"default"` or `"touch"`) and so do `DropdownMenuItem`, `DropdownMenuCheckboxItem`, `DropdownMenuRadioItem`
|
|
16
|
+
and `DropdownMenuSubTrigger`: a touch menu draws every row at least 44 px high (`min-h-touch-target`), and a row's
|
|
17
|
+
own `size` wins over its menu's. `TabsList` (and `tabsListVariants`) gains `size`: a touch list drops its fixed
|
|
18
|
+
36 px height and its triggers are at least 44 × 44 (`min-h-touch-target min-w-touch-target`); `TabsTrigger size`
|
|
19
|
+
wins over the list's. `AccordionTrigger` gains `size="touch"` (`min-h-touch-target`). `DialogContent` gains
|
|
20
|
+
`closeButtonSize="touch"`: the close button is 44 × 44 (`size-touch-target`) around the same icon. Defaults render
|
|
21
|
+
as before. An app that wrote `min-h-touch-target min-w-touch-target` on these controls replaces it with the size.
|
|
22
|
+
- `MiniProgress` (#871): a compact bar with its figure inside, for a table cell or a tile. A 20 px `primary/12` track
|
|
23
|
+
that takes the cell's width (at least 64 px), filled in `primary` (`link` in dark) or a `tone`'s colour; `value`
|
|
24
|
+
0–100 clamped, `label` (default: the rounded percent) drawn in `foreground` on the track and in `background` clipped
|
|
25
|
+
to the fill, AA on both in both schemes, truncated with an ellipsis in a narrow cell. A string label is the bar's
|
|
26
|
+
`aria-valuetext`. An app that put a figure in a fixed-width span next to `Progress` (`flex gap-2` + `w-16` +
|
|
27
|
+
`Progress`) swaps the pair for one `MiniProgress` and drops the widths.
|
|
28
|
+
- `UpdatePrompt` (#872): the offer to reload into a new build, for an installed app on `@softure-ai/pwa`. A floating
|
|
29
|
+
`Alert` at the bottom of the screen inside the safe-area insets, with a reload `Button` at the touch height (`md:h-7`
|
|
30
|
+
on a desktop); a polite `status`, drawn only while `open`. The copy is props, keyed like `pwaMessages.en.update`:
|
|
31
|
+
`<UpdatePrompt open={isUpdateReady} onReload={activate} {...messages.update} />`.
|
|
32
|
+
- `InstallBar` (#873): the offer to install the app on a phone, for an app on `@softure-ai/pwa`. A floating `Alert`
|
|
33
|
+
like `UpdatePrompt`, with the browser's install button (`offer="browser_prompt"`) or the two iOS steps, Share then
|
|
34
|
+
Add to Home Screen (`offer="ios_steps"`), and a labelled close button, both at the touch size on a phone; nothing for
|
|
35
|
+
`offer="none"`. The copy is props, keyed like `pwaMessages.en.install`:
|
|
36
|
+
`<InstallBar offer={offer} onInstall={() => void install()} onClose={close} {...messages.install} />`.
|
|
37
|
+
|
|
38
|
+
## 0.9.0
|
|
39
|
+
|
|
40
|
+
- `Badge` and `Status` in a narrow container (#864): a badge is capped at its container's width (`max-w-full`), so a
|
|
41
|
+
long word no longer runs past a card's edge. `Status` puts its word in a `<span data-slot="status-label"
|
|
42
|
+
class="min-w-0 truncate">`: the word, not the icon, shrinks and ends in an ellipsis, and the badge's `title` is the
|
|
43
|
+
full word when it is a string or a number (a new optional `title` prop sets it for any other node or overrides it).
|
|
44
|
+
A plain `Badge` clips its text at the end (`justify-center-safe`, so a cut text keeps its start); an app that wants
|
|
45
|
+
an ellipsis there wraps the text in `<span className="min-w-0 truncate">`. A badge whose text fits looks as before.
|
|
46
|
+
An app drops its `max-w-full` on `Badge`/`Status` and its own truncating span inside `Status`; a selector that read
|
|
47
|
+
`Status`'s text still finds it, now inside `status-label`.
|
|
48
|
+
- `SheetMenu`, `SheetMenuItem` and `SheetMenuButton` (#858): navigation rows for a side `Sheet` (a phone's drawer)
|
|
49
|
+
that need no `SidebarProvider`. A row is full width, icon and label left-aligned in `foreground` (`text-ui`), 44 px
|
|
50
|
+
tall on a phone and 34 px from `md`, hovered, pressed and active in `accent` like the sidebar's rows, `disabled`
|
|
51
|
+
dimmed; `asChild` renders a link, `SheetClose asChild` around it closes the drawer. The README shows the drawer
|
|
52
|
+
recipe: `showCloseButton={false}`, a ghost close `Button` in the `SheetHeader` row, the foot rows in a `SheetFooter`
|
|
53
|
+
with `border-t`. An app that laid out ghost `Button`s as rows (`size="lg" className="min-h-touch-target w-full
|
|
54
|
+
justify-start text-ui text-foreground"`) wraps them in `SheetMenu` / `SheetMenuItem`, swaps each `Button` for
|
|
55
|
+
`SheetMenuButton` and drops those classes.
|
|
56
|
+
- Touch sizes (#859): the controls a phone view taps most reach the `touch-target` token (44 px). `Button` gains the
|
|
57
|
+
sizes `touch` (`h-touch-target px-3`, the icon side padded like `lg`) and `icon-touch` (`size-touch-target`);
|
|
58
|
+
`SelectTrigger` gains `size="touch"` (`h-touch-target`); `SelectContent` and `SelectItem` gain `size` (`"default"` or
|
|
59
|
+
`"touch"`): a touch list draws every item at least 44 px high (`min-h-touch-target`), and an item's own `size` wins
|
|
60
|
+
over its list's. The heights are plain classes, so a caller's breakpoint class (`md:h-7`, `md:size-7`,
|
|
61
|
+
`md:min-h-7`) brings the pointer size back on a desktop. Existing sizes are unchanged. An app that used the
|
|
62
|
+
workaround `min-h-touch-target min-w-touch-target` on a `Button`, `SelectTrigger` or `SelectItem` replaces it with
|
|
63
|
+
the size (`size="touch"`, `size="icon-touch"`, or `size="touch"` on the `SelectContent`).
|
|
64
|
+
|
|
7
65
|
## 0.8.0
|
|
8
66
|
|
|
9
67
|
- Safe-area insets (#851): with `viewport-fit=cover` (an app installed on a phone's home screen), the parts at a
|
package/README.md
CHANGED
|
@@ -98,6 +98,10 @@ name outside a `CommandDialog`; without it the field has none), `SortableList in
|
|
|
98
98
|
(button, field, menu item), `lg` 8 (callout, card), `xl` 10 (menu, select, dialog), `full` (switch).
|
|
99
99
|
- Icons: lucide at `ICON_STROKE_WIDTH` (1.75), 16 px in text; they inherit the text colour. No emoji in the interface.
|
|
100
100
|
- Statuses always carry a word and an icon, so states read apart without telling green from red.
|
|
101
|
+
- A badge never leaves its container (`max-w-full`). In a narrow one (a grid card, a table cell) a `Status` word that
|
|
102
|
+
does not fit ends in an ellipsis while the icon keeps its size, and the full word is the badge's `title` when it is
|
|
103
|
+
a string or a number (pass `title` for any other node). A plain `Badge` clips its text at the end; wrap the
|
|
104
|
+
text in `<span className="min-w-0 truncate">` for an ellipsis.
|
|
101
105
|
- Installed on a phone's home screen (`viewport-fit=cover`), the parts at a screen edge pad by the screen's
|
|
102
106
|
safe-area insets on the edges they touch: `SheetContent` (every `side`, its close button too), the `Sidebar` on a
|
|
103
107
|
phone, the popper `SelectContent` (its height stops short of the inset it opens towards) and `PageFrame`. The insets
|
|
@@ -127,11 +131,42 @@ sidebar, skeleton, sonner (`Toaster`), spinner, switch, table, tabs, textarea, t
|
|
|
127
131
|
word), `PageHeader` (breadcrumb, icon box, title, description, actions), `PropertyList` (fields of one record),
|
|
128
132
|
`DetailTable` (an item's details as a label and value table), `FoldRow` (a list row folding open to a `DetailTable`
|
|
129
133
|
and more, a native `<details>`), `PageFrame` (a page outside the app shell, the target of `sft-bridge.css`),
|
|
130
|
-
`SidePanel` (a non-modal panel at a side of a canvas, below), `
|
|
134
|
+
`SidePanel` (a non-modal panel at a side of a canvas, below), `SheetMenu`, `SheetMenuItem` and `SheetMenuButton`
|
|
135
|
+
(navigation rows in a side `Sheet`, a phone's drawer, below), `TabBar` (a screen's tabs as links with an optional icon
|
|
131
136
|
and count, the shown tab in the address; `Tabs` keeps it in client state), `MarkPopover` (a counted tag that opens a
|
|
132
137
|
list of what it counts, below), `FilterChip` and `FilterChipAdd` (a list's filter pills, below), `Steps` (numbered
|
|
133
138
|
stages with a state, below), `Timeline` (dated entries on a vertical rail, below), `Code` (inline code) and `CodeBlock` (a mono block for logs and paths, below),
|
|
134
|
-
`SortableList`, `SortableItem`, `SortableHandle` and `SortableActivator` (rows reordered by dragging, below)
|
|
139
|
+
`SortableList`, `SortableItem`, `SortableHandle` and `SortableActivator` (rows reordered by dragging, below),
|
|
140
|
+
`MiniProgress` (a compact bar with its figure inside, for a table cell or a tile, below),
|
|
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).
|
|
143
|
+
|
|
144
|
+
**Touch sizes.** The controls a phone view taps most reach the `touch-target` token (44 px, Apple's HIG and WCAG
|
|
145
|
+
2.5.5): `Button` sizes `touch` (44 px high, padded like `lg`) and `icon-touch` (44 × 44), `SelectTrigger`
|
|
146
|
+
`size="touch"`, and `SelectItem` at least 44 px high, for a whole list (`SelectContent size="touch"`) or one item
|
|
147
|
+
(`SelectItem size="touch"`; an item's own `size` wins over its list's). The same rule holds for the dropdown menu
|
|
148
|
+
(`DropdownMenuContent size="touch"`, or `size="touch"` on a `DropdownMenuItem`, `DropdownMenuCheckboxItem`,
|
|
149
|
+
`DropdownMenuRadioItem` or `DropdownMenuSubTrigger`) and the tabs (`TabsList size="touch"` grows to its triggers,
|
|
150
|
+
each at least 44 × 44, or `TabsTrigger size="touch"`). `AccordionTrigger size="touch"` is at least 44 px high
|
|
151
|
+
whatever its padding, and `DialogContent closeButtonSize="touch"` draws the close button 44 × 44 around the same
|
|
152
|
+
icon. Each sets its height with a plain class, so one breakpoint class brings the pointer size back on a desktop.
|
|
153
|
+
|
|
154
|
+
```tsx
|
|
155
|
+
<Button size="touch" className="md:h-7 md:px-2.5">Save</Button>
|
|
156
|
+
<Button size="icon-touch" aria-label="Add" className="md:size-7"><Plus /></Button>
|
|
157
|
+
<Select>
|
|
158
|
+
<SelectTrigger size="touch" className="md:h-7" aria-label="View"><SelectValue /></SelectTrigger>
|
|
159
|
+
<SelectContent size="touch" position="popper">
|
|
160
|
+
<SelectItem value="table" className="md:min-h-7">Table</SelectItem>
|
|
161
|
+
</SelectContent>
|
|
162
|
+
</Select>
|
|
163
|
+
<DropdownMenuContent size="touch">
|
|
164
|
+
<DropdownMenuItem className="md:min-h-7">Rename</DropdownMenuItem>
|
|
165
|
+
</DropdownMenuContent>
|
|
166
|
+
<TabsList size="touch">
|
|
167
|
+
<TabsTrigger value="all" className="md:min-h-0 md:min-w-0">All</TabsTrigger>
|
|
168
|
+
</TabsList>
|
|
169
|
+
```
|
|
135
170
|
|
|
136
171
|
**`FoldRow`.** An item as one list row in a native `<details>`: a chevron, the title, short facts and badges on the
|
|
137
172
|
right; opened, it shows a `DetailTable` and its `children`. The opened content is padded 12 px on all four sides
|
|
@@ -184,6 +219,60 @@ Escape inside or the close button calls `onClose`, and the caller moves focus ba
|
|
|
184
219
|
</div>
|
|
185
220
|
```
|
|
186
221
|
|
|
222
|
+
**`SheetMenu`.** A phone's navigation drawer: a `Sheet` from the right with a heading and a ghost close button,
|
|
223
|
+
navigation rows at the top and one row at the foot, the way a desktop `Sidebar` ends with its foot menu.
|
|
224
|
+
`SheetMenu` (`ul`), `SheetMenuItem` (`li`) and `SheetMenuButton` (the row) mirror `SidebarMenu`, `SidebarMenuItem`
|
|
225
|
+
and `SidebarMenuButton`, but need no `SidebarProvider`. A row is full width, its icon and label left-aligned in the
|
|
226
|
+
`foreground` colour (`text-ui`, icons 16 px), 44 px tall on a phone (`min-h-touch-target`) and a 34 px list row from
|
|
227
|
+
`md` (`min-h-row-height`); hover, press and the active row (`isActive`, `data-active`) take `accent`, focus the
|
|
228
|
+
`ring`; `disabled` (or `aria-disabled` on a link) dims it to 50 % and drops its clicks. `asChild` renders a link with
|
|
229
|
+
the row's look (add `aria-current="page"` on the active one); wrap a row in `SheetClose asChild` to close the drawer
|
|
230
|
+
on a click. The heading and the foot are a recipe from the existing parts: `showCloseButton={false}` on
|
|
231
|
+
`SheetContent`, the close as a ghost icon `Button` in a `SheetHeader` row, and the foot rows in a `SheetFooter`
|
|
232
|
+
(already pushed to the panel's foot by `mt-auto`) with `border-t`.
|
|
233
|
+
|
|
234
|
+
```tsx
|
|
235
|
+
<Sheet open={isOpen} onOpenChange={setOpen}>
|
|
236
|
+
<SheetContent side="right" showCloseButton={false} className="gap-0">
|
|
237
|
+
<SheetHeader className="flex-row items-center justify-between gap-2 border-b py-2 pr-2 pl-4">
|
|
238
|
+
<SheetTitle>Workspace</SheetTitle>
|
|
239
|
+
<SheetClose asChild>
|
|
240
|
+
<Button variant="ghost" size="icon" aria-label={t("menu.close")}>
|
|
241
|
+
<X aria-hidden="true" strokeWidth={ICON_STROKE_WIDTH} />
|
|
242
|
+
</Button>
|
|
243
|
+
</SheetClose>
|
|
244
|
+
</SheetHeader>
|
|
245
|
+
<nav aria-label={t("menu.label")} className="p-2">
|
|
246
|
+
<SheetMenu>
|
|
247
|
+
<SheetMenuItem>
|
|
248
|
+
<SheetClose asChild>
|
|
249
|
+
<SheetMenuButton asChild isActive>
|
|
250
|
+
<Link href="/" aria-current="page">
|
|
251
|
+
<House aria-hidden="true" strokeWidth={ICON_STROKE_WIDTH} />
|
|
252
|
+
<span>{t("menu.home")}</span>
|
|
253
|
+
</Link>
|
|
254
|
+
</SheetMenuButton>
|
|
255
|
+
</SheetClose>
|
|
256
|
+
</SheetMenuItem>
|
|
257
|
+
</SheetMenu>
|
|
258
|
+
</nav>
|
|
259
|
+
<SheetFooter className="border-t p-2">
|
|
260
|
+
<SheetMenu>
|
|
261
|
+
<SheetMenuItem>
|
|
262
|
+
<SheetMenuButton onClick={signOut}>
|
|
263
|
+
<LogOut aria-hidden="true" strokeWidth={ICON_STROKE_WIDTH} />
|
|
264
|
+
<span>{t("menu.signOut")}</span>
|
|
265
|
+
</SheetMenuButton>
|
|
266
|
+
</SheetMenuItem>
|
|
267
|
+
</SheetMenu>
|
|
268
|
+
</SheetFooter>
|
|
269
|
+
</SheetContent>
|
|
270
|
+
</Sheet>
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
An app that laid out ghost `Button`s itself (`size="lg" className="min-h-touch-target w-full justify-start text-ui
|
|
274
|
+
text-foreground"`) moves each row to `SheetMenuButton` and drops those classes.
|
|
275
|
+
|
|
187
276
|
A screen's summary figures: `StatsFold` (figures folded under a heading, closed by default, on native `<details>`),
|
|
188
277
|
`StatCards` (a wrapping row of figure cards: label, figure in its tone, optional `progress` bar under the figure,
|
|
189
278
|
optional `hint`, optional `aside` tag; `isFullWidth` and `isOneRow` change the grid) and `StatPills` ("label **value**" tags in one row). Each figure takes a
|
|
@@ -256,6 +345,26 @@ and the body's parts mark the parts.
|
|
|
256
345
|
/>
|
|
257
346
|
```
|
|
258
347
|
|
|
348
|
+
**`MiniProgress`.** A share with its figure inside the bar, for a table cell or a tile where a figure next to a
|
|
349
|
+
`Progress` would collide with it: a 20 px rounded track (`primary/12`) that takes the cell's width (at least 64 px),
|
|
350
|
+
filled in `primary` (the link blue in dark, as in `Progress`) or in its `tone`'s colour. `value` is 0–100, clamped
|
|
351
|
+
(non-finite reads as 0); `label` is the text inside (default: the rounded percent). The label is drawn twice: in
|
|
352
|
+
`foreground` on the track and in the page `background` clipped to the fill, so it reads at any value, also where the
|
|
353
|
+
fill's edge crosses a letter, and passes AA on the track and on every fill in both schemes. A label wider than the cell
|
|
354
|
+
ends in an ellipsis inside the bar. The bar is Radix's `progressbar`: a string label is its `aria-valuetext` (the amount
|
|
355
|
+
is announced, not only the percent), the drawn copies are `aria-hidden`; give it a name with `aria-label`. Slots:
|
|
356
|
+
`mini-progress` (with `data-tone`), `mini-progress-indicator`, `mini-progress-label`.
|
|
357
|
+
|
|
358
|
+
```tsx
|
|
359
|
+
<TableCell className="w-24">
|
|
360
|
+
<MiniProgress value={task.costShare} label={formatUsd(task.costUsd)} aria-label={messages.costShare} />
|
|
361
|
+
</TableCell>
|
|
362
|
+
<MiniProgress value={82} tone="warning" aria-label={messages.budgetUsed} />
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
An app that set a figure in a fixed-width span next to `Progress` (`flex gap-2` + `w-16` + `Progress`) swaps the
|
|
366
|
+
pair for one `MiniProgress` and drops the widths.
|
|
367
|
+
|
|
259
368
|
**`MarkPopover`.** A tag in a palette colour with an icon and a count; a click or Enter opens the design system's
|
|
260
369
|
popover listing the entries, Escape or a click outside closes it. It runs on the browser's Popover API (no client
|
|
261
370
|
state, no portal): the panel sits in the top layer, so a card's `overflow` never clips it, centred on a phone and
|
|
@@ -281,6 +390,28 @@ plain text. No syntax highlighting. `data-slot="code"` and `data-slot="code-bloc
|
|
|
281
390
|
<CodeBlock label="Build log" wrap>{log}</CodeBlock>
|
|
282
391
|
```
|
|
283
392
|
|
|
393
|
+
**`UpdatePrompt`.** The offer to reload into a new build, for an installed app on `@softure-ai/pwa`: a floating
|
|
394
|
+
`Alert` at the bottom of the screen (`shadow-menu`, at most `max-w-md`), padded by the safe-area insets so it clears a
|
|
395
|
+
phone's home indicator and notch, with a reload `Button` at the touch height (`md:h-7` on a desktop). It is a polite
|
|
396
|
+
`status`, not an `alert`, so it never interrupts a screen reader. It draws nothing until `open`. The copy is props,
|
|
397
|
+
keyed like `pwaMessages.en.update`; `data-slot="update-prompt"` marks the root.
|
|
398
|
+
|
|
399
|
+
```tsx
|
|
400
|
+
const { isUpdateReady, activate } = useServiceWorkerUpdate(); // @softure-ai/pwa/react
|
|
401
|
+
<UpdatePrompt open={isUpdateReady} onReload={activate} {...messages.update} />
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
**`InstallBar`.** The offer to install the app on a phone, for an app on `@softure-ai/pwa`: a floating `Alert` like
|
|
405
|
+
`UpdatePrompt` (bottom of the screen, inside the safe-area insets, `max-w-md`), with the browser's install `Button` at
|
|
406
|
+
the touch height for `offer="browser_prompt"`, or the two iOS steps with their icons (Share, then Add to Home Screen)
|
|
407
|
+
for `offer="ios_steps"`, and a ghost close `Button` at `icon-touch` (`md:size-7` on a desktop) labelled by `close`. It
|
|
408
|
+
is a polite `status` and draws nothing for `offer="none"`. The copy is props, keyed like `pwaMessages.en.install`:
|
|
409
|
+
|
|
410
|
+
```tsx
|
|
411
|
+
const { offer, install, close } = useInstallOffer({ app: "fire" }); // @softure-ai/pwa/react
|
|
412
|
+
<InstallBar offer={offer} onInstall={() => void install()} onClose={close} {...messages.install} />
|
|
413
|
+
```
|
|
414
|
+
|
|
284
415
|
**`SortableList`.** A list whose rows are reordered by dragging, built on the headless `@dnd-kit/core` and
|
|
285
416
|
`@dnd-kit/sortable`. On a touch screen a long press (`holdDelay`, 500 ms) lifts a row; moving more than `tolerance`
|
|
286
417
|
(8 px) before that scrolls instead, and a tap still activates the row. A mouse drags the same way; from the keyboard
|
package/dist/index.d.ts
CHANGED
|
@@ -44,11 +44,14 @@ export { Code, CodeBlock, type CodeBlockProps } from "./notion/Code.js";
|
|
|
44
44
|
export { DetailTable, type DetailRow, type DetailTableProps } from "./notion/DetailTable.js";
|
|
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
|
+
export { InstallBar, type InstallBarOffer, type InstallBarProps } from "./notion/InstallBar.js";
|
|
47
48
|
export { PALETTE_COLORS, type PaletteColor } from "./notion/palette.js";
|
|
48
49
|
export { MarkPopover, type MarkPopoverProps } from "./notion/MarkPopover.js";
|
|
50
|
+
export { MiniProgress, type MiniProgressProps } from "./notion/MiniProgress.js";
|
|
49
51
|
export { PageFrame, type PageFrameProps } from "./notion/PageFrame.js";
|
|
50
52
|
export { PageHeader, type PageCrumb, type PageHeaderProps } from "./notion/PageHeader.js";
|
|
51
53
|
export { PropertyList, type Property, type PropertyListProps } from "./notion/PropertyList.js";
|
|
54
|
+
export { SheetMenu, SheetMenuButton, SheetMenuItem, type SheetMenuButtonProps } from "./notion/SheetMenu.js";
|
|
52
55
|
export { SidePanel, type SidePanelLayout, type SidePanelProps } from "./notion/SidePanel.js";
|
|
53
56
|
export { SortableActivator, SortableHandle, SortableItem, SortableList, type SortableActivatorProps, type SortableAnnouncements, type SortableDragBy, type SortableHandleProps, type SortableItemProps, type SortableListProps, type SortableMove, } from "./notion/Sortable.js";
|
|
54
57
|
export { StatCards, StatPills, StatsFold, type StatCard, type StatCardAside, type StatCardsProps, type StatPill, type StatPillsProps, type StatsFoldProps, } from "./notion/Stats.js";
|
|
@@ -56,5 +59,6 @@ export { Status, type StatusProps } from "./notion/Status.js";
|
|
|
56
59
|
export { Steps, type StepItem, type StepState, type StepsLayout, type StepsProps } from "./notion/Steps.js";
|
|
57
60
|
export { TabBar, type TabBarItem, type TabBarProps } from "./notion/TabBar.js";
|
|
58
61
|
export { Timeline, type TimelineItem, type TimelineItemSize, type TimelineLine, type TimelineProps } from "./notion/Timeline.js";
|
|
62
|
+
export { UpdatePrompt, type UpdatePromptProps } from "./notion/UpdatePrompt.js";
|
|
59
63
|
export { TONES, TONE_COLORS, TONE_EDGE, TONE_FILL, TONE_TEXT, type Tone } from "./notion/tones.js";
|
|
60
64
|
//# 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,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,iBAAiB,CAAC;AA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AK,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,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACjI,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
|
@@ -46,11 +46,14 @@ export { Code, CodeBlock } from "./notion/Code.js";
|
|
|
46
46
|
export { DetailTable } from "./notion/DetailTable.js";
|
|
47
47
|
export { FilterChip, FilterChipAdd } from "./notion/FilterChip.js";
|
|
48
48
|
export { FoldRow } from "./notion/FoldRow.js";
|
|
49
|
+
export { InstallBar } from "./notion/InstallBar.js";
|
|
49
50
|
export { PALETTE_COLORS } from "./notion/palette.js";
|
|
50
51
|
export { MarkPopover } from "./notion/MarkPopover.js";
|
|
52
|
+
export { MiniProgress } from "./notion/MiniProgress.js";
|
|
51
53
|
export { PageFrame } from "./notion/PageFrame.js";
|
|
52
54
|
export { PageHeader } from "./notion/PageHeader.js";
|
|
53
55
|
export { PropertyList } from "./notion/PropertyList.js";
|
|
56
|
+
export { SheetMenu, SheetMenuButton, SheetMenuItem } from "./notion/SheetMenu.js";
|
|
54
57
|
export { SidePanel } from "./notion/SidePanel.js";
|
|
55
58
|
export { SortableActivator, SortableHandle, SortableItem, SortableList, } from "./notion/Sortable.js";
|
|
56
59
|
export { StatCards, StatPills, StatsFold, } from "./notion/Stats.js";
|
|
@@ -58,5 +61,6 @@ export { Status } from "./notion/Status.js";
|
|
|
58
61
|
export { Steps } from "./notion/Steps.js";
|
|
59
62
|
export { TabBar } from "./notion/TabBar.js";
|
|
60
63
|
export { Timeline } from "./notion/Timeline.js";
|
|
64
|
+
export { UpdatePrompt } from "./notion/UpdatePrompt.js";
|
|
61
65
|
export { TONES, TONE_COLORS, TONE_EDGE, TONE_FILL, TONE_TEXT } from "./notion/tones.js";
|
|
62
66
|
//# sourceMappingURL=index.js.map
|
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,c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C3B,OAAO,EAAE,MAAM,EAAoB,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAoE,MAAM,mBAAmB,CAAC;AAC5G,OAAO,EAAE,MAAM,EAAqC,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAmF,MAAM,sBAAsB,CAAC;AACjI,OAAO,EAAE,YAAY,EAA0B,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAa,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** The offer to show, as `useInstallOffer` in `@softure-ai/pwa/react` picks it. */
|
|
2
|
+
export type InstallBarOffer = "ios_steps" | "browser_prompt" | "none";
|
|
3
|
+
export interface InstallBarProps {
|
|
4
|
+
/** `offer` from `useInstallOffer`: the browser's prompt button, the iOS steps, or nothing. */
|
|
5
|
+
readonly offer: InstallBarOffer;
|
|
6
|
+
readonly title: string;
|
|
7
|
+
readonly description: string;
|
|
8
|
+
/** The prompt button's text. */
|
|
9
|
+
readonly install: string;
|
|
10
|
+
/** The first iOS step, beside the Share icon. */
|
|
11
|
+
readonly shareStep: string;
|
|
12
|
+
/** The second iOS step, beside the Add to Home Screen icon. */
|
|
13
|
+
readonly addStep: string;
|
|
14
|
+
/** The close button's accessible name. */
|
|
15
|
+
readonly close: string;
|
|
16
|
+
/** The prompt button's action (`install` from `useInstallOffer`): the browser's install sheet. */
|
|
17
|
+
readonly onInstall: () => void;
|
|
18
|
+
/** The close button's action (`close` from `useInstallOffer`): the offer stays closed on this device. */
|
|
19
|
+
readonly onClose: () => void;
|
|
20
|
+
readonly className?: string;
|
|
21
|
+
}
|
|
22
|
+
export declare function InstallBar({ offer, title, description, install, shareStep, addStep, close, onInstall, onClose, className }: InstallBarProps): import("react").JSX.Element | null;
|
|
23
|
+
//# sourceMappingURL=InstallBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InstallBar.d.ts","sourceRoot":"","sources":["../../src/notion/InstallBar.tsx"],"names":[],"mappings":"AAQA,mFAAmF;AACnF,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,gBAAgB,GAAG,MAAM,CAAC;AAEtE,MAAM,WAAW,eAAe;IAC9B,8FAA8F;IAC9F,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAC;IAChC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,gCAAgC;IAChC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,iDAAiD;IACjD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,+DAA+D;IAC/D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,0CAA0C;IAC1C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,kGAAkG;IAClG,QAAQ,CAAC,SAAS,EAAE,MAAM,IAAI,CAAC;IAC/B,yGAAyG;IACzG,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;IAC7B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAMD,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,eAAe,sCAuC3I"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Download, Share, SquarePlus, X } from "lucide-react";
|
|
3
|
+
import { cn } from "../lib/utils.js";
|
|
4
|
+
import { Alert, AlertDescription, AlertTitle } from "../ui/alert.js";
|
|
5
|
+
import { Button } from "../ui/button.js";
|
|
6
|
+
import { ICON_STROKE_WIDTH } from "./icon-stroke.js";
|
|
7
|
+
// The offer to install the app on a phone: a floating alert at the bottom of the screen, inside the safe-area insets
|
|
8
|
+
// like UpdatePrompt, with the browser's install button or the two iOS steps (Share, then Add to Home Screen) and a
|
|
9
|
+
// close button, both at the touch size on a phone. A polite status: it never interrupts a screen reader. The copy is
|
|
10
|
+
// the app's (`pwaMessages.en.install` in `@softure-ai/pwa` has the English text, keyed like these props).
|
|
11
|
+
export function InstallBar({ offer, title, description, install, shareStep, addStep, close, onInstall, onClose, className }) {
|
|
12
|
+
if (offer === "none")
|
|
13
|
+
return null;
|
|
14
|
+
return (_jsx("div", { "data-slot": "install-bar", "data-offer": offer, className: cn("pointer-events-none fixed inset-x-0 bottom-0 z-50 flex justify-center pt-4 pr-[calc(--spacing(4)+env(safe-area-inset-right))] pb-[calc(--spacing(4)+env(safe-area-inset-bottom))] pl-[calc(--spacing(4)+env(safe-area-inset-left))]", className), children: _jsxs(Alert, { role: "status", "aria-live": "polite", className: "pointer-events-auto max-w-md pr-14 shadow-menu md:pr-11", children: [_jsx(Download, { strokeWidth: ICON_STROKE_WIDTH }), _jsx(AlertTitle, { children: title }), _jsxs(AlertDescription, { children: [_jsx("p", { children: description }), offer === "browser_prompt" ? (_jsx(Button, { size: "touch", className: "mt-1 md:h-7", onClick: onInstall, children: install })) : (_jsxs("ol", { "data-slot": "install-bar-steps", className: "mt-1 grid gap-1.5 text-foreground", children: [_jsxs("li", { className: "flex items-center gap-2", children: [_jsx(Share, { "aria-hidden": "true", className: "size-4 shrink-0", strokeWidth: ICON_STROKE_WIDTH }), shareStep] }), _jsxs("li", { className: "flex items-center gap-2", children: [_jsx(SquarePlus, { "aria-hidden": "true", className: "size-4 shrink-0", strokeWidth: ICON_STROKE_WIDTH }), addStep] })] }))] }), _jsx(Button, { type: "button", variant: "ghost", size: "icon-touch", "aria-label": close, className: "absolute top-0 right-0 md:top-1 md:right-1 md:size-7", onClick: onClose, children: _jsx(X, { "aria-hidden": "true", strokeWidth: ICON_STROKE_WIDTH }) })] }) }));
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=InstallBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InstallBar.js","sourceRoot":"","sources":["../../src/notion/InstallBar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAE9D,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAyBrD,qHAAqH;AACrH,mHAAmH;AACnH,qHAAqH;AACrH,0GAA0G;AAC1G,MAAM,UAAU,UAAU,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAmB;IAC1I,IAAI,KAAK,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC;IAClC,OAAO,CACL,2BACY,aAAa,gBACX,KAAK,EACjB,SAAS,EAAE,EAAE,CACX,qOAAqO,EACrO,SAAS,CACV,YAED,MAAC,KAAK,IAAC,IAAI,EAAC,QAAQ,eAAW,QAAQ,EAAC,SAAS,EAAC,yDAAyD,aACzG,KAAC,QAAQ,IAAC,WAAW,EAAE,iBAAiB,GAAI,EAC5C,KAAC,UAAU,cAAE,KAAK,GAAc,EAChC,MAAC,gBAAgB,eACf,sBAAI,WAAW,GAAK,EACnB,KAAK,KAAK,gBAAgB,CAAC,CAAC,CAAC,CAC5B,KAAC,MAAM,IAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAC,aAAa,EAAC,OAAO,EAAE,SAAS,YAC5D,OAAO,GACD,CACV,CAAC,CAAC,CAAC,CACF,2BAAc,mBAAmB,EAAC,SAAS,EAAC,mCAAmC,aAC7E,cAAI,SAAS,EAAC,yBAAyB,aACrC,KAAC,KAAK,mBAAa,MAAM,EAAC,SAAS,EAAC,iBAAiB,EAAC,WAAW,EAAE,iBAAiB,GAAI,EACvF,SAAS,IACP,EACL,cAAI,SAAS,EAAC,yBAAyB,aACrC,KAAC,UAAU,mBAAa,MAAM,EAAC,SAAS,EAAC,iBAAiB,EAAC,WAAW,EAAE,iBAAiB,GAAI,EAC5F,OAAO,IACL,IACF,CACN,IACgB,EACnB,KAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAC,OAAO,EAAC,IAAI,EAAC,YAAY,gBAAa,KAAK,EAAE,SAAS,EAAC,sDAAsD,EAAC,OAAO,EAAE,OAAO,YAC1J,KAAC,CAAC,mBAAa,MAAM,EAAC,WAAW,EAAE,iBAAiB,GAAI,GACjD,IACH,GACJ,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Progress as ProgressPrimitive } from "radix-ui";
|
|
2
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
3
|
+
import { type Tone } from "./tones.js";
|
|
4
|
+
export type MiniProgressProps = Omit<ComponentProps<typeof ProgressPrimitive.Root>, "children" | "max" | "value"> & {
|
|
5
|
+
/** 0–100, clamped; non-finite values read as 0. */
|
|
6
|
+
readonly value: number;
|
|
7
|
+
/** Text inside the bar, e.g. a formatted amount; defaults to the rounded percent. */
|
|
8
|
+
readonly label?: ReactNode;
|
|
9
|
+
/** Fill colour by meaning (the theme's tones); defaults to primary. */
|
|
10
|
+
readonly tone?: Tone;
|
|
11
|
+
};
|
|
12
|
+
export declare function MiniProgress({ value, label, tone, className, ...props }: MiniProgressProps): import("react").JSX.Element;
|
|
13
|
+
//# sourceMappingURL=MiniProgress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MiniProgress.d.ts","sourceRoot":"","sources":["../../src/notion/MiniProgress.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvD,OAAO,EAAa,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,iBAAiB,CAAC,IAAI,CAAC,EAAE,UAAU,GAAG,KAAK,GAAG,OAAO,CAAC,GAAG;IAClH,mDAAmD;IACnD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,qFAAqF;IACrF,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC;IAC3B,uEAAuE;IACvE,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC;CACtB,CAAC;AAcF,wBAAgB,YAAY,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,+BAoC1F"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Progress as ProgressPrimitive } from "radix-ui";
|
|
4
|
+
import { cn } from "../lib/utils.js";
|
|
5
|
+
import { TONE_FILL } from "./tones.js";
|
|
6
|
+
function clampShare(value) {
|
|
7
|
+
if (!Number.isFinite(value))
|
|
8
|
+
return 0;
|
|
9
|
+
return Math.min(100, Math.max(0, value));
|
|
10
|
+
}
|
|
11
|
+
const LABEL_CLASS = "absolute inset-0 flex items-center px-2 text-xs font-medium tabular-nums whitespace-nowrap";
|
|
12
|
+
// A share with its figure inside the bar, for a table cell or a tile: a 20 px track that takes the cell's width and
|
|
13
|
+
// carries the label, so a figure and a bar never collide in a narrow column. The label is drawn twice: in the text
|
|
14
|
+
// colour on the track, and in the page background clipped to the fill, so it reads at any value, also where the
|
|
15
|
+
// fill's edge crosses a letter. Both copies are hidden: the progress bar itself reports the value (and a string label
|
|
16
|
+
// as its value text). A label wider than the cell ends in an ellipsis.
|
|
17
|
+
export function MiniProgress({ value, label, tone, className, ...props }) {
|
|
18
|
+
const share = clampShare(value);
|
|
19
|
+
const text = label ?? `${Math.round(share)}%`;
|
|
20
|
+
return (_jsxs(ProgressPrimitive.Root, { "data-slot": "mini-progress", "data-tone": tone ?? "default", value: share, max: 100, getValueLabel: typeof text === "string" ? () => text : undefined, className: cn("relative h-5 w-full min-w-16 overflow-hidden rounded-sm bg-primary/12", className), ...props, children: [_jsx(ProgressPrimitive.Indicator, { "data-slot": "mini-progress-indicator", className: cn("absolute inset-y-0 left-0 transition-[width]",
|
|
21
|
+
// In dark the default fill is the lighter link blue, as in `Progress`.
|
|
22
|
+
tone === undefined ? "bg-primary dark:bg-link" : TONE_FILL[tone]), style: { width: `${share}%` } }), _jsx("span", { "aria-hidden": "true", "data-slot": "mini-progress-label", className: cn(LABEL_CLASS, "text-foreground"), children: _jsx("span", { className: "truncate", children: text }) }), _jsx("span", { "aria-hidden": "true", "data-slot": "mini-progress-label", className: cn(LABEL_CLASS, "text-background"), style: { clipPath: `inset(0 ${100 - share}% 0 0)` }, children: _jsx("span", { className: "truncate", children: text }) })] }));
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=MiniProgress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MiniProgress.js","sourceRoot":"","sources":["../../src/notion/MiniProgress.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAGzD,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC,OAAO,EAAE,SAAS,EAAa,MAAM,YAAY,CAAC;AAWlD,SAAS,UAAU,CAAC,KAAa;IAC/B,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AS,EAAC,UAAU,YAAE,IAAI,GAAQ,GACnC,EAEP,8BACc,MAAM,eACR,qBAAqB,EAC/B,SAAS,EAAE,EAAE,CAAC,WAAW,EAAE,iBAAiB,CAAC,EAC7C,KAAK,EAAE,EAAE,QAAQ,EAAE,WAAW,GAAG,GAAG,KAAK,QAAQ,EAAE,YAEnD,eAAM,SAAS,EAAC,UAAU,YAAE,IAAI,GAAQ,GACnC,IACgB,CAC1B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
export declare function SheetMenu({ className, ...props }: ComponentProps<"ul">): import("react").JSX.Element;
|
|
3
|
+
export declare function SheetMenuItem({ className, ...props }: ComponentProps<"li">): import("react").JSX.Element;
|
|
4
|
+
export interface SheetMenuButtonProps extends ComponentProps<"button"> {
|
|
5
|
+
readonly asChild?: boolean;
|
|
6
|
+
readonly isActive?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function SheetMenuButton({ asChild, isActive, className, type, ...props }: SheetMenuButtonProps): import("react").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=SheetMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SheetMenu.d.ts","sourceRoot":"","sources":["../../src/notion/SheetMenu.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAM5C,wBAAgB,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,IAAI,CAAC,+BAEtE;AAED,wBAAgB,aAAa,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,IAAI,CAAC,+BAE1E;AAED,MAAM,WAAW,oBAAqB,SAAQ,cAAc,CAAC,QAAQ,CAAC;IAEpE,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAE3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B;AAID,wBAAgB,eAAe,CAAC,EAAE,OAAe,EAAE,QAAgB,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,oBAAoB,+BAcrH"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Slot } from "radix-ui";
|
|
4
|
+
import { cn } from "../lib/utils.js";
|
|
5
|
+
// Navigation rows inside a `Sheet` (a phone's navigation drawer), shaped like the sidebar's menu but with no
|
|
6
|
+
// `SidebarProvider`: a list of items, each holding one full-width row.
|
|
7
|
+
export function SheetMenu({ className, ...props }) {
|
|
8
|
+
return _jsx("ul", { "data-slot": "sheet-menu", className: cn("flex w-full min-w-0 flex-col gap-1", className), ...props });
|
|
9
|
+
}
|
|
10
|
+
export function SheetMenuItem({ className, ...props }) {
|
|
11
|
+
return _jsx("li", { "data-slot": "sheet-menu-item", className: cn("relative", className), ...props });
|
|
12
|
+
}
|
|
13
|
+
// One row: icon and label left-aligned in the foreground colour, a touch target tall on a phone and a list row
|
|
14
|
+
// from `md`, hovered and focused like the sidebar's rows on the sheet's `background`.
|
|
15
|
+
export function SheetMenuButton({ asChild = false, isActive = false, className, type, ...props }) {
|
|
16
|
+
const Comp = asChild ? Slot.Root : "button";
|
|
17
|
+
return (_jsx(Comp, { "data-slot": "sheet-menu-button", "data-active": isActive, type: asChild ? type : (type ?? "button"), className: cn("flex min-h-touch-target w-full items-center gap-2 overflow-hidden rounded-md px-2 text-left text-ui text-foreground outline-hidden transition-colors duration-120 hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring active:bg-accent disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-accent data-[active=true]:font-medium md:min-h-row-height [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0", className), ...props }));
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=SheetMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SheetMenu.js","sourceRoot":"","sources":["../../src/notion/SheetMenu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAGhC,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC,6GAA6G;AAC7G,uEAAuE;AACvE,MAAM,UAAU,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAwB;IACrE,OAAO,0BAAc,YAAY,EAAC,SAAS,EAAE,EAAE,CAAC,oCAAoC,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAC;AAClH,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAwB;IACzE,OAAO,0BAAc,iBAAiB,EAAC,SAAS,EAAE,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAC;AAC7F,CAAC;AASD,+GAA+G;AAC/G,sFAAsF;AACtF,MAAM,UAAU,eAAe,CAAC,EAAE,OAAO,GAAG,KAAK,EAAE,QAAQ,GAAG,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,KAAK,EAAwB;IACpH,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC;IAC5C,OAAO,CACL,KAAC,IAAI,iBACO,mBAAmB,iBAChB,QAAQ,EACrB,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,QAAQ,CAAC,EACzC,SAAS,EAAE,EAAE,CACX,0eAA0e,EAC1e,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAC;AACJ,CAAC"}
|
package/dist/notion/Status.d.ts
CHANGED
|
@@ -5,7 +5,8 @@ export interface StatusProps {
|
|
|
5
5
|
color: PaletteColor;
|
|
6
6
|
icon: LucideIcon;
|
|
7
7
|
children: ReactNode;
|
|
8
|
+
title?: string;
|
|
8
9
|
className?: string;
|
|
9
10
|
}
|
|
10
|
-
export declare function Status({ color, icon: Icon, children, className }: StatusProps): import("react").JSX.Element;
|
|
11
|
+
export declare function Status({ color, icon: Icon, children, title, className }: StatusProps): import("react").JSX.Element;
|
|
11
12
|
//# sourceMappingURL=Status.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Status.d.ts","sourceRoot":"","sources":["../../src/notion/Status.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAejD,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,YAAY,CAAC;IACpB,IAAI,EAAE,UAAU,CAAC;IAEjB,QAAQ,EAAE,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Status.d.ts","sourceRoot":"","sources":["../../src/notion/Status.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAejD,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,YAAY,CAAC;IACpB,IAAI,EAAE,UAAU,CAAC;IAEjB,QAAQ,EAAE,SAAS,CAAC;IAEpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AASD,wBAAgB,MAAM,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,WAAW,+BAepF"}
|
package/dist/notion/Status.js
CHANGED
|
@@ -14,8 +14,13 @@ const TEXT_COLOR = {
|
|
|
14
14
|
pink: "text-pink",
|
|
15
15
|
red: "text-red",
|
|
16
16
|
};
|
|
17
|
+
/** The word as plain text, or undefined when it is any other node. */
|
|
18
|
+
function getPlainText(children) {
|
|
19
|
+
return typeof children === "string" || typeof children === "number" ? String(children) : undefined;
|
|
20
|
+
}
|
|
17
21
|
// A state of something (booked, to pay, overdue): a ghost badge with a line icon and a word in a palette colour.
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
// In a narrow container the word, not the icon, shrinks and ends in an ellipsis.
|
|
23
|
+
export function Status({ color, icon: Icon, children, title, className }) {
|
|
24
|
+
return (_jsxs(Badge, { variant: "ghost", "data-slot": "status", "data-color": color, title: title ?? getPlainText(children), className: cn("gap-1.5 px-0 text-sm font-normal [&>svg]:size-4 [&>svg]:shrink-0", TEXT_COLOR[color], className), children: [_jsx(Icon, { "aria-hidden": "true", strokeWidth: ICON_STROKE_WIDTH }), _jsx("span", { "data-slot": "status-label", className: "min-w-0 truncate", children: children })] }));
|
|
20
25
|
}
|
|
21
26
|
//# sourceMappingURL=Status.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Status.js","sourceRoot":"","sources":["../../src/notion/Status.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGrD,uDAAuD;AACvD,MAAM,UAAU,GAAiC;IAC/C,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,YAAY;IACnB,MAAM,EAAE,aAAa;IACrB,MAAM,EAAE,aAAa;IACrB,KAAK,EAAE,YAAY;IACnB,IAAI,EAAE,WAAW;IACjB,MAAM,EAAE,aAAa;IACrB,IAAI,EAAE,WAAW;IACjB,GAAG,EAAE,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,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface UpdatePromptProps {
|
|
2
|
+
/** A new build waits (`isUpdateReady` from `useServiceWorkerUpdate` in `@softure-ai/pwa/react`). */
|
|
3
|
+
readonly open: boolean;
|
|
4
|
+
readonly title: string;
|
|
5
|
+
readonly description: string;
|
|
6
|
+
/** The button's text. */
|
|
7
|
+
readonly reload: string;
|
|
8
|
+
/** The button's action (`activate` from `useServiceWorkerUpdate`): the new build takes over and the page reloads. */
|
|
9
|
+
readonly onReload: () => void;
|
|
10
|
+
readonly className?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function UpdatePrompt({ open, title, description, reload, onReload, className }: UpdatePromptProps): import("react").JSX.Element | null;
|
|
13
|
+
//# sourceMappingURL=UpdatePrompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UpdatePrompt.d.ts","sourceRoot":"","sources":["../../src/notion/UpdatePrompt.tsx"],"names":[],"mappings":"AAQA,MAAM,WAAW,iBAAiB;IAChC,oGAAoG;IACpG,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,yBAAyB;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,qHAAqH;IACrH,QAAQ,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC;IAC9B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAMD,wBAAgB,YAAY,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,iBAAiB,sCAsBxG"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { RefreshCw } from "lucide-react";
|
|
3
|
+
import { cn } from "../lib/utils.js";
|
|
4
|
+
import { Alert, AlertDescription, AlertTitle } from "../ui/alert.js";
|
|
5
|
+
import { Button } from "../ui/button.js";
|
|
6
|
+
import { ICON_STROKE_WIDTH } from "./icon-stroke.js";
|
|
7
|
+
// The offer to reload into a new build: a floating alert at the bottom of the screen, above the home indicator and
|
|
8
|
+
// beside a notch (the safe-area insets), with a reload button at the touch height on a phone. It is a polite status,
|
|
9
|
+
// not an alert: the offer never interrupts what a screen reader is reading. The copy is the app's
|
|
10
|
+
// (`pwaMessages.en.update` in `@softure-ai/pwa` has the English text, keyed like these props).
|
|
11
|
+
export function UpdatePrompt({ open, title, description, reload, onReload, className }) {
|
|
12
|
+
if (!open)
|
|
13
|
+
return null;
|
|
14
|
+
return (_jsx("div", { "data-slot": "update-prompt", className: cn("pointer-events-none fixed inset-x-0 bottom-0 z-50 flex justify-center pt-4 pr-[calc(--spacing(4)+env(safe-area-inset-right))] pb-[calc(--spacing(4)+env(safe-area-inset-bottom))] pl-[calc(--spacing(4)+env(safe-area-inset-left))]", className), children: _jsxs(Alert, { role: "status", "aria-live": "polite", className: "pointer-events-auto max-w-md shadow-menu", children: [_jsx(RefreshCw, { strokeWidth: ICON_STROKE_WIDTH }), _jsx(AlertTitle, { children: title }), _jsxs(AlertDescription, { children: [_jsx("p", { children: description }), _jsx(Button, { size: "touch", className: "mt-1 md:h-7", onClick: onReload, children: reload })] })] }) }));
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=UpdatePrompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UpdatePrompt.js","sourceRoot":"","sources":["../../src/notion/UpdatePrompt.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAcrD,mHAAmH;AACnH,qHAAqH;AACrH,kGAAkG;AAClG,+FAA+F;AAC/F,MAAM,UAAU,YAAY,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAqB;IACvG,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IACvB,OAAO,CACL,2BACY,eAAe,EACzB,SAAS,EAAE,EAAE,CACX,qOAAqO,EACrO,SAAS,CACV,YAED,MAAC,KAAK,IAAC,IAAI,EAAC,QAAQ,eAAW,QAAQ,EAAC,SAAS,EAAC,0CAA0C,aAC1F,KAAC,SAAS,IAAC,WAAW,EAAE,iBAAiB,GAAI,EAC7C,KAAC,UAAU,cAAE,KAAK,GAAc,EAChC,MAAC,gBAAgB,eACf,sBAAI,WAAW,GAAK,EACpB,KAAC,MAAM,IAAC,IAAI,EAAC,OAAO,EAAC,SAAS,EAAC,aAAa,EAAC,OAAO,EAAE,QAAQ,YAC3D,MAAM,GACA,IACQ,IACb,GACJ,CACP,CAAC;AACJ,CAAC"}
|
package/dist/ui/accordion.d.ts
CHANGED
|
@@ -2,7 +2,9 @@ import * as React from "react";
|
|
|
2
2
|
import { Accordion as AccordionPrimitive } from "radix-ui";
|
|
3
3
|
declare function Accordion({ ...props }: React.ComponentProps<typeof AccordionPrimitive.Root>): React.JSX.Element;
|
|
4
4
|
declare function AccordionItem({ className, ...props }: React.ComponentProps<typeof AccordionPrimitive.Item>): React.JSX.Element;
|
|
5
|
-
declare function AccordionTrigger({ className, children, ...props }: React.ComponentProps<typeof AccordionPrimitive.Trigger>
|
|
5
|
+
declare function AccordionTrigger({ className, children, size, ...props }: React.ComponentProps<typeof AccordionPrimitive.Trigger> & {
|
|
6
|
+
size?: "default" | "touch";
|
|
7
|
+
}): React.JSX.Element;
|
|
6
8
|
declare function AccordionContent({ className, children, ...props }: React.ComponentProps<typeof AccordionPrimitive.Content>): React.JSX.Element;
|
|
7
9
|
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
8
10
|
//# sourceMappingURL=accordion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.d.ts","sourceRoot":"","sources":["../../src/ui/accordion.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,EAAE,SAAS,IAAI,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAE1D,iBAAS,SAAS,CAAC,EACjB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,IAAI,CAAC,qBAEtD;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,IAAI,CAAC,qBAQtD;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"accordion.d.ts","sourceRoot":"","sources":["../../src/ui/accordion.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,EAAE,SAAS,IAAI,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAE1D,iBAAS,SAAS,CAAC,EACjB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,IAAI,CAAC,qBAEtD;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,IAAI,CAAC,qBAQtD;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,QAAQ,EACR,IAAgB,EAChB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,OAAO,CAAC,GAAG;IAC3D,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,CAAA;CAC3B,qBAiBA;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,OAAO,CAAC,qBAUzD;AAED,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAA"}
|
package/dist/ui/accordion.js
CHANGED
|
@@ -10,8 +10,8 @@ function Accordion({ ...props }) {
|
|
|
10
10
|
function AccordionItem({ className, ...props }) {
|
|
11
11
|
return (_jsx(AccordionPrimitive.Item, { "data-slot": "accordion-item", className: cn("border-b last:border-b-0", className), ...props }));
|
|
12
12
|
}
|
|
13
|
-
function AccordionTrigger({ className, children, ...props }) {
|
|
14
|
-
return (_jsx(AccordionPrimitive.Header, { className: "flex", children: _jsxs(AccordionPrimitive.Trigger, { "data-slot": "accordion-trigger", className: cn("flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180", className), ...props, children: [children, _jsx(ChevronDownIcon, { className: "pointer-events-none size-4 shrink-0 translate-y-0.5 text-muted-foreground transition-transform duration-200" })] }) }));
|
|
13
|
+
function AccordionTrigger({ className, children, size = "default", ...props }) {
|
|
14
|
+
return (_jsx(AccordionPrimitive.Header, { className: "flex", children: _jsxs(AccordionPrimitive.Trigger, { "data-slot": "accordion-trigger", className: cn("flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180", size === "touch" && "min-h-touch-target", className), ...props, children: [children, _jsx(ChevronDownIcon, { className: "pointer-events-none size-4 shrink-0 translate-y-0.5 text-muted-foreground transition-transform duration-200" })] }) }));
|
|
15
15
|
}
|
|
16
16
|
function AccordionContent({ className, children, ...props }) {
|
|
17
17
|
return (_jsx(AccordionPrimitive.Content, { "data-slot": "accordion-content", className: "overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down", ...props, children: _jsx("div", { className: cn("pt-0 pb-4", className), children: children }) }));
|
package/dist/ui/accordion.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.js","sourceRoot":"","sources":["../../src/ui/accordion.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAA;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,SAAS,IAAI,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAE1D,SAAS,SAAS,CAAC,EACjB,GAAG,KAAK,EAC6C;IACrD,OAAO,KAAC,kBAAkB,CAAC,IAAI,iBAAW,WAAW,KAAK,KAAK,GAAI,CAAA;AACrE,CAAC;AAED,SAAS,aAAa,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EAC6C;IACrD,OAAO,CACL,KAAC,kBAAkB,CAAC,IAAI,iBACZ,gBAAgB,EAC1B,SAAS,EAAE,EAAE,CAAC,0BAA0B,EAAE,SAAS,CAAC,KAChD,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,SAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,
|
|
1
|
+
{"version":3,"file":"accordion.js","sourceRoot":"","sources":["../../src/ui/accordion.tsx"],"names":[],"mappings":"AAAA,Y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