@stll/ui 0.18.0 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/button-variants.d.ts +2 -2
- package/dist/components/composer.d.ts +108 -0
- package/dist/components/composer.js +132 -0
- package/dist/components/landing.d.ts +61 -0
- package/dist/components/landing.js +97 -0
- package/dist/components/sidebar.d.ts +109 -0
- package/dist/components/sidebar.js +361 -0
- package/dist/components/sidebar.logic.d.ts +34 -0
- package/dist/components/sidebar.logic.js +27 -0
- package/dist/index.d.ts +6 -3
- package/dist/index.js +6 -3
- package/dist/inspector/entity-tab.d.ts +54 -0
- package/dist/inspector/entity-tab.js +56 -0
- package/dist/inspector/entity-tab.logic.d.ts +28 -0
- package/dist/inspector/entity-tab.logic.js +32 -0
- package/dist/inspector/facet-bar.d.ts +46 -0
- package/dist/inspector/facet-bar.js +166 -0
- package/dist/inspector/facet-bar.logic.d.ts +51 -0
- package/dist/inspector/facet-bar.logic.js +53 -0
- package/dist/inspector/index.d.ts +3 -1
- package/dist/inspector/index.js +3 -1
- package/dist/inspector/tabs.d.ts +1 -1
- package/dist/kanban/band-peek.d.ts +26 -33
- package/dist/kanban/band-peek.js +24 -30
- package/dist/kanban/column-header.d.ts +8 -1
- package/dist/kanban/column-header.js +9 -2
- package/dist/kanban/drag-interactions.d.ts +9 -1
- package/dist/kanban/drag-interactions.js +10 -1
- package/dist/kanban/index.d.ts +2 -2
- package/dist/kanban/index.js +2 -2
- package/dist/kanban/sortable-interactions.d.ts +12 -0
- package/dist/kanban/subgroup-board.d.ts +33 -6
- package/dist/kanban/subgroup-board.js +75 -22
- package/dist/kanban/virtual-cell.d.ts +10 -1
- package/dist/kanban/virtual-cell.js +25 -3
- package/dist/lib/control-size.d.ts +1 -1
- package/dist/lib/slot.d.ts +28 -0
- package/dist/lib/slot.js +64 -0
- package/package.json +17 -1
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
*/
|
|
11
11
|
declare const buttonAccessibleDisabledClass = "cursor-not-allowed opacity-64";
|
|
12
12
|
declare const buttonVariants: (props?: ({
|
|
13
|
-
size?: "
|
|
14
|
-
variant?: "link" | "
|
|
13
|
+
size?: "xs" | "sm" | "icon" | "default" | "lg" | "icon-sm" | "chip" | "icon-lg" | "icon-xl" | "icon-xs" | "xl" | null | undefined;
|
|
14
|
+
variant?: "link" | "destructive" | "outline" | "default" | "destructive-outline" | "ghost" | "secondary" | null | undefined;
|
|
15
15
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
16
16
|
//#endregion
|
|
17
17
|
export { buttonAccessibleDisabledClass, buttonVariants };
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
//#region src/components/composer.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* The tokens every composer box shares: the chat hero, the chat follow-up
|
|
5
|
+
* bar, the docked bar over documents (inspector chat, file overlay,
|
|
6
|
+
* Template Studio) and the law home's entry box all render one shell from
|
|
7
|
+
* these, so they restyle together. A surface that needs the look imports
|
|
8
|
+
* these rather than copying the classes; a copy is how the boxes drifted
|
|
9
|
+
* apart the first time (44px / `rounded-lg` / 14px in the chat, 38px /
|
|
10
|
+
* `rounded-2xl` / 13px in the inspector).
|
|
11
|
+
*/
|
|
12
|
+
/** Shared responsive size for the two round controls flanking a composer. */
|
|
13
|
+
declare const COMPOSER_CONTROL_BUTTON_SIZE: "icon-sm";
|
|
14
|
+
/** The bordered box: background, radius, border, colour transition. The
|
|
15
|
+
* radius is the docked bar's original `rounded-2xl`: at the compact row's
|
|
16
|
+
* stature it reads as a soft pill, which is the shape the composers were
|
|
17
|
+
* meant to unify on. */
|
|
18
|
+
declare const COMPOSER_BOX_CLASS = "bg-background rounded-2xl border transition-colors";
|
|
19
|
+
/** The box's focus ring in its default (non-anonymized) treatment. */
|
|
20
|
+
declare const COMPOSER_BOX_FOCUS_CLASS = "focus-within:border-ring";
|
|
21
|
+
/**
|
|
22
|
+
* The box's "shield active" treatment when the next send is anonymized: a
|
|
23
|
+
* blue ring replaces the default focus border (both together read as a
|
|
24
|
+
* double ring on click).
|
|
25
|
+
*/
|
|
26
|
+
declare const COMPOSER_BOX_ANONYMIZED_CLASS = "ring-info/40 border-info/40 focus-within:border-info/60 shadow-[0_0_0_4px_rgb(from_var(--color-info)_r_g_b_/_0.08)] ring-1";
|
|
27
|
+
/**
|
|
28
|
+
* The compact (one-line) bar row: its stature, end alignment, control gap
|
|
29
|
+
* and inset. The surface supplies the layout (`grid` for the chat bar's
|
|
30
|
+
* three fixed columns, `flex` for the docked bar's variable leading
|
|
31
|
+
* controls); the row grows with the editor.
|
|
32
|
+
*/
|
|
33
|
+
declare const COMPOSER_COMPACT_ROW_CLASS = "min-h-11 items-end gap-1 px-1.5 py-px";
|
|
34
|
+
/**
|
|
35
|
+
* The compact text cell: one `text-sm` line at `leading-5` plus the
|
|
36
|
+
* vertical inset that makes a single line exactly as tall as the row's
|
|
37
|
+
* inner height (44px row, 1px inset each side ⇒ 42px), so text and controls
|
|
38
|
+
* share one centre. The editable element itself takes `min-h-0` so an empty
|
|
39
|
+
* composer collapses to this one line and grows from there.
|
|
40
|
+
*/
|
|
41
|
+
declare const COMPOSER_COMPACT_TEXT_CELL_CLASS = "relative min-w-0 py-[11px]";
|
|
42
|
+
/** Text stature of the editor and every placeholder painted over it. */
|
|
43
|
+
declare const COMPOSER_TEXT_CLASS = "text-sm leading-5";
|
|
44
|
+
/**
|
|
45
|
+
* The `large` (hero) text well: the padding around the editor. The editor's
|
|
46
|
+
* own stature is `COMPOSER_LARGE_EDITOR_CLASS` (~3 lines of `text-sm` at
|
|
47
|
+
* `leading-5`), applied on the editable element by each surface because the
|
|
48
|
+
* chat editor targets its `.ProseMirror` node while a plain textarea takes
|
|
49
|
+
* it directly.
|
|
50
|
+
*/
|
|
51
|
+
declare const COMPOSER_LARGE_TEXT_WELL_CLASS = "ps-3 pe-3 pt-2 pb-1";
|
|
52
|
+
/** The `large` editable element's stature: three lines before it grows. */
|
|
53
|
+
declare const COMPOSER_LARGE_EDITOR_CLASS = "min-h-15";
|
|
54
|
+
/** The placeholder painted over an empty editor, in either stature. */
|
|
55
|
+
declare const COMPOSER_PLACEHOLDER_CLASS = "text-foreground-placeholder pointer-events-none absolute truncate text-sm";
|
|
56
|
+
/** The `large` action row under the text well: leading controls, trailing send. */
|
|
57
|
+
declare const COMPOSER_LARGE_ACTION_ROW_CLASS = "flex items-center justify-end gap-0.5 px-1.5 pb-1.5";
|
|
58
|
+
/** The leading group of the action row (the (+) menu, or a scope control). */
|
|
59
|
+
declare const COMPOSER_LEADING_GROUP_CLASS = "flex min-w-0 items-center gap-0.5";
|
|
60
|
+
/**
|
|
61
|
+
* The round, foreground-filled primary control at the action row's end:
|
|
62
|
+
* the chat's send/stop/retry button and the law home's submit. `size-7`
|
|
63
|
+
* pins the circle to the (+) trigger's diameter at every breakpoint
|
|
64
|
+
* (`icon-sm` alone is 32px below `sm`), so a row's two round ends match.
|
|
65
|
+
*/
|
|
66
|
+
declare const COMPOSER_SEND_BUTTON_CLASS = "bg-foreground text-background hover:bg-foreground/90 size-7 shrink-0 rounded-full";
|
|
67
|
+
/**
|
|
68
|
+
* A picker in the status row under the box (the chat's matter picker, the
|
|
69
|
+
* law home's scope and jurisdiction): quiet text with a hover surface, so
|
|
70
|
+
* the row stays subordinate to the box above it.
|
|
71
|
+
*/
|
|
72
|
+
declare const COMPOSER_PICKER_TRIGGER_CLASS = "text-muted-foreground hover:text-foreground hover:bg-accent inline-flex min-w-0 shrink items-center gap-1 rounded-md px-1.5 py-0.5 text-[11px] transition-colors";
|
|
73
|
+
type ComposerStatusRowProps = {
|
|
74
|
+
/** Left cluster: matter picker, web-search / anonymize toggles, ... */
|
|
75
|
+
start?: ReactNode | undefined;
|
|
76
|
+
/** End slot, pinned to the far edge (e.g. the context meter). */
|
|
77
|
+
end?: ReactNode | undefined;
|
|
78
|
+
className?: string | undefined;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* The slim status row rendered beneath a composer box: a `text-xs` row with
|
|
82
|
+
* a start cluster and an end slot pinned to the far edge. Shared by every
|
|
83
|
+
* surface so the shell can never drift. Renders nothing when both slots are
|
|
84
|
+
* empty, so a surface with no per-send controls shows no row.
|
|
85
|
+
*/
|
|
86
|
+
declare const ComposerStatusRow: ({ start, end, className }: ComposerStatusRowProps) => import("react").JSX.Element | null;
|
|
87
|
+
type ComposerPickerOption<Value extends string> = {
|
|
88
|
+
label: string;
|
|
89
|
+
value: Value;
|
|
90
|
+
};
|
|
91
|
+
type ComposerPickerProps<Value extends string> = {
|
|
92
|
+
/** The accessible name of the choice, e.g. "Jurisdiction". */
|
|
93
|
+
ariaLabel: string;
|
|
94
|
+
/** The glyph before the current choice, sized `size-3` by the trigger. */
|
|
95
|
+
icon: ReactNode;
|
|
96
|
+
onChange: (value: Value) => void;
|
|
97
|
+
options: readonly ComposerPickerOption<Value>[];
|
|
98
|
+
value: Value;
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* One choice among a few in the status row under a composer box: the
|
|
102
|
+
* trigger the chat's matter picker renders, with a radio menu behind it.
|
|
103
|
+
* Every picker under a box renders through this so the row reads as one
|
|
104
|
+
* kind of control.
|
|
105
|
+
*/
|
|
106
|
+
declare const ComposerPicker: <Value extends string>({ ariaLabel, icon, onChange, options, value }: ComposerPickerProps<Value>) => import("react").JSX.Element;
|
|
107
|
+
//#endregion
|
|
108
|
+
export { COMPOSER_BOX_ANONYMIZED_CLASS, COMPOSER_BOX_CLASS, COMPOSER_BOX_FOCUS_CLASS, COMPOSER_COMPACT_ROW_CLASS, COMPOSER_COMPACT_TEXT_CELL_CLASS, COMPOSER_CONTROL_BUTTON_SIZE, COMPOSER_LARGE_ACTION_ROW_CLASS, COMPOSER_LARGE_EDITOR_CLASS, COMPOSER_LARGE_TEXT_WELL_CLASS, COMPOSER_LEADING_GROUP_CLASS, COMPOSER_PICKER_TRIGGER_CLASS, COMPOSER_PLACEHOLDER_CLASS, COMPOSER_SEND_BUTTON_CLASS, COMPOSER_TEXT_CLASS, ComposerPicker, ComposerPickerOption, ComposerStatusRow };
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/utils.js";
|
|
3
|
+
import { DropdownMenu as Menu, DropdownMenuContent as MenuPopup, DropdownMenuRadioGroup as MenuRadioGroup, DropdownMenuRadioItem as MenuRadioItem, DropdownMenuTrigger as MenuTrigger } from "./menu.js";
|
|
4
|
+
import { ChevronDownIcon } from "lucide-react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/composer.tsx
|
|
7
|
+
/**
|
|
8
|
+
* The tokens every composer box shares: the chat hero, the chat follow-up
|
|
9
|
+
* bar, the docked bar over documents (inspector chat, file overlay,
|
|
10
|
+
* Template Studio) and the law home's entry box all render one shell from
|
|
11
|
+
* these, so they restyle together. A surface that needs the look imports
|
|
12
|
+
* these rather than copying the classes; a copy is how the boxes drifted
|
|
13
|
+
* apart the first time (44px / `rounded-lg` / 14px in the chat, 38px /
|
|
14
|
+
* `rounded-2xl` / 13px in the inspector).
|
|
15
|
+
*/
|
|
16
|
+
/** Shared responsive size for the two round controls flanking a composer. */
|
|
17
|
+
const COMPOSER_CONTROL_BUTTON_SIZE = "icon-sm";
|
|
18
|
+
/** The bordered box: background, radius, border, colour transition. The
|
|
19
|
+
* radius is the docked bar's original `rounded-2xl`: at the compact row's
|
|
20
|
+
* stature it reads as a soft pill, which is the shape the composers were
|
|
21
|
+
* meant to unify on. */
|
|
22
|
+
const COMPOSER_BOX_CLASS = "bg-background rounded-2xl border transition-colors";
|
|
23
|
+
/** The box's focus ring in its default (non-anonymized) treatment. */
|
|
24
|
+
const COMPOSER_BOX_FOCUS_CLASS = "focus-within:border-ring";
|
|
25
|
+
/**
|
|
26
|
+
* The box's "shield active" treatment when the next send is anonymized: a
|
|
27
|
+
* blue ring replaces the default focus border (both together read as a
|
|
28
|
+
* double ring on click).
|
|
29
|
+
*/
|
|
30
|
+
const COMPOSER_BOX_ANONYMIZED_CLASS = "ring-info/40 border-info/40 focus-within:border-info/60 shadow-[0_0_0_4px_rgb(from_var(--color-info)_r_g_b_/_0.08)] ring-1";
|
|
31
|
+
/**
|
|
32
|
+
* The compact (one-line) bar row: its stature, end alignment, control gap
|
|
33
|
+
* and inset. The surface supplies the layout (`grid` for the chat bar's
|
|
34
|
+
* three fixed columns, `flex` for the docked bar's variable leading
|
|
35
|
+
* controls); the row grows with the editor.
|
|
36
|
+
*/
|
|
37
|
+
const COMPOSER_COMPACT_ROW_CLASS = "min-h-11 items-end gap-1 px-1.5 py-px";
|
|
38
|
+
/**
|
|
39
|
+
* The compact text cell: one `text-sm` line at `leading-5` plus the
|
|
40
|
+
* vertical inset that makes a single line exactly as tall as the row's
|
|
41
|
+
* inner height (44px row, 1px inset each side ⇒ 42px), so text and controls
|
|
42
|
+
* share one centre. The editable element itself takes `min-h-0` so an empty
|
|
43
|
+
* composer collapses to this one line and grows from there.
|
|
44
|
+
*/
|
|
45
|
+
const COMPOSER_COMPACT_TEXT_CELL_CLASS = "relative min-w-0 py-[11px]";
|
|
46
|
+
/** Text stature of the editor and every placeholder painted over it. */
|
|
47
|
+
const COMPOSER_TEXT_CLASS = "text-sm leading-5";
|
|
48
|
+
/**
|
|
49
|
+
* The `large` (hero) text well: the padding around the editor. The editor's
|
|
50
|
+
* own stature is `COMPOSER_LARGE_EDITOR_CLASS` (~3 lines of `text-sm` at
|
|
51
|
+
* `leading-5`), applied on the editable element by each surface because the
|
|
52
|
+
* chat editor targets its `.ProseMirror` node while a plain textarea takes
|
|
53
|
+
* it directly.
|
|
54
|
+
*/
|
|
55
|
+
const COMPOSER_LARGE_TEXT_WELL_CLASS = "ps-3 pe-3 pt-2 pb-1";
|
|
56
|
+
/** The `large` editable element's stature: three lines before it grows. */
|
|
57
|
+
const COMPOSER_LARGE_EDITOR_CLASS = "min-h-15";
|
|
58
|
+
/** The placeholder painted over an empty editor, in either stature. */
|
|
59
|
+
const COMPOSER_PLACEHOLDER_CLASS = "text-foreground-placeholder pointer-events-none absolute truncate text-sm";
|
|
60
|
+
/** The `large` action row under the text well: leading controls, trailing send. */
|
|
61
|
+
const COMPOSER_LARGE_ACTION_ROW_CLASS = "flex items-center justify-end gap-0.5 px-1.5 pb-1.5";
|
|
62
|
+
/** The leading group of the action row (the (+) menu, or a scope control). */
|
|
63
|
+
const COMPOSER_LEADING_GROUP_CLASS = "flex min-w-0 items-center gap-0.5";
|
|
64
|
+
/**
|
|
65
|
+
* The round, foreground-filled primary control at the action row's end:
|
|
66
|
+
* the chat's send/stop/retry button and the law home's submit. `size-7`
|
|
67
|
+
* pins the circle to the (+) trigger's diameter at every breakpoint
|
|
68
|
+
* (`icon-sm` alone is 32px below `sm`), so a row's two round ends match.
|
|
69
|
+
*/
|
|
70
|
+
const COMPOSER_SEND_BUTTON_CLASS = "bg-foreground text-background hover:bg-foreground/90 size-7 shrink-0 rounded-full";
|
|
71
|
+
/**
|
|
72
|
+
* A picker in the status row under the box (the chat's matter picker, the
|
|
73
|
+
* law home's scope and jurisdiction): quiet text with a hover surface, so
|
|
74
|
+
* the row stays subordinate to the box above it.
|
|
75
|
+
*/
|
|
76
|
+
const COMPOSER_PICKER_TRIGGER_CLASS = "text-muted-foreground hover:text-foreground hover:bg-accent inline-flex min-w-0 shrink items-center gap-1 rounded-md px-1.5 py-0.5 text-[11px] transition-colors";
|
|
77
|
+
/**
|
|
78
|
+
* The slim status row rendered beneath a composer box: a `text-xs` row with
|
|
79
|
+
* a start cluster and an end slot pinned to the far edge. Shared by every
|
|
80
|
+
* surface so the shell can never drift. Renders nothing when both slots are
|
|
81
|
+
* empty, so a surface with no per-send controls shows no row.
|
|
82
|
+
*/
|
|
83
|
+
const ComposerStatusRow = ({ start, end, className }) => {
|
|
84
|
+
if (start === void 0 && end === void 0) return null;
|
|
85
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
86
|
+
className: cn("text-muted-foreground mt-1.5 flex items-center justify-between gap-2 px-1 text-xs", className),
|
|
87
|
+
children: [start, end !== void 0 && /* @__PURE__ */ jsx("div", {
|
|
88
|
+
className: "ms-auto",
|
|
89
|
+
children: end
|
|
90
|
+
})]
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* One choice among a few in the status row under a composer box: the
|
|
95
|
+
* trigger the chat's matter picker renders, with a radio menu behind it.
|
|
96
|
+
* Every picker under a box renders through this so the row reads as one
|
|
97
|
+
* kind of control.
|
|
98
|
+
*/
|
|
99
|
+
const ComposerPicker = ({ ariaLabel, icon, onChange, options, value }) => {
|
|
100
|
+
const current = options.find((option) => option.value === value);
|
|
101
|
+
return /* @__PURE__ */ jsxs(Menu, { children: [/* @__PURE__ */ jsxs(MenuTrigger, {
|
|
102
|
+
"aria-label": ariaLabel,
|
|
103
|
+
className: COMPOSER_PICKER_TRIGGER_CLASS,
|
|
104
|
+
children: [
|
|
105
|
+
/* @__PURE__ */ jsx("span", {
|
|
106
|
+
className: "flex size-3 shrink-0 items-center justify-center [&>svg]:size-3",
|
|
107
|
+
children: icon
|
|
108
|
+
}),
|
|
109
|
+
/* @__PURE__ */ jsx("span", {
|
|
110
|
+
className: "truncate",
|
|
111
|
+
children: current?.label ?? value
|
|
112
|
+
}),
|
|
113
|
+
/* @__PURE__ */ jsx(ChevronDownIcon, {
|
|
114
|
+
"aria-hidden": "true",
|
|
115
|
+
className: "size-3 shrink-0 opacity-70"
|
|
116
|
+
})
|
|
117
|
+
]
|
|
118
|
+
}), /* @__PURE__ */ jsx(MenuPopup, {
|
|
119
|
+
align: "start",
|
|
120
|
+
sideOffset: 6,
|
|
121
|
+
children: /* @__PURE__ */ jsx(MenuRadioGroup, {
|
|
122
|
+
value,
|
|
123
|
+
children: options.map((option) => /* @__PURE__ */ jsx(MenuRadioItem, {
|
|
124
|
+
onClick: () => onChange(option.value),
|
|
125
|
+
value: option.value,
|
|
126
|
+
children: option.label
|
|
127
|
+
}, option.value))
|
|
128
|
+
})
|
|
129
|
+
})] });
|
|
130
|
+
};
|
|
131
|
+
//#endregion
|
|
132
|
+
export { COMPOSER_BOX_ANONYMIZED_CLASS, COMPOSER_BOX_CLASS, COMPOSER_BOX_FOCUS_CLASS, COMPOSER_COMPACT_ROW_CLASS, COMPOSER_COMPACT_TEXT_CELL_CLASS, COMPOSER_CONTROL_BUTTON_SIZE, COMPOSER_LARGE_ACTION_ROW_CLASS, COMPOSER_LARGE_EDITOR_CLASS, COMPOSER_LARGE_TEXT_WELL_CLASS, COMPOSER_LEADING_GROUP_CLASS, COMPOSER_PICKER_TRIGGER_CLASS, COMPOSER_PLACEHOLDER_CLASS, COMPOSER_SEND_BUTTON_CLASS, COMPOSER_TEXT_CLASS, ComposerPicker, ComposerStatusRow };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from "react";
|
|
2
|
+
//#region src/components/landing.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* A home screen's one shape: a greeting and a box in the upper fold, three
|
|
5
|
+
* columns of what the reader reaches from it below. The chat home and the
|
|
6
|
+
* law home render from these, so a reader who has learned one has learned
|
|
7
|
+
* the other, and the two cannot drift apart.
|
|
8
|
+
*/
|
|
9
|
+
type LandingLayoutProps = {
|
|
10
|
+
/** Header-slot actions that belong to the page rather than the fold. */
|
|
11
|
+
actions?: ReactNode | undefined;
|
|
12
|
+
/** The greeting and the box; centred in the upper fold. */
|
|
13
|
+
hero: ReactNode;
|
|
14
|
+
/** The columns; take the rest of the height, each scrolling on its own. */
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
/** Below the columns, in its own bounded scroll: crawlable navigation. */
|
|
17
|
+
footer?: ReactNode | undefined;
|
|
18
|
+
};
|
|
19
|
+
declare const LandingLayout: ({ actions, hero, children, footer }: LandingLayoutProps) => import("react").JSX.Element;
|
|
20
|
+
type LandingGreetingProps = {
|
|
21
|
+
/** The mark in the tile: the product mark, or the section's icon. */
|
|
22
|
+
icon: ReactNode;
|
|
23
|
+
/** The one line under the tile, as the page's heading. */
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
};
|
|
26
|
+
declare const LandingGreeting: ({ icon, children }: LandingGreetingProps) => import("react").JSX.Element;
|
|
27
|
+
/** A column's heading: an icon and an uppercase label, as a link or a trigger. */
|
|
28
|
+
declare const LANDING_SECTION_HEADING_CLASS = "text-muted-foreground hover:text-foreground focus-visible:ring-ring flex items-center gap-2 rounded-md px-1 text-xs font-semibold tracking-widest uppercase transition-colors outline-none focus-visible:ring-2";
|
|
29
|
+
/** A row of a column, as a link or a button. */
|
|
30
|
+
declare const LANDING_ROW_CLASS = "group hover:bg-accent/50 focus-visible:ring-ring rounded-md px-2 py-1.5 text-start transition-colors outline-none focus-visible:ring-2";
|
|
31
|
+
type LandingSectionProps = {
|
|
32
|
+
children: ReactNode;
|
|
33
|
+
heading: ReactNode;
|
|
34
|
+
};
|
|
35
|
+
/** A column: its heading stays put, its rows scroll beneath it. */
|
|
36
|
+
declare const LandingSection: ({ children, heading }: LandingSectionProps) => import("react").JSX.Element;
|
|
37
|
+
type LandingButtonProps = {
|
|
38
|
+
icon?: ReactElement;
|
|
39
|
+
meta?: ReactNode | undefined;
|
|
40
|
+
onClick: () => void;
|
|
41
|
+
title: ReactNode;
|
|
42
|
+
};
|
|
43
|
+
declare const LandingButton: ({ icon, meta, onClick, title }: LandingButtonProps) => import("react").JSX.Element;
|
|
44
|
+
type LandingItemTextProps = {
|
|
45
|
+
icon?: ReactElement;
|
|
46
|
+
iconTone?: "muted" | "matter" | undefined;
|
|
47
|
+
meta?: ReactNode | undefined;
|
|
48
|
+
title: ReactNode;
|
|
49
|
+
};
|
|
50
|
+
declare const LandingItemText: ({ icon, iconTone, meta, title }: LandingItemTextProps) => import("react").JSX.Element;
|
|
51
|
+
type LandingRowIconProps = {
|
|
52
|
+
children: ReactElement;
|
|
53
|
+
tone?: "muted" | "matter" | undefined;
|
|
54
|
+
};
|
|
55
|
+
declare const LandingRowIcon: ({ children, tone }: LandingRowIconProps) => import("react").JSX.Element;
|
|
56
|
+
type LandingEmptyProps = {
|
|
57
|
+
children: ReactNode;
|
|
58
|
+
};
|
|
59
|
+
declare const LandingEmpty: ({ children }: LandingEmptyProps) => import("react").JSX.Element;
|
|
60
|
+
//#endregion
|
|
61
|
+
export { LANDING_ROW_CLASS, LANDING_SECTION_HEADING_CLASS, LandingButton, LandingEmpty, LandingGreeting, LandingItemText, LandingLayout, LandingRowIcon, LandingSection };
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/utils.js";
|
|
3
|
+
import { ScrollArea } from "./scroll-area.js";
|
|
4
|
+
import { BidiText } from "./bidi-text.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/landing.tsx
|
|
7
|
+
const LandingLayout = ({ actions, hero, children, footer }) => /* @__PURE__ */ jsxs("div", {
|
|
8
|
+
className: "mx-auto flex h-full w-full max-w-5xl flex-1 flex-col overflow-hidden",
|
|
9
|
+
children: [actions, /* @__PURE__ */ jsxs("div", {
|
|
10
|
+
className: "@container flex min-h-0 flex-1 flex-col items-center overflow-hidden px-4",
|
|
11
|
+
children: [
|
|
12
|
+
/* @__PURE__ */ jsx(ScrollArea, {
|
|
13
|
+
className: "min-h-72 w-full max-w-2xl shrink basis-[22rem]",
|
|
14
|
+
scrollFade: true,
|
|
15
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
16
|
+
className: "flex min-h-full w-full flex-col items-center justify-center gap-8",
|
|
17
|
+
children: hero
|
|
18
|
+
})
|
|
19
|
+
}),
|
|
20
|
+
/* @__PURE__ */ jsx("div", {
|
|
21
|
+
className: "grid min-h-0 w-full flex-1 auto-rows-fr gap-8 pb-6 @2xl:grid-cols-3",
|
|
22
|
+
children
|
|
23
|
+
}),
|
|
24
|
+
footer !== void 0 && /* @__PURE__ */ jsx(ScrollArea, {
|
|
25
|
+
className: "h-auto max-h-[40vh] w-full shrink-0",
|
|
26
|
+
scrollFade: true,
|
|
27
|
+
children: footer
|
|
28
|
+
})
|
|
29
|
+
]
|
|
30
|
+
})]
|
|
31
|
+
});
|
|
32
|
+
const LandingGreeting = ({ icon, children }) => /* @__PURE__ */ jsxs("div", {
|
|
33
|
+
className: "flex w-full flex-col items-center gap-4 text-center",
|
|
34
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
35
|
+
className: "border-border bg-background text-foreground flex size-12 items-center justify-center rounded-lg border shadow-sm",
|
|
36
|
+
children: icon
|
|
37
|
+
}), /* @__PURE__ */ jsx("h1", {
|
|
38
|
+
className: "text-foreground max-w-md text-center text-lg font-medium",
|
|
39
|
+
children
|
|
40
|
+
})]
|
|
41
|
+
});
|
|
42
|
+
/** A column's heading: an icon and an uppercase label, as a link or a trigger. */
|
|
43
|
+
const LANDING_SECTION_HEADING_CLASS = "text-muted-foreground hover:text-foreground focus-visible:ring-ring flex items-center gap-2 rounded-md px-1 text-xs font-semibold tracking-widest uppercase transition-colors outline-none focus-visible:ring-2";
|
|
44
|
+
/** A row of a column, as a link or a button. */
|
|
45
|
+
const LANDING_ROW_CLASS = "group hover:bg-accent/50 focus-visible:ring-ring rounded-md px-2 py-1.5 text-start transition-colors outline-none focus-visible:ring-2";
|
|
46
|
+
/** A column: its heading stays put, its rows scroll beneath it. */
|
|
47
|
+
const LandingSection = ({ children, heading }) => /* @__PURE__ */ jsxs("section", {
|
|
48
|
+
className: "flex min-h-0 min-w-0 flex-col",
|
|
49
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
50
|
+
className: "mb-3 shrink-0",
|
|
51
|
+
children: heading
|
|
52
|
+
}), /* @__PURE__ */ jsx(ScrollArea, {
|
|
53
|
+
className: "min-h-0 flex-1",
|
|
54
|
+
scrollFade: true,
|
|
55
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
56
|
+
className: "flex flex-col gap-1 pb-4",
|
|
57
|
+
children
|
|
58
|
+
})
|
|
59
|
+
})]
|
|
60
|
+
});
|
|
61
|
+
const LandingButton = ({ icon, meta, onClick, title }) => /* @__PURE__ */ jsx("button", {
|
|
62
|
+
className: LANDING_ROW_CLASS,
|
|
63
|
+
onClick,
|
|
64
|
+
type: "button",
|
|
65
|
+
children: /* @__PURE__ */ jsx(LandingItemText, {
|
|
66
|
+
...icon === void 0 ? {} : { icon },
|
|
67
|
+
meta,
|
|
68
|
+
title
|
|
69
|
+
})
|
|
70
|
+
});
|
|
71
|
+
const LandingItemText = ({ icon, iconTone = "muted", meta, title }) => /* @__PURE__ */ jsxs("span", {
|
|
72
|
+
className: "flex min-w-0 items-start gap-2",
|
|
73
|
+
children: [icon !== void 0 && /* @__PURE__ */ jsx(LandingRowIcon, {
|
|
74
|
+
tone: iconTone,
|
|
75
|
+
children: icon
|
|
76
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
77
|
+
className: "min-w-0 flex-1",
|
|
78
|
+
children: [/* @__PURE__ */ jsx(BidiText, {
|
|
79
|
+
as: "span",
|
|
80
|
+
className: "text-foreground block truncate text-sm font-medium",
|
|
81
|
+
children: title
|
|
82
|
+
}), meta !== void 0 && meta !== null ? /* @__PURE__ */ jsx("span", {
|
|
83
|
+
className: "text-muted-foreground block truncate text-xs",
|
|
84
|
+
children: meta
|
|
85
|
+
}) : null]
|
|
86
|
+
})]
|
|
87
|
+
});
|
|
88
|
+
const LandingRowIcon = ({ children, tone = "muted" }) => /* @__PURE__ */ jsx("span", {
|
|
89
|
+
className: cn("mt-0.5 flex size-4 shrink-0 items-center justify-center transition-colors", tone === "muted" && "text-foreground-muted group-hover:text-muted-foreground"),
|
|
90
|
+
children
|
|
91
|
+
});
|
|
92
|
+
const LandingEmpty = ({ children }) => /* @__PURE__ */ jsx("div", {
|
|
93
|
+
className: "border-border text-muted-foreground rounded-md border border-dashed px-3 py-3 text-sm",
|
|
94
|
+
children
|
|
95
|
+
});
|
|
96
|
+
//#endregion
|
|
97
|
+
export { LANDING_ROW_CLASS, LANDING_SECTION_HEADING_CLASS, LandingButton, LandingEmpty, LandingGreeting, LandingItemText, LandingLayout, LandingRowIcon, LandingSection };
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { Button } from "./button.js";
|
|
2
|
+
import { Input } from "./input.js";
|
|
3
|
+
import { Separator } from "./separator.js";
|
|
4
|
+
import { TooltipContent as TooltipPopup } from "./tooltip.js";
|
|
5
|
+
import { VariantProps } from "class-variance-authority";
|
|
6
|
+
//#region src/components/sidebar.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Inline size the sidebar takes out of the layout row when expanded, in CSS
|
|
9
|
+
* pixels. Kept equal across the two rail-shaped primitives in this package:
|
|
10
|
+
* `SIDE_RAIL_WIDTH` (inspector) and `APPLICATION_RAIL_WIDTH` are both `w-12`
|
|
11
|
+
* (48px), the same as {@link SIDEBAR_WIDTH_ICON_PX} below, so a collapsed
|
|
12
|
+
* sidebar lines up with either rail.
|
|
13
|
+
*/
|
|
14
|
+
declare const SIDEBAR_WIDTH_PX = 256;
|
|
15
|
+
/** Inline size of the collapsed ("icon") rail, in CSS pixels. See above. */
|
|
16
|
+
declare const SIDEBAR_WIDTH_ICON_PX = 48;
|
|
17
|
+
type SidebarContextProps = {
|
|
18
|
+
state: "expanded" | "collapsed";
|
|
19
|
+
open: boolean;
|
|
20
|
+
setOpen: (open: boolean) => void;
|
|
21
|
+
openMobile: boolean;
|
|
22
|
+
setOpenMobile: (open: boolean) => void;
|
|
23
|
+
isMobile: boolean;
|
|
24
|
+
toggleSidebar: () => void;
|
|
25
|
+
};
|
|
26
|
+
declare function useSidebar(): SidebarContextProps;
|
|
27
|
+
/**
|
|
28
|
+
* Inline size the sidebar takes out of the layout row, in CSS pixels. Panes
|
|
29
|
+
* docked to the opposite edge need this to know how much room is actually
|
|
30
|
+
* left for the content column. Mobile reports 0: there the sidebar is an
|
|
31
|
+
* overlay sheet and occupies no layout width.
|
|
32
|
+
*/
|
|
33
|
+
declare function useSidebarInlineSize(): 0 | 256 | 48;
|
|
34
|
+
declare const SidebarProvider: ({ defaultOpen, forceCollapsed, open: openProp, onOpenChange: setOpenProp, className, style, children, ...props }: React.ComponentProps<"div"> & {
|
|
35
|
+
defaultOpen?: boolean;
|
|
36
|
+
forceCollapsed?: boolean;
|
|
37
|
+
open?: boolean;
|
|
38
|
+
onOpenChange?: (open: boolean) => void;
|
|
39
|
+
}) => import("react").JSX.Element;
|
|
40
|
+
declare const Sidebar: ({ side, variant, collapsible, mobileTitle, mobileDescription, className, children, ...props }: React.ComponentProps<"div"> & {
|
|
41
|
+
/**
|
|
42
|
+
* Which edge the sidebar docks to. Despite the physical name, this is
|
|
43
|
+
* applied as a *logical* position: `"left"` docks at the CSS inline-start
|
|
44
|
+
* edge and `"right"` docks at the inline-end edge (see the `start-0` /
|
|
45
|
+
* `end-0` classes below, keyed off `data-side`). Under `dir="rtl"` a
|
|
46
|
+
* `side="left"` sidebar therefore renders on the visual right, mirroring
|
|
47
|
+
* the reading direction rather than a fixed screen edge. `SidebarRail`
|
|
48
|
+
* derives its content-facing offset from `data-side` using the same
|
|
49
|
+
* left→end / right→start mapping so it keeps tracking the boundary
|
|
50
|
+
* between the sidebar and the content pane in both directions.
|
|
51
|
+
*/
|
|
52
|
+
side?: "left" | "right";
|
|
53
|
+
variant?: "sidebar" | "floating" | "inset";
|
|
54
|
+
collapsible?: "offcanvas" | "icon" | "none";
|
|
55
|
+
/** Screen-reader title for the mobile sheet. Override to localize. */
|
|
56
|
+
mobileTitle?: string;
|
|
57
|
+
/** Screen-reader description for the mobile sheet. Override to localize. */
|
|
58
|
+
mobileDescription?: string;
|
|
59
|
+
}) => import("react").JSX.Element;
|
|
60
|
+
declare const SidebarTrigger: ({ className, onClick, label, "aria-label": ariaLabel, ...props }: React.ComponentProps<typeof Button> & {
|
|
61
|
+
/** Accessible name for the trigger. Override to localize. */
|
|
62
|
+
label?: string;
|
|
63
|
+
}) => import("react").JSX.Element;
|
|
64
|
+
declare const SidebarRail: ({ className, label, "aria-label": ariaLabel, ...props }: React.ComponentProps<"button"> & {
|
|
65
|
+
/** Accessible name for the rail. Override to localize. */
|
|
66
|
+
label?: string;
|
|
67
|
+
}) => import("react").JSX.Element;
|
|
68
|
+
declare const SidebarInset: ({ className, ...props }: React.ComponentProps<"main">) => import("react").JSX.Element;
|
|
69
|
+
declare const SidebarInput: ({ className, ...props }: React.ComponentProps<typeof Input>) => import("react").JSX.Element;
|
|
70
|
+
declare const SidebarHeader: ({ className, ...props }: React.ComponentProps<"div">) => import("react").JSX.Element;
|
|
71
|
+
declare const SidebarFooter: ({ className, ...props }: React.ComponentProps<"div">) => import("react").JSX.Element;
|
|
72
|
+
declare const SidebarSeparator: ({ className, ...props }: React.ComponentProps<typeof Separator>) => import("react").JSX.Element;
|
|
73
|
+
declare const SidebarContent: ({ className, ...props }: React.ComponentProps<"div">) => import("react").JSX.Element;
|
|
74
|
+
declare const SidebarGroup: ({ className, ...props }: React.ComponentProps<"div">) => import("react").JSX.Element;
|
|
75
|
+
declare const SidebarGroupLabel: ({ className, asChild, ...props }: React.ComponentProps<"div"> & {
|
|
76
|
+
asChild?: boolean;
|
|
77
|
+
}) => import("react").JSX.Element;
|
|
78
|
+
declare const SidebarGroupAction: ({ className, asChild, ...props }: React.ComponentProps<"button"> & {
|
|
79
|
+
asChild?: boolean;
|
|
80
|
+
}) => import("react").JSX.Element;
|
|
81
|
+
declare const SidebarGroupContent: ({ className, ...props }: React.ComponentProps<"div">) => import("react").JSX.Element;
|
|
82
|
+
declare const SidebarMenu: ({ className, ...props }: React.ComponentProps<"ul">) => import("react").JSX.Element;
|
|
83
|
+
declare const SidebarMenuItem: ({ className, ...props }: React.ComponentProps<"li">) => import("react").JSX.Element;
|
|
84
|
+
declare const sidebarMenuButtonVariants: (props?: ({
|
|
85
|
+
variant?: "outline" | "default" | null | undefined;
|
|
86
|
+
size?: "sm" | "default" | "lg" | "rail" | null | undefined;
|
|
87
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
88
|
+
declare const SidebarMenuButton: ({ asChild, isActive, variant, size, tooltip, className, ...props }: React.ComponentProps<"button"> & {
|
|
89
|
+
asChild?: boolean;
|
|
90
|
+
isActive?: boolean;
|
|
91
|
+
tooltip?: string | React.ComponentProps<typeof TooltipPopup>;
|
|
92
|
+
} & VariantProps<typeof sidebarMenuButtonVariants>) => import("react").JSX.Element;
|
|
93
|
+
declare const SidebarMenuAction: ({ className, asChild, showOnHover, ...props }: React.ComponentProps<"button"> & {
|
|
94
|
+
asChild?: boolean;
|
|
95
|
+
showOnHover?: boolean;
|
|
96
|
+
}) => import("react").JSX.Element;
|
|
97
|
+
declare const SidebarMenuBadge: ({ className, ...props }: React.ComponentProps<"div">) => import("react").JSX.Element;
|
|
98
|
+
declare const SidebarMenuSkeleton: ({ className, showIcon, ...props }: React.ComponentProps<"div"> & {
|
|
99
|
+
showIcon?: boolean;
|
|
100
|
+
}) => import("react").JSX.Element;
|
|
101
|
+
declare const SidebarMenuSub: ({ className, ...props }: React.ComponentProps<"ul">) => import("react").JSX.Element;
|
|
102
|
+
declare const SidebarMenuSubItem: ({ className, ...props }: React.ComponentProps<"li">) => import("react").JSX.Element;
|
|
103
|
+
declare const SidebarMenuSubButton: ({ asChild, size, isActive, className, ...props }: React.ComponentProps<"a"> & {
|
|
104
|
+
asChild?: boolean;
|
|
105
|
+
size?: "sm" | "md";
|
|
106
|
+
isActive?: boolean;
|
|
107
|
+
}) => import("react").JSX.Element;
|
|
108
|
+
//#endregion
|
|
109
|
+
export { SIDEBAR_WIDTH_ICON_PX, SIDEBAR_WIDTH_PX, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar, useSidebarInlineSize };
|