@spark-ui/checkbox 1.6.5 → 1.6.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/CHANGELOG.md +4 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +3 -3
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,10 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
+
## [1.6.6](https://github.com/adevinta/spark/compare/@spark-ui/checkbox@1.6.5...@spark-ui/checkbox@1.6.6) (2023-04-18)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @spark-ui/checkbox
|
9
|
+
|
6
10
|
## [1.6.5](https://github.com/adevinta/spark/compare/@spark-ui/checkbox@1.6.4...@spark-ui/checkbox@1.6.5) (2023-04-17)
|
7
11
|
|
8
12
|
### Bug Fixes
|
package/dist/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),b=require("@radix-ui/react-checkbox"),h=require("@spark-ui/icons"),k=require("@spark-ui/internal-utils"),m=require("class-variance-authority");function g(r){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(n,e,t.get?t:{enumerable:!0,get:()=>r[e]})}}return n.default=r,Object.freeze(n)}require("react-dom");const f=g(b),y=m.cva(["h-sz-20 w-sz-20 border-md peer items-center justify-center rounded-sm bg-transparent","spark-disabled:opacity-dim-3 spark-disabled:cursor-not-allowed spark-disabled:hover:ring-0","focus-visible:ring-outline-high focus-visible:outline-none focus-visible:ring-2","hover:border-primary-container hover:outline-none hover:ring-2"],{variants:{intent:k.makeVariants({primary:["spark-state-unchecked:border-outline","spark-state-checked:border-primary spark-state-checked:bg-primary"],success:["spark-state-unchecked:border-success","spark-state-checked:border-success spark-state-checked:bg-success"],alert:["spark-state-unchecked:border-alert","spark-state-checked:border-alert spark-state-checked:bg-alert"],error:["spark-state-unchecked:border-error","spark-state-checked:border-error spark-state-checked:bg-error"]})},defaultVariants:{intent:"primary"}}),v=a.forwardRef(({intent:r,icon:n=a.createElement(h.Check,null),...e},t)=>a.createElement(f.Root,{ref:t,className:y({intent:r}),...e},a.createElement(f.Indicator,{className:"text-surface flex items-center justify-center"},n)));function c(){return c=Object.assign?Object.assign.bind():function(r){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])}return r},c.apply(this,arguments)}function E(...r){return n=>r.forEach(e=>function(t,s){typeof t=="function"?t(s):t!=null&&(t.current=s)}(e,n))}const p=a.forwardRef((r,n)=>{const{children:e,...t}=r,s=a.Children.toArray(e),
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),b=require("@radix-ui/react-checkbox"),h=require("@spark-ui/icons"),k=require("@spark-ui/internal-utils"),m=require("class-variance-authority");function g(r){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(n,e,t.get?t:{enumerable:!0,get:()=>r[e]})}}return n.default=r,Object.freeze(n)}require("react-dom");const f=g(b),y=m.cva(["h-sz-20 w-sz-20 border-md peer items-center justify-center rounded-sm bg-transparent","spark-disabled:opacity-dim-3 spark-disabled:cursor-not-allowed spark-disabled:hover:ring-0","focus-visible:ring-outline-high focus-visible:outline-none focus-visible:ring-2","hover:border-primary-container hover:outline-none hover:ring-2"],{variants:{intent:k.makeVariants({primary:["spark-state-unchecked:border-outline","spark-state-checked:border-primary spark-state-checked:bg-primary"],success:["spark-state-unchecked:border-success","spark-state-checked:border-success spark-state-checked:bg-success"],alert:["spark-state-unchecked:border-alert","spark-state-checked:border-alert spark-state-checked:bg-alert"],error:["spark-state-unchecked:border-error","spark-state-checked:border-error spark-state-checked:bg-error"]})},defaultVariants:{intent:"primary"}}),v=a.forwardRef(({intent:r,icon:n=a.createElement(h.Check,null),...e},t)=>a.createElement(f.Root,{ref:t,className:y({intent:r}),...e},a.createElement(f.Indicator,{className:"text-surface flex items-center justify-center"},n)));function c(){return c=Object.assign?Object.assign.bind():function(r){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])}return r},c.apply(this,arguments)}function E(...r){return n=>r.forEach(e=>function(t,s){typeof t=="function"?t(s):t!=null&&(t.current=s)}(e,n))}const p=a.forwardRef((r,n)=>{const{children:e,...t}=r,s=a.Children.toArray(e),o=s.find(j);if(o){const l=o.props.children,i=s.map(u=>u===o?a.Children.count(l)>1?a.Children.only(null):a.isValidElement(l)?l.props.children:null:u);return a.createElement(d,c({},t,{ref:n}),a.isValidElement(l)?a.cloneElement(l,void 0,i):null)}return a.createElement(d,c({},t,{ref:n}),e)});p.displayName="Slot";const d=a.forwardRef((r,n)=>{const{children:e,...t}=r;return a.isValidElement(e)?a.cloneElement(e,{...O(t,e.props),ref:E(n,e.ref)}):a.Children.count(e)>1?a.Children.only(null):null});d.displayName="SlotClone";const w=({children:r})=>a.createElement(a.Fragment,null,r);function j(r){return a.isValidElement(r)&&r.type===w}function O(r,n){const e={...n};for(const t in n){const s=r[t],o=n[t];/^on[A-Z]/.test(t)?s&&o?e[t]=(...l)=>{o(...l),s(...l)}:s&&(e[t]=s):t==="style"?e[t]={...s,...o}:t==="className"&&(e[t]=[s,o].filter(Boolean).join(" "))}return{...r,...e}}const C=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((r,n)=>{const e=a.forwardRef((t,s)=>{const{asChild:o,...l}=t,i=o?p:n;return a.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),a.createElement(i,c({},l,{ref:s}))});return e.displayName=`Primitive.${n}`,{...r,[n]:e}},{}),N=a.forwardRef((r,n)=>a.createElement(C.label,c({},r,{ref:n,onMouseDown:e=>{var t;(t=r.onMouseDown)===null||t===void 0||t.call(r,e),!e.defaultPrevented&&e.detail>1&&e.preventDefault()}}))),x=m.cva(["flex","items-center","gap-md","text-body-1"],{variants:{disabled:{true:["text-neutral/dim-2","cursor-not-allowed"],false:["cursor-pointer"]}},defaultVariants:{disabled:!1}}),R=({className:r,disabled:n,...e})=>a.createElement(N,{className:x({className:r,disabled:n}),...e}),S=a.forwardRef(({children:r,...n},e)=>a.createElement(R,{"data-spark-component":"checkbox",disabled:n.disabled},a.createElement(v,{ref:e,...n}),r));exports.Checkbox=S;
|
package/dist/index.mjs
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
import c, { forwardRef as p, Children as i, isValidElement as u, createElement as d, cloneElement as k, Fragment as g, useEffect as w } from "react";
|
2
2
|
import * as h from "@radix-ui/react-checkbox";
|
3
3
|
import { Check as E } from "@spark-ui/icons";
|
4
|
-
import { makeVariants as
|
4
|
+
import { makeVariants as x } from "@spark-ui/internal-utils";
|
5
5
|
import { cva as v } from "class-variance-authority";
|
6
6
|
import "react-dom";
|
7
|
-
const
|
7
|
+
const N = v(["h-sz-20 w-sz-20 border-md peer items-center justify-center rounded-sm bg-transparent", "spark-disabled:opacity-dim-3 spark-disabled:cursor-not-allowed spark-disabled:hover:ring-0", "focus-visible:ring-outline-high focus-visible:outline-none focus-visible:ring-2", "hover:border-primary-container hover:outline-none hover:ring-2"], { variants: { intent: x({ primary: ["spark-state-unchecked:border-outline", "spark-state-checked:border-primary spark-state-checked:bg-primary"], success: ["spark-state-unchecked:border-success", "spark-state-checked:border-success spark-state-checked:bg-success"], alert: ["spark-state-unchecked:border-alert", "spark-state-checked:border-alert spark-state-checked:bg-alert"], error: ["spark-state-unchecked:border-error", "spark-state-checked:border-error spark-state-checked:bg-error"] }) }, defaultVariants: { intent: "primary" } }), j = c.forwardRef(({ intent: t, icon: a = c.createElement(E, null), ...e }, r) => c.createElement(h.Root, { ref: r, className: N({ intent: t }), ...e }, c.createElement(h.Indicator, { className: "text-surface flex items-center justify-center" }, a)));
|
8
8
|
function l() {
|
9
9
|
return l = Object.assign ? Object.assign.bind() : function(t) {
|
10
10
|
for (var a = 1; a < arguments.length; a++) {
|
@@ -59,7 +59,7 @@ const D = ["a", "button", "div", "form", "h2", "h3", "img", "input", "label", "l
|
|
59
59
|
}, {}), P = p((t, a) => d(D.label, l({}, t, { ref: a, onMouseDown: (e) => {
|
60
60
|
var r;
|
61
61
|
(r = t.onMouseDown) === null || r === void 0 || r.call(t, e), !e.defaultPrevented && e.detail > 1 && e.preventDefault();
|
62
|
-
} }))), S = v(["flex", "items-center", "gap-md", "text-body-1"], { variants: { disabled: { true: ["text-neutral/dim-2", "cursor-not-allowed"], false: ["cursor-pointer"] } }, defaultVariants: { disabled: !1 } }), z = ({ className: t, disabled: a, ...e }) => c.createElement(P, { className: S({ className: t, disabled: a }), ...e }), Z = c.forwardRef(({ children: t, ...a }, e) => c.createElement(z, { disabled: a.disabled }, c.createElement(j, { ref: e, ...a }), t));
|
62
|
+
} }))), S = v(["flex", "items-center", "gap-md", "text-body-1"], { variants: { disabled: { true: ["text-neutral/dim-2", "cursor-not-allowed"], false: ["cursor-pointer"] } }, defaultVariants: { disabled: !1 } }), z = ({ className: t, disabled: a, ...e }) => c.createElement(P, { className: S({ className: t, disabled: a }), ...e }), Z = c.forwardRef(({ children: t, ...a }, e) => c.createElement(z, { "data-spark-component": "checkbox", disabled: a.disabled }, c.createElement(j, { ref: e, ...a }), t));
|
63
63
|
export {
|
64
64
|
Z as Checkbox
|
65
65
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@spark-ui/checkbox",
|
3
|
-
"version": "1.6.
|
3
|
+
"version": "1.6.6",
|
4
4
|
"description": "A control that allows the user to toggle between checked and not checked.",
|
5
5
|
"publishConfig": {
|
6
6
|
"access": "public"
|
@@ -13,7 +13,7 @@
|
|
13
13
|
},
|
14
14
|
"dependencies": {
|
15
15
|
"@radix-ui/react-checkbox": "1",
|
16
|
-
"@spark-ui/icons": "^1.6.
|
16
|
+
"@spark-ui/icons": "^1.6.1",
|
17
17
|
"@spark-ui/internal-utils": "1",
|
18
18
|
"class-variance-authority": "0.4.0"
|
19
19
|
},
|
@@ -22,5 +22,5 @@
|
|
22
22
|
"react-dom": "^16.8 || ^17.0 || ^18.0",
|
23
23
|
"tailwindcss": "^3.0.0"
|
24
24
|
},
|
25
|
-
"gitHead": "
|
25
|
+
"gitHead": "eb75944ce3d95e64872aa512ad2d503e00539594"
|
26
26
|
}
|