@jarllyng/nostromo 3.9.0 → 3.11.0
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/README.md +1 -1
- package/dist/animations.css +29 -1
- package/dist/chunk-27UORO2F.cjs +3 -0
- package/dist/chunk-27UORO2F.cjs.map +1 -0
- package/dist/chunk-BDRP7ALG.cjs +3 -0
- package/dist/chunk-BDRP7ALG.cjs.map +1 -0
- package/dist/chunk-BJPJB6IA.cjs +3 -0
- package/dist/chunk-BJPJB6IA.cjs.map +1 -0
- package/dist/chunk-K45ZUJ42.js +3 -0
- package/dist/chunk-K45ZUJ42.js.map +1 -0
- package/dist/{chunk-WW2DDHCI.js → chunk-KR6IVHNR.js} +2 -2
- package/dist/{chunk-WW2DDHCI.js.map → chunk-KR6IVHNR.js.map} +1 -1
- package/dist/chunk-MINSU2YF.js +3 -0
- package/dist/chunk-MINSU2YF.js.map +1 -0
- package/dist/chunk-NM5NVIAK.js +3 -0
- package/dist/chunk-NM5NVIAK.js.map +1 -0
- package/dist/{chunk-MLJZU63I.cjs → chunk-YLAUFUIS.cjs} +2 -2
- package/dist/{chunk-MLJZU63I.cjs.map → chunk-YLAUFUIS.cjs.map} +1 -1
- package/dist/components/core/alert.d.cts +1 -1
- package/dist/components/core/alert.d.ts +1 -1
- package/dist/components/core/badge.d.cts +1 -1
- package/dist/components/core/badge.d.ts +1 -1
- package/dist/components/core/breadcrumb.d.cts +1 -1
- package/dist/components/core/breadcrumb.d.ts +1 -1
- package/dist/components/core/button.d.cts +2 -2
- package/dist/components/core/button.d.ts +2 -2
- package/dist/components/core/carousel.cjs +3 -0
- package/dist/components/core/carousel.cjs.map +1 -0
- package/dist/components/core/carousel.d.cts +71 -0
- package/dist/components/core/carousel.d.ts +71 -0
- package/dist/components/core/carousel.js +3 -0
- package/dist/components/core/carousel.js.map +1 -0
- package/dist/components/core/checkbox.d.cts +1 -1
- package/dist/components/core/checkbox.d.ts +1 -1
- package/dist/components/core/dialog.d.cts +1 -1
- package/dist/components/core/dialog.d.ts +1 -1
- package/dist/components/core/error-message.d.cts +1 -1
- package/dist/components/core/error-message.d.ts +1 -1
- package/dist/components/core/form.cjs +3 -0
- package/dist/components/core/form.cjs.map +1 -0
- package/dist/components/core/form.d.cts +90 -0
- package/dist/components/core/form.d.ts +90 -0
- package/dist/components/core/form.js +3 -0
- package/dist/components/core/form.js.map +1 -0
- package/dist/components/core/helper-text.d.cts +1 -1
- package/dist/components/core/helper-text.d.ts +1 -1
- package/dist/components/core/icon.d.cts +2 -2
- package/dist/components/core/icon.d.ts +2 -2
- package/dist/components/core/input-otp.cjs +3 -0
- package/dist/components/core/input-otp.cjs.map +1 -0
- package/dist/components/core/input-otp.d.cts +50 -0
- package/dist/components/core/input-otp.d.ts +50 -0
- package/dist/components/core/input-otp.js +3 -0
- package/dist/components/core/input-otp.js.map +1 -0
- package/dist/components/core/input.d.cts +1 -1
- package/dist/components/core/input.d.ts +1 -1
- package/dist/components/core/label.d.cts +1 -1
- package/dist/components/core/label.d.ts +1 -1
- package/dist/components/core/pagination.d.cts +1 -1
- package/dist/components/core/pagination.d.ts +1 -1
- package/dist/components/core/progress.d.cts +3 -3
- package/dist/components/core/progress.d.ts +3 -3
- package/dist/components/core/radio-group.cjs +1 -1
- package/dist/components/core/radio-group.d.cts +2 -2
- package/dist/components/core/radio-group.d.ts +2 -2
- package/dist/components/core/radio-group.js +1 -1
- package/dist/components/core/resizable.cjs +3 -0
- package/dist/components/core/resizable.cjs.map +1 -0
- package/dist/components/core/resizable.d.cts +362 -0
- package/dist/components/core/resizable.d.ts +362 -0
- package/dist/components/core/resizable.js +3 -0
- package/dist/components/core/resizable.js.map +1 -0
- package/dist/components/core/select.d.cts +3 -3
- package/dist/components/core/select.d.ts +3 -3
- package/dist/components/core/skeleton.d.cts +1 -1
- package/dist/components/core/skeleton.d.ts +1 -1
- package/dist/components/core/switch.d.cts +1 -1
- package/dist/components/core/switch.d.ts +1 -1
- package/dist/components/core/textarea.d.cts +1 -1
- package/dist/components/core/textarea.d.ts +1 -1
- package/dist/components/core/toast.d.cts +2 -2
- package/dist/components/core/toast.d.ts +2 -2
- package/dist/components/core/tooltip.d.cts +2 -2
- package/dist/components/core/tooltip.d.ts +2 -2
- package/dist/components/marketing/features.d.cts +2 -2
- package/dist/components/marketing/features.d.ts +2 -2
- package/dist/components/marketing/gallery.d.cts +1 -1
- package/dist/components/marketing/gallery.d.ts +1 -1
- package/dist/components/marketing/pricing.d.cts +1 -1
- package/dist/components/marketing/pricing.d.ts +1 -1
- package/dist/components/marketing/testimonials.d.cts +1 -1
- package/dist/components/marketing/testimonials.d.ts +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +471 -150
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Accessible React component library with CSS-first Tailwind v4 theming.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
53 components, 47 for products and apps and 6 for marketing pages, themed entirely
|
|
6
6
|
through CSS custom properties. No `tailwind.config.js`, no plugin to register.
|
|
7
7
|
|
|
8
8
|
The name comes from the _USCSS Nostromo_ in **Alien** (1979).
|
package/dist/animations.css
CHANGED
|
@@ -133,12 +133,40 @@
|
|
|
133
133
|
ease-out;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
+
/**
|
|
137
|
+
* The fake caret in InputOTP.
|
|
138
|
+
*
|
|
139
|
+
* The real input is transparent and off to the side, so its own caret is not
|
|
140
|
+
* visible in the slot the user is typing into. This draws one.
|
|
141
|
+
*
|
|
142
|
+
* Not wired to `--nostromo-animate-duration`. That token is around 150ms because
|
|
143
|
+
* it times enter and exit transitions; a caret blinking six times a second is
|
|
144
|
+
* not a themeable preference, it is a bug. 1s is the platform convention.
|
|
145
|
+
*/
|
|
146
|
+
@keyframes nostromo-caret-blink {
|
|
147
|
+
0%,
|
|
148
|
+
70%,
|
|
149
|
+
100% {
|
|
150
|
+
opacity: 1;
|
|
151
|
+
}
|
|
152
|
+
20%,
|
|
153
|
+
50% {
|
|
154
|
+
opacity: 0;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
@utility animate-caret-blink {
|
|
159
|
+
animation: nostromo-caret-blink 1s ease-out infinite;
|
|
160
|
+
}
|
|
161
|
+
|
|
136
162
|
/* Respect the user's setting. Every animation above is decorative. */
|
|
137
163
|
@media (prefers-reduced-motion: reduce) {
|
|
138
164
|
.animate-in,
|
|
139
165
|
.animate-out,
|
|
140
166
|
.animate-collapsible-down,
|
|
141
|
-
.animate-collapsible-up
|
|
167
|
+
.animate-collapsible-up,
|
|
168
|
+
/* A caret that stays put is still a caret, and is the better default here. */
|
|
169
|
+
.animate-caret-blink {
|
|
142
170
|
animation: none;
|
|
143
171
|
}
|
|
144
172
|
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';var chunkITRGJNWL_cjs=require('./chunk-ITRGJNWL.cjs'),e=require('react'),a=require('react-resizable-panels'),phosphorReact=require('phosphor-react');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var e__namespace=/*#__PURE__*/_interopNamespace(e);var a__namespace=/*#__PURE__*/_interopNamespace(a);var s=e__namespace.forwardRef(({className:i,...r},t)=>e__namespace.createElement(a__namespace.Group,{elementRef:t,className:chunkITRGJNWL_cjs.a(i),...r}));s.displayName="ResizablePanelGroup";var f=e__namespace.forwardRef(({...i},r)=>e__namespace.createElement(a__namespace.Panel,{elementRef:r,...i}));f.displayName="ResizablePanel";var m=e__namespace.forwardRef(({withHandle:i,className:r,...t},n)=>e__namespace.createElement(a__namespace.Separator,{elementRef:n,className:chunkITRGJNWL_cjs.a("relative flex w-px items-center justify-center bg-border","after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background","aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full","aria-[orientation=horizontal]:after:inset-x-0 aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:top-1/2 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:-translate-y-1/2 aria-[orientation=horizontal]:after:translate-x-0","[&[aria-orientation=horizontal]>div]:rotate-90",r),...t},i&&e__namespace.createElement("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border border-border bg-border"},e__namespace.createElement(phosphorReact.DotsSixVertical,{className:"h-3 w-3","aria-hidden":"true"}))));m.displayName="ResizableHandle";exports.a=s;exports.b=f;exports.c=m;//# sourceMappingURL=chunk-27UORO2F.cjs.map
|
|
3
|
+
//# sourceMappingURL=chunk-27UORO2F.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/core/resizable.tsx"],"names":["ResizablePanelGroup","e","className","props","ref","a","cn","ResizablePanel","ResizableHandle","withHandle","DotsSixVertical"],"mappings":"2jBAwCA,IAAMA,CAAAA,CAA4BC,wBAGhC,CAAC,CAAE,SAAA,CAAAC,CAAAA,CAAW,GAAGC,CAAM,EAAGC,CAAAA,GAC1BH,YAAA,CAAA,aAAA,CAAoBI,YAAA,CAAA,KAAA,CAAnB,CACC,UAAA,CAAYD,CAAAA,CACZ,UAAWE,mBAAAA,CAAGJ,CAAS,EACtB,GAAGC,CAAAA,CACN,CACD,EACDH,CAAAA,CAAoB,WAAA,CAAc,qBAAA,CAElC,IAAMO,CAAAA,CAAuBN,wBAG3B,CAAC,CAAE,GAAGE,CAAM,CAAA,CAAGC,CAAAA,GACfH,2BAAoBI,YAAA,CAAA,KAAA,CAAnB,CAAyB,UAAA,CAAYD,CAAAA,CAAM,GAAGD,CAAAA,CAAO,CACvD,EACDI,CAAAA,CAAe,YAAc,gBAAA,CAa7B,IAAMC,EAAwBP,YAAA,CAAA,UAAA,CAC5B,CAAC,CAAE,UAAA,CAAAQ,CAAAA,CAAY,SAAA,CAAAP,EAAW,GAAGC,CAAM,CAAA,CAAGC,CAAAA,GACpCH,YAAA,CAAA,aAAA,CAAoBI,YAAA,CAAA,SAAA,CAAnB,CACC,UAAA,CAAYD,CAAAA,CACZ,SAAA,CAAWE,mBAAAA,CACT,0DAAA,CAGA,gFAAA,CACA,2IACA,yEAAA,CACA,gUAAA,CACA,iDACAJ,CACF,CAAA,CACC,GAAGC,CAAAA,CAAAA,CAEHM,CAAAA,EACCR,YAAA,CAAA,aAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,yFAAA,CAAA,CACbA,2BAACS,6BAAAA,CAAA,CAAgB,SAAA,CAAU,SAAA,CAAU,aAAA,CAAY,MAAA,CAAO,CAC1D,CAEJ,CAEJ,EACAF,CAAAA,CAAgB,WAAA,CAAc,iBAAA","file":"chunk-27UORO2F.cjs","sourcesContent":["import * as React from \"react\";\nimport * as ResizablePrimitive from \"react-resizable-panels\";\nimport { DotsSixVertical } from \"phosphor-react\";\n\nimport { cn } from \"../../lib/utils\";\n\n/**\n * Panels the user can resize by dragging the divider between them: a file tree\n * next to an editor, a list next to a preview.\n *\n * Thin wrappers over react-resizable-panels, which owns the sizing, the pointer\n * and keyboard handling, and the ARIA on the divider. Only the look is ours.\n *\n * ## The group sizes itself, so size its parent\n *\n * The group sets `display`, `flex-direction`, `width: 100%` and `height: 100%`\n * as *inline* styles. Inline styles beat classes, so `className=\"h-96\"` on the\n * group does nothing at all - a silent no-op, which is why it is written down\n * here. Put the height on the element around the group, or pass\n * `style={{ height: \"24rem\" }}`, which merges with the library's own.\n *\n * For the same reason there are no layout classes on `ResizablePanelGroup`\n * below. `flex`, `w-full` and a flex-direction switch would all be overridden\n * by the inline styles, and dead classes are worse than none.\n *\n * ## `aria-orientation` on the divider is the divider's own axis\n *\n * A horizontal group - panels side by side - has a *vertical* divider, so it\n * reports `aria-orientation=\"vertical\"`. The styling below reads it that way\n * round: the default is a vertical hairline, and the `aria-[orientation=\n * horizontal]` variants flip it to a horizontal one.\n *\n * ## A class on a panel lands on an inner element\n *\n * `ResizablePanel` renders a wrapper that the library controls with flex, and\n * puts `className` on a child inside it. That is deliberate on their side: it\n * keeps padding and borders from fighting the flex sizing. It does mean a\n * background on a panel paints the inner box, which is what you want anyway.\n */\n\nconst ResizablePanelGroup = React.forwardRef<\n HTMLDivElement,\n ResizablePrimitive.GroupProps\n>(({ className, ...props }, ref) => (\n <ResizablePrimitive.Group\n elementRef={ref}\n className={cn(className)}\n {...props}\n />\n));\nResizablePanelGroup.displayName = \"ResizablePanelGroup\";\n\nconst ResizablePanel = React.forwardRef<\n HTMLDivElement,\n ResizablePrimitive.PanelProps\n>(({ ...props }, ref) => (\n <ResizablePrimitive.Panel elementRef={ref} {...props} />\n));\nResizablePanel.displayName = \"ResizablePanel\";\n\nexport interface ResizableHandleProps\n extends ResizablePrimitive.SeparatorProps {\n /**\n * Draw a grip on the divider.\n *\n * A one-pixel line is a small target and gives no hint that it can be\n * dragged. The grip is worth it anywhere the divider is not obvious.\n */\n withHandle?: boolean;\n}\n\nconst ResizableHandle = React.forwardRef<HTMLDivElement, ResizableHandleProps>(\n ({ withHandle, className, ...props }, ref) => (\n <ResizablePrimitive.Separator\n elementRef={ref}\n className={cn(\n \"relative flex w-px items-center justify-center bg-border\",\n // A 1px line is a 1px hit area. This widens the grab zone without\n // moving the panels, which is why it is a pseudo-element.\n \"after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background\",\n \"aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full\",\n \"aria-[orientation=horizontal]:after:inset-x-0 aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:top-1/2 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:-translate-y-1/2 aria-[orientation=horizontal]:after:translate-x-0\",\n \"[&[aria-orientation=horizontal]>div]:rotate-90\",\n className,\n )}\n {...props}\n >\n {withHandle && (\n <div className=\"z-10 flex h-4 w-3 items-center justify-center rounded-sm border border-border bg-border\">\n <DotsSixVertical className=\"h-3 w-3\" aria-hidden=\"true\" />\n </div>\n )}\n </ResizablePrimitive.Separator>\n ),\n);\nResizableHandle.displayName = \"ResizableHandle\";\n\nexport { ResizablePanelGroup, ResizablePanel, ResizableHandle };\n"]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';var chunk5PVFLXPO_cjs=require('./chunk-5PVFLXPO.cjs'),chunkITRGJNWL_cjs=require('./chunk-ITRGJNWL.cjs'),e=require('react'),E=require('embla-carousel-react'),phosphorReact=require('phosphor-react');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var e__namespace=/*#__PURE__*/_interopNamespace(e);var E__default=/*#__PURE__*/_interopDefault(E);var x=e__namespace.createContext(null);function m(){let t=e__namespace.useContext(x);if(!t)throw new Error("useCarousel must be used inside a <Carousel>.");return t}function L(t){if(!(t instanceof HTMLElement))return false;if(t.isContentEditable)return true;let r=t.tagName;return r==="INPUT"||r==="TEXTAREA"||r==="SELECT"}var k=e__namespace.forwardRef(({orientation:t="horizontal",opts:r,setApi:a,plugins:s,className:n,children:c,...f},d)=>{let[i,o]=E__default.default({...r,axis:t==="horizontal"?"x":"y"},s),b=e__namespace.useCallback(l=>o?(o.on("select",l),o.on("reInit",l),()=>{o.off("select",l),o.off("reInit",l);}):()=>{},[o]),y=e__namespace.useSyncExternalStore(b,()=>o?.canScrollPrev()??false,()=>false),h=e__namespace.useSyncExternalStore(b,()=>o?.canScrollNext()??false,()=>false),p=e__namespace.useCallback(()=>o?.scrollPrev(),[o]),C=e__namespace.useCallback(()=>o?.scrollNext(),[o]),R=e__namespace.useCallback(l=>{if(L(l.target))return;let[N,w]=t==="horizontal"?["ArrowLeft","ArrowRight"]:["ArrowUp","ArrowDown"];l.key===N?(l.preventDefault(),p()):l.key===w&&(l.preventDefault(),C());},[t,p,C]);e__namespace.useEffect(()=>{!o||!a||a(o);},[o,a]);let P=e__namespace.useMemo(()=>({carouselRef:i,api:o,opts:r,plugins:s,orientation:t,scrollPrev:p,scrollNext:C,canScrollPrev:y,canScrollNext:h}),[i,o,r,s,t,p,C,y,h]);return e__namespace.createElement(x.Provider,{value:P},e__namespace.createElement("div",{ref:d,onKeyDownCapture:R,className:chunkITRGJNWL_cjs.a("relative focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",n),role:"region","aria-roledescription":"carousel",tabIndex:0,...f},c))});k.displayName="Carousel";var M=e__namespace.forwardRef(({className:t,...r},a)=>{let{carouselRef:s,orientation:n}=m();return e__namespace.createElement("div",{ref:s,className:"overflow-hidden"},e__namespace.createElement("div",{ref:a,className:chunkITRGJNWL_cjs.a("flex",n==="horizontal"?"-ml-4":"-mt-4 flex-col",t),...r}))});M.displayName="CarouselContent";var A=e__namespace.forwardRef(({className:t,...r},a)=>{let{orientation:s}=m();return e__namespace.createElement("div",{ref:a,role:"group","aria-roledescription":"slide",className:chunkITRGJNWL_cjs.a("min-w-0 shrink-0 grow-0 basis-full",s==="horizontal"?"pl-4":"pt-4",t),...r})});A.displayName="CarouselItem";var H=e__namespace.forwardRef(({className:t,variant:r="outline",size:a="icon",label:s="Previous slide",...n},c)=>{let{orientation:f,scrollPrev:d,canScrollPrev:i}=m();return e__namespace.createElement(chunk5PVFLXPO_cjs.b,{ref:c,variant:r,size:a,className:chunkITRGJNWL_cjs.a("absolute h-8 w-8 rounded-full",f==="horizontal"?"-left-12 top-1/2 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",t),disabled:!i,onClick:d,...n},e__namespace.createElement(phosphorReact.CaretLeft,{className:"h-4 w-4","aria-hidden":"true"}),e__namespace.createElement("span",{className:"sr-only"},s))});H.displayName="CarouselPrevious";var D=e__namespace.forwardRef(({className:t,variant:r="outline",size:a="icon",label:s="Next slide",...n},c)=>{let{orientation:f,scrollNext:d,canScrollNext:i}=m();return e__namespace.createElement(chunk5PVFLXPO_cjs.b,{ref:c,variant:r,size:a,className:chunkITRGJNWL_cjs.a("absolute h-8 w-8 rounded-full",f==="horizontal"?"-right-12 top-1/2 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",t),disabled:!i,onClick:d,...n},e__namespace.createElement(phosphorReact.CaretRight,{className:"h-4 w-4","aria-hidden":"true"}),e__namespace.createElement("span",{className:"sr-only"},s))});D.displayName="CarouselNext";exports.a=m;exports.b=k;exports.c=M;exports.d=A;exports.e=H;exports.f=D;//# sourceMappingURL=chunk-BDRP7ALG.cjs.map
|
|
3
|
+
//# sourceMappingURL=chunk-BDRP7ALG.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/core/carousel.tsx"],"names":["CarouselContext","e","useCarousel","context","isTextEntry","target","tag","Carousel","orientation","opts","setApi","plugins","className","children","props","ref","carouselRef","api","useEmblaCarousel","subscribe","onStoreChange","canScrollPrev","canScrollNext","scrollPrev","scrollNext","handleKeyDown","event","back","forward","value","cn","CarouselContent","CarouselItem","CarouselPrevious","variant","size","label","Button","CaretLeft","CarouselNext","CaretRight"],"mappings":"wqBAwDA,IAAMA,EAAwBC,YAA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,uBAAAA,CAAA,CAAU,SAAA,CAAU,SAAA,CAAU,aAAA,CAAY,OAAO,CAAA,CAClDrC,YAAA,CAAA,aAAA,CAAC,MAAA,CAAA,CAAK,SAAA,CAAU,SAAA,CAAA,CAAWmC,CAAM,CACnC,CAEJ,CACF,EACAH,CAAAA,CAAiB,WAAA,CAAc,kBAAA,CAE/B,IAAMM,CAAAA,CAAqBtC,YAAA,CAAA,UAAA,CACzB,CACE,CACE,SAAA,CAAAW,CAAAA,CACA,OAAA,CAAAsB,CAAAA,CAAU,SAAA,CACV,IAAA,CAAAC,CAAAA,CAAO,MAAA,CACP,KAAA,CAAAC,CAAAA,CAAQ,YAAA,CACR,GAAGtB,CACL,CAAA,CACAC,CAAAA,GACG,CACH,GAAM,CAAE,WAAA,CAAAP,CAAAA,CAAa,UAAA,CAAAgB,CAAAA,CAAY,aAAA,CAAAF,CAAc,CAAA,CAAIpB,GAAY,CAC/D,OACED,YAAA,CAAA,aAAA,CAACoC,mBAAAA,CAAA,CACC,GAAA,CAAKtB,CAAAA,CACL,OAAA,CAASmB,EACT,IAAA,CAAMC,CAAAA,CACN,SAAA,CAAWL,mBAAAA,CACT,+BAAA,CACAtB,CAAAA,GAAgB,YAAA,CACZ,oCAAA,CACA,iDACJI,CACF,CAAA,CACA,QAAA,CAAU,CAACU,CAAAA,CACX,OAAA,CAASE,CAAAA,CACR,GAAGV,GAEJb,YAAA,CAAA,aAAA,CAACuC,wBAAAA,CAAA,CAAW,SAAA,CAAU,SAAA,CAAU,aAAA,CAAY,MAAA,CAAO,CAAA,CACnDvC,2BAAC,MAAA,CAAA,CAAK,SAAA,CAAU,SAAA,CAAA,CAAWmC,CAAM,CACnC,CAEJ,CACF,EACAG,EAAa,WAAA,CAAc,cAAA","file":"chunk-BDRP7ALG.cjs","sourcesContent":["import * as React from \"react\";\nimport useEmblaCarousel, {\n type UseEmblaCarouselType,\n} from \"embla-carousel-react\";\nimport { CaretLeft, CaretRight } from \"phosphor-react\";\n\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"./button\";\n\n/**\n * A horizontal or vertical strip of slides that snaps as you drag it.\n *\n * Embla does the measuring, the dragging and the snapping. This file is the\n * markup, the styling and the roles, plus the two buttons.\n *\n * ## `orientation` is the only axis control\n *\n * Embla takes `axis: \"x\" | \"y\"`, and this component derives it from\n * `orientation`, because the padding on `CarouselItem` and the placement of the\n * two buttons have to agree with it. Setting `opts={{ axis: \"y\" }}` will not\n * work: `orientation` overwrites it. One control, so the styling cannot drift\n * out of sync with the behaviour.\n *\n * ## Anything beyond next and previous goes through `setApi`\n *\n * Dots, autoplay, a progress bar, \"slide 3 of 7\" - all of that reads state\n * embla owns, and wrapping each one would mean guessing which you want. `setApi`\n * hands you the embla instance instead, and its `on(\"select\")` event is the hook\n * for the rest.\n */\n\ntype CarouselApi = UseEmblaCarouselType[1];\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>;\ntype CarouselOptions = UseCarouselParameters[0];\ntype CarouselPlugin = UseCarouselParameters[1];\n\ninterface CarouselProps {\n /** Embla options. `axis` is ignored - use `orientation`. */\n opts?: CarouselOptions;\n /** Embla plugins, for example autoplay. */\n plugins?: CarouselPlugin;\n orientation?: \"horizontal\" | \"vertical\";\n /** Receives the embla instance, for dots, autoplay or a slide counter. */\n setApi?: (api: CarouselApi) => void;\n}\n\ninterface CarouselContextValue extends CarouselProps {\n carouselRef: UseEmblaCarouselType[0];\n api: CarouselApi;\n scrollPrev: () => void;\n scrollNext: () => void;\n canScrollPrev: boolean;\n canScrollNext: boolean;\n orientation: \"horizontal\" | \"vertical\";\n}\n\nconst CarouselContext = React.createContext<CarouselContextValue | null>(null);\n\nfunction useCarousel() {\n const context = React.useContext(CarouselContext);\n if (!context) {\n throw new Error(\"useCarousel must be used inside a <Carousel>.\");\n }\n return context;\n}\n\n/** Arrow keys mean \"move the caret\" inside a text field, not \"change slide\". */\nfunction isTextEntry(target: EventTarget | null): boolean {\n if (!(target instanceof HTMLElement)) return false;\n if (target.isContentEditable) return true;\n const tag = target.tagName;\n return tag === \"INPUT\" || tag === \"TEXTAREA\" || tag === \"SELECT\";\n}\n\nconst Carousel = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & CarouselProps\n>(\n (\n {\n orientation = \"horizontal\",\n opts,\n setApi,\n plugins,\n className,\n children,\n ...props\n },\n ref,\n ) => {\n const [carouselRef, api] = useEmblaCarousel(\n { ...opts, axis: orientation === \"horizontal\" ? \"x\" : \"y\" },\n plugins,\n );\n // Whether there is anywhere to scroll lives in embla, not here, so it is\n // read rather than mirrored. An effect that copied it into state would\n // render once with both buttons wrongly disabled before the effect ran, and\n // would set state synchronously inside an effect, which is a cascading\n // render. Subscribing is both correct and simpler.\n const subscribe = React.useCallback(\n (onStoreChange: () => void) => {\n if (!api) return () => {};\n api.on(\"select\", onStoreChange);\n api.on(\"reInit\", onStoreChange);\n return () => {\n api.off(\"select\", onStoreChange);\n api.off(\"reInit\", onStoreChange);\n };\n },\n [api],\n );\n const canScrollPrev = React.useSyncExternalStore(\n subscribe,\n () => api?.canScrollPrev() ?? false,\n () => false,\n );\n const canScrollNext = React.useSyncExternalStore(\n subscribe,\n () => api?.canScrollNext() ?? false,\n () => false,\n );\n\n const scrollPrev = React.useCallback(() => api?.scrollPrev(), [api]);\n const scrollNext = React.useCallback(() => api?.scrollNext(), [api]);\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (isTextEntry(event.target)) return;\n const [back, forward] =\n orientation === \"horizontal\"\n ? [\"ArrowLeft\", \"ArrowRight\"]\n : [\"ArrowUp\", \"ArrowDown\"];\n if (event.key === back) {\n event.preventDefault();\n scrollPrev();\n } else if (event.key === forward) {\n event.preventDefault();\n scrollNext();\n }\n },\n [orientation, scrollPrev, scrollNext],\n );\n\n React.useEffect(() => {\n if (!api || !setApi) return;\n setApi(api);\n }, [api, setApi]);\n\n const value = React.useMemo(\n () => ({\n carouselRef,\n api,\n opts,\n plugins,\n orientation,\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n }),\n [\n carouselRef,\n api,\n opts,\n plugins,\n orientation,\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n ],\n );\n\n return (\n <CarouselContext.Provider value={value}>\n <div\n ref={ref}\n onKeyDownCapture={handleKeyDown}\n className={cn(\n \"relative focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\",\n className,\n )}\n role=\"region\"\n aria-roledescription=\"carousel\"\n // A tab stop, so the arrow keys below are actually reachable. Without\n // it this div can never hold focus, the handler only ever fires for\n // keys pressed on something inside it, and a keyboard user tabbing\n // through the page gets the two buttons and no way to reach the\n // slides. Pass your own tabIndex to opt out.\n tabIndex={0}\n {...props}\n >\n {children}\n </div>\n </CarouselContext.Provider>\n );\n },\n);\nCarousel.displayName = \"Carousel\";\n\n/**\n * The viewport and the track.\n *\n * Two elements rather than one: embla measures the outer one, which must clip,\n * and translates the inner one. The negative margin pairs with the padding on\n * `CarouselItem` so the gap between slides does not show up as an edge inset.\n */\nconst CarouselContent = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => {\n const { carouselRef, orientation } = useCarousel();\n return (\n <div ref={carouselRef} className=\"overflow-hidden\">\n <div\n ref={ref}\n className={cn(\n \"flex\",\n orientation === \"horizontal\" ? \"-ml-4\" : \"-mt-4 flex-col\",\n className,\n )}\n {...props}\n />\n </div>\n );\n});\nCarouselContent.displayName = \"CarouselContent\";\n\nconst CarouselItem = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => {\n const { orientation } = useCarousel();\n return (\n <div\n ref={ref}\n role=\"group\"\n aria-roledescription=\"slide\"\n className={cn(\n \"min-w-0 shrink-0 grow-0 basis-full\",\n orientation === \"horizontal\" ? \"pl-4\" : \"pt-4\",\n className,\n )}\n {...props}\n />\n );\n});\nCarouselItem.displayName = \"CarouselItem\";\n\nexport interface CarouselButtonProps extends React.ComponentPropsWithoutRef<\n typeof Button\n> {\n /**\n * Screen-reader text for the button. The arrow is decorative, so this is the\n * button's only accessible name.\n */\n label?: string;\n}\n\nconst CarouselPrevious = React.forwardRef<\n HTMLButtonElement,\n CarouselButtonProps\n>(\n (\n {\n className,\n variant = \"outline\",\n size = \"icon\",\n label = \"Previous slide\",\n ...props\n },\n ref,\n ) => {\n const { orientation, scrollPrev, canScrollPrev } = useCarousel();\n return (\n <Button\n ref={ref}\n variant={variant}\n size={size}\n className={cn(\n \"absolute h-8 w-8 rounded-full\",\n orientation === \"horizontal\"\n ? \"-left-12 top-1/2 -translate-y-1/2\"\n : \"-top-12 left-1/2 -translate-x-1/2 rotate-90\",\n className,\n )}\n disabled={!canScrollPrev}\n onClick={scrollPrev}\n {...props}\n >\n <CaretLeft className=\"h-4 w-4\" aria-hidden=\"true\" />\n <span className=\"sr-only\">{label}</span>\n </Button>\n );\n },\n);\nCarouselPrevious.displayName = \"CarouselPrevious\";\n\nconst CarouselNext = React.forwardRef<HTMLButtonElement, CarouselButtonProps>(\n (\n {\n className,\n variant = \"outline\",\n size = \"icon\",\n label = \"Next slide\",\n ...props\n },\n ref,\n ) => {\n const { orientation, scrollNext, canScrollNext } = useCarousel();\n return (\n <Button\n ref={ref}\n variant={variant}\n size={size}\n className={cn(\n \"absolute h-8 w-8 rounded-full\",\n orientation === \"horizontal\"\n ? \"-right-12 top-1/2 -translate-y-1/2\"\n : \"-bottom-12 left-1/2 -translate-x-1/2 rotate-90\",\n className,\n )}\n disabled={!canScrollNext}\n onClick={scrollNext}\n {...props}\n >\n <CaretRight className=\"h-4 w-4\" aria-hidden=\"true\" />\n <span className=\"sr-only\">{label}</span>\n </Button>\n );\n },\n);\nCarouselNext.displayName = \"CarouselNext\";\n\nexport {\n Carousel,\n CarouselContent,\n CarouselItem,\n CarouselPrevious,\n CarouselNext,\n useCarousel,\n};\nexport type { CarouselApi, CarouselOptions, CarouselPlugin, CarouselProps };\n"]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';var chunkITRGJNWL_cjs=require('./chunk-ITRGJNWL.cjs'),e=require('react'),inputOtp=require('input-otp'),phosphorReact=require('phosphor-react');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var e__namespace=/*#__PURE__*/_interopNamespace(e);var f=e__namespace.forwardRef((t,r)=>e__namespace.createElement(inputOtp.OTPInput,{...t,ref:r,containerClassName:chunkITRGJNWL_cjs.a("flex items-center gap-2 has-[:disabled]:opacity-50",t.containerClassName),className:chunkITRGJNWL_cjs.a("disabled:cursor-not-allowed",t.className)}));f.displayName="InputOTP";var T=e__namespace.forwardRef(({className:t,...r},a)=>e__namespace.createElement("div",{ref:a,className:chunkITRGJNWL_cjs.a("flex items-center",t),...r}));T.displayName="InputOTPGroup";var P=e__namespace.forwardRef(({index:t,className:r,...a},i)=>{let s=e__namespace.useContext(inputOtp.OTPInputContext);if(!s?.slots)throw new Error("InputOTPSlot must be used inside an <InputOTP>.");let o=s.slots[t];if(!o)throw new Error(`InputOTPSlot index ${t} is outside the code. maxLength is ${s.slots.length}, so the last index is ${s.slots.length-1}.`);let{char:d,hasFakeCaret:l,isActive:u}=o;return e__namespace.createElement("div",{ref:i,"aria-hidden":"true","data-active":u,className:chunkITRGJNWL_cjs.a("relative flex h-10 w-10 items-center justify-center border-y border-r border-input text-sm transition-all","first:rounded-l-md first:border-l last:rounded-r-md","data-[active=true]:z-10 data-[active=true]:border-ring data-[active=true]:ring-2 data-[active=true]:ring-ring/20",r),...a},d,l&&e__namespace.createElement("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center"},e__namespace.createElement("div",{className:"h-5 w-px animate-caret-blink bg-foreground"})))});P.displayName="InputOTPSlot";var v=e__namespace.forwardRef(({className:t,...r},a)=>e__namespace.createElement("div",{ref:a,"aria-hidden":"true",className:chunkITRGJNWL_cjs.a("text-muted-foreground",t),...r},e__namespace.createElement(phosphorReact.Minus,{className:"h-4 w-4"})));v.displayName="InputOTPSeparator";exports.a=f;exports.b=T;exports.c=P;exports.d=v;//# sourceMappingURL=chunk-BJPJB6IA.cjs.map
|
|
3
|
+
//# sourceMappingURL=chunk-BJPJB6IA.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/core/input-otp.tsx"],"names":["InputOTP","e","props","ref","OTPInput","cn","InputOTPGroup","className","InputOTPSlot","index","context","OTPInputContext","slot","char","hasFakeCaret","isActive","InputOTPSeparator","Minus"],"mappings":"kgBAsCA,IAAMA,EAAiBC,YAAA,CAAA,UAAA,CACrB,CAACC,EAAOC,CAAAA,GACNF,YAAA,CAAA,aAAA,CAACG,iBAAAA,CAAA,CACE,GAAGF,CAAAA,CACJ,IAAKC,CAAAA,CACL,kBAAA,CAAoBE,oBAClB,oDAAA,CACAH,CAAAA,CAAM,kBACR,CAAA,CACA,SAAA,CAAWG,mBAAAA,CAAG,6BAAA,CAA+BH,CAAAA,CAAM,SAAS,EAC9D,CAEJ,EACAF,EAAS,WAAA,CAAc,UAAA,KAQjBM,CAAAA,CAAsBL,YAAA,CAAA,UAAA,CAG1B,CAAC,CAAE,SAAA,CAAAM,CAAAA,CAAW,GAAGL,CAAM,CAAA,CAAGC,IAC1BF,YAAA,CAAA,aAAA,CAAC,KAAA,CAAA,CAAI,IAAKE,CAAAA,CAAK,SAAA,CAAWE,oBAAG,mBAAA,CAAqBE,CAAS,EAAI,GAAGL,CAAAA,CAAO,CAC1E,EACDI,CAAAA,CAAc,YAAc,eAAA,CAO5B,IAAME,CAAAA,CAAqBP,YAAA,CAAA,UAAA,CACzB,CAAC,CAAE,MAAAQ,CAAAA,CAAO,SAAA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CAAA,aAAA,CAACgB,oBAAA,CAAM,SAAA,CAAU,UAAU,CAC7B,CACD,EACDD,CAAAA,CAAkB,WAAA,CAAc,mBAAA","file":"chunk-BJPJB6IA.cjs","sourcesContent":["import * as React from \"react\";\nimport { OTPInput, OTPInputContext, type OTPInputProps } from \"input-otp\";\nimport { Minus } from \"phosphor-react\";\n\nimport { cn } from \"../../lib/utils\";\n\n/**\n * A one-time code, one character per box.\n *\n * There is exactly one `<input>`, stretched across the whole row and made\n * invisible. The boxes are divs that read their character out of context. That\n * is what makes paste, autofill, `autocomplete=\"one-time-code\"`, backspace and\n * mobile keyboards work: the browser sees a single ordinary text field. A row of\n * six real inputs looks the same and gets all of that wrong.\n *\n * The consequence, and the one thing worth knowing: the caret you see is drawn\n * by CSS, because the real caret is not where the boxes are.\n *\n * ## Slots are positional\n *\n * `InputOTPSlot` takes an `index`, and the indices must run 0..maxLength-1 in\n * document order. Nothing enforces it, because the boxes are yours to arrange -\n * `InputOTPSeparator` sits between groups, and the grouping is a visual choice\n * that this component should not make for you.\n */\n\n/**\n * `containerClassName` styles the row of boxes; `className` styles the hidden\n * input.\n *\n * A re-export rather than an interface of our own. The upstream type is a union\n * - `render` or `children`, never both - and `interface extends` flattens a\n * union into one object with every member optional, which would let both through\n * at once. Same reason the props below are spread whole instead of destructured:\n * `Omit` over a union collapses it too.\n */\nexport type InputOTPProps = OTPInputProps;\n\nconst InputOTP = React.forwardRef<HTMLInputElement, InputOTPProps>(\n (props, ref) => (\n <OTPInput\n {...props}\n ref={ref}\n containerClassName={cn(\n \"flex items-center gap-2 has-[:disabled]:opacity-50\",\n props.containerClassName,\n )}\n className={cn(\"disabled:cursor-not-allowed\", props.className)}\n />\n ),\n);\nInputOTP.displayName = \"InputOTP\";\n\n/**\n * One group of boxes.\n *\n * The boxes inside a group share borders, so the group reads as one field split\n * into cells rather than as separate inputs.\n */\nconst InputOTPGroup = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"flex items-center\", className)} {...props} />\n));\nInputOTPGroup.displayName = \"InputOTPGroup\";\n\nexport interface InputOTPSlotProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Position in the code, from 0. Must match the order on screen. */\n index: number;\n}\n\nconst InputOTPSlot = React.forwardRef<HTMLDivElement, InputOTPSlotProps>(\n ({ index, className, ...props }, ref) => {\n // The upstream context has a default value rather than null, so the check\n // is for the slots it should be carrying, not for the context itself.\n const context = React.useContext(OTPInputContext);\n if (!context?.slots) {\n throw new Error(\"InputOTPSlot must be used inside an <InputOTP>.\");\n }\n const slot = context.slots[index];\n if (!slot) {\n throw new Error(\n `InputOTPSlot index ${index} is outside the code. maxLength is ${context.slots.length}, so the last index is ${context.slots.length - 1}.`,\n );\n }\n const { char, hasFakeCaret, isActive } = slot;\n\n return (\n <div\n ref={ref}\n // The boxes are decoration. Everything a screen reader needs is on the\n // one real input, so announcing 6 empty divs on top of it is noise.\n aria-hidden=\"true\"\n data-active={isActive}\n className={cn(\n \"relative flex h-10 w-10 items-center justify-center border-y border-r border-input text-sm transition-all\",\n \"first:rounded-l-md first:border-l last:rounded-r-md\",\n \"data-[active=true]:z-10 data-[active=true]:border-ring data-[active=true]:ring-2 data-[active=true]:ring-ring/20\",\n className,\n )}\n {...props}\n >\n {char}\n {hasFakeCaret && (\n <div className=\"pointer-events-none absolute inset-0 flex items-center justify-center\">\n <div className=\"h-5 w-px animate-caret-blink bg-foreground\" />\n </div>\n )}\n </div>\n );\n },\n);\nInputOTPSlot.displayName = \"InputOTPSlot\";\n\n/** A gap between groups. Decorative, so it is hidden rather than announced. */\nconst InputOTPSeparator = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n aria-hidden=\"true\"\n className={cn(\"text-muted-foreground\", className)}\n {...props}\n >\n <Minus className=\"h-4 w-4\" />\n </div>\n));\nInputOTPSeparator.displayName = \"InputOTPSeparator\";\n\nexport { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator };\n"]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {a}from'./chunk-AC2JBXHQ.js';import*as e from'react';import {OTPInput,OTPInputContext}from'input-otp';import {Minus}from'phosphor-react';var f=e.forwardRef((t,r)=>e.createElement(OTPInput,{...t,ref:r,containerClassName:a("flex items-center gap-2 has-[:disabled]:opacity-50",t.containerClassName),className:a("disabled:cursor-not-allowed",t.className)}));f.displayName="InputOTP";var T=e.forwardRef(({className:t,...r},a$1)=>e.createElement("div",{ref:a$1,className:a("flex items-center",t),...r}));T.displayName="InputOTPGroup";var P=e.forwardRef(({index:t,className:r,...a$1},i)=>{let s=e.useContext(OTPInputContext);if(!s?.slots)throw new Error("InputOTPSlot must be used inside an <InputOTP>.");let o=s.slots[t];if(!o)throw new Error(`InputOTPSlot index ${t} is outside the code. maxLength is ${s.slots.length}, so the last index is ${s.slots.length-1}.`);let{char:d,hasFakeCaret:l,isActive:u}=o;return e.createElement("div",{ref:i,"aria-hidden":"true","data-active":u,className:a("relative flex h-10 w-10 items-center justify-center border-y border-r border-input text-sm transition-all","first:rounded-l-md first:border-l last:rounded-r-md","data-[active=true]:z-10 data-[active=true]:border-ring data-[active=true]:ring-2 data-[active=true]:ring-ring/20",r),...a$1},d,l&&e.createElement("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center"},e.createElement("div",{className:"h-5 w-px animate-caret-blink bg-foreground"})))});P.displayName="InputOTPSlot";var v=e.forwardRef(({className:t,...r},a$1)=>e.createElement("div",{ref:a$1,"aria-hidden":"true",className:a("text-muted-foreground",t),...r},e.createElement(Minus,{className:"h-4 w-4"})));v.displayName="InputOTPSeparator";export{f as a,T as b,P as c,v as d};//# sourceMappingURL=chunk-K45ZUJ42.js.map
|
|
3
|
+
//# sourceMappingURL=chunk-K45ZUJ42.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/core/input-otp.tsx"],"names":["InputOTP","props","ref","OTPInput","cn","InputOTPGroup","className","InputOTPSlot","index","context","OTPInputContext","slot","char","hasFakeCaret","isActive","InputOTPSeparator","Minus"],"mappings":"gJAsCA,IAAMA,EAAiB,CAAA,CAAA,UAAA,CACrB,CAACC,EAAOC,CAAAA,GACN,CAAA,CAAA,aAAA,CAACC,QAAAA,CAAA,CACE,GAAGF,CAAAA,CACJ,IAAKC,CAAAA,CACL,kBAAA,CAAoBE,EAClB,oDAAA,CACAH,CAAAA,CAAM,kBACR,CAAA,CACA,SAAA,CAAWG,CAAAA,CAAG,6BAAA,CAA+BH,CAAAA,CAAM,SAAS,EAC9D,CAEJ,EACAD,EAAS,WAAA,CAAc,UAAA,KAQjBK,CAAAA,CAAsB,CAAA,CAAA,UAAA,CAG1B,CAAC,CAAE,SAAA,CAAAC,CAAAA,CAAW,GAAGL,CAAM,CAAA,CAAGC,MAC1B,CAAA,CAAA,aAAA,CAAC,KAAA,CAAA,CAAI,IAAKA,GAAAA,CAAK,SAAA,CAAWE,EAAG,mBAAA,CAAqBE,CAAS,EAAI,GAAGL,CAAAA,CAAO,CAC1E,EACDI,CAAAA,CAAc,YAAc,eAAA,CAO5B,IAAME,CAAAA,CAAqB,CAAA,CAAA,UAAA,CACzB,CAAC,CAAE,MAAAC,CAAAA,CAAO,SAAA,CAAAF,EAAW,GAAGL,GAAM,EAAGC,CAAAA,GAAQ,CAGvC,IAAMO,CAAAA,CAAgB,CAAA,CAAA,UAAA,CAAWC,eAAe,EAChD,GAAI,CAACD,GAAS,KAAA,CACZ,MAAM,IAAI,KAAA,CAAM,iDAAiD,CAAA,CAEnE,IAAME,CAAAA,CAAOF,CAAAA,CAAQ,MAAMD,CAAK,CAAA,CAChC,GAAI,CAACG,CAAAA,CACH,MAAM,IAAI,KAAA,CACR,sBAAsBH,CAAK,CAAA,mCAAA,EAAsCC,EAAQ,KAAA,CAAM,MAAM,0BAA0BA,CAAAA,CAAQ,KAAA,CAAM,OAAS,CAAC,CAAA,CAAA,CACzI,CAAA,CAEF,GAAM,CAAE,IAAA,CAAAG,EAAM,YAAA,CAAAC,CAAAA,CAAc,SAAAC,CAAS,CAAA,CAAIH,EAEzC,OACE,CAAA,CAAA,aAAA,CAAC,KAAA,CAAA,CACC,GAAA,CAAKT,CAAAA,CAGL,aAAA,CAAY,OACZ,aAAA,CAAaY,CAAAA,CACb,UAAWV,CAAAA,CACT,2GAAA,CACA,sDACA,kHAAA,CACAE,CACF,CAAA,CACC,GAAGL,GAAAA,CAAAA,CAEHW,CAAAA,CACAC,GACC,CAAA,CAAA,aAAA,CAAC,KAAA,CAAA,CAAI,UAAU,uEAAA,CAAA,CACb,CAAA,CAAA,aAAA,CAAC,OAAI,SAAA,CAAU,4CAAA,CAA6C,CAC9D,CAEJ,CAEJ,CACF,EACAN,CAAAA,CAAa,WAAA,CAAc,eAG3B,IAAMQ,CAAAA,CAA0B,aAG9B,CAAC,CAAE,SAAA,CAAAT,CAAAA,CAAW,GAAGL,CAAM,EAAGC,GAAAA,GAC1B,CAAA,CAAA,aAAA,CAAC,OACC,GAAA,CAAKA,GAAAA,CACL,cAAY,MAAA,CACZ,SAAA,CAAWE,CAAAA,CAAG,uBAAA,CAAyBE,CAAS,CAAA,CAC/C,GAAGL,CAAAA,CAAAA,CAEJ,CAAA,CAAA,aAAA,CAACe,MAAA,CAAM,SAAA,CAAU,UAAU,CAC7B,CACD,EACDD,CAAAA,CAAkB,WAAA,CAAc,mBAAA","file":"chunk-K45ZUJ42.js","sourcesContent":["import * as React from \"react\";\nimport { OTPInput, OTPInputContext, type OTPInputProps } from \"input-otp\";\nimport { Minus } from \"phosphor-react\";\n\nimport { cn } from \"../../lib/utils\";\n\n/**\n * A one-time code, one character per box.\n *\n * There is exactly one `<input>`, stretched across the whole row and made\n * invisible. The boxes are divs that read their character out of context. That\n * is what makes paste, autofill, `autocomplete=\"one-time-code\"`, backspace and\n * mobile keyboards work: the browser sees a single ordinary text field. A row of\n * six real inputs looks the same and gets all of that wrong.\n *\n * The consequence, and the one thing worth knowing: the caret you see is drawn\n * by CSS, because the real caret is not where the boxes are.\n *\n * ## Slots are positional\n *\n * `InputOTPSlot` takes an `index`, and the indices must run 0..maxLength-1 in\n * document order. Nothing enforces it, because the boxes are yours to arrange -\n * `InputOTPSeparator` sits between groups, and the grouping is a visual choice\n * that this component should not make for you.\n */\n\n/**\n * `containerClassName` styles the row of boxes; `className` styles the hidden\n * input.\n *\n * A re-export rather than an interface of our own. The upstream type is a union\n * - `render` or `children`, never both - and `interface extends` flattens a\n * union into one object with every member optional, which would let both through\n * at once. Same reason the props below are spread whole instead of destructured:\n * `Omit` over a union collapses it too.\n */\nexport type InputOTPProps = OTPInputProps;\n\nconst InputOTP = React.forwardRef<HTMLInputElement, InputOTPProps>(\n (props, ref) => (\n <OTPInput\n {...props}\n ref={ref}\n containerClassName={cn(\n \"flex items-center gap-2 has-[:disabled]:opacity-50\",\n props.containerClassName,\n )}\n className={cn(\"disabled:cursor-not-allowed\", props.className)}\n />\n ),\n);\nInputOTP.displayName = \"InputOTP\";\n\n/**\n * One group of boxes.\n *\n * The boxes inside a group share borders, so the group reads as one field split\n * into cells rather than as separate inputs.\n */\nconst InputOTPGroup = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"flex items-center\", className)} {...props} />\n));\nInputOTPGroup.displayName = \"InputOTPGroup\";\n\nexport interface InputOTPSlotProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Position in the code, from 0. Must match the order on screen. */\n index: number;\n}\n\nconst InputOTPSlot = React.forwardRef<HTMLDivElement, InputOTPSlotProps>(\n ({ index, className, ...props }, ref) => {\n // The upstream context has a default value rather than null, so the check\n // is for the slots it should be carrying, not for the context itself.\n const context = React.useContext(OTPInputContext);\n if (!context?.slots) {\n throw new Error(\"InputOTPSlot must be used inside an <InputOTP>.\");\n }\n const slot = context.slots[index];\n if (!slot) {\n throw new Error(\n `InputOTPSlot index ${index} is outside the code. maxLength is ${context.slots.length}, so the last index is ${context.slots.length - 1}.`,\n );\n }\n const { char, hasFakeCaret, isActive } = slot;\n\n return (\n <div\n ref={ref}\n // The boxes are decoration. Everything a screen reader needs is on the\n // one real input, so announcing 6 empty divs on top of it is noise.\n aria-hidden=\"true\"\n data-active={isActive}\n className={cn(\n \"relative flex h-10 w-10 items-center justify-center border-y border-r border-input text-sm transition-all\",\n \"first:rounded-l-md first:border-l last:rounded-r-md\",\n \"data-[active=true]:z-10 data-[active=true]:border-ring data-[active=true]:ring-2 data-[active=true]:ring-ring/20\",\n className,\n )}\n {...props}\n >\n {char}\n {hasFakeCaret && (\n <div className=\"pointer-events-none absolute inset-0 flex items-center justify-center\">\n <div className=\"h-5 w-px animate-caret-blink bg-foreground\" />\n </div>\n )}\n </div>\n );\n },\n);\nInputOTPSlot.displayName = \"InputOTPSlot\";\n\n/** A gap between groups. Decorative, so it is hidden rather than announced. */\nconst InputOTPSeparator = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n aria-hidden=\"true\"\n className={cn(\"text-muted-foreground\", className)}\n {...props}\n >\n <Minus className=\"h-4 w-4\" />\n </div>\n));\nInputOTPSeparator.displayName = \"InputOTPSeparator\";\n\nexport { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator };\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {a}from'./chunk-AC2JBXHQ.js';import*as e from'react';import {cva}from'class-variance-authority';var V=cva("grid gap-2",{variants:{orientation:{vertical:"grid-cols-1",horizontal:"grid-cols-2 sm:grid-cols-3 md:grid-cols-4"}},defaultVariants:{orientation:"vertical"}}),w=cva("peer h-4 w-4 shrink-0 rounded-full border border-border shadow-sm 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 data-[state=checked]:border-primary transition-all duration-200",{variants:{variant:{default:"border-border hover:border-border data-[state=checked]:bg-primary data-[state=checked]:border-primary",error:"border-destructive focus-visible:ring-destructive data-[state=checked]:bg-destructive data-[state=checked]:border-destructive",success:"border-success-500 focus-visible:ring-success-500 data-[state=checked]:bg-success-500 data-[state=checked]:border-success-500"},size:{default:"h-4 w-4",sm:"h-3 w-3",lg:"h-5 w-5"}},defaultVariants:{variant:"default",size:"default"}}),E=e.forwardRef(({className:u,error:t,helperText:r,label:s,required:d,orientation:p,name:m,defaultValue:o,value:n,onValueChange:l,disabled:b,children:c,...f},v)=>{let g=e.useId(),
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
import {a}from'./chunk-AC2JBXHQ.js';import*as e from'react';import {cva}from'class-variance-authority';var V=cva("grid gap-2",{variants:{orientation:{vertical:"grid-cols-1",horizontal:"grid-cols-2 sm:grid-cols-3 md:grid-cols-4"}},defaultVariants:{orientation:"vertical"}}),w=cva("peer h-4 w-4 shrink-0 rounded-full border border-border shadow-sm 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 data-[state=checked]:border-primary transition-all duration-200",{variants:{variant:{default:"border-border hover:border-border data-[state=checked]:bg-primary data-[state=checked]:border-primary",error:"border-destructive focus-visible:ring-destructive data-[state=checked]:bg-destructive data-[state=checked]:border-destructive",success:"border-success-500 focus-visible:ring-success-500 data-[state=checked]:bg-success-500 data-[state=checked]:border-success-500"},size:{default:"h-4 w-4",sm:"h-3 w-3",lg:"h-5 w-5"}},defaultVariants:{variant:"default",size:"default"}}),E=e.forwardRef(({className:u,error:t,helperText:r,label:s,required:d,orientation:p,name:m,defaultValue:o,value:n,onValueChange:l,disabled:b,children:c,...f},v)=>{let g=e.useId(),R=s?`${g}-label`:void 0,h=r?`${g}-helper`:void 0,y=t?`${g}-error`:void 0,x=a=>{l&&l(a.target.value);};return e.createElement("div",{className:"space-y-2"},s&&e.createElement("label",{id:R,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"},s,d&&e.createElement("span",{className:"text-error-500 ml-1"},"*")),e.createElement("div",{ref:v,className:a(V({orientation:p,className:u})),role:"radiogroup","aria-labelledby":R,"aria-describedby":a(h,y)||void 0,"aria-invalid":t,...f},e.Children.map(c,a=>{if(e.isValidElement(a)){let k=n!==void 0,P={name:m,disabled:!!(b??a.props.disabled),variant:t?"error":a.props.variant,...k?{checked:n===a.props.value}:{defaultChecked:o===a.props.value},onChange:x};return e.cloneElement(a,P)}return a})),r&&e.createElement("p",{id:h,className:a("text-sm text-muted-foreground",t&&"text-destructive")},r))});E.displayName="RadioGroup";var N=e.forwardRef(({className:u,variant:t,size:r,value:s,label:d,disabled:p,id:m,onChange:o,...n},l)=>{let b=e.useId(),c=m||b,f=v=>{o&&o(v);};return e.createElement("div",{className:"flex items-center space-x-2"},e.createElement("input",{type:"radio",className:a(w({variant:t,size:r,className:u})),ref:l,id:c,value:s,disabled:p,onChange:f,...n}),d&&e.createElement("label",{htmlFor:c,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"},d))});N.displayName="RadioItem";export{V as a,w as b,E as c,N as d};//# sourceMappingURL=chunk-KR6IVHNR.js.map
|
|
3
|
+
//# sourceMappingURL=chunk-KR6IVHNR.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/core/radio-group.tsx"],"names":["radioGroupVariants","cva","radioItemVariants","RadioGroup","className","error","helperText","label","required","orientation","name","defaultValue","value","onValueChange","disabled","children","props","ref","radioGroupId","labelId","helperTextId","errorId","handleChange","event","cn","child","isControlled","childProps","RadioItem","variant","radioSize","id","onChange","generatedId","radioId"],"mappings":"uGAIA,IAAMA,CAAAA,CAAqBC,GAAAA,CA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,GAAS,kBACX,CAAA,CAAA,CAECC,CACH,CAEJ,CAEJ,CACF,EACAH,EAAW,WAAA,CAAc,YAAA,KAEnByB,CAAAA,CAAkB,CAAA,CAAA,UAAA,CACtB,CACE,CACE,UAAAxB,CAAAA,CACA,OAAA,CAAAyB,EACA,IAAA,CAAMC,CAAAA,CACN,MAAAlB,CAAAA,CACA,KAAA,CAAAL,CAAAA,CACA,QAAA,CAAAO,EACA,EAAA,CAAAiB,CAAAA,CACA,SAAAC,CAAAA,CACA,GAAGhB,CACL,CAAA,CACAC,CAAAA,GACG,CACH,IAAMgB,EAAoB,CAAA,CAAA,KAAA,EAAM,CAC1BC,EAAUH,CAAAA,EAAME,CAAAA,CAEhBX,EAAgBC,CAAAA,EAA+C,CAC/DS,CAAAA,EACFA,CAAAA,CAAST,CAAK,EAElB,CAAA,CAEA,OACE,CAAA,CAAA,aAAA,CAAC,KAAA,CAAA,CAAI,UAAU,6BAAA,CAAA,CACb,CAAA,CAAA,aAAA,CAAC,OAAA,CAAA,CACC,IAAA,CAAK,QACL,SAAA,CAAWC,CAAAA,CACTtB,EAAkB,CAAE,OAAA,CAAA2B,EAAS,IAAA,CAAMC,CAAAA,CAAW,SAAA,CAAA1B,CAAU,CAAC,CAC3D,CAAA,CACA,IAAKa,CAAAA,CACL,EAAA,CAAIiB,EACJ,KAAA,CAAOtB,CAAAA,CACP,QAAA,CAAUE,CAAAA,CACV,SAAUQ,CAAAA,CACT,GAAGN,EACN,CAAA,CACCT,CAAAA,EACC,gBAAC,OAAA,CAAA,CACC,OAAA,CAAS2B,CAAAA,CACT,SAAA,CAAU,8FAET3B,CACH,CAEJ,CAEJ,CACF,EACAqB,EAAU,WAAA,CAAc,WAAA","file":"chunk-WW2DDHCI.js","sourcesContent":["import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../lib/utils\";\n\nconst radioGroupVariants = cva(\"grid gap-2\", {\n variants: {\n orientation: {\n vertical: \"grid-cols-1\",\n horizontal: \"grid-cols-2 sm:grid-cols-3 md:grid-cols-4\",\n },\n },\n defaultVariants: {\n orientation: \"vertical\",\n },\n});\n\nconst radioItemVariants = cva(\n \"peer h-4 w-4 shrink-0 rounded-full border border-border shadow-sm 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 data-[state=checked]:border-primary transition-all duration-200\",\n {\n variants: {\n variant: {\n default:\n \"border-border hover:border-border data-[state=checked]:bg-primary data-[state=checked]:border-primary\",\n error:\n \"border-destructive focus-visible:ring-destructive data-[state=checked]:bg-destructive data-[state=checked]:border-destructive\",\n success:\n \"border-success-500 focus-visible:ring-success-500 data-[state=checked]:bg-success-500 data-[state=checked]:border-success-500\",\n },\n size: {\n default: \"h-4 w-4\",\n sm: \"h-3 w-3\",\n lg: \"h-5 w-5\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\nexport interface RadioGroupProps\n extends\n React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof radioGroupVariants> {\n /**\n * Whether the radio group is in an error state\n * @default false\n */\n error?: boolean;\n /**\n * Helper text to display below the radio group\n */\n helperText?: string;\n /**\n * Label text for the radio group\n */\n label?: string;\n /**\n * Whether the radio group is required\n * @default false\n */\n required?: boolean;\n /**\n * The name attribute for all radio buttons in the group\n */\n name?: string;\n /**\n * The default value of the radio group\n */\n defaultValue?: string;\n /**\n * The controlled value of the radio group\n */\n value?: string;\n /**\n * Callback fired when the value changes\n */\n onValueChange?: (value: string) => void;\n /**\n * Whether the radio group is disabled\n * @default false\n */\n disabled?: boolean;\n}\n\nexport interface RadioItemProps\n extends\n Omit<React.InputHTMLAttributes<HTMLInputElement>, \"size\">,\n VariantProps<typeof radioItemVariants> {\n /**\n * The value of the radio item\n */\n value: string;\n /**\n * The label for the radio item\n */\n label?: string;\n /**\n * Whether the radio item is disabled\n * @default false\n */\n disabled?: boolean;\n}\n\nconst RadioGroup = React.forwardRef<HTMLDivElement, RadioGroupProps>(\n (\n {\n className,\n error,\n helperText,\n label,\n required,\n orientation,\n name,\n defaultValue,\n value,\n onValueChange,\n disabled,\n children,\n ...props\n },\n ref,\n ) => {\n const radioGroupId = React.useId();\n const labelId = label ? `${radioGroupId}-label` : undefined;\n const helperTextId = helperText ? `${radioGroupId}-helper` : undefined;\n const errorId = error ? `${radioGroupId}-error` : undefined;\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n if (onValueChange) {\n onValueChange(event.target.value);\n }\n };\n\n return (\n <div className=\"space-y-2\">\n {label && (\n <label\n id={labelId}\n className=\"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n >\n {label}\n {required && <span className=\"text-error-500 ml-1\">*</span>}\n </label>\n )}\n <div\n ref={ref}\n className={cn(radioGroupVariants({ orientation, className }))}\n role=\"radiogroup\"\n aria-labelledby={labelId}\n aria-describedby={cn(helperTextId, errorId) || undefined}\n aria-invalid={error}\n {...props}\n >\n {React.Children.map(children, (child) => {\n if (React.isValidElement<RadioItemProps>(child)) {\n // Use controlled mode if value is provided, otherwise use uncontrolled\n const isControlled = value !== undefined;\n\n const childProps: Partial<RadioItemProps> = {\n name,\n disabled: Boolean(disabled ?? child.props.disabled),\n variant: error ? \"error\" : child.props.variant,\n ...(isControlled\n ? { checked: value === child.props.value }\n : { defaultChecked: defaultValue === child.props.value }),\n onChange: handleChange,\n };\n\n return React.cloneElement(child, childProps);\n }\n return child;\n })}\n </div>\n {helperText && (\n <p\n id={helperTextId}\n className={cn(\n \"text-sm text-muted-foreground\",\n error && \"text-destructive\",\n )}\n >\n {helperText}\n </p>\n )}\n </div>\n );\n },\n);\nRadioGroup.displayName = \"RadioGroup\";\n\nconst RadioItem = React.forwardRef<HTMLInputElement, RadioItemProps>(\n (\n {\n className,\n variant,\n size: radioSize,\n value,\n label,\n disabled,\n id,\n onChange,\n ...props\n },\n ref,\n ) => {\n const generatedId = React.useId();\n const radioId = id || generatedId;\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n if (onChange) {\n onChange(event);\n }\n };\n\n return (\n <div className=\"flex items-center space-x-2\">\n <input\n type=\"radio\"\n className={cn(\n radioItemVariants({ variant, size: radioSize, className }),\n )}\n ref={ref}\n id={radioId}\n value={value}\n disabled={disabled}\n onChange={handleChange}\n {...props}\n />\n {label && (\n <label\n htmlFor={radioId}\n className=\"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n >\n {label}\n </label>\n )}\n </div>\n );\n },\n);\nRadioItem.displayName = \"RadioItem\";\n\nexport { RadioGroup, RadioItem, radioGroupVariants, radioItemVariants };\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/core/radio-group.tsx"],"names":["radioGroupVariants","cva","radioItemVariants","RadioGroup","className","error","helperText","label","required","orientation","name","defaultValue","value","onValueChange","disabled","children","props","ref","radioGroupId","labelId","helperTextId","errorId","handleChange","event","cn","child","isControlled","childProps","RadioItem","variant","radioSize","id","onChange","generatedId","radioId"],"mappings":"uGAIA,IAAMA,CAAAA,CAAqBC,GAAAA,CAAI,YAAA,CAAc,CAC3C,QAAA,CAAU,CACR,YAAa,CACX,QAAA,CAAU,cACV,UAAA,CAAY,2CACd,CACF,CAAA,CACA,gBAAiB,CACf,WAAA,CAAa,UACf,CACF,CAAC,EAEKC,CAAAA,CAAoBD,GAAAA,CACxB,oWAAA,CACA,CACE,SAAU,CACR,OAAA,CAAS,CACP,OAAA,CACE,uGAAA,CACF,MACE,+HAAA,CACF,OAAA,CACE,+HACJ,CAAA,CACA,KAAM,CACJ,OAAA,CAAS,UACT,EAAA,CAAI,SAAA,CACJ,GAAI,SACN,CACF,CAAA,CACA,eAAA,CAAiB,CACf,OAAA,CAAS,SAAA,CACT,KAAM,SACR,CACF,CACF,CAAA,CAkEME,CAAAA,CAAmB,CAAA,CAAA,UAAA,CACvB,CACE,CACE,SAA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AST,CAAK,EAElB,CAAA,CAEA,OACE,CAAA,CAAA,aAAA,CAAC,KAAA,CAAA,CAAI,UAAU,6BAAA,CAAA,CACb,CAAA,CAAA,aAAA,CAAC,OAAA,CAAA,CACC,IAAA,CAAK,QACL,SAAA,CAAWC,CAAAA,CACTtB,EAAkB,CAAE,OAAA,CAAA2B,EAAS,IAAA,CAAMC,CAAAA,CAAW,SAAA,CAAA1B,CAAU,CAAC,CAC3D,CAAA,CACA,IAAKa,CAAAA,CACL,EAAA,CAAIiB,EACJ,KAAA,CAAOtB,CAAAA,CACP,QAAA,CAAUE,CAAAA,CACV,SAAUQ,CAAAA,CACT,GAAGN,EACN,CAAA,CACCT,CAAAA,EACC,gBAAC,OAAA,CAAA,CACC,OAAA,CAAS2B,CAAAA,CACT,SAAA,CAAU,8FAET3B,CACH,CAEJ,CAEJ,CACF,EACAqB,EAAU,WAAA,CAAc,WAAA","file":"chunk-KR6IVHNR.js","sourcesContent":["import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../lib/utils\";\n\nconst radioGroupVariants = cva(\"grid gap-2\", {\n variants: {\n orientation: {\n vertical: \"grid-cols-1\",\n horizontal: \"grid-cols-2 sm:grid-cols-3 md:grid-cols-4\",\n },\n },\n defaultVariants: {\n orientation: \"vertical\",\n },\n});\n\nconst radioItemVariants = cva(\n \"peer h-4 w-4 shrink-0 rounded-full border border-border shadow-sm 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 data-[state=checked]:border-primary transition-all duration-200\",\n {\n variants: {\n variant: {\n default:\n \"border-border hover:border-border data-[state=checked]:bg-primary data-[state=checked]:border-primary\",\n error:\n \"border-destructive focus-visible:ring-destructive data-[state=checked]:bg-destructive data-[state=checked]:border-destructive\",\n success:\n \"border-success-500 focus-visible:ring-success-500 data-[state=checked]:bg-success-500 data-[state=checked]:border-success-500\",\n },\n size: {\n default: \"h-4 w-4\",\n sm: \"h-3 w-3\",\n lg: \"h-5 w-5\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\nexport interface RadioGroupProps\n extends\n React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof radioGroupVariants> {\n /**\n * Whether the radio group is in an error state\n * @default false\n */\n error?: boolean;\n /**\n * Helper text to display below the radio group\n */\n helperText?: string;\n /**\n * Label text for the radio group\n */\n label?: string;\n /**\n * Whether the radio group is required\n * @default false\n */\n required?: boolean;\n /**\n * The name attribute for all radio buttons in the group\n */\n name?: string;\n /**\n * The default value of the radio group\n */\n defaultValue?: string;\n /**\n * The controlled value of the radio group\n */\n value?: string;\n /**\n * Callback fired when the value changes\n */\n onValueChange?: (value: string) => void;\n /**\n * Whether the radio group is disabled\n * @default false\n */\n disabled?: boolean;\n}\n\nexport interface RadioItemProps\n extends\n Omit<React.InputHTMLAttributes<HTMLInputElement>, \"size\">,\n VariantProps<typeof radioItemVariants> {\n /**\n * The value of the radio item\n */\n value: string;\n /**\n * The label for the radio item\n */\n label?: string;\n /**\n * Whether the radio item is disabled\n * @default false\n */\n disabled?: boolean;\n}\n\nconst RadioGroup = React.forwardRef<HTMLDivElement, RadioGroupProps>(\n (\n {\n className,\n error,\n helperText,\n label,\n required,\n orientation,\n name,\n defaultValue,\n value,\n onValueChange,\n disabled,\n children,\n ...props\n },\n ref,\n ) => {\n const radioGroupId = React.useId();\n const labelId = label ? `${radioGroupId}-label` : undefined;\n const helperTextId = helperText ? `${radioGroupId}-helper` : undefined;\n const errorId = error ? `${radioGroupId}-error` : undefined;\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n if (onValueChange) {\n onValueChange(event.target.value);\n }\n };\n\n return (\n <div className=\"space-y-2\">\n {label && (\n <label\n id={labelId}\n className=\"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n >\n {label}\n {required && <span className=\"text-error-500 ml-1\">*</span>}\n </label>\n )}\n <div\n ref={ref}\n className={cn(radioGroupVariants({ orientation, className }))}\n role=\"radiogroup\"\n aria-labelledby={labelId}\n aria-describedby={cn(helperTextId, errorId) || undefined}\n aria-invalid={error}\n {...props}\n >\n {React.Children.map(children, (child) => {\n if (React.isValidElement<RadioItemProps>(child)) {\n // Use controlled mode if value is provided, otherwise use uncontrolled\n const isControlled = value !== undefined;\n\n const childProps: Partial<RadioItemProps> = {\n name,\n disabled: Boolean(disabled ?? child.props.disabled),\n variant: error ? \"error\" : child.props.variant,\n ...(isControlled\n ? { checked: value === child.props.value }\n : { defaultChecked: defaultValue === child.props.value }),\n onChange: handleChange,\n };\n\n return React.cloneElement(child, childProps);\n }\n return child;\n })}\n </div>\n {helperText && (\n <p\n id={helperTextId}\n className={cn(\n \"text-sm text-muted-foreground\",\n error && \"text-destructive\",\n )}\n >\n {helperText}\n </p>\n )}\n </div>\n );\n },\n);\nRadioGroup.displayName = \"RadioGroup\";\n\nconst RadioItem = React.forwardRef<HTMLInputElement, RadioItemProps>(\n (\n {\n className,\n variant,\n size: radioSize,\n value,\n label,\n disabled,\n id,\n onChange,\n ...props\n },\n ref,\n ) => {\n const generatedId = React.useId();\n const radioId = id || generatedId;\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n if (onChange) {\n onChange(event);\n }\n };\n\n return (\n <div className=\"flex items-center space-x-2\">\n <input\n type=\"radio\"\n className={cn(\n radioItemVariants({ variant, size: radioSize, className }),\n )}\n ref={ref}\n id={radioId}\n value={value}\n disabled={disabled}\n onChange={handleChange}\n {...props}\n />\n {label && (\n <label\n htmlFor={radioId}\n className=\"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n >\n {label}\n </label>\n )}\n </div>\n );\n },\n);\nRadioItem.displayName = \"RadioItem\";\n\n// Both names, on purpose. `RadioGroupItem` is what shadcn calls it and what\n// every example in the docs uses; `RadioItem` is what this file has always\n// called it. The alias used to live only in the barrel, so\n// `@jarllyng/nostromo/radio-group` and `@jarllyng/nostromo` disagreed about the\n// name of the same component - and the documented subpath import did not resolve.\nexport {\n RadioGroup,\n RadioItem,\n RadioItem as RadioGroupItem,\n radioGroupVariants,\n radioItemVariants,\n};\n"]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {a as a$1}from'./chunk-AC2JBXHQ.js';import*as e from'react';import*as a from'react-resizable-panels';import {DotsSixVertical}from'phosphor-react';var s=e.forwardRef(({className:i,...r},t)=>e.createElement(a.Group,{elementRef:t,className:a$1(i),...r}));s.displayName="ResizablePanelGroup";var f=e.forwardRef(({...i},r)=>e.createElement(a.Panel,{elementRef:r,...i}));f.displayName="ResizablePanel";var m=e.forwardRef(({withHandle:i,className:r,...t},n)=>e.createElement(a.Separator,{elementRef:n,className:a$1("relative flex w-px items-center justify-center bg-border","after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background","aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full","aria-[orientation=horizontal]:after:inset-x-0 aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:top-1/2 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:-translate-y-1/2 aria-[orientation=horizontal]:after:translate-x-0","[&[aria-orientation=horizontal]>div]:rotate-90",r),...t},i&&e.createElement("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border border-border bg-border"},e.createElement(DotsSixVertical,{className:"h-3 w-3","aria-hidden":"true"}))));m.displayName="ResizableHandle";export{s as a,f as b,m as c};//# sourceMappingURL=chunk-MINSU2YF.js.map
|
|
3
|
+
//# sourceMappingURL=chunk-MINSU2YF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/core/resizable.tsx"],"names":["ResizablePanelGroup","className","props","ref","cn","ResizablePanel","ResizableHandle","withHandle","DotsSixVertical"],"mappings":"yJAwCA,IAAMA,CAAAA,CAA4B,aAGhC,CAAC,CAAE,SAAA,CAAAC,CAAAA,CAAW,GAAGC,CAAM,EAAGC,CAAAA,GAC1B,CAAA,CAAA,aAAA,CAAoB,CAAA,CAAA,KAAA,CAAnB,CACC,UAAA,CAAYA,CAAAA,CACZ,UAAWC,GAAAA,CAAGH,CAAS,EACtB,GAAGC,CAAAA,CACN,CACD,EACDF,CAAAA,CAAoB,WAAA,CAAc,qBAAA,CAElC,IAAMK,CAAAA,CAAuB,aAG3B,CAAC,CAAE,GAAGH,CAAM,CAAA,CAAGC,CAAAA,GACf,gBAAoB,CAAA,CAAA,KAAA,CAAnB,CAAyB,UAAA,CAAYA,CAAAA,CAAM,GAAGD,CAAAA,CAAO,CACvD,EACDG,CAAAA,CAAe,YAAc,gBAAA,CAa7B,IAAMC,EAAwB,CAAA,CAAA,UAAA,CAC5B,CAAC,CAAE,UAAA,CAAAC,CAAAA,CAAY,SAAA,CAAAN,EAAW,GAAGC,CAAM,CAAA,CAAGC,CAAAA,GACpC,CAAA,CAAA,aAAA,CAAoB,CAAA,CAAA,SAAA,CAAnB,CACC,UAAA,CAAYA,CAAAA,CACZ,SAAA,CAAWC,GAAAA,CACT,0DAAA,CAGA,gFAAA,CACA,2IACA,yEAAA,CACA,gUAAA,CACA,iDACAH,CACF,CAAA,CACC,GAAGC,CAAAA,CAAAA,CAEHK,CAAAA,EACC,CAAA,CAAA,aAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,yFAAA,CAAA,CACb,gBAACC,eAAAA,CAAA,CAAgB,SAAA,CAAU,SAAA,CAAU,aAAA,CAAY,MAAA,CAAO,CAC1D,CAEJ,CAEJ,EACAF,CAAAA,CAAgB,WAAA,CAAc,iBAAA","file":"chunk-MINSU2YF.js","sourcesContent":["import * as React from \"react\";\nimport * as ResizablePrimitive from \"react-resizable-panels\";\nimport { DotsSixVertical } from \"phosphor-react\";\n\nimport { cn } from \"../../lib/utils\";\n\n/**\n * Panels the user can resize by dragging the divider between them: a file tree\n * next to an editor, a list next to a preview.\n *\n * Thin wrappers over react-resizable-panels, which owns the sizing, the pointer\n * and keyboard handling, and the ARIA on the divider. Only the look is ours.\n *\n * ## The group sizes itself, so size its parent\n *\n * The group sets `display`, `flex-direction`, `width: 100%` and `height: 100%`\n * as *inline* styles. Inline styles beat classes, so `className=\"h-96\"` on the\n * group does nothing at all - a silent no-op, which is why it is written down\n * here. Put the height on the element around the group, or pass\n * `style={{ height: \"24rem\" }}`, which merges with the library's own.\n *\n * For the same reason there are no layout classes on `ResizablePanelGroup`\n * below. `flex`, `w-full` and a flex-direction switch would all be overridden\n * by the inline styles, and dead classes are worse than none.\n *\n * ## `aria-orientation` on the divider is the divider's own axis\n *\n * A horizontal group - panels side by side - has a *vertical* divider, so it\n * reports `aria-orientation=\"vertical\"`. The styling below reads it that way\n * round: the default is a vertical hairline, and the `aria-[orientation=\n * horizontal]` variants flip it to a horizontal one.\n *\n * ## A class on a panel lands on an inner element\n *\n * `ResizablePanel` renders a wrapper that the library controls with flex, and\n * puts `className` on a child inside it. That is deliberate on their side: it\n * keeps padding and borders from fighting the flex sizing. It does mean a\n * background on a panel paints the inner box, which is what you want anyway.\n */\n\nconst ResizablePanelGroup = React.forwardRef<\n HTMLDivElement,\n ResizablePrimitive.GroupProps\n>(({ className, ...props }, ref) => (\n <ResizablePrimitive.Group\n elementRef={ref}\n className={cn(className)}\n {...props}\n />\n));\nResizablePanelGroup.displayName = \"ResizablePanelGroup\";\n\nconst ResizablePanel = React.forwardRef<\n HTMLDivElement,\n ResizablePrimitive.PanelProps\n>(({ ...props }, ref) => (\n <ResizablePrimitive.Panel elementRef={ref} {...props} />\n));\nResizablePanel.displayName = \"ResizablePanel\";\n\nexport interface ResizableHandleProps\n extends ResizablePrimitive.SeparatorProps {\n /**\n * Draw a grip on the divider.\n *\n * A one-pixel line is a small target and gives no hint that it can be\n * dragged. The grip is worth it anywhere the divider is not obvious.\n */\n withHandle?: boolean;\n}\n\nconst ResizableHandle = React.forwardRef<HTMLDivElement, ResizableHandleProps>(\n ({ withHandle, className, ...props }, ref) => (\n <ResizablePrimitive.Separator\n elementRef={ref}\n className={cn(\n \"relative flex w-px items-center justify-center bg-border\",\n // A 1px line is a 1px hit area. This widens the grab zone without\n // moving the panels, which is why it is a pseudo-element.\n \"after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background\",\n \"aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full\",\n \"aria-[orientation=horizontal]:after:inset-x-0 aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:top-1/2 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:-translate-y-1/2 aria-[orientation=horizontal]:after:translate-x-0\",\n \"[&[aria-orientation=horizontal]>div]:rotate-90\",\n className,\n )}\n {...props}\n >\n {withHandle && (\n <div className=\"z-10 flex h-4 w-3 items-center justify-center rounded-sm border border-border bg-border\">\n <DotsSixVertical className=\"h-3 w-3\" aria-hidden=\"true\" />\n </div>\n )}\n </ResizablePrimitive.Separator>\n ),\n);\nResizableHandle.displayName = \"ResizableHandle\";\n\nexport { ResizablePanelGroup, ResizablePanel, ResizableHandle };\n"]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {b}from'./chunk-AVTJE2O2.js';import {a}from'./chunk-AC2JBXHQ.js';import*as e from'react';import E from'embla-carousel-react';import {CaretLeft,CaretRight}from'phosphor-react';var x=e.createContext(null);function m(){let t=e.useContext(x);if(!t)throw new Error("useCarousel must be used inside a <Carousel>.");return t}function L(t){if(!(t instanceof HTMLElement))return false;if(t.isContentEditable)return true;let r=t.tagName;return r==="INPUT"||r==="TEXTAREA"||r==="SELECT"}var k=e.forwardRef(({orientation:t="horizontal",opts:r,setApi:a$1,plugins:s,className:n,children:c,...f},d)=>{let[i,o]=E({...r,axis:t==="horizontal"?"x":"y"},s),b=e.useCallback(l=>o?(o.on("select",l),o.on("reInit",l),()=>{o.off("select",l),o.off("reInit",l);}):()=>{},[o]),y=e.useSyncExternalStore(b,()=>o?.canScrollPrev()??false,()=>false),h=e.useSyncExternalStore(b,()=>o?.canScrollNext()??false,()=>false),p=e.useCallback(()=>o?.scrollPrev(),[o]),C=e.useCallback(()=>o?.scrollNext(),[o]),R=e.useCallback(l=>{if(L(l.target))return;let[N,w]=t==="horizontal"?["ArrowLeft","ArrowRight"]:["ArrowUp","ArrowDown"];l.key===N?(l.preventDefault(),p()):l.key===w&&(l.preventDefault(),C());},[t,p,C]);e.useEffect(()=>{!o||!a$1||a$1(o);},[o,a$1]);let P=e.useMemo(()=>({carouselRef:i,api:o,opts:r,plugins:s,orientation:t,scrollPrev:p,scrollNext:C,canScrollPrev:y,canScrollNext:h}),[i,o,r,s,t,p,C,y,h]);return e.createElement(x.Provider,{value:P},e.createElement("div",{ref:d,onKeyDownCapture:R,className:a("relative focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",n),role:"region","aria-roledescription":"carousel",tabIndex:0,...f},c))});k.displayName="Carousel";var M=e.forwardRef(({className:t,...r},a$1)=>{let{carouselRef:s,orientation:n}=m();return e.createElement("div",{ref:s,className:"overflow-hidden"},e.createElement("div",{ref:a$1,className:a("flex",n==="horizontal"?"-ml-4":"-mt-4 flex-col",t),...r}))});M.displayName="CarouselContent";var A=e.forwardRef(({className:t,...r},a$1)=>{let{orientation:s}=m();return e.createElement("div",{ref:a$1,role:"group","aria-roledescription":"slide",className:a("min-w-0 shrink-0 grow-0 basis-full",s==="horizontal"?"pl-4":"pt-4",t),...r})});A.displayName="CarouselItem";var H=e.forwardRef(({className:t,variant:r="outline",size:a$1="icon",label:s="Previous slide",...n},c)=>{let{orientation:f,scrollPrev:d,canScrollPrev:i}=m();return e.createElement(b,{ref:c,variant:r,size:a$1,className:a("absolute h-8 w-8 rounded-full",f==="horizontal"?"-left-12 top-1/2 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",t),disabled:!i,onClick:d,...n},e.createElement(CaretLeft,{className:"h-4 w-4","aria-hidden":"true"}),e.createElement("span",{className:"sr-only"},s))});H.displayName="CarouselPrevious";var D=e.forwardRef(({className:t,variant:r="outline",size:a$1="icon",label:s="Next slide",...n},c)=>{let{orientation:f,scrollNext:d,canScrollNext:i}=m();return e.createElement(b,{ref:c,variant:r,size:a$1,className:a("absolute h-8 w-8 rounded-full",f==="horizontal"?"-right-12 top-1/2 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",t),disabled:!i,onClick:d,...n},e.createElement(CaretRight,{className:"h-4 w-4","aria-hidden":"true"}),e.createElement("span",{className:"sr-only"},s))});D.displayName="CarouselNext";export{m as a,k as b,M as c,A as d,H as e,D as f};//# sourceMappingURL=chunk-NM5NVIAK.js.map
|
|
3
|
+
//# sourceMappingURL=chunk-NM5NVIAK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/core/carousel.tsx"],"names":["CarouselContext","useCarousel","context","isTextEntry","target","tag","Carousel","orientation","opts","setApi","plugins","className","children","props","ref","carouselRef","api","useEmblaCarousel","subscribe","onStoreChange","canScrollPrev","canScrollNext","scrollPrev","scrollNext","handleKeyDown","event","back","forward","value","cn","CarouselContent","CarouselItem","CarouselPrevious","variant","size","label","Button","CaretLeft","CarouselNext","CaretRight"],"mappings":"sLAwDA,IAAMA,EAAwB,CAAA,CAAA,aAAA,CAA2C,IAAI,CAAA,CAE7E,SAASC,CAAAA,EAAc,CACrB,IAAMC,CAAAA,CAAgB,aAAWF,CAAe,CAAA,CAChD,GAAI,CAACE,CAAAA,CACH,MAAM,IAAI,KAAA,CAAM,+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AE/B,IAAMM,CAAAA,CAAqB,CAAA,CAAA,UAAA,CACzB,CACE,CACE,SAAA,CAAA3B,CAAAA,CACA,OAAA,CAAAsB,CAAAA,CAAU,SAAA,CACV,IAAA,CAAAC,GAAAA,CAAO,MAAA,CACP,KAAA,CAAAC,CAAAA,CAAQ,YAAA,CACR,GAAGtB,CACL,CAAA,CACAC,CAAAA,GACG,CACH,GAAM,CAAE,WAAA,CAAAP,CAAAA,CAAa,UAAA,CAAAgB,CAAAA,CAAY,aAAA,CAAAF,CAAc,CAAA,CAAIpB,GAAY,CAC/D,OACE,CAAA,CAAA,aAAA,CAACmC,CAAAA,CAAA,CACC,GAAA,CAAKtB,CAAAA,CACL,OAAA,CAASmB,EACT,IAAA,CAAMC,GAAAA,CACN,SAAA,CAAWL,CAAAA,CACT,+BAAA,CACAtB,CAAAA,GAAgB,YAAA,CACZ,oCAAA,CACA,iDACJI,CACF,CAAA,CACA,QAAA,CAAU,CAACU,CAAAA,CACX,OAAA,CAASE,CAAAA,CACR,GAAGV,GAEJ,CAAA,CAAA,aAAA,CAAC0B,UAAAA,CAAA,CAAW,SAAA,CAAU,SAAA,CAAU,aAAA,CAAY,MAAA,CAAO,CAAA,CACnD,gBAAC,MAAA,CAAA,CAAK,SAAA,CAAU,SAAA,CAAA,CAAWJ,CAAM,CACnC,CAEJ,CACF,EACAG,EAAa,WAAA,CAAc,cAAA","file":"chunk-NM5NVIAK.js","sourcesContent":["import * as React from \"react\";\nimport useEmblaCarousel, {\n type UseEmblaCarouselType,\n} from \"embla-carousel-react\";\nimport { CaretLeft, CaretRight } from \"phosphor-react\";\n\nimport { cn } from \"../../lib/utils\";\nimport { Button } from \"./button\";\n\n/**\n * A horizontal or vertical strip of slides that snaps as you drag it.\n *\n * Embla does the measuring, the dragging and the snapping. This file is the\n * markup, the styling and the roles, plus the two buttons.\n *\n * ## `orientation` is the only axis control\n *\n * Embla takes `axis: \"x\" | \"y\"`, and this component derives it from\n * `orientation`, because the padding on `CarouselItem` and the placement of the\n * two buttons have to agree with it. Setting `opts={{ axis: \"y\" }}` will not\n * work: `orientation` overwrites it. One control, so the styling cannot drift\n * out of sync with the behaviour.\n *\n * ## Anything beyond next and previous goes through `setApi`\n *\n * Dots, autoplay, a progress bar, \"slide 3 of 7\" - all of that reads state\n * embla owns, and wrapping each one would mean guessing which you want. `setApi`\n * hands you the embla instance instead, and its `on(\"select\")` event is the hook\n * for the rest.\n */\n\ntype CarouselApi = UseEmblaCarouselType[1];\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>;\ntype CarouselOptions = UseCarouselParameters[0];\ntype CarouselPlugin = UseCarouselParameters[1];\n\ninterface CarouselProps {\n /** Embla options. `axis` is ignored - use `orientation`. */\n opts?: CarouselOptions;\n /** Embla plugins, for example autoplay. */\n plugins?: CarouselPlugin;\n orientation?: \"horizontal\" | \"vertical\";\n /** Receives the embla instance, for dots, autoplay or a slide counter. */\n setApi?: (api: CarouselApi) => void;\n}\n\ninterface CarouselContextValue extends CarouselProps {\n carouselRef: UseEmblaCarouselType[0];\n api: CarouselApi;\n scrollPrev: () => void;\n scrollNext: () => void;\n canScrollPrev: boolean;\n canScrollNext: boolean;\n orientation: \"horizontal\" | \"vertical\";\n}\n\nconst CarouselContext = React.createContext<CarouselContextValue | null>(null);\n\nfunction useCarousel() {\n const context = React.useContext(CarouselContext);\n if (!context) {\n throw new Error(\"useCarousel must be used inside a <Carousel>.\");\n }\n return context;\n}\n\n/** Arrow keys mean \"move the caret\" inside a text field, not \"change slide\". */\nfunction isTextEntry(target: EventTarget | null): boolean {\n if (!(target instanceof HTMLElement)) return false;\n if (target.isContentEditable) return true;\n const tag = target.tagName;\n return tag === \"INPUT\" || tag === \"TEXTAREA\" || tag === \"SELECT\";\n}\n\nconst Carousel = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & CarouselProps\n>(\n (\n {\n orientation = \"horizontal\",\n opts,\n setApi,\n plugins,\n className,\n children,\n ...props\n },\n ref,\n ) => {\n const [carouselRef, api] = useEmblaCarousel(\n { ...opts, axis: orientation === \"horizontal\" ? \"x\" : \"y\" },\n plugins,\n );\n // Whether there is anywhere to scroll lives in embla, not here, so it is\n // read rather than mirrored. An effect that copied it into state would\n // render once with both buttons wrongly disabled before the effect ran, and\n // would set state synchronously inside an effect, which is a cascading\n // render. Subscribing is both correct and simpler.\n const subscribe = React.useCallback(\n (onStoreChange: () => void) => {\n if (!api) return () => {};\n api.on(\"select\", onStoreChange);\n api.on(\"reInit\", onStoreChange);\n return () => {\n api.off(\"select\", onStoreChange);\n api.off(\"reInit\", onStoreChange);\n };\n },\n [api],\n );\n const canScrollPrev = React.useSyncExternalStore(\n subscribe,\n () => api?.canScrollPrev() ?? false,\n () => false,\n );\n const canScrollNext = React.useSyncExternalStore(\n subscribe,\n () => api?.canScrollNext() ?? false,\n () => false,\n );\n\n const scrollPrev = React.useCallback(() => api?.scrollPrev(), [api]);\n const scrollNext = React.useCallback(() => api?.scrollNext(), [api]);\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (isTextEntry(event.target)) return;\n const [back, forward] =\n orientation === \"horizontal\"\n ? [\"ArrowLeft\", \"ArrowRight\"]\n : [\"ArrowUp\", \"ArrowDown\"];\n if (event.key === back) {\n event.preventDefault();\n scrollPrev();\n } else if (event.key === forward) {\n event.preventDefault();\n scrollNext();\n }\n },\n [orientation, scrollPrev, scrollNext],\n );\n\n React.useEffect(() => {\n if (!api || !setApi) return;\n setApi(api);\n }, [api, setApi]);\n\n const value = React.useMemo(\n () => ({\n carouselRef,\n api,\n opts,\n plugins,\n orientation,\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n }),\n [\n carouselRef,\n api,\n opts,\n plugins,\n orientation,\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n ],\n );\n\n return (\n <CarouselContext.Provider value={value}>\n <div\n ref={ref}\n onKeyDownCapture={handleKeyDown}\n className={cn(\n \"relative focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\",\n className,\n )}\n role=\"region\"\n aria-roledescription=\"carousel\"\n // A tab stop, so the arrow keys below are actually reachable. Without\n // it this div can never hold focus, the handler only ever fires for\n // keys pressed on something inside it, and a keyboard user tabbing\n // through the page gets the two buttons and no way to reach the\n // slides. Pass your own tabIndex to opt out.\n tabIndex={0}\n {...props}\n >\n {children}\n </div>\n </CarouselContext.Provider>\n );\n },\n);\nCarousel.displayName = \"Carousel\";\n\n/**\n * The viewport and the track.\n *\n * Two elements rather than one: embla measures the outer one, which must clip,\n * and translates the inner one. The negative margin pairs with the padding on\n * `CarouselItem` so the gap between slides does not show up as an edge inset.\n */\nconst CarouselContent = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => {\n const { carouselRef, orientation } = useCarousel();\n return (\n <div ref={carouselRef} className=\"overflow-hidden\">\n <div\n ref={ref}\n className={cn(\n \"flex\",\n orientation === \"horizontal\" ? \"-ml-4\" : \"-mt-4 flex-col\",\n className,\n )}\n {...props}\n />\n </div>\n );\n});\nCarouselContent.displayName = \"CarouselContent\";\n\nconst CarouselItem = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => {\n const { orientation } = useCarousel();\n return (\n <div\n ref={ref}\n role=\"group\"\n aria-roledescription=\"slide\"\n className={cn(\n \"min-w-0 shrink-0 grow-0 basis-full\",\n orientation === \"horizontal\" ? \"pl-4\" : \"pt-4\",\n className,\n )}\n {...props}\n />\n );\n});\nCarouselItem.displayName = \"CarouselItem\";\n\nexport interface CarouselButtonProps extends React.ComponentPropsWithoutRef<\n typeof Button\n> {\n /**\n * Screen-reader text for the button. The arrow is decorative, so this is the\n * button's only accessible name.\n */\n label?: string;\n}\n\nconst CarouselPrevious = React.forwardRef<\n HTMLButtonElement,\n CarouselButtonProps\n>(\n (\n {\n className,\n variant = \"outline\",\n size = \"icon\",\n label = \"Previous slide\",\n ...props\n },\n ref,\n ) => {\n const { orientation, scrollPrev, canScrollPrev } = useCarousel();\n return (\n <Button\n ref={ref}\n variant={variant}\n size={size}\n className={cn(\n \"absolute h-8 w-8 rounded-full\",\n orientation === \"horizontal\"\n ? \"-left-12 top-1/2 -translate-y-1/2\"\n : \"-top-12 left-1/2 -translate-x-1/2 rotate-90\",\n className,\n )}\n disabled={!canScrollPrev}\n onClick={scrollPrev}\n {...props}\n >\n <CaretLeft className=\"h-4 w-4\" aria-hidden=\"true\" />\n <span className=\"sr-only\">{label}</span>\n </Button>\n );\n },\n);\nCarouselPrevious.displayName = \"CarouselPrevious\";\n\nconst CarouselNext = React.forwardRef<HTMLButtonElement, CarouselButtonProps>(\n (\n {\n className,\n variant = \"outline\",\n size = \"icon\",\n label = \"Next slide\",\n ...props\n },\n ref,\n ) => {\n const { orientation, scrollNext, canScrollNext } = useCarousel();\n return (\n <Button\n ref={ref}\n variant={variant}\n size={size}\n className={cn(\n \"absolute h-8 w-8 rounded-full\",\n orientation === \"horizontal\"\n ? \"-right-12 top-1/2 -translate-y-1/2\"\n : \"-bottom-12 left-1/2 -translate-x-1/2 rotate-90\",\n className,\n )}\n disabled={!canScrollNext}\n onClick={scrollNext}\n {...props}\n >\n <CaretRight className=\"h-4 w-4\" aria-hidden=\"true\" />\n <span className=\"sr-only\">{label}</span>\n </Button>\n );\n },\n);\nCarouselNext.displayName = \"CarouselNext\";\n\nexport {\n Carousel,\n CarouselContent,\n CarouselItem,\n CarouselPrevious,\n CarouselNext,\n useCarousel,\n};\nexport type { CarouselApi, CarouselOptions, CarouselPlugin, CarouselProps };\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
'use strict';var chunkITRGJNWL_cjs=require('./chunk-ITRGJNWL.cjs'),e=require('react'),classVarianceAuthority=require('class-variance-authority');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var e__namespace=/*#__PURE__*/_interopNamespace(e);var V=classVarianceAuthority.cva("grid gap-2",{variants:{orientation:{vertical:"grid-cols-1",horizontal:"grid-cols-2 sm:grid-cols-3 md:grid-cols-4"}},defaultVariants:{orientation:"vertical"}}),w=classVarianceAuthority.cva("peer h-4 w-4 shrink-0 rounded-full border border-border shadow-sm 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 data-[state=checked]:border-primary transition-all duration-200",{variants:{variant:{default:"border-border hover:border-border data-[state=checked]:bg-primary data-[state=checked]:border-primary",error:"border-destructive focus-visible:ring-destructive data-[state=checked]:bg-destructive data-[state=checked]:border-destructive",success:"border-success-500 focus-visible:ring-success-500 data-[state=checked]:bg-success-500 data-[state=checked]:border-success-500"},size:{default:"h-4 w-4",sm:"h-3 w-3",lg:"h-5 w-5"}},defaultVariants:{variant:"default",size:"default"}}),E=e__namespace.forwardRef(({className:u,error:t,helperText:r,label:s,required:d,orientation:p,name:m,defaultValue:o,value:n,onValueChange:l,disabled:b,children:c,...f},v)=>{let g=e__namespace.useId(),
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
'use strict';var chunkITRGJNWL_cjs=require('./chunk-ITRGJNWL.cjs'),e=require('react'),classVarianceAuthority=require('class-variance-authority');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var e__namespace=/*#__PURE__*/_interopNamespace(e);var V=classVarianceAuthority.cva("grid gap-2",{variants:{orientation:{vertical:"grid-cols-1",horizontal:"grid-cols-2 sm:grid-cols-3 md:grid-cols-4"}},defaultVariants:{orientation:"vertical"}}),w=classVarianceAuthority.cva("peer h-4 w-4 shrink-0 rounded-full border border-border shadow-sm 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 data-[state=checked]:border-primary transition-all duration-200",{variants:{variant:{default:"border-border hover:border-border data-[state=checked]:bg-primary data-[state=checked]:border-primary",error:"border-destructive focus-visible:ring-destructive data-[state=checked]:bg-destructive data-[state=checked]:border-destructive",success:"border-success-500 focus-visible:ring-success-500 data-[state=checked]:bg-success-500 data-[state=checked]:border-success-500"},size:{default:"h-4 w-4",sm:"h-3 w-3",lg:"h-5 w-5"}},defaultVariants:{variant:"default",size:"default"}}),E=e__namespace.forwardRef(({className:u,error:t,helperText:r,label:s,required:d,orientation:p,name:m,defaultValue:o,value:n,onValueChange:l,disabled:b,children:c,...f},v)=>{let g=e__namespace.useId(),R=s?`${g}-label`:void 0,h=r?`${g}-helper`:void 0,y=t?`${g}-error`:void 0,x=a=>{l&&l(a.target.value);};return e__namespace.createElement("div",{className:"space-y-2"},s&&e__namespace.createElement("label",{id:R,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"},s,d&&e__namespace.createElement("span",{className:"text-error-500 ml-1"},"*")),e__namespace.createElement("div",{ref:v,className:chunkITRGJNWL_cjs.a(V({orientation:p,className:u})),role:"radiogroup","aria-labelledby":R,"aria-describedby":chunkITRGJNWL_cjs.a(h,y)||void 0,"aria-invalid":t,...f},e__namespace.Children.map(c,a=>{if(e__namespace.isValidElement(a)){let k=n!==void 0,P={name:m,disabled:!!(b??a.props.disabled),variant:t?"error":a.props.variant,...k?{checked:n===a.props.value}:{defaultChecked:o===a.props.value},onChange:x};return e__namespace.cloneElement(a,P)}return a})),r&&e__namespace.createElement("p",{id:h,className:chunkITRGJNWL_cjs.a("text-sm text-muted-foreground",t&&"text-destructive")},r))});E.displayName="RadioGroup";var N=e__namespace.forwardRef(({className:u,variant:t,size:r,value:s,label:d,disabled:p,id:m,onChange:o,...n},l)=>{let b=e__namespace.useId(),c=m||b,f=v=>{o&&o(v);};return e__namespace.createElement("div",{className:"flex items-center space-x-2"},e__namespace.createElement("input",{type:"radio",className:chunkITRGJNWL_cjs.a(w({variant:t,size:r,className:u})),ref:l,id:c,value:s,disabled:p,onChange:f,...n}),d&&e__namespace.createElement("label",{htmlFor:c,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"},d))});N.displayName="RadioItem";exports.a=V;exports.b=w;exports.c=E;exports.d=N;//# sourceMappingURL=chunk-YLAUFUIS.cjs.map
|
|
3
|
+
//# sourceMappingURL=chunk-YLAUFUIS.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/core/radio-group.tsx"],"names":["radioGroupVariants","cva","radioItemVariants","RadioGroup","e","className","error","helperText","label","required","orientation","name","defaultValue","value","onValueChange","disabled","children","props","ref","radioGroupId","labelId","helperTextId","errorId","handleChange","event","cn","child","isControlled","childProps","RadioItem","variant","radioSize","id","onChange","generatedId","radioId"],"mappings":"ufAIA,IAAMA,CAAAA,CAAqBC,0BAAAA,CAAI,YAAA,CAAc,CAC3C,QAAA,CAAU,CACR,YAAa,CACX,QAAA,CAAU,cACV,UAAA,CAAY,2CACd,CACF,CAAA,CACA,gBAAiB,CACf,WAAA,CAAa,UACf,CACF,CAAC,EAEKC,CAAAA,CAAoBD,0BAAAA,CACxB,oWAAA,CACA,CACE,SAAU,CACR,OAAA,CAAS,CACP,OAAA,CACE,uGAAA,CACF,MACE,+HAAA,CACF,OAAA,CACE,+HACJ,CAAA,CACA,KAAM,CACJ,OAAA,CAAS,UACT,EAAA,CAAI,SAAA,CACJ,GAAI,SACN,CACF,CAAA,CACA,eAAA,CAAiB,CACf,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AAMgB,EAAoB9B,YAAA,CAAA,KAAA,EAAM,CAC1B+B,EAAUH,CAAAA,EAAME,CAAAA,CAEhBX,EAAgBC,CAAAA,EAA+C,CAC/DS,CAAAA,EACFA,CAAAA,CAAST,CAAK,EAElB,CAAA,CAEA,OACEpB,YAAA,CAAA,aAAA,CAAC,KAAA,CAAA,CAAI,UAAU,6BAAA,CAAA,CACbA,YAAA,CAAA,aAAA,CAAC,OAAA,CAAA,CACC,IAAA,CAAK,QACL,SAAA,CAAWqB,mBAAAA,CACTvB,EAAkB,CAAE,OAAA,CAAA4B,EAAS,IAAA,CAAMC,CAAAA,CAAW,SAAA,CAAA1B,CAAU,CAAC,CAC3D,CAAA,CACA,IAAKa,CAAAA,CACL,EAAA,CAAIiB,EACJ,KAAA,CAAOtB,CAAAA,CACP,QAAA,CAAUE,CAAAA,CACV,SAAUQ,CAAAA,CACT,GAAGN,EACN,CAAA,CACCT,CAAAA,EACCJ,2BAAC,OAAA,CAAA,CACC,OAAA,CAAS+B,CAAAA,CACT,SAAA,CAAU,8FAET3B,CACH,CAEJ,CAEJ,CACF,EACAqB,EAAU,WAAA,CAAc,WAAA","file":"chunk-MLJZU63I.cjs","sourcesContent":["import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../lib/utils\";\n\nconst radioGroupVariants = cva(\"grid gap-2\", {\n variants: {\n orientation: {\n vertical: \"grid-cols-1\",\n horizontal: \"grid-cols-2 sm:grid-cols-3 md:grid-cols-4\",\n },\n },\n defaultVariants: {\n orientation: \"vertical\",\n },\n});\n\nconst radioItemVariants = cva(\n \"peer h-4 w-4 shrink-0 rounded-full border border-border shadow-sm 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 data-[state=checked]:border-primary transition-all duration-200\",\n {\n variants: {\n variant: {\n default:\n \"border-border hover:border-border data-[state=checked]:bg-primary data-[state=checked]:border-primary\",\n error:\n \"border-destructive focus-visible:ring-destructive data-[state=checked]:bg-destructive data-[state=checked]:border-destructive\",\n success:\n \"border-success-500 focus-visible:ring-success-500 data-[state=checked]:bg-success-500 data-[state=checked]:border-success-500\",\n },\n size: {\n default: \"h-4 w-4\",\n sm: \"h-3 w-3\",\n lg: \"h-5 w-5\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\nexport interface RadioGroupProps\n extends\n React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof radioGroupVariants> {\n /**\n * Whether the radio group is in an error state\n * @default false\n */\n error?: boolean;\n /**\n * Helper text to display below the radio group\n */\n helperText?: string;\n /**\n * Label text for the radio group\n */\n label?: string;\n /**\n * Whether the radio group is required\n * @default false\n */\n required?: boolean;\n /**\n * The name attribute for all radio buttons in the group\n */\n name?: string;\n /**\n * The default value of the radio group\n */\n defaultValue?: string;\n /**\n * The controlled value of the radio group\n */\n value?: string;\n /**\n * Callback fired when the value changes\n */\n onValueChange?: (value: string) => void;\n /**\n * Whether the radio group is disabled\n * @default false\n */\n disabled?: boolean;\n}\n\nexport interface RadioItemProps\n extends\n Omit<React.InputHTMLAttributes<HTMLInputElement>, \"size\">,\n VariantProps<typeof radioItemVariants> {\n /**\n * The value of the radio item\n */\n value: string;\n /**\n * The label for the radio item\n */\n label?: string;\n /**\n * Whether the radio item is disabled\n * @default false\n */\n disabled?: boolean;\n}\n\nconst RadioGroup = React.forwardRef<HTMLDivElement, RadioGroupProps>(\n (\n {\n className,\n error,\n helperText,\n label,\n required,\n orientation,\n name,\n defaultValue,\n value,\n onValueChange,\n disabled,\n children,\n ...props\n },\n ref,\n ) => {\n const radioGroupId = React.useId();\n const labelId = label ? `${radioGroupId}-label` : undefined;\n const helperTextId = helperText ? `${radioGroupId}-helper` : undefined;\n const errorId = error ? `${radioGroupId}-error` : undefined;\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n if (onValueChange) {\n onValueChange(event.target.value);\n }\n };\n\n return (\n <div className=\"space-y-2\">\n {label && (\n <label\n id={labelId}\n className=\"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n >\n {label}\n {required && <span className=\"text-error-500 ml-1\">*</span>}\n </label>\n )}\n <div\n ref={ref}\n className={cn(radioGroupVariants({ orientation, className }))}\n role=\"radiogroup\"\n aria-labelledby={labelId}\n aria-describedby={cn(helperTextId, errorId) || undefined}\n aria-invalid={error}\n {...props}\n >\n {React.Children.map(children, (child) => {\n if (React.isValidElement<RadioItemProps>(child)) {\n // Use controlled mode if value is provided, otherwise use uncontrolled\n const isControlled = value !== undefined;\n\n const childProps: Partial<RadioItemProps> = {\n name,\n disabled: Boolean(disabled ?? child.props.disabled),\n variant: error ? \"error\" : child.props.variant,\n ...(isControlled\n ? { checked: value === child.props.value }\n : { defaultChecked: defaultValue === child.props.value }),\n onChange: handleChange,\n };\n\n return React.cloneElement(child, childProps);\n }\n return child;\n })}\n </div>\n {helperText && (\n <p\n id={helperTextId}\n className={cn(\n \"text-sm text-muted-foreground\",\n error && \"text-destructive\",\n )}\n >\n {helperText}\n </p>\n )}\n </div>\n );\n },\n);\nRadioGroup.displayName = \"RadioGroup\";\n\nconst RadioItem = React.forwardRef<HTMLInputElement, RadioItemProps>(\n (\n {\n className,\n variant,\n size: radioSize,\n value,\n label,\n disabled,\n id,\n onChange,\n ...props\n },\n ref,\n ) => {\n const generatedId = React.useId();\n const radioId = id || generatedId;\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n if (onChange) {\n onChange(event);\n }\n };\n\n return (\n <div className=\"flex items-center space-x-2\">\n <input\n type=\"radio\"\n className={cn(\n radioItemVariants({ variant, size: radioSize, className }),\n )}\n ref={ref}\n id={radioId}\n value={value}\n disabled={disabled}\n onChange={handleChange}\n {...props}\n />\n {label && (\n <label\n htmlFor={radioId}\n className=\"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n >\n {label}\n </label>\n )}\n </div>\n );\n },\n);\nRadioItem.displayName = \"RadioItem\";\n\nexport { RadioGroup, RadioItem, radioGroupVariants, radioItemVariants };\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/core/radio-group.tsx"],"names":["radioGroupVariants","cva","radioItemVariants","RadioGroup","e","className","error","helperText","label","required","orientation","name","defaultValue","value","onValueChange","disabled","children","props","ref","radioGroupId","labelId","helperTextId","errorId","handleChange","event","cn","child","isControlled","childProps","RadioItem","variant","radioSize","id","onChange","generatedId","radioId"],"mappings":"ufAIA,IAAMA,CAAAA,CAAqBC,0BAAAA,CAAI,YAAA,CAAc,CAC3C,QAAA,CAAU,CACR,YAAa,CACX,QAAA,CAAU,cACV,UAAA,CAAY,2CACd,CACF,CAAA,CACA,gBAAiB,CACf,WAAA,CAAa,UACf,CACF,CAAC,EAEKC,CAAAA,CAAoBD,0BAAAA,CACxB,oWAAA,CACA,CACE,SAAU,CACR,OAAA,CAAS,CACP,OAAA,CACE,uGAAA,CACF,MACE,+HAAA,CACF,OAAA,CACE,+HACJ,CAAA,CACA,KAAM,CACJ,OAAA,CAAS,UACT,EAAA,CAAI,SAAA,CACJ,GAAI,SACN,CACF,CAAA,CACA,eAAA,CAAiB,CACf,OAAA,CAAS,SAAA,CACT,KAAM,SACR,CACF,CACF,CAAA,CAkEME,CAAAA,CAAmBC,YAAA,CAAA,UAAA,CACvB,CACE,CACE,SAAA,CAAAC,CAAAA,CACA,MAAAC,CAAAA,CACA,UAAA,CAAAC,EACA,KAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,YAAAC,CAAAA,CACA,IAAA,CAAAC,EACA,YAAA,CAAAC,CAAAA,CACA,MAAAC,CAAAA,CACA,aAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,EACA,QAAA,CAAAC,CAAAA,CACA,GAAGC,CACL,EACAC,CAAAA,GACG,CACH,IAAMC,CAAAA,CAAqBf,oBAAM,CAC3BgB,CAAAA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CACL,EAAA,CAAIiB,EACJ,KAAA,CAAOtB,CAAAA,CACP,QAAA,CAAUE,CAAAA,CACV,SAAUQ,CAAAA,CACT,GAAGN,EACN,CAAA,CACCT,CAAAA,EACCJ,2BAAC,OAAA,CAAA,CACC,OAAA,CAAS+B,CAAAA,CACT,SAAA,CAAU,8FAET3B,CACH,CAEJ,CAEJ,CACF,EACAqB,EAAU,WAAA,CAAc,WAAA","file":"chunk-YLAUFUIS.cjs","sourcesContent":["import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../lib/utils\";\n\nconst radioGroupVariants = cva(\"grid gap-2\", {\n variants: {\n orientation: {\n vertical: \"grid-cols-1\",\n horizontal: \"grid-cols-2 sm:grid-cols-3 md:grid-cols-4\",\n },\n },\n defaultVariants: {\n orientation: \"vertical\",\n },\n});\n\nconst radioItemVariants = cva(\n \"peer h-4 w-4 shrink-0 rounded-full border border-border shadow-sm 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 data-[state=checked]:border-primary transition-all duration-200\",\n {\n variants: {\n variant: {\n default:\n \"border-border hover:border-border data-[state=checked]:bg-primary data-[state=checked]:border-primary\",\n error:\n \"border-destructive focus-visible:ring-destructive data-[state=checked]:bg-destructive data-[state=checked]:border-destructive\",\n success:\n \"border-success-500 focus-visible:ring-success-500 data-[state=checked]:bg-success-500 data-[state=checked]:border-success-500\",\n },\n size: {\n default: \"h-4 w-4\",\n sm: \"h-3 w-3\",\n lg: \"h-5 w-5\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\nexport interface RadioGroupProps\n extends\n React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof radioGroupVariants> {\n /**\n * Whether the radio group is in an error state\n * @default false\n */\n error?: boolean;\n /**\n * Helper text to display below the radio group\n */\n helperText?: string;\n /**\n * Label text for the radio group\n */\n label?: string;\n /**\n * Whether the radio group is required\n * @default false\n */\n required?: boolean;\n /**\n * The name attribute for all radio buttons in the group\n */\n name?: string;\n /**\n * The default value of the radio group\n */\n defaultValue?: string;\n /**\n * The controlled value of the radio group\n */\n value?: string;\n /**\n * Callback fired when the value changes\n */\n onValueChange?: (value: string) => void;\n /**\n * Whether the radio group is disabled\n * @default false\n */\n disabled?: boolean;\n}\n\nexport interface RadioItemProps\n extends\n Omit<React.InputHTMLAttributes<HTMLInputElement>, \"size\">,\n VariantProps<typeof radioItemVariants> {\n /**\n * The value of the radio item\n */\n value: string;\n /**\n * The label for the radio item\n */\n label?: string;\n /**\n * Whether the radio item is disabled\n * @default false\n */\n disabled?: boolean;\n}\n\nconst RadioGroup = React.forwardRef<HTMLDivElement, RadioGroupProps>(\n (\n {\n className,\n error,\n helperText,\n label,\n required,\n orientation,\n name,\n defaultValue,\n value,\n onValueChange,\n disabled,\n children,\n ...props\n },\n ref,\n ) => {\n const radioGroupId = React.useId();\n const labelId = label ? `${radioGroupId}-label` : undefined;\n const helperTextId = helperText ? `${radioGroupId}-helper` : undefined;\n const errorId = error ? `${radioGroupId}-error` : undefined;\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n if (onValueChange) {\n onValueChange(event.target.value);\n }\n };\n\n return (\n <div className=\"space-y-2\">\n {label && (\n <label\n id={labelId}\n className=\"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n >\n {label}\n {required && <span className=\"text-error-500 ml-1\">*</span>}\n </label>\n )}\n <div\n ref={ref}\n className={cn(radioGroupVariants({ orientation, className }))}\n role=\"radiogroup\"\n aria-labelledby={labelId}\n aria-describedby={cn(helperTextId, errorId) || undefined}\n aria-invalid={error}\n {...props}\n >\n {React.Children.map(children, (child) => {\n if (React.isValidElement<RadioItemProps>(child)) {\n // Use controlled mode if value is provided, otherwise use uncontrolled\n const isControlled = value !== undefined;\n\n const childProps: Partial<RadioItemProps> = {\n name,\n disabled: Boolean(disabled ?? child.props.disabled),\n variant: error ? \"error\" : child.props.variant,\n ...(isControlled\n ? { checked: value === child.props.value }\n : { defaultChecked: defaultValue === child.props.value }),\n onChange: handleChange,\n };\n\n return React.cloneElement(child, childProps);\n }\n return child;\n })}\n </div>\n {helperText && (\n <p\n id={helperTextId}\n className={cn(\n \"text-sm text-muted-foreground\",\n error && \"text-destructive\",\n )}\n >\n {helperText}\n </p>\n )}\n </div>\n );\n },\n);\nRadioGroup.displayName = \"RadioGroup\";\n\nconst RadioItem = React.forwardRef<HTMLInputElement, RadioItemProps>(\n (\n {\n className,\n variant,\n size: radioSize,\n value,\n label,\n disabled,\n id,\n onChange,\n ...props\n },\n ref,\n ) => {\n const generatedId = React.useId();\n const radioId = id || generatedId;\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n if (onChange) {\n onChange(event);\n }\n };\n\n return (\n <div className=\"flex items-center space-x-2\">\n <input\n type=\"radio\"\n className={cn(\n radioItemVariants({ variant, size: radioSize, className }),\n )}\n ref={ref}\n id={radioId}\n value={value}\n disabled={disabled}\n onChange={handleChange}\n {...props}\n />\n {label && (\n <label\n htmlFor={radioId}\n className=\"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n >\n {label}\n </label>\n )}\n </div>\n );\n },\n);\nRadioItem.displayName = \"RadioItem\";\n\n// Both names, on purpose. `RadioGroupItem` is what shadcn calls it and what\n// every example in the docs uses; `RadioItem` is what this file has always\n// called it. The alias used to live only in the barrel, so\n// `@jarllyng/nostromo/radio-group` and `@jarllyng/nostromo` disagreed about the\n// name of the same component - and the documented subpath import did not resolve.\nexport {\n RadioGroup,\n RadioItem,\n RadioItem as RadioGroupItem,\n radioGroupVariants,\n radioItemVariants,\n};\n"]}
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
4
|
|
|
5
5
|
declare const alertVariants: (props?: ({
|
|
6
|
-
variant?: "
|
|
6
|
+
variant?: "error" | "default" | "success" | "warning" | "info" | null | undefined;
|
|
7
7
|
size?: "default" | "sm" | "lg" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
declare const alertTitleVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
4
|
|
|
5
5
|
declare const alertVariants: (props?: ({
|
|
6
|
-
variant?: "
|
|
6
|
+
variant?: "error" | "default" | "success" | "warning" | "info" | null | undefined;
|
|
7
7
|
size?: "default" | "sm" | "lg" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
declare const alertTitleVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
4
|
|
|
5
5
|
declare const badgeVariants: (props?: ({
|
|
6
|
-
variant?: "default" | "secondary" | "outline" | "destructive" | "success" | "
|
|
6
|
+
variant?: "error" | "default" | "secondary" | "outline" | "destructive" | "success" | "warning" | "info" | null | undefined;
|
|
7
7
|
size?: "default" | "sm" | "lg" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
/**
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
4
|
|
|
5
5
|
declare const badgeVariants: (props?: ({
|
|
6
|
-
variant?: "default" | "secondary" | "outline" | "destructive" | "success" | "
|
|
6
|
+
variant?: "error" | "default" | "secondary" | "outline" | "destructive" | "success" | "warning" | "info" | null | undefined;
|
|
7
7
|
size?: "default" | "sm" | "lg" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
/**
|
|
@@ -7,7 +7,7 @@ declare const breadcrumbVariants: (props?: ({
|
|
|
7
7
|
separator?: "default" | "slash" | "arrow" | "dot" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
declare const breadcrumbItemVariants: (props?: ({
|
|
10
|
-
variant?: "
|
|
10
|
+
variant?: "link" | "default" | "current" | null | undefined;
|
|
11
11
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
12
12
|
declare const breadcrumbSeparatorVariants: (props?: ({
|
|
13
13
|
variant?: "default" | "compact" | null | undefined;
|
|
@@ -7,7 +7,7 @@ declare const breadcrumbVariants: (props?: ({
|
|
|
7
7
|
separator?: "default" | "slash" | "arrow" | "dot" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
9
9
|
declare const breadcrumbItemVariants: (props?: ({
|
|
10
|
-
variant?: "
|
|
10
|
+
variant?: "link" | "default" | "current" | null | undefined;
|
|
11
11
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
12
12
|
declare const breadcrumbSeparatorVariants: (props?: ({
|
|
13
13
|
variant?: "default" | "compact" | null | undefined;
|
|
@@ -3,9 +3,9 @@ import * as React from 'react';
|
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
4
|
|
|
5
5
|
declare const buttonVariants: (props?: ({
|
|
6
|
-
variant?: "default" | "secondary" | "outline" | "ghost" | "destructive" | "subtle" |
|
|
6
|
+
variant?: "link" | "default" | "secondary" | "outline" | "ghost" | "destructive" | "subtle" | null | undefined;
|
|
7
7
|
size?: "default" | "sm" | "lg" | "xl" | "icon" | null | undefined;
|
|
8
|
-
state?: "
|
|
8
|
+
state?: "error" | "default" | "loading" | "success" | null | undefined;
|
|
9
9
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
10
10
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
11
11
|
/**
|
|
@@ -3,9 +3,9 @@ import * as React from 'react';
|
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
4
|
|
|
5
5
|
declare const buttonVariants: (props?: ({
|
|
6
|
-
variant?: "default" | "secondary" | "outline" | "ghost" | "destructive" | "subtle" |
|
|
6
|
+
variant?: "link" | "default" | "secondary" | "outline" | "ghost" | "destructive" | "subtle" | null | undefined;
|
|
7
7
|
size?: "default" | "sm" | "lg" | "xl" | "icon" | null | undefined;
|
|
8
|
-
state?: "
|
|
8
|
+
state?: "error" | "default" | "loading" | "success" | null | undefined;
|
|
9
9
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
10
10
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
11
11
|
/**
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';var chunkBDRP7ALG_cjs=require('../../chunk-BDRP7ALG.cjs');require('../../chunk-5PVFLXPO.cjs'),require('../../chunk-7SPPGTBT.cjs'),require('../../chunk-ITRGJNWL.cjs');Object.defineProperty(exports,"Carousel",{enumerable:true,get:function(){return chunkBDRP7ALG_cjs.b}});Object.defineProperty(exports,"CarouselContent",{enumerable:true,get:function(){return chunkBDRP7ALG_cjs.c}});Object.defineProperty(exports,"CarouselItem",{enumerable:true,get:function(){return chunkBDRP7ALG_cjs.d}});Object.defineProperty(exports,"CarouselNext",{enumerable:true,get:function(){return chunkBDRP7ALG_cjs.f}});Object.defineProperty(exports,"CarouselPrevious",{enumerable:true,get:function(){return chunkBDRP7ALG_cjs.e}});Object.defineProperty(exports,"useCarousel",{enumerable:true,get:function(){return chunkBDRP7ALG_cjs.a}});//# sourceMappingURL=carousel.cjs.map
|
|
3
|
+
//# sourceMappingURL=carousel.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"carousel.cjs"}
|