@jamsrui/switch 0.0.10 → 0.0.12
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-4FAMDC4W.mjs +1 -0
- package/dist/{chunk-IBRNHXAJ.mjs → chunk-BXBHWVKC.mjs} +1 -1
- package/dist/{chunk-YQAB3LUG.mjs → chunk-VGHIDOWS.mjs} +1 -1
- package/dist/{chunk-4HIF66TZ.mjs → chunk-WQGZQL5E.mjs} +1 -1
- package/dist/index.mjs +1 -1
- package/dist/primitive/index.mjs +1 -1
- package/dist/primitive/styles.mjs +1 -1
- package/dist/primitive/switch.mjs +1 -1
- package/dist/primitive/use-switch.mjs +1 -1
- package/dist/switch.mjs +1 -1
- package/package.json +5 -5
- package/dist/chunk-YYWXM3MT.mjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{groupDataFocusVisibleClasses as e,tv as r}from"@jamsrui/utils";var s=r({slots:{root:"group flex flex-col gap-2",track:[...e,"flex cursor-default shrink-0 items-center rounded-full bg-surface-secondary p-1","uig-disabled:cursor-not-allowed uig-disabled:opacity-60","ui-interactive:hover:opacity-95","justify-start uig-checked:justify-end"],thumb:"size-8 rounded-full bg-white shadow-md",label:"text-sm uig-interactive:cursor-pointer",description:"text-xs text-foreground-secondary",content:"grid grow gap-1",wrapper:"flex items-center justify-between gap-2 relative",input:"opacity-[0.0001] absolute inset-0 cursor-default disabled:cursor-not-allowed z-1"},variants:{color:{default:{track:"uig-checked:bg-default"},primary:{track:"uig-checked:bg-primary"},secondary:{track:"uig-checked:bg-secondary"},success:{track:"uig-checked:bg-success"},warning:{track:"uig-checked:bg-warning"},danger:{track:"uig-checked:bg-danger"}},size:{xs:{track:"h-4 w-7 px-0.5",thumb:"size-3 uig-pressed:w-4"},sm:{track:"h-6 w-10",thumb:"size-4 uig-pressed:w-5"},md:{track:"h-7 w-12",thumb:"size-5 uig-pressed:w-6"},lg:{track:"h-8 w-14",thumb:"size-6 uig-pressed:w-7"}},labelPlacement:{start:{wrapper:"flex-row"},end:{wrapper:"flex-row-reverse"},top:{wrapper:"flex-col"},bottom:{wrapper:"flex-col-reverse"}}},defaultVariants:{size:"md",color:"success",labelPlacement:"start"}});export{s as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as c}from"./chunk-
|
|
1
|
+
import{a as c}from"./chunk-WQGZQL5E.mjs";import{b as e}from"./chunk-IIZ5FKIW.mjs";import{a as r}from"./chunk-NR7TBHSW.mjs";import{mergeConfigProps as s}from"@jamsrui/utils";import{jsx as p}from"react/jsx-runtime";var S=t=>{let o=e(),i=s(o,o,t),n=c(i);return p(r,{value:n,children:t.children})};export{S as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as r}from"./chunk-IGNAWQUV.mjs";import{a as S}from"./chunk-YZHN6POK.mjs";import{a as n}from"./chunk-ZID55QUD.mjs";import{a as p}from"./chunk-X76H4PSZ.mjs";import{a as h}from"./chunk-UV6DZE4H.mjs";import{a as w}from"./chunk-VP7BK66R.mjs";import{a as m}from"./chunk-YFRKKQNC.mjs";import{a}from"./chunk-VSR2PVUI.mjs";import{a as s}from"./chunk-
|
|
1
|
+
import{b as r}from"./chunk-IGNAWQUV.mjs";import{a as S}from"./chunk-YZHN6POK.mjs";import{a as n}from"./chunk-ZID55QUD.mjs";import{a as p}from"./chunk-X76H4PSZ.mjs";import{a as h}from"./chunk-UV6DZE4H.mjs";import{a as w}from"./chunk-VP7BK66R.mjs";import{a as m}from"./chunk-YFRKKQNC.mjs";import{a}from"./chunk-VSR2PVUI.mjs";import{a as s}from"./chunk-WQGZQL5E.mjs";import{a as l}from"./chunk-CV6X5VZS.mjs";import{a as c}from"./chunk-NR7TBHSW.mjs";import{Slot as i}from"@jamsrui/slot";import{mergeConfigProps as C}from"@jamsrui/utils";import{AnimatePresence as T}from"motion/react";import{jsx as t,jsxs as f}from"react/jsx-runtime";var D=u=>{let e=r(),P=C(e,e,u),{label:b,children:d,slots:o,...g}=P,x=s(g);return t(c,{value:x,children:t(i,{slot:o?.root,children:t(h,{children:t(i,{slot:o?.wrapper,children:f(a,{children:[t(i,{slot:o?.input,children:t(n,{})}),t(i,{slot:o?.content,children:f(l,{children:[t(i,{slot:o?.label,children:t(p,{children:b})}),t(i,{slot:o?.description,children:t(S,{children:d})})]})}),t(T,{initial:!1,children:t(i,{slot:o?.track,children:t(m,{children:t(i,{slot:o?.thumb,children:t(w,{})})})})})]})})})})})};export{D as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as n}from"./chunk-
|
|
1
|
+
import{a as n}from"./chunk-4FAMDC4W.mjs";import{useCallback as a,useId as L,useMemo as M}from"react";import{useControlledState as W,useFocusVisible as A,useMergeRefs as E,usePress as F}from"@jamsrui/hooks";import{cn as r,dataAttr as p,dataAttrDev as l,mapPropsVariants as j,mergeProps as H}from"@jamsrui/utils";var z=R=>{let[I,G]=j(R,n.variantKeys),e=n(G),{isChecked:T,defaultChecked:v,onCheckedChange:V,isDisabled:o,isReadonly:c,classNames:s}=I,[i,m]=W({defaultProp:v,onChange:V,prop:T}),{isFocusVisible:h,ref:D}=A({isDisabled:o}),{isPressed:d,ref:x}=F({isDisabled:o}),u=E([D,x]),w=L(),P=a(t=>{!o&&!c&&m(t.target.checked)},[o,c,m]),b=a(t=>({...t,className:e.root({className:r(s?.root,t.className)}),"data-slot":l("root"),"data-component":l("switch"),"data-checked":p(i),"data-focus-visible":p(h),"data-pressed":p(d),"data-disabled":p(o)}),[s?.root,i,o,h,d,e]),N=a(t=>({...H(t,{onChange:P}),ref:u,type:"checkbox","data-slot":l("input"),className:e.input({className:r(s?.input,t.className)}),disabled:o,readOnly:c}),[s?.input,P,u,o,c,e]),S=a(t=>({...t,"data-slot":"track",className:e.track({className:r(s?.track,t.className)})}),[s?.track,e]),f=a(t=>({...t,layoutId:w,"data-slot":"thumb",className:e.thumb({className:r(s?.thumb,t.className)})}),[s?.thumb,w,e]),C=a(t=>({...t,"data-slot":"label",className:e.label({className:r(s?.label,t.className)})}),[s?.label,e]),k=a(t=>({...t,"data-slot":"description",className:e.description({className:r(s?.description,t.className)})}),[s?.description,e]),y=a(t=>({...t,"data-slot":"content",className:e.content({className:r(s?.content,t.className)})}),[s?.content,e]),g=a(t=>({...t,"data-slot":"wrapper",className:e.wrapper({className:r(s?.wrapper,t.className)})}),[s?.wrapper,e]);return M(()=>({isChecked:i,getRootProps:b,getThumbProps:f,getLabelProps:C,getDescriptionProps:k,getContentProps:y,getWrapperProps:g,getTrackProps:S,getInputProps:N}),[i,b,f,C,k,y,g,S,N])};export{z as a};
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{a as t}from"./chunk-
|
|
1
|
+
"use client";import{a as t}from"./chunk-VGHIDOWS.mjs";import{a as i,b as o}from"./chunk-IGNAWQUV.mjs";import"./chunk-PXWG26DS.mjs";import"./chunk-YZHN6POK.mjs";import"./chunk-ZID55QUD.mjs";import"./chunk-X76H4PSZ.mjs";import"./chunk-UV6DZE4H.mjs";import"./chunk-VP7BK66R.mjs";import"./chunk-YFRKKQNC.mjs";import"./chunk-VSR2PVUI.mjs";import"./chunk-BXBHWVKC.mjs";import"./chunk-WQGZQL5E.mjs";import"./chunk-4FAMDC4W.mjs";import"./chunk-IIZ5FKIW.mjs";import"./chunk-CV6X5VZS.mjs";import"./chunk-NR7TBHSW.mjs";export{t as Switch,i as SwitchConfig,o as useSwitchConfig};
|
package/dist/primitive/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import"../chunk-PXWG26DS.mjs";import{a as h}from"../chunk-YZHN6POK.mjs";import{a as i}from"../chunk-ZID55QUD.mjs";import{a as j}from"../chunk-X76H4PSZ.mjs";import{a as k}from"../chunk-UV6DZE4H.mjs";import{a as l}from"../chunk-VP7BK66R.mjs";import{a as m}from"../chunk-YFRKKQNC.mjs";import{a as n}from"../chunk-VSR2PVUI.mjs";import{a as f}from"../chunk-
|
|
1
|
+
"use client";import"../chunk-PXWG26DS.mjs";import{a as h}from"../chunk-YZHN6POK.mjs";import{a as i}from"../chunk-ZID55QUD.mjs";import{a as j}from"../chunk-X76H4PSZ.mjs";import{a as k}from"../chunk-UV6DZE4H.mjs";import{a as l}from"../chunk-VP7BK66R.mjs";import{a as m}from"../chunk-YFRKKQNC.mjs";import{a as n}from"../chunk-VSR2PVUI.mjs";import{a as f}from"../chunk-BXBHWVKC.mjs";import{a as e}from"../chunk-WQGZQL5E.mjs";import"../chunk-4FAMDC4W.mjs";import{a,b}from"../chunk-IIZ5FKIW.mjs";import{a as g}from"../chunk-CV6X5VZS.mjs";import{a as c,b as d}from"../chunk-NR7TBHSW.mjs";export{f as Switch,a as SwitchConfig,g as SwitchContent,c as SwitchContext,h as SwitchDescription,i as SwitchInput,j as SwitchLabel,k as SwitchRoot,l as SwitchThumb,m as SwitchTrack,n as SwitchWrapper,e as useSwitch,b as useSwitchConfig,d as useSwitchContext};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-4FAMDC4W.mjs";export{a as switchVariants};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-BXBHWVKC.mjs";import"../chunk-WQGZQL5E.mjs";import"../chunk-4FAMDC4W.mjs";import"../chunk-IIZ5FKIW.mjs";import"../chunk-NR7TBHSW.mjs";export{a as Switch};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-WQGZQL5E.mjs";import"../chunk-4FAMDC4W.mjs";export{a as useSwitch};
|
package/dist/switch.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-VGHIDOWS.mjs";import"./chunk-IGNAWQUV.mjs";import"./chunk-PXWG26DS.mjs";import"./chunk-YZHN6POK.mjs";import"./chunk-ZID55QUD.mjs";import"./chunk-X76H4PSZ.mjs";import"./chunk-UV6DZE4H.mjs";import"./chunk-VP7BK66R.mjs";import"./chunk-YFRKKQNC.mjs";import"./chunk-VSR2PVUI.mjs";import"./chunk-BXBHWVKC.mjs";import"./chunk-WQGZQL5E.mjs";import"./chunk-4FAMDC4W.mjs";import"./chunk-IIZ5FKIW.mjs";import"./chunk-CV6X5VZS.mjs";import"./chunk-NR7TBHSW.mjs";export{a as Switch};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jamsrui/switch",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12",
|
|
4
4
|
"exports": {
|
|
5
5
|
".": {
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
"react": ">=19"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@jamsrui/core": "^0.0.
|
|
20
|
-
"@jamsrui/
|
|
21
|
-
"@jamsrui/
|
|
22
|
-
"@jamsrui/
|
|
19
|
+
"@jamsrui/core": "^0.0.10",
|
|
20
|
+
"@jamsrui/hooks": "^0.0.12",
|
|
21
|
+
"@jamsrui/slot": "^0.0.11",
|
|
22
|
+
"@jamsrui/utils": "^0.0.12"
|
|
23
23
|
},
|
|
24
24
|
"description": "A modern and beautiful Next.js UI components library.",
|
|
25
25
|
"keywords": [
|
package/dist/chunk-YYWXM3MT.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{groupDataFocusVisibleClasses as e,tv as r}from"@jamsrui/utils";var s=r({slots:{root:"group flex flex-col gap-2",track:[...e,"flex cursor-pointer shrink-0 items-center rounded-full bg-surface-secondary p-1","uig-disabled:cursor-not-allowed uig-disabled:opacity-60","cursor-default ui-interactive:cursor-pointer ui-interactive:hover:opacity-95","justify-start uig-checked:justify-end"],thumb:"size-8 rounded-full bg-white shadow-md",label:"text-sm uig-interactive:cursor-pointer",description:"text-xs text-foreground-secondary",content:"grid grow gap-1",wrapper:"flex items-center justify-between gap-2 relative",input:"opacity-[0.0001] absolute inset-0 cursor-pointer disabled:cursor-not-allowed z-1"},variants:{color:{default:{track:"uig-checked:bg-default"},primary:{track:"uig-checked:bg-primary"},secondary:{track:"uig-checked:bg-secondary"},success:{track:"uig-checked:bg-success"},warning:{track:"uig-checked:bg-warning"},danger:{track:"uig-checked:bg-danger"}},size:{xs:{track:"h-4 w-7 px-0.5",thumb:"size-3 uig-pressed:w-4"},sm:{track:"h-6 w-10",thumb:"size-4 uig-pressed:w-5"},md:{track:"h-7 w-12",thumb:"size-5 uig-pressed:w-6"},lg:{track:"h-8 w-14",thumb:"size-6 uig-pressed:w-7"}},labelPlacement:{start:{wrapper:"flex-row"},end:{wrapper:"flex-row-reverse"},top:{wrapper:"flex-col"},bottom:{wrapper:"flex-col-reverse"}}},defaultVariants:{size:"md",color:"success",labelPlacement:"start"}});export{s as a};
|