@ctrl-ui/react 0.9.14 → 0.9.15
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/dist/control-variants.d.ts +1 -1
- package/dist/control-variants.js +2 -1
- package/dist/knob-contracts/button-knobs.d.ts +1 -1
- package/dist/knob-contracts/button-knobs.js +11 -10
- package/dist/knob-contracts/reveal-knobs.d.ts +4 -0
- package/dist/knob-contracts/reveal-knobs.js +4 -0
- package/dist/styles/index.css +1 -0
- package/dist/styles/recipes/button-states.css +50 -0
- package/dist/styles/recipes/button.css +19 -52
- package/dist/styles/recipes/infinite-canvas.css +8 -0
- package/dist/styles/recipes/reveal.css +26 -0
- package/dist/ui/reveal.d.ts +15 -0
- package/dist/ui/reveal.js +29 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/control-variants.d.ts
|
|
2
2
|
export type ControlSize = "xs" | "sm" | "md" | "lg";
|
|
3
|
-
export declare const buttonVariants: readonly ["solid", "surface", "ghost", "quiet", "dashed", "link"];
|
|
3
|
+
export declare const buttonVariants: readonly ["solid", "surface", "ghost", "quiet", "dashed", "link", "scrim"];
|
|
4
4
|
export type ButtonVariant = (typeof buttonVariants)[number];
|
|
5
5
|
export declare const controlTones: readonly ["neutral", "primary", "danger"];
|
|
6
6
|
export type ControlTone = (typeof controlTones)[number];
|
package/dist/control-variants.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
//#region src/knob-contracts/button-knobs.d.ts
|
|
2
|
-
export declare const buttonKnobs: readonly ["--cui-button-press-background", "--cui-button-press-scale", "--cui-button-hover-border-color", "--cui-button-open-border-color", "--cui-button-open-background", "--cui-button-open-foreground", "--cui-button-open-shadow", "--cui-button-
|
|
2
|
+
export declare const buttonKnobs: readonly ["--cui-button-press-background", "--cui-button-press-scale", "--cui-button-hover-border-color", "--cui-button-open-border-color", "--cui-button-open-background", "--cui-button-open-foreground", "--cui-button-open-shadow", "--cui-button-hover-background-image", "--cui-button-hover-background", "--cui-button-hover-foreground", "--cui-button-active-background", "--cui-button-active-foreground", "--cui-button-active-hover-background", "--cui-button-hover-shadow", "--cui-button-press-shadow", "--cui-button-active-shadow", "--cui-button-radius", "--cui-button-gap", "--cui-button-icon", "--cui-button-height", "--cui-button-padding-inline", "--cui-button-padding-block", "--cui-button-icon-padding-inline", "--cui-button-font-size", "--cui-button-font-weight", "--cui-button-background", "--cui-button-background-image", "--cui-button-foreground", "--cui-button-shadow", "--cui-button-border-width", "--cui-button-border-style", "--cui-button-border-color", "--cui-button-backdrop-filter"];
|
|
3
3
|
export type ButtonKnobStyle = Partial<Record<(typeof buttonKnobs)[number], string>>;
|
|
4
4
|
//#endregion
|
|
@@ -7,6 +7,15 @@ const buttonKnobs = [
|
|
|
7
7
|
"--cui-button-open-background",
|
|
8
8
|
"--cui-button-open-foreground",
|
|
9
9
|
"--cui-button-open-shadow",
|
|
10
|
+
"--cui-button-hover-background-image",
|
|
11
|
+
"--cui-button-hover-background",
|
|
12
|
+
"--cui-button-hover-foreground",
|
|
13
|
+
"--cui-button-active-background",
|
|
14
|
+
"--cui-button-active-foreground",
|
|
15
|
+
"--cui-button-active-hover-background",
|
|
16
|
+
"--cui-button-hover-shadow",
|
|
17
|
+
"--cui-button-press-shadow",
|
|
18
|
+
"--cui-button-active-shadow",
|
|
10
19
|
"--cui-button-radius",
|
|
11
20
|
"--cui-button-gap",
|
|
12
21
|
"--cui-button-icon",
|
|
@@ -18,20 +27,12 @@ const buttonKnobs = [
|
|
|
18
27
|
"--cui-button-font-weight",
|
|
19
28
|
"--cui-button-background",
|
|
20
29
|
"--cui-button-background-image",
|
|
21
|
-
"--cui-button-hover-background-image",
|
|
22
30
|
"--cui-button-foreground",
|
|
23
|
-
"--cui-button-hover-background",
|
|
24
|
-
"--cui-button-hover-foreground",
|
|
25
|
-
"--cui-button-active-background",
|
|
26
|
-
"--cui-button-active-foreground",
|
|
27
|
-
"--cui-button-active-hover-background",
|
|
28
31
|
"--cui-button-shadow",
|
|
29
|
-
"--cui-button-hover-shadow",
|
|
30
|
-
"--cui-button-press-shadow",
|
|
31
|
-
"--cui-button-active-shadow",
|
|
32
32
|
"--cui-button-border-width",
|
|
33
33
|
"--cui-button-border-style",
|
|
34
|
-
"--cui-button-border-color"
|
|
34
|
+
"--cui-button-border-color",
|
|
35
|
+
"--cui-button-backdrop-filter"
|
|
35
36
|
];
|
|
36
37
|
//#endregion
|
|
37
38
|
export { buttonKnobs };
|
package/dist/styles/index.css
CHANGED
|
@@ -84,6 +84,7 @@
|
|
|
84
84
|
@import "./recipes/pagination.css";
|
|
85
85
|
@import "./recipes/phone-input.css";
|
|
86
86
|
@import "./recipes/resize-handle.css";
|
|
87
|
+
@import "./recipes/reveal.css";
|
|
87
88
|
@import "./recipes/rich-tooltip.css";
|
|
88
89
|
@import "./recipes/skeleton.css";
|
|
89
90
|
@import "./recipes/stepper.css";
|
|
@@ -125,3 +125,53 @@
|
|
|
125
125
|
syntax: "*";
|
|
126
126
|
inherits: true;
|
|
127
127
|
}
|
|
128
|
+
|
|
129
|
+
@property --cui-button-hover-background-image {
|
|
130
|
+
syntax: "*";
|
|
131
|
+
inherits: true;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
@property --cui-button-hover-background {
|
|
135
|
+
syntax: "<color>";
|
|
136
|
+
inherits: true;
|
|
137
|
+
initial-value: transparent;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
@property --cui-button-hover-foreground {
|
|
141
|
+
syntax: "<color>";
|
|
142
|
+
inherits: true;
|
|
143
|
+
initial-value: transparent;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
@property --cui-button-active-background {
|
|
147
|
+
syntax: "<color>";
|
|
148
|
+
inherits: true;
|
|
149
|
+
initial-value: transparent;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
@property --cui-button-active-foreground {
|
|
153
|
+
syntax: "<color>";
|
|
154
|
+
inherits: true;
|
|
155
|
+
initial-value: transparent;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
@property --cui-button-active-hover-background {
|
|
159
|
+
syntax: "<color>";
|
|
160
|
+
inherits: true;
|
|
161
|
+
initial-value: transparent;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
@property --cui-button-hover-shadow {
|
|
165
|
+
syntax: "*";
|
|
166
|
+
inherits: true;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
@property --cui-button-press-shadow {
|
|
170
|
+
syntax: "*";
|
|
171
|
+
inherits: true;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
@property --cui-button-active-shadow {
|
|
175
|
+
syntax: "*";
|
|
176
|
+
inherits: true;
|
|
177
|
+
}
|
|
@@ -56,10 +56,12 @@
|
|
|
56
56
|
--cui-button-border-color: var(--control-rim);
|
|
57
57
|
--cui-button-hover-border-color: var(--cui-button-border-color);
|
|
58
58
|
--cui-button-open-border-color: var(--cui-button-hover-border-color);
|
|
59
|
+
--cui-button-backdrop-filter: none;
|
|
59
60
|
border: var(--cui-button-border-width) var(--cui-button-border-style) var(--cui-button-border-color);
|
|
60
61
|
border-radius: var(--cui-button-radius);
|
|
61
62
|
background-color: var(--cui-button-background);
|
|
62
63
|
background-image: var(--cui-button-background-image);
|
|
64
|
+
backdrop-filter: var(--cui-button-backdrop-filter);
|
|
63
65
|
box-shadow: var(--cui-button-shadow);
|
|
64
66
|
color: var(--cui-button-foreground);
|
|
65
67
|
cursor: pointer;
|
|
@@ -193,6 +195,16 @@
|
|
|
193
195
|
--cui-button-hover-background: transparent;
|
|
194
196
|
}
|
|
195
197
|
|
|
198
|
+
:where([data-control-family="button"][data-variant="scrim"]) {
|
|
199
|
+
--cui-button-background: oklch(0 0 0 / 0.6);
|
|
200
|
+
--cui-button-foreground: oklch(1 0 0);
|
|
201
|
+
--cui-button-hover-background: oklch(0 0 0 / 0.8);
|
|
202
|
+
--cui-button-hover-foreground: var(--cui-button-foreground);
|
|
203
|
+
--cui-button-active-background: var(--cui-button-foreground);
|
|
204
|
+
--cui-button-active-foreground: oklch(0 0 0);
|
|
205
|
+
--cui-button-backdrop-filter: blur(8px);
|
|
206
|
+
}
|
|
207
|
+
|
|
196
208
|
:where([data-control-family="button"]:is([data-variant="surface"], [data-variant="ghost"], [data-variant="quiet"])) {
|
|
197
209
|
--cui-button-open-background: oklch(from var(--foreground) l c h / 0.07);
|
|
198
210
|
}
|
|
@@ -210,7 +222,7 @@
|
|
|
210
222
|
}
|
|
211
223
|
}
|
|
212
224
|
|
|
213
|
-
:where([data-control-family="button"][data-tone="primary"]:not([data-variant="solid"])) {
|
|
225
|
+
:where([data-control-family="button"][data-tone="primary"]:not([data-variant="solid"], [data-variant="scrim"])) {
|
|
214
226
|
--cui-button-foreground: var(--primary-text);
|
|
215
227
|
--cui-button-hover-foreground: var(--primary-text);
|
|
216
228
|
--cui-button-active-foreground: var(--primary-text);
|
|
@@ -226,7 +238,7 @@
|
|
|
226
238
|
--cui-button-active-hover-background: var(--cui-button-hover-background);
|
|
227
239
|
}
|
|
228
240
|
|
|
229
|
-
:where([data-control-family="button"][data-tone="danger"]:not([data-variant="solid"])) {
|
|
241
|
+
:where([data-control-family="button"][data-tone="danger"]:not([data-variant="solid"], [data-variant="scrim"])) {
|
|
230
242
|
--cui-button-foreground: var(--destructive-text);
|
|
231
243
|
--cui-button-hover-foreground: var(--destructive-text);
|
|
232
244
|
--cui-button-active-foreground: var(--destructive-text);
|
|
@@ -316,67 +328,17 @@
|
|
|
316
328
|
inherits: true;
|
|
317
329
|
}
|
|
318
330
|
|
|
319
|
-
@property --cui-button-hover-background-image {
|
|
320
|
-
syntax: "*";
|
|
321
|
-
inherits: true;
|
|
322
|
-
}
|
|
323
|
-
|
|
324
331
|
@property --cui-button-foreground {
|
|
325
332
|
syntax: "<color>";
|
|
326
333
|
inherits: true;
|
|
327
334
|
initial-value: transparent;
|
|
328
335
|
}
|
|
329
336
|
|
|
330
|
-
@property --cui-button-hover-background {
|
|
331
|
-
syntax: "<color>";
|
|
332
|
-
inherits: true;
|
|
333
|
-
initial-value: transparent;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
@property --cui-button-hover-foreground {
|
|
337
|
-
syntax: "<color>";
|
|
338
|
-
inherits: true;
|
|
339
|
-
initial-value: transparent;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
@property --cui-button-active-background {
|
|
343
|
-
syntax: "<color>";
|
|
344
|
-
inherits: true;
|
|
345
|
-
initial-value: transparent;
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
@property --cui-button-active-foreground {
|
|
349
|
-
syntax: "<color>";
|
|
350
|
-
inherits: true;
|
|
351
|
-
initial-value: transparent;
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
@property --cui-button-active-hover-background {
|
|
355
|
-
syntax: "<color>";
|
|
356
|
-
inherits: true;
|
|
357
|
-
initial-value: transparent;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
337
|
@property --cui-button-shadow {
|
|
361
338
|
syntax: "*";
|
|
362
339
|
inherits: true;
|
|
363
340
|
}
|
|
364
341
|
|
|
365
|
-
@property --cui-button-hover-shadow {
|
|
366
|
-
syntax: "*";
|
|
367
|
-
inherits: true;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
@property --cui-button-press-shadow {
|
|
371
|
-
syntax: "*";
|
|
372
|
-
inherits: true;
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
@property --cui-button-active-shadow {
|
|
376
|
-
syntax: "*";
|
|
377
|
-
inherits: true;
|
|
378
|
-
}
|
|
379
|
-
|
|
380
342
|
@property --cui-button-border-width {
|
|
381
343
|
syntax: "<length>";
|
|
382
344
|
inherits: true;
|
|
@@ -393,3 +355,8 @@
|
|
|
393
355
|
inherits: true;
|
|
394
356
|
initial-value: transparent;
|
|
395
357
|
}
|
|
358
|
+
|
|
359
|
+
@property --cui-button-backdrop-filter {
|
|
360
|
+
syntax: "*";
|
|
361
|
+
inherits: true;
|
|
362
|
+
}
|
|
@@ -26,6 +26,14 @@
|
|
|
26
26
|
--focus-ring-offset: calc(var(--focus-ring-width) * -1);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
:where([data-control-family="infinite-canvas"][data-slot="root"][data-pan-ready]:not([data-panning])) {
|
|
30
|
+
cursor: grab;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
:where([data-control-family="infinite-canvas"][data-slot="root"][data-panning]) {
|
|
34
|
+
cursor: grabbing;
|
|
35
|
+
}
|
|
36
|
+
|
|
29
37
|
:where([data-control-family="infinite-canvas"][data-slot="root"][data-easing]) {
|
|
30
38
|
transition-property: background-position, background-size;
|
|
31
39
|
transition-duration: var(--duration-base);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
:where([data-control-family="reveal"][data-slot="scope"]) {
|
|
3
|
+
--cui-reveal-hidden-opacity: 0;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
:where([data-control-family="reveal"][data-slot="content"]) {
|
|
7
|
+
transition-property: opacity;
|
|
8
|
+
transition-duration: var(--duration-fast);
|
|
9
|
+
transition-timing-function: var(--ease-standard);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@media (hover: hover) and (pointer: fine) {
|
|
13
|
+
:where(
|
|
14
|
+
[data-control-family="reveal"][data-slot="scope"]:not(:hover, :focus-within, :has([data-popup-open]))
|
|
15
|
+
[data-control-family="reveal"][data-slot="content"]
|
|
16
|
+
) {
|
|
17
|
+
opacity: var(--cui-reveal-hidden-opacity);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@property --cui-reveal-hidden-opacity {
|
|
23
|
+
syntax: "<number>";
|
|
24
|
+
inherits: true;
|
|
25
|
+
initial-value: 1;
|
|
26
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { RenderProp } from "../control-props.js";
|
|
2
|
+
import { RevealKnobStyle } from "../knob-contracts/reveal-knobs.js";
|
|
3
|
+
import { CSSProperties, ComponentProps } from "react";
|
|
4
|
+
//#region src/ui/reveal.d.ts
|
|
5
|
+
export type RevealScopeProps = Omit<ComponentProps<"div">, "style"> & {
|
|
6
|
+
render?: RenderProp<ComponentProps<"div">>;
|
|
7
|
+
style?: CSSProperties & RevealKnobStyle;
|
|
8
|
+
};
|
|
9
|
+
export type RevealProps = Omit<ComponentProps<"span">, "style"> & {
|
|
10
|
+
render?: RenderProp<ComponentProps<"span">>;
|
|
11
|
+
style?: CSSProperties & RevealKnobStyle;
|
|
12
|
+
};
|
|
13
|
+
export declare function RevealScope({ render, ...props }: RevealScopeProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
14
|
+
export declare function Reveal({ render, ...props }: RevealProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
15
|
+
//#endregion
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
3
|
+
//#region src/ui/reveal.tsx
|
|
4
|
+
function RevealScope({ render, ...props }) {
|
|
5
|
+
return useRender({
|
|
6
|
+
defaultTagName: "div",
|
|
7
|
+
render,
|
|
8
|
+
props: {
|
|
9
|
+
...props,
|
|
10
|
+
"data-control-ui": "reveal",
|
|
11
|
+
"data-control-family": "reveal",
|
|
12
|
+
"data-slot": "scope"
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function Reveal({ render, ...props }) {
|
|
17
|
+
return useRender({
|
|
18
|
+
defaultTagName: "span",
|
|
19
|
+
render,
|
|
20
|
+
props: {
|
|
21
|
+
...props,
|
|
22
|
+
"data-control-ui": "reveal",
|
|
23
|
+
"data-control-family": "reveal",
|
|
24
|
+
"data-slot": "content"
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { Reveal, RevealScope };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ctrl-ui/react",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.15",
|
|
4
4
|
"description": "100+ React components for Tailwind CSS and shadcn/ui: pickers, trees, editors, canvases, app templates, and AI chat surfaces, with neutral defaults and consumer-owned themes.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|