xiod-ui 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +73 -0
- package/README.md +167 -0
- package/dist/components/accordion.d.ts +9 -0
- package/dist/components/accordion.js +46 -0
- package/dist/components/agent-steps.d.ts +47 -0
- package/dist/components/agent-steps.js +223 -0
- package/dist/components/alert-dialog.d.ts +21 -0
- package/dist/components/alert-dialog.js +74 -0
- package/dist/components/alert.d.ts +12 -0
- package/dist/components/alert.js +45 -0
- package/dist/components/aspect-ratio.d.ts +9 -0
- package/dist/components/aspect-ratio.js +22 -0
- package/dist/components/autocomplete.d.ts +35 -0
- package/dist/components/autocomplete.js +160 -0
- package/dist/components/avatar.d.ts +17 -0
- package/dist/components/avatar.js +65 -0
- package/dist/components/badge.d.ts +15 -0
- package/dist/components/badge.js +46 -0
- package/dist/components/breadcrumb.d.ts +12 -0
- package/dist/components/breadcrumb.js +75 -0
- package/dist/components/button-group.d.ts +14 -0
- package/dist/components/button-group.js +45 -0
- package/dist/components/button-split.d.ts +19 -0
- package/dist/components/button-split.js +73 -0
- package/dist/components/button.d.ts +15 -0
- package/dist/components/button.js +54 -0
- package/dist/components/calendar.d.ts +63 -0
- package/dist/components/calendar.js +425 -0
- package/dist/components/card.d.ts +17 -0
- package/dist/components/card.js +139 -0
- package/dist/components/carousel.d.ts +59 -0
- package/dist/components/carousel.js +503 -0
- package/dist/components/checkbox.d.ts +16 -0
- package/dist/components/checkbox.js +86 -0
- package/dist/components/circular-progress.d.ts +28 -0
- package/dist/components/circular-progress.js +127 -0
- package/dist/components/collapsible.d.ts +8 -0
- package/dist/components/collapsible.js +27 -0
- package/dist/components/color-picker.d.ts +159 -0
- package/dist/components/color-picker.js +1589 -0
- package/dist/components/combobox.d.ts +46 -0
- package/dist/components/combobox.js +237 -0
- package/dist/components/command.d.ts +22 -0
- package/dist/components/command.js +129 -0
- package/dist/components/context-menu.d.ts +38 -0
- package/dist/components/context-menu.js +164 -0
- package/dist/components/copy-to-clipboard.d.ts +32 -0
- package/dist/components/copy-to-clipboard.js +83 -0
- package/dist/components/corner-badge.d.ts +22 -0
- package/dist/components/corner-badge.js +84 -0
- package/dist/components/dashboard-grid.d.ts +83 -0
- package/dist/components/dashboard-grid.js +486 -0
- package/dist/components/date-picker.d.ts +29 -0
- package/dist/components/date-picker.js +261 -0
- package/dist/components/dialog.d.ts +26 -0
- package/dist/components/dialog.js +97 -0
- package/dist/components/dot-matrix.d.ts +32 -0
- package/dist/components/dot-matrix.js +707 -0
- package/dist/components/draggable.d.ts +42 -0
- package/dist/components/draggable.js +346 -0
- package/dist/components/drawer.d.ts +66 -0
- package/dist/components/drawer.js +304 -0
- package/dist/components/empty.d.ts +14 -0
- package/dist/components/empty.js +75 -0
- package/dist/components/field.d.ts +12 -0
- package/dist/components/field.js +44 -0
- package/dist/components/fieldset.d.ts +7 -0
- package/dist/components/fieldset.js +21 -0
- package/dist/components/file-upload.d.ts +61 -0
- package/dist/components/file-upload.js +482 -0
- package/dist/components/form.d.ts +6 -0
- package/dist/components/form.js +14 -0
- package/dist/components/frame.d.ts +10 -0
- package/dist/components/frame.js +47 -0
- package/dist/components/gauge.d.ts +27 -0
- package/dist/components/gauge.js +74 -0
- package/dist/components/grid.d.ts +26 -0
- package/dist/components/grid.js +204 -0
- package/dist/components/group.d.ts +19 -0
- package/dist/components/group.js +45 -0
- package/dist/components/input-group.d.ts +15 -0
- package/dist/components/input-group.js +61 -0
- package/dist/components/input-otp.d.ts +24 -0
- package/dist/components/input-otp.js +50 -0
- package/dist/components/input-payment.d.ts +131 -0
- package/dist/components/input-payment.js +1140 -0
- package/dist/components/input-phone.d.ts +70 -0
- package/dist/components/input-phone.js +657 -0
- package/dist/components/input-sensitive.d.ts +12 -0
- package/dist/components/input-sensitive.js +169 -0
- package/dist/components/input.d.ts +13 -0
- package/dist/components/input.js +26 -0
- package/dist/components/kbd.d.ts +6 -0
- package/dist/components/kbd.js +19 -0
- package/dist/components/kinetic-click.d.ts +48 -0
- package/dist/components/kinetic-click.js +1184 -0
- package/dist/components/label.d.ts +6 -0
- package/dist/components/label.js +18 -0
- package/dist/components/list-box.d.ts +20 -0
- package/dist/components/list-box.js +148 -0
- package/dist/components/loader.d.ts +13 -0
- package/dist/components/loader.js +430 -0
- package/dist/components/marker.d.ts +15 -0
- package/dist/components/marker.js +59 -0
- package/dist/components/menu.d.ts +42 -0
- package/dist/components/menu.js +186 -0
- package/dist/components/menubar.d.ts +40 -0
- package/dist/components/menubar.js +107 -0
- package/dist/components/message.d.ts +33 -0
- package/dist/components/message.js +112 -0
- package/dist/components/meter.d.ts +10 -0
- package/dist/components/meter.js +42 -0
- package/dist/components/morphic-toast.d.ts +61 -0
- package/dist/components/morphic-toast.js +916 -0
- package/dist/components/navigation-menu.d.ts +26 -0
- package/dist/components/navigation-menu.js +116 -0
- package/dist/components/number-field.d.ts +15 -0
- package/dist/components/number-field.js +86 -0
- package/dist/components/option-picker.d.ts +18 -0
- package/dist/components/option-picker.js +89 -0
- package/dist/components/orb.d.ts +38 -0
- package/dist/components/orb.js +1413 -0
- package/dist/components/pagination.d.ts +25 -0
- package/dist/components/pagination.js +147 -0
- package/dist/components/popover.d.ts +22 -0
- package/dist/components/popover.js +79 -0
- package/dist/components/preview-card.d.ts +16 -0
- package/dist/components/preview-card.js +60 -0
- package/dist/components/progress.d.ts +21 -0
- package/dist/components/progress.js +139 -0
- package/dist/components/radio.d.ts +16 -0
- package/dist/components/radio.js +68 -0
- package/dist/components/resizable.d.ts +58 -0
- package/dist/components/resizable.js +964 -0
- package/dist/components/ruler-picker.d.ts +27 -0
- package/dist/components/ruler-picker.js +253 -0
- package/dist/components/scroll-area.d.ts +13 -0
- package/dist/components/scroll-area.js +34 -0
- package/dist/components/scroll-bar.d.ts +13 -0
- package/dist/components/scroll-bar.js +47 -0
- package/dist/components/select.d.ts +29 -0
- package/dist/components/select.js +140 -0
- package/dist/components/separator.d.ts +6 -0
- package/dist/components/separator.js +15 -0
- package/dist/components/sidebar.d.ts +65 -0
- package/dist/components/sidebar.js +408 -0
- package/dist/components/skeleton.d.ts +5 -0
- package/dist/components/skeleton.js +12 -0
- package/dist/components/slider.d.ts +12 -0
- package/dist/components/slider.js +96 -0
- package/dist/components/sortable.d.ts +44 -0
- package/dist/components/sortable.js +327 -0
- package/dist/components/switch.d.ts +15 -0
- package/dist/components/switch.js +63 -0
- package/dist/components/table.d.ts +12 -0
- package/dist/components/table.js +65 -0
- package/dist/components/tabs.d.ts +12 -0
- package/dist/components/tabs.js +39 -0
- package/dist/components/text.d.ts +14 -0
- package/dist/components/text.js +69 -0
- package/dist/components/textarea.d.ts +9 -0
- package/dist/components/textarea.js +20 -0
- package/dist/components/theme-provider.d.ts +52 -0
- package/dist/components/theme-provider.js +148 -0
- package/dist/components/timeline.d.ts +34 -0
- package/dist/components/timeline.js +147 -0
- package/dist/components/toast.d.ts +17 -0
- package/dist/components/toast.js +161 -0
- package/dist/components/toggle-group.d.ts +14 -0
- package/dist/components/toggle-group.js +53 -0
- package/dist/components/toggle.d.ts +11 -0
- package/dist/components/toggle.js +36 -0
- package/dist/components/toolbar.d.ts +11 -0
- package/dist/components/toolbar.js +49 -0
- package/dist/components/tooltip.d.ts +17 -0
- package/dist/components/tooltip.js +56 -0
- package/dist/components/waveform.d.ts +61 -0
- package/dist/components/waveform.js +500 -0
- package/dist/components/wheel-picker.d.ts +44 -0
- package/dist/components/wheel-picker.js +771 -0
- package/dist/hooks/use-copy-to-clipboard.d.ts +9 -0
- package/dist/hooks/use-copy-to-clipboard.js +36 -0
- package/dist/hooks/use-media-query.d.ts +21 -0
- package/dist/hooks/use-media-query.js +58 -0
- package/dist/styles.css +202 -0
- package/dist/themes/afterglow.css +89 -0
- package/dist/themes/afterglow.scoped.css +90 -0
- package/dist/themes/blacklight.css +89 -0
- package/dist/themes/blacklight.scoped.css +90 -0
- package/dist/themes/cathode.css +89 -0
- package/dist/themes/cathode.scoped.css +90 -0
- package/dist/themes/cel.css +89 -0
- package/dist/themes/cel.scoped.css +90 -0
- package/dist/themes/cinder.css +89 -0
- package/dist/themes/cinder.scoped.css +90 -0
- package/dist/themes/clay.css +89 -0
- package/dist/themes/clay.scoped.css +90 -0
- package/dist/themes/cobalt.css +89 -0
- package/dist/themes/cobalt.scoped.css +90 -0
- package/dist/themes/crimson.css +89 -0
- package/dist/themes/crimson.scoped.css +90 -0
- package/dist/themes/ion.css +89 -0
- package/dist/themes/ion.scoped.css +90 -0
- package/dist/themes/iris.css +89 -0
- package/dist/themes/iris.scoped.css +90 -0
- package/dist/themes/lagoon.css +89 -0
- package/dist/themes/lagoon.scoped.css +90 -0
- package/dist/themes/mochi.css +89 -0
- package/dist/themes/mochi.scoped.css +90 -0
- package/dist/themes/riso.css +89 -0
- package/dist/themes/riso.scoped.css +90 -0
- package/dist/themes/roast.css +89 -0
- package/dist/themes/roast.scoped.css +90 -0
- package/dist/themes/sage.css +89 -0
- package/dist/themes/sage.scoped.css +90 -0
- package/dist/themes/sepia.css +89 -0
- package/dist/themes/sepia.scoped.css +90 -0
- package/dist/themes/sorbet.css +89 -0
- package/dist/themes/sorbet.scoped.css +90 -0
- package/dist/themes/taffy.css +89 -0
- package/dist/themes/taffy.scoped.css +90 -0
- package/dist/themes/toxin.css +89 -0
- package/dist/themes/toxin.scoped.css +90 -0
- package/package.json +140 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { VariantProps } from "class-variance-authority";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
//#region src/components/alert.d.ts
|
|
4
|
+
export declare const alertVariants: (props?: ({
|
|
5
|
+
variant?: "default" | "error" | "info" | "success" | "warning" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
declare function Alert({ className, variant, ...props }: React$1.ComponentProps<"div"> & VariantProps<typeof alertVariants>): React$1.JSX.Element;
|
|
8
|
+
declare function AlertTitle({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
9
|
+
declare function AlertDescription({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
10
|
+
declare function AlertAction({ className, ...props }: React$1.ComponentProps<"div">): React$1.JSX.Element;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Alert, AlertAction, AlertDescription, AlertTitle };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { cn } from "cn";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
//#region src/components/alert.tsx
|
|
5
|
+
const alertVariants = cva("relative grid w-full items-start gap-x-2 gap-y-0.5 rounded-xl border px-[calc(--spacing(3.5)-1px)] py-[calc(--spacing(3)-1px)] text-card-foreground text-sm has-[>svg]:has-data-[slot=alert-action]:grid-cols-[calc(var(--spacing)*4)_1fr_auto] has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-data-[slot=alert-action]:grid-cols-[1fr_auto] has-[>svg]:gap-x-2 [&>svg]:h-lh [&>svg]:w-4", {
|
|
6
|
+
defaultVariants: { variant: "default" },
|
|
7
|
+
variants: { variant: {
|
|
8
|
+
default: "bg-transparent dark:bg-input/32 [&>svg]:text-muted-foreground",
|
|
9
|
+
error: "border-destructive/32 bg-destructive/4 [&>svg]:text-destructive",
|
|
10
|
+
info: "border-info/32 bg-info/4 [&>svg]:text-info",
|
|
11
|
+
success: "border-success/32 bg-success/4 [&>svg]:text-success",
|
|
12
|
+
warning: "border-warning/32 bg-warning/4 [&>svg]:text-warning"
|
|
13
|
+
} }
|
|
14
|
+
});
|
|
15
|
+
function Alert({ className, variant, ...props }) {
|
|
16
|
+
return /* @__PURE__ */ jsx("div", {
|
|
17
|
+
className: cn(alertVariants({ variant }), className),
|
|
18
|
+
"data-slot": "alert",
|
|
19
|
+
role: "alert",
|
|
20
|
+
...props
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function AlertTitle({ className, ...props }) {
|
|
24
|
+
return /* @__PURE__ */ jsx("div", {
|
|
25
|
+
className: cn("font-medium [svg~&]:col-start-2", className),
|
|
26
|
+
"data-slot": "alert-title",
|
|
27
|
+
...props
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function AlertDescription({ className, ...props }) {
|
|
31
|
+
return /* @__PURE__ */ jsx("div", {
|
|
32
|
+
className: cn("flex flex-col gap-2.5 text-muted-foreground [svg~&]:col-start-2", className),
|
|
33
|
+
"data-slot": "alert-description",
|
|
34
|
+
...props
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function AlertAction({ className, ...props }) {
|
|
38
|
+
return /* @__PURE__ */ jsx("div", {
|
|
39
|
+
className: cn("flex gap-1 max-sm:col-start-2 max-sm:mt-2 sm:row-start-1 sm:row-end-3 sm:self-center sm:[[data-slot=alert-description]~&]:col-start-2 sm:[[data-slot=alert-title]~&]:col-start-2 sm:[svg~&]:col-start-2 sm:[svg~[data-slot=alert-description]~&]:col-start-3 sm:[svg~[data-slot=alert-title]~&]:col-start-3", className),
|
|
40
|
+
"data-slot": "alert-action",
|
|
41
|
+
...props
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
export { Alert, AlertAction, AlertDescription, AlertTitle, alertVariants };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
3
|
+
//#region src/components/aspect-ratio.d.ts
|
|
4
|
+
export interface AspectRatioProps extends useRender.ComponentProps<"div"> {
|
|
5
|
+
ratio?: number;
|
|
6
|
+
}
|
|
7
|
+
declare function AspectRatio({ className, ratio, render, style, ...props }: AspectRatioProps): React$1.ReactElement;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { AspectRatio };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "cn";
|
|
3
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
4
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
5
|
+
//#region src/components/aspect-ratio.tsx
|
|
6
|
+
function AspectRatio({ className, ratio = 1, render, style, ...props }) {
|
|
7
|
+
const rootProps = {
|
|
8
|
+
className: cn("relative w-full", className),
|
|
9
|
+
style: {
|
|
10
|
+
aspectRatio: `${ratio}`,
|
|
11
|
+
...style
|
|
12
|
+
},
|
|
13
|
+
"data-slot": "aspect-ratio"
|
|
14
|
+
};
|
|
15
|
+
return useRender({
|
|
16
|
+
defaultTagName: "div",
|
|
17
|
+
props: mergeProps(rootProps, props),
|
|
18
|
+
render
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { AspectRatio };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { Autocomplete as Autocomplete$1 } from "@base-ui/react/autocomplete";
|
|
3
|
+
//#region src/components/autocomplete.d.ts
|
|
4
|
+
declare const Autocomplete: typeof Autocomplete$1.Root;
|
|
5
|
+
declare function AutocompleteInput({ className, showTrigger, showClear, startAddon, size, triggerProps, clearProps, ...props }: Omit<Autocomplete$1.Input.Props, "size"> & {
|
|
6
|
+
showTrigger?: boolean;
|
|
7
|
+
showClear?: boolean;
|
|
8
|
+
startAddon?: React$1.ReactNode;
|
|
9
|
+
size?: "sm" | "default" | "lg" | number;
|
|
10
|
+
ref?: React$1.Ref<HTMLInputElement>;
|
|
11
|
+
triggerProps?: Autocomplete$1.Trigger.Props;
|
|
12
|
+
clearProps?: Autocomplete$1.Clear.Props;
|
|
13
|
+
}): React$1.JSX.Element;
|
|
14
|
+
declare function AutocompletePopup({ className, children, side, sideOffset, alignOffset, align, anchor, ...props }: Autocomplete$1.Popup.Props & {
|
|
15
|
+
align?: Autocomplete$1.Positioner.Props["align"];
|
|
16
|
+
sideOffset?: Autocomplete$1.Positioner.Props["sideOffset"];
|
|
17
|
+
alignOffset?: Autocomplete$1.Positioner.Props["alignOffset"];
|
|
18
|
+
side?: Autocomplete$1.Positioner.Props["side"];
|
|
19
|
+
anchor?: Autocomplete$1.Positioner.Props["anchor"];
|
|
20
|
+
}): React$1.JSX.Element;
|
|
21
|
+
declare function AutocompleteItem({ className, children, ...props }: Autocomplete$1.Item.Props): React$1.JSX.Element;
|
|
22
|
+
declare function AutocompleteSeparator({ className, ...props }: Autocomplete$1.Separator.Props): React$1.JSX.Element;
|
|
23
|
+
declare function AutocompleteGroup({ className, ...props }: Autocomplete$1.Group.Props): React$1.JSX.Element;
|
|
24
|
+
declare function AutocompleteGroupLabel({ className, ...props }: Autocomplete$1.GroupLabel.Props): React$1.JSX.Element;
|
|
25
|
+
declare function AutocompleteEmpty({ className, ...props }: Autocomplete$1.Empty.Props): React$1.JSX.Element;
|
|
26
|
+
declare function AutocompleteRow({ className, ...props }: Autocomplete$1.Row.Props): React$1.JSX.Element;
|
|
27
|
+
declare function AutocompleteValue({ ...props }: Autocomplete$1.Value.Props): React$1.JSX.Element;
|
|
28
|
+
declare function AutocompleteList({ className, ...props }: Autocomplete$1.List.Props): React$1.JSX.Element;
|
|
29
|
+
declare function AutocompleteClear({ className, ...props }: Autocomplete$1.Clear.Props): React$1.JSX.Element;
|
|
30
|
+
declare function AutocompleteStatus({ className, ...props }: Autocomplete$1.Status.Props): React$1.JSX.Element;
|
|
31
|
+
declare function AutocompleteCollection({ ...props }: Autocomplete$1.Collection.Props): React$1.JSX.Element;
|
|
32
|
+
declare function AutocompleteTrigger({ className, children, ...props }: Autocomplete$1.Trigger.Props): React$1.JSX.Element;
|
|
33
|
+
declare const useAutocompleteFilter: typeof import("@base-ui/react/internals/filter").getFilter;
|
|
34
|
+
//#endregion
|
|
35
|
+
export { Autocomplete, AutocompleteClear, AutocompleteCollection, AutocompleteEmpty, AutocompleteGroup, AutocompleteGroupLabel, AutocompleteInput, AutocompleteItem, AutocompleteList, AutocompletePopup, AutocompleteRow, AutocompleteSeparator, AutocompleteStatus, AutocompleteTrigger, AutocompleteValue, useAutocompleteFilter };
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Input } from "./input.js";
|
|
3
|
+
import { ScrollArea } from "./scroll-area.js";
|
|
4
|
+
import { cn } from "cn";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { Cancel } from "xiod-icons/icons/Cancel";
|
|
7
|
+
import { Autocomplete as Autocomplete$1 } from "@base-ui/react/autocomplete";
|
|
8
|
+
import { UnfoldMore } from "xiod-icons/icons/UnfoldMore";
|
|
9
|
+
//#region src/components/autocomplete.tsx
|
|
10
|
+
const Autocomplete = Autocomplete$1.Root;
|
|
11
|
+
function AutocompleteInput({ className, showTrigger = false, showClear = false, startAddon, size, triggerProps, clearProps, ...props }) {
|
|
12
|
+
const sizeValue = size ?? "default";
|
|
13
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
14
|
+
className: "relative not-has-[>*.w-full]:w-fit w-full text-foreground has-disabled:opacity-64",
|
|
15
|
+
children: [
|
|
16
|
+
startAddon && /* @__PURE__ */ jsx("div", {
|
|
17
|
+
"aria-hidden": "true",
|
|
18
|
+
className: "[&_svg]:-mx-0.5 pointer-events-none absolute inset-y-0 start-px z-10 flex items-center ps-[calc(--spacing(3)-1px)] opacity-80 has-[+[data-size=sm]]:ps-[calc(--spacing(2.5)-1px)] [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4",
|
|
19
|
+
"data-slot": "autocomplete-start-addon",
|
|
20
|
+
children: startAddon
|
|
21
|
+
}),
|
|
22
|
+
/* @__PURE__ */ jsx(Autocomplete$1.Input, {
|
|
23
|
+
className: cn(startAddon && "data-[size=sm]:*:data-[slot=autocomplete-input]:ps-[calc(--spacing(7.5)-1px)] *:data-[slot=autocomplete-input]:ps-[calc(--spacing(8.5)-1px)] sm:data-[size=sm]:*:data-[slot=autocomplete-input]:ps-[calc(--spacing(7)-1px)] sm:*:data-[slot=autocomplete-input]:ps-[calc(--spacing(8)-1px)]", sizeValue === "sm" ? "has-[+[data-slot=autocomplete-trigger],+[data-slot=autocomplete-clear]]:*:data-[slot=autocomplete-input]:pe-6.5" : "has-[+[data-slot=autocomplete-trigger],+[data-slot=autocomplete-clear]]:*:data-[slot=autocomplete-input]:pe-7", className),
|
|
24
|
+
"data-slot": "autocomplete-input",
|
|
25
|
+
render: /* @__PURE__ */ jsx(Input, {
|
|
26
|
+
nativeInput: true,
|
|
27
|
+
size: sizeValue
|
|
28
|
+
}),
|
|
29
|
+
...props
|
|
30
|
+
}),
|
|
31
|
+
showTrigger && /* @__PURE__ */ jsx(AutocompleteTrigger, {
|
|
32
|
+
"aria-label": "Open suggestions",
|
|
33
|
+
className: cn("-translate-y-1/2 absolute top-1/2 inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 outline-none transition-colors pointer-coarse:after:absolute pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:opacity-100 has-[+[data-slot=autocomplete-clear]]:hidden sm:size-7 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", sizeValue === "sm" ? "inset-e-0" : "inset-e-0.5"),
|
|
34
|
+
...triggerProps,
|
|
35
|
+
children: /* @__PURE__ */ jsx(Autocomplete$1.Icon, {
|
|
36
|
+
"data-slot": "autocomplete-icon",
|
|
37
|
+
children: /* @__PURE__ */ jsx(UnfoldMore, {})
|
|
38
|
+
})
|
|
39
|
+
}),
|
|
40
|
+
showClear && /* @__PURE__ */ jsx(AutocompleteClear, {
|
|
41
|
+
"aria-label": "Clear value",
|
|
42
|
+
className: cn("-translate-y-1/2 absolute top-1/2 inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 outline-none transition-colors pointer-coarse:after:absolute pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:opacity-100 has-[+[data-slot=autocomplete-clear]]:hidden sm:size-7 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", sizeValue === "sm" ? "inset-e-0" : "inset-e-0.5"),
|
|
43
|
+
...clearProps,
|
|
44
|
+
children: /* @__PURE__ */ jsx(Cancel, {})
|
|
45
|
+
})
|
|
46
|
+
]
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function AutocompletePopup({ className, children, side = "bottom", sideOffset = 4, alignOffset, align = "start", anchor, ...props }) {
|
|
50
|
+
return /* @__PURE__ */ jsx(Autocomplete$1.Portal, { children: /* @__PURE__ */ jsx(Autocomplete$1.Positioner, {
|
|
51
|
+
align,
|
|
52
|
+
alignOffset,
|
|
53
|
+
anchor,
|
|
54
|
+
className: "z-50 select-none",
|
|
55
|
+
"data-slot": "autocomplete-positioner",
|
|
56
|
+
side,
|
|
57
|
+
sideOffset,
|
|
58
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
59
|
+
className: cn("relative flex max-h-full min-w-(--anchor-width) max-w-(--available-width) origin-(--transform-origin) rounded-lg border bg-popover not-dark:bg-clip-padding shadow-lg/5 transition-[scale,opacity] duration-100 ease-out data-ending-style:scale-97 data-starting-style:scale-97 data-ending-style:opacity-0 data-starting-style:opacity-0 before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] dark:before:shadow-[0_-1px_--theme(--color-white/6%)]", className),
|
|
60
|
+
children: /* @__PURE__ */ jsx(Autocomplete$1.Popup, {
|
|
61
|
+
className: "flex max-h-[min(var(--available-height),23rem)] flex-1 flex-col text-foreground",
|
|
62
|
+
"data-slot": "autocomplete-popup",
|
|
63
|
+
...props,
|
|
64
|
+
children
|
|
65
|
+
})
|
|
66
|
+
})
|
|
67
|
+
}) });
|
|
68
|
+
}
|
|
69
|
+
function AutocompleteItem({ className, children, ...props }) {
|
|
70
|
+
return /* @__PURE__ */ jsx(Autocomplete$1.Item, {
|
|
71
|
+
className: cn("flex min-h-8 cursor-default select-none items-center rounded-sm px-2 py-1 text-base outline-none data-disabled:pointer-events-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-disabled:opacity-64 sm:min-h-7 sm:text-sm", className),
|
|
72
|
+
"data-slot": "autocomplete-item",
|
|
73
|
+
...props,
|
|
74
|
+
children
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function AutocompleteSeparator({ className, ...props }) {
|
|
78
|
+
return /* @__PURE__ */ jsx(Autocomplete$1.Separator, {
|
|
79
|
+
className: cn("mx-2 my-1 h-px bg-border last:hidden", className),
|
|
80
|
+
"data-slot": "autocomplete-separator",
|
|
81
|
+
...props
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
function AutocompleteGroup({ className, ...props }) {
|
|
85
|
+
return /* @__PURE__ */ jsx(Autocomplete$1.Group, {
|
|
86
|
+
className: cn("[[role=group]+&]:mt-1.5", className),
|
|
87
|
+
"data-slot": "autocomplete-group",
|
|
88
|
+
...props
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
function AutocompleteGroupLabel({ className, ...props }) {
|
|
92
|
+
return /* @__PURE__ */ jsx(Autocomplete$1.GroupLabel, {
|
|
93
|
+
className: cn("px-2 py-1.5 font-medium text-muted-foreground text-xs", className),
|
|
94
|
+
"data-slot": "autocomplete-group-label",
|
|
95
|
+
...props
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
function AutocompleteEmpty({ className, ...props }) {
|
|
99
|
+
return /* @__PURE__ */ jsx(Autocomplete$1.Empty, {
|
|
100
|
+
className: cn("not-empty:p-2 text-center text-base text-muted-foreground sm:text-sm", className),
|
|
101
|
+
"data-slot": "autocomplete-empty",
|
|
102
|
+
...props
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
function AutocompleteRow({ className, ...props }) {
|
|
106
|
+
return /* @__PURE__ */ jsx(Autocomplete$1.Row, {
|
|
107
|
+
className: cn(className),
|
|
108
|
+
"data-slot": "autocomplete-row",
|
|
109
|
+
...props
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
function AutocompleteValue({ ...props }) {
|
|
113
|
+
return /* @__PURE__ */ jsx(Autocomplete$1.Value, {
|
|
114
|
+
"data-slot": "autocomplete-value",
|
|
115
|
+
...props
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
function AutocompleteList({ className, ...props }) {
|
|
119
|
+
return /* @__PURE__ */ jsx(ScrollArea, {
|
|
120
|
+
scrollbarGutter: true,
|
|
121
|
+
scrollFade: true,
|
|
122
|
+
children: /* @__PURE__ */ jsx(Autocomplete$1.List, {
|
|
123
|
+
className: cn("not-empty:scroll-py-1 not-empty:p-1 in-data-has-overflow-y:pe-3", className),
|
|
124
|
+
"data-slot": "autocomplete-list",
|
|
125
|
+
...props
|
|
126
|
+
})
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
function AutocompleteClear({ className, ...props }) {
|
|
130
|
+
return /* @__PURE__ */ jsx(Autocomplete$1.Clear, {
|
|
131
|
+
className: cn("-translate-y-1/2 absolute inset-e-0.5 top-1/2 inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border border-transparent opacity-80 outline-none transition-[color,background-color,box-shadow,opacity] pointer-coarse:after:absolute pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:opacity-100 sm:size-7 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", className),
|
|
132
|
+
"data-slot": "autocomplete-clear",
|
|
133
|
+
...props,
|
|
134
|
+
children: /* @__PURE__ */ jsx(Cancel, {})
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
function AutocompleteStatus({ className, ...props }) {
|
|
138
|
+
return /* @__PURE__ */ jsx(Autocomplete$1.Status, {
|
|
139
|
+
className: cn("px-3 py-2 font-medium text-muted-foreground text-xs empty:m-0 empty:p-0", className),
|
|
140
|
+
"data-slot": "autocomplete-status",
|
|
141
|
+
...props
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
function AutocompleteCollection({ ...props }) {
|
|
145
|
+
return /* @__PURE__ */ jsx(Autocomplete$1.Collection, {
|
|
146
|
+
"data-slot": "autocomplete-collection",
|
|
147
|
+
...props
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
function AutocompleteTrigger({ className, children, ...props }) {
|
|
151
|
+
return /* @__PURE__ */ jsx(Autocomplete$1.Trigger, {
|
|
152
|
+
className: cn(className),
|
|
153
|
+
"data-slot": "autocomplete-trigger",
|
|
154
|
+
...props,
|
|
155
|
+
children
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
const useAutocompleteFilter = Autocomplete$1.useFilter;
|
|
159
|
+
//#endregion
|
|
160
|
+
export { Autocomplete, AutocompleteClear, AutocompleteCollection, AutocompleteEmpty, AutocompleteGroup, AutocompleteGroupLabel, AutocompleteInput, AutocompleteItem, AutocompleteList, AutocompletePopup, AutocompleteRow, AutocompleteSeparator, AutocompleteStatus, AutocompleteTrigger, AutocompleteValue, useAutocompleteFilter };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { VariantProps } from "class-variance-authority";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
4
|
+
import { Avatar as Avatar$1 } from "@base-ui/react/avatar";
|
|
5
|
+
//#region src/components/avatar.d.ts
|
|
6
|
+
declare const avatarVariants: (props?: ({
|
|
7
|
+
size?: "sm" | "md" | "lg" | "xs" | "xl" | "2xl" | null | undefined;
|
|
8
|
+
shape?: "circle" | "square" | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
|
+
export interface AvatarProps extends React$1.ComponentProps<typeof Avatar$1.Root>, VariantProps<typeof avatarVariants> {}
|
|
11
|
+
declare function Avatar({ className, size, shape, ...props }: AvatarProps): React$1.JSX.Element;
|
|
12
|
+
declare function AvatarImage({ className, ...props }: React$1.ComponentProps<typeof Avatar$1.Image>): React$1.JSX.Element;
|
|
13
|
+
declare function AvatarFallback({ className, ...props }: React$1.ComponentProps<typeof Avatar$1.Fallback>): React$1.JSX.Element;
|
|
14
|
+
export interface AvatarGroupProps extends useRender.ComponentProps<"div"> {}
|
|
15
|
+
declare function AvatarGroup({ className, render, ...props }: AvatarGroupProps): React$1.ReactElement;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { Avatar, AvatarFallback, AvatarGroup, AvatarImage, avatarVariants };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "cn";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
6
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
7
|
+
import { Avatar as Avatar$1 } from "@base-ui/react/avatar";
|
|
8
|
+
//#region src/components/avatar.tsx
|
|
9
|
+
const avatarVariants = cva("inline-flex shrink-0 select-none items-center justify-center overflow-hidden bg-background align-middle font-medium text-xs", {
|
|
10
|
+
variants: {
|
|
11
|
+
size: {
|
|
12
|
+
xs: "size-6 text-[10px]",
|
|
13
|
+
sm: "size-8 text-xs",
|
|
14
|
+
md: "size-10 text-sm",
|
|
15
|
+
lg: "size-12 text-base",
|
|
16
|
+
xl: "size-16 text-lg",
|
|
17
|
+
"2xl": "size-20 text-xl"
|
|
18
|
+
},
|
|
19
|
+
shape: {
|
|
20
|
+
circle: "rounded-full",
|
|
21
|
+
square: "rounded-md"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
defaultVariants: {
|
|
25
|
+
size: "md",
|
|
26
|
+
shape: "circle"
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
function Avatar({ className, size, shape, ...props }) {
|
|
30
|
+
return /* @__PURE__ */ jsx(Avatar$1.Root, {
|
|
31
|
+
className: cn(avatarVariants({
|
|
32
|
+
size,
|
|
33
|
+
shape
|
|
34
|
+
}), className),
|
|
35
|
+
"data-slot": "avatar",
|
|
36
|
+
...props
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function AvatarImage({ className, ...props }) {
|
|
40
|
+
return /* @__PURE__ */ jsx(Avatar$1.Image, {
|
|
41
|
+
className: cn("size-full object-cover", className),
|
|
42
|
+
"data-slot": "avatar-image",
|
|
43
|
+
...props
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function AvatarFallback({ className, ...props }) {
|
|
47
|
+
return /* @__PURE__ */ jsx(Avatar$1.Fallback, {
|
|
48
|
+
className: cn("flex size-full items-center justify-center bg-muted text-muted-foreground", className),
|
|
49
|
+
"data-slot": "avatar-fallback",
|
|
50
|
+
...props
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function AvatarGroup({ className, render, ...props }) {
|
|
54
|
+
const rootProps = {
|
|
55
|
+
className: cn("flex items-center -space-x-2 *:ring-2 *:ring-background", className),
|
|
56
|
+
"data-slot": "avatar-group"
|
|
57
|
+
};
|
|
58
|
+
return useRender({
|
|
59
|
+
defaultTagName: "div",
|
|
60
|
+
props: mergeProps(rootProps, props),
|
|
61
|
+
render
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
65
|
+
export { Avatar, AvatarFallback, AvatarGroup, AvatarImage, avatarVariants };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { VariantProps } from "class-variance-authority";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
4
|
+
//#region src/components/badge.d.ts
|
|
5
|
+
declare const badgeVariants: (props?: ({
|
|
6
|
+
size?: "sm" | "lg" | "default" | null | undefined;
|
|
7
|
+
variant?: "default" | "destructive" | "error" | "info" | "outline" | "secondary" | "success" | "warning" | null | undefined;
|
|
8
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
|
+
interface BadgeProps extends useRender.ComponentProps<"span"> {
|
|
10
|
+
variant?: VariantProps<typeof badgeVariants>["variant"];
|
|
11
|
+
size?: VariantProps<typeof badgeVariants>["size"];
|
|
12
|
+
}
|
|
13
|
+
declare function Badge({ className, variant, size, render, ...props }: BadgeProps): React$1.ReactElement;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { Badge, badgeVariants };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "cn";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
5
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
6
|
+
//#region src/components/badge.tsx
|
|
7
|
+
const badgeVariants = cva("relative inline-flex shrink-0 items-center justify-center gap-1 whitespace-nowrap rounded-sm border border-transparent font-medium outline-none transition-shadow focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-3.5 sm:[&_svg:not([class*='size-'])]:size-3 [&_svg]:pointer-events-none [&_svg]:shrink-0 [button&,a&]:cursor-pointer [button&,a&]:pointer-coarse:after:absolute [button&,a&]:pointer-coarse:after:size-full [button&,a&]:pointer-coarse:after:min-h-11 [button&,a&]:pointer-coarse:after:min-w-11", {
|
|
8
|
+
defaultVariants: {
|
|
9
|
+
size: "default",
|
|
10
|
+
variant: "default"
|
|
11
|
+
},
|
|
12
|
+
variants: {
|
|
13
|
+
size: {
|
|
14
|
+
default: "h-5.5 min-w-5.5 px-[calc(--spacing(1)-1px)] text-sm sm:h-4.5 sm:min-w-4.5 sm:text-xs",
|
|
15
|
+
lg: "h-6.5 min-w-6.5 px-[calc(--spacing(1.5)-1px)] text-base sm:h-5.5 sm:min-w-5.5 sm:text-sm",
|
|
16
|
+
sm: "h-5 min-w-5 rounded-[.25rem] px-[calc(--spacing(1)-1px)] text-xs sm:h-4 sm:min-w-4 sm:text-[.625rem]"
|
|
17
|
+
},
|
|
18
|
+
variant: {
|
|
19
|
+
default: "bg-primary text-primary-foreground shadow-xs inset-shadow-[0_1px_--alpha(var(--primary-foreground)/16%)] [button&,a&]:hover:bg-primary/90",
|
|
20
|
+
destructive: "bg-destructive text-white shadow-xs inset-shadow-[0_1px_--alpha(var(--primary-foreground)/16%)] [button&,a&]:hover:bg-destructive/90",
|
|
21
|
+
error: "bg-destructive/8 text-destructive-foreground dark:bg-destructive/16",
|
|
22
|
+
info: "bg-info/8 text-info-foreground dark:bg-info/16",
|
|
23
|
+
outline: "border-input bg-background text-foreground dark:bg-input/32 shadow-xs/5 before:absolute before:inset-0 before:pointer-events-none before:rounded-[inherit] before:shadow-[0_1px_var(--border)] [button&,a&]:hover:bg-accent/50 dark:[button&,a&]:hover:bg-input/48",
|
|
24
|
+
secondary: "bg-secondary text-secondary-foreground shadow-xs inset-shadow-[0_1px_--alpha(var(--primary-foreground)/16%)] [button&,a&]:hover:bg-secondary/90",
|
|
25
|
+
success: "bg-success/8 text-success-foreground dark:bg-success/16",
|
|
26
|
+
warning: "bg-warning/8 text-warning-foreground dark:bg-warning/16"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
function Badge({ className, variant, size, render, ...props }) {
|
|
31
|
+
const defaultProps = {
|
|
32
|
+
className: cn(badgeVariants({
|
|
33
|
+
className,
|
|
34
|
+
size,
|
|
35
|
+
variant
|
|
36
|
+
})),
|
|
37
|
+
"data-slot": "badge"
|
|
38
|
+
};
|
|
39
|
+
return useRender({
|
|
40
|
+
defaultTagName: "span",
|
|
41
|
+
props: mergeProps(defaultProps, props),
|
|
42
|
+
render
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export { Badge, badgeVariants };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
3
|
+
//#region src/components/breadcrumb.d.ts
|
|
4
|
+
declare function Breadcrumb({ ...props }: React$1.ComponentProps<"nav">): React$1.JSX.Element;
|
|
5
|
+
declare function BreadcrumbList({ className, ...props }: React$1.ComponentProps<"ol">): React$1.JSX.Element;
|
|
6
|
+
declare function BreadcrumbItem({ className, ...props }: React$1.ComponentProps<"li">): React$1.JSX.Element;
|
|
7
|
+
declare function BreadcrumbLink({ className, render, ...props }: useRender.ComponentProps<"a">): React$1.ReactElement;
|
|
8
|
+
declare function BreadcrumbPage({ className, ...props }: React$1.ComponentProps<"span">): React$1.JSX.Element;
|
|
9
|
+
declare function BreadcrumbSeparator({ children, className, ...props }: React$1.ComponentProps<"li">): React$1.JSX.Element;
|
|
10
|
+
declare function BreadcrumbEllipsis({ className, ...props }: React$1.ComponentProps<"span">): React$1.JSX.Element;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "cn";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
5
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
6
|
+
import { ChevronRight } from "xiod-icons/icons/ChevronRight";
|
|
7
|
+
import { MoreHorizontal } from "xiod-icons/icons/MoreHorizontal";
|
|
8
|
+
//#region src/components/breadcrumb.tsx
|
|
9
|
+
function Breadcrumb({ ...props }) {
|
|
10
|
+
return /* @__PURE__ */ jsx("nav", {
|
|
11
|
+
"aria-label": "breadcrumb",
|
|
12
|
+
"data-slot": "breadcrumb",
|
|
13
|
+
...props
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function BreadcrumbList({ className, ...props }) {
|
|
17
|
+
return /* @__PURE__ */ jsx("ol", {
|
|
18
|
+
className: cn("wrap-break-word flex flex-wrap items-center gap-1.5 text-muted-foreground text-sm sm:gap-2.5", className),
|
|
19
|
+
"data-slot": "breadcrumb-list",
|
|
20
|
+
...props
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function BreadcrumbItem({ className, ...props }) {
|
|
24
|
+
return /* @__PURE__ */ jsx("li", {
|
|
25
|
+
className: cn("inline-flex items-center gap-1.5", className),
|
|
26
|
+
"data-slot": "breadcrumb-item",
|
|
27
|
+
...props
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function BreadcrumbLink({ className, render, ...props }) {
|
|
31
|
+
const defaultProps = {
|
|
32
|
+
className: cn("transition-colors hover:text-foreground", className),
|
|
33
|
+
"data-slot": "breadcrumb-link"
|
|
34
|
+
};
|
|
35
|
+
return useRender({
|
|
36
|
+
defaultTagName: "a",
|
|
37
|
+
props: mergeProps(defaultProps, props),
|
|
38
|
+
render
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function BreadcrumbPage({ className, ...props }) {
|
|
42
|
+
return /* @__PURE__ */ jsx("span", {
|
|
43
|
+
"aria-current": "page",
|
|
44
|
+
"aria-disabled": "true",
|
|
45
|
+
className: cn("font-normal text-foreground", className),
|
|
46
|
+
"data-slot": "breadcrumb-page",
|
|
47
|
+
role: "link",
|
|
48
|
+
...props
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function BreadcrumbSeparator({ children, className, ...props }) {
|
|
52
|
+
return /* @__PURE__ */ jsx("li", {
|
|
53
|
+
"aria-hidden": "true",
|
|
54
|
+
className: cn("opacity-80 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", className),
|
|
55
|
+
"data-slot": "breadcrumb-separator",
|
|
56
|
+
role: "presentation",
|
|
57
|
+
...props,
|
|
58
|
+
children: children ?? /* @__PURE__ */ jsx(ChevronRight, {})
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
function BreadcrumbEllipsis({ className, ...props }) {
|
|
62
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
63
|
+
"aria-hidden": "true",
|
|
64
|
+
className: cn("flex size-9 items-center justify-center [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0", className),
|
|
65
|
+
"data-slot": "breadcrumb-ellipsis",
|
|
66
|
+
role: "presentation",
|
|
67
|
+
...props,
|
|
68
|
+
children: [/* @__PURE__ */ jsx(MoreHorizontal, { className: "size-4" }), /* @__PURE__ */ jsx("span", {
|
|
69
|
+
className: "sr-only",
|
|
70
|
+
children: "More"
|
|
71
|
+
})]
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
//#endregion
|
|
75
|
+
export { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Separator } from "./separator.js";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
import * as React$1 from "react";
|
|
4
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
5
|
+
//#region src/components/button-group.d.ts
|
|
6
|
+
declare const buttonGroupVariants: (props?: ({
|
|
7
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
8
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
|
+
export interface ButtonGroupProps extends React$1.ComponentProps<"div">, VariantProps<typeof buttonGroupVariants> {}
|
|
10
|
+
declare function ButtonGroup({ className, orientation, ...props }: ButtonGroupProps): React$1.JSX.Element;
|
|
11
|
+
declare function ButtonGroupText({ className, render, ...props }: useRender.ComponentProps<"div">): React$1.ReactElement;
|
|
12
|
+
declare function ButtonGroupSeparator({ className, orientation, ...props }: React$1.ComponentProps<typeof Separator>): React$1.JSX.Element;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Separator } from "./separator.js";
|
|
3
|
+
import { cn } from "cn";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { cva } from "class-variance-authority";
|
|
6
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
7
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
8
|
+
//#region src/components/button-group.tsx
|
|
9
|
+
const buttonGroupVariants = cva("inline-flex w-fit items-stretch isolate *:relative *:focus-visible:z-10 *:hover:z-10 *:active:z-10", {
|
|
10
|
+
defaultVariants: { orientation: "horizontal" },
|
|
11
|
+
variants: { orientation: {
|
|
12
|
+
horizontal: "flex-row [&>*:not(:first-child)]:-ms-px [&>*:first-child:not(:last-child)]:rounded-e-none [&>*:first-child:not(:last-child)]:before:rounded-e-none [&>*:last-child:not(:first-child)]:rounded-s-none [&>*:last-child:not(:first-child)]:before:rounded-s-none [&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:not(:first-child):not(:last-child)]:before:rounded-none",
|
|
13
|
+
vertical: "flex-col [&>*:not(:first-child)]:-mt-px [&>*:first-child:not(:last-child)]:rounded-b-none [&>*:first-child:not(:last-child)]:before:rounded-b-none [&>*:last-child:not(:first-child)]:rounded-t-none [&>*:last-child:not(:first-child)]:before:rounded-t-none [&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:not(:first-child):not(:last-child)]:before:rounded-none"
|
|
14
|
+
} }
|
|
15
|
+
});
|
|
16
|
+
function ButtonGroup({ className, orientation, ...props }) {
|
|
17
|
+
return /* @__PURE__ */ jsx("div", {
|
|
18
|
+
role: "group",
|
|
19
|
+
"data-slot": "button-group",
|
|
20
|
+
"data-orientation": orientation,
|
|
21
|
+
className: cn(buttonGroupVariants({ orientation }), className),
|
|
22
|
+
...props
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function ButtonGroupText({ className, render, ...props }) {
|
|
26
|
+
const defaultProps = {
|
|
27
|
+
className: cn("flex items-center gap-2 rounded-lg border border-input bg-muted/50 px-[calc(--spacing(3)-1px)] text-base font-medium text-muted-foreground sm:text-sm [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0", className),
|
|
28
|
+
"data-slot": "button-group-text"
|
|
29
|
+
};
|
|
30
|
+
return useRender({
|
|
31
|
+
defaultTagName: "div",
|
|
32
|
+
props: mergeProps(defaultProps, props),
|
|
33
|
+
render
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function ButtonGroupSeparator({ className, orientation = "vertical", ...props }) {
|
|
37
|
+
return /* @__PURE__ */ jsx(Separator, {
|
|
38
|
+
"data-slot": "button-group-separator",
|
|
39
|
+
orientation,
|
|
40
|
+
className: cn("relative self-stretch bg-border", orientation === "vertical" ? "mx-px my-1.5 w-px h-auto" : "my-px mx-1.5 h-px w-auto", className),
|
|
41
|
+
...props
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Button, buttonVariants } from "./button.js";
|
|
2
|
+
import { GroupSeparator } from "./group.js";
|
|
3
|
+
import { Popover, PopoverContent as PopoverPopup, PopoverTrigger } from "./popover.js";
|
|
4
|
+
import { VariantProps } from "class-variance-authority";
|
|
5
|
+
import * as React$1 from "react";
|
|
6
|
+
//#region src/components/button-split.d.ts
|
|
7
|
+
export interface ButtonSplitProps extends Omit<React$1.ComponentPropsWithoutRef<typeof Popover>, "children"> {
|
|
8
|
+
children: React$1.ReactNode;
|
|
9
|
+
variant?: VariantProps<typeof buttonVariants>["variant"];
|
|
10
|
+
size?: VariantProps<typeof buttonVariants>["size"];
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
declare function ButtonSplit({ variant, size, className, children, ...props }: ButtonSplitProps): React$1.JSX.Element;
|
|
14
|
+
declare function ButtonSplitAction({ className, render, ...props }: React$1.ComponentProps<typeof Button>): React$1.JSX.Element;
|
|
15
|
+
declare function ButtonSplitSeparator({ className, ...props }: React$1.ComponentProps<typeof GroupSeparator>): React$1.JSX.Element;
|
|
16
|
+
declare function ButtonSplitTrigger({ className, render, children, ...props }: React$1.ComponentProps<typeof PopoverTrigger>): React$1.JSX.Element;
|
|
17
|
+
declare function ButtonSplitContent({ className, sideOffset, hideArrow, children, ...props }: React$1.ComponentProps<typeof PopoverPopup>): React$1.JSX.Element;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { ButtonSplit, ButtonSplitAction, ButtonSplitContent, ButtonSplitSeparator, ButtonSplitTrigger };
|