@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,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../utils/cn.js";
|
|
3
|
+
import { FOCUS_BORDER as t } from "./overlay.js";
|
|
4
|
+
import { controlSurfaceClass as n } from "../utils/control-surface.js";
|
|
5
|
+
import * as r from "react";
|
|
6
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/input.tsx
|
|
8
|
+
var a = {
|
|
9
|
+
sm: "h-8 px-2.5 py-1.5 text-xs",
|
|
10
|
+
default: "h-9 px-3 py-2 text-sm",
|
|
11
|
+
lg: "h-10 px-4 py-2 text-base"
|
|
12
|
+
}, o = {
|
|
13
|
+
"data-1p-ignore": "true",
|
|
14
|
+
"data-bwignore": "true",
|
|
15
|
+
"data-form-type": "other",
|
|
16
|
+
"data-lpignore": "true"
|
|
17
|
+
}, s = r.forwardRef(({ className: r, type: s, size: c = "default", passwordManagerIgnore: l = !1, ...u }, d) => /* @__PURE__ */ i("input", {
|
|
18
|
+
type: s,
|
|
19
|
+
className: n(e("flex w-full text-basalt-foreground shadow-xs file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-basalt-muted-foreground disabled:cursor-not-allowed disabled:border-transparent disabled:text-basalt-muted-foreground/40", a[c], t, "aria-invalid:border-basalt-destructive aria-invalid:focus-visible:border-basalt-destructive", l && "keeper-ignore", r)),
|
|
20
|
+
ref: d,
|
|
21
|
+
...u,
|
|
22
|
+
...l ? o : {}
|
|
23
|
+
}));
|
|
24
|
+
s.displayName = "Input";
|
|
25
|
+
//#endregion
|
|
26
|
+
export { s as Input };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.js","names":[],"sources":["../../src/components/input.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { controlSurfaceClass } from \"../utils/control-surface\";\nimport { FOCUS_BORDER } from \"./overlay\";\n\nexport type InputSize = \"sm\" | \"default\" | \"lg\";\n\nconst INPUT_SIZE_CLASS: Record<InputSize, string> = {\n\tsm: \"h-8 px-2.5 py-1.5 text-xs\",\n\tdefault: \"h-9 px-3 py-2 text-sm\",\n\tlg: \"h-10 px-4 py-2 text-base\",\n};\n\nconst PASSWORD_MANAGER_MARKERS = {\n\t\"data-1p-ignore\": \"true\",\n\t\"data-bwignore\": \"true\",\n\t\"data-form-type\": \"other\",\n\t\"data-lpignore\": \"true\",\n} as const;\n\nexport type InputProps = Omit<React.ComponentProps<\"input\">, \"type\" | \"size\"> & {\n\t/**\n\t * The type of input control to render.\n\t */\n\ttype?: React.HTMLInputTypeAttribute;\n\t/**\n\t * The visual size of the input.\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 Input = React.forwardRef<HTMLInputElement, InputProps>(\n\t({ className, type, size = \"default\", passwordManagerIgnore = false, ...props }, ref) => (\n\t\t<input\n\t\t\ttype={type}\n\t\t\tclassName={controlSurfaceClass(\n\t\t\t\tcn(\n\t\t\t\t\t\"flex w-full text-basalt-foreground shadow-xs file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-basalt-muted-foreground disabled:cursor-not-allowed disabled:border-transparent disabled:text-basalt-muted-foreground/40\",\n\t\t\t\t\tINPUT_SIZE_CLASS[size],\n\t\t\t\t\tFOCUS_BORDER,\n\t\t\t\t\t\"aria-invalid:border-basalt-destructive aria-invalid:focus-visible:border-basalt-destructive\",\n\t\t\t\t\tpasswordManagerIgnore && \"keeper-ignore\",\n\t\t\t\t\tclassName,\n\t\t\t\t),\n\t\t\t)}\n\t\t\tref={ref}\n\t\t\t{...props}\n\t\t\t{...(passwordManagerIgnore ? PASSWORD_MANAGER_MARKERS : {})}\n\t\t/>\n\t),\n);\nInput.displayName = \"Input\";\n"],"mappings":";;;;;;;AAOA,IAAM,IAA8C;CACnD,IAAI;CACJ,SAAS;CACT,IAAI;AACL,GAEM,IAA2B;CAChC,kBAAkB;CAClB,iBAAiB;CACjB,kBAAkB;CAClB,iBAAiB;AAClB,GAmBa,IAAQ,EAAM,YACzB,EAAE,cAAW,SAAM,UAAO,WAAW,2BAAwB,IAAO,GAAG,KAAS,MAChF,kBAAC,SAAD;CACO;CACN,WAAW,EACV,EACC,0PACA,EAAiB,IACjB,GACA,+FACA,KAAyB,iBACzB,CACD,CACD;CACK;CACL,GAAI;CACJ,GAAK,IAAwB,IAA2B,CAAC;AACzD,CAAA,CAEH;AACA,EAAM,cAAc"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export type LabelProps = React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> & {
|
|
4
|
+
/**
|
|
5
|
+
* Show gray (optional) after the label.
|
|
6
|
+
* @default false
|
|
7
|
+
*/
|
|
8
|
+
showOptional?: boolean;
|
|
9
|
+
/** Info icon with hover text. */
|
|
10
|
+
tooltip?: React.ReactNode;
|
|
11
|
+
};
|
|
12
|
+
export declare const Label: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & {
|
|
13
|
+
/**
|
|
14
|
+
* Show gray (optional) after the label.
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
17
|
+
showOptional?: boolean;
|
|
18
|
+
/** Info icon with hover text. */
|
|
19
|
+
tooltip?: React.ReactNode;
|
|
20
|
+
} & React.RefAttributes<HTMLLabelElement>>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../utils/cn.js";
|
|
3
|
+
import { Tooltip as t, TooltipContent as n, TooltipProvider as r, TooltipTrigger as i } from "./tooltip.js";
|
|
4
|
+
import * as a from "react";
|
|
5
|
+
import { Info as o } from "lucide-react";
|
|
6
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
|
+
import * as l from "@radix-ui/react-label";
|
|
8
|
+
//#region src/components/label.tsx
|
|
9
|
+
var u = a.forwardRef(({ className: a, children: u, showOptional: d = !1, tooltip: f, ...p }, m) => /* @__PURE__ */ c(l.Root, {
|
|
10
|
+
ref: m,
|
|
11
|
+
className: e("inline-flex items-center gap-1 text-sm font-medium leading-none text-basalt-foreground peer-disabled:cursor-not-allowed peer-disabled:opacity-70", a),
|
|
12
|
+
...p,
|
|
13
|
+
children: [
|
|
14
|
+
u,
|
|
15
|
+
d ? /* @__PURE__ */ s("span", {
|
|
16
|
+
className: "font-normal text-basalt-muted-foreground",
|
|
17
|
+
children: "(optional)"
|
|
18
|
+
}) : null,
|
|
19
|
+
f ? /* @__PURE__ */ s(r, { children: /* @__PURE__ */ c(t, { children: [/* @__PURE__ */ s(i, {
|
|
20
|
+
asChild: !0,
|
|
21
|
+
children: /* @__PURE__ */ s("button", {
|
|
22
|
+
type: "button",
|
|
23
|
+
"aria-label": "More information",
|
|
24
|
+
className: "inline-flex size-4 shrink-0 items-center justify-center text-basalt-muted-foreground hover:text-basalt-foreground",
|
|
25
|
+
children: /* @__PURE__ */ s(o, { className: "size-3.5" })
|
|
26
|
+
})
|
|
27
|
+
}), /* @__PURE__ */ s(n, { children: f })] }) }) : null
|
|
28
|
+
]
|
|
29
|
+
}));
|
|
30
|
+
u.displayName = l.Root.displayName;
|
|
31
|
+
//#endregion
|
|
32
|
+
export { u as Label };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=label.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label.js","names":[],"sources":["../../src/components/label.tsx"],"sourcesContent":["import * as LabelPrimitive from \"@radix-ui/react-label\";\nimport { Info } from \"lucide-react\";\nimport * as React from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from \"./tooltip\";\n\nexport type LabelProps = React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> & {\n\t/**\n\t * Show gray (optional) after the label.\n\t * @default false\n\t */\n\tshowOptional?: boolean;\n\t/** Info icon with hover text. */\n\ttooltip?: React.ReactNode;\n};\n\nexport const Label = React.forwardRef<React.ElementRef<typeof LabelPrimitive.Root>, LabelProps>(\n\t({ className, children, showOptional = false, tooltip, ...props }, ref) => (\n\t\t<LabelPrimitive.Root\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"inline-flex items-center gap-1 text-sm font-medium leading-none text-basalt-foreground peer-disabled:cursor-not-allowed peer-disabled:opacity-70\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t\t{showOptional ? (\n\t\t\t\t<span className=\"font-normal text-basalt-muted-foreground\">(optional)</span>\n\t\t\t) : null}\n\t\t\t{tooltip ? (\n\t\t\t\t<TooltipProvider>\n\t\t\t\t\t<Tooltip>\n\t\t\t\t\t\t<TooltipTrigger asChild>\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\taria-label=\"More information\"\n\t\t\t\t\t\t\t\tclassName=\"inline-flex size-4 shrink-0 items-center justify-center text-basalt-muted-foreground hover:text-basalt-foreground\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Info className=\"size-3.5\" />\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</TooltipTrigger>\n\t\t\t\t\t\t<TooltipContent>{tooltip}</TooltipContent>\n\t\t\t\t\t</Tooltip>\n\t\t\t\t</TooltipProvider>\n\t\t\t) : null}\n\t\t</LabelPrimitive.Root>\n\t),\n);\nLabel.displayName = LabelPrimitive.Root.displayName;\n"],"mappings":";;;;;;;;AAgBA,IAAa,IAAQ,EAAM,YACzB,EAAE,cAAW,aAAU,kBAAe,IAAO,YAAS,GAAG,KAAS,MAClE,kBAAC,EAAe,MAAhB;CACM;CACL,WAAW,EACV,oJACA,CACD;CACA,GAAI;CANL,UAAA;EAQE;EACA,IACA,kBAAC,QAAD;GAAM,WAAU;GAA2C,UAAA;EAAgB,CAAA,IACxE;EACH,IACA,kBAAC,GAAD,EAAA,UACC,kBAAC,GAAD,EAAA,UAAA,CACC,kBAAC,GAAD;GAAgB,SAAA;GACf,UAAA,kBAAC,UAAD;IACC,MAAK;IACL,cAAW;IACX,WAAU;IAEV,UAAA,kBAAC,GAAD,EAAM,WAAU,WAAY,CAAA;GACrB,CAAA;EACO,CAAA,GAChB,kBAAC,GAAD,EAAA,UAAiB,EAAwB,CAAA,CACjC,EAAA,CAAA,EACO,CAAA,IACd;CACgB;AAEvB,CAAA,CAAA;AACA,EAAM,cAAc,EAAe,KAAK"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
declare const PADDING_CLASSES: {
|
|
3
|
+
readonly none: "";
|
|
4
|
+
readonly sm: "p-3";
|
|
5
|
+
readonly md: "p-4";
|
|
6
|
+
readonly lg: "p-6";
|
|
7
|
+
};
|
|
8
|
+
export type LayerCardPadding = keyof typeof PADDING_CLASSES;
|
|
9
|
+
export type LayerCardProps = Omit<HTMLAttributes<HTMLDivElement>, "className"> & {
|
|
10
|
+
/**
|
|
11
|
+
* Additional classes for the card root.
|
|
12
|
+
*/
|
|
13
|
+
className?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Inner spacing for unstructured card content.
|
|
16
|
+
* @default "none"
|
|
17
|
+
*/
|
|
18
|
+
padding?: LayerCardPadding;
|
|
19
|
+
};
|
|
20
|
+
export type LayerCardSectionProps = HTMLAttributes<HTMLDivElement>;
|
|
21
|
+
export type LayerCardLoadingProps = Omit<HTMLAttributes<HTMLDivElement>, "aria-label"> & {
|
|
22
|
+
/**
|
|
23
|
+
* Accessible label announced for the loading state.
|
|
24
|
+
* @default "Loading"
|
|
25
|
+
*/
|
|
26
|
+
label?: string;
|
|
27
|
+
};
|
|
28
|
+
export type LayerCardEmptyProps = Omit<HTMLAttributes<HTMLDivElement>, "title"> & {
|
|
29
|
+
/**
|
|
30
|
+
* Empty-state heading.
|
|
31
|
+
* @default "No content"
|
|
32
|
+
*/
|
|
33
|
+
title?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Supporting empty-state text.
|
|
36
|
+
*/
|
|
37
|
+
description?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Optional empty-state icon.
|
|
40
|
+
*/
|
|
41
|
+
icon?: ReactNode;
|
|
42
|
+
};
|
|
43
|
+
declare function LayerCardSecondary({ className, ...props }: LayerCardSectionProps): import("react").JSX.Element;
|
|
44
|
+
declare function LayerCardPrimary({ className, ...props }: LayerCardSectionProps): import("react").JSX.Element;
|
|
45
|
+
declare function LayerCardHeader({ className, ...props }: LayerCardSectionProps): import("react").JSX.Element;
|
|
46
|
+
declare function LayerCardBody({ className, ...props }: LayerCardSectionProps): import("react").JSX.Element;
|
|
47
|
+
declare function LayerCardFooter({ className, ...props }: LayerCardSectionProps): import("react").JSX.Element;
|
|
48
|
+
declare function LayerCardLoading({ label, className, ...props }: LayerCardLoadingProps): import("react").JSX.Element;
|
|
49
|
+
declare function LayerCardEmpty({ title, description, icon, className, ...props }: LayerCardEmptyProps): import("react").JSX.Element;
|
|
50
|
+
export declare const LayerCard: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "className"> & {
|
|
51
|
+
/**
|
|
52
|
+
* Additional classes for the card root.
|
|
53
|
+
*/
|
|
54
|
+
className?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Inner spacing for unstructured card content.
|
|
57
|
+
* @default "none"
|
|
58
|
+
*/
|
|
59
|
+
padding?: LayerCardPadding;
|
|
60
|
+
} & import("react").RefAttributes<HTMLDivElement>> & {
|
|
61
|
+
Primary: typeof LayerCardPrimary;
|
|
62
|
+
Secondary: typeof LayerCardSecondary;
|
|
63
|
+
Header: typeof LayerCardHeader;
|
|
64
|
+
Body: typeof LayerCardBody;
|
|
65
|
+
Footer: typeof LayerCardFooter;
|
|
66
|
+
Loading: typeof LayerCardLoading;
|
|
67
|
+
Empty: typeof LayerCardEmpty;
|
|
68
|
+
};
|
|
69
|
+
export {};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../utils/cn.js";
|
|
3
|
+
import { Empty as t } from "./empty.js";
|
|
4
|
+
import { SkeletonLine as n } from "./skeleton-line.js";
|
|
5
|
+
import { Children as r, Fragment as i, forwardRef as a, isValidElement as o } from "react";
|
|
6
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/layer-card.tsx
|
|
8
|
+
var l = "overflow-hidden rounded-basalt-lg bg-basalt-bright shadow-xs ring-1 ring-basalt-border", u = "flex w-full flex-col overflow-hidden rounded-basalt-lg bg-basalt-muted text-base ring-1 ring-basalt-border", d = "-my-2 flex items-center gap-2 bg-basalt-muted p-4 text-base font-medium text-basalt-muted-foreground", f = "relative flex flex-col gap-2 overflow-hidden rounded-basalt-lg bg-basalt-bright p-4 pr-3 text-basalt-foreground ring-1 ring-basalt-border", p = {
|
|
9
|
+
none: "",
|
|
10
|
+
sm: "p-3",
|
|
11
|
+
md: "p-4",
|
|
12
|
+
lg: "p-6"
|
|
13
|
+
};
|
|
14
|
+
function m(e) {
|
|
15
|
+
return r.toArray(e).some((e) => o(e) ? e.type === _ || e.type === g || e.type === i && m(e.props.children) : !1);
|
|
16
|
+
}
|
|
17
|
+
var h = a(({ className: t, children: n, padding: r = "none", ...i }, a) => /* @__PURE__ */ s("div", {
|
|
18
|
+
ref: a,
|
|
19
|
+
className: e(m(n) ? u : l, p[r], t),
|
|
20
|
+
...i,
|
|
21
|
+
children: n
|
|
22
|
+
}));
|
|
23
|
+
h.displayName = "LayerCard";
|
|
24
|
+
function g({ className: t, ...n }) {
|
|
25
|
+
return /* @__PURE__ */ s("div", {
|
|
26
|
+
className: e(d, t),
|
|
27
|
+
...n
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
g.displayName = "LayerCard.Secondary";
|
|
31
|
+
function _({ className: t, ...n }) {
|
|
32
|
+
return /* @__PURE__ */ s("div", {
|
|
33
|
+
className: e(f, t),
|
|
34
|
+
...n
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
_.displayName = "LayerCard.Primary";
|
|
38
|
+
function v({ className: t, ...n }) {
|
|
39
|
+
return /* @__PURE__ */ s("div", {
|
|
40
|
+
className: e("flex min-w-0 items-start justify-between gap-4 border-b border-basalt-border px-4 py-3", t),
|
|
41
|
+
...n
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
v.displayName = "LayerCard.Header";
|
|
45
|
+
function y({ className: t, ...n }) {
|
|
46
|
+
return /* @__PURE__ */ s("div", {
|
|
47
|
+
className: e("min-w-0 p-4", t),
|
|
48
|
+
...n
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
y.displayName = "LayerCard.Body";
|
|
52
|
+
function b({ className: t, ...n }) {
|
|
53
|
+
return /* @__PURE__ */ s("div", {
|
|
54
|
+
className: e("flex flex-wrap items-center justify-end gap-2 border-t border-basalt-border px-4 py-3", t),
|
|
55
|
+
...n
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
b.displayName = "LayerCard.Footer";
|
|
59
|
+
function x({ label: t = "Loading", className: r, ...i }) {
|
|
60
|
+
return /* @__PURE__ */ c("div", {
|
|
61
|
+
role: "status",
|
|
62
|
+
"aria-label": t,
|
|
63
|
+
className: e("space-y-3 p-4", r),
|
|
64
|
+
...i,
|
|
65
|
+
children: [
|
|
66
|
+
/* @__PURE__ */ s(n, {
|
|
67
|
+
minWidth: 100,
|
|
68
|
+
maxWidth: 100
|
|
69
|
+
}),
|
|
70
|
+
/* @__PURE__ */ s(n, {
|
|
71
|
+
minWidth: 72,
|
|
72
|
+
maxWidth: 72
|
|
73
|
+
}),
|
|
74
|
+
/* @__PURE__ */ s(n, {
|
|
75
|
+
minWidth: 88,
|
|
76
|
+
maxWidth: 88
|
|
77
|
+
})
|
|
78
|
+
]
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
x.displayName = "LayerCard.Loading";
|
|
82
|
+
function S({ title: n = "No content", description: r, icon: i, className: a, ...o }) {
|
|
83
|
+
return /* @__PURE__ */ s(t, {
|
|
84
|
+
title: n,
|
|
85
|
+
description: r,
|
|
86
|
+
icon: i,
|
|
87
|
+
className: e("p-8", a),
|
|
88
|
+
...o
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
S.displayName = "LayerCard.Empty";
|
|
92
|
+
var C = Object.assign(h, {
|
|
93
|
+
Primary: _,
|
|
94
|
+
Secondary: g,
|
|
95
|
+
Header: v,
|
|
96
|
+
Body: y,
|
|
97
|
+
Footer: b,
|
|
98
|
+
Loading: x,
|
|
99
|
+
Empty: S
|
|
100
|
+
});
|
|
101
|
+
//#endregion
|
|
102
|
+
export { C as LayerCard };
|
|
103
|
+
|
|
104
|
+
//# sourceMappingURL=layer-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layer-card.js","names":[],"sources":["../../src/components/layer-card.tsx"],"sourcesContent":["import {\n\tChildren,\n\tFragment,\n\tforwardRef,\n\ttype HTMLAttributes,\n\tisValidElement,\n\ttype ReactElement,\n\ttype ReactNode,\n} from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { Empty } from \"./empty\";\nimport { SkeletonLine } from \"./skeleton-line\";\n\nconst SURFACE_CLASSES =\n\t\"overflow-hidden rounded-basalt-lg bg-basalt-bright shadow-xs ring-1 ring-basalt-border\";\nconst LAYERED_ROOT_CLASSES =\n\t\"flex w-full flex-col overflow-hidden rounded-basalt-lg bg-basalt-muted text-base ring-1 ring-basalt-border\";\nconst SECONDARY_CLASSES =\n\t\"-my-2 flex items-center gap-2 bg-basalt-muted p-4 text-base font-medium text-basalt-muted-foreground\";\nconst PRIMARY_CLASSES =\n\t\"relative flex flex-col gap-2 overflow-hidden rounded-basalt-lg bg-basalt-bright p-4 pr-3 text-basalt-foreground ring-1 ring-basalt-border\";\nconst PADDING_CLASSES = {\n\tnone: \"\",\n\tsm: \"p-3\",\n\tmd: \"p-4\",\n\tlg: \"p-6\",\n} as const;\n\nexport type LayerCardPadding = keyof typeof PADDING_CLASSES;\n\nexport type LayerCardProps = Omit<HTMLAttributes<HTMLDivElement>, \"className\"> & {\n\t/**\n\t * Additional classes for the card root.\n\t */\n\tclassName?: string;\n\t/**\n\t * Inner spacing for unstructured card content.\n\t * @default \"none\"\n\t */\n\tpadding?: LayerCardPadding;\n};\nexport type LayerCardSectionProps = HTMLAttributes<HTMLDivElement>;\nexport type LayerCardLoadingProps = Omit<HTMLAttributes<HTMLDivElement>, \"aria-label\"> & {\n\t/**\n\t * Accessible label announced for the loading state.\n\t * @default \"Loading\"\n\t */\n\tlabel?: string;\n};\nexport type LayerCardEmptyProps = Omit<HTMLAttributes<HTMLDivElement>, \"title\"> & {\n\t/**\n\t * Empty-state heading.\n\t * @default \"No content\"\n\t */\n\ttitle?: string;\n\t/**\n\t * Supporting empty-state text.\n\t */\n\tdescription?: string;\n\t/**\n\t * Optional empty-state icon.\n\t */\n\ticon?: ReactNode;\n};\n\nfunction hasLayerCardSections(children: ReactNode): boolean {\n\treturn Children.toArray(children).some((child): boolean => {\n\t\tif (!isValidElement(child)) {\n\t\t\treturn false;\n\t\t}\n\t\tif (child.type === LayerCardPrimary || child.type === LayerCardSecondary) {\n\t\t\treturn true;\n\t\t}\n\t\tif (child.type === Fragment) {\n\t\t\tconst fragmentChild = child as ReactElement<{ children?: ReactNode }>;\n\t\t\treturn hasLayerCardSections(fragmentChild.props.children);\n\t\t}\n\t\treturn false;\n\t});\n}\n\nconst LayerCardRoot = forwardRef<HTMLDivElement, LayerCardProps>(\n\t({ className, children, padding = \"none\", ...props }, ref) => (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\thasLayerCardSections(children) ? LAYERED_ROOT_CLASSES : SURFACE_CLASSES,\n\t\t\t\tPADDING_CLASSES[padding],\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</div>\n\t),\n);\nLayerCardRoot.displayName = \"LayerCard\";\n\nfunction LayerCardSecondary({ className, ...props }: LayerCardSectionProps) {\n\treturn <div className={cn(SECONDARY_CLASSES, className)} {...props} />;\n}\nLayerCardSecondary.displayName = \"LayerCard.Secondary\";\n\nfunction LayerCardPrimary({ className, ...props }: LayerCardSectionProps) {\n\treturn <div className={cn(PRIMARY_CLASSES, className)} {...props} />;\n}\nLayerCardPrimary.displayName = \"LayerCard.Primary\";\n\nfunction LayerCardHeader({ className, ...props }: LayerCardSectionProps) {\n\treturn (\n\t\t<div\n\t\t\tclassName={cn(\n\t\t\t\t\"flex min-w-0 items-start justify-between gap-4 border-b border-basalt-border px-4 py-3\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\nLayerCardHeader.displayName = \"LayerCard.Header\";\n\nfunction LayerCardBody({ className, ...props }: LayerCardSectionProps) {\n\treturn <div className={cn(\"min-w-0 p-4\", className)} {...props} />;\n}\nLayerCardBody.displayName = \"LayerCard.Body\";\n\nfunction LayerCardFooter({ className, ...props }: LayerCardSectionProps) {\n\treturn (\n\t\t<div\n\t\t\tclassName={cn(\n\t\t\t\t\"flex flex-wrap items-center justify-end gap-2 border-t border-basalt-border px-4 py-3\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\nLayerCardFooter.displayName = \"LayerCard.Footer\";\n\nfunction LayerCardLoading({ label = \"Loading\", className, ...props }: LayerCardLoadingProps) {\n\treturn (\n\t\t<div role=\"status\" aria-label={label} className={cn(\"space-y-3 p-4\", className)} {...props}>\n\t\t\t<SkeletonLine minWidth={100} maxWidth={100} />\n\t\t\t<SkeletonLine minWidth={72} maxWidth={72} />\n\t\t\t<SkeletonLine minWidth={88} maxWidth={88} />\n\t\t</div>\n\t);\n}\nLayerCardLoading.displayName = \"LayerCard.Loading\";\n\nfunction LayerCardEmpty({\n\ttitle = \"No content\",\n\tdescription,\n\ticon,\n\tclassName,\n\t...props\n}: LayerCardEmptyProps) {\n\treturn (\n\t\t<Empty\n\t\t\ttitle={title}\n\t\t\tdescription={description}\n\t\t\ticon={icon}\n\t\t\tclassName={cn(\"p-8\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\nLayerCardEmpty.displayName = \"LayerCard.Empty\";\n\nexport const LayerCard = Object.assign(LayerCardRoot, {\n\tPrimary: LayerCardPrimary,\n\tSecondary: LayerCardSecondary,\n\tHeader: LayerCardHeader,\n\tBody: LayerCardBody,\n\tFooter: LayerCardFooter,\n\tLoading: LayerCardLoading,\n\tEmpty: LayerCardEmpty,\n});\n"],"mappings":";;;;;;;AAaA,IAAM,IACL,0FACK,IACL,8GACK,IACL,wGACK,IACL,6IACK,IAAkB;CACvB,MAAM;CACN,IAAI;CACJ,IAAI;CACJ,IAAI;AACL;AAuCA,SAAS,EAAqB,GAA8B;CAC3D,OAAO,EAAS,QAAQ,CAAQ,CAAC,CAAC,MAAM,MAClC,EAAe,CAAK,IAGrB,EAAM,SAAS,KAAoB,EAAM,SAAS,KAGlD,EAAM,SAAS,KAEX,EAAqB,EAAc,MAAM,QAAQ,IAPjD,EAUR;AACF;AAEA,IAAM,IAAgB,GACpB,EAAE,cAAW,aAAU,aAAU,QAAQ,GAAG,KAAS,MACrD,kBAAC,OAAD;CACM;CACL,WAAW,EACV,EAAqB,CAAQ,IAAI,IAAuB,GACxD,EAAgB,IAChB,CACD;CACA,GAAI;CAEH;AACG,CAAA,CAEP;AACA,EAAc,cAAc;AAE5B,SAAS,EAAmB,EAAE,cAAW,GAAG,KAAgC;CAC3E,OAAO,kBAAC,OAAD;EAAK,WAAW,EAAG,GAAmB,CAAS;EAAG,GAAI;CAAQ,CAAA;AACtE;AACA,EAAmB,cAAc;AAEjC,SAAS,EAAiB,EAAE,cAAW,GAAG,KAAgC;CACzE,OAAO,kBAAC,OAAD;EAAK,WAAW,EAAG,GAAiB,CAAS;EAAG,GAAI;CAAQ,CAAA;AACpE;AACA,EAAiB,cAAc;AAE/B,SAAS,EAAgB,EAAE,cAAW,GAAG,KAAgC;CACxE,OACC,kBAAC,OAAD;EACC,WAAW,EACV,0FACA,CACD;EACA,GAAI;CACJ,CAAA;AAEH;AACA,EAAgB,cAAc;AAE9B,SAAS,EAAc,EAAE,cAAW,GAAG,KAAgC;CACtE,OAAO,kBAAC,OAAD;EAAK,WAAW,EAAG,eAAe,CAAS;EAAG,GAAI;CAAQ,CAAA;AAClE;AACA,EAAc,cAAc;AAE5B,SAAS,EAAgB,EAAE,cAAW,GAAG,KAAgC;CACxE,OACC,kBAAC,OAAD;EACC,WAAW,EACV,yFACA,CACD;EACA,GAAI;CACJ,CAAA;AAEH;AACA,EAAgB,cAAc;AAE9B,SAAS,EAAiB,EAAE,WAAQ,WAAW,cAAW,GAAG,KAAgC;CAC5F,OACC,kBAAC,OAAD;EAAK,MAAK;EAAS,cAAY;EAAO,WAAW,EAAG,iBAAiB,CAAS;EAAG,GAAI;EAArF,UAAA;GACC,kBAAC,GAAD;IAAc,UAAU;IAAK,UAAU;GAAM,CAAA;GAC7C,kBAAC,GAAD;IAAc,UAAU;IAAI,UAAU;GAAK,CAAA;GAC3C,kBAAC,GAAD;IAAc,UAAU;IAAI,UAAU;GAAK,CAAA;EACvC;;AAEP;AACA,EAAiB,cAAc;AAE/B,SAAS,EAAe,EACvB,WAAQ,cACR,gBACA,SACA,cACA,GAAG,KACoB;CACvB,OACC,kBAAC,GAAD;EACQ;EACM;EACP;EACN,WAAW,EAAG,OAAO,CAAS;EAC9B,GAAI;CACJ,CAAA;AAEH;AACA,EAAe,cAAc;AAE7B,IAAa,IAAY,OAAO,OAAO,GAAe;CACrD,SAAS;CACT,WAAW;CACX,QAAQ;CACR,MAAM;CACN,QAAQ;CACR,SAAS;CACT,OAAO;AACR,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
export type LinkProps = Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, "href"> & Record<string, unknown> & {
|
|
3
|
+
/**
|
|
4
|
+
* The link destination.
|
|
5
|
+
*/
|
|
6
|
+
href: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function Link({ className, href, children, ...props }: LinkProps): React.JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../utils/cn.js";
|
|
3
|
+
import { useLinkComponent as t } from "../providers/link.js";
|
|
4
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/link.tsx
|
|
6
|
+
function r({ className: r, href: i, children: a, ...o }) {
|
|
7
|
+
let s = t();
|
|
8
|
+
return /* @__PURE__ */ n(s, {
|
|
9
|
+
href: i,
|
|
10
|
+
className: e("text-basalt-primary underline-offset-4 hover:underline", r),
|
|
11
|
+
...o,
|
|
12
|
+
children: a
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { r as Link };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.js","names":[],"sources":["../../src/components/link.tsx"],"sourcesContent":["import type * as React from \"react\";\nimport { useLinkComponent } from \"../providers/link\";\nimport { cn } from \"../utils/cn\";\n\nexport type LinkProps = Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, \"href\"> &\n\tRecord<string, unknown> & {\n\t\t/**\n\t\t * The link destination.\n\t\t */\n\t\thref: string;\n\t};\n\nexport function Link({ className, href, children, ...props }: LinkProps) {\n\tconst Comp = useLinkComponent();\n\treturn (\n\t\t<Comp\n\t\t\thref={href}\n\t\t\tclassName={cn(\"text-basalt-primary underline-offset-4 hover:underline\", className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</Comp>\n\t);\n}\n"],"mappings":";;;;;AAYA,SAAgB,EAAK,EAAE,cAAW,SAAM,aAAU,GAAG,KAAoB;CACxE,IAAM,IAAO,EAAiB;CAC9B,OACC,kBAAC,GAAD;EACO;EACN,WAAW,EAAG,0DAA0D,CAAS;EACjF,GAAI;EAEH;CACI,CAAA;AAER"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../utils/cn.js";
|
|
3
|
+
import { useId as t } from "react";
|
|
4
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/loader.tsx
|
|
6
|
+
function i({ className: i, size: a = 24, ...o }) {
|
|
7
|
+
let s = `basalt-loader-${t().replace(/:/g, "")}`;
|
|
8
|
+
return /* @__PURE__ */ r("svg", {
|
|
9
|
+
viewBox: "0 0 24 24",
|
|
10
|
+
role: "status",
|
|
11
|
+
"aria-label": "Loading",
|
|
12
|
+
...o,
|
|
13
|
+
width: a,
|
|
14
|
+
height: a,
|
|
15
|
+
className: e("origin-center animate-basalt-loader text-basalt-primary motion-reduce:animate-none", i),
|
|
16
|
+
children: [
|
|
17
|
+
/* @__PURE__ */ n("defs", { children: /* @__PURE__ */ r("linearGradient", {
|
|
18
|
+
id: s,
|
|
19
|
+
x1: "0%",
|
|
20
|
+
y1: "0%",
|
|
21
|
+
x2: "100%",
|
|
22
|
+
y2: "0%",
|
|
23
|
+
children: [
|
|
24
|
+
/* @__PURE__ */ n("stop", {
|
|
25
|
+
offset: "0%",
|
|
26
|
+
stopColor: "currentColor",
|
|
27
|
+
stopOpacity: "0"
|
|
28
|
+
}),
|
|
29
|
+
/* @__PURE__ */ n("stop", {
|
|
30
|
+
offset: "55%",
|
|
31
|
+
stopColor: "currentColor",
|
|
32
|
+
stopOpacity: "0.35"
|
|
33
|
+
}),
|
|
34
|
+
/* @__PURE__ */ n("stop", {
|
|
35
|
+
offset: "100%",
|
|
36
|
+
stopColor: "currentColor",
|
|
37
|
+
stopOpacity: "1"
|
|
38
|
+
})
|
|
39
|
+
]
|
|
40
|
+
}) }),
|
|
41
|
+
/* @__PURE__ */ n("circle", {
|
|
42
|
+
cx: "12",
|
|
43
|
+
cy: "12",
|
|
44
|
+
r: "9.5",
|
|
45
|
+
fill: "none",
|
|
46
|
+
opacity: "0.12",
|
|
47
|
+
stroke: "currentColor",
|
|
48
|
+
strokeWidth: "2.25"
|
|
49
|
+
}),
|
|
50
|
+
/* @__PURE__ */ n("circle", {
|
|
51
|
+
cx: "12",
|
|
52
|
+
cy: "12",
|
|
53
|
+
r: "9.5",
|
|
54
|
+
fill: "none",
|
|
55
|
+
stroke: `url(#${s})`,
|
|
56
|
+
strokeWidth: "2.25",
|
|
57
|
+
strokeLinecap: "round",
|
|
58
|
+
strokeDasharray: "36 60"
|
|
59
|
+
})
|
|
60
|
+
]
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
//#endregion
|
|
64
|
+
export { i as Loader };
|
|
65
|
+
|
|
66
|
+
//# sourceMappingURL=loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.js","names":[],"sources":["../../src/components/loader.tsx"],"sourcesContent":["import { type SVGAttributes, useId } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport function Loader({\n\tclassName,\n\tsize = 24,\n\t...props\n}: SVGAttributes<SVGSVGElement> & { size?: number }) {\n\tconst gradientId = `basalt-loader-${useId().replace(/:/g, \"\")}`;\n\treturn (\n\t\t<svg\n\t\t\tviewBox=\"0 0 24 24\"\n\t\t\trole=\"status\"\n\t\t\taria-label=\"Loading\"\n\t\t\t{...props}\n\t\t\twidth={size}\n\t\t\theight={size}\n\t\t\tclassName={cn(\n\t\t\t\t\"origin-center animate-basalt-loader text-basalt-primary motion-reduce:animate-none\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<defs>\n\t\t\t\t<linearGradient id={gradientId} x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\">\n\t\t\t\t\t<stop offset=\"0%\" stopColor=\"currentColor\" stopOpacity=\"0\" />\n\t\t\t\t\t<stop offset=\"55%\" stopColor=\"currentColor\" stopOpacity=\"0.35\" />\n\t\t\t\t\t<stop offset=\"100%\" stopColor=\"currentColor\" stopOpacity=\"1\" />\n\t\t\t\t</linearGradient>\n\t\t\t</defs>\n\t\t\t<circle\n\t\t\t\tcx=\"12\"\n\t\t\t\tcy=\"12\"\n\t\t\t\tr=\"9.5\"\n\t\t\t\tfill=\"none\"\n\t\t\t\topacity=\"0.12\"\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeWidth=\"2.25\"\n\t\t\t/>\n\t\t\t<circle\n\t\t\t\tcx=\"12\"\n\t\t\t\tcy=\"12\"\n\t\t\t\tr=\"9.5\"\n\t\t\t\tfill=\"none\"\n\t\t\t\tstroke={`url(#${gradientId})`}\n\t\t\t\tstrokeWidth=\"2.25\"\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeDasharray=\"36 60\"\n\t\t\t/>\n\t\t</svg>\n\t);\n}\n"],"mappings":";;;;;AAGA,SAAgB,EAAO,EACtB,cACA,UAAO,IACP,GAAG,KACiD;CACpD,IAAM,IAAa,iBAAiB,EAAM,CAAC,CAAC,QAAQ,MAAM,EAAE;CAC5D,OACC,kBAAC,OAAD;EACC,SAAQ;EACR,MAAK;EACL,cAAW;EACX,GAAI;EACJ,OAAO;EACP,QAAQ;EACR,WAAW,EACV,sFACA,CACD;EAVD,UAAA;GAYC,kBAAC,QAAD,EAAA,UACC,kBAAC,kBAAD;IAAgB,IAAI;IAAY,IAAG;IAAK,IAAG;IAAK,IAAG;IAAO,IAAG;IAA7D,UAAA;KACC,kBAAC,QAAD;MAAM,QAAO;MAAK,WAAU;MAAe,aAAY;KAAK,CAAA;KAC5D,kBAAC,QAAD;MAAM,QAAO;MAAM,WAAU;MAAe,aAAY;KAAQ,CAAA;KAChE,kBAAC,QAAD;MAAM,QAAO;MAAO,WAAU;MAAe,aAAY;KAAK,CAAA;IAC/C;GACX,CAAA,EAAA,CAAA;GACN,kBAAC,UAAD;IACC,IAAG;IACH,IAAG;IACH,GAAE;IACF,MAAK;IACL,SAAQ;IACR,QAAO;IACP,aAAY;GACZ,CAAA;GACD,kBAAC,UAAD;IACC,IAAG;IACH,IAAG;IACH,GAAE;IACF,MAAK;IACL,QAAQ,QAAQ,EAAW;IAC3B,aAAY;IACZ,eAAc;IACd,iBAAgB;GAChB,CAAA;EACG;;AAEP"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../utils/cn.js";
|
|
3
|
+
import { BasaltMark as t } from "./basalt-mark.js";
|
|
4
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/loading-screen.tsx
|
|
6
|
+
function i({ label: i = "Loading", mark: a, className: o, ...s }) {
|
|
7
|
+
return /* @__PURE__ */ n("div", {
|
|
8
|
+
role: "status",
|
|
9
|
+
"aria-label": i,
|
|
10
|
+
className: e("fixed inset-0 z-50 flex items-center justify-center bg-basalt-background", o),
|
|
11
|
+
...s,
|
|
12
|
+
children: /* @__PURE__ */ r("div", {
|
|
13
|
+
className: "relative",
|
|
14
|
+
children: [/* @__PURE__ */ n("div", {
|
|
15
|
+
className: "flex h-72 w-72 items-center justify-center overflow-hidden rounded-full bg-basalt-secondary p-6 ring-1 ring-basalt-border",
|
|
16
|
+
children: a ?? /* @__PURE__ */ n(t, { className: "h-28 w-28 text-basalt-muted-foreground" })
|
|
17
|
+
}), /* @__PURE__ */ n("div", { className: "absolute inset-[-4px] animate-basalt-spin rounded-full border-[3px] border-transparent border-t-basalt-primary motion-reduce:animate-none" })]
|
|
18
|
+
})
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { i as LoadingScreen };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=loading-screen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loading-screen.js","names":[],"sources":["../../src/components/loading-screen.tsx"],"sourcesContent":["import type { HTMLAttributes, ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { BasaltMark } from \"./basalt-mark\";\n\nexport function LoadingScreen({\n\tlabel = \"Loading\",\n\tmark,\n\tclassName,\n\t...props\n}: HTMLAttributes<HTMLDivElement> & {\n\tlabel?: string;\n\tmark?: ReactNode;\n}) {\n\treturn (\n\t\t<div\n\t\t\trole=\"status\"\n\t\t\taria-label={label}\n\t\t\tclassName={cn(\n\t\t\t\t\"fixed inset-0 z-50 flex items-center justify-center bg-basalt-background\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<div className=\"relative\">\n\t\t\t\t<div className=\"flex h-72 w-72 items-center justify-center overflow-hidden rounded-full bg-basalt-secondary p-6 ring-1 ring-basalt-border\">\n\t\t\t\t\t{mark ?? <BasaltMark className=\"h-28 w-28 text-basalt-muted-foreground\" />}\n\t\t\t\t</div>\n\t\t\t\t<div className=\"absolute inset-[-4px] animate-basalt-spin rounded-full border-[3px] border-transparent border-t-basalt-primary motion-reduce:animate-none\" />\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;AAIA,SAAgB,EAAc,EAC7B,WAAQ,WACR,SACA,cACA,GAAG,KAID;CACF,OACC,kBAAC,OAAD;EACC,MAAK;EACL,cAAY;EACZ,WAAW,EACV,4EACA,CACD;EACA,GAAI;EAEJ,UAAA,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACC,kBAAC,OAAD;IAAK,WAAU;IACb,UAAA,KAAQ,kBAAC,GAAD,EAAY,WAAU,yCAA0C,CAAA;GACrE,CAAA,GACL,kBAAC,OAAD,EAAK,WAAU,4IAA6I,CAAA,CACxJ;;CACD,CAAA;AAEP"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as MenubarPrimitive from "@radix-ui/react-menubar";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export declare function MenuBar(props: React.ComponentProps<typeof MenubarPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
export declare function MenuBarMenu(props: React.ComponentProps<typeof MenubarPrimitive.Menu>): React.JSX.Element;
|
|
5
|
+
export declare const MenuBarTrigger: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
export declare const MenuBarContent: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export declare const MenuBarItem: React.ForwardRefExoticComponent<Omit<MenubarPrimitive.MenubarItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export declare function MenuBarRoot({ className, ...props }: React.ComponentProps<typeof MenubarPrimitive.Root>): React.JSX.Element;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../utils/cn.js";
|
|
3
|
+
import { overlayItemClass as t, overlayPanelClass as n } from "./overlay.js";
|
|
4
|
+
import * as r from "react";
|
|
5
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
6
|
+
import * as a from "@radix-ui/react-menubar";
|
|
7
|
+
//#region src/components/menu-bar.tsx
|
|
8
|
+
function o(e) {
|
|
9
|
+
return /* @__PURE__ */ i(d, { ...e });
|
|
10
|
+
}
|
|
11
|
+
function s(e) {
|
|
12
|
+
return /* @__PURE__ */ i(a.Menu, { ...e });
|
|
13
|
+
}
|
|
14
|
+
var c = r.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ i(a.Trigger, {
|
|
15
|
+
ref: r,
|
|
16
|
+
className: e("inline-flex h-8 items-center rounded-basalt-sm px-3 text-sm font-medium outline-hidden hover:bg-basalt-accent data-[state=open]:bg-basalt-accent", t),
|
|
17
|
+
...n
|
|
18
|
+
}));
|
|
19
|
+
c.displayName = a.Trigger.displayName;
|
|
20
|
+
var l = r.forwardRef(({ className: t, sideOffset: r = 8, ...o }, s) => /* @__PURE__ */ i(a.Portal, { children: /* @__PURE__ */ i(a.Content, {
|
|
21
|
+
ref: s,
|
|
22
|
+
sideOffset: r,
|
|
23
|
+
className: n(e("min-w-40", t)),
|
|
24
|
+
...o
|
|
25
|
+
}) }));
|
|
26
|
+
l.displayName = a.Content.displayName;
|
|
27
|
+
var u = r.forwardRef(({ className: n, ...r }, o) => /* @__PURE__ */ i(a.Item, {
|
|
28
|
+
ref: o,
|
|
29
|
+
className: t(e("relative outline-hidden focus:bg-basalt-accent", n)),
|
|
30
|
+
...r
|
|
31
|
+
}));
|
|
32
|
+
u.displayName = a.Item.displayName;
|
|
33
|
+
function d({ className: t, ...n }) {
|
|
34
|
+
return /* @__PURE__ */ i(a.Root, {
|
|
35
|
+
className: e("flex h-9 items-center gap-0.5 rounded-basalt-md border border-basalt-border bg-basalt-popover px-1", t),
|
|
36
|
+
...n
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
export { o as MenuBar, l as MenuBarContent, u as MenuBarItem, s as MenuBarMenu, d as MenuBarRoot, c as MenuBarTrigger };
|
|
41
|
+
|
|
42
|
+
//# sourceMappingURL=menu-bar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu-bar.js","names":[],"sources":["../../src/components/menu-bar.tsx"],"sourcesContent":["import * as MenubarPrimitive from \"@radix-ui/react-menubar\";\nimport * as React from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { MENU_GAP, overlayItemClass, overlayPanelClass } from \"./overlay\";\n\nexport function MenuBar(props: React.ComponentProps<typeof MenubarPrimitive.Root>) {\n\treturn <MenuBarRoot {...props} />;\n}\n\nexport function MenuBarMenu(props: React.ComponentProps<typeof MenubarPrimitive.Menu>) {\n\treturn <MenubarPrimitive.Menu {...props} />;\n}\n\nexport const MenuBarTrigger = React.forwardRef<\n\tReact.ElementRef<typeof MenubarPrimitive.Trigger>,\n\tReact.ComponentPropsWithoutRef<typeof MenubarPrimitive.Trigger>\n>(({ className, ...props }, ref) => (\n\t<MenubarPrimitive.Trigger\n\t\tref={ref}\n\t\tclassName={cn(\n\t\t\t\"inline-flex h-8 items-center rounded-basalt-sm px-3 text-sm font-medium outline-hidden hover:bg-basalt-accent data-[state=open]:bg-basalt-accent\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n));\nMenuBarTrigger.displayName = MenubarPrimitive.Trigger.displayName;\n\nexport const MenuBarContent = React.forwardRef<\n\tReact.ElementRef<typeof MenubarPrimitive.Content>,\n\tReact.ComponentPropsWithoutRef<typeof MenubarPrimitive.Content>\n>(({ className, sideOffset = MENU_GAP, ...props }, ref) => (\n\t<MenubarPrimitive.Portal>\n\t\t<MenubarPrimitive.Content\n\t\t\tref={ref}\n\t\t\tsideOffset={sideOffset}\n\t\t\tclassName={overlayPanelClass(cn(\"min-w-40\", className))}\n\t\t\t{...props}\n\t\t/>\n\t</MenubarPrimitive.Portal>\n));\nMenuBarContent.displayName = MenubarPrimitive.Content.displayName;\n\nexport const MenuBarItem = React.forwardRef<\n\tReact.ElementRef<typeof MenubarPrimitive.Item>,\n\tReact.ComponentPropsWithoutRef<typeof MenubarPrimitive.Item>\n>(({ className, ...props }, ref) => (\n\t<MenubarPrimitive.Item\n\t\tref={ref}\n\t\tclassName={overlayItemClass(cn(\"relative outline-hidden focus:bg-basalt-accent\", className))}\n\t\t{...props}\n\t/>\n));\nMenuBarItem.displayName = MenubarPrimitive.Item.displayName;\n\nexport function MenuBarRoot({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof MenubarPrimitive.Root>) {\n\treturn (\n\t\t<MenubarPrimitive.Root\n\t\t\tclassName={cn(\n\t\t\t\t\"flex h-9 items-center gap-0.5 rounded-basalt-md border border-basalt-border bg-basalt-popover px-1\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAKA,SAAgB,EAAQ,GAA2D;CAClF,OAAO,kBAAC,GAAD,EAAa,GAAI,EAAQ,CAAA;AACjC;AAEA,SAAgB,EAAY,GAA2D;CACtF,OAAO,kBAAC,EAAiB,MAAlB,EAAuB,GAAI,EAAQ,CAAA;AAC3C;AAEA,IAAa,IAAiB,EAAM,YAGjC,EAAE,cAAW,GAAG,KAAS,MAC3B,kBAAC,EAAiB,SAAlB;CACM;CACL,WAAW,EACV,oJACA,CACD;CACA,GAAI;AACJ,CAAA,CACD;AACD,EAAe,cAAc,EAAiB,QAAQ;AAEtD,IAAa,IAAiB,EAAM,YAGjC,EAAE,cAAW,gBAAA,GAAuB,GAAG,KAAS,MAClD,kBAAC,EAAiB,QAAlB,EAAA,UACC,kBAAC,EAAiB,SAAlB;CACM;CACO;CACZ,WAAW,EAAkB,EAAG,YAAY,CAAS,CAAC;CACtD,GAAI;AACJ,CAAA,EACuB,CAAA,CACzB;AACD,EAAe,cAAc,EAAiB,QAAQ;AAEtD,IAAa,IAAc,EAAM,YAG9B,EAAE,cAAW,GAAG,KAAS,MAC3B,kBAAC,EAAiB,MAAlB;CACM;CACL,WAAW,EAAiB,EAAG,kDAAkD,CAAS,CAAC;CAC3F,GAAI;AACJ,CAAA,CACD;AACD,EAAY,cAAc,EAAiB,KAAK;AAEhD,SAAgB,EAAY,EAC3B,cACA,GAAG,KACmD;CACtD,OACC,kBAAC,EAAiB,MAAlB;EACC,WAAW,EACV,sGACA,CACD;EACA,GAAI;CACJ,CAAA;AAEH"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function Meter({ value, label, customValue, hideValue, className, "aria-label": ariaLabel, }: {
|
|
2
|
+
value?: number;
|
|
3
|
+
label?: string;
|
|
4
|
+
customValue?: string;
|
|
5
|
+
hideValue?: boolean;
|
|
6
|
+
className?: string;
|
|
7
|
+
"aria-label"?: string;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../utils/cn.js";
|
|
3
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
|
+
import * as r from "@radix-ui/react-progress";
|
|
5
|
+
//#region src/components/meter.tsx
|
|
6
|
+
function i({ value: i = 0, label: a, customValue: o, hideValue: s = !1, className: c, "aria-label": l }) {
|
|
7
|
+
return /* @__PURE__ */ n("div", {
|
|
8
|
+
className: e("w-full space-y-1", c),
|
|
9
|
+
children: [a || !s && o ? /* @__PURE__ */ n("div", {
|
|
10
|
+
className: "flex justify-between text-xs text-basalt-muted-foreground",
|
|
11
|
+
children: [/* @__PURE__ */ t("span", { children: a }), s ? null : /* @__PURE__ */ t("span", { children: o ?? `${i}%` })]
|
|
12
|
+
}) : null, /* @__PURE__ */ t(r.Root, {
|
|
13
|
+
value: i,
|
|
14
|
+
"aria-label": l ?? a,
|
|
15
|
+
className: "relative h-2 overflow-hidden rounded-full bg-basalt-muted",
|
|
16
|
+
children: /* @__PURE__ */ t(r.Indicator, {
|
|
17
|
+
className: "h-full bg-basalt-primary transition-[width]",
|
|
18
|
+
style: { width: `${Math.min(100, Math.max(0, i))}%` }
|
|
19
|
+
})
|
|
20
|
+
})]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { i as Meter };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=meter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meter.js","names":[],"sources":["../../src/components/meter.tsx"],"sourcesContent":["import * as Progress from \"@radix-ui/react-progress\";\nimport { cn } from \"../utils/cn\";\n\nexport function Meter({\n\tvalue = 0,\n\tlabel,\n\tcustomValue,\n\thideValue = false,\n\tclassName,\n\t\"aria-label\": ariaLabel,\n}: {\n\tvalue?: number;\n\tlabel?: string;\n\tcustomValue?: string;\n\thideValue?: boolean;\n\tclassName?: string;\n\t\"aria-label\"?: string;\n}) {\n\treturn (\n\t\t<div className={cn(\"w-full space-y-1\", className)}>\n\t\t\t{label || (!hideValue && customValue) ? (\n\t\t\t\t<div className=\"flex justify-between text-xs text-basalt-muted-foreground\">\n\t\t\t\t\t<span>{label}</span>\n\t\t\t\t\t{hideValue ? null : <span>{customValue ?? `${value}%`}</span>}\n\t\t\t\t</div>\n\t\t\t) : null}\n\t\t\t<Progress.Root\n\t\t\t\tvalue={value}\n\t\t\t\taria-label={ariaLabel ?? label}\n\t\t\t\tclassName=\"relative h-2 overflow-hidden rounded-full bg-basalt-muted\"\n\t\t\t>\n\t\t\t\t<Progress.Indicator\n\t\t\t\t\tclassName=\"h-full bg-basalt-primary transition-[width]\"\n\t\t\t\t\tstyle={{ width: `${Math.min(100, Math.max(0, value))}%` }}\n\t\t\t\t/>\n\t\t\t</Progress.Root>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;AAGA,SAAgB,EAAM,EACrB,WAAQ,GACR,UACA,gBACA,eAAY,IACZ,cACA,cAAc,KAQZ;CACF,OACC,kBAAC,OAAD;EAAK,WAAW,EAAG,oBAAoB,CAAS;EAAhD,UAAA,CACE,KAAU,CAAC,KAAa,IACxB,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACC,kBAAC,QAAD,EAAA,UAAO,EAAY,CAAA,GAClB,IAAY,OAAO,kBAAC,QAAD,EAAA,UAAO,KAAe,GAAG,EAAM,GAAS,CAAA,CACxD;EACF,CAAA,IAAA,MACJ,kBAAC,EAAS,MAAV;GACQ;GACP,cAAY,KAAa;GACzB,WAAU;GAEV,UAAA,kBAAC,EAAS,WAAV;IACC,WAAU;IACV,OAAO,EAAE,OAAO,GAAG,KAAK,IAAI,KAAK,KAAK,IAAI,GAAG,CAAK,CAAC,EAAE,GAAG;GACxD,CAAA;EACa,CAAA,CACX;;AAEP"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
export declare const NavigationMenu: import("react").ForwardRefExoticComponent<NavigationMenuPrimitive.NavigationMenuProps & import("react").RefAttributes<HTMLElement>>;
|
|
4
|
+
export declare const NavigationMenuList: import("react").ForwardRefExoticComponent<NavigationMenuPrimitive.NavigationMenuListProps & import("react").RefAttributes<HTMLUListElement>>;
|
|
5
|
+
export declare const NavigationMenuItem: import("react").ForwardRefExoticComponent<NavigationMenuPrimitive.NavigationMenuItemProps & import("react").RefAttributes<HTMLLIElement>>;
|
|
6
|
+
export declare function NavigationMenuLink({ className, ...props }: ComponentProps<typeof NavigationMenuPrimitive.Link>): import("react").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../utils/cn.js";
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
import * as n from "@radix-ui/react-navigation-menu";
|
|
5
|
+
//#region src/components/navigation-menu.tsx
|
|
6
|
+
var r = n.Root, i = n.List, a = n.Item;
|
|
7
|
+
function o({ className: r, ...i }) {
|
|
8
|
+
return /* @__PURE__ */ t(n.Link, {
|
|
9
|
+
className: e("rounded-basalt-md px-3 py-2 text-sm hover:bg-basalt-accent", r),
|
|
10
|
+
...i
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { r as NavigationMenu, a as NavigationMenuItem, o as NavigationMenuLink, i as NavigationMenuList };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=navigation-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-menu.js","names":[],"sources":["../../src/components/navigation-menu.tsx"],"sourcesContent":["import * as NavigationMenuPrimitive from \"@radix-ui/react-navigation-menu\";\nimport type { ComponentProps } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport const NavigationMenu = NavigationMenuPrimitive.Root;\nexport const NavigationMenuList = NavigationMenuPrimitive.List;\nexport const NavigationMenuItem = NavigationMenuPrimitive.Item;\n\nexport function NavigationMenuLink({\n\tclassName,\n\t...props\n}: ComponentProps<typeof NavigationMenuPrimitive.Link>) {\n\treturn (\n\t\t<NavigationMenuPrimitive.Link\n\t\t\tclassName={cn(\"rounded-basalt-md px-3 py-2 text-sm hover:bg-basalt-accent\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;AAIA,IAAa,IAAiB,EAAwB,MACzC,IAAqB,EAAwB,MAC7C,IAAqB,EAAwB;AAE1D,SAAgB,EAAmB,EAClC,cACA,GAAG,KACoD;CACvD,OACC,kBAAC,EAAwB,MAAzB;EACC,WAAW,EAAG,8DAA8D,CAAS;EACrF,GAAI;CACJ,CAAA;AAEH"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Gap between a field trigger and its list. Matches Kumo Select/Combobox. */
|
|
2
|
+
export declare const OVERLAY_GAP = 4;
|
|
3
|
+
/** Gap between a menu trigger and its panel. Matches Kumo Dropdown/Popover. */
|
|
4
|
+
export declare const MENU_GAP = 8;
|
|
5
|
+
/** Shared stacking layer for portals, menus, and chrome overlays. */
|
|
6
|
+
export declare const OVERLAY_LAYER = "z-50";
|
|
7
|
+
/** Kill CSS animation and transition when the user prefers reduced motion. */
|
|
8
|
+
export declare const OVERLAY_MOTION = "motion-reduce:animate-none motion-reduce:transition-none";
|
|
9
|
+
/** Recolor the existing 1px border. No extra ring, no layout shift. */
|
|
10
|
+
export declare const FOCUS_BORDER = "outline-hidden focus-visible:border-basalt-ring";
|
|
11
|
+
/** Inset 1px theme ring for borderless controls. Outer size stays put. */
|
|
12
|
+
export declare const FOCUS_INSET = "outline-hidden focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-basalt-ring";
|
|
13
|
+
/** Offset ring stays visible on primary fills (ring token equals primary). */
|
|
14
|
+
export declare const FOCUS_RING = "outline-hidden focus-visible:ring-2 focus-visible:ring-basalt-ring focus-visible:ring-offset-2 focus-visible:ring-offset-basalt-background";
|
|
15
|
+
export declare function overlayPanelClass(className?: string): string;
|
|
16
|
+
export declare function overlayItemClass(className?: string): string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../utils/cn.js";
|
|
3
|
+
//#region src/components/overlay.ts
|
|
4
|
+
var t = 4, n = 8, r = "z-50", i = "motion-reduce:animate-none motion-reduce:transition-none", a = "outline-hidden focus-visible:border-basalt-ring", o = "outline-hidden focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-basalt-ring", s = "outline-hidden focus-visible:ring-2 focus-visible:ring-basalt-ring focus-visible:ring-offset-2 focus-visible:ring-offset-basalt-background";
|
|
5
|
+
function c(t) {
|
|
6
|
+
return e(r, "overflow-hidden rounded-basalt-md border border-basalt-border bg-basalt-popover py-1.5 text-sm text-basalt-popover-foreground shadow-md", i, t);
|
|
7
|
+
}
|
|
8
|
+
function l(t) {
|
|
9
|
+
return e("mx-1.5 flex w-[calc(100%-0.75rem)] cursor-default items-center rounded-basalt-sm px-2 py-1.5 text-left text-sm outline-hidden select-none", t);
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { a as FOCUS_BORDER, o as FOCUS_INSET, s as FOCUS_RING, n as MENU_GAP, t as OVERLAY_GAP, r as OVERLAY_LAYER, i as OVERLAY_MOTION, l as overlayItemClass, c as overlayPanelClass };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=overlay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overlay.js","names":[],"sources":["../../src/components/overlay.ts"],"sourcesContent":["import { cn } from \"../utils/cn\";\n\n/** Gap between a field trigger and its list. Matches Kumo Select/Combobox. */\nexport const OVERLAY_GAP = 4;\n/** Gap between a menu trigger and its panel. Matches Kumo Dropdown/Popover. */\nexport const MENU_GAP = 8;\n/** Shared stacking layer for portals, menus, and chrome overlays. */\nexport const OVERLAY_LAYER = \"z-50\";\n/** Kill CSS animation and transition when the user prefers reduced motion. */\nexport const OVERLAY_MOTION = \"motion-reduce:animate-none motion-reduce:transition-none\";\n\n/** Recolor the existing 1px border. No extra ring, no layout shift. */\nexport const FOCUS_BORDER = \"outline-hidden focus-visible:border-basalt-ring\";\n/** Inset 1px theme ring for borderless controls. Outer size stays put. */\nexport const FOCUS_INSET =\n\t\"outline-hidden focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-basalt-ring\";\n/** Offset ring stays visible on primary fills (ring token equals primary). */\nexport const FOCUS_RING =\n\t\"outline-hidden focus-visible:ring-2 focus-visible:ring-basalt-ring focus-visible:ring-offset-2 focus-visible:ring-offset-basalt-background\";\n\nexport function overlayPanelClass(className?: string) {\n\treturn cn(\n\t\tOVERLAY_LAYER,\n\t\t\"overflow-hidden rounded-basalt-md border border-basalt-border bg-basalt-popover py-1.5 text-sm text-basalt-popover-foreground shadow-md\",\n\t\tOVERLAY_MOTION,\n\t\tclassName,\n\t);\n}\n\nexport function overlayItemClass(className?: string) {\n\treturn cn(\n\t\t\"mx-1.5 flex w-[calc(100%-0.75rem)] cursor-default items-center rounded-basalt-sm px-2 py-1.5 text-left text-sm outline-hidden select-none\",\n\t\tclassName,\n\t);\n}\n"],"mappings":";;;AAGA,IAAa,IAAc,GAEd,IAAW,GAEX,IAAgB,QAEhB,IAAiB,4DAGjB,IAAe,mDAEf,IACZ,+FAEY,IACZ;AAED,SAAgB,EAAkB,GAAoB;CACrD,OAAO,EACN,GACA,2IACA,GACA,CACD;AACD;AAEA,SAAgB,EAAiB,GAAoB;CACpD,OAAO,EACN,6IACA,CACD;AACD"}
|