@stackshift-ui/checkbox 7.0.0-beta.0 → 7.0.0-beta.3
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/checkbox.d.ts +4 -17
- package/dist/checkbox.js +1 -1
- package/dist/checkbox.mjs +1 -1
- package/dist/chunk-GHOTKBI3.mjs +1 -0
- package/dist/chunk-S7SAPVVU.mjs +28 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +4 -4
- package/dist/chunk-3O2SYB7X.mjs +0 -1
package/dist/checkbox.d.ts
CHANGED
|
@@ -1,17 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
required?: boolean;
|
|
6
|
-
name?: string;
|
|
7
|
-
ariaLabel?: string;
|
|
8
|
-
label?: string;
|
|
9
|
-
labelClass?: string;
|
|
10
|
-
item?: string;
|
|
11
|
-
variant?: Variant;
|
|
12
|
-
onChange?: () => void;
|
|
13
|
-
className?: string;
|
|
14
|
-
as?: ElementType;
|
|
15
|
-
}
|
|
16
|
-
export declare const Checkbox: React.FC<CheckboxProps>;
|
|
17
|
-
export {};
|
|
1
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare const Checkbox: React.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
export { Checkbox };
|
package/dist/checkbox.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var h=Object.create;var a=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var C=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty;var v=(e,o)=>{for(var t in o)a(e,t,{get:o[t],enumerable:!0})},m=(e,o,t,c)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of u(o))!x.call(e,r)&&r!==t&&a(e,r,{get:()=>o[r],enumerable:!(c=k(o,r))||c.enumerable});return e};var f=(e,o,t)=>(t=e!=null?h(C(e)):{},m(o||!e||!e.__esModule?a(t,"default",{value:e,enumerable:!0}):t,e)),R=e=>m(a({},"__esModule",{value:!0}),e);var y={};v(y,{Checkbox:()=>l});module.exports=R(y);var n=f(require("@radix-ui/react-checkbox")),d=require("lucide-react"),p=f(require("react")),i=require("@stackshift-ui/system"),s=require("react/jsx-runtime"),b="Checkbox",l=p.forwardRef(({className:e,...o},t)=>{let{[b]:c=i.DefaultComponent}=(0,i.useStackShiftUIComponents)();return(0,s.jsx)(c,{as:n.Root,ref:t,className:(0,i.cn)("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...o,children:(0,s.jsx)(n.Indicator,{className:(0,i.cn)("flex items-center justify-center text-current"),children:(0,s.jsx)(d.Check,{className:"h-4 w-4"})})})});l.displayName=b;0&&(module.exports={Checkbox});
|
package/dist/checkbox.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-GHOTKBI3.mjs";export{a as Checkbox};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as e from"@radix-ui/react-checkbox";import{Check as m}from"lucide-react";import*as i from"react";import{cn as t,DefaultComponent as f,useStackShiftUIComponents as d}from"@stackshift-ui/system";import{jsx as o}from"react/jsx-runtime";var r="Checkbox",p=i.forwardRef(({className:c,...a},s)=>{let{[r]:n=f}=d();return o(n,{as:e.Root,ref:s,className:t("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",c),...a,children:o(e.Indicator,{className:t("flex items-center justify-center text-current"),children:o(m,{className:"h-4 w-4"})})})});p.displayName=r;export{p as a};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// src/checkbox.tsx
|
|
2
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
3
|
+
import { Check } from "lucide-react";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { cn, DefaultComponent, useStackShiftUIComponents } from "@stackshift-ui/system";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
var displayName = "Checkbox";
|
|
8
|
+
var Checkbox = React.forwardRef(({ className, ...props }, ref) => {
|
|
9
|
+
const { [displayName]: Component = DefaultComponent } = useStackShiftUIComponents();
|
|
10
|
+
return /* @__PURE__ */ jsx(
|
|
11
|
+
Component,
|
|
12
|
+
{
|
|
13
|
+
as: CheckboxPrimitive.Root,
|
|
14
|
+
ref,
|
|
15
|
+
className: cn(
|
|
16
|
+
"peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
|
|
17
|
+
className
|
|
18
|
+
),
|
|
19
|
+
...props,
|
|
20
|
+
children: /* @__PURE__ */ jsx(CheckboxPrimitive.Indicator, { className: cn("flex items-center justify-center text-current"), children: /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" }) })
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
});
|
|
24
|
+
Checkbox.displayName = displayName;
|
|
25
|
+
|
|
26
|
+
export {
|
|
27
|
+
Checkbox
|
|
28
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";var
|
|
2
|
+
"use strict";var h=Object.create;var s=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var C=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty;var v=(e,o)=>{for(var t in o)s(e,t,{get:o[t],enumerable:!0})},m=(e,o,t,c)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of k(o))!x.call(e,r)&&r!==t&&s(e,r,{get:()=>o[r],enumerable:!(c=u(o,r))||c.enumerable});return e};var f=(e,o,t)=>(t=e!=null?h(C(e)):{},m(o||!e||!e.__esModule?s(t,"default",{value:e,enumerable:!0}):t,e)),R=e=>m(s({},"__esModule",{value:!0}),e);var y={};v(y,{Checkbox:()=>l});module.exports=R(y);var n=f(require("@radix-ui/react-checkbox")),p=require("lucide-react"),d=f(require("react")),i=require("@stackshift-ui/system"),a=require("react/jsx-runtime"),b="Checkbox",l=d.forwardRef(({className:e,...o},t)=>{let{[b]:c=i.DefaultComponent}=(0,i.useStackShiftUIComponents)();return(0,a.jsx)(c,{as:n.Root,ref:t,className:(0,i.cn)("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...o,children:(0,a.jsx)(n.Indicator,{className:(0,i.cn)("flex items-center justify-center text-current"),children:(0,a.jsx)(p.Check,{className:"h-4 w-4"})})})});l.displayName=b;0&&(module.exports={Checkbox});
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";import{a as e}from"./chunk-
|
|
2
|
+
"use strict";import{a as e}from"./chunk-GHOTKBI3.mjs";export{e as Checkbox};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stackshift-ui/checkbox",
|
|
3
3
|
"description": "",
|
|
4
|
-
"version": "7.0.0-beta.
|
|
4
|
+
"version": "7.0.0-beta.3",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"@testing-library/user-event": "^14.6.1",
|
|
38
38
|
"classnames": "^2.5.1",
|
|
39
39
|
"lucide-react": "^0.468.0",
|
|
40
|
-
"@stackshift-ui/
|
|
41
|
-
"@stackshift-ui/
|
|
40
|
+
"@stackshift-ui/scripts": "6.1.0-beta.2",
|
|
41
|
+
"@stackshift-ui/system": "6.1.0-beta.3"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@stackshift-ui/system": ">=6.1.0-beta.
|
|
44
|
+
"@stackshift-ui/system": ">=6.1.0-beta.3",
|
|
45
45
|
"@types/react": "16.8 - 19",
|
|
46
46
|
"next": "10 - 14",
|
|
47
47
|
"react": "16.8 - 19",
|
package/dist/chunk-3O2SYB7X.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{DefaultComponent as f,useStackShiftUIComponents as x}from"@stackshift-ui/system";import o from"classnames";import{jsx as u,jsxs as T}from"react/jsx-runtime";var a="Checkbox",h=({required:l=!1,name:t,ariaLabel:i,label:m,labelClass:p,item:e,variant:c="primary",onChange:y,className:C,as:b="label",...n})=>{var r;let{[a]:d=f}=x(),s="",g=(r={primary:s}[c])!=null?r:s;return T(d,{as:b,htmlFor:e,className:o("flex gap-2 items-center",p),...n,"data-testid":a,children:[u("input",{"aria-label":i||t,className:o(g,C),name:t,type:"checkbox",value:e,required:l,onChange:y,id:e,...n}),m||e]})};h.displayName=a;export{h as a};
|