@next-degree/pickle-shared-js 0.6.48 → 0.7.51
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_latest-DFxfjA2x.d.cts +4369 -0
- package/dist/company_service_latest-DFxfjA2x.d.ts +4369 -0
- package/dist/company_service_sanity--Aw-Y3Us.d.cts +7611 -0
- package/dist/company_service_sanity-B5FBDl-4.d.ts +7611 -0
- package/dist/components/buttons/BackButton.cjs +5 -1
- package/dist/components/buttons/BackButton.cjs.map +1 -1
- package/dist/components/buttons/BackButton.js +5 -1
- package/dist/components/buttons/BackButton.js.map +1 -1
- package/dist/components/company/CompanyTake.cjs +4 -2
- package/dist/components/company/CompanyTake.cjs.map +1 -1
- package/dist/components/company/CompanyTake.js +4 -2
- package/dist/components/company/CompanyTake.js.map +1 -1
- package/dist/components/jobPost/JobDescription.cjs +18 -7
- package/dist/components/jobPost/JobDescription.cjs.map +1 -1
- package/dist/components/jobPost/JobDescription.js +18 -7
- package/dist/components/jobPost/JobDescription.js.map +1 -1
- package/dist/components/jobPost/JobHeader.cjs +43 -37
- package/dist/components/jobPost/JobHeader.cjs.map +1 -1
- package/dist/components/jobPost/JobHeader.js +42 -36
- package/dist/components/jobPost/JobHeader.js.map +1 -1
- package/dist/components/jobPost/JobPost.cjs +105 -90
- 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 +105 -90
- 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 +6 -4
- package/dist/components/primitives/command.cjs.map +1 -1
- package/dist/components/primitives/command.d.cts +7 -7
- package/dist/components/primitives/command.d.ts +7 -7
- package/dist/components/primitives/command.js +6 -4
- package/dist/components/primitives/command.js.map +1 -1
- package/dist/components/primitives/dialog.cjs +4 -4
- package/dist/components/primitives/dialog.cjs.map +1 -1
- package/dist/components/primitives/dialog.js +6 -4
- package/dist/components/primitives/dialog.js.map +1 -1
- package/dist/components/primitives/input-otp.cjs +2 -2
- package/dist/components/primitives/input-otp.cjs.map +1 -1
- package/dist/components/primitives/input-otp.js +2 -2
- package/dist/components/primitives/input-otp.js.map +1 -1
- package/dist/components/primitives/popover.cjs +1 -1
- package/dist/components/primitives/popover.cjs.map +1 -1
- package/dist/components/primitives/popover.d.cts +1 -1
- package/dist/components/primitives/popover.d.ts +1 -1
- package/dist/components/primitives/popover.js +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 +2 -2
- package/dist/components/ui/Avatar.cjs.map +1 -1
- package/dist/components/ui/Avatar.js +4 -2
- 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 +3 -3
- package/dist/components/ui/Button.cjs.map +1 -1
- package/dist/components/ui/Button.d.cts +33 -0
- package/dist/components/ui/Button.d.ts +33 -0
- package/dist/components/ui/Button.js +5 -3
- 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 +111 -103
- package/dist/components/ui/Combobox.cjs.map +1 -1
- package/dist/components/ui/Combobox.d.cts +1 -1
- package/dist/components/ui/Combobox.d.ts +1 -1
- package/dist/components/ui/Combobox.js +108 -100
- package/dist/components/ui/Combobox.js.map +1 -1
- package/dist/components/ui/Counter.cjs +3 -1
- package/dist/components/ui/Counter.cjs.map +1 -1
- package/dist/components/ui/Counter.js +3 -1
- package/dist/components/ui/Counter.js.map +1 -1
- package/dist/components/ui/DatePicker.cjs +318 -0
- package/dist/components/ui/DatePicker.cjs.map +1 -0
- package/dist/components/ui/DatePicker.d.cts +16 -0
- package/dist/components/ui/DatePicker.d.ts +16 -0
- package/dist/components/ui/DatePicker.js +284 -0
- package/dist/components/ui/DatePicker.js.map +1 -0
- 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 +3 -1
- package/dist/components/ui/Input.cjs.map +1 -1
- package/dist/components/ui/Input.d.cts +29 -0
- package/dist/components/ui/Input.d.ts +29 -0
- package/dist/components/ui/Input.js +3 -1
- package/dist/components/ui/Input.js.map +1 -1
- package/dist/components/ui/InputOtp.cjs +62 -58
- package/dist/components/ui/InputOtp.cjs.map +1 -1
- package/dist/components/ui/InputOtp.js +62 -58
- package/dist/components/ui/InputOtp.js.map +1 -1
- package/dist/components/ui/Label.cjs +5 -3
- package/dist/components/ui/Label.cjs.map +1 -1
- package/dist/components/ui/Label.js +7 -3
- package/dist/components/ui/Label.js.map +1 -1
- package/dist/components/ui/ListItem.cjs +7 -7
- package/dist/components/ui/ListItem.cjs.map +1 -1
- package/dist/components/ui/ListItem.js +10 -8
- package/dist/components/ui/ListItem.js.map +1 -1
- package/dist/components/ui/MapComponent.cjs.map +1 -1
- package/dist/components/ui/MapComponent.js +1 -1
- package/dist/components/ui/MapComponent.js.map +1 -1
- package/dist/components/ui/PlacesQueryInput.cjs +21 -13
- package/dist/components/ui/PlacesQueryInput.cjs.map +1 -1
- package/dist/components/ui/PlacesQueryInput.js +23 -13
- package/dist/components/ui/PlacesQueryInput.js.map +1 -1
- package/dist/components/ui/ReadMore.cjs +18 -7
- package/dist/components/ui/ReadMore.cjs.map +1 -1
- package/dist/components/ui/ReadMore.js +18 -7
- package/dist/components/ui/ReadMore.js.map +1 -1
- package/dist/components/ui/Select.cjs +68 -70
- package/dist/components/ui/Select.cjs.map +1 -1
- package/dist/components/ui/Select.js +66 -68
- package/dist/components/ui/Select.js.map +1 -1
- package/dist/components/ui/StepTabs.cjs +92 -0
- package/dist/components/ui/StepTabs.cjs.map +1 -0
- package/dist/components/ui/StepTabs.d.cts +13 -0
- package/dist/components/ui/StepTabs.d.ts +13 -0
- package/dist/components/ui/StepTabs.js +58 -0
- package/dist/components/ui/StepTabs.js.map +1 -0
- package/dist/components/ui/buttonShadcn.cjs +94 -0
- package/dist/components/ui/buttonShadcn.cjs.map +1 -0
- package/dist/components/ui/buttonShadcn.d.cts +14 -0
- package/dist/components/ui/buttonShadcn.d.ts +14 -0
- package/dist/components/ui/buttonShadcn.js +58 -0
- package/dist/components/ui/buttonShadcn.js.map +1 -0
- package/dist/components/ui/calendar.cjs +152 -0
- package/dist/components/ui/calendar.cjs.map +1 -0
- package/dist/components/ui/calendar.d.cts +11 -0
- package/dist/components/ui/calendar.d.ts +11 -0
- package/dist/components/ui/calendar.js +118 -0
- package/dist/components/ui/calendar.js.map +1 -0
- package/dist/{displayText-mYUVo6Ek.d.cts → displayText-CQRZ2fOT.d.cts} +2 -2
- package/dist/{displayText-DDf9iWyg.d.ts → displayText-LlsLfkTS.d.ts} +2 -2
- package/dist/hooks/useDisplayText.cjs.map +1 -1
- package/dist/hooks/useDisplayText.d.cts +3 -3
- package/dist/hooks/useDisplayText.d.ts +3 -3
- package/dist/hooks/useDisplayText.js.map +1 -1
- package/dist/index.cjs +763 -738
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -13
- package/dist/index.d.ts +13 -13
- package/dist/index.js +772 -747
- package/dist/index.js.map +1 -1
- package/dist/job_posting_service_latest-B5tqLSgo.d.cts +4247 -0
- package/dist/job_posting_service_latest-B5tqLSgo.d.ts +4247 -0
- package/dist/{job_posting_service_latest-Dn5s8beY.d.cts → job_posting_service_latest-CKITrYyz.d.cts} +230 -230
- package/dist/{job_posting_service_latest-Dn5s8beY.d.ts → job_posting_service_latest-CKITrYyz.d.ts} +230 -230
- package/dist/job_posting_service_sanity-CeX9tlpb.d.ts +8093 -0
- package/dist/job_posting_service_sanity-D5Znr6Ba.d.cts +8093 -0
- package/dist/lib/google.cjs.map +1 -1
- package/dist/lib/google.js.map +1 -1
- package/dist/lib/locations.cjs.map +1 -1
- package/dist/lib/locations.d.cts +2 -2
- package/dist/lib/locations.d.ts +2 -2
- package/dist/lib/locations.js.map +1 -1
- package/dist/lib/mappings.cjs.map +1 -1
- package/dist/lib/mappings.d.cts +3 -3
- package/dist/lib/mappings.d.ts +3 -3
- package/dist/lib/mappings.js.map +1 -1
- package/dist/lib/salaryRange.cjs.map +1 -1
- package/dist/lib/salaryRange.d.cts +1 -1
- package/dist/lib/salaryRange.d.ts +1 -1
- package/dist/lib/salaryRange.js.map +1 -1
- package/dist/lib/utils.cjs.map +1 -1
- package/dist/lib/utils.js.map +1 -1
- package/dist/services/displayText.cjs.map +1 -1
- package/dist/services/displayText.d.cts +3 -3
- package/dist/services/displayText.d.ts +3 -3
- package/dist/services/displayText.js.map +1 -1
- package/dist/shared_pickle_output_latest-Bwfg5B4p.d.cts +350 -0
- package/dist/shared_pickle_output_latest-Bwfg5B4p.d.ts +350 -0
- package/dist/styles/globals.css +371 -6
- package/dist/styles/globals.css.map +1 -1
- package/dist/types/data/company_service_latest.cjs.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/company_service_latest.js.map +1 -1
- package/dist/types/data/job_posting_service_latest.cjs +3 -1
- package/dist/types/data/job_posting_service_latest.cjs.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/data/job_posting_service_latest.js +3 -1
- package/dist/types/data/job_posting_service_latest.js.map +1 -1
- package/dist/types/data/shared_pickle_output_latest.cjs.map +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/dist/types/data/shared_pickle_output_latest.js.map +1 -1
- package/dist/types/index.cjs +505 -0
- package/dist/types/index.cjs.map +1 -0
- package/dist/types/index.d.cts +10 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.js +479 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/latest/company_service_latest.cjs +251 -0
- package/dist/types/latest/company_service_latest.cjs.map +1 -0
- package/dist/types/latest/company_service_latest.d.cts +2 -0
- package/dist/types/latest/company_service_latest.d.ts +2 -0
- package/dist/types/latest/company_service_latest.js +210 -0
- package/dist/types/latest/company_service_latest.js.map +1 -0
- package/dist/types/latest/custom/company_service_sanity.cjs +325 -0
- package/dist/types/latest/custom/company_service_sanity.cjs.map +1 -0
- package/dist/types/latest/custom/company_service_sanity.d.cts +4 -0
- package/dist/types/latest/custom/company_service_sanity.d.ts +4 -0
- package/dist/types/latest/custom/company_service_sanity.js +288 -0
- package/dist/types/latest/custom/company_service_sanity.js.map +1 -0
- package/dist/types/latest/custom/custom_sanity_models.cjs +43 -0
- package/dist/types/latest/custom/custom_sanity_models.cjs.map +1 -0
- package/dist/types/latest/custom/custom_sanity_models.d.cts +30 -0
- package/dist/types/latest/custom/custom_sanity_models.d.ts +30 -0
- package/dist/types/latest/custom/custom_sanity_models.js +17 -0
- package/dist/types/latest/custom/custom_sanity_models.js.map +1 -0
- package/dist/types/latest/custom/job_posting_service_sanity.cjs +376 -0
- package/dist/types/latest/custom/job_posting_service_sanity.cjs.map +1 -0
- package/dist/types/latest/custom/job_posting_service_sanity.d.cts +5 -0
- package/dist/types/latest/custom/job_posting_service_sanity.d.ts +5 -0
- package/dist/types/latest/custom/job_posting_service_sanity.js +331 -0
- package/dist/types/latest/custom/job_posting_service_sanity.js.map +1 -0
- package/dist/types/latest/job_posting_service_latest.cjs +293 -0
- package/dist/types/latest/job_posting_service_latest.cjs.map +1 -0
- package/dist/types/latest/job_posting_service_latest.d.cts +2 -0
- package/dist/types/latest/job_posting_service_latest.d.ts +2 -0
- package/dist/types/latest/job_posting_service_latest.js +257 -0
- package/dist/types/latest/job_posting_service_latest.js.map +1 -0
- package/dist/types/latest/shared_pickle_output_latest.cjs +109 -0
- package/dist/types/latest/shared_pickle_output_latest.cjs.map +1 -0
- package/dist/types/latest/shared_pickle_output_latest.d.cts +2 -0
- package/dist/types/latest/shared_pickle_output_latest.d.ts +2 -0
- package/dist/types/latest/shared_pickle_output_latest.js +75 -0
- package/dist/types/latest/shared_pickle_output_latest.js.map +1 -0
- package/package.json +28 -6
- package/dist/{company_service_latest-DelYl1hO.d.cts → company_service_latest-8IMr2hMZ.d.cts} +244 -244
- package/dist/{company_service_latest-DelYl1hO.d.ts → company_service_latest-8IMr2hMZ.d.ts} +244 -244
- package/dist/{shared_pickle_output_latest-DbAgINuf.d.cts → shared_pickle_output_latest-Cwf2EMdH.d.cts} +17 -17
- package/dist/{shared_pickle_output_latest-DbAgINuf.d.ts → shared_pickle_output_latest-Cwf2EMdH.d.ts} +17 -17
|
@@ -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 { 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,e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AO;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/ui/Label.tsx","../../../src/components/primitives/tooltip.tsx"],"sourcesContent":["'use client'\n\nimport { cva, type VariantProps } from 'cva'\nimport { Minus, Plus } from 'lucide-react'\nimport { type ChangeEvent, forwardRef, type InputHTMLAttributes, useEffect, useState } 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","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":";;;AAEA,SAAS,WAA8B;AACvC,SAAS,OAAO,YAAY;AAC5B,SAA2B,cAAAA,aAAsC,WAAW,gBAAgB;;;ACJ5F,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;;;AClBf,SAAS,gBAAgB;;;ACEzB,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,gBAAA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AAA;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"]}
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
|
|
31
|
+
// src/components/ui/DatePicker.tsx
|
|
32
|
+
var DatePicker_exports = {};
|
|
33
|
+
__export(DatePicker_exports, {
|
|
34
|
+
DatePicker: () => DatePicker
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(DatePicker_exports);
|
|
37
|
+
var import_cva = require("cva");
|
|
38
|
+
|
|
39
|
+
// src/components/primitives/popover.tsx
|
|
40
|
+
var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"), 1);
|
|
41
|
+
var React = __toESM(require("react"), 1);
|
|
42
|
+
|
|
43
|
+
// src/lib/utils.ts
|
|
44
|
+
var import_clsx = require("clsx");
|
|
45
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
46
|
+
function cn(...inputs) {
|
|
47
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// src/components/primitives/popover.tsx
|
|
51
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
52
|
+
var Popover = PopoverPrimitive.Root;
|
|
53
|
+
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
54
|
+
var PopoverContent = React.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PopoverPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
55
|
+
PopoverPrimitive.Content,
|
|
56
|
+
{
|
|
57
|
+
ref,
|
|
58
|
+
align,
|
|
59
|
+
sideOffset,
|
|
60
|
+
className: cn(
|
|
61
|
+
"z-50 rounded-2xl border bg-white p-4 text-black shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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",
|
|
62
|
+
className
|
|
63
|
+
),
|
|
64
|
+
...props
|
|
65
|
+
}
|
|
66
|
+
) }));
|
|
67
|
+
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
68
|
+
|
|
69
|
+
// src/components/ui/Label.tsx
|
|
70
|
+
var import_lucide_react = require("lucide-react");
|
|
71
|
+
|
|
72
|
+
// src/components/primitives/tooltip.tsx
|
|
73
|
+
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"), 1);
|
|
74
|
+
var React2 = __toESM(require("react"), 1);
|
|
75
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
76
|
+
var TooltipProvider = TooltipPrimitive.Provider;
|
|
77
|
+
var Tooltip = TooltipPrimitive.Root;
|
|
78
|
+
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
79
|
+
var TooltipContent = React2.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
80
|
+
TooltipPrimitive.Content,
|
|
81
|
+
{
|
|
82
|
+
ref,
|
|
83
|
+
sideOffset,
|
|
84
|
+
className: cn(
|
|
85
|
+
"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",
|
|
86
|
+
className
|
|
87
|
+
),
|
|
88
|
+
...props
|
|
89
|
+
}
|
|
90
|
+
));
|
|
91
|
+
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
92
|
+
|
|
93
|
+
// src/components/ui/Label.tsx
|
|
94
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
95
|
+
function Label({ text, required, description, className, ...props }) {
|
|
96
|
+
if (!text) return null;
|
|
97
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex w-full flex-row gap-1", children: [
|
|
98
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
99
|
+
"label",
|
|
100
|
+
{
|
|
101
|
+
className: cn(
|
|
102
|
+
"text-xs text-grey-80 peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
103
|
+
className
|
|
104
|
+
),
|
|
105
|
+
...props,
|
|
106
|
+
children: [
|
|
107
|
+
text,
|
|
108
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-red-600", children: "\xA0*" })
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
),
|
|
112
|
+
!!description && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Tooltip, { children: [
|
|
113
|
+
/* @__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" }) }),
|
|
114
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TooltipContent, { className: "max-w-48", children: description })
|
|
115
|
+
] }) })
|
|
116
|
+
] });
|
|
117
|
+
}
|
|
118
|
+
var Label_default = Label;
|
|
119
|
+
|
|
120
|
+
// src/components/ui/DatePicker.tsx
|
|
121
|
+
var import_react = require("react");
|
|
122
|
+
var import_date_fns = require("date-fns");
|
|
123
|
+
|
|
124
|
+
// src/components/ui/calendar.tsx
|
|
125
|
+
var import_lucide_react2 = require("lucide-react");
|
|
126
|
+
var import_react_day_picker = require("react-day-picker");
|
|
127
|
+
|
|
128
|
+
// src/components/ui/buttonShadcn.tsx
|
|
129
|
+
var React3 = __toESM(require("react"), 1);
|
|
130
|
+
var import_react_slot = require("@radix-ui/react-slot");
|
|
131
|
+
var import_class_variance_authority = require("class-variance-authority");
|
|
132
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
133
|
+
var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
134
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-neutral-950 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 dark:focus-visible:ring-neutral-300",
|
|
135
|
+
{
|
|
136
|
+
variants: {
|
|
137
|
+
variant: {
|
|
138
|
+
default: "bg-neutral-900 text-neutral-50 shadow hover:bg-neutral-900/90 dark:bg-neutral-50 dark:text-neutral-900 dark:hover:bg-neutral-50/90",
|
|
139
|
+
destructive: "bg-red-500 text-neutral-50 shadow-sm hover:bg-red-500/90 dark:bg-red-900 dark:text-neutral-50 dark:hover:bg-red-900/90",
|
|
140
|
+
outline: "border border-neutral-200 bg-white shadow-sm hover:bg-neutral-100 hover:text-neutral-900 dark:border-neutral-800 dark:bg-neutral-950 dark:hover:bg-neutral-800 dark:hover:text-neutral-50",
|
|
141
|
+
secondary: "bg-neutral-100 text-neutral-900 shadow-sm hover:bg-neutral-100/80 dark:bg-neutral-800 dark:text-neutral-50 dark:hover:bg-neutral-800/80",
|
|
142
|
+
ghost: "hover:bg-neutral-100 hover:text-neutral-900 dark:hover:bg-neutral-800 dark:hover:text-neutral-50",
|
|
143
|
+
link: "text-neutral-900 underline-offset-4 hover:underline dark:text-neutral-50"
|
|
144
|
+
},
|
|
145
|
+
size: {
|
|
146
|
+
default: "h-9 px-4 py-2",
|
|
147
|
+
sm: "h-8 rounded-md px-3 text-xs",
|
|
148
|
+
lg: "h-10 rounded-md px-8",
|
|
149
|
+
icon: "h-9 w-9"
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
defaultVariants: {
|
|
153
|
+
variant: "default",
|
|
154
|
+
size: "default"
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
var Button = React3.forwardRef(
|
|
159
|
+
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
160
|
+
const Comp = asChild ? import_react_slot.Slot : "button";
|
|
161
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
162
|
+
Comp,
|
|
163
|
+
{
|
|
164
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
165
|
+
ref,
|
|
166
|
+
...props
|
|
167
|
+
}
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
);
|
|
171
|
+
Button.displayName = "Button";
|
|
172
|
+
|
|
173
|
+
// src/components/ui/calendar.tsx
|
|
174
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
175
|
+
function Calendar({
|
|
176
|
+
className,
|
|
177
|
+
classNames,
|
|
178
|
+
showOutsideDays = true,
|
|
179
|
+
...props
|
|
180
|
+
}) {
|
|
181
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
182
|
+
import_react_day_picker.DayPicker,
|
|
183
|
+
{
|
|
184
|
+
showOutsideDays,
|
|
185
|
+
className: cn("p-3", className),
|
|
186
|
+
classNames: {
|
|
187
|
+
months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
|
|
188
|
+
month: "space-y-4",
|
|
189
|
+
caption: "flex justify-center pt-1 relative items-center",
|
|
190
|
+
caption_label: "text-sm font-medium",
|
|
191
|
+
nav: "space-x-1 flex items-center",
|
|
192
|
+
nav_button: cn(
|
|
193
|
+
buttonVariants({ variant: "outline" }),
|
|
194
|
+
"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"
|
|
195
|
+
),
|
|
196
|
+
nav_button_previous: "absolute left-1",
|
|
197
|
+
nav_button_next: "absolute right-1",
|
|
198
|
+
table: "w-full border-collapse space-y-1",
|
|
199
|
+
head_row: "flex",
|
|
200
|
+
head_cell: "text-neutral-500 rounded-md w-8 font-normal text-[0.8rem] dark:text-neutral-400",
|
|
201
|
+
row: "flex w-full mt-2",
|
|
202
|
+
cell: cn(
|
|
203
|
+
"relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-neutral-100 [&:has([aria-selected].day-outside)]:bg-neutral-100/50 [&:has([aria-selected].day-range-end)]:rounded-r-md dark:[&:has([aria-selected])]:bg-neutral-800 dark:[&:has([aria-selected].day-outside)]:bg-neutral-800/50",
|
|
204
|
+
props.mode === "range" ? "[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md" : "[&:has([aria-selected])]:rounded-md"
|
|
205
|
+
),
|
|
206
|
+
day: cn(
|
|
207
|
+
buttonVariants({ variant: "ghost" }),
|
|
208
|
+
"h-8 w-8 p-0 font-normal aria-selected:opacity-100"
|
|
209
|
+
),
|
|
210
|
+
day_range_start: "day-range-start",
|
|
211
|
+
day_range_end: "day-range-end",
|
|
212
|
+
day_selected: "bg-neutral-900 text-neutral-50 hover:bg-neutral-900 hover:text-neutral-50 focus:bg-neutral-900 focus:text-neutral-50 dark:bg-neutral-50 dark:text-neutral-900 dark:hover:bg-neutral-50 dark:hover:text-neutral-900 dark:focus:bg-neutral-50 dark:focus:text-neutral-900",
|
|
213
|
+
day_today: "bg-neutral-100 text-neutral-900 dark:bg-neutral-800 dark:text-neutral-50",
|
|
214
|
+
day_outside: "day-outside text-neutral-500 aria-selected:bg-neutral-100/50 aria-selected:text-neutral-500 dark:text-neutral-400 dark:aria-selected:bg-neutral-800/50 dark:aria-selected:text-neutral-400",
|
|
215
|
+
day_disabled: "text-neutral-500 opacity-50 dark:text-neutral-400",
|
|
216
|
+
day_range_middle: "aria-selected:bg-neutral-100 aria-selected:text-neutral-900 dark:aria-selected:bg-neutral-800 dark:aria-selected:text-neutral-50",
|
|
217
|
+
day_hidden: "invisible",
|
|
218
|
+
...classNames
|
|
219
|
+
},
|
|
220
|
+
components: {
|
|
221
|
+
IconLeft: ({ className: className2, ...props2 }) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react2.ChevronLeft, { className: cn("h-4 w-4", className2), ...props2 }),
|
|
222
|
+
IconRight: ({ className: className2, ...props2 }) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react2.ChevronRight, { className: cn("h-4 w-4", className2), ...props2 })
|
|
223
|
+
},
|
|
224
|
+
...props
|
|
225
|
+
}
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
Calendar.displayName = "Calendar";
|
|
229
|
+
|
|
230
|
+
// src/components/ui/DatePicker.tsx
|
|
231
|
+
var import_lucide_react3 = require("lucide-react");
|
|
232
|
+
|
|
233
|
+
// src/components/ui/ErrorMessage.tsx
|
|
234
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
235
|
+
function ErrorMessage({ message, className, ...props }) {
|
|
236
|
+
if (!message) return null;
|
|
237
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: cn("px-1 text-xs text-red-600", className), ...props, children: message });
|
|
238
|
+
}
|
|
239
|
+
var ErrorMessage_default = ErrorMessage;
|
|
240
|
+
|
|
241
|
+
// src/components/ui/DatePicker.tsx
|
|
242
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
243
|
+
var DatePicker = (0, import_react.forwardRef)(({ label, description, required, classNames, value, onChange, error }, ref) => {
|
|
244
|
+
const [date, setDate] = (0, import_react.useState)(null);
|
|
245
|
+
(0, import_react.useEffect)(() => {
|
|
246
|
+
setDate(value ?? null);
|
|
247
|
+
}, [value]);
|
|
248
|
+
const handleDateSelect = (dateSelected) => {
|
|
249
|
+
if (!dateSelected) return;
|
|
250
|
+
onChange?.(dateSelected);
|
|
251
|
+
setDate(dateSelected);
|
|
252
|
+
};
|
|
253
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: cn("flex w-auto flex-col gap-1"), children: [
|
|
254
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
255
|
+
Label_default,
|
|
256
|
+
{
|
|
257
|
+
text: label,
|
|
258
|
+
required,
|
|
259
|
+
description,
|
|
260
|
+
className: classNames?.label
|
|
261
|
+
}
|
|
262
|
+
),
|
|
263
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Popover, { children: [
|
|
264
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PopoverTrigger, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: cn(datePickerStyle()), children: [
|
|
265
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react3.Calendar, { size: 16 }),
|
|
266
|
+
date ? (0, import_date_fns.format)(date, "MM/dd/yyyy") : "Select a date"
|
|
267
|
+
] }) }),
|
|
268
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PopoverContent, { ref, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
269
|
+
Calendar,
|
|
270
|
+
{
|
|
271
|
+
mode: "single",
|
|
272
|
+
selected: date || void 0,
|
|
273
|
+
onSelect: handleDateSelect,
|
|
274
|
+
captionLayout: "dropdown",
|
|
275
|
+
showOutsideDays: true
|
|
276
|
+
}
|
|
277
|
+
) })
|
|
278
|
+
] }),
|
|
279
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ErrorMessage_default, { message: error })
|
|
280
|
+
] });
|
|
281
|
+
});
|
|
282
|
+
var datePickerStyle = (0, import_cva.cva)(
|
|
283
|
+
[
|
|
284
|
+
"placeholder:text-muted-foreground",
|
|
285
|
+
"focus-visible:ring-ring",
|
|
286
|
+
"inline-flex",
|
|
287
|
+
"w-full",
|
|
288
|
+
"h-11",
|
|
289
|
+
"items-center",
|
|
290
|
+
"justify-start",
|
|
291
|
+
"gap-3",
|
|
292
|
+
"rounded-lg",
|
|
293
|
+
"bg-transparent",
|
|
294
|
+
"px-3",
|
|
295
|
+
"pt-0.5",
|
|
296
|
+
"text-sm",
|
|
297
|
+
"shadow-sm",
|
|
298
|
+
"ring-grey-50",
|
|
299
|
+
"transition-colors",
|
|
300
|
+
"focus-visible:outline-none",
|
|
301
|
+
"focus-visible:ring-1",
|
|
302
|
+
"disabled:cursor-not-allowed",
|
|
303
|
+
"disabled:opacity-50",
|
|
304
|
+
"appearance-none",
|
|
305
|
+
"[&::-webkit-search-cancel-button]:appearance-none",
|
|
306
|
+
"[&::-webkit-search-decoration]:appearance-none",
|
|
307
|
+
"[&::-webkit-search-results-button]:appearance-none",
|
|
308
|
+
"[&::-webkit-search-results-decoration]:appearance-none",
|
|
309
|
+
"[&::-ms-clear]:display-none",
|
|
310
|
+
"[&::-ms-reveal]:display-none",
|
|
311
|
+
"text-grey-80 border"
|
|
312
|
+
]
|
|
313
|
+
);
|
|
314
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
315
|
+
0 && (module.exports = {
|
|
316
|
+
DatePicker
|
|
317
|
+
});
|
|
318
|
+
//# sourceMappingURL=DatePicker.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ui/DatePicker.tsx","../../../src/components/primitives/popover.tsx","../../../src/lib/utils.ts","../../../src/components/ui/Label.tsx","../../../src/components/primitives/tooltip.tsx","../../../src/components/ui/calendar.tsx","../../../src/components/ui/buttonShadcn.tsx","../../../src/components/ui/ErrorMessage.tsx"],"sourcesContent":["'use client'\n\nimport { cva } from 'cva'\nimport { Popover, PopoverContent, PopoverTrigger } from '@/components/primitives/popover'\nimport Label from '@/components/ui/Label'\nimport { cn } from \"@/lib/utils\"\nimport { forwardRef, useEffect, useState } from 'react'\nimport { format } from 'date-fns'\nimport { Calendar } from '@/components/ui/calendar'\nimport { Calendar as CalendarIcon } from 'lucide-react'\nimport ErrorMessage from '@/components/ui/ErrorMessage'\n\ntype Props = {\n label?: string\n description?: string\n required?: boolean\n classNames?: { label?: string }\n value?: Date | null\n onChange?: (date: Date) => void\n error?: string\n}\n\nexport const DatePicker = forwardRef<HTMLInputElement, Props>(({ label, description, required, classNames, value, onChange, error }, ref) => {\n const [date, setDate] = useState<Date | null>(null)\n\n useEffect(() => {\n setDate(value ?? null)\n }, [value])\n\n const handleDateSelect = (dateSelected: Date | undefined) => {\n if (!dateSelected) return\n onChange?.(dateSelected)\n setDate(dateSelected)\n }\n\n return (\n <div className={cn('flex w-auto flex-col gap-1')}>\n {label && (\n <Label\n text={label}\n required={required}\n description={description}\n className={classNames?.label}\n /> \n )}\n <Popover>\n <PopoverTrigger>\n <div className={cn(datePickerStyle())}>\n <CalendarIcon size={16} />\n {date ? format(date, 'MM/dd/yyyy') : 'Select a date'}\n </div>\n </PopoverTrigger>\n <PopoverContent ref={ref}>\n <Calendar\n mode=\"single\"\n selected={date || undefined}\n onSelect={handleDateSelect}\n captionLayout='dropdown'\n showOutsideDays={true}\n />\n </PopoverContent>\n </Popover>\n\n <ErrorMessage message={error} />\n </div>\n )\n})\n\nconst datePickerStyle = cva(\n [\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 'text-grey-80 border'\n ]\n)","'use client'\n\nimport * as PopoverPrimitive from '@radix-ui/react-popover'\nimport * as React from 'react'\n\nimport { cn } from '@/lib/utils'\n\nconst Popover = PopoverPrimitive.Root\n\nconst PopoverTrigger = PopoverPrimitive.Trigger\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(({ className, align = 'center', sideOffset = 4, ...props }, ref) => (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n 'z-50 rounded-2xl border bg-white p-4 text-black shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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',\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n))\nPopoverContent.displayName = PopoverPrimitive.Content.displayName\n\nexport { Popover, PopoverContent, PopoverTrigger }\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 { 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","\"use client\"\n\nimport * as React from \"react\"\nimport { ChevronLeft, ChevronRight } from \"lucide-react\"\nimport { DayPicker } from \"react-day-picker\"\n\nimport { cn } from \"@/lib/utils\"\nimport { buttonVariants } from \"@/components/ui/buttonShadcn\"\n\nexport type CalendarProps = React.ComponentProps<typeof DayPicker>\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n ...props\n}: CalendarProps) {\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\"p-3\", className)}\n classNames={{\n months: \"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0\",\n month: \"space-y-4\",\n caption: \"flex justify-center pt-1 relative items-center\",\n caption_label: \"text-sm font-medium\",\n nav: \"space-x-1 flex items-center\",\n nav_button: cn(\n buttonVariants({ variant: \"outline\" }),\n \"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100\"\n ),\n nav_button_previous: \"absolute left-1\",\n nav_button_next: \"absolute right-1\",\n table: \"w-full border-collapse space-y-1\",\n head_row: \"flex\",\n head_cell:\n \"text-neutral-500 rounded-md w-8 font-normal text-[0.8rem] dark:text-neutral-400\",\n row: \"flex w-full mt-2\",\n cell: cn(\n \"relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-neutral-100 [&:has([aria-selected].day-outside)]:bg-neutral-100/50 [&:has([aria-selected].day-range-end)]:rounded-r-md dark:[&:has([aria-selected])]:bg-neutral-800 dark:[&:has([aria-selected].day-outside)]:bg-neutral-800/50\",\n props.mode === \"range\"\n ? \"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md\"\n : \"[&:has([aria-selected])]:rounded-md\"\n ),\n day: cn(\n buttonVariants({ variant: \"ghost\" }),\n \"h-8 w-8 p-0 font-normal aria-selected:opacity-100\"\n ),\n day_range_start: \"day-range-start\",\n day_range_end: \"day-range-end\",\n day_selected:\n \"bg-neutral-900 text-neutral-50 hover:bg-neutral-900 hover:text-neutral-50 focus:bg-neutral-900 focus:text-neutral-50 dark:bg-neutral-50 dark:text-neutral-900 dark:hover:bg-neutral-50 dark:hover:text-neutral-900 dark:focus:bg-neutral-50 dark:focus:text-neutral-900\",\n day_today: \"bg-neutral-100 text-neutral-900 dark:bg-neutral-800 dark:text-neutral-50\",\n day_outside:\n \"day-outside text-neutral-500 aria-selected:bg-neutral-100/50 aria-selected:text-neutral-500 dark:text-neutral-400 dark:aria-selected:bg-neutral-800/50 dark:aria-selected:text-neutral-400\",\n day_disabled: \"text-neutral-500 opacity-50 dark:text-neutral-400\",\n day_range_middle:\n \"aria-selected:bg-neutral-100 aria-selected:text-neutral-900 dark:aria-selected:bg-neutral-800 dark:aria-selected:text-neutral-50\",\n day_hidden: \"invisible\",\n ...classNames,\n }}\n components={{\n IconLeft: ({ className, ...props }) => (\n <ChevronLeft className={cn(\"h-4 w-4\", className)} {...props} />\n ),\n IconRight: ({ className, ...props }) => (\n <ChevronRight className={cn(\"h-4 w-4\", className)} {...props} />\n ),\n }}\n {...props}\n />\n )\n}\nCalendar.displayName = \"Calendar\"\n\nexport { Calendar }\n","import * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-neutral-950 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 dark:focus-visible:ring-neutral-300\",\n {\n variants: {\n variant: {\n default:\n \"bg-neutral-900 text-neutral-50 shadow hover:bg-neutral-900/90 dark:bg-neutral-50 dark:text-neutral-900 dark:hover:bg-neutral-50/90\",\n destructive:\n \"bg-red-500 text-neutral-50 shadow-sm hover:bg-red-500/90 dark:bg-red-900 dark:text-neutral-50 dark:hover:bg-red-900/90\",\n outline:\n \"border border-neutral-200 bg-white shadow-sm hover:bg-neutral-100 hover:text-neutral-900 dark:border-neutral-800 dark:bg-neutral-950 dark:hover:bg-neutral-800 dark:hover:text-neutral-50\",\n secondary:\n \"bg-neutral-100 text-neutral-900 shadow-sm hover:bg-neutral-100/80 dark:bg-neutral-800 dark:text-neutral-50 dark:hover:bg-neutral-800/80\",\n ghost: \"hover:bg-neutral-100 hover:text-neutral-900 dark:hover:bg-neutral-800 dark:hover:text-neutral-50\",\n link: \"text-neutral-900 underline-offset-4 hover:underline dark:text-neutral-50\",\n },\n size: {\n default: \"h-9 px-4 py-2\",\n sm: \"h-8 rounded-md px-3 text-xs\",\n lg: \"h-10 rounded-md px-8\",\n icon: \"h-9 w-9\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\"\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n {...props}\n />\n )\n }\n)\nButton.displayName = \"Button\"\n\nexport { Button, buttonVariants }\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;AAAA;AAAA;AAAA;AAAA;AAEA,iBAAoB;;;ACApB,uBAAkC;AAClC,YAAuB;;;ACHvB,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ADWI;AATJ,IAAM,UAA2B;AAEjC,IAAM,iBAAkC;AAExC,IAAM,iBAAuB,iBAG3B,CAAC,EAAE,WAAW,QAAQ,UAAU,aAAa,GAAG,GAAG,MAAM,GAAG,QAC5D,4CAAkB,yBAAjB,EACC;AAAA,EAAkB;AAAA,EAAjB;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,GACF,CACD;AACD,eAAe,cAA+B,yBAAQ;;;AE5BtD,0BAAyB;;;ACEzB,uBAAkC;AAClC,IAAAA,SAAuB;AAcrB,IAAAC,sBAAA;AAVF,IAAM,kBAAmC;AAEzC,IAAM,UAA2B;AAEjC,IAAM,iBAAkC;AAExC,IAAM,iBAAuB,kBAG3B,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;;;ADLhD,IAAAC,sBAAA;AALN,SAAS,MAAM,EAAE,MAAM,UAAU,aAAa,WAAW,GAAG,MAAM,GAAoB;AACp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A;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;AACF;","names":["React","import_jsx_runtime","import_jsx_runtime","import_lucide_react","React","import_jsx_runtime","import_jsx_runtime","className","props","import_lucide_react","import_jsx_runtime","import_jsx_runtime","CalendarIcon"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
type Props = {
|
|
4
|
+
label?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
classNames?: {
|
|
8
|
+
label?: string;
|
|
9
|
+
};
|
|
10
|
+
value?: Date | null;
|
|
11
|
+
onChange?: (date: Date) => void;
|
|
12
|
+
error?: string;
|
|
13
|
+
};
|
|
14
|
+
declare const DatePicker: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLInputElement>>;
|
|
15
|
+
|
|
16
|
+
export { DatePicker };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
type Props = {
|
|
4
|
+
label?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
classNames?: {
|
|
8
|
+
label?: string;
|
|
9
|
+
};
|
|
10
|
+
value?: Date | null;
|
|
11
|
+
onChange?: (date: Date) => void;
|
|
12
|
+
error?: string;
|
|
13
|
+
};
|
|
14
|
+
declare const DatePicker: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLInputElement>>;
|
|
15
|
+
|
|
16
|
+
export { DatePicker };
|