@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 { ArrowUpRightIcon } from '@phosphor-icons/react';
3
+ import { Slot as SlotPrimitive } from 'radix-ui';
4
+ import { cn } from '../lib/cn.js';
5
+ /** A link inside text or a row: plain at rest, underlined on hover. */
6
+ export function TextLink({ asChild = false, external = false, className, children, ...props }) {
7
+ const Comp = asChild ? SlotPrimitive.Slot : 'a';
8
+ return (_jsxs(Comp, { "data-slot": "text-link", className: cn('group/text-link inline-flex min-w-0 items-center gap-1 rounded-sm font-medium text-foreground underline-offset-4 outline-none hover:underline focus-ring', className), ...(external ? { target: '_blank', rel: 'noopener noreferrer' } : {}), ...props, children: [_jsx(SlotPrimitive.Slottable, { children: children }), external && (_jsx(ArrowUpRightIcon, { "aria-hidden": true, className: "size-3.5 shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover/text-link:opacity-100" }))] }));
9
+ }
@@ -0,0 +1,13 @@
1
+ import type * as React from 'react';
2
+ export interface TextProps extends React.ComponentProps<'p'> {
3
+ /** Secondary: a description, an address, a calm status. */
4
+ muted?: boolean;
5
+ /** A heading inside a section, in the body size. */
6
+ strong?: boolean;
7
+ /** A Phosphor icon before the text, e.g. a calm all-clear. */
8
+ icon?: React.ReactNode;
9
+ /** Render the child element (an `h4`, a `span`…) with the text's look. */
10
+ asChild?: boolean;
11
+ }
12
+ /** A paragraph of the interface, in the body size. Smaller, quieter lines are `Caption`s. */
13
+ export declare function Text({ muted, strong, icon, asChild, className, children, ...props }: TextProps): React.JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Slot as SlotPrimitive } from 'radix-ui';
3
+ import { cn } from '../lib/cn.js';
4
+ /** A paragraph of the interface, in the body size. Smaller, quieter lines are `Caption`s. */
5
+ export function Text({ muted = false, strong = false, icon, asChild = false, className, children, ...props }) {
6
+ const Comp = asChild ? SlotPrimitive.Slot : 'p';
7
+ return (_jsxs(Comp, { "data-slot": "text", className: cn('text-sm leading-relaxed', muted && 'text-muted-foreground', strong && 'font-medium', icon && 'flex items-center gap-2.5 [&_svg]:size-4 [&_svg]:shrink-0', className), ...props, children: [icon, _jsx(SlotPrimitive.Slottable, { children: children })] }));
8
+ }
@@ -0,0 +1,8 @@
1
+ import { toast } from 'sonner';
2
+ /**
3
+ * Shows a short-lived message: `toast('Saved')`, `toast.success(…)`, `toast.error(…)`, with an
4
+ * optional `action: { label: 'Undo', onClick }`. `AppFrame` mounts the `Toaster` that renders it.
5
+ */
6
+ export { toast };
7
+ /** Where toasts appear: one per app, already mounted by `AppFrame`. */
8
+ export declare function Toaster(): import("react").JSX.Element;
@@ -0,0 +1,27 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { CheckCircleIcon, InfoIcon, WarningCircleIcon } from '@phosphor-icons/react';
3
+ import { Toaster as SonnerToaster, toast } from 'sonner';
4
+ /**
5
+ * Shows a short-lived message: `toast('Saved')`, `toast.success(…)`, `toast.error(…)`, with an
6
+ * optional `action: { label: 'Undo', onClick }`. `AppFrame` mounts the `Toaster` that renders it.
7
+ */
8
+ export { toast };
9
+ /** Where toasts appear: one per app, already mounted by `AppFrame`. */
10
+ export function Toaster() {
11
+ return (_jsx(SonnerToaster, { position: "bottom-center", gap: 8, icons: {
12
+ success: _jsx(CheckCircleIcon, { weight: "fill", className: "size-4 text-success" }),
13
+ error: _jsx(WarningCircleIcon, { weight: "fill", className: "size-4 text-danger" }),
14
+ info: _jsx(InfoIcon, { weight: "fill", className: "size-4 text-muted-foreground" }),
15
+ }, toastOptions: {
16
+ unstyled: true,
17
+ classNames: {
18
+ toast: 'flex w-full items-center gap-2.5 rounded-xl border bg-popover py-2.5 pr-2.5 pl-3.5 text-popover-foreground text-sm shadow-md sm:w-(--width)',
19
+ title: 'min-w-0 font-medium',
20
+ description: 'text-muted-foreground text-xs',
21
+ icon: 'flex shrink-0 items-center',
22
+ content: 'flex min-w-0 flex-1 flex-col gap-0.5',
23
+ actionButton: 'ml-auto inline-flex h-7 shrink-0 items-center rounded-md px-2.5 font-medium text-primary text-sm transition-colors hover:bg-accent',
24
+ cancelButton: 'inline-flex h-7 shrink-0 items-center rounded-md px-2.5 text-muted-foreground text-sm transition-colors hover:bg-accent',
25
+ },
26
+ } }));
27
+ }
@@ -0,0 +1,37 @@
1
+ import type * as React from 'react';
2
+ import { Button } from './button.tsx';
3
+ export interface ViewerDialogProps {
4
+ open: boolean;
5
+ onOpenChange: (open: boolean) => void;
6
+ /** What is shown, e.g. the file's name. */
7
+ title: React.ReactNode;
8
+ /** A short line beside the title, e.g. its size and type. */
9
+ description?: React.ReactNode;
10
+ /** Buttons at the right of the bar, before Close (download, share...). */
11
+ actions?: React.ReactNode;
12
+ /** The previous item of the list, when there is one: a side arrow, and ←. */
13
+ onPrevious?: () => void;
14
+ /** The next item of the list, when there is one: a side arrow, and →. */
15
+ onNext?: () => void;
16
+ /** The thing itself: a `ViewerImage`, a `ViewerVideo`, or an `EmptyState`. */
17
+ children: React.ReactNode;
18
+ }
19
+ /**
20
+ * Shows one thing (a picture, a video) over the whole page, on a tinted, blurred backdrop: its
21
+ * name and actions in a bar on top, arrows to its neighbours in the list. Escape or a click
22
+ * beside the thing closes it.
23
+ */
24
+ export declare function ViewerDialog({ open, onOpenChange, title, description, actions, onPrevious, onNext, children, }: ViewerDialogProps): React.JSX.Element;
25
+ export interface ViewerActionProps extends React.ComponentProps<typeof Button> {
26
+ /** Its accessible name and tooltip, e.g. "Download". */
27
+ label: string;
28
+ }
29
+ /** An icon button of the viewer's bar, light on its dark backdrop. */
30
+ export declare function ViewerAction({ label, className, ...props }: ViewerActionProps): React.JSX.Element;
31
+ /** A picture in the viewer: as large as fits, never enlarged beyond its own size. */
32
+ export declare function ViewerImage({ className, alt, ...props }: React.ComponentProps<'img'>): React.JSX.Element;
33
+ /**
34
+ * A video in the viewer, played by the browser with its own controls: as large as fits, never
35
+ * enlarged beyond its own size.
36
+ */
37
+ export declare function ViewerVideo({ className, ...props }: React.ComponentProps<'video'>): React.JSX.Element;
@@ -0,0 +1,53 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useSharedMessages } from '@ismou-workspace/translations/react';
3
+ import { CaretLeftIcon, CaretRightIcon, XIcon } from '@phosphor-icons/react';
4
+ import { Dialog as DialogPrimitive } from 'radix-ui';
5
+ import { cn } from '../lib/cn.js';
6
+ import { Button } from './button.js';
7
+ /** Light controls on the tinted backdrop of the viewer. */
8
+ const VIEWER_BUTTON_CLASS_NAME = 'text-background/80 hover:bg-background/10 hover:text-background focus-visible:ring-background/40';
9
+ /**
10
+ * Shows one thing (a picture, a video) over the whole page, on a tinted, blurred backdrop: its
11
+ * name and actions in a bar on top, arrows to its neighbours in the list. Escape or a click
12
+ * beside the thing closes it.
13
+ */
14
+ export function ViewerDialog({ open, onOpenChange, title, description, actions, onPrevious, onNext, children, }) {
15
+ const t = useSharedMessages();
16
+ function handleKeyDown(event) {
17
+ // A video playing has the arrows to itself: they seek.
18
+ if (event.target instanceof HTMLMediaElement)
19
+ return;
20
+ if (event.key === 'ArrowLeft' && onPrevious) {
21
+ event.preventDefault();
22
+ onPrevious();
23
+ }
24
+ else if (event.key === 'ArrowRight' && onNext) {
25
+ event.preventDefault();
26
+ onNext();
27
+ }
28
+ }
29
+ // The content covers the page (Radix keeps it taking the pointer, over the backdrop): a click
30
+ // on its empty parts (the bar around the title and buttons included), beside the thing shown
31
+ // and the controls, is a click on the backdrop.
32
+ function handleClick(event) {
33
+ if (event.target instanceof HTMLElement && event.target.dataset.viewerBlank !== undefined) {
34
+ onOpenChange(false);
35
+ }
36
+ }
37
+ return (_jsx(DialogPrimitive.Root, { open: open, onOpenChange: onOpenChange, children: _jsxs(DialogPrimitive.Portal, { children: [_jsx(DialogPrimitive.Overlay, { "data-slot": "viewer-backdrop", className: "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-foreground/60 backdrop-blur-xl data-[state=closed]:animate-out data-[state=open]:animate-in" }), _jsxs(DialogPrimitive.Content, { "data-slot": "viewer-dialog", "data-viewer-blank": true, onKeyDown: handleKeyDown, onClick: handleClick, className: "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 flex flex-col text-background outline-none duration-200 data-[state=closed]:animate-out data-[state=open]:animate-in", children: [_jsxs("div", { "data-viewer-blank": true, className: "flex h-14 shrink-0 items-center gap-3 px-4", children: [_jsxs("div", { "data-viewer-blank": true, className: "flex min-w-0 flex-1 flex-col", children: [_jsx(DialogPrimitive.Title, { className: "w-fit max-w-full truncate font-medium text-sm", children: title }), description ? (_jsx(DialogPrimitive.Description, { className: "w-fit max-w-full truncate text-background/60 text-xs", children: description })) : (_jsx(DialogPrimitive.Description, { className: "sr-only", children: t.ui.viewer.preview }))] }), _jsxs("div", { "data-viewer-blank": true, className: "flex items-center gap-1", children: [actions, _jsx(DialogPrimitive.Close, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "icon-sm", "aria-label": t.common.close, title: t.common.close, className: VIEWER_BUTTON_CLASS_NAME, children: _jsx(XIcon, {}) }) })] })] }), _jsxs("div", { "data-viewer-blank": true, className: "relative flex min-h-0 flex-1 items-center justify-center px-4 pb-4 sm:px-16", children: [children, onPrevious && (_jsx(Button, { variant: "ghost", size: "icon", "aria-label": t.common.previous, title: t.common.previous, onClick: onPrevious, className: cn('absolute top-1/2 left-3 -translate-y-1/2', VIEWER_BUTTON_CLASS_NAME), children: _jsx(CaretLeftIcon, {}) })), onNext && (_jsx(Button, { variant: "ghost", size: "icon", "aria-label": t.common.next, title: t.common.next, onClick: onNext, className: cn('absolute top-1/2 right-3 -translate-y-1/2', VIEWER_BUTTON_CLASS_NAME), children: _jsx(CaretRightIcon, {}) }))] })] })] }) }));
38
+ }
39
+ /** An icon button of the viewer's bar, light on its dark backdrop. */
40
+ export function ViewerAction({ label, className, ...props }) {
41
+ return (_jsx(Button, { variant: "ghost", size: "icon-sm", "aria-label": label, title: label, className: cn(VIEWER_BUTTON_CLASS_NAME, className), ...props }));
42
+ }
43
+ /** A picture in the viewer: as large as fits, never enlarged beyond its own size. */
44
+ export function ViewerImage({ className, alt, ...props }) {
45
+ return (_jsx("img", { "data-slot": "viewer-image", alt: alt, draggable: false, className: cn('max-h-full max-w-full rounded-md object-contain shadow-2xl', className), ...props }));
46
+ }
47
+ /**
48
+ * A video in the viewer, played by the browser with its own controls: as large as fits, never
49
+ * enlarged beyond its own size.
50
+ */
51
+ export function ViewerVideo({ className, ...props }) {
52
+ return (_jsx("video", { "data-slot": "viewer-video", controls: true, autoPlay: true, className: cn('max-h-full max-w-full rounded-md bg-foreground shadow-2xl', className), ...props }));
53
+ }
@@ -0,0 +1,87 @@
1
+ export { APP_BRANDS, type AppBrand, type AppBrandDefinition, appFaviconSvg, appGlyphSvg, type GlyphAppBrand, type GlyphBrandDefinition, type LogoAppBrand, type LogoBrandDefinition, PALETTE_TEXTURE_HEX, type PaletteColor, } from './brand/app-brands.ts';
2
+ export { AccountAppIcon, AdminAppIcon, AppIcon, type AppIconProps, type AppIconSize, appIconVariants, type BrandAppIconProps, CalendarAppIcon, ContactsAppIcon, CoreAppIcon, DriveAppIcon, GoogleAppIcon, } from './brand/app-icon.tsx';
3
+ export { AppLogo, type AppLogoProps } from './brand/app-logo.tsx';
4
+ export { GrainSurface, type GrainSurfaceProps } from './brand/grain-surface.tsx';
5
+ export { AccountMenu, type AccountMenuProps } from './components/account-menu.tsx';
6
+ export { Alert, AlertDescription, type AlertProps, AlertTitle, alertVariants, } from './components/alert.tsx';
7
+ export { AppSwitcher, type AppSwitcherEntry, type AppSwitcherProps, } from './components/app-switcher.tsx';
8
+ export { type AreaSelectionOptions, SELECTABLE_ATTRIBUTE, useAreaSelection, } from './components/area-selection.ts';
9
+ export { Avatar, AvatarFallback } from './components/avatar.tsx';
10
+ export { type AvatarChoice, AvatarPickerDialog, type AvatarPickerDialogProps, EditableAvatar, type EditableAvatarProps, } from './components/avatar-picker-dialog.tsx';
11
+ export { Badge, type BadgeProps, badgeVariants } from './components/badge.tsx';
12
+ export { BadgeList, type BadgeListProps } from './components/badge-list.tsx';
13
+ export { BreadcrumbItem, type BreadcrumbItemProps, Breadcrumbs, type BreadcrumbsProps, } from './components/breadcrumbs.tsx';
14
+ export { Button, type ButtonProps, buttonVariants } from './components/button.tsx';
15
+ export { Caption } from './components/caption.tsx';
16
+ export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, } from './components/card.tsx';
17
+ export { Checkbox } from './components/checkbox.tsx';
18
+ export { CheckboxField, type CheckboxFieldProps } from './components/checkbox-field.tsx';
19
+ export { Code, CodeBlock, type CodeProps, CopyableCodeBlock, type CopyableCodeBlockProps, } from './components/code.tsx';
20
+ export { ColorDot, type ColorDotProps, PALETTE_COLORS } from './components/color-dot.tsx';
21
+ export { CornerMark, type CornerMarkProps } from './components/corner-mark.tsx';
22
+ export { DateRangeField, type DateRangeFieldProps } from './components/date-range-field.tsx';
23
+ export { DescriptionItem, type DescriptionItemProps, DescriptionList, } from './components/description-list.tsx';
24
+ export { Dialog, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, } from './components/dialog.tsx';
25
+ export { DROP_TARGET_CLASS_NAME, DragDropProvider, type DragItem, type DragSourceOptions, type DropState, type DropTargetOptions, useDragSource, useDropTarget, } from './components/drag-and-drop.tsx';
26
+ export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger, } from './components/dropdown-menu.tsx';
27
+ export { AVATAR_PALETTE, EntityAvatar, type EntityAvatarProps, type EntityAvatarVariant, } from './components/entity-avatar.tsx';
28
+ export { EntityMenu, type EntityMenuAction, EntityMenuButton, type EntityMenuButtonProps, type EntityMenuChoice, type EntityMenuProps, } from './components/entity-menu.tsx';
29
+ export { ErrorAlert, type ErrorAlertProps } from './components/error-alert.tsx';
30
+ export { EventChip, type EventChipProps } from './components/event-chip.tsx';
31
+ export { Fab, type FabProps } from './components/fab.tsx';
32
+ export { FileDropZone, type FileDropZoneProps, type FilePickerOptions, type PickedFile, useFilePicker, } from './components/file-drop-zone.tsx';
33
+ export { type FileCategory, FileTypeIcon, type FileTypeIconProps, fileCategoryOf, } from './components/file-type-icon.tsx';
34
+ export { IconImage, type IconImageProps } from './components/icon-image.tsx';
35
+ export { Identity, type IdentityProps, InlineIdentity, type InlineIdentityProps, } from './components/identity.tsx';
36
+ export { InlineField, type InlineFieldProps } from './components/inline-field.tsx';
37
+ export { Input, type InputProps, Textarea, type TextareaProps } from './components/input.tsx';
38
+ export { BulletList, Checklist, ChecklistItem, type ChecklistItemProps, } from './components/item-list.tsx';
39
+ export { Label } from './components/label.tsx';
40
+ export { MiniMonth, type MiniMonthProps } from './components/mini-month.tsx';
41
+ export { PlaceholderAvatar, type PlaceholderAvatarProps, } from './components/placeholder-avatar.tsx';
42
+ export { Popover, PopoverAnchor, PopoverContent, PopoverTrigger } from './components/popover.tsx';
43
+ export { Progress, type ProgressProps } from './components/progress.tsx';
44
+ export { ProgressList, ProgressListItem, type ProgressListItemProps, type ProgressListProps, } from './components/progress-list.tsx';
45
+ export { ProgressRing, type ProgressRingProps } from './components/progress-ring.tsx';
46
+ export { SearchBox, type SearchBoxProps } from './components/search-box.tsx';
47
+ export { type SearchableOption, SearchableOptions, type SearchableOptionsProps, } from './components/searchable-options.tsx';
48
+ export { SectionLabel, type SectionLabelProps } from './components/section-label.tsx';
49
+ export { SegmentedControl, type SegmentedControlProps, type SegmentedOption, } from './components/segmented-control.tsx';
50
+ export { SelectButton, type SelectButtonProps, type SelectOption, SelectOptions, type SelectOptionsProps, SelectValue, } from './components/select-menu.tsx';
51
+ export { SelectionBar, type SelectionBarProps } from './components/selection-bar.tsx';
52
+ export { Separator } from './components/separator.tsx';
53
+ export { ShareDialog, type ShareDialogProps, type ShareLevelOption, type ShareMember, type SharePerson, } from './components/share-dialog.tsx';
54
+ export { Sheet, SheetBody, SheetContent, type SheetContentProps, SheetFooter, SheetHeader, type SheetHeaderProps, } from './components/sheet.tsx';
55
+ export { Skeleton } from './components/skeleton.tsx';
56
+ export { Spinner } from './components/spinner.tsx';
57
+ export { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from './components/table.tsx';
58
+ export { Text, type TextProps } from './components/text.tsx';
59
+ export { TextLink, type TextLinkProps } from './components/text-link.tsx';
60
+ export { Toaster, toast } from './components/toaster.tsx';
61
+ export { ViewerAction, type ViewerActionProps, ViewerDialog, type ViewerDialogProps, ViewerImage, ViewerVideo, } from './components/viewer-dialog.tsx';
62
+ export { AppFrame, type AppFrameProps } from './layout/app-frame.tsx';
63
+ export { AppShell, type AppShellProps } from './layout/app-shell.tsx';
64
+ export { DocumentTitle, documentTitle, usePageTitle } from './layout/document-title.tsx';
65
+ export { EmptyState, type EmptyStateProps, emptyStateVariants } from './layout/empty-state.tsx';
66
+ export { EntityHeader, type EntityHeaderProps } from './layout/entity-header.tsx';
67
+ export { FormField, type FormFieldProps } from './layout/form-field.tsx';
68
+ export { FormGrid } from './layout/form-grid.tsx';
69
+ export { FullPageMessage, type FullPageMessageProps } from './layout/full-page-message.tsx';
70
+ export { FullPageSurface, type FullPageSurfaceProps } from './layout/full-page-surface.tsx';
71
+ export { MonthGrid, type MonthGridDay, type MonthGridProps } from './layout/month-grid.tsx';
72
+ export { PageHeader, type PageHeaderProps } from './layout/page-header.tsx';
73
+ export { Panel, type PanelProps } from './layout/panel.tsx';
74
+ export { RetryMessage, type RetryMessageProps } from './layout/retry-message.tsx';
75
+ export { RouteErrorMessage, type RouteErrorMessageProps } from './layout/route-error-message.tsx';
76
+ export { RowAction, RowCell, type RowCellProps, RowColumns, RowList, RowListGroup, type RowListGroupProps, RowListItem, type RowListItemProps, type RowListProps, RowListSkeleton, type RowListSkeletonProps, RowMeta, RowSelect, type RowSelectProps, RowTarget, type RowTargetProps, } from './layout/row-list.tsx';
77
+ export { SettingsSection, type SettingsSectionProps } from './layout/settings-section.tsx';
78
+ export { SidebarNav, SidebarNavItem, type SidebarNavItemProps, SidebarNavNote, type SidebarNavNoteProps, type SidebarNavProps, SidebarNavSection, type SidebarNavSectionProps, } from './layout/sidebar-nav.tsx';
79
+ export { SignInLayout, type SignInLayoutProps } from './layout/sign-in-layout.tsx';
80
+ export { SortableRowList, SortableRowListItem, type SortableRowListItemProps, type SortableRowListProps, } from './layout/sortable-row-list.tsx';
81
+ export { Inline, type InlineProps, type LayoutGap, Stack, type StackProps, } from './layout/stack.tsx';
82
+ export { Tile, TileAction, TileGrid, TileGridSkeleton, type TileGridSkeletonProps, TileMedia, type TileMediaProps, type TileProps, TileTarget, type TileTargetProps, } from './layout/tile-grid.tsx';
83
+ export { placeEvents, TimeGrid, type TimeGridColumn, type TimeGridEvent, type TimeGridProps, } from './layout/time-grid.tsx';
84
+ export { useFavicon } from './layout/use-favicon.ts';
85
+ export { cn } from './lib/cn.ts';
86
+ export { initialsOf } from './lib/initials.ts';
87
+ export { Mascot, type MascotProps } from './mascot/mascot.tsx';
package/dist/index.js ADDED
@@ -0,0 +1,87 @@
1
+ export { APP_BRANDS, appFaviconSvg, appGlyphSvg, PALETTE_TEXTURE_HEX, } from './brand/app-brands.js';
2
+ export { AccountAppIcon, AdminAppIcon, AppIcon, appIconVariants, CalendarAppIcon, ContactsAppIcon, CoreAppIcon, DriveAppIcon, GoogleAppIcon, } from './brand/app-icon.js';
3
+ export { AppLogo } from './brand/app-logo.js';
4
+ export { GrainSurface } from './brand/grain-surface.js';
5
+ export { AccountMenu } from './components/account-menu.js';
6
+ export { Alert, AlertDescription, AlertTitle, alertVariants, } from './components/alert.js';
7
+ export { AppSwitcher, } from './components/app-switcher.js';
8
+ export { SELECTABLE_ATTRIBUTE, useAreaSelection, } from './components/area-selection.js';
9
+ export { Avatar, AvatarFallback } from './components/avatar.js';
10
+ export { AvatarPickerDialog, EditableAvatar, } from './components/avatar-picker-dialog.js';
11
+ export { Badge, badgeVariants } from './components/badge.js';
12
+ export { BadgeList } from './components/badge-list.js';
13
+ export { BreadcrumbItem, Breadcrumbs, } from './components/breadcrumbs.js';
14
+ export { Button, buttonVariants } from './components/button.js';
15
+ export { Caption } from './components/caption.js';
16
+ export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, } from './components/card.js';
17
+ export { Checkbox } from './components/checkbox.js';
18
+ export { CheckboxField } from './components/checkbox-field.js';
19
+ export { Code, CodeBlock, CopyableCodeBlock, } from './components/code.js';
20
+ export { ColorDot, PALETTE_COLORS } from './components/color-dot.js';
21
+ export { CornerMark } from './components/corner-mark.js';
22
+ export { DateRangeField } from './components/date-range-field.js';
23
+ export { DescriptionItem, DescriptionList, } from './components/description-list.js';
24
+ export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, } from './components/dialog.js';
25
+ export { DROP_TARGET_CLASS_NAME, DragDropProvider, useDragSource, useDropTarget, } from './components/drag-and-drop.js';
26
+ export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger, } from './components/dropdown-menu.js';
27
+ export { AVATAR_PALETTE, EntityAvatar, } from './components/entity-avatar.js';
28
+ export { EntityMenu, EntityMenuButton, } from './components/entity-menu.js';
29
+ export { ErrorAlert } from './components/error-alert.js';
30
+ export { EventChip } from './components/event-chip.js';
31
+ export { Fab } from './components/fab.js';
32
+ export { FileDropZone, useFilePicker, } from './components/file-drop-zone.js';
33
+ export { FileTypeIcon, fileCategoryOf, } from './components/file-type-icon.js';
34
+ export { IconImage } from './components/icon-image.js';
35
+ export { Identity, InlineIdentity, } from './components/identity.js';
36
+ export { InlineField } from './components/inline-field.js';
37
+ export { Input, Textarea } from './components/input.js';
38
+ export { BulletList, Checklist, ChecklistItem, } from './components/item-list.js';
39
+ export { Label } from './components/label.js';
40
+ export { MiniMonth } from './components/mini-month.js';
41
+ export { PlaceholderAvatar, } from './components/placeholder-avatar.js';
42
+ export { Popover, PopoverAnchor, PopoverContent, PopoverTrigger } from './components/popover.js';
43
+ export { Progress } from './components/progress.js';
44
+ export { ProgressList, ProgressListItem, } from './components/progress-list.js';
45
+ export { ProgressRing } from './components/progress-ring.js';
46
+ export { SearchBox } from './components/search-box.js';
47
+ export { SearchableOptions, } from './components/searchable-options.js';
48
+ export { SectionLabel } from './components/section-label.js';
49
+ export { SegmentedControl, } from './components/segmented-control.js';
50
+ export { SelectButton, SelectOptions, SelectValue, } from './components/select-menu.js';
51
+ export { SelectionBar } from './components/selection-bar.js';
52
+ export { Separator } from './components/separator.js';
53
+ export { ShareDialog, } from './components/share-dialog.js';
54
+ export { Sheet, SheetBody, SheetContent, SheetFooter, SheetHeader, } from './components/sheet.js';
55
+ export { Skeleton } from './components/skeleton.js';
56
+ export { Spinner } from './components/spinner.js';
57
+ export { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from './components/table.js';
58
+ export { Text } from './components/text.js';
59
+ export { TextLink } from './components/text-link.js';
60
+ export { Toaster, toast } from './components/toaster.js';
61
+ export { ViewerAction, ViewerDialog, ViewerImage, ViewerVideo, } from './components/viewer-dialog.js';
62
+ export { AppFrame } from './layout/app-frame.js';
63
+ export { AppShell } from './layout/app-shell.js';
64
+ export { DocumentTitle, documentTitle, usePageTitle } from './layout/document-title.js';
65
+ export { EmptyState, emptyStateVariants } from './layout/empty-state.js';
66
+ export { EntityHeader } from './layout/entity-header.js';
67
+ export { FormField } from './layout/form-field.js';
68
+ export { FormGrid } from './layout/form-grid.js';
69
+ export { FullPageMessage } from './layout/full-page-message.js';
70
+ export { FullPageSurface } from './layout/full-page-surface.js';
71
+ export { MonthGrid } from './layout/month-grid.js';
72
+ export { PageHeader } from './layout/page-header.js';
73
+ export { Panel } from './layout/panel.js';
74
+ export { RetryMessage } from './layout/retry-message.js';
75
+ export { RouteErrorMessage } from './layout/route-error-message.js';
76
+ export { RowAction, RowCell, RowColumns, RowList, RowListGroup, RowListItem, RowListSkeleton, RowMeta, RowSelect, RowTarget, } from './layout/row-list.js';
77
+ export { SettingsSection } from './layout/settings-section.js';
78
+ export { SidebarNav, SidebarNavItem, SidebarNavNote, SidebarNavSection, } from './layout/sidebar-nav.js';
79
+ export { SignInLayout } from './layout/sign-in-layout.js';
80
+ export { SortableRowList, SortableRowListItem, } from './layout/sortable-row-list.js';
81
+ export { Inline, Stack, } from './layout/stack.js';
82
+ export { Tile, TileAction, TileGrid, TileGridSkeleton, TileMedia, TileTarget, } from './layout/tile-grid.js';
83
+ export { placeEvents, TimeGrid, } from './layout/time-grid.js';
84
+ export { useFavicon } from './layout/use-favicon.js';
85
+ export { cn } from './lib/cn.js';
86
+ export { initialsOf } from './lib/initials.js';
87
+ export { Mascot } from './mascot/mascot.js';
@@ -0,0 +1,42 @@
1
+ import * as React from 'react';
2
+ export interface AppFrameProps {
3
+ /** The app's logo, e.g. `<CoreAppIcon />`: drawn at `size-9`, balanced with the `text-2xl` name. */
4
+ appIcon: React.ReactNode;
5
+ /** The app's name, printed next to its icon in the top-left brand cell. */
6
+ appName: string;
7
+ /**
8
+ * Makes the brand a link home: pass an empty link element (the router's `<Link to="/" />`);
9
+ * it receives the icon and the name as children.
10
+ */
11
+ brandLink?: React.ReactElement<{
12
+ className?: string;
13
+ children?: React.ReactNode;
14
+ }>;
15
+ /** The sidebar's content, typically a `SidebarNav`. */
16
+ navigation: React.ReactNode;
17
+ /** Pinned at the bottom of the sidebar (secondary links, version...). */
18
+ sidebarFooter?: React.ReactNode;
19
+ /** Centered in the topbar, typically a `SearchBox`. */
20
+ search?: React.ReactNode;
21
+ /** Right of the topbar, before the account (icon buttons...). */
22
+ actions?: React.ReactNode;
23
+ /** Far right of the topbar, typically an `AccountMenu`. */
24
+ account?: React.ReactNode;
25
+ /**
26
+ * - `panel` (default): the page sits in one full-width `Panel`, padded by the frame gutter,
27
+ * and scrolls inside it.
28
+ * - `panels`: the page lays out its own `Panel`s side by side (a list, then a detail), each
29
+ * owning its scrolling and its padding (start text at `px-(--frame-gutter)`).
30
+ */
31
+ layout?: 'panel' | 'panels';
32
+ children: React.ReactNode;
33
+ }
34
+ /**
35
+ * The application shell, on the page canvas: the app's brand top-left with the sidebar below
36
+ * it, the topbar (search, then the actions and the account) beside it, and the content in
37
+ * rounded panels. The sidebar and the topbar have no surface of their own: only the panels do.
38
+ * Under the `md` breakpoint the sidebar collapses into a sheet opened from the topbar.
39
+ * The search lines up with the first panel, and looks like one (same surface, same radius);
40
+ * inside the panels, content starts at one horizontal gutter (`--frame-gutter`).
41
+ */
42
+ export declare function AppFrame({ appIcon, appName, brandLink, navigation, sidebarFooter, search, actions, account, layout, children, }: AppFrameProps): React.JSX.Element;
@@ -0,0 +1,62 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useSharedMessages } from '@ismou-workspace/translations/react';
3
+ import { ListIcon, XIcon } from '@phosphor-icons/react';
4
+ import { Dialog as DialogPrimitive } from 'radix-ui';
5
+ import * as React from 'react';
6
+ import { Button } from '../components/button.js';
7
+ import { DragDropProvider } from '../components/drag-and-drop.js';
8
+ import { Toaster } from '../components/toaster.js';
9
+ import { cn } from '../lib/cn.js';
10
+ import { DocumentTitle } from './document-title.js';
11
+ import { Panel } from './panel.js';
12
+ /** Matches Tailwind's `md` breakpoint, where the sidebar is docked. */
13
+ const DOCKED_QUERY = '(min-width: 48rem)';
14
+ function subscribeDocked(onChange) {
15
+ if (typeof window.matchMedia !== 'function')
16
+ return () => { };
17
+ const query = window.matchMedia(DOCKED_QUERY);
18
+ query.addEventListener('change', onChange);
19
+ return () => query.removeEventListener('change', onChange);
20
+ }
21
+ function isDocked() {
22
+ return typeof window.matchMedia !== 'function' || window.matchMedia(DOCKED_QUERY).matches;
23
+ }
24
+ /**
25
+ * Whether the sidebar is docked. The layout itself is pure CSS; this only avoids mounting the
26
+ * brand twice (an icon passed in may be live, e.g. animated, and would run while hidden).
27
+ */
28
+ function useDocked() {
29
+ return React.useSyncExternalStore(subscribeDocked, isDocked, () => true);
30
+ }
31
+ function Brand({ appIcon, appName, brandLink, }) {
32
+ const className = 'flex min-w-0 items-center gap-2.5 rounded-md font-semibold text-2xl text-foreground leading-none tracking-tight outline-none focus-ring *:data-[slot=app-icon]:size-9';
33
+ const content = (_jsxs(_Fragment, { children: [appIcon, _jsx("span", { className: "-mb-px truncate", children: appName })] }));
34
+ if (brandLink) {
35
+ return React.cloneElement(brandLink, {
36
+ className: cn(className, brandLink.props.className),
37
+ children: content,
38
+ });
39
+ }
40
+ return _jsx("span", { className: className, children: content });
41
+ }
42
+ /**
43
+ * The application shell, on the page canvas: the app's brand top-left with the sidebar below
44
+ * it, the topbar (search, then the actions and the account) beside it, and the content in
45
+ * rounded panels. The sidebar and the topbar have no surface of their own: only the panels do.
46
+ * Under the `md` breakpoint the sidebar collapses into a sheet opened from the topbar.
47
+ * The search lines up with the first panel, and looks like one (same surface, same radius);
48
+ * inside the panels, content starts at one horizontal gutter (`--frame-gutter`).
49
+ */
50
+ export function AppFrame({ appIcon, appName, brandLink, navigation, sidebarFooter, search, actions, account, layout = 'panel', children, }) {
51
+ const t = useSharedMessages().ui.appFrame;
52
+ const [sheetOpen, setSheetOpen] = React.useState(false);
53
+ const docked = useDocked();
54
+ const sidebarContent = (_jsxs(_Fragment, { children: [_jsx("div", { className: "flex min-h-0 flex-1 flex-col overflow-y-auto px-3 py-4", children: navigation }), sidebarFooter && _jsx("div", { className: "px-3 py-3", children: sidebarFooter }), _jsx("p", { "data-slot": "app-frame-credit", className: "px-4 pb-2 text-muted-foreground/60 text-xs", children: t.credit })] }));
55
+ // Every app can drag its entities and show toasts, and is named in the browser tab: the frame
56
+ // provides all three.
57
+ return (_jsx(DocumentTitle, { appName: appName, children: _jsxs(DragDropProvider, { children: [_jsxs("div", { "data-slot": "app-frame", className: "grid h-svh grid-cols-[minmax(0,1fr)] grid-rows-[3.5rem_minmax(0,1fr)] bg-background md:grid-cols-[15rem_minmax(0,1fr)]", children: [_jsx("div", { "data-slot": "app-frame-brand", className: "hidden items-center px-4 md:flex", children: docked && _jsx(Brand, { appIcon: appIcon, appName: appName, brandLink: brandLink }) }), _jsxs("header", { "data-slot": "app-frame-topbar", className: "grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-3 px-3 md:grid-cols-[minmax(0,36rem)_1fr] md:gap-6 md:pr-(--frame-gutter) md:pl-0", children: [!docked && (_jsxs("div", { className: "flex items-center gap-2 md:hidden", children: [_jsxs(DialogPrimitive.Root, { open: sheetOpen, onOpenChange: setSheetOpen, children: [_jsx(DialogPrimitive.Trigger, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "icon", "aria-label": t.openNavigation, className: "text-muted-foreground", children: _jsx(ListIcon, { className: "size-5" }) }) }), _jsxs(DialogPrimitive.Portal, { children: [_jsx(DialogPrimitive.Overlay, { className: "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-foreground/20 backdrop-blur-xs data-[state=closed]:animate-out data-[state=open]:animate-in md:hidden" }), _jsxs(DialogPrimitive.Content, { "aria-describedby": undefined, onClick: (event) => {
58
+ // Following a link inside the sheet closes it.
59
+ if (event.target.closest('a'))
60
+ setSheetOpen(false);
61
+ }, className: "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left fixed inset-y-0 left-0 z-50 flex w-72 max-w-[85vw] flex-col bg-background shadow-xl outline-none duration-200 data-[state=closed]:animate-out data-[state=open]:animate-in md:hidden", children: [_jsx(DialogPrimitive.Title, { className: "sr-only", children: t.navigation }), _jsxs("div", { className: "flex h-14 shrink-0 items-center justify-between gap-2 px-4", children: [_jsx(Brand, { appIcon: appIcon, appName: appName, brandLink: brandLink }), _jsx(DialogPrimitive.Close, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "icon-sm", "aria-label": t.closeNavigation, className: "text-muted-foreground", children: _jsx(XIcon, {}) }) })] }), sidebarContent] })] })] }), _jsx("span", { className: "flex", "aria-hidden": true, children: appIcon })] })), _jsx("div", { className: "flex min-w-0 justify-start", children: search }), _jsxs("div", { className: "flex items-center justify-end gap-4", children: [actions, account] })] }), _jsx("aside", { "data-slot": "app-frame-sidebar", className: "hidden min-h-0 flex-col md:flex", children: docked && sidebarContent }), _jsx("main", { "data-slot": "app-frame-main", className: "flex min-h-0 min-w-0 gap-2 px-2 pb-2 md:pl-0", children: layout === 'panel' ? (_jsx(Panel, { scroll: true, className: "flex-1", children: _jsx("div", { className: "w-full max-w-6xl px-(--frame-gutter) py-8", children: children }) })) : (children) })] }), _jsx(Toaster, {})] }) }));
62
+ }
@@ -0,0 +1,11 @@
1
+ import type * as React from 'react';
2
+ export interface AppShellProps {
3
+ appName: string;
4
+ navigation?: React.ReactNode;
5
+ actions?: React.ReactNode;
6
+ children: React.ReactNode;
7
+ }
8
+ /**
9
+ * @deprecated Use `AppFrame` (sidebar + topbar shell). Kept until every app has migrated.
10
+ */
11
+ export declare function AppShell({ appName, navigation, actions, children }: AppShellProps): React.JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * @deprecated Use `AppFrame` (sidebar + topbar shell). Kept until every app has migrated.
4
+ */
5
+ export function AppShell({ appName, navigation, actions, children }) {
6
+ return (_jsxs("div", { "data-slot": "app-shell", className: "flex min-h-svh flex-col bg-background", children: [_jsx("header", { className: "sticky top-0 z-40 border-b bg-background", children: _jsxs("div", { className: "mx-auto flex h-14 max-w-5xl items-center gap-6 px-6", children: [_jsx("span", { className: "font-semibold text-sm tracking-tight", children: appName }), navigation && (_jsx("nav", { className: "flex min-w-0 items-center gap-1 text-sm", children: navigation })), actions && _jsx("div", { className: "ml-auto flex items-center gap-2", children: actions })] }) }), _jsx("main", { className: "mx-auto w-full max-w-5xl flex-1 px-6 py-10", children: children })] }));
7
+ }
@@ -0,0 +1,14 @@
1
+ import * as React from 'react';
2
+ /** `Projects | Drive · Ismou`: the page, then the app; just the app on a page named after it. */
3
+ export declare function documentTitle(appName: string, page?: string): string;
4
+ /**
5
+ * Titles the browser tab after the app (`AppFrame` renders it), and after the page shown in it
6
+ * once a page names itself (`PageHeader`, `usePageTitle`). The previous title comes back when it
7
+ * goes away.
8
+ */
9
+ export declare function DocumentTitle({ appName, children, }: {
10
+ appName: string;
11
+ children: React.ReactNode;
12
+ }): React.JSX.Element;
13
+ /** Names the page shown in the browser tab, while it is shown (inside an `AppFrame`). */
14
+ export declare function usePageTitle(page: string | undefined): void;
@@ -0,0 +1,39 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ /** The platform's name, last in every tab's title. */
4
+ const PLATFORM_NAME = 'Ismou';
5
+ /** `Projects | Drive · Ismou`: the page, then the app; just the app on a page named after it. */
6
+ export function documentTitle(appName, page) {
7
+ const app = `${appName} · ${PLATFORM_NAME}`;
8
+ return page && page !== appName ? `${page} | ${app}` : app;
9
+ }
10
+ const PageTitleContext = React.createContext(null);
11
+ /**
12
+ * Titles the browser tab after the app (`AppFrame` renders it), and after the page shown in it
13
+ * once a page names itself (`PageHeader`, `usePageTitle`). The previous title comes back when it
14
+ * goes away.
15
+ */
16
+ export function DocumentTitle({ appName, children, }) {
17
+ const [page, setPage] = React.useState();
18
+ // First: what the tab was called before, to give it back.
19
+ React.useEffect(() => {
20
+ const previous = document.title;
21
+ return () => {
22
+ document.title = previous;
23
+ };
24
+ }, []);
25
+ React.useEffect(() => {
26
+ document.title = documentTitle(appName, page);
27
+ }, [appName, page]);
28
+ return _jsx(PageTitleContext.Provider, { value: setPage, children: children });
29
+ }
30
+ /** Names the page shown in the browser tab, while it is shown (inside an `AppFrame`). */
31
+ export function usePageTitle(page) {
32
+ const setPage = React.useContext(PageTitleContext);
33
+ React.useEffect(() => {
34
+ if (!setPage || page === undefined)
35
+ return;
36
+ setPage(page);
37
+ return () => setPage(undefined);
38
+ }, [setPage, page]);
39
+ }
@@ -0,0 +1,16 @@
1
+ import { type VariantProps } from 'class-variance-authority';
2
+ import type * as React from 'react';
3
+ export declare const emptyStateVariants: (props?: ({
4
+ variant?: "outline" | "plain" | null | undefined;
5
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
+ export interface EmptyStateProps extends VariantProps<typeof emptyStateVariants> {
7
+ /** A Phosphor icon, drawn bare (no badge) in a muted tone. */
8
+ icon?: React.ReactNode;
9
+ /** Replaces the icon with any picture (e.g. a cluster of avatars), rendered as is. */
10
+ illustration?: React.ReactNode;
11
+ title: React.ReactNode;
12
+ description?: React.ReactNode;
13
+ action?: React.ReactNode;
14
+ className?: string;
15
+ }
16
+ export declare function EmptyState({ icon, illustration, title, description, action, variant, className, }: EmptyStateProps): React.JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cva } from 'class-variance-authority';
3
+ import { cn } from '../lib/cn.js';
4
+ export const emptyStateVariants = cva('flex flex-col items-center justify-center text-center', {
5
+ variants: {
6
+ variant: {
7
+ /** A dashed frame, for an empty block inside a page. */
8
+ outline: 'gap-3 rounded-xl border border-dashed px-6 py-12',
9
+ /** No frame and more air, for a whole empty panel or "no search results". */
10
+ plain: 'gap-4 px-6 py-20',
11
+ },
12
+ },
13
+ defaultVariants: { variant: 'outline' },
14
+ });
15
+ export function EmptyState({ icon, illustration, title, description, action, variant, className, }) {
16
+ const plain = variant === 'plain';
17
+ return (_jsxs("div", { "data-slot": "empty-state", "data-variant": variant ?? 'outline', className: cn(emptyStateVariants({ variant }), className), children: [illustration ??
18
+ (icon && (_jsx("div", { "aria-hidden": true, className: cn('flex text-muted-foreground/70', plain ? 'mb-1 [&_svg]:size-10' : '[&_svg]:size-7'), children: icon }))), _jsxs("div", { className: cn('flex flex-col', plain ? 'max-w-xs gap-1.5' : 'max-w-sm gap-1'), children: [_jsx("h2", { className: cn(plain ? 'font-semibold text-base tracking-tight' : 'font-medium'), children: title }), description && _jsx("p", { className: "text-balance text-muted-foreground text-sm", children: description })] }), action && _jsx("div", { className: "mt-2", children: action })] }));
19
+ }
@@ -0,0 +1,14 @@
1
+ import type * as React from 'react';
2
+ export interface EntityHeaderProps {
3
+ /** The entity's large avatar or logo. */
4
+ media: React.ReactNode;
5
+ title: React.ReactNode;
6
+ /** Id of the title, to name the region it heads. */
7
+ titleId?: string;
8
+ /** `lg` for a detail panel, `md` inside a sheet. */
9
+ size?: 'md' | 'lg';
10
+ /** Under the title: an address, a picker of the entity's place. */
11
+ children?: React.ReactNode;
12
+ }
13
+ /** The head of an entity's page: its picture, with its name and what goes with it beside. */
14
+ export declare function EntityHeader({ media, title, titleId, size, children }: EntityHeaderProps): React.JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from '../lib/cn.js';
3
+ /** The head of an entity's page: its picture, with its name and what goes with it beside. */
4
+ export function EntityHeader({ media, title, titleId, size = 'lg', children }) {
5
+ return (_jsxs("div", { "data-slot": "entity-header", className: "flex w-full min-w-0 items-center gap-5", children: [_jsx("span", { className: "flex shrink-0", children: media }), _jsxs("div", { className: "flex min-w-0 flex-col", children: [_jsx("h2", { id: titleId, className: cn('break-words font-semibold tracking-tight', size === 'lg' ? 'text-3xl' : 'text-xl'), children: title }), children] })] }));
6
+ }
@@ -0,0 +1,10 @@
1
+ import type * as React from 'react';
2
+ export interface FormFieldProps {
3
+ label: React.ReactNode;
4
+ htmlFor: string;
5
+ error?: React.ReactNode;
6
+ hint?: React.ReactNode;
7
+ /** A single control element; it receives `id`, `aria-describedby` and `aria-invalid`. */
8
+ children: React.ReactElement;
9
+ }
10
+ export declare function FormField({ label, htmlFor, error, hint, children }: FormFieldProps): React.JSX.Element;