@ismou-workspace/ui 0.0.0-stage → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. package/README.md +17 -2
  2. package/dist/brand/app-brands.d.ts +59 -0
  3. package/dist/brand/app-brands.js +130 -0
  4. package/dist/brand/app-icon.d.ts +34 -0
  5. package/dist/brand/app-icon.js +65 -0
  6. package/dist/brand/app-logo.d.ts +14 -0
  7. package/dist/brand/app-logo.js +27 -0
  8. package/dist/brand/favicons/account.svg +1 -0
  9. package/dist/brand/favicons/admin.svg +1 -0
  10. package/dist/brand/favicons/calendar.svg +1 -0
  11. package/dist/brand/favicons/contacts.svg +1 -0
  12. package/dist/brand/favicons/core.svg +1 -0
  13. package/dist/brand/favicons/drive.svg +1 -0
  14. package/dist/brand/favicons/google.svg +1 -0
  15. package/dist/brand/favicons/office.svg +1 -0
  16. package/dist/brand/file-icons/archive.svg +1 -0
  17. package/dist/brand/file-icons/audio.svg +1 -0
  18. package/dist/brand/file-icons/code.svg +1 -0
  19. package/dist/brand/file-icons/diagram.svg +1 -0
  20. package/dist/brand/file-icons/document.svg +1 -0
  21. package/dist/brand/file-icons/form.svg +1 -0
  22. package/dist/brand/file-icons/image.svg +1 -0
  23. package/dist/brand/file-icons/markdown.svg +1 -0
  24. package/dist/brand/file-icons/other.svg +1 -0
  25. package/dist/brand/file-icons/pdf.svg +1 -0
  26. package/dist/brand/file-icons/presentation.svg +1 -0
  27. package/dist/brand/file-icons/spreadsheet.svg +1 -0
  28. package/dist/brand/file-icons/text.svg +1 -0
  29. package/dist/brand/file-icons/video.svg +1 -0
  30. package/dist/brand/grain-surface.d.ts +8 -0
  31. package/dist/brand/grain-surface.js +10 -0
  32. package/dist/brand/kind-icons.d.ts +36 -0
  33. package/dist/brand/kind-icons.js +149 -0
  34. package/dist/components/account-menu.d.ts +20 -0
  35. package/dist/components/account-menu.js +13 -0
  36. package/dist/components/alert.d.ts +10 -0
  37. package/dist/components/alert.js +28 -0
  38. package/dist/components/app-switcher.d.ts +21 -0
  39. package/dist/components/app-switcher.js +17 -0
  40. package/dist/components/area-selection.d.ts +21 -0
  41. package/dist/components/area-selection.js +91 -0
  42. package/dist/components/avatar-picker-dialog.d.ts +40 -0
  43. package/dist/components/avatar-picker-dialog.js +110 -0
  44. package/dist/components/avatar.d.ts +5 -0
  45. package/dist/components/avatar.js +10 -0
  46. package/dist/components/badge-list.d.ts +7 -0
  47. package/dist/components/badge-list.js +7 -0
  48. package/dist/components/badge.d.ts +9 -0
  49. package/dist/components/badge.js +32 -0
  50. package/dist/components/breadcrumbs.d.ts +20 -0
  51. package/dist/components/breadcrumbs.js +16 -0
  52. package/dist/components/button.d.ts +12 -0
  53. package/dist/components/button.js +38 -0
  54. package/dist/components/caption.d.ts +3 -0
  55. package/dist/components/caption.js +6 -0
  56. package/dist/components/card.d.ts +8 -0
  57. package/dist/components/card.js +23 -0
  58. package/dist/components/checkbox-field.d.ts +10 -0
  59. package/dist/components/checkbox-field.js +8 -0
  60. package/dist/components/checkbox.d.ts +3 -0
  61. package/dist/components/checkbox.js +7 -0
  62. package/dist/components/code.d.ts +16 -0
  63. package/dist/components/code.js +32 -0
  64. package/dist/components/color-dot.d.ts +11 -0
  65. package/dist/components/color-dot.js +34 -0
  66. package/dist/components/corner-mark.d.ts +14 -0
  67. package/dist/components/corner-mark.js +27 -0
  68. package/dist/components/date-range-field.d.ts +9 -0
  69. package/dist/components/date-range-field.js +9 -0
  70. package/dist/components/description-list.d.ts +11 -0
  71. package/dist/components/description-list.js +10 -0
  72. package/dist/components/dialog.d.ts +16 -0
  73. package/dist/components/dialog.js +38 -0
  74. package/dist/components/drag-and-drop.d.ts +60 -0
  75. package/dist/components/drag-and-drop.js +141 -0
  76. package/dist/components/dropdown-menu.d.ts +27 -0
  77. package/dist/components/dropdown-menu.js +44 -0
  78. package/dist/components/entity-avatar.d.ts +28 -0
  79. package/dist/components/entity-avatar.js +22 -0
  80. package/dist/components/entity-menu.d.ts +67 -0
  81. package/dist/components/entity-menu.js +74 -0
  82. package/dist/components/error-alert.d.ts +7 -0
  83. package/dist/components/error-alert.js +9 -0
  84. package/dist/components/event-chip.d.ts +16 -0
  85. package/dist/components/event-chip.js +19 -0
  86. package/dist/components/fab.d.ts +21 -0
  87. package/dist/components/fab.js +14 -0
  88. package/dist/components/file-drop-zone.d.ts +35 -0
  89. package/dist/components/file-drop-zone.js +44 -0
  90. package/dist/components/file-type-icon.d.ts +44 -0
  91. package/dist/components/file-type-icon.js +147 -0
  92. package/dist/components/icon-image.d.ts +10 -0
  93. package/dist/components/icon-image.js +11 -0
  94. package/dist/components/identity.d.ts +27 -0
  95. package/dist/components/identity.js +22 -0
  96. package/dist/components/inline-field.d.ts +40 -0
  97. package/dist/components/inline-field.js +110 -0
  98. package/dist/components/input.d.ts +17 -0
  99. package/dist/components/input.js +14 -0
  100. package/dist/components/item-list.d.ts +11 -0
  101. package/dist/components/item-list.js +15 -0
  102. package/dist/components/label.d.ts +3 -0
  103. package/dist/components/label.js +6 -0
  104. package/dist/components/mini-month.d.ts +15 -0
  105. package/dist/components/mini-month.js +35 -0
  106. package/dist/components/placeholder-avatar.d.ts +12 -0
  107. package/dist/components/placeholder-avatar.js +6 -0
  108. package/dist/components/popover.d.ts +7 -0
  109. package/dist/components/popover.js +16 -0
  110. package/dist/components/progress-list.d.ts +31 -0
  111. package/dist/components/progress-list.js +15 -0
  112. package/dist/components/progress-ring.d.ts +13 -0
  113. package/dist/components/progress-ring.js +14 -0
  114. package/dist/components/progress.d.ts +10 -0
  115. package/dist/components/progress.js +12 -0
  116. package/dist/components/search-box.d.ts +25 -0
  117. package/dist/components/search-box.js +56 -0
  118. package/dist/components/searchable-options.d.ts +32 -0
  119. package/dist/components/searchable-options.js +17 -0
  120. package/dist/components/section-label.d.ts +7 -0
  121. package/dist/components/section-label.js +8 -0
  122. package/dist/components/segmented-control.d.ts +21 -0
  123. package/dist/components/segmented-control.js +9 -0
  124. package/dist/components/select-menu.d.ts +38 -0
  125. package/dist/components/select-menu.js +26 -0
  126. package/dist/components/selection-bar.d.ts +17 -0
  127. package/dist/components/selection-bar.js +15 -0
  128. package/dist/components/separator.d.ts +3 -0
  129. package/dist/components/separator.js +6 -0
  130. package/dist/components/share-dialog.d.ts +63 -0
  131. package/dist/components/share-dialog.js +74 -0
  132. package/dist/components/sheet.d.ts +20 -0
  133. package/dist/components/sheet.js +24 -0
  134. package/dist/components/skeleton.d.ts +2 -0
  135. package/dist/components/skeleton.js +5 -0
  136. package/dist/components/spinner.d.ts +3 -0
  137. package/dist/components/spinner.js +8 -0
  138. package/dist/components/table.d.ts +7 -0
  139. package/dist/components/table.js +20 -0
  140. package/dist/components/text-link.d.ts +9 -0
  141. package/dist/components/text-link.js +9 -0
  142. package/dist/components/text.d.ts +13 -0
  143. package/dist/components/text.js +8 -0
  144. package/dist/components/toaster.d.ts +8 -0
  145. package/dist/components/toaster.js +27 -0
  146. package/dist/components/viewer-dialog.d.ts +37 -0
  147. package/dist/components/viewer-dialog.js +53 -0
  148. package/dist/index.d.ts +87 -0
  149. package/dist/index.js +87 -0
  150. package/dist/layout/app-frame.d.ts +42 -0
  151. package/dist/layout/app-frame.js +62 -0
  152. package/dist/layout/app-shell.d.ts +11 -0
  153. package/dist/layout/app-shell.js +7 -0
  154. package/dist/layout/document-title.d.ts +14 -0
  155. package/dist/layout/document-title.js +39 -0
  156. package/dist/layout/empty-state.d.ts +16 -0
  157. package/dist/layout/empty-state.js +19 -0
  158. package/dist/layout/entity-header.d.ts +14 -0
  159. package/dist/layout/entity-header.js +6 -0
  160. package/dist/layout/form-field.d.ts +10 -0
  161. package/dist/layout/form-field.js +9 -0
  162. package/dist/layout/form-grid.d.ts +6 -0
  163. package/dist/layout/form-grid.js +9 -0
  164. package/dist/layout/full-page-message.d.ts +10 -0
  165. package/dist/layout/full-page-message.js +5 -0
  166. package/dist/layout/full-page-surface.d.ts +12 -0
  167. package/dist/layout/full-page-surface.js +8 -0
  168. package/dist/layout/month-grid.d.ts +31 -0
  169. package/dist/layout/month-grid.js +12 -0
  170. package/dist/layout/page-header.d.ts +14 -0
  171. package/dist/layout/page-header.js +11 -0
  172. package/dist/layout/panel.d.ts +15 -0
  173. package/dist/layout/panel.js +12 -0
  174. package/dist/layout/retry-message.d.ts +8 -0
  175. package/dist/layout/retry-message.js +9 -0
  176. package/dist/layout/route-error-message.d.ts +9 -0
  177. package/dist/layout/route-error-message.js +9 -0
  178. package/dist/layout/row-list.d.ts +87 -0
  179. package/dist/layout/row-list.js +67 -0
  180. package/dist/layout/settings-section.d.ts +14 -0
  181. package/dist/layout/settings-section.js +11 -0
  182. package/dist/layout/sidebar-nav.d.ts +79 -0
  183. package/dist/layout/sidebar-nav.js +59 -0
  184. package/dist/layout/sign-in-layout.d.ts +19 -0
  185. package/dist/layout/sign-in-layout.js +11 -0
  186. package/dist/layout/sortable-row-list.d.ts +27 -0
  187. package/dist/layout/sortable-row-list.js +61 -0
  188. package/dist/layout/stack.d.ts +41 -0
  189. package/dist/layout/stack.js +51 -0
  190. package/dist/layout/tile-grid.d.ts +75 -0
  191. package/dist/layout/tile-grid.js +71 -0
  192. package/dist/layout/time-grid.d.ts +40 -0
  193. package/dist/layout/time-grid.js +63 -0
  194. package/dist/layout/use-favicon.d.ts +5 -0
  195. package/dist/layout/use-favicon.js +20 -0
  196. package/dist/lib/cn.d.ts +2 -0
  197. package/dist/lib/cn.js +5 -0
  198. package/dist/lib/initials.d.ts +2 -0
  199. package/dist/lib/initials.js +7 -0
  200. package/dist/mascot/mascot.d.ts +23 -0
  201. package/dist/mascot/mascot.definition.json +14 -0
  202. package/dist/mascot/mascot.js +49 -0
  203. package/dist/mascot/use-thinking-motion.d.ts +8 -0
  204. package/dist/mascot/use-thinking-motion.js +68 -0
  205. package/dist/styles.css +385 -0
  206. package/dist/vite/ismou-favicon.plugin.d.ts +10 -0
  207. package/dist/vite/ismou-favicon.plugin.js +67 -0
  208. package/dist/vite/phosphor-icons.plugin.d.ts +8 -0
  209. package/dist/vite/phosphor-icons.plugin.js +61 -0
  210. package/package.json +98 -3
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Slot as SlotPrimitive } from 'radix-ui';
3
+ import { Label } from '../components/label.js';
4
+ export function FormField({ label, htmlFor, error, hint, children }) {
5
+ const hintId = `${htmlFor}-hint`;
6
+ const errorId = `${htmlFor}-error`;
7
+ const describedBy = [hint ? hintId : null, error ? errorId : null].filter(Boolean).join(' ');
8
+ return (_jsxs("div", { "data-slot": "form-field", className: "flex flex-col gap-2", children: [_jsx(Label, { htmlFor: htmlFor, children: label }), _jsx(SlotPrimitive.Slot, { id: htmlFor, "aria-describedby": describedBy || undefined, "aria-invalid": error ? true : undefined, children: children }), hint && (_jsx("p", { id: hintId, className: "text-muted-foreground text-sm", children: hint })), error && (_jsx("p", { id: errorId, className: "text-danger-foreground text-sm", children: error }))] }));
9
+ }
@@ -0,0 +1,6 @@
1
+ import type * as React from 'react';
2
+ /**
3
+ * Fields in two columns on wide screens, one on small ones. A field spanning both columns takes
4
+ * `className="sm:col-span-2"`.
5
+ */
6
+ export declare function FormGrid({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from '../lib/cn.js';
3
+ /**
4
+ * Fields in two columns on wide screens, one on small ones. A field spanning both columns takes
5
+ * `className="sm:col-span-2"`.
6
+ */
7
+ export function FormGrid({ className, ...props }) {
8
+ return (_jsx("div", { "data-slot": "form-grid", className: cn('grid gap-x-8 gap-y-4 sm:grid-cols-2', className), ...props }));
9
+ }
@@ -0,0 +1,10 @@
1
+ import type * as React from 'react';
2
+ export interface FullPageMessageProps {
3
+ title: React.ReactNode;
4
+ description?: React.ReactNode;
5
+ action?: React.ReactNode;
6
+ loading?: boolean;
7
+ /** Content under the message, as wide as a reading column (a block of data to copy). */
8
+ children?: React.ReactNode;
9
+ }
10
+ export declare function FullPageMessage({ title, description, action, loading, children, }: FullPageMessageProps): React.JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Spinner } from '../components/spinner.js';
3
+ export function FullPageMessage({ title, description, action, loading = false, children, }) {
4
+ return (_jsxs("div", { "data-slot": "full-page-message", className: "flex min-h-svh flex-col items-center justify-center gap-4 bg-background px-6 text-center", children: [loading && _jsx(Spinner, { className: "size-6" }), _jsxs("div", { className: "flex max-w-md flex-col gap-1", children: [_jsx("h1", { className: "font-semibold text-lg tracking-tight", children: title }), description && _jsx("p", { className: "text-muted-foreground text-sm", children: description })] }), children && _jsx("div", { className: "w-full max-w-2xl", children: children }), action && _jsx("div", { className: "mt-2", children: action })] }));
5
+ }
@@ -0,0 +1,12 @@
1
+ import type * as React from 'react';
2
+ export interface FullPageSurfaceProps {
3
+ /** The element an outside script mounts its interface in (an editor). */
4
+ surfaceRef: React.Ref<HTMLDivElement>;
5
+ /** Shown over the surface while it isn't ready (a loading `FullPageMessage`). */
6
+ cover?: React.ReactNode;
7
+ }
8
+ /**
9
+ * The whole page given to an interface drawn by an outside script (an editor of documents): it
10
+ * mounts in the surface, hidden under `cover` until ready.
11
+ */
12
+ export declare function FullPageSurface({ surfaceRef, cover }: FullPageSurfaceProps): React.JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * The whole page given to an interface drawn by an outside script (an editor of documents): it
4
+ * mounts in the surface, hidden under `cover` until ready.
5
+ */
6
+ export function FullPageSurface({ surfaceRef, cover }) {
7
+ return (_jsxs("div", { "data-slot": "full-page-surface", className: "grid h-svh *:col-start-1 *:row-start-1", children: [_jsx("div", { ref: surfaceRef, "data-slot": "full-page-surface-content" }), cover] }));
8
+ }
@@ -0,0 +1,31 @@
1
+ import type * as React from 'react';
2
+ export interface MonthGridDay {
3
+ /** Unique in the grid, e.g. the date `2026-06-01`. */
4
+ key: string;
5
+ /** Its number in the month. */
6
+ label: string;
7
+ /** Its full name, read by screen readers ("Monday 1 June"). */
8
+ description: string;
9
+ /** Of the month before or after: drawn quieter. */
10
+ outside?: boolean;
11
+ today?: boolean;
12
+ /** Its number opens the day. */
13
+ onOpen?: () => void;
14
+ /** A click in its empty space, e.g. to add an event that day. */
15
+ onSelect?: () => void;
16
+ /** What happens that day (`EventChip`s), one under the other; the rest is cut. */
17
+ children?: React.ReactNode;
18
+ /** How many more things happen that day than shown: a "+N more" opening the day. */
19
+ more?: number;
20
+ }
21
+ export interface MonthGridProps {
22
+ /** The names of the days of the week, in the grid's order ("Mon"). */
23
+ weekdays: readonly string[];
24
+ /** The weeks shown, seven days each. */
25
+ weeks: readonly (readonly MonthGridDay[])[];
26
+ }
27
+ /**
28
+ * A month as a grid of weeks: each day its number and what happens then. The weeks share the
29
+ * height of the panel holding the grid.
30
+ */
31
+ export declare function MonthGrid({ weekdays, weeks }: MonthGridProps): React.JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from '../lib/cn.js';
3
+ /**
4
+ * A month as a grid of weeks: each day its number and what happens then. The weeks share the
5
+ * height of the panel holding the grid.
6
+ */
7
+ export function MonthGrid({ weekdays, weeks }) {
8
+ return (_jsxs("div", { "data-slot": "month-grid", className: "flex h-full min-h-0 flex-col", children: [_jsx("div", { className: "grid shrink-0 grid-cols-7 border-b", children: weekdays.map((weekday) => (_jsx("div", { className: "px-2 pb-2 font-medium text-muted-foreground text-xs uppercase tracking-wide", children: weekday }, weekday))) }), _jsx("div", { className: "flex min-h-0 flex-1 flex-col divide-y", children: weeks.map((week) => (_jsx("div", { className: "grid min-h-24 flex-1 grid-cols-7 divide-x", children: week.map((day) => (_jsxs("div", { "data-outside": day.outside || undefined, onClick: (event) => {
9
+ if (event.target === event.currentTarget)
10
+ day.onSelect?.();
11
+ }, className: "flex min-h-0 min-w-0 flex-col gap-0.5 overflow-hidden p-1 data-outside:bg-muted/40", children: [_jsx("button", { type: "button", "aria-label": day.description, "aria-current": day.today ? 'date' : undefined, onClick: day.onOpen, className: cn('flex size-6 shrink-0 items-center justify-center self-start rounded-full text-xs tabular-nums outline-none transition-colors hover:bg-accent focus-ring', day.outside && 'text-muted-foreground', day.today && 'primary-texture-subtle font-semibold hover:brightness-105'), children: day.label }), day.children, day.more !== undefined && day.more > 0 && (_jsxs("button", { type: "button", onClick: day.onOpen, className: "self-start rounded-sm px-1.5 text-muted-foreground text-xs outline-none hover:text-foreground focus-ring", children: [day.more, " more"] }))] }, day.key))) }, week[0]?.key))) })] }));
12
+ }
@@ -0,0 +1,14 @@
1
+ import type * as React from 'react';
2
+ export interface PageHeaderProps {
3
+ title: React.ReactNode;
4
+ /** The page's name in the browser tab, when `title` is not plain text. */
5
+ documentTitle?: string;
6
+ description?: React.ReactNode;
7
+ actions?: React.ReactNode;
8
+ }
9
+ /**
10
+ * The page's title, what it is about, and its actions. Spaced by the page's `Stack`, like any
11
+ * block. The same size beside a detail panel: the page stays the same page. Its title also
12
+ * names the browser tab: "Projects | Drive · Ismou".
13
+ */
14
+ export declare function PageHeader({ title, documentTitle, description, actions }: PageHeaderProps): React.JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { usePageTitle } from './document-title.js';
3
+ /**
4
+ * The page's title, what it is about, and its actions. Spaced by the page's `Stack`, like any
5
+ * block. The same size beside a detail panel: the page stays the same page. Its title also
6
+ * names the browser tab: "Projects | Drive · Ismou".
7
+ */
8
+ export function PageHeader({ title, documentTitle, description, actions }) {
9
+ usePageTitle(documentTitle ?? (typeof title === 'string' ? title : undefined));
10
+ return (_jsxs("div", { "data-slot": "page-header", className: "flex flex-wrap items-start justify-between gap-4", children: [_jsxs("div", { className: "flex min-w-0 flex-col gap-1", children: [_jsx("h1", { className: "truncate font-semibold text-2xl tracking-tight", children: title }), description && (_jsx("p", { className: "truncate text-muted-foreground text-sm tabular-nums", "aria-live": "polite", children: description }))] }), actions && _jsx("div", { className: "flex shrink-0 items-center gap-2", children: actions })] }));
11
+ }
@@ -0,0 +1,15 @@
1
+ import type * as React from 'react';
2
+ /** The surface of a panel, shared by everything that sits on the canvas as one (the search bar). */
3
+ export declare const PANEL_SURFACE_CLASS_NAME = "rounded-2xl bg-panel";
4
+ export interface PanelProps extends React.ComponentProps<'div'> {
5
+ /** Its content scrolls inside it; otherwise the content handles its own scrolling. */
6
+ scroll?: boolean;
7
+ /** Slides in from the right when it mounts, e.g. a detail opened beside a list. */
8
+ appear?: boolean;
9
+ }
10
+ /**
11
+ * A surface of the application frame: rounded, on the page canvas. `AppFrame` puts a page in one
12
+ * panel; a page with `layout="panels"` lays out its own, side by side (a list, then a detail).
13
+ * Floating elements of the page (a `Fab`) are placed against the panel, whatever its scroll.
14
+ */
15
+ export declare function Panel({ scroll, appear, className, children, ...props }: PanelProps): React.JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from '../lib/cn.js';
3
+ /** The surface of a panel, shared by everything that sits on the canvas as one (the search bar). */
4
+ export const PANEL_SURFACE_CLASS_NAME = 'rounded-2xl bg-panel';
5
+ /**
6
+ * A surface of the application frame: rounded, on the page canvas. `AppFrame` puts a page in one
7
+ * panel; a page with `layout="panels"` lays out its own, side by side (a list, then a detail).
8
+ * Floating elements of the page (a `Fab`) are placed against the panel, whatever its scroll.
9
+ */
10
+ export function Panel({ scroll = false, appear = false, className, children, ...props }) {
11
+ return (_jsx("div", { "data-slot": "panel", className: cn('relative min-h-0 min-w-0 overflow-hidden', PANEL_SURFACE_CLASS_NAME, appear && 'fade-in-0 slide-in-from-right-2 animate-in duration-200', className), ...props, children: scroll ? _jsx("div", { className: "h-full overflow-y-auto", children: children }) : children }));
12
+ }
@@ -0,0 +1,8 @@
1
+ export interface RetryMessageProps {
2
+ /** What could not be reached, as in "Unable to reach <serviceName>". */
3
+ serviceName: string;
4
+ error: Error;
5
+ onRetry: () => void;
6
+ }
7
+ /** Full-page error for a request the whole page depends on, with a way to try again. */
8
+ export declare function RetryMessage({ serviceName, error, onRetry }: RetryMessageProps): import("react").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useSharedMessages } from '@ismou-workspace/translations/react';
3
+ import { Button } from '../components/button.js';
4
+ import { FullPageMessage } from './full-page-message.js';
5
+ /** Full-page error for a request the whole page depends on, with a way to try again. */
6
+ export function RetryMessage({ serviceName, error, onRetry }) {
7
+ const t = useSharedMessages();
8
+ return (_jsx(FullPageMessage, { title: t.ui.retryMessage.title(serviceName), description: error.message, action: _jsx(Button, { variant: "outline", onClick: onRetry, children: t.common.retry }) }));
9
+ }
@@ -0,0 +1,9 @@
1
+ import type * as React from 'react';
2
+ export interface RouteErrorMessageProps {
3
+ /** An unknown route rather than an unexpected rendering error. */
4
+ notFound: boolean;
5
+ /** A link back to the home page, typically the router's `<Link>`. */
6
+ homeLink: React.ReactElement;
7
+ }
8
+ /** Full-page message for unknown routes and unexpected rendering errors. */
9
+ export declare function RouteErrorMessage({ notFound, homeLink }: RouteErrorMessageProps): React.JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useSharedMessages } from '@ismou-workspace/translations/react';
3
+ import { Button } from '../components/button.js';
4
+ import { FullPageMessage } from './full-page-message.js';
5
+ /** Full-page message for unknown routes and unexpected rendering errors. */
6
+ export function RouteErrorMessage({ notFound, homeLink }) {
7
+ const t = useSharedMessages().ui.routeError;
8
+ return (_jsx(FullPageMessage, { title: notFound ? t.notFoundTitle : t.errorTitle, description: notFound ? t.notFoundDescription : t.errorDescription, action: _jsx(Button, { asChild: true, variant: "outline", children: homeLink }) }));
9
+ }
@@ -0,0 +1,87 @@
1
+ import type * as React from 'react';
2
+ import { type DropState } from '../components/drag-and-drop.tsx';
3
+ /**
4
+ * The list of entities, the same in every app (accounts, apps, events, contacts): one rounded row
5
+ * per entity, sitting on the panel itself (no box, no lines). It bleeds into the gutter by the
6
+ * rows' own padding, so a row's tint frames it while its text stays aligned with the page.
7
+ */
8
+ export declare function RowList({ className, ...props }: React.ComponentProps<'ul'>): React.JSX.Element;
9
+ export type RowListProps = React.ComponentProps<'ul'>;
10
+ export interface RowListItemProps extends React.ComponentProps<'li'> {
11
+ /** The entity open beside the list, or one of the entities picked for a common action. */
12
+ selected?: boolean;
13
+ /**
14
+ * The row is a drop target (`useDropTarget`), e.g. a folder: outlined while an item it accepts
15
+ * is dragged, tinted while that item is over it. Pass the hook's `ref` as the row's `ref`.
16
+ */
17
+ dropState?: DropState;
18
+ /** The entity is on its way elsewhere (cut, waiting to be pasted): faded. */
19
+ dimmed?: boolean;
20
+ }
21
+ /**
22
+ * One row, the same in every list: its content — a `RowColumns` (a row of information) or a
23
+ * `RowTarget` (a row that opens something) — then its `RowAction`, side by side. Tinted on hover
24
+ * and while its `EntityMenu` is open (wrap the item in the menu).
25
+ */
26
+ export declare function RowListItem({ selected, dropState, dimmed, className, ...props }: RowListItemProps): React.JSX.Element;
27
+ /** The content of a row of information: columns side by side, stacked on small screens. */
28
+ export declare function RowColumns({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
29
+ export interface RowCellProps extends React.ComponentProps<'div'> {
30
+ /**
31
+ * - `identity`: who or what the row is; one width on every row, so the next columns line up.
32
+ * - `fill`: takes the rest of the row.
33
+ */
34
+ size?: 'identity' | 'fill';
35
+ }
36
+ /** A column of a `RowColumns`. */
37
+ export declare function RowCell({ size, className, ...props }: RowCellProps): React.JSX.Element;
38
+ export interface RowTargetProps extends React.ComponentProps<'button'> {
39
+ /** Render the child element (a router `<Link>`, a `<button>`) as the whole row. */
40
+ asChild?: boolean;
41
+ }
42
+ /** A row that opens something: the row's content is the link or the button. */
43
+ export declare function RowTarget({ asChild, className, ...props }: RowTargetProps): React.JSX.Element;
44
+ export interface RowSelectProps {
45
+ /** Accessible name, e.g. "Select report.pdf". */
46
+ label: string;
47
+ checked: boolean;
48
+ onCheckedChange: (checked: boolean) => void;
49
+ /** Some rows of the list are picked: every checkbox shows. */
50
+ selecting?: boolean;
51
+ }
52
+ /**
53
+ * Picks the row for a common action (move, delete...), before its content. It takes no room
54
+ * until rows are picked (a click, Ctrl/⌘ or Shift, a band, Space): then it shows on every row.
55
+ * Devices that can't hover always show it.
56
+ */
57
+ export declare function RowSelect({ label, checked, onCheckedChange, selecting }: RowSelectProps): React.JSX.Element;
58
+ /** A short value at the end of a `RowTarget`, e.g. a phone number. */
59
+ export declare function RowMeta({ className, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
60
+ export interface RowListGroupProps {
61
+ /** Id of the heading, naming the group. */
62
+ headingId: string;
63
+ label: React.ReactNode;
64
+ /** How many rows the group holds, beside its label. */
65
+ count?: number;
66
+ /** The group's `RowList`. */
67
+ children: React.ReactNode;
68
+ }
69
+ /** A group of a long list (a letter, a company): its heading sticks while the group scrolls by. */
70
+ export declare function RowListGroup({ headingId, label, count, children }: RowListGroupProps): React.JSX.Element;
71
+ /**
72
+ * The actions at the end of a row, beside its content (never inside its link or button): they
73
+ * take no room until the row is hovered or focused, or its menu is open (always shown on small
74
+ * screens). Hidden, they stay out of the tab order: focusing the row shows them, next in it.
75
+ */
76
+ export declare function RowAction({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
77
+ export interface RowListSkeletonProps {
78
+ /** Read by screen readers, e.g. "Loading users". */
79
+ label: string;
80
+ rows?: number;
81
+ /** The shape of each row's picture: a person, or an app. */
82
+ media?: 'circle' | 'square';
83
+ /** Badges after the identity, as in rows listing permissions. */
84
+ badges?: number;
85
+ }
86
+ /** A row list while it loads. */
87
+ export declare function RowListSkeleton({ label, rows, media, badges, }: RowListSkeletonProps): React.JSX.Element;
@@ -0,0 +1,67 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Slot as SlotPrimitive } from 'radix-ui';
3
+ import { Checkbox } from '../components/checkbox.js';
4
+ import { DROP_TARGET_CLASS_NAME } from '../components/drag-and-drop.js';
5
+ import { Skeleton } from '../components/skeleton.js';
6
+ import { cn } from '../lib/cn.js';
7
+ /**
8
+ * The list of entities, the same in every app (accounts, apps, events, contacts): one rounded row
9
+ * per entity, sitting on the panel itself (no box, no lines). It bleeds into the gutter by the
10
+ * rows' own padding, so a row's tint frames it while its text stays aligned with the page.
11
+ */
12
+ export function RowList({ className, ...props }) {
13
+ return (_jsx("ul", { "data-slot": "row-list", className: cn('-mx-3 flex flex-col gap-px', className), ...props }));
14
+ }
15
+ /**
16
+ * One row, the same in every list: its content — a `RowColumns` (a row of information) or a
17
+ * `RowTarget` (a row that opens something) — then its `RowAction`, side by side. Tinted on hover
18
+ * and while its `EntityMenu` is open (wrap the item in the menu).
19
+ */
20
+ export function RowListItem({ selected = false, dropState, dimmed = false, className, ...props }) {
21
+ return (_jsx("li", { "data-slot": "row-list-item", "data-selected": selected || undefined, "data-drop": dropState, className: cn('group/row flex min-w-0 items-center transition-colors hover:bg-muted/60 data-[state=open]:bg-muted/60', 'rounded-lg data-selected:bg-accent data-selected:ring-1 data-selected:ring-border data-selected:ring-inset', DROP_TARGET_CLASS_NAME, dimmed && 'opacity-50', className), ...props }));
22
+ }
23
+ /** The content of a row of information: columns side by side, stacked on small screens. */
24
+ export function RowColumns({ className, ...props }) {
25
+ return (_jsx("div", { "data-slot": "row-columns", className: cn('flex min-w-0 flex-1 flex-col gap-3 px-3 py-2.5 sm:flex-row sm:items-center sm:gap-6', className), ...props }));
26
+ }
27
+ /** A column of a `RowColumns`. */
28
+ export function RowCell({ size = 'fill', className, ...props }) {
29
+ return (_jsx("div", { "data-slot": "row-cell", className: cn('min-w-0', size === 'identity' ? 'sm:w-72 sm:shrink-0' : 'flex flex-1 flex-col gap-2', className), ...props }));
30
+ }
31
+ /** A row that opens something: the row's content is the link or the button. */
32
+ export function RowTarget({ asChild = false, className, ...props }) {
33
+ const Comp = asChild ? SlotPrimitive.Slot : 'button';
34
+ return (_jsx(Comp, { "data-slot": "row-target", ...(asChild ? {} : { type: 'button' }), className: cn('flex min-w-0 flex-1 items-center gap-3.5 px-3 py-2.5 text-left text-sm outline-none focus-ring',
35
+ // Being dragged (`useDragSource`): the row stays in place, faded.
36
+ 'rounded-lg transition-opacity data-dragging:opacity-40', className), ...props }));
37
+ }
38
+ /**
39
+ * Picks the row for a common action (move, delete...), before its content. It takes no room
40
+ * until rows are picked (a click, Ctrl/⌘ or Shift, a band, Space): then it shows on every row.
41
+ * Devices that can't hover always show it.
42
+ */
43
+ export function RowSelect({ label, checked, onCheckedChange, selecting = false }) {
44
+ return (_jsx("div", { "data-slot": "row-select", "data-selecting": selecting || checked || undefined, className: "flex shrink-0 items-center pl-3 sm:hidden sm:data-selecting:flex", children: _jsx(Checkbox, { "aria-label": label, checked: checked, onCheckedChange: (state) => onCheckedChange(state === true) }) }));
45
+ }
46
+ /** A short value at the end of a `RowTarget`, e.g. a phone number. */
47
+ export function RowMeta({ className, ...props }) {
48
+ return (_jsx("span", { "data-slot": "row-meta", className: cn('ml-auto shrink-0 text-muted-foreground text-xs tabular-nums', className), ...props }));
49
+ }
50
+ /** A group of a long list (a letter, a company): its heading sticks while the group scrolls by. */
51
+ export function RowListGroup({ headingId, label, count, children }) {
52
+ return (_jsxs("section", { "data-slot": "row-list-group", "aria-labelledby": headingId, children: [_jsxs("h3", { id: headingId, className: "sticky top-0 z-10 flex items-baseline gap-2 bg-panel/95 py-1.5 font-medium text-muted-foreground text-xs backdrop-blur-sm", children: [_jsx("span", { className: "text-foreground/80", children: label }), count !== undefined && _jsx("span", { className: "tabular-nums", children: count })] }), children] }));
53
+ }
54
+ /**
55
+ * The actions at the end of a row, beside its content (never inside its link or button): they
56
+ * take no room until the row is hovered or focused, or its menu is open (always shown on small
57
+ * screens). Hidden, they stay out of the tab order: focusing the row shows them, next in it.
58
+ */
59
+ export function RowAction({ className, ...props }) {
60
+ return (_jsx("div", { "data-slot": "row-action", className: cn('flex shrink-0 items-center gap-1 pr-2 text-muted-foreground', 'sm:hidden sm:group-focus-within/row:flex sm:group-hover/row:flex sm:group-data-[state=open]/row:flex sm:group-has-data-[state=open]/row:flex', className), ...props }));
61
+ }
62
+ /** A row list while it loads. */
63
+ export function RowListSkeleton({ label, rows = 4, media = 'circle', badges = 0, }) {
64
+ const keys = Array.from({ length: rows }, (_, index) => `row-${index}`);
65
+ const identity = (_jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-3.5", children: [_jsx(Skeleton, { className: cn('size-10 shrink-0', media === 'circle' ? 'rounded-full' : 'rounded-xl') }), _jsxs("div", { className: "flex flex-1 flex-col gap-2", children: [_jsx(Skeleton, { className: "h-3.5 w-2/5" }), _jsx(Skeleton, { className: "h-3 w-3/5" })] })] }));
66
+ return (_jsx(RowList, { role: "status", "aria-label": label, children: keys.map((key) => (_jsx(RowListItem, { "aria-hidden": true, className: "hover:bg-transparent", children: badges > 0 ? (_jsxs(RowColumns, { children: [_jsx(RowCell, { size: "identity", children: identity }), _jsx(RowCell, { className: "flex-row gap-1.5", children: Array.from({ length: badges }, (_, index) => (_jsx(Skeleton, { className: "h-5 w-24 rounded-full" }, `${key}-badge-${index}`))) })] })) : (_jsx("div", { className: "flex-1 px-3 py-2.5", children: identity })) }, key))) }));
67
+ }
@@ -0,0 +1,14 @@
1
+ import type * as React from 'react';
2
+ export interface SettingsSectionProps {
3
+ title: string;
4
+ description?: React.ReactNode;
5
+ /** Colours the title as a destructive zone. */
6
+ tone?: 'default' | 'danger';
7
+ children: React.ReactNode;
8
+ }
9
+ /**
10
+ * A titled group of settings, in one readable column: the title and its description, then the
11
+ * content (its blocks spaced by `md`). Sections follow each other, set apart by whitespace and a
12
+ * hairline, never by a box.
13
+ */
14
+ export declare function SettingsSection({ title, description, tone, children, }: SettingsSectionProps): React.JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from '../lib/cn.js';
3
+ /**
4
+ * A titled group of settings, in one readable column: the title and its description, then the
5
+ * content (its blocks spaced by `md`). Sections follow each other, set apart by whitespace and a
6
+ * hairline, never by a box.
7
+ */
8
+ export function SettingsSection({ title, description, tone = 'default', children, }) {
9
+ const titleId = `settings-${title.toLowerCase().replaceAll(/\W+/g, '-')}`;
10
+ return (_jsxs("section", { "data-slot": "settings-section", "aria-labelledby": titleId, className: "flex max-w-xl flex-col gap-6 border-t py-8 first-of-type:border-t-0 first-of-type:pt-0", children: [_jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("h2", { id: titleId, className: cn('font-semibold text-base tracking-tight', tone === 'danger' && 'text-danger-foreground'), children: title }), description && (_jsx("p", { className: "text-muted-foreground text-sm leading-relaxed", children: description }))] }), _jsx("div", { className: "flex min-w-0 flex-col gap-4", children: children })] }));
11
+ }
@@ -0,0 +1,79 @@
1
+ import type * as React from 'react';
2
+ import { type DropState } from '../components/drag-and-drop.tsx';
3
+ export interface SidebarNavProps extends React.ComponentProps<'nav'> {
4
+ /** Accessible name of the navigation landmark. Defaults to "Main". */
5
+ label?: string;
6
+ }
7
+ /** The app's navigation, placed in `AppFrame`'s `navigation` slot. Holds sections or items. */
8
+ export declare function SidebarNav({ label, className, children, ...props }: SidebarNavProps): React.JSX.Element;
9
+ export interface SidebarNavSectionProps extends Omit<React.ComponentProps<'div'>, 'title'> {
10
+ /** Small uppercase heading above the items. Omit for an unlabelled group. */
11
+ label?: React.ReactNode;
12
+ /** A small control at the end of the heading, e.g. an icon button adding an item. */
13
+ action?: React.ReactNode;
14
+ }
15
+ /** A group of `SidebarNavItem`s, optionally headed by a section label. */
16
+ export declare function SidebarNavSection({ label, action, className, children, ...props }: SidebarNavSectionProps): React.JSX.Element;
17
+ export interface SidebarNavItemProps extends React.ComponentProps<'button'> {
18
+ /** Leading icon (a Phosphor icon): drawn regular, and in its `fill` weight while active. */
19
+ icon?: React.ReactNode;
20
+ /** A different icon while active, when the filled version of `icon` is not the right mark. */
21
+ activeIcon?: React.ReactNode;
22
+ /**
23
+ * The current page: a small primary bar on the left edge, a semibold label, the icon filled,
24
+ * a soft primary tint and `aria-current="page"`.
25
+ */
26
+ active?: boolean;
27
+ /**
28
+ * Trailing content, e.g. a count. It is not part of the item's accessible name: it is read as
29
+ * the item's description ("All contacts", description "2").
30
+ */
31
+ badge?: React.ReactNode;
32
+ /**
33
+ * What the badge means, read instead of it and shown as its tooltip, e.g. "2 contacts".
34
+ * Recommended when the badge is a bare number.
35
+ */
36
+ badgeLabel?: string;
37
+ /**
38
+ * Render the child element (typically the router's `<Link>`) instead of a button. The icon
39
+ * and the badge are added around the child's own content (its label).
40
+ */
41
+ asChild?: boolean;
42
+ /**
43
+ * A small control over the end of the item (e.g. a "More" menu trigger), shown while the item
44
+ * is hovered or focused with the keyboard, or while its menu is open; it takes the badge's place meanwhile.
45
+ * Always shown on devices that can't hover.
46
+ */
47
+ action?: React.ReactNode;
48
+ /**
49
+ * The item is a drop target (`useDropTarget`): outlined while an item it accepts is dragged,
50
+ * tinted while that item is over it. Pass the hook's `ref` as the item's `ref`.
51
+ */
52
+ dropState?: DropState;
53
+ /**
54
+ * Its depth in a tree of items (folders under a place): each level indents it one step.
55
+ * Items of a tree are siblings in the section's list, in the tree's order.
56
+ */
57
+ level?: number;
58
+ /**
59
+ * The item holds other items, shown under it while `expanded`: hovering it swaps its icon for
60
+ * a caret that toggles them (also shown on keyboard focus). Leave it out for a leaf.
61
+ */
62
+ onExpandedChange?: (expanded: boolean) => void;
63
+ expanded?: boolean;
64
+ /** Accessible name of the caret, e.g. "Show the folders of Projects". */
65
+ expandLabel?: string;
66
+ }
67
+ /**
68
+ * One navigation entry. The label is the children (or, with `asChild`, the link's children):
69
+ * `<SidebarNavItem asChild icon={<UsersIcon />} active><Link to="/">Contacts</Link></SidebarNavItem>`.
70
+ */
71
+ export declare function SidebarNavItem({ icon, activeIcon, active, badge, badgeLabel, asChild, action, dropState, level, onExpandedChange, expanded, expandLabel, className, children, ...props }: SidebarNavItemProps): React.JSX.Element;
72
+ export interface SidebarNavNoteProps extends React.ComponentProps<'li'> {
73
+ /** A small icon before the text, e.g. a lock. */
74
+ icon?: React.ReactNode;
75
+ /** Render the child element (a `p`, outside a section) with the note's look. */
76
+ asChild?: boolean;
77
+ }
78
+ /** A quiet line of the sidebar: why a section is empty, or a notice under the navigation. */
79
+ export declare function SidebarNavNote({ icon, asChild, className, children, ...props }: SidebarNavNoteProps): React.JSX.Element;
@@ -0,0 +1,59 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useSharedMessages } from '@ismou-workspace/translations/react';
3
+ import { CaretRightIcon, IconContext } from '@phosphor-icons/react';
4
+ import { Slot as SlotPrimitive } from 'radix-ui';
5
+ import { useId } from 'react';
6
+ import { DROP_TARGET_CLASS_NAME } from '../components/drag-and-drop.js';
7
+ import { SectionLabel } from '../components/section-label.js';
8
+ import { cn } from '../lib/cn.js';
9
+ // Full context values: a provider replaces Phosphor's defaults rather than merging with them.
10
+ const REGULAR_ICONS = {
11
+ color: 'currentColor',
12
+ size: '1em',
13
+ weight: 'regular',
14
+ mirrored: false,
15
+ };
16
+ const FILLED_ICONS = { ...REGULAR_ICONS, weight: 'fill' };
17
+ /** The app's navigation, placed in `AppFrame`'s `navigation` slot. Holds sections or items. */
18
+ export function SidebarNav({ label, className, children, ...props }) {
19
+ const t = useSharedMessages();
20
+ return (_jsx("nav", { "data-slot": "sidebar-nav", "aria-label": label ?? t.ui.sidebarNav.label, className: cn('flex flex-col gap-5', className), ...props, children: children }));
21
+ }
22
+ /** A group of `SidebarNavItem`s, optionally headed by a section label. */
23
+ export function SidebarNavSection({ label, action, className, children, ...props }) {
24
+ return (_jsxs("div", { "data-slot": "sidebar-nav-section", className: cn('flex flex-col gap-1', className), ...props, children: [label && (_jsxs("div", { className: "flex min-h-6 items-center justify-between gap-2 pb-1 pl-2.5", children: [_jsx(SectionLabel, { asChild: true, children: _jsx("span", { children: label }) }), action] })), _jsx("ul", { className: "flex flex-col gap-0.5", children: children })] }));
25
+ }
26
+ /** Indentation of each tree level, on the spacing scale: the icon moves one step per level. */
27
+ const LEVEL_PADDING = ['pl-2.5', 'pl-6.5', 'pl-10.5', 'pl-14.5', 'pl-18.5', 'pl-22.5'];
28
+ /** Where the caret sits on each level: over the icon. */
29
+ const LEVEL_TOGGLE_OFFSET = [
30
+ 'left-2',
31
+ 'left-6',
32
+ 'left-10',
33
+ 'left-14',
34
+ 'left-18',
35
+ 'left-22',
36
+ ];
37
+ /**
38
+ * One navigation entry. The label is the children (or, with `asChild`, the link's children):
39
+ * `<SidebarNavItem asChild icon={<UsersIcon />} active><Link to="/">Contacts</Link></SidebarNavItem>`.
40
+ */
41
+ export function SidebarNavItem({ icon, activeIcon, active = false, badge, badgeLabel, asChild = false, action, dropState, level = 0, onExpandedChange, expanded = false, expandLabel, className, children, ...props }) {
42
+ const Comp = asChild ? SlotPrimitive.Slot : 'button';
43
+ const badgeId = useId();
44
+ const hasBadge = badge != null;
45
+ const depth = Math.min(level, LEVEL_PADDING.length - 1);
46
+ const expandable = onExpandedChange !== undefined;
47
+ return (_jsxs("li", { className: "group/nav-row relative", children: [_jsxs(Comp, { "data-slot": "sidebar-nav-item", "data-active": active || undefined, "data-drop": dropState, "aria-current": active ? 'page' : undefined, "aria-describedby": hasBadge ? badgeId : undefined, ...(asChild ? {} : { type: 'button' }), className: cn('group/nav-item flex h-8 w-full min-w-0 items-center gap-2.5 whitespace-nowrap rounded-md pr-2.5 text-left text-sidebar-foreground text-sm outline-none transition-colors', LEVEL_PADDING[depth], 'hover:bg-muted hover:text-foreground', 'focus-ring', 'data-[active]:bg-primary-soft data-[active]:font-semibold data-[active]:text-foreground data-[active]:hover:bg-primary-soft', DROP_TARGET_CLASS_NAME, "[&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0", className), ...props, children: [active && (_jsx("span", { "aria-hidden": true, className: "absolute top-1/2 -left-3 h-6 w-0.75 -translate-y-1/2 rounded-r-full bg-primary" })), icon && (_jsx("span", { "aria-hidden": true, className: cn('flex text-muted-foreground transition-colors group-hover/nav-item:text-foreground', active && 'text-foreground',
48
+ // The caret takes the icon's place while the row is hovered or focused with the keyboard.
49
+ expandable &&
50
+ 'group-has-focus-visible/nav-row:invisible group-hover/nav-row:invisible [@media(hover:none)]:invisible'), children: _jsx(IconContext.Provider, { value: active ? FILLED_ICONS : REGULAR_ICONS, children: active && activeIcon ? activeIcon : icon }) })), _jsx(SlotPrimitive.Slottable, { children: children }), hasBadge && (_jsx("span", { "aria-hidden": true, title: badgeLabel, className: cn('ml-auto text-muted-foreground text-xs tabular-nums', action &&
51
+ 'group-has-focus-visible/nav-row:invisible group-hover/nav-row:invisible group-has-[[data-state=open]]/nav-row:invisible [@media(hover:none)]:invisible'), children: badge })), hasBadge && (_jsx("span", { id: badgeId, hidden: true, children: badgeLabel ?? badge }))] }), expandable && (_jsx("button", { type: "button", "data-slot": "sidebar-nav-item-toggle", "aria-label": expandLabel, "aria-expanded": expanded, title: expandLabel, onClick: () => onExpandedChange(!expanded), className: cn('absolute top-1.5 flex size-5 items-center justify-center rounded-sm text-muted-foreground outline-none hover:bg-accent hover:text-foreground focus-ring',
52
+ // Shown with the row's hover or keyboard focus, at once: it swaps places with the icon.
53
+ 'opacity-0 group-has-focus-visible/nav-row:opacity-100 group-hover/nav-row:opacity-100 [@media(hover:none)]:opacity-100', LEVEL_TOGGLE_OFFSET[depth]), children: _jsx(CaretRightIcon, { "aria-hidden": true, className: cn('size-3.5 transition-transform', expanded && 'rotate-90') }) })), action && (_jsx("div", { "data-slot": "sidebar-nav-item-action", className: "absolute inset-y-0 right-1 flex items-center opacity-0 has-focus-visible:opacity-100 group-hover/nav-row:opacity-100 has-[[data-state=open]]:opacity-100 [@media(hover:none)]:opacity-100", children: action }))] }));
54
+ }
55
+ /** A quiet line of the sidebar: why a section is empty, or a notice under the navigation. */
56
+ export function SidebarNavNote({ icon, asChild = false, className, children, ...props }) {
57
+ const Comp = asChild ? SlotPrimitive.Slot : 'li';
58
+ return (_jsxs(Comp, { "data-slot": "sidebar-nav-note", className: cn('flex items-center gap-2 px-2.5 py-1 text-muted-foreground text-xs [&_svg]:size-3.5 [&_svg]:shrink-0', className), ...props, children: [icon, _jsx(SlotPrimitive.Slottable, { children: children })] }));
59
+ }
@@ -0,0 +1,19 @@
1
+ import type * as React from 'react';
2
+ export interface SignInLayoutProps {
3
+ /** Large statement on the painted half, e.g. "One password — that's it.". None by default. */
4
+ slogan?: React.ReactNode;
5
+ /** Title above the form, e.g. "Sign in". No subtitle by design. */
6
+ heading?: React.ReactNode;
7
+ /** The form. */
8
+ children: React.ReactNode;
9
+ /** Under the form, e.g. a "No account yet? Register" line. */
10
+ footer?: React.ReactNode;
11
+ /** Spins the mascot, e.g. while the credentials are being checked. */
12
+ thinking?: boolean;
13
+ }
14
+ /**
15
+ * The sign-in screen, split in two: the painted half (the primary under the grain, the white mascot in its
16
+ * top corner, the slogan) and a plain white half with the form centered. On narrow screens the
17
+ * painted half becomes a compact band on top.
18
+ */
19
+ export declare function SignInLayout({ slogan, heading, children, footer, thinking, }: SignInLayoutProps): React.JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { GrainSurface } from '../brand/grain-surface.js';
3
+ import { Mascot } from '../mascot/mascot.js';
4
+ /**
5
+ * The sign-in screen, split in two: the painted half (the primary under the grain, the white mascot in its
6
+ * top corner, the slogan) and a plain white half with the form centered. On narrow screens the
7
+ * painted half becomes a compact band on top.
8
+ */
9
+ export function SignInLayout({ slogan, heading, children, footer, thinking = false, }) {
10
+ return (_jsxs("div", { "data-slot": "sign-in-layout", className: "grid min-h-svh grid-rows-[auto_1fr] bg-card lg:grid-cols-[minmax(0,1.05fr)_minmax(0,1fr)] lg:grid-rows-1", children: [_jsxs(GrainSurface, { className: "flex min-h-44 flex-col justify-between gap-8 p-6 sm:p-8 lg:min-h-svh lg:p-12", children: [_jsx(Mascot, { size: 56, color: "white", eyeColor: "var(--primary-deep)", thinking: thinking }), slogan && (_jsx("p", { className: "max-w-[13ch] text-balance font-semibold text-[2rem] leading-[1.02] tracking-[-0.035em] sm:text-[2.5rem] lg:text-[3.5rem] xl:text-[4rem]", children: slogan }))] }), _jsx("main", { className: "flex items-center justify-center px-6 py-12 sm:px-10", children: _jsxs("div", { className: "flex w-full max-w-sm flex-col gap-8", children: [heading && _jsx("h1", { className: "font-semibold text-2xl tracking-tight", children: heading }), children, footer && _jsx("div", { className: "text-muted-foreground text-sm", children: footer })] }) })] }));
11
+ }
@@ -0,0 +1,27 @@
1
+ import * as React from 'react';
2
+ import { type RowListItemProps, type RowListProps } from './row-list.tsx';
3
+ export interface SortableRowListProps extends Omit<RowListProps, 'children'> {
4
+ /** The ids of the rows, in their order. */
5
+ ids: string[];
6
+ /** Names of the rows by id: what the handles say and what screen readers hear. */
7
+ labels: Record<string, string>;
8
+ /** The new order, once a row is dropped elsewhere (or moved with the keyboard). */
9
+ onReorder: (ids: string[]) => void;
10
+ /** Rows stay put, e.g. while the list is filtered or for who may not reorder it. */
11
+ disabled?: boolean;
12
+ children: React.ReactNode;
13
+ }
14
+ /**
15
+ * A `RowList` whose rows (`SortableRowListItem`) are put in order by their handle: dragged with
16
+ * the pointer, or picked up with Space or Enter and moved with the arrow keys.
17
+ */
18
+ export declare function SortableRowList({ ids, labels, onReorder, disabled, children, ...props }: SortableRowListProps): React.JSX.Element;
19
+ export interface SortableRowListItemProps extends RowListItemProps {
20
+ /** One of the list's `ids`. */
21
+ id: string;
22
+ }
23
+ /**
24
+ * A row of a `SortableRowList`: its handle comes first, the row's content after it. It keeps the
25
+ * `ref` it is given (an `EntityMenu` around it passes its trigger's) alongside dnd-kit's own.
26
+ */
27
+ export declare function SortableRowListItem({ id, ref, className, style, children, ...props }: SortableRowListItemProps): React.JSX.Element;