@ismou-workspace/ui 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. package/dist/brand/app-brands.d.ts +38 -0
  2. package/dist/brand/app-brands.js +110 -0
  3. package/dist/brand/app-icon.d.ts +34 -0
  4. package/dist/brand/app-icon.js +65 -0
  5. package/dist/brand/app-logo.d.ts +14 -0
  6. package/dist/brand/app-logo.js +27 -0
  7. package/dist/brand/favicons/account.svg +1 -0
  8. package/dist/brand/favicons/admin.svg +1 -0
  9. package/dist/brand/favicons/bridge.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/office.svg +1 -0
  15. package/dist/brand/file-icons/archive.svg +1 -0
  16. package/dist/brand/file-icons/audio.svg +1 -0
  17. package/dist/brand/file-icons/code.svg +1 -0
  18. package/dist/brand/file-icons/diagram.svg +1 -0
  19. package/dist/brand/file-icons/document.svg +1 -0
  20. package/dist/brand/file-icons/form.svg +1 -0
  21. package/dist/brand/file-icons/image.svg +1 -0
  22. package/dist/brand/file-icons/markdown.svg +1 -0
  23. package/dist/brand/file-icons/other.svg +1 -0
  24. package/dist/brand/file-icons/pdf.svg +1 -0
  25. package/dist/brand/file-icons/presentation.svg +1 -0
  26. package/dist/brand/file-icons/spreadsheet.svg +1 -0
  27. package/dist/brand/file-icons/text.svg +1 -0
  28. package/dist/brand/file-icons/video.svg +1 -0
  29. package/dist/brand/grain-surface.d.ts +8 -0
  30. package/dist/brand/grain-surface.js +10 -0
  31. package/dist/brand/kind-icons.d.ts +36 -0
  32. package/dist/brand/kind-icons.js +149 -0
  33. package/dist/components/account-menu.d.ts +20 -0
  34. package/dist/components/account-menu.js +13 -0
  35. package/dist/components/alert.d.ts +10 -0
  36. package/dist/components/alert.js +28 -0
  37. package/dist/components/app-switcher.d.ts +21 -0
  38. package/dist/components/app-switcher.js +17 -0
  39. package/dist/components/area-selection.d.ts +21 -0
  40. package/dist/components/area-selection.js +91 -0
  41. package/dist/components/avatar-picker-dialog.d.ts +40 -0
  42. package/dist/components/avatar-picker-dialog.js +110 -0
  43. package/dist/components/avatar.d.ts +5 -0
  44. package/dist/components/avatar.js +10 -0
  45. package/dist/components/badge-list.d.ts +7 -0
  46. package/dist/components/badge-list.js +7 -0
  47. package/dist/components/badge.d.ts +9 -0
  48. package/dist/components/badge.js +32 -0
  49. package/dist/components/breadcrumbs.d.ts +20 -0
  50. package/dist/components/breadcrumbs.js +16 -0
  51. package/dist/components/button.d.ts +12 -0
  52. package/dist/components/button.js +38 -0
  53. package/dist/components/caption.d.ts +3 -0
  54. package/dist/components/caption.js +6 -0
  55. package/dist/components/card.d.ts +8 -0
  56. package/dist/components/card.js +23 -0
  57. package/dist/components/checkbox-field.d.ts +10 -0
  58. package/dist/components/checkbox-field.js +8 -0
  59. package/dist/components/checkbox.d.ts +3 -0
  60. package/dist/components/checkbox.js +7 -0
  61. package/dist/components/code.d.ts +16 -0
  62. package/dist/components/code.js +32 -0
  63. package/dist/components/color-dot.d.ts +11 -0
  64. package/dist/components/color-dot.js +34 -0
  65. package/dist/components/corner-mark.d.ts +14 -0
  66. package/dist/components/corner-mark.js +27 -0
  67. package/dist/components/date-range-field.d.ts +9 -0
  68. package/dist/components/date-range-field.js +9 -0
  69. package/dist/components/description-list.d.ts +11 -0
  70. package/dist/components/description-list.js +10 -0
  71. package/dist/components/dialog.d.ts +16 -0
  72. package/dist/components/dialog.js +38 -0
  73. package/dist/components/drag-and-drop.d.ts +60 -0
  74. package/dist/components/drag-and-drop.js +141 -0
  75. package/dist/components/dropdown-menu.d.ts +27 -0
  76. package/dist/components/dropdown-menu.js +44 -0
  77. package/dist/components/entity-avatar.d.ts +28 -0
  78. package/dist/components/entity-avatar.js +22 -0
  79. package/dist/components/entity-menu.d.ts +67 -0
  80. package/dist/components/entity-menu.js +74 -0
  81. package/dist/components/error-alert.d.ts +7 -0
  82. package/dist/components/error-alert.js +9 -0
  83. package/dist/components/event-chip.d.ts +16 -0
  84. package/dist/components/event-chip.js +19 -0
  85. package/dist/components/fab.d.ts +21 -0
  86. package/dist/components/fab.js +14 -0
  87. package/dist/components/file-drop-zone.d.ts +35 -0
  88. package/dist/components/file-drop-zone.js +44 -0
  89. package/dist/components/file-type-icon.d.ts +44 -0
  90. package/dist/components/file-type-icon.js +147 -0
  91. package/dist/components/icon-image.d.ts +10 -0
  92. package/dist/components/icon-image.js +11 -0
  93. package/dist/components/identity.d.ts +27 -0
  94. package/dist/components/identity.js +22 -0
  95. package/dist/components/inline-field.d.ts +40 -0
  96. package/dist/components/inline-field.js +110 -0
  97. package/dist/components/input.d.ts +17 -0
  98. package/dist/components/input.js +14 -0
  99. package/dist/components/item-list.d.ts +11 -0
  100. package/dist/components/item-list.js +15 -0
  101. package/dist/components/label.d.ts +3 -0
  102. package/dist/components/label.js +6 -0
  103. package/dist/components/mini-month.d.ts +15 -0
  104. package/dist/components/mini-month.js +35 -0
  105. package/dist/components/placeholder-avatar.d.ts +12 -0
  106. package/dist/components/placeholder-avatar.js +6 -0
  107. package/dist/components/popover.d.ts +7 -0
  108. package/dist/components/popover.js +16 -0
  109. package/dist/components/progress-list.d.ts +31 -0
  110. package/dist/components/progress-list.js +15 -0
  111. package/dist/components/progress-ring.d.ts +13 -0
  112. package/dist/components/progress-ring.js +14 -0
  113. package/dist/components/progress.d.ts +10 -0
  114. package/dist/components/progress.js +12 -0
  115. package/dist/components/search-box.d.ts +25 -0
  116. package/dist/components/search-box.js +56 -0
  117. package/dist/components/searchable-options.d.ts +32 -0
  118. package/dist/components/searchable-options.js +17 -0
  119. package/dist/components/section-label.d.ts +7 -0
  120. package/dist/components/section-label.js +8 -0
  121. package/dist/components/segmented-control.d.ts +21 -0
  122. package/dist/components/segmented-control.js +9 -0
  123. package/dist/components/select-menu.d.ts +38 -0
  124. package/dist/components/select-menu.js +26 -0
  125. package/dist/components/selection-bar.d.ts +17 -0
  126. package/dist/components/selection-bar.js +15 -0
  127. package/dist/components/separator.d.ts +3 -0
  128. package/dist/components/separator.js +6 -0
  129. package/dist/components/share-dialog.d.ts +63 -0
  130. package/dist/components/share-dialog.js +74 -0
  131. package/dist/components/sheet.d.ts +20 -0
  132. package/dist/components/sheet.js +24 -0
  133. package/dist/components/skeleton.d.ts +2 -0
  134. package/dist/components/skeleton.js +5 -0
  135. package/dist/components/spinner.d.ts +3 -0
  136. package/dist/components/spinner.js +8 -0
  137. package/dist/components/table.d.ts +7 -0
  138. package/dist/components/table.js +20 -0
  139. package/dist/components/text-link.d.ts +9 -0
  140. package/dist/components/text-link.js +9 -0
  141. package/dist/components/text.d.ts +13 -0
  142. package/dist/components/text.js +8 -0
  143. package/dist/components/toaster.d.ts +8 -0
  144. package/dist/components/toaster.js +27 -0
  145. package/dist/components/viewer-dialog.d.ts +37 -0
  146. package/dist/components/viewer-dialog.js +53 -0
  147. package/dist/index.d.ts +87 -0
  148. package/dist/index.js +87 -0
  149. package/dist/layout/app-frame.d.ts +42 -0
  150. package/dist/layout/app-frame.js +62 -0
  151. package/dist/layout/app-shell.d.ts +11 -0
  152. package/dist/layout/app-shell.js +7 -0
  153. package/dist/layout/document-title.d.ts +14 -0
  154. package/dist/layout/document-title.js +39 -0
  155. package/dist/layout/empty-state.d.ts +16 -0
  156. package/dist/layout/empty-state.js +19 -0
  157. package/dist/layout/entity-header.d.ts +14 -0
  158. package/dist/layout/entity-header.js +6 -0
  159. package/dist/layout/form-field.d.ts +10 -0
  160. package/dist/layout/form-field.js +9 -0
  161. package/dist/layout/form-grid.d.ts +6 -0
  162. package/dist/layout/form-grid.js +9 -0
  163. package/dist/layout/full-page-message.d.ts +10 -0
  164. package/dist/layout/full-page-message.js +5 -0
  165. package/dist/layout/full-page-surface.d.ts +12 -0
  166. package/dist/layout/full-page-surface.js +8 -0
  167. package/dist/layout/month-grid.d.ts +31 -0
  168. package/dist/layout/month-grid.js +12 -0
  169. package/dist/layout/page-header.d.ts +14 -0
  170. package/dist/layout/page-header.js +11 -0
  171. package/dist/layout/panel.d.ts +15 -0
  172. package/dist/layout/panel.js +12 -0
  173. package/dist/layout/retry-message.d.ts +8 -0
  174. package/dist/layout/retry-message.js +9 -0
  175. package/dist/layout/route-error-message.d.ts +9 -0
  176. package/dist/layout/route-error-message.js +9 -0
  177. package/dist/layout/row-list.d.ts +87 -0
  178. package/dist/layout/row-list.js +67 -0
  179. package/dist/layout/settings-section.d.ts +14 -0
  180. package/dist/layout/settings-section.js +11 -0
  181. package/dist/layout/sidebar-nav.d.ts +79 -0
  182. package/dist/layout/sidebar-nav.js +59 -0
  183. package/dist/layout/sign-in-layout.d.ts +19 -0
  184. package/dist/layout/sign-in-layout.js +11 -0
  185. package/dist/layout/sortable-row-list.d.ts +27 -0
  186. package/dist/layout/sortable-row-list.js +61 -0
  187. package/dist/layout/stack.d.ts +41 -0
  188. package/dist/layout/stack.js +51 -0
  189. package/dist/layout/tile-grid.d.ts +75 -0
  190. package/dist/layout/tile-grid.js +71 -0
  191. package/dist/layout/time-grid.d.ts +40 -0
  192. package/dist/layout/time-grid.js +63 -0
  193. package/dist/layout/use-favicon.d.ts +5 -0
  194. package/dist/layout/use-favicon.js +20 -0
  195. package/dist/lib/cn.d.ts +2 -0
  196. package/dist/lib/cn.js +5 -0
  197. package/dist/lib/initials.d.ts +2 -0
  198. package/dist/lib/initials.js +7 -0
  199. package/dist/mascot/mascot.d.ts +23 -0
  200. package/dist/mascot/mascot.definition.json +14 -0
  201. package/dist/mascot/mascot.js +49 -0
  202. package/dist/mascot/use-thinking-motion.d.ts +8 -0
  203. package/dist/mascot/use-thinking-motion.js +68 -0
  204. package/dist/styles.css +385 -0
  205. package/dist/vite/ismou-favicon.plugin.d.ts +10 -0
  206. package/dist/vite/ismou-favicon.plugin.js +67 -0
  207. package/dist/vite/phosphor-icons.plugin.d.ts +8 -0
  208. package/dist/vite/phosphor-icons.plugin.js +61 -0
  209. package/package.json +97 -3
  210. package/README.md +0 -3
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from '../lib/cn.js';
3
+ const RADIUS = 10;
4
+ const CIRCUMFERENCE = 2 * Math.PI * RADIUS;
5
+ /** How far a task went, as a ring around a small mark: fits in an icon button. */
6
+ const TONES = {
7
+ primary: 'stroke-primary',
8
+ success: 'stroke-success text-success-foreground',
9
+ danger: 'stroke-danger text-danger-foreground',
10
+ };
11
+ export function ProgressRing({ value, label, children, tone = 'primary', className, }) {
12
+ const clamped = Math.min(100, Math.max(0, value));
13
+ return (_jsxs("span", { role: "progressbar", "aria-label": label, "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": Math.round(clamped), "data-slot": "progress-ring", className: cn('relative inline-flex size-7 shrink-0 items-center justify-center [&>svg:not([data-ring])]:size-3.5', tone !== 'primary' && TONES[tone], className), children: [_jsxs("svg", { "data-ring": "", "aria-hidden": true, viewBox: "0 0 24 24", className: "absolute inset-0 size-full -rotate-90", children: [_jsx("circle", { cx: "12", cy: "12", r: RADIUS, fill: "none", strokeWidth: "2.5", className: "stroke-muted" }), _jsx("circle", { cx: "12", cy: "12", r: RADIUS, fill: "none", strokeWidth: "2.5", strokeLinecap: "round", strokeDasharray: CIRCUMFERENCE, strokeDashoffset: CIRCUMFERENCE * (1 - clamped / 100), className: cn(TONES[tone], 'transition-[stroke-dashoffset] duration-300 ease-out') })] }), children] }));
14
+ }
@@ -0,0 +1,10 @@
1
+ import { Progress as ProgressPrimitive } from 'radix-ui';
2
+ import type * as React from 'react';
3
+ export interface ProgressProps extends Omit<React.ComponentProps<typeof ProgressPrimitive.Root>, 'value'> {
4
+ /** From 0 to 100; `null` while the amount is unknown. */
5
+ value: number | null;
6
+ /** `danger` for a task that failed, `success` for one that is done. */
7
+ tone?: 'primary' | 'success' | 'danger';
8
+ }
9
+ /** How far a task went, as a thin bar (an upload, an import). */
10
+ export declare function Progress({ value, tone, className, ...props }: ProgressProps): React.JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Progress as ProgressPrimitive } from 'radix-ui';
3
+ import { cn } from '../lib/cn.js';
4
+ const TONES = {
5
+ primary: 'bg-primary',
6
+ success: 'bg-success',
7
+ danger: 'bg-danger',
8
+ };
9
+ /** How far a task went, as a thin bar (an upload, an import). */
10
+ export function Progress({ value, tone = 'primary', className, ...props }) {
11
+ return (_jsx(ProgressPrimitive.Root, { "data-slot": "progress", value: value, className: cn('relative h-1.5 w-full overflow-hidden rounded-full bg-muted', className), ...props, children: _jsx(ProgressPrimitive.Indicator, { className: cn('h-full rounded-full transition-[width] duration-300 ease-out', TONES[tone], value === null && 'w-1/3 animate-pulse'), style: value === null ? undefined : { width: `${Math.min(100, Math.max(0, value))}%` } }) }));
12
+ }
@@ -0,0 +1,25 @@
1
+ import type * as React from 'react';
2
+ export interface SearchBoxProps {
3
+ value: string;
4
+ onValueChange: (value: string) => void;
5
+ /** Called on Enter, with the current value. */
6
+ onSubmit?: (value: string) => void;
7
+ placeholder?: string;
8
+ /**
9
+ * Runs before the box's own keys (Enter submits, Escape clears), e.g. ArrowDown to move into
10
+ * the results. Call `event.preventDefault()` to skip the built-in handling.
11
+ */
12
+ onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
13
+ /** Accessible name of the input. Defaults to "Search". */
14
+ label?: string;
15
+ /** Focuses the box on ⌘K (macOS) / Ctrl K anywhere on the page, and shows the hint. Defaults to true. */
16
+ shortcut?: boolean;
17
+ id?: string;
18
+ className?: string;
19
+ }
20
+ /**
21
+ * The topbar search: a quiet, controlled input with a leading icon, a clear button when it has
22
+ * a value, and a keyboard shortcut hint (⌘K / Ctrl K) that focuses it from anywhere.
23
+ * Escape clears the value, or leaves the box when it is already empty.
24
+ */
25
+ export declare function SearchBox({ value, onValueChange, onSubmit, onKeyDown, placeholder: placeholderProp, label: labelProp, shortcut, id, className, }: SearchBoxProps): React.JSX.Element;
@@ -0,0 +1,56 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useSharedMessages } from '@ismou-workspace/translations/react';
3
+ import { MagnifyingGlassIcon, XIcon } from '@phosphor-icons/react';
4
+ import { useEffect, useRef, useState } from 'react';
5
+ import { PANEL_SURFACE_CLASS_NAME } from '../layout/panel.js';
6
+ import { cn } from '../lib/cn.js';
7
+ import { Button } from './button.js';
8
+ function isApplePlatform() {
9
+ return typeof navigator !== 'undefined' && /Mac|iPhone|iPad|iPod/i.test(navigator.platform);
10
+ }
11
+ /**
12
+ * The topbar search: a quiet, controlled input with a leading icon, a clear button when it has
13
+ * a value, and a keyboard shortcut hint (⌘K / Ctrl K) that focuses it from anywhere.
14
+ * Escape clears the value, or leaves the box when it is already empty.
15
+ */
16
+ export function SearchBox({ value, onValueChange, onSubmit, onKeyDown, placeholder: placeholderProp, label: labelProp, shortcut = true, id, className, }) {
17
+ const t = useSharedMessages();
18
+ const placeholder = placeholderProp ?? t.common.search;
19
+ const label = labelProp ?? t.common.search;
20
+ const input = useRef(null);
21
+ const [apple] = useState(isApplePlatform);
22
+ useEffect(() => {
23
+ if (!shortcut)
24
+ return;
25
+ const onKeyDown = (event) => {
26
+ if (event.key.toLowerCase() !== 'k' || event.altKey || event.shiftKey)
27
+ return;
28
+ if (!(event.metaKey || event.ctrlKey))
29
+ return;
30
+ event.preventDefault();
31
+ input.current?.focus();
32
+ input.current?.select();
33
+ };
34
+ window.addEventListener('keydown', onKeyDown);
35
+ return () => window.removeEventListener('keydown', onKeyDown);
36
+ }, [shortcut]);
37
+ const clear = () => {
38
+ onValueChange('');
39
+ input.current?.focus();
40
+ };
41
+ return (_jsxs("div", { "data-slot": "search-box", className: cn('group/search relative w-full', className), children: [_jsx(MagnifyingGlassIcon, { "aria-hidden": true, className: "pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground" }), _jsx("input", { ref: input, id: id, type: "search", "aria-label": label, "aria-keyshortcuts": shortcut ? (apple ? 'Meta+K' : 'Control+K') : undefined, autoComplete: "off", spellCheck: false, value: value, placeholder: placeholder, onChange: (event) => onValueChange(event.target.value), onKeyDown: (event) => {
42
+ onKeyDown?.(event);
43
+ if (event.defaultPrevented)
44
+ return;
45
+ if (event.key === 'Enter') {
46
+ onSubmit?.(value);
47
+ }
48
+ else if (event.key === 'Escape') {
49
+ event.preventDefault();
50
+ if (value)
51
+ onValueChange('');
52
+ else
53
+ event.currentTarget.blur();
54
+ }
55
+ }, className: cn(PANEL_SURFACE_CLASS_NAME, 'peer h-9 w-full min-w-0 border border-transparent pr-16 pl-9 text-sm outline-none transition-[background-color,border-color,box-shadow] placeholder:text-muted-foreground', 'focus-visible:border-ring focus-ring', '[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none') }), value ? (_jsx(Button, { variant: "ghost", size: "icon", "aria-label": t.ui.searchBox.clear, onClick: clear, className: "absolute top-1/2 right-2 size-6 -translate-y-1/2 rounded-sm text-muted-foreground", children: _jsx(XIcon, { className: "size-3.5" }) })) : (shortcut && (_jsxs("kbd", { "aria-hidden": true, className: "pointer-events-none absolute top-1/2 right-2 hidden h-5 -translate-y-1/2 select-none items-center gap-0.5 rounded-sm border bg-card px-1.5 font-medium font-sans text-xs text-muted-foreground sm:inline-flex peer-focus-visible:opacity-0", children: [apple ? '⌘' : 'Ctrl', _jsx("span", { children: "K" })] })))] }));
56
+ }
@@ -0,0 +1,32 @@
1
+ import type * as React from 'react';
2
+ export interface SearchableOption {
3
+ value: string;
4
+ /** What the option shows, e.g. an `Identity`. */
5
+ content: React.ReactNode;
6
+ }
7
+ export interface SearchableOptionsProps {
8
+ search: string;
9
+ onSearchChange: (search: string) => void;
10
+ /** Names the search input, e.g. "Search users". */
11
+ searchLabel: string;
12
+ placeholder?: string;
13
+ /** The options matching `search`. */
14
+ options: readonly SearchableOption[];
15
+ /** The chosen value, marked in the list. */
16
+ value: string | undefined;
17
+ onSelect: (value: string) => void;
18
+ /** Listed first, alone: the choice of nothing ("All users"). */
19
+ emptyOption?: {
20
+ value: string;
21
+ label: string;
22
+ };
23
+ /** Shown when no option matches. */
24
+ emptyText?: string;
25
+ /** Shown instead of the options, e.g. why they can't be listed. */
26
+ notice?: React.ReactNode;
27
+ }
28
+ /**
29
+ * Choices too many for a menu: a search field over the list. Goes inside a `PopoverContent`
30
+ * (with `className="p-0"`), opened by a `SelectButton`.
31
+ */
32
+ export declare function SearchableOptions({ search, onSearchChange, searchLabel, placeholder, options, value, onSelect, emptyOption, emptyText, notice, }: SearchableOptionsProps): React.JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useSharedMessages } from '@ismou-workspace/translations/react';
3
+ import { MagnifyingGlassIcon } from '@phosphor-icons/react';
4
+ import { cn } from '../lib/cn.js';
5
+ import { MENU_ITEM_CLASS_NAME } from './dropdown-menu.js';
6
+ /**
7
+ * Choices too many for a menu: a search field over the list. Goes inside a `PopoverContent`
8
+ * (with `className="p-0"`), opened by a `SelectButton`.
9
+ */
10
+ export function SearchableOptions({ search, onSearchChange, searchLabel, placeholder, options, value, onSelect, emptyOption, emptyText, notice, }) {
11
+ const t = useSharedMessages();
12
+ const item = (key, optionValue, content) => (_jsx("li", { children: _jsx("button", { type: "button", "aria-pressed": optionValue === value, className: cn(MENU_ITEM_CLASS_NAME, 'w-full text-left aria-pressed:bg-accent'), onClick: () => onSelect(optionValue), children: content }) }, key));
13
+ return (_jsxs("div", { "data-slot": "searchable-options", className: "flex flex-col", children: [_jsxs("div", { className: "flex items-center gap-2 border-b px-3", children: [_jsx(MagnifyingGlassIcon, { "aria-hidden": true, className: "size-4 shrink-0 text-muted-foreground" }), _jsx("input", {
14
+ // biome-ignore lint/a11y/noAutofocus: the list opens to search.
15
+ autoFocus: true, type: "search", value: search, onChange: (event) => onSearchChange(event.target.value), placeholder: placeholder, "aria-label": searchLabel, className: "h-10 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground" })] }), _jsxs("ul", { className: "max-h-72 overflow-y-auto p-1.5", children: [emptyOption &&
16
+ item('empty', emptyOption.value, _jsx("span", { className: "text-muted-foreground", children: emptyOption.label })), notice ? (_jsx("li", { className: "px-2 py-3 text-muted-foreground text-sm", children: notice })) : options.length === 0 ? (_jsx("li", { className: "px-2 py-3 text-center text-muted-foreground text-sm", children: emptyText ?? t.ui.searchableOptions.noMatch })) : (options.map((option) => item(option.value, option.value, option.content)))] })] }));
17
+ }
@@ -0,0 +1,7 @@
1
+ import type * as React from 'react';
2
+ export interface SectionLabelProps extends React.ComponentProps<'p'> {
3
+ /** Render the child element (an `h3`, a `legend`…) with the label's look. */
4
+ asChild?: boolean;
5
+ }
6
+ /** The small uppercase heading of a group: a list's count, a sheet's section, a sidebar group. */
7
+ export declare function SectionLabel({ asChild, className, ...props }: SectionLabelProps): React.JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Slot as SlotPrimitive } from 'radix-ui';
3
+ import { cn } from '../lib/cn.js';
4
+ /** The small uppercase heading of a group: a list's count, a sheet's section, a sidebar group. */
5
+ export function SectionLabel({ asChild = false, className, ...props }) {
6
+ const Comp = asChild ? SlotPrimitive.Slot : 'p';
7
+ return (_jsx(Comp, { "data-slot": "section-label", className: cn('font-medium text-muted-foreground text-xs uppercase tracking-wide tabular-nums', className), ...props }));
8
+ }
@@ -0,0 +1,21 @@
1
+ import type * as React from 'react';
2
+ export interface SegmentedOption<Value extends string> {
3
+ value: Value;
4
+ /** Its name: read by screen readers, and shown as a tooltip when only the icon is drawn. */
5
+ label: string;
6
+ icon?: React.ReactNode;
7
+ }
8
+ export interface SegmentedControlProps<Value extends string> {
9
+ /** Accessible name of the group, e.g. "Layout". */
10
+ label: string;
11
+ value: Value;
12
+ onValueChange: (value: Value) => void;
13
+ options: readonly SegmentedOption<Value>[];
14
+ /** Draws the icons only (each option must have one); labels stay for screen readers. */
15
+ iconOnly?: boolean;
16
+ /** For a `FormField`'s `htmlFor`. */
17
+ id?: string;
18
+ className?: string;
19
+ }
20
+ /** A few exclusive ways to show the same thing (list or cards), side by side in one control. */
21
+ export declare function SegmentedControl<Value extends string>({ label, value, onValueChange, options, iconOnly, id, className, }: SegmentedControlProps<Value>): React.JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ToggleGroup as ToggleGroupPrimitive } from 'radix-ui';
3
+ import { cn } from '../lib/cn.js';
4
+ /** A few exclusive ways to show the same thing (list or cards), side by side in one control. */
5
+ export function SegmentedControl({ label, value, onValueChange, options, iconOnly = false, id, className, }) {
6
+ return (_jsx(ToggleGroupPrimitive.Root, { id: id, type: "single", "aria-label": label, value: value,
7
+ // A segmented control always has one value: clicking the current one keeps it.
8
+ onValueChange: (next) => next && onValueChange(next), "data-slot": "segmented-control", className: cn('inline-flex shrink-0 items-center gap-0.5 rounded-md bg-muted p-0.5', className), children: options.map((option) => (_jsxs(ToggleGroupPrimitive.Item, { value: option.value, "aria-label": option.label, title: iconOnly ? option.label : undefined, className: cn('inline-flex h-7 items-center justify-center gap-1.5 rounded-sm px-2 font-medium text-muted-foreground text-sm outline-none transition-colors focus-ring', 'hover:text-foreground data-[state=on]:bg-card data-[state=on]:text-foreground data-[state=on]:shadow-xs', "[&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0"), children: [option.icon, !iconOnly && option.label] }, option.value))) }));
9
+ }
@@ -0,0 +1,38 @@
1
+ import * as React from 'react';
2
+ import { Button } from './button.tsx';
3
+ export interface SelectOption {
4
+ value: string;
5
+ label: string;
6
+ /** A small mark before the label (an icon, an avatar), in the list and on the button. */
7
+ icon?: React.ReactNode;
8
+ /** Options sharing a group are listed under its heading. */
9
+ group?: string;
10
+ }
11
+ export interface SelectButtonProps extends React.ComponentProps<typeof Button> {
12
+ /**
13
+ * Names what is chosen, e.g. a filter's "Level": shown alone, muted, until something is chosen
14
+ * (`active`), then before the choice ("Level: Errors only").
15
+ */
16
+ label?: string;
17
+ /** Something is chosen: with a `label`, the choice shows and the button darkens. */
18
+ active?: boolean;
19
+ }
20
+ /**
21
+ * The button of a select: a ghost button with the current choice and a caret. Put it in a
22
+ * `DropdownMenuTrigger asChild` (or a `PopoverTrigger`), with `SelectOptions` in the content.
23
+ */
24
+ export declare function SelectButton({ label, active, className, children, ...props }: SelectButtonProps): React.JSX.Element;
25
+ /** What a `SelectButton` shows for `option`: its mark and its label, truncated. */
26
+ export declare function SelectValue({ option }: {
27
+ option: Pick<SelectOption, 'icon' | 'label'>;
28
+ }): React.JSX.Element;
29
+ export interface SelectOptionsProps {
30
+ value: string;
31
+ options: readonly SelectOption[];
32
+ /** Called with the picked value, only when it changed. */
33
+ onValueChange: (value: string) => void;
34
+ /** Listed first, alone: the choice of nothing ("All actions", "No label"). */
35
+ emptyOption?: SelectOption;
36
+ }
37
+ /** The choices of a select, checked on the current one, grouped under headings when set. */
38
+ export declare function SelectOptions({ value, options, onValueChange, emptyOption }: SelectOptionsProps): React.JSX.Element;
@@ -0,0 +1,26 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useSharedMessages } from '@ismou-workspace/translations/react';
3
+ import { CaretDownIcon } from '@phosphor-icons/react';
4
+ import * as React from 'react';
5
+ import { cn } from '../lib/cn.js';
6
+ import { Button } from './button.js';
7
+ import { DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, } from './dropdown-menu.js';
8
+ /**
9
+ * The button of a select: a ghost button with the current choice and a caret. Put it in a
10
+ * `DropdownMenuTrigger asChild` (or a `PopoverTrigger`), with `SelectOptions` in the content.
11
+ */
12
+ export function SelectButton({ label, active = false, className, children, ...props }) {
13
+ const t = useSharedMessages();
14
+ return (_jsxs(Button, { variant: "ghost", size: "sm", "data-active": active || undefined, className: cn('max-w-64 font-normal', label && 'text-muted-foreground data-active:bg-accent data-active:text-foreground', className), ...props, children: [label && (_jsx("span", { className: cn(active && 'sr-only sm:not-sr-only sm:text-muted-foreground'), children: active ? t.ui.select.labelled(label) : label })), (!label || active) && children, _jsx(CaretDownIcon, { className: "text-muted-foreground" })] }));
15
+ }
16
+ /** What a `SelectButton` shows for `option`: its mark and its label, truncated. */
17
+ export function SelectValue({ option }) {
18
+ return (_jsxs("span", { className: "flex min-w-0 items-center gap-1.5", children: [option.icon, _jsx("span", { className: "truncate", children: option.label })] }));
19
+ }
20
+ /** The choices of a select, checked on the current one, grouped under headings when set. */
21
+ export function SelectOptions({ value, options, onValueChange, emptyOption }) {
22
+ const groups = [...new Set(options.map(({ group }) => group))];
23
+ return (_jsxs(DropdownMenuRadioGroup, { value: value, onValueChange: (next) => next !== value && onValueChange(next), children: [emptyOption && (_jsxs(DropdownMenuRadioItem, { value: emptyOption.value, children: [emptyOption.icon, _jsx("span", { className: "truncate", children: emptyOption.label })] })), groups.map((group, index) => (_jsxs(React.Fragment, { children: [(emptyOption || index > 0) && _jsx(DropdownMenuSeparator, {}), group && _jsx(DropdownMenuLabel, { children: group }), options
24
+ .filter((option) => option.group === group)
25
+ .map((option) => (_jsxs(DropdownMenuRadioItem, { value: option.value, children: [option.icon, _jsx("span", { className: "truncate", children: option.label })] }, option.value)))] }, group ?? 'ungrouped')))] }));
26
+ }
@@ -0,0 +1,17 @@
1
+ import type * as React from 'react';
2
+ export interface SelectionBarProps {
3
+ /** How many entities are picked; the bar shows from one. */
4
+ count: number;
5
+ /** What they are, e.g. `3 items selected`. */
6
+ label: React.ReactNode;
7
+ /** Unpicks them all (also on Escape, handled by the list). */
8
+ onClear: () => void;
9
+ /** The actions on all of them: `Button`s (`variant="ghost" size="sm"`) or menus. */
10
+ children?: React.ReactNode;
11
+ className?: string;
12
+ }
13
+ /**
14
+ * The actions on the entities picked in a list (move, download, delete): floats at the bottom of
15
+ * the list's panel, like the `Fab`, while some are picked.
16
+ */
17
+ export declare function SelectionBar({ count, label, onClear, children, className }: SelectionBarProps): React.JSX.Element | null;
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useSharedMessages } from '@ismou-workspace/translations/react';
3
+ import { XIcon } from '@phosphor-icons/react';
4
+ import { cn } from '../lib/cn.js';
5
+ import { Button } from './button.js';
6
+ /**
7
+ * The actions on the entities picked in a list (move, download, delete): floats at the bottom of
8
+ * the list's panel, like the `Fab`, while some are picked.
9
+ */
10
+ export function SelectionBar({ count, label, onClear, children, className }) {
11
+ const t = useSharedMessages().ui.selectionBar;
12
+ if (count === 0)
13
+ return null;
14
+ return (_jsxs("div", { role: "toolbar", "aria-label": t.label, "data-slot": "selection-bar", className: cn('fade-in-0 slide-in-from-bottom-2 absolute bottom-(--frame-gutter) left-1/2 z-30 flex max-w-11/12 -translate-x-1/2 animate-in items-center gap-1 rounded-xl border bg-popover p-1.5 text-popover-foreground shadow-lg duration-150', className), children: [_jsx(Button, { variant: "ghost", size: "icon-sm", "aria-label": t.clear, title: t.clear, className: "text-muted-foreground", onClick: onClear, children: _jsx(XIcon, {}) }), _jsx("span", { "aria-live": "polite", className: "whitespace-nowrap pr-2 font-medium text-sm tabular-nums", children: label }), children && _jsx("span", { "aria-hidden": true, className: "mx-1 h-5 w-px shrink-0 bg-border" }), _jsx("div", { className: "flex min-w-0 items-center gap-1 overflow-x-auto", children: children })] }));
15
+ }
@@ -0,0 +1,3 @@
1
+ import { Separator as SeparatorPrimitive } from 'radix-ui';
2
+ import type * as React from 'react';
3
+ export declare function Separator({ className, orientation, decorative, ...props }: React.ComponentProps<typeof SeparatorPrimitive.Root>): React.JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Separator as SeparatorPrimitive } from 'radix-ui';
3
+ import { cn } from '../lib/cn.js';
4
+ export function Separator({ className, orientation = 'horizontal', decorative = true, ...props }) {
5
+ return (_jsx(SeparatorPrimitive.Root, { "data-slot": "separator", decorative: decorative, orientation: orientation, className: cn('shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=vertical]:h-full data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px', className), ...props }));
6
+ }
@@ -0,0 +1,63 @@
1
+ import type * as React from 'react';
2
+ /** Someone a resource can be shared with: an account of the platform. */
3
+ export interface SharePerson {
4
+ id: string;
5
+ name: string;
6
+ email: string;
7
+ /** Seed of the generated avatar; ignored when `avatarUrl` is set. */
8
+ avatarSeed: string;
9
+ avatarUrl?: string;
10
+ }
11
+ /** A level a share can grant, as the level picker shows it. */
12
+ export interface ShareLevelOption<Level extends string> {
13
+ value: Level;
14
+ label: string;
15
+ /** What it allows, in a few words. */
16
+ description: string;
17
+ }
18
+ export interface ShareMember<Level extends string> {
19
+ person: SharePerson;
20
+ level: Level;
21
+ }
22
+ export interface ShareDialogProps<Level extends string> {
23
+ open: boolean;
24
+ onOpenChange: (open: boolean) => void;
25
+ /** E.g. `Share “Work”`. */
26
+ title: string;
27
+ description?: React.ReactNode;
28
+ /** The signed-in account, marked "you". */
29
+ currentPersonId: string;
30
+ /** `undefined` while loading; `null` once the owner's account no longer exists. */
31
+ owner: SharePerson | null | undefined;
32
+ /** How the owner's level reads, e.g. "Owner". */
33
+ ownerLabel: string;
34
+ /** `undefined` while loading. */
35
+ members: ShareMember<Level>[] | undefined;
36
+ /** Grantable levels, lowest first; people are added at the first one. */
37
+ levels: ShareLevelOption<Level>[];
38
+ /** The signed-in account may add people, change levels and remove access. */
39
+ canManage: boolean;
40
+ /** A failure loading the shares. */
41
+ loadError?: Error | null;
42
+ /** A failure of the last change. */
43
+ changeError?: Error | null;
44
+ /** A change is being saved: controls are disabled meanwhile. */
45
+ saving?: boolean;
46
+ search: string;
47
+ onSearchChange: (search: string) => void;
48
+ /** People matching `search`; `undefined` while searching or without a search. */
49
+ searchResults: SharePerson[] | undefined;
50
+ searchError?: Error | null;
51
+ onAdd: (person: SharePerson, level: Level) => void;
52
+ onChangeLevel: (personId: string, level: Level) => void;
53
+ /** Removes someone's access, or the signed-in account's own (leaving). */
54
+ onRemove: (personId: string) => void;
55
+ /** Extra information under the list, e.g. access inherited from a container. */
56
+ note?: React.ReactNode;
57
+ }
58
+ /**
59
+ * Who a resource is shared with, and at which level: the owner, then every share. Managers add
60
+ * people from a search, change their level or remove them; others see the list and may leave.
61
+ * Holds no data: the app's sharing hook feeds it (see `@ismou-workspace/app-react`).
62
+ */
63
+ export declare function ShareDialog<Level extends string>({ open, onOpenChange, title, description, currentPersonId, owner, ownerLabel, members, levels, canManage, loadError, changeError, saving, search, onSearchChange, searchResults, searchError, onAdd, onChangeLevel, onRemove, note, }: ShareDialogProps<Level>): React.JSX.Element;
@@ -0,0 +1,74 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useSharedMessages } from '@ismou-workspace/translations/react';
3
+ import { CaretDownIcon, MagnifyingGlassIcon, UserPlusIcon } from '@phosphor-icons/react';
4
+ import { useId } from 'react';
5
+ import { Badge } from './badge.js';
6
+ import { Button } from './button.js';
7
+ import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from './dialog.js';
8
+ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger, } from './dropdown-menu.js';
9
+ import { EntityAvatar } from './entity-avatar.js';
10
+ import { ErrorAlert } from './error-alert.js';
11
+ import { Identity } from './identity.js';
12
+ import { Input } from './input.js';
13
+ import { Skeleton } from './skeleton.js';
14
+ import { Spinner } from './spinner.js';
15
+ function PersonRow({ person, isYou, children }) {
16
+ const t = useSharedMessages();
17
+ return (_jsxs("li", { className: "flex items-center gap-3 py-2", children: [_jsx(Identity, { className: "flex-1", media: _jsx(EntityAvatar, { name: person.avatarSeed, imageUrl: person.avatarUrl, size: 32 }), title: person.name, badge: isYou && _jsx(Badge, { variant: "subtle", children: t.common.you }), description: person.email }), _jsx("span", { className: "shrink-0", children: children })] }));
18
+ }
19
+ function RowsSkeleton() {
20
+ const t = useSharedMessages();
21
+ return (_jsx("div", { role: "status", "aria-label": t.ui.shareDialog.loadingPeople, className: "flex flex-col gap-1", children: ['first', 'second'].map((key) => (_jsxs("div", { className: "flex items-center gap-3 py-2", children: [_jsx(Skeleton, { className: "size-8 rounded-full" }), _jsxs("div", { className: "flex flex-1 flex-col gap-1.5", children: [_jsx(Skeleton, { className: "h-3.5 w-2/5" }), _jsx(Skeleton, { className: "h-3 w-3/5" })] })] }, key))) }));
22
+ }
23
+ /**
24
+ * Who a resource is shared with, and at which level: the owner, then every share. Managers add
25
+ * people from a search, change their level or remove them; others see the list and may leave.
26
+ * Holds no data: the app's sharing hook feeds it (see `@ismou-workspace/app-react`).
27
+ */
28
+ export function ShareDialog({ open, onOpenChange, title, description, currentPersonId, owner, ownerLabel, members, levels, canManage, loadError, changeError, saving = false, search, onSearchChange, searchResults, searchError, onAdd, onChangeLevel, onRemove, note, }) {
29
+ const messages = useSharedMessages();
30
+ const t = messages.ui.shareDialog;
31
+ const searchId = useId();
32
+ const labelOf = (level) => levels.find((option) => option.value === level)?.label ?? level;
33
+ const reached = new Set([owner?.id, ...(members ?? []).map((member) => member.person.id)]);
34
+ const candidates = searchResults?.filter((person) => !reached.has(person.id));
35
+ const firstLevel = levels[0]?.value;
36
+ function renderSearchResults() {
37
+ if (!search.trim())
38
+ return null;
39
+ let body;
40
+ if (searchError)
41
+ body = _jsx(ErrorAlert, { title: t.searchFailed, error: searchError });
42
+ else if (!candidates)
43
+ body = _jsx(Spinner, { className: "mx-auto my-2" });
44
+ else if (candidates.length === 0) {
45
+ body = _jsx("p", { className: "py-2 text-center text-muted-foreground text-sm", children: t.noOneElse });
46
+ }
47
+ else {
48
+ body = (_jsx("ul", { "aria-label": t.matchingPeople, className: "flex flex-col", children: candidates.map((person) => (_jsx(PersonRow, { person: person, isYou: person.id === currentPersonId, children: _jsxs(Button, { variant: "outline", size: "sm", disabled: saving || person.id === currentPersonId || firstLevel === undefined, onClick: () => firstLevel !== undefined && onAdd(person, firstLevel), "aria-label": t.addPerson(person.name), children: [_jsx(UserPlusIcon, {}), messages.common.add] }) }, person.id))) }));
49
+ }
50
+ return _jsx("div", { className: "rounded-lg border px-3 py-1", children: body });
51
+ }
52
+ function renderLevel(member) {
53
+ const isYou = member.person.id === currentPersonId;
54
+ if (!canManage) {
55
+ if (!isYou)
56
+ return _jsx("span", { className: "text-muted-foreground text-sm", children: labelOf(member.level) });
57
+ return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(Button, { variant: "ghost", size: "sm", disabled: saving, children: [labelOf(member.level), _jsx(CaretDownIcon, {})] }) }), _jsx(DropdownMenuContent, { align: "end", children: _jsx(DropdownMenuItem, { variant: "destructive", onSelect: () => onRemove(member.person.id), children: t.leave }) })] }));
58
+ }
59
+ return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(Button, { variant: "ghost", size: "sm", disabled: saving, "aria-label": t.accessOf(member.person.name, labelOf(member.level)), children: [labelOf(member.level), _jsx(CaretDownIcon, {})] }) }), _jsxs(DropdownMenuContent, { align: "end", className: "w-60", children: [_jsx(DropdownMenuRadioGroup, { value: member.level, onValueChange: (value) => {
60
+ const option = levels.find((candidate) => candidate.value === value);
61
+ if (option && option.value !== member.level) {
62
+ onChangeLevel(member.person.id, option.value);
63
+ }
64
+ }, children: levels.map((option) => (_jsx(DropdownMenuRadioItem, { value: option.value, children: _jsxs("span", { className: "flex flex-col", children: [_jsx("span", { children: option.label }), _jsx("span", { className: "text-muted-foreground text-xs", children: option.description })] }) }, option.value))) }), _jsx(DropdownMenuSeparator, {}), _jsx(DropdownMenuItem, { variant: "destructive", onSelect: () => onRemove(member.person.id), children: isYou ? t.leave : t.removeAccess })] })] }));
65
+ }
66
+ function renderPeople() {
67
+ if (loadError)
68
+ return _jsx(ErrorAlert, { title: t.loadFailed, error: loadError });
69
+ if (owner === undefined || !members)
70
+ return _jsx(RowsSkeleton, {});
71
+ return (_jsxs("ul", { "aria-label": t.peopleWithAccess, className: "flex flex-col", children: [owner ? (_jsx(PersonRow, { person: owner, isYou: owner.id === currentPersonId, children: _jsx("span", { className: "text-muted-foreground text-sm", children: ownerLabel }) })) : (_jsx("li", { className: "py-2 text-muted-foreground text-sm", children: t.ownerGone })), members.map((member) => (_jsx(PersonRow, { person: member.person, isYou: member.person.id === currentPersonId, children: renderLevel(member) }, member.person.id)))] }));
72
+ }
73
+ return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(DialogContent, { className: "sm:max-w-lg", children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { className: "truncate leading-normal", children: title }), description && _jsx(DialogDescription, { children: description })] }), canManage && (_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx("label", { htmlFor: searchId, className: "sr-only", children: t.searchLabel }), _jsxs("div", { className: "relative", children: [_jsx(MagnifyingGlassIcon, { "aria-hidden": true, className: "pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground" }), _jsx(Input, { id: searchId, type: "search", value: search, onChange: (event) => onSearchChange(event.target.value), placeholder: t.searchLabel, autoComplete: "off", className: "pl-9" })] }), renderSearchResults()] })), _jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("h3", { className: "font-medium text-sm", children: t.peopleWithAccess }), renderPeople()] }), note && _jsx("p", { className: "text-muted-foreground text-xs leading-5", children: note }), _jsx(ErrorAlert, { title: t.saveFailed, error: changeError ?? null }), _jsx(DialogFooter, { children: _jsx(DialogClose, { asChild: true, children: _jsx(Button, { variant: "outline", children: messages.common.done }) }) })] }) }));
74
+ }
@@ -0,0 +1,20 @@
1
+ import { Dialog as DialogPrimitive } from 'radix-ui';
2
+ import type * as React from 'react';
3
+ /** A dialog sliding from the right edge, for a detail or a review over a page. */
4
+ export declare function Sheet(props: React.ComponentProps<typeof DialogPrimitive.Root>): React.JSX.Element;
5
+ export interface SheetContentProps extends React.ComponentProps<typeof DialogPrimitive.Content> {
6
+ /** `md` for a detail, `lg` for a review with more to read. */
7
+ size?: 'md' | 'lg';
8
+ }
9
+ /** Full height, flush with the right edge: a `SheetHeader`, a `SheetBody`, maybe a `SheetFooter`. */
10
+ export declare function SheetContent({ size, className, children, ...props }: SheetContentProps): React.JSX.Element;
11
+ export interface SheetHeaderProps {
12
+ title: React.ReactNode;
13
+ description?: React.ReactNode;
14
+ }
15
+ /** The sheet's title and what it is about, above a hairline. */
16
+ export declare function SheetHeader({ title, description }: SheetHeaderProps): React.JSX.Element;
17
+ /** The scrolling content of the sheet; its sections are spaced like a panel's. */
18
+ export declare function SheetBody({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
19
+ /** Pinned under the body, above a hairline: the decision. */
20
+ export declare function SheetFooter({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
@@ -0,0 +1,24 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Dialog as DialogPrimitive } from 'radix-ui';
3
+ import { cn } from '../lib/cn.js';
4
+ import { DialogCloseButton, DialogOverlay } from './dialog.js';
5
+ /** A dialog sliding from the right edge, for a detail or a review over a page. */
6
+ export function Sheet(props) {
7
+ return _jsx(DialogPrimitive.Root, { "data-slot": "sheet", ...props });
8
+ }
9
+ /** Full height, flush with the right edge: a `SheetHeader`, a `SheetBody`, maybe a `SheetFooter`. */
10
+ export function SheetContent({ size = 'md', className, children, ...props }) {
11
+ return (_jsxs(DialogPrimitive.Portal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, { "data-slot": "sheet-content", className: cn('data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right fixed inset-y-0 right-0 z-50 flex h-svh w-full flex-col border-l bg-popover text-popover-foreground shadow-lg outline-none duration-200 data-[state=closed]:animate-out data-[state=open]:animate-in', size === 'md' ? 'sm:max-w-lg' : 'sm:max-w-xl', className), ...props, children: [children, _jsx(DialogCloseButton, {})] })] }));
12
+ }
13
+ /** The sheet's title and what it is about, above a hairline. */
14
+ export function SheetHeader({ title, description }) {
15
+ return (_jsxs("div", { "data-slot": "sheet-header", className: "flex flex-col gap-1 border-b px-6 pt-5 pr-12 pb-4", children: [_jsx(DialogPrimitive.Title, { className: "font-semibold text-lg leading-none", children: title }), description ? (_jsx(DialogPrimitive.Description, { className: "text-muted-foreground text-sm", children: description })) : null] }));
16
+ }
17
+ /** The scrolling content of the sheet; its sections are spaced like a panel's. */
18
+ export function SheetBody({ className, ...props }) {
19
+ return (_jsx("div", { "data-slot": "sheet-body", className: cn('flex min-h-0 flex-1 flex-col gap-6 overflow-y-auto p-6', className), ...props }));
20
+ }
21
+ /** Pinned under the body, above a hairline: the decision. */
22
+ export function SheetFooter({ className, ...props }) {
23
+ return (_jsx("div", { "data-slot": "sheet-footer", className: cn('flex flex-col gap-3 border-t px-6 py-4', className), ...props }));
24
+ }
@@ -0,0 +1,2 @@
1
+ import type * as React from 'react';
2
+ export declare function Skeleton({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from '../lib/cn.js';
3
+ export function Skeleton({ className, ...props }) {
4
+ return (_jsx("div", { "data-slot": "skeleton", className: cn('animate-pulse rounded-md bg-muted', className), ...props }));
5
+ }
@@ -0,0 +1,3 @@
1
+ import { CircleNotchIcon } from '@phosphor-icons/react';
2
+ import type * as React from 'react';
3
+ export declare function Spinner({ className, ...props }: React.ComponentProps<typeof CircleNotchIcon>): React.JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useSharedMessages } from '@ismou-workspace/translations/react';
3
+ import { CircleNotchIcon } from '@phosphor-icons/react';
4
+ import { cn } from '../lib/cn.js';
5
+ export function Spinner({ className, ...props }) {
6
+ const t = useSharedMessages();
7
+ return (_jsx(CircleNotchIcon, { "data-slot": "spinner", role: "status", "aria-label": t.common.loading, className: cn('size-4 animate-spin text-muted-foreground', className), ...props }));
8
+ }
@@ -0,0 +1,7 @@
1
+ import type * as React from 'react';
2
+ export declare function Table({ className, ...props }: React.ComponentProps<'table'>): React.JSX.Element;
3
+ export declare function TableHeader({ className, ...props }: React.ComponentProps<'thead'>): React.JSX.Element;
4
+ export declare function TableBody({ className, ...props }: React.ComponentProps<'tbody'>): React.JSX.Element;
5
+ export declare function TableRow({ className, ...props }: React.ComponentProps<'tr'>): React.JSX.Element;
6
+ export declare function TableHead({ className, ...props }: React.ComponentProps<'th'>): React.JSX.Element;
7
+ export declare function TableCell({ className, ...props }: React.ComponentProps<'td'>): React.JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from '../lib/cn.js';
3
+ export function Table({ className, ...props }) {
4
+ return (_jsx("div", { "data-slot": "table-container", className: "relative w-full overflow-x-auto", children: _jsx("table", { "data-slot": "table", className: cn('w-full caption-bottom text-sm', className), ...props }) }));
5
+ }
6
+ export function TableHeader({ className, ...props }) {
7
+ return _jsx("thead", { "data-slot": "table-header", className: cn('[&_tr]:border-b', className), ...props });
8
+ }
9
+ export function TableBody({ className, ...props }) {
10
+ return (_jsx("tbody", { "data-slot": "table-body", className: cn('[&_tr:last-child]:border-0', className), ...props }));
11
+ }
12
+ export function TableRow({ className, ...props }) {
13
+ return (_jsx("tr", { "data-slot": "table-row", className: cn('border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted', className), ...props }));
14
+ }
15
+ export function TableHead({ className, ...props }) {
16
+ return (_jsx("th", { "data-slot": "table-head", className: cn('h-10 whitespace-nowrap px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0', className), ...props }));
17
+ }
18
+ export function TableCell({ className, ...props }) {
19
+ return (_jsx("td", { "data-slot": "table-cell", className: cn('whitespace-nowrap p-2 align-middle [&:has([role=checkbox])]:pr-0', className), ...props }));
20
+ }
@@ -0,0 +1,9 @@
1
+ import type * as React from 'react';
2
+ export interface TextLinkProps extends React.ComponentProps<'a'> {
3
+ /** Render the child element (the router's `<Link>`) with the link's look. */
4
+ asChild?: boolean;
5
+ /** Leads out of the app: opens in a new tab, an arrow shows on hover. */
6
+ external?: boolean;
7
+ }
8
+ /** A link inside text or a row: plain at rest, underlined on hover. */
9
+ export declare function TextLink({ asChild, external, className, children, ...props }: TextLinkProps): React.JSX.Element;