@softure-ai/theme-notion 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/README.md +77 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- 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/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/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/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/notion/SheetMenu.tsx +41 -0
- package/src/notion/Status.tsx +14 -3
- package/src/ui/badge.tsx +1 -1
- package/src/ui/button.tsx +3 -0
- package/src/ui/select.tsx +23 -5
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,33 @@ 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.9.0
|
|
8
|
+
|
|
9
|
+
- `Badge` and `Status` in a narrow container (#864): a badge is capped at its container's width (`max-w-full`), so a
|
|
10
|
+
long word no longer runs past a card's edge. `Status` puts its word in a `<span data-slot="status-label"
|
|
11
|
+
class="min-w-0 truncate">`: the word, not the icon, shrinks and ends in an ellipsis, and the badge's `title` is the
|
|
12
|
+
full word when it is a string or a number (a new optional `title` prop sets it for any other node or overrides it).
|
|
13
|
+
A plain `Badge` clips its text at the end (`justify-center-safe`, so a cut text keeps its start); an app that wants
|
|
14
|
+
an ellipsis there wraps the text in `<span className="min-w-0 truncate">`. A badge whose text fits looks as before.
|
|
15
|
+
An app drops its `max-w-full` on `Badge`/`Status` and its own truncating span inside `Status`; a selector that read
|
|
16
|
+
`Status`'s text still finds it, now inside `status-label`.
|
|
17
|
+
- `SheetMenu`, `SheetMenuItem` and `SheetMenuButton` (#858): navigation rows for a side `Sheet` (a phone's drawer)
|
|
18
|
+
that need no `SidebarProvider`. A row is full width, icon and label left-aligned in `foreground` (`text-ui`), 44 px
|
|
19
|
+
tall on a phone and 34 px from `md`, hovered, pressed and active in `accent` like the sidebar's rows, `disabled`
|
|
20
|
+
dimmed; `asChild` renders a link, `SheetClose asChild` around it closes the drawer. The README shows the drawer
|
|
21
|
+
recipe: `showCloseButton={false}`, a ghost close `Button` in the `SheetHeader` row, the foot rows in a `SheetFooter`
|
|
22
|
+
with `border-t`. An app that laid out ghost `Button`s as rows (`size="lg" className="min-h-touch-target w-full
|
|
23
|
+
justify-start text-ui text-foreground"`) wraps them in `SheetMenu` / `SheetMenuItem`, swaps each `Button` for
|
|
24
|
+
`SheetMenuButton` and drops those classes.
|
|
25
|
+
- Touch sizes (#859): the controls a phone view taps most reach the `touch-target` token (44 px). `Button` gains the
|
|
26
|
+
sizes `touch` (`h-touch-target px-3`, the icon side padded like `lg`) and `icon-touch` (`size-touch-target`);
|
|
27
|
+
`SelectTrigger` gains `size="touch"` (`h-touch-target`); `SelectContent` and `SelectItem` gain `size` (`"default"` or
|
|
28
|
+
`"touch"`): a touch list draws every item at least 44 px high (`min-h-touch-target`), and an item's own `size` wins
|
|
29
|
+
over its list's. The heights are plain classes, so a caller's breakpoint class (`md:h-7`, `md:size-7`,
|
|
30
|
+
`md:min-h-7`) brings the pointer size back on a desktop. Existing sizes are unchanged. An app that used the
|
|
31
|
+
workaround `min-h-touch-target min-w-touch-target` on a `Button`, `SelectTrigger` or `SelectItem` replaces it with
|
|
32
|
+
the size (`size="touch"`, `size="icon-touch"`, or `size="touch"` on the `SelectContent`).
|
|
33
|
+
|
|
7
34
|
## 0.8.0
|
|
8
35
|
|
|
9
36
|
- 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,12 +131,30 @@ 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
139
|
`SortableList`, `SortableItem`, `SortableHandle` and `SortableActivator` (rows reordered by dragging, below).
|
|
135
140
|
|
|
141
|
+
**Touch sizes.** The controls a phone view taps most reach the `touch-target` token (44 px, Apple's HIG and WCAG
|
|
142
|
+
2.5.5): `Button` sizes `touch` (44 px high, padded like `lg`) and `icon-touch` (44 × 44), `SelectTrigger`
|
|
143
|
+
`size="touch"`, and `SelectItem` at least 44 px high, for a whole list (`SelectContent size="touch"`) or one item
|
|
144
|
+
(`SelectItem size="touch"`; an item's own `size` wins over its list's). Each sets its height with a plain class, so
|
|
145
|
+
one breakpoint class brings the pointer size back on a desktop.
|
|
146
|
+
|
|
147
|
+
```tsx
|
|
148
|
+
<Button size="touch" className="md:h-7 md:px-2.5">Save</Button>
|
|
149
|
+
<Button size="icon-touch" aria-label="Add" className="md:size-7"><Plus /></Button>
|
|
150
|
+
<Select>
|
|
151
|
+
<SelectTrigger size="touch" className="md:h-7" aria-label="View"><SelectValue /></SelectTrigger>
|
|
152
|
+
<SelectContent size="touch" position="popper">
|
|
153
|
+
<SelectItem value="table" className="md:min-h-7">Table</SelectItem>
|
|
154
|
+
</SelectContent>
|
|
155
|
+
</Select>
|
|
156
|
+
```
|
|
157
|
+
|
|
136
158
|
**`FoldRow`.** An item as one list row in a native `<details>`: a chevron, the title, short facts and badges on the
|
|
137
159
|
right; opened, it shows a `DetailTable` and its `children`. The opened content is padded 12 px on all four sides
|
|
138
160
|
(`p-3`), so a table sits centred under the row; `isInset` indents it under the title instead (24 px on the left) and
|
|
@@ -184,6 +206,60 @@ Escape inside or the close button calls `onClose`, and the caller moves focus ba
|
|
|
184
206
|
</div>
|
|
185
207
|
```
|
|
186
208
|
|
|
209
|
+
**`SheetMenu`.** A phone's navigation drawer: a `Sheet` from the right with a heading and a ghost close button,
|
|
210
|
+
navigation rows at the top and one row at the foot, the way a desktop `Sidebar` ends with its foot menu.
|
|
211
|
+
`SheetMenu` (`ul`), `SheetMenuItem` (`li`) and `SheetMenuButton` (the row) mirror `SidebarMenu`, `SidebarMenuItem`
|
|
212
|
+
and `SidebarMenuButton`, but need no `SidebarProvider`. A row is full width, its icon and label left-aligned in the
|
|
213
|
+
`foreground` colour (`text-ui`, icons 16 px), 44 px tall on a phone (`min-h-touch-target`) and a 34 px list row from
|
|
214
|
+
`md` (`min-h-row-height`); hover, press and the active row (`isActive`, `data-active`) take `accent`, focus the
|
|
215
|
+
`ring`; `disabled` (or `aria-disabled` on a link) dims it to 50 % and drops its clicks. `asChild` renders a link with
|
|
216
|
+
the row's look (add `aria-current="page"` on the active one); wrap a row in `SheetClose asChild` to close the drawer
|
|
217
|
+
on a click. The heading and the foot are a recipe from the existing parts: `showCloseButton={false}` on
|
|
218
|
+
`SheetContent`, the close as a ghost icon `Button` in a `SheetHeader` row, and the foot rows in a `SheetFooter`
|
|
219
|
+
(already pushed to the panel's foot by `mt-auto`) with `border-t`.
|
|
220
|
+
|
|
221
|
+
```tsx
|
|
222
|
+
<Sheet open={isOpen} onOpenChange={setOpen}>
|
|
223
|
+
<SheetContent side="right" showCloseButton={false} className="gap-0">
|
|
224
|
+
<SheetHeader className="flex-row items-center justify-between gap-2 border-b py-2 pr-2 pl-4">
|
|
225
|
+
<SheetTitle>Workspace</SheetTitle>
|
|
226
|
+
<SheetClose asChild>
|
|
227
|
+
<Button variant="ghost" size="icon" aria-label={t("menu.close")}>
|
|
228
|
+
<X aria-hidden="true" strokeWidth={ICON_STROKE_WIDTH} />
|
|
229
|
+
</Button>
|
|
230
|
+
</SheetClose>
|
|
231
|
+
</SheetHeader>
|
|
232
|
+
<nav aria-label={t("menu.label")} className="p-2">
|
|
233
|
+
<SheetMenu>
|
|
234
|
+
<SheetMenuItem>
|
|
235
|
+
<SheetClose asChild>
|
|
236
|
+
<SheetMenuButton asChild isActive>
|
|
237
|
+
<Link href="/" aria-current="page">
|
|
238
|
+
<House aria-hidden="true" strokeWidth={ICON_STROKE_WIDTH} />
|
|
239
|
+
<span>{t("menu.home")}</span>
|
|
240
|
+
</Link>
|
|
241
|
+
</SheetMenuButton>
|
|
242
|
+
</SheetClose>
|
|
243
|
+
</SheetMenuItem>
|
|
244
|
+
</SheetMenu>
|
|
245
|
+
</nav>
|
|
246
|
+
<SheetFooter className="border-t p-2">
|
|
247
|
+
<SheetMenu>
|
|
248
|
+
<SheetMenuItem>
|
|
249
|
+
<SheetMenuButton onClick={signOut}>
|
|
250
|
+
<LogOut aria-hidden="true" strokeWidth={ICON_STROKE_WIDTH} />
|
|
251
|
+
<span>{t("menu.signOut")}</span>
|
|
252
|
+
</SheetMenuButton>
|
|
253
|
+
</SheetMenuItem>
|
|
254
|
+
</SheetMenu>
|
|
255
|
+
</SheetFooter>
|
|
256
|
+
</SheetContent>
|
|
257
|
+
</Sheet>
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
An app that laid out ghost `Button`s itself (`size="lg" className="min-h-touch-target w-full justify-start text-ui
|
|
261
|
+
text-foreground"`) moves each row to `SheetMenuButton` and drops those classes.
|
|
262
|
+
|
|
187
263
|
A screen's summary figures: `StatsFold` (figures folded under a heading, closed by default, on native `<details>`),
|
|
188
264
|
`StatCards` (a wrapping row of figure cards: label, figure in its tone, optional `progress` bar under the figure,
|
|
189
265
|
optional `hint`, optional `aside` tag; `isFullWidth` and `isOneRow` change the grid) and `StatPills` ("label **value**" tags in one row). Each figure takes a
|
package/dist/index.d.ts
CHANGED
|
@@ -49,6 +49,7 @@ export { MarkPopover, type MarkPopoverProps } from "./notion/MarkPopover.js";
|
|
|
49
49
|
export { PageFrame, type PageFrameProps } from "./notion/PageFrame.js";
|
|
50
50
|
export { PageHeader, type PageCrumb, type PageHeaderProps } from "./notion/PageHeader.js";
|
|
51
51
|
export { PropertyList, type Property, type PropertyListProps } from "./notion/PropertyList.js";
|
|
52
|
+
export { SheetMenu, SheetMenuButton, SheetMenuItem, type SheetMenuButtonProps } from "./notion/SheetMenu.js";
|
|
52
53
|
export { SidePanel, type SidePanelLayout, type SidePanelProps } from "./notion/SidePanel.js";
|
|
53
54
|
export { SortableActivator, SortableHandle, SortableItem, SortableList, type SortableActivatorProps, type SortableAnnouncements, type SortableDragBy, type SortableHandleProps, type SortableItemProps, type SortableListProps, type SortableMove, } from "./notion/Sortable.js";
|
|
54
55
|
export { StatCards, StatPills, StatsFold, type StatCard, type StatCardAside, type StatCardsProps, type StatPill, type StatPillsProps, type StatsFoldProps, } from "./notion/Stats.js";
|
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;A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sB,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,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACjI,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,IAAI,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -51,6 +51,7 @@ export { MarkPopover } from "./notion/MarkPopover.js";
|
|
|
51
51
|
export { PageFrame } from "./notion/PageFrame.js";
|
|
52
52
|
export { PageHeader } from "./notion/PageHeader.js";
|
|
53
53
|
export { PropertyList } from "./notion/PropertyList.js";
|
|
54
|
+
export { SheetMenu, SheetMenuButton, SheetMenuItem } from "./notion/SheetMenu.js";
|
|
54
55
|
export { SidePanel } from "./notion/SidePanel.js";
|
|
55
56
|
export { SortableActivator, SortableHandle, SortableItem, SortableList, } from "./notion/Sortable.js";
|
|
56
57
|
export { StatCards, StatPills, StatsFold, } from "./notion/Stats.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,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,yBAA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ps } 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,UAAU;CAChB,CAAC;
|
|
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,UAAU;CAChB,CAAC;AAYF,sEAAsE;AACtE,SAAS,YAAY,CAAC,QAAmB;IACvC,OAAO,OAAO,QAAQ,KAAK,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACrG,CAAC;AAED,iHAAiH;AACjH,iFAAiF;AACjF,MAAM,UAAU,MAAM,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAe;IACnF,OAAO,CACL,MAAC,KAAK,IACJ,OAAO,EAAC,OAAO,eACL,QAAQ,gBACN,KAAK,EACjB,KAAK,EAAE,KAAK,IAAI,YAAY,CAAC,QAAQ,CAAC,EACtC,SAAS,EAAE,EAAE,CAAC,kEAAkE,EAAE,UAAU,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC,aAE/G,KAAC,IAAI,mBAAa,MAAM,EAAC,WAAW,EAAE,iBAAiB,GAAI,EAC3D,4BAAgB,cAAc,EAAC,SAAS,EAAC,kBAAkB,YACxD,QAAQ,GACJ,IACD,CACT,CAAC;AACJ,CAAC"}
|
package/dist/ui/badge.js
CHANGED
|
@@ -17,7 +17,7 @@ const TAG_COLORS = {
|
|
|
17
17
|
};
|
|
18
18
|
// Every variant a palette colour applies to: all but destructive.
|
|
19
19
|
const COLORED_VARIANTS = ["default", "secondary", "outline", "ghost", "link", "tag"];
|
|
20
|
-
const badgeVariants = cva("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3", {
|
|
20
|
+
const badgeVariants = cva("inline-flex w-fit max-w-full shrink-0 items-center justify-center-safe gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3", {
|
|
21
21
|
variants: {
|
|
22
22
|
variant: {
|
|
23
23
|
default: "bg-primary text-primary-foreground [a&]:hover:bg-primary-hover",
|
package/dist/ui/badge.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.js","sourceRoot":"","sources":["../../src/ui/badge.tsx"],"names":[],"mappings":";AAAA,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,EAAE,MAAM,UAAU,CAAA;AAE/B,MAAM,UAAU,GAAG;IACjB,OAAO,EAAE,4CAA4C;IACrD,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,0CAA0C;IAClD,IAAI,EAAE,sCAAsC;IAC5C,GAAG,EAAE,oCAAoC;CAC1C,CAAA;AAED,kEAAkE;AAClE,MAAM,gBAAgB,GAAG,CAAC,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAU,CAAA;AAE7F,MAAM,aAAa,GAAG,GAAG,CAC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ACR,GAAG,EAAE,EAAE;SACR;KACF;IACD,uEAAuE;IACvE,gBAAgB,EAAE,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,SAAS,CAAC,EAAE,EAAE,CAAC,CAAC;QACxE,OAAO,EAAE,CAAC,GAAG,gBAAgB,CAAC;QAC9B,KAAK,EAAE,KAAgC;QACvC,SAAS;KACV,CAAC,CAAC;IACH,eAAe,EAAE;QACf,OAAO,EAAE,SAAS;QAClB,KAAK,EAAE,MAAM;KACd;CACF,CACF,CAAA;AAED,SAAS,KAAK,CAAC,EACb,SAAS,EACT,OAAO,GAAG,SAAS,EACnB,KAAK,EACL,OAAO,GAAG,KAAK,EACf,GAAG,KAAK,EAEkD;IAC1D,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAA;IAEzC,OAAO,CACL,KAAC,IAAI,iBACO,OAAO,kBACH,OAAO,EACrB,SAAS,EAAE,EAAE,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,SAAS,CAAC,KACvD,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAA"}
|
package/dist/ui/button.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import { type VariantProps } from "class-variance-authority";
|
|
3
3
|
declare const buttonVariants: (props?: ({
|
|
4
4
|
variant?: "link" | "secondary" | "destructive" | "default" | "outline" | "ghost" | "floating" | null | undefined;
|
|
5
|
-
size?: "xs" | "sm" | "lg" | "default" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
5
|
+
size?: "xs" | "sm" | "lg" | "default" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | "touch" | "icon-touch" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
7
|
declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
8
8
|
asChild?: boolean;
|
package/dist/ui/button.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/ui/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,cAAc;;;
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/ui/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,cAAc;;;8EAoCnB,CAAA;AAED,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,OAAmB,EACnB,IAAgB,EAChB,OAAe,EACf,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,GAC/B,YAAY,CAAC,OAAO,cAAc,CAAC,GAAG;IACpC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,qBAYF;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA"}
|
package/dist/ui/button.js
CHANGED
|
@@ -23,6 +23,8 @@ const buttonVariants = cva("inline-flex shrink-0 items-center justify-center gap
|
|
|
23
23
|
"icon-xs": "size-6 rounded-md [&_svg:not([class*='size-'])]:size-3",
|
|
24
24
|
"icon-sm": "size-6",
|
|
25
25
|
"icon-lg": "size-8",
|
|
26
|
+
touch: "h-touch-target px-3 has-[>svg:first-child]:pl-2.5 has-[>svg:last-child]:pr-2.5",
|
|
27
|
+
"icon-touch": "size-touch-target",
|
|
26
28
|
},
|
|
27
29
|
},
|
|
28
30
|
defaultVariants: {
|
package/dist/ui/button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/ui/button.tsx"],"names":[],"mappings":";AAAA,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,EAAE,MAAM,UAAU,CAAA;AAE/B,MAAM,cAAc,GAAG,GAAG,CACxB,wbAAwb,EACxb;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,2DAA2D;YACpE,WAAW,EACT,iMAAiM;YACnM,OAAO,EACL,wHAAwH;YAC1H,SAAS,EAAE,+DAA+D;YAC1E,KAAK,EAAE,6DAA6D;YACpE,IAAI,EAAE,8CAA8C;YACpD,QAAQ,EACN,wQAAwQ;SAC3Q;QACD,IAAI,EAAE;YACJ,OAAO,EACL,mEAAmE;YACrE,EAAE,EAAE,0FAA0F;YAC9F,EAAE,EAAE,kGAAkG;YACtG,EAAE,EAAE,gFAAgF;YACpF,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,wDAAwD;YACnE,SAAS,EAAE,QAAQ;YACnB,SAAS,EAAE,QAAQ;
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/ui/button.tsx"],"names":[],"mappings":";AAAA,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,EAAE,MAAM,UAAU,CAAA;AAE/B,MAAM,cAAc,GAAG,GAAG,CACxB,wbAAwb,EACxb;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,2DAA2D;YACpE,WAAW,EACT,iMAAiM;YACnM,OAAO,EACL,wHAAwH;YAC1H,SAAS,EAAE,+DAA+D;YAC1E,KAAK,EAAE,6DAA6D;YACpE,IAAI,EAAE,8CAA8C;YACpD,QAAQ,EACN,wQAAwQ;SAC3Q;QACD,IAAI,EAAE;YACJ,OAAO,EACL,mEAAmE;YACrE,EAAE,EAAE,0FAA0F;YAC9F,EAAE,EAAE,kGAAkG;YACtG,EAAE,EAAE,gFAAgF;YACpF,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,wDAAwD;YACnE,SAAS,EAAE,QAAQ;YACnB,SAAS,EAAE,QAAQ;YACnB,KAAK,EACH,gFAAgF;YAClF,YAAY,EAAE,mBAAmB;SAClC;KACF;IACD,eAAe,EAAE;QACf,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,SAAS;KAChB;CACF,CACF,CAAA;AAED,SAAS,MAAM,CAAC,EACd,SAAS,EACT,OAAO,GAAG,SAAS,EACnB,IAAI,GAAG,SAAS,EAChB,OAAO,GAAG,KAAK,EACf,GAAG,KAAK,EAIP;IACD,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAA;IAE3C,OAAO,CACL,KAAC,IAAI,iBACO,QAAQ,kBACJ,OAAO,eACV,IAAI,EACf,SAAS,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,KACvD,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA"}
|
package/dist/ui/select.d.ts
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Select as SelectPrimitive } from "radix-ui";
|
|
3
|
+
type SelectItemSize = "default" | "touch";
|
|
3
4
|
declare function Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>): React.JSX.Element;
|
|
4
5
|
declare function SelectGroup({ ...props }: React.ComponentProps<typeof SelectPrimitive.Group>): React.JSX.Element;
|
|
5
6
|
declare function SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>): React.JSX.Element;
|
|
6
7
|
declare function SelectTrigger({ className, size, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
|
|
7
|
-
size?: "sm" | "default";
|
|
8
|
+
size?: "sm" | "default" | "touch";
|
|
9
|
+
}): React.JSX.Element;
|
|
10
|
+
declare function SelectContent({ className, children, position, align, size, ...props }: React.ComponentProps<typeof SelectPrimitive.Content> & {
|
|
11
|
+
size?: SelectItemSize;
|
|
8
12
|
}): React.JSX.Element;
|
|
9
|
-
declare function SelectContent({ className, children, position, align, ...props }: React.ComponentProps<typeof SelectPrimitive.Content>): React.JSX.Element;
|
|
10
13
|
declare function SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>): React.JSX.Element;
|
|
11
|
-
declare function SelectItem({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>
|
|
14
|
+
declare function SelectItem({ className, children, size, ...props }: React.ComponentProps<typeof SelectPrimitive.Item> & {
|
|
15
|
+
size?: SelectItemSize;
|
|
16
|
+
}): React.JSX.Element;
|
|
12
17
|
declare function SelectSeparator({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Separator>): React.JSX.Element;
|
|
13
18
|
declare function SelectScrollUpButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>): React.JSX.Element;
|
|
14
19
|
declare function SelectScrollDownButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>): React.JSX.Element;
|
package/dist/ui/select.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/ui/select.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAA;AAEpD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 @@ import * as React from "react";
|
|
|
4
4
|
import { cn } from "../lib/utils.js";
|
|
5
5
|
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
|
|
6
6
|
import { Select as SelectPrimitive } from "radix-ui";
|
|
7
|
+
// The items render in a portal, so a list's size reaches them through context, not the DOM.
|
|
8
|
+
const SelectItemSizeContext = React.createContext("default");
|
|
7
9
|
function Select({ ...props }) {
|
|
8
10
|
return _jsx(SelectPrimitive.Root, { "data-slot": "select", ...props });
|
|
9
11
|
}
|
|
@@ -14,18 +16,21 @@ function SelectValue({ ...props }) {
|
|
|
14
16
|
return _jsx(SelectPrimitive.Value, { "data-slot": "select-value", ...props });
|
|
15
17
|
}
|
|
16
18
|
function SelectTrigger({ className, size = "default", children, ...props }) {
|
|
17
|
-
return (_jsxs(SelectPrimitive.Trigger, { "data-slot": "select-trigger", "data-size": size, className: cn("flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-field px-2.5 py-1 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-7 data-[size=sm]:h-6 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground", className), ...props, children: [children, _jsx(SelectPrimitive.Icon, { asChild: true, children: _jsx(ChevronDownIcon, { className: "size-4 opacity-50" }) })] }));
|
|
19
|
+
return (_jsxs(SelectPrimitive.Trigger, { "data-slot": "select-trigger", "data-size": size, className: cn("flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-field px-2.5 py-1 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-7 data-[size=sm]:h-6 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground", size === "touch" && "h-touch-target", className), ...props, children: [children, _jsx(SelectPrimitive.Icon, { asChild: true, children: _jsx(ChevronDownIcon, { className: "size-4 opacity-50" }) })] }));
|
|
18
20
|
}
|
|
19
|
-
function SelectContent({ className, children, position = "item-aligned", align = "center", ...props }) {
|
|
21
|
+
function SelectContent({ className, children, position = "item-aligned", align = "center", size = "default", ...props }) {
|
|
20
22
|
return (_jsx(SelectPrimitive.Portal, { children: _jsxs(SelectPrimitive.Content, { "data-slot": "select-content", className: cn("relative z-50 max-h-(--radix-select-content-available-height) data-[side=bottom]:max-h-[calc(var(--radix-select-content-available-height)-env(safe-area-inset-bottom))] data-[side=top]:max-h-[calc(var(--radix-select-content-available-height)-env(safe-area-inset-top))] min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-xl bg-popover text-popover-foreground shadow-menu data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 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", position === "popper" &&
|
|
21
23
|
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className), position: position, align: align, ...props, children: [_jsx(SelectScrollUpButton, {}), _jsx(SelectPrimitive.Viewport, { className: cn("p-1", position === "popper" &&
|
|
22
|
-
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"), children: children }), _jsx(SelectScrollDownButton, {})] }) }));
|
|
24
|
+
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"), children: _jsx(SelectItemSizeContext.Provider, { value: size, children: children }) }), _jsx(SelectScrollDownButton, {})] }) }));
|
|
23
25
|
}
|
|
24
26
|
function SelectLabel({ className, ...props }) {
|
|
25
27
|
return (_jsx(SelectPrimitive.Label, { "data-slot": "select-label", className: cn("px-2 py-1.5 text-xs text-muted-foreground", className), ...props }));
|
|
26
28
|
}
|
|
27
|
-
function SelectItem({ className, children, ...props }) {
|
|
28
|
-
|
|
29
|
+
function SelectItem({ className, children, size, ...props }) {
|
|
30
|
+
const listSize = React.useContext(SelectItemSizeContext);
|
|
31
|
+
return (_jsxs(SelectPrimitive.Item, { "data-slot": "select-item", className: cn("relative flex w-full cursor-default items-center gap-2 rounded-md py-1 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
32
|
+
// One height or the other: `cn` does not merge `min-h-7` with the theme's `touch-target` spacing.
|
|
33
|
+
(size ?? listSize) === "touch" ? "min-h-touch-target" : "min-h-7", className), ...props, children: [_jsx("span", { "data-slot": "select-item-indicator", className: "absolute right-2 flex size-3.5 items-center justify-center", children: _jsx(SelectPrimitive.ItemIndicator, { children: _jsx(CheckIcon, { className: "size-4" }) }) }), _jsx(SelectPrimitive.ItemText, { children: children })] }));
|
|
29
34
|
}
|
|
30
35
|
function SelectSeparator({ className, ...props }) {
|
|
31
36
|
return (_jsx(SelectPrimitive.Separator, { "data-slot": "select-separator", className: cn("pointer-events-none -mx-1 my-1 h-px bg-border", className), ...props }));
|
package/dist/ui/select.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../src/ui/select.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAA;AACpC,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AACxE,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../src/ui/select.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAA;AACpC,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AACxE,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAA;AAIpD,4FAA4F;AAC5F,MAAM,qBAAqB,GAAG,KAAK,CAAC,aAAa,CAAiB,SAAS,CAAC,CAAA;AAE5E,SAAS,MAAM,CAAC,EACd,GAAG,KAAK,EAC0C;IAClD,OAAO,KAAC,eAAe,CAAC,IAAI,iBAAW,QAAQ,KAAK,KAAK,GAAI,CAAA;AAC/D,CAAC;AAED,SAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EAC2C;IACnD,OAAO,KAAC,eAAe,CAAC,KAAK,iBAAW,cAAc,KAAK,KAAK,GAAI,CAAA;AACtE,CAAC;AAED,SAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EAC2C;IACnD,OAAO,KAAC,eAAe,CAAC,KAAK,iBAAW,cAAc,KAAK,KAAK,GAAI,CAAA;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,gBAAgB,iBACrB,2BAA2B,EACrC,SAAS,EAAE,EAAE,CACX,sDAAsD,EACtD,SAAS,CACV,KACG,KAAK,YAET,KAAC,eAAe,IAAC,SAAS,EAAC,QAAQ,GAAG,GACL,CACpC,CAAA;AACH,CAAC;AAED,OAAO,EACL,MAAM,EACN,aAAa,EACb,WAAW,EACX,UAAU,EACV,WAAW,EACX,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,WAAW,GACZ,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@softure-ai/theme-notion",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
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
|
@@ -53,6 +53,7 @@ export { MarkPopover, type MarkPopoverProps } from "./notion/MarkPopover.js";
|
|
|
53
53
|
export { PageFrame, type PageFrameProps } from "./notion/PageFrame.js";
|
|
54
54
|
export { PageHeader, type PageCrumb, type PageHeaderProps } from "./notion/PageHeader.js";
|
|
55
55
|
export { PropertyList, type Property, type PropertyListProps } from "./notion/PropertyList.js";
|
|
56
|
+
export { SheetMenu, SheetMenuButton, SheetMenuItem, type SheetMenuButtonProps } from "./notion/SheetMenu.js";
|
|
56
57
|
export { SidePanel, type SidePanelLayout, type SidePanelProps } from "./notion/SidePanel.js";
|
|
57
58
|
export {
|
|
58
59
|
SortableActivator,
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Slot } from "radix-ui";
|
|
4
|
+
import type { ComponentProps } from "react";
|
|
5
|
+
|
|
6
|
+
import { cn } from "../lib/utils.js";
|
|
7
|
+
|
|
8
|
+
// Navigation rows inside a `Sheet` (a phone's navigation drawer), shaped like the sidebar's menu but with no
|
|
9
|
+
// `SidebarProvider`: a list of items, each holding one full-width row.
|
|
10
|
+
export function SheetMenu({ className, ...props }: ComponentProps<"ul">) {
|
|
11
|
+
return <ul data-slot="sheet-menu" className={cn("flex w-full min-w-0 flex-col gap-1", className)} {...props} />;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function SheetMenuItem({ className, ...props }: ComponentProps<"li">) {
|
|
15
|
+
return <li data-slot="sheet-menu-item" className={cn("relative", className)} {...props} />;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface SheetMenuButtonProps extends ComponentProps<"button"> {
|
|
19
|
+
// Renders the child (a link) with the row's look instead of a button.
|
|
20
|
+
readonly asChild?: boolean;
|
|
21
|
+
// The row of the screen being shown; the caller adds `aria-current="page"` on a link.
|
|
22
|
+
readonly isActive?: boolean;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// One row: icon and label left-aligned in the foreground colour, a touch target tall on a phone and a list row
|
|
26
|
+
// from `md`, hovered and focused like the sidebar's rows on the sheet's `background`.
|
|
27
|
+
export function SheetMenuButton({ asChild = false, isActive = false, className, type, ...props }: SheetMenuButtonProps) {
|
|
28
|
+
const Comp = asChild ? Slot.Root : "button";
|
|
29
|
+
return (
|
|
30
|
+
<Comp
|
|
31
|
+
data-slot="sheet-menu-button"
|
|
32
|
+
data-active={isActive}
|
|
33
|
+
type={asChild ? type : (type ?? "button")}
|
|
34
|
+
className={cn(
|
|
35
|
+
"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",
|
|
36
|
+
className,
|
|
37
|
+
)}
|
|
38
|
+
{...props}
|
|
39
|
+
/>
|
|
40
|
+
);
|
|
41
|
+
}
|
package/src/notion/Status.tsx
CHANGED
|
@@ -25,20 +25,31 @@ export interface StatusProps {
|
|
|
25
25
|
icon: LucideIcon;
|
|
26
26
|
// The word: a status always carries one, so states read apart without telling colours apart.
|
|
27
27
|
children: ReactNode;
|
|
28
|
+
// The full word on hover; defaults to the word itself when it is a string or a number, since a long one is cut.
|
|
29
|
+
title?: string;
|
|
28
30
|
className?: string;
|
|
29
31
|
}
|
|
30
32
|
|
|
33
|
+
/** The word as plain text, or undefined when it is any other node. */
|
|
34
|
+
function getPlainText(children: ReactNode): string | undefined {
|
|
35
|
+
return typeof children === "string" || typeof children === "number" ? String(children) : undefined;
|
|
36
|
+
}
|
|
37
|
+
|
|
31
38
|
// A state of something (booked, to pay, overdue): a ghost badge with a line icon and a word in a palette colour.
|
|
32
|
-
|
|
39
|
+
// In a narrow container the word, not the icon, shrinks and ends in an ellipsis.
|
|
40
|
+
export function Status({ color, icon: Icon, children, title, className }: StatusProps) {
|
|
33
41
|
return (
|
|
34
42
|
<Badge
|
|
35
43
|
variant="ghost"
|
|
36
44
|
data-slot="status"
|
|
37
45
|
data-color={color}
|
|
38
|
-
|
|
46
|
+
title={title ?? getPlainText(children)}
|
|
47
|
+
className={cn("gap-1.5 px-0 text-sm font-normal [&>svg]:size-4 [&>svg]:shrink-0", TEXT_COLOR[color], className)}
|
|
39
48
|
>
|
|
40
49
|
<Icon aria-hidden="true" strokeWidth={ICON_STROKE_WIDTH} />
|
|
41
|
-
|
|
50
|
+
<span data-slot="status-label" className="min-w-0 truncate">
|
|
51
|
+
{children}
|
|
52
|
+
</span>
|
|
42
53
|
</Badge>
|
|
43
54
|
);
|
|
44
55
|
}
|
package/src/ui/badge.tsx
CHANGED
|
@@ -20,7 +20,7 @@ const TAG_COLORS = {
|
|
|
20
20
|
const COLORED_VARIANTS = ["default", "secondary", "outline", "ghost", "link", "tag"] as const
|
|
21
21
|
|
|
22
22
|
const badgeVariants = cva(
|
|
23
|
-
"inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",
|
|
23
|
+
"inline-flex w-fit max-w-full shrink-0 items-center justify-center-safe gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",
|
|
24
24
|
{
|
|
25
25
|
variants: {
|
|
26
26
|
variant: {
|
package/src/ui/button.tsx
CHANGED
|
@@ -29,6 +29,9 @@ const buttonVariants = cva(
|
|
|
29
29
|
"icon-xs": "size-6 rounded-md [&_svg:not([class*='size-'])]:size-3",
|
|
30
30
|
"icon-sm": "size-6",
|
|
31
31
|
"icon-lg": "size-8",
|
|
32
|
+
touch:
|
|
33
|
+
"h-touch-target px-3 has-[>svg:first-child]:pl-2.5 has-[>svg:last-child]:pr-2.5",
|
|
34
|
+
"icon-touch": "size-touch-target",
|
|
32
35
|
},
|
|
33
36
|
},
|
|
34
37
|
defaultVariants: {
|
package/src/ui/select.tsx
CHANGED
|
@@ -5,6 +5,11 @@ import { cn } from "../lib/utils.js"
|
|
|
5
5
|
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react"
|
|
6
6
|
import { Select as SelectPrimitive } from "radix-ui"
|
|
7
7
|
|
|
8
|
+
type SelectItemSize = "default" | "touch"
|
|
9
|
+
|
|
10
|
+
// The items render in a portal, so a list's size reaches them through context, not the DOM.
|
|
11
|
+
const SelectItemSizeContext = React.createContext<SelectItemSize>("default")
|
|
12
|
+
|
|
8
13
|
function Select({
|
|
9
14
|
...props
|
|
10
15
|
}: React.ComponentProps<typeof SelectPrimitive.Root>) {
|
|
@@ -29,7 +34,7 @@ function SelectTrigger({
|
|
|
29
34
|
children,
|
|
30
35
|
...props
|
|
31
36
|
}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
|
|
32
|
-
size?: "sm" | "default"
|
|
37
|
+
size?: "sm" | "default" | "touch"
|
|
33
38
|
}) {
|
|
34
39
|
return (
|
|
35
40
|
<SelectPrimitive.Trigger
|
|
@@ -37,6 +42,7 @@ function SelectTrigger({
|
|
|
37
42
|
data-size={size}
|
|
38
43
|
className={cn(
|
|
39
44
|
"flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-field px-2.5 py-1 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-7 data-[size=sm]:h-6 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",
|
|
45
|
+
size === "touch" && "h-touch-target",
|
|
40
46
|
className
|
|
41
47
|
)}
|
|
42
48
|
{...props}
|
|
@@ -54,8 +60,11 @@ function SelectContent({
|
|
|
54
60
|
children,
|
|
55
61
|
position = "item-aligned",
|
|
56
62
|
align = "center",
|
|
63
|
+
size = "default",
|
|
57
64
|
...props
|
|
58
|
-
}: React.ComponentProps<typeof SelectPrimitive.Content>
|
|
65
|
+
}: React.ComponentProps<typeof SelectPrimitive.Content> & {
|
|
66
|
+
size?: SelectItemSize
|
|
67
|
+
}) {
|
|
59
68
|
return (
|
|
60
69
|
<SelectPrimitive.Portal>
|
|
61
70
|
<SelectPrimitive.Content
|
|
@@ -78,7 +87,9 @@ function SelectContent({
|
|
|
78
87
|
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
|
|
79
88
|
)}
|
|
80
89
|
>
|
|
81
|
-
{
|
|
90
|
+
<SelectItemSizeContext.Provider value={size}>
|
|
91
|
+
{children}
|
|
92
|
+
</SelectItemSizeContext.Provider>
|
|
82
93
|
</SelectPrimitive.Viewport>
|
|
83
94
|
<SelectScrollDownButton />
|
|
84
95
|
</SelectPrimitive.Content>
|
|
@@ -102,13 +113,20 @@ function SelectLabel({
|
|
|
102
113
|
function SelectItem({
|
|
103
114
|
className,
|
|
104
115
|
children,
|
|
116
|
+
size,
|
|
105
117
|
...props
|
|
106
|
-
}: React.ComponentProps<typeof SelectPrimitive.Item>
|
|
118
|
+
}: React.ComponentProps<typeof SelectPrimitive.Item> & {
|
|
119
|
+
size?: SelectItemSize
|
|
120
|
+
}) {
|
|
121
|
+
const listSize = React.useContext(SelectItemSizeContext)
|
|
122
|
+
|
|
107
123
|
return (
|
|
108
124
|
<SelectPrimitive.Item
|
|
109
125
|
data-slot="select-item"
|
|
110
126
|
className={cn(
|
|
111
|
-
"relative flex w-full cursor-default items-center gap-2 rounded-md py-1
|
|
127
|
+
"relative flex w-full cursor-default items-center gap-2 rounded-md py-1 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
128
|
+
// One height or the other: `cn` does not merge `min-h-7` with the theme's `touch-target` spacing.
|
|
129
|
+
(size ?? listSize) === "touch" ? "min-h-touch-target" : "min-h-7",
|
|
112
130
|
className
|
|
113
131
|
)}
|
|
114
132
|
{...props}
|