@next-degree/pickle-shared-js 0.7.52 → 0.9.3
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/README.md +4 -2
- package/dist/components/jobPost/JobDescription.cjs +2 -1
- package/dist/components/jobPost/JobDescription.cjs.map +1 -1
- package/dist/components/jobPost/JobDescription.js +2 -1
- package/dist/components/jobPost/JobDescription.js.map +1 -1
- package/dist/components/jobPost/JobPost.cjs +2 -1
- 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 +2 -1
- package/dist/components/jobPost/JobPost.js.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/input-otp.d.cts +2 -2
- package/dist/components/primitives/input-otp.d.ts +2 -2
- package/dist/components/primitives/radio-group.cjs +74 -0
- package/dist/components/primitives/radio-group.cjs.map +1 -0
- package/dist/components/primitives/radio-group.d.cts +9 -0
- package/dist/components/primitives/radio-group.d.ts +9 -0
- package/dist/components/primitives/radio-group.js +41 -0
- package/dist/components/primitives/radio-group.js.map +1 -0
- package/dist/components/ui/Button.cjs +2 -1
- package/dist/components/ui/Button.cjs.map +1 -1
- package/dist/components/ui/Button.d.cts +1 -1
- package/dist/components/ui/Button.d.ts +1 -1
- package/dist/components/ui/Button.js +2 -1
- package/dist/components/ui/Button.js.map +1 -1
- package/dist/components/ui/Checkbox.cjs +39 -14
- package/dist/components/ui/Checkbox.cjs.map +1 -1
- package/dist/components/ui/Checkbox.d.cts +2 -1
- package/dist/components/ui/Checkbox.d.ts +2 -1
- package/dist/components/ui/Checkbox.js +32 -12
- package/dist/components/ui/Checkbox.js.map +1 -1
- package/dist/components/ui/Combobox.cjs +63 -42
- package/dist/components/ui/Combobox.cjs.map +1 -1
- package/dist/components/ui/Combobox.js +54 -33
- package/dist/components/ui/Combobox.js.map +1 -1
- package/dist/components/ui/DatePicker.cjs +135 -149
- package/dist/components/ui/DatePicker.cjs.map +1 -1
- package/dist/components/ui/DatePicker.d.cts +4 -0
- package/dist/components/ui/DatePicker.d.ts +4 -0
- package/dist/components/ui/DatePicker.js +134 -148
- package/dist/components/ui/DatePicker.js.map +1 -1
- package/dist/components/ui/ListItem.cjs +41 -22
- package/dist/components/ui/ListItem.cjs.map +1 -1
- package/dist/components/ui/ListItem.js +37 -18
- package/dist/components/ui/ListItem.js.map +1 -1
- package/dist/components/ui/Radio.cjs +177 -0
- package/dist/components/ui/Radio.cjs.map +1 -0
- package/dist/components/ui/Radio.d.cts +27 -0
- package/dist/components/ui/Radio.d.ts +27 -0
- package/dist/components/ui/Radio.js +144 -0
- package/dist/components/ui/Radio.js.map +1 -0
- package/dist/components/ui/ReadMore.cjs +2 -1
- package/dist/components/ui/ReadMore.cjs.map +1 -1
- package/dist/components/ui/ReadMore.js +2 -1
- package/dist/components/ui/ReadMore.js.map +1 -1
- package/dist/components/ui/Select.cjs +48 -24
- package/dist/components/ui/Select.cjs.map +1 -1
- package/dist/components/ui/Select.js +49 -25
- package/dist/components/ui/Select.js.map +1 -1
- package/dist/components/ui/Switch.cjs +83 -0
- package/dist/components/ui/Switch.cjs.map +1 -0
- package/dist/components/ui/Switch.d.cts +10 -0
- package/dist/components/ui/Switch.d.ts +10 -0
- package/dist/components/ui/Switch.js +48 -0
- package/dist/components/ui/Switch.js.map +1 -0
- package/dist/components/ui/buttonShadcn.cjs +2 -9
- package/dist/components/ui/buttonShadcn.cjs.map +1 -1
- package/dist/components/ui/buttonShadcn.d.cts +2 -2
- package/dist/components/ui/buttonShadcn.d.ts +2 -2
- package/dist/components/ui/buttonShadcn.js +2 -9
- package/dist/components/ui/buttonShadcn.js.map +1 -1
- package/dist/components/ui/calendar.cjs +7 -17
- package/dist/components/ui/calendar.cjs.map +1 -1
- package/dist/components/ui/calendar.js +7 -17
- package/dist/components/ui/calendar.js.map +1 -1
- package/dist/{displayText-6TMMBOmQ.d.cts → displayText-ca_ofoAC.d.cts} +2 -2
- package/dist/{displayText-BCC_oy5I.d.ts → displayText-eoAHqSNz.d.ts} +2 -2
- package/dist/hooks/useDisplayText.d.cts +3 -3
- package/dist/hooks/useDisplayText.d.ts +3 -3
- package/dist/index.cjs +456 -327
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -7
- package/dist/index.d.ts +12 -7
- package/dist/index.js +438 -309
- package/dist/index.js.map +1 -1
- 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/services/displayText.d.cts +3 -3
- package/dist/services/displayText.d.ts +3 -3
- package/dist/styles/globals.css +78 -0
- 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 +7 -10
- package/dist/{company_service_latest-BUKbZgpZ.d.cts → company_service_latest-CRQFzMep.d.cts} +366 -366
- package/dist/{company_service_latest-BUKbZgpZ.d.ts → company_service_latest-CRQFzMep.d.ts} +366 -366
- package/dist/{job_posting_service_latest-2KcpupDl.d.cts → job_posting_service_latest-BOVbz68F.d.cts} +324 -324
- package/dist/{job_posting_service_latest-2KcpupDl.d.ts → job_posting_service_latest-BOVbz68F.d.ts} +324 -324
- package/dist/{shared_pickle_output_latest-D2n-PRlx.d.cts → shared_pickle_output_latest-DKOmTyYk.d.cts} +20 -20
- package/dist/{shared_pickle_output_latest-D2n-PRlx.d.ts → shared_pickle_output_latest-DKOmTyYk.d.ts} +20 -20
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ui/Select.tsx","../../../src/components/primitives/separator.tsx","../../../src/lib/utils.ts","../../../src/components/ui/Chip.tsx","../../../src/components/ui/ErrorMessage.tsx","../../../src/components/ui/Label.tsx","../../../src/components/primitives/tooltip.tsx"],"sourcesContent":["'use client'\n\nimport * as SelectPrimitive from '@radix-ui/react-select'\nimport { CheckIcon, ChevronDownIcon, X } from 'lucide-react'\nimport {\n type ComponentPropsWithoutRef,\n forwardRef,\n type KeyboardEvent,\n useEffect,\n useRef,\n useState,\n} from 'react'\n\nimport { Separator } from '@/components/primitives/separator'\nimport Chip from '@/components/ui/Chip'\nimport ErrorMessage from '@/components/ui/ErrorMessage'\nimport Label from '@/components/ui/Label'\nimport { cn } from '@/lib/utils'\n\ninterface Props extends Omit<ComponentPropsWithoutRef<'select'>, 'value' | 'onChange'> {\n label?: string\n value?: string | string[]\n options?: { id: string | number; value: string; title: string }[]\n placeholder?: string\n multiselect?: boolean\n description?: string\n error?: string\n classNames?: { label?: string; trigger?: string }\n onChange?: (value: string | string[]) => void\n}\n\nconst Select = forwardRef<HTMLButtonElement, Props>(\n (\n { label, options, placeholder, multiselect, description, classNames, error, id, ...props },\n ref\n ) => {\n const { value, defaultValue, dir, className, onChange, ...rest } = props\n const [selected, setSelected] = useState<string[]>([])\n const [open, setOpen] = useState(false)\n const containerRef = useRef<HTMLDivElement>(null)\n\n useEffect(() => {\n if (!value) return setSelected([])\n setSelected(Array.isArray(value) ? value : [value])\n }, [value])\n\n const toggleOpen = () => setOpen((prev) => !prev)\n const closeOnEscape = (event: KeyboardEvent) => event.key === 'Escape' && setOpen(false)\n const handleOnOpenChange = (isOpen: boolean) => (!multiselect || isOpen) && setOpen(isOpen)\n const setValueOnEnter = (event: KeyboardEvent, value: string) =>\n event.key === 'Enter' && handleChange(value)\n const getLabel = () =>\n selected.map((o) => options?.find((option) => option.value === o)?.title).join(', ')\n\n const chipLabels = selected\n ?.map((s) => options?.find(({ value }) => value === s))\n .filter(Boolean)\n\n function handleChange(newValue: string) {\n if (newValue === '' && !multiselect) return // Prevent clearing single select\n let newSelected: string[] = []\n setSelected((prev) => {\n newSelected = prev.includes(newValue)\n ? prev.filter((item) => item !== newValue)\n : [...prev, newValue]\n return multiselect ? newSelected : [newValue]\n })\n onChange?.(multiselect ? newSelected : newValue)\n }\n\n return (\n <div\n className={cn('flex w-full flex-col gap-1', className)}\n ref={containerRef}\n data-testid={`${(label ?? id)?.toLowerCase()}-select-element`}\n >\n <Label\n text={label}\n htmlFor={props.name}\n required={props.required}\n description={description}\n className={classNames?.label}\n />\n\n <SelectPrimitive.Root\n open={open}\n value={selected.join(',')}\n onOpenChange={handleOnOpenChange}\n onValueChange={multiselect ? undefined : handleChange}\n defaultValue={typeof defaultValue === 'string' ? defaultValue : undefined}\n dir={dir === 'rtl' ? 'rtl' : 'ltr'}\n {...rest}\n >\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n 'group flex h-11 w-full flex-row items-center justify-between gap-3 rounded-lg border px-4 py-3 text-sm font-normal focus:outline-purple-100 disabled:bg-grey-5 data-[placeholder]:text-grey-50 data-[placeholder]:disabled:text-grey-40',\n classNames?.trigger\n )}\n >\n <span className=\"truncate\">\n <SelectPrimitive.Value\n placeholder={placeholder ?? 'Select an option'}\n aria-label={getLabel()}\n >\n {getLabel()}\n </SelectPrimitive.Value>\n </span>\n\n <ChevronDownIcon\n className=\"transform text-black group-data-[state=open]:rotate-180\"\n size=\"16\"\n />\n </SelectPrimitive.Trigger>\n\n <SelectPrimitive.Portal container={containerRef.current}>\n <SelectPrimitive.Content\n hideWhenDetached\n className=\"z-10 max-h-[var(--radix-select-content-available-height)] w-[var(--radix-select-trigger-width)] overflow-hidden rounded-md bg-white py-2 shadow-lg\"\n position=\"popper\"\n sideOffset={4}\n onPointerDownOutside={toggleOpen}\n onKeyDown={closeOnEscape}\n >\n <SelectPrimitive.Viewport>\n {multiselect && !!chipLabels?.length && (\n <SelectPrimitive.Group\n className=\"mb-2 flex flex-row flex-wrap gap-1 px-2\"\n data-testid=\"selected-labels\"\n >\n {chipLabels?.map(\n (chip) =>\n chip && (\n <Chip key={chip.title} size=\"small\" variant=\"primary\">\n <span>{chip.title}</span>\n <X\n size={18}\n data-testid={`chip-remove-${chip.value}`}\n className=\"cursor-pointer\"\n onClick={() => handleChange(chip.value)}\n />\n </Chip>\n )\n )}\n </SelectPrimitive.Group>\n )}\n <Separator />\n {options?.map(({ id, title, value }) => (\n <SelectPrimitive.Item\n key={id}\n value={value}\n className=\"group relative cursor-pointer px-4 py-2 text-left text-sm hover:bg-purple-50 focus:bg-purple-50 focus:outline-none data-[state=checked]:bg-purple-50 data-[state=checked]:pr-10 data-[state=checked]:text-purple-100\"\n data-state={selected.includes(value) ? 'checked' : 'unchecked'}\n onKeyDown={(e) => setValueOnEnter(e, value)}\n onClick={() => handleChange(value)}\n >\n <SelectPrimitive.ItemText>{title}</SelectPrimitive.ItemText>\n <CheckIcon\n className=\"absolute inset-y-0 right-3 my-auto hidden w-6 text-purple-100 group-data-[state=checked]:block\"\n size={16}\n />\n </SelectPrimitive.Item>\n ))}\n </SelectPrimitive.Viewport>\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n </SelectPrimitive.Root>\n\n <ErrorMessage message={error} />\n </div>\n )\n }\n)\n\nSelect.displayName = 'Select'\n\nexport default Select\n","'use client'\r\n\r\nimport * as SeparatorPrimitive from '@radix-ui/react-separator'\r\nimport * as React from 'react'\r\n\r\nimport { cn } from '@/lib/utils'\r\n\r\nconst Separator = React.forwardRef<\r\n React.ElementRef<typeof SeparatorPrimitive.Root>,\r\n React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>\r\n>(({ className, orientation = 'horizontal', decorative = true, ...props }, ref) => (\r\n <SeparatorPrimitive.Root\r\n ref={ref}\r\n decorative={decorative}\r\n orientation={orientation}\r\n className={cn(\r\n 'shrink-0 bg-grey-10',\r\n orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]',\r\n className\r\n )}\r\n {...props}\r\n />\r\n))\r\nSeparator.displayName = SeparatorPrimitive.Root.displayName\r\n\r\nexport { Separator }\r\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 { cva, type VariantProps } from 'cva'\nimport React from 'react'\nimport { twMerge } from 'tailwind-merge'\n\ninterface ChipProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof chipVariants> {}\n\nconst Chip = ({ className, variant, size, ...props }: ChipProps) => (\n <div className={twMerge(chipVariants({ variant, size, className }))} {...props} />\n)\n\nconst chipVariants = cva(['flex', 'items-center', 'rounded-3xl', 'border', 'w-fit'], {\n variants: {\n variant: {\n neutral: ['text-grey-80', 'border-grey-10'],\n primary: ['text-purple-100', 'border-purple-20'],\n danger: ['text-pumpkin-100', 'border-pumpkin-20'],\n onboarding: ['text-green-100', 'bg-green-10', 'cursor-pointer'],\n onboardingSelected: ['text-white', 'bg-green-90', 'cursor-pointer'],\n },\n size: {\n small: ['text-sm', 'leading-5', 'px-2', 'py-1', 'gap-1.5'],\n medium: ['text-base', 'leading-6', 'px-3', 'py-2', 'gap-2'],\n },\n },\n defaultVariants: {\n variant: 'neutral',\n size: 'medium',\n },\n})\n\nexport default Chip\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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,MAAM;AAAA;AAAA,4BACR;AAAA;AAAA;AAAA,wBAXKI;AAAA,sBAYP,CACD;AAAA,uBACH;AAAA;AAAA,gBACF,GACF;AAAA;AAAA;AAAA,UACF;AAAA,UAEA,gBAAAJ,KAAC,wBAAa,SAAS,OAAO;AAAA;AAAA;AAAA,IAChC;AAAA,EAEJ;AACF;AAEA,OAAO,cAAc;AAErB,IAAO,iBAAQ;","names":["forwardRef","twMerge","jsx","jsx","React","jsx","jsx","jsx","jsxs","forwardRef","value","id"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ui/Select.tsx","../../../src/components/primitives/separator.tsx","../../../src/lib/utils.ts","../../../src/components/ui/Chip.tsx","../../../src/components/ui/ErrorMessage.tsx","../../../src/components/ui/Label.tsx","../../../src/components/primitives/tooltip.tsx"],"sourcesContent":["'use client'\n\nimport * as SelectPrimitive from '@radix-ui/react-select'\nimport { CheckIcon, ChevronDownIcon, X } from 'lucide-react'\nimport {\n type ComponentPropsWithoutRef,\n forwardRef,\n type KeyboardEvent,\n useEffect,\n useRef,\n useState,\n} from 'react'\n\nimport { Separator } from '@/components/primitives/separator'\nimport Chip from '@/components/ui/Chip'\nimport ErrorMessage from '@/components/ui/ErrorMessage'\nimport Label from '@/components/ui/Label'\nimport { cn } from '@/lib/utils'\n\ninterface Props extends Omit<ComponentPropsWithoutRef<'select'>, 'value' | 'onChange'> {\n label?: string\n value?: string | string[]\n options?: { id: string | number; value: string; title: string }[]\n placeholder?: string\n multiselect?: boolean\n description?: string\n error?: string\n classNames?: { label?: string; trigger?: string }\n onChange?: (value: string | string[]) => void\n}\n\nconst Select = forwardRef<HTMLButtonElement, Props>(\n (\n {\n label,\n options,\n placeholder,\n multiselect,\n description,\n classNames,\n error,\n id,\n children: footer,\n ...props\n },\n ref\n ) => {\n const { value, defaultValue, dir, className, onChange, ...rest } = props\n const [selected, setSelected] = useState<string[]>([])\n const [open, setOpen] = useState(false)\n const containerRef = useRef<HTMLDivElement>(null)\n\n useEffect(() => {\n if (!value) return setSelected([])\n setSelected(Array.isArray(value) ? value : [value])\n }, [value])\n\n const toggleOpen = () => setOpen((prev) => !prev)\n const closeOnEscape = (event: KeyboardEvent) => event.key === 'Escape' && setOpen(false)\n const handleOnOpenChange = (isOpen: boolean) => (!multiselect || isOpen) && setOpen(isOpen)\n const setValueOnEnter = (event: KeyboardEvent, value: string) =>\n event.key === 'Enter' && handleChange(value)\n const getLabel = () =>\n selected.map((o) => options?.find((option) => option.value === o)?.title).join(', ')\n\n const chipLabels = selected\n ?.map((s) => options?.find(({ value }) => value === s))\n .filter(Boolean)\n\n function handleChange(newValue: string) {\n if (newValue === '' && !multiselect) return // Prevent clearing single select\n let newSelected: string[] = []\n setSelected((prev) => {\n newSelected = prev.includes(newValue)\n ? prev.filter((item) => item !== newValue)\n : [...prev, newValue]\n return multiselect ? newSelected : [newValue]\n })\n onChange?.(multiselect ? newSelected : newValue)\n }\n\n return (\n <div\n className={cn('flex w-full flex-col gap-1', className)}\n ref={containerRef}\n data-testid={`${(label ?? id)?.toLowerCase()}-select-element`}\n >\n <Label\n text={label}\n htmlFor={props.name}\n required={props.required}\n description={description}\n className={classNames?.label}\n />\n\n <SelectPrimitive.Root\n open={open}\n value={selected.join(',')}\n onOpenChange={handleOnOpenChange}\n onValueChange={multiselect ? undefined : handleChange}\n defaultValue={typeof defaultValue === 'string' ? defaultValue : undefined}\n dir={dir === 'rtl' ? 'rtl' : 'ltr'}\n {...rest}\n >\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n 'group flex h-11 w-full flex-row items-center justify-between gap-3 rounded-lg border px-4 py-3 text-sm font-normal focus:outline-purple-100 disabled:bg-grey-5 data-[placeholder]:text-grey-50 data-[placeholder]:disabled:text-grey-40',\n classNames?.trigger\n )}\n >\n <span className=\"truncate\">\n <SelectPrimitive.Value\n placeholder={placeholder ?? 'Select an option'}\n aria-label={getLabel()}\n >\n {getLabel()}\n </SelectPrimitive.Value>\n </span>\n\n <ChevronDownIcon\n className=\"transform text-black group-data-[state=open]:rotate-180\"\n size=\"16\"\n />\n </SelectPrimitive.Trigger>\n\n <SelectPrimitive.Portal container={containerRef.current}>\n <SelectPrimitive.Content\n hideWhenDetached\n className=\"z-10 max-h-[var(--radix-select-content-available-height)] w-[var(--radix-select-trigger-width)] overflow-hidden rounded-md bg-white py-2 shadow-lg\"\n position=\"popper\"\n sideOffset={4}\n onPointerDownOutside={toggleOpen}\n onKeyDown={closeOnEscape}\n >\n <SelectPrimitive.Viewport>\n {multiselect && !!chipLabels?.length && (\n <>\n <SelectPrimitive.Group\n className=\"mb-2 flex flex-row flex-wrap gap-1 px-2\"\n data-testid=\"selected-labels\"\n >\n {chipLabels?.map(\n (chip) =>\n chip && (\n <Chip key={chip.title} size=\"small\" variant=\"primary\">\n <span>{chip.title}</span>\n <X\n size={18}\n data-testid={`chip-remove-${chip.value}`}\n className=\"cursor-pointer\"\n onClick={() => handleChange(chip.value)}\n />\n </Chip>\n )\n )}\n </SelectPrimitive.Group>\n <Separator />\n </>\n )}\n {options?.map(({ id, title, value }) => (\n <SelectPrimitive.Item\n key={id}\n value={value}\n className=\"group relative cursor-pointer px-4 py-2 text-left text-sm hover:bg-purple-50 focus:bg-purple-50 focus:outline-none data-[state=checked]:bg-purple-50 data-[state=checked]:pr-10 data-[state=checked]:text-purple-100\"\n data-state={selected.includes(value) ? 'checked' : 'unchecked'}\n onKeyDown={(e) => setValueOnEnter(e, value)}\n onClick={() => handleChange(value)}\n >\n <SelectPrimitive.ItemText>{title}</SelectPrimitive.ItemText>\n <CheckIcon\n className=\"absolute inset-y-0 right-3 my-auto hidden w-6 text-purple-100 group-data-[state=checked]:block\"\n size={16}\n />\n </SelectPrimitive.Item>\n ))}\n\n {!!footer && (\n <>\n <Separator />\n <SelectPrimitive.Group\n className=\"mt-2 flex flex-row flex-wrap gap-1 px-2\"\n data-testid=\"selected-labels\"\n >\n {footer}\n </SelectPrimitive.Group>\n </>\n )}\n </SelectPrimitive.Viewport>\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n </SelectPrimitive.Root>\n\n <ErrorMessage message={error} />\n </div>\n )\n }\n)\n\nSelect.displayName = 'Select'\n\nexport default Select\n","'use client'\r\n\r\nimport * as SeparatorPrimitive from '@radix-ui/react-separator'\r\nimport * as React from 'react'\r\n\r\nimport { cn } from '@/lib/utils'\r\n\r\nconst Separator = React.forwardRef<\r\n React.ElementRef<typeof SeparatorPrimitive.Root>,\r\n React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>\r\n>(({ className, orientation = 'horizontal', decorative = true, ...props }, ref) => (\r\n <SeparatorPrimitive.Root\r\n ref={ref}\r\n decorative={decorative}\r\n orientation={orientation}\r\n className={cn(\r\n 'shrink-0 bg-grey-10',\r\n orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]',\r\n className\r\n )}\r\n {...props}\r\n />\r\n))\r\nSeparator.displayName = SeparatorPrimitive.Root.displayName\r\n\r\nexport { Separator }\r\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 { cva, type VariantProps } from 'cva'\nimport React from 'react'\nimport { twMerge } from 'tailwind-merge'\n\ninterface ChipProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof chipVariants> {}\n\nconst Chip = ({ className, variant, size, ...props }: ChipProps) => (\n <div className={twMerge(chipVariants({ variant, size, className }))} {...props} />\n)\n\nconst chipVariants = cva(['flex', 'items-center', 'rounded-3xl', 'border', 'w-fit'], {\n variants: {\n variant: {\n neutral: ['text-grey-80', 'border-grey-10'],\n primary: ['text-purple-100', 'border-purple-20'],\n danger: ['text-pumpkin-100', 'border-pumpkin-20'],\n onboarding: ['text-green-100', 'bg-green-10', 'cursor-pointer'],\n onboardingSelected: ['text-white', 'bg-green-90', 'cursor-pointer'],\n },\n size: {\n small: ['text-sm', 'leading-5', 'px-2', 'py-1', 'gap-1.5'],\n medium: ['text-base', 'leading-6', 'px-3', 'py-2', 'gap-2'],\n },\n },\n defaultVariants: {\n variant: 'neutral',\n size: 'medium',\n },\n})\n\nexport default Chip\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,YAAY,qBAAqB;AACjC,SAAS,WAAW,iBAAiB,SAAS;AAC9C;AAAA,EAEE,cAAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACTP,YAAY,wBAAwB;AACpC,YAAY,WAAW;;;ACHvB,SAA0B,YAAY;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ADME;AAJF,IAAM,YAAkB,iBAGtB,CAAC,EAAE,WAAW,cAAc,cAAc,aAAa,MAAM,GAAG,MAAM,GAAG,QACzE;AAAA,EAAoB;AAAA,EAAnB;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA,gBAAgB,eAAe,mBAAmB;AAAA,MAClD;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,UAAU,cAAiC,wBAAK;;;AEvBhD,SAAS,WAA8B;AAEvC,SAAS,WAAAC,gBAAe;AAOtB,gBAAAC,YAAA;AADF,IAAM,OAAO,CAAC,EAAE,WAAW,SAAS,MAAM,GAAG,MAAM,MACjD,gBAAAA,KAAC,SAA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AAA,oCACV,SAAS,MAAM,aAAa,KAAK,KAAK;AAAA;AAAA,gCACxC;AAAA,mCAPS,KAAK,KAQhB;AAAA,4BAEN;AAAA;AAAA,wBACF;AAAA,wBACA,gBAAAA,KAAC,aAAU;AAAA,yBACb;AAAA,sBAED,SAAS,IAAI,CAAC,EAAE,IAAAI,KAAI,OAAO,OAAAD,OAAM,MAChC,gBAAAF;AAAA,wBAAiB;AAAA,wBAAhB;AAAA,0BAEC,OAAOE;AAAA,0BACP,WAAU;AAAA,0BACV,cAAY,SAAS,SAASA,MAAK,IAAI,YAAY;AAAA,0BACnD,WAAW,CAAC,MAAM,gBAAgB,GAAGA,MAAK;AAAA,0BAC1C,SAAS,MAAM,aAAaA,MAAK;AAAA,0BAEjC;AAAA,4CAAAH,KAAiB,0BAAhB,EAA0B,iBAAM;AAAA,4BACjC,gBAAAA;AAAA,8BAAC;AAAA;AAAA,gCACC,WAAU;AAAA,gCACV,MAAM;AAAA;AAAA,4BACR;AAAA;AAAA;AAAA,wBAXKI;AAAA,sBAYP,CACD;AAAA,sBAEA,CAAC,CAAC,UACD,gBAAAH,MAAA,YACE;AAAA,wCAAAD,KAAC,aAAU;AAAA,wBACX,gBAAAA;AAAA,0BAAiB;AAAA,0BAAhB;AAAA,4BACC,WAAU;AAAA,4BACV,eAAY;AAAA,4BAEX;AAAA;AAAA,wBACH;AAAA,yBACF;AAAA,uBAEJ;AAAA;AAAA,gBACF,GACF;AAAA;AAAA;AAAA,UACF;AAAA,UAEA,gBAAAA,KAAC,wBAAa,SAAS,OAAO;AAAA;AAAA;AAAA,IAChC;AAAA,EAEJ;AACF;AAEA,OAAO,cAAc;AAErB,IAAO,iBAAQ;","names":["forwardRef","twMerge","jsx","jsx","React","jsx","jsx","jsx","jsxs","forwardRef","value","id"]}
|
|
@@ -0,0 +1,83 @@
|
|
|
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/Switch.tsx
|
|
31
|
+
var Switch_exports = {};
|
|
32
|
+
__export(Switch_exports, {
|
|
33
|
+
Switch: () => Switch
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(Switch_exports);
|
|
36
|
+
var SwitchPrimitive = __toESM(require("@radix-ui/react-switch"), 1);
|
|
37
|
+
var import_react = require("react");
|
|
38
|
+
|
|
39
|
+
// src/lib/utils.ts
|
|
40
|
+
var import_clsx = require("clsx");
|
|
41
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
42
|
+
function cn(...inputs) {
|
|
43
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// src/components/ui/ErrorMessage.tsx
|
|
47
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
48
|
+
function ErrorMessage({ message, className, ...props }) {
|
|
49
|
+
if (!message) return null;
|
|
50
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: cn("px-1 text-xs text-red-600", className), ...props, children: message });
|
|
51
|
+
}
|
|
52
|
+
var ErrorMessage_default = ErrorMessage;
|
|
53
|
+
|
|
54
|
+
// src/components/ui/Switch.tsx
|
|
55
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
56
|
+
var Switch = (0, import_react.forwardRef)(
|
|
57
|
+
({ label, error, className, ...props }, ref) => {
|
|
58
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: cn("flex items-center", props.disabled && "opacity-50"), children: [
|
|
59
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
60
|
+
SwitchPrimitive.Root,
|
|
61
|
+
{
|
|
62
|
+
className: cn(
|
|
63
|
+
"relative h-[25px] w-[42px] cursor-default rounded-full bg-grey-20 shadow-md outline-none focus:outline-purple-100 data-[state=checked]:bg-green-90",
|
|
64
|
+
className
|
|
65
|
+
),
|
|
66
|
+
ref,
|
|
67
|
+
...props,
|
|
68
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SwitchPrimitive.Thumb, { className: "block h-[21px] w-[21px] translate-x-0.5 rounded-full bg-white shadow-[0_2px_2px] transition-transform duration-100 will-change-transform data-[state=checked]:translate-x-[19px]" })
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("label", { className: "pl-4 text-sm leading-none text-inherit", htmlFor: props.name, children: [
|
|
72
|
+
label,
|
|
73
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ErrorMessage_default, { message: error, className: "mt-1" })
|
|
74
|
+
] })
|
|
75
|
+
] });
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
Switch.displayName = "Switch";
|
|
79
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
80
|
+
0 && (module.exports = {
|
|
81
|
+
Switch
|
|
82
|
+
});
|
|
83
|
+
//# sourceMappingURL=Switch.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ui/Switch.tsx","../../../src/lib/utils.ts","../../../src/components/ui/ErrorMessage.tsx"],"sourcesContent":["import * as SwitchPrimitive from '@radix-ui/react-switch'\nimport { forwardRef } from 'react'\n\nimport ErrorMessage from '@/components/ui/ErrorMessage'\nimport { cn } from '@/lib/utils'\n\ninterface Props extends SwitchPrimitive.SwitchProps {\n label?: string\n error?: string\n}\n\nexport const Switch = forwardRef<HTMLButtonElement, Props>(\n ({ label, error, className, ...props }, ref) => {\n return (\n <div className={cn('flex items-center', props.disabled && 'opacity-50')}>\n <SwitchPrimitive.Root\n className={cn(\n 'relative h-[25px] w-[42px] cursor-default rounded-full bg-grey-20 shadow-md outline-none focus:outline-purple-100 data-[state=checked]:bg-green-90',\n className\n )}\n ref={ref}\n {...props}\n >\n <SwitchPrimitive.Thumb className=\"block h-[21px] w-[21px] translate-x-0.5 rounded-full bg-white shadow-[0_2px_2px] transition-transform duration-100 will-change-transform data-[state=checked]:translate-x-[19px]\" />\n </SwitchPrimitive.Root>\n {label && (\n <label className=\"pl-4 text-sm leading-none text-inherit\" htmlFor={props.name}>\n {label}\n\n <ErrorMessage message={error} className=\"mt-1\" />\n </label>\n )}\n </div>\n )\n }\n)\nSwitch.displayName = 'Switch'\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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAiC;AACjC,mBAA2B;;;ACD3B,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;;;AFKL,IAAAA,sBAAA;AAZH,IAAM,aAAS;AAAA,EACpB,CAAC,EAAE,OAAO,OAAO,WAAW,GAAG,MAAM,GAAG,QAAQ;AAC9C,WACE,8CAAC,SAAI,WAAW,GAAG,qBAAqB,MAAM,YAAY,YAAY,GACpE;AAAA;AAAA,QAAiB;AAAA,QAAhB;AAAA,UACC,WAAW;AAAA,YACT;AAAA,YACA;AAAA,UACF;AAAA,UACA;AAAA,UACC,GAAG;AAAA,UAEJ,uDAAiB,uBAAhB,EAAsB,WAAU,oLAAmL;AAAA;AAAA,MACtN;AAAA,MACC,SACC,8CAAC,WAAM,WAAU,0CAAyC,SAAS,MAAM,MACtE;AAAA;AAAA,QAED,6CAAC,wBAAa,SAAS,OAAO,WAAU,QAAO;AAAA,SACjD;AAAA,OAEJ;AAAA,EAEJ;AACF;AACA,OAAO,cAAc;","names":["import_jsx_runtime"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as SwitchPrimitive from '@radix-ui/react-switch';
|
|
3
|
+
|
|
4
|
+
interface Props extends SwitchPrimitive.SwitchProps {
|
|
5
|
+
label?: string;
|
|
6
|
+
error?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const Switch: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLButtonElement>>;
|
|
9
|
+
|
|
10
|
+
export { Switch };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as SwitchPrimitive from '@radix-ui/react-switch';
|
|
3
|
+
|
|
4
|
+
interface Props extends SwitchPrimitive.SwitchProps {
|
|
5
|
+
label?: string;
|
|
6
|
+
error?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const Switch: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLButtonElement>>;
|
|
9
|
+
|
|
10
|
+
export { Switch };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// src/components/ui/Switch.tsx
|
|
2
|
+
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
|
|
5
|
+
// src/lib/utils.ts
|
|
6
|
+
import { clsx } from "clsx";
|
|
7
|
+
import { twMerge } from "tailwind-merge";
|
|
8
|
+
function cn(...inputs) {
|
|
9
|
+
return twMerge(clsx(inputs));
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// src/components/ui/ErrorMessage.tsx
|
|
13
|
+
import { jsx } from "react/jsx-runtime";
|
|
14
|
+
function ErrorMessage({ message, className, ...props }) {
|
|
15
|
+
if (!message) return null;
|
|
16
|
+
return /* @__PURE__ */ jsx("p", { className: cn("px-1 text-xs text-red-600", className), ...props, children: message });
|
|
17
|
+
}
|
|
18
|
+
var ErrorMessage_default = ErrorMessage;
|
|
19
|
+
|
|
20
|
+
// src/components/ui/Switch.tsx
|
|
21
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
22
|
+
var Switch = forwardRef(
|
|
23
|
+
({ label, error, className, ...props }, ref) => {
|
|
24
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center", props.disabled && "opacity-50"), children: [
|
|
25
|
+
/* @__PURE__ */ jsx2(
|
|
26
|
+
SwitchPrimitive.Root,
|
|
27
|
+
{
|
|
28
|
+
className: cn(
|
|
29
|
+
"relative h-[25px] w-[42px] cursor-default rounded-full bg-grey-20 shadow-md outline-none focus:outline-purple-100 data-[state=checked]:bg-green-90",
|
|
30
|
+
className
|
|
31
|
+
),
|
|
32
|
+
ref,
|
|
33
|
+
...props,
|
|
34
|
+
children: /* @__PURE__ */ jsx2(SwitchPrimitive.Thumb, { className: "block h-[21px] w-[21px] translate-x-0.5 rounded-full bg-white shadow-[0_2px_2px] transition-transform duration-100 will-change-transform data-[state=checked]:translate-x-[19px]" })
|
|
35
|
+
}
|
|
36
|
+
),
|
|
37
|
+
label && /* @__PURE__ */ jsxs("label", { className: "pl-4 text-sm leading-none text-inherit", htmlFor: props.name, children: [
|
|
38
|
+
label,
|
|
39
|
+
/* @__PURE__ */ jsx2(ErrorMessage_default, { message: error, className: "mt-1" })
|
|
40
|
+
] })
|
|
41
|
+
] });
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
Switch.displayName = "Switch";
|
|
45
|
+
export {
|
|
46
|
+
Switch
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=Switch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ui/Switch.tsx","../../../src/lib/utils.ts","../../../src/components/ui/ErrorMessage.tsx"],"sourcesContent":["import * as SwitchPrimitive from '@radix-ui/react-switch'\nimport { forwardRef } from 'react'\n\nimport ErrorMessage from '@/components/ui/ErrorMessage'\nimport { cn } from '@/lib/utils'\n\ninterface Props extends SwitchPrimitive.SwitchProps {\n label?: string\n error?: string\n}\n\nexport const Switch = forwardRef<HTMLButtonElement, Props>(\n ({ label, error, className, ...props }, ref) => {\n return (\n <div className={cn('flex items-center', props.disabled && 'opacity-50')}>\n <SwitchPrimitive.Root\n className={cn(\n 'relative h-[25px] w-[42px] cursor-default rounded-full bg-grey-20 shadow-md outline-none focus:outline-purple-100 data-[state=checked]:bg-green-90',\n className\n )}\n ref={ref}\n {...props}\n >\n <SwitchPrimitive.Thumb className=\"block h-[21px] w-[21px] translate-x-0.5 rounded-full bg-white shadow-[0_2px_2px] transition-transform duration-100 will-change-transform data-[state=checked]:translate-x-[19px]\" />\n </SwitchPrimitive.Root>\n {label && (\n <label className=\"pl-4 text-sm leading-none text-inherit\" htmlFor={props.name}>\n {label}\n\n <ErrorMessage message={error} className=\"mt-1\" />\n </label>\n )}\n </div>\n )\n }\n)\nSwitch.displayName = 'Switch'\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"],"mappings":";AAAA,YAAY,qBAAqB;AACjC,SAAS,kBAAkB;;;ACD3B,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;;;AFKL,gBAAAA,MAGA,YAHA;AAZH,IAAM,SAAS;AAAA,EACpB,CAAC,EAAE,OAAO,OAAO,WAAW,GAAG,MAAM,GAAG,QAAQ;AAC9C,WACE,qBAAC,SAAI,WAAW,GAAG,qBAAqB,MAAM,YAAY,YAAY,GACpE;AAAA,sBAAAA;AAAA,QAAiB;AAAA,QAAhB;AAAA,UACC,WAAW;AAAA,YACT;AAAA,YACA;AAAA,UACF;AAAA,UACA;AAAA,UACC,GAAG;AAAA,UAEJ,0BAAAA,KAAiB,uBAAhB,EAAsB,WAAU,oLAAmL;AAAA;AAAA,MACtN;AAAA,MACC,SACC,qBAAC,WAAM,WAAU,0CAAyC,SAAS,MAAM,MACtE;AAAA;AAAA,QAED,gBAAAA,KAAC,wBAAa,SAAS,OAAO,WAAU,QAAO;AAAA,SACjD;AAAA,OAEJ;AAAA,EAEJ;AACF;AACA,OAAO,cAAc;","names":["jsx"]}
|
|
@@ -34,9 +34,9 @@ __export(buttonShadcn_exports, {
|
|
|
34
34
|
buttonVariants: () => buttonVariants
|
|
35
35
|
});
|
|
36
36
|
module.exports = __toCommonJS(buttonShadcn_exports);
|
|
37
|
-
var React = __toESM(require("react"), 1);
|
|
38
37
|
var import_react_slot = require("@radix-ui/react-slot");
|
|
39
38
|
var import_class_variance_authority = require("class-variance-authority");
|
|
39
|
+
var React = __toESM(require("react"), 1);
|
|
40
40
|
|
|
41
41
|
// src/lib/utils.ts
|
|
42
42
|
var import_clsx = require("clsx");
|
|
@@ -75,14 +75,7 @@ var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
|
75
75
|
var Button = React.forwardRef(
|
|
76
76
|
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
77
77
|
const Comp = asChild ? import_react_slot.Slot : "button";
|
|
78
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
79
|
-
Comp,
|
|
80
|
-
{
|
|
81
|
-
className: cn(buttonVariants({ variant, size, className })),
|
|
82
|
-
ref,
|
|
83
|
-
...props
|
|
84
|
-
}
|
|
85
|
-
);
|
|
78
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Comp, { className: cn(buttonVariants({ variant, size, className })), ref, ...props });
|
|
86
79
|
}
|
|
87
80
|
);
|
|
88
81
|
Button.displayName = "Button";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ui/buttonShadcn.tsx","../../../src/lib/utils.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ui/buttonShadcn.tsx","../../../src/lib/utils.ts"],"sourcesContent":["import { Slot } from '@radix-ui/react-slot'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\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:\n '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 className={cn(buttonVariants({ variant, size, className }))} ref={ref} {...props} />\n )\n }\n)\nButton.displayName = 'Button'\n\nexport { Button, buttonVariants }\n","import { type ClassValue, clsx } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAqB;AACrB,sCAAuC;AACvC,YAAuB;;;ACFvB,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;AD0CM;AAzCN,IAAM,qBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SACE;AAAA,QACF,aACE;AAAA,QACF,SACE;AAAA,QACF,WACE;AAAA,QACF,OACE;AAAA,QACF,MAAM;AAAA,MACR;AAAA,MACA,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,IACR;AAAA,EACF;AACF;AAQA,IAAM,SAAe;AAAA,EACnB,CAAC,EAAE,WAAW,SAAS,MAAM,UAAU,OAAO,GAAG,MAAM,GAAG,QAAQ;AAChE,UAAM,OAAO,UAAU,yBAAO;AAC9B,WACE,4CAAC,QAAK,WAAW,GAAG,eAAe,EAAE,SAAS,MAAM,UAAU,CAAC,CAAC,GAAG,KAAW,GAAG,OAAO;AAAA,EAE5F;AACF;AACA,OAAO,cAAc;","names":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as cva_types from 'cva/types';
|
|
2
|
-
import * as React from 'react';
|
|
3
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import * as React from 'react';
|
|
4
4
|
|
|
5
5
|
declare const buttonVariants: (props?: ({
|
|
6
|
-
variant?: "
|
|
6
|
+
variant?: "default" | "link" | "outline" | "secondary" | "destructive" | "ghost" | null | undefined;
|
|
7
7
|
size?: "default" | "icon" | "sm" | "lg" | null | undefined;
|
|
8
8
|
} & cva_types.ClassProp) | undefined) => string;
|
|
9
9
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as cva_types from 'cva/types';
|
|
2
|
-
import * as React from 'react';
|
|
3
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import * as React from 'react';
|
|
4
4
|
|
|
5
5
|
declare const buttonVariants: (props?: ({
|
|
6
|
-
variant?: "
|
|
6
|
+
variant?: "default" | "link" | "outline" | "secondary" | "destructive" | "ghost" | null | undefined;
|
|
7
7
|
size?: "default" | "icon" | "sm" | "lg" | null | undefined;
|
|
8
8
|
} & cva_types.ClassProp) | undefined) => string;
|
|
9
9
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/components/ui/buttonShadcn.tsx
|
|
2
|
-
import * as React from "react";
|
|
3
2
|
import { Slot } from "@radix-ui/react-slot";
|
|
4
3
|
import { cva } from "class-variance-authority";
|
|
4
|
+
import * as React from "react";
|
|
5
5
|
|
|
6
6
|
// src/lib/utils.ts
|
|
7
7
|
import { clsx } from "clsx";
|
|
@@ -40,14 +40,7 @@ var buttonVariants = cva(
|
|
|
40
40
|
var Button = React.forwardRef(
|
|
41
41
|
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
42
42
|
const Comp = asChild ? Slot : "button";
|
|
43
|
-
return /* @__PURE__ */ jsx(
|
|
44
|
-
Comp,
|
|
45
|
-
{
|
|
46
|
-
className: cn(buttonVariants({ variant, size, className })),
|
|
47
|
-
ref,
|
|
48
|
-
...props
|
|
49
|
-
}
|
|
50
|
-
);
|
|
43
|
+
return /* @__PURE__ */ jsx(Comp, { className: cn(buttonVariants({ variant, size, className })), ref, ...props });
|
|
51
44
|
}
|
|
52
45
|
);
|
|
53
46
|
Button.displayName = "Button";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ui/buttonShadcn.tsx","../../../src/lib/utils.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ui/buttonShadcn.tsx","../../../src/lib/utils.ts"],"sourcesContent":["import { Slot } from '@radix-ui/react-slot'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\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:\n '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 className={cn(buttonVariants({ variant, size, className }))} ref={ref} {...props} />\n )\n }\n)\nButton.displayName = 'Button'\n\nexport { Button, buttonVariants }\n","import { type ClassValue, clsx } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n"],"mappings":";AAAA,SAAS,YAAY;AACrB,SAAS,WAA8B;AACvC,YAAY,WAAW;;;ACFvB,SAA0B,YAAY;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;AD0CM;AAzCN,IAAM,iBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SACE;AAAA,QACF,aACE;AAAA,QACF,SACE;AAAA,QACF,WACE;AAAA,QACF,OACE;AAAA,QACF,MAAM;AAAA,MACR;AAAA,MACA,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,IACR;AAAA,EACF;AACF;AAQA,IAAM,SAAe;AAAA,EACnB,CAAC,EAAE,WAAW,SAAS,MAAM,UAAU,OAAO,GAAG,MAAM,GAAG,QAAQ;AAChE,UAAM,OAAO,UAAU,OAAO;AAC9B,WACE,oBAAC,QAAK,WAAW,GAAG,eAAe,EAAE,SAAS,MAAM,UAAU,CAAC,CAAC,GAAG,KAAW,GAAG,OAAO;AAAA,EAE5F;AACF;AACA,OAAO,cAAc;","names":[]}
|
|
@@ -37,6 +37,11 @@ module.exports = __toCommonJS(calendar_exports);
|
|
|
37
37
|
var import_lucide_react = require("lucide-react");
|
|
38
38
|
var import_react_day_picker = require("react-day-picker");
|
|
39
39
|
|
|
40
|
+
// src/components/ui/buttonShadcn.tsx
|
|
41
|
+
var import_react_slot = require("@radix-ui/react-slot");
|
|
42
|
+
var import_class_variance_authority = require("class-variance-authority");
|
|
43
|
+
var React = __toESM(require("react"), 1);
|
|
44
|
+
|
|
40
45
|
// src/lib/utils.ts
|
|
41
46
|
var import_clsx = require("clsx");
|
|
42
47
|
var import_tailwind_merge = require("tailwind-merge");
|
|
@@ -45,9 +50,6 @@ function cn(...inputs) {
|
|
|
45
50
|
}
|
|
46
51
|
|
|
47
52
|
// src/components/ui/buttonShadcn.tsx
|
|
48
|
-
var React = __toESM(require("react"), 1);
|
|
49
|
-
var import_react_slot = require("@radix-ui/react-slot");
|
|
50
|
-
var import_class_variance_authority = require("class-variance-authority");
|
|
51
53
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
52
54
|
var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
53
55
|
"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",
|
|
@@ -77,26 +79,14 @@ var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
|
77
79
|
var Button = React.forwardRef(
|
|
78
80
|
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
79
81
|
const Comp = asChild ? import_react_slot.Slot : "button";
|
|
80
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
81
|
-
Comp,
|
|
82
|
-
{
|
|
83
|
-
className: cn(buttonVariants({ variant, size, className })),
|
|
84
|
-
ref,
|
|
85
|
-
...props
|
|
86
|
-
}
|
|
87
|
-
);
|
|
82
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Comp, { className: cn(buttonVariants({ variant, size, className })), ref, ...props });
|
|
88
83
|
}
|
|
89
84
|
);
|
|
90
85
|
Button.displayName = "Button";
|
|
91
86
|
|
|
92
87
|
// src/components/ui/calendar.tsx
|
|
93
88
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
94
|
-
function Calendar({
|
|
95
|
-
className,
|
|
96
|
-
classNames,
|
|
97
|
-
showOutsideDays = true,
|
|
98
|
-
...props
|
|
99
|
-
}) {
|
|
89
|
+
function Calendar({ className, classNames, showOutsideDays = true, ...props }) {
|
|
100
90
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
101
91
|
import_react_day_picker.DayPicker,
|
|
102
92
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ui/calendar.tsx","../../../src/
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ui/calendar.tsx","../../../src/components/ui/buttonShadcn.tsx","../../../src/lib/utils.ts"],"sourcesContent":["'use client'\n\nimport { ChevronLeft, ChevronRight } from 'lucide-react'\nimport * as React from 'react'\nimport { DayPicker } from 'react-day-picker'\n\nimport { buttonVariants } from '@/components/ui/buttonShadcn'\nimport { cn } from '@/lib/utils'\n\nexport type CalendarProps = React.ComponentProps<typeof DayPicker>\n\nfunction Calendar({ className, classNames, showOutsideDays = true, ...props }: 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 { Slot } from '@radix-ui/react-slot'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\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:\n '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 className={cn(buttonVariants({ variant, size, className }))} ref={ref} {...props} />\n )\n }\n)\nButton.displayName = 'Button'\n\nexport { Button, buttonVariants }\n","import { type ClassValue, clsx } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,0BAA0C;AAE1C,8BAA0B;;;ACJ1B,wBAAqB;AACrB,sCAAuC;AACvC,YAAuB;;;ACFvB,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;AD0CM;AAzCN,IAAM,qBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SACE;AAAA,QACF,aACE;AAAA,QACF,SACE;AAAA,QACF,WACE;AAAA,QACF,OACE;AAAA,QACF,MAAM;AAAA,MACR;AAAA,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AAAA,MACA,YAAY;AAAA,QACV,UAAU,CAAC,EAAE,WAAAC,YAAW,GAAGC,OAAM,MAC/B,6CAAC,mCAAY,WAAW,GAAG,WAAWD,UAAS,GAAI,GAAGC,QAAO;AAAA,QAE/D,WAAW,CAAC,EAAE,WAAAD,YAAW,GAAGC,OAAM,MAChC,6CAAC,oCAAa,WAAW,GAAG,WAAWD,UAAS,GAAI,GAAGC,QAAO;AAAA,MAElE;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AACA,SAAS,cAAc;","names":["import_jsx_runtime","className","props"]}
|
|
@@ -4,6 +4,11 @@
|
|
|
4
4
|
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
5
5
|
import { DayPicker } from "react-day-picker";
|
|
6
6
|
|
|
7
|
+
// src/components/ui/buttonShadcn.tsx
|
|
8
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
9
|
+
import { cva } from "class-variance-authority";
|
|
10
|
+
import * as React from "react";
|
|
11
|
+
|
|
7
12
|
// src/lib/utils.ts
|
|
8
13
|
import { clsx } from "clsx";
|
|
9
14
|
import { twMerge } from "tailwind-merge";
|
|
@@ -12,9 +17,6 @@ function cn(...inputs) {
|
|
|
12
17
|
}
|
|
13
18
|
|
|
14
19
|
// src/components/ui/buttonShadcn.tsx
|
|
15
|
-
import * as React from "react";
|
|
16
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
17
|
-
import { cva } from "class-variance-authority";
|
|
18
20
|
import { jsx } from "react/jsx-runtime";
|
|
19
21
|
var buttonVariants = cva(
|
|
20
22
|
"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",
|
|
@@ -44,26 +46,14 @@ var buttonVariants = cva(
|
|
|
44
46
|
var Button = React.forwardRef(
|
|
45
47
|
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
46
48
|
const Comp = asChild ? Slot : "button";
|
|
47
|
-
return /* @__PURE__ */ jsx(
|
|
48
|
-
Comp,
|
|
49
|
-
{
|
|
50
|
-
className: cn(buttonVariants({ variant, size, className })),
|
|
51
|
-
ref,
|
|
52
|
-
...props
|
|
53
|
-
}
|
|
54
|
-
);
|
|
49
|
+
return /* @__PURE__ */ jsx(Comp, { className: cn(buttonVariants({ variant, size, className })), ref, ...props });
|
|
55
50
|
}
|
|
56
51
|
);
|
|
57
52
|
Button.displayName = "Button";
|
|
58
53
|
|
|
59
54
|
// src/components/ui/calendar.tsx
|
|
60
55
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
61
|
-
function Calendar({
|
|
62
|
-
className,
|
|
63
|
-
classNames,
|
|
64
|
-
showOutsideDays = true,
|
|
65
|
-
...props
|
|
66
|
-
}) {
|
|
56
|
+
function Calendar({ className, classNames, showOutsideDays = true, ...props }) {
|
|
67
57
|
return /* @__PURE__ */ jsx2(
|
|
68
58
|
DayPicker,
|
|
69
59
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ui/calendar.tsx","../../../src/
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ui/calendar.tsx","../../../src/components/ui/buttonShadcn.tsx","../../../src/lib/utils.ts"],"sourcesContent":["'use client'\n\nimport { ChevronLeft, ChevronRight } from 'lucide-react'\nimport * as React from 'react'\nimport { DayPicker } from 'react-day-picker'\n\nimport { buttonVariants } from '@/components/ui/buttonShadcn'\nimport { cn } from '@/lib/utils'\n\nexport type CalendarProps = React.ComponentProps<typeof DayPicker>\n\nfunction Calendar({ className, classNames, showOutsideDays = true, ...props }: 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 { Slot } from '@radix-ui/react-slot'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\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:\n '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 className={cn(buttonVariants({ variant, size, className }))} ref={ref} {...props} />\n )\n }\n)\nButton.displayName = 'Button'\n\nexport { Button, buttonVariants }\n","import { type ClassValue, clsx } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n"],"mappings":";;;AAEA,SAAS,aAAa,oBAAoB;AAE1C,SAAS,iBAAiB;;;ACJ1B,SAAS,YAAY;AACrB,SAAS,WAA8B;AACvC,YAAY,WAAW;;;ACFvB,SAA0B,YAAY;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;AD0CM;AAzCN,IAAM,iBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SACE;AAAA,QACF,aACE;AAAA,QACF,SACE;AAAA,QACF,WACE;AAAA,QACF,OACE;AAAA,QACF,MAAM;AAAA,MACR;AAAA,MACA,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,IACR;AAAA,EACF;AACF;AAQA,IAAM,SAAe;AAAA,EACnB,CAAC,EAAE,WAAW,SAAS,MAAM,UAAU,OAAO,GAAG,MAAM,GAAG,QAAQ;AAChE,UAAM,OAAO,UAAU,OAAO;AAC9B,WACE,o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ACN;AAEJ;AACA,SAAS,cAAc;","names":["jsx","className","props"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as zod from 'zod';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { E as EmploymentTypeEnum, a as EmploymentLevelEnum, b as JobFunctionEnum, B as BestFitEnum, C as ClinicalSpecialtyEnum, S as ShiftEnum, c as ClinicalSettingEnum } from './job_posting_service_latest-
|
|
4
|
-
import { U as UnitTextEnum, C as CurrencyEnum } from './shared_pickle_output_latest-
|
|
3
|
+
import { E as EmploymentTypeEnum, a as EmploymentLevelEnum, b as JobFunctionEnum, B as BestFitEnum, C as ClinicalSpecialtyEnum, S as ShiftEnum, c as ClinicalSettingEnum } from './job_posting_service_latest-BOVbz68F.cjs';
|
|
4
|
+
import { U as UnitTextEnum, C as CurrencyEnum } from './shared_pickle_output_latest-DKOmTyYk.cjs';
|
|
5
5
|
|
|
6
6
|
declare const employmentTypeDisplayText: DisplayTextConfig<typeof EmploymentTypeEnum>;
|
|
7
7
|
declare const unitTextDisplayText: DisplayTextConfig<typeof UnitTextEnum>;
|