@camox/ui 0.77.0 → 0.79.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,7 +2,7 @@ import { VariantProps } from "class-variance-authority";
|
|
|
2
2
|
import { useRender } from "@base-ui/react/use-render";
|
|
3
3
|
//#region src/components/badge.d.ts
|
|
4
4
|
declare const badgeVariants: (props?: ({
|
|
5
|
-
variant?: "default" | "destructive" | "
|
|
5
|
+
variant?: "default" | "destructive" | "link" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
6
6
|
size?: "default" | "sm" | null | undefined;
|
|
7
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
8
|
declare function Badge({ className, variant, size, render, ...props }: useRender.ComponentProps<"span"> & VariantProps<typeof badgeVariants>): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
@@ -4,7 +4,7 @@ import { useRender } from "@base-ui/react/use-render";
|
|
|
4
4
|
//#region src/components/bubble.d.ts
|
|
5
5
|
declare function BubbleGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
6
6
|
declare const bubbleVariants: (props?: ({
|
|
7
|
-
variant?: "default" | "destructive" | "
|
|
7
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "muted" | "tinted" | null | undefined;
|
|
8
8
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
9
|
declare function Bubble({ variant, align, className, ...props }: React.ComponentProps<"div"> & VariantProps<typeof bubbleVariants> & {
|
|
10
10
|
align?: "start" | "end";
|
|
@@ -2,8 +2,8 @@ import { Button as Button$1 } from "@base-ui/react/button";
|
|
|
2
2
|
import { VariantProps } from "class-variance-authority";
|
|
3
3
|
//#region src/components/button.d.ts
|
|
4
4
|
declare const buttonVariants: (props?: ({
|
|
5
|
-
variant?: "default" | "destructive" | "
|
|
6
|
-
size?: "default" | "sm" | "
|
|
5
|
+
variant?: "default" | "destructive" | "link" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
6
|
+
size?: "default" | "sm" | "lg" | "xs" | "icon-xs" | "icon-sm" | "icon" | "icon-lg" | null | undefined;
|
|
7
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
8
|
declare function Button({ className, variant, size, ...props }: Button$1.Props & VariantProps<typeof buttonVariants>): import("react").JSX.Element;
|
|
9
9
|
//#endregion
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Slider as Slider$1 } from "@base-ui/react/slider";
|
|
2
|
+
//#region src/components/slider.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* A single-thumb slider. `label` names it to assistive technology, and `valueText` reads its value
|
|
5
|
+
* as words, such as a step's name. `marks` draws a tick at each of that many evenly spaced
|
|
6
|
+
* values, for a slider with a few named steps.
|
|
7
|
+
*/
|
|
8
|
+
declare function Slider({ className, label, valueText, marks, ...props }: Slider$1.Root.Props<number> & {
|
|
9
|
+
label: string;
|
|
10
|
+
valueText?: string;
|
|
11
|
+
marks?: number;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { Slider };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.js";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Slider as Slider$1 } from "@base-ui/react/slider";
|
|
4
|
+
|
|
5
|
+
//#region src/components/slider.tsx
|
|
6
|
+
/**
|
|
7
|
+
* A single-thumb slider. `label` names it to assistive technology, and `valueText` reads its value
|
|
8
|
+
* as words, such as a step's name. `marks` draws a tick at each of that many evenly spaced
|
|
9
|
+
* values, for a slider with a few named steps.
|
|
10
|
+
*/
|
|
11
|
+
function Slider({ className, label, valueText, marks, ...props }) {
|
|
12
|
+
return /* @__PURE__ */ jsx(Slider$1.Root, {
|
|
13
|
+
"data-slot": "slider",
|
|
14
|
+
thumbAlignment: "edge",
|
|
15
|
+
className: cn("data-disabled:opacity-50", className),
|
|
16
|
+
...props,
|
|
17
|
+
children: /* @__PURE__ */ jsxs(Slider$1.Control, {
|
|
18
|
+
"data-slot": "slider-control",
|
|
19
|
+
className: "relative flex h-5 w-full touch-none items-center select-none data-disabled:cursor-not-allowed",
|
|
20
|
+
children: [/* @__PURE__ */ jsx(Slider$1.Track, {
|
|
21
|
+
"data-slot": "slider-track",
|
|
22
|
+
className: "bg-muted relative h-1.5 w-full grow rounded-full",
|
|
23
|
+
children: marks !== void 0 && marks > 1 && /* @__PURE__ */ jsx("div", {
|
|
24
|
+
className: "pointer-events-none absolute inset-x-2 inset-y-0",
|
|
25
|
+
children: Array.from({ length: marks }, (_, index) => /* @__PURE__ */ jsx("span", {
|
|
26
|
+
"aria-hidden": true,
|
|
27
|
+
className: "bg-muted-foreground/40 absolute top-1/2 size-1 -translate-x-1/2 -translate-y-1/2 rounded-full",
|
|
28
|
+
style: { left: `${index / (marks - 1) * 100}%` }
|
|
29
|
+
}, index))
|
|
30
|
+
})
|
|
31
|
+
}), /* @__PURE__ */ jsx(Slider$1.Thumb, {
|
|
32
|
+
"data-slot": "slider-thumb",
|
|
33
|
+
getAriaLabel: () => label,
|
|
34
|
+
"aria-valuetext": valueText,
|
|
35
|
+
className: "border-primary bg-background ring-ring/50 block size-4 shrink-0 rounded-full border-2 shadow-sm transition-[box-shadow] outline-none hover:ring-4 focus-visible:ring-4 data-disabled:pointer-events-none"
|
|
36
|
+
})]
|
|
37
|
+
})
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
//#endregion
|
|
42
|
+
export { Slider };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camox/ui",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"license": "
|
|
3
|
+
"version": "0.79.0",
|
|
4
|
+
"license": "UNLICENSED",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
7
7
|
],
|
|
@@ -119,6 +119,10 @@
|
|
|
119
119
|
"types": "./dist/components/spinner.d.ts",
|
|
120
120
|
"default": "./dist/components/spinner.js"
|
|
121
121
|
},
|
|
122
|
+
"./slider": {
|
|
123
|
+
"types": "./dist/components/slider.d.ts",
|
|
124
|
+
"default": "./dist/components/slider.js"
|
|
125
|
+
},
|
|
122
126
|
"./switch": {
|
|
123
127
|
"types": "./dist/components/switch.d.ts",
|
|
124
128
|
"default": "./dist/components/switch.js"
|
package/LICENSE.md
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# MIT License
|
|
2
|
-
|
|
3
|
-
Copyright 2026 Rémi de Juvigny
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights to
|
|
8
|
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
9
|
-
of the Software, and to permit persons to whom the Software is furnished to do
|
|
10
|
-
so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|