@jamsrui/switch 0.0.2

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.
Files changed (80) hide show
  1. package/README.md +40 -0
  2. package/dist/chunk-2LZJ7NTE.js +1 -0
  3. package/dist/chunk-3QVJWFDR.mjs +1 -0
  4. package/dist/chunk-3TCAATGI.mjs +1 -0
  5. package/dist/chunk-6KHD65QK.mjs +1 -0
  6. package/dist/chunk-BCSK4AAO.mjs +1 -0
  7. package/dist/chunk-BEV2H3PO.js +1 -0
  8. package/dist/chunk-BUBGL4JZ.mjs +1 -0
  9. package/dist/chunk-CABIUVTY.js +1 -0
  10. package/dist/chunk-CLFHT656.js +1 -0
  11. package/dist/chunk-D3VTNGLC.js +1 -0
  12. package/dist/chunk-DDA54MYZ.mjs +1 -0
  13. package/dist/chunk-DHSJ6D3Y.js +1 -0
  14. package/dist/chunk-HSHMMCEU.mjs +1 -0
  15. package/dist/chunk-IGNAWQUV.mjs +1 -0
  16. package/dist/chunk-KK3YODKW.mjs +1 -0
  17. package/dist/chunk-MDPXI2FD.mjs +1 -0
  18. package/dist/chunk-OIF5SWKN.mjs +1 -0
  19. package/dist/chunk-Q5HFLFKD.js +1 -0
  20. package/dist/chunk-TEP4KR32.js +1 -0
  21. package/dist/chunk-UP35U2LS.js +1 -0
  22. package/dist/chunk-W374VGMM.js +1 -0
  23. package/dist/chunk-XO5NKDV5.js +1 -0
  24. package/dist/chunk-ZMFP3ZII.mjs +1 -0
  25. package/dist/chunk-ZU4NB4BT.js +1 -0
  26. package/dist/index.d.mts +14 -0
  27. package/dist/index.d.ts +14 -0
  28. package/dist/index.js +1 -0
  29. package/dist/index.mjs +1 -0
  30. package/dist/styles.d.mts +204 -0
  31. package/dist/styles.d.ts +204 -0
  32. package/dist/styles.js +1 -0
  33. package/dist/styles.mjs +1 -0
  34. package/dist/switch-CzNIU3Zv.d.mts +54 -0
  35. package/dist/switch-config.d.mts +24 -0
  36. package/dist/switch-config.d.ts +24 -0
  37. package/dist/switch-config.js +1 -0
  38. package/dist/switch-config.mjs +1 -0
  39. package/dist/switch-context.d.mts +21 -0
  40. package/dist/switch-context.d.ts +21 -0
  41. package/dist/switch-context.js +1 -0
  42. package/dist/switch-context.mjs +1 -0
  43. package/dist/switch-description.d.mts +10 -0
  44. package/dist/switch-description.d.ts +10 -0
  45. package/dist/switch-description.js +1 -0
  46. package/dist/switch-description.mjs +1 -0
  47. package/dist/switch-label.d.mts +10 -0
  48. package/dist/switch-label.d.ts +10 -0
  49. package/dist/switch-label.js +1 -0
  50. package/dist/switch-label.mjs +1 -0
  51. package/dist/switch-rDfweH_z.d.ts +54 -0
  52. package/dist/switch-thumb.d.mts +10 -0
  53. package/dist/switch-thumb.d.ts +10 -0
  54. package/dist/switch-thumb.js +1 -0
  55. package/dist/switch-thumb.mjs +1 -0
  56. package/dist/switch-track.d.mts +10 -0
  57. package/dist/switch-track.d.ts +10 -0
  58. package/dist/switch-track.js +1 -0
  59. package/dist/switch-track.mjs +1 -0
  60. package/dist/switch-wrapper.d.mts +10 -0
  61. package/dist/switch-wrapper.d.ts +10 -0
  62. package/dist/switch-wrapper.js +1 -0
  63. package/dist/switch-wrapper.mjs +1 -0
  64. package/dist/switch.d.mts +12 -0
  65. package/dist/switch.d.ts +12 -0
  66. package/dist/switch.js +1 -0
  67. package/dist/switch.mjs +1 -0
  68. package/dist/swith-content.d.mts +10 -0
  69. package/dist/swith-content.d.ts +10 -0
  70. package/dist/swith-content.js +1 -0
  71. package/dist/swith-content.mjs +1 -0
  72. package/dist/swith-error-message.d.mts +10 -0
  73. package/dist/swith-error-message.d.ts +10 -0
  74. package/dist/swith-error-message.js +1 -0
  75. package/dist/swith-error-message.mjs +1 -0
  76. package/dist/use-switch.d.mts +12 -0
  77. package/dist/use-switch.d.ts +12 -0
  78. package/dist/use-switch.js +1 -0
  79. package/dist/use-switch.mjs +1 -0
  80. package/package.json +49 -0
package/README.md ADDED
@@ -0,0 +1,40 @@
1
+ # 🚀 **JamsrUI**
2
+
3
+ **A comprehensive React UI component library designed for developers, with Tailwind CSS integration for seamless styling.**
4
+
5
+
6
+ ## 📖 **Overview**
7
+
8
+ [JamsrUI](https://jamsr-ui.jamsrworld.com) is designed to help developers build modern, fast and visually appealing web applications with ease.
9
+
10
+ ## 🚀 Getting Started
11
+
12
+ Boost & Build your websites using [JamsrUI](https://jamsr-ui.jamsrworld.com).
13
+
14
+ ## ✨ Features
15
+
16
+ - 🚀 **Production-Ready**: Optimized for modern React projects.
17
+ - 🎨 **Customizable**: Easily override styles and themes.
18
+ - 🛠️ **Reusable Components**: Save time with prebuilt, efficient UI elements.
19
+ - ⚡ **Developer-Friendly**: Simple API and well-documented usage.
20
+ - 📦 **Lightweight**: Minimal dependencies for fast performance.
21
+ - 🖥️ **Modern Design**: Clean, responsive, and user-friendly components.
22
+
23
+ ## 🌱 Community
24
+
25
+ We’re thrilled to see the community actively engage with **JamsrUI**! Whether you're sharing feedback, reporting bugs, requesting features, or showcasing projects built with JamsrUI, your involvement helps us grow and improve.
26
+
27
+ ### How to Engage
28
+
29
+ - 💬 **Report Bugs**: [GitHub Issues](https://github.com/jamsrworld/jamsr-ui/issues)
30
+ - 🚀 **Request Features**: Share ideas for new components.
31
+ - 🤝 **Showcase Projects**: Let us know how you use JamsrUI.
32
+
33
+ ## Contributing
34
+
35
+ We welcome contributions from developers of all skill levels!
36
+
37
+ ## ⭐ Support the Project
38
+
39
+ If you find **JamsrUI** helpful, consider giving it a ⭐ on [GitHub](https://github.com/jamsrworld/jamsr-ui).
40
+
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _react = require('react');var n=_react.createContext.call(void 0, null),c= exports.b =()=>{let t=_react.use.call(void 0, n);if(!t)throw new Error("useSwitchContext must be used within SwitchContext");return t};exports.a = n; exports.b = c;
@@ -0,0 +1 @@
1
+ import{b as r}from"./chunk-ZMFP3ZII.mjs";import{useRenderElement as n}from"@jamsrui/hooks";var i=t=>{let{getLabelProps:o,label:e}=r(),l=n("label",{props:[o(t),{children:e}]});return e?l:null};export{i as a};
@@ -0,0 +1 @@
1
+ import{b as e}from"./chunk-ZMFP3ZII.mjs";import{useRenderElement as o}from"@jamsrui/hooks";var n=r=>{let{getDescriptionProps:t}=e();return o("div",{props:[t(r)]})};export{n as a};
@@ -0,0 +1 @@
1
+ import{b as r}from"./chunk-ZMFP3ZII.mjs";import{useRenderElement as p}from"@jamsrui/hooks";var i=e=>{let{getWrapperProps:t}=r();return p("div",{props:[t(e)]})};export{i as a};
@@ -0,0 +1 @@
1
+ import{focusVisibleClasses as e,tv as r}from"@jamsrui/utils";var s="",a=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-500",content:"grid grow gap-1",wrapper:"flex items-center justify-between gap-2",errorMessage:"text-danger text-xs"},variants:{isInvalid:{true:{}},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"},sm:{track:"h-6 w-10",thumb:"size-4"},md:{track:"mr-2 h-7 w-12",thumb:"size-5"},lg:{track:"mr-2 h-8 w-14",thumb:"size-6"}},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,a as b};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk2LZJ7NTEjs = require('./chunk-2LZJ7NTE.js');var _hooks = require('@jamsrui/hooks');var n=r=>{let{getDescriptionProps:t}=_chunk2LZJ7NTEjs.b.call(void 0, );return _hooks.useRenderElement.call(void 0, "div",{props:[t(r)]})};exports.a = n;
@@ -0,0 +1 @@
1
+ import{a as h}from"./chunk-6KHD65QK.mjs";import{a as w}from"./chunk-KK3YODKW.mjs";import{a as S}from"./chunk-MDPXI2FD.mjs";import{a as f}from"./chunk-OIF5SWKN.mjs";import{b as i}from"./chunk-IGNAWQUV.mjs";import{a as n}from"./chunk-3TCAATGI.mjs";import{a as m}from"./chunk-3QVJWFDR.mjs";import{a as p}from"./chunk-DDA54MYZ.mjs";import{a as s}from"./chunk-HSHMMCEU.mjs";import{a as c}from"./chunk-ZMFP3ZII.mjs";import{useRenderElement as u}from"@jamsrui/hooks";import{mergeConfigProps as x}from"@jamsrui/utils";var q=t=>{let{children:o}=t,r=i(),a=x(r,r,t),e=f(a),{getRootProps:d,hasContent:C}=e,g=React.createElement(React.Fragment,null,React.createElement(h,null,!!C&&React.createElement(w,null,React.createElement(m,null),!!o&&React.createElement(n,null,o)),React.createElement(s,null,React.createElement(p,null))),React.createElement(S,null)),l=u("div",{props:[d({}),{children:g}]});return React.createElement(c,{value:e},l)};export{q as a};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk2LZJ7NTEjs = require('./chunk-2LZJ7NTE.js');var _hooks = require('@jamsrui/hooks');var i=e=>{let{getContentProps:r}=_chunk2LZJ7NTEjs.b.call(void 0, );return _hooks.useRenderElement.call(void 0, "div",{props:[r(e)]})};exports.a = i;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk2LZJ7NTEjs = require('./chunk-2LZJ7NTE.js');var _hooks = require('@jamsrui/hooks');var i=e=>{let{getErrorMessageProps:s,errorMessage:o}=_chunk2LZJ7NTEjs.b.call(void 0, );return _hooks.useRenderElement.call(void 0, "span",{props:[s(e),{children:o}]})};exports.a = i;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _utils = require('@jamsrui/utils');var[t,r]=_utils.createConfigContext.call(void 0, {displayName:"SwitchConfig"});exports.a = t; exports.b = r;
@@ -0,0 +1 @@
1
+ import{b as e}from"./chunk-ZMFP3ZII.mjs";import{useRenderElement as o}from"@jamsrui/hooks";var n=r=>{let{getThumbProps:t}=e();return o("div",{props:[t(r)]})};export{n as a};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk2LZJ7NTEjs = require('./chunk-2LZJ7NTE.js');var _hooks = require('@jamsrui/hooks');var i=t=>{let{getLabelProps:o,label:e}=_chunk2LZJ7NTEjs.b.call(void 0, ),l=_hooks.useRenderElement.call(void 0, "label",{props:[o(t),{children:e}]});return e?l:null};exports.a = i;
@@ -0,0 +1 @@
1
+ import{b as r}from"./chunk-ZMFP3ZII.mjs";import{useRenderElement as o}from"@jamsrui/hooks";var c=t=>{let{getTrackProps:e}=r();return o("button",{props:[e(t)]})};export{c as a};
@@ -0,0 +1 @@
1
+ import{createConfigContext as o}from"@jamsrui/utils";var[t,r]=o({displayName:"SwitchConfig"});export{t as a,r as b};
@@ -0,0 +1 @@
1
+ import{b as t}from"./chunk-ZMFP3ZII.mjs";import{useRenderElement as o}from"@jamsrui/hooks";var i=e=>{let{getContentProps:r}=t();return o("div",{props:[r(e)]})};export{i as a};
@@ -0,0 +1 @@
1
+ import{b as r}from"./chunk-ZMFP3ZII.mjs";import{useRenderElement as t}from"@jamsrui/hooks";var i=e=>{let{getErrorMessageProps:s,errorMessage:o}=r();return t("span",{props:[s(e),{children:o}]})};export{i as a};
@@ -0,0 +1 @@
1
+ import{b as l}from"./chunk-BCSK4AAO.mjs";import{useCallback as a,useMemo as M}from"react";import{cn as o,dataAttrDev as u,mapPropsVariants as T,mergeProps as c}from"@jamsrui/utils";var I=k=>{let[f,C]=T(k,l.variantKeys),s=l(C),{classNames:r,slotProps:e,label:i,errorMessage:n,children:y,isChecked:G,defaultChecked:v,onCheckedChange:D,isDisabled:x,isReadonly:E,...p}=f,m=a(()=>({...p,"data-slot":u("root"),"data-component":u("switch"),className:s.root({className:o(r?.root,p.className)})}),[r?.root,p,s]),h=a(t=>({...c(e?.thumb,t),"data-slot":"thumb",className:s.thumb({className:o(e?.thumb?.className,r?.thumb,t.className)})}),[r?.thumb,e?.thumb,s]),w=a(t=>({...c(e?.label,t),"data-slot":"label",className:s.label({className:o(e?.label?.className,r?.label,t.className)})}),[r?.label,e?.label,s]),P=a(t=>({...c(e?.description,t),"data-slot":"description",className:s.description({className:o(e?.description?.className,r?.description,t.className)})}),[r?.description,e?.description,s]),b=a(t=>({...c(e?.content,t),"data-slot":"content",className:s.content({className:o(e?.content?.className,r?.content,t.className)})}),[r?.content,e?.content,s]),d=a(t=>({...c(e?.wrapper,t),"data-slot":"wrapper",className:s.wrapper({className:o(e?.wrapper?.className,r?.wrapper,t.className)})}),[r?.wrapper,e?.wrapper,s]),N=a(t=>({...c(e?.track,t),"data-slot":"track",className:s.track({className:o(e?.track?.className,r?.track,t.className)})}),[r?.track,e?.track,s]),S=a(t=>({...c(e?.errorMessage,t),"data-slot":"error-message",className:s.errorMessage({className:o(e?.errorMessage?.className,r?.errorMessage,t.className)})}),[r?.errorMessage,e?.errorMessage,s]),g=!!i||!!y;return M(()=>({getRootProps:m,getThumbProps:h,getLabelProps:w,getDescriptionProps:P,getContentProps:b,getWrapperProps:d,getTrackProps:N,getErrorMessageProps:S,label:i,errorMessage:n,hasContent:g}),[m,h,w,P,b,d,N,S,i,n,g])};export{I as a};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk2LZJ7NTEjs = require('./chunk-2LZJ7NTE.js');var _hooks = require('@jamsrui/hooks');var n=r=>{let{getThumbProps:t}=_chunk2LZJ7NTEjs.b.call(void 0, );return _hooks.useRenderElement.call(void 0, "div",{props:[t(r)]})};exports.a = n;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _utils = require('@jamsrui/utils');var s="",a= exports.b =_utils.tv.call(void 0, {slots:{root:"group flex flex-col gap-2",track:[..._utils.focusVisibleClasses,"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-500",content:"grid grow gap-1",wrapper:"flex items-center justify-between gap-2",errorMessage:"text-danger text-xs"},variants:{isInvalid:{true:{}},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"},sm:{track:"h-6 w-10",thumb:"size-4"},md:{track:"mr-2 h-7 w-12",thumb:"size-5"},lg:{track:"mr-2 h-8 w-14",thumb:"size-6"}},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"}});exports.a = s; exports.b = a;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkW374VGMMjs = require('./chunk-W374VGMM.js');var _chunkCABIUVTYjs = require('./chunk-CABIUVTY.js');var _chunkCLFHT656js = require('./chunk-CLFHT656.js');var _chunkXO5NKDV5js = require('./chunk-XO5NKDV5.js');var _chunkD3VTNGLCjs = require('./chunk-D3VTNGLC.js');var _chunkBEV2H3POjs = require('./chunk-BEV2H3PO.js');var _chunkDHSJ6D3Yjs = require('./chunk-DHSJ6D3Y.js');var _chunkQ5HFLFKDjs = require('./chunk-Q5HFLFKD.js');var _chunkZU4NB4BTjs = require('./chunk-ZU4NB4BT.js');var _chunk2LZJ7NTEjs = require('./chunk-2LZJ7NTE.js');var _hooks = require('@jamsrui/hooks');var _utils = require('@jamsrui/utils');var q=t=>{let{children:o}=t,r=_chunkD3VTNGLCjs.b.call(void 0, ),a=_utils.mergeConfigProps.call(void 0, r,r,t),e=_chunkXO5NKDV5js.a.call(void 0, a),{getRootProps:d,hasContent:C}=e,g=React.createElement(React.Fragment,null,React.createElement(_chunkW374VGMMjs.a,null,!!C&&React.createElement(_chunkCABIUVTYjs.a,null,React.createElement(_chunkDHSJ6D3Yjs.a,null),!!o&&React.createElement(_chunkBEV2H3POjs.a,null,o)),React.createElement(_chunkZU4NB4BTjs.a,null,React.createElement(_chunkQ5HFLFKDjs.a,null))),React.createElement(_chunkCLFHT656js.a,null)),l=_hooks.useRenderElement.call(void 0, "div",{props:[d({}),{children:g}]});return React.createElement(_chunk2LZJ7NTEjs.a,{value:e},l)};exports.a = q;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk2LZJ7NTEjs = require('./chunk-2LZJ7NTE.js');var _hooks = require('@jamsrui/hooks');var i=e=>{let{getWrapperProps:t}=_chunk2LZJ7NTEjs.b.call(void 0, );return _hooks.useRenderElement.call(void 0, "div",{props:[t(e)]})};exports.a = i;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkTEP4KR32js = require('./chunk-TEP4KR32.js');var _react = require('react');var _utils = require('@jamsrui/utils');var I=k=>{let[f,C]=_utils.mapPropsVariants.call(void 0, k,_chunkTEP4KR32js.b.variantKeys),s=_chunkTEP4KR32js.b.call(void 0, C),{classNames:r,slotProps:e,label:i,errorMessage:n,children:y,isChecked:G,defaultChecked:v,onCheckedChange:D,isDisabled:x,isReadonly:E,...p}=f,m=_react.useCallback.call(void 0, ()=>({...p,"data-slot":_utils.dataAttrDev.call(void 0, "root"),"data-component":_utils.dataAttrDev.call(void 0, "switch"),className:s.root({className:_utils.cn.call(void 0, _optionalChain([r, 'optionalAccess', _ => _.root]),p.className)})}),[_optionalChain([r, 'optionalAccess', _2 => _2.root]),p,s]),h=_react.useCallback.call(void 0, t=>({..._utils.mergeProps.call(void 0, _optionalChain([e, 'optionalAccess', _3 => _3.thumb]),t),"data-slot":"thumb",className:s.thumb({className:_utils.cn.call(void 0, _optionalChain([e, 'optionalAccess', _4 => _4.thumb, 'optionalAccess', _5 => _5.className]),_optionalChain([r, 'optionalAccess', _6 => _6.thumb]),t.className)})}),[_optionalChain([r, 'optionalAccess', _7 => _7.thumb]),_optionalChain([e, 'optionalAccess', _8 => _8.thumb]),s]),w=_react.useCallback.call(void 0, t=>({..._utils.mergeProps.call(void 0, _optionalChain([e, 'optionalAccess', _9 => _9.label]),t),"data-slot":"label",className:s.label({className:_utils.cn.call(void 0, _optionalChain([e, 'optionalAccess', _10 => _10.label, 'optionalAccess', _11 => _11.className]),_optionalChain([r, 'optionalAccess', _12 => _12.label]),t.className)})}),[_optionalChain([r, 'optionalAccess', _13 => _13.label]),_optionalChain([e, 'optionalAccess', _14 => _14.label]),s]),P=_react.useCallback.call(void 0, t=>({..._utils.mergeProps.call(void 0, _optionalChain([e, 'optionalAccess', _15 => _15.description]),t),"data-slot":"description",className:s.description({className:_utils.cn.call(void 0, _optionalChain([e, 'optionalAccess', _16 => _16.description, 'optionalAccess', _17 => _17.className]),_optionalChain([r, 'optionalAccess', _18 => _18.description]),t.className)})}),[_optionalChain([r, 'optionalAccess', _19 => _19.description]),_optionalChain([e, 'optionalAccess', _20 => _20.description]),s]),b=_react.useCallback.call(void 0, t=>({..._utils.mergeProps.call(void 0, _optionalChain([e, 'optionalAccess', _21 => _21.content]),t),"data-slot":"content",className:s.content({className:_utils.cn.call(void 0, _optionalChain([e, 'optionalAccess', _22 => _22.content, 'optionalAccess', _23 => _23.className]),_optionalChain([r, 'optionalAccess', _24 => _24.content]),t.className)})}),[_optionalChain([r, 'optionalAccess', _25 => _25.content]),_optionalChain([e, 'optionalAccess', _26 => _26.content]),s]),d=_react.useCallback.call(void 0, t=>({..._utils.mergeProps.call(void 0, _optionalChain([e, 'optionalAccess', _27 => _27.wrapper]),t),"data-slot":"wrapper",className:s.wrapper({className:_utils.cn.call(void 0, _optionalChain([e, 'optionalAccess', _28 => _28.wrapper, 'optionalAccess', _29 => _29.className]),_optionalChain([r, 'optionalAccess', _30 => _30.wrapper]),t.className)})}),[_optionalChain([r, 'optionalAccess', _31 => _31.wrapper]),_optionalChain([e, 'optionalAccess', _32 => _32.wrapper]),s]),N=_react.useCallback.call(void 0, t=>({..._utils.mergeProps.call(void 0, _optionalChain([e, 'optionalAccess', _33 => _33.track]),t),"data-slot":"track",className:s.track({className:_utils.cn.call(void 0, _optionalChain([e, 'optionalAccess', _34 => _34.track, 'optionalAccess', _35 => _35.className]),_optionalChain([r, 'optionalAccess', _36 => _36.track]),t.className)})}),[_optionalChain([r, 'optionalAccess', _37 => _37.track]),_optionalChain([e, 'optionalAccess', _38 => _38.track]),s]),S=_react.useCallback.call(void 0, t=>({..._utils.mergeProps.call(void 0, _optionalChain([e, 'optionalAccess', _39 => _39.errorMessage]),t),"data-slot":"error-message",className:s.errorMessage({className:_utils.cn.call(void 0, _optionalChain([e, 'optionalAccess', _40 => _40.errorMessage, 'optionalAccess', _41 => _41.className]),_optionalChain([r, 'optionalAccess', _42 => _42.errorMessage]),t.className)})}),[_optionalChain([r, 'optionalAccess', _43 => _43.errorMessage]),_optionalChain([e, 'optionalAccess', _44 => _44.errorMessage]),s]),g=!!i||!!y;return _react.useMemo.call(void 0, ()=>({getRootProps:m,getThumbProps:h,getLabelProps:w,getDescriptionProps:P,getContentProps:b,getWrapperProps:d,getTrackProps:N,getErrorMessageProps:S,label:i,errorMessage:n,hasContent:g}),[m,h,w,P,b,d,N,S,i,n,g])};exports.a = I;
@@ -0,0 +1 @@
1
+ import{createContext as e,use as o}from"react";var n=e(null),c=()=>{let t=o(n);if(!t)throw new Error("useSwitchContext must be used within SwitchContext");return t};export{n as a,c as b};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk2LZJ7NTEjs = require('./chunk-2LZJ7NTE.js');var _hooks = require('@jamsrui/hooks');var c=t=>{let{getTrackProps:e}=_chunk2LZJ7NTEjs.b.call(void 0, );return _hooks.useRenderElement.call(void 0, "button",{props:[e(t)]})};exports.a = c;
@@ -0,0 +1,14 @@
1
+ export { S as Switch } from './switch-CzNIU3Zv.mjs';
2
+ export { SwitchConfig, useSwitchConfig } from './switch-config.mjs';
3
+ import 'react';
4
+ import '@jamsrui/utils';
5
+ import './styles.mjs';
6
+ import 'tailwind-variants';
7
+ import './switch-description.mjs';
8
+ import './switch-label.mjs';
9
+ import './switch-thumb.mjs';
10
+ import './switch-track.mjs';
11
+ import './switch-wrapper.mjs';
12
+ import './swith-content.mjs';
13
+ import './swith-error-message.mjs';
14
+ import '@jamsrui/core';
@@ -0,0 +1,14 @@
1
+ export { S as Switch } from './switch-rDfweH_z.js';
2
+ export { SwitchConfig, useSwitchConfig } from './switch-config.js';
3
+ import 'react';
4
+ import '@jamsrui/utils';
5
+ import './styles.js';
6
+ import 'tailwind-variants';
7
+ import './switch-description.js';
8
+ import './switch-label.js';
9
+ import './switch-thumb.js';
10
+ import './switch-track.js';
11
+ import './switch-wrapper.js';
12
+ import './swith-content.js';
13
+ import './swith-error-message.js';
14
+ import '@jamsrui/core';
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";var _chunkUP35U2LSjs = require('./chunk-UP35U2LS.js');require('./chunk-W374VGMM.js');require('./chunk-CABIUVTY.js');require('./chunk-CLFHT656.js');require('./chunk-XO5NKDV5.js');require('./chunk-TEP4KR32.js');var _chunkD3VTNGLCjs = require('./chunk-D3VTNGLC.js');require('./chunk-BEV2H3PO.js');require('./chunk-DHSJ6D3Y.js');require('./chunk-Q5HFLFKD.js');require('./chunk-ZU4NB4BT.js');require('./chunk-2LZJ7NTE.js');exports.Switch = _chunkUP35U2LSjs.a; exports.SwitchConfig = _chunkD3VTNGLCjs.a; exports.useSwitchConfig = _chunkD3VTNGLCjs.b;
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+ "use client";import{a as t}from"./chunk-BUBGL4JZ.mjs";import"./chunk-6KHD65QK.mjs";import"./chunk-KK3YODKW.mjs";import"./chunk-MDPXI2FD.mjs";import"./chunk-OIF5SWKN.mjs";import"./chunk-BCSK4AAO.mjs";import{a as i,b as o}from"./chunk-IGNAWQUV.mjs";import"./chunk-3TCAATGI.mjs";import"./chunk-3QVJWFDR.mjs";import"./chunk-DDA54MYZ.mjs";import"./chunk-HSHMMCEU.mjs";import"./chunk-ZMFP3ZII.mjs";export{t as Switch,i as SwitchConfig,o as useSwitchConfig};
@@ -0,0 +1,204 @@
1
+ import * as tailwind_variants from 'tailwind-variants';
2
+ import { VariantProps } from '@jamsrui/utils';
3
+
4
+ declare const test = "";
5
+ declare const switchVariants: tailwind_variants.TVReturnType<{
6
+ isInvalid: {
7
+ true: {};
8
+ };
9
+ color: {
10
+ default: {
11
+ track: string;
12
+ };
13
+ primary: {
14
+ track: string;
15
+ };
16
+ secondary: {
17
+ track: string;
18
+ };
19
+ success: {
20
+ track: string;
21
+ };
22
+ warning: {
23
+ track: string;
24
+ };
25
+ danger: {
26
+ track: string;
27
+ };
28
+ };
29
+ size: {
30
+ xs: {
31
+ track: string;
32
+ thumb: string;
33
+ };
34
+ sm: {
35
+ track: string;
36
+ thumb: string;
37
+ };
38
+ md: {
39
+ track: string;
40
+ thumb: string;
41
+ };
42
+ lg: {
43
+ track: string;
44
+ thumb: string;
45
+ };
46
+ };
47
+ labelPlacement: {
48
+ start: {
49
+ wrapper: string;
50
+ };
51
+ end: {
52
+ wrapper: string;
53
+ };
54
+ top: {
55
+ wrapper: string;
56
+ };
57
+ bottom: {
58
+ wrapper: string;
59
+ };
60
+ };
61
+ }, {
62
+ root: string;
63
+ track: string[];
64
+ thumb: string;
65
+ label: string;
66
+ description: string;
67
+ content: string;
68
+ wrapper: string;
69
+ errorMessage: string;
70
+ }, undefined, {
71
+ isInvalid: {
72
+ true: {};
73
+ };
74
+ color: {
75
+ default: {
76
+ track: string;
77
+ };
78
+ primary: {
79
+ track: string;
80
+ };
81
+ secondary: {
82
+ track: string;
83
+ };
84
+ success: {
85
+ track: string;
86
+ };
87
+ warning: {
88
+ track: string;
89
+ };
90
+ danger: {
91
+ track: string;
92
+ };
93
+ };
94
+ size: {
95
+ xs: {
96
+ track: string;
97
+ thumb: string;
98
+ };
99
+ sm: {
100
+ track: string;
101
+ thumb: string;
102
+ };
103
+ md: {
104
+ track: string;
105
+ thumb: string;
106
+ };
107
+ lg: {
108
+ track: string;
109
+ thumb: string;
110
+ };
111
+ };
112
+ labelPlacement: {
113
+ start: {
114
+ wrapper: string;
115
+ };
116
+ end: {
117
+ wrapper: string;
118
+ };
119
+ top: {
120
+ wrapper: string;
121
+ };
122
+ bottom: {
123
+ wrapper: string;
124
+ };
125
+ };
126
+ }, {
127
+ root: string;
128
+ track: string[];
129
+ thumb: string;
130
+ label: string;
131
+ description: string;
132
+ content: string;
133
+ wrapper: string;
134
+ errorMessage: string;
135
+ }, tailwind_variants.TVReturnType<{
136
+ isInvalid: {
137
+ true: {};
138
+ };
139
+ color: {
140
+ default: {
141
+ track: string;
142
+ };
143
+ primary: {
144
+ track: string;
145
+ };
146
+ secondary: {
147
+ track: string;
148
+ };
149
+ success: {
150
+ track: string;
151
+ };
152
+ warning: {
153
+ track: string;
154
+ };
155
+ danger: {
156
+ track: string;
157
+ };
158
+ };
159
+ size: {
160
+ xs: {
161
+ track: string;
162
+ thumb: string;
163
+ };
164
+ sm: {
165
+ track: string;
166
+ thumb: string;
167
+ };
168
+ md: {
169
+ track: string;
170
+ thumb: string;
171
+ };
172
+ lg: {
173
+ track: string;
174
+ thumb: string;
175
+ };
176
+ };
177
+ labelPlacement: {
178
+ start: {
179
+ wrapper: string;
180
+ };
181
+ end: {
182
+ wrapper: string;
183
+ };
184
+ top: {
185
+ wrapper: string;
186
+ };
187
+ bottom: {
188
+ wrapper: string;
189
+ };
190
+ };
191
+ }, {
192
+ root: string;
193
+ track: string[];
194
+ thumb: string;
195
+ label: string;
196
+ description: string;
197
+ content: string;
198
+ wrapper: string;
199
+ errorMessage: string;
200
+ }, undefined, unknown, unknown, undefined>>;
201
+ type SwitchVariants = VariantProps<typeof switchVariants>;
202
+ type SwitchSlots = keyof ReturnType<typeof switchVariants>;
203
+
204
+ export { type SwitchSlots, type SwitchVariants, switchVariants, test };
@@ -0,0 +1,204 @@
1
+ import * as tailwind_variants from 'tailwind-variants';
2
+ import { VariantProps } from '@jamsrui/utils';
3
+
4
+ declare const test = "";
5
+ declare const switchVariants: tailwind_variants.TVReturnType<{
6
+ isInvalid: {
7
+ true: {};
8
+ };
9
+ color: {
10
+ default: {
11
+ track: string;
12
+ };
13
+ primary: {
14
+ track: string;
15
+ };
16
+ secondary: {
17
+ track: string;
18
+ };
19
+ success: {
20
+ track: string;
21
+ };
22
+ warning: {
23
+ track: string;
24
+ };
25
+ danger: {
26
+ track: string;
27
+ };
28
+ };
29
+ size: {
30
+ xs: {
31
+ track: string;
32
+ thumb: string;
33
+ };
34
+ sm: {
35
+ track: string;
36
+ thumb: string;
37
+ };
38
+ md: {
39
+ track: string;
40
+ thumb: string;
41
+ };
42
+ lg: {
43
+ track: string;
44
+ thumb: string;
45
+ };
46
+ };
47
+ labelPlacement: {
48
+ start: {
49
+ wrapper: string;
50
+ };
51
+ end: {
52
+ wrapper: string;
53
+ };
54
+ top: {
55
+ wrapper: string;
56
+ };
57
+ bottom: {
58
+ wrapper: string;
59
+ };
60
+ };
61
+ }, {
62
+ root: string;
63
+ track: string[];
64
+ thumb: string;
65
+ label: string;
66
+ description: string;
67
+ content: string;
68
+ wrapper: string;
69
+ errorMessage: string;
70
+ }, undefined, {
71
+ isInvalid: {
72
+ true: {};
73
+ };
74
+ color: {
75
+ default: {
76
+ track: string;
77
+ };
78
+ primary: {
79
+ track: string;
80
+ };
81
+ secondary: {
82
+ track: string;
83
+ };
84
+ success: {
85
+ track: string;
86
+ };
87
+ warning: {
88
+ track: string;
89
+ };
90
+ danger: {
91
+ track: string;
92
+ };
93
+ };
94
+ size: {
95
+ xs: {
96
+ track: string;
97
+ thumb: string;
98
+ };
99
+ sm: {
100
+ track: string;
101
+ thumb: string;
102
+ };
103
+ md: {
104
+ track: string;
105
+ thumb: string;
106
+ };
107
+ lg: {
108
+ track: string;
109
+ thumb: string;
110
+ };
111
+ };
112
+ labelPlacement: {
113
+ start: {
114
+ wrapper: string;
115
+ };
116
+ end: {
117
+ wrapper: string;
118
+ };
119
+ top: {
120
+ wrapper: string;
121
+ };
122
+ bottom: {
123
+ wrapper: string;
124
+ };
125
+ };
126
+ }, {
127
+ root: string;
128
+ track: string[];
129
+ thumb: string;
130
+ label: string;
131
+ description: string;
132
+ content: string;
133
+ wrapper: string;
134
+ errorMessage: string;
135
+ }, tailwind_variants.TVReturnType<{
136
+ isInvalid: {
137
+ true: {};
138
+ };
139
+ color: {
140
+ default: {
141
+ track: string;
142
+ };
143
+ primary: {
144
+ track: string;
145
+ };
146
+ secondary: {
147
+ track: string;
148
+ };
149
+ success: {
150
+ track: string;
151
+ };
152
+ warning: {
153
+ track: string;
154
+ };
155
+ danger: {
156
+ track: string;
157
+ };
158
+ };
159
+ size: {
160
+ xs: {
161
+ track: string;
162
+ thumb: string;
163
+ };
164
+ sm: {
165
+ track: string;
166
+ thumb: string;
167
+ };
168
+ md: {
169
+ track: string;
170
+ thumb: string;
171
+ };
172
+ lg: {
173
+ track: string;
174
+ thumb: string;
175
+ };
176
+ };
177
+ labelPlacement: {
178
+ start: {
179
+ wrapper: string;
180
+ };
181
+ end: {
182
+ wrapper: string;
183
+ };
184
+ top: {
185
+ wrapper: string;
186
+ };
187
+ bottom: {
188
+ wrapper: string;
189
+ };
190
+ };
191
+ }, {
192
+ root: string;
193
+ track: string[];
194
+ thumb: string;
195
+ label: string;
196
+ description: string;
197
+ content: string;
198
+ wrapper: string;
199
+ errorMessage: string;
200
+ }, undefined, unknown, unknown, undefined>>;
201
+ type SwitchVariants = VariantProps<typeof switchVariants>;
202
+ type SwitchSlots = keyof ReturnType<typeof switchVariants>;
203
+
204
+ export { type SwitchSlots, type SwitchVariants, switchVariants, test };
package/dist/styles.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkTEP4KR32js = require('./chunk-TEP4KR32.js');exports.switchVariants = _chunkTEP4KR32js.b; exports.test = _chunkTEP4KR32js.a;
@@ -0,0 +1 @@
1
+ import{a,b}from"./chunk-BCSK4AAO.mjs";export{b as switchVariants,a as test};
@@ -0,0 +1,54 @@
1
+ import * as react from 'react';
2
+ import { PropGetter, UIProps, SlotsToClassNames } from '@jamsrui/utils';
3
+ import { SwitchVariants, SwitchSlots } from './styles.mjs';
4
+ import { SwitchDescription } from './switch-description.mjs';
5
+ import { SwitchLabel } from './switch-label.mjs';
6
+ import { SwitchThumb } from './switch-thumb.mjs';
7
+ import { SwitchTrack } from './switch-track.mjs';
8
+ import { SwitchWrapper } from './switch-wrapper.mjs';
9
+ import { SwitchContent } from './swith-content.mjs';
10
+ import { SwitchErrorMessage } from './swith-error-message.mjs';
11
+
12
+ declare const useSwitch: (props: useSwitch.Props) => {
13
+ getRootProps: PropGetter<Switch.Props>;
14
+ getThumbProps: PropGetter<SwitchThumb.Props>;
15
+ getLabelProps: PropGetter<SwitchLabel.Props>;
16
+ getDescriptionProps: PropGetter<SwitchDescription.Props>;
17
+ getContentProps: PropGetter<SwitchContent.Props>;
18
+ getWrapperProps: PropGetter<SwitchWrapper.Props>;
19
+ getTrackProps: PropGetter<SwitchTrack.Props>;
20
+ getErrorMessageProps: PropGetter<SwitchErrorMessage.Props>;
21
+ label: string | undefined;
22
+ errorMessage: string | undefined;
23
+ hasContent: boolean;
24
+ };
25
+ declare namespace useSwitch {
26
+ interface Props extends SwitchVariants, UIProps<"div"> {
27
+ label?: string;
28
+ errorMessage?: string;
29
+ classNames?: SlotsToClassNames<SwitchSlots>;
30
+ slotProps?: {
31
+ track?: SwitchTrack.Props;
32
+ thumb?: SwitchThumb.Props;
33
+ label?: SwitchLabel.Props;
34
+ description?: SwitchDescription.Props;
35
+ content?: SwitchContent.Props;
36
+ wrapper?: SwitchWrapper.Props;
37
+ errorMessage?: SwitchErrorMessage.Props;
38
+ };
39
+ isReadonly?: boolean;
40
+ isDisabled?: boolean;
41
+ isChecked?: boolean;
42
+ onCheckedChange?: (value: boolean) => void;
43
+ defaultChecked?: boolean;
44
+ isInvalid?: boolean;
45
+ }
46
+ }
47
+
48
+ declare const Switch: (props: Switch.Props) => react.JSX.Element;
49
+ declare namespace Switch {
50
+ interface Props extends useSwitch.Props {
51
+ }
52
+ }
53
+
54
+ export { Switch as S, useSwitch as u };
@@ -0,0 +1,24 @@
1
+ import { S as Switch } from './switch-CzNIU3Zv.mjs';
2
+ import * as react from 'react';
3
+ import { GlobalConfigProps } from '@jamsrui/core';
4
+ import '@jamsrui/utils';
5
+ import './styles.mjs';
6
+ import 'tailwind-variants';
7
+ import './switch-description.mjs';
8
+ import './switch-label.mjs';
9
+ import './switch-thumb.mjs';
10
+ import './switch-track.mjs';
11
+ import './switch-wrapper.mjs';
12
+ import './swith-content.mjs';
13
+ import './swith-error-message.mjs';
14
+
15
+ declare const useSwitchConfig: () => SwitchConfig.Props;
16
+ declare const SwitchConfig: (props: SwitchConfig.Props & {
17
+ merge?: boolean;
18
+ }) => react.JSX.Element;
19
+ declare namespace SwitchConfig {
20
+ interface Props extends Switch.Props, GlobalConfigProps<Switch.Props> {
21
+ }
22
+ }
23
+
24
+ export { SwitchConfig, useSwitchConfig };
@@ -0,0 +1,24 @@
1
+ import { S as Switch } from './switch-rDfweH_z.js';
2
+ import * as react from 'react';
3
+ import { GlobalConfigProps } from '@jamsrui/core';
4
+ import '@jamsrui/utils';
5
+ import './styles.js';
6
+ import 'tailwind-variants';
7
+ import './switch-description.js';
8
+ import './switch-label.js';
9
+ import './switch-thumb.js';
10
+ import './switch-track.js';
11
+ import './switch-wrapper.js';
12
+ import './swith-content.js';
13
+ import './swith-error-message.js';
14
+
15
+ declare const useSwitchConfig: () => SwitchConfig.Props;
16
+ declare const SwitchConfig: (props: SwitchConfig.Props & {
17
+ merge?: boolean;
18
+ }) => react.JSX.Element;
19
+ declare namespace SwitchConfig {
20
+ interface Props extends Switch.Props, GlobalConfigProps<Switch.Props> {
21
+ }
22
+ }
23
+
24
+ export { SwitchConfig, useSwitchConfig };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkD3VTNGLCjs = require('./chunk-D3VTNGLC.js');exports.SwitchConfig = _chunkD3VTNGLCjs.a; exports.useSwitchConfig = _chunkD3VTNGLCjs.b;
@@ -0,0 +1 @@
1
+ import{a,b}from"./chunk-IGNAWQUV.mjs";export{a as SwitchConfig,b as useSwitchConfig};
@@ -0,0 +1,21 @@
1
+ import * as react from 'react';
2
+ import { u as useSwitch } from './switch-CzNIU3Zv.mjs';
3
+ import '@jamsrui/utils';
4
+ import './styles.mjs';
5
+ import 'tailwind-variants';
6
+ import './switch-description.mjs';
7
+ import './switch-label.mjs';
8
+ import './switch-thumb.mjs';
9
+ import './switch-track.mjs';
10
+ import './switch-wrapper.mjs';
11
+ import './swith-content.mjs';
12
+ import './swith-error-message.mjs';
13
+
14
+ declare const useSwitchContext: () => SwitchContext.Props;
15
+ declare const SwitchContext: react.Context<SwitchContext.Props | null>;
16
+ declare namespace SwitchContext {
17
+ interface Props extends ReturnType<typeof useSwitch> {
18
+ }
19
+ }
20
+
21
+ export { SwitchContext, useSwitchContext };
@@ -0,0 +1,21 @@
1
+ import * as react from 'react';
2
+ import { u as useSwitch } from './switch-rDfweH_z.js';
3
+ import '@jamsrui/utils';
4
+ import './styles.js';
5
+ import 'tailwind-variants';
6
+ import './switch-description.js';
7
+ import './switch-label.js';
8
+ import './switch-thumb.js';
9
+ import './switch-track.js';
10
+ import './switch-wrapper.js';
11
+ import './swith-content.js';
12
+ import './swith-error-message.js';
13
+
14
+ declare const useSwitchContext: () => SwitchContext.Props;
15
+ declare const SwitchContext: react.Context<SwitchContext.Props | null>;
16
+ declare namespace SwitchContext {
17
+ interface Props extends ReturnType<typeof useSwitch> {
18
+ }
19
+ }
20
+
21
+ export { SwitchContext, useSwitchContext };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk2LZJ7NTEjs = require('./chunk-2LZJ7NTE.js');exports.SwitchContext = _chunk2LZJ7NTEjs.a; exports.useSwitchContext = _chunk2LZJ7NTEjs.b;
@@ -0,0 +1 @@
1
+ import{a,b}from"./chunk-ZMFP3ZII.mjs";export{a as SwitchContext,b as useSwitchContext};
@@ -0,0 +1,10 @@
1
+ import * as react from 'react';
2
+ import { UIProps } from '@jamsrui/utils';
3
+
4
+ declare const SwitchDescription: (props: SwitchDescription.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
5
+ declare namespace SwitchDescription {
6
+ interface Props extends UIProps<"div"> {
7
+ }
8
+ }
9
+
10
+ export { SwitchDescription };
@@ -0,0 +1,10 @@
1
+ import * as react from 'react';
2
+ import { UIProps } from '@jamsrui/utils';
3
+
4
+ declare const SwitchDescription: (props: SwitchDescription.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
5
+ declare namespace SwitchDescription {
6
+ interface Props extends UIProps<"div"> {
7
+ }
8
+ }
9
+
10
+ export { SwitchDescription };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkBEV2H3POjs = require('./chunk-BEV2H3PO.js');require('./chunk-2LZJ7NTE.js');exports.SwitchDescription = _chunkBEV2H3POjs.a;
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-3TCAATGI.mjs";import"./chunk-ZMFP3ZII.mjs";export{a as SwitchDescription};
@@ -0,0 +1,10 @@
1
+ import * as react from 'react';
2
+ import { UIProps } from '@jamsrui/utils';
3
+
4
+ declare const SwitchLabel: (props: SwitchLabel.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | null;
5
+ declare namespace SwitchLabel {
6
+ interface Props extends UIProps<"label"> {
7
+ }
8
+ }
9
+
10
+ export { SwitchLabel };
@@ -0,0 +1,10 @@
1
+ import * as react from 'react';
2
+ import { UIProps } from '@jamsrui/utils';
3
+
4
+ declare const SwitchLabel: (props: SwitchLabel.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | null;
5
+ declare namespace SwitchLabel {
6
+ interface Props extends UIProps<"label"> {
7
+ }
8
+ }
9
+
10
+ export { SwitchLabel };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkDHSJ6D3Yjs = require('./chunk-DHSJ6D3Y.js');require('./chunk-2LZJ7NTE.js');exports.SwitchLabel = _chunkDHSJ6D3Yjs.a;
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-3QVJWFDR.mjs";import"./chunk-ZMFP3ZII.mjs";export{a as SwitchLabel};
@@ -0,0 +1,54 @@
1
+ import * as react from 'react';
2
+ import { PropGetter, UIProps, SlotsToClassNames } from '@jamsrui/utils';
3
+ import { SwitchVariants, SwitchSlots } from './styles.js';
4
+ import { SwitchDescription } from './switch-description.js';
5
+ import { SwitchLabel } from './switch-label.js';
6
+ import { SwitchThumb } from './switch-thumb.js';
7
+ import { SwitchTrack } from './switch-track.js';
8
+ import { SwitchWrapper } from './switch-wrapper.js';
9
+ import { SwitchContent } from './swith-content.js';
10
+ import { SwitchErrorMessage } from './swith-error-message.js';
11
+
12
+ declare const useSwitch: (props: useSwitch.Props) => {
13
+ getRootProps: PropGetter<Switch.Props>;
14
+ getThumbProps: PropGetter<SwitchThumb.Props>;
15
+ getLabelProps: PropGetter<SwitchLabel.Props>;
16
+ getDescriptionProps: PropGetter<SwitchDescription.Props>;
17
+ getContentProps: PropGetter<SwitchContent.Props>;
18
+ getWrapperProps: PropGetter<SwitchWrapper.Props>;
19
+ getTrackProps: PropGetter<SwitchTrack.Props>;
20
+ getErrorMessageProps: PropGetter<SwitchErrorMessage.Props>;
21
+ label: string | undefined;
22
+ errorMessage: string | undefined;
23
+ hasContent: boolean;
24
+ };
25
+ declare namespace useSwitch {
26
+ interface Props extends SwitchVariants, UIProps<"div"> {
27
+ label?: string;
28
+ errorMessage?: string;
29
+ classNames?: SlotsToClassNames<SwitchSlots>;
30
+ slotProps?: {
31
+ track?: SwitchTrack.Props;
32
+ thumb?: SwitchThumb.Props;
33
+ label?: SwitchLabel.Props;
34
+ description?: SwitchDescription.Props;
35
+ content?: SwitchContent.Props;
36
+ wrapper?: SwitchWrapper.Props;
37
+ errorMessage?: SwitchErrorMessage.Props;
38
+ };
39
+ isReadonly?: boolean;
40
+ isDisabled?: boolean;
41
+ isChecked?: boolean;
42
+ onCheckedChange?: (value: boolean) => void;
43
+ defaultChecked?: boolean;
44
+ isInvalid?: boolean;
45
+ }
46
+ }
47
+
48
+ declare const Switch: (props: Switch.Props) => react.JSX.Element;
49
+ declare namespace Switch {
50
+ interface Props extends useSwitch.Props {
51
+ }
52
+ }
53
+
54
+ export { Switch as S, useSwitch as u };
@@ -0,0 +1,10 @@
1
+ import * as react from 'react';
2
+ import { UIProps } from '@jamsrui/utils';
3
+
4
+ declare const SwitchThumb: (props: SwitchThumb.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
5
+ declare namespace SwitchThumb {
6
+ interface Props extends UIProps<"div"> {
7
+ }
8
+ }
9
+
10
+ export { SwitchThumb };
@@ -0,0 +1,10 @@
1
+ import * as react from 'react';
2
+ import { UIProps } from '@jamsrui/utils';
3
+
4
+ declare const SwitchThumb: (props: SwitchThumb.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
5
+ declare namespace SwitchThumb {
6
+ interface Props extends UIProps<"div"> {
7
+ }
8
+ }
9
+
10
+ export { SwitchThumb };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkQ5HFLFKDjs = require('./chunk-Q5HFLFKD.js');require('./chunk-2LZJ7NTE.js');exports.SwitchThumb = _chunkQ5HFLFKDjs.a;
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-DDA54MYZ.mjs";import"./chunk-ZMFP3ZII.mjs";export{a as SwitchThumb};
@@ -0,0 +1,10 @@
1
+ import * as react from 'react';
2
+ import { UIProps } from '@jamsrui/utils';
3
+
4
+ declare const SwitchTrack: (props: SwitchTrack.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
5
+ declare namespace SwitchTrack {
6
+ interface Props extends UIProps<"button"> {
7
+ }
8
+ }
9
+
10
+ export { SwitchTrack };
@@ -0,0 +1,10 @@
1
+ import * as react from 'react';
2
+ import { UIProps } from '@jamsrui/utils';
3
+
4
+ declare const SwitchTrack: (props: SwitchTrack.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
5
+ declare namespace SwitchTrack {
6
+ interface Props extends UIProps<"button"> {
7
+ }
8
+ }
9
+
10
+ export { SwitchTrack };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZU4NB4BTjs = require('./chunk-ZU4NB4BT.js');require('./chunk-2LZJ7NTE.js');exports.SwitchTrack = _chunkZU4NB4BTjs.a;
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-HSHMMCEU.mjs";import"./chunk-ZMFP3ZII.mjs";export{a as SwitchTrack};
@@ -0,0 +1,10 @@
1
+ import * as react from 'react';
2
+ import { UIProps } from '@jamsrui/utils';
3
+
4
+ declare const SwitchWrapper: (props: SwitchWrapper.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
5
+ declare namespace SwitchWrapper {
6
+ interface Props extends UIProps<"div"> {
7
+ }
8
+ }
9
+
10
+ export { SwitchWrapper };
@@ -0,0 +1,10 @@
1
+ import * as react from 'react';
2
+ import { UIProps } from '@jamsrui/utils';
3
+
4
+ declare const SwitchWrapper: (props: SwitchWrapper.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
5
+ declare namespace SwitchWrapper {
6
+ interface Props extends UIProps<"div"> {
7
+ }
8
+ }
9
+
10
+ export { SwitchWrapper };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkW374VGMMjs = require('./chunk-W374VGMM.js');require('./chunk-2LZJ7NTE.js');exports.SwitchWrapper = _chunkW374VGMMjs.a;
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-6KHD65QK.mjs";import"./chunk-ZMFP3ZII.mjs";export{a as SwitchWrapper};
@@ -0,0 +1,12 @@
1
+ import 'react';
2
+ export { S as Switch } from './switch-CzNIU3Zv.mjs';
3
+ import '@jamsrui/utils';
4
+ import './styles.mjs';
5
+ import 'tailwind-variants';
6
+ import './switch-description.mjs';
7
+ import './switch-label.mjs';
8
+ import './switch-thumb.mjs';
9
+ import './switch-track.mjs';
10
+ import './switch-wrapper.mjs';
11
+ import './swith-content.mjs';
12
+ import './swith-error-message.mjs';
@@ -0,0 +1,12 @@
1
+ import 'react';
2
+ export { S as Switch } from './switch-rDfweH_z.js';
3
+ import '@jamsrui/utils';
4
+ import './styles.js';
5
+ import 'tailwind-variants';
6
+ import './switch-description.js';
7
+ import './switch-label.js';
8
+ import './switch-thumb.js';
9
+ import './switch-track.js';
10
+ import './switch-wrapper.js';
11
+ import './swith-content.js';
12
+ import './swith-error-message.js';
package/dist/switch.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkUP35U2LSjs = require('./chunk-UP35U2LS.js');require('./chunk-W374VGMM.js');require('./chunk-CABIUVTY.js');require('./chunk-CLFHT656.js');require('./chunk-XO5NKDV5.js');require('./chunk-TEP4KR32.js');require('./chunk-D3VTNGLC.js');require('./chunk-BEV2H3PO.js');require('./chunk-DHSJ6D3Y.js');require('./chunk-Q5HFLFKD.js');require('./chunk-ZU4NB4BT.js');require('./chunk-2LZJ7NTE.js');exports.Switch = _chunkUP35U2LSjs.a;
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-BUBGL4JZ.mjs";import"./chunk-6KHD65QK.mjs";import"./chunk-KK3YODKW.mjs";import"./chunk-MDPXI2FD.mjs";import"./chunk-OIF5SWKN.mjs";import"./chunk-BCSK4AAO.mjs";import"./chunk-IGNAWQUV.mjs";import"./chunk-3TCAATGI.mjs";import"./chunk-3QVJWFDR.mjs";import"./chunk-DDA54MYZ.mjs";import"./chunk-HSHMMCEU.mjs";import"./chunk-ZMFP3ZII.mjs";export{a as Switch};
@@ -0,0 +1,10 @@
1
+ import * as react from 'react';
2
+ import { UIProps } from '@jamsrui/utils';
3
+
4
+ declare const SwitchContent: (props: SwitchContent.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
5
+ declare namespace SwitchContent {
6
+ interface Props extends UIProps<"div"> {
7
+ }
8
+ }
9
+
10
+ export { SwitchContent };
@@ -0,0 +1,10 @@
1
+ import * as react from 'react';
2
+ import { UIProps } from '@jamsrui/utils';
3
+
4
+ declare const SwitchContent: (props: SwitchContent.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
5
+ declare namespace SwitchContent {
6
+ interface Props extends UIProps<"div"> {
7
+ }
8
+ }
9
+
10
+ export { SwitchContent };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkCABIUVTYjs = require('./chunk-CABIUVTY.js');require('./chunk-2LZJ7NTE.js');exports.SwitchContent = _chunkCABIUVTYjs.a;
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-KK3YODKW.mjs";import"./chunk-ZMFP3ZII.mjs";export{a as SwitchContent};
@@ -0,0 +1,10 @@
1
+ import * as react from 'react';
2
+ import { UIProps } from '@jamsrui/utils';
3
+
4
+ declare const SwitchErrorMessage: (props: SwitchErrorMessage.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
5
+ declare namespace SwitchErrorMessage {
6
+ interface Props extends UIProps<"span"> {
7
+ }
8
+ }
9
+
10
+ export { SwitchErrorMessage };
@@ -0,0 +1,10 @@
1
+ import * as react from 'react';
2
+ import { UIProps } from '@jamsrui/utils';
3
+
4
+ declare const SwitchErrorMessage: (props: SwitchErrorMessage.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
5
+ declare namespace SwitchErrorMessage {
6
+ interface Props extends UIProps<"span"> {
7
+ }
8
+ }
9
+
10
+ export { SwitchErrorMessage };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkCLFHT656js = require('./chunk-CLFHT656.js');require('./chunk-2LZJ7NTE.js');exports.SwitchErrorMessage = _chunkCLFHT656js.a;
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-MDPXI2FD.mjs";import"./chunk-ZMFP3ZII.mjs";export{a as SwitchErrorMessage};
@@ -0,0 +1,12 @@
1
+ import '@jamsrui/utils';
2
+ import './styles.mjs';
3
+ export { u as useSwitch } from './switch-CzNIU3Zv.mjs';
4
+ import './switch-description.mjs';
5
+ import './switch-label.mjs';
6
+ import './switch-thumb.mjs';
7
+ import './switch-track.mjs';
8
+ import './switch-wrapper.mjs';
9
+ import './swith-content.mjs';
10
+ import './swith-error-message.mjs';
11
+ import 'tailwind-variants';
12
+ import 'react';
@@ -0,0 +1,12 @@
1
+ import '@jamsrui/utils';
2
+ import './styles.js';
3
+ export { u as useSwitch } from './switch-rDfweH_z.js';
4
+ import './switch-description.js';
5
+ import './switch-label.js';
6
+ import './switch-thumb.js';
7
+ import './switch-track.js';
8
+ import './switch-wrapper.js';
9
+ import './swith-content.js';
10
+ import './swith-error-message.js';
11
+ import 'tailwind-variants';
12
+ import 'react';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkXO5NKDV5js = require('./chunk-XO5NKDV5.js');require('./chunk-TEP4KR32.js');exports.useSwitch = _chunkXO5NKDV5js.a;
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-OIF5SWKN.mjs";import"./chunk-BCSK4AAO.mjs";export{a as useSwitch};
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "@jamsrui/switch",
3
+ "version": "0.0.2",
4
+ "peerDependencies": {
5
+ "motion": ">=12",
6
+ "react": ">=19"
7
+ },
8
+ "dependencies": {
9
+ "@jamsrui/hooks": "^0.0.2",
10
+ "@jamsrui/core": "^0.0.2",
11
+ "@jamsrui/utils": "^0.0.2"
12
+ },
13
+ "exports": {
14
+ ".": {
15
+ "types": "./dist/index.d.ts",
16
+ "import": "./dist/index.mjs",
17
+ "require": "./dist/index.js"
18
+ }
19
+ },
20
+ "description": "A modern and beautiful Next.js UI components library.",
21
+ "keywords": [
22
+ "react",
23
+ "ui",
24
+ "UI components",
25
+ "Next.js",
26
+ "React",
27
+ "JamsrUI",
28
+ "jamsr-ui",
29
+ "TypeScript"
30
+ ],
31
+ "sideEffects": false,
32
+ "license": "MIT",
33
+ "author": "@jamsrworld",
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "https://github.com/jamsrworld/jamsr-ui"
37
+ },
38
+ "bugs": {
39
+ "url": "https://github.com/jamsrworld/jamsr-ui/issues"
40
+ },
41
+ "homepage": "https://jamsr-ui.jamsrworld.com",
42
+ "files": [
43
+ "dist",
44
+ "README",
45
+ "README.md",
46
+ "package.json",
47
+ "LICENSE"
48
+ ]
49
+ }