@codefast/ui 0.1.54 → 0.1.56
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-2D4K3VN5.js +2 -0
- package/dist/chunk-2D4K3VN5.js.map +1 -0
- package/dist/chunk-2ZV3RRUF.js +2 -0
- package/dist/chunk-2ZV3RRUF.js.map +1 -0
- package/dist/chunk-36JL64WE.js +2 -0
- package/dist/chunk-36JL64WE.js.map +1 -0
- package/dist/{chunk-EEDKRHHZ.cjs → chunk-4KP3LG6P.cjs} +2 -2
- package/dist/chunk-4KP3LG6P.cjs.map +1 -0
- package/dist/chunk-5J3MQRCG.js +2 -0
- package/dist/{chunk-OPRULC2F.js.map → chunk-5J3MQRCG.js.map} +1 -1
- package/dist/chunk-6AI2HSG6.js +2 -0
- package/dist/chunk-6AI2HSG6.js.map +1 -0
- package/dist/chunk-6IKJWYUQ.cjs +2 -0
- package/dist/chunk-6IKJWYUQ.cjs.map +1 -0
- package/dist/chunk-7D25EXRF.cjs +2 -0
- package/dist/chunk-7D25EXRF.cjs.map +1 -0
- package/dist/chunk-7G7GY6WB.cjs +2 -0
- package/dist/chunk-7G7GY6WB.cjs.map +1 -0
- package/dist/chunk-7GOKKSQ2.js +2 -0
- package/dist/chunk-7GOKKSQ2.js.map +1 -0
- package/dist/chunk-7M3I7GAI.cjs +2 -0
- package/dist/chunk-7M3I7GAI.cjs.map +1 -0
- package/dist/chunk-ANFCBS2Z.cjs +2 -0
- package/dist/chunk-ANFCBS2Z.cjs.map +1 -0
- package/dist/chunk-BBVYRCKN.cjs +2 -0
- package/dist/chunk-BBVYRCKN.cjs.map +1 -0
- package/dist/chunk-BP2FRPTA.js +2 -0
- package/dist/chunk-BP2FRPTA.js.map +1 -0
- package/dist/chunk-CFXQ7IR4.js +2 -0
- package/dist/chunk-CFXQ7IR4.js.map +1 -0
- package/dist/chunk-DRLZ27WH.cjs +2 -0
- package/dist/chunk-DRLZ27WH.cjs.map +1 -0
- package/dist/chunk-FVR3LJWM.cjs +4 -0
- package/dist/chunk-FVR3LJWM.cjs.map +1 -0
- package/dist/chunk-GAIGLFOT.js +2 -0
- package/dist/chunk-GAIGLFOT.js.map +1 -0
- package/dist/chunk-GBCWWLEX.js +2 -0
- package/dist/chunk-GBCWWLEX.js.map +1 -0
- package/dist/chunk-GCXQJEFZ.cjs +2 -0
- package/dist/chunk-GCXQJEFZ.cjs.map +1 -0
- package/dist/chunk-GDEO256Z.js +2 -0
- package/dist/chunk-GDEO256Z.js.map +1 -0
- package/dist/chunk-HXMLYPF5.js +2 -0
- package/dist/chunk-HXMLYPF5.js.map +1 -0
- package/dist/chunk-IDSE6FJ7.cjs +2 -0
- package/dist/chunk-IDSE6FJ7.cjs.map +1 -0
- package/dist/chunk-ITSIGICG.js +2 -0
- package/dist/chunk-ITSIGICG.js.map +1 -0
- package/dist/chunk-J7QU6N2U.js +2 -0
- package/dist/chunk-J7QU6N2U.js.map +1 -0
- package/dist/chunk-K32V3MHQ.cjs +2 -0
- package/dist/chunk-K32V3MHQ.cjs.map +1 -0
- package/dist/chunk-KEAW3ISB.cjs +2 -0
- package/dist/chunk-KEAW3ISB.cjs.map +1 -0
- package/dist/{chunk-E2QRPDUI.cjs → chunk-KFX5L3AF.cjs} +2 -2
- package/dist/{chunk-E2QRPDUI.cjs.map → chunk-KFX5L3AF.cjs.map} +1 -1
- package/dist/chunk-KYZ6DEDI.cjs +2 -0
- package/dist/chunk-KYZ6DEDI.cjs.map +1 -0
- package/dist/chunk-LQRU5KEQ.js +2 -0
- package/dist/chunk-LQRU5KEQ.js.map +1 -0
- package/dist/chunk-LUQA5J5W.cjs +2 -0
- package/dist/chunk-LUQA5J5W.cjs.map +1 -0
- package/dist/chunk-M25UFVFW.cjs +2 -0
- package/dist/chunk-M25UFVFW.cjs.map +1 -0
- package/dist/chunk-OIF6PONX.cjs +2 -0
- package/dist/chunk-OIF6PONX.cjs.map +1 -0
- package/dist/{chunk-FSXJI6UE.js → chunk-PP6Z3U6S.js} +2 -2
- package/dist/chunk-QISUHNKM.cjs +2 -0
- package/dist/chunk-QISUHNKM.cjs.map +1 -0
- package/dist/chunk-QUMY3I5T.js +2 -0
- package/dist/chunk-QUMY3I5T.js.map +1 -0
- package/dist/chunk-RNWK4YZ2.js +2 -0
- package/dist/chunk-RNWK4YZ2.js.map +1 -0
- package/dist/chunk-T2EOHTGR.js +2 -0
- package/dist/chunk-T2EOHTGR.js.map +1 -0
- package/dist/{chunk-NGEZQP54.cjs → chunk-TQEAAFPM.cjs} +2 -2
- package/dist/{chunk-NGEZQP54.cjs.map → chunk-TQEAAFPM.cjs.map} +1 -1
- package/dist/chunk-VZSYA6XE.js +4 -0
- package/dist/chunk-VZSYA6XE.js.map +1 -0
- package/dist/chunk-W3UMO54G.js +2 -0
- package/dist/chunk-W3UMO54G.js.map +1 -0
- package/dist/chunk-WNEFXTN4.cjs +2 -0
- package/dist/chunk-WNEFXTN4.cjs.map +1 -0
- package/dist/chunk-WZSVJ7BS.js +2 -0
- package/dist/chunk-WZSVJ7BS.js.map +1 -0
- package/dist/chunk-XEGQBIJR.cjs +2 -0
- package/dist/chunk-XEGQBIJR.cjs.map +1 -0
- package/dist/chunk-XRJ3USVN.js +2 -0
- package/dist/chunk-XRJ3USVN.js.map +1 -0
- package/dist/chunk-YEINLNE5.js +2 -0
- package/dist/chunk-YEINLNE5.js.map +1 -0
- package/dist/chunk-YMXAFSOU.cjs +2 -0
- package/dist/chunk-YMXAFSOU.cjs.map +1 -0
- package/dist/chunk-YQWAU4NX.cjs +2 -0
- package/dist/chunk-YQWAU4NX.cjs.map +1 -0
- package/dist/chunk-YSVRLPUL.js +2 -0
- package/dist/chunk-YSVRLPUL.js.map +1 -0
- package/dist/chunk-ZK6QHQWT.cjs +2 -0
- package/dist/chunk-ZK6QHQWT.cjs.map +1 -0
- package/dist/components/accordion.cjs +1 -1
- package/dist/components/accordion.js +1 -1
- package/dist/components/breadcrumb.cjs +1 -1
- package/dist/components/breadcrumb.js +1 -1
- package/dist/components/calendar.cjs +1 -1
- package/dist/components/calendar.js +1 -1
- package/dist/components/carousel.cjs +1 -1
- package/dist/components/carousel.js +1 -1
- package/dist/components/chart.cjs +1 -1
- package/dist/components/chart.d.cts +14 -10
- package/dist/components/chart.d.ts +14 -10
- package/dist/components/chart.js +1 -1
- package/dist/components/checkbox-cards.cjs +1 -1
- package/dist/components/checkbox-cards.js +1 -1
- package/dist/components/checkbox-group.cjs +1 -1
- package/dist/components/checkbox-group.js +1 -1
- package/dist/components/checkbox.cjs +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/command.cjs +1 -1
- package/dist/components/command.js +1 -1
- package/dist/components/context-menu.cjs +1 -1
- package/dist/components/context-menu.js +1 -1
- package/dist/components/data-table.cjs +1 -1
- package/dist/components/data-table.js +1 -1
- package/dist/components/dialog.cjs +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/dropdown-menu.cjs +1 -1
- package/dist/components/dropdown-menu.js +1 -1
- package/dist/components/input-otp.cjs +1 -1
- package/dist/components/input-otp.js +1 -1
- package/dist/components/menubar.cjs +1 -1
- package/dist/components/menubar.js +1 -1
- package/dist/components/navigation-menu.cjs +1 -1
- package/dist/components/navigation-menu.js +1 -1
- package/dist/components/number-input.cjs +1 -1
- package/dist/components/number-input.js +1 -1
- package/dist/components/pagination.cjs +1 -1
- package/dist/components/pagination.js +1 -1
- package/dist/components/password-input.cjs +1 -1
- package/dist/components/password-input.js +1 -1
- package/dist/components/resizable.cjs +1 -1
- package/dist/components/resizable.js +1 -1
- package/dist/components/search-input.cjs +1 -1
- package/dist/components/search-input.js +1 -1
- package/dist/components/select.cjs +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/sheet.cjs +1 -1
- package/dist/components/sheet.js +1 -1
- package/dist/components/sidebar.cjs +1 -1
- package/dist/components/sidebar.js +1 -1
- package/dist/components/tabs.cjs +1 -1
- package/dist/components/tabs.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +9 -10
- package/dist/chunk-4PL3DAT2.cjs +0 -2
- package/dist/chunk-4PL3DAT2.cjs.map +0 -1
- package/dist/chunk-5I7UA4HT.js +0 -2
- package/dist/chunk-5I7UA4HT.js.map +0 -1
- package/dist/chunk-5LM6T7Z5.js +0 -2
- package/dist/chunk-5LM6T7Z5.js.map +0 -1
- package/dist/chunk-B5V32KRW.cjs +0 -2
- package/dist/chunk-B5V32KRW.cjs.map +0 -1
- package/dist/chunk-BAOFKRE7.cjs +0 -2
- package/dist/chunk-BAOFKRE7.cjs.map +0 -1
- package/dist/chunk-BHLW3MWI.js +0 -2
- package/dist/chunk-BHLW3MWI.js.map +0 -1
- package/dist/chunk-C4SXNTCJ.js +0 -2
- package/dist/chunk-C4SXNTCJ.js.map +0 -1
- package/dist/chunk-CRQ5URNB.js +0 -2
- package/dist/chunk-CRQ5URNB.js.map +0 -1
- package/dist/chunk-DIYHARQU.cjs +0 -2
- package/dist/chunk-DIYHARQU.cjs.map +0 -1
- package/dist/chunk-DQBQF25F.cjs +0 -2
- package/dist/chunk-DQBQF25F.cjs.map +0 -1
- package/dist/chunk-DUDXLCPG.js +0 -2
- package/dist/chunk-DUDXLCPG.js.map +0 -1
- package/dist/chunk-EEDKRHHZ.cjs.map +0 -1
- package/dist/chunk-GUOQM6BL.cjs +0 -2
- package/dist/chunk-GUOQM6BL.cjs.map +0 -1
- package/dist/chunk-GV5FQF4J.js +0 -2
- package/dist/chunk-GV5FQF4J.js.map +0 -1
- package/dist/chunk-HO5BFEZO.cjs +0 -4
- package/dist/chunk-HO5BFEZO.cjs.map +0 -1
- package/dist/chunk-I6LNZ6KP.cjs +0 -2
- package/dist/chunk-I6LNZ6KP.cjs.map +0 -1
- package/dist/chunk-IPRXHJQ5.cjs +0 -2
- package/dist/chunk-IPRXHJQ5.cjs.map +0 -1
- package/dist/chunk-JMYWGU6A.js +0 -2
- package/dist/chunk-JMYWGU6A.js.map +0 -1
- package/dist/chunk-KASTA74M.cjs +0 -2
- package/dist/chunk-KASTA74M.cjs.map +0 -1
- package/dist/chunk-LGRBBJSZ.js +0 -2
- package/dist/chunk-LGRBBJSZ.js.map +0 -1
- package/dist/chunk-LJPFJ6NG.js +0 -2
- package/dist/chunk-LJPFJ6NG.js.map +0 -1
- package/dist/chunk-MHH6QORE.cjs +0 -2
- package/dist/chunk-MHH6QORE.cjs.map +0 -1
- package/dist/chunk-MO7TQSRR.js +0 -2
- package/dist/chunk-MO7TQSRR.js.map +0 -1
- package/dist/chunk-MYT23AOL.js +0 -2
- package/dist/chunk-MYT23AOL.js.map +0 -1
- package/dist/chunk-O632SAUI.js +0 -2
- package/dist/chunk-O632SAUI.js.map +0 -1
- package/dist/chunk-OH3BXT6D.js +0 -2
- package/dist/chunk-OH3BXT6D.js.map +0 -1
- package/dist/chunk-OOEZEXWK.cjs +0 -2
- package/dist/chunk-OOEZEXWK.cjs.map +0 -1
- package/dist/chunk-OPRULC2F.js +0 -2
- package/dist/chunk-OUWUINGX.cjs +0 -2
- package/dist/chunk-OUWUINGX.cjs.map +0 -1
- package/dist/chunk-P3YLZBAU.js +0 -2
- package/dist/chunk-P3YLZBAU.js.map +0 -1
- package/dist/chunk-PCKCN7MO.js +0 -2
- package/dist/chunk-PCKCN7MO.js.map +0 -1
- package/dist/chunk-PYKB3C2F.cjs +0 -2
- package/dist/chunk-PYKB3C2F.cjs.map +0 -1
- package/dist/chunk-Q7IH47TY.js +0 -2
- package/dist/chunk-Q7IH47TY.js.map +0 -1
- package/dist/chunk-QEIZTAWS.js +0 -2
- package/dist/chunk-QEIZTAWS.js.map +0 -1
- package/dist/chunk-R5235IUC.cjs +0 -2
- package/dist/chunk-R5235IUC.cjs.map +0 -1
- package/dist/chunk-RAOQ5OMD.cjs +0 -2
- package/dist/chunk-RAOQ5OMD.cjs.map +0 -1
- package/dist/chunk-SDGFNHJP.cjs +0 -2
- package/dist/chunk-SDGFNHJP.cjs.map +0 -1
- package/dist/chunk-TTKMKXCU.js +0 -2
- package/dist/chunk-TTKMKXCU.js.map +0 -1
- package/dist/chunk-UHHMORLE.js +0 -2
- package/dist/chunk-UHHMORLE.js.map +0 -1
- package/dist/chunk-UIVPC5TQ.cjs +0 -2
- package/dist/chunk-UIVPC5TQ.cjs.map +0 -1
- package/dist/chunk-UQWSMTYF.js +0 -2
- package/dist/chunk-UQWSMTYF.js.map +0 -1
- package/dist/chunk-VBE6D4FZ.cjs +0 -2
- package/dist/chunk-VBE6D4FZ.cjs.map +0 -1
- package/dist/chunk-VFOMCFSG.cjs +0 -2
- package/dist/chunk-VFOMCFSG.cjs.map +0 -1
- package/dist/chunk-WNXJ2WHS.js +0 -4
- package/dist/chunk-WNXJ2WHS.js.map +0 -1
- package/dist/chunk-YORY32TX.cjs +0 -2
- package/dist/chunk-YORY32TX.cjs.map +0 -1
- package/dist/chunk-YTSBANYY.js +0 -2
- package/dist/chunk-YTSBANYY.js.map +0 -1
- package/dist/chunk-Z7U5IONC.cjs +0 -2
- package/dist/chunk-Z7U5IONC.cjs.map +0 -1
- /package/dist/{chunk-FSXJI6UE.js.map → chunk-PP6Z3U6S.js.map} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";var _chunkDD6AVCRHcjs = require('./chunk-DD6AVCRH.cjs');var _inputotp = require('input-otp');var _lucidereact = require('lucide-react');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var m=_react.forwardRef.call(void 0, ({className:t,containerClassName:e,...p},s)=>_jsxruntime.jsx.call(void 0, _inputotp.OTPInput,{ref:s,className:_chunkDD6AVCRHcjs.a.call(void 0, "disabled:cursor-default",t),containerClassName:_chunkDD6AVCRHcjs.a.call(void 0, "flex items-center gap-2","has-[:disabled]:opacity-50",e),...p}));m.displayName="InputOTP";var T=_react.forwardRef.call(void 0, ({className:t,...e},p)=>_jsxruntime.jsx.call(void 0, "div",{ref:p,className:_chunkDD6AVCRHcjs.a.call(void 0, "flex items-center",t),...e}));T.displayName="InputOTPGroup";var I=_react.forwardRef.call(void 0, ({index:t,className:e,...p},s)=>{let u=_react.useContext.call(void 0, _inputotp.OTPInputContext).slots[t];return _jsxruntime.jsxs.call(void 0, "div",{ref:s,className:_chunkDD6AVCRHcjs.a.call(void 0, "border-input relative flex size-10 items-center justify-center border-y border-r text-sm shadow-sm transition-all","first:rounded-l-md first:border-l","last:rounded-r-md",u.isActive&&"z-10 outline outline-2",e),...p,children:[u.char,u.hasFakeCaret?_jsxruntime.jsx.call(void 0, "div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:_jsxruntime.jsx.call(void 0, "div",{className:"animate-caret-blink bg-foreground animate-duration-1000 h-4 w-px"})}):null]})});I.displayName="InputOTPSlot";var O=_react.forwardRef.call(void 0, ({...t},e)=>_jsxruntime.jsx.call(void 0, "div",{ref:e,role:"separator",...t,children:_jsxruntime.jsx.call(void 0, _lucidereact.DotIcon,{})}));O.displayName="InputOTPSeparator";exports.a = _inputotp.REGEXP_ONLY_CHARS; exports.b = _inputotp.REGEXP_ONLY_DIGITS; exports.c = _inputotp.REGEXP_ONLY_DIGITS_AND_CHARS; exports.d = m; exports.e = T; exports.f = I; exports.g = O;
|
|
2
|
+
//# sourceMappingURL=chunk-DRLZ27WH.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/codefast/codefast/packages/ui/dist/chunk-DRLZ27WH.cjs","../src/components/input-otp.tsx"],"names":["className","jsx","OTPInput","forwardedRef","cn","InputOTP","InputOTPGroup","index","slot","useContext","OTPInputContext","InputOTPSlot","props","DotIcon","InputOTPSeparator"],"mappings":"AAAA,qFAAY,CAAC,wDCGX,qCAMO,2CACkD,8BAavD,+CADC,IAAA,CAAA,CAAA,+BAAAA,CAAW,CAAA,SAAA,CAAA,CAAA,CAAA,kBACZC,CAAAA,CAACC,CAAAA,GACC,CAAA,CAAA,CAAKC,CAAAA,CACL,EAAA,6BAAA,kBAAA,CAAA,CAA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,CAAC,CAAA,GAAA,CAAA,CAAA,CAAI,CAAA,CAAA,EAAKE,6BAAAA,KAAmB,CAAA,CAAA,GAAA,CAAA,CAAA,CAAA,IAAa,CAAA,WACxC,CAAA,GAACU,CAAAA,CAAA,QAILC,CAAkB,6BAAA,oBAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,CAAA,WAAA,CAAA,mBAAA,CAAA,kMAAA","file":"/home/runner/work/codefast/codefast/packages/ui/dist/chunk-DRLZ27WH.cjs","sourcesContent":[null,"'use client';\n\nimport {\n OTPInput,\n OTPInputContext,\n REGEXP_ONLY_CHARS,\n REGEXP_ONLY_DIGITS,\n REGEXP_ONLY_DIGITS_AND_CHARS,\n} from 'input-otp';\nimport { DotIcon } from 'lucide-react';\nimport { type ComponentPropsWithoutRef, type ComponentRef, forwardRef, type HTMLAttributes, useContext } from 'react';\n\nimport { cn } from '@/lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Component: InputOtp\n * -------------------------------------------------------------------------- */\n\ntype InputOTPElement = ComponentRef<typeof OTPInput>;\ntype InputOTPProps = ComponentPropsWithoutRef<typeof OTPInput>;\n\nconst InputOTP = forwardRef<InputOTPElement, InputOTPProps>(\n ({ className, containerClassName, ...props }, forwardedRef) => (\n <OTPInput\n ref={forwardedRef}\n className={cn('disabled:cursor-default', className)}\n containerClassName={cn('flex items-center gap-2', 'has-[:disabled]:opacity-50', containerClassName)}\n {...props}\n />\n ),\n);\n\nInputOTP.displayName = 'InputOTP';\n\n/* -----------------------------------------------------------------------------\n * Component: InputOTPGroup\n * -------------------------------------------------------------------------- */\n\ntype InputOTPGroupElement = HTMLDivElement;\ntype InputOTPGroupProps = HTMLAttributes<HTMLDivElement>;\n\nconst InputOTPGroup = forwardRef<InputOTPGroupElement, InputOTPGroupProps>(({ className, ...props }, forwardedRef) => (\n <div ref={forwardedRef} className={cn('flex items-center', className)} {...props} />\n));\n\nInputOTPGroup.displayName = 'InputOTPGroup';\n\n/* -----------------------------------------------------------------------------\n * Component: InputOTPSlot\n * -------------------------------------------------------------------------- */\n\ntype InputOTPSlotElement = HTMLDivElement;\n\ninterface InputOTPSlotProps extends HTMLAttributes<HTMLDivElement> {\n index: number;\n}\n\nconst InputOTPSlot = forwardRef<InputOTPSlotElement, InputOTPSlotProps>(\n ({ index, className, ...props }, forwardedRef) => {\n const inputOTPContext = useContext(OTPInputContext);\n const slot = inputOTPContext.slots[index];\n\n return (\n <div\n ref={forwardedRef}\n className={cn(\n 'border-input relative flex size-10 items-center justify-center border-y border-r text-sm shadow-sm transition-all',\n 'first:rounded-l-md first:border-l',\n 'last:rounded-r-md',\n slot.isActive && 'z-10 outline outline-2',\n className,\n )}\n {...props}\n >\n {slot.char}\n {slot.hasFakeCaret ? (\n <div className=\"pointer-events-none absolute inset-0 flex items-center justify-center\">\n <div className=\"animate-caret-blink bg-foreground animate-duration-1000 h-4 w-px\" />\n </div>\n ) : null}\n </div>\n );\n },\n);\n\nInputOTPSlot.displayName = 'InputOTPSlot';\n\n/* -----------------------------------------------------------------------------\n * Component: InputOTPSeparator\n * -------------------------------------------------------------------------- */\n\ntype InputOTPSeparatorElement = HTMLDivElement;\ntype InputOTPSeparatorProps = HTMLAttributes<HTMLDivElement>;\n\nconst InputOTPSeparator = forwardRef<InputOTPSeparatorElement, InputOTPSeparatorProps>(({ ...props }, forwardedRef) => (\n <div ref={forwardedRef} role=\"separator\" {...props}>\n <DotIcon />\n </div>\n));\n\nInputOTPSeparator.displayName = 'InputOTPSeparator';\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n InputOTP,\n InputOTPGroup,\n InputOTPSeparator,\n InputOTPSlot,\n REGEXP_ONLY_CHARS,\n REGEXP_ONLY_DIGITS,\n REGEXP_ONLY_DIGITS_AND_CHARS,\n type InputOTPGroupProps,\n type InputOTPProps,\n type InputOTPSeparatorProps,\n type InputOTPSlotProps,\n};\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";var _chunkDD6AVCRHcjs = require('./chunk-DD6AVCRH.cjs');var _react = require('react');var _recharts = require('recharts'); var g = _interopRequireWildcard(_recharts);var _jsxruntime = require('react/jsx-runtime');var N={light:"",dark:".dark"},_=_react.createContext.call(void 0, null);function w(){let e=_react.useContext.call(void 0, _);if(!e)throw new Error("useChart must be used within a <ChartContainer />");return e}var K=_react.forwardRef.call(void 0, ({children:e,className:n,config:t,id:o,...a},s)=>{let c=_react.useId.call(void 0, ),l=`chart-${o||c.replace(/:/g,"")}`;return _jsxruntime.jsx.call(void 0, _.Provider,{value:{config:t},children:_jsxruntime.jsxs.call(void 0, "div",{ref:s,className:_chunkDD6AVCRHcjs.a.call(void 0, "flex aspect-video justify-center text-xs","[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground","[&_.recharts-cartesian-grid_line]:stroke-border/50","[&_.recharts-curve.recharts-tooltip-cursor]:stroke-border","[&_.recharts-dot]:stroke-transparent","[&_.recharts-layer]:outline-none","[&_.recharts-polar-grid_]:stroke-border","[&_.recharts-radial-bar-background-sector]:fill-muted","[&_.recharts-reference-line_]:stroke-border","[&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted","[&_.recharts-sector]:outline-none","[&_.recharts-sector]:stroke-transparent","[&_.recharts-surface]:outline-none",n),"data-chart":l,...a,children:[_jsxruntime.jsx.call(void 0, $,{config:t,id:l}),_jsxruntime.jsx.call(void 0, g.ResponsiveContainer,{children:e})]})})});K.displayName="Chart";function $({id:e,config:n}){let t=_react.useMemo.call(void 0, ()=>J(e,n),[e,n]);return _jsxruntime.jsx.call(void 0, "style",{dangerouslySetInnerHTML:{__html:t}})}var G=g.Tooltip,O= exports.d =_react.forwardRef.call(void 0, ({active:e,className:n,color:t,formatter:o,hideIndicator:a=!1,hideLabel:s=!1,indicator:c="dot",label:l,labelClassName:p,labelFormatter:C,labelKey:y,nameKey:E,payload:h},I)=>{let{config:m}=w(),L=_react.useMemo.call(void 0, ()=>{if(s||!_optionalChain([h, 'optionalAccess', _2 => _2.length]))return null;let[r]=h,P=`${y||r.dataKey||r.name||"value"}`,b=T(m,r,P),u=!y&&typeof l=="string"?_optionalChain([m, 'access', _3 => _3[l], 'optionalAccess', _4 => _4.label])||l:_optionalChain([b, 'optionalAccess', _5 => _5.label]);return C?_jsxruntime.jsx.call(void 0, "div",{className:_chunkDD6AVCRHcjs.a.call(void 0, "font-medium",p),children:C(u,h)}):u?_jsxruntime.jsx.call(void 0, "div",{className:_chunkDD6AVCRHcjs.a.call(void 0, "font-medium",p),children:u}):null},[m,s,l,p,C,y,h]);if(!e||!_optionalChain([h, 'optionalAccess', _6 => _6.length]))return null;let v=h.length===1&&c!=="dot";return _jsxruntime.jsxs.call(void 0, "div",{ref:I,className:_chunkDD6AVCRHcjs.a.call(void 0, "border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl",n),children:[v?null:L,_jsxruntime.jsx.call(void 0, "div",{className:"grid gap-1.5",children:h.map((r,P)=>{let b=`${E||r.name||r.dataKey||"value"}`,u=T(m,r,b),S=t||r.payload.fill||r.color;return _jsxruntime.jsx.call(void 0, "div",{className:_chunkDD6AVCRHcjs.a.call(void 0, "[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5",c==="dot"&&"items-center"),children:o&&r.value!==void 0&&r.name?o(r.value,r.name,r,P,r.payload):_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_optionalChain([u, 'optionalAccess', _7 => _7.icon])?_jsxruntime.jsx.call(void 0, u.icon,{}):!a&&_jsxruntime.jsx.call(void 0, "div",{className:_chunkDD6AVCRHcjs.a.call(void 0, "shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",{"h-2.5 w-2.5":c==="dot","w-1":c==="line","w-0 border-[1.5px] border-dashed bg-transparent":c==="dashed","my-0.5":v&&c==="dashed"}),style:{"--color-bg":S,"--color-border":S}}),_jsxruntime.jsxs.call(void 0, "div",{className:_chunkDD6AVCRHcjs.a.call(void 0, "flex flex-1 justify-between leading-none",v?"items-end":"items-center"),children:[_jsxruntime.jsxs.call(void 0, "div",{className:"grid gap-1.5",children:[v?L:null,_jsxruntime.jsx.call(void 0, "span",{className:"text-muted-foreground",children:_optionalChain([u, 'optionalAccess', _8 => _8.label])||r.name})]}),r.value?_jsxruntime.jsx.call(void 0, "span",{className:"text-foreground font-mono font-medium tabular-nums",children:r.value.toLocaleString()}):null]})]})},r.dataKey)})})]})});O.displayName="ChartTooltipContent";var Q=g.Legend,D= exports.f =_react.forwardRef.call(void 0, ({className:e,hideIcon:n=!1,nameKey:t,payload:o,verticalAlign:a="bottom"},s)=>{let{config:c}=w();return _optionalChain([o, 'optionalAccess', _9 => _9.length])?_jsxruntime.jsx.call(void 0, "div",{ref:s,className:_chunkDD6AVCRHcjs.a.call(void 0, "flex items-center justify-center gap-4",a==="top"?"pb-3":"pt-3",e),children:o.map(l=>{let p="value";t?p=t:l.dataKey&&(p=String(l.dataKey));let C=T(c,l,p);return _jsxruntime.jsxs.call(void 0, "div",{className:_chunkDD6AVCRHcjs.a.call(void 0, "[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:size-3"),children:[_optionalChain([C, 'optionalAccess', _10 => _10.icon])&&!n?_jsxruntime.jsx.call(void 0, C.icon,{}):_jsxruntime.jsx.call(void 0, "div",{className:"size-2 shrink-0 rounded",style:{backgroundColor:l.color}}),_optionalChain([C, 'optionalAccess', _11 => _11.label])]},String(l.value))})}):null});D.displayName="ChartLegendContent";function T(e,n,t){if(!k(n))return;let o="payload"in n&&k(n.payload)?n.payload:void 0,a=V(n,o,t);return a in e?e[a]:e[t]}function k(e){return typeof e=="object"&&e!==null}function V(e,n,t){return t in e&&typeof e[t]=="string"?e[t]:n&&t in n&&typeof n[t]=="string"?n[t]:t}function z(e,n,t){let o=[];return o.push(`${N[e]} [data-chart=${n}] {`),t.forEach(([a,s])=>{let c=_optionalChain([s, 'optionalAccess', _12 => _12.theme, 'optionalAccess', _13 => _13[e]])||_optionalChain([s, 'optionalAccess', _14 => _14.color]);c&&o.push(` --color-${a}: ${c};`)}),o.push("}"),o.join(`
|
|
2
|
+
`)}function J(e,n){let t=Object.entries(n).filter(([a,s])=>_optionalChain([s, 'optionalAccess', _15 => _15.theme])||_optionalChain([s, 'optionalAccess', _16 => _16.color])),o=[];return Object.keys(N).forEach(a=>{let s=z(a,e,t);o.push(s)}),o.join(`
|
|
3
|
+
`)}exports.a = K; exports.b = $; exports.c = G; exports.d = O; exports.e = Q; exports.f = D;
|
|
4
|
+
//# sourceMappingURL=chunk-FVR3LJWM.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/codefast/codefast/packages/ui/dist/chunk-FVR3LJWM.cjs","../src/components/chart.tsx"],"names":["RechartsPrimitive","createContext","useChart","ChartContainer","children","className","id","ref","uniqueId","useId","chartId","jsx","ChartContext"],"mappings":"AAAA,22BAAY,CAAC,wDCKX,8BASUA,gFAiNM,+CA3MhB,IACA,CAAA,CAAA,CAAA,KAAM,CAAA,EACR,CAAA,IA6BqBC,CAAwC,OAE7D,CAAA,CAAA,CAAA,CAAA,kCAAA,IAASC,CAA8B,CACrC,SAAuC,CAAA,CAEvC,CAAA,CAAA,IACE,CAAA,CAAA,+BAAA,CAAA,CAAM,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,MAAM,IAAA,KAAA,CAAA,mDAgBpB,CAAA,CAAMC,OACD,CAAA,CAAA,IAAA,CAAA,CAAAC,+BAAAA,CAAU,CAAA,QAAAC,CAAAA,CAAW,CAAA,SAAQ,CAAA,CAAAC,CAAAA,MAAa,CAAGC,CAAAA,CAAAA,EAAQ,CACtD,CAAA,CAAA,GAAMC,CAAWC,CAAAA,CAAM,CAAA,CACjBC,EAAU,CAAA,IAAA,CAAA,CAAA,0BAAA,CAASJ,CAAAA,CAAME,CAAAA,CAAS,MAAA,EAAQ,CAAA,EAAA,CAAA,CAAM,OAEtD,CAAA,IAAA,CACEG,EAACC,CAAAA,CAAa,CAAA;AA6XG;AACvB","file":"/home/runner/work/codefast/codefast/packages/ui/dist/chunk-FVR3LJWM.cjs","sourcesContent":[null,"'use client';\n\nimport {\n type ComponentProps,\n type ComponentType,\n createContext,\n type CSSProperties,\n forwardRef,\n type JSX,\n type ReactNode,\n useContext,\n useId,\n useMemo,\n} from 'react';\nimport * as RechartsPrimitive from 'recharts';\nimport { type NameType, type Payload, type ValueType } from 'recharts/types/component/DefaultTooltipContent';\n\nimport { cn } from '@/lib/utils';\n\nconst THEMES = {\n light: '',\n dark: '.dark',\n} as const;\n\ntype Theme = keyof typeof THEMES;\n\ninterface IconLabelConfig {\n icon?: ComponentType;\n label?: ReactNode | undefined;\n}\n\ninterface ColorConfig {\n color?: string;\n theme?: never;\n}\n\ninterface ThemeConfig {\n theme: Record<Theme, string>;\n color?: never;\n}\n\ntype ChartConfigItem = IconLabelConfig & (ColorConfig | ThemeConfig);\n\ntype ChartConfig = {\n [k in string]: ChartConfigItem | undefined;\n};\n\ninterface ChartContextProps {\n config: ChartConfig;\n}\n\nconst ChartContext = createContext<ChartContextProps | null>(null);\n\nfunction useChart(): ChartContextProps {\n const context = useContext(ChartContext);\n\n if (!context) {\n throw new Error('useChart must be used within a <ChartContainer />');\n }\n\n return context;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: Chart\n * -------------------------------------------------------------------------- */\n\ntype ChartContainerElement = HTMLDivElement;\ninterface ChartContainerProps extends ComponentProps<'div'> {\n children: ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children'];\n config: ChartConfig;\n}\n\nconst ChartContainer = forwardRef<ChartContainerElement, ChartContainerProps>(\n ({ children, className, config, id, ...props }, ref) => {\n const uniqueId = useId();\n const chartId = `chart-${id || uniqueId.replace(/:/g, '')}`;\n\n return (\n <ChartContext.Provider value={{ config }}>\n <div\n ref={ref}\n className={cn(\n 'flex aspect-video justify-center text-xs',\n '[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground',\n '[&_.recharts-cartesian-grid_line]:stroke-border/50',\n '[&_.recharts-curve.recharts-tooltip-cursor]:stroke-border',\n '[&_.recharts-dot]:stroke-transparent',\n '[&_.recharts-layer]:outline-none',\n '[&_.recharts-polar-grid_]:stroke-border',\n '[&_.recharts-radial-bar-background-sector]:fill-muted',\n '[&_.recharts-reference-line_]:stroke-border',\n '[&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted',\n '[&_.recharts-sector]:outline-none',\n '[&_.recharts-sector]:stroke-transparent',\n '[&_.recharts-surface]:outline-none',\n className,\n )}\n data-chart={chartId}\n {...props}\n >\n <ChartStyle config={config} id={chartId} />\n <RechartsPrimitive.ResponsiveContainer>{children}</RechartsPrimitive.ResponsiveContainer>\n </div>\n </ChartContext.Provider>\n );\n },\n);\n\nChartContainer.displayName = 'Chart';\n\n/* -----------------------------------------------------------------------------\n * Component: ChartStyle\n * -------------------------------------------------------------------------- */\n\ninterface ChartStyleProps {\n config: ChartConfig;\n id: string;\n}\n\nfunction ChartStyle({ id, config }: ChartStyleProps): JSX.Element | null {\n const cssString = useMemo(() => generateCSS(id, config), [id, config]);\n\n return <style dangerouslySetInnerHTML={{ __html: cssString }} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: ChartTooltip\n * -------------------------------------------------------------------------- */\n\ntype ChartTooltipProps = ComponentProps<typeof RechartsPrimitive.Tooltip>;\nconst ChartTooltip = RechartsPrimitive.Tooltip;\n\n/* -----------------------------------------------------------------------------\n * Component: ChartTooltipContent\n * -------------------------------------------------------------------------- */\n\ntype ChartTooltipContentElement = HTMLDivElement;\ninterface ChartTooltipContentProps\n extends ComponentProps<typeof RechartsPrimitive.Tooltip>,\n Omit<ComponentProps<'div'>, 'content'> {\n hideIndicator?: boolean;\n hideLabel?: boolean;\n indicator?: 'line' | 'dot' | 'dashed';\n labelKey?: string;\n nameKey?: string;\n}\n\nconst ChartTooltipContent = forwardRef<ChartTooltipContentElement, ChartTooltipContentProps>(\n (\n {\n active,\n className,\n color,\n formatter,\n hideIndicator = false,\n hideLabel = false,\n indicator = 'dot',\n label,\n labelClassName,\n labelFormatter,\n labelKey,\n nameKey,\n payload,\n },\n ref,\n ) => {\n const { config } = useChart();\n\n const tooltipLabel = useMemo(() => {\n if (hideLabel || !payload?.length) {\n return null;\n }\n\n const [item] = payload;\n\n const key = `${labelKey || item.dataKey || item.name || 'value'}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const value = !labelKey && typeof label === 'string' ? config[label]?.label || label : itemConfig?.label;\n\n if (labelFormatter) {\n return <div className={cn('font-medium', labelClassName)}>{labelFormatter(value, payload)}</div>;\n }\n\n if (!value) {\n return null;\n }\n\n return <div className={cn('font-medium', labelClassName)}>{value}</div>;\n }, [config, hideLabel, label, labelClassName, labelFormatter, labelKey, payload]);\n\n if (!active || !payload?.length) {\n return null;\n }\n\n const nestLabel = payload.length === 1 && indicator !== 'dot';\n\n return (\n <div\n ref={ref}\n className={cn(\n 'border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl',\n className,\n )}\n >\n {!nestLabel ? tooltipLabel : null}\n <div className=\"grid gap-1.5\">\n {payload.map((item, index) => {\n const key = `${nameKey || item.name || item.dataKey || 'value'}`;\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n const indicatorColor = color || (item.payload as { fill?: string }).fill || item.color;\n\n return (\n <div\n key={item.dataKey}\n className={cn(\n '[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5',\n indicator === 'dot' && 'items-center',\n )}\n >\n {formatter && item.value !== undefined && item.name ? (\n formatter(item.value, item.name, item, index, item.payload as Payload<ValueType, NameType>[])\n ) : (\n <>\n {itemConfig?.icon ? (\n <itemConfig.icon />\n ) : (\n !hideIndicator && (\n <div\n className={cn('shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]', {\n 'h-2.5 w-2.5': indicator === 'dot',\n 'w-1': indicator === 'line',\n 'w-0 border-[1.5px] border-dashed bg-transparent': indicator === 'dashed',\n 'my-0.5': nestLabel && indicator === 'dashed',\n })}\n style={\n {\n '--color-bg': indicatorColor,\n '--color-border': indicatorColor,\n } as CSSProperties\n }\n />\n )\n )}\n <div\n className={cn(\n 'flex flex-1 justify-between leading-none',\n nestLabel ? 'items-end' : 'items-center',\n )}\n >\n <div className=\"grid gap-1.5\">\n {nestLabel ? tooltipLabel : null}\n <span className=\"text-muted-foreground\">{itemConfig?.label || item.name}</span>\n </div>\n {item.value ? (\n <span className=\"text-foreground font-mono font-medium tabular-nums\">\n {item.value.toLocaleString()}\n </span>\n ) : null}\n </div>\n </>\n )}\n </div>\n );\n })}\n </div>\n </div>\n );\n },\n);\n\nChartTooltipContent.displayName = 'ChartTooltipContent';\n\n/* -----------------------------------------------------------------------------\n * Component: ChartLegend\n * -------------------------------------------------------------------------- */\n\ntype ChartLegendProps = ComponentProps<typeof RechartsPrimitive.Legend>;\nconst ChartLegend = RechartsPrimitive.Legend;\n\n/* -----------------------------------------------------------------------------\n * Component: ChartLegendContent\n * -------------------------------------------------------------------------- */\n\ntype ChartLegendContent = HTMLDivElement;\ninterface ChartLegendContentProps\n extends ComponentProps<'div'>,\n Pick<RechartsPrimitive.LegendProps, 'payload' | 'verticalAlign'> {\n hideIcon?: boolean;\n nameKey?: string;\n}\n\nconst ChartLegendContent = forwardRef<HTMLDivElement, ChartLegendContentProps>(\n ({ className, hideIcon = false, nameKey, payload, verticalAlign = 'bottom' }, ref) => {\n const { config } = useChart();\n\n if (!payload?.length) {\n return null;\n }\n\n return (\n <div\n ref={ref}\n className={cn('flex items-center justify-center gap-4', verticalAlign === 'top' ? 'pb-3' : 'pt-3', className)}\n >\n {payload.map((item) => {\n let key = 'value';\n\n if (nameKey) {\n key = nameKey;\n } else if (item.dataKey) {\n key = String(item.dataKey);\n }\n\n const itemConfig = getPayloadConfigFromPayload(config, item, key);\n\n return (\n <div\n key={String(item.value)}\n className={cn('[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:size-3')}\n >\n {itemConfig?.icon && !hideIcon ? (\n <itemConfig.icon />\n ) : (\n <div\n className=\"size-2 shrink-0 rounded\"\n style={{\n backgroundColor: item.color,\n }}\n />\n )}\n {itemConfig?.label}\n </div>\n );\n })}\n </div>\n );\n },\n);\n\nChartLegendContent.displayName = 'ChartLegendContent';\n\n/* -----------------------------------------------------------------------------\n * Helpers\n * -------------------------------------------------------------------------- */\n\n/**\n * Extracts and returns the appropriate configuration object from\n * the payload based on the specified key.\n *\n * @param config - The chart configuration object that contains various\n * settings.\n * @param payload - The payload object that might contain nested payload data.\n * @param key - The key used to retrieve the specific configuration from the\n * chart config.\n * @returns Returns a configuration object with optional properties `icon`,\n * `label`, `color` or `theme`, or `undefined` if the payload is invalid or\n * no configuration is found for the provided key.\n */\nfunction getPayloadConfigFromPayload(config: ChartConfig, payload: unknown, key: string): ChartConfigItem | undefined {\n if (!isValidObject(payload)) {\n return undefined;\n }\n\n const nestedPayload = 'payload' in payload && isValidObject(payload.payload) ? payload.payload : undefined;\n\n const configLabelKey = getConfigLabelKey(payload, nestedPayload, key);\n\n return configLabelKey in config ? config[configLabelKey] : config[key];\n}\n\n/**\n * Checks if the provided value is a valid object.\n *\n * @param obj - The value to check.\n * @returns - Returns true if the value is an object and not null, false\n * otherwise.\n */\nfunction isValidObject(obj: unknown): obj is Record<string, unknown> {\n return typeof obj === 'object' && obj !== null;\n}\n\n/**\n * Retrieves the configuration label key from either the payload or\n * nestedPayload. If the key exists in the payload and is a string, the\n * corresponding value is returned. Otherwise, if the key exists in the\n * nestedPayload and is a string, its value is returned. If the key is not\n * found as a string in either object, the key itself is returned.\n *\n * @param payload - The primary payload containing key-value pairs.\n * @param nestedPayload - An optional nested payload containing additional\n * key-value pairs.\n * @param key - The key to search for within the payload and nestedPayload.\n *\n * @returns The string value associated with the key if found; otherwise, the\n * key itself.\n */\nfunction getConfigLabelKey(\n payload: Record<string, unknown>,\n nestedPayload: Record<string, unknown> | undefined,\n key: string,\n): string {\n if (key in payload && typeof payload[key] === 'string') {\n return payload[key];\n }\n\n if (nestedPayload && key in nestedPayload && typeof nestedPayload[key] === 'string') {\n return nestedPayload[key];\n }\n\n return key;\n}\n\n/**\n * Generates CSS for a specified theme and chart configuration.\n *\n * @param theme - The theme to be used (for example, 'light', 'dark').\n * @param id - The unique identifier of the chart.\n * @param configEntries - A list of configuration entries, each containing a\n * key and a chart configuration.\n * @returns The generated CSS as a string.\n */\nfunction generateThemeCSS(theme: Theme, id: string, configEntries: [string, ChartConfig[string]][]): string {\n const rules: string[] = [];\n\n rules.push(`${THEMES[theme]} [data-chart=${id}] {`);\n\n configEntries.forEach(([key, itemConfig]) => {\n const color = itemConfig?.theme?.[theme] || itemConfig?.color;\n\n if (color) {\n rules.push(` --color-${key}: ${color};`);\n }\n });\n\n rules.push('}');\n\n return rules.join('\\n');\n}\n\n/**\n * Generates CSS styles for a chart based on the provided configuration and\n * themes.\n *\n * @param id - The unique identifier for the chart element.\n * @param config - Configuration object for the chart. This includes theme and\n * color settings.\n * @returns A string containing the generated CSS rules.\n */\nfunction generateCSS(id: string, config: ChartConfig): string {\n const themeOrColorConfig = Object.entries(config).filter(([_, itemConfig]) => itemConfig?.theme || itemConfig?.color);\n\n const allRules: string[] = [];\n\n Object.keys(THEMES).forEach((theme) => {\n const themeCSS = generateThemeCSS(theme as Theme, id, themeOrColorConfig);\n\n allRules.push(themeCSS);\n });\n\n return allRules.join('\\n');\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n ChartContainer,\n ChartLegend,\n ChartLegendContent,\n ChartStyle,\n ChartTooltip,\n ChartTooltipContent,\n type ChartConfig,\n type ChartContainerProps,\n type ChartLegendContentProps,\n type ChartLegendProps,\n type ChartStyleProps,\n type ChartTooltipContentProps,\n type ChartTooltipProps,\n};\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{a as r}from"./chunk-7MCTR55I.js";import{a as i}from"./chunk-24TJIVWR.js";import{a as n}from"./chunk-Q3UBBFLY.js";import*as o from"@codefast-ui/input";import{EyeClosedIcon as c,EyeIcon as v}from"lucide-react";import{forwardRef as C,useCallback as R,useState as x}from"react";import{jsx as t,jsxs as h}from"react/jsx-runtime";var{root:E,input:b}=r(),g=C(({className:a,inputSize:e,loaderPosition:m,loading:d,prefix:u,spinner:P,suffix:l,...p},f)=>{let[s,I]=x("password"),w=R(()=>{I(y=>y==="password"?"text":"password")},[]);return h(o.Root,{className:E({inputSize:e,className:a}),loaderPosition:m,loading:d,prefix:u,spinner:P||t(n,{}),suffix:l,children:[t(o.Item,{ref:f,className:b({inputSize:e}),type:s,...p}),t(i,{icon:!0,inside:!0,"aria-label":s==="password"?"Show password":"Hide password",className:"rounded-full",disabled:p.disabled,prefix:s==="password"?t(c,{}):t(v,{}),size:e,variant:"ghost",onClick:w})]})});g.displayName="PasswordInput";export{g as a};
|
|
2
|
+
//# sourceMappingURL=chunk-GAIGLFOT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/password-input.tsx"],"names":["InputPrimitive","EyeClosedIcon","EyeIcon","forwardRef","useCallback","useState","jsx","jsxs","root","input","inputVariants","PasswordInput","className","inputSize","loaderPosition","loading","prefix","spinner","suffix","props","forwardedRef","type","setType","togglePasswordVisibility","prev","Spinner","Button"],"mappings":"wHAEA,UAAYA,MAAoB,qBAChC,OAAS,iBAAAC,EAAe,WAAAC,MAAe,eACvC,OAIE,cAAAC,EAEA,eAAAC,EACA,YAAAC,MACK,QA+BD,OAKsB,OAAAC,EALtB,QAAAC,MAAA,oBArBN,GAAM,CAAE,KAAAC,EAAM,MAAAC,CAAM,EAAIC,EAAc,EAYhCC,EAAgBR,EACpB,CAAC,CAAE,UAAAS,EAAW,UAAAC,EAAW,eAAAC,EAAgB,QAAAC,EAAS,OAAAC,EAAQ,QAAAC,EAAS,OAAAC,EAAQ,GAAGC,CAAM,EAAGC,IAAiB,CACtG,GAAM,CAACC,EAAMC,CAAO,EAAIjB,EAA8B,UAAU,EAE1DkB,EAA2BnB,EAAkD,IAAM,CACvFkB,EAASE,GAAUA,IAAS,WAAa,OAAS,UAAW,CAC/D,EAAG,CAAC,CAAC,EAEL,OACEjB,EAAgB,OAAf,CACC,UAAWC,EAAK,CAAE,UAAAK,EAAW,UAAAD,CAAU,CAAC,EACxC,eAAgBE,EAChB,QAASC,EACT,OAAQC,EACR,QAASC,GAAWX,EAACmB,EAAA,EAAQ,EAC7B,OAAQP,EAER,UAAAZ,EAAgB,OAAf,CAAoB,IAAKc,EAAc,UAAWX,EAAM,CAAE,UAAAI,CAAU,CAAC,EAAG,KAAMQ,EAAO,GAAGF,EAAO,EAChGb,EAACoB,EAAA,CACC,KAAI,GACJ,OAAM,GACN,aAAYL,IAAS,WAAa,gBAAkB,gBACpD,UAAU,eACV,SAAUF,EAAM,SAChB,OAAQE,IAAS,WAAaf,EAACL,EAAA,EAAc,EAAKK,EAACJ,EAAA,EAAQ,EAC3D,KAAMW,EACN,QAAQ,QACR,QAASU,EACX,GACF,CAEJ,CACF,EAEAZ,EAAc,YAAc","sourcesContent":["'use client';\n\nimport * as InputPrimitive from '@codefast-ui/input';\nimport { EyeClosedIcon, EyeIcon } from 'lucide-react';\nimport {\n type ComponentProps,\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n type MouseEventHandler,\n useCallback,\n useState,\n} from 'react';\n\nimport { Button } from '@/components/button';\nimport { Spinner } from '@/components/spinner';\nimport { inputVariants, type InputVariantsProps } from '@/styles/input-variants';\n\n/* -----------------------------------------------------------------------------\n * Variant: PasswordInput\n * -------------------------------------------------------------------------- */\n\nconst { root, input } = inputVariants();\n\n/* -----------------------------------------------------------------------------\n * Component: PasswordInput\n * -------------------------------------------------------------------------- */\n\ntype PasswordInputElement = ComponentRef<typeof InputPrimitive.Item>;\ninterface PasswordInputProps\n extends InputVariantsProps,\n ComponentProps<typeof InputPrimitive.Root>,\n Omit<ComponentPropsWithoutRef<typeof InputPrimitive.Item>, 'prefix' | 'type'> {}\n\nconst PasswordInput = forwardRef<PasswordInputElement, PasswordInputProps>(\n ({ className, inputSize, loaderPosition, loading, prefix, spinner, suffix, ...props }, forwardedRef) => {\n const [type, setType] = useState<'password' | 'text'>('password');\n\n const togglePasswordVisibility = useCallback<MouseEventHandler<HTMLButtonElement>>(() => {\n setType((prev) => (prev === 'password' ? 'text' : 'password'));\n }, []);\n\n return (\n <InputPrimitive.Root\n className={root({ inputSize, className })}\n loaderPosition={loaderPosition}\n loading={loading}\n prefix={prefix}\n spinner={spinner || <Spinner />}\n suffix={suffix}\n >\n <InputPrimitive.Item ref={forwardedRef} className={input({ inputSize })} type={type} {...props} />\n <Button\n icon\n inside\n aria-label={type === 'password' ? 'Show password' : 'Hide password'}\n className=\"rounded-full\"\n disabled={props.disabled}\n prefix={type === 'password' ? <EyeClosedIcon /> : <EyeIcon />}\n size={inputSize}\n variant=\"ghost\"\n onClick={togglePasswordVisibility}\n />\n </InputPrimitive.Root>\n );\n },\n);\n\nPasswordInput.displayName = 'PasswordInput';\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { PasswordInput, type PasswordInputProps };\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{a as r,c as d}from"./chunk-RNWK4YZ2.js";import{a as p}from"./chunk-VPYH6JWS.js";import{Command as m}from"cmdk";import{SearchIcon as s}from"lucide-react";import{forwardRef as a}from"react";import{jsx as n,jsxs as g}from"react/jsx-runtime";var i=a(({className:e,...o},t)=>n(m,{ref:t,className:p("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...o}));i.displayName=m.displayName;function k({children:e,...o}){return n(r,{...o,children:n(d,{className:"p-0",children:n(i,{className:"[&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:size-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:size-5",children:e})})})}var C=a(({className:e,...o},t)=>g("div",{className:"flex items-center gap-2 border-b px-3","cmdk-input-wrapper":"",children:[n(s,{className:"size-5 shrink-0 opacity-50"}),n(m.Input,{ref:t,className:p("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent text-sm outline-none disabled:cursor-default disabled:opacity-50",e),...o})]}));C.displayName=m.Input.displayName;var l=a(({className:e,...o},t)=>n(m.List,{ref:t,className:p("max-h-72 overflow-y-auto overflow-x-hidden",e),...o}));l.displayName=m.List.displayName;var y=a((e,o)=>n(m.Empty,{ref:o,className:"py-6 text-center text-sm",...e}));y.displayName=m.Empty.displayName;var u=a(({className:e,...o},t)=>n(m.Group,{ref:t,className:p("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...o}));u.displayName=m.Group.displayName;var f=a(({className:e,...o},t)=>n(m.Separator,{ref:t,className:p("bg-border -mx-1 h-px",e),...o}));f.displayName=m.Separator.displayName;var c=a(({className:e,...o},t)=>n(m.Item,{ref:t,className:p("gap-x-2 px-3 py-1.5","relative flex cursor-pointer select-none items-center rounded text-sm","aria-disabled:pointer-events-none aria-disabled:opacity-50","aria-selected:bg-accent aria-selected:text-accent-foreground aria-selected:outline-none",e),...o}));c.displayName=m.Item.displayName;var P=a(({className:e,...o},t)=>n(m.Loading,{ref:t,className:p("flex justify-center p-2",e),...o}));P.displayName=m.Loading.displayName;function R({className:e,...o}){return n("span",{className:p("text-muted-foreground ml-auto text-xs tracking-widest",e),...o})}export{i as a,k as b,C as c,l as d,y as e,u as f,f as g,c as h,P as i,R as j};
|
|
2
|
+
//# sourceMappingURL=chunk-GBCWWLEX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/command.tsx"],"names":["CommandPrimitive","SearchIcon","forwardRef","jsx","jsxs","Command","className","props","forwardedRef","cn","CommandDialog","children","Dialog","DialogContent","CommandInput","CommandList","CommandEmpty","CommandGroup","CommandSeparator","CommandItem","CommandLoading","CommandShortcut"],"mappings":"uFAEA,OAAS,WAAWA,MAAwB,OAC5C,OAAS,cAAAC,MAAkB,eAC3B,OAIE,cAAAC,MAGK,QAaL,cAAAC,EAsCA,QAAAC,MAtCA,oBADF,IAAMC,EAAUH,EAAyC,CAAC,CAAE,UAAAI,EAAW,GAAGC,CAAM,EAAGC,IACjFL,EAACH,EAAA,CACC,IAAKQ,EACL,UAAWC,EACT,4FACAH,CACF,EACC,GAAGC,EACN,CACD,EAEDF,EAAQ,YAAcL,EAAiB,YAQvC,SAASU,EAAc,CAAE,SAAAC,EAAU,GAAGJ,CAAM,EAAoC,CAC9E,OACEJ,EAACS,EAAA,CAAQ,GAAGL,EACV,SAAAJ,EAACU,EAAA,CAAc,UAAU,MACvB,SAAAV,EA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KAAjB,CACC,IAAKQ,EACL,UAAWC,EACT,sBACA,wEACA,6DACA,0FACAH,CACF,EACC,GAAGC,EACN,CACD,EAEDY,EAAY,YAAcnB,EAAiB,KAAK,YAShD,IAAMoB,EAAiBlB,EACrB,CAAC,CAAE,UAAAI,EAAW,GAAGC,CAAM,EAAGC,IACxBL,EAACH,EAAiB,QAAjB,CAAyB,IAAKQ,EAAc,UAAWC,EAAG,0BAA2BH,CAAS,EAAI,GAAGC,EAAO,CAEjH,EAEAa,EAAe,YAAcpB,EAAiB,QAAQ,YAQtD,SAASqB,EAAgB,CAAE,UAAAf,EAAW,GAAGC,CAAM,EAAsC,CACnF,OAAOJ,EAAC,QAAK,UAAWM,EAAG,wDAAyDH,CAAS,EAAI,GAAGC,EAAO,CAC7G","sourcesContent":["'use client';\n\nimport { Command as CommandPrimitive } from 'cmdk';\nimport { SearchIcon } from 'lucide-react';\nimport {\n type ComponentProps,\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n type HTMLAttributes,\n type JSX,\n} from 'react';\n\nimport { Dialog, DialogContent } from '@/components/dialog';\nimport { cn } from '@/lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Component: Command\n * -------------------------------------------------------------------------- */\n\ntype CommandElement = ComponentRef<typeof CommandPrimitive>;\ntype CommandProps = ComponentPropsWithoutRef<typeof CommandPrimitive>;\n\nconst Command = forwardRef<CommandElement, CommandProps>(({ className, ...props }, forwardedRef) => (\n <CommandPrimitive\n ref={forwardedRef}\n className={cn(\n 'bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md',\n className,\n )}\n {...props}\n />\n));\n\nCommand.displayName = CommandPrimitive.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: CommandDialog\n * -------------------------------------------------------------------------- */\n\ntype CommandDialogProps = ComponentProps<typeof Dialog>;\n\nfunction CommandDialog({ children, ...props }: CommandDialogProps): JSX.Element {\n return (\n <Dialog {...props}>\n <DialogContent className=\"p-0\">\n <Command className=\"[&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:size-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:size-5\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CommandInput\n * -------------------------------------------------------------------------- */\n\ntype CommandInputElement = ComponentRef<typeof CommandPrimitive.Input>;\ntype CommandInputProps = ComponentPropsWithoutRef<typeof CommandPrimitive.Input>;\n\nconst CommandInput = forwardRef<CommandInputElement, CommandInputProps>(({ className, ...props }, forwardedRef) => (\n <div className=\"flex items-center gap-2 border-b px-3\" cmdk-input-wrapper=\"\">\n <SearchIcon className=\"size-5 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n ref={forwardedRef}\n className={cn(\n 'placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent text-sm outline-none disabled:cursor-default disabled:opacity-50',\n className,\n )}\n {...props}\n />\n </div>\n));\n\nCommandInput.displayName = CommandPrimitive.Input.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: CommandList\n * -------------------------------------------------------------------------- */\n\ntype CommandListElement = ComponentRef<typeof CommandPrimitive.List>;\ntype CommandListProps = ComponentPropsWithoutRef<typeof CommandPrimitive.List>;\n\nconst CommandList = forwardRef<CommandListElement, CommandListProps>(({ className, ...props }, forwardedRef) => (\n <CommandPrimitive.List\n ref={forwardedRef}\n className={cn('max-h-72 overflow-y-auto overflow-x-hidden', className)}\n {...props}\n />\n));\n\nCommandList.displayName = CommandPrimitive.List.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: CommandEmpty\n * -------------------------------------------------------------------------- */\n\ntype CommandEmptyElement = ComponentRef<typeof CommandPrimitive.Empty>;\ntype CommandEmptyProps = ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>;\n\nconst CommandEmpty = forwardRef<CommandEmptyElement, CommandEmptyProps>((props, forwardedRef) => (\n <CommandPrimitive.Empty ref={forwardedRef} className=\"py-6 text-center text-sm\" {...props} />\n));\n\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: CommandGroup\n * -------------------------------------------------------------------------- */\n\ntype CommandGroupElement = ComponentRef<typeof CommandPrimitive.Group>;\ntype CommandGroupProps = ComponentPropsWithoutRef<typeof CommandPrimitive.Group>;\n\nconst CommandGroup = forwardRef<CommandGroupElement, CommandGroupProps>(({ className, ...props }, forwardedRef) => (\n <CommandPrimitive.Group\n ref={forwardedRef}\n className={cn(\n 'text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium',\n className,\n )}\n {...props}\n />\n));\n\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: CommandSeparator\n * -------------------------------------------------------------------------- */\n\ntype CommandSeparatorElement = ComponentRef<typeof CommandPrimitive.Separator>;\ntype CommandSeparatorProps = ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>;\n\nconst CommandSeparator = forwardRef<CommandSeparatorElement, CommandSeparatorProps>(\n ({ className, ...props }, forwardedRef) => (\n <CommandPrimitive.Separator ref={forwardedRef} className={cn('bg-border -mx-1 h-px', className)} {...props} />\n ),\n);\n\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: CommandItem\n * -------------------------------------------------------------------------- */\n\ntype CommandItemElement = ComponentRef<typeof CommandPrimitive.Item>;\ntype CommandItemProps = ComponentPropsWithoutRef<typeof CommandPrimitive.Item>;\n\nconst CommandItem = forwardRef<CommandItemElement, CommandItemProps>(({ className, ...props }, forwardedRef) => (\n <CommandPrimitive.Item\n ref={forwardedRef}\n className={cn(\n 'gap-x-2 px-3 py-1.5',\n 'relative flex cursor-pointer select-none items-center rounded text-sm',\n 'aria-disabled:pointer-events-none aria-disabled:opacity-50',\n 'aria-selected:bg-accent aria-selected:text-accent-foreground aria-selected:outline-none',\n className,\n )}\n {...props}\n />\n));\n\nCommandItem.displayName = CommandPrimitive.Item.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: CommandLoading\n * -------------------------------------------------------------------------- */\n\ntype CommandLoadingElement = ComponentRef<typeof CommandPrimitive.Loading>;\ntype CommandLoadingProps = ComponentPropsWithoutRef<typeof CommandPrimitive.Loading>;\n\nconst CommandLoading = forwardRef<CommandLoadingElement, CommandLoadingProps>(\n ({ className, ...props }, forwardedRef) => (\n <CommandPrimitive.Loading ref={forwardedRef} className={cn('flex justify-center p-2', className)} {...props} />\n ),\n);\n\nCommandLoading.displayName = CommandPrimitive.Loading.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: CommandShortcut\n * -------------------------------------------------------------------------- */\n\ntype CommandShortcutProps = HTMLAttributes<HTMLSpanElement>;\n\nfunction CommandShortcut({ className, ...props }: CommandShortcutProps): JSX.Element {\n return <span className={cn('text-muted-foreground ml-auto text-xs tracking-widest', className)} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Command,\n CommandDialog,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n CommandLoading,\n CommandSeparator,\n CommandShortcut,\n type CommandDialogProps,\n type CommandEmptyProps,\n type CommandGroupProps,\n type CommandInputProps,\n type CommandItemProps,\n type CommandListProps,\n type CommandLoadingProps,\n type CommandProps,\n type CommandSeparatorProps,\n type CommandShortcutProps,\n};\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }"use client";var _chunkDD6AVCRHcjs = require('./chunk-DD6AVCRH.cjs');var _lucidereact = require('lucide-react');var _reactresizablepanels = require('react-resizable-panels'); var e = _interopRequireWildcard(_reactresizablepanels);var _jsxruntime = require('react/jsx-runtime');function c({className:a,...t}){return _jsxruntime.jsx.call(void 0, e.PanelGroup,{className:_chunkDD6AVCRHcjs.a.call(void 0, "flex size-full","data-[panel-group-direction=vertical]:flex-col",a),...t})}var f=e.Panel;function d({withHandle:a,className:t,...l}){return _jsxruntime.jsx.call(void 0, e.PanelResizeHandle,{className:_chunkDD6AVCRHcjs.a.call(void 0, "bg-border relative flex w-px items-center justify-center transition","after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2","focus-visible:ring-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2","data-[panel-group-direction=vertical]:h-px","data-[panel-group-direction=vertical]:w-full","data-[panel-group-direction=vertical]:after:left-0","data-[panel-group-direction=vertical]:after:h-1","data-[panel-group-direction=vertical]:after:w-full","data-[panel-group-direction=vertical]:after:-translate-y-1/2","data-[panel-group-direction=vertical]:after:translate-x-0","[&[data-panel-group-direction=vertical]>div]:rotate-90",t),...l,children:a?_jsxruntime.jsx.call(void 0, "div",{className:"bg-border z-10 flex h-4 w-3 items-center justify-center rounded border",children:_jsxruntime.jsx.call(void 0, _lucidereact.GripVerticalIcon,{className:"size-2.5"})}):null})}exports.a = c; exports.b = f; exports.c = d;
|
|
2
|
+
//# sourceMappingURL=chunk-GCXQJEFZ.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/codefast/codefast/packages/ui/dist/chunk-GCXQJEFZ.cjs","../src/components/resizable.tsx"],"names":["ResizablePrimitive","className","cn","ResizablePanel","withHandle","jsx","GripVerticalIcon"],"mappings":"AAAA,uWAAY,CAAC,wDCEJ,2CAEGA,sHAaR,+CAJF,SAAAC,CAAAA,CACA,CAAA,SAEA,CAAA,CAAA,CAAA,GACsB,CAAA,CAAA,CAAA,CAAA,OAAA,6BAAA,CAClB,CAAA,UAAWC,CAAG,CAAA,SAAA,CAAA,iCAAA,gBAAkB,CAAA,gDAUtC,CAAA,CAAMC,CAAAA,CAAoC,GAAA,CAAA,CAAA,CAAA,CAAA,IAM1C,CAAA,CAAA,CAAA,CAAA,KACE,CAAA,SAAA,CAAAC,CAAAA,CACA,UAAAH,CAAAA,CACA,CAAA,SAIA,CAAA,CAAA,CAAA,GACsB,CAAA,CAAA,CAAA,CAAA,OAAA,6BAAA,CAAA,CAAA,iBACPC,CACT,CAAA,SAAA,CAAA,iCAAA,qEACA,CAAA,gFACA,CAAA,qGACA,CAAA,4CACA,CAAA,8CACA,CAAA,oDACA,CAAA,iDACA,CAAA,oDACA,CAAA,8DACA,CAAA,2DACA,CAAA,wDAKD,CAAA,CAAA,CAAA,CAAA,GACCG,CAAAA,CAAC,QAAI,CAAA,CAAA,CAAA,6BAAA,KAAU,CAAA,CAAA,SAAA,CAAA,wEACZC,CAAA,QAAiB,CAAA,6BAAA,6BAAU,CAAA,CAAA,SAAW,CACzC,UAIR,CAAA,CAAA,CAAA,CAAA,CAAA,IAAA,CAAA,CAAA,CAAA,4CAAA","file":"/home/runner/work/codefast/codefast/packages/ui/dist/chunk-GCXQJEFZ.cjs","sourcesContent":[null,"'use client';\n\nimport { GripVerticalIcon } from 'lucide-react';\nimport { type ComponentProps, type JSX } from 'react';\nimport * as ResizablePrimitive from 'react-resizable-panels';\n\nimport { cn } from '@/lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Component: ResizablePanelGroup\n * -------------------------------------------------------------------------- */\n\nfunction ResizablePanelGroup({\n className,\n ...props\n}: ComponentProps<typeof ResizablePrimitive.PanelGroup>): JSX.Element {\n return (\n <ResizablePrimitive.PanelGroup\n className={cn('flex size-full', 'data-[panel-group-direction=vertical]:flex-col', className)}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: ResizablePanel\n * -------------------------------------------------------------------------- */\n\nconst ResizablePanel = ResizablePrimitive.Panel;\n\n/* -----------------------------------------------------------------------------\n * Component: ResizableHandle\n * -------------------------------------------------------------------------- */\n\nfunction ResizableHandle({\n withHandle,\n className,\n ...props\n}: ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {\n withHandle?: boolean;\n}): JSX.Element {\n return (\n <ResizablePrimitive.PanelResizeHandle\n className={cn(\n 'bg-border relative flex w-px items-center justify-center transition',\n 'after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2',\n 'focus-visible:ring-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2',\n 'data-[panel-group-direction=vertical]:h-px',\n 'data-[panel-group-direction=vertical]:w-full',\n 'data-[panel-group-direction=vertical]:after:left-0',\n 'data-[panel-group-direction=vertical]:after:h-1',\n 'data-[panel-group-direction=vertical]:after:w-full',\n 'data-[panel-group-direction=vertical]:after:-translate-y-1/2',\n 'data-[panel-group-direction=vertical]:after:translate-x-0',\n '[&[data-panel-group-direction=vertical]>div]:rotate-90',\n className,\n )}\n {...props}\n >\n {withHandle ? (\n <div className=\"bg-border z-10 flex h-4 w-3 items-center justify-center rounded border\">\n <GripVerticalIcon className=\"size-2.5\" />\n </div>\n ) : null}\n </ResizablePrimitive.PanelResizeHandle>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { ResizableHandle, ResizablePanel, ResizablePanelGroup };\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as r}from"./chunk-EVRI6TWT.js";import{a as e}from"./chunk-VPYH6JWS.js";import{ChevronLeftIcon as m,ChevronRightIcon as u,EllipsisIcon as c}from"lucide-react";import{forwardRef as p}from"react";import{jsx as t,jsxs as o}from"react/jsx-runtime";function b({className:n,...i}){return t("nav",{"aria-label":"pagination",className:e("mx-auto flex w-full justify-center",n),role:"navigation",...i})}var L=p(({className:n,...i},a)=>t("ul",{ref:a,className:e("flex flex-row items-center gap-1",n),...i}));L.displayName="PaginationContent";var f=p((n,i)=>t("li",{ref:i,...n}));f.displayName="PaginationItem";function P({children:n,className:i,icon:a=!0,isActive:s,size:l,...g}){return t("a",{"aria-current":s?"page":void 0,className:r({className:i,icon:a,size:l,variant:s?"outline":"ghost"}),...g,children:n})}function x({...n}){return o(P,{"aria-label":"Go to previous page",icon:!1,...n,children:[t(m,{className:"size-4"}),t("span",{children:"Previous"})]})}function I({...n}){return o(P,{"aria-label":"Go to next page",icon:!1,...n,children:[t("span",{children:"Next"}),t(u,{})]})}function v({className:n,...i}){return o("span",{"aria-hidden":!0,className:e("flex size-10 items-center justify-center",n),...i,children:[t(c,{className:"size-4"}),t("span",{className:"sr-only",children:"More pages"})]})}export{b as a,L as b,f as c,P as d,x as e,I as f,v as g};
|
|
2
|
+
//# sourceMappingURL=chunk-GDEO256Z.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/pagination.tsx"],"names":["ChevronLeftIcon","ChevronRightIcon","EllipsisIcon","forwardRef","jsx","jsxs","Pagination","className","props","cn","PaginationContent","forwardedRef","PaginationItem","PaginationLink","children","icon","isActive","size","buttonVariants","PaginationPrevious","PaginationNext","PaginationEllipsis"],"mappings":"gFAAA,OAAS,mBAAAA,EAAiB,oBAAAC,EAAkB,gBAAAC,MAAoB,eAChE,OAAoC,cAAAC,MAAwE,QAaxG,cAAAC,EA+EA,QAAAC,MA/EA,oBAFJ,SAASC,EAAW,CAAE,UAAAC,EAAW,GAAGC,CAAM,EAAiC,CACzE,OACEJ,EAAC,OACC,aAAW,aACX,UAAWK,EAAG,qCAAsCF,CAAS,EAC7D,KAAK,aACJ,GAAGC,EACN,CAEJ,CASA,IAAME,EAAoBP,EACxB,CAAC,CAAE,UAAAI,EAAW,GAAGC,CAAM,EAAGG,IACxBP,EAAC,MAAG,IAAKO,EAAc,UAAWF,EAAG,mCAAoCF,CAAS,EAAI,GAAGC,EAAO,CAEpG,EAEAE,EAAkB,YAAc,oBAShC,IAAME,EAAiBT,EAAuD,CAACK,EAAOG,IACpFP,EAAC,MAAG,IAAKO,EAAe,GAAGH,EAAO,CACnC,EAEDI,EAAe,YAAc,iBAY7B,SAASC,EAAe,CACtB,SAAAC,EACA,UAAAP,EACA,KAAAQ,EAAO,GACP,SAAAC,EACA,KAAAC,EACA,GAAGT,CACL,EAAqC,CACnC,OACEJ,EAAC,KACC,eAAcY,EAAW,OAAS,OAClC,UAAWE,EAAe,CACxB,UAAAX,EACA,KAAAQ,EACA,KAAAE,EACA,QAASD,EAAW,UAAY,OAClC,CAAC,EACA,GAAGR,EAEH,SAAAM,EACH,CAEJ,CAQA,SAASK,EAAmB,CAAE,GAAGX,CAAM,EAAyC,CAC9E,OACEH,EAACQ,EAAA,CAAe,aAAW,sBAAsB,KAAM,GAAQ,GAAGL,EAChE,UAAAJ,EAACJ,EAAA,CAAgB,UAAU,SAAS,EACpCI,EAAC,QAAK,oBAAQ,GAChB,CAEJ,CAQA,SAASgB,EAAe,CAAE,GAAGZ,CAAM,EAAqC,CACtE,OACEH,EAACQ,EAAA,CAAe,aAAW,kBAAkB,KAAM,GAAQ,GAAGL,EAC5D,UAAAJ,EAAC,QAAK,gBAAI,EACVA,EAACH,EAAA,EAAiB,GACpB,CAEJ,CAQA,SAASoB,EAAmB,CAAE,UAAAd,EAAW,GAAGC,CAAM,EAAyC,CACzF,OACEH,EAAC,QAAK,cAAW,GAAC,UAAWI,EAAG,2CAA4CF,CAAS,EAAI,GAAGC,EAC1F,UAAAJ,EAACF,EAAA,CAAa,UAAU,SAAS,EACjCE,EAAC,QAAK,UAAU,UAAU,sBAAU,GACtC,CAEJ","sourcesContent":["import { ChevronLeftIcon, ChevronRightIcon, EllipsisIcon } from 'lucide-react';\nimport { type AnchorHTMLAttributes, forwardRef, type HTMLAttributes, type JSX, type LiHTMLAttributes } from 'react';\n\nimport { cn } from '@/lib/utils';\nimport { buttonVariants, type ButtonVariantsProps } from '@/styles/button-variants';\n\n/* -----------------------------------------------------------------------------\n * Component: Pagination\n * -------------------------------------------------------------------------- */\n\ntype PaginationProps = HTMLAttributes<HTMLElement>;\n\nfunction Pagination({ className, ...props }: PaginationProps): JSX.Element {\n return (\n <nav\n aria-label=\"pagination\"\n className={cn('mx-auto flex w-full justify-center', className)}\n role=\"navigation\"\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: PaginationContent\n * -------------------------------------------------------------------------- */\n\ntype PaginationContentElement = HTMLUListElement;\ntype PaginationContentProps = HTMLAttributes<HTMLUListElement>;\n\nconst PaginationContent = forwardRef<PaginationContentElement, PaginationContentProps>(\n ({ className, ...props }, forwardedRef) => (\n <ul ref={forwardedRef} className={cn('flex flex-row items-center gap-1', className)} {...props} />\n ),\n);\n\nPaginationContent.displayName = 'PaginationContent';\n\n/* -----------------------------------------------------------------------------\n * Component: PaginationItem\n * -------------------------------------------------------------------------- */\n\ntype PaginationItemElement = HTMLLIElement;\ntype PaginationItemProps = LiHTMLAttributes<HTMLLIElement>;\n\nconst PaginationItem = forwardRef<PaginationItemElement, PaginationItemProps>((props, forwardedRef) => (\n <li ref={forwardedRef} {...props} />\n));\n\nPaginationItem.displayName = 'PaginationItem';\n\n/* -----------------------------------------------------------------------------\n * Component: PaginationLink\n * -------------------------------------------------------------------------- */\n\ninterface PaginationLinkProps\n extends AnchorHTMLAttributes<HTMLAnchorElement>,\n Pick<ButtonVariantsProps, 'size' | 'icon'> {\n isActive?: boolean;\n}\n\nfunction PaginationLink({\n children,\n className,\n icon = true,\n isActive,\n size,\n ...props\n}: PaginationLinkProps): JSX.Element {\n return (\n <a\n aria-current={isActive ? 'page' : undefined}\n className={buttonVariants({\n className,\n icon,\n size,\n variant: isActive ? 'outline' : 'ghost',\n })}\n {...props}\n >\n {children}\n </a>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: PaginationPrevious\n * -------------------------------------------------------------------------- */\n\ntype PaginationPreviousProps = PaginationLinkProps;\n\nfunction PaginationPrevious({ ...props }: PaginationPreviousProps): JSX.Element {\n return (\n <PaginationLink aria-label=\"Go to previous page\" icon={false} {...props}>\n <ChevronLeftIcon className=\"size-4\" />\n <span>Previous</span>\n </PaginationLink>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: PaginationNext\n * -------------------------------------------------------------------------- */\n\ntype PaginationNextProps = PaginationLinkProps;\n\nfunction PaginationNext({ ...props }: PaginationNextProps): JSX.Element {\n return (\n <PaginationLink aria-label=\"Go to next page\" icon={false} {...props}>\n <span>Next</span>\n <ChevronRightIcon />\n </PaginationLink>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: PaginationEllipsis\n * -------------------------------------------------------------------------- */\n\ntype PaginationEllipsisProps = HTMLAttributes<HTMLSpanElement>;\n\nfunction PaginationEllipsis({ className, ...props }: PaginationEllipsisProps): JSX.Element {\n return (\n <span aria-hidden className={cn('flex size-10 items-center justify-center', className)} {...props}>\n <EllipsisIcon className=\"size-4\" />\n <span className=\"sr-only\">More pages</span>\n </span>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Pagination,\n PaginationContent,\n PaginationEllipsis,\n PaginationItem,\n PaginationLink,\n PaginationNext,\n PaginationPrevious,\n type PaginationContentProps,\n type PaginationEllipsisProps,\n type PaginationItemProps,\n type PaginationLinkProps,\n type PaginationNextProps,\n type PaginationPreviousProps,\n type PaginationProps,\n};\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{a as p}from"./chunk-EVRI6TWT.js";import{a as n}from"./chunk-VPYH6JWS.js";import{DayFlag as d,DayPicker as c,SelectionState as i,UI as e}from"@codefast-ui/day-picker";import{format as f}from"date-fns";import{ChevronDownIcon as s,ChevronLeftIcon as g,ChevronRightIcon as m,ChevronUpIcon as y,DotIcon as b}from"lucide-react";import{useEffect as h,useRef as C}from"react";import{jsx as o,jsxs as P}from"react/jsx-runtime";function D({orientation:r,...t}){switch(r){case"up":return o(y,{className:"size-4",...t});case"down":return o(s,{className:"size-4",...t});case"left":return o(g,{className:"size-4",...t});case"right":return o(m,{className:"size-4",...t});default:return o(b,{className:"size-4",...t})}}function x({modifiers:r,className:t,day:a,...u}){let l=C(null);return h(()=>{r.focused&&l.current?.focus()},[r.focused]),o("button",{ref:l,className:p({icon:!0,size:"sm",variant:r.selected&&!r.range_middle?"default":"ghost",className:["focus-visible:ring-1 focus-visible:ring-offset-0",(!r.selected||r.range_middle)&&[r.today?"bg-accent":"hover:border-accent hover:bg-transparent",r.outside&&"text-opacity-30"],r.range_middle&&"bg-transparent",t]}),type:"button",...u})}function z({className:r,classNames:t,...a}){return o(c,{showOutsideDays:!0,className:n("p-3",r),classNames:{[d.disabled]:n("",t?.[d.disabled]),[d.focused]:n("",t?.[d.focused]),[d.hidden]:n("invisible",t?.[d.hidden]),[d.outside]:n(!a.mode&&"text-opacity-30",t?.[d.outside]),[d.today]:n(!a.mode&&"bg-accent rounded-md",t?.[d.today]),[i.range_end]:n("to-accent rounded-r-md bg-gradient-to-l from-transparent to-50% first:rounded-l-md",t?.[i.range_end]),[i.range_middle]:n("bg-accent first:rounded-l-md last:rounded-r-md",t?.[i.range_middle]),[i.range_start]:n("to-accent rounded-l-md bg-gradient-to-r from-transparent to-50% last:rounded-r-md",t?.[i.range_start]),[i.selected]:n("",t?.[i.selected]),[e.CaptionLabel]:n("inline-flex items-center",t?.[e.CaptionLabel]),[e.Chevron]:n("",t?.[e.Chevron]),[e.Day]:n("py-0",!a.mode&&"text-foreground mx-px flex min-h-9 min-w-9 items-center justify-center text-sm font-medium",t?.[e.Day]),[e.DayButton]:n("border border-transparent",t?.[e.DayButton]),[e.Dropdown]:n("absolute size-full appearance-none opacity-0",t?.[e.Dropdown]),[e.DropdownRoot]:n("relative inline-flex",t?.[e.DropdownRoot]),[e.Dropdowns]:n("inline-flex items-center gap-2",t?.[e.Dropdowns]),[e.Footer]:n("text-sm",t?.[e.Footer]),[e.Month]:n("grid grid-rows-[2rem_1fr] gap-4",!((a.numberOfMonths||0)>1)&&"w-full",t?.[e.Month]),[e.MonthCaption]:n("flex w-full justify-center text-sm font-medium",t?.[e.MonthCaption]),[e.MonthGrid]:n("relative block table-fixed border-collapse space-y-2 [&>thead]:block",t?.[e.MonthGrid]),[e.Months]:n("relative flex flex-wrap gap-4",t?.[e.Months]),[e.MonthsDropdown]:n("",t?.[e.MonthsDropdown]),[e.Nav]:n("-mr-4",t?.[e.Nav]),[e.NextMonthButton]:p({className:["absolute end-0",t?.[e.NextMonthButton]],icon:!0,size:"xs",variant:"outline"}),[e.PreviousMonthButton]:p({className:["absolute start-0",t?.[e.PreviousMonthButton]],icon:!0,size:"xs",variant:"outline"}),[e.Root]:n("inline-grid gap-4",t?.[e.Root]),[e.Week]:n("flex justify-between",t?.[e.Week]),[e.WeekNumber]:n("text-foreground/50 size-9 text-center text-xs",t?.[e.WeekNumber]),[e.WeekNumberHeader]:n("",t?.[e.WeekNumberHeader]),[e.Weekday]:n("text-muted-foreground flex-1 text-sm font-normal",t?.[e.Weekday]),[e.Weekdays]:n("flex justify-between",t?.[e.Weekdays]),[e.Weeks]:n("grid gap-y-2",t?.[e.Weeks]),[e.YearsDropdown]:n("",t?.[e.YearsDropdown])},components:{Chevron:D,DayButton:x},...a})}function B({date:r,formatStr:t="LLL dd, y",placeholder:a="Pick a date"}){if(!r?.from)return o("span",{className:"truncate",children:a});let u=f(r.from,t);if(!r.to)return o("span",{className:"truncate",children:u});let l=f(r.to,t);return P("span",{className:"truncate",children:[u," - ",l]})}function S({date:r,formatStr:t="PPP",placeholder:a="Pick a date"}){return r?o("span",{className:"truncate",children:f(r,t)}):o("span",{className:"truncate",children:a})}export{z as a,B as b,S as c};
|
|
2
|
+
//# sourceMappingURL=chunk-HXMLYPF5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/calendar.tsx"],"names":["DayFlag","DayPicker","SelectionState","UI","format","ChevronDownIcon","ChevronLeftIcon","ChevronRightIcon","ChevronUpIcon","DotIcon","useEffect","useRef","jsx","jsxs","Chevron","orientation","props","DayButton","modifiers","className","_","buttonRef","buttonVariants","Calendar","classNames","cn","CalendarRangeLabel","date","formatStr","placeholder","formattedFromDate","formattedToDate","CalendarLabel"],"mappings":"gFAEA,OAIE,WAAAA,EACA,aAAAC,EAGA,kBAAAC,EACA,MAAAC,MACK,0BACP,OAAS,UAAAC,MAAc,WACvB,OAAS,mBAAAC,EAAiB,mBAAAC,EAAiB,oBAAAC,EAAkB,iBAAAC,EAAe,WAAAC,MAAe,eAC3F,OAAwC,aAAAC,EAAW,UAAAC,MAAc,QAcpD,cAAAC,EAsKT,QAAAC,MAtKS,oBAHb,SAASC,EAAQ,CAAE,YAAAC,EAAa,GAAGC,CAAM,EAA8B,CACrE,OAAQD,EAAa,CACnB,IAAK,KACH,OAAOH,EAACJ,EAAA,CAAc,UAAU,SAAU,GAAGQ,EAAO,EAGtD,IAAK,OACH,OAAOJ,EAACP,EAAA,CAAgB,UAAU,SAAU,GAAGW,EAAO,EAGxD,IAAK,OACH,OAAOJ,EAACN,EAAA,CAAgB,UAAU,SAAU,GAAGU,EAAO,EAGxD,IAAK,QACH,OAAOJ,EAACL,EAAA,CAAiB,UAAU,SAAU,GAAGS,EAAO,EAGzD,QACE,OAAOJ,EAACH,EAAA,CAAQ,UAAU,SAAU,GAAGO,EAAO,CAClD,CACF,CAMA,SAASC,EAAU,CAAE,UAAAC,EAAW,UAAAC,EAAW,IAAKC,EAAG,GAAGJ,CAAM,EAAgC,CAC1F,IAAMK,EAAYV,EAA0B,IAAI,EAEhD,OAAAD,EAAU,IAAM,CACVQ,EAAU,SACZG,EAAU,SAAS,MAAM,CAE7B,EAAG,CAACH,EAAU,OAAO,CAAC,EAGpBN,EAAC,UACC,IAAKS,EACL,UAA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EAAOuB,EAAMC,CAAS,EAAE,EAHlDhB,EAAC,QAAK,UAAU,WAAY,SAAAiB,EAAY,CAInD","sourcesContent":["'use client';\n\nimport {\n type Components,\n type DateRange,\n type DayButtonProps,\n DayFlag,\n DayPicker,\n type DayPickerProps,\n type Matcher,\n SelectionState,\n UI,\n} from '@codefast-ui/day-picker';\nimport { format } from 'date-fns';\nimport { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, DotIcon } from 'lucide-react';\nimport { type ComponentProps, type JSX, useEffect, useRef } from 'react';\n\nimport { cn } from '@/lib/utils';\nimport { buttonVariants } from '@/styles/button-variants';\n\n/* -----------------------------------------------------------------------------\n * Component: Chevron\n * -------------------------------------------------------------------------- */\n\ntype ChevronProps = ComponentProps<Components['Chevron']>;\n\nfunction Chevron({ orientation, ...props }: ChevronProps): JSX.Element {\n switch (orientation) {\n case 'up': {\n return <ChevronUpIcon className=\"size-4\" {...props} />;\n }\n\n case 'down': {\n return <ChevronDownIcon className=\"size-4\" {...props} />;\n }\n\n case 'left': {\n return <ChevronLeftIcon className=\"size-4\" {...props} />;\n }\n\n case 'right': {\n return <ChevronRightIcon className=\"size-4\" {...props} />;\n }\n\n default:\n return <DotIcon className=\"size-4\" {...props} />;\n }\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DayButton\n * -------------------------------------------------------------------------- */\n\nfunction DayButton({ modifiers, className, day: _, ...props }: DayButtonProps): JSX.Element {\n const buttonRef = useRef<HTMLButtonElement>(null);\n\n useEffect(() => {\n if (modifiers.focused) {\n buttonRef.current?.focus();\n }\n }, [modifiers.focused]);\n\n return (\n <button\n ref={buttonRef}\n className={buttonVariants({\n icon: true,\n size: 'sm',\n variant: modifiers.selected && !modifiers.range_middle ? 'default' : 'ghost',\n className: [\n 'focus-visible:ring-1 focus-visible:ring-offset-0',\n (!modifiers.selected || modifiers.range_middle) && [\n modifiers.today ? 'bg-accent' : 'hover:border-accent hover:bg-transparent',\n modifiers.outside && 'text-opacity-30',\n ],\n modifiers.range_middle && 'bg-transparent',\n className,\n ],\n })}\n type=\"button\"\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: Calendar\n * -------------------------------------------------------------------------- */\n\ntype CalendarProps = DayPickerProps;\n\nfunction Calendar({ className, classNames, ...props }: CalendarProps): JSX.Element {\n return (\n <DayPicker\n showOutsideDays\n className={cn('p-3', className)}\n classNames={{\n [DayFlag.disabled]: cn('', classNames?.[DayFlag.disabled]),\n [DayFlag.focused]: cn('', classNames?.[DayFlag.focused]),\n [DayFlag.hidden]: cn('invisible', classNames?.[DayFlag.hidden]),\n [DayFlag.outside]: cn(!props.mode && 'text-opacity-30', classNames?.[DayFlag.outside]),\n [DayFlag.today]: cn(!props.mode && 'bg-accent rounded-md', classNames?.[DayFlag.today]),\n [SelectionState.range_end]: cn(\n 'to-accent rounded-r-md bg-gradient-to-l from-transparent to-50% first:rounded-l-md',\n classNames?.[SelectionState.range_end],\n ),\n [SelectionState.range_middle]: cn(\n 'bg-accent first:rounded-l-md last:rounded-r-md',\n classNames?.[SelectionState.range_middle],\n ),\n [SelectionState.range_start]: cn(\n 'to-accent rounded-l-md bg-gradient-to-r from-transparent to-50% last:rounded-r-md',\n classNames?.[SelectionState.range_start],\n ),\n [SelectionState.selected]: cn('', classNames?.[SelectionState.selected]),\n [UI.CaptionLabel]: cn('inline-flex items-center', classNames?.[UI.CaptionLabel]),\n [UI.Chevron]: cn('', classNames?.[UI.Chevron]),\n [UI.Day]: cn(\n 'py-0',\n !props.mode && 'text-foreground mx-px flex min-h-9 min-w-9 items-center justify-center text-sm font-medium',\n classNames?.[UI.Day],\n ),\n [UI.DayButton]: cn('border border-transparent', classNames?.[UI.DayButton]),\n [UI.Dropdown]: cn('absolute size-full appearance-none opacity-0', classNames?.[UI.Dropdown]),\n [UI.DropdownRoot]: cn('relative inline-flex', classNames?.[UI.DropdownRoot]),\n [UI.Dropdowns]: cn('inline-flex items-center gap-2', classNames?.[UI.Dropdowns]),\n [UI.Footer]: cn('text-sm', classNames?.[UI.Footer]),\n [UI.Month]: cn(\n 'grid grid-rows-[2rem_1fr] gap-4',\n !((props.numberOfMonths || 0) > 1) && 'w-full',\n classNames?.[UI.Month],\n ),\n [UI.MonthCaption]: cn('flex w-full justify-center text-sm font-medium', classNames?.[UI.MonthCaption]),\n [UI.MonthGrid]: cn(\n 'relative block table-fixed border-collapse space-y-2 [&>thead]:block',\n classNames?.[UI.MonthGrid],\n ),\n [UI.Months]: cn('relative flex flex-wrap gap-4', classNames?.[UI.Months]),\n [UI.MonthsDropdown]: cn('', classNames?.[UI.MonthsDropdown]),\n [UI.Nav]: cn('-mr-4', classNames?.[UI.Nav]),\n [UI.NextMonthButton]: buttonVariants({\n className: ['absolute end-0', classNames?.[UI.NextMonthButton]],\n icon: true,\n size: 'xs',\n variant: 'outline',\n }),\n [UI.PreviousMonthButton]: buttonVariants({\n className: ['absolute start-0', classNames?.[UI.PreviousMonthButton]],\n icon: true,\n size: 'xs',\n variant: 'outline',\n }),\n [UI.Root]: cn('inline-grid gap-4', classNames?.[UI.Root]),\n [UI.Week]: cn('flex justify-between', classNames?.[UI.Week]),\n [UI.WeekNumber]: cn('text-foreground/50 size-9 text-center text-xs', classNames?.[UI.WeekNumber]),\n [UI.WeekNumberHeader]: cn('', classNames?.[UI.WeekNumberHeader]),\n [UI.Weekday]: cn('text-muted-foreground flex-1 text-sm font-normal', classNames?.[UI.Weekday]),\n [UI.Weekdays]: cn('flex justify-between', classNames?.[UI.Weekdays]),\n [UI.Weeks]: cn('grid gap-y-2', classNames?.[UI.Weeks]),\n [UI.YearsDropdown]: cn('', classNames?.[UI.YearsDropdown]),\n }}\n components={{ Chevron, DayButton }}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CalendarRangeLabel\n * -------------------------------------------------------------------------- */\n\ninterface CalendarRangeLabelProps {\n date: DateRange | undefined;\n formatStr?: string;\n placeholder?: string;\n}\n\nfunction CalendarRangeLabel({\n date,\n formatStr = 'LLL dd, y',\n placeholder = 'Pick a date',\n}: CalendarRangeLabelProps): string | JSX.Element {\n if (!date?.from) {\n return <span className=\"truncate\">{placeholder}</span>;\n }\n\n const formattedFromDate = format(date.from, formatStr);\n\n if (!date.to) {\n return <span className=\"truncate\">{formattedFromDate}</span>;\n }\n\n const formattedToDate = format(date.to, formatStr);\n\n return (\n <span className=\"truncate\">\n {formattedFromDate} - {formattedToDate}\n </span>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CalendarLabel\n * -------------------------------------------------------------------------- */\n\ninterface CalendarLabelProps {\n date: Date | undefined;\n formatStr?: string;\n placeholder?: string;\n}\n\nfunction CalendarLabel({\n date,\n formatStr = 'PPP',\n placeholder = 'Pick a date',\n}: CalendarLabelProps): string | JSX.Element {\n if (!date) {\n return <span className=\"truncate\">{placeholder}</span>;\n }\n\n return <span className=\"truncate\">{format(date, formatStr)}</span>;\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Calendar,\n CalendarLabel,\n CalendarRangeLabel,\n type CalendarLabelProps,\n type CalendarProps,\n type CalendarRangeLabelProps,\n type DateRange,\n type Matcher,\n};\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";var _chunkKF7Y7B3Gcjs = require('./chunk-KF7Y7B3G.cjs');var _chunkDD6AVCRHcjs = require('./chunk-DD6AVCRH.cjs');var _daypicker = require('@codefast-ui/day-picker');var _datefns = require('date-fns');var _lucidereact = require('lucide-react');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');function D({orientation:r,...t}){switch(r){case"up":return _jsxruntime.jsx.call(void 0, _lucidereact.ChevronUpIcon,{className:"size-4",...t});case"down":return _jsxruntime.jsx.call(void 0, _lucidereact.ChevronDownIcon,{className:"size-4",...t});case"left":return _jsxruntime.jsx.call(void 0, _lucidereact.ChevronLeftIcon,{className:"size-4",...t});case"right":return _jsxruntime.jsx.call(void 0, _lucidereact.ChevronRightIcon,{className:"size-4",...t});default:return _jsxruntime.jsx.call(void 0, _lucidereact.DotIcon,{className:"size-4",...t})}}function x({modifiers:r,className:t,day:a,...u}){let l=_react.useRef.call(void 0, null);return _react.useEffect.call(void 0, ()=>{r.focused&&_optionalChain([l, 'access', _2 => _2.current, 'optionalAccess', _3 => _3.focus, 'call', _4 => _4()])},[r.focused]),_jsxruntime.jsx.call(void 0, "button",{ref:l,className:_chunkKF7Y7B3Gcjs.a.call(void 0, {icon:!0,size:"sm",variant:r.selected&&!r.range_middle?"default":"ghost",className:["focus-visible:ring-1 focus-visible:ring-offset-0",(!r.selected||r.range_middle)&&[r.today?"bg-accent":"hover:border-accent hover:bg-transparent",r.outside&&"text-opacity-30"],r.range_middle&&"bg-transparent",t]}),type:"button",...u})}function _({className:r,classNames:t,...a}){return _jsxruntime.jsx.call(void 0, _daypicker.DayPicker,{showOutsideDays:!0,className:_chunkDD6AVCRHcjs.a.call(void 0, "p-3",r),classNames:{[_daypicker.DayFlag.disabled]:_chunkDD6AVCRHcjs.a.call(void 0, "",_optionalChain([t, 'optionalAccess', _5 => _5[_daypicker.DayFlag.disabled]])),[_daypicker.DayFlag.focused]:_chunkDD6AVCRHcjs.a.call(void 0, "",_optionalChain([t, 'optionalAccess', _6 => _6[_daypicker.DayFlag.focused]])),[_daypicker.DayFlag.hidden]:_chunkDD6AVCRHcjs.a.call(void 0, "invisible",_optionalChain([t, 'optionalAccess', _7 => _7[_daypicker.DayFlag.hidden]])),[_daypicker.DayFlag.outside]:_chunkDD6AVCRHcjs.a.call(void 0, !a.mode&&"text-opacity-30",_optionalChain([t, 'optionalAccess', _8 => _8[_daypicker.DayFlag.outside]])),[_daypicker.DayFlag.today]:_chunkDD6AVCRHcjs.a.call(void 0, !a.mode&&"bg-accent rounded-md",_optionalChain([t, 'optionalAccess', _9 => _9[_daypicker.DayFlag.today]])),[_daypicker.SelectionState.range_end]:_chunkDD6AVCRHcjs.a.call(void 0, "to-accent rounded-r-md bg-gradient-to-l from-transparent to-50% first:rounded-l-md",_optionalChain([t, 'optionalAccess', _10 => _10[_daypicker.SelectionState.range_end]])),[_daypicker.SelectionState.range_middle]:_chunkDD6AVCRHcjs.a.call(void 0, "bg-accent first:rounded-l-md last:rounded-r-md",_optionalChain([t, 'optionalAccess', _11 => _11[_daypicker.SelectionState.range_middle]])),[_daypicker.SelectionState.range_start]:_chunkDD6AVCRHcjs.a.call(void 0, "to-accent rounded-l-md bg-gradient-to-r from-transparent to-50% last:rounded-r-md",_optionalChain([t, 'optionalAccess', _12 => _12[_daypicker.SelectionState.range_start]])),[_daypicker.SelectionState.selected]:_chunkDD6AVCRHcjs.a.call(void 0, "",_optionalChain([t, 'optionalAccess', _13 => _13[_daypicker.SelectionState.selected]])),[_daypicker.UI.CaptionLabel]:_chunkDD6AVCRHcjs.a.call(void 0, "inline-flex items-center",_optionalChain([t, 'optionalAccess', _14 => _14[_daypicker.UI.CaptionLabel]])),[_daypicker.UI.Chevron]:_chunkDD6AVCRHcjs.a.call(void 0, "",_optionalChain([t, 'optionalAccess', _15 => _15[_daypicker.UI.Chevron]])),[_daypicker.UI.Day]:_chunkDD6AVCRHcjs.a.call(void 0, "py-0",!a.mode&&"text-foreground mx-px flex min-h-9 min-w-9 items-center justify-center text-sm font-medium",_optionalChain([t, 'optionalAccess', _16 => _16[_daypicker.UI.Day]])),[_daypicker.UI.DayButton]:_chunkDD6AVCRHcjs.a.call(void 0, "border border-transparent",_optionalChain([t, 'optionalAccess', _17 => _17[_daypicker.UI.DayButton]])),[_daypicker.UI.Dropdown]:_chunkDD6AVCRHcjs.a.call(void 0, "absolute size-full appearance-none opacity-0",_optionalChain([t, 'optionalAccess', _18 => _18[_daypicker.UI.Dropdown]])),[_daypicker.UI.DropdownRoot]:_chunkDD6AVCRHcjs.a.call(void 0, "relative inline-flex",_optionalChain([t, 'optionalAccess', _19 => _19[_daypicker.UI.DropdownRoot]])),[_daypicker.UI.Dropdowns]:_chunkDD6AVCRHcjs.a.call(void 0, "inline-flex items-center gap-2",_optionalChain([t, 'optionalAccess', _20 => _20[_daypicker.UI.Dropdowns]])),[_daypicker.UI.Footer]:_chunkDD6AVCRHcjs.a.call(void 0, "text-sm",_optionalChain([t, 'optionalAccess', _21 => _21[_daypicker.UI.Footer]])),[_daypicker.UI.Month]:_chunkDD6AVCRHcjs.a.call(void 0, "grid grid-rows-[2rem_1fr] gap-4",!((a.numberOfMonths||0)>1)&&"w-full",_optionalChain([t, 'optionalAccess', _22 => _22[_daypicker.UI.Month]])),[_daypicker.UI.MonthCaption]:_chunkDD6AVCRHcjs.a.call(void 0, "flex w-full justify-center text-sm font-medium",_optionalChain([t, 'optionalAccess', _23 => _23[_daypicker.UI.MonthCaption]])),[_daypicker.UI.MonthGrid]:_chunkDD6AVCRHcjs.a.call(void 0, "relative block table-fixed border-collapse space-y-2 [&>thead]:block",_optionalChain([t, 'optionalAccess', _24 => _24[_daypicker.UI.MonthGrid]])),[_daypicker.UI.Months]:_chunkDD6AVCRHcjs.a.call(void 0, "relative flex flex-wrap gap-4",_optionalChain([t, 'optionalAccess', _25 => _25[_daypicker.UI.Months]])),[_daypicker.UI.MonthsDropdown]:_chunkDD6AVCRHcjs.a.call(void 0, "",_optionalChain([t, 'optionalAccess', _26 => _26[_daypicker.UI.MonthsDropdown]])),[_daypicker.UI.Nav]:_chunkDD6AVCRHcjs.a.call(void 0, "-mr-4",_optionalChain([t, 'optionalAccess', _27 => _27[_daypicker.UI.Nav]])),[_daypicker.UI.NextMonthButton]:_chunkKF7Y7B3Gcjs.a.call(void 0, {className:["absolute end-0",_optionalChain([t, 'optionalAccess', _28 => _28[_daypicker.UI.NextMonthButton]])],icon:!0,size:"xs",variant:"outline"}),[_daypicker.UI.PreviousMonthButton]:_chunkKF7Y7B3Gcjs.a.call(void 0, {className:["absolute start-0",_optionalChain([t, 'optionalAccess', _29 => _29[_daypicker.UI.PreviousMonthButton]])],icon:!0,size:"xs",variant:"outline"}),[_daypicker.UI.Root]:_chunkDD6AVCRHcjs.a.call(void 0, "inline-grid gap-4",_optionalChain([t, 'optionalAccess', _30 => _30[_daypicker.UI.Root]])),[_daypicker.UI.Week]:_chunkDD6AVCRHcjs.a.call(void 0, "flex justify-between",_optionalChain([t, 'optionalAccess', _31 => _31[_daypicker.UI.Week]])),[_daypicker.UI.WeekNumber]:_chunkDD6AVCRHcjs.a.call(void 0, "text-foreground/50 size-9 text-center text-xs",_optionalChain([t, 'optionalAccess', _32 => _32[_daypicker.UI.WeekNumber]])),[_daypicker.UI.WeekNumberHeader]:_chunkDD6AVCRHcjs.a.call(void 0, "",_optionalChain([t, 'optionalAccess', _33 => _33[_daypicker.UI.WeekNumberHeader]])),[_daypicker.UI.Weekday]:_chunkDD6AVCRHcjs.a.call(void 0, "text-muted-foreground flex-1 text-sm font-normal",_optionalChain([t, 'optionalAccess', _34 => _34[_daypicker.UI.Weekday]])),[_daypicker.UI.Weekdays]:_chunkDD6AVCRHcjs.a.call(void 0, "flex justify-between",_optionalChain([t, 'optionalAccess', _35 => _35[_daypicker.UI.Weekdays]])),[_daypicker.UI.Weeks]:_chunkDD6AVCRHcjs.a.call(void 0, "grid gap-y-2",_optionalChain([t, 'optionalAccess', _36 => _36[_daypicker.UI.Weeks]])),[_daypicker.UI.YearsDropdown]:_chunkDD6AVCRHcjs.a.call(void 0, "",_optionalChain([t, 'optionalAccess', _37 => _37[_daypicker.UI.YearsDropdown]]))},components:{Chevron:D,DayButton:x},...a})}function z({date:r,formatStr:t="LLL dd, y",placeholder:a="Pick a date"}){if(!_optionalChain([r, 'optionalAccess', _38 => _38.from]))return _jsxruntime.jsx.call(void 0, "span",{className:"truncate",children:a});let u=_datefns.format.call(void 0, r.from,t);if(!r.to)return _jsxruntime.jsx.call(void 0, "span",{className:"truncate",children:u});let l=_datefns.format.call(void 0, r.to,t);return _jsxruntime.jsxs.call(void 0, "span",{className:"truncate",children:[u," - ",l]})}function B({date:r,formatStr:t="PPP",placeholder:a="Pick a date"}){return r?_jsxruntime.jsx.call(void 0, "span",{className:"truncate",children:_datefns.format.call(void 0, r,t)}):_jsxruntime.jsx.call(void 0, "span",{className:"truncate",children:a})}exports.a = _; exports.b = z; exports.c = B;
|
|
2
|
+
//# sourceMappingURL=chunk-IDSE6FJ7.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/codefast/codefast/packages/ui/dist/chunk-IDSE6FJ7.cjs","../src/components/calendar.tsx"],"names":["orientation","jsx","props","DayButton","modifiers","className","buttonRef","useRef","buttonVariants","Calendar","classNames","DayPicker","cn","DayFlag","SelectionState","UI","CalendarRangeLabel","formatStr","placeholder","date","jsxs","CalendarLabel"],"mappings":"AAAA,ylBAAY,CAAC,wDAAwC,wDCMnD,oDAOO,mCACA,2CAC+B,8BAc3B,+CAHM,SAAA,CAAA,CAAAA,CAAAA,WACjB,CAAA,CAAA,CAAA,GAAqB,CACnB,CAAA,CAAA,CAAA,MACE,CAAA,CAAA,CAAA,CAAA,IAAOC,IAAe,CAAA,OAAA,6BAAA,0BAAU,CAAA,CAAA,SAAaC,CAAAA,QAG1C,CAAA,GAAA,CAAA,CACH,CAAA,CAAA,IAAA,MAAwB,CAAA,OAAA,6BAAA,4BAAU,CAAA,CAAA,SAAaA,CAAAA,QAG5C,CAAA,GAAA,CAAA,CACH,CAAA,CAAA,IAAA,MAAwB,CAAA,OAAA,6BAAA,4BAAU,CAAA,CAAA,SAAaA,CAAAA,QAG5C,CAAA,GAAA,CAAA,CAAA,CACH,CAAA,I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,OAAK,6BAAA,MAAU,CAAA,CAAA,SAAY,CAAA,UAAkB,CAGvD,QAA+BkB,CAAAA,CAAK,CAAA,CAAA,CAAIF,IAExC,CAAA,CAAA,6BAAA,CAAA,CACEG,EAAC,CAAA,CAAA,CAAA,CAAA,OAAK,8BAAA,MAAU,CAAA,CAAA,SACb,CAAA,UAAkB,CAAA,QACrB,CAEJ,CAYA,CAAA,CAAA,KAAA,CAAA,CAASC,CAAAA,CAAc,CACrB,CAAA,SACA,CAAA,CAAA,CAAA,IAAAJ,CAAAA,CAAY,CAAA,SACZ,CAAA,CAAA,CAAA,KAAAC,CAAAA,WAAc,CAAA,CAAA,CAChB,aAKSjB,CAAC,CAAA,CAAA,OAAK,CAAA,CAAA,6BAAA,MAAU,CAAA,CAAA,SAAY,CAAA,UAAOkB,CAAMF,QAHtC,CAAA,6BAAA,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,6BAAA,MAAU,CAAA,CAAA,SAAY,CAAA,UAIvC,CAAA,QAAA,CAAA,CAAA,CAAA,CAAA,CAAA,4CAAA","file":"/home/runner/work/codefast/codefast/packages/ui/dist/chunk-IDSE6FJ7.cjs","sourcesContent":[null,"'use client';\n\nimport {\n type Components,\n type DateRange,\n type DayButtonProps,\n DayFlag,\n DayPicker,\n type DayPickerProps,\n type Matcher,\n SelectionState,\n UI,\n} from '@codefast-ui/day-picker';\nimport { format } from 'date-fns';\nimport { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, DotIcon } from 'lucide-react';\nimport { type ComponentProps, type JSX, useEffect, useRef } from 'react';\n\nimport { cn } from '@/lib/utils';\nimport { buttonVariants } from '@/styles/button-variants';\n\n/* -----------------------------------------------------------------------------\n * Component: Chevron\n * -------------------------------------------------------------------------- */\n\ntype ChevronProps = ComponentProps<Components['Chevron']>;\n\nfunction Chevron({ orientation, ...props }: ChevronProps): JSX.Element {\n switch (orientation) {\n case 'up': {\n return <ChevronUpIcon className=\"size-4\" {...props} />;\n }\n\n case 'down': {\n return <ChevronDownIcon className=\"size-4\" {...props} />;\n }\n\n case 'left': {\n return <ChevronLeftIcon className=\"size-4\" {...props} />;\n }\n\n case 'right': {\n return <ChevronRightIcon className=\"size-4\" {...props} />;\n }\n\n default:\n return <DotIcon className=\"size-4\" {...props} />;\n }\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DayButton\n * -------------------------------------------------------------------------- */\n\nfunction DayButton({ modifiers, className, day: _, ...props }: DayButtonProps): JSX.Element {\n const buttonRef = useRef<HTMLButtonElement>(null);\n\n useEffect(() => {\n if (modifiers.focused) {\n buttonRef.current?.focus();\n }\n }, [modifiers.focused]);\n\n return (\n <button\n ref={buttonRef}\n className={buttonVariants({\n icon: true,\n size: 'sm',\n variant: modifiers.selected && !modifiers.range_middle ? 'default' : 'ghost',\n className: [\n 'focus-visible:ring-1 focus-visible:ring-offset-0',\n (!modifiers.selected || modifiers.range_middle) && [\n modifiers.today ? 'bg-accent' : 'hover:border-accent hover:bg-transparent',\n modifiers.outside && 'text-opacity-30',\n ],\n modifiers.range_middle && 'bg-transparent',\n className,\n ],\n })}\n type=\"button\"\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: Calendar\n * -------------------------------------------------------------------------- */\n\ntype CalendarProps = DayPickerProps;\n\nfunction Calendar({ className, classNames, ...props }: CalendarProps): JSX.Element {\n return (\n <DayPicker\n showOutsideDays\n className={cn('p-3', className)}\n classNames={{\n [DayFlag.disabled]: cn('', classNames?.[DayFlag.disabled]),\n [DayFlag.focused]: cn('', classNames?.[DayFlag.focused]),\n [DayFlag.hidden]: cn('invisible', classNames?.[DayFlag.hidden]),\n [DayFlag.outside]: cn(!props.mode && 'text-opacity-30', classNames?.[DayFlag.outside]),\n [DayFlag.today]: cn(!props.mode && 'bg-accent rounded-md', classNames?.[DayFlag.today]),\n [SelectionState.range_end]: cn(\n 'to-accent rounded-r-md bg-gradient-to-l from-transparent to-50% first:rounded-l-md',\n classNames?.[SelectionState.range_end],\n ),\n [SelectionState.range_middle]: cn(\n 'bg-accent first:rounded-l-md last:rounded-r-md',\n classNames?.[SelectionState.range_middle],\n ),\n [SelectionState.range_start]: cn(\n 'to-accent rounded-l-md bg-gradient-to-r from-transparent to-50% last:rounded-r-md',\n classNames?.[SelectionState.range_start],\n ),\n [SelectionState.selected]: cn('', classNames?.[SelectionState.selected]),\n [UI.CaptionLabel]: cn('inline-flex items-center', classNames?.[UI.CaptionLabel]),\n [UI.Chevron]: cn('', classNames?.[UI.Chevron]),\n [UI.Day]: cn(\n 'py-0',\n !props.mode && 'text-foreground mx-px flex min-h-9 min-w-9 items-center justify-center text-sm font-medium',\n classNames?.[UI.Day],\n ),\n [UI.DayButton]: cn('border border-transparent', classNames?.[UI.DayButton]),\n [UI.Dropdown]: cn('absolute size-full appearance-none opacity-0', classNames?.[UI.Dropdown]),\n [UI.DropdownRoot]: cn('relative inline-flex', classNames?.[UI.DropdownRoot]),\n [UI.Dropdowns]: cn('inline-flex items-center gap-2', classNames?.[UI.Dropdowns]),\n [UI.Footer]: cn('text-sm', classNames?.[UI.Footer]),\n [UI.Month]: cn(\n 'grid grid-rows-[2rem_1fr] gap-4',\n !((props.numberOfMonths || 0) > 1) && 'w-full',\n classNames?.[UI.Month],\n ),\n [UI.MonthCaption]: cn('flex w-full justify-center text-sm font-medium', classNames?.[UI.MonthCaption]),\n [UI.MonthGrid]: cn(\n 'relative block table-fixed border-collapse space-y-2 [&>thead]:block',\n classNames?.[UI.MonthGrid],\n ),\n [UI.Months]: cn('relative flex flex-wrap gap-4', classNames?.[UI.Months]),\n [UI.MonthsDropdown]: cn('', classNames?.[UI.MonthsDropdown]),\n [UI.Nav]: cn('-mr-4', classNames?.[UI.Nav]),\n [UI.NextMonthButton]: buttonVariants({\n className: ['absolute end-0', classNames?.[UI.NextMonthButton]],\n icon: true,\n size: 'xs',\n variant: 'outline',\n }),\n [UI.PreviousMonthButton]: buttonVariants({\n className: ['absolute start-0', classNames?.[UI.PreviousMonthButton]],\n icon: true,\n size: 'xs',\n variant: 'outline',\n }),\n [UI.Root]: cn('inline-grid gap-4', classNames?.[UI.Root]),\n [UI.Week]: cn('flex justify-between', classNames?.[UI.Week]),\n [UI.WeekNumber]: cn('text-foreground/50 size-9 text-center text-xs', classNames?.[UI.WeekNumber]),\n [UI.WeekNumberHeader]: cn('', classNames?.[UI.WeekNumberHeader]),\n [UI.Weekday]: cn('text-muted-foreground flex-1 text-sm font-normal', classNames?.[UI.Weekday]),\n [UI.Weekdays]: cn('flex justify-between', classNames?.[UI.Weekdays]),\n [UI.Weeks]: cn('grid gap-y-2', classNames?.[UI.Weeks]),\n [UI.YearsDropdown]: cn('', classNames?.[UI.YearsDropdown]),\n }}\n components={{ Chevron, DayButton }}\n {...props}\n />\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CalendarRangeLabel\n * -------------------------------------------------------------------------- */\n\ninterface CalendarRangeLabelProps {\n date: DateRange | undefined;\n formatStr?: string;\n placeholder?: string;\n}\n\nfunction CalendarRangeLabel({\n date,\n formatStr = 'LLL dd, y',\n placeholder = 'Pick a date',\n}: CalendarRangeLabelProps): string | JSX.Element {\n if (!date?.from) {\n return <span className=\"truncate\">{placeholder}</span>;\n }\n\n const formattedFromDate = format(date.from, formatStr);\n\n if (!date.to) {\n return <span className=\"truncate\">{formattedFromDate}</span>;\n }\n\n const formattedToDate = format(date.to, formatStr);\n\n return (\n <span className=\"truncate\">\n {formattedFromDate} - {formattedToDate}\n </span>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: CalendarLabel\n * -------------------------------------------------------------------------- */\n\ninterface CalendarLabelProps {\n date: Date | undefined;\n formatStr?: string;\n placeholder?: string;\n}\n\nfunction CalendarLabel({\n date,\n formatStr = 'PPP',\n placeholder = 'Pick a date',\n}: CalendarLabelProps): string | JSX.Element {\n if (!date) {\n return <span className=\"truncate\">{placeholder}</span>;\n }\n\n return <span className=\"truncate\">{format(date, formatStr)}</span>;\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Calendar,\n CalendarLabel,\n CalendarRangeLabel,\n type CalendarLabelProps,\n type CalendarProps,\n type CalendarRangeLabelProps,\n type DateRange,\n type Matcher,\n};\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{a as D,c as x,d as T,g as w,i as C}from"./chunk-T2EOHTGR.js";import{a as c,b as g,h as p,i,j as m,l as f,m as d}from"./chunk-WZSVJ7BS.js";import{a as o}from"./chunk-24TJIVWR.js";import{a as u}from"./chunk-EVRI6TWT.js";import{a as l}from"./chunk-VPYH6JWS.js";import{ChevronDownIcon as v,ChevronLeftIcon as N,ChevronRightIcon as S,ChevronsLeftIcon as P,ChevronsRightIcon as h,ChevronsUpDownIcon as I,ChevronUpIcon as b,EyeOffIcon as M,Settings2Icon as y}from"lucide-react";import{Fragment as V,jsx as e,jsxs as a}from"react/jsx-runtime";function X({table:t}){return a(c,{children:[a(g,{className:u({size:"xs",variant:"outline"}),children:[e(y,{className:"size-4"}),"View"]}),a(p,{align:"end",className:"w-36",children:[e(f,{children:"Toggle columns"}),e(d,{}),t.getAllColumns().filter(n=>typeof n.accessorFn<"u"&&n.getCanHide()).map(n=>e(m,{checked:n.getIsVisible(),className:"capitalize",onCheckedChange:r=>{n.toggleVisibility(!!r)},children:n.id},n.id))]})]})}function A({table:t,className:n,...r}){return a("div",{className:l("flex flex-wrap items-center justify-between gap-4 px-2",n),...r,children:[a("div",{className:"text-muted-foreground min-w-max flex-1 text-sm",children:[t.getFilteredSelectedRowModel().rows.length," of ",t.getFilteredRowModel().rows.length," row(s) selected."]}),a("div",{className:"flex grow flex-wrap items-center justify-between gap-4 md:justify-end md:gap-x-6 lg:gap-x-8",children:[a("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-4",children:[e("p",{className:"text-sm font-medium",children:"Rows per page"}),a(D,{value:String(t.getState().pagination.pageSize),onValueChange:s=>{t.setPageSize(Number(s))},children:[e(T,{className:"w-18 h-8",children:e(x,{placeholder:t.getState().pagination.pageSize})}),e(w,{side:"top",children:[10,20,30,40,50].map(s=>e(C,{value:String(s),children:s},s))})]})]}),a("div",{className:"flex flex-wrap items-center justify-center text-sm font-medium",children:["Page ",t.getState().pagination.pageIndex+1," of ",t.getPageCount()]}),a("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-4",children:[a(o,{icon:!0,className:"max-md:hidden",disabled:!t.getCanPreviousPage(),size:"xs",variant:"outline",onClick:()=>{t.setPageIndex(0)},children:[e("span",{className:"sr-only",children:"Go to first page"}),e(P,{className:"size-4"})]}),a(o,{icon:!0,disabled:!t.getCanPreviousPage(),size:"xs",variant:"outline",onClick:()=>{t.previousPage()},children:[e("span",{className:"sr-only",children:"Go to previous page"}),e(N,{className:"size-4"})]}),a(o,{icon:!0,disabled:!t.getCanNextPage(),size:"xs",variant:"outline",onClick:()=>{t.nextPage()},children:[e("span",{className:"sr-only",children:"Go to next page"}),e(S,{className:"size-4"})]}),a(o,{icon:!0,className:"max-md:hidden",disabled:!t.getCanNextPage(),size:"xs",variant:"outline",onClick:()=>{t.setPageIndex(t.getPageCount()-1)},children:[e("span",{className:"sr-only",children:"Go to last page"}),e(h,{className:"size-4"})]})]})]})]})}function G({column:t,title:n}){return t.getCanSort()?a(c,{children:[e(g,{asChild:!0,children:e(o,{className:l("text-muted-foreground p-0","hover:bg-transparent","data-[state=open]:text-accent-foreground","focus-visible:text-accent-foreground focus-visible:bg-transparent focus-visible:outline-0"),size:"xs",suffix:e(z,{sorted:t.getIsSorted()}),variant:"ghost",children:n})}),a(p,{align:"start",children:[a(i,{onClick:()=>{t.toggleSorting(!1)},children:[e(b,{className:"text-muted-foreground size-4"}),"Asc"]}),a(i,{onClick:()=>{t.toggleSorting(!0)},children:[e(v,{className:"text-muted-foreground size-4"}),"Desc"]}),e(d,{}),a(i,{onClick:()=>{t.toggleVisibility(!1)},children:[e(M,{className:"text-muted-foreground size-4"}),"Hide"]})]})]}):e(V,{children:n})}function z({sorted:t}){switch(t){case"desc":return e(v,{});case"asc":return e(b,{});default:return e(I,{})}}export{X as a,A as b,G as c};
|
|
2
|
+
//# sourceMappingURL=chunk-ITSIGICG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/data-table.tsx"],"names":["ChevronDownIcon","ChevronLeftIcon","ChevronRightIcon","ChevronsLeftIcon","ChevronsRightIcon","ChevronsUpDownIcon","ChevronUpIcon","EyeOffIcon","Settings2Icon","Fragment","jsx","jsxs","DataTableViewOptions","table","DropdownMenu","DropdownMenuTrigger","buttonVariants","DropdownMenuContent","DropdownMenuLabel","DropdownMenuSeparator","column","DropdownMenuCheckboxItem","value","DataTablePagination","className","props","cn","Select","SelectTrigger","SelectValue","SelectContent","pageSize","SelectItem","Button","DataTableColumnHeader","title","SortIcon","DropdownMenuItem","sorted"],"mappings":"yQAEA,OACE,mBAAAA,EACA,mBAAAC,EACA,oBAAAC,EACA,oBAAAC,EACA,qBAAAC,EACA,sBAAAC,EACA,iBAAAC,EACA,cAAAC,EACA,iBAAAC,MACK,eA8BD,OAyIK,YAAAC,EAxIH,OAAAC,EADF,QAAAC,MAAA,oBAHN,SAASC,EAA4B,CAAE,MAAAC,CAAM,EAAkD,CAC7F,OACEF,EAACG,EAAA,CACC,UAAAH,EAACI,EAAA,CAAoB,UAAWC,EAAe,CAAE,KAAM,KAAM,QAAS,SAAU,CAAC,EAC/E,UAAAN,EAACF,EAAA,CAAc,UAAU,SAAS,EAAE,QAEtC,EACAG,EAACM,EAAA,CAAoB,MAAM,MAAM,UAAU,OACzC,UAAAP,EAACQ,EAAA,CAAkB,0BAAc,EACjCR,EAACS,EAAA,EAAsB,EACtBN,EACE,cAAc,EACd,OAAQO,GAAW,OAAOA,EAAO,WAAe,KAAeA,EAAO,WAAW,CAAC,EAClF,IAAKA,GACJV,EAACW,EAAA,CAEC,QAASD,EAAO,aAAa,EAC7B,UAAU,aACV,gBAAkBE,GAAU,CAC1BF,EA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AE5D,EACAK,EAAC0B,EAAA,CACC,QAAS,IAAM,CACbjB,EAAO,cAAc,EAAI,CAC3B,EAEA,UAAAV,EAACV,EAAA,CAAgB,UAAU,+BAA+B,EAAE,QAE9D,EACAU,EAACS,EAAA,EAAsB,EACvBR,EAAC0B,EAAA,CACC,QAAS,IAAM,CACbjB,EAAO,iBAAiB,EAAK,CAC/B,EAEA,UAAAV,EAACH,EAAA,CAAW,UAAU,+BAA+B,EAAE,QAEzD,GACF,GACF,EAhDOG,EAAAD,EAAA,CAAG,SAAA0B,EAAM,CAkDpB,CAEA,SAASC,EAAS,CAAE,OAAAE,CAAO,EAA8D,CACvF,OAAQA,EAAQ,CACd,IAAK,OACH,OAAO5B,EAACV,EAAA,EAAgB,EAG1B,IAAK,MACH,OAAOU,EAACJ,EAAA,EAAc,EAGxB,QACE,OAAOI,EAACL,EAAA,EAAmB,CAC/B,CACF","sourcesContent":["'use client';\n\nimport {\n ChevronDownIcon,\n ChevronLeftIcon,\n ChevronRightIcon,\n ChevronsLeftIcon,\n ChevronsRightIcon,\n ChevronsUpDownIcon,\n ChevronUpIcon,\n EyeOffIcon,\n Settings2Icon,\n} from 'lucide-react';\nimport { type HTMLAttributes, type JSX } from 'react';\n\nimport { Button } from '@/components/button';\nimport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '@/components/dropdown-menu';\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/select';\nimport { cn } from '@/lib/utils';\nimport { buttonVariants } from '@/styles/button-variants';\n\nimport type * as ReactTable from '@tanstack/react-table';\n\n/* -----------------------------------------------------------------------------\n * Component: DataTableViewOptions\n * -------------------------------------------------------------------------- */\n\ninterface DataTableViewOptionsProps<TData> {\n table: ReactTable.Table<TData>;\n}\n\nfunction DataTableViewOptions<TData>({ table }: DataTableViewOptionsProps<TData>): JSX.Element {\n return (\n <DropdownMenu>\n <DropdownMenuTrigger className={buttonVariants({ size: 'xs', variant: 'outline' })}>\n <Settings2Icon className=\"size-4\" />\n View\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-36\">\n <DropdownMenuLabel>Toggle columns</DropdownMenuLabel>\n <DropdownMenuSeparator />\n {table\n .getAllColumns()\n .filter((column) => typeof column.accessorFn !== 'undefined' && column.getCanHide())\n .map((column) => (\n <DropdownMenuCheckboxItem\n key={column.id}\n checked={column.getIsVisible()}\n className=\"capitalize\"\n onCheckedChange={(value) => {\n column.toggleVisibility(Boolean(value));\n }}\n >\n {column.id}\n </DropdownMenuCheckboxItem>\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DataTablePagination\n * -------------------------------------------------------------------------- */\n\ninterface DataTablePaginationProps<TData> extends HTMLAttributes<HTMLDivElement> {\n table: ReactTable.Table<TData>;\n}\n\nfunction DataTablePagination<TData>({ table, className, ...props }: DataTablePaginationProps<TData>): JSX.Element {\n return (\n <div className={cn('flex flex-wrap items-center justify-between gap-4 px-2', className)} {...props}>\n <div className=\"text-muted-foreground min-w-max flex-1 text-sm\">\n {table.getFilteredSelectedRowModel().rows.length} of {table.getFilteredRowModel().rows.length} row(s) selected.\n </div>\n\n <div className=\"flex grow flex-wrap items-center justify-between gap-4 md:justify-end md:gap-x-6 lg:gap-x-8\">\n <div className=\"flex flex-wrap items-center gap-x-2 gap-y-4\">\n <p className=\"text-sm font-medium\">Rows per page</p>\n <Select\n value={String(table.getState().pagination.pageSize)}\n onValueChange={(value) => {\n table.setPageSize(Number(value));\n }}\n >\n <SelectTrigger className=\"w-18 h-8\">\n <SelectValue placeholder={table.getState().pagination.pageSize} />\n </SelectTrigger>\n <SelectContent side=\"top\">\n {[10, 20, 30, 40, 50].map((pageSize) => (\n <SelectItem key={pageSize} value={String(pageSize)}>\n {pageSize}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div className=\"flex flex-wrap items-center justify-center text-sm font-medium\">\n Page {table.getState().pagination.pageIndex + 1} of {table.getPageCount()}\n </div>\n <div className=\"flex flex-wrap items-center gap-x-2 gap-y-4\">\n <Button\n icon\n className=\"max-md:hidden\"\n disabled={!table.getCanPreviousPage()}\n size=\"xs\"\n variant=\"outline\"\n onClick={() => {\n table.setPageIndex(0);\n }}\n >\n <span className=\"sr-only\">Go to first page</span>\n <ChevronsLeftIcon className=\"size-4\" />\n </Button>\n <Button\n icon\n disabled={!table.getCanPreviousPage()}\n size=\"xs\"\n variant=\"outline\"\n onClick={() => {\n table.previousPage();\n }}\n >\n <span className=\"sr-only\">Go to previous page</span>\n <ChevronLeftIcon className=\"size-4\" />\n </Button>\n <Button\n icon\n disabled={!table.getCanNextPage()}\n size=\"xs\"\n variant=\"outline\"\n onClick={() => {\n table.nextPage();\n }}\n >\n <span className=\"sr-only\">Go to next page</span>\n <ChevronRightIcon className=\"size-4\" />\n </Button>\n <Button\n icon\n className=\"max-md:hidden\"\n disabled={!table.getCanNextPage()}\n size=\"xs\"\n variant=\"outline\"\n onClick={() => {\n table.setPageIndex(table.getPageCount() - 1);\n }}\n >\n <span className=\"sr-only\">Go to last page</span>\n <ChevronsRightIcon className=\"size-4\" />\n </Button>\n </div>\n </div>\n </div>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DataTableColumnHeader\n * -------------------------------------------------------------------------- */\n\ninterface DataTableColumnHeaderProps<TData, TValue> {\n column: ReactTable.Column<TData, TValue>;\n title: string;\n}\n\nfunction DataTableColumnHeader<TData, TValue>({\n column,\n title,\n}: DataTableColumnHeaderProps<TData, TValue>): JSX.Element {\n if (!column.getCanSort()) {\n return <>{title}</>;\n }\n\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n className={cn(\n 'text-muted-foreground p-0',\n 'hover:bg-transparent',\n 'data-[state=open]:text-accent-foreground',\n 'focus-visible:text-accent-foreground focus-visible:bg-transparent focus-visible:outline-0',\n )}\n size=\"xs\"\n suffix={<SortIcon sorted={column.getIsSorted()} />}\n variant=\"ghost\"\n >\n {title}\n </Button>\n </DropdownMenuTrigger>\n\n <DropdownMenuContent align=\"start\">\n <DropdownMenuItem\n onClick={() => {\n column.toggleSorting(false);\n }}\n >\n <ChevronUpIcon className=\"text-muted-foreground size-4\" />\n Asc\n </DropdownMenuItem>\n <DropdownMenuItem\n onClick={() => {\n column.toggleSorting(true);\n }}\n >\n <ChevronDownIcon className=\"text-muted-foreground size-4\" />\n Desc\n </DropdownMenuItem>\n <DropdownMenuSeparator />\n <DropdownMenuItem\n onClick={() => {\n column.toggleVisibility(false);\n }}\n >\n <EyeOffIcon className=\"text-muted-foreground size-4\" />\n Hide\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n\nfunction SortIcon({ sorted }: { sorted: false | ReactTable.SortDirection }): JSX.Element {\n switch (sorted) {\n case 'desc': {\n return <ChevronDownIcon />;\n }\n\n case 'asc': {\n return <ChevronUpIcon />;\n }\n\n default:\n return <ChevronsUpDownIcon />;\n }\n}\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n DataTableColumnHeader,\n DataTablePagination,\n DataTableViewOptions,\n type DataTableColumnHeaderProps,\n type DataTablePaginationProps,\n type DataTableViewOptionsProps,\n};\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{a as d}from"./chunk-24TJIVWR.js";import{a as i}from"./chunk-VPYH6JWS.js";import{createContextScope as g}from"@radix-ui/react-context";import B from"embla-carousel-react";import{ArrowLeftIcon as D,ArrowRightIcon as U}from"lucide-react";import{forwardRef as y,useCallback as f,useEffect as S,useState as b}from"react";import{jsx as s}from"react/jsx-runtime";var x="Carousel",[_,$]=g(x),[O,v]=_(x),z=y(({__scopeCarousel:l,children:a,orientation:o,opts:r,setApi:t,plugins:u,className:p,...c},C)=>{let[m,e]=B({...r,axis:o==="vertical"?"y":"x"},u),[R,H]=b(!1),[I,h]=b(!1),P=f(n=>{n&&(H(n.canScrollPrev()),h(n.canScrollNext()))},[]),E=f(()=>{e?.scrollPrev()},[e]),N=f(()=>{e?.scrollNext()},[e]),w=f(n=>{n.key==="ArrowLeft"?(n.preventDefault(),E()):n.key==="ArrowRight"&&(n.preventDefault(),N())},[E,N]);return S(()=>{!e||!t||t(e)},[e,t]),S(()=>{if(e)return P(e),e.on("reInit",P),e.on("select",P),()=>{e.off("select",P)}},[e,P]),s(O,{api:e,canScrollNext:I,canScrollPrev:R,carouselRef:m,opts:r,orientation:o??(r?.axis==="y"?"vertical":"horizontal"),scope:l,scrollNext:N,scrollPrev:E,children:s("div",{ref:C,"aria-roledescription":"carousel",className:i("relative",p),role:"region",onKeyDownCapture:w,...c,children:a})})});z.displayName=x;var T="CarouselContent",k=y(({__scopeCarousel:l,className:a,classNames:o,...r},t)=>{let{carouselRef:u,orientation:p}=v(T,l);return s("div",{ref:u,className:i("overflow-hidden",o?.wrapper),children:s("div",{ref:t,className:i("flex",p==="horizontal"?"-ml-4":"-mt-4 flex-col",o?.content,a),...r})})});k.displayName=T;var L="CarouselItem",K=y(({__scopeCarousel:l,className:a,...o},r)=>{let{orientation:t}=v(L,l);return s("div",{ref:r,"aria-roledescription":"slide",className:i("min-w-0 shrink-0 grow-0 basis-full",t==="horizontal"?"pl-4":"pt-4",a),role:"group",...o})});K.displayName=L;var A="CarouselPrevious",V=y(({__scopeCarousel:l,className:a,icon:o=!0,size:r="sm",variant:t="outline",...u},p)=>{let{orientation:c,scrollPrev:C,canScrollPrev:m}=v(A,l);return s(d,{ref:p,className:i("absolute",c==="horizontal"?"-left-12 top-1/2 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",a),disabled:!m,icon:o,prefix:s(D,{}),size:r,variant:t,onClick:C,...u,children:s("span",{className:"sr-only",children:"Previous slide"})})});V.displayName=A;var M="CarouselNext",X=y(({__scopeCarousel:l,className:a,icon:o=!0,size:r="sm",variant:t="outline",...u},p)=>{let{orientation:c,scrollNext:C,canScrollNext:m}=v(M,l);return s(d,{ref:p,className:i("absolute",c==="horizontal"?"-right-12 top-1/2 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",a),disabled:!m,icon:o,prefix:s(U,{}),size:r,variant:t,onClick:C,...u,children:s("span",{className:"sr-only",children:"Next slide"})})});X.displayName=M;export{$ as a,z as b,k as c,K as d,V as e,X as f};
|
|
2
|
+
//# sourceMappingURL=chunk-J7QU6N2U.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/carousel.tsx"],"names":["createContextScope","useEmblaCarousel","ArrowLeftIcon","ArrowRightIcon","forwardRef","useCallback","useEffect","useState","jsx","CAROUSEL_NAME","createCarouselContext","createCarouselScope","CarouselProvider","useCarouselContext","Carousel","__scopeCarousel","children","orientation","opts","setApi","plugins","className","props","forwardedRef","carouselRef","api","canScrollPrev","setCanScrollPrev","canScrollNext","setCanScrollNext","onSelect","carouselApi","scrollPrev","scrollNext","handleKeyDown","event","cn","CAROUSEL_CONTENT_NAME","CarouselContent","classNames","CAROUSEL_ITEM_NAME","CarouselItem","CAROUSEL_PREVIOUS_NAME","CarouselPrevious","icon","size","variant","Button","CAROUSEL_NEXT_NAME","CarouselNext"],"mappings":"gFAEA,OAAS,sBAAAA,MAAsC,0BAC/C,OAAOC,MAAqD,uBAC5D,OAAS,iBAAAC,EAAe,kBAAAC,MAAsB,eAC9C,OAAS,cAAAC,EAAqD,eAAAC,EAAa,aAAAC,EAAW,YAAAC,MAAgB,QAyH9F,cAAAC,MAAA,oBAhHR,IAAMC,EAAgB,WAIhB,CAACC,EAAuBC,CAAmB,EAAIX,EAAmBS,CAAa,EAuB/E,CAACG,EAAkBC,CAAkB,EAAIH,EAA4CD,CAAa,EAKlGK,EAAWV,EACf,CACE,CAAE,gBAAAW,EAAiB,SAAAC,EAAU,YAAAC,EAAa,KAAAC,EAAM,OAAAC,EAAQ,QAAAC,EA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AAWa,EACT,WACAnB,IAAgB,aACZ,oCACA,8CACJI,CACF,EACA,SAAU,CAACK,EACX,KAAMkB,EACN,OAAQpC,EAACN,EAAA,EAAc,EACvB,KAAM2C,EACN,QAASC,EACT,QAASd,EACR,GAAGV,EAEJ,SAAAd,EAAC,QAAK,UAAU,UAAU,0BAAc,EAC1C,CAEJ,CACF,EAEAmC,EAAiB,YAAcD,EAM/B,IAAMM,EAAqB,eAKrBC,EAAe7C,EACnB,CACE,CACE,gBAAAW,EACA,UAAAM,EACA,KAAAuB,EAAO,GACP,KAAAC,EAAO,KACP,QAAAC,EAAU,UACV,GAAGxB,CACL,EACAC,IACG,CACH,GAAM,CAAE,YAAAN,EAAa,WAAAgB,EAAY,cAAAL,CAAc,EAAIf,EAAmBmC,EAAoBjC,CAAe,EAEzG,OACEP,EAACuC,EAAA,CACC,IAAKxB,EACL,UAAWa,EACT,WACAnB,IAAgB,aACZ,qCACA,iDACJI,CACF,EACA,SAAU,CAACO,EACX,KAAMgB,EACN,OAAQpC,EAACL,EAAA,EAAe,EACxB,KAAM0C,EACN,QAASC,EACT,QAASb,EACR,GAAGX,EAEJ,SAAAd,EAAC,QAAK,UAAU,UAAU,sBAAU,EACtC,CAEJ,CACF,EAEAyC,EAAa,YAAcD","sourcesContent":["'use client';\n\nimport { createContextScope, type Scope } from '@radix-ui/react-context';\nimport useEmblaCarousel, { type UseEmblaCarouselType } from 'embla-carousel-react';\nimport { ArrowLeftIcon, ArrowRightIcon } from 'lucide-react';\nimport { forwardRef, type HTMLAttributes, type KeyboardEvent, useCallback, useEffect, useState } from 'react';\n\nimport { Button, type ButtonProps } from '@/components/button';\nimport { cn } from '@/lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Component: Carousel\n * -------------------------------------------------------------------------- */\n\nconst CAROUSEL_NAME = 'Carousel';\n\ntype ScopedProps<P> = P & { __scopeCarousel?: Scope };\n\nconst [createCarouselContext, createCarouselScope] = createContextScope(CAROUSEL_NAME);\n\ntype CarouselApi = UseEmblaCarouselType[1];\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>;\ntype CarouselOptions = UseCarouselParameters[0];\ntype CarouselPlugin = UseCarouselParameters[1];\n\ninterface BaseCarouselProps {\n opts?: CarouselOptions;\n orientation?: 'horizontal' | 'vertical';\n plugins?: CarouselPlugin;\n setApi?: (api: CarouselApi) => void;\n}\n\ntype CarouselContextValue = {\n api: ReturnType<typeof useEmblaCarousel>[1];\n canScrollNext: boolean;\n canScrollPrev: boolean;\n carouselRef: ReturnType<typeof useEmblaCarousel>[0];\n scrollNext: () => void;\n scrollPrev: () => void;\n} & BaseCarouselProps;\n\nconst [CarouselProvider, useCarouselContext] = createCarouselContext<CarouselContextValue>(CAROUSEL_NAME);\n\ntype CarouselElement = HTMLDivElement;\ntype CarouselProps = HTMLAttributes<HTMLDivElement> & BaseCarouselProps;\n\nconst Carousel = forwardRef<CarouselElement, CarouselProps>(\n (\n { __scopeCarousel, children, orientation, opts, setApi, plugins, className, ...props }: ScopedProps<CarouselProps>,\n forwardedRef,\n ) => {\n const [carouselRef, api] = useEmblaCarousel(\n {\n ...opts,\n axis: orientation === 'vertical' ? 'y' : 'x',\n },\n plugins,\n );\n\n const [canScrollPrev, setCanScrollPrev] = useState(false);\n const [canScrollNext, setCanScrollNext] = useState(false);\n\n const onSelect = useCallback((carouselApi: CarouselApi) => {\n if (!carouselApi) {\n return;\n }\n\n setCanScrollPrev(carouselApi.canScrollPrev());\n setCanScrollNext(carouselApi.canScrollNext());\n }, []);\n\n const scrollPrev = useCallback(() => {\n api?.scrollPrev();\n }, [api]);\n\n const scrollNext = useCallback(() => {\n api?.scrollNext();\n }, [api]);\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'ArrowLeft') {\n event.preventDefault();\n scrollPrev();\n } else if (event.key === 'ArrowRight') {\n event.preventDefault();\n scrollNext();\n }\n },\n [scrollPrev, scrollNext],\n );\n\n useEffect(() => {\n if (!api || !setApi) {\n return;\n }\n\n setApi(api);\n }, [api, setApi]);\n\n useEffect(() => {\n if (!api) {\n return;\n }\n\n onSelect(api);\n api.on('reInit', onSelect);\n api.on('select', onSelect);\n\n return () => {\n api.off('select', onSelect);\n };\n }, [api, onSelect]);\n\n return (\n <CarouselProvider\n api={api}\n canScrollNext={canScrollNext}\n canScrollPrev={canScrollPrev}\n carouselRef={carouselRef}\n opts={opts}\n orientation={orientation ?? (opts?.axis === 'y' ? 'vertical' : 'horizontal')}\n scope={__scopeCarousel}\n scrollNext={scrollNext}\n scrollPrev={scrollPrev}\n >\n <div\n ref={forwardedRef}\n aria-roledescription=\"carousel\"\n className={cn('relative', className)}\n role=\"region\"\n onKeyDownCapture={handleKeyDown}\n {...props}\n >\n {children}\n </div>\n </CarouselProvider>\n );\n },\n);\n\nCarousel.displayName = CAROUSEL_NAME;\n\n/* -----------------------------------------------------------------------------\n * Component: CarouselContent\n * -------------------------------------------------------------------------- */\n\nconst CAROUSEL_CONTENT_NAME = 'CarouselContent';\n\ntype CarouselContentElement = HTMLDivElement;\ninterface CarouselContentProps extends HTMLAttributes<HTMLDivElement> {\n classNames?: {\n content?: string;\n wrapper?: string;\n };\n}\n\nconst CarouselContent = forwardRef<CarouselContentElement, CarouselContentProps>(\n ({ __scopeCarousel, className, classNames, ...props }: ScopedProps<CarouselContentProps>, forwardedRef) => {\n const { carouselRef, orientation } = useCarouselContext(CAROUSEL_CONTENT_NAME, __scopeCarousel);\n\n return (\n <div ref={carouselRef} className={cn('overflow-hidden', classNames?.wrapper)}>\n <div\n ref={forwardedRef}\n className={cn(\n 'flex',\n orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col',\n classNames?.content,\n className,\n )}\n {...props}\n />\n </div>\n );\n },\n);\n\nCarouselContent.displayName = CAROUSEL_CONTENT_NAME;\n\n/* -----------------------------------------------------------------------------\n * Component: CarouselItem\n * -------------------------------------------------------------------------- */\n\nconst CAROUSEL_ITEM_NAME = 'CarouselItem';\n\ntype CarouselItemElement = HTMLDivElement;\ntype CarouselItemProps = HTMLAttributes<HTMLDivElement>;\n\nconst CarouselItem = forwardRef<CarouselItemElement, CarouselItemProps>(\n ({ __scopeCarousel, className, ...props }: ScopedProps<CarouselItemProps>, forwardedRef) => {\n const { orientation } = useCarouselContext(CAROUSEL_ITEM_NAME, __scopeCarousel);\n\n return (\n <div\n ref={forwardedRef}\n aria-roledescription=\"slide\"\n className={cn('min-w-0 shrink-0 grow-0 basis-full', orientation === 'horizontal' ? 'pl-4' : 'pt-4', className)}\n role=\"group\"\n {...props}\n />\n );\n },\n);\n\nCarouselItem.displayName = CAROUSEL_ITEM_NAME;\n\n/* -----------------------------------------------------------------------------\n * Component: CarouselPrevious\n * -------------------------------------------------------------------------- */\n\nconst CAROUSEL_PREVIOUS_NAME = 'CarouselPrevious';\n\ntype CarouselPreviousElement = HTMLButtonElement;\ntype CarouselPreviousProps = ButtonProps;\n\nconst CarouselPrevious = forwardRef<CarouselPreviousElement, CarouselPreviousProps>(\n (\n {\n __scopeCarousel,\n className,\n icon = true,\n size = 'sm',\n variant = 'outline',\n ...props\n }: ScopedProps<CarouselPreviousProps>,\n forwardedRef,\n ) => {\n const { orientation, scrollPrev, canScrollPrev } = useCarouselContext(CAROUSEL_PREVIOUS_NAME, __scopeCarousel);\n\n return (\n <Button\n ref={forwardedRef}\n className={cn(\n 'absolute',\n orientation === 'horizontal'\n ? '-left-12 top-1/2 -translate-y-1/2'\n : '-top-12 left-1/2 -translate-x-1/2 rotate-90',\n className,\n )}\n disabled={!canScrollPrev}\n icon={icon}\n prefix={<ArrowLeftIcon />}\n size={size}\n variant={variant}\n onClick={scrollPrev}\n {...props}\n >\n <span className=\"sr-only\">Previous slide</span>\n </Button>\n );\n },\n);\n\nCarouselPrevious.displayName = CAROUSEL_PREVIOUS_NAME;\n\n/* -----------------------------------------------------------------------------\n * Component: CarouselNext\n * -------------------------------------------------------------------------- */\n\nconst CAROUSEL_NEXT_NAME = 'CarouselNext';\n\ntype CarouselNextElement = HTMLButtonElement;\ntype CarouselNextProps = ButtonProps;\n\nconst CarouselNext = forwardRef<CarouselNextElement, CarouselNextProps>(\n (\n {\n __scopeCarousel,\n className,\n icon = true,\n size = 'sm',\n variant = 'outline',\n ...props\n }: ScopedProps<CarouselNextProps>,\n forwardedRef,\n ) => {\n const { orientation, scrollNext, canScrollNext } = useCarouselContext(CAROUSEL_NEXT_NAME, __scopeCarousel);\n\n return (\n <Button\n ref={forwardedRef}\n className={cn(\n 'absolute',\n orientation === 'horizontal'\n ? '-right-12 top-1/2 -translate-y-1/2'\n : '-bottom-12 left-1/2 -translate-x-1/2 rotate-90',\n className,\n )}\n disabled={!canScrollNext}\n icon={icon}\n prefix={<ArrowRightIcon />}\n size={size}\n variant={variant}\n onClick={scrollNext}\n {...props}\n >\n <span className=\"sr-only\">Next slide</span>\n </Button>\n );\n },\n);\n\nCarouselNext.displayName = CAROUSEL_NEXT_NAME;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Carousel,\n CarouselContent,\n CarouselItem,\n CarouselNext,\n CarouselPrevious,\n createCarouselScope,\n type CarouselApi,\n type CarouselContentProps,\n type CarouselItemProps,\n type CarouselNextProps,\n type CarouselPreviousProps,\n type CarouselProps,\n};\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var _chunkDD6AVCRHcjs = require('./chunk-DD6AVCRH.cjs');var _reactmenubar = require('@radix-ui/react-menubar'); var e = _interopRequireWildcard(_reactmenubar);var _lucidereact = require('lucide-react');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var T=e.Menu,w= exports.b =e.Group,k= exports.c =e.Sub,W= exports.d =e.RadioGroup,l= exports.e =_react.forwardRef.call(void 0, ({className:t,...r},o)=>_jsxruntime.jsx.call(void 0, e.Root,{ref:o,className:_chunkDD6AVCRHcjs.a.call(void 0, "bg-background flex h-10 items-center space-x-1 rounded-md border p-1",t),...r}));l.displayName=e.Root.displayName;var c=_react.forwardRef.call(void 0, ({className:t,...r},o)=>_jsxruntime.jsx.call(void 0, e.Trigger,{ref:o,className:_chunkDD6AVCRHcjs.a.call(void 0, "gap-x-2 px-3 py-1.5","flex cursor-pointer select-none items-center rounded text-sm font-medium","focus:bg-accent focus:text-accent-foreground focus:outline-none","data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t),...r}));c.displayName=e.Trigger.displayName;var f=_react.forwardRef.call(void 0, ({children:t,className:r,inset:o,...i},u)=>_jsxruntime.jsxs.call(void 0, e.SubTrigger,{ref:u,className:_chunkDD6AVCRHcjs.a.call(void 0, "gap-x-2 px-3 py-1.5","flex cursor-pointer select-none items-center rounded text-sm","focus:bg-accent focus:text-accent-foreground focus:outline-none","data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",o&&"pl-8",r),...i,children:[t,_jsxruntime.jsx.call(void 0, _lucidereact.ChevronRightIcon,{className:"ml-auto size-4"})]}));f.displayName=e.SubTrigger.displayName;var P=_react.forwardRef.call(void 0, ({className:t,...r},o)=>_jsxruntime.jsx.call(void 0, e.Portal,{children:_jsxruntime.jsx.call(void 0, e.SubContent,{ref:o,className:_chunkDD6AVCRHcjs.a.call(void 0, "bg-popover text-popover-foreground z-50 min-w-32 rounded-md border p-1 shadow-md","data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-95","data-[state=open]:data-[side=top]:slide-in-from-bottom-2","data-[state=open]:data-[side=right]:slide-in-from-left-2","data-[state=open]:data-[side=bottom]:slide-in-from-top-2","data-[state=open]:data-[side=left]:slide-in-from-right-2","data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95","data-[state=closed]:data-[side=top]:slide-out-to-bottom-2","data-[state=closed]:data-[side=left]:slide-out-to-right-2","data-[state=closed]:data-[side=bottom]:slide-out-to-top-2","data-[state=closed]:data-[side=right]:slide-out-to-left-2",t),...r})}));P.displayName=e.SubContent.displayName;var y=_react.forwardRef.call(void 0, ({className:t,align:r="start",alignOffset:o=-4,sideOffset:i=8,...u},m)=>_jsxruntime.jsx.call(void 0, e.Portal,{children:_jsxruntime.jsx.call(void 0, e.Content,{ref:m,align:r,alignOffset:o,className:_chunkDD6AVCRHcjs.a.call(void 0, "bg-popover text-popover-foreground z-50 min-w-32 rounded-md border p-1 shadow-md","data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2",t),sideOffset:i,...u})}));y.displayName=e.Content.displayName;var g=_react.forwardRef.call(void 0, ({className:t,inset:r,...o},i)=>_jsxruntime.jsx.call(void 0, e.Item,{ref:i,className:_chunkDD6AVCRHcjs.a.call(void 0, "gap-x-2 px-3 py-1.5","relative flex cursor-pointer select-none items-center rounded text-sm","focus:bg-accent focus:text-accent-foreground focus:outline-none","aria-disabled:pointer-events-none aria-disabled:opacity-50",r&&"pl-8",t),...o}));g.displayName=e.Item.displayName;var v=_react.forwardRef.call(void 0, ({children:t,className:r,checked:o,...i},u)=>_jsxruntime.jsxs.call(void 0, e.CheckboxItem,{ref:u,checked:o,className:_chunkDD6AVCRHcjs.a.call(void 0, "gap-x-2 px-3 py-1.5","pl-8","relative flex cursor-pointer select-none items-center rounded text-sm","focus:bg-accent focus:text-accent-foreground focus:outline-none","aria-disabled:pointer-events-none aria-disabled:opacity-50",r),...i,children:[_jsxruntime.jsx.call(void 0, "span",{className:"absolute left-2 flex size-3.5 items-center justify-center",children:_jsxruntime.jsx.call(void 0, e.ItemIndicator,{children:_jsxruntime.jsx.call(void 0, _lucidereact.CheckIcon,{className:"size-4"})})}),t]}));v.displayName=e.CheckboxItem.displayName;var C=_react.forwardRef.call(void 0, ({children:t,className:r,...o},i)=>_jsxruntime.jsxs.call(void 0, e.RadioItem,{ref:i,className:_chunkDD6AVCRHcjs.a.call(void 0, "gap-x-2 px-3 py-1.5","pl-8","relative flex cursor-pointer select-none items-center rounded text-sm","focus:bg-accent focus:text-accent-foreground focus:outline-none","aria-disabled:pointer-events-none aria-disabled:opacity-50",r),...o,children:[_jsxruntime.jsx.call(void 0, "span",{className:"absolute left-2 flex size-3.5 items-center justify-center",children:_jsxruntime.jsx.call(void 0, e.ItemIndicator,{children:_jsxruntime.jsx.call(void 0, _lucidereact.DotIcon,{className:"size-4 fill-current"})})}),t]}));C.displayName=e.RadioItem.displayName;var x=_react.forwardRef.call(void 0, ({className:t,inset:r,...o},i)=>_jsxruntime.jsx.call(void 0, e.Label,{ref:i,className:_chunkDD6AVCRHcjs.a.call(void 0, "gap-x-2 px-3 py-1.5","flex items-center text-sm font-semibold",r&&"pl-8",t),...o}));x.displayName=e.Label.displayName;var R=_react.forwardRef.call(void 0, ({className:t,...r},o)=>_jsxruntime.jsx.call(void 0, e.Separator,{ref:o,className:_chunkDD6AVCRHcjs.a.call(void 0, "bg-muted mx-2 my-1 h-px",t),...r}));R.displayName=e.Separator.displayName;function L({className:t,...r}){return _jsxruntime.jsx.call(void 0, "span",{className:_chunkDD6AVCRHcjs.a.call(void 0, "text-muted-foreground ml-auto text-xs tracking-widest",t),...r})}var h=_react.forwardRef.call(void 0, ({className:t,...r},o)=>_jsxruntime.jsx.call(void 0, e.Arrow,{ref:o,className:_chunkDD6AVCRHcjs.a.call(void 0, "fill-popover",t),...r}));h.displayName=e.Arrow.displayName;exports.a = T; exports.b = w; exports.c = k; exports.d = W; exports.e = l; exports.f = c; exports.g = f; exports.h = P; exports.i = y; exports.j = g; exports.k = v; exports.l = C; exports.m = x; exports.n = R; exports.o = L; exports.p = h;
|
|
2
|
+
//# sourceMappingURL=chunk-K32V3MHQ.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/codefast/codefast/packages/ui/dist/chunk-K32V3MHQ.cjs","../src/components/menubar.tsx"],"names":["MenubarMenu","MenubarGroup","MenubarSub","MenubarRadioGroup","Menubar","forwardRef","className","props","forwardedRef","jsx","cn","MenubarTrigger","MenubarSubTrigger","children","inset","jsxs","ChevronRightIcon","MenubarSubContent","MenubarContent","align","alignOffset","sideOffset","MenubarItem","MenubarCheckboxItem","checked","CheckIcon","MenubarRadioItem","DotIcon","MenubarLabel","MenubarSeparator","MenubarShortcut","MenubarArrow"],"mappings":"AAAA,mZAAwC,uGCAN,2CACmB,8BAQ9C,+CAwCL,IA/BIA,CAAAA,CAA+B,CAAA,CAAA,IAAA,CAO/BC,CAAAA,aAAgC,CAAA,CAAA,KAAA,CAOhCC,CAAAA,aAA8B,CAAA,CAAA,GAAA,CAO9BC,CAAAA,aAAqC,CAAA,CAAA,UAAA,CASrCC,CAAAA,aAAUC,+BAAAA,CAA0C,CAAE,SAAA,CAAAC,CAAAA,CAAW,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EACjFC,6BAAAA,CAAkB,CAAA,IAAA,CAAjB,CACC,GAAA,CAAKD,CAAAA,CACL,SAAA,CAAWE,iCAAAA,sEAAG,CAAwEJ,CAAS,CAAA,CAC9F,GAAGC,CAAAA,CACN,CACD,CAAA,CAEDH,CAAAA,CAAQ,WAAA,CAA+B,CAAA,CAAA,IAAA,CAAK,WAAA,CAS5C,IAAMO,CAAAA,CAAiBN,+BAAAA,CACpB,CAAE,SAAA,CAAAC,CAAAA,CAAW,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EACxBC,6BAAAA,CAAkB,CAAA,OAAA,CAAjB,CACC,GAAA,CAAKD,CAAAA,CACL,SAAA,CAAWE,iCAAAA,qBACT,CACA,0EAAA,CACA,iEAAA,CACA,sEAAA,CACAJ,CACF,CAAA,CACC,GAAGC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":"/home/runner/work/codefast/codefast/packages/ui/dist/chunk-K32V3MHQ.cjs","sourcesContent":[null,"import * as MenubarPrimitive from '@radix-ui/react-menubar';\nimport { CheckIcon, ChevronRightIcon, DotIcon } from 'lucide-react';\nimport {\n type ComponentProps,\n type ComponentPropsWithoutRef,\n type ComponentRef,\n forwardRef,\n type HTMLAttributes,\n type JSX,\n} from 'react';\n\nimport { cn } from '@/lib/utils';\n\n/* -----------------------------------------------------------------------------\n * Component: MenubarMenu\n * -------------------------------------------------------------------------- */\n\ntype MenubarMenuProps = ComponentProps<typeof MenubarPrimitive.Menu>;\nconst MenubarMenu = MenubarPrimitive.Menu;\n\n/* -----------------------------------------------------------------------------\n * Component: MenubarGroup\n * -------------------------------------------------------------------------- */\n\ntype MenubarGroupProps = ComponentPropsWithoutRef<typeof MenubarPrimitive.Group>;\nconst MenubarGroup = MenubarPrimitive.Group;\n\n/* -----------------------------------------------------------------------------\n * Component: MenubarSub\n * -------------------------------------------------------------------------- */\n\ntype MenubarSubProps = ComponentPropsWithoutRef<typeof MenubarPrimitive.Sub>;\nconst MenubarSub = MenubarPrimitive.Sub;\n\n/* -----------------------------------------------------------------------------\n * Component: MenubarRadioGroup\n * -------------------------------------------------------------------------- */\n\ntype MenubarRadioGroupProps = ComponentPropsWithoutRef<typeof MenubarPrimitive.RadioGroup>;\nconst MenubarRadioGroup = MenubarPrimitive.RadioGroup;\n\n/* -----------------------------------------------------------------------------\n * Component: Menubar\n * -------------------------------------------------------------------------- */\n\ntype MenubarElement = ComponentRef<typeof MenubarPrimitive.Root>;\ntype MenubarProps = ComponentPropsWithoutRef<typeof MenubarPrimitive.Root>;\n\nconst Menubar = forwardRef<MenubarElement, MenubarProps>(({ className, ...props }, forwardedRef) => (\n <MenubarPrimitive.Root\n ref={forwardedRef}\n className={cn('bg-background flex h-10 items-center space-x-1 rounded-md border p-1', className)}\n {...props}\n />\n));\n\nMenubar.displayName = MenubarPrimitive.Root.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: MenubarTrigger\n * -------------------------------------------------------------------------- */\n\ntype MenubarTriggerElement = ComponentRef<typeof MenubarPrimitive.Trigger>;\ntype MenubarTriggerProps = ComponentPropsWithoutRef<typeof MenubarPrimitive.Trigger>;\n\nconst MenubarTrigger = forwardRef<MenubarTriggerElement, MenubarTriggerProps>(\n ({ className, ...props }, forwardedRef) => (\n <MenubarPrimitive.Trigger\n ref={forwardedRef}\n className={cn(\n 'gap-x-2 px-3 py-1.5',\n 'flex cursor-pointer select-none items-center rounded text-sm font-medium',\n 'focus:bg-accent focus:text-accent-foreground focus:outline-none',\n 'data-[state=open]:bg-accent data-[state=open]:text-accent-foreground',\n className,\n )}\n {...props}\n />\n ),\n);\n\nMenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: MenubarSubTrigger\n * -------------------------------------------------------------------------- */\n\ntype MenubarSubTriggerElement = ComponentRef<typeof MenubarPrimitive.SubTrigger>;\n\ninterface MenubarSubTriggerProps extends ComponentPropsWithoutRef<typeof MenubarPrimitive.SubTrigger> {\n inset?: boolean;\n}\n\nconst MenubarSubTrigger = forwardRef<MenubarSubTriggerElement, MenubarSubTriggerProps>(\n ({ children, className, inset, ...props }, forwardedRef) => (\n <MenubarPrimitive.SubTrigger\n ref={forwardedRef}\n className={cn(\n 'gap-x-2 px-3 py-1.5',\n 'flex cursor-pointer select-none items-center rounded text-sm',\n 'focus:bg-accent focus:text-accent-foreground focus:outline-none',\n 'data-[state=open]:bg-accent data-[state=open]:text-accent-foreground',\n inset && 'pl-8',\n className,\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto size-4\" />\n </MenubarPrimitive.SubTrigger>\n ),\n);\n\nMenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: MenubarSubContent\n * -------------------------------------------------------------------------- */\n\ntype MenubarSubContentElement = ComponentRef<typeof MenubarPrimitive.SubContent>;\ntype MenubarSubContentProps = ComponentPropsWithoutRef<typeof MenubarPrimitive.SubContent>;\n\nconst MenubarSubContent = forwardRef<MenubarSubContentElement, MenubarSubContentProps>(\n ({ className, ...props }, forwardedRef) => (\n <MenubarPrimitive.Portal>\n <MenubarPrimitive.SubContent\n ref={forwardedRef}\n className={cn(\n 'bg-popover text-popover-foreground z-50 min-w-32 rounded-md border p-1 shadow-md',\n 'data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-95',\n 'data-[state=open]:data-[side=top]:slide-in-from-bottom-2',\n 'data-[state=open]:data-[side=right]:slide-in-from-left-2',\n 'data-[state=open]:data-[side=bottom]:slide-in-from-top-2',\n 'data-[state=open]:data-[side=left]:slide-in-from-right-2',\n 'data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:zoom-out-95',\n 'data-[state=closed]:data-[side=top]:slide-out-to-bottom-2',\n 'data-[state=closed]:data-[side=left]:slide-out-to-right-2',\n 'data-[state=closed]:data-[side=bottom]:slide-out-to-top-2',\n 'data-[state=closed]:data-[side=right]:slide-out-to-left-2',\n className,\n )}\n {...props}\n />\n </MenubarPrimitive.Portal>\n ),\n);\n\nMenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: MenubarContent\n * -------------------------------------------------------------------------- */\n\ntype MenubarContentElement = ComponentRef<typeof MenubarPrimitive.Content>;\ntype MenubarContentProps = ComponentPropsWithoutRef<typeof MenubarPrimitive.Content>;\n\nconst MenubarContent = forwardRef<MenubarContentElement, MenubarContentProps>(\n ({ className, align = 'start', alignOffset = -4, sideOffset = 8, ...props }, forwardedRef) => (\n <MenubarPrimitive.Portal>\n <MenubarPrimitive.Content\n ref={forwardedRef}\n align={align}\n alignOffset={alignOffset}\n className={cn(\n 'bg-popover text-popover-foreground z-50 min-w-32 rounded-md border p-1 shadow-md',\n 'data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:zoom-in-95 data-[state=open]:data-[side=top]:slide-in-from-bottom-2 data-[state=open]:data-[side=right]:slide-in-from-left-2 data-[state=open]:data-[side=bottom]:slide-in-from-top-2 data-[state=open]:data-[side=left]:slide-in-from-right-2',\n className,\n )}\n sideOffset={sideOffset}\n {...props}\n />\n </MenubarPrimitive.Portal>\n ),\n);\n\nMenubarContent.displayName = MenubarPrimitive.Content.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: MenubarItem\n * -------------------------------------------------------------------------- */\n\ntype MenubarItemElement = ComponentRef<typeof MenubarPrimitive.Item>;\n\ninterface MenubarItemProps extends ComponentPropsWithoutRef<typeof MenubarPrimitive.Item> {\n inset?: boolean;\n}\n\nconst MenubarItem = forwardRef<MenubarItemElement, MenubarItemProps>(({ className, inset, ...props }, forwardedRef) => (\n <MenubarPrimitive.Item\n ref={forwardedRef}\n className={cn(\n 'gap-x-2 px-3 py-1.5',\n 'relative flex cursor-pointer select-none items-center rounded text-sm',\n 'focus:bg-accent focus:text-accent-foreground focus:outline-none',\n 'aria-disabled:pointer-events-none aria-disabled:opacity-50',\n inset && 'pl-8',\n className,\n )}\n {...props}\n />\n));\n\nMenubarItem.displayName = MenubarPrimitive.Item.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: MenubarCheckboxItem\n * -------------------------------------------------------------------------- */\n\ntype MenubarCheckboxItemElement = ComponentRef<typeof MenubarPrimitive.CheckboxItem>;\ntype MenubarCheckboxItemProps = ComponentPropsWithoutRef<typeof MenubarPrimitive.CheckboxItem>;\n\nconst MenubarCheckboxItem = forwardRef<MenubarCheckboxItemElement, MenubarCheckboxItemProps>(\n ({ children, className, checked, ...props }, forwardedRef) => (\n <MenubarPrimitive.CheckboxItem\n ref={forwardedRef}\n checked={checked}\n className={cn(\n 'gap-x-2 px-3 py-1.5',\n 'pl-8',\n 'relative flex cursor-pointer select-none items-center rounded text-sm',\n 'focus:bg-accent focus:text-accent-foreground focus:outline-none',\n 'aria-disabled:pointer-events-none aria-disabled:opacity-50',\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex size-3.5 items-center justify-center\">\n <MenubarPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </MenubarPrimitive.ItemIndicator>\n </span>\n {children}\n </MenubarPrimitive.CheckboxItem>\n ),\n);\n\nMenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: MenubarRadioItem\n * -------------------------------------------------------------------------- */\n\ntype MenubarRadioItemElement = ComponentRef<typeof MenubarPrimitive.RadioItem>;\ntype MenubarRadioItemProps = ComponentPropsWithoutRef<typeof MenubarPrimitive.RadioItem>;\n\nconst MenubarRadioItem = forwardRef<MenubarRadioItemElement, MenubarRadioItemProps>(\n ({ children, className, ...props }, forwardedRef) => (\n <MenubarPrimitive.RadioItem\n ref={forwardedRef}\n className={cn(\n 'gap-x-2 px-3 py-1.5',\n 'pl-8',\n 'relative flex cursor-pointer select-none items-center rounded text-sm',\n 'focus:bg-accent focus:text-accent-foreground focus:outline-none',\n 'aria-disabled:pointer-events-none aria-disabled:opacity-50',\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex size-3.5 items-center justify-center\">\n <MenubarPrimitive.ItemIndicator>\n <DotIcon className=\"size-4 fill-current\" />\n </MenubarPrimitive.ItemIndicator>\n </span>\n {children}\n </MenubarPrimitive.RadioItem>\n ),\n);\n\nMenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: MenubarLabel\n * -------------------------------------------------------------------------- */\n\ntype MenubarLabelElement = ComponentRef<typeof MenubarPrimitive.Label>;\n\ninterface MenubarLabelProps extends ComponentPropsWithoutRef<typeof MenubarPrimitive.Label> {\n inset?: boolean;\n}\n\nconst MenubarLabel = forwardRef<MenubarLabelElement, MenubarLabelProps>(\n ({ className, inset, ...props }, forwardedRef) => (\n <MenubarPrimitive.Label\n ref={forwardedRef}\n className={cn('gap-x-2 px-3 py-1.5', 'flex items-center text-sm font-semibold', inset && 'pl-8', className)}\n {...props}\n />\n ),\n);\n\nMenubarLabel.displayName = MenubarPrimitive.Label.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: MenubarSeparator\n * -------------------------------------------------------------------------- */\n\ntype MenubarSeparatorElement = ComponentRef<typeof MenubarPrimitive.Separator>;\ntype MenubarSeparatorProps = ComponentPropsWithoutRef<typeof MenubarPrimitive.Separator>;\n\nconst MenubarSeparator = forwardRef<MenubarSeparatorElement, MenubarSeparatorProps>(\n ({ className, ...props }, forwardedRef) => (\n <MenubarPrimitive.Separator ref={forwardedRef} className={cn('bg-muted mx-2 my-1 h-px', className)} {...props} />\n ),\n);\n\nMenubarSeparator.displayName = MenubarPrimitive.Separator.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: MenubarShortcut\n * -------------------------------------------------------------------------- */\n\ntype MenubarShortcutProps = HTMLAttributes<HTMLSpanElement>;\n\nfunction MenubarShortcut({ className, ...props }: MenubarShortcutProps): JSX.Element {\n return <span className={cn('text-muted-foreground ml-auto text-xs tracking-widest', className)} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: MenubarArrow\n * -------------------------------------------------------------------------- */\n\ntype MenubarArrowElement = ComponentRef<typeof MenubarPrimitive.Arrow>;\ntype MenubarArrowProps = MenubarPrimitive.MenubarArrowProps;\n\nconst MenubarArrow = forwardRef<MenubarArrowElement, MenubarArrowProps>(({ className, ...props }, forwardedRef) => (\n <MenubarPrimitive.Arrow ref={forwardedRef} className={cn('fill-popover', className)} {...props} />\n));\n\nMenubarArrow.displayName = MenubarPrimitive.Arrow.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Menubar,\n MenubarArrow,\n MenubarCheckboxItem,\n MenubarContent,\n MenubarGroup,\n MenubarItem,\n MenubarLabel,\n MenubarMenu,\n MenubarRadioGroup,\n MenubarRadioItem,\n MenubarSeparator,\n MenubarShortcut,\n MenubarSub,\n MenubarSubContent,\n MenubarSubTrigger,\n MenubarTrigger,\n type MenubarArrowProps,\n type MenubarCheckboxItemProps,\n type MenubarContentProps,\n type MenubarGroupProps,\n type MenubarItemProps,\n type MenubarLabelProps,\n type MenubarMenuProps,\n type MenubarProps,\n type MenubarRadioGroupProps,\n type MenubarRadioItemProps,\n type MenubarSeparatorProps,\n type MenubarShortcutProps,\n type MenubarSubContentProps,\n type MenubarSubProps,\n type MenubarSubTriggerProps,\n type MenubarTriggerProps,\n};\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var _chunk7XV37NAWcjs = require('./chunk-7XV37NAW.cjs');var _chunk7R4FFNVEcjs = require('./chunk-7R4FFNVE.cjs');var _chunkKF7Y7B3Gcjs = require('./chunk-KF7Y7B3G.cjs');var _chunkDD6AVCRHcjs = require('./chunk-DD6AVCRH.cjs');var _numberinput = require('@codefast-ui/number-input'); var e = _interopRequireWildcard(_numberinput);var _lucidereact = require('lucide-react');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var{root:E,input:L}=_chunk7XV37NAWcjs.a.call(void 0, ),O= exports.a =_react.forwardRef.call(void 0, ({ariaDecrementLabel:u,ariaIncrementLabel:a,className:s,defaultValue:d,disabled:l,formatOptions:f,id:c,inputSize:r,loaderPosition:b,loading:I,max:N,min:v,onChange:P,prefix:h,readOnly:C,spinner:y,step:R,suffix:g,value:x,...V},B)=>_jsxruntime.jsxs.call(void 0, e.Root,{ariaDecrementLabel:u,ariaIncrementLabel:a,className:E({inputSize:r,className:["pr-0",s]}),defaultValue:d,disabled:l,formatOptions:f,id:c,loaderPosition:b,loading:I,max:N,min:v,prefix:h,readOnly:C,spinner:y||_jsxruntime.jsx.call(void 0, _chunk7R4FFNVEcjs.a,{}),step:R,suffix:g,value:x,onChange:P,children:[_jsxruntime.jsx.call(void 0, e.Item,{ref:B,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",className:L({inputSize:r}),inputMode:"numeric",spellCheck:"false",...V}),_jsxruntime.jsxs.call(void 0, "div",{className:_chunkDD6AVCRHcjs.a.call(void 0, "peer-focus:divide-ring peer-focus:border-l-ring","divide-input border-input order-last ml-auto grid h-full shrink-0 divide-y overflow-hidden rounded-r-[calc(theme(borderRadius.md)-1px)] border-l transition"),children:[_jsxruntime.jsx.call(void 0, e.IncrementButton,{className:_chunkKF7Y7B3Gcjs.a.call(void 0, {className:"h-full rounded-none rounded-tr-[calc(theme(borderRadius.md)-1px)]",icon:!0,variant:"ghost",size:r}),children:_jsxruntime.jsx.call(void 0, _lucidereact.ChevronUpIcon,{})}),_jsxruntime.jsx.call(void 0, e.DecrementButton,{className:_chunkKF7Y7B3Gcjs.a.call(void 0, {className:"h-full rounded-none rounded-br-[calc(theme(borderRadius.md)-1px)]",icon:!0,variant:"ghost",size:r}),children:_jsxruntime.jsx.call(void 0, _lucidereact.ChevronDownIcon,{})})]})]}));O.displayName="NumberInput";exports.a = O;
|
|
2
|
+
//# sourceMappingURL=chunk-KEAW3ISB.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/codefast/codefast/packages/ui/dist/chunk-KEAW3ISB.cjs","../src/components/number-input.tsx"],"names":["root","input","inputVariants","NumberInput","forwardRef","ariaDecrementLabel","ariaIncrementLabel","className","defaultValue","disabled","formatOptions","id","inputSize","loaderPosition","loading","max","min","onChange","prefix","readOnly","spinner","step","suffix","value","props","forwardedRef","jsxs","jsx","Spinner","cn","buttonVariants","ChevronUpIcon","ChevronDownIcon"],"mappings":"AAAA,mZAAwC,wDAAyC,wDAAyC,wDAAyC,uGCA7H,2CACS,8BACmD,+CA2DxE,GApDpB,CAAE,IAAA,CAAAA,CAAAA,CAAM,KAAA,CAAAC,CAAM,C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UN,CAAAA,CAEV,QAAA,CAAA,CAAAU,6BAAAA,CAAsB,CAAA,IAAA,CAArB,CACC,GAAA,CAAKF,CAAAA,CACL,cAAA,CAAe,KAAA,CACf,YAAA,CAAa,KAAA,CACb,WAAA,CAAY,KAAA,CACZ,SAAA,CAAWxB,CAAAA,CAAM,CAAE,SAAA,CAAAW,CAAU,CAAC,CAAA,CAC9B,SAAA,CAAU,SAAA,CACV,UAAA,CAAW,OAAA,CACV,GAAGY,CAAAA,CACN,CAAA,CACAE,8BAAAA,KAAC,CAAA,CACC,SAAA,CAAWG,iCAAAA,iDACT,CACA,6JACF,CAAA,CAEA,QAAA,CAAA,CAAAF,6BAAAA,CAAsB,CAAA,eAAA,CAArB,CACC,SAAA,CAAWG,iCAAAA,CACT,SAAA,CAAW,mEAAA,CACX,IAAA,CAAM,CAAA,CAAA,CACN,OAAA,CAAS,OAAA,CACT,IAAA,CAAMlB,CACR,CAAC,CAAA,CAED,QAAA,CAAAe,6BAAAA,0BAACI,CAAA,CAAA,CAAc,CAAA,CACjB,CAAA,CACAJ,6BAAAA,CAAsB,CAAA,eAAA,CAArB,CACC,SAAA,CAAWG,iCAAAA,CACT,SAAA,CAAW,mEAAA,CACX,IAAA,CAAM,CAAA,CAAA,CACN,OAAA,CAAS,OAAA,CACT,IAAA,CAAMlB,CACR,CAAC,CAAA,CAED,QAAA,CAAAe,6BAAAA,4BAACK,CAAA,CAAA,CAAgB,CAAA,CACnB,CAAA,CAAA,CACF,CAAA,CAAA,CACF,CAEJ,CAAA,CAEA7B,CAAAA,CAAY,WAAA,CAAc,aAAA,CAAA,cAAA","file":"/home/runner/work/codefast/codefast/packages/ui/dist/chunk-KEAW3ISB.cjs","sourcesContent":[null,"import * as NumberInputPrimitive from '@codefast-ui/number-input';\nimport { ChevronDownIcon, ChevronUpIcon } from 'lucide-react';\nimport { type ComponentProps, type ComponentPropsWithoutRef, type ComponentRef, forwardRef } from 'react';\n\nimport { Spinner } from '@/components/spinner';\nimport { cn } from '@/lib/utils';\nimport { buttonVariants } from '@/styles/button-variants';\nimport { inputVariants, type InputVariantsProps } from '@/styles/input-variants';\n\nconst { root, input } = inputVariants();\n\n/* -----------------------------------------------------------------------------\n * Component: NumberInput\n * -------------------------------------------------------------------------- */\n\ntype NumberInputElement = ComponentRef<typeof NumberInputPrimitive.Item>;\ninterface NumberInputProps\n extends InputVariantsProps,\n ComponentProps<typeof NumberInputPrimitive.Root>,\n ComponentPropsWithoutRef<typeof NumberInputPrimitive.Item> {}\n\nconst NumberInput = forwardRef<NumberInputElement, NumberInputProps>(\n (\n {\n ariaDecrementLabel,\n ariaIncrementLabel,\n className,\n defaultValue,\n disabled,\n formatOptions,\n id,\n inputSize,\n loaderPosition,\n loading,\n max,\n min,\n onChange,\n prefix,\n readOnly,\n spinner,\n step,\n suffix,\n value,\n ...props\n },\n forwardedRef,\n ) => (\n <NumberInputPrimitive.Root\n ariaDecrementLabel={ariaDecrementLabel}\n ariaIncrementLabel={ariaIncrementLabel}\n className={root({ inputSize, className: ['pr-0', className] })}\n defaultValue={defaultValue}\n disabled={disabled}\n formatOptions={formatOptions}\n id={id}\n loaderPosition={loaderPosition}\n loading={loading}\n max={max}\n min={min}\n prefix={prefix}\n readOnly={readOnly}\n spinner={spinner || <Spinner />}\n step={step}\n suffix={suffix}\n value={value}\n onChange={onChange}\n >\n <NumberInputPrimitive.Item\n ref={forwardedRef}\n autoCapitalize=\"off\"\n autoComplete=\"off\"\n autoCorrect=\"off\"\n className={input({ inputSize })}\n inputMode=\"numeric\"\n spellCheck=\"false\"\n {...props}\n />\n <div\n className={cn(\n 'peer-focus:divide-ring peer-focus:border-l-ring',\n 'divide-input border-input order-last ml-auto grid h-full shrink-0 divide-y overflow-hidden rounded-r-[calc(theme(borderRadius.md)-1px)] border-l transition',\n )}\n >\n <NumberInputPrimitive.IncrementButton\n className={buttonVariants({\n className: 'h-full rounded-none rounded-tr-[calc(theme(borderRadius.md)-1px)]',\n icon: true,\n variant: 'ghost',\n size: inputSize,\n })}\n >\n <ChevronUpIcon />\n </NumberInputPrimitive.IncrementButton>\n <NumberInputPrimitive.DecrementButton\n className={buttonVariants({\n className: 'h-full rounded-none rounded-br-[calc(theme(borderRadius.md)-1px)]',\n icon: true,\n variant: 'ghost',\n size: inputSize,\n })}\n >\n <ChevronDownIcon />\n </NumberInputPrimitive.DecrementButton>\n </div>\n </NumberInputPrimitive.Root>\n ),\n);\n\nNumberInput.displayName = 'NumberInput';\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { NumberInput, type NumberInputProps };\n"]}
|