@ctrl-ui/react 0.9.6 → 0.9.9
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 +38 -2
- package/dist/activity.d.ts +3 -1
- package/dist/activity.js +2 -1
- package/dist/blocks/agent-run-sidebar.js +11 -10
- package/dist/blocks/agent-run.d.ts +3 -1
- package/dist/blocks/agent-run.js +21 -13
- package/dist/blocks/coding-agent.js +50 -69
- package/dist/blocks/design-canvas-inspector.js +1 -1
- package/dist/blocks/design-canvas.js +41 -34
- package/dist/blocks/discussion.js +1 -1
- package/dist/blocks/file-explorer.js +66 -47
- package/dist/blocks/settings.js +37 -41
- package/dist/blocks/team-chat.js +2 -1
- package/dist/blocks/theme-toggle.d.ts +2 -1
- package/dist/blocks/theme-toggle.js +13 -4
- package/dist/hooks/use-mobile.d.ts +1 -1
- package/dist/hooks/use-mobile.js +1 -1
- package/dist/knob-contracts/badge-knobs.d.ts +1 -1
- package/dist/knob-contracts/badge-knobs.js +3 -1
- package/dist/knob-contracts/button-knobs.d.ts +1 -1
- package/dist/knob-contracts/button-knobs.js +1 -0
- package/dist/knob-contracts/calendar-knobs.d.ts +1 -1
- package/dist/knob-contracts/calendar-knobs.js +9 -1
- package/dist/knob-contracts/card-knobs.d.ts +1 -1
- package/dist/knob-contracts/card-knobs.js +5 -1
- package/dist/knob-contracts/choice-knobs.d.ts +1 -1
- package/dist/knob-contracts/choice-knobs.js +1 -0
- package/dist/knob-contracts/collapsible-knobs.d.ts +1 -1
- package/dist/knob-contracts/collapsible-knobs.js +5 -1
- package/dist/knob-contracts/emoji-picker-knobs.d.ts +1 -1
- package/dist/knob-contracts/emoji-picker-knobs.js +3 -1
- package/dist/knob-contracts/field-knobs.d.ts +1 -1
- package/dist/knob-contracts/field-knobs.js +17 -1
- package/dist/knob-contracts/item-knobs.d.ts +1 -1
- package/dist/knob-contracts/item-knobs.js +6 -1
- package/dist/knob-contracts/kbd-knobs.d.ts +1 -1
- package/dist/knob-contracts/kbd-knobs.js +4 -1
- package/dist/knob-contracts/page-layout-knobs.d.ts +1 -1
- package/dist/knob-contracts/page-layout-knobs.js +1 -0
- package/dist/knob-contracts/pagination-knobs.d.ts +1 -1
- package/dist/knob-contracts/pagination-knobs.js +2 -1
- package/dist/knob-contracts/popup-knobs.d.ts +1 -1
- package/dist/knob-contracts/popup-knobs.js +9 -0
- package/dist/knob-contracts/range-knobs.d.ts +1 -1
- package/dist/knob-contracts/range-knobs.js +2 -0
- package/dist/knob-contracts/sidebar-knobs.d.ts +1 -1
- package/dist/knob-contracts/sidebar-knobs.js +2 -0
- package/dist/knob-contracts/tabs-knobs.d.ts +1 -1
- package/dist/knob-contracts/tabs-knobs.js +3 -0
- package/dist/knob-contracts/timeline-knobs.d.ts +1 -1
- package/dist/knob-contracts/timeline-knobs.js +4 -1
- package/dist/knob-contracts/tree-knobs.d.ts +1 -1
- package/dist/knob-contracts/tree-knobs.js +3 -1
- package/dist/skin.d.ts +2 -0
- package/dist/styles/index.css +2 -3
- package/dist/styles/recipes/activity.css +4 -0
- package/dist/styles/recipes/avatar.css +1 -1
- package/dist/styles/recipes/badge.css +17 -0
- package/dist/styles/recipes/button.css +8 -1
- package/dist/styles/recipes/calendar.css +82 -6
- package/dist/styles/recipes/card.css +40 -5
- package/dist/styles/recipes/choice.css +9 -2
- package/dist/styles/recipes/collapsible.css +8 -1
- package/dist/styles/recipes/color-picker-values.css +4 -0
- package/dist/styles/recipes/emoji-picker.css +29 -8
- package/dist/styles/recipes/empty.css +5 -0
- package/dist/styles/recipes/field-parts.css +80 -5
- package/dist/styles/recipes/field.css +113 -40
- package/dist/styles/recipes/item.css +44 -5
- package/dist/styles/recipes/kbd.css +26 -6
- package/dist/styles/recipes/morphing-panel.css +1 -1
- package/dist/styles/recipes/page-layout.css +18 -2
- package/dist/styles/recipes/pagination.css +8 -0
- package/dist/styles/recipes/popup-controls.css +41 -0
- package/dist/styles/recipes/popup-drawer.css +1 -0
- package/dist/styles/recipes/popup-lists.css +55 -6
- package/dist/styles/recipes/popup-motion.css +7 -1
- package/dist/styles/recipes/popup.css +10 -0
- package/dist/styles/recipes/range.css +16 -2
- package/dist/styles/recipes/sidebar-mobile.css +1 -1
- package/dist/styles/recipes/sidebar-parts.css +17 -1
- package/dist/styles/recipes/sidebar.css +11 -0
- package/dist/styles/recipes/skeleton.css +8 -0
- package/dist/styles/recipes/tabs.css +41 -8
- package/dist/styles/recipes/timeline.css +25 -2
- package/dist/styles/recipes/tree.css +33 -0
- package/dist/styles/theme.css +11 -1
- package/dist/surface-variants.d.ts +2 -0
- package/dist/surface-variants.js +2 -1
- package/dist/ui/alert-dialog.js +1 -1
- package/dist/ui/badge.js +1 -1
- package/dist/ui/calendar.js +9 -4
- package/dist/ui/card.d.ts +3 -1
- package/dist/ui/card.js +2 -1
- package/dist/ui/context-menu.d.ts +3 -1
- package/dist/ui/context-menu.js +2 -1
- package/dist/ui/dialog.js +1 -1
- package/dist/ui/dropdown-menu.d.ts +6 -3
- package/dist/ui/dropdown-menu.js +25 -7
- package/dist/ui/dropzone.js +10 -11
- package/dist/ui/empty.d.ts +4 -1
- package/dist/ui/empty.js +4 -2
- package/dist/ui/field.d.ts +6 -2
- package/dist/ui/field.js +4 -2
- package/dist/ui/menubar.d.ts +3 -1
- package/dist/ui/menubar.js +2 -1
- package/dist/ui/morphing-panel.d.ts +5 -1
- package/dist/ui/morphing-panel.js +4 -2
- package/dist/ui/select.js +2 -2
- package/dist/ui/sheet.d.ts +9 -0
- package/dist/ui/sheet.js +23 -1
- package/dist/ui/sidebar-mobile.js +1 -1
- package/dist/ui/sidebar-provider.d.ts +3 -1
- package/dist/ui/sidebar-provider.js +3 -2
- package/dist/ui/sidebar-resize-rail.js +1 -1
- package/dist/ui/sidebar.d.ts +6 -5
- package/dist/ui/sidebar.js +10 -9
- package/dist/ui/skeleton.d.ts +4 -1
- package/dist/ui/skeleton.js +8 -2
- package/dist/ui/tabs.d.ts +1 -1
- package/dist/ui/tabs.js +2 -13
- package/dist/ui/timeline.js +1 -1
- package/dist/ui/typography.d.ts +11 -5
- package/dist/ui/typography.js +18 -6
- package/lint/biome-preset.json +3 -0
- package/lint/class-policy.mjs +17 -0
- package/lint/eslint-plugin.mjs +87 -0
- package/lint/grit-rules.mjs +40 -0
- package/lint/no-component-style-classes.grit +16 -0
- package/lint/no-raw-type-classes.grit +2 -3
- package/lint/write-grit-rules.mjs +19 -0
- package/package.json +11 -2
- package/dist/styles/type-scale.css +0 -72
package/dist/surface-variants.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
//#region src/surface-variants.ts
|
|
2
2
|
const popupItemStructureClasses = "flex select-none items-center";
|
|
3
|
+
const popupItemTones = ["neutral", "danger"];
|
|
3
4
|
const popupParts = [
|
|
4
5
|
"backdrop",
|
|
5
6
|
"surface",
|
|
@@ -13,4 +14,4 @@ const popupParts = [
|
|
|
13
14
|
"shortcut"
|
|
14
15
|
];
|
|
15
16
|
//#endregion
|
|
16
|
-
export { popupItemStructureClasses, popupParts };
|
|
17
|
+
export { popupItemStructureClasses, popupItemTones, popupParts };
|
package/dist/ui/alert-dialog.js
CHANGED
|
@@ -53,7 +53,7 @@ function AlertDialogContent({ className, children, ...props }) {
|
|
|
53
53
|
"data-control-family": "popup",
|
|
54
54
|
"data-popup-part": "surface",
|
|
55
55
|
"data-surface": "modal",
|
|
56
|
-
className: cn("fixed left-1/2 top-[12vh] z-(--z-modal) grid w-[calc(100%-2rem)]
|
|
56
|
+
className: cn("fixed left-1/2 top-[12vh] z-(--z-modal) grid w-[calc(100%-2rem)] -translate-x-1/2", className),
|
|
57
57
|
...props,
|
|
58
58
|
children
|
|
59
59
|
})] });
|
package/dist/ui/badge.js
CHANGED
|
@@ -27,7 +27,7 @@ function Badge({ variant = "default", size = "md", color, render, className, chi
|
|
|
27
27
|
"data-variant": variant,
|
|
28
28
|
"data-size": size,
|
|
29
29
|
"data-color": resolvedColor,
|
|
30
|
-
className: cn("inline-flex w-fit shrink-0 items-center justify-center overflow-hidden whitespace-nowrap
|
|
30
|
+
className: cn("inline-flex w-fit shrink-0 items-center justify-center overflow-hidden whitespace-nowrap [&>svg]:pointer-events-none [&>svg]:size-3", className),
|
|
31
31
|
children
|
|
32
32
|
}
|
|
33
33
|
});
|
package/dist/ui/calendar.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/cn.js";
|
|
3
|
+
import { useSkin } from "../skin-provider.js";
|
|
3
4
|
import { useEffect, useRef } from "react";
|
|
4
5
|
import { jsx } from "react/jsx-runtime";
|
|
5
6
|
import { CaptionLabel, Day, DayPicker, Month, MonthCaption, MonthGrid, Months, Nav, Weekday } from "react-day-picker";
|
|
@@ -12,7 +13,8 @@ const chevronPathByOrientation = {
|
|
|
12
13
|
up: "M3 10 8 5.5 13 10",
|
|
13
14
|
down: "M3 6 8 10.5 13 6"
|
|
14
15
|
};
|
|
15
|
-
function Calendar({ className, showOutsideDays
|
|
16
|
+
function Calendar({ className, showOutsideDays, style, ...props }) {
|
|
17
|
+
const skin = useSkin();
|
|
16
18
|
return /* @__PURE__ */ jsx("div", {
|
|
17
19
|
"data-control-ui": "calendar",
|
|
18
20
|
"data-control-family": "calendar",
|
|
@@ -20,7 +22,7 @@ function Calendar({ className, showOutsideDays = true, style, ...props }) {
|
|
|
20
22
|
className: cn("w-fit", className),
|
|
21
23
|
style,
|
|
22
24
|
children: /* @__PURE__ */ jsx(DayPicker, {
|
|
23
|
-
showOutsideDays,
|
|
25
|
+
showOutsideDays: showOutsideDays ?? skin.calendarShowOutsideDays ?? true,
|
|
24
26
|
components: {
|
|
25
27
|
Chevron: CalendarChevron,
|
|
26
28
|
Months: CalendarMonths,
|
|
@@ -111,12 +113,15 @@ function CalendarWeekday({ className, ...props }) {
|
|
|
111
113
|
...props
|
|
112
114
|
});
|
|
113
115
|
}
|
|
114
|
-
function CalendarDay({ className, ...props }) {
|
|
116
|
+
function CalendarDay({ className, day, ...props }) {
|
|
117
|
+
const dayOfWeek = day.date.getDay();
|
|
115
118
|
return /* @__PURE__ */ jsx(Day, {
|
|
116
119
|
"data-control-ui": "calendar",
|
|
117
120
|
"data-control-family": "calendar",
|
|
118
121
|
"data-slot": "day-cell",
|
|
119
|
-
|
|
122
|
+
"data-weekend": dayOfWeek === 0 || dayOfWeek === 6 ? true : void 0,
|
|
123
|
+
className: cn("align-middle", className),
|
|
124
|
+
day,
|
|
120
125
|
...props
|
|
121
126
|
});
|
|
122
127
|
}
|
package/dist/ui/card.d.ts
CHANGED
|
@@ -3,10 +3,12 @@ import { CardKnobStyle } from "../knob-contracts/card-knobs.js";
|
|
|
3
3
|
import { CSSProperties, ComponentProps } from "react";
|
|
4
4
|
//#region src/ui/card.d.ts
|
|
5
5
|
export type CardVariant = "default" | "sectioned";
|
|
6
|
+
export type CardSize = "default" | "sm";
|
|
6
7
|
export type CardProps = Omit<ComponentProps<"div">, "style"> & {
|
|
7
8
|
style?: CSSProperties & CardKnobStyle;
|
|
8
9
|
} & {
|
|
9
10
|
variant?: CardVariant;
|
|
11
|
+
size?: CardSize;
|
|
10
12
|
};
|
|
11
13
|
export type CardHeaderProps = ComponentProps<"div"> & {
|
|
12
14
|
style?: CSSProperties & CardKnobStyle;
|
|
@@ -27,7 +29,7 @@ export type CardContentProps = ComponentProps<"div"> & {
|
|
|
27
29
|
export type CardFooterProps = ComponentProps<"div"> & {
|
|
28
30
|
style?: CSSProperties & CardKnobStyle;
|
|
29
31
|
};
|
|
30
|
-
export declare function Card({ variant, className, ...props }: CardProps): import("react").JSX.Element;
|
|
32
|
+
export declare function Card({ variant, size, className, ...props }: CardProps): import("react").JSX.Element;
|
|
31
33
|
export declare function CardHeader({ className, ...props }: CardHeaderProps): import("react").JSX.Element;
|
|
32
34
|
export declare function CardTitle({ render, ...props }: CardTitleProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
33
35
|
export declare function CardDescription({ className, ...props }: CardDescriptionProps): import("react").JSX.Element;
|
package/dist/ui/card.js
CHANGED
|
@@ -3,13 +3,14 @@ import { cn } from "../lib/cn.js";
|
|
|
3
3
|
import { useRender } from "@base-ui/react/use-render";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region src/ui/card.tsx
|
|
6
|
-
function Card({ variant = "default", className, ...props }) {
|
|
6
|
+
function Card({ variant = "default", size = "default", className, ...props }) {
|
|
7
7
|
return /* @__PURE__ */ jsx("div", {
|
|
8
8
|
"data-control-ui": "card",
|
|
9
9
|
"data-control-family": "card",
|
|
10
10
|
"data-slot": "root",
|
|
11
11
|
"data-surface": "panel",
|
|
12
12
|
"data-variant": variant,
|
|
13
|
+
"data-size": size,
|
|
13
14
|
className: cn("flex flex-col", className),
|
|
14
15
|
...props
|
|
15
16
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ControlledChoice, OpenChangeEventDetails } from "../control-props.js";
|
|
2
2
|
import { PopupKnobStyle } from "../knob-contracts/popup-knobs.js";
|
|
3
|
+
import { PopupItemTone } from "../surface-variants.js";
|
|
3
4
|
import { CSSProperties, ComponentProps, MouseEvent, ReactNode } from "react";
|
|
4
5
|
import { ContextMenu as ContextMenu$1 } from "@base-ui/react/context-menu";
|
|
5
6
|
//#region src/ui/context-menu.d.ts
|
|
@@ -23,6 +24,7 @@ export type ContextMenuItemProps = Omit<Omit<ComponentProps<"div">, "onClick">,
|
|
|
23
24
|
} & {
|
|
24
25
|
disabled?: boolean;
|
|
25
26
|
inset?: boolean;
|
|
27
|
+
tone?: PopupItemTone;
|
|
26
28
|
onClick?: (event: MouseEvent) => void;
|
|
27
29
|
};
|
|
28
30
|
export type ContextMenuCheckboxItemProps = Omit<Omit<ComponentProps<"div">, "onClick">, "style"> & {
|
|
@@ -72,7 +74,7 @@ export declare function ContextMenuTrigger({ className, ...props }: ContextMenuT
|
|
|
72
74
|
export declare function ContextMenuPortal(props: ComponentProps<typeof ContextMenu$1.Portal>): import("react").JSX.Element;
|
|
73
75
|
export declare function ContextMenuGroup({ className, ...props }: ContextMenuGroupProps): import("react").JSX.Element;
|
|
74
76
|
export declare function ContextMenuContent({ className, children, ...props }: ContextMenuContentProps): import("react").JSX.Element;
|
|
75
|
-
export declare function ContextMenuItem({ className, inset, ...props }: ContextMenuItemProps): import("react").JSX.Element;
|
|
77
|
+
export declare function ContextMenuItem({ className, inset, tone, ...props }: ContextMenuItemProps): import("react").JSX.Element;
|
|
76
78
|
export declare function ContextMenuCheckboxItem({ className, children, ...props }: ContextMenuCheckboxItemProps): import("react").JSX.Element;
|
|
77
79
|
export declare function ContextMenuRadioGroup<TValue extends string = string>({ className, ...props }: ContextMenuRadioGroupProps<TValue>): import("react").JSX.Element;
|
|
78
80
|
export declare function ContextMenuRadioItem({ className, children, value, ...props }: ContextMenuRadioItemProps): import("react").JSX.Element;
|
package/dist/ui/context-menu.js
CHANGED
|
@@ -56,13 +56,14 @@ function ContextMenuContent({ className, children, ...props }) {
|
|
|
56
56
|
})
|
|
57
57
|
}) });
|
|
58
58
|
}
|
|
59
|
-
function ContextMenuItem({ className, inset = false, ...props }) {
|
|
59
|
+
function ContextMenuItem({ className, inset = false, tone = "neutral", ...props }) {
|
|
60
60
|
return /* @__PURE__ */ jsx(ContextMenu$1.Item, {
|
|
61
61
|
"data-control-ui": "context-menu",
|
|
62
62
|
"data-popup-kind": "context-menu",
|
|
63
63
|
"data-slot": "item",
|
|
64
64
|
"data-control-family": "popup",
|
|
65
65
|
"data-popup-part": "item",
|
|
66
|
+
"data-tone": tone,
|
|
66
67
|
"data-inset": inset || void 0,
|
|
67
68
|
className: cn(itemClasses, className),
|
|
68
69
|
...mergeProps(popupItemFocusProps, props)
|
package/dist/ui/dialog.js
CHANGED
|
@@ -54,7 +54,7 @@ function DialogContent({ className, children, showCloseButton = true, closeLabel
|
|
|
54
54
|
"data-control-family": "popup",
|
|
55
55
|
"data-popup-part": "surface",
|
|
56
56
|
"data-surface": "modal",
|
|
57
|
-
className: cn("fixed left-1/2 top-[12vh] z-(--z-modal) grid w-[calc(100%-2rem)]
|
|
57
|
+
className: cn("fixed left-1/2 top-[12vh] z-(--z-modal) grid w-[calc(100%-2rem)] -translate-x-1/2", className),
|
|
58
58
|
...props,
|
|
59
59
|
children: [
|
|
60
60
|
skinAdornment(skin, "dialog", "titlebar", {}),
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ControlSize } from "../control-variants.js";
|
|
2
2
|
import { ButtonKnobStyle } from "../knob-contracts/button-knobs.js";
|
|
3
3
|
import { PopupKnobStyle } from "../knob-contracts/popup-knobs.js";
|
|
4
|
+
import { PopupItemTone } from "../surface-variants.js";
|
|
4
5
|
import { CSSProperties, ComponentProps } from "react";
|
|
5
6
|
import { Menu } from "@base-ui/react/menu";
|
|
6
7
|
//#region src/ui/dropdown-menu.d.ts
|
|
@@ -19,7 +20,9 @@ export type DropdownMenuTriggerProps = Omit<ComponentProps<"button">, "style"> &
|
|
|
19
20
|
variant?: DropdownMenuTriggerVariant;
|
|
20
21
|
};
|
|
21
22
|
export type DropdownMenuContentProps = DropdownMenuStyledProps<Menu.Popup.Props> & Pick<Menu.Positioner.Props, "side" | "sideOffset" | "align" | "alignOffset" | "collisionBoundary" | "collisionPadding" | "collisionAvoidance">;
|
|
22
|
-
export type DropdownMenuItemProps = DropdownMenuStyledProps<Menu.Item.Props
|
|
23
|
+
export type DropdownMenuItemProps = DropdownMenuStyledProps<Menu.Item.Props> & {
|
|
24
|
+
tone?: PopupItemTone;
|
|
25
|
+
};
|
|
23
26
|
export type DropdownMenuGroupProps = DropdownMenuStyledProps<Menu.Group.Props>;
|
|
24
27
|
export type DropdownMenuCheckboxItemProps = DropdownMenuStyledProps<Menu.CheckboxItem.Props>;
|
|
25
28
|
export type DropdownMenuRadioGroupProps = DropdownMenuStyledProps<Menu.RadioGroup.Props>;
|
|
@@ -35,9 +38,9 @@ export type DropdownMenuLabelProps = Omit<ComponentProps<"div">, "style"> & {
|
|
|
35
38
|
style?: CSSProperties & PopupKnobStyle;
|
|
36
39
|
};
|
|
37
40
|
export declare function DropdownMenu({ children, ...props }: DropdownMenuProps): import("react").JSX.Element;
|
|
38
|
-
export declare function DropdownMenuTrigger({ size, iconOnly, variant, className,
|
|
41
|
+
export declare function DropdownMenuTrigger({ size, iconOnly, variant, className, ...props }: DropdownMenuTriggerProps): import("react").JSX.Element;
|
|
39
42
|
export declare function DropdownMenuContent({ className, children, side, sideOffset, align, alignOffset, collisionBoundary, collisionPadding, collisionAvoidance, ...props }: DropdownMenuContentProps): import("react").JSX.Element;
|
|
40
|
-
export declare function DropdownMenuItem({ className, ...props }: DropdownMenuItemProps): import("react").JSX.Element;
|
|
43
|
+
export declare function DropdownMenuItem({ tone, className, ...props }: DropdownMenuItemProps): import("react").JSX.Element;
|
|
41
44
|
export declare function DropdownMenuSeparator({ className, ...props }: DropdownMenuSeparatorProps): import("react").JSX.Element;
|
|
42
45
|
export declare function DropdownMenuLabel({ className, ...props }: DropdownMenuLabelProps): import("react").JSX.Element;
|
|
43
46
|
export declare function DropdownMenuPortal(props: Menu.Portal.Props): import("react").JSX.Element;
|
package/dist/ui/dropdown-menu.js
CHANGED
|
@@ -4,6 +4,7 @@ import { controlEffectsAttribute } from "../skin.js";
|
|
|
4
4
|
import { useSkin } from "../skin-provider.js";
|
|
5
5
|
import { popupItemFocusProps } from "../lib/popup-item-focus.js";
|
|
6
6
|
import { popupItemStructureClasses } from "../surface-variants.js";
|
|
7
|
+
import { isValidElement } from "react";
|
|
7
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
9
|
import { mergeProps } from "@base-ui/react/merge-props";
|
|
9
10
|
import { Menu } from "@base-ui/react/menu";
|
|
@@ -15,21 +16,37 @@ function DropdownMenu({ children, ...props }) {
|
|
|
15
16
|
children
|
|
16
17
|
});
|
|
17
18
|
}
|
|
18
|
-
function
|
|
19
|
+
function explicitAppearance({ size, variant, iconOnly }) {
|
|
20
|
+
const attributes = {};
|
|
21
|
+
if (size) attributes["data-size"] = size;
|
|
22
|
+
if (variant) attributes["data-variant"] = variant;
|
|
23
|
+
if (iconOnly) attributes["data-icon-only"] = "true";
|
|
24
|
+
return attributes;
|
|
25
|
+
}
|
|
26
|
+
function DropdownMenuTrigger({ size, iconOnly, variant, className, ...props }) {
|
|
27
|
+
if (props.render !== void 0 && !(isValidElement(props.render) && typeof props.render.type === "string")) return /* @__PURE__ */ jsx(Menu.Trigger, {
|
|
28
|
+
"data-control-ui": "dropdown-menu",
|
|
29
|
+
"data-slot": "trigger",
|
|
30
|
+
...explicitAppearance({
|
|
31
|
+
size,
|
|
32
|
+
variant,
|
|
33
|
+
iconOnly
|
|
34
|
+
}),
|
|
35
|
+
className,
|
|
36
|
+
...props
|
|
37
|
+
});
|
|
19
38
|
return /* @__PURE__ */ jsx(Menu.Trigger, {
|
|
20
39
|
"data-control-ui": "dropdown-menu",
|
|
21
40
|
"data-control-family": "button",
|
|
22
41
|
"data-slot": "trigger",
|
|
23
42
|
"data-control": "true",
|
|
24
|
-
"data-size": size,
|
|
43
|
+
"data-size": size ?? "sm",
|
|
25
44
|
"data-icon-only": iconOnly ? "true" : void 0,
|
|
26
|
-
"data-variant": variant,
|
|
45
|
+
"data-variant": variant ?? "surface",
|
|
27
46
|
"data-tone": "neutral",
|
|
28
47
|
"data-shape": "default",
|
|
29
48
|
className: cn("relative isolate inline-flex shrink-0 items-center justify-center overflow-visible", className),
|
|
30
|
-
|
|
31
|
-
...props,
|
|
32
|
-
children
|
|
49
|
+
...props
|
|
33
50
|
});
|
|
34
51
|
}
|
|
35
52
|
function DropdownMenuContent({ className, children, side, sideOffset = 6, align = "start", alignOffset, collisionBoundary, collisionPadding, collisionAvoidance, ...props }) {
|
|
@@ -57,12 +74,13 @@ function DropdownMenuContent({ className, children, side, sideOffset = 6, align
|
|
|
57
74
|
})
|
|
58
75
|
}) });
|
|
59
76
|
}
|
|
60
|
-
function DropdownMenuItem({ className, ...props }) {
|
|
77
|
+
function DropdownMenuItem({ tone = "neutral", className, ...props }) {
|
|
61
78
|
return /* @__PURE__ */ jsx(Menu.Item, {
|
|
62
79
|
"data-control-ui": "dropdown-menu",
|
|
63
80
|
"data-slot": "item",
|
|
64
81
|
"data-control-family": "popup",
|
|
65
82
|
"data-popup-part": "item",
|
|
83
|
+
"data-tone": tone,
|
|
66
84
|
className: cn(popupItemStructureClasses, className),
|
|
67
85
|
...mergeProps(popupItemFocusProps, props)
|
|
68
86
|
});
|
package/dist/ui/dropzone.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/cn.js";
|
|
3
3
|
import { Button } from "./button.js";
|
|
4
|
+
import { Item, ItemActions, ItemContent, ItemDescription, ItemMedia, ItemTitle } from "./item.js";
|
|
4
5
|
import { DropzoneErrorCode, formatDropzoneFileSize } from "../lib/dropzone-validation.js";
|
|
5
6
|
import { useDropzone } from "../hooks/use-dropzone.js";
|
|
6
|
-
import { Item, ItemActions, ItemContent, ItemDescription, ItemMedia, ItemTitle } from "./item.js";
|
|
7
7
|
import { createContext, useContext, useEffect, useState } from "react";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
-
import {
|
|
9
|
+
import { CircleAlertIcon, CloudUpload, FileIcon, LoaderCircle, Search, XIcon } from "lucide-react";
|
|
10
10
|
//#region src/ui/dropzone.tsx
|
|
11
11
|
const DropzoneContext = createContext(null);
|
|
12
12
|
const DropzoneFocusContext = createContext(null);
|
|
@@ -300,7 +300,7 @@ function DropzoneFeedback({ state }) {
|
|
|
300
300
|
icon = /* @__PURE__ */ jsx(CloudUpload, { "aria-hidden": "true" });
|
|
301
301
|
message = "Release to add files.";
|
|
302
302
|
} else if (state === "reject") {
|
|
303
|
-
icon = /* @__PURE__ */ jsx(
|
|
303
|
+
icon = /* @__PURE__ */ jsx(CircleAlertIcon, { "aria-hidden": "true" });
|
|
304
304
|
message = "Some files are not accepted.";
|
|
305
305
|
} else if (state === "unknown") {
|
|
306
306
|
icon = /* @__PURE__ */ jsx(Search, { "aria-hidden": "true" });
|
|
@@ -341,19 +341,18 @@ function DefaultFile({ file }) {
|
|
|
341
341
|
]
|
|
342
342
|
});
|
|
343
343
|
}
|
|
344
|
+
const rejectedItemStyle = {
|
|
345
|
+
"--cui-item-media-foreground": "var(--destructive-text)",
|
|
346
|
+
"--cui-item-description-foreground": "var(--destructive-text)"
|
|
347
|
+
};
|
|
344
348
|
function DefaultRejection({ rejection }) {
|
|
345
349
|
return /* @__PURE__ */ jsxs(Item, {
|
|
346
350
|
variant: "muted",
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
children: /* @__PURE__ */ jsx(CircleAlert, { "aria-hidden": "true" })
|
|
350
|
-
}), /* @__PURE__ */ jsxs(ItemContent, { children: [/* @__PURE__ */ jsx(ItemTitle, {
|
|
351
|
+
style: rejectedItemStyle,
|
|
352
|
+
children: [/* @__PURE__ */ jsx(ItemMedia, { children: /* @__PURE__ */ jsx(CircleAlertIcon, { "aria-hidden": "true" }) }), /* @__PURE__ */ jsxs(ItemContent, { children: [/* @__PURE__ */ jsx(ItemTitle, {
|
|
351
353
|
className: "wrap-anywhere",
|
|
352
354
|
children: rejection.file.name
|
|
353
|
-
}), rejection.errors.map((error) => /* @__PURE__ */ jsx(ItemDescription, {
|
|
354
|
-
"data-dropzone-invalid": "",
|
|
355
|
-
children: error.message
|
|
356
|
-
}, `${error.code}-${error.message}`))] })]
|
|
355
|
+
}), rejection.errors.map((error) => /* @__PURE__ */ jsx(ItemDescription, { children: error.message }, `${error.code}-${error.message}`))] })]
|
|
357
356
|
});
|
|
358
357
|
}
|
|
359
358
|
function getDropzoneStatusMessage(context) {
|
package/dist/ui/empty.d.ts
CHANGED
|
@@ -2,8 +2,11 @@ import { RenderProp } from "../control-props.js";
|
|
|
2
2
|
import { EmptyKnobStyle } from "../knob-contracts/empty-knobs.js";
|
|
3
3
|
import { CSSProperties, ComponentProps } from "react";
|
|
4
4
|
//#region src/ui/empty.d.ts
|
|
5
|
+
export declare const emptyVariants: readonly ["default", "outline"];
|
|
6
|
+
export type EmptyVariant = (typeof emptyVariants)[number];
|
|
5
7
|
export type EmptyProps = Omit<ComponentProps<"div">, "style"> & {
|
|
6
8
|
style?: CSSProperties & EmptyKnobStyle;
|
|
9
|
+
variant?: EmptyVariant;
|
|
7
10
|
};
|
|
8
11
|
export type EmptyHeaderProps = Omit<ComponentProps<"div">, "style"> & {
|
|
9
12
|
style?: CSSProperties & EmptyKnobStyle;
|
|
@@ -21,7 +24,7 @@ export type EmptyTitleProps = Omit<ComponentProps<"div">, "style"> & {
|
|
|
21
24
|
render?: RenderProp<ComponentProps<"div">>;
|
|
22
25
|
style?: CSSProperties & EmptyKnobStyle;
|
|
23
26
|
};
|
|
24
|
-
export declare function Empty({ className, ...props }: EmptyProps): import("react").JSX.Element;
|
|
27
|
+
export declare function Empty({ variant, className, ...props }: EmptyProps): import("react").JSX.Element;
|
|
25
28
|
export declare function EmptyHeader({ className, ...props }: EmptyHeaderProps): import("react").JSX.Element;
|
|
26
29
|
export declare function EmptyMedia({ className, ...props }: EmptyMediaProps): import("react").JSX.Element;
|
|
27
30
|
export declare function EmptyTitle({ render, ...props }: EmptyTitleProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
package/dist/ui/empty.js
CHANGED
|
@@ -3,11 +3,13 @@ import { cn } from "../lib/cn.js";
|
|
|
3
3
|
import { useRender } from "@base-ui/react/use-render";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region src/ui/empty.tsx
|
|
6
|
-
|
|
6
|
+
const emptyVariants = ["default", "outline"];
|
|
7
|
+
function Empty({ variant = "default", className, ...props }) {
|
|
7
8
|
return /* @__PURE__ */ jsx("div", {
|
|
8
9
|
"data-control-ui": "empty",
|
|
9
10
|
"data-control-family": "empty",
|
|
10
11
|
"data-slot": "root",
|
|
12
|
+
"data-variant": variant,
|
|
11
13
|
className: cn("flex min-w-0 flex-1 flex-col items-center justify-center", className),
|
|
12
14
|
...props
|
|
13
15
|
});
|
|
@@ -61,4 +63,4 @@ function EmptyContent({ className, ...props }) {
|
|
|
61
63
|
});
|
|
62
64
|
}
|
|
63
65
|
//#endregion
|
|
64
|
-
export { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle };
|
|
66
|
+
export { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, emptyVariants };
|
package/dist/ui/field.d.ts
CHANGED
|
@@ -31,7 +31,9 @@ export type FieldErrorProps = Omit<ComponentProps<"div">, "style"> & {
|
|
|
31
31
|
match?: FieldErrorMatch;
|
|
32
32
|
style?: CSSProperties & FieldKnobStyle;
|
|
33
33
|
};
|
|
34
|
+
export type FieldGroupVariant = "default" | "card";
|
|
34
35
|
export type FieldGroupProps = ComponentProps<"div"> & {
|
|
36
|
+
variant?: FieldGroupVariant;
|
|
35
37
|
style?: CSSProperties & FieldKnobStyle;
|
|
36
38
|
};
|
|
37
39
|
export type FieldSeparatorProps = Omit<ComponentProps<"div">, "style"> & {
|
|
@@ -44,7 +46,9 @@ export type FieldItemProps = ComponentProps<"div"> & {
|
|
|
44
46
|
export type FieldSetProps = Omit<ComponentProps<"fieldset">, "style"> & {
|
|
45
47
|
style?: CSSProperties & FieldKnobStyle;
|
|
46
48
|
};
|
|
49
|
+
export type FieldLegendVariant = "default" | "section";
|
|
47
50
|
export type FieldLegendProps = Omit<ComponentProps<"div">, "style"> & {
|
|
51
|
+
variant?: FieldLegendVariant;
|
|
48
52
|
style?: CSSProperties & FieldKnobStyle;
|
|
49
53
|
};
|
|
50
54
|
export declare function Field({ className, orientation, ...props }: FieldProps): import("react").JSX.Element;
|
|
@@ -55,9 +59,9 @@ type RefinedFieldControlProps = FieldControlProps & Pick<ComponentProps<typeof F
|
|
|
55
59
|
export declare function FieldControl({ className, render, ...props }: RefinedFieldControlProps): import("react").JSX.Element;
|
|
56
60
|
export declare function FieldDescription({ className, ...props }: FieldDescriptionProps): import("react").JSX.Element;
|
|
57
61
|
export declare function FieldError({ className, ...props }: FieldErrorProps): import("react").JSX.Element;
|
|
58
|
-
export declare function FieldGroup({ className, ...props }: FieldGroupProps): import("react").JSX.Element;
|
|
62
|
+
export declare function FieldGroup({ className, variant, ...props }: FieldGroupProps): import("react").JSX.Element;
|
|
59
63
|
export declare function FieldSeparator({ children, className, ...props }: FieldSeparatorProps): import("react").JSX.Element;
|
|
60
64
|
export declare function FieldItem({ className, ...props }: FieldItemProps): import("react").JSX.Element;
|
|
61
65
|
export declare function FieldSet({ className, ...props }: FieldSetProps): import("react").JSX.Element;
|
|
62
|
-
export declare function FieldLegend({ className, ...props }: FieldLegendProps): import("react").JSX.Element;
|
|
66
|
+
export declare function FieldLegend({ className, variant, ...props }: FieldLegendProps): import("react").JSX.Element;
|
|
63
67
|
//#endregion
|
package/dist/ui/field.js
CHANGED
|
@@ -103,12 +103,13 @@ function FieldError({ className, ...props }) {
|
|
|
103
103
|
})
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
|
-
function FieldGroup({ className, ...props }) {
|
|
106
|
+
function FieldGroup({ className, variant = "default", ...props }) {
|
|
107
107
|
return /* @__PURE__ */ jsx("div", {
|
|
108
108
|
"data-control-ui": "field",
|
|
109
109
|
"data-control-family": "field",
|
|
110
110
|
"data-field-kind": "field",
|
|
111
111
|
"data-slot": "group",
|
|
112
|
+
"data-variant": variant,
|
|
112
113
|
className: cn("group/field-group @container/field-group flex flex-col", className),
|
|
113
114
|
...props
|
|
114
115
|
});
|
|
@@ -152,12 +153,13 @@ function FieldSet({ className, ...props }) {
|
|
|
152
153
|
...props
|
|
153
154
|
});
|
|
154
155
|
}
|
|
155
|
-
function FieldLegend({ className, ...props }) {
|
|
156
|
+
function FieldLegend({ className, variant = "default", ...props }) {
|
|
156
157
|
return /* @__PURE__ */ jsx(Fieldset.Legend, {
|
|
157
158
|
"data-control-ui": "field",
|
|
158
159
|
"data-control-family": "field",
|
|
159
160
|
"data-field-kind": "field",
|
|
160
161
|
"data-slot": "legend",
|
|
162
|
+
"data-variant": variant,
|
|
161
163
|
className,
|
|
162
164
|
...props
|
|
163
165
|
});
|
package/dist/ui/menubar.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { OpenChangeEventDetails } from "../control-props.js";
|
|
2
2
|
import { ButtonKnobStyle } from "../knob-contracts/button-knobs.js";
|
|
3
3
|
import { PopupKnobStyle } from "../knob-contracts/popup-knobs.js";
|
|
4
|
+
import { PopupItemTone } from "../surface-variants.js";
|
|
4
5
|
import { CSSProperties, ComponentProps, MouseEvent, ReactNode } from "react";
|
|
5
6
|
//#region src/ui/menubar.d.ts
|
|
6
7
|
export type MenubarProps = Omit<ComponentProps<"div">, "style"> & {
|
|
@@ -30,6 +31,7 @@ export type MenubarItemProps = Omit<Omit<ComponentProps<"div">, "onClick">, "sty
|
|
|
30
31
|
style?: CSSProperties & PopupKnobStyle;
|
|
31
32
|
} & {
|
|
32
33
|
disabled?: boolean;
|
|
34
|
+
tone?: PopupItemTone;
|
|
33
35
|
onClick?: (event: MouseEvent) => void;
|
|
34
36
|
};
|
|
35
37
|
export type MenubarSeparatorProps = Omit<ComponentProps<"div">, "style"> & {
|
|
@@ -63,7 +65,7 @@ export declare function MenubarMenu(props: MenubarMenuProps): import("react").JS
|
|
|
63
65
|
export declare function MenubarTrigger({ className, ...props }: MenubarTriggerProps): import("react").JSX.Element;
|
|
64
66
|
export declare function MenubarContent({ className, children, ...props }: MenubarContentProps): import("react").JSX.Element;
|
|
65
67
|
export declare function MenubarGroup({ className, ...props }: MenubarGroupProps): import("react").JSX.Element;
|
|
66
|
-
export declare function MenubarItem({ className, ...props }: MenubarItemProps): import("react").JSX.Element;
|
|
68
|
+
export declare function MenubarItem({ tone, className, ...props }: MenubarItemProps): import("react").JSX.Element;
|
|
67
69
|
export declare function MenubarLabel({ className, inset, ...props }: MenubarLabelProps): import("react").JSX.Element;
|
|
68
70
|
export declare function MenubarSeparator({ className, ...props }: MenubarSeparatorProps): import("react").JSX.Element;
|
|
69
71
|
export declare function MenubarShortcut({ className, ...props }: MenubarShortcutProps): import("react").JSX.Element;
|
package/dist/ui/menubar.js
CHANGED
|
@@ -69,13 +69,14 @@ function MenubarGroup({ className, ...props }) {
|
|
|
69
69
|
...props
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
|
-
function MenubarItem({ className, ...props }) {
|
|
72
|
+
function MenubarItem({ tone = "neutral", className, ...props }) {
|
|
73
73
|
return /* @__PURE__ */ jsx(Menu.Item, {
|
|
74
74
|
"data-control-ui": "menubar",
|
|
75
75
|
"data-popup-kind": "menubar",
|
|
76
76
|
"data-slot": "item",
|
|
77
77
|
"data-control-family": "popup",
|
|
78
78
|
"data-popup-part": "item",
|
|
79
|
+
"data-tone": tone,
|
|
79
80
|
className: cn(itemClasses, className),
|
|
80
81
|
...props
|
|
81
82
|
});
|
|
@@ -35,6 +35,10 @@ export declare function MorphingPanelTrigger({ render, className, children, ...p
|
|
|
35
35
|
export declare function MorphingPanelContent({ autoFocus, ...props }: MorphingPanelContentProps): import("react").JSX.Element;
|
|
36
36
|
export declare function MorphingPanelClose({ onClick, ...props }: MorphingPanelCloseProps): import("react").JSX.Element;
|
|
37
37
|
export declare function MorphingPanelHeader({ className, ...props }: MorphingPanelPartProps): import("react").JSX.Element;
|
|
38
|
-
export declare
|
|
38
|
+
export declare const morphingPanelBodyPaddings: readonly ["default", "none"];
|
|
39
|
+
export type MorphingPanelBodyPadding = (typeof morphingPanelBodyPaddings)[number];
|
|
40
|
+
export declare function MorphingPanelBody({ className, padding, ...props }: MorphingPanelPartProps & {
|
|
41
|
+
padding?: MorphingPanelBodyPadding;
|
|
42
|
+
}): import("react").JSX.Element;
|
|
39
43
|
export declare function MorphingPanelFooter({ className, ...props }: MorphingPanelPartProps): import("react").JSX.Element;
|
|
40
44
|
//#endregion
|
|
@@ -182,12 +182,14 @@ function MorphingPanelHeader({ className, ...props }) {
|
|
|
182
182
|
className: cn("flex shrink-0 items-center", className)
|
|
183
183
|
});
|
|
184
184
|
}
|
|
185
|
-
|
|
185
|
+
const morphingPanelBodyPaddings = ["default", "none"];
|
|
186
|
+
function MorphingPanelBody({ className, padding = "default", ...props }) {
|
|
186
187
|
return /* @__PURE__ */ jsx("div", {
|
|
187
188
|
...props,
|
|
188
189
|
"data-control-ui": "morphing-panel",
|
|
189
190
|
"data-control-family": "morphing-panel",
|
|
190
191
|
"data-slot": "body",
|
|
192
|
+
"data-padding": padding,
|
|
191
193
|
className: cn("min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain", className)
|
|
192
194
|
});
|
|
193
195
|
}
|
|
@@ -201,4 +203,4 @@ function MorphingPanelFooter({ className, ...props }) {
|
|
|
201
203
|
});
|
|
202
204
|
}
|
|
203
205
|
//#endregion
|
|
204
|
-
export { MorphingPanel, MorphingPanelBody, MorphingPanelClose, MorphingPanelContent, MorphingPanelFooter, MorphingPanelHeader, MorphingPanelPositioner, MorphingPanelTrigger };
|
|
206
|
+
export { MorphingPanel, MorphingPanelBody, MorphingPanelClose, MorphingPanelContent, MorphingPanelFooter, MorphingPanelHeader, MorphingPanelPositioner, MorphingPanelTrigger, morphingPanelBodyPaddings };
|
package/dist/ui/select.js
CHANGED
|
@@ -81,7 +81,7 @@ function SelectValue({ children, ...props }) {
|
|
|
81
81
|
children
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
|
-
function SelectContent({ className, children, alignItemWithTrigger
|
|
84
|
+
function SelectContent({ className, children, alignItemWithTrigger, ...props }) {
|
|
85
85
|
const skin = useSkin();
|
|
86
86
|
return /* @__PURE__ */ jsx(Select$1.Portal, { children: /* @__PURE__ */ jsx(Select$1.Positioner, {
|
|
87
87
|
"data-skin": skin.id,
|
|
@@ -89,7 +89,7 @@ function SelectContent({ className, children, alignItemWithTrigger = false, ...p
|
|
|
89
89
|
side: "bottom",
|
|
90
90
|
align: "start",
|
|
91
91
|
sideOffset: 6,
|
|
92
|
-
alignItemWithTrigger,
|
|
92
|
+
alignItemWithTrigger: alignItemWithTrigger ?? skin.selectAlignItemWithTrigger ?? false,
|
|
93
93
|
className: "z-(--z-popup)",
|
|
94
94
|
children: /* @__PURE__ */ jsx(Select$1.Popup, {
|
|
95
95
|
"data-control-ui": "select",
|
package/dist/ui/sheet.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import { PopupKnobStyle } from "../knob-contracts/popup-knobs.js";
|
|
|
2
2
|
import { CSSProperties, ComponentProps } from "react";
|
|
3
3
|
import { Dialog } from "@base-ui/react/dialog";
|
|
4
4
|
//#region src/ui/sheet.d.ts
|
|
5
|
+
export declare const sheetBodyPaddings: readonly ["default", "none"];
|
|
6
|
+
export type SheetBodyPadding = (typeof sheetBodyPaddings)[number];
|
|
5
7
|
export declare function Sheet(props: ComponentProps<typeof Dialog.Root>): import("react").JSX.Element;
|
|
6
8
|
export declare function SheetClose({ className, ...props }: ComponentProps<typeof Dialog.Close> & {
|
|
7
9
|
style?: CSSProperties & PopupKnobStyle;
|
|
@@ -15,6 +17,13 @@ export declare function SheetContent({ className, children, side, ...props }: Sh
|
|
|
15
17
|
export declare function SheetHeader({ className, ...props }: ComponentProps<"div"> & {
|
|
16
18
|
style?: CSSProperties & PopupKnobStyle;
|
|
17
19
|
}): import("react").JSX.Element;
|
|
20
|
+
export declare function SheetBody({ padding, className, ...props }: ComponentProps<"div"> & {
|
|
21
|
+
padding?: SheetBodyPadding;
|
|
22
|
+
style?: CSSProperties & PopupKnobStyle;
|
|
23
|
+
}): import("react").JSX.Element;
|
|
24
|
+
export declare function SheetFooter({ className, ...props }: ComponentProps<"div"> & {
|
|
25
|
+
style?: CSSProperties & PopupKnobStyle;
|
|
26
|
+
}): import("react").JSX.Element;
|
|
18
27
|
export declare function SheetTitle({ className, ...props }: ComponentProps<typeof Dialog.Title> & {
|
|
19
28
|
style?: CSSProperties & PopupKnobStyle;
|
|
20
29
|
}): import("react").JSX.Element;
|
package/dist/ui/sheet.js
CHANGED
|
@@ -5,6 +5,7 @@ import { useSkin } from "../skin-provider.js";
|
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { Dialog } from "@base-ui/react/dialog";
|
|
7
7
|
//#region src/ui/sheet.tsx
|
|
8
|
+
const sheetBodyPaddings = ["default", "none"];
|
|
8
9
|
function Sheet(props) {
|
|
9
10
|
return /* @__PURE__ */ jsx(Dialog.Root, { ...props });
|
|
10
11
|
}
|
|
@@ -54,6 +55,27 @@ function SheetHeader({ className, ...props }) {
|
|
|
54
55
|
...props
|
|
55
56
|
});
|
|
56
57
|
}
|
|
58
|
+
function SheetBody({ padding = "default", className, ...props }) {
|
|
59
|
+
return /* @__PURE__ */ jsx("div", {
|
|
60
|
+
"data-control-ui": "sheet",
|
|
61
|
+
"data-control-family": "popup",
|
|
62
|
+
"data-popup-kind": "sheet",
|
|
63
|
+
"data-slot": "body",
|
|
64
|
+
"data-padding": padding,
|
|
65
|
+
className: cn("flex min-h-0 flex-1 flex-col overflow-y-auto", className),
|
|
66
|
+
...props
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
function SheetFooter({ className, ...props }) {
|
|
70
|
+
return /* @__PURE__ */ jsx("div", {
|
|
71
|
+
"data-control-ui": "sheet",
|
|
72
|
+
"data-control-family": "popup",
|
|
73
|
+
"data-popup-kind": "sheet",
|
|
74
|
+
"data-slot": "footer",
|
|
75
|
+
className: cn("mt-auto flex shrink-0 flex-col sm:flex-row sm:justify-end", className),
|
|
76
|
+
...props
|
|
77
|
+
});
|
|
78
|
+
}
|
|
57
79
|
function SheetTitle({ className, ...props }) {
|
|
58
80
|
return /* @__PURE__ */ jsx(Dialog.Title, {
|
|
59
81
|
"data-control-ui": "sheet",
|
|
@@ -75,4 +97,4 @@ function SheetDescription({ className, ...props }) {
|
|
|
75
97
|
});
|
|
76
98
|
}
|
|
77
99
|
//#endregion
|
|
78
|
-
export { Sheet, SheetClose, SheetContent, SheetDescription, SheetHeader, SheetTitle };
|
|
100
|
+
export { Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, sheetBodyPaddings };
|
|
@@ -14,7 +14,7 @@ function SidebarMobileNav({ variant = "bar", "aria-label": label = "Mobile navig
|
|
|
14
14
|
"data-slot": "mobile-nav-container",
|
|
15
15
|
"data-layout": layout,
|
|
16
16
|
"data-variant": variant,
|
|
17
|
-
className: "shrink-0
|
|
17
|
+
className: "shrink-0 sidebar:hidden",
|
|
18
18
|
style,
|
|
19
19
|
children: /* @__PURE__ */ jsx("nav", {
|
|
20
20
|
...props,
|
|
@@ -6,6 +6,7 @@ export type SidebarStyle = CSSProperties & SidebarKnobStyle & {
|
|
|
6
6
|
"--sidebar-width-icon"?: string;
|
|
7
7
|
};
|
|
8
8
|
export type SidebarLayoutMode = "viewport" | "contained";
|
|
9
|
+
export type SidebarWrapperSurface = "transparent" | "background";
|
|
9
10
|
type SidebarContextProps = {
|
|
10
11
|
state: "expanded" | "collapsed";
|
|
11
12
|
open: boolean;
|
|
@@ -55,9 +56,10 @@ export type SidebarProviderProps = Omit<ComponentProps<"div">, "style"> & {
|
|
|
55
56
|
persistOpen?: boolean;
|
|
56
57
|
keyboardShortcut?: string | null;
|
|
57
58
|
layout?: SidebarLayoutMode;
|
|
59
|
+
surface?: SidebarWrapperSurface;
|
|
58
60
|
skipLinkLabel?: string;
|
|
59
61
|
contentId?: string;
|
|
60
62
|
style?: SidebarStyle;
|
|
61
63
|
};
|
|
62
|
-
export declare function SidebarProvider({ defaultOpen, open: openProp, onOpenChange, defaultWidth, minWidth, maxWidth, width: widthProp, onWidthChange, persistOpen, keyboardShortcut, layout, skipLinkLabel, contentId: contentIdProp, ref, className, style, children, ...props }: SidebarProviderProps): import("react").JSX.Element;
|
|
64
|
+
export declare function SidebarProvider({ defaultOpen, open: openProp, onOpenChange, defaultWidth, minWidth, maxWidth, width: widthProp, onWidthChange, persistOpen, keyboardShortcut, layout, surface, skipLinkLabel, contentId: contentIdProp, ref, className, style, children, ...props }: SidebarProviderProps): import("react").JSX.Element;
|
|
63
65
|
//#endregion
|