@stackshift-ui/toggle 1.0.0-beta.2 → 1.0.0-beta.4
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/chunk-RXQTONXM.mjs +49 -0
- package/package.json +6 -6
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// src/toggle.tsx
|
|
2
|
+
import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { cn, DefaultComponent, useStackShiftUIComponents } from "@stackshift-ui/system";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
var displayName = "Toggle";
|
|
7
|
+
var toggleVariants = cva(
|
|
8
|
+
"inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
default: "bg-transparent",
|
|
13
|
+
outline: "border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"
|
|
14
|
+
},
|
|
15
|
+
size: {
|
|
16
|
+
default: "h-9 px-2 min-w-9",
|
|
17
|
+
sm: "h-8 px-1.5 min-w-8",
|
|
18
|
+
lg: "h-10 px-2.5 min-w-10"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
defaultVariants: {
|
|
22
|
+
variant: "default",
|
|
23
|
+
size: "default"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
function Toggle({
|
|
28
|
+
className,
|
|
29
|
+
variant,
|
|
30
|
+
size,
|
|
31
|
+
...props
|
|
32
|
+
}) {
|
|
33
|
+
const { [displayName]: Component = DefaultComponent } = useStackShiftUIComponents();
|
|
34
|
+
return /* @__PURE__ */ jsx(
|
|
35
|
+
Component,
|
|
36
|
+
{
|
|
37
|
+
as: TogglePrimitive.Root,
|
|
38
|
+
"data-slot": "toggle",
|
|
39
|
+
className: cn(toggleVariants({ variant, size, className })),
|
|
40
|
+
...props
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
Toggle.displayName = displayName;
|
|
45
|
+
|
|
46
|
+
export {
|
|
47
|
+
toggleVariants,
|
|
48
|
+
Toggle
|
|
49
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stackshift-ui/toggle",
|
|
3
3
|
"description": "A two-state button that can be either on or off.",
|
|
4
|
-
"version": "1.0.0-beta.
|
|
4
|
+
"version": "1.0.0-beta.4",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -29,18 +29,18 @@
|
|
|
29
29
|
"typescript": "^5.6.2",
|
|
30
30
|
"vite-tsconfig-paths": "^5.0.1",
|
|
31
31
|
"vitest": "^2.1.1",
|
|
32
|
-
"@stackshift-ui/
|
|
33
|
-
"@stackshift-ui/
|
|
32
|
+
"@stackshift-ui/eslint-config": "6.0.10",
|
|
33
|
+
"@stackshift-ui/typescript-config": "6.0.10"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@radix-ui/react-toggle": "^1.1.9",
|
|
37
37
|
"class-variance-authority": "^0.7.1",
|
|
38
38
|
"classnames": "^2.5.1",
|
|
39
|
-
"@stackshift-ui/scripts": "6.1.0-beta.
|
|
40
|
-
"@stackshift-ui/system": "6.1.0-beta.
|
|
39
|
+
"@stackshift-ui/scripts": "6.1.0-beta.2",
|
|
40
|
+
"@stackshift-ui/system": "6.1.0-beta.3"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@stackshift-ui/system": ">=6.1.0-beta.
|
|
43
|
+
"@stackshift-ui/system": ">=6.1.0-beta.3",
|
|
44
44
|
"@types/react": "16.8 - 19",
|
|
45
45
|
"next": "10 - 14",
|
|
46
46
|
"react": "16.8 - 19",
|