@ctrl-ui/react 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/blocks/coding-agent.js +3 -1
- package/dist/blocks/file-explorer.js +3 -1
- package/dist/blocks/settings.js +3 -1
- package/dist/control-props.d.ts +2 -1
- package/dist/email/email.d.ts +28 -0
- package/dist/email/email.js +70 -0
- package/dist/email/templates.d.ts +51 -0
- package/dist/email/templates.js +228 -0
- package/dist/email/theme.d.ts +23 -0
- package/dist/email/theme.js +98 -0
- package/dist/extensions/create-track-highlight.d.ts +0 -2
- package/dist/extensions/create-track-highlight.js +49 -8
- package/dist/extensions/supports-anchor-transitions.d.ts +4 -0
- package/dist/extensions/supports-anchor-transitions.js +31 -0
- package/dist/extensions/track-highlight.d.ts +0 -6
- package/dist/extensions/track-highlight.js +25 -9
- package/dist/knob-contracts/button-knobs.d.ts +1 -1
- package/dist/knob-contracts/button-knobs.js +4 -1
- package/dist/knob-contracts/progressive-blur-knobs.d.ts +5 -0
- package/dist/knob-contracts/progressive-blur-knobs.js +9 -0
- package/dist/scripts/contrast-eval.d.ts +46 -0
- package/dist/scripts/contrast-eval.js +327 -0
- package/dist/skin.config.js +9 -1
- package/dist/skin.d.ts +11 -9
- package/dist/skin.js +0 -1
- package/dist/styles/index.css +2 -1
- package/dist/styles/recipes/button-group.css +46 -0
- package/dist/styles/recipes/button.css +53 -5
- package/dist/styles/recipes/progressive-blur.css +145 -0
- package/dist/styles/recipes/scroll-area.css +140 -5
- package/dist/styles/recipes/sidebar.css +49 -0
- package/dist/styles/recipes/table-of-contents.css +1 -1
- package/dist/styles/recipes/track-highlight.css +126 -2
- package/dist/styles/recipes/tree.css +4 -0
- package/dist/ui/button-group.d.ts +3 -1
- package/dist/ui/button-group.js +21 -18
- package/dist/ui/button.d.ts +3 -1
- package/dist/ui/button.js +13 -4
- package/dist/ui/checkbox-group.d.ts +5 -3
- package/dist/ui/checkbox-group.js +23 -6
- package/dist/ui/color-picker.js +1 -1
- package/dist/ui/dropdown-menu.d.ts +2 -3
- package/dist/ui/dropdown-menu.js +1 -7
- package/dist/ui/progressive-blur.d.ts +12 -0
- package/dist/ui/progressive-blur.js +47 -0
- package/dist/ui/scroll-area.d.ts +4 -1
- package/dist/ui/scroll-area.js +27 -4
- package/dist/ui/sidebar-menu.d.ts +39 -0
- package/dist/ui/sidebar-menu.js +135 -0
- package/dist/ui/sidebar-provider.d.ts +28 -0
- package/dist/ui/sidebar-provider.js +80 -0
- package/dist/ui/sidebar.d.ts +4 -61
- package/dist/ui/sidebar.js +23 -202
- package/dist/ui/table-of-contents.js +3 -11
- package/dist/ui/toggle.d.ts +3 -2
- package/dist/ui/toggle.js +22 -10
- package/dist/ui/tree.js +13 -19
- package/package.json +5 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
--_track-highlight-opacity: 0;
|
|
5
5
|
border-radius: var(--cui-track-highlight-radius);
|
|
6
6
|
opacity: var(--_track-highlight-opacity);
|
|
7
|
-
transition-property: top, left, right, bottom, opacity, background-color, box-shadow;
|
|
7
|
+
transition-property: top, left, right, bottom, width, height, opacity, background-color, box-shadow;
|
|
8
8
|
transition-duration: var(--cui-track-highlight-transition-duration);
|
|
9
9
|
transition-timing-function: var(--ease-emphasized);
|
|
10
10
|
}
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
var(--cui-track-highlight-shadow);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
:where([data-control-family="track-highlight"][data-slot="root"][data-hover])
|
|
25
|
+
:where([data-control-family="track-highlight"][data-slot="root"][data-hover]),
|
|
26
|
+
:where([data-track="hover"] > [data-control-family="track-highlight"][data-slot="root"]) {
|
|
26
27
|
--cui-track-highlight-background: var(--cui-track-highlight-hover-background);
|
|
27
28
|
--cui-track-highlight-ring-color: transparent;
|
|
28
29
|
--cui-track-highlight-shadow: none;
|
|
@@ -36,6 +37,129 @@
|
|
|
36
37
|
:where([data-control-family="track-highlight"][data-slot="hover"][data-visible]) {
|
|
37
38
|
--_track-highlight-opacity: 1;
|
|
38
39
|
}
|
|
40
|
+
|
|
41
|
+
:where(
|
|
42
|
+
[data-track="hover"]:is([data-control-family="button-group"], [data-control-family="button"][data-slot="group"])
|
|
43
|
+
> [data-control-family="track-highlight"]
|
|
44
|
+
) {
|
|
45
|
+
--cui-track-highlight-hover-background: oklch(from var(--foreground) l c h / 0.06);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
:where([data-track]:has(> [data-control-family="button"][data-track-item]) > [data-control-family="track-highlight"]),
|
|
49
|
+
:where(
|
|
50
|
+
[data-track]:is(
|
|
51
|
+
[data-control-family="button-group"],
|
|
52
|
+
[data-control-family="button"][data-slot="group"],
|
|
53
|
+
[data-control-family="checkbox-group"]
|
|
54
|
+
)
|
|
55
|
+
> [data-control-family="track-highlight"]
|
|
56
|
+
) {
|
|
57
|
+
--cui-track-highlight-radius: var(--radius-control);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@supports ((anchor-name: --cui-track) and (anchor-scope: --cui-track)) {
|
|
61
|
+
:where([data-track]:has(> [data-control-family="track-highlight"])) {
|
|
62
|
+
anchor-scope: --cui-track-active, --cui-track-hover, --cui-track-focus;
|
|
63
|
+
--_track-anchor: --cui-track-active;
|
|
64
|
+
--_track-display: none;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
:where(
|
|
68
|
+
[data-track="slide"]:has(> [data-control-family="track-highlight"]):has(
|
|
69
|
+
[data-track-item][data-active="true"]:not(:disabled, [aria-disabled="true"], [data-disabled])
|
|
70
|
+
)
|
|
71
|
+
) {
|
|
72
|
+
--_track-display: block;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
:where([data-track="hover"]:has(> [data-control-family="track-highlight"])) {
|
|
76
|
+
--_track-anchor: --cui-track-idle;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
:where(
|
|
80
|
+
[data-track]:has(> [data-control-family="track-highlight"])
|
|
81
|
+
[data-track-item][data-active="true"]:not(:disabled, [aria-disabled="true"], [data-disabled])
|
|
82
|
+
) {
|
|
83
|
+
anchor-name: --cui-track-active;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
:where([data-track] > [data-control-family="track-highlight"][data-positioning="anchor"]:not([data-measured])) {
|
|
87
|
+
display: var(--_track-display);
|
|
88
|
+
position-anchor: var(--_track-anchor);
|
|
89
|
+
top: anchor(top, 0px);
|
|
90
|
+
width: anchor-size(width, 0px);
|
|
91
|
+
height: anchor-size(height, 0px);
|
|
92
|
+
left: anchor(left, 0px);
|
|
93
|
+
--_track-highlight-opacity: 1;
|
|
94
|
+
|
|
95
|
+
@starting-style {
|
|
96
|
+
opacity: 0;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
@media (hover: hover) {
|
|
101
|
+
:where(
|
|
102
|
+
[data-track]:has(> [data-control-family="track-highlight"])
|
|
103
|
+
[data-track-item]:hover:not(:disabled, [aria-disabled="true"], [data-disabled], :has([role="checkbox"][data-disabled]))
|
|
104
|
+
) {
|
|
105
|
+
anchor-name: --cui-track-hover;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
:where(
|
|
109
|
+
[data-track]:has(> [data-control-family="track-highlight"]):has(
|
|
110
|
+
[data-track-item]:hover:not(:disabled, [aria-disabled="true"], [data-disabled])
|
|
111
|
+
):not(:has([data-track-item]:hover [role="checkbox"][data-disabled])):not(:has([data-track] [data-track-item]:hover))
|
|
112
|
+
) {
|
|
113
|
+
--_track-anchor: --cui-track-hover;
|
|
114
|
+
--_track-display: block;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
:where(
|
|
118
|
+
[data-track="slide"]:has(
|
|
119
|
+
[data-track-item]:hover:not([data-active="true"], :disabled, [aria-disabled="true"], [data-disabled])
|
|
120
|
+
):not(:has(:focus-visible, [data-track] [data-track-item]:hover))
|
|
121
|
+
> [data-control-family="track-highlight"][data-positioning="anchor"]:not([data-measured])
|
|
122
|
+
) {
|
|
123
|
+
--cui-track-highlight-background: var(--cui-track-highlight-hover-background);
|
|
124
|
+
--cui-track-highlight-ring-color: transparent;
|
|
125
|
+
--cui-track-highlight-shadow: none;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
:where(
|
|
130
|
+
[data-track]:has(> [data-control-family="track-highlight"])
|
|
131
|
+
[data-track-item]:is(:focus-visible, :has(:focus-visible)):not(
|
|
132
|
+
:disabled,
|
|
133
|
+
[aria-disabled="true"],
|
|
134
|
+
[data-disabled],
|
|
135
|
+
:has([role="checkbox"][data-disabled])
|
|
136
|
+
)
|
|
137
|
+
) {
|
|
138
|
+
anchor-name: --cui-track-focus;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
:where(
|
|
142
|
+
[data-track]:has(> [data-control-family="track-highlight"]):has(
|
|
143
|
+
[data-track-item]:focus-visible,
|
|
144
|
+
[data-track-item] :focus-visible
|
|
145
|
+
):not(:has([data-track] :focus-visible))
|
|
146
|
+
) {
|
|
147
|
+
--_track-anchor: --cui-track-focus;
|
|
148
|
+
--_track-display: block;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
:where(
|
|
152
|
+
[data-track="slide"]:has(
|
|
153
|
+
[data-track-item]:not([data-active="true"]):focus-visible,
|
|
154
|
+
[data-track-item]:not([data-active="true"]) :focus-visible
|
|
155
|
+
):not(:has([data-track] :focus-visible))
|
|
156
|
+
> [data-control-family="track-highlight"][data-positioning="anchor"]:not([data-measured])
|
|
157
|
+
) {
|
|
158
|
+
--cui-track-highlight-background: var(--cui-track-highlight-hover-background);
|
|
159
|
+
--cui-track-highlight-ring-color: transparent;
|
|
160
|
+
--cui-track-highlight-shadow: none;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
39
163
|
}
|
|
40
164
|
|
|
41
165
|
@property --cui-track-highlight-radius {
|
|
@@ -15,6 +15,10 @@
|
|
|
15
15
|
outline: none;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
:where([data-control-family="tree"][data-slot="root"] > [data-control-family="track-highlight"]) {
|
|
19
|
+
--cui-track-highlight-radius: var(--cui-tree-item-trigger-radius);
|
|
20
|
+
}
|
|
21
|
+
|
|
18
22
|
:where([data-control-family="tree"][data-slot="item-trigger"]) {
|
|
19
23
|
gap: calc(var(--spacing) * 1.5);
|
|
20
24
|
padding-block: calc(var(--spacing) * 1);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { HoverIndicator } from "../control-props.js";
|
|
1
2
|
import { ControlSize } from "../control-variants.js";
|
|
2
3
|
import { ButtonGroupKnobStyle } from "../knob-contracts/button-group-knobs.js";
|
|
3
4
|
import { CSSProperties, ComponentProps } from "react";
|
|
@@ -9,6 +10,7 @@ type ButtonGroupTextProps = Omit<ComponentProps<"div"> & {
|
|
|
9
10
|
};
|
|
10
11
|
type ButtonGroupProps = ComponentProps<"div"> & {
|
|
11
12
|
orientation?: "horizontal" | "vertical";
|
|
13
|
+
indicator?: HoverIndicator;
|
|
12
14
|
} & {
|
|
13
15
|
style?: CSSProperties & ButtonGroupKnobStyle;
|
|
14
16
|
};
|
|
@@ -17,7 +19,7 @@ type ButtonGroupSeparatorProps = Omit<ComponentProps<"div"> & {
|
|
|
17
19
|
}, "style"> & {
|
|
18
20
|
style?: CSSProperties & ButtonGroupKnobStyle;
|
|
19
21
|
};
|
|
20
|
-
declare function ButtonGroup({ orientation, className, ...props }: ButtonGroupProps): import("react").JSX.Element;
|
|
22
|
+
declare function ButtonGroup({ orientation, indicator, className, children, ...props }: ButtonGroupProps): import("react").JSX.Element;
|
|
21
23
|
declare function ButtonGroupText({ size, className, ...props }: ButtonGroupTextProps): import("react").JSX.Element;
|
|
22
24
|
declare function ButtonGroupSeparator({ orientation, className, ...props }: ButtonGroupSeparatorProps): import("react").JSX.Element;
|
|
23
25
|
//#endregion
|
package/dist/ui/button-group.js
CHANGED
|
@@ -1,23 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { cn } from "../lib/cn.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
3
|
+
import { skinIndicator } from "../skin.js";
|
|
4
|
+
import { ButtonTrackContext, buttonTrackStructureClasses } from "./button.js";
|
|
5
|
+
import { TrackHighlight } from "../extensions/track-highlight.js";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
7
|
//#region src/ui/button-group.tsx
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
8
|
+
function ButtonGroup({ orientation = "horizontal", indicator, className, children, ...props }) {
|
|
9
|
+
const resolvedIndicator = indicator ?? skinIndicator("button-group") ?? "none";
|
|
10
|
+
const tracksHover = resolvedIndicator === "hover";
|
|
11
|
+
return /* @__PURE__ */ jsx(ButtonTrackContext, {
|
|
12
|
+
value: tracksHover,
|
|
13
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
14
|
+
role: "group",
|
|
15
|
+
"data-control-ui": "button-group",
|
|
16
|
+
"data-control-family": "button-group",
|
|
17
|
+
"data-slot": "root",
|
|
18
|
+
"data-orientation": orientation,
|
|
19
|
+
"data-track": resolvedIndicator,
|
|
20
|
+
className: cn(buttonTrackStructureClasses, "inline-flex w-fit items-stretch data-[orientation=vertical]:flex-col", className),
|
|
21
|
+
...props,
|
|
22
|
+
children: [children, tracksHover ? /* @__PURE__ */ jsx(TrackHighlight, { className: "z-0" }) : null]
|
|
23
|
+
})
|
|
21
24
|
});
|
|
22
25
|
}
|
|
23
26
|
function ButtonGroupText({ size = "sm", className, ...props }) {
|
package/dist/ui/button.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { CSSProperties, ComponentProps } from "react";
|
|
|
6
6
|
type ButtonVariant = ControlVariant;
|
|
7
7
|
type ButtonSize = ControlSize;
|
|
8
8
|
type ButtonTone = ControlTone;
|
|
9
|
+
declare const ButtonTrackContext: import("react").Context<boolean>;
|
|
9
10
|
declare const buttonShapes: readonly ["default", "circle"];
|
|
10
11
|
type ButtonShape = (typeof buttonShapes)[number];
|
|
11
12
|
type ButtonAppearanceProps = {
|
|
@@ -28,9 +29,10 @@ type ButtonLinkProps = ComponentProps<"a"> & ButtonAppearanceProps & {
|
|
|
28
29
|
};
|
|
29
30
|
type ButtonLabelProps = ComponentProps<"label"> & ButtonAppearanceProps;
|
|
30
31
|
declare const buttonStructureClasses = "relative isolate inline-flex shrink-0 items-center justify-center overflow-visible whitespace-nowrap";
|
|
32
|
+
declare const buttonTrackStructureClasses = "data-[track=hover]:relative data-[track=hover]:isolate [&_[data-track-item]]:[isolation:auto]";
|
|
31
33
|
declare const buttonContentClasses = "relative z-[1] inline-flex min-w-0 items-center justify-center gap-[inherit]";
|
|
32
34
|
declare function Button({ variant, size, tone, active, iconOnly, shape, type, disabled, render, nativeButton, className, children, ...props }: ButtonProps): import("react").JSX.Element;
|
|
33
35
|
declare function ButtonLink({ variant, size, tone, active, iconOnly, shape, render, className, children, ...props }: ButtonLinkProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
34
36
|
declare function ButtonLabel({ variant, size, tone, active, iconOnly, shape, className, children, ...props }: ButtonLabelProps): import("react").JSX.Element;
|
|
35
37
|
//#endregion
|
|
36
|
-
export { Button, ButtonAppearanceProps, ButtonLabel, ButtonLabelProps, ButtonLink, ButtonLinkProps, ButtonProps, ButtonShape, ButtonSize, ButtonTone, ButtonVariant, buttonContentClasses, buttonShapes, buttonStructureClasses };
|
|
38
|
+
export { Button, ButtonAppearanceProps, ButtonLabel, ButtonLabelProps, ButtonLink, ButtonLinkProps, ButtonProps, ButtonShape, ButtonSize, ButtonTone, ButtonTrackContext, ButtonVariant, buttonContentClasses, buttonShapes, buttonStructureClasses, buttonTrackStructureClasses };
|
package/dist/ui/button.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/cn.js";
|
|
3
3
|
import { skinAdornment } from "../skin.js";
|
|
4
|
+
import { createContext, useContext } from "react";
|
|
4
5
|
import { Button as Button$1 } from "@base-ui/react/button";
|
|
5
6
|
import { useRender } from "@base-ui/react/use-render";
|
|
6
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
7
8
|
//#region src/ui/button.tsx
|
|
9
|
+
const ButtonTrackContext = createContext(false);
|
|
8
10
|
const buttonShapes = ["default", "circle"];
|
|
9
11
|
const buttonStructureClasses = "relative isolate inline-flex shrink-0 items-center justify-center overflow-visible whitespace-nowrap";
|
|
12
|
+
const buttonTrackStructureClasses = "data-[track=hover]:relative data-[track=hover]:isolate [&_[data-track-item]]:[isolation:auto]";
|
|
10
13
|
const buttonContentClasses = "relative z-[1] inline-flex min-w-0 items-center justify-center gap-[inherit]";
|
|
11
14
|
function ButtonContent({ children }) {
|
|
12
15
|
return /* @__PURE__ */ jsx("span", {
|
|
@@ -17,15 +20,16 @@ function ButtonContent({ children }) {
|
|
|
17
20
|
children
|
|
18
21
|
});
|
|
19
22
|
}
|
|
20
|
-
/** The content wrapper only earns its node when a skin layer sits behind it and needs stacking above it. */
|
|
21
23
|
function ButtonBody({ layer, wrap = true, children }) {
|
|
22
|
-
|
|
24
|
+
const wrapsContent = useContext(ButtonTrackContext) || wrap && Boolean(layer);
|
|
25
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [layer, wrapsContent ? /* @__PURE__ */ jsx(ButtonContent, { children }) : children] });
|
|
23
26
|
}
|
|
24
27
|
function Button({ variant = "quiet", size = "sm", tone = "neutral", active = false, iconOnly = false, shape = "default", type = "button", disabled, render, nativeButton, className, children, ...props }) {
|
|
25
28
|
const layer = skinAdornment("button", "layer", {
|
|
26
29
|
variant,
|
|
27
30
|
tone
|
|
28
31
|
});
|
|
32
|
+
const tracksHover = useContext(ButtonTrackContext);
|
|
29
33
|
return /* @__PURE__ */ jsx(Button$1, {
|
|
30
34
|
type: nativeButton === false ? void 0 : type,
|
|
31
35
|
disabled,
|
|
@@ -33,6 +37,7 @@ function Button({ variant = "quiet", size = "sm", tone = "neutral", active = fal
|
|
|
33
37
|
"data-control-family": "button",
|
|
34
38
|
"data-slot": "root",
|
|
35
39
|
"data-control": "true",
|
|
40
|
+
"data-track-item": tracksHover ? "" : void 0,
|
|
36
41
|
"data-active": active ? "true" : void 0,
|
|
37
42
|
"data-icon-only": iconOnly ? "true" : void 0,
|
|
38
43
|
"data-shape": shape,
|
|
@@ -51,10 +56,12 @@ function Button({ variant = "quiet", size = "sm", tone = "neutral", active = fal
|
|
|
51
56
|
});
|
|
52
57
|
}
|
|
53
58
|
function ButtonLink({ variant = "quiet", size = "sm", tone = "neutral", active = false, iconOnly = false, shape = "default", render, className, children, ...props }) {
|
|
59
|
+
const tracksHover = useContext(ButtonTrackContext);
|
|
54
60
|
return useRender({
|
|
55
61
|
defaultTagName: "a",
|
|
56
62
|
render,
|
|
57
63
|
props: {
|
|
64
|
+
"data-track-item": tracksHover ? "" : void 0,
|
|
58
65
|
...props,
|
|
59
66
|
"data-control-ui": "button",
|
|
60
67
|
"data-control-family": "button",
|
|
@@ -78,7 +85,9 @@ function ButtonLink({ variant = "quiet", size = "sm", tone = "neutral", active =
|
|
|
78
85
|
});
|
|
79
86
|
}
|
|
80
87
|
function ButtonLabel({ variant = "quiet", size = "sm", tone = "neutral", active = false, iconOnly = false, shape = "default", className, children, ...props }) {
|
|
88
|
+
const tracksHover = useContext(ButtonTrackContext);
|
|
81
89
|
return /* @__PURE__ */ jsx("label", {
|
|
90
|
+
"data-track-item": tracksHover ? "" : void 0,
|
|
82
91
|
...props,
|
|
83
92
|
"data-control-ui": "button",
|
|
84
93
|
"data-control-family": "button",
|
|
@@ -101,4 +110,4 @@ function ButtonLabel({ variant = "quiet", size = "sm", tone = "neutral", active
|
|
|
101
110
|
});
|
|
102
111
|
}
|
|
103
112
|
//#endregion
|
|
104
|
-
export { Button, ButtonLabel, ButtonLink, buttonContentClasses, buttonShapes, buttonStructureClasses };
|
|
113
|
+
export { Button, ButtonLabel, ButtonLink, ButtonTrackContext, buttonContentClasses, buttonShapes, buttonStructureClasses, buttonTrackStructureClasses };
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { ControlledMultiChoice } from "../control-props.js";
|
|
1
|
+
import { ControlledMultiChoice, HoverIndicator } from "../control-props.js";
|
|
2
2
|
import { ComponentProps } from "react";
|
|
3
3
|
//#region src/ui/checkbox-group.d.ts
|
|
4
4
|
type CheckboxGroupProps = Omit<ComponentProps<"div">, "defaultValue" | "onChange"> & ControlledMultiChoice & {
|
|
5
5
|
allValues?: string[];
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
orientation?: "horizontal" | "vertical";
|
|
8
|
+
indicator?: HoverIndicator;
|
|
8
9
|
};
|
|
9
|
-
declare function CheckboxGroup({ className, orientation, ...props }: CheckboxGroupProps): import("react").JSX.Element;
|
|
10
|
+
declare function CheckboxGroup({ className, orientation, indicator, children, ...props }: CheckboxGroupProps): import("react").JSX.Element;
|
|
11
|
+
declare function CheckboxGroupItem({ className, htmlFor, children, ...props }: ComponentProps<"label">): import("react").JSX.Element;
|
|
10
12
|
//#endregion
|
|
11
|
-
export { CheckboxGroup, CheckboxGroupProps };
|
|
13
|
+
export { CheckboxGroup, CheckboxGroupItem, CheckboxGroupProps };
|
|
@@ -1,16 +1,33 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/cn.js";
|
|
3
|
-
import {
|
|
3
|
+
import { skinIndicator } from "../skin.js";
|
|
4
|
+
import { TrackHighlight } from "../extensions/track-highlight.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
6
|
import { CheckboxGroup as CheckboxGroup$1 } from "@base-ui/react/checkbox-group";
|
|
5
7
|
//#region src/ui/checkbox-group.tsx
|
|
6
|
-
function CheckboxGroup({ className, orientation = "vertical", ...props }) {
|
|
7
|
-
|
|
8
|
+
function CheckboxGroup({ className, orientation = "vertical", indicator, children, ...props }) {
|
|
9
|
+
const resolvedIndicator = indicator ?? skinIndicator("checkbox-group") ?? "none";
|
|
10
|
+
return /* @__PURE__ */ jsxs(CheckboxGroup$1, {
|
|
8
11
|
"data-control-ui": "checkbox-group",
|
|
12
|
+
"data-control-family": "checkbox-group",
|
|
9
13
|
"data-slot": "root",
|
|
10
14
|
"data-orientation": orientation,
|
|
11
|
-
|
|
12
|
-
|
|
15
|
+
"data-track": resolvedIndicator,
|
|
16
|
+
className: cn("flex flex-col gap-2.5 data-[orientation=horizontal]:flex-row data-[orientation=horizontal]:gap-4 data-[track=hover]:relative data-[track=hover]:isolate data-[track=hover]:gap-0", className),
|
|
17
|
+
...props,
|
|
18
|
+
children: [children, resolvedIndicator === "hover" ? /* @__PURE__ */ jsx(TrackHighlight, {}) : null]
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function CheckboxGroupItem({ className, htmlFor, children, ...props }) {
|
|
22
|
+
return /* @__PURE__ */ jsx("label", {
|
|
23
|
+
htmlFor,
|
|
24
|
+
"data-control-ui": "checkbox-group",
|
|
25
|
+
"data-slot": "item",
|
|
26
|
+
"data-track-item": "",
|
|
27
|
+
className: cn("flex cursor-pointer items-start gap-2.5 rounded-(--radius-control) p-2 text-body has-[[data-disabled]]:cursor-not-allowed", className),
|
|
28
|
+
...props,
|
|
29
|
+
children
|
|
13
30
|
});
|
|
14
31
|
}
|
|
15
32
|
//#endregion
|
|
16
|
-
export { CheckboxGroup };
|
|
33
|
+
export { CheckboxGroup, CheckboxGroupItem };
|
package/dist/ui/color-picker.js
CHANGED
|
@@ -3,9 +3,9 @@ import { cn } from "../lib/cn.js";
|
|
|
3
3
|
import { skinEffects, skinId } from "../skin.js";
|
|
4
4
|
import { Button } from "./button.js";
|
|
5
5
|
import { Input } from "./input.js";
|
|
6
|
+
import { useColorArea } from "../hooks/use-color-area.js";
|
|
6
7
|
import { formatColor, getChannels, hsvaToRgba, parseColor, pointToHueSat, pointToSaturationValue, setChannel } from "../lib/color.js";
|
|
7
8
|
import { TARGET_RATIO, contrastOf, fixColorForContrast, nextFixLevel, wcagLevels } from "../lib/contrast.js";
|
|
8
|
-
import { useColorArea } from "../hooks/use-color-area.js";
|
|
9
9
|
import { NumberField, NumberFieldGroup, NumberFieldInput } from "./number-field.js";
|
|
10
10
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "./select.js";
|
|
11
11
|
import { createContext, useContext, useEffect, useRef, useState, useSyncExternalStore } from "react";
|
|
@@ -13,7 +13,7 @@ type DropdownMenuProps = {
|
|
|
13
13
|
};
|
|
14
14
|
declare const dropdownMenuTriggerVariants: readonly ["surface", "ghost"];
|
|
15
15
|
type DropdownMenuTriggerVariant = (typeof dropdownMenuTriggerVariants)[number];
|
|
16
|
-
type DropdownMenuTriggerProps = Omit<ComponentProps<"button">, "style"> & {
|
|
16
|
+
type DropdownMenuTriggerProps = Omit<ComponentProps<"button">, "style"> & Pick<ComponentProps<typeof Menu.Trigger>, "nativeButton" | "render"> & {
|
|
17
17
|
style?: CSSProperties & ButtonKnobStyle;
|
|
18
18
|
} & {
|
|
19
19
|
size?: ControlSize;
|
|
@@ -35,9 +35,8 @@ type DropdownMenuSeparatorProps = Omit<ComponentProps<"div">, "style"> & {
|
|
|
35
35
|
type DropdownMenuLabelProps = Omit<ComponentProps<"div">, "style"> & {
|
|
36
36
|
style?: CSSProperties & PopupKnobStyle;
|
|
37
37
|
};
|
|
38
|
-
type RefinedDropdownMenuTriggerProps = DropdownMenuTriggerProps & Pick<ComponentProps<typeof Menu.Trigger>, "nativeButton" | "render">;
|
|
39
38
|
declare function DropdownMenu({ children, ...props }: DropdownMenuProps): import("react").JSX.Element;
|
|
40
|
-
declare function DropdownMenuTrigger({ size, iconOnly, variant, className, children, disabled, ...props }:
|
|
39
|
+
declare function DropdownMenuTrigger({ size, iconOnly, variant, className, children, disabled, ...props }: DropdownMenuTriggerProps): import("react").JSX.Element;
|
|
41
40
|
declare function DropdownMenuContent({ className, children, ...props }: DropdownMenuContentProps): import("react").JSX.Element;
|
|
42
41
|
declare function DropdownMenuItem({ className, ...props }: DropdownMenuItemProps): import("react").JSX.Element;
|
|
43
42
|
declare function DropdownMenuSeparator({ className, ...props }: DropdownMenuSeparatorProps): import("react").JSX.Element;
|
package/dist/ui/dropdown-menu.js
CHANGED
|
@@ -26,13 +26,7 @@ function DropdownMenuTrigger({ size = "sm", iconOnly = false, variant = "surface
|
|
|
26
26
|
className: cn("relative isolate inline-flex shrink-0 items-center justify-center overflow-visible", className),
|
|
27
27
|
disabled,
|
|
28
28
|
...props,
|
|
29
|
-
children
|
|
30
|
-
"data-control-ui": "button",
|
|
31
|
-
"data-control-family": "button",
|
|
32
|
-
"data-slot": "content",
|
|
33
|
-
className: "relative z-[1] inline-flex items-center justify-center gap-[inherit]",
|
|
34
|
-
children
|
|
35
|
-
})
|
|
29
|
+
children
|
|
36
30
|
});
|
|
37
31
|
}
|
|
38
32
|
function DropdownMenuContent({ className, children, ...props }) {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ProgressiveBlurKnobStyle } from "../knob-contracts/progressive-blur-knobs.js";
|
|
2
|
+
import { CSSProperties, ComponentProps } from "react";
|
|
3
|
+
//#region src/ui/progressive-blur.d.ts
|
|
4
|
+
type ProgressiveBlurSide = "top" | "bottom" | "inline-start" | "inline-end";
|
|
5
|
+
type ProgressiveBlurProps = Omit<ComponentProps<"div">, "children" | "dangerouslySetInnerHTML" | "style" | "tabIndex"> & {
|
|
6
|
+
side?: ProgressiveBlurSide;
|
|
7
|
+
visible?: boolean;
|
|
8
|
+
style?: CSSProperties & ProgressiveBlurKnobStyle;
|
|
9
|
+
};
|
|
10
|
+
declare function ProgressiveBlur({ side, visible, ...props }: ProgressiveBlurProps): import("react").JSX.Element;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { ProgressiveBlur, ProgressiveBlurProps, ProgressiveBlurSide };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
//#region src/ui/progressive-blur.tsx
|
|
3
|
+
function ProgressiveBlur({ side = "bottom", visible = true, ...props }) {
|
|
4
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
5
|
+
...props,
|
|
6
|
+
"data-control-ui": "progressive-blur",
|
|
7
|
+
"data-control-family": "progressive-blur",
|
|
8
|
+
"data-slot": "root",
|
|
9
|
+
"data-side": side,
|
|
10
|
+
"data-visible": visible || void 0,
|
|
11
|
+
"aria-hidden": "true",
|
|
12
|
+
children: [
|
|
13
|
+
/* @__PURE__ */ jsx("span", {
|
|
14
|
+
"data-control-ui": "progressive-blur",
|
|
15
|
+
"data-control-family": "progressive-blur",
|
|
16
|
+
"data-slot": "layer"
|
|
17
|
+
}),
|
|
18
|
+
/* @__PURE__ */ jsx("span", {
|
|
19
|
+
"data-control-ui": "progressive-blur",
|
|
20
|
+
"data-control-family": "progressive-blur",
|
|
21
|
+
"data-slot": "layer"
|
|
22
|
+
}),
|
|
23
|
+
/* @__PURE__ */ jsx("span", {
|
|
24
|
+
"data-control-ui": "progressive-blur",
|
|
25
|
+
"data-control-family": "progressive-blur",
|
|
26
|
+
"data-slot": "layer"
|
|
27
|
+
}),
|
|
28
|
+
/* @__PURE__ */ jsx("span", {
|
|
29
|
+
"data-control-ui": "progressive-blur",
|
|
30
|
+
"data-control-family": "progressive-blur",
|
|
31
|
+
"data-slot": "layer"
|
|
32
|
+
}),
|
|
33
|
+
/* @__PURE__ */ jsx("span", {
|
|
34
|
+
"data-control-ui": "progressive-blur",
|
|
35
|
+
"data-control-family": "progressive-blur",
|
|
36
|
+
"data-slot": "layer"
|
|
37
|
+
}),
|
|
38
|
+
/* @__PURE__ */ jsx("span", {
|
|
39
|
+
"data-control-ui": "progressive-blur",
|
|
40
|
+
"data-control-family": "progressive-blur",
|
|
41
|
+
"data-slot": "layer"
|
|
42
|
+
})
|
|
43
|
+
]
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
export { ProgressiveBlur };
|
package/dist/ui/scroll-area.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ScrollAreaKnobStyle } from "../knob-contracts/scroll-area-knobs.js";
|
|
2
|
+
import { ProgressiveBlurProps } from "./progressive-blur.js";
|
|
2
3
|
import { CSSProperties, ComponentProps, Ref } from "react";
|
|
3
4
|
//#region src/ui/scroll-area.d.ts
|
|
4
5
|
declare const scrollAreaScrollbarVisibilities: readonly ["scroll", "hover", "always"];
|
|
@@ -17,9 +18,11 @@ type ScrollAreaProps = Omit<ComponentProps<"div">, "style"> & {
|
|
|
17
18
|
viewportRef?: Ref<HTMLDivElement>;
|
|
18
19
|
maxHeight?: string;
|
|
19
20
|
mask?: boolean;
|
|
21
|
+
blur?: boolean;
|
|
22
|
+
blurProps?: Pick<ProgressiveBlurProps, "style">;
|
|
20
23
|
lockAxis?: ScrollAreaLockAxis;
|
|
21
24
|
scrollbarVisibility?: ScrollAreaScrollbarVisibility;
|
|
22
25
|
};
|
|
23
|
-
declare function ScrollArea({ className, viewportClassName, viewportProps, viewportRef, maxHeight, mask, lockAxis, scrollbarVisibility, children, style, ...props }: ScrollAreaProps): import("react").JSX.Element;
|
|
26
|
+
declare function ScrollArea({ className, viewportClassName, viewportProps, viewportRef, maxHeight, mask, blur, blurProps, lockAxis, scrollbarVisibility, children, style, ...props }: ScrollAreaProps): import("react").JSX.Element;
|
|
24
27
|
//#endregion
|
|
25
28
|
export { ScrollArea, ScrollAreaLockAxis, ScrollAreaProps, ScrollAreaScrollbarVisibility, ScrollAreaViewportProps, scrollAreaScrollbarVisibilities };
|
package/dist/ui/scroll-area.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../lib/cn.js";
|
|
3
|
+
import { ProgressiveBlur } from "./progressive-blur.js";
|
|
3
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
5
|
import { ScrollArea as ScrollArea$1 } from "@base-ui/react/scroll-area";
|
|
5
6
|
//#region src/ui/scroll-area.tsx
|
|
@@ -8,8 +9,6 @@ const scrollAreaScrollbarVisibilities = [
|
|
|
8
9
|
"hover",
|
|
9
10
|
"always"
|
|
10
11
|
];
|
|
11
|
-
const maskXOverflowClasses = cn("data-[overflow-x-start]:mask-l-from-[calc(100%_-_var(--scroll-fade-size))]", "data-[overflow-x-end]:mask-r-from-[calc(100%_-_var(--scroll-fade-size))]");
|
|
12
|
-
const maskYOverflowClasses = cn("data-[overflow-y-start]:mask-t-from-[calc(100%_-_var(--scroll-fade-size))]", "data-[overflow-y-end]:mask-b-from-[calc(100%_-_var(--scroll-fade-size))]");
|
|
13
12
|
function Scrollbar({ orientation, visibility, thumbStyle }) {
|
|
14
13
|
return /* @__PURE__ */ jsx(ScrollArea$1.Scrollbar, {
|
|
15
14
|
orientation,
|
|
@@ -35,7 +34,7 @@ function viewportStyle(maxHeight, lockX, lockY) {
|
|
|
35
34
|
...lockY ? { overflowY: "hidden" } : {}
|
|
36
35
|
};
|
|
37
36
|
}
|
|
38
|
-
function ScrollArea({ className, viewportClassName, viewportProps, viewportRef, maxHeight, mask = true, lockAxis, scrollbarVisibility = "scroll", children, style, ...props }) {
|
|
37
|
+
function ScrollArea({ className, viewportClassName, viewportProps, viewportRef, maxHeight, mask = true, blur = false, blurProps, lockAxis, scrollbarVisibility = "scroll", children, style, ...props }) {
|
|
39
38
|
const lockX = lockAxis === "x" || lockAxis === "both";
|
|
40
39
|
const lockY = lockAxis === "y" || lockAxis === "both";
|
|
41
40
|
const resolvedViewportStyle = viewportStyle(maxHeight, lockX, lockY);
|
|
@@ -51,6 +50,9 @@ function ScrollArea({ className, viewportClassName, viewportProps, viewportRef,
|
|
|
51
50
|
"data-control-ui": "scroll-area",
|
|
52
51
|
"data-control-family": "scroll-area",
|
|
53
52
|
"data-slot": "root",
|
|
53
|
+
"data-mask": mask || void 0,
|
|
54
|
+
"data-blur": blur || void 0,
|
|
55
|
+
"data-lock-axis": lockAxis,
|
|
54
56
|
className: cn("relative overflow-hidden", className),
|
|
55
57
|
style,
|
|
56
58
|
children: [
|
|
@@ -59,8 +61,9 @@ function ScrollArea({ className, viewportClassName, viewportProps, viewportRef,
|
|
|
59
61
|
"data-control-family": "scroll-area",
|
|
60
62
|
"data-slot": "viewport",
|
|
61
63
|
...resolvedViewportProps,
|
|
64
|
+
"data-scroll-area-viewport": "",
|
|
62
65
|
ref: viewportRef,
|
|
63
|
-
className: cn("h-full w-full",
|
|
66
|
+
className: cn("h-full w-full", viewportClassName),
|
|
64
67
|
style: mergedViewportStyle,
|
|
65
68
|
children: /* @__PURE__ */ jsx(ScrollArea$1.Content, {
|
|
66
69
|
"data-control-ui": "scroll-area",
|
|
@@ -70,6 +73,26 @@ function ScrollArea({ className, viewportClassName, viewportProps, viewportRef,
|
|
|
70
73
|
children
|
|
71
74
|
})
|
|
72
75
|
}),
|
|
76
|
+
blur && !lockY && /* @__PURE__ */ jsx(ProgressiveBlur, {
|
|
77
|
+
...blurProps,
|
|
78
|
+
side: "top",
|
|
79
|
+
visible: false
|
|
80
|
+
}),
|
|
81
|
+
blur && !lockY && /* @__PURE__ */ jsx(ProgressiveBlur, {
|
|
82
|
+
...blurProps,
|
|
83
|
+
side: "bottom",
|
|
84
|
+
visible: false
|
|
85
|
+
}),
|
|
86
|
+
blur && !lockX && /* @__PURE__ */ jsx(ProgressiveBlur, {
|
|
87
|
+
...blurProps,
|
|
88
|
+
side: "inline-start",
|
|
89
|
+
visible: false
|
|
90
|
+
}),
|
|
91
|
+
blur && !lockX && /* @__PURE__ */ jsx(ProgressiveBlur, {
|
|
92
|
+
...blurProps,
|
|
93
|
+
side: "inline-end",
|
|
94
|
+
visible: false
|
|
95
|
+
}),
|
|
73
96
|
!lockY && /* @__PURE__ */ jsx(Scrollbar, {
|
|
74
97
|
orientation: "vertical",
|
|
75
98
|
visibility: scrollbarVisibility,
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { HoverIndicator, RenderProp, SelectionIndicator } from "../control-props.js";
|
|
2
|
+
import { SidebarKnobStyle } from "../knob-contracts/sidebar-knobs.js";
|
|
3
|
+
import { CSSProperties, ComponentProps, ReactNode } from "react";
|
|
4
|
+
//#region src/ui/sidebar-menu.d.ts
|
|
5
|
+
declare const sidebarMenuButtonVariants: readonly ["default", "outline"];
|
|
6
|
+
type SidebarMenuButtonVariant = (typeof sidebarMenuButtonVariants)[number];
|
|
7
|
+
declare const sidebarMenuButtonSizes: readonly ["default", "sm", "lg"];
|
|
8
|
+
type SidebarMenuButtonSize = (typeof sidebarMenuButtonSizes)[number];
|
|
9
|
+
type SidebarGroupLabelProps = Omit<ComponentProps<"div">, "style"> & {
|
|
10
|
+
style?: CSSProperties & SidebarKnobStyle;
|
|
11
|
+
} & {
|
|
12
|
+
render?: RenderProp<ComponentProps<"div">>;
|
|
13
|
+
};
|
|
14
|
+
type SidebarMenuButtonProps = Omit<ComponentProps<"button">, "style"> & {
|
|
15
|
+
style?: CSSProperties & SidebarKnobStyle;
|
|
16
|
+
} & {
|
|
17
|
+
render?: RenderProp<ComponentProps<"button">>;
|
|
18
|
+
isActive?: boolean;
|
|
19
|
+
tooltip?: ReactNode;
|
|
20
|
+
variant?: SidebarMenuButtonVariant;
|
|
21
|
+
size?: SidebarMenuButtonSize;
|
|
22
|
+
};
|
|
23
|
+
declare function SidebarGroup({ className, ...props }: ComponentProps<"div"> & {
|
|
24
|
+
style?: CSSProperties & SidebarKnobStyle;
|
|
25
|
+
}): import("react").JSX.Element;
|
|
26
|
+
declare function SidebarGroupLabel({ className, render, children, ...props }: SidebarGroupLabelProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
27
|
+
type SidebarSelectionIndicator = SelectionIndicator | HoverIndicator;
|
|
28
|
+
declare function SidebarMenu({ className, indicator, style, children, ...props }: ComponentProps<"ul"> & {
|
|
29
|
+
indicator?: SidebarSelectionIndicator;
|
|
30
|
+
} & {
|
|
31
|
+
style?: CSSProperties & SidebarKnobStyle;
|
|
32
|
+
}): import("react").JSX.Element;
|
|
33
|
+
declare function SidebarMenuItem({ className, ...props }: ComponentProps<"li"> & {
|
|
34
|
+
style?: CSSProperties & SidebarKnobStyle;
|
|
35
|
+
}): import("react").JSX.Element;
|
|
36
|
+
declare function SidebarMenuButton({ render, isActive, variant, size, tooltip, className, children, ...props }: SidebarMenuButtonProps): import("react").JSX.Element;
|
|
37
|
+
declare function SidebarMenuSub({ className, ...props }: ComponentProps<typeof SidebarMenu>): import("react").JSX.Element;
|
|
38
|
+
//#endregion
|
|
39
|
+
export { SidebarGroup, SidebarGroupLabel, SidebarGroupLabelProps, SidebarMenu, SidebarMenuButton, SidebarMenuButtonProps, SidebarMenuButtonSize, SidebarMenuButtonVariant, SidebarMenuItem, SidebarMenuSub, SidebarSelectionIndicator, sidebarMenuButtonSizes, sidebarMenuButtonVariants };
|