@next-degree/pickle-shared-js 0.6.46 → 0.6.48
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/components/buttons/BackButton.cjs +0 -3
- package/dist/components/buttons/BackButton.cjs.map +1 -1
- package/dist/components/buttons/BackButton.js +0 -3
- package/dist/components/buttons/BackButton.js.map +1 -1
- package/dist/components/company/CompanyTake.cjs.map +1 -1
- package/dist/components/company/CompanyTake.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 +0 -3
- package/dist/components/jobPost/JobHeader.cjs.map +1 -1
- package/dist/components/jobPost/JobHeader.js +0 -3
- package/dist/components/jobPost/JobHeader.js.map +1 -1
- package/dist/components/jobPost/JobPost.cjs +0 -3
- package/dist/components/jobPost/JobPost.cjs.map +1 -1
- package/dist/components/jobPost/JobPost.d.cts +1 -1
- package/dist/components/jobPost/JobPost.d.ts +1 -1
- package/dist/components/jobPost/JobPost.js +0 -3
- package/dist/components/jobPost/JobPost.js.map +1 -1
- package/dist/components/primitives/avatar.cjs.map +1 -1
- package/dist/components/primitives/avatar.js.map +1 -1
- package/dist/components/primitives/command.cjs.map +1 -1
- package/dist/components/primitives/command.d.cts +3 -3
- package/dist/components/primitives/command.d.ts +3 -3
- package/dist/components/primitives/command.js.map +1 -1
- package/dist/components/primitives/dialog.cjs.map +1 -1
- package/dist/components/primitives/dialog.js.map +1 -1
- package/dist/components/primitives/input-otp.cjs +99 -0
- package/dist/components/primitives/input-otp.cjs.map +1 -0
- package/dist/components/primitives/input-otp.d.cts +38 -0
- package/dist/components/primitives/input-otp.d.ts +38 -0
- package/dist/components/primitives/input-otp.js +62 -0
- package/dist/components/primitives/input-otp.js.map +1 -0
- package/dist/components/primitives/popover.cjs.map +1 -1
- package/dist/components/primitives/popover.js.map +1 -1
- package/dist/components/primitives/separator.cjs.map +1 -1
- package/dist/components/primitives/separator.js.map +1 -1
- package/dist/components/primitives/tooltip.cjs.map +1 -1
- package/dist/components/primitives/tooltip.js.map +1 -1
- package/dist/components/ui/Avatar.cjs.map +1 -1
- package/dist/components/ui/Avatar.js.map +1 -1
- package/dist/components/ui/Badge.cjs.map +1 -1
- package/dist/components/ui/Badge.js.map +1 -1
- package/dist/components/ui/Button.cjs.map +1 -1
- package/dist/components/ui/Button.js.map +1 -1
- package/dist/components/ui/Checkbox.cjs.map +1 -1
- package/dist/components/ui/Checkbox.js.map +1 -1
- package/dist/components/ui/Combobox.cjs.map +1 -1
- package/dist/components/ui/Combobox.js.map +1 -1
- package/dist/components/ui/Counter.cjs.map +1 -1
- package/dist/components/ui/Counter.js.map +1 -1
- package/dist/components/ui/ErrorMessage.cjs.map +1 -1
- package/dist/components/ui/ErrorMessage.js.map +1 -1
- package/dist/components/ui/Icon.cjs.map +1 -1
- package/dist/components/ui/Icon.js.map +1 -1
- package/dist/components/ui/Input.cjs.map +1 -1
- package/dist/components/ui/Input.js.map +1 -1
- package/dist/components/ui/InputOtp.cjs +187 -0
- package/dist/components/ui/InputOtp.cjs.map +1 -0
- package/dist/components/ui/InputOtp.d.cts +14 -0
- package/dist/components/ui/InputOtp.d.ts +14 -0
- package/dist/components/ui/InputOtp.js +152 -0
- package/dist/components/ui/InputOtp.js.map +1 -0
- package/dist/components/ui/Label.cjs.map +1 -1
- package/dist/components/ui/Label.js.map +1 -1
- package/dist/components/ui/ListItem.cjs.map +1 -1
- package/dist/components/ui/ListItem.js.map +1 -1
- package/dist/components/ui/MapComponent.cjs.map +1 -1
- package/dist/components/ui/MapComponent.js.map +1 -1
- package/dist/components/ui/PlacesQueryInput.cjs.map +1 -1
- package/dist/components/ui/PlacesQueryInput.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/Select.cjs.map +1 -1
- package/dist/components/ui/Select.js.map +1 -1
- package/dist/{displayText-D8JK59Z-.d.ts → displayText-DDf9iWyg.d.ts} +2 -2
- package/dist/{displayText-DT2bYICS.d.cts → displayText-mYUVo6Ek.d.cts} +2 -2
- package/dist/hooks/useDisplayText.d.cts +3 -3
- package/dist/hooks/useDisplayText.d.ts +3 -3
- package/dist/hooks/useWindowHistory.cjs +0 -3
- package/dist/hooks/useWindowHistory.cjs.map +1 -1
- package/dist/hooks/useWindowHistory.js +0 -3
- package/dist/hooks/useWindowHistory.js.map +1 -1
- package/dist/index.cjs +207 -123
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +171 -88
- package/dist/index.js.map +1 -1
- package/dist/{job_posting_service_latest-RgzWsEdh.d.cts → job_posting_service_latest-Dn5s8beY.d.cts} +183 -183
- package/dist/{job_posting_service_latest-RgzWsEdh.d.ts → job_posting_service_latest-Dn5s8beY.d.ts} +183 -183
- package/dist/lib/locations.d.cts +2 -2
- package/dist/lib/locations.d.ts +2 -2
- package/dist/lib/mappings.d.cts +3 -3
- package/dist/lib/mappings.d.ts +3 -3
- package/dist/lib/salaryRange.d.cts +1 -1
- package/dist/lib/salaryRange.d.ts +1 -1
- package/dist/lib/utils.cjs.map +1 -1
- package/dist/lib/utils.js.map +1 -1
- package/dist/services/displayText.d.cts +3 -3
- package/dist/services/displayText.d.ts +3 -3
- package/dist/styles/globals.css +109 -37
- package/dist/styles/globals.css.map +1 -1
- package/dist/types/data/company_service_latest.d.cts +1 -1
- package/dist/types/data/company_service_latest.d.ts +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/data/shared_pickle_output_latest.d.cts +1 -1
- package/dist/types/data/shared_pickle_output_latest.d.ts +1 -1
- package/package.json +6 -4
- package/dist/{company_service_latest-B7KhyYDc.d.cts → company_service_latest-DelYl1hO.d.cts} +174 -174
- package/dist/{company_service_latest-B7KhyYDc.d.ts → company_service_latest-DelYl1hO.d.ts} +174 -174
- package/dist/{shared_pickle_output_latest-D8viuRLi.d.cts → shared_pickle_output_latest-DbAgINuf.d.cts} +15 -15
- package/dist/{shared_pickle_output_latest-D8viuRLi.d.ts → shared_pickle_output_latest-DbAgINuf.d.ts} +15 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ui/Counter.tsx","../../../src/lib/utils.ts","../../../src/components/ui/ErrorMessage.tsx","../../../src/components/primitives/tooltip.tsx","../../../src/components/ui/Label.tsx"],"sourcesContent":["'use client'\n\nimport { cva, type VariantProps } from 'cva'\nimport { Minus, Plus } from 'lucide-react'\nimport { ChangeEvent, forwardRef, useEffect, useState, type InputHTMLAttributes } from 'react'\n\nimport ErrorMessage from '@/components/ui/ErrorMessage'\nimport Label from '@/components/ui/Label'\nimport { cn } from '@/lib/utils'\n\ntype InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'>\ntype CounterVariants = VariantProps<typeof counterVariants>\ntype Props = InputProps &\n CounterVariants & {\n label?: string\n value?: number\n error?: string\n min?: number\n max?: number\n step?: number\n description?: string\n classNames?: { root?: string; input?: string; label?: string }\n onChange?: (n: number) => void\n }\n\nexport const Counter = forwardRef<HTMLInputElement, Props>(\n (\n { label, error, min, max, step = 1, description, theme, value, classNames, onChange, ...props },\n ref\n ) => {\n const [count, setCount] = useState(0)\n\n useEffect(() => {\n setCount(value ?? 0)\n }, [value])\n\n const handleChange = (e: ChangeEvent<HTMLInputElement>) => {\n const newValue = parseInt(e.target.value.replace(/\\D/g, ''), 10)\n if (isNaN(newValue)) return\n if (min && newValue < min) {\n onChange?.(min)\n setCount(min)\n return\n }\n if (max && newValue > max) {\n onChange?.(max)\n setCount(max)\n return\n }\n onChange?.(newValue)\n setCount(newValue)\n }\n\n const decrement = () => {\n const proposedValue = count - step\n const newValue = Math.max(min ?? -Infinity, proposedValue)\n onChange?.(newValue)\n setCount(newValue)\n }\n\n const increment = () => {\n const proposedValue = count + step\n const newValue = Math.min(max ?? Infinity, proposedValue)\n onChange?.(newValue)\n setCount(newValue)\n }\n\n return (\n <div\n className={cn('flex w-auto flex-col gap-1', classNames?.root)}\n data-testid={`counter-wrapper-${props.id}`}\n >\n {label && (\n <Label\n text={label}\n htmlFor={props.name}\n required={props.required}\n description={description}\n className={classNames?.label}\n />\n )}\n\n <div className=\"relative flex w-[122px] flex-row items-center\">\n <button\n type=\"button\"\n className=\"absolute inset-y-0 left-1 my-auto flex h-8 w-8 cursor-pointer items-center justify-center rounded-full hover:bg-pickle-20\"\n onClick={decrement}\n >\n <Minus className=\"h-4 w-4 text-green-100\" />\n </button>\n\n <input\n className={cn(counterVariants({ theme }), classNames?.input)}\n ref={ref}\n value={count}\n onChange={handleChange}\n data-testid={`counter-element-${props.id}`}\n {...props}\n />\n\n <button\n type=\"button\"\n className=\"absolute inset-y-0 right-1 my-auto flex h-8 w-8 cursor-pointer items-center justify-center rounded-full hover:bg-pickle-20\"\n onClick={increment}\n >\n <Plus className=\"h-4 w-4 text-green-100\" />\n </button>\n </div>\n\n <ErrorMessage message={error} />\n </div>\n )\n }\n)\nCounter.displayName = 'Counter'\n\nconst counterVariants = cva(\n [\n 'border-input',\n 'placeholder:text-muted-foreground',\n 'focus-visible:ring-ring',\n 'inline-flex',\n 'w-[122px]',\n 'h-11',\n 'items-center',\n 'justify-start',\n 'gap-3',\n 'rounded-lg',\n 'bg-transparent',\n 'px-3',\n 'pt-0.5',\n 'text-sm',\n 'text-center',\n 'shadow-sm',\n 'ring-grey-50',\n 'transition-colors',\n 'focus-visible:outline-none',\n 'focus-visible:ring-1',\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-50',\n 'appearance-none',\n '[&::-webkit-search-cancel-button]:appearance-none',\n '[&::-webkit-search-decoration]:appearance-none',\n '[&::-webkit-search-results-button]:appearance-none',\n '[&::-webkit-search-results-decoration]:appearance-none',\n '[&::-ms-clear]:display-none',\n '[&::-ms-reveal]:display-none',\n ],\n {\n variants: {\n theme: {\n light: 'text-grey-80 border',\n dark: 'text-white',\n },\n hasIcon: {\n false: 'pl-3',\n true: 'pl-8',\n },\n },\n defaultVariants: {\n theme: 'light',\n hasIcon: false,\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","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","'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","import { type ComponentPropsWithoutRef } from 'react'\n\nimport { cn } from '@/lib/utils'\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from '@/components/primitives/tooltip'\nimport { InfoIcon } from 'lucide-react'\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"],"mappings":";;;AAEA,SAAS,WAA8B;AACvC,SAAS,OAAO,YAAY;AAC5B,SAAsB,cAAAA,aAAY,WAAW,gBAA0C;;;ACJvF,SAA0B,YAAY;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ACOI;AAJJ,SAAS,aAAa,EAAE,SAAS,WAAW,GAAG,MAAM,GAAoB;AACvE,MAAI,CAAC,QAAS,QAAO;AAErB,SACE,oBAAC,OAAE,WAAW,GAAG,6BAA6B,SAAS,GAAI,GAAG,OAC3D,mBACH;AAEJ;AAEA,IAAO,uBAAQ;;;AChBf,YAAY,sBAAsB;AAClC,YAAY,WAAW;AAcrB,gBAAAC,YAAA;AAVF,IAAM,kBAAmC;AAEzC,IAAM,UAA2B;AAEjC,IAAM,iBAAkC;AAExC,IAAM,iBAAuB,iBAG3B,CAAC,EAAE,WAAW,aAAa,GAAG,GAAG,MAAM,GAAG,QAC1C,gBA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A,gBAAAA;AAAA,cAAC;AAAA;AAAA,gBACC,MAAK;AAAA,gBACL,WAAU;AAAA,gBACV,SAAS;AAAA,gBAET,0BAAAA,KAAC,QAAK,WAAU,0BAAyB;AAAA;AAAA,YAC3C;AAAA,aACF;AAAA,UAEA,gBAAAA,KAAC,wBAAa,SAAS,OAAO;AAAA;AAAA;AAAA,IAChC;AAAA,EAEJ;AACF;AACA,QAAQ,cAAc;AAEtB,IAAM,kBAAkB;AAAA,EACtB;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;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,OAAO;AAAA,QACL,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,MACA,SAAS;AAAA,QACP,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,OAAO;AAAA,MACP,SAAS;AAAA,IACX;AAAA,EACF;AACF;","names":["forwardRef","jsx","jsx","jsx","jsxs","forwardRef"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ui/Counter.tsx","../../../src/lib/utils.ts","../../../src/components/ui/ErrorMessage.tsx","../../../src/components/primitives/tooltip.tsx","../../../src/components/ui/Label.tsx"],"sourcesContent":["'use client'\n\nimport { cva, type VariantProps } from 'cva'\nimport { Minus, Plus } from 'lucide-react'\nimport { ChangeEvent, forwardRef, useEffect, useState, type InputHTMLAttributes } from 'react'\n\nimport ErrorMessage from '@/components/ui/ErrorMessage'\nimport Label from '@/components/ui/Label'\nimport { cn } from '@/lib/utils'\n\ntype InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'>\ntype CounterVariants = VariantProps<typeof counterVariants>\ntype Props = InputProps &\n CounterVariants & {\n label?: string\n value?: number\n error?: string\n min?: number\n max?: number\n step?: number\n description?: string\n classNames?: { root?: string; input?: string; label?: string }\n onChange?: (n: number) => void\n }\n\nexport const Counter = forwardRef<HTMLInputElement, Props>(\n (\n { label, error, min, max, step = 1, description, theme, value, classNames, onChange, ...props },\n ref\n ) => {\n const [count, setCount] = useState(0)\n\n useEffect(() => {\n setCount(value ?? 0)\n }, [value])\n\n const handleChange = (e: ChangeEvent<HTMLInputElement>) => {\n const newValue = parseInt(e.target.value.replace(/\\D/g, ''), 10)\n if (isNaN(newValue)) return\n if (min && newValue < min) {\n onChange?.(min)\n setCount(min)\n return\n }\n if (max && newValue > max) {\n onChange?.(max)\n setCount(max)\n return\n }\n onChange?.(newValue)\n setCount(newValue)\n }\n\n const decrement = () => {\n const proposedValue = count - step\n const newValue = Math.max(min ?? -Infinity, proposedValue)\n onChange?.(newValue)\n setCount(newValue)\n }\n\n const increment = () => {\n const proposedValue = count + step\n const newValue = Math.min(max ?? Infinity, proposedValue)\n onChange?.(newValue)\n setCount(newValue)\n }\n\n return (\n <div\n className={cn('flex w-auto flex-col gap-1', classNames?.root)}\n data-testid={`counter-wrapper-${props.id}`}\n >\n {label && (\n <Label\n text={label}\n htmlFor={props.name}\n required={props.required}\n description={description}\n className={classNames?.label}\n />\n )}\n\n <div className=\"relative flex w-[122px] flex-row items-center\">\n <button\n type=\"button\"\n className=\"absolute inset-y-0 left-1 my-auto flex h-8 w-8 cursor-pointer items-center justify-center rounded-full hover:bg-pickle-20\"\n onClick={decrement}\n >\n <Minus className=\"h-4 w-4 text-green-100\" />\n </button>\n\n <input\n className={cn(counterVariants({ theme }), classNames?.input)}\n ref={ref}\n value={count}\n onChange={handleChange}\n data-testid={`counter-element-${props.id}`}\n {...props}\n />\n\n <button\n type=\"button\"\n className=\"absolute inset-y-0 right-1 my-auto flex h-8 w-8 cursor-pointer items-center justify-center rounded-full hover:bg-pickle-20\"\n onClick={increment}\n >\n <Plus className=\"h-4 w-4 text-green-100\" />\n </button>\n </div>\n\n <ErrorMessage message={error} />\n </div>\n )\n }\n)\nCounter.displayName = 'Counter'\n\nconst counterVariants = cva(\n [\n 'border-input',\n 'placeholder:text-muted-foreground',\n 'focus-visible:ring-ring',\n 'inline-flex',\n 'w-[122px]',\n 'h-11',\n 'items-center',\n 'justify-start',\n 'gap-3',\n 'rounded-lg',\n 'bg-transparent',\n 'px-3',\n 'pt-0.5',\n 'text-sm',\n 'text-center',\n 'shadow-sm',\n 'ring-grey-50',\n 'transition-colors',\n 'focus-visible:outline-none',\n 'focus-visible:ring-1',\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-50',\n 'appearance-none',\n '[&::-webkit-search-cancel-button]:appearance-none',\n '[&::-webkit-search-decoration]:appearance-none',\n '[&::-webkit-search-results-button]:appearance-none',\n '[&::-webkit-search-results-decoration]:appearance-none',\n '[&::-ms-clear]:display-none',\n '[&::-ms-reveal]:display-none',\n ],\n {\n variants: {\n theme: {\n light: 'text-grey-80 border',\n dark: 'text-white',\n },\n hasIcon: {\n false: 'pl-3',\n true: 'pl-8',\n },\n },\n defaultVariants: {\n theme: 'light',\n hasIcon: false,\n },\n }\n)\n","import { clsx, type ClassValue } 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","'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","import { type ComponentPropsWithoutRef } from 'react'\n\nimport { cn } from '@/lib/utils'\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from '@/components/primitives/tooltip'\nimport { InfoIcon } from 'lucide-react'\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"],"mappings":";;;AAEA,SAAS,WAA8B;AACvC,SAAS,OAAO,YAAY;AAC5B,SAAsB,cAAAA,aAAY,WAAW,gBAA0C;;;ACJvF,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ACOI;AAJJ,SAAS,aAAa,EAAE,SAAS,WAAW,GAAG,MAAM,GAAoB;AACvE,MAAI,CAAC,QAAS,QAAO;AAErB,SACE,oBAAC,OAAE,WAAW,GAAG,6BAA6B,SAAS,GAAI,GAAG,OAC3D,mBACH;AAEJ;AAEA,IAAO,uBAAQ;;;AChBf,YAAY,sBAAsB;AAClC,YAAY,WAAW;AAcrB,gBAAAC,YAAA;AAVF,IAAM,kBAAmC;AAEzC,IAAM,UAA2B;AAEjC,IAAM,iBAAkC;AAExC,IAAM,iBAAuB,iBAG3B,CAAC,EAAE,WAAW,aAAa,GAAG,GAAG,MAAM,GAAG,QAC1C,gBAAAA;AAAA,EAAkB;AAAA,EAAjB;AAAA,IACC;AAAA,IACA;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,eAAe,cAA+B,yBAAQ;;;AClBtD,SAAS,gBAAgB;AAanB,SAQe,OAAAC,MARf;AALN,SAAS,MAAM,EAAE,MAAM,UAAU,aAAa,WAAW,GAAG,MAAM,GAAoB;AACpF,MAAI,CAAC,KAAM,QAAO;AAElB,SACE,qBAAC,SAAI,WAAU,8BACb;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,WAAW;AAAA,UACT;AAAA,UACA;AAAA,QACF;AAAA,QACC,GAAG;AAAA,QAEH;AAAA;AAAA,UACA,YAAY,gBAAAA,KAAC,UAAK,WAAU,gBAAe,mBAAO;AAAA;AA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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,OAAO;AAAA,QACL,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,MACA,SAAS;AAAA,QACP,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,OAAO;AAAA,MACP,SAAS;AAAA,IACX;AAAA,EACF;AACF;","names":["forwardRef","jsx","jsx","jsx","jsxs","forwardRef"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ui/ErrorMessage.tsx","../../../src/lib/utils.ts"],"sourcesContent":["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 { type ClassValue
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ui/ErrorMessage.tsx","../../../src/lib/utils.ts"],"sourcesContent":["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 { clsx, type ClassValue } 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;;;ACAA,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ADOI;AAJJ,SAAS,aAAa,EAAE,SAAS,WAAW,GAAG,MAAM,GAAoB;AACvE,MAAI,CAAC,QAAS,QAAO;AAErB,SACE,4CAAC,OAAE,WAAW,GAAG,6BAA6B,SAAS,GAAI,GAAG,OAC3D,mBACH;AAEJ;AAEA,IAAO,uBAAQ;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/utils.ts","../../../src/components/ui/ErrorMessage.tsx"],"sourcesContent":["import { type ClassValue
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/utils.ts","../../../src/components/ui/ErrorMessage.tsx"],"sourcesContent":["import { clsx, type ClassValue } 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"],"mappings":";AAAA,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ACOI;AAJJ,SAAS,aAAa,EAAE,SAAS,WAAW,GAAG,MAAM,GAAoB;AACvE,MAAI,CAAC,QAAS,QAAO;AAErB,SACE,oBAAC,OAAE,WAAW,GAAG,6BAA6B,SAAS,GAAI,GAAG,OAC3D,mBACH;AAEJ;AAEA,IAAO,uBAAQ;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ui/Icon.tsx","../../../src/lib/utils.ts"],"sourcesContent":["import { Slot } from '@radix-ui/react-slot'\nimport { cva, type VariantProps } from 'cva'\nimport { forwardRef } from 'react'\nimport { twMerge } from 'tailwind-merge'\n\nimport { cn } from '@/lib/utils'\n\ninterface IconProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof iconVariants> {\n active?: boolean\n readonly?: boolean\n}\n\nexport const Icon = forwardRef<HTMLButtonElement, IconProps>(\n ({ variant, size, active = false, readonly = false, className, ...props }, ref) => {\n const Component = readonly ? Slot : 'button'\n return (\n <Component\n className={cn(\n twMerge(iconVariants({ variant: active ? 'active' : variant, size })),\n className\n )}\n {...props}\n ref={ref}\n />\n )\n }\n)\n\nIcon.displayName = 'Icon'\n\nconst iconVariants = cva(\n [\n 'inline-flex',\n 'items-center',\n 'rounded-full',\n 'outline-2',\n 'outline-offset-2',\n 'outline-dashed',\n 'outline-transparent',\n 'disabled:text-grey-40',\n 'disabled:bg-transparent',\n 'disabled:pointer-events-none',\n ],\n {\n variants: {\n variant: {\n filled: [\n 'border',\n 'border-green-80',\n 'bg-green-90',\n 'text-white',\n 'hover:bg-green-80',\n 'active:bg-green-80',\n 'focus:outline-pickle-100',\n 'disabled:bg-green-70',\n ],\n transparent: [\n 'text-black',\n 'hover:bg-grey-5',\n 'active:bg-grey-10',\n 'focus:outline-purple-100',\n ],\n tonal: [\n 'border',\n 'border-grey-5',\n 'hover:border-grey-10',\n 'active:border-grey-20',\n 'focus:outline-purple-100',\n ],\n active: ['text-black', 'bg-pickle-100'],\n },\n size: {\n small: ['h-10', 'w-10', 'p-3'],\n medium: ['h-12', 'w-12', 'p-4'],\n large: ['h-14', 'w-14', 'p-4'],\n },\n },\n defaultVariants: {\n variant: 'filled',\n size: 'medium',\n },\n }\n)\n","import { type ClassValue
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ui/Icon.tsx","../../../src/lib/utils.ts"],"sourcesContent":["import { Slot } from '@radix-ui/react-slot'\nimport { cva, type VariantProps } from 'cva'\nimport { forwardRef } from 'react'\nimport { twMerge } from 'tailwind-merge'\n\nimport { cn } from '@/lib/utils'\n\ninterface IconProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof iconVariants> {\n active?: boolean\n readonly?: boolean\n}\n\nexport const Icon = forwardRef<HTMLButtonElement, IconProps>(\n ({ variant, size, active = false, readonly = false, className, ...props }, ref) => {\n const Component = readonly ? Slot : 'button'\n return (\n <Component\n className={cn(\n twMerge(iconVariants({ variant: active ? 'active' : variant, size })),\n className\n )}\n {...props}\n ref={ref}\n />\n )\n }\n)\n\nIcon.displayName = 'Icon'\n\nconst iconVariants = cva(\n [\n 'inline-flex',\n 'items-center',\n 'rounded-full',\n 'outline-2',\n 'outline-offset-2',\n 'outline-dashed',\n 'outline-transparent',\n 'disabled:text-grey-40',\n 'disabled:bg-transparent',\n 'disabled:pointer-events-none',\n ],\n {\n variants: {\n variant: {\n filled: [\n 'border',\n 'border-green-80',\n 'bg-green-90',\n 'text-white',\n 'hover:bg-green-80',\n 'active:bg-green-80',\n 'focus:outline-pickle-100',\n 'disabled:bg-green-70',\n ],\n transparent: [\n 'text-black',\n 'hover:bg-grey-5',\n 'active:bg-grey-10',\n 'focus:outline-purple-100',\n ],\n tonal: [\n 'border',\n 'border-grey-5',\n 'hover:border-grey-10',\n 'active:border-grey-20',\n 'focus:outline-purple-100',\n ],\n active: ['text-black', 'bg-pickle-100'],\n },\n size: {\n small: ['h-10', 'w-10', 'p-3'],\n medium: ['h-12', 'w-12', 'p-4'],\n large: ['h-14', 'w-14', 'p-4'],\n },\n },\n defaultVariants: {\n variant: 'filled',\n size: 'medium',\n },\n }\n)\n","import { clsx, type ClassValue } 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;AAAA,wBAAqB;AACrB,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iB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,IACR;AAAA,EACF;AACF;","names":["import_tailwind_merge"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ui/Icon.tsx","../../../src/lib/utils.ts"],"sourcesContent":["import { Slot } from '@radix-ui/react-slot'\nimport { cva, type VariantProps } from 'cva'\nimport { forwardRef } from 'react'\nimport { twMerge } from 'tailwind-merge'\n\nimport { cn } from '@/lib/utils'\n\ninterface IconProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof iconVariants> {\n active?: boolean\n readonly?: boolean\n}\n\nexport const Icon = forwardRef<HTMLButtonElement, IconProps>(\n ({ variant, size, active = false, readonly = false, className, ...props }, ref) => {\n const Component = readonly ? Slot : 'button'\n return (\n <Component\n className={cn(\n twMerge(iconVariants({ variant: active ? 'active' : variant, size })),\n className\n )}\n {...props}\n ref={ref}\n />\n )\n }\n)\n\nIcon.displayName = 'Icon'\n\nconst iconVariants = cva(\n [\n 'inline-flex',\n 'items-center',\n 'rounded-full',\n 'outline-2',\n 'outline-offset-2',\n 'outline-dashed',\n 'outline-transparent',\n 'disabled:text-grey-40',\n 'disabled:bg-transparent',\n 'disabled:pointer-events-none',\n ],\n {\n variants: {\n variant: {\n filled: [\n 'border',\n 'border-green-80',\n 'bg-green-90',\n 'text-white',\n 'hover:bg-green-80',\n 'active:bg-green-80',\n 'focus:outline-pickle-100',\n 'disabled:bg-green-70',\n ],\n transparent: [\n 'text-black',\n 'hover:bg-grey-5',\n 'active:bg-grey-10',\n 'focus:outline-purple-100',\n ],\n tonal: [\n 'border',\n 'border-grey-5',\n 'hover:border-grey-10',\n 'active:border-grey-20',\n 'focus:outline-purple-100',\n ],\n active: ['text-black', 'bg-pickle-100'],\n },\n size: {\n small: ['h-10', 'w-10', 'p-3'],\n medium: ['h-12', 'w-12', 'p-4'],\n large: ['h-14', 'w-14', 'p-4'],\n },\n },\n defaultVariants: {\n variant: 'filled',\n size: 'medium',\n },\n }\n)\n","import { type ClassValue
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ui/Icon.tsx","../../../src/lib/utils.ts"],"sourcesContent":["import { Slot } from '@radix-ui/react-slot'\nimport { cva, type VariantProps } from 'cva'\nimport { forwardRef } from 'react'\nimport { twMerge } from 'tailwind-merge'\n\nimport { cn } from '@/lib/utils'\n\ninterface IconProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof iconVariants> {\n active?: boolean\n readonly?: boolean\n}\n\nexport const Icon = forwardRef<HTMLButtonElement, IconProps>(\n ({ variant, size, active = false, readonly = false, className, ...props }, ref) => {\n const Component = readonly ? Slot : 'button'\n return (\n <Component\n className={cn(\n twMerge(iconVariants({ variant: active ? 'active' : variant, size })),\n className\n )}\n {...props}\n ref={ref}\n />\n )\n }\n)\n\nIcon.displayName = 'Icon'\n\nconst iconVariants = cva(\n [\n 'inline-flex',\n 'items-center',\n 'rounded-full',\n 'outline-2',\n 'outline-offset-2',\n 'outline-dashed',\n 'outline-transparent',\n 'disabled:text-grey-40',\n 'disabled:bg-transparent',\n 'disabled:pointer-events-none',\n ],\n {\n variants: {\n variant: {\n filled: [\n 'border',\n 'border-green-80',\n 'bg-green-90',\n 'text-white',\n 'hover:bg-green-80',\n 'active:bg-green-80',\n 'focus:outline-pickle-100',\n 'disabled:bg-green-70',\n ],\n transparent: [\n 'text-black',\n 'hover:bg-grey-5',\n 'active:bg-grey-10',\n 'focus:outline-purple-100',\n ],\n tonal: [\n 'border',\n 'border-grey-5',\n 'hover:border-grey-10',\n 'active:border-grey-20',\n 'focus:outline-purple-100',\n ],\n active: ['text-black', 'bg-pickle-100'],\n },\n size: {\n small: ['h-10', 'w-10', 'p-3'],\n medium: ['h-12', 'w-12', 'p-4'],\n large: ['h-14', 'w-14', 'p-4'],\n },\n },\n defaultVariants: {\n variant: 'filled',\n size: 'medium',\n },\n }\n)\n","import { clsx, type ClassValue } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n"],"mappings":";AAAA,SAAS,YAAY;AACrB,SAAS,WAA8B;AACvC,SAAS,kBAAkB;AAC3B,SAAS,WAAAA,gBAAe;;;ACHxB,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ADaM;AAJC,IAAM,OAAO;AAAA,EAClB,CAAC,EAAE,SAAS,MAAM,SAAS,OAAO,WAAW,OAAO,WAAW,GAAG,MAAM,GAAG,QAAQ;AACjF,UAAM,YAAY,WAAW,OAAO;AACpC,WACE;AAAA,MAAC;AAAA;AAAA,QACC,WAAW;AAAA,UACTC,SAAQ,aAAa,EAAE,SAAS,SAAS,WAAW,SAAS,KAAK,CAAC,CAAC;AAAA,UACpE;AAAA,QACF;AAAA,QACC,GAAG;AAAA,QACJ;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,KAAK,cAAc;AAEnB,IAAM,eAAe;AAAA,EACnB;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,QAAQ;AAAA,UACN;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,QACA,aAAa;AAAA,UACX;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,QACA,OAAO;AAAA,UACL;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,QACA,QAAQ,CAAC,cAAc,eAAe;AAAA,MACxC;AAAA,MACA,MAAM;AAAA,QACJ,OAAO,CAAC,QAAQ,QAAQ,KAAK;AAAA,QAC7B,QAAQ,CAAC,QAAQ,QAAQ,KAAK;AAAA,QAC9B,OAAO,CAAC,QAAQ,QAAQ,KAAK;AAAA,MAC/B;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,IACR;AAAA,EACF;AACF;","names":["twMerge","twMerge"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ui/Input.tsx","../../../src/lib/utils.ts","../../../src/components/ui/ErrorMessage.tsx","../../../src/components/primitives/tooltip.tsx","../../../src/components/ui/Label.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'cva'\nimport { icons, X } from 'lucide-react'\nimport { type ChangeEvent, forwardRef, type InputHTMLAttributes } from 'react'\n\nimport ErrorMessage from '@/components/ui/ErrorMessage'\nimport Label from '@/components/ui/Label'\nimport { cn } from '@/lib/utils'\n\ninterface Props extends InputHTMLAttributes<HTMLInputElement>, VariantProps<typeof inputVariants> {\n label?: string\n error?: string\n icon?: keyof typeof icons\n description?: string\n classNames?: { label?: string }\n onClear?: () => void\n}\n\nconst Input = forwardRef<HTMLInputElement, Props>(\n (\n { label, error, description, theme, icon, onClear, value, onChange, classNames, ...props },\n ref\n ) => {\n const handleClear = () => {\n onChange?.({ target: { value: '' } } as ChangeEvent<HTMLInputElement>)\n onClear?.()\n }\n\n const IconComponent = icon && icons[icon]\n\n const placeholder = props.placeholder ?? (icon === 'Search' ? 'Search...' : '')\n const hasIcon = !!icon\n\n const iconColor = theme === 'dark' ? 'text-white' : 'text-grey-80'\n\n return (\n <div className=\"group flex w-full flex-col gap-1\" data-testid={`input-wrapper-${props.id}`}>\n {label && (\n <Label\n text={label}\n htmlFor={props.name}\n required={props.required}\n description={description}\n className={classNames?.label}\n />\n )}\n <div className=\"relative flex flex-row items-center\">\n {IconComponent && (\n <IconComponent\n className={`absolute left-3 h-4 w-4 ${iconColor} opacity-50 group-hover:opacity-100`}\n />\n )}\n <input\n className={cn(inputVariants({ theme, hasIcon }))}\n ref={ref}\n placeholder={placeholder}\n value={value}\n onChange={onChange}\n data-testid={`input-element-${props.id}`}\n {...props}\n />\n {hasIcon && value && (\n <X\n className={`absolute right-3 h-4 w-4 cursor-pointer ${iconColor}`}\n onClick={handleClear}\n data-testid=\"clear-button\"\n />\n )}\n </div>\n\n <ErrorMessage message={error} />\n </div>\n )\n }\n)\nInput.displayName = 'Input'\n\nconst inputVariants = cva(\n [\n 'border-input',\n 'placeholder:text-muted-foreground',\n 'focus-visible:ring-ring',\n 'inline-flex',\n 'w-full',\n 'h-11',\n 'items-center',\n 'justify-start',\n 'gap-3',\n 'rounded-lg',\n 'bg-transparent',\n 'px-3',\n 'pt-0.5',\n 'text-sm',\n 'shadow-sm',\n 'ring-grey-50',\n 'transition-colors',\n 'focus-visible:outline-none',\n 'focus-visible:ring-1',\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-50',\n 'appearance-none',\n '[&::-webkit-search-cancel-button]:appearance-none',\n '[&::-webkit-search-decoration]:appearance-none',\n '[&::-webkit-search-results-button]:appearance-none',\n '[&::-webkit-search-results-decoration]:appearance-none',\n '[&::-ms-clear]:display-none',\n '[&::-ms-reveal]:display-none',\n ],\n {\n variants: {\n theme: {\n light: 'text-grey-80 border',\n dark: 'text-white',\n },\n hasIcon: {\n false: 'pl-3',\n true: 'pl-8',\n },\n },\n defaultVariants: {\n theme: 'light',\n hasIcon: false,\n },\n }\n)\n\nexport default Input\n","import { type ClassValue
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ui/Input.tsx","../../../src/lib/utils.ts","../../../src/components/ui/ErrorMessage.tsx","../../../src/components/primitives/tooltip.tsx","../../../src/components/ui/Label.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'cva'\nimport { icons, X } from 'lucide-react'\nimport { type ChangeEvent, forwardRef, type InputHTMLAttributes } from 'react'\n\nimport ErrorMessage from '@/components/ui/ErrorMessage'\nimport Label from '@/components/ui/Label'\nimport { cn } from '@/lib/utils'\n\ninterface Props extends InputHTMLAttributes<HTMLInputElement>, VariantProps<typeof inputVariants> {\n label?: string\n error?: string\n icon?: keyof typeof icons\n description?: string\n classNames?: { label?: string }\n onClear?: () => void\n}\n\nconst Input = forwardRef<HTMLInputElement, Props>(\n (\n { label, error, description, theme, icon, onClear, value, onChange, classNames, ...props },\n ref\n ) => {\n const handleClear = () => {\n onChange?.({ target: { value: '' } } as ChangeEvent<HTMLInputElement>)\n onClear?.()\n }\n\n const IconComponent = icon && icons[icon]\n\n const placeholder = props.placeholder ?? (icon === 'Search' ? 'Search...' : '')\n const hasIcon = !!icon\n\n const iconColor = theme === 'dark' ? 'text-white' : 'text-grey-80'\n\n return (\n <div className=\"group flex w-full flex-col gap-1\" data-testid={`input-wrapper-${props.id}`}>\n {label && (\n <Label\n text={label}\n htmlFor={props.name}\n required={props.required}\n description={description}\n className={classNames?.label}\n />\n )}\n <div className=\"relative flex flex-row items-center\">\n {IconComponent && (\n <IconComponent\n className={`absolute left-3 h-4 w-4 ${iconColor} opacity-50 group-hover:opacity-100`}\n />\n )}\n <input\n className={cn(inputVariants({ theme, hasIcon }))}\n ref={ref}\n placeholder={placeholder}\n value={value}\n onChange={onChange}\n data-testid={`input-element-${props.id}`}\n {...props}\n />\n {hasIcon && value && (\n <X\n className={`absolute right-3 h-4 w-4 cursor-pointer ${iconColor}`}\n onClick={handleClear}\n data-testid=\"clear-button\"\n />\n )}\n </div>\n\n <ErrorMessage message={error} />\n </div>\n )\n }\n)\nInput.displayName = 'Input'\n\nconst inputVariants = cva(\n [\n 'border-input',\n 'placeholder:text-muted-foreground',\n 'focus-visible:ring-ring',\n 'inline-flex',\n 'w-full',\n 'h-11',\n 'items-center',\n 'justify-start',\n 'gap-3',\n 'rounded-lg',\n 'bg-transparent',\n 'px-3',\n 'pt-0.5',\n 'text-sm',\n 'shadow-sm',\n 'ring-grey-50',\n 'transition-colors',\n 'focus-visible:outline-none',\n 'focus-visible:ring-1',\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-50',\n 'appearance-none',\n '[&::-webkit-search-cancel-button]:appearance-none',\n '[&::-webkit-search-decoration]:appearance-none',\n '[&::-webkit-search-results-button]:appearance-none',\n '[&::-webkit-search-results-decoration]:appearance-none',\n '[&::-ms-clear]:display-none',\n '[&::-ms-reveal]:display-none',\n ],\n {\n variants: {\n theme: {\n light: 'text-grey-80 border',\n dark: 'text-white',\n },\n hasIcon: {\n false: 'pl-3',\n true: 'pl-8',\n },\n },\n defaultVariants: {\n theme: 'light',\n hasIcon: false,\n },\n }\n)\n\nexport default Input\n","import { clsx, type ClassValue } 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","'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","import { type ComponentPropsWithoutRef } from 'react'\n\nimport { cn } from '@/lib/utils'\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from '@/components/primitives/tooltip'\nimport { InfoIcon } from 'lucide-react'\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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAuC;AACvC,IAAAA,uBAAyB;AACzB,mBAAuE;;;ACFvE,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ACOI;AAJJ,SAAS,aAAa,EAAE,SAAS,WAAW,GAAG,MAAM,GAAoB;AACvE,MAAI,CAAC,QAAS,QAAO;AAErB,SACE,4CAAC,OAAE,WAAW,GAAG,6BAA6B,SAAS,GAAI,GAAG,OAC3D,mBACH;AAEJ;A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EACF;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,OAAO;AAAA,QACL,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,MACA,SAAS;AAAA,QACP,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,OAAO;AAAA,MACP,SAAS;AAAA,IACX;AAAA,EACF;AACF;AAEA,IAAO,gBAAQ;","names":["import_lucide_react","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ui/Input.tsx","../../../src/lib/utils.ts","../../../src/components/ui/ErrorMessage.tsx","../../../src/components/primitives/tooltip.tsx","../../../src/components/ui/Label.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'cva'\nimport { icons, X } from 'lucide-react'\nimport { type ChangeEvent, forwardRef, type InputHTMLAttributes } from 'react'\n\nimport ErrorMessage from '@/components/ui/ErrorMessage'\nimport Label from '@/components/ui/Label'\nimport { cn } from '@/lib/utils'\n\ninterface Props extends InputHTMLAttributes<HTMLInputElement>, VariantProps<typeof inputVariants> {\n label?: string\n error?: string\n icon?: keyof typeof icons\n description?: string\n classNames?: { label?: string }\n onClear?: () => void\n}\n\nconst Input = forwardRef<HTMLInputElement, Props>(\n (\n { label, error, description, theme, icon, onClear, value, onChange, classNames, ...props },\n ref\n ) => {\n const handleClear = () => {\n onChange?.({ target: { value: '' } } as ChangeEvent<HTMLInputElement>)\n onClear?.()\n }\n\n const IconComponent = icon && icons[icon]\n\n const placeholder = props.placeholder ?? (icon === 'Search' ? 'Search...' : '')\n const hasIcon = !!icon\n\n const iconColor = theme === 'dark' ? 'text-white' : 'text-grey-80'\n\n return (\n <div className=\"group flex w-full flex-col gap-1\" data-testid={`input-wrapper-${props.id}`}>\n {label && (\n <Label\n text={label}\n htmlFor={props.name}\n required={props.required}\n description={description}\n className={classNames?.label}\n />\n )}\n <div className=\"relative flex flex-row items-center\">\n {IconComponent && (\n <IconComponent\n className={`absolute left-3 h-4 w-4 ${iconColor} opacity-50 group-hover:opacity-100`}\n />\n )}\n <input\n className={cn(inputVariants({ theme, hasIcon }))}\n ref={ref}\n placeholder={placeholder}\n value={value}\n onChange={onChange}\n data-testid={`input-element-${props.id}`}\n {...props}\n />\n {hasIcon && value && (\n <X\n className={`absolute right-3 h-4 w-4 cursor-pointer ${iconColor}`}\n onClick={handleClear}\n data-testid=\"clear-button\"\n />\n )}\n </div>\n\n <ErrorMessage message={error} />\n </div>\n )\n }\n)\nInput.displayName = 'Input'\n\nconst inputVariants = cva(\n [\n 'border-input',\n 'placeholder:text-muted-foreground',\n 'focus-visible:ring-ring',\n 'inline-flex',\n 'w-full',\n 'h-11',\n 'items-center',\n 'justify-start',\n 'gap-3',\n 'rounded-lg',\n 'bg-transparent',\n 'px-3',\n 'pt-0.5',\n 'text-sm',\n 'shadow-sm',\n 'ring-grey-50',\n 'transition-colors',\n 'focus-visible:outline-none',\n 'focus-visible:ring-1',\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-50',\n 'appearance-none',\n '[&::-webkit-search-cancel-button]:appearance-none',\n '[&::-webkit-search-decoration]:appearance-none',\n '[&::-webkit-search-results-button]:appearance-none',\n '[&::-webkit-search-results-decoration]:appearance-none',\n '[&::-ms-clear]:display-none',\n '[&::-ms-reveal]:display-none',\n ],\n {\n variants: {\n theme: {\n light: 'text-grey-80 border',\n dark: 'text-white',\n },\n hasIcon: {\n false: 'pl-3',\n true: 'pl-8',\n },\n },\n defaultVariants: {\n theme: 'light',\n hasIcon: false,\n },\n }\n)\n\nexport default Input\n","import { type ClassValue
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ui/Input.tsx","../../../src/lib/utils.ts","../../../src/components/ui/ErrorMessage.tsx","../../../src/components/primitives/tooltip.tsx","../../../src/components/ui/Label.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'cva'\nimport { icons, X } from 'lucide-react'\nimport { type ChangeEvent, forwardRef, type InputHTMLAttributes } from 'react'\n\nimport ErrorMessage from '@/components/ui/ErrorMessage'\nimport Label from '@/components/ui/Label'\nimport { cn } from '@/lib/utils'\n\ninterface Props extends InputHTMLAttributes<HTMLInputElement>, VariantProps<typeof inputVariants> {\n label?: string\n error?: string\n icon?: keyof typeof icons\n description?: string\n classNames?: { label?: string }\n onClear?: () => void\n}\n\nconst Input = forwardRef<HTMLInputElement, Props>(\n (\n { label, error, description, theme, icon, onClear, value, onChange, classNames, ...props },\n ref\n ) => {\n const handleClear = () => {\n onChange?.({ target: { value: '' } } as ChangeEvent<HTMLInputElement>)\n onClear?.()\n }\n\n const IconComponent = icon && icons[icon]\n\n const placeholder = props.placeholder ?? (icon === 'Search' ? 'Search...' : '')\n const hasIcon = !!icon\n\n const iconColor = theme === 'dark' ? 'text-white' : 'text-grey-80'\n\n return (\n <div className=\"group flex w-full flex-col gap-1\" data-testid={`input-wrapper-${props.id}`}>\n {label && (\n <Label\n text={label}\n htmlFor={props.name}\n required={props.required}\n description={description}\n className={classNames?.label}\n />\n )}\n <div className=\"relative flex flex-row items-center\">\n {IconComponent && (\n <IconComponent\n className={`absolute left-3 h-4 w-4 ${iconColor} opacity-50 group-hover:opacity-100`}\n />\n )}\n <input\n className={cn(inputVariants({ theme, hasIcon }))}\n ref={ref}\n placeholder={placeholder}\n value={value}\n onChange={onChange}\n data-testid={`input-element-${props.id}`}\n {...props}\n />\n {hasIcon && value && (\n <X\n className={`absolute right-3 h-4 w-4 cursor-pointer ${iconColor}`}\n onClick={handleClear}\n data-testid=\"clear-button\"\n />\n )}\n </div>\n\n <ErrorMessage message={error} />\n </div>\n )\n }\n)\nInput.displayName = 'Input'\n\nconst inputVariants = cva(\n [\n 'border-input',\n 'placeholder:text-muted-foreground',\n 'focus-visible:ring-ring',\n 'inline-flex',\n 'w-full',\n 'h-11',\n 'items-center',\n 'justify-start',\n 'gap-3',\n 'rounded-lg',\n 'bg-transparent',\n 'px-3',\n 'pt-0.5',\n 'text-sm',\n 'shadow-sm',\n 'ring-grey-50',\n 'transition-colors',\n 'focus-visible:outline-none',\n 'focus-visible:ring-1',\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-50',\n 'appearance-none',\n '[&::-webkit-search-cancel-button]:appearance-none',\n '[&::-webkit-search-decoration]:appearance-none',\n '[&::-webkit-search-results-button]:appearance-none',\n '[&::-webkit-search-results-decoration]:appearance-none',\n '[&::-ms-clear]:display-none',\n '[&::-ms-reveal]:display-none',\n ],\n {\n variants: {\n theme: {\n light: 'text-grey-80 border',\n dark: 'text-white',\n },\n hasIcon: {\n false: 'pl-3',\n true: 'pl-8',\n },\n },\n defaultVariants: {\n theme: 'light',\n hasIcon: false,\n },\n }\n)\n\nexport default Input\n","import { clsx, type ClassValue } 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","'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","import { type ComponentPropsWithoutRef } from 'react'\n\nimport { cn } from '@/lib/utils'\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from '@/components/primitives/tooltip'\nimport { InfoIcon } from 'lucide-react'\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"],"mappings":";AAAA,SAAS,WAA8B;AACvC,SAAS,OAAO,SAAS;AACzB,SAA2B,cAAAA,mBAA4C;;;ACFvE,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ACOI;AAJJ,SAAS,aAAa,EAAE,SAAS,WAAW,GAAG,MAAM,GAAoB;AACvE,MAAI,CAAC,QAAS,QAAO;AAErB,S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,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;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,OAAO;AAAA,QACL,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,MACA,SAAS;AAAA,QACP,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,OAAO;AAAA,MACP,SAAS;AAAA,IACX;AAAA,EACF;AACF;AAEA,IAAO,gBAAQ;","names":["forwardRef","jsx","jsx","jsx","jsxs","forwardRef"]}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/components/ui/InputOtp.tsx
|
|
31
|
+
var InputOtp_exports = {};
|
|
32
|
+
__export(InputOtp_exports, {
|
|
33
|
+
InputOtp: () => InputOtp
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(InputOtp_exports);
|
|
36
|
+
var import_react = require("react");
|
|
37
|
+
|
|
38
|
+
// src/lib/utils.ts
|
|
39
|
+
var import_clsx = require("clsx");
|
|
40
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
41
|
+
function cn(...inputs) {
|
|
42
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// src/components/ui/ErrorMessage.tsx
|
|
46
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
47
|
+
function ErrorMessage({ message, className, ...props }) {
|
|
48
|
+
if (!message) return null;
|
|
49
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: cn("px-1 text-xs text-red-600", className), ...props, children: message });
|
|
50
|
+
}
|
|
51
|
+
var ErrorMessage_default = ErrorMessage;
|
|
52
|
+
|
|
53
|
+
// src/components/primitives/tooltip.tsx
|
|
54
|
+
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"), 1);
|
|
55
|
+
var React = __toESM(require("react"), 1);
|
|
56
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
57
|
+
var TooltipProvider = TooltipPrimitive.Provider;
|
|
58
|
+
var Tooltip = TooltipPrimitive.Root;
|
|
59
|
+
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
60
|
+
var TooltipContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
61
|
+
TooltipPrimitive.Content,
|
|
62
|
+
{
|
|
63
|
+
ref,
|
|
64
|
+
sideOffset,
|
|
65
|
+
className: cn(
|
|
66
|
+
"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",
|
|
67
|
+
className
|
|
68
|
+
),
|
|
69
|
+
...props
|
|
70
|
+
}
|
|
71
|
+
));
|
|
72
|
+
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
73
|
+
|
|
74
|
+
// src/components/ui/Label.tsx
|
|
75
|
+
var import_lucide_react = require("lucide-react");
|
|
76
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
77
|
+
function Label({ text, required, description, className, ...props }) {
|
|
78
|
+
if (!text) return null;
|
|
79
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex w-full flex-row gap-1", children: [
|
|
80
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
81
|
+
"label",
|
|
82
|
+
{
|
|
83
|
+
className: cn(
|
|
84
|
+
"text-xs text-grey-80 peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
85
|
+
className
|
|
86
|
+
),
|
|
87
|
+
...props,
|
|
88
|
+
children: [
|
|
89
|
+
text,
|
|
90
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-red-600", children: "\xA0*" })
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
),
|
|
94
|
+
!!description && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Tooltip, { children: [
|
|
95
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.InfoIcon, { className: "h-4 w-4" }) }),
|
|
96
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TooltipContent, { className: "max-w-48", children: description })
|
|
97
|
+
] }) })
|
|
98
|
+
] });
|
|
99
|
+
}
|
|
100
|
+
var Label_default = Label;
|
|
101
|
+
|
|
102
|
+
// src/components/primitives/input-otp.tsx
|
|
103
|
+
var React2 = __toESM(require("react"), 1);
|
|
104
|
+
var import_input_otp = require("input-otp");
|
|
105
|
+
var import_lucide_react2 = require("lucide-react");
|
|
106
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
107
|
+
var InputOTP = React2.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
108
|
+
import_input_otp.OTPInput,
|
|
109
|
+
{
|
|
110
|
+
ref,
|
|
111
|
+
containerClassName: cn(
|
|
112
|
+
"flex items-center gap-2 has-[:disabled]:opacity-50",
|
|
113
|
+
containerClassName
|
|
114
|
+
),
|
|
115
|
+
className: cn("disabled:cursor-not-allowed", className),
|
|
116
|
+
...props
|
|
117
|
+
}
|
|
118
|
+
));
|
|
119
|
+
InputOTP.displayName = "InputOTP";
|
|
120
|
+
var InputOTPGroup = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { ref, className: cn("flex items-center", className), ...props }));
|
|
121
|
+
InputOTPGroup.displayName = "InputOTPGroup";
|
|
122
|
+
var InputOTPSlot = React2.forwardRef(({ index, error, className, ...props }, ref) => {
|
|
123
|
+
const inputOTPContext = React2.useContext(import_input_otp.OTPInputContext);
|
|
124
|
+
const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index];
|
|
125
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
126
|
+
"div",
|
|
127
|
+
{
|
|
128
|
+
ref,
|
|
129
|
+
className: cn(
|
|
130
|
+
"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",
|
|
131
|
+
isActive && "z-10 ring-2 ring-purple-100 ring-offset-white dark:ring-purple-20 dark:ring-offset-purple-100",
|
|
132
|
+
error && "border-red-500 dark:border-red-400",
|
|
133
|
+
className
|
|
134
|
+
),
|
|
135
|
+
...props,
|
|
136
|
+
children: [
|
|
137
|
+
char,
|
|
138
|
+
hasFakeCaret && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "animate-caret-blink h-4 w-px bg-neutral-950 duration-1000 dark:bg-neutral-50" }) })
|
|
139
|
+
]
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
});
|
|
143
|
+
InputOTPSlot.displayName = "InputOTPSlot";
|
|
144
|
+
var InputOTPSeparator = React2.forwardRef(({ ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { ref, role: "separator", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react2.Dot, {}) }));
|
|
145
|
+
InputOTPSeparator.displayName = "InputOTPSeparator";
|
|
146
|
+
|
|
147
|
+
// src/components/ui/InputOtp.tsx
|
|
148
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
149
|
+
var InputOtp = (0, import_react.forwardRef)(
|
|
150
|
+
({ digits, label, description, error, ...props }, ref) => {
|
|
151
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
152
|
+
"div",
|
|
153
|
+
{
|
|
154
|
+
className: "group flex w-full flex-col gap-1",
|
|
155
|
+
"data-testid": `input-otp-wrapper-${props.id}`,
|
|
156
|
+
children: [
|
|
157
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
158
|
+
Label_default,
|
|
159
|
+
{
|
|
160
|
+
text: label,
|
|
161
|
+
htmlFor: props.name,
|
|
162
|
+
required: props.required,
|
|
163
|
+
description
|
|
164
|
+
}
|
|
165
|
+
),
|
|
166
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "relative flex flex-row items-center", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
167
|
+
InputOTP,
|
|
168
|
+
{
|
|
169
|
+
ref,
|
|
170
|
+
maxLength: digits,
|
|
171
|
+
"data-testid": `input-otp-element-${props.id}`,
|
|
172
|
+
...props,
|
|
173
|
+
children: [...Array(digits)].map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(InputOTPGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(InputOTPSlot, { index, error: Boolean(error) }) }, index))
|
|
174
|
+
}
|
|
175
|
+
) }),
|
|
176
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ErrorMessage_default, { message: error })
|
|
177
|
+
]
|
|
178
|
+
}
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
);
|
|
182
|
+
InputOtp.displayName = "Input";
|
|
183
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
184
|
+
0 && (module.exports = {
|
|
185
|
+
InputOtp
|
|
186
|
+
});
|
|
187
|
+
//# sourceMappingURL=InputOtp.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ui/InputOtp.tsx","../../../src/lib/utils.ts","../../../src/components/ui/ErrorMessage.tsx","../../../src/components/primitives/tooltip.tsx","../../../src/components/ui/Label.tsx","../../../src/components/primitives/input-otp.tsx"],"sourcesContent":["import { forwardRef, type InputHTMLAttributes } from 'react'\n\nimport ErrorMessage from '@/components/ui/ErrorMessage'\nimport Label from '@/components/ui/Label'\nimport { InputOTP, InputOTPGroup, InputOTPSlot } from '@/components/primitives/input-otp'\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","import { clsx, type ClassValue } 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","'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","import { type ComponentPropsWithoutRef } from 'react'\n\nimport { cn } from '@/lib/utils'\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from '@/components/primitives/tooltip'\nimport { InfoIcon } from 'lucide-react'\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 React from 'react'\nimport { OTPInput, OTPInputContext } from 'input-otp'\nimport { Dot } from 'lucide-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=\"animate-caret-blink h-4 w-px 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, InputOTPSlot, InputOTPSeparator }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAqD;;;ACArD,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ACOI;AAJJ,SAAS,aAAa,EAAE,SAAS,WAAW,GAAG,MAAM,GAAoB;AACvE,MAAI,CAAC,QAAS,QAAO;AAErB,SACE,4CAAC,OAAE,WAAW,GAAG,6BAA6B,SAAS,GAAI,GAAG,OAC3D,mBACH;AAEJ;AAEA,IAAO,uBAAQ;;;AChBf,uBAAkC;AAClC,YAAuB;AAcrB,IAAAA,sBAAA;AAVF,IAAM,kBAAmC;AAEzC,IAAM,UAA2B;AAEjC,IAAM,iBAAkC;AAExC,IAAM,iBAAuB,iBAG3B,CAAC,EAAE,WAAW,aAAa,GAAG,GAAG,MAAM,GAAG,QAC1C;AAAA,EAAkB;AAAA,EAAjB;AAAA,IACC;AAAA,IACA;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,eAAe,cAA+B,yBAAQ;;;AClBtD,0BAAyB;AAanB,IAAAC,sBAAA;AALN,SAAS,MAAM,EAAE,MAAM,UAAU,aAAa,WAAW,GAAG,MAAM,GAAoB;AACpF,MAAI,CAAC,KAAM,QAAO;AAElB,SACE,8CAAC,SAAI,WAAU,8BACb;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,WAAW;AAAA,UACT;AAAA,UACA;AAAA,QACF;AAAA,QACC,GAAG;AAAA,QAEH;AAAA;AAAA,UACA,YAAY,6CAAC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cAAc;AAE3B,IAAM,oBAA0B,kBAG9B,CAAC,EAAE,GAAG,MAAM,GAAG,QACf,6CAAC,SAAI,KAAU,MAAK,aAAa,GAAG,OAClC,uDAAC,4BAAI,GACP,CACD;AACD,kBAAkB,cAAc;;;ALpD1B,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_jsx_runtime","React","import_lucide_react","import_jsx_runtime","import_jsx_runtime"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { InputHTMLAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
interface Props extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {
|
|
5
|
+
digits: 4 | 6 | 8;
|
|
6
|
+
value?: string;
|
|
7
|
+
label?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
error?: string;
|
|
10
|
+
onChange?: (v: string) => void;
|
|
11
|
+
}
|
|
12
|
+
declare const InputOtp: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLInputElement>>;
|
|
13
|
+
|
|
14
|
+
export { InputOtp };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { InputHTMLAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
interface Props extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> {
|
|
5
|
+
digits: 4 | 6 | 8;
|
|
6
|
+
value?: string;
|
|
7
|
+
label?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
error?: string;
|
|
10
|
+
onChange?: (v: string) => void;
|
|
11
|
+
}
|
|
12
|
+
declare const InputOtp: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLInputElement>>;
|
|
13
|
+
|
|
14
|
+
export { InputOtp };
|