@next-degree/pickle-shared-js 0.9.5 → 0.9.7
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/{company_service_sanity--Aw-Y3Us.d.cts → company_service_sanity-BR1XSAj3.d.ts} +1142 -1142
- package/dist/{company_service_sanity-B5FBDl-4.d.ts → company_service_sanity-D9tvlc53.d.cts} +1142 -1142
- package/dist/components/buttons/BackButton.cjs +1 -1
- package/dist/components/buttons/BackButton.cjs.map +1 -1
- package/dist/components/buttons/BackButton.js +1 -1
- package/dist/components/buttons/BackButton.js.map +1 -1
- package/dist/components/jobPost/JobDescription.cjs.map +1 -1
- package/dist/components/jobPost/JobDescription.js.map +1 -1
- package/dist/components/jobPost/JobHeader.cjs +1 -1
- package/dist/components/jobPost/JobHeader.cjs.map +1 -1
- package/dist/components/jobPost/JobHeader.js +1 -1
- package/dist/components/jobPost/JobHeader.js.map +1 -1
- package/dist/components/jobPost/JobPost.cjs +3 -1
- package/dist/components/jobPost/JobPost.cjs.map +1 -1
- package/dist/components/jobPost/JobPost.d.cts +3 -2
- package/dist/components/jobPost/JobPost.d.ts +3 -2
- package/dist/components/jobPost/JobPost.js +3 -1
- package/dist/components/jobPost/JobPost.js.map +1 -1
- package/dist/components/ui/Button.cjs +4 -2
- package/dist/components/ui/Button.cjs.map +1 -1
- package/dist/components/ui/Button.d.cts +2 -2
- package/dist/components/ui/Button.d.ts +2 -2
- package/dist/components/ui/Button.js +2 -1
- package/dist/components/ui/Button.js.map +1 -1
- package/dist/components/ui/Combobox.cjs +20 -20
- package/dist/components/ui/Combobox.cjs.map +1 -1
- package/dist/components/ui/Combobox.d.cts +1 -0
- package/dist/components/ui/Combobox.d.ts +1 -0
- package/dist/components/ui/Combobox.js +18 -18
- package/dist/components/ui/Combobox.js.map +1 -1
- package/dist/components/ui/InputOtp.cjs +8 -1
- package/dist/components/ui/InputOtp.cjs.map +1 -1
- package/dist/components/ui/InputOtp.js +8 -1
- package/dist/components/ui/InputOtp.js.map +1 -1
- package/dist/components/ui/ReadMore.cjs.map +1 -1
- package/dist/components/ui/ReadMore.js.map +1 -1
- package/dist/components/ui/buttonShadcn.d.cts +1 -1
- package/dist/components/ui/buttonShadcn.d.ts +1 -1
- package/dist/{displayText-4cJ7-3Mw.d.cts → displayText-BIzvCN9H.d.cts} +1 -1
- package/dist/{displayText-CBIWVZVw.d.ts → displayText-BtujjCCA.d.ts} +1 -1
- package/dist/hooks/useDisplayText.d.cts +2 -2
- package/dist/hooks/useDisplayText.d.ts +2 -2
- package/dist/index.cjs +14 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +14 -3
- package/dist/index.js.map +1 -1
- package/dist/{job_posting_service_sanity-CeX9tlpb.d.ts → job_posting_service_sanity-DwNhHT1w.d.ts} +979 -979
- package/dist/{job_posting_service_sanity-D5Znr6Ba.d.cts → job_posting_service_sanity-J281ln61.d.cts} +979 -979
- package/dist/lib/locations.d.cts +1 -1
- package/dist/lib/locations.d.ts +1 -1
- package/dist/lib/mappings.d.cts +2 -2
- package/dist/lib/mappings.d.ts +2 -2
- package/dist/services/displayText.d.cts +2 -2
- package/dist/services/displayText.d.ts +2 -2
- package/dist/styles/globals.css +9 -0
- package/dist/styles/globals.css.map +1 -1
- package/dist/types/data/job_posting_service_latest.d.cts +1 -1
- package/dist/types/data/job_posting_service_latest.d.ts +1 -1
- package/dist/types/index.d.cts +5 -5
- package/dist/types/index.d.ts +5 -5
- package/dist/types/latest/company_service_latest.d.cts +1 -1
- package/dist/types/latest/company_service_latest.d.ts +1 -1
- package/dist/types/latest/custom/company_service_sanity.d.cts +3 -3
- package/dist/types/latest/custom/company_service_sanity.d.ts +3 -3
- package/dist/types/latest/custom/job_posting_service_sanity.d.cts +3 -3
- package/dist/types/latest/custom/job_posting_service_sanity.d.ts +3 -3
- package/dist/types/latest/job_posting_service_latest.d.cts +1 -1
- package/dist/types/latest/job_posting_service_latest.d.ts +1 -1
- package/dist/types/latest/shared_pickle_output_latest.d.cts +1 -1
- package/dist/types/latest/shared_pickle_output_latest.d.ts +1 -1
- package/package.json +1 -1
- package/dist/{company_service_latest-DFxfjA2x.d.cts → company_service_latest-CWBnweTJ.d.cts} +571 -571
- package/dist/{company_service_latest-DFxfjA2x.d.ts → company_service_latest-CWBnweTJ.d.ts} +571 -571
- package/dist/{job_posting_service_latest-B5tqLSgo.d.cts → job_posting_service_latest-DSpkRuDi.d.cts} +528 -528
- package/dist/{job_posting_service_latest-B5tqLSgo.d.ts → job_posting_service_latest-DSpkRuDi.d.ts} +528 -528
- package/dist/{job_posting_service_latest-DOGQ9tEu.d.cts → job_posting_service_latest-duSSyFvo.d.cts} +1 -1
- package/dist/{job_posting_service_latest-DOGQ9tEu.d.ts → job_posting_service_latest-duSSyFvo.d.ts} +1 -1
- package/dist/{shared_pickle_output_latest-Bwfg5B4p.d.cts → shared_pickle_output_latest-CJb9E6oz.d.cts} +18 -18
- package/dist/{shared_pickle_output_latest-Bwfg5B4p.d.ts → shared_pickle_output_latest-CJb9E6oz.d.ts} +18 -18
|
@@ -174,7 +174,14 @@ var InputOtp = (0, import_react.forwardRef)(
|
|
|
174
174
|
maxLength: digits,
|
|
175
175
|
"data-testid": `input-otp-element-${props.id}`,
|
|
176
176
|
...props,
|
|
177
|
-
children: [...Array(digits)].map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(InputOTPGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
177
|
+
children: [...Array(digits)].map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(InputOTPGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
178
|
+
InputOTPSlot,
|
|
179
|
+
{
|
|
180
|
+
"data-testid": `input-otp-slot-${index}`,
|
|
181
|
+
index,
|
|
182
|
+
error: Boolean(error)
|
|
183
|
+
}
|
|
184
|
+
) }, index))
|
|
178
185
|
}
|
|
179
186
|
) }),
|
|
180
187
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ErrorMessage_default, { message: error })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ui/InputOtp.tsx","../../../src/components/primitives/input-otp.tsx","../../../src/lib/utils.ts","../../../src/components/ui/ErrorMessage.tsx","../../../src/components/ui/Label.tsx","../../../src/components/primitives/tooltip.tsx"],"sourcesContent":["import { forwardRef, type InputHTMLAttributes } from 'react'\n\nimport { InputOTP, InputOTPGroup, InputOTPSlot } from '@/components/primitives/input-otp'\nimport ErrorMessage from '@/components/ui/ErrorMessage'\nimport Label from '@/components/ui/Label'\n\ninterface Props extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {\n digits: 4 | 6 | 8\n value?: string\n label?: string\n description?: string\n error?: string\n onChange?: (v: string) => void\n}\n\nexport const InputOtp = forwardRef<HTMLInputElement, Props>(\n ({ digits, label, description, error, ...props }, ref) => {\n return (\n <div\n className=\"group flex w-full flex-col gap-1\"\n data-testid={`input-otp-wrapper-${props.id}`}\n >\n {label && (\n <Label\n text={label}\n htmlFor={props.name}\n required={props.required}\n description={description}\n />\n )}\n <div className=\"relative flex flex-row items-center\">\n <InputOTP\n ref={ref}\n maxLength={digits}\n data-testid={`input-otp-element-${props.id}`}\n {...props}\n >\n {[...Array(digits)].map((_, index) => (\n <InputOTPGroup key={index}>\n <InputOTPSlot index={index} error={Boolean(error)} />\n </InputOTPGroup>\n ))}\n </InputOTP>\n </div>\n\n <ErrorMessage message={error} />\n </div>\n )\n }\n)\nInputOtp.displayName = 'Input'\n","'use client'\n\nimport { OTPInput, OTPInputContext } from 'input-otp'\nimport { Dot } from 'lucide-react'\nimport * as React from 'react'\n\nimport { cn } from '@/lib/utils'\n\nconst InputOTP = React.forwardRef<\n React.ElementRef<typeof OTPInput>,\n React.ComponentPropsWithoutRef<typeof OTPInput>\n>(({ className, containerClassName, ...props }, ref) => (\n <OTPInput\n ref={ref}\n containerClassName={cn(\n 'flex items-center gap-2 has-[:disabled]:opacity-50',\n containerClassName\n )}\n className={cn('disabled:cursor-not-allowed', className)}\n {...props}\n />\n))\nInputOTP.displayName = 'InputOTP'\n\nconst InputOTPGroup = React.forwardRef<\n React.ElementRef<'div'>,\n React.ComponentPropsWithoutRef<'div'>\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn('flex items-center', className)} {...props} />\n))\nInputOTPGroup.displayName = 'InputOTPGroup'\n\nconst InputOTPSlot = React.forwardRef<\n React.ElementRef<'div'>,\n React.ComponentPropsWithoutRef<'div'> & { index: number; error?: boolean }\n>(({ index, error, className, ...props }, ref) => {\n const inputOTPContext = React.useContext(OTPInputContext)\n const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index]\n\n return (\n <div\n ref={ref}\n className={cn(\n 'relative flex h-10 w-10 items-center justify-center border-y border-r border-neutral-200 text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md dark:border-neutral-800',\n isActive &&\n 'z-10 ring-2 ring-purple-100 ring-offset-white dark:ring-purple-20 dark:ring-offset-purple-100',\n error && 'border-red-500 dark:border-red-400',\n className\n )}\n {...props}\n >\n {char}\n {hasFakeCaret && (\n <div className=\"pointer-events-none absolute inset-0 flex items-center justify-center\">\n <div className=\"h-4 w-px animate-caret-blink bg-neutral-950 duration-1000 dark:bg-neutral-50\" />\n </div>\n )}\n </div>\n )\n})\nInputOTPSlot.displayName = 'InputOTPSlot'\n\nconst InputOTPSeparator = React.forwardRef<\n React.ElementRef<'div'>,\n React.ComponentPropsWithoutRef<'div'>\n>(({ ...props }, ref) => (\n <div ref={ref} role=\"separator\" {...props}>\n <Dot />\n </div>\n))\nInputOTPSeparator.displayName = 'InputOTPSeparator'\n\nexport { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot }\n","import { type ClassValue, clsx } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import { type ComponentPropsWithoutRef } from 'react'\n\nimport { cn } from '@/lib/utils'\n\ninterface Props extends ComponentPropsWithoutRef<'p'> {\n message?: string\n}\n\nfunction ErrorMessage({ message, className, ...props }: Readonly<Props>) {\n if (!message) return null\n\n return (\n <p className={cn('px-1 text-xs text-red-600', className)} {...props}>\n {message}\n </p>\n )\n}\n\nexport default ErrorMessage\n","import { InfoIcon } from 'lucide-react'\nimport { type ComponentPropsWithoutRef } from 'react'\n\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from '@/components/primitives/tooltip'\nimport { cn } from '@/lib/utils'\n\ninterface Props extends ComponentPropsWithoutRef<'label'> {\n text?: string\n required?: boolean\n description?: string\n}\n\nfunction Label({ text, required, description, className, ...props }: Readonly<Props>) {\n if (!text) return null\n\n return (\n <div className=\"flex w-full flex-row gap-1\">\n <label\n className={cn(\n 'text-xs text-grey-80 peer-disabled:cursor-not-allowed peer-disabled:opacity-70',\n className\n )}\n {...props}\n >\n {text}\n {required && <span className=\"text-red-600\"> *</span>}\n </label>\n\n {!!description && (\n <TooltipProvider>\n <Tooltip>\n <TooltipTrigger asChild>\n <InfoIcon className=\"h-4 w-4\" />\n </TooltipTrigger>\n <TooltipContent className=\"max-w-48\">{description}</TooltipContent>\n </Tooltip>\n </TooltipProvider>\n )}\n </div>\n )\n}\n\nexport default Label\n","'use client'\n\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip'\nimport * as React from 'react'\n\nimport { cn } from '@/lib/utils'\n\nconst TooltipProvider = TooltipPrimitive.Provider\n\nconst Tooltip = TooltipPrimitive.Root\n\nconst TooltipTrigger = TooltipPrimitive.Trigger\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n 'z-50 overflow-hidden rounded-md border border-neutral-200 bg-white px-3 py-1.5 text-sm text-neutral-950 shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50',\n className\n )}\n {...props}\n />\n))\nTooltipContent.displayName = TooltipPrimitive.Content.displayName\n\nexport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAqD;;;ACErD,uBAA0C;AAC1C,0BAAoB;AACpB,YAAuB;;;ACJvB,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ADOE;AAJF,IAAM,WAAiB,iBAGrB,CAAC,EAAE,WAAW,oBAAoB,GAAG,MAAM,GAAG,QAC9C;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,oBAAoB;AAAA,MAClB;AAAA,MACA;AAAA,IACF;AAAA,IACA,WAAW,GAAG,+BAA+B,SAAS;AAAA,IACrD,GAAG;AAAA;AACN,CACD;AACD,SAAS,cAAc;AAEvB,IAAM,gBAAsB,iBAG1B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B,4CAAC,SAAI,KAAU,WAAW,GAAG,qBAAqB,SAAS,GAAI,GAAG,OAAO,CAC1E;AACD,cAAc,cAAc;AAE5B,IAAM,eAAqB,iBAGzB,CAAC,EAAE,OAAO,OAAO,WAAW,GAAG,MAAM,GAAG,QAAQ;AAChD,QAAM,kBAAwB,iBAAW,gCAAe;AACxD,QAAM,EAAE,MAAM,cAAc,SAAS,IAAI,gBAAgB,MAAM,KAAK;AAEpE,SACE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AA,UACT;AAAA,UACA;AAAA,QACF;AAAA,QACC,GAAG;AAAA,QAEH;AAAA;AAAA,UACA,YAAY,6CAAC,UAAK,WAAU,gBAAe,mBAAO;AAAA;AAAA;AAAA,IACrD;AAAA,IAEC,CAAC,CAAC,eACD,6CAAC,mBACC,wDAAC,WACC;AAAA,mDAAC,kBAAe,SAAO,MACrB,uDAAC,iCAAS,WAAU,WAAU,GAChC;AAAA,MACA,6CAAC,kBAAe,WAAU,YAAY,uBAAY;AAAA,OACpD,GACF;AAAA,KAEJ;AAEJ;AAEA,IAAO,gBAAQ;;;AJ7BT,IAAAC,sBAAA;AAHC,IAAM,eAAW;AAAA,EACtB,CAAC,EAAE,QAAQ,OAAO,aAAa,OAAO,GAAG,MAAM,GAAG,QAAQ;AACxD,WACE;AAAA,MAAC;AAAA;AAAA,QACC,WAAU;AAAA,QACV,eAAa,qBAAqB,MAAM,EAAE;AAAA,QAEzC;AAAA,mBACC;AAAA,YAAC;AAAA;AAAA,cACC,MAAM;AAAA,cACN,SAAS,MAAM;AAAA,cACf,UAAU,MAAM;AAAA,cAChB;AAAA;AAAA,UACF;AAAA,UAEF,6CAAC,SAAI,WAAU,uCACb;AAAA,YAAC;AAAA;AAAA,cACC;AAAA,cACA,WAAW;AAAA,cACX,eAAa,qBAAqB,MAAM,EAAE;AAAA,cACzC,GAAG;AAAA,cAEH,WAAC,GAAG,MAAM,MAAM,CAAC,EAAE,IAAI,CAAC,GAAG,UAC1B,6CAAC,iBACC,uDAAC,gBAAa,OAAc,OAAO,QAAQ,KAAK,GAAG,KADjC,KAEpB,CACD;AAAA;AAAA,UACH,GACF;AAAA,UAEA,6CAAC,wBAAa,SAAS,OAAO;AAAA;AAAA;AAAA,IAChC;AAAA,EAEJ;AACF;AACA,SAAS,cAAc;","names":["import_jsx_runtime","import_lucide_react","React","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ui/InputOtp.tsx","../../../src/components/primitives/input-otp.tsx","../../../src/lib/utils.ts","../../../src/components/ui/ErrorMessage.tsx","../../../src/components/ui/Label.tsx","../../../src/components/primitives/tooltip.tsx"],"sourcesContent":["import { forwardRef, type InputHTMLAttributes } from 'react'\n\nimport { InputOTP, InputOTPGroup, InputOTPSlot } from '@/components/primitives/input-otp'\nimport ErrorMessage from '@/components/ui/ErrorMessage'\nimport Label from '@/components/ui/Label'\n\ninterface Props extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {\n digits: 4 | 6 | 8\n value?: string\n label?: string\n description?: string\n error?: string\n onChange?: (v: string) => void\n}\n\nexport const InputOtp = forwardRef<HTMLInputElement, Props>(\n ({ digits, label, description, error, ...props }, ref) => {\n return (\n <div\n className=\"group flex w-full flex-col gap-1\"\n data-testid={`input-otp-wrapper-${props.id}`}\n >\n {label && (\n <Label\n text={label}\n htmlFor={props.name}\n required={props.required}\n description={description}\n />\n )}\n <div className=\"relative flex flex-row items-center\">\n <InputOTP\n ref={ref}\n maxLength={digits}\n data-testid={`input-otp-element-${props.id}`}\n {...props}\n >\n {[...Array(digits)].map((_, index) => (\n <InputOTPGroup key={index}>\n <InputOTPSlot\n data-testid={`input-otp-slot-${index}`}\n index={index}\n error={Boolean(error)}\n />\n </InputOTPGroup>\n ))}\n </InputOTP>\n </div>\n\n <ErrorMessage message={error} />\n </div>\n )\n }\n)\nInputOtp.displayName = 'Input'\n","'use client'\n\nimport { OTPInput, OTPInputContext } from 'input-otp'\nimport { Dot } from 'lucide-react'\nimport * as React from 'react'\n\nimport { cn } from '@/lib/utils'\n\nconst InputOTP = React.forwardRef<\n React.ElementRef<typeof OTPInput>,\n React.ComponentPropsWithoutRef<typeof OTPInput>\n>(({ className, containerClassName, ...props }, ref) => (\n <OTPInput\n ref={ref}\n containerClassName={cn(\n 'flex items-center gap-2 has-[:disabled]:opacity-50',\n containerClassName\n )}\n className={cn('disabled:cursor-not-allowed', className)}\n {...props}\n />\n))\nInputOTP.displayName = 'InputOTP'\n\nconst InputOTPGroup = React.forwardRef<\n React.ElementRef<'div'>,\n React.ComponentPropsWithoutRef<'div'>\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn('flex items-center', className)} {...props} />\n))\nInputOTPGroup.displayName = 'InputOTPGroup'\n\nconst InputOTPSlot = React.forwardRef<\n React.ElementRef<'div'>,\n React.ComponentPropsWithoutRef<'div'> & { index: number; error?: boolean }\n>(({ index, error, className, ...props }, ref) => {\n const inputOTPContext = React.useContext(OTPInputContext)\n const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index]\n\n return (\n <div\n ref={ref}\n className={cn(\n 'relative flex h-10 w-10 items-center justify-center border-y border-r border-neutral-200 text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md dark:border-neutral-800',\n isActive &&\n 'z-10 ring-2 ring-purple-100 ring-offset-white dark:ring-purple-20 dark:ring-offset-purple-100',\n error && 'border-red-500 dark:border-red-400',\n className\n )}\n {...props}\n >\n {char}\n {hasFakeCaret && (\n <div className=\"pointer-events-none absolute inset-0 flex items-center justify-center\">\n <div className=\"h-4 w-px animate-caret-blink bg-neutral-950 duration-1000 dark:bg-neutral-50\" />\n </div>\n )}\n </div>\n )\n})\nInputOTPSlot.displayName = 'InputOTPSlot'\n\nconst InputOTPSeparator = React.forwardRef<\n React.ElementRef<'div'>,\n React.ComponentPropsWithoutRef<'div'>\n>(({ ...props }, ref) => (\n <div ref={ref} role=\"separator\" {...props}>\n <Dot />\n </div>\n))\nInputOTPSeparator.displayName = 'InputOTPSeparator'\n\nexport { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot }\n","import { type ClassValue, clsx } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import { type ComponentPropsWithoutRef } from 'react'\n\nimport { cn } from '@/lib/utils'\n\ninterface Props extends ComponentPropsWithoutRef<'p'> {\n message?: string\n}\n\nfunction ErrorMessage({ message, className, ...props }: Readonly<Props>) {\n if (!message) return null\n\n return (\n <p className={cn('px-1 text-xs text-red-600', className)} {...props}>\n {message}\n </p>\n )\n}\n\nexport default ErrorMessage\n","import { InfoIcon } from 'lucide-react'\nimport { type ComponentPropsWithoutRef } from 'react'\n\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from '@/components/primitives/tooltip'\nimport { cn } from '@/lib/utils'\n\ninterface Props extends ComponentPropsWithoutRef<'label'> {\n text?: string\n required?: boolean\n description?: string\n}\n\nfunction Label({ text, required, description, className, ...props }: Readonly<Props>) {\n if (!text) return null\n\n return (\n <div className=\"flex w-full flex-row gap-1\">\n <label\n className={cn(\n 'text-xs text-grey-80 peer-disabled:cursor-not-allowed peer-disabled:opacity-70',\n className\n )}\n {...props}\n >\n {text}\n {required && <span className=\"text-red-600\"> *</span>}\n </label>\n\n {!!description && (\n <TooltipProvider>\n <Tooltip>\n <TooltipTrigger asChild>\n <InfoIcon className=\"h-4 w-4\" />\n </TooltipTrigger>\n <TooltipContent className=\"max-w-48\">{description}</TooltipContent>\n </Tooltip>\n </TooltipProvider>\n )}\n </div>\n )\n}\n\nexport default Label\n","'use client'\n\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip'\nimport * as React from 'react'\n\nimport { cn } from '@/lib/utils'\n\nconst TooltipProvider = TooltipPrimitive.Provider\n\nconst Tooltip = TooltipPrimitive.Root\n\nconst TooltipTrigger = TooltipPrimitive.Trigger\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n 'z-50 overflow-hidden rounded-md border border-neutral-200 bg-white px-3 py-1.5 text-sm text-neutral-950 shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50',\n className\n )}\n {...props}\n />\n))\nTooltipContent.displayName = TooltipPrimitive.Content.displayName\n\nexport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAqD;;;ACErD,uBAA0C;AAC1C,0BAAoB;AACpB,YAAuB;;;ACJvB,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ADOE;AAJF,IAAM,WAAiB,iBAGrB,CAAC,EAAE,WAAW,oBAAoB,GAAG,MAAM,GAAG,QAC9C;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,oBAAoB;AAAA,MAClB;AAAA,MACA;AAAA,IACF;AAAA,IACA,WAAW,GAAG,+BAA+B,SAAS;AAAA,IACrD,GAAG;AAAA;AACN,CACD;AACD,SAAS,cAAc;AAEvB,IAAM,gBAAsB,iBAG1B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B,4CAAC,SAAI,KAAU,WAAW,GAAG,qBAAqB,SAAS,GAAI,GAAG,OAAO,CAC1E;AACD,cAAc,cAAc;AAE5B,IAAM,eAAqB,iBAGzB,CAAC,EAAE,OAAO,OAAO,WAAW,GAAG,MAAM,GAAG,QAAQ;AAChD,QAAM,kBAAwB,iBAAW,gCAAe;AACxD,QAAM,EAAE,MAAM,cAAc,SAAS,IAAI,gBAAgB,MAAM,KAAK;AAEpE,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA,YACE;AAAA,QACF,SAAS;AAAA,QACT;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH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AAAA,IAEC,CAAC,CAAC,eACD,6CAAC,mBACC,wDAAC,WACC;AAAA,mDAAC,kBAAe,SAAO,MACrB,uDAAC,iCAAS,WAAU,WAAU,GAChC;AAAA,MACA,6CAAC,kBAAe,WAAU,YAAY,uBAAY;AAAA,OACpD,GACF;AAAA,KAEJ;AAEJ;AAEA,IAAO,gBAAQ;;;AJ7BT,IAAAC,sBAAA;AAHC,IAAM,eAAW;AAAA,EACtB,CAAC,EAAE,QAAQ,OAAO,aAAa,OAAO,GAAG,MAAM,GAAG,QAAQ;AACxD,WACE;AAAA,MAAC;AAAA;AAAA,QACC,WAAU;AAAA,QACV,eAAa,qBAAqB,MAAM,EAAE;AAAA,QAEzC;AAAA,mBACC;AAAA,YAAC;AAAA;AAAA,cACC,MAAM;AAAA,cACN,SAAS,MAAM;AAAA,cACf,UAAU,MAAM;AAAA,cAChB;AAAA;AAAA,UACF;AAAA,UAEF,6CAAC,SAAI,WAAU,uCACb;AAAA,YAAC;AAAA;AAAA,cACC;AAAA,cACA,WAAW;AAAA,cACX,eAAa,qBAAqB,MAAM,EAAE;AAAA,cACzC,GAAG;AAAA,cAEH,WAAC,GAAG,MAAM,MAAM,CAAC,EAAE,IAAI,CAAC,GAAG,UAC1B,6CAAC,iBACC;AAAA,gBAAC;AAAA;AAAA,kBACC,eAAa,kBAAkB,KAAK;AAAA,kBACpC;AAAA,kBACA,OAAO,QAAQ,KAAK;AAAA;AAAA,cACtB,KALkB,KAMpB,CACD;AAAA;AAAA,UACH,GACF;AAAA,UAEA,6CAAC,wBAAa,SAAS,OAAO;AAAA;AAAA;AAAA,IAChC;AAAA,EAEJ;AACF;AACA,SAAS,cAAc;","names":["import_jsx_runtime","import_lucide_react","React","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime"]}
|
|
@@ -140,7 +140,14 @@ var InputOtp = forwardRef3(
|
|
|
140
140
|
maxLength: digits,
|
|
141
141
|
"data-testid": `input-otp-element-${props.id}`,
|
|
142
142
|
...props,
|
|
143
|
-
children: [...Array(digits)].map((_, index) => /* @__PURE__ */ jsx5(InputOTPGroup, { children: /* @__PURE__ */ jsx5(
|
|
143
|
+
children: [...Array(digits)].map((_, index) => /* @__PURE__ */ jsx5(InputOTPGroup, { children: /* @__PURE__ */ jsx5(
|
|
144
|
+
InputOTPSlot,
|
|
145
|
+
{
|
|
146
|
+
"data-testid": `input-otp-slot-${index}`,
|
|
147
|
+
index,
|
|
148
|
+
error: Boolean(error)
|
|
149
|
+
}
|
|
150
|
+
) }, index))
|
|
144
151
|
}
|
|
145
152
|
) }),
|
|
146
153
|
/* @__PURE__ */ jsx5(ErrorMessage_default, { message: error })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ui/InputOtp.tsx","../../../src/components/primitives/input-otp.tsx","../../../src/lib/utils.ts","../../../src/components/ui/ErrorMessage.tsx","../../../src/components/ui/Label.tsx","../../../src/components/primitives/tooltip.tsx"],"sourcesContent":["import { forwardRef, type InputHTMLAttributes } from 'react'\n\nimport { InputOTP, InputOTPGroup, InputOTPSlot } from '@/components/primitives/input-otp'\nimport ErrorMessage from '@/components/ui/ErrorMessage'\nimport Label from '@/components/ui/Label'\n\ninterface Props extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {\n digits: 4 | 6 | 8\n value?: string\n label?: string\n description?: string\n error?: string\n onChange?: (v: string) => void\n}\n\nexport const InputOtp = forwardRef<HTMLInputElement, Props>(\n ({ digits, label, description, error, ...props }, ref) => {\n return (\n <div\n className=\"group flex w-full flex-col gap-1\"\n data-testid={`input-otp-wrapper-${props.id}`}\n >\n {label && (\n <Label\n text={label}\n htmlFor={props.name}\n required={props.required}\n description={description}\n />\n )}\n <div className=\"relative flex flex-row items-center\">\n <InputOTP\n ref={ref}\n maxLength={digits}\n data-testid={`input-otp-element-${props.id}`}\n {...props}\n >\n {[...Array(digits)].map((_, index) => (\n <InputOTPGroup key={index}>\n <InputOTPSlot index={index} error={Boolean(error)} />\n </InputOTPGroup>\n ))}\n </InputOTP>\n </div>\n\n <ErrorMessage message={error} />\n </div>\n )\n }\n)\nInputOtp.displayName = 'Input'\n","'use client'\n\nimport { OTPInput, OTPInputContext } from 'input-otp'\nimport { Dot } from 'lucide-react'\nimport * as React from 'react'\n\nimport { cn } from '@/lib/utils'\n\nconst InputOTP = React.forwardRef<\n React.ElementRef<typeof OTPInput>,\n React.ComponentPropsWithoutRef<typeof OTPInput>\n>(({ className, containerClassName, ...props }, ref) => (\n <OTPInput\n ref={ref}\n containerClassName={cn(\n 'flex items-center gap-2 has-[:disabled]:opacity-50',\n containerClassName\n )}\n className={cn('disabled:cursor-not-allowed', className)}\n {...props}\n />\n))\nInputOTP.displayName = 'InputOTP'\n\nconst InputOTPGroup = React.forwardRef<\n React.ElementRef<'div'>,\n React.ComponentPropsWithoutRef<'div'>\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn('flex items-center', className)} {...props} />\n))\nInputOTPGroup.displayName = 'InputOTPGroup'\n\nconst InputOTPSlot = React.forwardRef<\n React.ElementRef<'div'>,\n React.ComponentPropsWithoutRef<'div'> & { index: number; error?: boolean }\n>(({ index, error, className, ...props }, ref) => {\n const inputOTPContext = React.useContext(OTPInputContext)\n const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index]\n\n return (\n <div\n ref={ref}\n className={cn(\n 'relative flex h-10 w-10 items-center justify-center border-y border-r border-neutral-200 text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md dark:border-neutral-800',\n isActive &&\n 'z-10 ring-2 ring-purple-100 ring-offset-white dark:ring-purple-20 dark:ring-offset-purple-100',\n error && 'border-red-500 dark:border-red-400',\n className\n )}\n {...props}\n >\n {char}\n {hasFakeCaret && (\n <div className=\"pointer-events-none absolute inset-0 flex items-center justify-center\">\n <div className=\"h-4 w-px animate-caret-blink bg-neutral-950 duration-1000 dark:bg-neutral-50\" />\n </div>\n )}\n </div>\n )\n})\nInputOTPSlot.displayName = 'InputOTPSlot'\n\nconst InputOTPSeparator = React.forwardRef<\n React.ElementRef<'div'>,\n React.ComponentPropsWithoutRef<'div'>\n>(({ ...props }, ref) => (\n <div ref={ref} role=\"separator\" {...props}>\n <Dot />\n </div>\n))\nInputOTPSeparator.displayName = 'InputOTPSeparator'\n\nexport { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot }\n","import { type ClassValue, clsx } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import { type ComponentPropsWithoutRef } from 'react'\n\nimport { cn } from '@/lib/utils'\n\ninterface Props extends ComponentPropsWithoutRef<'p'> {\n message?: string\n}\n\nfunction ErrorMessage({ message, className, ...props }: Readonly<Props>) {\n if (!message) return null\n\n return (\n <p className={cn('px-1 text-xs text-red-600', className)} {...props}>\n {message}\n </p>\n )\n}\n\nexport default ErrorMessage\n","import { InfoIcon } from 'lucide-react'\nimport { type ComponentPropsWithoutRef } from 'react'\n\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from '@/components/primitives/tooltip'\nimport { cn } from '@/lib/utils'\n\ninterface Props extends ComponentPropsWithoutRef<'label'> {\n text?: string\n required?: boolean\n description?: string\n}\n\nfunction Label({ text, required, description, className, ...props }: Readonly<Props>) {\n if (!text) return null\n\n return (\n <div className=\"flex w-full flex-row gap-1\">\n <label\n className={cn(\n 'text-xs text-grey-80 peer-disabled:cursor-not-allowed peer-disabled:opacity-70',\n className\n )}\n {...props}\n >\n {text}\n {required && <span className=\"text-red-600\"> *</span>}\n </label>\n\n {!!description && (\n <TooltipProvider>\n <Tooltip>\n <TooltipTrigger asChild>\n <InfoIcon className=\"h-4 w-4\" />\n </TooltipTrigger>\n <TooltipContent className=\"max-w-48\">{description}</TooltipContent>\n </Tooltip>\n </TooltipProvider>\n )}\n </div>\n )\n}\n\nexport default Label\n","'use client'\n\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip'\nimport * as React from 'react'\n\nimport { cn } from '@/lib/utils'\n\nconst TooltipProvider = TooltipPrimitive.Provider\n\nconst Tooltip = TooltipPrimitive.Root\n\nconst TooltipTrigger = TooltipPrimitive.Trigger\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n 'z-50 overflow-hidden rounded-md border border-neutral-200 bg-white px-3 py-1.5 text-sm text-neutral-950 shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50',\n className\n )}\n {...props}\n />\n))\nTooltipContent.displayName = TooltipPrimitive.Content.displayName\n\nexport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger }\n"],"mappings":";AAAA,SAAS,cAAAA,mBAA4C;;;ACErD,SAAS,UAAU,uBAAuB;AAC1C,SAAS,WAAW;AACpB,YAAY,WAAW;;;ACJvB,SAA0B,YAAY;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ADOE,cA4BE,YA5BF;AAJF,IAAM,WAAiB,iBAGrB,CAAC,EAAE,WAAW,oBAAoB,GAAG,MAAM,GAAG,QAC9C;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,oBAAoB;AAAA,MAClB;AAAA,MACA;AAAA,IACF;AAAA,IACA,WAAW,GAAG,+BAA+B,SAAS;AAAA,IACrD,GAAG;AAAA;AACN,CACD;AACD,SAAS,cAAc;AAEvB,IAAM,gBAAsB,iBAG1B,CAAC,EAAE,WAAW,GAAG,MA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AAa,qBAAqB,MAAM,EAAE;AAAA,cACzC,GAAG;AAAA,cAEH,WAAC,GAAG,MAAM,MAAM,CAAC,EAAE,IAAI,CAAC,GAAG,UAC1B,gBAAAA,KAAC,iBACC,0BAAAA,KAAC,gBAAa,OAAc,OAAO,QAAQ,KAAK,GAAG,KADjC,KAEpB,CACD;AAAA;AAAA,UACH,GACF;AAAA,UAEA,gBAAAA,KAAC,wBAAa,SAAS,OAAO;AAAA;AAAA;AAAA,IAChC;AAAA,EAEJ;AACF;AACA,SAAS,cAAc;","names":["forwardRef","jsx","React","jsx","jsx","jsxs","jsx","jsxs","forwardRef"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ui/InputOtp.tsx","../../../src/components/primitives/input-otp.tsx","../../../src/lib/utils.ts","../../../src/components/ui/ErrorMessage.tsx","../../../src/components/ui/Label.tsx","../../../src/components/primitives/tooltip.tsx"],"sourcesContent":["import { forwardRef, type InputHTMLAttributes } from 'react'\n\nimport { InputOTP, InputOTPGroup, InputOTPSlot } from '@/components/primitives/input-otp'\nimport ErrorMessage from '@/components/ui/ErrorMessage'\nimport Label from '@/components/ui/Label'\n\ninterface Props extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {\n digits: 4 | 6 | 8\n value?: string\n label?: string\n description?: string\n error?: string\n onChange?: (v: string) => void\n}\n\nexport const InputOtp = forwardRef<HTMLInputElement, Props>(\n ({ digits, label, description, error, ...props }, ref) => {\n return (\n <div\n className=\"group flex w-full flex-col gap-1\"\n data-testid={`input-otp-wrapper-${props.id}`}\n >\n {label && (\n <Label\n text={label}\n htmlFor={props.name}\n required={props.required}\n description={description}\n />\n )}\n <div className=\"relative flex flex-row items-center\">\n <InputOTP\n ref={ref}\n maxLength={digits}\n data-testid={`input-otp-element-${props.id}`}\n {...props}\n >\n {[...Array(digits)].map((_, index) => (\n <InputOTPGroup key={index}>\n <InputOTPSlot\n data-testid={`input-otp-slot-${index}`}\n index={index}\n error={Boolean(error)}\n />\n </InputOTPGroup>\n ))}\n </InputOTP>\n </div>\n\n <ErrorMessage message={error} />\n </div>\n )\n }\n)\nInputOtp.displayName = 'Input'\n","'use client'\n\nimport { OTPInput, OTPInputContext } from 'input-otp'\nimport { Dot } from 'lucide-react'\nimport * as React from 'react'\n\nimport { cn } from '@/lib/utils'\n\nconst InputOTP = React.forwardRef<\n React.ElementRef<typeof OTPInput>,\n React.ComponentPropsWithoutRef<typeof OTPInput>\n>(({ className, containerClassName, ...props }, ref) => (\n <OTPInput\n ref={ref}\n containerClassName={cn(\n 'flex items-center gap-2 has-[:disabled]:opacity-50',\n containerClassName\n )}\n className={cn('disabled:cursor-not-allowed', className)}\n {...props}\n />\n))\nInputOTP.displayName = 'InputOTP'\n\nconst InputOTPGroup = React.forwardRef<\n React.ElementRef<'div'>,\n React.ComponentPropsWithoutRef<'div'>\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn('flex items-center', className)} {...props} />\n))\nInputOTPGroup.displayName = 'InputOTPGroup'\n\nconst InputOTPSlot = React.forwardRef<\n React.ElementRef<'div'>,\n React.ComponentPropsWithoutRef<'div'> & { index: number; error?: boolean }\n>(({ index, error, className, ...props }, ref) => {\n const inputOTPContext = React.useContext(OTPInputContext)\n const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index]\n\n return (\n <div\n ref={ref}\n className={cn(\n 'relative flex h-10 w-10 items-center justify-center border-y border-r border-neutral-200 text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md dark:border-neutral-800',\n isActive &&\n 'z-10 ring-2 ring-purple-100 ring-offset-white dark:ring-purple-20 dark:ring-offset-purple-100',\n error && 'border-red-500 dark:border-red-400',\n className\n )}\n {...props}\n >\n {char}\n {hasFakeCaret && (\n <div className=\"pointer-events-none absolute inset-0 flex items-center justify-center\">\n <div className=\"h-4 w-px animate-caret-blink bg-neutral-950 duration-1000 dark:bg-neutral-50\" />\n </div>\n )}\n </div>\n )\n})\nInputOTPSlot.displayName = 'InputOTPSlot'\n\nconst InputOTPSeparator = React.forwardRef<\n React.ElementRef<'div'>,\n React.ComponentPropsWithoutRef<'div'>\n>(({ ...props }, ref) => (\n <div ref={ref} role=\"separator\" {...props}>\n <Dot />\n </div>\n))\nInputOTPSeparator.displayName = 'InputOTPSeparator'\n\nexport { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot }\n","import { type ClassValue, clsx } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import { type ComponentPropsWithoutRef } from 'react'\n\nimport { cn } from '@/lib/utils'\n\ninterface Props extends ComponentPropsWithoutRef<'p'> {\n message?: string\n}\n\nfunction ErrorMessage({ message, className, ...props }: Readonly<Props>) {\n if (!message) return null\n\n return (\n <p className={cn('px-1 text-xs text-red-600', className)} {...props}>\n {message}\n </p>\n )\n}\n\nexport default ErrorMessage\n","import { InfoIcon } from 'lucide-react'\nimport { type ComponentPropsWithoutRef } from 'react'\n\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from '@/components/primitives/tooltip'\nimport { cn } from '@/lib/utils'\n\ninterface Props extends ComponentPropsWithoutRef<'label'> {\n text?: string\n required?: boolean\n description?: string\n}\n\nfunction Label({ text, required, description, className, ...props }: Readonly<Props>) {\n if (!text) return null\n\n return (\n <div className=\"flex w-full flex-row gap-1\">\n <label\n className={cn(\n 'text-xs text-grey-80 peer-disabled:cursor-not-allowed peer-disabled:opacity-70',\n className\n )}\n {...props}\n >\n {text}\n {required && <span className=\"text-red-600\"> *</span>}\n </label>\n\n {!!description && (\n <TooltipProvider>\n <Tooltip>\n <TooltipTrigger asChild>\n <InfoIcon className=\"h-4 w-4\" />\n </TooltipTrigger>\n <TooltipContent className=\"max-w-48\">{description}</TooltipContent>\n </Tooltip>\n </TooltipProvider>\n )}\n </div>\n )\n}\n\nexport default Label\n","'use client'\n\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip'\nimport * as React from 'react'\n\nimport { cn } from '@/lib/utils'\n\nconst TooltipProvider = TooltipPrimitive.Provider\n\nconst Tooltip = TooltipPrimitive.Root\n\nconst TooltipTrigger = TooltipPrimitive.Trigger\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n 'z-50 overflow-hidden rounded-md border border-neutral-200 bg-white px-3 py-1.5 text-sm text-neutral-950 shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50',\n className\n )}\n {...props}\n />\n))\nTooltipContent.displayName = TooltipPrimitive.Content.displayName\n\nexport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger }\n"],"mappings":";AAAA,SAAS,cAAAA,mBAA4C;;;ACErD,SAAS,UAAU,uBAAuB;AAC1C,SAAS,WAAW;AACpB,YAAY,WAAW;;;ACJvB,SAA0B,YAAY;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ADOE,cA4BE,YA5BF;AAJF,IAAM,WAAiB,iBAGrB,CAAC,EAAE,WAAW,oBAAoB,GAAG,MAAM,GAAG,QAC9C;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,oBAAoB;AAAA,MAClB;AAAA,MACA;AAAA,IACF;AAAA,IACA,WAAW,GAAG,+BAA+B,SAAS;AAAA,IACrD,GAAG;AAAA;AACN,CACD;AACD,SAAS,cAAc;AAEvB,IAAM,gBAAsB,iBAG1B,CAAC,EAAE,WAAW,GAAG,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,eAAa,qBAAqB,MAAM,EAAE;AAAA,cACzC,GAAG;AAAA,cAEH,WAAC,GAAG,MAAM,MAAM,CAAC,EAAE,IAAI,CAAC,GAAG,UAC1B,gBAAAA,KAAC,iBACC,0BAAAA;AAAA,gBAAC;AAAA;AAAA,kBACC,eAAa,kBAAkB,KAAK;AAAA,kBACpC;AAAA,kBACA,OAAO,QAAQ,KAAK;AAAA;AAAA,cACtB,KALkB,KAMpB,CACD;AAAA;AAAA,UACH,GACF;AAAA,UAEA,gBAAAA,KAAC,wBAAa,SAAS,OAAO;AAAA;AAAA;AAAA,IAChC;AAAA,EAEJ;AACF;AACA,SAAS,cAAc;","names":["forwardRef","jsx","React","jsx","jsx","jsxs","jsx","jsxs","forwardRef"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ui/ReadMore.tsx","../../../src/components/ui/Button.tsx","../../../src/lib/utils.ts"],"sourcesContent":["'use client'\n\nimport { type ComponentProps, useEffect, useState } from 'react'\nimport Markdown from 'react-markdown'\n\nimport { Button } from '@/components/ui/Button'\n\nexport type ReadMoreProps = ComponentProps<'div'> & {\n text: string\n}\n\nexport function ReadMore({ text, ...props }: Readonly<ReadMoreProps>) {\n const [isExpanded, setIsExpanded] = useState(false)\n const [maxWords, setMaxWords] = useState(160)\n\n useEffect(() => {\n const updateMaxWords = () => {\n const windowWidth = window.innerWidth\n if (windowWidth <= 768) {\n setMaxWords(50)\n } else {\n setMaxWords(160)\n }\n }\n\n updateMaxWords()\n window.addEventListener('resize', updateMaxWords)\n\n return () => window.removeEventListener('resize', updateMaxWords)\n }, [])\n\n function createReadMoreText(text: string, maxWords: number, isExpanded: boolean): string {\n const words = text.split(' ')\n\n const snippet = isExpanded ? text : words.slice(0, maxWords).join(' ')\n const readMoreText = isExpanded ? '' : '...'\n return `${snippet} ${readMoreText}`\n }\n\n const toggleText = () => setIsExpanded(!isExpanded)\n\n const snippet = createReadMoreText(text, maxWords, isExpanded)\n\n return (\n <div {...props}>\n <div data-testid=\"read-more-text\" className=\"prose lg:prose-lg\">\n <Markdown>{snippet}</Markdown>\n </div>\n <Button\n type=\"button\"\n className=\"mt-2 flex items-center justify-center\"\n variant=\"link\"\n onClick={toggleText}\n >\n <p className=\"text-sm font-bold underline underline-offset-2\">\n Read {isExpanded ? 'less' : 'more'}\n </p>\n </Button>\n </div>\n )\n}\n","import { Slot } from '@radix-ui/react-slot'\nimport { cva, type VariantProps } from 'cva'\nimport React, { forwardRef } from 'react'\n\nimport { cn } from '@/lib/utils'\n\n/**\n * Props for the Button component.\n * @interface ButtonProps\n * @extends {React.ButtonHTMLAttributes<HTMLButtonElement>}\n * @extends {VariantProps<typeof buttonVariants>}\n */\ninterface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n /**\n * When true, the component will render its children directly without wrapping them in a button element.\n * Useful when you want to use the button styles on a different element.\n * @default false\n */\n asChild?: boolean\n}\n\n/**\n * A versatile button component that supports multiple variants and sizes.\n *\n * @component\n * @example\n * ```tsx\n * // Default button\n * <Button>Click me</Button>\n *\n * // Primary variant with large size\n * <Button variant=\"primary\" size=\"lg\">Large Button</Button>\n *\n * // As a link\n * <Button asChild>\n * <a href=\"/somewhere\">Go somewhere</a>\n * </Button>\n * ```\n */\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, type = 'button', ...props }, ref) => {\n const Component = asChild ? Slot : 'button'\n\n return (\n <Component\n className={cn(buttonVariants({ variant, size, className }))}\n type={type}\n ref={ref}\n {...props}\n />\n )\n }\n)\nButton.displayName = 'Button'\n\n/**\n * Variant definitions for the Button component using class-variance-authority.\n * Provides consistent styling across different button variations.\n */\
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ui/ReadMore.tsx","../../../src/components/ui/Button.tsx","../../../src/lib/utils.ts"],"sourcesContent":["'use client'\n\nimport { type ComponentProps, useEffect, useState } from 'react'\nimport Markdown from 'react-markdown'\n\nimport { Button } from '@/components/ui/Button'\n\nexport type ReadMoreProps = ComponentProps<'div'> & {\n text: string\n}\n\nexport function ReadMore({ text, ...props }: Readonly<ReadMoreProps>) {\n const [isExpanded, setIsExpanded] = useState(false)\n const [maxWords, setMaxWords] = useState(160)\n\n useEffect(() => {\n const updateMaxWords = () => {\n const windowWidth = window.innerWidth\n if (windowWidth <= 768) {\n setMaxWords(50)\n } else {\n setMaxWords(160)\n }\n }\n\n updateMaxWords()\n window.addEventListener('resize', updateMaxWords)\n\n return () => window.removeEventListener('resize', updateMaxWords)\n }, [])\n\n function createReadMoreText(text: string, maxWords: number, isExpanded: boolean): string {\n const words = text.split(' ')\n\n const snippet = isExpanded ? text : words.slice(0, maxWords).join(' ')\n const readMoreText = isExpanded ? '' : '...'\n return `${snippet} ${readMoreText}`\n }\n\n const toggleText = () => setIsExpanded(!isExpanded)\n\n const snippet = createReadMoreText(text, maxWords, isExpanded)\n\n return (\n <div {...props}>\n <div data-testid=\"read-more-text\" className=\"prose lg:prose-lg\">\n <Markdown>{snippet}</Markdown>\n </div>\n <Button\n type=\"button\"\n className=\"mt-2 flex items-center justify-center\"\n variant=\"link\"\n onClick={toggleText}\n >\n <p className=\"text-sm font-bold underline underline-offset-2\">\n Read {isExpanded ? 'less' : 'more'}\n </p>\n </Button>\n </div>\n )\n}\n","import { Slot } from '@radix-ui/react-slot'\nimport { cva, type VariantProps } from 'cva'\nimport React, { forwardRef } from 'react'\n\nimport { cn } from '@/lib/utils'\n\n/**\n * Props for the Button component.\n * @interface ButtonProps\n * @extends {React.ButtonHTMLAttributes<HTMLButtonElement>}\n * @extends {VariantProps<typeof buttonVariants>}\n */\ninterface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n /**\n * When true, the component will render its children directly without wrapping them in a button element.\n * Useful when you want to use the button styles on a different element.\n * @default false\n */\n asChild?: boolean\n}\n\n/**\n * A versatile button component that supports multiple variants and sizes.\n *\n * @component\n * @example\n * ```tsx\n * // Default button\n * <Button>Click me</Button>\n *\n * // Primary variant with large size\n * <Button variant=\"primary\" size=\"lg\">Large Button</Button>\n *\n * // As a link\n * <Button asChild>\n * <a href=\"/somewhere\">Go somewhere</a>\n * </Button>\n * ```\n */\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, type = 'button', ...props }, ref) => {\n const Component = asChild ? Slot : 'button'\n\n return (\n <Component\n className={cn(buttonVariants({ variant, size, className }))}\n type={type}\n ref={ref}\n {...props}\n />\n )\n }\n)\nButton.displayName = 'Button'\n\n/**\n * Variant definitions for the Button component using class-variance-authority.\n * Provides consistent styling across different button variations.\n */\nexport const buttonVariants = cva(\n [\n 'flex',\n 'items-center',\n 'justify-center',\n 'gap-2',\n 'rounded-full',\n 'font-bold',\n 'outline-2',\n 'outline-offset-2',\n 'outline-dashed',\n 'outline-transparent',\n ],\n {\n variants: {\n variant: {\n neutral: [\n 'bg-black',\n 'text-white',\n 'hover:bg-grey-90',\n 'active:bg-grey-80',\n 'focus:outline-purple-100',\n 'disabled:text-grey-40',\n 'disabled:bg-grey-10',\n ],\n primary: [\n 'bg-pickle-100',\n 'text-black',\n 'hover:bg-pickle-80',\n 'active:bg-pickle-60',\n 'focus:outline-purple-100',\n 'disabled:text-grey-40',\n 'disabled:bg-grey-10',\n ],\n secondary: [\n 'bg-green-80',\n 'text-white',\n 'hover:bg-green-90',\n 'active:bg-green-100',\n 'focus:outline-pickle-100',\n 'disabled:text-grey-40',\n 'disabled:bg-grey-10',\n ],\n transparent: [\n 'text-white',\n 'hover:bg-green-80',\n 'active:bg-green-100',\n 'focus:outline-pickle-100',\n 'disabled:text-grey-40',\n ],\n link: [\n 'leading-tight',\n 'text-black',\n 'underline',\n 'hover:text-purple-100',\n 'focus:text-black',\n 'focus:outline-purple-100',\n 'active:text-purple-80',\n ],\n },\n size: {\n small: ['h-10', 'text-sm', 'px-4', 'py-2'],\n medium: ['h-12', 'text-base', 'px-6', 'py-3'],\n large: ['h-14', 'text-lg', 'px-8', 'py-4'],\n },\n },\n defaultVariants: {\n variant: 'neutral',\n size: 'medium',\n },\n compoundVariants: [\n {\n variant: 'link',\n size: 'small',\n class: ['h-3', 'text-xs', 'p-0'],\n },\n {\n variant: 'link',\n size: 'medium',\n class: ['h-4', 'text-sm', 'p-0'],\n },\n {\n variant: 'link',\n size: 'large',\n class: ['h-6', 'text-base', 'p-0'],\n },\n ],\n }\n)\n","import { type ClassValue, clsx } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,IAAAA,gBAAyD;AACzD,4BAAqB;;;ACHrB,wBAAqB;AACrB,iBAAuC;AACvC,mBAAkC;;;ACFlC,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ADyCM;AALC,IAAM,aAAS;AAAA,EACpB,CAAC,EAAE,WAAW,SAAS,MAAM,UAAU,OAAO,OAAO,UAAU,GAAG,MAAM,GAAG,QAAQ;AACjF,UAAM,YAAY,UAAU,yBAAO;AAEnC,WACE;AAAA,MAAC;AAAA;AAAA,QACC,WAAW,GAAG,eAAe,EAAE,SAAS,MAAM,UAAU,CAAC,CAAC;AAAA,QAC1D;AAAA,QACA;AAAA,QACC,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AACA,OAAO,cAAc;AAMd,IAAM,qBAAiB;AAAA,EAC5B;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,UACP;AAAA,UACA;AA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,GAAG;AAE5C,+BAAU,MAAM;AACd,UAAM,iBAAiB,MAAM;AAC3B,YAAM,cAAc,OAAO;AAC3B,UAAI,eAAe,KAAK;AACtB,oBAAY,EAAE;AAAA,MAChB,OAAO;AACL,oBAAY,GAAG;AAAA,MACjB;AAAA,IACF;AAEA,mBAAe;AACf,WAAO,iBAAiB,UAAU,cAAc;AAEhD,WAAO,MAAM,OAAO,oBAAoB,UAAU,cAAc;AAAA,EAClE,GAAG,CAAC,CAAC;AAEL,WAAS,mBAAmBC,OAAcC,WAAkBC,aAA6B;AACvF,UAAM,QAAQF,MAAK,MAAM,GAAG;AAE5B,UAAMG,WAAUD,cAAaF,QAAO,MAAM,MAAM,GAAGC,SAAQ,EAAE,KAAK,GAAG;AACrE,UAAM,eAAeC,cAAa,KAAK;AACvC,WAAO,GAAGC,QAAO,IAAI,YAAY;AAAA,EACnC;AAEA,QAAM,aAAa,MAAM,cAAc,CAAC,UAAU;AAElD,QAAM,UAAU,mBAAmB,MAAM,UAAU,UAAU;AAE7D,SACE,8CAAC,SAAK,GAAG,OACP;AAAA,iDAAC,SAAI,eAAY,kBAAiB,WAAU,qBAC1C,uDAAC,sBAAAC,SAAA,EAAU,mBAAQ,GACrB;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,WAAU;AAAA,QACV,SAAQ;AAAA,QACR,SAAS;AAAA,QAET,wDAAC,OAAE,WAAU,kDAAiD;AAAA;AAAA,UACtD,aAAa,SAAS;AAAA,WAC9B;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;","names":["import_react","import_jsx_runtime","text","maxWords","isExpanded","snippet","Markdown"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ui/ReadMore.tsx","../../../src/components/ui/Button.tsx","../../../src/lib/utils.ts"],"sourcesContent":["'use client'\n\nimport { type ComponentProps, useEffect, useState } from 'react'\nimport Markdown from 'react-markdown'\n\nimport { Button } from '@/components/ui/Button'\n\nexport type ReadMoreProps = ComponentProps<'div'> & {\n text: string\n}\n\nexport function ReadMore({ text, ...props }: Readonly<ReadMoreProps>) {\n const [isExpanded, setIsExpanded] = useState(false)\n const [maxWords, setMaxWords] = useState(160)\n\n useEffect(() => {\n const updateMaxWords = () => {\n const windowWidth = window.innerWidth\n if (windowWidth <= 768) {\n setMaxWords(50)\n } else {\n setMaxWords(160)\n }\n }\n\n updateMaxWords()\n window.addEventListener('resize', updateMaxWords)\n\n return () => window.removeEventListener('resize', updateMaxWords)\n }, [])\n\n function createReadMoreText(text: string, maxWords: number, isExpanded: boolean): string {\n const words = text.split(' ')\n\n const snippet = isExpanded ? text : words.slice(0, maxWords).join(' ')\n const readMoreText = isExpanded ? '' : '...'\n return `${snippet} ${readMoreText}`\n }\n\n const toggleText = () => setIsExpanded(!isExpanded)\n\n const snippet = createReadMoreText(text, maxWords, isExpanded)\n\n return (\n <div {...props}>\n <div data-testid=\"read-more-text\" className=\"prose lg:prose-lg\">\n <Markdown>{snippet}</Markdown>\n </div>\n <Button\n type=\"button\"\n className=\"mt-2 flex items-center justify-center\"\n variant=\"link\"\n onClick={toggleText}\n >\n <p className=\"text-sm font-bold underline underline-offset-2\">\n Read {isExpanded ? 'less' : 'more'}\n </p>\n </Button>\n </div>\n )\n}\n","import { Slot } from '@radix-ui/react-slot'\nimport { cva, type VariantProps } from 'cva'\nimport React, { forwardRef } from 'react'\n\nimport { cn } from '@/lib/utils'\n\n/**\n * Props for the Button component.\n * @interface ButtonProps\n * @extends {React.ButtonHTMLAttributes<HTMLButtonElement>}\n * @extends {VariantProps<typeof buttonVariants>}\n */\ninterface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n /**\n * When true, the component will render its children directly without wrapping them in a button element.\n * Useful when you want to use the button styles on a different element.\n * @default false\n */\n asChild?: boolean\n}\n\n/**\n * A versatile button component that supports multiple variants and sizes.\n *\n * @component\n * @example\n * ```tsx\n * // Default button\n * <Button>Click me</Button>\n *\n * // Primary variant with large size\n * <Button variant=\"primary\" size=\"lg\">Large Button</Button>\n *\n * // As a link\n * <Button asChild>\n * <a href=\"/somewhere\">Go somewhere</a>\n * </Button>\n * ```\n */\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, type = 'button', ...props }, ref) => {\n const Component = asChild ? Slot : 'button'\n\n return (\n <Component\n className={cn(buttonVariants({ variant, size, className }))}\n type={type}\n ref={ref}\n {...props}\n />\n )\n }\n)\nButton.displayName = 'Button'\n\n/**\n * Variant definitions for the Button component using class-variance-authority.\n * Provides consistent styling across different button variations.\n */\
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ui/ReadMore.tsx","../../../src/components/ui/Button.tsx","../../../src/lib/utils.ts"],"sourcesContent":["'use client'\n\nimport { type ComponentProps, useEffect, useState } from 'react'\nimport Markdown from 'react-markdown'\n\nimport { Button } from '@/components/ui/Button'\n\nexport type ReadMoreProps = ComponentProps<'div'> & {\n text: string\n}\n\nexport function ReadMore({ text, ...props }: Readonly<ReadMoreProps>) {\n const [isExpanded, setIsExpanded] = useState(false)\n const [maxWords, setMaxWords] = useState(160)\n\n useEffect(() => {\n const updateMaxWords = () => {\n const windowWidth = window.innerWidth\n if (windowWidth <= 768) {\n setMaxWords(50)\n } else {\n setMaxWords(160)\n }\n }\n\n updateMaxWords()\n window.addEventListener('resize', updateMaxWords)\n\n return () => window.removeEventListener('resize', updateMaxWords)\n }, [])\n\n function createReadMoreText(text: string, maxWords: number, isExpanded: boolean): string {\n const words = text.split(' ')\n\n const snippet = isExpanded ? text : words.slice(0, maxWords).join(' ')\n const readMoreText = isExpanded ? '' : '...'\n return `${snippet} ${readMoreText}`\n }\n\n const toggleText = () => setIsExpanded(!isExpanded)\n\n const snippet = createReadMoreText(text, maxWords, isExpanded)\n\n return (\n <div {...props}>\n <div data-testid=\"read-more-text\" className=\"prose lg:prose-lg\">\n <Markdown>{snippet}</Markdown>\n </div>\n <Button\n type=\"button\"\n className=\"mt-2 flex items-center justify-center\"\n variant=\"link\"\n onClick={toggleText}\n >\n <p className=\"text-sm font-bold underline underline-offset-2\">\n Read {isExpanded ? 'less' : 'more'}\n </p>\n </Button>\n </div>\n )\n}\n","import { Slot } from '@radix-ui/react-slot'\nimport { cva, type VariantProps } from 'cva'\nimport React, { forwardRef } from 'react'\n\nimport { cn } from '@/lib/utils'\n\n/**\n * Props for the Button component.\n * @interface ButtonProps\n * @extends {React.ButtonHTMLAttributes<HTMLButtonElement>}\n * @extends {VariantProps<typeof buttonVariants>}\n */\ninterface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n /**\n * When true, the component will render its children directly without wrapping them in a button element.\n * Useful when you want to use the button styles on a different element.\n * @default false\n */\n asChild?: boolean\n}\n\n/**\n * A versatile button component that supports multiple variants and sizes.\n *\n * @component\n * @example\n * ```tsx\n * // Default button\n * <Button>Click me</Button>\n *\n * // Primary variant with large size\n * <Button variant=\"primary\" size=\"lg\">Large Button</Button>\n *\n * // As a link\n * <Button asChild>\n * <a href=\"/somewhere\">Go somewhere</a>\n * </Button>\n * ```\n */\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, type = 'button', ...props }, ref) => {\n const Component = asChild ? Slot : 'button'\n\n return (\n <Component\n className={cn(buttonVariants({ variant, size, className }))}\n type={type}\n ref={ref}\n {...props}\n />\n )\n }\n)\nButton.displayName = 'Button'\n\n/**\n * Variant definitions for the Button component using class-variance-authority.\n * Provides consistent styling across different button variations.\n */\nexport const buttonVariants = cva(\n [\n 'flex',\n 'items-center',\n 'justify-center',\n 'gap-2',\n 'rounded-full',\n 'font-bold',\n 'outline-2',\n 'outline-offset-2',\n 'outline-dashed',\n 'outline-transparent',\n ],\n {\n variants: {\n variant: {\n neutral: [\n 'bg-black',\n 'text-white',\n 'hover:bg-grey-90',\n 'active:bg-grey-80',\n 'focus:outline-purple-100',\n 'disabled:text-grey-40',\n 'disabled:bg-grey-10',\n ],\n primary: [\n 'bg-pickle-100',\n 'text-black',\n 'hover:bg-pickle-80',\n 'active:bg-pickle-60',\n 'focus:outline-purple-100',\n 'disabled:text-grey-40',\n 'disabled:bg-grey-10',\n ],\n secondary: [\n 'bg-green-80',\n 'text-white',\n 'hover:bg-green-90',\n 'active:bg-green-100',\n 'focus:outline-pickle-100',\n 'disabled:text-grey-40',\n 'disabled:bg-grey-10',\n ],\n transparent: [\n 'text-white',\n 'hover:bg-green-80',\n 'active:bg-green-100',\n 'focus:outline-pickle-100',\n 'disabled:text-grey-40',\n ],\n link: [\n 'leading-tight',\n 'text-black',\n 'underline',\n 'hover:text-purple-100',\n 'focus:text-black',\n 'focus:outline-purple-100',\n 'active:text-purple-80',\n ],\n },\n size: {\n small: ['h-10', 'text-sm', 'px-4', 'py-2'],\n medium: ['h-12', 'text-base', 'px-6', 'py-3'],\n large: ['h-14', 'text-lg', 'px-8', 'py-4'],\n },\n },\n defaultVariants: {\n variant: 'neutral',\n size: 'medium',\n },\n compoundVariants: [\n {\n variant: 'link',\n size: 'small',\n class: ['h-3', 'text-xs', 'p-0'],\n },\n {\n variant: 'link',\n size: 'medium',\n class: ['h-4', 'text-sm', 'p-0'],\n },\n {\n variant: 'link',\n size: 'large',\n class: ['h-6', 'text-base', 'p-0'],\n },\n ],\n }\n)\n","import { type ClassValue, clsx } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n"],"mappings":";;;AAEA,SAA8B,WAAW,gBAAgB;AACzD,OAAO,cAAc;;;ACHrB,SAAS,YAAY;AACrB,SAAS,WAA8B;AACvC,SAAgB,kBAAkB;;;ACFlC,SAA0B,YAAY;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ADyCM;AALC,IAAM,SAAS;AAAA,EACpB,CAAC,EAA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iB,WAAU,qBAC1C,0BAAAA,KAAC,YAAU,mBAAQ,GACrB;AAAA,IACA,gBAAAA;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,WAAU;AAAA,QACV,SAAQ;AAAA,QACR,SAAS;AAAA,QAET,+BAAC,OAAE,WAAU,kDAAiD;AAAA;AAAA,UACtD,aAAa,SAAS;AAAA,WAC9B;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;","names":["jsx","text","maxWords","isExpanded","snippet"]}
|
|
@@ -3,7 +3,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
|
|
5
5
|
declare const buttonVariants: (props?: ({
|
|
6
|
-
variant?: "
|
|
6
|
+
variant?: "link" | "default" | "outline" | "secondary" | "destructive" | "ghost" | null | undefined;
|
|
7
7
|
size?: "default" | "icon" | "sm" | "lg" | null | undefined;
|
|
8
8
|
} & cva_types.ClassProp) | undefined) => string;
|
|
9
9
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
@@ -3,7 +3,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
|
|
5
5
|
declare const buttonVariants: (props?: ({
|
|
6
|
-
variant?: "
|
|
6
|
+
variant?: "link" | "default" | "outline" | "secondary" | "destructive" | "ghost" | null | undefined;
|
|
7
7
|
size?: "default" | "icon" | "sm" | "lg" | null | undefined;
|
|
8
8
|
} & cva_types.ClassProp) | undefined) => string;
|
|
9
9
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as zod from 'zod';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { E as EmploymentTypeEnum, a as EmploymentLevelEnum, b as JobFunctionEnum, B as BestFitEnum, C as ClinicalSpecialtyEnum, S as ShiftEnum, c as ClinicalSettingEnum } from './job_posting_service_latest-
|
|
3
|
+
import { E as EmploymentTypeEnum, a as EmploymentLevelEnum, b as JobFunctionEnum, B as BestFitEnum, C as ClinicalSpecialtyEnum, S as ShiftEnum, c as ClinicalSettingEnum } from './job_posting_service_latest-duSSyFvo.cjs';
|
|
4
4
|
import { U as UnitTextEnum, C as CurrencyEnum } from './shared_pickle_output_latest-DKOmTyYk.cjs';
|
|
5
5
|
|
|
6
6
|
declare const employmentTypeDisplayText: DisplayTextConfig<typeof EmploymentTypeEnum>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as zod from 'zod';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { E as EmploymentTypeEnum, a as EmploymentLevelEnum, b as JobFunctionEnum, B as BestFitEnum, C as ClinicalSpecialtyEnum, S as ShiftEnum, c as ClinicalSettingEnum } from './job_posting_service_latest-
|
|
3
|
+
import { E as EmploymentTypeEnum, a as EmploymentLevelEnum, b as JobFunctionEnum, B as BestFitEnum, C as ClinicalSpecialtyEnum, S as ShiftEnum, c as ClinicalSettingEnum } from './job_posting_service_latest-duSSyFvo.js';
|
|
4
4
|
import { U as UnitTextEnum, C as CurrencyEnum } from './shared_pickle_output_latest-DKOmTyYk.js';
|
|
5
5
|
|
|
6
6
|
declare const employmentTypeDisplayText: DisplayTextConfig<typeof EmploymentTypeEnum>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as ServiceMappings } from '../displayText-
|
|
1
|
+
import { S as ServiceMappings } from '../displayText-BIzvCN9H.cjs';
|
|
2
2
|
import 'zod';
|
|
3
|
-
import '../job_posting_service_latest-
|
|
3
|
+
import '../job_posting_service_latest-duSSyFvo.cjs';
|
|
4
4
|
import '../shared_pickle_output_latest-DKOmTyYk.cjs';
|
|
5
5
|
|
|
6
6
|
declare const useDisplayText: (scope: keyof ServiceMappings, value: string | string[] | undefined | null) => string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as ServiceMappings } from '../displayText-
|
|
1
|
+
import { S as ServiceMappings } from '../displayText-BtujjCCA.js';
|
|
2
2
|
import 'zod';
|
|
3
|
-
import '../job_posting_service_latest-
|
|
3
|
+
import '../job_posting_service_latest-duSSyFvo.js';
|
|
4
4
|
import '../shared_pickle_output_latest-DKOmTyYk.js';
|
|
5
5
|
|
|
6
6
|
declare const useDisplayText: (scope: keyof ServiceMappings, value: string | string[] | undefined | null) => string;
|
package/dist/index.cjs
CHANGED
|
@@ -1175,6 +1175,7 @@ var Combobox = (0, import_react6.forwardRef)((props, ref) => {
|
|
|
1175
1175
|
classNames,
|
|
1176
1176
|
multiselect,
|
|
1177
1177
|
placeholder,
|
|
1178
|
+
error,
|
|
1178
1179
|
variant = "default",
|
|
1179
1180
|
size,
|
|
1180
1181
|
icon,
|
|
@@ -1325,7 +1326,8 @@ var Combobox = (0, import_react6.forwardRef)((props, ref) => {
|
|
|
1325
1326
|
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react10.CircleX, { className: "h-4 w-4 text-green-100" })
|
|
1326
1327
|
}
|
|
1327
1328
|
)
|
|
1328
|
-
] })
|
|
1329
|
+
] }),
|
|
1330
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ErrorMessage_default, { message: error })
|
|
1329
1331
|
] });
|
|
1330
1332
|
});
|
|
1331
1333
|
Combobox.displayName = "Combobox";
|
|
@@ -1748,7 +1750,14 @@ var InputOtp = (0, import_react12.forwardRef)(
|
|
|
1748
1750
|
maxLength: digits,
|
|
1749
1751
|
"data-testid": `input-otp-element-${props.id}`,
|
|
1750
1752
|
...props,
|
|
1751
|
-
children: [...Array(digits)].map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(InputOTPGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1753
|
+
children: [...Array(digits)].map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(InputOTPGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1754
|
+
InputOTPSlot,
|
|
1755
|
+
{
|
|
1756
|
+
"data-testid": `input-otp-slot-${index}`,
|
|
1757
|
+
index,
|
|
1758
|
+
error: Boolean(error)
|
|
1759
|
+
}
|
|
1760
|
+
) }, index))
|
|
1752
1761
|
}
|
|
1753
1762
|
) }),
|
|
1754
1763
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ErrorMessage_default, { message: error })
|
|
@@ -2136,7 +2145,7 @@ var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
|
2136
2145
|
function BackButton({ acceptedRoutes, fallbackHref, className, ...props }) {
|
|
2137
2146
|
const { history } = useWindowHistory();
|
|
2138
2147
|
const router = (0, import_navigation2.useRouter)();
|
|
2139
|
-
const isAcceptedRoute = (r) => !!acceptedRoutes?.find((route) => new RegExp("^" + route + "$", "i").test(r));
|
|
2148
|
+
const isAcceptedRoute = (r) => !!acceptedRoutes?.find((route) => new RegExp("^" + route + "$", "i").test(new URL(r).pathname));
|
|
2140
2149
|
const goBack = () => {
|
|
2141
2150
|
const previous = history[history.length - 2];
|
|
2142
2151
|
if (history.length > 1 && isAcceptedRoute(previous)) {
|
|
@@ -2925,6 +2934,7 @@ function JobPost({
|
|
|
2925
2934
|
standalone,
|
|
2926
2935
|
avatarHref,
|
|
2927
2936
|
fallbackHref,
|
|
2937
|
+
backAcceptedRoutes,
|
|
2928
2938
|
actions
|
|
2929
2939
|
}) {
|
|
2930
2940
|
const formattedEmploymentType = useDisplayText("employmentType", job.employmentType);
|
|
@@ -2982,6 +2992,7 @@ function JobPost({
|
|
|
2982
2992
|
standalone,
|
|
2983
2993
|
avatarHref,
|
|
2984
2994
|
backFallbackHref: fallbackHref,
|
|
2995
|
+
backAcceptedRoutes,
|
|
2985
2996
|
tags
|
|
2986
2997
|
}
|
|
2987
2998
|
),
|