@stackshift-ui/toggle 1.0.0-beta.4 → 1.0.0-beta.6
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/package.json +6 -6
- package/src/toggle.tsx +4 -4
- package/dist/chunk-IADJHCE2.mjs +0 -1
- package/dist/chunk-RXQTONXM.mjs +0 -49
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -2
- package/dist/index.mjs +0 -2
- package/dist/toggle.d.ts +0 -12
- package/dist/toggle.js +0 -2
- package/dist/toggle.mjs +0 -2
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.6",
|
|
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/typescript-config": "6.0.10",
|
|
33
|
+
"@stackshift-ui/eslint-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/
|
|
40
|
-
"@stackshift-ui/
|
|
39
|
+
"@stackshift-ui/system": "7.0.0-beta.5",
|
|
40
|
+
"@stackshift-ui/scripts": "7.0.0-beta.4"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@stackshift-ui/system": ">=
|
|
43
|
+
"@stackshift-ui/system": ">=7.0.0-beta.5",
|
|
44
44
|
"@types/react": "16.8 - 19",
|
|
45
45
|
"next": "10 - 14",
|
|
46
46
|
"react": "16.8 - 19",
|
package/src/toggle.tsx
CHANGED
|
@@ -9,7 +9,7 @@ import { cn, DefaultComponent, useStackShiftUIComponents } from "@stackshift-ui/
|
|
|
9
9
|
const displayName = "Toggle";
|
|
10
10
|
|
|
11
11
|
const toggleVariants = cva(
|
|
12
|
-
"inline-flex items-center justify-center gap-2 rounded-md
|
|
12
|
+
"inline-flex items-center justify-center gap-2 rounded-md 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",
|
|
13
13
|
{
|
|
14
14
|
variants: {
|
|
15
15
|
variant: {
|
|
@@ -18,9 +18,9 @@ const toggleVariants = cva(
|
|
|
18
18
|
"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground",
|
|
19
19
|
},
|
|
20
20
|
size: {
|
|
21
|
-
default: "h-9 px-
|
|
22
|
-
sm: "h-
|
|
23
|
-
lg: "h-
|
|
21
|
+
default: "h-9 px-3 min-w-9 text-sm",
|
|
22
|
+
sm: "h-7 px-2 min-w-7 text-xs",
|
|
23
|
+
lg: "h-11 px-4 min-w-11 text-base",
|
|
24
24
|
},
|
|
25
25
|
},
|
|
26
26
|
defaultVariants: {
|
package/dist/chunk-IADJHCE2.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import*as e from"@radix-ui/react-toggle";import{cva as s}from"class-variance-authority";import{cn as d,DefaultComponent as g,useStackShiftUIComponents as l}from"@stackshift-ui/system";import{jsx as m}from"react/jsx-runtime";var t="Toggle",c=s("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",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});function p({className:o,variant:i,size:n,...a}){let{[t]:r=g}=l();return m(r,{as:e.Root,"data-slot":"toggle",className:d(c({variant:i,size:n,className:o})),...a})}p.displayName=t;export{c as a,p as b};
|
package/dist/chunk-RXQTONXM.mjs
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
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/dist/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./toggle";
|
package/dist/index.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";var u=Object.create;var r=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var x=(e,t)=>{for(var o in t)r(e,o,{get:t[o],enumerable:!0})},s=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of f(t))!h.call(e,i)&&i!==o&&r(e,i,{get:()=>t[i],enumerable:!(a=v(t,i))||a.enumerable});return e};var w=(e,t,o)=>(o=e!=null?u(b(e)):{},s(t||!e||!e.__esModule?r(o,"default",{value:e,enumerable:!0}):o,e)),y=e=>s(r({},"__esModule",{value:!0}),e);var P={};x(P,{Toggle:()=>p,toggleVariants:()=>c});module.exports=y(P);var d=w(require("@radix-ui/react-toggle")),g=require("class-variance-authority"),n=require("@stackshift-ui/system"),m=require("react/jsx-runtime"),l="Toggle",c=(0,g.cva)("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",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});function p({className:e,variant:t,size:o,...a}){let{[l]:i=n.DefaultComponent}=(0,n.useStackShiftUIComponents)();return(0,m.jsx)(i,{as:d.Root,"data-slot":"toggle",className:(0,n.cn)(c({variant:t,size:o,className:e})),...a})}p.displayName=l;0&&(module.exports={Toggle,toggleVariants});
|
package/dist/index.mjs
DELETED
package/dist/toggle.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
2
|
-
import { type VariantProps } from "class-variance-authority";
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
declare const toggleVariants: (props?: ({
|
|
5
|
-
variant?: "default" | "outline" | null | undefined;
|
|
6
|
-
size?: "default" | "sm" | "lg" | null | undefined;
|
|
7
|
-
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
-
declare function Toggle({ className, variant, size, ...props }: React.ComponentProps<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
declare namespace Toggle {
|
|
10
|
-
var displayName: string;
|
|
11
|
-
}
|
|
12
|
-
export { Toggle, toggleVariants };
|
package/dist/toggle.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";var u=Object.create;var r=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var x=(e,t)=>{for(var o in t)r(e,o,{get:t[o],enumerable:!0})},s=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of f(t))!h.call(e,i)&&i!==o&&r(e,i,{get:()=>t[i],enumerable:!(a=v(t,i))||a.enumerable});return e};var w=(e,t,o)=>(o=e!=null?u(b(e)):{},s(t||!e||!e.__esModule?r(o,"default",{value:e,enumerable:!0}):o,e)),y=e=>s(r({},"__esModule",{value:!0}),e);var P={};x(P,{Toggle:()=>p,toggleVariants:()=>c});module.exports=y(P);var d=w(require("@radix-ui/react-toggle")),g=require("class-variance-authority"),n=require("@stackshift-ui/system"),m=require("react/jsx-runtime"),l="Toggle",c=(0,g.cva)("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",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});function p({className:e,variant:t,size:o,...a}){let{[l]:i=n.DefaultComponent}=(0,n.useStackShiftUIComponents)();return(0,m.jsx)(i,{as:d.Root,"data-slot":"toggle",className:(0,n.cn)(c({variant:t,size:o,className:e})),...a})}p.displayName=l;0&&(module.exports={Toggle,toggleVariants});
|
package/dist/toggle.mjs
DELETED