@jarllyng/nostromo 3.8.0 → 3.10.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/dist/chunk-45W3AH36.cjs +3 -0
- package/dist/chunk-45W3AH36.cjs.map +1 -0
- package/dist/chunk-BISYWH74.js +3 -0
- package/dist/chunk-BISYWH74.js.map +1 -0
- package/dist/chunk-FMIAI6US.cjs +3 -0
- package/dist/chunk-FMIAI6US.cjs.map +1 -0
- package/dist/chunk-FTAB43WC.js +3 -0
- package/dist/chunk-FTAB43WC.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-QEHKWS7N.cjs +3 -0
- package/dist/chunk-QEHKWS7N.cjs.map +1 -0
- package/dist/chunk-VBGHESL2.js +3 -0
- package/dist/chunk-VBGHESL2.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/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/menubar.cjs +3 -0
- package/dist/components/core/menubar.cjs.map +1 -0
- package/dist/components/core/menubar.d.cts +41 -0
- package/dist/components/core/menubar.d.ts +41 -0
- package/dist/components/core/menubar.js +3 -0
- package/dist/components/core/menubar.js.map +1 -0
- package/dist/components/core/navigation-menu.cjs +3 -0
- package/dist/components/core/navigation-menu.cjs.map +1 -0
- package/dist/components/core/navigation-menu.d.cts +29 -0
- package/dist/components/core/navigation-menu.d.ts +29 -0
- package/dist/components/core/navigation-menu.js +3 -0
- package/dist/components/core/navigation-menu.js.map +1 -0
- package/dist/components/core/radio-group.cjs +1 -1
- package/dist/components/core/radio-group.d.cts +1 -1
- package/dist/components/core/radio-group.d.ts +1 -1
- package/dist/components/core/radio-group.js +1 -1
- package/dist/components/core/slider.cjs +3 -0
- package/dist/components/core/slider.cjs.map +1 -0
- package/dist/components/core/slider.d.cts +29 -0
- package/dist/components/core/slider.d.ts +29 -0
- package/dist/components/core/slider.js +3 -0
- package/dist/components/core/slider.js.map +1 -0
- 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 +445 -139
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';var chunkITRGJNWL_cjs=require('./chunk-ITRGJNWL.cjs'),t=require('react'),e=require('@radix-ui/react-navigation-menu'),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 t__namespace=/*#__PURE__*/_interopNamespace(t);var e__namespace=/*#__PURE__*/_interopNamespace(e);var d=t__namespace.forwardRef(({className:i,children:a,...o},r)=>t__namespace.createElement(e__namespace.Root,{ref:r,className:chunkITRGJNWL_cjs.a("relative z-10 flex max-w-max flex-1 items-center justify-center",i),...o},a,t__namespace.createElement(m,null)));d.displayName=e__namespace.Root.displayName;var v=t__namespace.forwardRef(({className:i,...a},o)=>t__namespace.createElement(e__namespace.List,{ref:o,className:chunkITRGJNWL_cjs.a("group flex flex-1 list-none items-center justify-center gap-1",i),...a}));v.displayName=e__namespace.List.displayName;var N=e__namespace.Item,u=classVarianceAuthority.cva("group inline-flex h-9 w-max items-center justify-center rounded-md px-4 py-2 text-sm font-medium transition-colors hover:bg-muted hover:text-foreground focus:bg-muted focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=open]:bg-muted"),f=t__namespace.forwardRef(({className:i,children:a,...o},r)=>t__namespace.createElement(e__namespace.Trigger,{ref:r,className:chunkITRGJNWL_cjs.a(u(),"gap-1",i),...o},a,t__namespace.createElement("svg",{viewBox:"0 0 16 16",fill:"none",className:"h-3 w-3 transition-transform duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"},t__namespace.createElement("path",{d:"m4 6 4 4 4-4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}))));f.displayName=e__namespace.Trigger.displayName;var g=t__namespace.forwardRef(({className:i,...a},o)=>t__namespace.createElement(e__namespace.Content,{ref:o,className:chunkITRGJNWL_cjs.a("left-0 top-0 w-full p-4 md:absolute md:w-auto data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in-0 data-[motion^=to-]:fade-out-0",i),...a}));g.displayName=e__namespace.Content.displayName;var R=e__namespace.Link,m=t__namespace.forwardRef(({className:i,...a},o)=>t__namespace.createElement("div",{className:"absolute left-0 top-full flex justify-center"},t__namespace.createElement(e__namespace.Viewport,{ref:o,className:chunkITRGJNWL_cjs.a("relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-lg border border-border bg-background text-foreground shadow-lg md:w-[var(--radix-navigation-menu-viewport-width)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",i),...a})));m.displayName=e__namespace.Viewport.displayName;var l=t__namespace.forwardRef(({className:i,...a},o)=>t__namespace.createElement(e__namespace.Indicator,{ref:o,className:chunkITRGJNWL_cjs.a("top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out-0 data-[state=visible]:fade-in-0",i),...a},t__namespace.createElement("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border"})));l.displayName=e__namespace.Indicator.displayName;exports.a=d;exports.b=v;exports.c=N;exports.d=u;exports.e=f;exports.f=g;exports.g=R;exports.h=m;exports.i=l;//# sourceMappingURL=chunk-45W3AH36.cjs.map
|
|
3
|
+
//# sourceMappingURL=chunk-45W3AH36.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/core/navigation-menu.tsx"],"names":["NavigationMenu","t","className","children","props","ref","e","cn","NavigationMenuViewport","NavigationMenuList","NavigationMenuItem","navigationMenuTriggerStyle","cva","NavigationMenuTrigger","NavigationMenuContent","NavigationMenuLink","NavigationMenuIndicator"],"mappings":"ulBAoBA,IAAMA,CAAAA,CAAuBC,YAAA,CAAA,UAAA,CAG3B,CAAC,CAAE,SAAA,CAAAC,CAAAA,CAAW,QAAA,CAAAC,CAAAA,CAAU,GAAGC,CAAM,CAAA,CAAGC,CAAAA,GACpCJ,YAAA,CAAA,aAAA,CAAyBK,YAAA,CAAA,IAAA,CAAxB,CACC,GAAA,CAAKD,CAAAA,CACL,UAAWE,mBAAAA,CACT,iEAAA,CACAL,CACF,CAAA,CACC,GAAGE,CAAAA,CAAAA,CAEHD,CAAAA,CACDF,YAAA,CAAA,aAAA,CAACO,CAAAA,CAAA,IAAuB,CAC1B,CACD,EACDR,CAAAA,CAAe,YAAsCM,YAAA,CAAA,IAAA,CAAK,WAAA,CAE1D,IAAMG,CAAAA,CAA2BR,YAAA,CAAA,UAAA,CAG/B,CAAC,CAAE,SAAA,CAAAC,CAAAA,CAAW,GAAGE,CAAM,CAAA,CAAGC,CAAAA,GAC1BJ,YAAA,CAAA,aAAA,CAAyBK,kBAAxB,CACC,GAAA,CAAKD,CAAAA,CACL,SAAA,CAAWE,mBAAAA,CACT,+DAAA,CACAL,CACF,CAAA,CACC,GAAGE,CAAAA,CACN,CACD,EACDK,CAAAA,CAAmB,WAAA,CAAsCH,kBAAK,WAAA,CAE9D,IAAMI,CAAAA,CAA6CJ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AAA,UAAA,CAGnC,CAAC,CAAE,SAAA,CAAAC,CAAAA,CAAW,GAAGE,CAAM,CAAA,CAAGC,CAAAA,GAC1BJ,YAAA,CAAA,aAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,8CAAA,CAAA,CACbA,YAAA,CAAA,aAAA,CAAyBK,YAAA,CAAA,QAAA,CAAxB,CACC,GAAA,CAAKD,CAAAA,CACL,SAAA,CAAWE,mBAAAA,CACT,8UAAA,CAKAL,CACF,CAAA,CACC,GAAGE,CAAAA,CACN,CACF,CACD,EACDI,CAAAA,CAAuB,WAAA,CACGF,YAAA,CAAA,QAAA,CAAS,WAAA,CAEnC,IAAMU,CAAAA,CAAgCf,YAAA,CAAA,UAAA,CAGpC,CAAC,CAAE,SAAA,CAAAC,CAAAA,CAAW,GAAGE,CAAM,CAAA,CAAGC,CAAAA,GAC1BJ,YAAA,CAAA,aAAA,CAAyBK,YAAA,CAAA,SAAA,CAAxB,CACC,GAAA,CAAKD,CAAAA,CACL,SAAA,CAAWE,mBAAAA,CACT,kMAAA,CAGAL,CACF,CAAA,CACC,GAAGE,CAAAA,CAAAA,CAEJH,YAAA,CAAA,aAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,8DAAA,CAA+D,CAChF,CACD,EACDe,CAAAA,CAAwB,WAAA,CACEV,YAAA,CAAA,SAAA,CAAU,WAAA","file":"chunk-45W3AH36.cjs","sourcesContent":["import * as React from \"react\";\nimport * as NavigationMenuPrimitive from \"@radix-ui/react-navigation-menu\";\nimport { cva } from \"class-variance-authority\";\nimport { cn } from \"../../lib/utils\";\n\n/**\n * Site navigation with panels: a header where \"Products\" opens a grid of links.\n *\n * Not a menu, despite the name. A `DropdownMenu` runs commands and uses menu\n * roles; this is a `<nav>` full of links, and Radix keeps it that way. That\n * distinction is the reason to use this one for site navigation - a screen\n * reader user gets a navigation landmark and a list of links rather than a menu\n * they are expected to act on.\n *\n * The viewport is where the active panel is drawn. It sits outside the list so\n * one panel can animate into the next without the trigger row reflowing, which\n * is why it is a separate component rather than something rendered inside each\n * item.\n */\n\nconst NavigationMenu = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root>\n>(({ className, children, ...props }, ref) => (\n <NavigationMenuPrimitive.Root\n ref={ref}\n className={cn(\n \"relative z-10 flex max-w-max flex-1 items-center justify-center\",\n className,\n )}\n {...props}\n >\n {children}\n <NavigationMenuViewport />\n </NavigationMenuPrimitive.Root>\n));\nNavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;\n\nconst NavigationMenuList = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.List\n ref={ref}\n className={cn(\n \"group flex flex-1 list-none items-center justify-center gap-1\",\n className,\n )}\n {...props}\n />\n));\nNavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName;\n\nconst NavigationMenuItem = NavigationMenuPrimitive.Item;\n\nconst navigationMenuTriggerStyle = cva(\n \"group inline-flex h-9 w-max items-center justify-center rounded-md px-4 py-2 text-sm font-medium \" +\n \"transition-colors hover:bg-muted hover:text-foreground \" +\n \"focus:bg-muted focus:outline-none disabled:pointer-events-none disabled:opacity-50 \" +\n \"data-[state=open]:bg-muted\",\n);\n\nconst NavigationMenuTrigger = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <NavigationMenuPrimitive.Trigger\n ref={ref}\n className={cn(navigationMenuTriggerStyle(), \"gap-1\", className)}\n {...props}\n >\n {children}\n <svg\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n className=\"h-3 w-3 transition-transform duration-200 group-data-[state=open]:rotate-180\"\n aria-hidden=\"true\"\n >\n <path\n d=\"m4 6 4 4 4-4\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </NavigationMenuPrimitive.Trigger>\n));\nNavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;\n\nconst NavigationMenuContent = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Content\n ref={ref}\n className={cn(\n \"left-0 top-0 w-full p-4 md:absolute md:w-auto \" +\n \"data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out \" +\n \"data-[motion^=from-]:fade-in-0 data-[motion^=to-]:fade-out-0\",\n className,\n )}\n {...props}\n />\n));\nNavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;\n\nconst NavigationMenuLink = NavigationMenuPrimitive.Link;\n\nconst NavigationMenuViewport = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Viewport>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>\n>(({ className, ...props }, ref) => (\n <div className=\"absolute left-0 top-full flex justify-center\">\n <NavigationMenuPrimitive.Viewport\n ref={ref}\n className={cn(\n \"relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden \" +\n \"rounded-lg border border-border bg-background text-foreground shadow-lg \" +\n \"md:w-[var(--radix-navigation-menu-viewport-width)] \" +\n \"data-[state=open]:animate-in data-[state=closed]:animate-out \" +\n \"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95\",\n className,\n )}\n {...props}\n />\n </div>\n));\nNavigationMenuViewport.displayName =\n NavigationMenuPrimitive.Viewport.displayName;\n\nconst NavigationMenuIndicator = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Indicator>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Indicator>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Indicator\n ref={ref}\n className={cn(\n \"top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden \" +\n \"data-[state=visible]:animate-in data-[state=hidden]:animate-out \" +\n \"data-[state=hidden]:fade-out-0 data-[state=visible]:fade-in-0\",\n className,\n )}\n {...props}\n >\n <div className=\"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border\" />\n </NavigationMenuPrimitive.Indicator>\n));\nNavigationMenuIndicator.displayName =\n NavigationMenuPrimitive.Indicator.displayName;\n\nexport {\n NavigationMenu,\n NavigationMenuList,\n NavigationMenuItem,\n NavigationMenuTrigger,\n NavigationMenuContent,\n NavigationMenuLink,\n NavigationMenuViewport,\n NavigationMenuIndicator,\n navigationMenuTriggerStyle,\n};\n"]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {a}from'./chunk-AC2JBXHQ.js';import*as t from'react';import*as e from'@radix-ui/react-navigation-menu';import {cva}from'class-variance-authority';var d=t.forwardRef(({className:i,children:a$1,...o},r)=>t.createElement(e.Root,{ref:r,className:a("relative z-10 flex max-w-max flex-1 items-center justify-center",i),...o},a$1,t.createElement(m,null)));d.displayName=e.Root.displayName;var v=t.forwardRef(({className:i,...a$1},o)=>t.createElement(e.List,{ref:o,className:a("group flex flex-1 list-none items-center justify-center gap-1",i),...a$1}));v.displayName=e.List.displayName;var N=e.Item,u=cva("group inline-flex h-9 w-max items-center justify-center rounded-md px-4 py-2 text-sm font-medium transition-colors hover:bg-muted hover:text-foreground focus:bg-muted focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=open]:bg-muted"),f=t.forwardRef(({className:i,children:a$1,...o},r)=>t.createElement(e.Trigger,{ref:r,className:a(u(),"gap-1",i),...o},a$1,t.createElement("svg",{viewBox:"0 0 16 16",fill:"none",className:"h-3 w-3 transition-transform duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"},t.createElement("path",{d:"m4 6 4 4 4-4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}))));f.displayName=e.Trigger.displayName;var g=t.forwardRef(({className:i,...a$1},o)=>t.createElement(e.Content,{ref:o,className:a("left-0 top-0 w-full p-4 md:absolute md:w-auto data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in-0 data-[motion^=to-]:fade-out-0",i),...a$1}));g.displayName=e.Content.displayName;var R=e.Link,m=t.forwardRef(({className:i,...a$1},o)=>t.createElement("div",{className:"absolute left-0 top-full flex justify-center"},t.createElement(e.Viewport,{ref:o,className:a("relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-lg border border-border bg-background text-foreground shadow-lg md:w-[var(--radix-navigation-menu-viewport-width)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",i),...a$1})));m.displayName=e.Viewport.displayName;var l=t.forwardRef(({className:i,...a$1},o)=>t.createElement(e.Indicator,{ref:o,className:a("top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out-0 data-[state=visible]:fade-in-0",i),...a$1},t.createElement("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border"})));l.displayName=e.Indicator.displayName;export{d as a,v as b,N as c,u as d,f as e,g as f,R as g,m as h,l as i};//# sourceMappingURL=chunk-BISYWH74.js.map
|
|
3
|
+
//# sourceMappingURL=chunk-BISYWH74.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/core/navigation-menu.tsx"],"names":["NavigationMenu","className","children","props","ref","cn","NavigationMenuViewport","NavigationMenuList","NavigationMenuItem","navigationMenuTriggerStyle","cva","NavigationMenuTrigger","NavigationMenuContent","NavigationMenuLink","NavigationMenuIndicator"],"mappings":"yJAoBA,IAAMA,CAAAA,CAAuB,CAAA,CAAA,UAAA,CAG3B,CAAC,CAAE,SAAA,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A,CAAA,aAAA,CAAyB,CAAA,CAAA,SAAA,CAAxB,CACC,GAAA,CAAKA,CAAAA,CACL,SAAA,CAAWC,CAAAA,CACT,kMAAA,CAGAJ,CACF,CAAA,CACC,GAAGE,GAAAA,CAAAA,CAEJ,CAAA,CAAA,aAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,8DAAA,CAA+D,CAChF,CACD,EACDW,CAAAA,CAAwB,WAAA,CACE,CAAA,CAAA,SAAA,CAAU,WAAA","file":"chunk-BISYWH74.js","sourcesContent":["import * as React from \"react\";\nimport * as NavigationMenuPrimitive from \"@radix-ui/react-navigation-menu\";\nimport { cva } from \"class-variance-authority\";\nimport { cn } from \"../../lib/utils\";\n\n/**\n * Site navigation with panels: a header where \"Products\" opens a grid of links.\n *\n * Not a menu, despite the name. A `DropdownMenu` runs commands and uses menu\n * roles; this is a `<nav>` full of links, and Radix keeps it that way. That\n * distinction is the reason to use this one for site navigation - a screen\n * reader user gets a navigation landmark and a list of links rather than a menu\n * they are expected to act on.\n *\n * The viewport is where the active panel is drawn. It sits outside the list so\n * one panel can animate into the next without the trigger row reflowing, which\n * is why it is a separate component rather than something rendered inside each\n * item.\n */\n\nconst NavigationMenu = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root>\n>(({ className, children, ...props }, ref) => (\n <NavigationMenuPrimitive.Root\n ref={ref}\n className={cn(\n \"relative z-10 flex max-w-max flex-1 items-center justify-center\",\n className,\n )}\n {...props}\n >\n {children}\n <NavigationMenuViewport />\n </NavigationMenuPrimitive.Root>\n));\nNavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;\n\nconst NavigationMenuList = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.List\n ref={ref}\n className={cn(\n \"group flex flex-1 list-none items-center justify-center gap-1\",\n className,\n )}\n {...props}\n />\n));\nNavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName;\n\nconst NavigationMenuItem = NavigationMenuPrimitive.Item;\n\nconst navigationMenuTriggerStyle = cva(\n \"group inline-flex h-9 w-max items-center justify-center rounded-md px-4 py-2 text-sm font-medium \" +\n \"transition-colors hover:bg-muted hover:text-foreground \" +\n \"focus:bg-muted focus:outline-none disabled:pointer-events-none disabled:opacity-50 \" +\n \"data-[state=open]:bg-muted\",\n);\n\nconst NavigationMenuTrigger = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <NavigationMenuPrimitive.Trigger\n ref={ref}\n className={cn(navigationMenuTriggerStyle(), \"gap-1\", className)}\n {...props}\n >\n {children}\n <svg\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n className=\"h-3 w-3 transition-transform duration-200 group-data-[state=open]:rotate-180\"\n aria-hidden=\"true\"\n >\n <path\n d=\"m4 6 4 4 4-4\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </NavigationMenuPrimitive.Trigger>\n));\nNavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;\n\nconst NavigationMenuContent = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Content\n ref={ref}\n className={cn(\n \"left-0 top-0 w-full p-4 md:absolute md:w-auto \" +\n \"data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out \" +\n \"data-[motion^=from-]:fade-in-0 data-[motion^=to-]:fade-out-0\",\n className,\n )}\n {...props}\n />\n));\nNavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;\n\nconst NavigationMenuLink = NavigationMenuPrimitive.Link;\n\nconst NavigationMenuViewport = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Viewport>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>\n>(({ className, ...props }, ref) => (\n <div className=\"absolute left-0 top-full flex justify-center\">\n <NavigationMenuPrimitive.Viewport\n ref={ref}\n className={cn(\n \"relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden \" +\n \"rounded-lg border border-border bg-background text-foreground shadow-lg \" +\n \"md:w-[var(--radix-navigation-menu-viewport-width)] \" +\n \"data-[state=open]:animate-in data-[state=closed]:animate-out \" +\n \"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95\",\n className,\n )}\n {...props}\n />\n </div>\n));\nNavigationMenuViewport.displayName =\n NavigationMenuPrimitive.Viewport.displayName;\n\nconst NavigationMenuIndicator = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Indicator>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Indicator>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Indicator\n ref={ref}\n className={cn(\n \"top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden \" +\n \"data-[state=visible]:animate-in data-[state=hidden]:animate-out \" +\n \"data-[state=hidden]:fade-out-0 data-[state=visible]:fade-in-0\",\n className,\n )}\n {...props}\n >\n <div className=\"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border\" />\n </NavigationMenuPrimitive.Indicator>\n));\nNavigationMenuIndicator.displayName =\n NavigationMenuPrimitive.Indicator.displayName;\n\nexport {\n NavigationMenu,\n NavigationMenuList,\n NavigationMenuItem,\n NavigationMenuTrigger,\n NavigationMenuContent,\n NavigationMenuLink,\n NavigationMenuViewport,\n NavigationMenuIndicator,\n navigationMenuTriggerStyle,\n};\n"]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';var chunkMIYL7YKU_cjs=require('./chunk-MIYL7YKU.cjs'),chunkITRGJNWL_cjs=require('./chunk-ITRGJNWL.cjs'),t=require('react'),e=require('@radix-ui/react-menubar');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 t__namespace=/*#__PURE__*/_interopNamespace(t);var e__namespace=/*#__PURE__*/_interopNamespace(e);var d=t__namespace.forwardRef(({className:r,...a},i)=>t__namespace.createElement(e__namespace.Root,{ref:i,className:chunkITRGJNWL_cjs.a("flex items-center gap-1 rounded-lg border border-border bg-background p-1",r),...a}));d.displayName=e__namespace.Root.displayName;var M=t__namespace.forwardRef(({className:r,...a},i)=>t__namespace.createElement(e__namespace.Trigger,{ref:i,className:chunkITRGJNWL_cjs.a("flex cursor-pointer select-none items-center rounded-md px-3 py-1.5 text-sm font-medium outline-none focus:bg-muted data-[state=open]:bg-muted",r),...a}));M.displayName=e__namespace.Trigger.displayName;var R=t__namespace.forwardRef(({className:r,align:a="start",sideOffset:i=6,...o},u)=>t__namespace.createElement(e__namespace.Portal,null,t__namespace.createElement(e__namespace.Content,{ref:u,align:a,sideOffset:i,className:chunkITRGJNWL_cjs.a(chunkMIYL7YKU_cjs.a,r),...o})));R.displayName=e__namespace.Content.displayName;var P=t__namespace.forwardRef(({className:r,destructive:a,inset:i,...o},u)=>t__namespace.createElement(e__namespace.Item,{ref:u,className:chunkITRGJNWL_cjs.a(chunkMIYL7YKU_cjs.b,i&&chunkMIYL7YKU_cjs.c,a&&chunkMIYL7YKU_cjs.g,r),...o}));P.displayName=e__namespace.Item.displayName;var v=t__namespace.forwardRef(({className:r,children:a,...i},o)=>t__namespace.createElement(e__namespace.CheckboxItem,{ref:o,className:chunkITRGJNWL_cjs.a(chunkMIYL7YKU_cjs.b,chunkMIYL7YKU_cjs.c,r),...i},t__namespace.createElement("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center"},t__namespace.createElement(e__namespace.ItemIndicator,null,t__namespace.createElement("svg",{viewBox:"0 0 16 16",fill:"none",className:"h-3.5 w-3.5","aria-hidden":"true"},t__namespace.createElement("path",{d:"M13 4.5 6.5 11 3 7.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})))),a));v.displayName=e__namespace.CheckboxItem.displayName;var y=t__namespace.forwardRef(({className:r,children:a,...i},o)=>t__namespace.createElement(e__namespace.RadioItem,{ref:o,className:chunkITRGJNWL_cjs.a(chunkMIYL7YKU_cjs.b,chunkMIYL7YKU_cjs.c,r),...i},t__namespace.createElement("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center"},t__namespace.createElement(e__namespace.ItemIndicator,null,t__namespace.createElement("span",{className:"h-2 w-2 rounded-full bg-current"}))),a));y.displayName=e__namespace.RadioItem.displayName;var N=t__namespace.forwardRef(({className:r,inset:a,...i},o)=>t__namespace.createElement(e__namespace.Label,{ref:o,className:chunkITRGJNWL_cjs.a(chunkMIYL7YKU_cjs.d,a&&chunkMIYL7YKU_cjs.c,r),...i}));N.displayName=e__namespace.Label.displayName;var g=t__namespace.forwardRef(({className:r,...a},i)=>t__namespace.createElement(e__namespace.Separator,{ref:i,className:chunkITRGJNWL_cjs.a(chunkMIYL7YKU_cjs.e,r),...a}));g.displayName=e__namespace.Separator.displayName;function h({className:r,...a}){return t__namespace.createElement("span",{className:chunkITRGJNWL_cjs.a(chunkMIYL7YKU_cjs.f,r),...a})}h.displayName="MenubarShortcut";var I=t__namespace.forwardRef(({className:r,inset:a,children:i,...o},u)=>t__namespace.createElement(e__namespace.SubTrigger,{ref:u,className:chunkITRGJNWL_cjs.a(chunkMIYL7YKU_cjs.b,"data-[state=open]:bg-muted",a&&chunkMIYL7YKU_cjs.c,r),...o},i,t__namespace.createElement("svg",{viewBox:"0 0 16 16",fill:"none",className:"ml-auto h-3.5 w-3.5","aria-hidden":"true"},t__namespace.createElement("path",{d:"m6 4 4 4-4 4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}))));I.displayName=e__namespace.SubTrigger.displayName;var C=t__namespace.forwardRef(({className:r,...a},i)=>t__namespace.createElement(e__namespace.Portal,null,t__namespace.createElement(e__namespace.SubContent,{ref:i,className:chunkITRGJNWL_cjs.a(chunkMIYL7YKU_cjs.a,r),...a})));C.displayName=e__namespace.SubContent.displayName;Object.defineProperty(exports,"l",{enumerable:true,get:function(){return e.Menu}});Object.defineProperty(exports,"m",{enumerable:true,get:function(){return e.Group}});Object.defineProperty(exports,"n",{enumerable:true,get:function(){return e.Sub}});Object.defineProperty(exports,"o",{enumerable:true,get:function(){return e.RadioGroup}});exports.a=d;exports.b=M;exports.c=R;exports.d=P;exports.e=v;exports.f=y;exports.g=N;exports.h=g;exports.i=h;exports.j=I;exports.k=C;//# sourceMappingURL=chunk-FMIAI6US.cjs.map
|
|
3
|
+
//# sourceMappingURL=chunk-FMIAI6US.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/core/menubar.tsx"],"names":["Menubar","t","className","props","ref","e","cn","MenubarTrigger","MenubarContent","align","sideOffset","menuSurface","MenubarItem","destructive","inset","menuItem","menuItemInset","menuDestructive","MenubarCheckboxItem","children","MenubarRadioItem","MenubarLabel","menuLabel","MenubarSeparator","menuSeparator","MenubarShortcut","menuShortcut","MenubarSubTrigger","MenubarSubContent"],"mappings":"skBA0BA,IAAMA,CAAAA,CAAgBC,YAAA,CAAA,UAAA,CAGpB,CAAC,CAAE,SAAA,CAAAC,CAAAA,CAAW,GAAGC,CAAM,CAAA,CAAGC,CAAAA,GAC1BH,2BAAkBI,YAAA,CAAA,IAAA,CAAjB,CACC,GAAA,CAAKD,CAAAA,CACL,SAAA,CAAWE,mBAAAA,CACT,4EACAJ,CACF,CAAA,CACC,GAAGC,CAAAA,CACN,CACD,EAC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CAA+BvB,YAAA,CAAA,UAAA,CAAW,WAAA","file":"chunk-FMIAI6US.cjs","sourcesContent":["import * as React from \"react\";\nimport * as MenubarPrimitive from \"@radix-ui/react-menubar\";\nimport { cn } from \"../../lib/utils\";\nimport {\n menuDestructive,\n menuItem,\n menuItemInset,\n menuLabel,\n menuSeparator,\n menuShortcut,\n menuSurface,\n} from \"./menu-styles\";\n\n/**\n * The application menu bar: File, Edit, View, each opening its own menu.\n *\n * Its own primitive rather than a row of dropdowns, because a menu bar behaves\n * as one control. Once a menu is open, moving the pointer to a neighbouring\n * trigger opens that one without a click, and the arrow keys move between menus\n * as well as within them. A row of independent `DropdownMenu`s gets none of\n * that.\n *\n * Third component reading from menu-styles, after DropdownMenu and ContextMenu.\n * All three are the same menu to look at, and now cannot drift apart.\n */\n\nconst Menubar = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.Root\n ref={ref}\n className={cn(\n \"flex items-center gap-1 rounded-lg border border-border bg-background p-1\",\n className,\n )}\n {...props}\n />\n));\nMenubar.displayName = MenubarPrimitive.Root.displayName;\n\n// Re-exported straight from the package rather than through `const X =\n// MenubarPrimitive.Y`. That form makes TypeScript infer a type naming an\n// internal Radix path, which it cannot write into the .d.ts - TS2742, \"the\n// inferred type cannot be named without a reference to ... this is likely not\n// portable\". A direct re-export skips the inference entirely.\nexport {\n Menu as MenubarMenu,\n Group as MenubarGroup,\n Sub as MenubarSub,\n RadioGroup as MenubarRadioGroup,\n} from \"@radix-ui/react-menubar\";\n\nconst MenubarTrigger = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Trigger>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.Trigger\n ref={ref}\n className={cn(\n \"flex cursor-pointer select-none items-center rounded-md px-3 py-1.5 text-sm font-medium outline-none \" +\n \"focus:bg-muted data-[state=open]:bg-muted\",\n className,\n )}\n {...props}\n />\n));\nMenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName;\n\nconst MenubarContent = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Content>\n>(({ className, align = \"start\", sideOffset = 6, ...props }, ref) => (\n <MenubarPrimitive.Portal>\n <MenubarPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(menuSurface, className)}\n {...props}\n />\n </MenubarPrimitive.Portal>\n));\nMenubarContent.displayName = MenubarPrimitive.Content.displayName;\n\nexport interface MenubarItemProps extends React.ComponentPropsWithoutRef<\n typeof MenubarPrimitive.Item\n> {\n destructive?: boolean;\n inset?: boolean;\n}\n\nconst MenubarItem = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Item>,\n MenubarItemProps\n>(({ className, destructive, inset, ...props }, ref) => (\n <MenubarPrimitive.Item\n ref={ref}\n className={cn(\n menuItem,\n inset && menuItemInset,\n destructive && menuDestructive,\n className,\n )}\n {...props}\n />\n));\nMenubarItem.displayName = MenubarPrimitive.Item.displayName;\n\nconst MenubarCheckboxItem = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.CheckboxItem>\n>(({ className, children, ...props }, ref) => (\n <MenubarPrimitive.CheckboxItem\n ref={ref}\n className={cn(menuItem, menuItemInset, className)}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <MenubarPrimitive.ItemIndicator>\n <svg\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n className=\"h-3.5 w-3.5\"\n aria-hidden=\"true\"\n >\n <path\n d=\"M13 4.5 6.5 11 3 7.5\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </MenubarPrimitive.ItemIndicator>\n </span>\n {children}\n </MenubarPrimitive.CheckboxItem>\n));\nMenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName;\n\nconst MenubarRadioItem = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <MenubarPrimitive.RadioItem\n ref={ref}\n className={cn(menuItem, menuItemInset, className)}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <MenubarPrimitive.ItemIndicator>\n <span className=\"h-2 w-2 rounded-full bg-current\" />\n </MenubarPrimitive.ItemIndicator>\n </span>\n {children}\n </MenubarPrimitive.RadioItem>\n));\nMenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName;\n\nconst MenubarLabel = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <MenubarPrimitive.Label\n ref={ref}\n className={cn(menuLabel, inset && menuItemInset, className)}\n {...props}\n />\n));\nMenubarLabel.displayName = MenubarPrimitive.Label.displayName;\n\nconst MenubarSeparator = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.Separator\n ref={ref}\n className={cn(menuSeparator, className)}\n {...props}\n />\n));\nMenubarSeparator.displayName = MenubarPrimitive.Separator.displayName;\n\nfunction MenubarShortcut({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) {\n return <span className={cn(menuShortcut, className)} {...props} />;\n}\nMenubarShortcut.displayName = \"MenubarShortcut\";\n\nconst MenubarSubTrigger = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <MenubarPrimitive.SubTrigger\n ref={ref}\n className={cn(\n menuItem,\n \"data-[state=open]:bg-muted\",\n inset && menuItemInset,\n className,\n )}\n {...props}\n >\n {children}\n <svg\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n className=\"ml-auto h-3.5 w-3.5\"\n aria-hidden=\"true\"\n >\n <path\n d=\"m6 4 4 4-4 4\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </MenubarPrimitive.SubTrigger>\n));\nMenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName;\n\nconst MenubarSubContent = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.Portal>\n <MenubarPrimitive.SubContent\n ref={ref}\n className={cn(menuSurface, className)}\n {...props}\n />\n </MenubarPrimitive.Portal>\n));\nMenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName;\n\nexport {\n Menubar,\n MenubarTrigger,\n MenubarContent,\n MenubarItem,\n MenubarCheckboxItem,\n MenubarRadioItem,\n MenubarLabel,\n MenubarSeparator,\n MenubarShortcut,\n MenubarSubTrigger,\n MenubarSubContent,\n};\n"]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {a as a$1,b,c,g as g$1,d as d$1,e as e$1,f}from'./chunk-XYPJ2K22.js';import {a}from'./chunk-AC2JBXHQ.js';import*as t from'react';import*as e from'@radix-ui/react-menubar';export{Menu as l,Group as m,Sub as n,RadioGroup as o}from'@radix-ui/react-menubar';var d=t.forwardRef(({className:r,...a$1},i)=>t.createElement(e.Root,{ref:i,className:a("flex items-center gap-1 rounded-lg border border-border bg-background p-1",r),...a$1}));d.displayName=e.Root.displayName;var M=t.forwardRef(({className:r,...a$1},i)=>t.createElement(e.Trigger,{ref:i,className:a("flex cursor-pointer select-none items-center rounded-md px-3 py-1.5 text-sm font-medium outline-none focus:bg-muted data-[state=open]:bg-muted",r),...a$1}));M.displayName=e.Trigger.displayName;var R=t.forwardRef(({className:r,align:a$2="start",sideOffset:i=6,...o},u)=>t.createElement(e.Portal,null,t.createElement(e.Content,{ref:u,align:a$2,sideOffset:i,className:a(a$1,r),...o})));R.displayName=e.Content.displayName;var P=t.forwardRef(({className:r,destructive:a$1,inset:i,...o},u)=>t.createElement(e.Item,{ref:u,className:a(b,i&&c,a$1&&g$1,r),...o}));P.displayName=e.Item.displayName;var v=t.forwardRef(({className:r,children:a$1,...i},o)=>t.createElement(e.CheckboxItem,{ref:o,className:a(b,c,r),...i},t.createElement("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center"},t.createElement(e.ItemIndicator,null,t.createElement("svg",{viewBox:"0 0 16 16",fill:"none",className:"h-3.5 w-3.5","aria-hidden":"true"},t.createElement("path",{d:"M13 4.5 6.5 11 3 7.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})))),a$1));v.displayName=e.CheckboxItem.displayName;var y=t.forwardRef(({className:r,children:a$1,...i},o)=>t.createElement(e.RadioItem,{ref:o,className:a(b,c,r),...i},t.createElement("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center"},t.createElement(e.ItemIndicator,null,t.createElement("span",{className:"h-2 w-2 rounded-full bg-current"}))),a$1));y.displayName=e.RadioItem.displayName;var N=t.forwardRef(({className:r,inset:a$1,...i},o)=>t.createElement(e.Label,{ref:o,className:a(d$1,a$1&&c,r),...i}));N.displayName=e.Label.displayName;var g=t.forwardRef(({className:r,...a$1},i)=>t.createElement(e.Separator,{ref:i,className:a(e$1,r),...a$1}));g.displayName=e.Separator.displayName;function h({className:r,...a$1}){return t.createElement("span",{className:a(f,r),...a$1})}h.displayName="MenubarShortcut";var I=t.forwardRef(({className:r,inset:a$1,children:i,...o},u)=>t.createElement(e.SubTrigger,{ref:u,className:a(b,"data-[state=open]:bg-muted",a$1&&c,r),...o},i,t.createElement("svg",{viewBox:"0 0 16 16",fill:"none",className:"ml-auto h-3.5 w-3.5","aria-hidden":"true"},t.createElement("path",{d:"m6 4 4 4-4 4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}))));I.displayName=e.SubTrigger.displayName;var C=t.forwardRef(({className:r,...a$2},i)=>t.createElement(e.Portal,null,t.createElement(e.SubContent,{ref:i,className:a(a$1,r),...a$2})));C.displayName=e.SubContent.displayName;export{d as a,M as b,R as c,P as d,v as e,y as f,N as g,g as h,h as i,I as j,C as k};//# sourceMappingURL=chunk-FTAB43WC.js.map
|
|
3
|
+
//# sourceMappingURL=chunk-FTAB43WC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/core/menubar.tsx"],"names":["Menubar","className","props","ref","cn","MenubarTrigger","MenubarContent","align","sideOffset","menuSurface","MenubarItem","destructive","inset","menuItem","menuItemInset","menuDestructive","MenubarCheckboxItem","children","MenubarRadioItem","MenubarLabel","menuLabel","MenubarSeparator","menuSeparator","MenubarShortcut","menuShortcut","MenubarSubTrigger","MenubarSubContent"],"mappings":"qQA0BA,IAAMA,CAAAA,CAAgB,CAAA,CAAA,UAAA,CAGpB,CAAC,CAAE,SAAA,CAAAC,CAAAA,CAAW,GAAGC,GAAM,CAAA,CAAGC,CAAAA,GAC1B,gBAAkB,CAAA,CAAA,IAAA,CAAjB,CACC,GAAA,CAAKA,CAAAA,CACL,SAAA,CAAWC,CAAAA,CACT,4EACAH,CACF,CAAA,CACC,GAAGC,GAAAA,CACN,CACD,EACDF,EAAQ,WAAA,CAA+B,CAAA,CAAA,IAAA,CAAK,WAAA,CAc5C,IAAMK,CAAAA,CAAuB,CAAA,CAAA,UAAA,CAG3B,CAAC,CAAE,SAAA,CAAAJ,CAAAA,CAAW,GAAGC,GAAM,CAAA,CA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AK,EAAU,GAAGf,CAAM,CAAA,CAAGC,CAAAA,GAC3C,CAAA,CAAA,aAAA,CAAkB,CAAA,CAAA,UAAA,CAAjB,CACC,GAAA,CAAKA,CAAAA,CACL,SAAA,CAAWC,CAAAA,CACTS,CAAAA,CACA,4BAAA,CACAD,KAASE,CAAAA,CACTb,CACF,CAAA,CACC,GAAGC,CAAAA,CAAAA,CAEHe,CAAAA,CACD,gBAAC,KAAA,CAAA,CACC,OAAA,CAAQ,WAAA,CACR,IAAA,CAAK,MAAA,CACL,SAAA,CAAU,sBACV,aAAA,CAAY,MAAA,CAAA,CAEZ,CAAA,CAAA,aAAA,CAAC,MAAA,CAAA,CACC,CAAA,CAAE,cAAA,CACF,OAAO,cAAA,CACP,WAAA,CAAY,GAAA,CACZ,aAAA,CAAc,OAAA,CACd,cAAA,CAAe,QACjB,CACF,CACF,CACD,EACDQ,CAAAA,CAAkB,WAAA,CAA+B,aAAW,WAAA,CAE5D,IAAMC,CAAAA,CAA0B,CAAA,CAAA,UAAA,CAG9B,CAAC,CAAE,UAAAzB,CAAAA,CAAW,GAAGC,GAAM,CAAA,CAAGC,CAAAA,GAC1B,CAAA,CAAA,aAAA,CAAkB,SAAjB,IAAA,CACC,CAAA,CAAA,aAAA,CAAkB,CAAA,CAAA,UAAA,CAAjB,CACC,GAAA,CAAKA,CAAAA,CACL,UAAWC,CAAAA,CAAGK,GAAAA,CAAaR,CAAS,CAAA,CACnC,GAAGC,GAAAA,CACN,CACF,CACD,EACDwB,CAAAA,CAAkB,WAAA,CAA+B,CAAA,CAAA,UAAA,CAAW,WAAA","file":"chunk-FTAB43WC.js","sourcesContent":["import * as React from \"react\";\nimport * as MenubarPrimitive from \"@radix-ui/react-menubar\";\nimport { cn } from \"../../lib/utils\";\nimport {\n menuDestructive,\n menuItem,\n menuItemInset,\n menuLabel,\n menuSeparator,\n menuShortcut,\n menuSurface,\n} from \"./menu-styles\";\n\n/**\n * The application menu bar: File, Edit, View, each opening its own menu.\n *\n * Its own primitive rather than a row of dropdowns, because a menu bar behaves\n * as one control. Once a menu is open, moving the pointer to a neighbouring\n * trigger opens that one without a click, and the arrow keys move between menus\n * as well as within them. A row of independent `DropdownMenu`s gets none of\n * that.\n *\n * Third component reading from menu-styles, after DropdownMenu and ContextMenu.\n * All three are the same menu to look at, and now cannot drift apart.\n */\n\nconst Menubar = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.Root\n ref={ref}\n className={cn(\n \"flex items-center gap-1 rounded-lg border border-border bg-background p-1\",\n className,\n )}\n {...props}\n />\n));\nMenubar.displayName = MenubarPrimitive.Root.displayName;\n\n// Re-exported straight from the package rather than through `const X =\n// MenubarPrimitive.Y`. That form makes TypeScript infer a type naming an\n// internal Radix path, which it cannot write into the .d.ts - TS2742, \"the\n// inferred type cannot be named without a reference to ... this is likely not\n// portable\". A direct re-export skips the inference entirely.\nexport {\n Menu as MenubarMenu,\n Group as MenubarGroup,\n Sub as MenubarSub,\n RadioGroup as MenubarRadioGroup,\n} from \"@radix-ui/react-menubar\";\n\nconst MenubarTrigger = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Trigger>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.Trigger\n ref={ref}\n className={cn(\n \"flex cursor-pointer select-none items-center rounded-md px-3 py-1.5 text-sm font-medium outline-none \" +\n \"focus:bg-muted data-[state=open]:bg-muted\",\n className,\n )}\n {...props}\n />\n));\nMenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName;\n\nconst MenubarContent = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Content>\n>(({ className, align = \"start\", sideOffset = 6, ...props }, ref) => (\n <MenubarPrimitive.Portal>\n <MenubarPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(menuSurface, className)}\n {...props}\n />\n </MenubarPrimitive.Portal>\n));\nMenubarContent.displayName = MenubarPrimitive.Content.displayName;\n\nexport interface MenubarItemProps extends React.ComponentPropsWithoutRef<\n typeof MenubarPrimitive.Item\n> {\n destructive?: boolean;\n inset?: boolean;\n}\n\nconst MenubarItem = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Item>,\n MenubarItemProps\n>(({ className, destructive, inset, ...props }, ref) => (\n <MenubarPrimitive.Item\n ref={ref}\n className={cn(\n menuItem,\n inset && menuItemInset,\n destructive && menuDestructive,\n className,\n )}\n {...props}\n />\n));\nMenubarItem.displayName = MenubarPrimitive.Item.displayName;\n\nconst MenubarCheckboxItem = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.CheckboxItem>\n>(({ className, children, ...props }, ref) => (\n <MenubarPrimitive.CheckboxItem\n ref={ref}\n className={cn(menuItem, menuItemInset, className)}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <MenubarPrimitive.ItemIndicator>\n <svg\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n className=\"h-3.5 w-3.5\"\n aria-hidden=\"true\"\n >\n <path\n d=\"M13 4.5 6.5 11 3 7.5\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </MenubarPrimitive.ItemIndicator>\n </span>\n {children}\n </MenubarPrimitive.CheckboxItem>\n));\nMenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName;\n\nconst MenubarRadioItem = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <MenubarPrimitive.RadioItem\n ref={ref}\n className={cn(menuItem, menuItemInset, className)}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <MenubarPrimitive.ItemIndicator>\n <span className=\"h-2 w-2 rounded-full bg-current\" />\n </MenubarPrimitive.ItemIndicator>\n </span>\n {children}\n </MenubarPrimitive.RadioItem>\n));\nMenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName;\n\nconst MenubarLabel = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <MenubarPrimitive.Label\n ref={ref}\n className={cn(menuLabel, inset && menuItemInset, className)}\n {...props}\n />\n));\nMenubarLabel.displayName = MenubarPrimitive.Label.displayName;\n\nconst MenubarSeparator = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.Separator\n ref={ref}\n className={cn(menuSeparator, className)}\n {...props}\n />\n));\nMenubarSeparator.displayName = MenubarPrimitive.Separator.displayName;\n\nfunction MenubarShortcut({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) {\n return <span className={cn(menuShortcut, className)} {...props} />;\n}\nMenubarShortcut.displayName = \"MenubarShortcut\";\n\nconst MenubarSubTrigger = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <MenubarPrimitive.SubTrigger\n ref={ref}\n className={cn(\n menuItem,\n \"data-[state=open]:bg-muted\",\n inset && menuItemInset,\n className,\n )}\n {...props}\n >\n {children}\n <svg\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n className=\"ml-auto h-3.5 w-3.5\"\n aria-hidden=\"true\"\n >\n <path\n d=\"m6 4 4 4-4 4\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </MenubarPrimitive.SubTrigger>\n));\nMenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName;\n\nconst MenubarSubContent = React.forwardRef<\n React.ElementRef<typeof MenubarPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <MenubarPrimitive.Portal>\n <MenubarPrimitive.SubContent\n ref={ref}\n className={cn(menuSurface, className)}\n {...props}\n />\n </MenubarPrimitive.Portal>\n));\nMenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName;\n\nexport {\n Menubar,\n MenubarTrigger,\n MenubarContent,\n MenubarItem,\n MenubarCheckboxItem,\n MenubarRadioItem,\n MenubarLabel,\n MenubarSeparator,\n MenubarShortcut,\n MenubarSubTrigger,\n MenubarSubContent,\n};\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,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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AGhB,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,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,CAAqB,SA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iB,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
|
+
'use strict';var chunkITRGJNWL_cjs=require('./chunk-ITRGJNWL.cjs'),i=require('react'),e=require('@radix-ui/react-slider'),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 i__namespace=/*#__PURE__*/_interopNamespace(i);var e__namespace=/*#__PURE__*/_interopNamespace(e);var c=classVarianceAuthority.cva("relative grow overflow-hidden rounded-full bg-muted",{variants:{size:{sm:"h-1",default:"h-1.5",lg:"h-2.5"}},defaultVariants:{size:"default"}}),u=classVarianceAuthority.cva("block rounded-full border-2 border-primary bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50",{variants:{size:{sm:"h-3.5 w-3.5",default:"h-4 w-4",lg:"h-5 w-5"}},defaultVariants:{size:"default"}}),v=i__namespace.forwardRef(({className:d,size:o,thumbLabel:t,...a},f)=>{let m=a.value??a.defaultValue??[0],l=Array.isArray(t)?t:[t];return i__namespace.createElement(e__namespace.Root,{ref:f,className:chunkITRGJNWL_cjs.a("relative flex w-full touch-none select-none items-center",d),...a},i__namespace.createElement(e__namespace.Track,{className:chunkITRGJNWL_cjs.a(c({size:o}))},i__namespace.createElement(e__namespace.Range,{className:"absolute h-full bg-primary"})),m.map((p,s)=>i__namespace.createElement(e__namespace.Thumb,{key:s,className:chunkITRGJNWL_cjs.a(u({size:o})),"aria-label":l[s]??l[0]})))});v.displayName=e__namespace.Root.displayName;exports.a=c;exports.b=u;exports.c=v;//# sourceMappingURL=chunk-QEHKWS7N.cjs.map
|
|
3
|
+
//# sourceMappingURL=chunk-QEHKWS7N.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/core/slider.tsx"],"names":["sliderTrackVariants","cva","sliderThumbVariants","Slider","i","className","size","thumbLabel","props","ref","values","labels","e","cn","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ACdA,YAAA,CAAA,aAAA,CAAiBQ,YAAA,CAAA,KAAA,CAAhB,CACC,GAAA,CAAKR,CAAAA,CACL,SAAA,CAAWS,mBAAAA,CAAGX,EAAoB,CAAE,IAAA,CAAAI,CAAK,CAAC,CAAC,CAAA,CAC3C,YAAA,CAAYK,CAAAA,CAAOP,CAAC,GAAKO,CAAAA,CAAO,CAAC,CAAA,CACnC,CACD,CACH,CAEJ,CAAC,EACDR,CAAAA,CAAO,YAA8BS,YAAA,CAAA,IAAA,CAAK,WAAA","file":"chunk-QEHKWS7N.cjs","sourcesContent":["import * as React from \"react\";\nimport * as SliderPrimitive from \"@radix-ui/react-slider\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../lib/utils\";\n\n/**\n * A value picked by dragging along a range: volume, price, opacity.\n *\n * Radix renders one thumb per entry in `value`, so a range slider is the same\n * component with two numbers rather than a separate one. The thumbs are rendered\n * from the value rather than hardcoded here for that reason.\n */\n\nconst sliderTrackVariants = cva(\n \"relative grow overflow-hidden rounded-full bg-muted\",\n {\n variants: {\n size: {\n sm: \"h-1\",\n default: \"h-1.5\",\n lg: \"h-2.5\",\n },\n },\n defaultVariants: { size: \"default\" },\n },\n);\n\nconst sliderThumbVariants = cva(\n \"block rounded-full border-2 border-primary bg-background shadow transition-colors \" +\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background \" +\n \"disabled:pointer-events-none disabled:opacity-50\",\n {\n variants: {\n size: {\n sm: \"h-3.5 w-3.5\",\n default: \"h-4 w-4\",\n lg: \"h-5 w-5\",\n },\n },\n defaultVariants: { size: \"default\" },\n },\n);\n\nexport interface SliderProps\n extends\n React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>,\n VariantProps<typeof sliderTrackVariants> {\n /**\n * Label for each thumb, so a screen reader says \"Minimum\" and \"Maximum\"\n * rather than \"slider\" twice. One string labels a single thumb; an array\n * labels them in order.\n */\n thumbLabel?: string | string[];\n}\n\nconst Slider = React.forwardRef<\n React.ElementRef<typeof SliderPrimitive.Root>,\n SliderProps\n>(({ className, size, thumbLabel, ...props }, ref) => {\n // One thumb per value. Radix drives this from `value` or `defaultValue`, so\n // reading it here keeps a range slider working without a second component.\n const values = props.value ?? props.defaultValue ?? [0];\n const labels = Array.isArray(thumbLabel) ? thumbLabel : [thumbLabel];\n\n return (\n <SliderPrimitive.Root\n ref={ref}\n className={cn(\n \"relative flex w-full touch-none select-none items-center\",\n className,\n )}\n {...props}\n >\n <SliderPrimitive.Track className={cn(sliderTrackVariants({ size }))}>\n <SliderPrimitive.Range className=\"absolute h-full bg-primary\" />\n </SliderPrimitive.Track>\n {values.map((_, i) => (\n <SliderPrimitive.Thumb\n key={i}\n className={cn(sliderThumbVariants({ size }))}\n aria-label={labels[i] ?? labels[0]}\n />\n ))}\n </SliderPrimitive.Root>\n );\n});\nSlider.displayName = SliderPrimitive.Root.displayName;\n\nexport { Slider, sliderTrackVariants, sliderThumbVariants };\n"]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {a}from'./chunk-AC2JBXHQ.js';import*as i from'react';import*as e from'@radix-ui/react-slider';import {cva}from'class-variance-authority';var c=cva("relative grow overflow-hidden rounded-full bg-muted",{variants:{size:{sm:"h-1",default:"h-1.5",lg:"h-2.5"}},defaultVariants:{size:"default"}}),u=cva("block rounded-full border-2 border-primary bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50",{variants:{size:{sm:"h-3.5 w-3.5",default:"h-4 w-4",lg:"h-5 w-5"}},defaultVariants:{size:"default"}}),v=i.forwardRef(({className:d,size:o,thumbLabel:t,...a$1},f)=>{let m=a$1.value??a$1.defaultValue??[0],l=Array.isArray(t)?t:[t];return i.createElement(e.Root,{ref:f,className:a("relative flex w-full touch-none select-none items-center",d),...a$1},i.createElement(e.Track,{className:a(c({size:o}))},i.createElement(e.Range,{className:"absolute h-full bg-primary"})),m.map((p,s)=>i.createElement(e.Thumb,{key:s,className:a(u({size:o})),"aria-label":l[s]??l[0]})))});v.displayName=e.Root.displayName;export{c as a,u as b,v as c};//# sourceMappingURL=chunk-VBGHESL2.js.map
|
|
3
|
+
//# sourceMappingURL=chunk-VBGHESL2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/core/slider.tsx"],"names":["sliderTrackVariants","cva","sliderThumbVariants","Slider","className","size","thumbLabel","props","ref","values","labels","cn","_","i"],"mappings":"oJAaMA,CAAAA,CAAsBC,GAAAA,CAC1B,qDAAA,CACA,CACE,SAAU,CACR,IAAA,CAAM,CACJ,EAAA,CAAI,MACJ,OAAA,CAAS,OAAA,CACT,EAAA,CAAI,OACN,CACF,CAAA,CACA,eAAA,CAAiB,CAAE,IAAA,CAAM,SAAU,CACrC,CACF,CAAA,CAEMC,CAAAA,CAAsBD,IAC1B,6QAAA,CAGA,CACE,QAAA,CAAU,CACR,KAAM,CACJ,EAAA,CAAI,aAAA,CACJ,OAAA,CAAS,UACT,EAAA,CAAI,SACN,CACF,CAAA,CACA,gBAAiB,CAAE,IAAA,CAAM,SAAU,CACrC,CACF,CAAA,CAcME,CAAAA,CAAe,CAAA,CAAA,UAAA,CAGnB,CAAC,CAAE,SAAA,CAAAC,CAAAA,CAAW,IAAA,CAAAC,CAAAA,CAAM,WAAAC,CAAAA,CAAY,GAAGC,GAAM,CAAA,CAAGC,IAAQ,CAGpD,IAAMC,CAAAA,CAASF,GAAAA,CAAM,OAASA,GAAAA,CAAM,YAAA,EAAgB,CAAC,CAAC,CAAA,CAChDG,CAAAA,CAAS,KAAA,CAAM,OAAA,CAAQJ,CAAU,CAAA,CAAIA,CAAAA,CAAa,CAACA,CAAU,EAEnE,OACE,CAAA,CAAA,aAAA,CAAiB,CAAA,CAAA,IAAA,CAAhB,CACC,IAAKE,CAAAA,CACL,SAAA,CAAWG,CAAAA,CACT,0DAAA,CACAP,CACF,CAAA,CACC,GAAGG,GAAAA,CAAAA,CAEJ,CAAA,CAAA,aAAA,CAAiB,QAAhB,CAAsB,SAAA,CAAWI,CAAAA,CAAGX,CAAAA,CAAoB,CAAE,IAAA,CAAAK,CAAK,CAAC,CAAC,GAChE,CAAA,CAAA,aAAA,CAAiB,CAAA,CAAA,KAAA,CAAhB,CAAsB,SAAA,CAAU,6BAA6B,CAChE,CAAA,CACCI,CAAAA,CAAO,GAAA,CAAI,CAACG,CAAAA,CAAGC,CAAAA,GACd,CAAA,CAAA,aAAA,CAAiB,CAAA,CAAA,KAAA,CAAhB,CACC,GAAA,CAAKA,CAAAA,CACL,SAAA,CAAWF,CAAAA,CAAGT,EAAoB,CAAE,IAAA,CAAAG,CAAK,CAAC,CAAC,CAAA,CAC3C,YAAA,CAAYK,CAAAA,CAAOG,CAAC,GAAKH,CAAAA,CAAO,CAAC,CAAA,CACnC,CACD,CACH,CAEJ,CAAC,EACDP,CAAAA,CAAO,YAA8B,CAAA,CAAA,IAAA,CAAK,WAAA","file":"chunk-VBGHESL2.js","sourcesContent":["import * as React from \"react\";\nimport * as SliderPrimitive from \"@radix-ui/react-slider\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../lib/utils\";\n\n/**\n * A value picked by dragging along a range: volume, price, opacity.\n *\n * Radix renders one thumb per entry in `value`, so a range slider is the same\n * component with two numbers rather than a separate one. The thumbs are rendered\n * from the value rather than hardcoded here for that reason.\n */\n\nconst sliderTrackVariants = cva(\n \"relative grow overflow-hidden rounded-full bg-muted\",\n {\n variants: {\n size: {\n sm: \"h-1\",\n default: \"h-1.5\",\n lg: \"h-2.5\",\n },\n },\n defaultVariants: { size: \"default\" },\n },\n);\n\nconst sliderThumbVariants = cva(\n \"block rounded-full border-2 border-primary bg-background shadow transition-colors \" +\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background \" +\n \"disabled:pointer-events-none disabled:opacity-50\",\n {\n variants: {\n size: {\n sm: \"h-3.5 w-3.5\",\n default: \"h-4 w-4\",\n lg: \"h-5 w-5\",\n },\n },\n defaultVariants: { size: \"default\" },\n },\n);\n\nexport interface SliderProps\n extends\n React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>,\n VariantProps<typeof sliderTrackVariants> {\n /**\n * Label for each thumb, so a screen reader says \"Minimum\" and \"Maximum\"\n * rather than \"slider\" twice. One string labels a single thumb; an array\n * labels them in order.\n */\n thumbLabel?: string | string[];\n}\n\nconst Slider = React.forwardRef<\n React.ElementRef<typeof SliderPrimitive.Root>,\n SliderProps\n>(({ className, size, thumbLabel, ...props }, ref) => {\n // One thumb per value. Radix drives this from `value` or `defaultValue`, so\n // reading it here keeps a range slider working without a second component.\n const values = props.value ?? props.defaultValue ?? [0];\n const labels = Array.isArray(thumbLabel) ? thumbLabel : [thumbLabel];\n\n return (\n <SliderPrimitive.Root\n ref={ref}\n className={cn(\n \"relative flex w-full touch-none select-none items-center\",\n className,\n )}\n {...props}\n >\n <SliderPrimitive.Track className={cn(sliderTrackVariants({ size }))}>\n <SliderPrimitive.Range className=\"absolute h-full bg-primary\" />\n </SliderPrimitive.Track>\n {values.map((_, i) => (\n <SliderPrimitive.Thumb\n key={i}\n className={cn(sliderThumbVariants({ size }))}\n aria-label={labels[i] ?? labels[0]}\n />\n ))}\n </SliderPrimitive.Root>\n );\n});\nSlider.displayName = SliderPrimitive.Root.displayName;\n\nexport { Slider, sliderTrackVariants, sliderThumbVariants };\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,OAAA,CAAS,SAAA,CACT,KAAM,SACR,CACF,CACF,CAAA,CAkEME,CAAAA,CAAm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ME,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,CAAUZ,EAAQ,CAAA,EAAGW,CAAY,SAAW,MAAA,CAC5CE,CAAAA,CAAed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AA,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"]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';var chunk7YFUAGIW_cjs=require('../../chunk-7YFUAGIW.cjs'),chunkXPIBRXTW_cjs=require('../../chunk-XPIBRXTW.cjs'),chunkV77N662N_cjs=require('../../chunk-V77N662N.cjs'),chunkITRGJNWL_cjs=require('../../chunk-ITRGJNWL.cjs'),r=require('react'),reactSlot=require('@radix-ui/react-slot'),reactHookForm=require('react-hook-form');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 r__namespace=/*#__PURE__*/_interopNamespace(r);var v=reactHookForm.FormProvider,f=r__namespace.createContext(null);function N({...e}){let t=r__namespace.useId(),o=r__namespace.useMemo(()=>({name:e.name,id:t}),[e.name,t]);return r__namespace.createElement(f.Provider,{value:o},r__namespace.createElement(reactHookForm.Controller,{...e}))}function i(){let e=r__namespace.useContext(f);if(!e)throw new Error("useFormField must be used inside a <FormField>. Without it there is no field id to attach a label or a message to.");let{errors:t}=reactHookForm.useFormState({name:e.name}),o=e.name.split(".").reduce((s,a)=>s?.[a],t);return {name:e.name,formItemId:e.id,formDescriptionId:`${e.id}-description`,formMessageId:`${e.id}-message`,error:o}}function g({className:e,...t}){return r__namespace.createElement("div",{className:chunkITRGJNWL_cjs.a("space-y-1.5",e),...t})}g.displayName="FormItem";var y=r__namespace.forwardRef(({className:e,...t},o)=>{let{error:s,formItemId:a}=i();return r__namespace.createElement(chunkXPIBRXTW_cjs.b,{ref:o,htmlFor:a,className:chunkITRGJNWL_cjs.a(s&&"text-destructive",e),...t})});y.displayName="FormLabel";var C=r__namespace.forwardRef(({...e},t)=>{let{error:o,formItemId:s,formDescriptionId:a,formMessageId:n}=i();return r__namespace.createElement(reactSlot.Slot,{ref:t,id:s,"aria-describedby":o?`${a} ${n}`:a,"aria-invalid":o?true:void 0,...e})});C.displayName="FormControl";var I=r__namespace.forwardRef(({...e},t)=>{let{formDescriptionId:o}=i();return r__namespace.createElement(chunk7YFUAGIW_cjs.b,{ref:t,id:o,...e})});I.displayName="FormDescription";var M=r__namespace.forwardRef(({children:e,...t},o)=>{let{error:s,formMessageId:a}=i(),n=s?.message??e;return n?r__namespace.createElement(chunkV77N662N_cjs.b,{ref:o,id:a,...t},n):null});M.displayName="FormMessage";Object.defineProperty(exports,"useFormContext",{enumerable:true,get:function(){return reactHookForm.useFormContext}});exports.Form=v;exports.FormControl=C;exports.FormDescription=I;exports.FormField=N;exports.FormItem=g;exports.FormLabel=y;exports.FormMessage=M;exports.useFormField=i;//# sourceMappingURL=form.cjs.map
|
|
3
|
+
//# sourceMappingURL=form.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/core/form.tsx"],"names":["Form","FormProvider","FormFieldContext","r","FormField","props","id","value","Controller","useFormField","field","errors","useFormState","error","acc","key","FormItem","className","cn","FormLabel","ref","formItemId","Label","FormControl","formDescriptionId","formMessageId","Slot","FormDescription","HelperText","FormMessage","children","body","ErrorMessage"],"mappings":"qrBAgDA,IAAMA,CAAAA,CAAOC,0BAAAA,CAOPC,CAAAA,CAAyBC,2BAC7B,IACF,EAQA,SAASC,CAAAA,CAGP,CAAE,GAAGC,CAAM,CAAA,CAAyC,CACpD,IAAMC,CAAAA,CAAWH,YAAA,CAAA,KAAA,EAAM,CACjBI,CAAAA,CAAcJ,qBAClB,KAAO,CAAE,IAAA,CAAME,CAAAA,CAAM,KAAgB,EAAA,CAAAC,CAAG,CAAA,CAAA,CACxC,CAACD,EAAM,IAAA,CAAMC,CAAE,CACjB,CAAA,CACA,OACEH,YAAA,CAAA,aAAA,CAACD,CAAAA,CAAiB,QAAA,CAAjB,CAA0B,MAAOK,CAAAA,CAAAA,CAChCJ,YAAA,CAAA,aAAA,CAACK,wBAAAA,CAAA,CAAY,GAAGH,CAAAA,CAAO,CACzB,CAEJ,CASA,SAASI,CAAAA,EAAe,CACtB,IAAMC,CAAAA,CAAcP,wBAAWD,CAAgB,CAAA,CAC/C,GAAI,CAACQ,CAAAA,CACH,MAAM,IAAI,KAAA,CACR,oHACF,CAAA,CAEF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AA","file":"form.cjs","sourcesContent":["import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport {\n Controller,\n FormProvider,\n useFormContext,\n useFormState,\n type ControllerProps,\n type FieldPath,\n type FieldValues,\n} from \"react-hook-form\";\n\nimport { cn } from \"../../lib/utils\";\nimport { ErrorMessage } from \"./error-message\";\nimport { HelperText } from \"./helper-text\";\nimport { Label } from \"./label\";\n\n/**\n * Wires react-hook-form to this library's Label, HelperText and ErrorMessage,\n * and generates the ids that connect them.\n *\n * The three pieces have always existed separately, and connecting them was left\n * to the caller: an id on the input, a matching htmlFor, an aria-describedby\n * listing the description and the error, and aria-invalid toggled by hand. That\n * is four things to get right per field, and the failure is silent - a form that\n * looks correct and tells a screen reader nothing.\n *\n * `FormField` generates one id per field and `FormControl` applies the wiring, so\n * a field is a label, a control and a message with no bookkeeping.\n *\n * ## react-hook-form is an optional peer dependency, and this is not in the barrel\n *\n * `react-hook-form` is around 25kB and most consumers of a component library do\n * not want it forced on them, so it is an optional peer: install it if you use\n * `Form`, and pay nothing if you do not.\n *\n * That only works if importing something unrelated cannot pull it in. A bundler\n * has to *resolve* every import in a module before it can tree-shake anything,\n * so a barrel that re-exported this file would fail to build for anyone without\n * the peer installed, even if they only wanted `Button`. So `Form` is reachable\n * only through its own entry point:\n *\n * import { Form, FormField } from \"@jarllyng/nostromo/components/core/form\";\n *\n * Verified rather than assumed - see the react-compat job, which installs the\n * packed tarball into a project with no react-hook-form and imports the barrel.\n */\n\nconst Form = FormProvider;\n\ninterface FormFieldContextValue {\n name: string;\n id: string;\n}\n\nconst FormFieldContext = React.createContext<FormFieldContextValue | null>(\n null,\n);\n\n/**\n * One field: a name, and the ids that tie its parts together.\n *\n * Wraps react-hook-form's `Controller`, so it works with controlled components\n * like `Select` and `Checkbox` as well as with plain inputs.\n */\nfunction FormField<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({ ...props }: ControllerProps<TFieldValues, TName>) {\n const id = React.useId();\n const value = React.useMemo(\n () => ({ name: props.name as string, id }),\n [props.name, id],\n );\n return (\n <FormFieldContext.Provider value={value}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n}\n\n/**\n * The ids and error state for the field being rendered.\n *\n * Throws rather than returning undefined when used outside a `FormField`. The\n * quiet alternative is a label whose `htmlFor` points at nothing, which is the\n * exact class of silent breakage this component exists to remove.\n */\nfunction useFormField() {\n const field = React.useContext(FormFieldContext);\n if (!field) {\n throw new Error(\n \"useFormField must be used inside a <FormField>. Without it there is no field id to attach a label or a message to.\",\n );\n }\n const { errors } = useFormState({ name: field.name });\n // Nested names like \"address.city\" reach into the error object.\n const error = field.name\n .split(\".\")\n .reduce<unknown>(\n (acc, key) => (acc as Record<string, unknown>)?.[key],\n errors,\n );\n\n return {\n name: field.name,\n formItemId: field.id,\n formDescriptionId: `${field.id}-description`,\n formMessageId: `${field.id}-message`,\n error: error as { message?: string } | undefined,\n };\n}\n\nfunction FormItem({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) {\n return <div className={cn(\"space-y-1.5\", className)} {...props} />;\n}\nFormItem.displayName = \"FormItem\";\n\nconst FormLabel = React.forwardRef<\n React.ElementRef<typeof Label>,\n React.ComponentPropsWithoutRef<typeof Label>\n>(({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField();\n return (\n <Label\n ref={ref}\n htmlFor={formItemId}\n className={cn(error && \"text-destructive\", className)}\n {...props}\n />\n );\n});\nFormLabel.displayName = \"FormLabel\";\n\n/**\n * Applies the wiring to whatever control it wraps.\n *\n * A `Slot`, so it passes the id and the aria attributes to the child rather than\n * rendering an element of its own. `aria-describedby` lists the description and,\n * when there is one, the message - both, because a field can have guidance and\n * an error at the same time and a screen reader should hear both.\n */\nconst FormControl = React.forwardRef<\n HTMLElement,\n React.HTMLAttributes<HTMLElement>\n>(({ ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } =\n useFormField();\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={\n error ? `${formDescriptionId} ${formMessageId}` : formDescriptionId\n }\n aria-invalid={error ? true : undefined}\n {...props}\n />\n );\n});\nFormControl.displayName = \"FormControl\";\n\nconst FormDescription = React.forwardRef<\n React.ElementRef<typeof HelperText>,\n React.ComponentPropsWithoutRef<typeof HelperText>\n>(({ ...props }, ref) => {\n const { formDescriptionId } = useFormField();\n return <HelperText ref={ref} id={formDescriptionId} {...props} />;\n});\nFormDescription.displayName = \"FormDescription\";\n\n/**\n * The field's error, or nothing.\n *\n * Renders the validation message when there is one and `children` otherwise, so\n * a field can carry a persistent hint that the error replaces. Renders nothing\n * at all when there is neither, rather than an empty element that still takes up\n * space in the layout.\n */\nconst FormMessage = React.forwardRef<\n React.ElementRef<typeof ErrorMessage>,\n React.ComponentPropsWithoutRef<typeof ErrorMessage>\n>(({ children, ...props }, ref) => {\n const { error, formMessageId } = useFormField();\n const body = error?.message ?? children;\n if (!body) return null;\n\n return (\n <ErrorMessage ref={ref} id={formMessageId} {...props}>\n {body}\n </ErrorMessage>\n );\n});\nFormMessage.displayName = \"FormMessage\";\n\nexport {\n Form,\n FormField,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n useFormField,\n useFormContext,\n};\n"]}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { ErrorMessageProps } from './error-message.cjs';
|
|
2
|
+
import { HelperTextProps } from './helper-text.cjs';
|
|
3
|
+
import { LabelProps } from './label.cjs';
|
|
4
|
+
import * as react_hook_form from 'react-hook-form';
|
|
5
|
+
import { FieldValues, FieldPath, ControllerProps } from 'react-hook-form';
|
|
6
|
+
export { useFormContext } from 'react-hook-form';
|
|
7
|
+
import * as React from 'react';
|
|
8
|
+
import 'class-variance-authority/types';
|
|
9
|
+
import 'class-variance-authority';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Wires react-hook-form to this library's Label, HelperText and ErrorMessage,
|
|
13
|
+
* and generates the ids that connect them.
|
|
14
|
+
*
|
|
15
|
+
* The three pieces have always existed separately, and connecting them was left
|
|
16
|
+
* to the caller: an id on the input, a matching htmlFor, an aria-describedby
|
|
17
|
+
* listing the description and the error, and aria-invalid toggled by hand. That
|
|
18
|
+
* is four things to get right per field, and the failure is silent - a form that
|
|
19
|
+
* looks correct and tells a screen reader nothing.
|
|
20
|
+
*
|
|
21
|
+
* `FormField` generates one id per field and `FormControl` applies the wiring, so
|
|
22
|
+
* a field is a label, a control and a message with no bookkeeping.
|
|
23
|
+
*
|
|
24
|
+
* ## react-hook-form is an optional peer dependency, and this is not in the barrel
|
|
25
|
+
*
|
|
26
|
+
* `react-hook-form` is around 25kB and most consumers of a component library do
|
|
27
|
+
* not want it forced on them, so it is an optional peer: install it if you use
|
|
28
|
+
* `Form`, and pay nothing if you do not.
|
|
29
|
+
*
|
|
30
|
+
* That only works if importing something unrelated cannot pull it in. A bundler
|
|
31
|
+
* has to *resolve* every import in a module before it can tree-shake anything,
|
|
32
|
+
* so a barrel that re-exported this file would fail to build for anyone without
|
|
33
|
+
* the peer installed, even if they only wanted `Button`. So `Form` is reachable
|
|
34
|
+
* only through its own entry point:
|
|
35
|
+
*
|
|
36
|
+
* import { Form, FormField } from "@jarllyng/nostromo/components/core/form";
|
|
37
|
+
*
|
|
38
|
+
* Verified rather than assumed - see the react-compat job, which installs the
|
|
39
|
+
* packed tarball into a project with no react-hook-form and imports the barrel.
|
|
40
|
+
*/
|
|
41
|
+
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>({ children, watch, getValues, getFieldState, setError, clearErrors, setValue, setValues, trigger, formState, resetField, reset, resetDefaultValues, handleSubmit, unregister, control, register, setFocus, subscribe, }: react_hook_form.FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
|
|
42
|
+
/**
|
|
43
|
+
* One field: a name, and the ids that tie its parts together.
|
|
44
|
+
*
|
|
45
|
+
* Wraps react-hook-form's `Controller`, so it works with controlled components
|
|
46
|
+
* like `Select` and `Checkbox` as well as with plain inputs.
|
|
47
|
+
*/
|
|
48
|
+
declare function FormField<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>): React.JSX.Element;
|
|
49
|
+
/**
|
|
50
|
+
* The ids and error state for the field being rendered.
|
|
51
|
+
*
|
|
52
|
+
* Throws rather than returning undefined when used outside a `FormField`. The
|
|
53
|
+
* quiet alternative is a label whose `htmlFor` points at nothing, which is the
|
|
54
|
+
* exact class of silent breakage this component exists to remove.
|
|
55
|
+
*/
|
|
56
|
+
declare function useFormField(): {
|
|
57
|
+
name: string;
|
|
58
|
+
formItemId: string;
|
|
59
|
+
formDescriptionId: string;
|
|
60
|
+
formMessageId: string;
|
|
61
|
+
error: {
|
|
62
|
+
message?: string;
|
|
63
|
+
} | undefined;
|
|
64
|
+
};
|
|
65
|
+
declare function FormItem({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
66
|
+
declare namespace FormItem {
|
|
67
|
+
var displayName: string;
|
|
68
|
+
}
|
|
69
|
+
declare const FormLabel: React.ForwardRefExoticComponent<Omit<LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & React.RefAttributes<HTMLLabelElement>>;
|
|
70
|
+
/**
|
|
71
|
+
* Applies the wiring to whatever control it wraps.
|
|
72
|
+
*
|
|
73
|
+
* A `Slot`, so it passes the id and the aria attributes to the child rather than
|
|
74
|
+
* rendering an element of its own. `aria-describedby` lists the description and,
|
|
75
|
+
* when there is one, the message - both, because a field can have guidance and
|
|
76
|
+
* an error at the same time and a screen reader should hear both.
|
|
77
|
+
*/
|
|
78
|
+
declare const FormControl: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>>;
|
|
79
|
+
declare const FormDescription: React.ForwardRefExoticComponent<Omit<HelperTextProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
80
|
+
/**
|
|
81
|
+
* The field's error, or nothing.
|
|
82
|
+
*
|
|
83
|
+
* Renders the validation message when there is one and `children` otherwise, so
|
|
84
|
+
* a field can carry a persistent hint that the error replaces. Renders nothing
|
|
85
|
+
* at all when there is neither, rather than an empty element that still takes up
|
|
86
|
+
* space in the layout.
|
|
87
|
+
*/
|
|
88
|
+
declare const FormMessage: React.ForwardRefExoticComponent<Omit<ErrorMessageProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
89
|
+
|
|
90
|
+
export { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField };
|