@api7/ui-components 0.5.0 → 0.7.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/README.md +47 -2
- package/dist/components/alert/alert.d.ts +0 -2
- package/dist/components/alert/alert.js +1 -2
- package/dist/components/avatar/avatar.d.ts +0 -2
- package/dist/components/avatar/avatar.js +1 -2
- package/dist/components/badge/badge.d.ts +0 -2
- package/dist/components/badge/badge.js +1 -2
- package/dist/components/button/button.d.ts +0 -2
- package/dist/components/button/button.js +1 -2
- package/dist/components/calendar/calendar.d.ts +0 -2
- package/dist/components/calendar/calendar.js +1 -2
- package/dist/components/checkbox/checkbox.d.ts +0 -2
- package/dist/components/checkbox/checkbox.js +1 -2
- package/dist/components/combobox/combobox.d.ts +0 -2
- package/dist/components/combobox/combobox.js +1 -2
- package/dist/components/data-table/data-table.d.ts +0 -2
- package/dist/components/data-table/data-table.js +1 -2
- package/dist/components/data-table/filter-header.d.ts +1 -3
- package/dist/components/data-table/filter-header.js +1 -2
- package/dist/components/data-table/sort-header.js +1 -2
- package/dist/components/date-picker/date-picker.d.ts +0 -2
- package/dist/components/date-picker/date-picker.js +1 -2
- package/dist/components/description-list/description-list.d.ts +0 -2
- package/dist/components/description-list/description-list.js +1 -2
- package/dist/components/dialog/dialog.d.ts +0 -2
- package/dist/components/dialog/dialog.js +1 -2
- package/dist/components/drawer/drawer.d.ts +0 -2
- package/dist/components/drawer/drawer.js +1 -2
- package/dist/components/empty/empty.d.ts +0 -2
- package/dist/components/empty/empty.js +1 -2
- package/dist/components/field/field.d.ts +0 -2
- package/dist/components/field/field.js +1 -2
- package/dist/components/field/labeled-field.d.ts +33 -0
- package/dist/components/field/labeled-field.js +67 -0
- package/dist/components/form/choice-fields.d.ts +1 -3
- package/dist/components/form/choice-fields.js +1 -2
- package/dist/components/form/date-fields.d.ts +0 -2
- package/dist/components/form/date-fields.js +1 -2
- package/dist/components/form/errors.d.ts +1 -3
- package/dist/components/form/errors.js +1 -2
- package/dist/components/form/form-context.d.ts +1 -3
- package/dist/components/form/form-context.js +1 -2
- package/dist/components/form/form-item.d.ts +6 -17
- package/dist/components/form/form-item.js +9 -58
- package/dist/components/form/form.d.ts +1 -3
- package/dist/components/form/form.js +1 -2
- package/dist/components/form/lazy-field-components.js +1 -2
- package/dist/components/form/submit-button.d.ts +1 -3
- package/dist/components/form/submit-button.js +1 -2
- package/dist/components/form/text-field.d.ts +1 -3
- package/dist/components/form/text-field.js +1 -2
- package/dist/components/form/toggle-fields.d.ts +1 -3
- package/dist/components/form/toggle-fields.js +30 -46
- package/dist/components/input/input.d.ts +0 -2
- package/dist/components/input/input.js +1 -2
- package/dist/components/input-group/input-group.d.ts +0 -2
- package/dist/components/input-group/input-group.js +1 -2
- package/dist/components/menu/menu.d.ts +14 -4
- package/dist/components/menu/menu.js +34 -24
- package/dist/components/number-field/number-field.d.ts +0 -2
- package/dist/components/number-field/number-field.js +1 -2
- package/dist/components/pagination/pagination.d.ts +1 -3
- package/dist/components/pagination/pagination.js +1 -2
- package/dist/components/popover/popover.d.ts +3 -3
- package/dist/components/popover/popover.js +9 -3
- package/dist/components/progress/progress.d.ts +0 -2
- package/dist/components/progress/progress.js +1 -2
- package/dist/components/radio-group/radio-group.d.ts +0 -2
- package/dist/components/radio-group/radio-group.js +1 -2
- package/dist/components/select/select.d.ts +0 -2
- package/dist/components/select/select.js +1 -2
- package/dist/components/separator/separator.d.ts +0 -2
- package/dist/components/separator/separator.js +1 -2
- package/dist/components/sidebar/sidebar.d.ts +0 -2
- package/dist/components/sidebar/sidebar.js +2 -3
- package/dist/components/skeleton/skeleton.d.ts +0 -2
- package/dist/components/skeleton/skeleton.js +1 -2
- package/dist/components/spinner/spinner.d.ts +0 -2
- package/dist/components/spinner/spinner.js +1 -2
- package/dist/components/switch/switch.d.ts +0 -2
- package/dist/components/switch/switch.js +1 -2
- package/dist/components/table/table.d.ts +0 -2
- package/dist/components/table/table.js +1 -2
- package/dist/components/tabs/tabs.d.ts +0 -2
- package/dist/components/tabs/tabs.js +1 -2
- package/dist/components/textarea/textarea.d.ts +0 -2
- package/dist/components/textarea/textarea.js +1 -2
- package/dist/components/toast/toast.d.ts +0 -2
- package/dist/components/toast/toast.js +1 -2
- package/dist/components/tooltip/tooltip.d.ts +0 -2
- package/dist/components/tooltip/tooltip.js +1 -2
- package/dist/config/config-provider.d.ts +1 -3
- package/dist/config/config-provider.js +1 -2
- package/dist/config/messages.d.ts +1 -3
- package/dist/config/messages.js +1 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +4 -3
- package/dist/lib/cn.js +1 -2
- package/dist/lib/control.js +1 -2
- package/dist/lib/popup.js +1 -2
- package/dist/theme.css +1 -0
- package/dist/tokens/contrast.d.ts +1 -3
- package/dist/tokens/contrast.js +1 -2
- package/dist/tokens/palette.d.ts +0 -2
- package/dist/tokens/palette.js +1 -2
- package/dist/tokens/scale.js +1 -2
- package/dist/tokens/semantic.d.ts +0 -2
- package/dist/tokens/semantic.js +0 -1
- package/dist/tokens/types.d.ts +1 -3
- package/dist/tokens/types.js +1 -2
- package/package.json +5 -5
|
@@ -4,7 +4,7 @@ import { popupClassName, popupLayerClassName } from "../../lib/popup.js";
|
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { CheckIcon, ChevronRightIcon } from "lucide-react";
|
|
6
6
|
import { Menu } from "@base-ui/react/menu";
|
|
7
|
-
|
|
7
|
+
// src/components/menu/menu.tsx
|
|
8
8
|
const menuItemClassName = "flex h-13 cursor-default items-center gap-2 px-3 text-sm outline-none select-none data-highlighted:bg-accent data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0";
|
|
9
9
|
const destructiveItemClassName = "text-destructive-text data-highlighted:bg-destructive-subtle";
|
|
10
10
|
const Menu$1 = Menu.Root;
|
|
@@ -15,18 +15,25 @@ function MenuTrigger({ className, ...props }) {
|
|
|
15
15
|
"data-slot": "menu-trigger"
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
children: /* @__PURE__ */ jsx(Menu.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
function positionerClassName(className) {
|
|
19
|
+
return typeof className === "function" ? (state) => cn(popupLayerClassName, className(state)) : cn(popupLayerClassName, className);
|
|
20
|
+
}
|
|
21
|
+
function MenuContent({ className, side = "bottom", sideOffset = 4, align = "end", positionerProps, keepMounted, ...props }) {
|
|
22
|
+
return /* @__PURE__ */ jsx(Menu.Portal, {
|
|
23
|
+
keepMounted,
|
|
24
|
+
children: /* @__PURE__ */ jsx(Menu.Positioner, {
|
|
25
|
+
...positionerProps,
|
|
26
|
+
className: positionerClassName(positionerProps?.className),
|
|
27
|
+
side: positionerProps?.side ?? side,
|
|
28
|
+
sideOffset: positionerProps?.sideOffset ?? sideOffset,
|
|
29
|
+
align: positionerProps?.align ?? align,
|
|
30
|
+
children: /* @__PURE__ */ jsx(Menu.Popup, {
|
|
31
|
+
className: cn(popupClassName, "min-w-40 py-1", className),
|
|
32
|
+
...props,
|
|
33
|
+
"data-slot": "menu-content"
|
|
34
|
+
})
|
|
28
35
|
})
|
|
29
|
-
})
|
|
36
|
+
});
|
|
30
37
|
}
|
|
31
38
|
function MenuItem({ className, variant = "default", ...props }) {
|
|
32
39
|
return /* @__PURE__ */ jsx(Menu.Item, {
|
|
@@ -94,18 +101,21 @@ function MenuSubTrigger({ className, children, ...props }) {
|
|
|
94
101
|
children: [children, /* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto" })]
|
|
95
102
|
});
|
|
96
103
|
}
|
|
97
|
-
function MenuSubContent({ className, side, sideOffset, align, ...props }) {
|
|
98
|
-
return /* @__PURE__ */ jsx(Menu.Portal, {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
function MenuSubContent({ className, side, sideOffset, align, positionerProps, keepMounted, ...props }) {
|
|
105
|
+
return /* @__PURE__ */ jsx(Menu.Portal, {
|
|
106
|
+
keepMounted,
|
|
107
|
+
children: /* @__PURE__ */ jsx(Menu.Positioner, {
|
|
108
|
+
...positionerProps,
|
|
109
|
+
className: positionerClassName(positionerProps?.className),
|
|
110
|
+
side: positionerProps?.side ?? side,
|
|
111
|
+
sideOffset: positionerProps?.sideOffset ?? sideOffset,
|
|
112
|
+
align: positionerProps?.align ?? align,
|
|
113
|
+
children: /* @__PURE__ */ jsx(Menu.Popup, {
|
|
114
|
+
className: cn(popupClassName, "min-w-40 py-1", className),
|
|
115
|
+
...props,
|
|
116
|
+
"data-slot": "menu-sub-content"
|
|
117
|
+
})
|
|
107
118
|
})
|
|
108
|
-
})
|
|
119
|
+
});
|
|
109
120
|
}
|
|
110
|
-
//#endregion
|
|
111
121
|
export { Menu$1 as Menu, MenuCheckboxItem, MenuContent, MenuGroup, MenuGroupLabel, MenuItem, MenuRadioGroup, MenuRadioItem, MenuSeparator, MenuSub, MenuSubContent, MenuSubTrigger, MenuTrigger };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import { NumberField } from "@base-ui/react/number-field";
|
|
3
|
-
//#region src/components/number-field/number-field.d.ts
|
|
4
3
|
export type NumberFieldProps = Omit<NumberField.Root.Props, 'className' | 'children'> & {
|
|
5
4
|
className?: string;
|
|
6
5
|
placeholder?: string;
|
|
@@ -12,5 +11,4 @@ export type NumberFieldProps = Omit<NumberField.Root.Props, 'className' | 'child
|
|
|
12
11
|
decrementLabel?: string;
|
|
13
12
|
};
|
|
14
13
|
declare function NumberField$1({ className, placeholder, showStepper, unit, incrementLabel, decrementLabel, locale, format, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, ...props }: NumberFieldProps): import("react").JSX.Element;
|
|
15
|
-
//#endregion
|
|
16
14
|
export { NumberField$1 as NumberField };
|
|
@@ -6,7 +6,7 @@ import { useId } from "react";
|
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { ChevronDown, ChevronUp } from "lucide-react";
|
|
8
8
|
import { NumberField } from "@base-ui/react/number-field";
|
|
9
|
-
|
|
9
|
+
// src/components/number-field/number-field.tsx
|
|
10
10
|
const stepperButtonClassName = "flex basis-1/2 grow-0 shrink-0 items-center justify-center text-muted-foreground hover:bg-accent hover:text-accent-foreground disabled:cursor-not-allowed disabled:opacity-50 [&_svg]:size-3";
|
|
11
11
|
function NumberField$1({ className, placeholder, showStepper = false, unit, incrementLabel, decrementLabel, locale, format, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, ...props }) {
|
|
12
12
|
const messages = useMessages();
|
|
@@ -56,5 +56,4 @@ function NumberField$1({ className, placeholder, showStepper = false, unit, incr
|
|
|
56
56
|
})]
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
|
-
//#endregion
|
|
60
59
|
export { NumberField$1 as NumberField };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/components/pagination/pagination.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* Page buttons to render: page indexes (0-based) and 'ellipsis' markers, mirroring
|
|
4
3
|
* react-paginate with pageRangeDisplayed=2 and one page kept at each edge. The window is 3
|
|
@@ -20,5 +19,4 @@ export interface PaginationProps {
|
|
|
20
19
|
className?: string;
|
|
21
20
|
}
|
|
22
21
|
/** Renders nothing when `rowCount` is 0, matching the legacy footer's `total > 0` guard. */
|
|
23
|
-
export declare function Pagination({ pageIndex, pageSize, rowCount, pageSizeOptions, onPageIndexChange, onPageSizeChange, label, className }: PaginationProps): import("react").JSX.Element | null;
|
|
24
|
-
//#endregion
|
|
22
|
+
export declare function Pagination({ pageIndex, pageSize, rowCount, pageSizeOptions, onPageIndexChange, onPageSizeChange, label, className }: PaginationProps): import("react").JSX.Element | null;
|
|
@@ -4,7 +4,7 @@ import { cn } from "../../lib/cn.js";
|
|
|
4
4
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../select/select.js";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
7
|
-
|
|
7
|
+
// src/components/pagination/pagination.tsx
|
|
8
8
|
const DEFAULT_PAGE_SIZE_OPTIONS = [
|
|
9
9
|
10,
|
|
10
10
|
20,
|
|
@@ -126,5 +126,4 @@ function Pagination({ pageIndex, pageSize, rowCount, pageSizeOptions = DEFAULT_P
|
|
|
126
126
|
function pageSizeItems(pageSizeOptions, messages, formatter) {
|
|
127
127
|
return Object.fromEntries(pageSizeOptions.map((size) => [String(size), messages.pagination.pageSize({ size: formatter.format(size) })]));
|
|
128
128
|
}
|
|
129
|
-
//#endregion
|
|
130
129
|
export { DEFAULT_PAGE_SIZE_OPTIONS, Pagination, getPageItems };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Popover } from "@base-ui/react/popover";
|
|
2
|
-
//#region src/components/popover/popover.d.ts
|
|
3
2
|
type WithClassName<P> = Omit<P, 'className'> & {
|
|
4
3
|
className?: string;
|
|
5
4
|
};
|
|
@@ -12,11 +11,12 @@ export type PopoverContentProps = WithClassName<Popover.Popup.Props> & {
|
|
|
12
11
|
align?: Popover.Positioner.Props['align'];
|
|
13
12
|
};
|
|
14
13
|
declare function PopoverContent({ className, side, sideOffset, align, ...props }: PopoverContentProps): import("react").JSX.Element;
|
|
14
|
+
export type PopoverArrowProps = WithClassName<Popover.Arrow.Props>;
|
|
15
|
+
declare function PopoverArrow({ className, ...props }: PopoverArrowProps): import("react").JSX.Element;
|
|
15
16
|
export type PopoverTitleProps = WithClassName<Popover.Title.Props>;
|
|
16
17
|
declare function PopoverTitle({ className, ...props }: PopoverTitleProps): import("react").JSX.Element;
|
|
17
18
|
export type PopoverDescriptionProps = WithClassName<Popover.Description.Props>;
|
|
18
19
|
declare function PopoverDescription({ className, ...props }: PopoverDescriptionProps): import("react").JSX.Element;
|
|
19
20
|
export type PopoverCloseProps = WithClassName<Popover.Close.Props>;
|
|
20
21
|
declare function PopoverClose({ className, ...props }: PopoverCloseProps): import("react").JSX.Element;
|
|
21
|
-
|
|
22
|
-
export { Popover$1 as Popover, PopoverClose, PopoverContent, PopoverDescription, PopoverTitle, PopoverTrigger };
|
|
22
|
+
export { Popover$1 as Popover, PopoverArrow, PopoverClose, PopoverContent, PopoverDescription, PopoverTitle, PopoverTrigger };
|
|
@@ -3,7 +3,7 @@ import { cn } from "../../lib/cn.js";
|
|
|
3
3
|
import { popupClassName, popupLayerClassName } from "../../lib/popup.js";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
import { Popover } from "@base-ui/react/popover";
|
|
6
|
-
|
|
6
|
+
// src/components/popover/popover.tsx
|
|
7
7
|
const Popover$1 = Popover.Root;
|
|
8
8
|
function PopoverTrigger({ className, ...props }) {
|
|
9
9
|
return /* @__PURE__ */ jsx(Popover.Trigger, {
|
|
@@ -25,6 +25,13 @@ function PopoverContent({ className, side = "bottom", sideOffset = 4, align = "s
|
|
|
25
25
|
})
|
|
26
26
|
}) });
|
|
27
27
|
}
|
|
28
|
+
function PopoverArrow({ className, ...props }) {
|
|
29
|
+
return /* @__PURE__ */ jsx(Popover.Arrow, {
|
|
30
|
+
className: cn("size-3 rotate-45 bg-popover data-[side=bottom]:-top-1.5 data-[side=left]:-right-1.5 data-[side=right]:-left-1.5 data-[side=top]:-bottom-1.5 data-[side=inline-start]:-end-1.5 data-[side=inline-end]:-start-1.5", className),
|
|
31
|
+
...props,
|
|
32
|
+
"data-slot": "popover-arrow"
|
|
33
|
+
});
|
|
34
|
+
}
|
|
28
35
|
function PopoverTitle({ className, ...props }) {
|
|
29
36
|
return /* @__PURE__ */ jsx(Popover.Title, {
|
|
30
37
|
className: cn("text-sm font-medium", className),
|
|
@@ -46,5 +53,4 @@ function PopoverClose({ className, ...props }) {
|
|
|
46
53
|
"data-slot": "popover-close"
|
|
47
54
|
});
|
|
48
55
|
}
|
|
49
|
-
|
|
50
|
-
export { Popover$1 as Popover, PopoverClose, PopoverContent, PopoverDescription, PopoverTitle, PopoverTrigger };
|
|
56
|
+
export { Popover$1 as Popover, PopoverArrow, PopoverClose, PopoverContent, PopoverDescription, PopoverTitle, PopoverTrigger };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { VariantProps } from "class-variance-authority";
|
|
2
2
|
import { Progress } from "@base-ui/react/progress";
|
|
3
|
-
//#region src/components/progress/progress.d.ts
|
|
4
3
|
declare const trackVariants: (props?: ({
|
|
5
4
|
size?: "sm" | "md" | "xs" | null | undefined;
|
|
6
5
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
@@ -15,5 +14,4 @@ export interface ProgressProps extends Omit<Progress.Root.Props, 'className' | '
|
|
|
15
14
|
className?: string;
|
|
16
15
|
}
|
|
17
16
|
declare function Progress$1({ className, size, variant, ...props }: ProgressProps): import("react").JSX.Element;
|
|
18
|
-
//#endregion
|
|
19
17
|
export { Progress$1 as Progress };
|
|
@@ -3,7 +3,7 @@ import { cn } from "../../lib/cn.js";
|
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { cva } from "class-variance-authority";
|
|
5
5
|
import { Progress } from "@base-ui/react/progress";
|
|
6
|
-
|
|
6
|
+
// src/components/progress/progress.tsx
|
|
7
7
|
const trackVariants = cva("block w-full overflow-hidden rounded-full bg-accent-selected", {
|
|
8
8
|
variants: { size: {
|
|
9
9
|
xs: "h-1",
|
|
@@ -32,5 +32,4 @@ function Progress$1({ className, size, variant, ...props }) {
|
|
|
32
32
|
})
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
|
-
//#endregion
|
|
36
35
|
export { Progress$1 as Progress };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Radio } from "@base-ui/react/radio";
|
|
2
2
|
import { RadioGroup } from "@base-ui/react/radio-group";
|
|
3
|
-
//#region src/components/radio-group/radio-group.d.ts
|
|
4
3
|
export type RadioGroupProps = Omit<RadioGroup.Props, 'className'> & {
|
|
5
4
|
className?: string;
|
|
6
5
|
};
|
|
@@ -9,5 +8,4 @@ export type RadioGroupItemProps = Omit<Radio.Root.Props, 'className'> & {
|
|
|
9
8
|
};
|
|
10
9
|
declare function RadioGroup$1({ className, ...props }: RadioGroupProps): import("react").JSX.Element;
|
|
11
10
|
declare function RadioGroupItem({ className, ...props }: RadioGroupItemProps): import("react").JSX.Element;
|
|
12
|
-
//#endregion
|
|
13
11
|
export { RadioGroup$1 as RadioGroup, RadioGroupItem };
|
|
@@ -3,7 +3,7 @@ import { cn } from "../../lib/cn.js";
|
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { Radio } from "@base-ui/react/radio";
|
|
5
5
|
import { RadioGroup } from "@base-ui/react/radio-group";
|
|
6
|
-
|
|
6
|
+
// src/components/radio-group/radio-group.tsx
|
|
7
7
|
function RadioGroup$1({ className, ...props }) {
|
|
8
8
|
return /* @__PURE__ */ jsx(RadioGroup, {
|
|
9
9
|
className: cn("flex flex-col gap-2", className),
|
|
@@ -23,5 +23,4 @@ function RadioGroupItem({ className, ...props }) {
|
|
|
23
23
|
})
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
-
//#endregion
|
|
27
26
|
export { RadioGroup$1 as RadioGroup, RadioGroupItem };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Select } from "@base-ui/react/select";
|
|
2
|
-
//#region src/components/select/select.d.ts
|
|
3
2
|
type WithClassName<P> = Omit<P, 'className'> & {
|
|
4
3
|
className?: string;
|
|
5
4
|
};
|
|
@@ -51,5 +50,4 @@ export type SelectGroupLabelProps = WithClassName<Select.GroupLabel.Props>;
|
|
|
51
50
|
declare function SelectGroupLabel({ className, ...props }: SelectGroupLabelProps): import("react").JSX.Element;
|
|
52
51
|
export type SelectSeparatorProps = WithClassName<Select.Separator.Props>;
|
|
53
52
|
declare function SelectSeparator({ className, ...props }: SelectSeparatorProps): import("react").JSX.Element;
|
|
54
|
-
//#endregion
|
|
55
53
|
export { Select$1 as Select, SelectContent, SelectGroup, SelectGroupLabel, SelectItem, SelectSeparator, SelectTrigger, SelectValue };
|
|
@@ -7,7 +7,7 @@ import { createContext, useCallback, useContext, useMemo, useRef, useState } fro
|
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { CheckIcon, ChevronDownIcon, XIcon } from "lucide-react";
|
|
9
9
|
import { Select } from "@base-ui/react/select";
|
|
10
|
-
|
|
10
|
+
// src/components/select/select.tsx
|
|
11
11
|
const SelectClearContext = createContext(void 0);
|
|
12
12
|
/**
|
|
13
13
|
* Pass `items` (a value-to-label map, e.g. `{ http: 'HTTP' }`, or a `{ label, value }[]` list)
|
|
@@ -160,5 +160,4 @@ function SelectSeparator({ className, ...props }) {
|
|
|
160
160
|
"data-slot": "select-separator"
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
|
-
//#endregion
|
|
164
163
|
export { Select$1 as Select, SelectContent, SelectGroup, SelectGroupLabel, SelectItem, SelectSeparator, SelectTrigger, SelectValue };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { Separator } from "@base-ui/react/separator";
|
|
2
|
-
//#region src/components/separator/separator.d.ts
|
|
3
2
|
export type SeparatorProps = Omit<Separator.Props, 'className'> & {
|
|
4
3
|
className?: string;
|
|
5
4
|
};
|
|
6
5
|
declare function Separator$1({ className, orientation, ...props }: SeparatorProps): import("react").JSX.Element;
|
|
7
|
-
//#endregion
|
|
8
6
|
export { Separator$1 as Separator };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { cn } from "../../lib/cn.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { Separator } from "@base-ui/react/separator";
|
|
5
|
-
|
|
5
|
+
// src/components/separator/separator.tsx
|
|
6
6
|
function Separator$1({ className, orientation = "horizontal", ...props }) {
|
|
7
7
|
return /* @__PURE__ */ jsx(Separator, {
|
|
8
8
|
orientation,
|
|
@@ -11,5 +11,4 @@ function Separator$1({ className, orientation = "horizontal", ...props }) {
|
|
|
11
11
|
"data-slot": "separator"
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
|
-
//#endregion
|
|
15
14
|
export { Separator$1 as Separator };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ComponentProps, ReactElement, ReactNode } from "react";
|
|
2
|
-
//#region src/components/sidebar/sidebar.d.ts
|
|
3
2
|
export type SidebarProps = ComponentProps<'nav'>;
|
|
4
3
|
declare function Sidebar({ className, ...props }: SidebarProps): import("react").JSX.Element;
|
|
5
4
|
export type SidebarGroupProps = ComponentProps<'div'> & {
|
|
@@ -17,5 +16,4 @@ export type SidebarItemProps = Omit<ComponentProps<'a'>, 'className' | 'children
|
|
|
17
16
|
children?: ReactNode;
|
|
18
17
|
};
|
|
19
18
|
declare function SidebarItem({ render, className, active, disabled, disabledReason, icon, children, onClick, href, tabIndex, ...props }: SidebarItemProps): import("react").JSX.Element;
|
|
20
|
-
//#endregion
|
|
21
19
|
export { Sidebar, SidebarGroup, SidebarItem };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../../lib/cn.js";
|
|
3
|
-
import { Separator } from "../separator/separator.js";
|
|
4
3
|
import { Tooltip, TooltipContent, TooltipTrigger } from "../tooltip/tooltip.js";
|
|
4
|
+
import { Separator } from "../separator/separator.js";
|
|
5
5
|
import { cloneElement, useId } from "react";
|
|
6
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
|
|
7
|
+
// src/components/sidebar/sidebar.tsx
|
|
8
8
|
function Sidebar({ className, ...props }) {
|
|
9
9
|
return /* @__PURE__ */ jsx("nav", {
|
|
10
10
|
className: cn("w-[226px] bg-background p-2 pt-5", className),
|
|
@@ -79,5 +79,4 @@ function SidebarItem({ render, className, active = false, disabled = false, disa
|
|
|
79
79
|
})] });
|
|
80
80
|
return element;
|
|
81
81
|
}
|
|
82
|
-
//#endregion
|
|
83
82
|
export { Sidebar, SidebarGroup, SidebarItem };
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { ComponentProps } from "react";
|
|
2
|
-
//#region src/components/skeleton/skeleton.d.ts
|
|
3
2
|
export type SkeletonProps = ComponentProps<'div'>;
|
|
4
3
|
declare function Skeleton({ className, ...props }: SkeletonProps): import("react").JSX.Element;
|
|
5
|
-
//#endregion
|
|
6
4
|
export { Skeleton };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cn } from "../../lib/cn.js";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
|
|
3
|
+
// src/components/skeleton/skeleton.tsx
|
|
4
4
|
function Skeleton({ className, ...props }) {
|
|
5
5
|
return /* @__PURE__ */ jsx("div", {
|
|
6
6
|
className: cn("animate-pulse rounded-md bg-accent-selected motion-reduce:animate-none", className),
|
|
@@ -8,5 +8,4 @@ function Skeleton({ className, ...props }) {
|
|
|
8
8
|
"data-slot": "skeleton"
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
|
-
//#endregion
|
|
12
11
|
export { Skeleton };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ComponentProps } from "react";
|
|
2
2
|
import { VariantProps } from "class-variance-authority";
|
|
3
|
-
//#region src/components/spinner/spinner.d.ts
|
|
4
3
|
declare const spinnerVariants: (props?: ({
|
|
5
4
|
size?: "sm" | "md" | "lg" | "xs" | null | undefined;
|
|
6
5
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
@@ -10,5 +9,4 @@ declare const spinnerVariants: (props?: ({
|
|
|
10
9
|
*/
|
|
11
10
|
export type SpinnerProps = Omit<ComponentProps<'svg'>, 'ref'> & VariantProps<typeof spinnerVariants>;
|
|
12
11
|
declare function Spinner({ className, size, ...props }: SpinnerProps): import("react").JSX.Element;
|
|
13
|
-
//#endregion
|
|
14
12
|
export { Spinner, spinnerVariants };
|
|
@@ -4,7 +4,7 @@ import { cn } from "../../lib/cn.js";
|
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
import { cva } from "class-variance-authority";
|
|
6
6
|
import { LoaderCircle } from "lucide-react";
|
|
7
|
-
|
|
7
|
+
// src/components/spinner/spinner.tsx
|
|
8
8
|
const spinnerVariants = cva("shrink-0 animate-spin motion-reduce:animate-none", {
|
|
9
9
|
variants: { size: {
|
|
10
10
|
xs: "size-3",
|
|
@@ -24,5 +24,4 @@ function Spinner({ className, size, ...props }) {
|
|
|
24
24
|
"data-slot": "spinner"
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
|
-
//#endregion
|
|
28
27
|
export { Spinner, spinnerVariants };
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { Switch } from "@base-ui/react/switch";
|
|
2
|
-
//#region src/components/switch/switch.d.ts
|
|
3
2
|
export type SwitchProps = Omit<Switch.Root.Props, 'className'> & {
|
|
4
3
|
className?: string;
|
|
5
4
|
size?: 'sm' | 'md';
|
|
6
5
|
};
|
|
7
6
|
declare function Switch$1({ className, size, ...props }: SwitchProps): import("react").JSX.Element;
|
|
8
|
-
//#endregion
|
|
9
7
|
export { Switch$1 as Switch };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { cn } from "../../lib/cn.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { Switch } from "@base-ui/react/switch";
|
|
5
|
-
|
|
5
|
+
// src/components/switch/switch.tsx
|
|
6
6
|
function Switch$1({ className, size = "md", ...props }) {
|
|
7
7
|
return /* @__PURE__ */ jsx(Switch.Root, {
|
|
8
8
|
"data-size": size,
|
|
@@ -16,5 +16,4 @@ function Switch$1({ className, size = "md", ...props }) {
|
|
|
16
16
|
})
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
|
-
//#endregion
|
|
20
19
|
export { Switch$1 as Switch };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ComponentProps } from "react";
|
|
2
|
-
//#region src/components/table/table.d.ts
|
|
3
2
|
export type TableProps = Omit<ComponentProps<'table'>, 'className'> & {
|
|
4
3
|
className?: string;
|
|
5
4
|
containerClassName?: string;
|
|
@@ -29,5 +28,4 @@ export type TableCaptionProps = Omit<ComponentProps<'caption'>, 'className'> & {
|
|
|
29
28
|
className?: string;
|
|
30
29
|
};
|
|
31
30
|
declare function TableCaption({ className, ...props }: TableCaptionProps): import("react").JSX.Element;
|
|
32
|
-
//#endregion
|
|
33
31
|
export { Table, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cn } from "../../lib/cn.js";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
|
|
3
|
+
// src/components/table/table.tsx
|
|
4
4
|
function Table({ className, containerClassName, ...props }) {
|
|
5
5
|
return /* @__PURE__ */ jsx("div", {
|
|
6
6
|
"data-slot": "table-container",
|
|
@@ -55,5 +55,4 @@ function TableCaption({ className, ...props }) {
|
|
|
55
55
|
"data-slot": "table-caption"
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
|
-
//#endregion
|
|
59
58
|
export { Table, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Tabs } from "@base-ui/react/tabs";
|
|
2
|
-
//#region src/components/tabs/tabs.d.ts
|
|
3
2
|
export type TabsProps = Omit<Tabs.Root.Props, 'className'> & {
|
|
4
3
|
className?: string;
|
|
5
4
|
};
|
|
@@ -16,5 +15,4 @@ export type TabsContentProps = Omit<Tabs.Panel.Props, 'className'> & {
|
|
|
16
15
|
className?: string;
|
|
17
16
|
};
|
|
18
17
|
declare function TabsContent({ className, ...props }: TabsContentProps): import("react").JSX.Element;
|
|
19
|
-
//#endregion
|
|
20
18
|
export { Tabs$1 as Tabs, TabsContent, TabsList, TabsTrigger };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { cn } from "../../lib/cn.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { Tabs } from "@base-ui/react/tabs";
|
|
5
|
-
|
|
5
|
+
// src/components/tabs/tabs.tsx
|
|
6
6
|
function Tabs$1({ className, ...props }) {
|
|
7
7
|
return /* @__PURE__ */ jsx(Tabs.Root, {
|
|
8
8
|
className: cn("flex flex-col data-[orientation=vertical]:flex-row", className),
|
|
@@ -32,5 +32,4 @@ function TabsContent({ className, ...props }) {
|
|
|
32
32
|
"data-slot": "tabs-content"
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
|
-
//#endregion
|
|
36
35
|
export { Tabs$1 as Tabs, TabsContent, TabsList, TabsTrigger };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ComponentProps } from "react";
|
|
2
2
|
import { Input } from "@base-ui/react/input";
|
|
3
|
-
//#region src/components/textarea/textarea.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Base UI's Field.Control (which Input wraps) derives `id`, `name`, `disabled`,
|
|
6
5
|
* `autoFocus`, the controlled/uncontrolled `value`/`defaultValue` and the field's
|
|
@@ -23,5 +22,4 @@ export type TextareaProps = Omit<ComponentProps<'textarea'>, 'className' | 'valu
|
|
|
23
22
|
onValueChange?: Input.Props['onValueChange'];
|
|
24
23
|
};
|
|
25
24
|
declare function Textarea({ className, id, name, disabled, autoFocus, value, defaultValue, onChange, onValueChange, ...rest }: TextareaProps): import("react").JSX.Element;
|
|
26
|
-
//#endregion
|
|
27
25
|
export { Textarea };
|
|
@@ -3,7 +3,7 @@ import { cn } from "../../lib/cn.js";
|
|
|
3
3
|
import { controlFocus, controlSurface } from "../../lib/control.js";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
import { Input } from "@base-ui/react/input";
|
|
6
|
-
|
|
6
|
+
// src/components/textarea/textarea.tsx
|
|
7
7
|
function Textarea({ className, id, name, disabled, autoFocus, value, defaultValue, onChange, onValueChange, ...rest }) {
|
|
8
8
|
return /* @__PURE__ */ jsx(Input, {
|
|
9
9
|
id,
|
|
@@ -21,5 +21,4 @@ function Textarea({ className, id, name, disabled, autoFocus, value, defaultValu
|
|
|
21
21
|
className: cn(controlSurface, controlFocus, "min-h-16 px-3 py-2 field-sizing-content", className)
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
-
//#endregion
|
|
25
24
|
export { Textarea };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import { CircleCheck } from "lucide-react";
|
|
3
|
-
//#region src/components/toast/toast.d.ts
|
|
4
3
|
export type ToastActionOptions = React.ComponentPropsWithoutRef<'button'>;
|
|
5
4
|
export interface ToastOptions {
|
|
6
5
|
description?: ReactNode;
|
|
@@ -43,5 +42,4 @@ export interface ToasterProps {
|
|
|
43
42
|
* mounted, only the first one renders and the rest take over in order when it unmounts.
|
|
44
43
|
*/
|
|
45
44
|
declare function Toaster({ limit }: ToasterProps): import("react").JSX.Element | null;
|
|
46
|
-
//#endregion
|
|
47
45
|
export { Toaster };
|
|
@@ -6,7 +6,7 @@ import { useEffect, useState, useSyncExternalStore } from "react";
|
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { CircleAlert, CircleCheck, Info, LoaderCircle, TriangleAlert, X } from "lucide-react";
|
|
8
8
|
import { Toast } from "@base-ui/react/toast";
|
|
9
|
-
|
|
9
|
+
// src/components/toast/toast.tsx
|
|
10
10
|
const DEFAULT_TIMEOUT = {
|
|
11
11
|
success: 3e3,
|
|
12
12
|
info: 3e3,
|
|
@@ -161,5 +161,4 @@ function Toaster({ limit = 3 }) {
|
|
|
161
161
|
}) })
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
|
-
//#endregion
|
|
165
164
|
export { DEFAULT_TIMEOUT, TOAST_BACKGROUND_CLASSNAME, TOAST_ICON, TOAST_ICON_CLASSNAME, Toaster, toast, toastManager };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Tooltip } from "@base-ui/react/tooltip";
|
|
2
|
-
//#region src/components/tooltip/tooltip.d.ts
|
|
3
2
|
type WithClassName<P> = Omit<P, 'className'> & {
|
|
4
3
|
className?: string;
|
|
5
4
|
};
|
|
@@ -14,5 +13,4 @@ export type TooltipContentProps = WithClassName<Tooltip.Popup.Props> & {
|
|
|
14
13
|
align?: Tooltip.Positioner.Props['align'];
|
|
15
14
|
};
|
|
16
15
|
declare function TooltipContent({ className, side, sideOffset, align, children, ...props }: TooltipContentProps): import("react").JSX.Element;
|
|
17
|
-
//#endregion
|
|
18
16
|
export { Tooltip$1 as Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|
|
@@ -4,7 +4,7 @@ import { popupLayerClassName } from "../../lib/popup.js";
|
|
|
4
4
|
import { createContext, useContext } from "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { Tooltip } from "@base-ui/react/tooltip";
|
|
7
|
-
|
|
7
|
+
// src/components/tooltip/tooltip.tsx
|
|
8
8
|
const DEFAULT_TOOLTIP_DELAY = 300;
|
|
9
9
|
const TooltipDelayContext = createContext(void 0);
|
|
10
10
|
const Tooltip$1 = Tooltip.Root;
|
|
@@ -45,5 +45,4 @@ function TooltipContent({ className, side = "top", sideOffset = 6, align, childr
|
|
|
45
45
|
})
|
|
46
46
|
}) });
|
|
47
47
|
}
|
|
48
|
-
//#endregion
|
|
49
48
|
export { Tooltip$1 as Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Locale, Messages, MessagesOverride } from "./messages.js";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
|
-
//#region src/config/config-provider.d.ts
|
|
4
3
|
export interface ConfigProviderProps {
|
|
5
4
|
locale?: Locale;
|
|
6
5
|
/** Memoize this object or define it at module scope; a new object on every render re-renders every useMessages() consumer. */
|
|
@@ -10,5 +9,4 @@ export interface ConfigProviderProps {
|
|
|
10
9
|
/** Global configuration entry for the library; currently carries the locale and built-in message overrides used by components. */
|
|
11
10
|
export declare function ConfigProvider({ locale, messages, children }: ConfigProviderProps): import("react").JSX.Element;
|
|
12
11
|
export declare function useMessages(): Messages;
|
|
13
|
-
export declare function useLocale(): Locale;
|
|
14
|
-
//#endregion
|
|
12
|
+
export declare function useLocale(): Locale;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { resolveMessages } from "./messages.js";
|
|
3
3
|
import { createContext, useContext, useMemo } from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
|
|
5
|
+
// src/config/config-provider.tsx
|
|
6
6
|
const ConfigContext = createContext({
|
|
7
7
|
locale: "en-US",
|
|
8
8
|
messages: resolveMessages("en-US")
|
|
@@ -24,5 +24,4 @@ function useMessages() {
|
|
|
24
24
|
function useLocale() {
|
|
25
25
|
return useContext(ConfigContext).locale;
|
|
26
26
|
}
|
|
27
|
-
//#endregion
|
|
28
27
|
export { ConfigProvider, useLocale, useMessages };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/config/messages.d.ts
|
|
2
1
|
export type Locale = 'en-US' | 'zh-CN';
|
|
3
2
|
export interface Messages {
|
|
4
3
|
readonly button: {
|
|
@@ -79,5 +78,4 @@ export interface Messages {
|
|
|
79
78
|
readonly presetsLabel: string;
|
|
80
79
|
};
|
|
81
80
|
}
|
|
82
|
-
export type MessagesOverride = { [K in keyof Messages]?: Partial<Messages[K]>; };
|
|
83
|
-
//#endregion
|
|
81
|
+
export type MessagesOverride = { [K in keyof Messages]?: Partial<Messages[K]>; };
|
package/dist/config/messages.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/config/messages.ts
|
|
2
2
|
function deepFreeze(value) {
|
|
3
3
|
for (const nested of Object.values(value)) if (nested && typeof nested === "object") Object.freeze(nested);
|
|
4
4
|
return Object.freeze(value);
|
|
@@ -111,5 +111,4 @@ function resolveMessages(locale, override) {
|
|
|
111
111
|
const keys = Object.keys(base);
|
|
112
112
|
return Object.fromEntries(keys.map((key) => [key, mergeSection(base[key], override[key])]));
|
|
113
113
|
}
|
|
114
|
-
//#endregion
|
|
115
114
|
export { enUS, resolveMessages, zhCN };
|