@nocoo/basalt 2.0.0-rc.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.
- package/LICENSE +21 -0
- package/README.md +41 -0
- package/dist/charts/area.d.ts +8 -0
- package/dist/charts/area.js +55 -0
- package/dist/charts/area.js.map +1 -0
- package/dist/charts/bar.d.ts +9 -0
- package/dist/charts/bar.js +42 -0
- package/dist/charts/bar.js.map +1 -0
- package/dist/charts/bullet.d.ts +8 -0
- package/dist/charts/bullet.js +50 -0
- package/dist/charts/bullet.js.map +1 -0
- package/dist/charts/chart-colors.d.ts +1 -0
- package/dist/charts/chart-colors.js +3 -0
- package/dist/charts/charts.d.ts +6 -0
- package/dist/charts/charts.js +15 -0
- package/dist/charts/charts.js.map +1 -0
- package/dist/charts/config.d.ts +117 -0
- package/dist/charts/config.js +117 -0
- package/dist/charts/config.js.map +1 -0
- package/dist/charts/custom-chart.d.ts +6 -0
- package/dist/charts/custom-chart.js +15 -0
- package/dist/charts/custom-chart.js.map +1 -0
- package/dist/charts/date-navigation.d.ts +22 -0
- package/dist/charts/date-navigation.js +122 -0
- package/dist/charts/date-navigation.js.map +1 -0
- package/dist/charts/donut.d.ts +8 -0
- package/dist/charts/donut.js +36 -0
- package/dist/charts/donut.js.map +1 -0
- package/dist/charts/frame.d.ts +9 -0
- package/dist/charts/frame.js +22 -0
- package/dist/charts/frame.js.map +1 -0
- package/dist/charts/funnel.d.ts +7 -0
- package/dist/charts/funnel.js +35 -0
- package/dist/charts/funnel.js.map +1 -0
- package/dist/charts/gauge.d.ts +8 -0
- package/dist/charts/gauge.js +46 -0
- package/dist/charts/gauge.js.map +1 -0
- package/dist/charts/grouped-bar.d.ts +7 -0
- package/dist/charts/grouped-bar.js +42 -0
- package/dist/charts/grouped-bar.js.map +1 -0
- package/dist/charts/heatmap-calendar.d.ts +27 -0
- package/dist/charts/heatmap-calendar.js +200 -0
- package/dist/charts/heatmap-calendar.js.map +1 -0
- package/dist/charts/item-list.d.ts +9 -0
- package/dist/charts/item-list.js +22 -0
- package/dist/charts/item-list.js.map +1 -0
- package/dist/charts/line.d.ts +9 -0
- package/dist/charts/line.js +58 -0
- package/dist/charts/line.js.map +1 -0
- package/dist/charts/palette.d.ts +33 -0
- package/dist/charts/palette.js +44 -0
- package/dist/charts/palette.js.map +1 -0
- package/dist/charts/radar.d.ts +6 -0
- package/dist/charts/radar.js +37 -0
- package/dist/charts/radar.js.map +1 -0
- package/dist/charts/sample.d.ts +42 -0
- package/dist/charts/sample.js +124 -0
- package/dist/charts/sample.js.map +1 -0
- package/dist/charts/sankey.d.ts +6 -0
- package/dist/charts/sankey.js +51 -0
- package/dist/charts/sankey.js.map +1 -0
- package/dist/charts/slot-bar.d.ts +15 -0
- package/dist/charts/slot-bar.js +80 -0
- package/dist/charts/slot-bar.js.map +1 -0
- package/dist/charts/sparkline.d.ts +6 -0
- package/dist/charts/sparkline.js +29 -0
- package/dist/charts/sparkline.js.map +1 -0
- package/dist/charts/stacked-bar.d.ts +7 -0
- package/dist/charts/stacked-bar.js +51 -0
- package/dist/charts/stacked-bar.js.map +1 -0
- package/dist/charts/stat-card.d.ts +21 -0
- package/dist/charts/stat-card.js +66 -0
- package/dist/charts/stat-card.js.map +1 -0
- package/dist/charts/timeline.d.ts +17 -0
- package/dist/charts/timeline.js +79 -0
- package/dist/charts/timeline.js.map +1 -0
- package/dist/charts/timeseries.d.ts +6 -0
- package/dist/charts/timeseries.js +15 -0
- package/dist/charts/timeseries.js.map +1 -0
- package/dist/components/accordion.d.ts +6 -0
- package/dist/components/accordion.js +21 -0
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/alert-dialog.d.ts +25 -0
- package/dist/components/alert-dialog.js +61 -0
- package/dist/components/alert-dialog.js.map +1 -0
- package/dist/components/app-header.d.ts +10 -0
- package/dist/components/app-header.js +35 -0
- package/dist/components/app-header.js.map +1 -0
- package/dist/components/app-shell.d.ts +4 -0
- package/dist/components/app-shell.js +29 -0
- package/dist/components/app-shell.js.map +1 -0
- package/dist/components/autocomplete.d.ts +47 -0
- package/dist/components/autocomplete.js +28 -0
- package/dist/components/autocomplete.js.map +1 -0
- package/dist/components/avatar.d.ts +5 -0
- package/dist/components/avatar.js +28 -0
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/badge.d.ts +10 -0
- package/dist/components/badge.js +37 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/banner.d.ts +22 -0
- package/dist/components/banner.js +88 -0
- package/dist/components/banner.js.map +1 -0
- package/dist/components/basalt-mark.d.ts +8 -0
- package/dist/components/basalt-mark.js +17 -0
- package/dist/components/basalt-mark.js.map +1 -0
- package/dist/components/breadcrumbs.d.ts +9 -0
- package/dist/components/breadcrumbs.js +38 -0
- package/dist/components/breadcrumbs.js.map +1 -0
- package/dist/components/button.d.ts +17 -0
- package/dist/components/button.js +73 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/checkbox.d.ts +86 -0
- package/dist/components/checkbox.js +107 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/clipboard-text.d.ts +5 -0
- package/dist/components/clipboard-text.js +33 -0
- package/dist/components/clipboard-text.js.map +1 -0
- package/dist/components/code.d.ts +26 -0
- package/dist/components/code.js +45 -0
- package/dist/components/code.js.map +1 -0
- package/dist/components/collapsible.d.ts +33 -0
- package/dist/components/collapsible.js +38 -0
- package/dist/components/collapsible.js.map +1 -0
- package/dist/components/combobox.d.ts +47 -0
- package/dist/components/combobox.js +28 -0
- package/dist/components/combobox.js.map +1 -0
- package/dist/components/command-palette.d.ts +83 -0
- package/dist/components/command-palette.js +90 -0
- package/dist/components/command-palette.js.map +1 -0
- package/dist/components/confirm-dialog.d.ts +52 -0
- package/dist/components/confirm-dialog.js +61 -0
- package/dist/components/confirm-dialog.js.map +1 -0
- package/dist/components/context-menu.d.ts +7 -0
- package/dist/components/context-menu.js +23 -0
- package/dist/components/context-menu.js.map +1 -0
- package/dist/components/data-table.d.ts +76 -0
- package/dist/components/data-table.js +230 -0
- package/dist/components/data-table.js.map +1 -0
- package/dist/components/date-picker.d.ts +90 -0
- package/dist/components/date-picker.js +452 -0
- package/dist/components/date-picker.js.map +1 -0
- package/dist/components/dialog.d.ts +37 -0
- package/dist/components/dialog.js +67 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/dropdown-menu.d.ts +38 -0
- package/dist/components/dropdown-menu.js +24 -0
- package/dist/components/dropdown-menu.js.map +1 -0
- package/dist/components/empty.d.ts +6 -0
- package/dist/components/empty.js +28 -0
- package/dist/components/empty.js.map +1 -0
- package/dist/components/field.d.ts +39 -0
- package/dist/components/field.js +52 -0
- package/dist/components/field.js.map +1 -0
- package/dist/components/flow.d.ts +24 -0
- package/dist/components/flow.js +56 -0
- package/dist/components/flow.js.map +1 -0
- package/dist/components/grid.d.ts +15 -0
- package/dist/components/grid.js +24 -0
- package/dist/components/grid.js.map +1 -0
- package/dist/components/hover-card.d.ts +5 -0
- package/dist/components/hover-card.js +18 -0
- package/dist/components/hover-card.js.map +1 -0
- package/dist/components/input-area.d.ts +19 -0
- package/dist/components/input-area.js +27 -0
- package/dist/components/input-area.js.map +1 -0
- package/dist/components/input-group.d.ts +70 -0
- package/dist/components/input-group.js +78 -0
- package/dist/components/input-group.js.map +1 -0
- package/dist/components/input.d.ts +19 -0
- package/dist/components/input.js +28 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/label.d.ts +20 -0
- package/dist/components/label.js +34 -0
- package/dist/components/label.js.map +1 -0
- package/dist/components/layer-card.d.ts +69 -0
- package/dist/components/layer-card.js +104 -0
- package/dist/components/layer-card.js.map +1 -0
- package/dist/components/link.d.ts +8 -0
- package/dist/components/link.js +18 -0
- package/dist/components/link.js.map +1 -0
- package/dist/components/loader.d.ts +4 -0
- package/dist/components/loader.js +66 -0
- package/dist/components/loader.js.map +1 -0
- package/dist/components/loading-screen.d.ts +5 -0
- package/dist/components/loading-screen.js +24 -0
- package/dist/components/loading-screen.js.map +1 -0
- package/dist/components/menu-bar.d.ts +8 -0
- package/dist/components/menu-bar.js +42 -0
- package/dist/components/menu-bar.js.map +1 -0
- package/dist/components/meter.d.ts +8 -0
- package/dist/components/meter.js +26 -0
- package/dist/components/meter.js.map +1 -0
- package/dist/components/navigation-menu.d.ts +6 -0
- package/dist/components/navigation-menu.js +16 -0
- package/dist/components/navigation-menu.js.map +1 -0
- package/dist/components/overlay.d.ts +16 -0
- package/dist/components/overlay.js +14 -0
- package/dist/components/overlay.js.map +1 -0
- package/dist/components/page-header.d.ts +19 -0
- package/dist/components/page-header.js +43 -0
- package/dist/components/page-header.js.map +1 -0
- package/dist/components/pagination.d.ts +35 -0
- package/dist/components/pagination.js +68 -0
- package/dist/components/pagination.js.map +1 -0
- package/dist/components/popover.d.ts +38 -0
- package/dist/components/popover.js +65 -0
- package/dist/components/popover.js.map +1 -0
- package/dist/components/radio.d.ts +108 -0
- package/dist/components/radio.js +80 -0
- package/dist/components/radio.js.map +1 -0
- package/dist/components/scroll-area.d.ts +15 -0
- package/dist/components/scroll-area.js +49 -0
- package/dist/components/scroll-area.js.map +1 -0
- package/dist/components/segment-control.d.ts +35 -0
- package/dist/components/segment-control.js +46 -0
- package/dist/components/segment-control.js.map +1 -0
- package/dist/components/select.d.ts +99 -0
- package/dist/components/select.js +51 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/sensitive-input.d.ts +23 -0
- package/dist/components/sensitive-input.js +43 -0
- package/dist/components/sensitive-input.js.map +1 -0
- package/dist/components/separator.d.ts +26 -0
- package/dist/components/separator.js +18 -0
- package/dist/components/separator.js.map +1 -0
- package/dist/components/sheet.d.ts +26 -0
- package/dist/components/sheet.js +49 -0
- package/dist/components/sheet.js.map +1 -0
- package/dist/components/sidebar.d.ts +101 -0
- package/dist/components/sidebar.js +260 -0
- package/dist/components/sidebar.js.map +1 -0
- package/dist/components/skeleton-line.d.ts +6 -0
- package/dist/components/skeleton-line.js +22 -0
- package/dist/components/skeleton-line.js.map +1 -0
- package/dist/components/slider.d.ts +3 -0
- package/dist/components/slider.js +21 -0
- package/dist/components/slider.js.map +1 -0
- package/dist/components/stat-strip.d.ts +19 -0
- package/dist/components/stat-strip.js +27 -0
- package/dist/components/stat-strip.js.map +1 -0
- package/dist/components/switch.d.ts +85 -0
- package/dist/components/switch.js +94 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/table-of-contents.d.ts +33 -0
- package/dist/components/table-of-contents.js +37 -0
- package/dist/components/table-of-contents.js.map +1 -0
- package/dist/components/table-pager.d.ts +26 -0
- package/dist/components/table-pager.js +35 -0
- package/dist/components/table-pager.js.map +1 -0
- package/dist/components/table.d.ts +45 -0
- package/dist/components/table.js +32 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/tabs.d.ts +65 -0
- package/dist/components/tabs.js +56 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/text.d.ts +32 -0
- package/dist/components/text.js +46 -0
- package/dist/components/text.js.map +1 -0
- package/dist/components/theme-toggle.d.ts +7 -0
- package/dist/components/theme-toggle.js +28 -0
- package/dist/components/theme-toggle.js.map +1 -0
- package/dist/components/toast.d.ts +27 -0
- package/dist/components/toast.js +78 -0
- package/dist/components/toast.js.map +1 -0
- package/dist/components/toggle-group.d.ts +4 -0
- package/dist/components/toggle-group.js +48 -0
- package/dist/components/toggle-group.js.map +1 -0
- package/dist/components/toggle.d.ts +7 -0
- package/dist/components/toggle.js +37 -0
- package/dist/components/toggle.js.map +1 -0
- package/dist/components/toolbar.d.ts +58 -0
- package/dist/components/toolbar.js +76 -0
- package/dist/components/toolbar.js.map +1 -0
- package/dist/components/tooltip.d.ts +13 -0
- package/dist/components/tooltip.js +18 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/components/typeahead-field.d.ts +24 -0
- package/dist/components/typeahead-field.js +177 -0
- package/dist/components/typeahead-field.js.map +1 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +35 -0
- package/dist/providers/link.d.ts +12 -0
- package/dist/providers/link.js +18 -0
- package/dist/providers/link.js.map +1 -0
- package/dist/providers/theme.d.ts +11 -0
- package/dist/providers/theme.js +43 -0
- package/dist/providers/theme.js.map +1 -0
- package/dist/styles/standalone.css +2233 -0
- package/dist/styles/tailwind.css +103 -0
- package/dist/styles/tokens.css +277 -0
- package/dist/utils/cn.d.ts +2 -0
- package/dist/utils/cn.js +11 -0
- package/dist/utils/cn.js.map +1 -0
- package/dist/utils/control-surface.d.ts +2 -0
- package/dist/utils/control-surface.js +11 -0
- package/dist/utils/control-surface.js.map +1 -0
- package/dist/utils/selection-indicator.d.ts +24 -0
- package/dist/utils/selection-indicator.js +108 -0
- package/dist/utils/selection-indicator.js.map +1 -0
- package/package.json +107 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../utils/cn.js";
|
|
3
|
+
import { ToggleGroup as t, ToggleGroupItem as n } from "./toggle-group.js";
|
|
4
|
+
import * as r from "react";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/segment-control.tsx
|
|
7
|
+
var o = r.forwardRef(({ allOption: o, className: s, disabled: c = !1, legend: l, onValueChange: u, options: d, value: f, ...p }, m) => {
|
|
8
|
+
let h = r.useId(), g = o ? [{
|
|
9
|
+
...o,
|
|
10
|
+
label: o.label ?? "All"
|
|
11
|
+
}, ...d] : d;
|
|
12
|
+
return /* @__PURE__ */ a("fieldset", {
|
|
13
|
+
ref: m,
|
|
14
|
+
disabled: c,
|
|
15
|
+
className: e("min-w-0 border-0 p-0", s),
|
|
16
|
+
...p,
|
|
17
|
+
children: [/* @__PURE__ */ i("legend", {
|
|
18
|
+
id: h,
|
|
19
|
+
className: "mb-2 block text-xs font-medium text-basalt-muted-foreground",
|
|
20
|
+
children: l
|
|
21
|
+
}), /* @__PURE__ */ i("div", {
|
|
22
|
+
"data-slot": "segment-control-viewport",
|
|
23
|
+
className: "max-w-full overflow-x-auto pb-1",
|
|
24
|
+
children: /* @__PURE__ */ i(t, {
|
|
25
|
+
type: "single",
|
|
26
|
+
value: f,
|
|
27
|
+
disabled: c,
|
|
28
|
+
onValueChange: (e) => {
|
|
29
|
+
e && u(e);
|
|
30
|
+
},
|
|
31
|
+
"aria-labelledby": h,
|
|
32
|
+
className: "w-max",
|
|
33
|
+
children: g.map((e) => /* @__PURE__ */ i(n, {
|
|
34
|
+
value: e.value,
|
|
35
|
+
disabled: e.disabled,
|
|
36
|
+
children: e.label
|
|
37
|
+
}, e.value))
|
|
38
|
+
})
|
|
39
|
+
})]
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
o.displayName = "SegmentControl";
|
|
43
|
+
//#endregion
|
|
44
|
+
export { o as SegmentControl };
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=segment-control.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segment-control.js","names":[],"sources":["../../src/components/segment-control.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { ToggleGroup, ToggleGroupItem } from \"./toggle-group\";\n\nexport interface SegmentControlOption {\n\t/** The value selected when this segment is activated. */\n\tvalue: string;\n\t/** The visible label for the segment. */\n\tlabel: React.ReactNode;\n\t/** Disable only this segment. */\n\tdisabled?: boolean;\n}\n\nexport interface SegmentControlAllOption {\n\t/** The value representing the unfiltered selection. */\n\tvalue: string;\n\t/** The visible label for the leading segment. */\n\tlabel?: React.ReactNode;\n\t/** Disable only the leading segment. */\n\tdisabled?: boolean;\n}\n\nexport interface SegmentControlProps\n\textends Omit<React.HTMLAttributes<HTMLFieldSetElement>, \"children\" | \"onChange\"> {\n\t/** The currently selected value. */\n\tvalue: string;\n\t/** Called when the user selects a different segment. */\n\tonValueChange: (value: string) => void;\n\t/** The visible legend that names the control. */\n\tlegend: React.ReactNode;\n\t/** The selectable segments shown after the optional All segment. */\n\toptions: readonly SegmentControlOption[];\n\t/** Add a leading unfiltered segment, labelled All by default. */\n\tallOption?: SegmentControlAllOption;\n\t/**\n\t * Disable every segment.\n\t * @default false\n\t */\n\tdisabled?: boolean;\n}\n\nexport const SegmentControl = React.forwardRef<HTMLFieldSetElement, SegmentControlProps>(\n\t(\n\t\t{ allOption, className, disabled = false, legend, onValueChange, options, value, ...props },\n\t\tref,\n\t) => {\n\t\tconst legendId = React.useId();\n\t\tconst items: readonly SegmentControlOption[] = allOption\n\t\t\t? [{ ...allOption, label: allOption.label ?? \"All\" }, ...options]\n\t\t\t: options;\n\n\t\treturn (\n\t\t\t<fieldset\n\t\t\t\tref={ref}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tclassName={cn(\"min-w-0 border-0 p-0\", className)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t<legend\n\t\t\t\t\tid={legendId}\n\t\t\t\t\tclassName=\"mb-2 block text-xs font-medium text-basalt-muted-foreground\"\n\t\t\t\t>\n\t\t\t\t\t{legend}\n\t\t\t\t</legend>\n\t\t\t\t<div data-slot=\"segment-control-viewport\" className=\"max-w-full overflow-x-auto pb-1\">\n\t\t\t\t\t<ToggleGroup\n\t\t\t\t\t\ttype=\"single\"\n\t\t\t\t\t\tvalue={value}\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tonValueChange={(nextValue) => {\n\t\t\t\t\t\t\tif (nextValue) {\n\t\t\t\t\t\t\t\tonValueChange(nextValue);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}}\n\t\t\t\t\t\taria-labelledby={legendId}\n\t\t\t\t\t\tclassName=\"w-max\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{items.map((item) => (\n\t\t\t\t\t\t\t<ToggleGroupItem key={item.value} value={item.value} disabled={item.disabled}>\n\t\t\t\t\t\t\t\t{item.label}\n\t\t\t\t\t\t\t</ToggleGroupItem>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</ToggleGroup>\n\t\t\t\t</div>\n\t\t\t</fieldset>\n\t\t);\n\t},\n);\nSegmentControl.displayName = \"SegmentControl\";\n"],"mappings":";;;;;;AAyCA,IAAa,IAAiB,EAAM,YAElC,EAAE,cAAW,cAAW,cAAW,IAAO,WAAQ,kBAAe,YAAS,UAAO,GAAG,KACpF,MACI;CACJ,IAAM,IAAW,EAAM,MAAM,GACvB,IAAyC,IAC5C,CAAC;EAAE,GAAG;EAAW,OAAO,EAAU,SAAS;CAAM,GAAG,GAAG,CAAO,IAC9D;CAEH,OACC,kBAAC,YAAD;EACM;EACK;EACV,WAAW,EAAG,wBAAwB,CAAS;EAC/C,GAAI;EAJL,UAAA,CAMC,kBAAC,UAAD;GACC,IAAI;GACJ,WAAU;GAET,UAAA;EACM,CAAA,GACR,kBAAC,OAAD;GAAK,aAAU;GAA2B,WAAU;GACnD,UAAA,kBAAC,GAAD;IACC,MAAK;IACE;IACG;IACV,gBAAgB,MAAc;KAC7B,AAAI,KACH,EAAc,CAAS;IAEzB;IACA,mBAAiB;IACjB,WAAU;IAET,UAAA,EAAM,KAAK,MACX,kBAAC,GAAD;KAAkC,OAAO,EAAK;KAAO,UAAU,EAAK;KAClE,UAAA,EAAK;IACU,GAFK,EAAK,KAEV,CACjB;GACW,CAAA;EACT,CAAA,CACI;;AAEZ,CACD;AACA,EAAe,cAAc"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export type SelectProps = Omit<React.ComponentPropsWithoutRef<typeof SelectPrimitive.Root>, "value" | "defaultValue" | "onValueChange"> & {
|
|
4
|
+
/**
|
|
5
|
+
* The controlled value of the select.
|
|
6
|
+
*/
|
|
7
|
+
value?: string;
|
|
8
|
+
/**
|
|
9
|
+
* The uncontrolled initial value of the select.
|
|
10
|
+
*/
|
|
11
|
+
defaultValue?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Called when the selected value changes.
|
|
14
|
+
*/
|
|
15
|
+
onValueChange?: (value: string) => void;
|
|
16
|
+
};
|
|
17
|
+
export declare const Select: React.FC<SelectProps>;
|
|
18
|
+
export type SelectValueProps = Omit<React.ComponentPropsWithoutRef<typeof SelectPrimitive.Value>, "placeholder"> & {
|
|
19
|
+
/**
|
|
20
|
+
* Content shown when no value is selected.
|
|
21
|
+
*/
|
|
22
|
+
placeholder?: React.ReactNode;
|
|
23
|
+
};
|
|
24
|
+
export declare const SelectValue: React.ForwardRefExoticComponent<SelectValueProps & React.RefAttributes<React.ElementRef<typeof SelectPrimitive.Value>>>;
|
|
25
|
+
export type SelectGroupProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Group>;
|
|
26
|
+
export declare const SelectGroup: React.ForwardRefExoticComponent<SelectGroupProps & React.RefAttributes<React.ElementRef<typeof SelectPrimitive.Group>>>;
|
|
27
|
+
export type SelectSize = "sm" | "default" | "lg";
|
|
28
|
+
export type SelectTriggerProps = Omit<React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>, "disabled"> & {
|
|
29
|
+
/**
|
|
30
|
+
* The visual size of the trigger.
|
|
31
|
+
* @default default
|
|
32
|
+
*/
|
|
33
|
+
size?: SelectSize;
|
|
34
|
+
/**
|
|
35
|
+
* Disable the trigger and mark it busy.
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
38
|
+
loading?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Disable the trigger.
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
43
|
+
disabled?: boolean;
|
|
44
|
+
};
|
|
45
|
+
export declare const SelectTrigger: React.ForwardRefExoticComponent<Omit<Omit<SelectPrimitive.SelectTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref">, "disabled"> & {
|
|
46
|
+
/**
|
|
47
|
+
* The visual size of the trigger.
|
|
48
|
+
* @default default
|
|
49
|
+
*/
|
|
50
|
+
size?: SelectSize;
|
|
51
|
+
/**
|
|
52
|
+
* Disable the trigger and mark it busy.
|
|
53
|
+
* @default false
|
|
54
|
+
*/
|
|
55
|
+
loading?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Disable the trigger.
|
|
58
|
+
* @default false
|
|
59
|
+
*/
|
|
60
|
+
disabled?: boolean;
|
|
61
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
62
|
+
export type SelectLabelProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>;
|
|
63
|
+
export declare const SelectLabel: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
64
|
+
export type SelectContentProps = Omit<React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>, "position" | "sideOffset"> & {
|
|
65
|
+
/**
|
|
66
|
+
* The positioning mode for the select content.
|
|
67
|
+
* @default popper
|
|
68
|
+
*/
|
|
69
|
+
position?: "item-aligned" | "popper";
|
|
70
|
+
/**
|
|
71
|
+
* The distance between the trigger and the select content.
|
|
72
|
+
* @default 4
|
|
73
|
+
*/
|
|
74
|
+
sideOffset?: number;
|
|
75
|
+
};
|
|
76
|
+
export declare const SelectContent: React.ForwardRefExoticComponent<Omit<Omit<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>, "ref">, "position" | "sideOffset"> & {
|
|
77
|
+
/**
|
|
78
|
+
* The positioning mode for the select content.
|
|
79
|
+
* @default popper
|
|
80
|
+
*/
|
|
81
|
+
position?: "item-aligned" | "popper";
|
|
82
|
+
/**
|
|
83
|
+
* The distance between the trigger and the select content.
|
|
84
|
+
* @default 4
|
|
85
|
+
*/
|
|
86
|
+
sideOffset?: number;
|
|
87
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
88
|
+
export type SelectItemProps = Omit<React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>, "value"> & {
|
|
89
|
+
/**
|
|
90
|
+
* The value associated with the select item.
|
|
91
|
+
*/
|
|
92
|
+
value: string;
|
|
93
|
+
};
|
|
94
|
+
export declare const SelectItem: React.ForwardRefExoticComponent<Omit<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref">, "value"> & {
|
|
95
|
+
/**
|
|
96
|
+
* The value associated with the select item.
|
|
97
|
+
*/
|
|
98
|
+
value: string;
|
|
99
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../utils/cn.js";
|
|
3
|
+
import { FOCUS_BORDER as t, overlayItemClass as n, overlayPanelClass as r } from "./overlay.js";
|
|
4
|
+
import { controlSurfaceClass as i } from "../utils/control-surface.js";
|
|
5
|
+
import * as a from "react";
|
|
6
|
+
import { Check as o, ChevronDown as s } from "lucide-react";
|
|
7
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
8
|
+
import * as u from "@radix-ui/react-select";
|
|
9
|
+
//#region src/components/select.tsx
|
|
10
|
+
var d = u.Root, f = u.Value, p = u.Group, m = {
|
|
11
|
+
sm: "h-8 px-2.5 text-xs",
|
|
12
|
+
default: "h-9 px-3 text-sm",
|
|
13
|
+
lg: "h-10 px-4 text-base"
|
|
14
|
+
}, h = a.forwardRef(({ className: n, children: r, size: a = "default", loading: o = !1, disabled: d = !1, ...f }, p) => /* @__PURE__ */ l(u.Trigger, {
|
|
15
|
+
ref: p,
|
|
16
|
+
...f,
|
|
17
|
+
disabled: d || o,
|
|
18
|
+
"aria-busy": o || void 0,
|
|
19
|
+
className: i(e("flex w-full items-center justify-between", m[a], t, "aria-invalid:border-basalt-destructive aria-invalid:focus-visible:border-basalt-destructive", n)),
|
|
20
|
+
children: [r, /* @__PURE__ */ c(s, { className: "h-4 w-4 opacity-50" })]
|
|
21
|
+
}));
|
|
22
|
+
h.displayName = u.Trigger.displayName;
|
|
23
|
+
var g = a.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ c(u.Label, {
|
|
24
|
+
ref: r,
|
|
25
|
+
className: e("px-2 py-1.5 text-xs text-basalt-muted-foreground", t),
|
|
26
|
+
...n
|
|
27
|
+
}));
|
|
28
|
+
g.displayName = u.Label.displayName;
|
|
29
|
+
var _ = a.forwardRef(({ className: t, children: n, position: i = "popper", sideOffset: a = 4, ...o }, s) => /* @__PURE__ */ c(u.Portal, { children: /* @__PURE__ */ c(u.Content, {
|
|
30
|
+
ref: s,
|
|
31
|
+
position: i,
|
|
32
|
+
sideOffset: a,
|
|
33
|
+
className: r(e(i === "popper" && "w-[var(--radix-select-trigger-width)]", t)),
|
|
34
|
+
...o,
|
|
35
|
+
children: /* @__PURE__ */ c(u.Viewport, { children: n })
|
|
36
|
+
}) }));
|
|
37
|
+
_.displayName = u.Content.displayName;
|
|
38
|
+
var v = a.forwardRef(({ className: t, children: r, ...i }, a) => /* @__PURE__ */ l(u.Item, {
|
|
39
|
+
ref: a,
|
|
40
|
+
className: n(e("relative pr-8 outline-hidden hover:bg-basalt-accent focus-visible:bg-basalt-accent data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[disabled]:hover:bg-transparent", t)),
|
|
41
|
+
...i,
|
|
42
|
+
children: [/* @__PURE__ */ c(u.ItemText, { children: r }), /* @__PURE__ */ c(u.ItemIndicator, {
|
|
43
|
+
className: "absolute right-2",
|
|
44
|
+
children: /* @__PURE__ */ c(o, { className: "h-3.5 w-3.5" })
|
|
45
|
+
})]
|
|
46
|
+
}));
|
|
47
|
+
v.displayName = u.Item.displayName;
|
|
48
|
+
//#endregion
|
|
49
|
+
export { d as Select, _ as SelectContent, p as SelectGroup, v as SelectItem, g as SelectLabel, h as SelectTrigger, f as SelectValue };
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.js","names":[],"sources":["../../src/components/select.tsx"],"sourcesContent":["import * as SelectPrimitive from \"@radix-ui/react-select\";\nimport { Check, ChevronDown } from \"lucide-react\";\nimport * as React from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { controlSurfaceClass } from \"../utils/control-surface\";\nimport { FOCUS_BORDER, OVERLAY_GAP, overlayItemClass, overlayPanelClass } from \"./overlay\";\n\nexport type SelectProps = Omit<\n\tReact.ComponentPropsWithoutRef<typeof SelectPrimitive.Root>,\n\t\"value\" | \"defaultValue\" | \"onValueChange\"\n> & {\n\t/**\n\t * The controlled value of the select.\n\t */\n\tvalue?: string;\n\t/**\n\t * The uncontrolled initial value of the select.\n\t */\n\tdefaultValue?: string;\n\t/**\n\t * Called when the selected value changes.\n\t */\n\tonValueChange?: (value: string) => void;\n};\nexport const Select: React.FC<SelectProps> = SelectPrimitive.Root;\n\nexport type SelectValueProps = Omit<\n\tReact.ComponentPropsWithoutRef<typeof SelectPrimitive.Value>,\n\t\"placeholder\"\n> & {\n\t/**\n\t * Content shown when no value is selected.\n\t */\n\tplaceholder?: React.ReactNode;\n};\nexport const SelectValue: React.ForwardRefExoticComponent<\n\tSelectValueProps & React.RefAttributes<React.ElementRef<typeof SelectPrimitive.Value>>\n> = SelectPrimitive.Value;\n\nexport type SelectGroupProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Group>;\nexport const SelectGroup: React.ForwardRefExoticComponent<\n\tSelectGroupProps & React.RefAttributes<React.ElementRef<typeof SelectPrimitive.Group>>\n> = SelectPrimitive.Group;\n\nexport type SelectSize = \"sm\" | \"default\" | \"lg\";\n\nconst SELECT_SIZE_CLASS: Record<SelectSize, string> = {\n\tsm: \"h-8 px-2.5 text-xs\",\n\tdefault: \"h-9 px-3 text-sm\",\n\tlg: \"h-10 px-4 text-base\",\n};\n\nexport type SelectTriggerProps = Omit<\n\tReact.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>,\n\t\"disabled\"\n> & {\n\t/**\n\t * The visual size of the trigger.\n\t * @default default\n\t */\n\tsize?: SelectSize;\n\t/**\n\t * Disable the trigger and mark it busy.\n\t * @default false\n\t */\n\tloading?: boolean;\n\t/**\n\t * Disable the trigger.\n\t * @default false\n\t */\n\tdisabled?: boolean;\n};\n\nexport const SelectTrigger = React.forwardRef<\n\tReact.ElementRef<typeof SelectPrimitive.Trigger>,\n\tSelectTriggerProps\n>(({ className, children, size = \"default\", loading = false, disabled = false, ...props }, ref) => (\n\t<SelectPrimitive.Trigger\n\t\tref={ref}\n\t\t{...props}\n\t\tdisabled={disabled || loading}\n\t\taria-busy={loading || undefined}\n\t\tclassName={controlSurfaceClass(\n\t\t\tcn(\n\t\t\t\t\"flex w-full items-center justify-between\",\n\t\t\t\tSELECT_SIZE_CLASS[size],\n\t\t\t\tFOCUS_BORDER,\n\t\t\t\t\"aria-invalid:border-basalt-destructive aria-invalid:focus-visible:border-basalt-destructive\",\n\t\t\t\tclassName,\n\t\t\t),\n\t\t)}\n\t>\n\t\t{children}\n\t\t<ChevronDown className=\"h-4 w-4 opacity-50\" />\n\t</SelectPrimitive.Trigger>\n));\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\n\nexport type SelectLabelProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>;\n\nexport const SelectLabel = React.forwardRef<\n\tReact.ElementRef<typeof SelectPrimitive.Label>,\n\tSelectLabelProps\n>(({ className, ...props }, ref) => (\n\t<SelectPrimitive.Label\n\t\tref={ref}\n\t\tclassName={cn(\"px-2 py-1.5 text-xs text-basalt-muted-foreground\", className)}\n\t\t{...props}\n\t/>\n));\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\n\nexport type SelectContentProps = Omit<\n\tReact.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>,\n\t\"position\" | \"sideOffset\"\n> & {\n\t/**\n\t * The positioning mode for the select content.\n\t * @default popper\n\t */\n\tposition?: \"item-aligned\" | \"popper\";\n\t/**\n\t * The distance between the trigger and the select content.\n\t * @default 4\n\t */\n\tsideOffset?: number;\n};\n\nexport const SelectContent = React.forwardRef<\n\tReact.ElementRef<typeof SelectPrimitive.Content>,\n\tSelectContentProps\n>(({ className, children, position = \"popper\", sideOffset = OVERLAY_GAP, ...props }, ref) => (\n\t<SelectPrimitive.Portal>\n\t\t<SelectPrimitive.Content\n\t\t\tref={ref}\n\t\t\tposition={position}\n\t\t\tsideOffset={sideOffset}\n\t\t\tclassName={overlayPanelClass(\n\t\t\t\tcn(position === \"popper\" && \"w-[var(--radix-select-trigger-width)]\", className),\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<SelectPrimitive.Viewport>{children}</SelectPrimitive.Viewport>\n\t\t</SelectPrimitive.Content>\n\t</SelectPrimitive.Portal>\n));\nSelectContent.displayName = SelectPrimitive.Content.displayName;\n\nexport type SelectItemProps = Omit<\n\tReact.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>,\n\t\"value\"\n> & {\n\t/**\n\t * The value associated with the select item.\n\t */\n\tvalue: string;\n};\n\nexport const SelectItem = React.forwardRef<\n\tReact.ElementRef<typeof SelectPrimitive.Item>,\n\tSelectItemProps\n>(({ className, children, ...props }, ref) => (\n\t<SelectPrimitive.Item\n\t\tref={ref}\n\t\tclassName={overlayItemClass(\n\t\t\tcn(\n\t\t\t\t\"relative pr-8 outline-hidden hover:bg-basalt-accent focus-visible:bg-basalt-accent data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[disabled]:hover:bg-transparent\",\n\t\t\t\tclassName,\n\t\t\t),\n\t\t)}\n\t\t{...props}\n\t>\n\t\t<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n\t\t<SelectPrimitive.ItemIndicator className=\"absolute right-2\">\n\t\t\t<Check className=\"h-3.5 w-3.5\" />\n\t\t</SelectPrimitive.ItemIndicator>\n\t</SelectPrimitive.Item>\n));\nSelectItem.displayName = SelectPrimitive.Item.displayName;\n"],"mappings":";;;;;;;;;AAwBA,IAAa,IAAgC,EAAgB,MAWhD,IAET,EAAgB,OAGP,IAET,EAAgB,OAId,IAAgD;CACrD,IAAI;CACJ,SAAS;CACT,IAAI;AACL,GAuBa,IAAgB,EAAM,YAGhC,EAAE,cAAW,aAAU,UAAO,WAAW,aAAU,IAAO,cAAW,IAAO,GAAG,KAAS,MAC1F,kBAAC,EAAgB,SAAjB;CACM;CACL,GAAI;CACJ,UAAU,KAAY;CACtB,aAAW,KAAW,KAAA;CACtB,WAAW,EACV,EACC,4CACA,EAAkB,IAClB,GACA,+FACA,CACD,CACD;CAbD,UAAA,CAeE,GACD,kBAAC,GAAD,EAAa,WAAU,qBAAsB,CAAA,CACrB;AACzB,CAAA,CAAA;AACD,EAAc,cAAc,EAAgB,QAAQ;AAIpD,IAAa,IAAc,EAAM,YAG9B,EAAE,cAAW,GAAG,KAAS,MAC3B,kBAAC,EAAgB,OAAjB;CACM;CACL,WAAW,EAAG,oDAAoD,CAAS;CAC3E,GAAI;AACJ,CAAA,CACD;AACD,EAAY,cAAc,EAAgB,MAAM;AAkBhD,IAAa,IAAgB,EAAM,YAGhC,EAAE,cAAW,aAAU,cAAW,UAAU,gBAAA,GAA0B,GAAG,KAAS,MACpF,kBAAC,EAAgB,QAAjB,EAAA,UACC,kBAAC,EAAgB,SAAjB;CACM;CACK;CACE;CACZ,WAAW,EACV,EAAG,MAAa,YAAY,yCAAyC,CAAS,CAC/E;CACA,GAAI;CAEJ,UAAA,kBAAC,EAAgB,UAAjB,EAA2B,YAAmC,CAAA;AACtC,CAAA,EACF,CAAA,CACxB;AACD,EAAc,cAAc,EAAgB,QAAQ;AAYpD,IAAa,IAAa,EAAM,YAG7B,EAAE,cAAW,aAAU,GAAG,KAAS,MACrC,kBAAC,EAAgB,MAAjB;CACM;CACL,WAAW,EACV,EACC,0LACA,CACD,CACD;CACA,GAAI;CARL,UAAA,CAUC,kBAAC,EAAgB,UAAjB,EAA2B,YAAmC,CAAA,GAC9D,kBAAC,EAAgB,eAAjB;EAA+B,WAAU;EACxC,UAAA,kBAAC,GAAD,EAAO,WAAU,cAAe,CAAA;CACF,CAAA,CACV;AACtB,CAAA,CAAA;AACD,EAAW,cAAc,EAAgB,KAAK"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type InputSize } from "./input.js";
|
|
3
|
+
export type SensitiveInputProps = Omit<React.ComponentProps<"input">, "type" | "size"> & {
|
|
4
|
+
/**
|
|
5
|
+
* Accessible label for the reveal action.
|
|
6
|
+
*/
|
|
7
|
+
revealLabel: string;
|
|
8
|
+
/**
|
|
9
|
+
* Accessible label for the hide action.
|
|
10
|
+
*/
|
|
11
|
+
hideLabel: string;
|
|
12
|
+
/**
|
|
13
|
+
* The visual size of the field.
|
|
14
|
+
* @default default
|
|
15
|
+
*/
|
|
16
|
+
size?: InputSize;
|
|
17
|
+
/**
|
|
18
|
+
* Ignore password managers on this field.
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
21
|
+
passwordManagerIgnore?: boolean;
|
|
22
|
+
};
|
|
23
|
+
export declare const SensitiveInput: React.ForwardRefExoticComponent<Omit<SensitiveInputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../utils/cn.js";
|
|
3
|
+
import { Button as t } from "./button.js";
|
|
4
|
+
import { Input as n } from "./input.js";
|
|
5
|
+
import * as r from "react";
|
|
6
|
+
import { Eye as i, EyeOff as a } from "lucide-react";
|
|
7
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
8
|
+
//#region src/components/sensitive-input.tsx
|
|
9
|
+
var c = {
|
|
10
|
+
sm: "h-8 w-8",
|
|
11
|
+
default: "h-9 w-9",
|
|
12
|
+
lg: "h-10 w-10"
|
|
13
|
+
}, l = r.forwardRef(({ className: l, revealLabel: u, hideLabel: d, disabled: f, size: p = "default", passwordManagerIgnore: m = !1, ...h }, g) => {
|
|
14
|
+
let [_, v] = r.useState(!1);
|
|
15
|
+
return /* @__PURE__ */ s("div", {
|
|
16
|
+
className: "relative",
|
|
17
|
+
children: [/* @__PURE__ */ o(n, {
|
|
18
|
+
ref: g,
|
|
19
|
+
type: _ ? "text" : "password",
|
|
20
|
+
size: p,
|
|
21
|
+
passwordManagerIgnore: m,
|
|
22
|
+
className: e("pr-10", l),
|
|
23
|
+
disabled: f,
|
|
24
|
+
...h
|
|
25
|
+
}), /* @__PURE__ */ o(t, {
|
|
26
|
+
type: "button",
|
|
27
|
+
variant: "ghost",
|
|
28
|
+
className: e("absolute right-0 top-0", c[p]),
|
|
29
|
+
"aria-label": _ ? d : u,
|
|
30
|
+
disabled: f,
|
|
31
|
+
onClick: () => v((e) => !e),
|
|
32
|
+
children: o(_ ? a : i, {
|
|
33
|
+
className: "h-4 w-4",
|
|
34
|
+
"aria-hidden": "true"
|
|
35
|
+
})
|
|
36
|
+
})]
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
l.displayName = "SensitiveInput";
|
|
40
|
+
//#endregion
|
|
41
|
+
export { l as SensitiveInput };
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=sensitive-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sensitive-input.js","names":[],"sources":["../../src/components/sensitive-input.tsx"],"sourcesContent":["import { Eye, EyeOff } from \"lucide-react\";\nimport * as React from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { Button } from \"./button\";\nimport { Input, type InputSize } from \"./input\";\n\nconst TOGGLE_SIZE_CLASS: Record<InputSize, string> = {\n\tsm: \"h-8 w-8\",\n\tdefault: \"h-9 w-9\",\n\tlg: \"h-10 w-10\",\n};\n\nexport type SensitiveInputProps = Omit<React.ComponentProps<\"input\">, \"type\" | \"size\"> & {\n\t/**\n\t * Accessible label for the reveal action.\n\t */\n\trevealLabel: string;\n\t/**\n\t * Accessible label for the hide action.\n\t */\n\thideLabel: string;\n\t/**\n\t * The visual size of the field.\n\t * @default default\n\t */\n\tsize?: InputSize;\n\t/**\n\t * Ignore password managers on this field.\n\t * @default false\n\t */\n\tpasswordManagerIgnore?: boolean;\n};\n\nexport const SensitiveInput = React.forwardRef<HTMLInputElement, SensitiveInputProps>(\n\t(\n\t\t{\n\t\t\tclassName,\n\t\t\trevealLabel,\n\t\t\thideLabel,\n\t\t\tdisabled,\n\t\t\tsize = \"default\",\n\t\t\tpasswordManagerIgnore = false,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst [revealed, setRevealed] = React.useState(false);\n\t\treturn (\n\t\t\t<div className=\"relative\">\n\t\t\t\t<Input\n\t\t\t\t\tref={ref}\n\t\t\t\t\ttype={revealed ? \"text\" : \"password\"}\n\t\t\t\t\tsize={size}\n\t\t\t\t\tpasswordManagerIgnore={passwordManagerIgnore}\n\t\t\t\t\tclassName={cn(\"pr-10\", className)}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t{...props}\n\t\t\t\t/>\n\t\t\t\t<Button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\tclassName={cn(\"absolute right-0 top-0\", TOGGLE_SIZE_CLASS[size])}\n\t\t\t\t\taria-label={revealed ? hideLabel : revealLabel}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tonClick={() => setRevealed((value) => !value)}\n\t\t\t\t>\n\t\t\t\t\t{revealed ? (\n\t\t\t\t\t\t<EyeOff className=\"h-4 w-4\" aria-hidden=\"true\" />\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<Eye className=\"h-4 w-4\" aria-hidden=\"true\" />\n\t\t\t\t\t)}\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t);\n\t},\n);\nSensitiveInput.displayName = \"SensitiveInput\";\n"],"mappings":";;;;;;;;AAMA,IAAM,IAA+C;CACpD,IAAI;CACJ,SAAS;CACT,IAAI;AACL,GAuBa,IAAiB,EAAM,YAElC,EACC,cACA,gBACA,cACA,aACA,UAAO,WACP,2BAAwB,IACxB,GAAG,KAEJ,MACI;CACJ,IAAM,CAAC,GAAU,KAAe,EAAM,SAAS,EAAK;CACpD,OACC,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACC,kBAAC,GAAD;GACM;GACL,MAAM,IAAW,SAAS;GACpB;GACiB;GACvB,WAAW,EAAG,SAAS,CAAS;GACtB;GACV,GAAI;EACJ,CAAA,GACD,kBAAC,GAAD;GACC,MAAK;GACL,SAAQ;GACR,WAAW,EAAG,0BAA0B,EAAkB,EAAK;GAC/D,cAAY,IAAW,IAAY;GACzB;GACV,eAAe,GAAa,MAAU,CAAC,CAAK;GAE3C,UACA,EADA,IACC,IAEA,GAFD;IAAQ,WAAU;IAAU,eAAY;GAAQ,CAEH;EAEvC,CAAA,CACJ;;AAEP,CACD;AACA,EAAe,cAAc"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export type SeparatorProps = Omit<React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>, "orientation" | "decorative"> & {
|
|
4
|
+
/**
|
|
5
|
+
* The orientation of the separator.
|
|
6
|
+
* @default horizontal
|
|
7
|
+
*/
|
|
8
|
+
orientation?: "horizontal" | "vertical";
|
|
9
|
+
/**
|
|
10
|
+
* Whether the separator is purely decorative.
|
|
11
|
+
* @default true
|
|
12
|
+
*/
|
|
13
|
+
decorative?: boolean;
|
|
14
|
+
};
|
|
15
|
+
export declare const Separator: React.ForwardRefExoticComponent<Omit<Omit<SeparatorPrimitive.SeparatorProps & React.RefAttributes<HTMLDivElement>, "ref">, "decorative" | "orientation"> & {
|
|
16
|
+
/**
|
|
17
|
+
* The orientation of the separator.
|
|
18
|
+
* @default horizontal
|
|
19
|
+
*/
|
|
20
|
+
orientation?: "horizontal" | "vertical";
|
|
21
|
+
/**
|
|
22
|
+
* Whether the separator is purely decorative.
|
|
23
|
+
* @default true
|
|
24
|
+
*/
|
|
25
|
+
decorative?: boolean;
|
|
26
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../utils/cn.js";
|
|
3
|
+
import * as t from "react";
|
|
4
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
5
|
+
import * as r from "@radix-ui/react-separator";
|
|
6
|
+
//#region src/components/separator.tsx
|
|
7
|
+
var i = t.forwardRef(({ className: t, orientation: i = "horizontal", decorative: a = !0, ...o }, s) => /* @__PURE__ */ n(r.Root, {
|
|
8
|
+
ref: s,
|
|
9
|
+
decorative: a,
|
|
10
|
+
orientation: i,
|
|
11
|
+
className: e("shrink-0 bg-basalt-border", i === "horizontal" ? "h-px w-full" : "h-full w-px", t),
|
|
12
|
+
...o
|
|
13
|
+
}));
|
|
14
|
+
i.displayName = r.Root.displayName;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { i as Separator };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=separator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"separator.js","names":[],"sources":["../../src/components/separator.tsx"],"sourcesContent":["import * as SeparatorPrimitive from \"@radix-ui/react-separator\";\nimport * as React from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport type SeparatorProps = Omit<\n\tReact.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>,\n\t\"orientation\" | \"decorative\"\n> & {\n\t/**\n\t * The orientation of the separator.\n\t * @default horizontal\n\t */\n\torientation?: \"horizontal\" | \"vertical\";\n\t/**\n\t * Whether the separator is purely decorative.\n\t * @default true\n\t */\n\tdecorative?: boolean;\n};\n\nexport const Separator = React.forwardRef<\n\tReact.ElementRef<typeof SeparatorPrimitive.Root>,\n\tSeparatorProps\n>(({ className, orientation = \"horizontal\", decorative = true, ...props }, ref) => (\n\t<SeparatorPrimitive.Root\n\t\tref={ref}\n\t\tdecorative={decorative}\n\t\torientation={orientation}\n\t\tclassName={cn(\n\t\t\t\"shrink-0 bg-basalt-border\",\n\t\t\torientation === \"horizontal\" ? \"h-px w-full\" : \"h-full w-px\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n));\nSeparator.displayName = SeparatorPrimitive.Root.displayName;\n"],"mappings":";;;;;;AAoBA,IAAa,IAAY,EAAM,YAG5B,EAAE,cAAW,iBAAc,cAAc,gBAAa,IAAM,GAAG,KAAS,MAC1E,kBAAC,EAAmB,MAApB;CACM;CACO;CACC;CACb,WAAW,EACV,6BACA,MAAgB,eAAe,gBAAgB,eAC/C,CACD;CACA,GAAI;AACJ,CAAA,CACD;AACD,EAAU,cAAc,EAAmB,KAAK"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export declare const Sheet: React.FC<DialogPrimitive.DialogProps>;
|
|
4
|
+
export declare const SheetTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
export declare const SheetClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
export declare const SheetTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
7
|
+
export declare const SheetDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
8
|
+
declare const SIDE: {
|
|
9
|
+
readonly right: "fixed inset-y-0 right-0 box-border flex h-full w-80 flex-col gap-3 border-l border-basalt-border bg-basalt-popover p-6 text-sm text-basalt-popover-foreground shadow-lg";
|
|
10
|
+
readonly left: "fixed inset-y-0 left-0 box-border flex h-full w-80 flex-col gap-3 border-r border-basalt-border bg-basalt-popover p-6 text-sm text-basalt-popover-foreground shadow-lg";
|
|
11
|
+
readonly top: "fixed inset-x-0 top-0 box-border flex h-80 w-full flex-col gap-3 border-b border-basalt-border bg-basalt-popover p-6 text-sm text-basalt-popover-foreground shadow-lg";
|
|
12
|
+
readonly bottom: "fixed inset-x-0 bottom-0 box-border flex h-80 w-full flex-col gap-3 border-t border-basalt-border bg-basalt-popover p-6 text-sm text-basalt-popover-foreground shadow-lg";
|
|
13
|
+
};
|
|
14
|
+
export type SheetSide = keyof typeof SIDE;
|
|
15
|
+
export declare const SheetContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
16
|
+
side?: SheetSide;
|
|
17
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
export declare function SheetHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
19
|
+
export declare namespace SheetHeader {
|
|
20
|
+
var displayName: string;
|
|
21
|
+
}
|
|
22
|
+
export declare function SheetFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
23
|
+
export declare namespace SheetFooter {
|
|
24
|
+
var displayName: string;
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../utils/cn.js";
|
|
3
|
+
import { OVERLAY_LAYER as t, OVERLAY_MOTION as n } from "./overlay.js";
|
|
4
|
+
import * as r from "react";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
import * as o from "@radix-ui/react-dialog";
|
|
7
|
+
//#region src/components/sheet.tsx
|
|
8
|
+
var s = o.Root, c = o.Trigger, l = o.Close, u = r.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ i(o.Title, {
|
|
9
|
+
ref: r,
|
|
10
|
+
className: e("text-lg font-semibold leading-none tracking-tight", t),
|
|
11
|
+
...n
|
|
12
|
+
}));
|
|
13
|
+
u.displayName = o.Title.displayName;
|
|
14
|
+
var d = r.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ i(o.Description, {
|
|
15
|
+
ref: r,
|
|
16
|
+
className: e("text-sm text-basalt-muted-foreground", t),
|
|
17
|
+
...n
|
|
18
|
+
}));
|
|
19
|
+
d.displayName = o.Description.displayName;
|
|
20
|
+
var f = {
|
|
21
|
+
right: "fixed inset-y-0 right-0 box-border flex h-full w-80 flex-col gap-3 border-l border-basalt-border bg-basalt-popover p-6 text-sm text-basalt-popover-foreground shadow-lg",
|
|
22
|
+
left: "fixed inset-y-0 left-0 box-border flex h-full w-80 flex-col gap-3 border-r border-basalt-border bg-basalt-popover p-6 text-sm text-basalt-popover-foreground shadow-lg",
|
|
23
|
+
top: "fixed inset-x-0 top-0 box-border flex h-80 w-full flex-col gap-3 border-b border-basalt-border bg-basalt-popover p-6 text-sm text-basalt-popover-foreground shadow-lg",
|
|
24
|
+
bottom: "fixed inset-x-0 bottom-0 box-border flex h-80 w-full flex-col gap-3 border-t border-basalt-border bg-basalt-popover p-6 text-sm text-basalt-popover-foreground shadow-lg"
|
|
25
|
+
}, p = r.forwardRef(({ className: r, side: s = "right", children: c, ...l }, u) => /* @__PURE__ */ a(o.Portal, { children: [/* @__PURE__ */ i(o.Overlay, { className: e("fixed inset-0 bg-black/50 backdrop-blur-xs", t, n) }), /* @__PURE__ */ i(o.Content, {
|
|
26
|
+
ref: u,
|
|
27
|
+
className: e(t, n, f[s], r),
|
|
28
|
+
...l,
|
|
29
|
+
style: {
|
|
30
|
+
boxSizing: "border-box",
|
|
31
|
+
...l.style
|
|
32
|
+
},
|
|
33
|
+
children: c
|
|
34
|
+
})] }));
|
|
35
|
+
p.displayName = "SheetContent";
|
|
36
|
+
var m = ({ className: t, ...n }) => /* @__PURE__ */ i("div", {
|
|
37
|
+
className: e("flex flex-col space-y-2 text-left", t),
|
|
38
|
+
...n
|
|
39
|
+
});
|
|
40
|
+
m.displayName = "SheetHeader";
|
|
41
|
+
var h = ({ className: t, ...n }) => /* @__PURE__ */ i("div", {
|
|
42
|
+
className: e("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", t),
|
|
43
|
+
...n
|
|
44
|
+
});
|
|
45
|
+
h.displayName = "SheetFooter";
|
|
46
|
+
//#endregion
|
|
47
|
+
export { s as Sheet, l as SheetClose, p as SheetContent, d as SheetDescription, h as SheetFooter, m as SheetHeader, u as SheetTitle, c as SheetTrigger };
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=sheet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sheet.js","names":[],"sources":["../../src/components/sheet.tsx"],"sourcesContent":["import * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport * as React from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { OVERLAY_LAYER, OVERLAY_MOTION } from \"./overlay\";\n\nexport const Sheet = DialogPrimitive.Root;\nexport const SheetTrigger = DialogPrimitive.Trigger;\nexport const SheetClose = DialogPrimitive.Close;\nexport const SheetTitle = React.forwardRef<\n\tReact.ElementRef<typeof DialogPrimitive.Title>,\n\tReact.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n\t<DialogPrimitive.Title\n\t\tref={ref}\n\t\tclassName={cn(\"text-lg font-semibold leading-none tracking-tight\", className)}\n\t\t{...props}\n\t/>\n));\nSheetTitle.displayName = DialogPrimitive.Title.displayName;\n\nexport const SheetDescription = React.forwardRef<\n\tReact.ElementRef<typeof DialogPrimitive.Description>,\n\tReact.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n\t<DialogPrimitive.Description\n\t\tref={ref}\n\t\tclassName={cn(\"text-sm text-basalt-muted-foreground\", className)}\n\t\t{...props}\n\t/>\n));\nSheetDescription.displayName = DialogPrimitive.Description.displayName;\n\nconst SIDE = {\n\tright:\n\t\t\"fixed inset-y-0 right-0 box-border flex h-full w-80 flex-col gap-3 border-l border-basalt-border bg-basalt-popover p-6 text-sm text-basalt-popover-foreground shadow-lg\",\n\tleft: \"fixed inset-y-0 left-0 box-border flex h-full w-80 flex-col gap-3 border-r border-basalt-border bg-basalt-popover p-6 text-sm text-basalt-popover-foreground shadow-lg\",\n\ttop: \"fixed inset-x-0 top-0 box-border flex h-80 w-full flex-col gap-3 border-b border-basalt-border bg-basalt-popover p-6 text-sm text-basalt-popover-foreground shadow-lg\",\n\tbottom:\n\t\t\"fixed inset-x-0 bottom-0 box-border flex h-80 w-full flex-col gap-3 border-t border-basalt-border bg-basalt-popover p-6 text-sm text-basalt-popover-foreground shadow-lg\",\n} as const;\n\nexport type SheetSide = keyof typeof SIDE;\n\nexport const SheetContent = React.forwardRef<\n\tReact.ElementRef<typeof DialogPrimitive.Content>,\n\tReact.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & { side?: SheetSide }\n>(({ className, side = \"right\", children, ...props }, ref) => (\n\t<DialogPrimitive.Portal>\n\t\t<DialogPrimitive.Overlay\n\t\t\tclassName={cn(\"fixed inset-0 bg-black/50 backdrop-blur-xs\", OVERLAY_LAYER, OVERLAY_MOTION)}\n\t\t/>\n\t\t<DialogPrimitive.Content\n\t\t\tref={ref}\n\t\t\tclassName={cn(OVERLAY_LAYER, OVERLAY_MOTION, SIDE[side], className)}\n\t\t\t{...props}\n\t\t\tstyle={{ boxSizing: \"border-box\", ...props.style }}\n\t\t>\n\t\t\t{children}\n\t\t</DialogPrimitive.Content>\n\t</DialogPrimitive.Portal>\n));\nSheetContent.displayName = \"SheetContent\";\n\nexport const SheetHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n\t<div className={cn(\"flex flex-col space-y-2 text-left\", className)} {...props} />\n);\nSheetHeader.displayName = \"SheetHeader\";\n\nexport const SheetFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n\t<div\n\t\tclassName={cn(\"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\", className)}\n\t\t{...props}\n\t/>\n);\nSheetFooter.displayName = \"SheetFooter\";\n"],"mappings":";;;;;;;AAKA,IAAa,IAAQ,EAAgB,MACxB,IAAe,EAAgB,SAC/B,IAAa,EAAgB,OAC7B,IAAa,EAAM,YAG7B,EAAE,cAAW,GAAG,KAAS,MAC3B,kBAAC,EAAgB,OAAjB;CACM;CACL,WAAW,EAAG,qDAAqD,CAAS;CAC5E,GAAI;AACJ,CAAA,CACD;AACD,EAAW,cAAc,EAAgB,MAAM;AAE/C,IAAa,IAAmB,EAAM,YAGnC,EAAE,cAAW,GAAG,KAAS,MAC3B,kBAAC,EAAgB,aAAjB;CACM;CACL,WAAW,EAAG,wCAAwC,CAAS;CAC/D,GAAI;AACJ,CAAA,CACD;AACD,EAAiB,cAAc,EAAgB,YAAY;AAE3D,IAAM,IAAO;CACZ,OACC;CACD,MAAM;CACN,KAAK;CACL,QACC;AACF,GAIa,IAAe,EAAM,YAG/B,EAAE,cAAW,UAAO,SAAS,aAAU,GAAG,KAAS,MACrD,kBAAC,EAAgB,QAAjB,EAAA,UAAA,CACC,kBAAC,EAAgB,SAAjB,EACC,WAAW,EAAG,8CAA8C,GAAe,CAAc,EACzF,CAAA,GACD,kBAAC,EAAgB,SAAjB;CACM;CACL,WAAW,EAAG,GAAe,GAAgB,EAAK,IAAO,CAAS;CAClE,GAAI;CACJ,OAAO;EAAE,WAAW;EAAc,GAAG,EAAM;CAAM;CAEhD;AACuB,CAAA,CACF,EAAA,CAAA,CACxB;AACD,EAAa,cAAc;AAE3B,IAAa,KAAe,EAAE,cAAW,GAAG,QAC3C,kBAAC,OAAD;CAAK,WAAW,EAAG,qCAAqC,CAAS;CAAG,GAAI;AAAQ,CAAA;AAEjF,EAAY,cAAc;AAE1B,IAAa,KAAe,EAAE,cAAW,GAAG,QAC3C,kBAAC,OAAD;CACC,WAAW,EAAG,0DAA0D,CAAS;CACjF,GAAI;AACJ,CAAA;AAEF,EAAY,cAAc"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { type ButtonHTMLAttributes, type HTMLAttributes, type ReactNode, type RefObject } from "react";
|
|
2
|
+
export type SidebarSide = "left" | "right";
|
|
3
|
+
type SidebarContextValue = {
|
|
4
|
+
collapsed: boolean;
|
|
5
|
+
setCollapsed: (next: boolean) => void;
|
|
6
|
+
side: SidebarSide;
|
|
7
|
+
loading: boolean;
|
|
8
|
+
peek: boolean;
|
|
9
|
+
peeking: boolean;
|
|
10
|
+
setPeeking: (next: boolean) => void;
|
|
11
|
+
overlay: boolean;
|
|
12
|
+
width: number;
|
|
13
|
+
setWidth: (next: number) => void;
|
|
14
|
+
lastFocusRef: RefObject<HTMLElement | null>;
|
|
15
|
+
};
|
|
16
|
+
export declare function useSidebar(): SidebarContextValue;
|
|
17
|
+
export type SidebarProviderProps = {
|
|
18
|
+
/**
|
|
19
|
+
* The controlled collapsed state.
|
|
20
|
+
*/
|
|
21
|
+
collapsed?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* The uncontrolled initial collapsed state.
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
defaultCollapsed?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Called when the collapsed state changes.
|
|
29
|
+
*/
|
|
30
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
31
|
+
/**
|
|
32
|
+
* Which edge the sidebar occupies.
|
|
33
|
+
* @default left
|
|
34
|
+
*/
|
|
35
|
+
side?: SidebarSide;
|
|
36
|
+
/**
|
|
37
|
+
* Replace the nav with a loading skeleton.
|
|
38
|
+
* @default false
|
|
39
|
+
*/
|
|
40
|
+
loading?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Expand the collapsed rail on hover.
|
|
43
|
+
* @default false
|
|
44
|
+
*/
|
|
45
|
+
peek?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Render as an overlay instead of in-flow chrome.
|
|
48
|
+
* @default false
|
|
49
|
+
*/
|
|
50
|
+
overlay?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Expanded width in pixels.
|
|
53
|
+
* @default 260
|
|
54
|
+
*/
|
|
55
|
+
defaultWidth?: number;
|
|
56
|
+
/**
|
|
57
|
+
* Sidebar chrome and page content.
|
|
58
|
+
*/
|
|
59
|
+
children: ReactNode;
|
|
60
|
+
};
|
|
61
|
+
export declare function SidebarProvider({ collapsed, defaultCollapsed, onCollapsedChange, side, loading, peek, overlay, defaultWidth, children, }: SidebarProviderProps): import("react").JSX.Element;
|
|
62
|
+
export type SidebarProps = HTMLAttributes<HTMLElement> & {
|
|
63
|
+
/**
|
|
64
|
+
* Collapse the rail when no provider is present.
|
|
65
|
+
* @default false
|
|
66
|
+
*/
|
|
67
|
+
collapsed?: boolean;
|
|
68
|
+
};
|
|
69
|
+
export declare function Sidebar({ collapsed: collapsedProp, className, children, onMouseEnter, onMouseLeave, style, ...props }: SidebarProps): import("react").JSX.Element;
|
|
70
|
+
export declare function SidebarHeader({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
71
|
+
export declare function SidebarSearch({ shortcut, className, children, ...props }: ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
72
|
+
shortcut?: string;
|
|
73
|
+
}): import("react").JSX.Element;
|
|
74
|
+
export declare function SidebarNav({ className, ...props }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
|
|
75
|
+
export declare function SidebarPartition({ className, ...props }: HTMLAttributes<HTMLParagraphElement>): import("react").JSX.Element;
|
|
76
|
+
export type SidebarItemProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
77
|
+
/**
|
|
78
|
+
* Mark the item as the current page.
|
|
79
|
+
* @default false
|
|
80
|
+
*/
|
|
81
|
+
active?: boolean;
|
|
82
|
+
};
|
|
83
|
+
export declare function SidebarItem({ active, className, ...props }: SidebarItemProps): import("react").JSX.Element;
|
|
84
|
+
export declare function SidebarIconItem({ active, className, ...props }: ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
85
|
+
active?: boolean;
|
|
86
|
+
}): import("react").JSX.Element;
|
|
87
|
+
export declare function SidebarGroup({ label, defaultOpen, children, }: {
|
|
88
|
+
label: ReactNode;
|
|
89
|
+
defaultOpen?: boolean;
|
|
90
|
+
children: ReactNode;
|
|
91
|
+
}): import("react").JSX.Element;
|
|
92
|
+
export declare function SidebarFooter({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
93
|
+
export declare function SidebarUser({ name, email, avatar, action, className, }: {
|
|
94
|
+
name: ReactNode;
|
|
95
|
+
email?: ReactNode;
|
|
96
|
+
avatar?: ReactNode;
|
|
97
|
+
action?: ReactNode;
|
|
98
|
+
className?: string;
|
|
99
|
+
}): import("react").JSX.Element;
|
|
100
|
+
export declare function ContentIsland({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
101
|
+
export {};
|