{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "tw-date-picker",
  "type": "registry:ui",
  "title": "react-tw/date-picker.tsx",
  "description": "Carbon `DatePicker` as a React + Tailwind component, the look and rules of `<ui-date-picker>` on the Copied from @purpurabog/ui 2.3.0; the package is the maintained source, this copy is yours to change. Icons from the Carbon Design System (Apache-2.0, © IBM Corp.; see THIRD-PARTY-NOTICES.md in the package).",
  "dependencies": [
    "@purpurabog/ui@^2.3.0"
  ],
  "registryDependencies": [
    "@kanok-ui/core-date",
    "@kanok-ui/core-field",
    "@kanok-ui/core-i18n",
    "@kanok-ui/tw-calendar",
    "@kanok-ui/tw-field",
    "@kanok-ui/tw-i18n",
    "@kanok-ui/tw-skeleton",
    "@kanok-ui/tw-theme",
    "@kanok-ui/tw-utils"
  ],
  "files": [
    {
      "path": "src/react-tw/date-picker.tsx",
      "type": "registry:ui",
      "target": "components/ui/react-tw/date-picker.tsx",
      "content": "import { useId, type CSSProperties, type ReactNode, type ComponentProps, type Ref } from 'react';\nimport { isThai, type DateFormat, type Era } from '../core/date.ts';\nimport { pickMessage } from '../core/field.ts';\nimport { getTranslation } from '../core/i18n.ts';\nimport { DatePicker as DatePickerPrimitive } from '@purpurabog/ui/headless';\nimport { Calendar, type CalendarProps } from './calendar.tsx';\nimport { FieldLabel, FieldMessageLine, StatusIcon, fluidBoxClasses, fluidControlClasses, useFluid, useFieldDisabled, fieldBoxClasses, fieldStateEdges, fieldInvalidRing, fieldTextSize } from './field.tsx';\nimport { useLanguage, useTranslation } from './lib/i18n.ts';\nimport type { FieldMessage } from '../core/field.ts';\nimport { cn } from './lib/utils.ts';\nimport { FieldSkeleton, type FieldSkeletonProps } from './skeleton.tsx';\n\n/**\n * Carbon `DatePicker` as a React + Tailwind component, the look and rules of `<ui-date-picker>` on the\n * headless `DatePicker` (core/date-picker; WAI-ARIA APG date picker dialog; keyboard and focus traced\n * on Carbon): type the date or pick it. The calendar opens when a text box gets focus and focus stays\n * there; ↓ moves into the calendar and Tab on to the next field; in the calendar Tab and Shift+Tab go round\n * its controls (Cally, the APG dialog), Esc closes. Typed text is committed on blur / Enter: an incomplete,\n * impossible, out-of-range or refused date stays with a message saying why (nothing is guessed). Thai\n * digits become 0–9; Thai shows years in พ.ศ.\n * `range` gives two boxes sharing one calendar (flatpickr rules: an end before the start swaps them).\n * Values are ISO yyyy-mm-dd and are submitted under `name` / `endName`.\n */\ntype Field = 'start' | 'end';\n\nexport interface DatePickerProps extends Omit<ComponentProps<'input'>, 'label' | 'hideLabel' | 'helperText' | 'invalid' | 'invalidText' | 'warn' | 'warnText' | 'value' | 'defaultValue' | 'onChange' | 'range' | 'endValue' | 'defaultEndValue' | 'onEndChange' | 'endLabel' | 'name' | 'endName' | 'min' | 'max' | 'isDateDisabled' | 'format' | 'locale' | 'era' | 'firstDay' | 'disabled' | 'readOnly' | 'required' | 'picker' | 'clearable' | 'showToday' | 'size' | 'id' | 'fluid' | 'className'> {\n    label?: ReactNode;\n    hideLabel?: boolean;\n    /** Under the field; the format hint is the default. */\n    helperText?: ReactNode;\n    /** Forces the error state (e.g. after server-side validation). */\n    invalid?: boolean;\n    invalidText?: ReactNode;\n    warn?: boolean;\n    warnText?: ReactNode;\n    /** ISO yyyy-mm-dd (the start in a range). */\n    value?: string;\n    defaultValue?: string;\n    /** After a committed change: blur, Enter, a pick, clear. */\n    onChange?: (value: string) => void;\n    range?: boolean;\n    endValue?: string;\n    defaultEndValue?: string;\n    onEndChange?: (value: string) => void;\n    /** Range: a calendar pick began a range (its start), as Cally's `rangestart`; `onChange` waits for the end. */\n    onRangeStart?: (date: Date) => void;\n    /** Range: a calendar pick finished a range (its end), as Cally's `rangeend`. */\n    onRangeEnd?: (date: Date) => void;\n    endLabel?: ReactNode;\n    name?: string;\n    endName?: string;\n    min?: string;\n    max?: string;\n    /** Days that can't be chosen; return a string to use it as the message. */\n    isDateDisabled?: (date: Date) => boolean | string;\n    format?: DateFormat;\n    /** Names, labels and messages (default `<html lang>`). */\n    locale?: string;\n    /** Years in พ.ศ. (`be`, default for Thai) or ค.ศ. */\n    era?: Era;\n    /** 0 = Sunday … 6 = Saturday. */\n    firstDay?: number;\n    disabled?: boolean;\n    readOnly?: boolean;\n    required?: boolean;\n    /**\n     * Which picker opens: `auto` (default) = the calendar, in a bottom sheet on a phone (as `<ui-date-picker>`); `custom` =\n     * the calendar as a popover on every device; `sheet` = in a bottom sheet on every device; `native` = the OS date picker.\n     */\n    picker?: 'auto' | 'custom' | 'sheet' | 'native';\n    clearable?: boolean;\n    showToday?: boolean;\n    /** Months side by side in the calendar, 1 to 12 (default 1); they wrap one under the other where they don't fit. */\n    months?: number;\n    /** How far the calendar's ‹ › turn several months: the whole page (default) or one month (`single`). */\n    pageBy?: 'months' | 'single';\n    /** The day the calendar marks as today, ISO (default: the real today). */\n    today?: string;\n    /** The calendar's weekday headings: `narrow` or `short` (default: the translation's). */\n    weekdayFormat?: 'narrow' | 'short';\n    /** An ISO week number before each week of the calendar (its popover widens). */\n    showWeekNumbers?: boolean;\n    /** Show other months' days in the calendar (by default they are empty cells). */\n    showOutsideDays?: boolean;\n    /** Classes of your own for a calendar day (holidays, events …), as Cally's `getDayParts`. */\n    dayClassName?: (date: Date) => string | undefined;\n    size?: 'sm' | 'md' | 'lg';\n    id?: string;\n    /** Carbon `FluidDatePicker`: each date box a 64px box with its label inside; range boxes touch (also set by `FluidForm`). */\n    fluid?: boolean;\n    className?: string;\n}\n\n/** The field heights (--ui-field-height-*), as <ui-date-picker>. */\nconst HEIGHT = { sm: 'var(--ui-field-height-sm, 32px)', md: 'var(--ui-field-height-md, 40px)', lg: 'var(--ui-field-height-lg, 48px)' } as const;\n\n/** A message prop as plain text ('' for markup, which renders on its own). */\nconst textOf = (node: ReactNode) => (typeof node === 'string' ? node : '');\n\nconst calendarIcon = (\n    <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\" className=\"block size-4 fill-current\">\n        <path d=\"M13 2h-2V1h-1v1H6V1H5v1H3a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1Zm0 11H3V6h10v7Zm0-8H3V3h2v1h1V3h4v1h1V3h2v2Z\" />\n    </svg>\n);\n\nconst clearIcon = (\n    <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\" className=\"block size-4 fill-current\">\n        <path d=\"m12 4.7-.7-.7L8 7.3 4.7 4l-.7.7L7.3 8 4 11.3l.7.7L8 8.7l3.3 3.3.7-.7L8.7 8z\" />\n    </svg>\n);\n\n/** The language of the built-in strings and the era (Buddhist for Thai unless set). */\nfunction pickerLocale(resolvedLocale: string, era: Era | undefined) {\n    return { resolvedLocale, era: era ?? (isThai(resolvedLocale) ? 'be' : 'ce') };\n}\n\nconst hasText = (node: ReactNode) => node !== undefined && node !== '';\n\n/** The ids that describe a box (the message, the format hint), space-separated; none when empty. */\nconst joinIds = (...ids: (string | false | null | undefined)[]) => ids.filter(Boolean).join(' ') || undefined;\n\ninterface DateFieldMessageInput {\n    /** The start box: the warning and your helper text show under it only. */\n    first: boolean;\n    showError: boolean;\n    invalid: boolean;\n    invalidText?: ReactNode;\n    /** The box's own error (an unreadable or refused date). */\n    error: string | null;\n    showWarn: boolean;\n    warnText?: ReactNode;\n    helperText?: ReactNode;\n    /** The format hint, the helper by default. */\n    hint: string;\n}\n\n/** A box's message line: your error or its own, the warning, your helper text or the format hint; markup renders as given. */\nfunction dateFieldMessage(o: DateFieldMessageInput) {\n    const ownHelper = o.first && hasText(o.helperText);\n    const message = pickMessage({\n        showError: o.showError,\n        errorText: (o.invalid ? textOf(o.invalidText) : '') || o.error || '',\n        showWarn: o.showWarn && o.first,\n        warnText: textOf(o.warnText),\n        helperText: ownHelper ? textOf(o.helperText) : o.hint,\n        hasWarn: o.first && !!o.warnText,\n        hasHelper: true,\n    });\n    let content: ReactNode = message?.text;\n    if (message?.kind === 'error' && o.invalid && o.invalidText) content = o.invalidText;\n    if (message?.kind === 'warn' && o.warnText) content = o.warnText;\n    if (message?.kind === 'helper' && ownHelper) content = o.helperText;\n    return { message, content, ownHelper };\n}\n\n/** Room at the end for the calendar icon, the clear button and the status icon. */\nfunction datePadding(hasStatus: boolean, showClear: boolean) {\n    if (hasStatus && showClear) return 'pe-[105px]';\n    if (showClear) return 'pe-[70px]';\n    return hasStatus ? 'pe-[72px]' : 'pe-12';\n}\n\nfunction dateInputClasses({ statusKind, showClear, showError, fluid }: { statusKind: FieldMessage['kind'] | undefined; showClear: boolean; showError: boolean; fluid: boolean }) {\n    return cn(\n        'peer m-0 box-border min-h-(--_toggle) w-full ps-4',\n        datePadding(!!statusKind, showClear),\n        fieldBoxClasses,\n        'text-ink type-body-sm',\n        fieldTextSize,\n        'outline-[length:var(--ui-field-focus-width,2px)] [outline-offset:calc(-1*var(--ui-field-focus-width,2px))] outline-transparent placeholder:text-ink-placeholder placeholder:opacity-100 focus:outline-focus focus:[box-shadow:var(--ui-field-focus-halo,none)]',\n        // Carbon date-picker__input: all at fast-01 — its colours and outline (not the padding the × adds; Carbon has no ×)\n        'transition-[background-color,border-bottom-color,color,outline-color] duration-(--ui-duration-fast) ease-carbon',\n        showError && fieldInvalidRing,\n        'disabled:cursor-not-allowed disabled:text-ink-disabled',\n        'read-only:not-disabled:bg-[var(--ui-field-readonly-background,transparent)]',\n        fieldStateEdges,\n        'forced-colors:border forced-colors:border-[FieldText]',\n        fluid && cn('h-16 min-h-16 pt-8 pb-[13px]', fluidControlClasses(statusKind)),\n    );\n}\n\n/** The status icon (fluid: in the message row, 16px from the end) and the × that clears the box (`clearLabel` set). */\nfunction FieldIcons({ kind, fluid, clearLabel, field }: Readonly<{ kind: FieldMessage['kind'] | undefined; fluid: boolean; clearLabel?: string; field: Field }>) {\n    const hasStatus = !!kind && kind !== 'helper';\n    return (\n        <>\n            <span className={cn('pointer-events-none absolute inset-y-0 flex items-center', clearLabel ? 'end-[82px]' : 'end-12', fluid && 'end-0')}>\n                <StatusIcon kind={kind} className={fluid ? 'absolute end-4 top-[calc(100%+8px)]' : undefined} />\n            </span>\n            {clearLabel ? (\n                <DatePickerPrimitive.Clear\n                    field={field}\n                    aria-label={clearLabel}\n                    className={cn(\n                        \"absolute inset-y-0 end-[45px] my-auto flex size-6 cursor-pointer items-center justify-center rounded-[var(--ui-icon-control-radius,0px)] border-0 bg-transparent p-0 text-ink after:absolute after:start-7 after:top-1 after:h-4 after:w-px after:bg-border-subtle-2 after:content-['']\",\n                        hasStatus && \"before:absolute before:-start-[5px] before:top-1 before:h-4 before:w-px before:bg-border-subtle-2 before:content-['']\",\n                        'outline-none focus-visible:outline-[length:var(--ui-focus-width,2px)] focus-visible:outline-solid focus-visible:-outline-offset-2 focus-visible:outline-focus',\n                        fluid && 'top-[31px] bottom-auto',\n                    )}\n                >\n                    {clearIcon}\n                </DatePickerPrimitive.Clear>\n            ) : null}\n        </>\n    );\n}\n\n/** What a date box needs from the picker's props to look right. */\ninterface DateBoxLook {\n    label?: ReactNode;\n    endLabel?: ReactNode;\n    hideLabel?: boolean;\n    helperText?: ReactNode;\n    invalid: boolean;\n    invalidText?: ReactNode;\n    warn: boolean;\n    warnText?: ReactNode;\n    clearable: boolean;\n    fluid: boolean;\n    /** The format, e.g. dd/mm/yyyy: the placeholder. */\n    pattern: string;\n    /** The format hint, the helper by default. */\n    hint: string;\n    clearLabel: string;\n}\n\n/** One text box with its label, icons and message line; the start box takes the input props and the ref. */\nfunction DateBox({ field: f, look, inputProps, inputRef }: Readonly<{ field: Field; look: DateBoxLook; inputProps?: Omit<ComponentProps<'input'>, 'ref'>; inputRef?: Ref<HTMLInputElement> }>) {\n    const ctx = DatePickerPrimitive.useDatePickerContext();\n    const fieldId = f === 'start' ? ctx.id : `${ctx.id}-end`;\n    const showError = ctx.showsError(f);\n    const { message, content, ownHelper } = dateFieldMessage({\n        first: f === 'start',\n        showError,\n        invalid: look.invalid,\n        invalidText: look.invalidText,\n        error: ctx.errors[f],\n        showWarn: look.warn && ctx.interactive,\n        warnText: look.warnText,\n        helperText: look.helperText,\n        hint: look.hint,\n    });\n    const statusKind = message && message.kind !== 'helper' ? message.kind : undefined;\n    const showClear = look.clearable && ctx.interactive && ctx.state.text[f] !== '';\n    const fieldLabel = f === 'start' ? look.label : look.endLabel;\n    const describedBy = joinIds(message && `${fieldId}-message`, ownHelper && `${fieldId}-hint`);\n    return (\n        <div className={cn('block', look.fluid && fluidBoxClasses(statusKind, ctx.readOnly))}>\n            {hasText(fieldLabel) ? (\n                <FieldLabel htmlFor={fieldId} hidden={look.hideLabel} disabled={ctx.disabled} fluid={look.fluid}>\n                    {fieldLabel}\n                </FieldLabel>\n            ) : null}\n            <div className=\"relative\">\n                <DatePickerPrimitive.Input {...inputProps}\n                    ref={inputRef}\n                    field={f}\n                    placeholder={look.pattern}\n                    aria-describedby={describedBy}\n                    className={dateInputClasses({ statusKind, showClear, showError, fluid: look.fluid })}\n                />\n                <DatePickerPrimitive.NativeInput field={f} className=\"pointer-events-none absolute inset-0 m-0 size-full border-0 p-0 opacity-0\" />\n                {ownHelper ? (\n                    <span className=\"sr-only\" id={`${fieldId}-hint`}>\n                        {look.hint}\n                    </span>\n                ) : null}\n                <FieldIcons kind={message?.kind} fluid={look.fluid} clearLabel={showClear ? look.clearLabel : undefined} field={f} />\n                <span\n                    aria-hidden=\"true\"\n                    className={cn('pointer-events-none absolute inset-y-0 end-0 flex w-12 items-center justify-center text-icon-primary peer-disabled:text-icon-disabled', look.fluid && 'top-[23px] bottom-auto h-10')}\n                >\n                    {calendarIcon}\n                </span>\n            </div>\n            <FieldMessageLine id={`${fieldId}-message`} message={message} content={content} disabled={ctx.disabled} fluid={look.fluid} />\n        </div>\n    );\n}\n\ntype PickerCalendarProps = Pick<CalendarProps, 'months' | 'pageBy' | 'today' | 'weekdayFormat' | 'showWeekNumbers' | 'showOutsideDays' | 'dayClassName'> & { locale: string; firstDay: number; showToday: boolean };\n\n/** The calendar in the popup, on the picker's state. */\nfunction PickerCalendar(props: Readonly<PickerCalendarProps>) {\n    const { calendar } = DatePickerPrimitive.useDatePickerContext();\n    return <Calendar {...calendar} {...props} />;\n}\n\nexport function DatePicker({\n    label,\n    hideLabel,\n    helperText,\n    invalid = false,\n    invalidText,\n    warn = false,\n    warnText,\n    value,\n    defaultValue = '',\n    onChange,\n    range = false,\n    endValue,\n    defaultEndValue = '',\n    onEndChange,\n    onRangeStart,\n    onRangeEnd,\n    endLabel,\n    name,\n    endName,\n    min = '',\n    max = '',\n    isDateDisabled,\n    format = 'dd/mm/yyyy',\n    locale,\n    era: eraProp,\n    firstDay = 0,\n    disabled: ownDisabled,\n    readOnly = false,\n    required = false,\n    picker = 'auto',\n    clearable = false,\n    showToday = false,\n    months = 1,\n    pageBy = 'months',\n    today,\n    weekdayFormat,\n    showWeekNumbers = false,\n    showOutsideDays = false,\n    dayClassName,\n    size = 'md',\n    id,\n    fluid: fluidProp,\n    className,\n    ref,\n    ...rest\n}: Readonly<DatePickerProps>) {\n    const disabled = useFieldDisabled(ownDisabled);\n    useTranslation(locale); // re-render on <html lang> / translation changes\n    const fluid = useFluid(fluidProp);\n    const { resolvedLocale, era } = pickerLocale(useLanguage(locale), eraProp);\n    const translation = getTranslation(resolvedLocale);\n    const m = translation.datePicker;\n    const pattern = m.pattern(format);\n    const autoId = useId();\n    const fields: Field[] = range ? ['start', 'end'] : ['start'];\n    const look: DateBoxLook = { label, endLabel, hideLabel, helperText, invalid, invalidText, warn, warnText, clearable, fluid, pattern, hint: m.hint(pattern), clearLabel: m.clear };\n\n    return (\n        <div style={{ '--_toggle': HEIGHT[size] } as CSSProperties} className={cn('block font-sans', className)}>\n            <DatePickerPrimitive.Root\n                value={value}\n                defaultValue={defaultValue}\n                onValueChange={onChange}\n                range={range}\n                endValue={endValue}\n                defaultEndValue={defaultEndValue}\n                onEndValueChange={onEndChange}\n                onRangeStart={onRangeStart}\n                onRangeEnd={onRangeEnd}\n                name={name}\n                endName={endName}\n                min={min}\n                max={max}\n                isDateDisabled={isDateDisabled}\n                format={format}\n                era={era}\n                locale={resolvedLocale}\n                disabled={disabled}\n                readOnly={readOnly}\n                required={required}\n                invalid={invalid}\n                invalidMessage={typeof invalidText === 'string' ? invalidText : ''}\n                picker={picker}\n                id={id ?? autoId}\n            >\n                {/* Carbon fluid range: the two boxes touch */}\n                <DatePickerPrimitive.Group className={cn(range && 'grid grid-cols-2 items-start gap-x-px', range && fluid && 'gap-x-0')}>\n                    {fields.map((f) => (f === 'start' ? <DateBox key={f} field={f} look={look} inputProps={rest} inputRef={ref} /> : <DateBox key={f} field={f} look={look} />))}\n                </DatePickerPrimitive.Group>\n                <DatePickerPrimitive.Popup\n                    aria-label={m.chooseDate}\n                    className={cn(\n                        // the menu settings (--ui-menu-*), as the dropdown lists: a design rounds and outlines both alike\n                        'absolute inset-auto m-0 box-border w-[var(--ui-calendar-width,288px)] ui-menu-edge rounded-[var(--ui-menu-radius,0px)] bg-[var(--ui-overlay-background,var(--ui-surface-1))] px-1 pt-1 pb-2 text-ink [--_ui-calendar-surface:var(--ui-overlay-background,var(--ui-surface-1))]',\n                        'shadow-[var(--ui-menu-shadow,0_2px_6px_rgb(0_0_0/0.3))] forced-colors:border forced-colors:border-solid forced-colors:border-[CanvasText]',\n                        // Carbon flatpickr-calendar.animate.open: fades in from 20px above (it closes at once)\n                        'motion-safe:open:animate-ui-calendar-open',\n                        // several months or the week numbers' eighth column: as wide as they need, within the viewport (as <ui-date-picker>)\n                        (months > 1 || showWeekNumbers) && 'w-max max-w-[calc(100vw-32px)] data-sheet:max-w-none',\n                        // in the bottom sheet: a full-width panel, the calendar centred, rounded on top, clear of the safe-area insets\n                        'data-sheet:static data-sheet:flex data-sheet:w-full data-sheet:flex-col data-sheet:items-center data-sheet:max-h-[calc(100dvh-var(--ui-space-xl))] data-sheet:overflow-y-auto data-sheet:overscroll-contain',\n                        'data-sheet:pt-0 data-sheet:pr-[max(var(--ui-space-xs),env(safe-area-inset-right))] data-sheet:pb-[calc(var(--ui-space-md)+env(safe-area-inset-bottom))] data-sheet:pl-[max(var(--ui-space-xs),env(safe-area-inset-left))]',\n                        'data-sheet:rounded-b-none data-sheet:rounded-t-[var(--ui-sheet-radius,var(--ui-menu-radius,0px))] data-sheet:animate-none',\n                    )}\n                    // the bottom sheet's <dialog>: pinned to the bottom edge over the modal's scrim, rising in; a swipe moves it, short of closing it springs back\n                    sheetClassName={cn(\n                        'fixed inset-x-0 top-auto bottom-0 m-0 box-border max-h-full w-full max-w-none overflow-visible border-0 bg-transparent p-0 text-ink',\n                        'transition-[translate] duration-(--ui-duration-moderate) ease-carbon data-dragging:transition-none',\n                        'backdrop:bg-[var(--ui-modal-scrim,rgb(22_22_22/0.5))] open:animate-ui-sheet-open',\n                    )}\n                >\n                    <DatePickerPrimitive.SheetGrip className=\"relative flex h-12 flex-none cursor-grab justify-center self-stretch\">\n                        <span aria-hidden=\"true\" className=\"mt-2 h-1 w-8 rounded-[2px] bg-icon-secondary forced-colors:bg-[CanvasText]\" />\n                        <DatePickerPrimitive.SheetClose\n                            aria-label={translation.common.close}\n                            className=\"absolute end-0 top-0 grid size-12 cursor-pointer place-items-center border-0 bg-transparent p-0 text-ink transition-[background-color] duration-(--ui-duration-moderate) ease-carbon hover:bg-ghost-hover focus-visible:outline-[length:var(--ui-focus-width,2px)] focus-visible:-outline-offset-2 focus-visible:outline-focus [&_svg]:size-5 [&_svg]:fill-current\"\n                        >\n                            <svg viewBox=\"0 0 32 32\" aria-hidden=\"true\">\n                                <path d=\"M24 9.4 22.6 8 16 14.6 9.4 8 8 9.4l6.6 6.6L8 22.6 9.4 24l6.6-6.6 6.6 6.6 1.4-1.4-6.6-6.6z\" />\n                            </svg>\n                        </DatePickerPrimitive.SheetClose>\n                    </DatePickerPrimitive.SheetGrip>\n                    <PickerCalendar\n                        locale={resolvedLocale}\n                        firstDay={firstDay}\n                        showToday={showToday}\n                        months={months}\n                        pageBy={pageBy}\n                        today={today}\n                        weekdayFormat={weekdayFormat}\n                        showWeekNumbers={showWeekNumbers}\n                        showOutsideDays={showOutsideDays}\n                        dayClassName={dayClassName}\n                    />\n                </DatePickerPrimitive.Popup>\n            </DatePickerPrimitive.Root>\n        </div>\n    );\n}\n\nconst calendarPath = 'M13 2h-2V1h-1v1H6V1H5v1H3a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1Zm0 11H3V6h10v7Zm0-8H3V3h2v1h1V3h4v1h1V3h2v2Z';\n\n/**\n * Carbon `DatePickerSkeleton`: a label bar and a 143.5px field bar; `range` draws two, 1px apart. `fluid` (Carbon\n * `FluidDatePickerSkeleton`): a 64px box with the bars and the calendar icon 16px from the end and bottom; `range`\n * halves it with a 1px line between. Hidden from assistive tech.\n */\nexport function DatePickerSkeleton({ range = false, size = 'md', hideLabel = false, fluid: fluidProp, className, ...rest }: Readonly<FieldSkeletonProps & { range?: boolean }>) {\n    const fluid = useFluid(fluidProp);\n    if (fluid) {\n        const half = (first: boolean) => (\n            <div className={cn('relative box-border h-full', range && 'w-1/2 flex-none', range && first && 'border-0 border-e border-solid border-skeleton-element')}>\n                <span className=\"skeleton absolute start-4 top-4 block h-2 w-1/4\" />\n                <span className=\"skeleton absolute start-4 top-9 block h-2 w-1/2\" />\n                <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\" className=\"absolute end-4 bottom-4 size-4 fill-icon-primary\">\n                    <path d={calendarPath} />\n                </svg>\n            </div>\n        );\n        return (\n            <div {...rest} aria-hidden=\"true\" className={cn('block', className)}>\n                <div className={cn('relative box-border h-16 border-0 border-b border-solid border-skeleton-element bg-skeleton-background', range && 'flex')}>\n                    {half(true)}\n                    {range ? half(false) : null}\n                </div>\n            </div>\n        );\n    }\n    const input = <FieldSkeleton size={size} hideLabel={hideLabel} className=\"w-[143.5px]\" />;\n    return (\n        <div {...rest} aria-hidden=\"true\" className={cn('flex gap-px', className)}>\n            {input}\n            {range ? input : null}\n        </div>\n    );\n}\n"
    }
  ]
}
