@takeoff-ui/react-spar 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,7 +1,8 @@
1
1
  import * as react from 'react';
2
- import { HTMLAttributes, ElementType, ComponentPropsWithoutRef, ReactNode, Ref, ImgHTMLAttributes } from 'react';
3
- import { PolymorphicProps, AccordionProps as AccordionProps$1, AccordionItemProps as AccordionItemProps$1, AccordionHeaderProps as AccordionHeaderProps$1, AccordionContentProps as AccordionContentProps$1, BreadcrumbProps as BreadcrumbProps$1, BreadcrumbItemRenderProps, BreadcrumbLinkProps as BreadcrumbLinkProps$1, NavigationHandler, PressEvent, ButtonProps as ButtonProps$1, CheckboxRenderProps as CheckboxRenderProps$1, CheckboxProps as CheckboxProps$1, DialogProps as DialogProps$1, DialogTriggerProps as DialogTriggerProps$1, DialogOverlayProps as DialogOverlayProps$1, DialogContentProps, DialogTitleProps as DialogTitleProps$1, DialogCloseProps as DialogCloseProps$1, DropdownMenuProps, DropdownMenuTriggerProps, DropdownMenuContentProps, DropdownMenuViewportProps, DropdownMenuItemProps, DropdownMenuGroupProps, DropdownMenuLabelProps, DropdownMenuSeparatorProps, DropdownMenuArrowProps, FieldProps as FieldProps$1, FieldLabelProps as FieldLabelProps$1, FieldDescriptionProps as FieldDescriptionProps$1, FieldErrorMessageProps as FieldErrorMessageProps$1, InputProps as InputProps$1, InputFieldProps as InputFieldProps$1, LabelProps as LabelProps$1, RadioProps as RadioProps$1, RadioItemRenderProps, RadioItemProps as RadioItemProps$1, PopoverProps as PopoverProps$1, PopoverTriggerProps as PopoverTriggerProps$1, PopoverContentProps as PopoverContentProps$1, PopoverCloseProps as PopoverCloseProps$1, SelectProps as SelectProps$1, SelectTriggerProps as SelectTriggerProps$1, SelectContentProps as SelectContentProps$1, SelectViewportProps as SelectViewportProps$1, SelectItemProps as SelectItemProps$1, SelectGroupProps as SelectGroupProps$1, SelectLabelProps as SelectLabelProps$1, SelectSeparatorProps as SelectSeparatorProps$1, SwitchRenderProps as SwitchRenderProps$1, SwitchProps as SwitchProps$1, TabsProps as TabsProps$1, TabsListProps as TabsListProps$1, TabsTriggerRenderProps as TabsTriggerRenderProps$1, TabsTriggerProps as TabsTriggerProps$1, TabsContentProps as TabsContentProps$1, TabsActivationMode as TabsActivationMode$1, TooltipTriggerProps as TooltipTriggerProps$1, TooltipContentProps as TooltipContentProps$1, TooltipProps as TooltipProps$1, TooltipProviderProps as TooltipProviderProps$1, ToasterController, ToastData as ToastData$1, ToasterProps as ToasterProps$1, ToastOptions as ToastOptions$1 } from '@turkish-technology/spar';
4
- export { BreadcrumbItemRenderProps, BreadcrumbPosition, CreateToasterOptions, ToastAnnouncement, ToastPlacement, ToastPromiseOptions, ToastStatus, ToastType, ToastUpdateOptions, ToasterController, createToaster } from '@turkish-technology/spar';
2
+ import { HTMLAttributes, ElementType, ComponentPropsWithoutRef, ReactNode, Ref, ImgHTMLAttributes, KeyboardEvent } from 'react';
3
+ import { PolymorphicProps, AccordionProps as AccordionProps$1, AccordionItemProps as AccordionItemProps$1, AccordionHeaderProps as AccordionHeaderProps$1, AccordionContentProps as AccordionContentProps$1, BreadcrumbProps as BreadcrumbProps$1, BreadcrumbItemRenderProps, BreadcrumbLinkProps as BreadcrumbLinkProps$1, NavigationHandler, PressEvent, ButtonProps as ButtonProps$1, CheckboxRenderProps as CheckboxRenderProps$1, CheckboxProps as CheckboxProps$1, DialogProps as DialogProps$1, DialogTriggerProps as DialogTriggerProps$1, DialogOverlayProps as DialogOverlayProps$1, DialogContentProps, DialogTitleProps as DialogTitleProps$1, DialogCloseProps as DialogCloseProps$1, DropdownMenuProps, DropdownMenuTriggerProps, DropdownMenuContentProps, DropdownMenuViewportProps, DropdownMenuItemProps, DropdownMenuGroupProps, DropdownMenuLabelProps, DropdownMenuSeparatorProps, DropdownMenuArrowProps, FieldProps as FieldProps$1, FieldLabelProps as FieldLabelProps$1, FieldDescriptionProps as FieldDescriptionProps$1, FieldErrorMessageProps as FieldErrorMessageProps$1, InputProps as InputProps$1, InputFieldProps as InputFieldProps$1, LabelProps as LabelProps$1, RadioProps as RadioProps$1, RadioItemRenderProps, RadioItemProps as RadioItemProps$1, PopoverProps as PopoverProps$1, PopoverTriggerProps as PopoverTriggerProps$1, PopoverContentProps as PopoverContentProps$1, PopoverCloseProps as PopoverCloseProps$1, SelectProps as SelectProps$1, SelectTriggerProps as SelectTriggerProps$1, SelectContentProps as SelectContentProps$1, SelectViewportProps as SelectViewportProps$1, SelectItemProps as SelectItemProps$1, SelectGroupProps as SelectGroupProps$1, SelectLabelProps as SelectLabelProps$1, SelectSeparatorProps as SelectSeparatorProps$1, SwitchRenderProps as SwitchRenderProps$1, SwitchProps as SwitchProps$1, TabsProps as TabsProps$1, TabsListProps as TabsListProps$1, TabsTriggerRenderProps as TabsTriggerRenderProps$1, TabsTriggerProps as TabsTriggerProps$1, TabsContentProps as TabsContentProps$1, TabsActivationMode as TabsActivationMode$1, TooltipTriggerProps as TooltipTriggerProps$1, TooltipContentProps as TooltipContentProps$1, TooltipProps as TooltipProps$1, TooltipProviderProps as TooltipProviderProps$1, ToasterController, ToastData as ToastData$1, ToasterProps as ToasterProps$1, ToastOptions as ToastOptions$1, MaskDateOptions } from '@turkish-technology/spar';
4
+ export { BreadcrumbItemRenderProps, BreadcrumbPosition, CreateToasterOptions, Mask, MaskChangeMeta, MaskCommonOptions, MaskDateOptions, MaskDateToken, MaskNumberOptions, MaskPattern, MaskPreset, MaskRegexOptions, MaskResolver, MaskResolverContext, MaskResolverResult, MaskShapeOptions, MaskTimeOptions, MaskTimeToken, ToastAnnouncement, ToastPlacement, ToastPromiseOptions, ToastStatus, ToastType, ToastUpdateOptions, ToasterController, createDateMask, createNumberMask, createTimeMask, createToaster } from '@turkish-technology/spar';
5
+ import { PropsBase, Modifiers, DateRange } from 'react-day-picker';
5
6
  import * as _tanstack_react_table from '@tanstack/react-table';
6
7
  import { HeaderContext, CellContext, Column, FilterFn, RowSelectionState, SortingState, ColumnFiltersState, ExpandedState, PaginationState, Table as Table$1 } from '@tanstack/react-table';
7
8
 
@@ -619,6 +620,225 @@ declare const Button: {
619
620
  displayName: string;
620
621
  };
621
622
 
623
+ /**
624
+ * Calendar is the catalog's second **third-party-engine** component (Table is the
625
+ * first): its state core is `react-day-picker`, not a Spar primitive — Spar ships
626
+ * no date component. These public types are therefore **v2-owned** and carry no
627
+ * `Pick<SparCalendarProps, …>` boundary; there is no `SparCalendar` to pick from,
628
+ * so the `check-spar-pick.mjs` guard does not apply. Engine props are still
629
+ * inherited through `Pick<DayPickerBaseProps, …>` rather than re-declared, so a
630
+ * change upstream reaches this contract automatically. See
631
+ * `docs/component-authoring-contract.md` → Public type boundary.
632
+ */
633
+ /** Selection mode. Takeoff Core defines `single` / `range`; `multiple` extends it. */
634
+ type CalendarMode = 'single' | 'range' | 'multiple';
635
+ /**
636
+ * Grid scale → root `data-size`.
637
+ *
638
+ * Two values, not three: the design system defines exactly two day-cell sizes
639
+ * for a picking grid (`datepicker-items-base-size` / `-small-size`). An input
640
+ * row has a `large`, a month grid does not, so a component that pairs a field
641
+ * with this grid should resolve its own `large` to `base` — the mapping Takeoff
642
+ * Core makes (`size === 'small' ? 'small' : 'base'`).
643
+ *
644
+ * @defaultValue 'base'
645
+ */
646
+ type CalendarSize = 'small' | 'base';
647
+ /**
648
+ * Caption-row treatment → root `data-header-type`. Takeoff Core's
649
+ * `tk-datepicker` header vocabulary, ported verbatim: `basic` keeps the row
650
+ * plain and divides it from the grid, the other four drop that divider and draw
651
+ * the month and its arrows inside a boxed surface.
652
+ *
653
+ * @defaultValue 'basic'
654
+ */
655
+ type CalendarHeaderType = 'basic' | 'divided' | 'light' | 'primary' | 'dark';
656
+ /**
657
+ * Which board the body shows → root `data-view`. Takeoff Core's `tk-datepicker`
658
+ * view switch, which `react-day-picker` has no equivalent for: the month and
659
+ * the year in the caption are buttons, and they swap the day grid for a
660
+ * twelve-month or twelve-year board.
661
+ *
662
+ * @defaultValue 'day'
663
+ */
664
+ type CalendarView = 'day' | 'month' | 'year';
665
+ /** A selected range. `to` is undefined while the range is half-picked. */
666
+ type CalendarRange = DateRange;
667
+ /** Render the content inside a day button without replacing its behavior. */
668
+ type CalendarDayRenderer = (date: Date, modifiers: Modifiers) => ReactNode;
669
+ /**
670
+ * Slot vocabulary for `classNames` / `slotProps`. Calendar has a single public
671
+ * component, so every anatomy node is reached through these keys rather than a
672
+ * compound part — the nodes are rendered by the engine and are not
673
+ * consumer-placeable (Table precedent,
674
+ * `docs/component-authoring-contract.md` → Compound component rule).
675
+ */
676
+ type CalendarSlot = 'root' | 'months' | 'month' | 'nav' | 'previousMonthButton' | 'nextMonthButton' | 'previousYearButton' | 'nextYearButton' | 'chevron' | 'monthCaption' | 'captionLabel' | 'captionTrigger' | 'dropdowns' | 'dropdownRoot' | 'dropdown' | 'monthGrid' | 'monthYearGrid' | 'monthYearCell' | 'weekdays' | 'weekday' | 'weeks' | 'week' | 'weekNumber' | 'weekNumberHeader' | 'day' | 'dayButton' | 'footer';
677
+ /**
678
+ * First day of the week, `0` = Sunday. Takeoff Core's `firstDayOfWeekIndex`
679
+ * vocabulary, mapped onto the engine's `weekStartsOn`.
680
+ */
681
+ type CalendarWeekStart = 0 | 1 | 2 | 3 | 4 | 5 | 6;
682
+ /**
683
+ * Props shared by every selection mode.
684
+ *
685
+ * The `Pick<DayPickerBaseProps, …>` below is the layout/navigation,
686
+ * localization and a11y-naming surface inherited from the engine. These pass
687
+ * through untranslated because the engine owns the behavior behind each one.
688
+ *
689
+ * Excluded on purpose: `selected` / `onSelect` (renamed to the `value` /
690
+ * `onValueChange` pair below, so there is one source of truth), `required`
691
+ * (collides with the form-`required` semantics Spar's Field chain owns),
692
+ * `disabled` / `hidden` raw matchers (the Core-vocabulary props above compile
693
+ * down to them; exposing both would make precedence ambiguous), `modifiers` /
694
+ * `modifiersClassNames` / `modifiersStyles` / `styles` / `components` /
695
+ * `dateLib` (engine extension points — `components` and the `classNames` keys
696
+ * are how this wrapper implements its own anatomy, so handing them to an
697
+ * instance would let it delete `data-slot` anchors), the per-day DOM events
698
+ * (`onDayClick` and friends — no Core counterpart, and `onValueChange` covers
699
+ * selection), `animate` (its classes need keyframes this package's recipe does
700
+ * not ship yet), and `className` / `style` (owned by the wrapper's own
701
+ * `className` and `slotProps.root`).
702
+ */
703
+ interface CalendarOwnProps extends Pick<PropsBase, 'id' | 'month' | 'defaultMonth' | 'onMonthChange' | 'numberOfMonths' | 'pagedNavigation' | 'reverseMonths' | 'reverseYears' | 'hideNavigation' | 'disableNavigation' | 'captionLayout' | 'navLayout' | 'fixedWeeks' | 'hideWeekdays' | 'showOutsideDays' | 'showWeekNumber' | 'broadcastCalendar' | 'ISOWeek' | 'timeZone' | 'today' | 'autoFocus' | 'dir' | 'locale' | 'numerals' | 'formatters' | 'labels' | 'footer' | 'role' | 'aria-label' | 'aria-labelledby'> {
704
+ /**
705
+ * Size scale → root `data-size`.
706
+ * @defaultValue 'base'
707
+ */
708
+ size?: CalendarSize;
709
+ /**
710
+ * Caption-row treatment → root `data-header-type`.
711
+ * @defaultValue 'basic'
712
+ */
713
+ headerType?: CalendarHeaderType;
714
+ /**
715
+ * Board the body shows (controlled). Pair with `onViewChange`; the caption's
716
+ * month and year switch it, so a `view` passed without a handler locks the
717
+ * body to that board.
718
+ *
719
+ * Under a `dropdown*` caption the boards still work, but the caption keeps
720
+ * the engine's `<select>` pair instead of gaining switch buttons.
721
+ */
722
+ view?: CalendarView;
723
+ /**
724
+ * Board the body opens on, without taking control of it.
725
+ * @defaultValue 'day'
726
+ */
727
+ defaultView?: CalendarView;
728
+ /** Fires when the caption or a board selection moves the body to another board. */
729
+ onViewChange?: (view: CalendarView) => void;
730
+ /**
731
+ * Earliest selectable date, inclusive. Bounds both navigation (the engine's
732
+ * `startMonth`) and selection (a `{ before }` disabled matcher).
733
+ */
734
+ minDate?: Date;
735
+ /**
736
+ * Latest selectable date, inclusive. Bounds both navigation (the engine's
737
+ * `endMonth`) and selection (an `{ after }` disabled matcher).
738
+ */
739
+ maxDate?: Date;
740
+ /** Individual dates that cannot be selected. */
741
+ disabledDates?: Date[];
742
+ /**
743
+ * Whitelist: when set, every date **not** listed is disabled. Combines with
744
+ * `disabledDates` / `disabledWeekDays` / `minDate` / `maxDate` — a date must
745
+ * pass all of them to be selectable.
746
+ */
747
+ allowedDates?: Date[];
748
+ /** Weekday indices that cannot be selected, `0` = Sunday. */
749
+ disabledWeekDays?: number[];
750
+ /**
751
+ * First day of the week, `0` = Sunday. Defaults to the locale's own first day.
752
+ */
753
+ firstDayOfWeekIndex?: CalendarWeekStart;
754
+ /** Extra class on the root element. */
755
+ className?: string;
756
+ /** Per-slot class name overrides. */
757
+ classNames?: ClassNamesMap<CalendarSlot>;
758
+ /** Per-slot HTML attribute overrides. */
759
+ slotProps?: SlotPropsMap<CalendarSlot>;
760
+ /** Custom content rendered inside each day button. */
761
+ renderDay?: CalendarDayRenderer;
762
+ /** Ref to the root element. */
763
+ ref?: Ref<HTMLDivElement>;
764
+ }
765
+ /** Single-date selection (the default mode). */
766
+ interface CalendarSingleProps extends CalendarOwnProps {
767
+ /**
768
+ * Selection mode.
769
+ * @defaultValue 'single'
770
+ */
771
+ mode?: 'single';
772
+ /** Selected date (controlled). */
773
+ value?: Date;
774
+ /** Initially selected date (uncontrolled). */
775
+ defaultValue?: Date;
776
+ /** Fires with the new selection, or `undefined` when it is cleared. */
777
+ onValueChange?: (value: Date | undefined) => void;
778
+ }
779
+ /** Multiple discrete dates. */
780
+ interface CalendarMultipleProps extends CalendarOwnProps {
781
+ mode: 'multiple';
782
+ /** Selected dates (controlled). */
783
+ value?: Date[];
784
+ /** Initially selected dates (uncontrolled). */
785
+ defaultValue?: Date[];
786
+ /** Fires with the new selection, or `undefined` when it is cleared. */
787
+ onValueChange?: (value: Date[] | undefined) => void;
788
+ /** Fewest dates that may be selected. */
789
+ min?: number;
790
+ /** Most dates that may be selected. */
791
+ max?: number;
792
+ }
793
+ /** A continuous range. */
794
+ interface CalendarRangeProps extends CalendarOwnProps {
795
+ mode: 'range';
796
+ /** Selected range (controlled). */
797
+ value?: CalendarRange;
798
+ /** Initially selected range (uncontrolled). */
799
+ defaultValue?: CalendarRange;
800
+ /** Fires with the new range, or `undefined` when it is cleared. */
801
+ onValueChange?: (value: CalendarRange | undefined) => void;
802
+ /** Fewest days the range may span. */
803
+ min?: number;
804
+ /** Most days the range may span. */
805
+ max?: number;
806
+ /** Forbid a range that would contain a disabled date. */
807
+ excludeDisabled?: boolean;
808
+ }
809
+ /**
810
+ * Public props for Calendar. The `mode` discriminant decides the shape of
811
+ * `value` / `defaultValue` / `onValueChange`, mirroring the engine's own
812
+ * discriminated union.
813
+ */
814
+ type CalendarProps = CalendarSingleProps | CalendarMultipleProps | CalendarRangeProps;
815
+ /** The union's value payload, for callers that need it non-narrowed. */
816
+ type CalendarValue = Date | Date[] | CalendarRange | undefined;
817
+ declare module '../../core/theme' {
818
+ interface ComponentThemeRegistry {
819
+ Calendar: ComponentThemeConfig<CalendarProps, CalendarSlot>;
820
+ }
821
+ }
822
+
823
+ /**
824
+ * Calendar — a month grid built on `react-day-picker`.
825
+ *
826
+ * Spar ships no date primitive, so the engine here is third-party (the Table /
827
+ * TanStack precedent). Every class name in the rendered tree is wrapper-owned
828
+ * and no engine stylesheet is imported; the engine keeps date arithmetic,
829
+ * selection, keyboard navigation and ARIA.
830
+ *
831
+ * @example
832
+ * ```tsx
833
+ * const [date, setDate] = useState<Date>();
834
+ * <Calendar value={date} onValueChange={setDate} minDate={new Date()} />
835
+ * ```
836
+ */
837
+ declare const Calendar: {
838
+ (props: CalendarProps): react.JSX.Element;
839
+ displayName: string;
840
+ };
841
+
622
842
  type CardHeaderType = 'basic' | 'divided' | 'light' | 'dark' | 'primary';
623
843
  type CardFooterType = 'basic' | 'divided' | 'light';
624
844
  type CardSlot = 'root';
@@ -912,7 +1132,7 @@ type DrawerCloseSlot = 'root';
912
1132
  * `slotProps` (state-driven styling lives on the Panel/Overlay/Header
913
1133
  * children, which read shared values from context).
914
1134
  */
915
- interface DrawerProps extends Pick<DialogProps$1, 'id' | 'open' | 'defaultOpen' | 'onOpenChange' | 'disabled'> {
1135
+ interface DrawerProps extends Pick<DialogProps$1, 'id' | 'open' | 'defaultOpen' | 'onOpenChange' | 'disabled' | 'modal' | 'forceMount'> {
916
1136
  /** Side the drawer slides in from. */
917
1137
  placement?: DrawerPlacement;
918
1138
  /** Whether the drawer can be dismissed by clicking outside or pressing Escape. @defaultValue true */
@@ -940,7 +1160,7 @@ interface DrawerPanelOwnProps {
940
1160
  classNames?: ClassNamesMap<DrawerPanelSlot>;
941
1161
  slotProps?: SlotPropsMap<DrawerPanelSlot>;
942
1162
  }
943
- type DrawerPanelProps<T extends ElementType = 'div'> = PolymorphicProps<'div', T, DrawerPanelOwnProps & Pick<DialogContentProps, 'container' | 'trapFocus' | 'restoreFocus' | 'initialFocus' | 'finalFocus' | 'onOpenAutoFocus' | 'onCloseAutoFocus' | 'onEscapeKeyDown' | 'onPointerDownOutside' | 'onInteractOutside'>>;
1163
+ type DrawerPanelProps<T extends ElementType = 'div'> = PolymorphicProps<'div', T, DrawerPanelOwnProps & Pick<DialogContentProps, 'role' | 'container' | 'trapFocus' | 'restoreFocus' | 'initialFocus' | 'finalFocus' | 'onOpenAutoFocus' | 'onCloseAutoFocus' | 'onEscapeKeyDown' | 'onPointerDownOutside' | 'onInteractOutside'>>;
944
1164
  type DrawerHeaderType = 'basic' | 'divided' | 'light' | 'dark' | 'primary';
945
1165
  interface DrawerHeaderOwnProps {
946
1166
  /** Type of the header. @defaultValue 'basic' */
@@ -1462,7 +1682,7 @@ interface InputFieldOwnProps {
1462
1682
  /** Per-slot HTML attribute overrides. */
1463
1683
  slotProps?: SlotPropsMap<InputFieldSlot>;
1464
1684
  }
1465
- type InputFieldProps<T extends ElementType = 'input'> = PolymorphicProps<'input', T, InputFieldOwnProps & Pick<InputFieldProps$1, 'autoFocus'>>;
1685
+ type InputFieldProps<T extends ElementType = 'input'> = PolymorphicProps<'input', T, InputFieldOwnProps & Pick<InputFieldProps$1, 'autoFocus' | 'mask' | 'onValueChange'>>;
1466
1686
  interface InputPrefixOwnProps {
1467
1687
  /** Per-slot class name overrides. */
1468
1688
  classNames?: ClassNamesMap<InputPrefixSlot>;
@@ -4047,4 +4267,89 @@ declare const Upload: {
4047
4267
  };
4048
4268
  };
4049
4269
 
4050
- export { Accordion, type AccordionContentProps, type AccordionCurrentValue, type AccordionHeaderProps, type AccordionHeadingLevel, type AccordionIndicatorProps, type AccordionIndicatorRenderState, type AccordionItemProps, type AccordionMode, type AccordionProps, type AccordionSize, type AccordionTriggerProps, type AccordionType, type AccordionValue, type AccordionValueChangeHandler, Alert, type AlertActionsProps, type AlertActionsSlot, type AlertAppearance, type AlertCloseProps, type AlertCloseSlot, type AlertContentProps, type AlertContentSlot, type AlertDescriptionProps, type AlertDescriptionSlot, type AlertProps, type AlertSlot, type AlertTitleProps, type AlertTitleSlot, type AlertVariant, Badge, type BadgeAppearance, type BadgeProps, type BadgeSize, type BadgeSlot, type BadgeVariant, Breadcrumb, type BreadcrumbItemProps, type BreadcrumbLinkProps, type BreadcrumbListProps, type BreadcrumbNavigationHandler, type BreadcrumbPageProps, type BreadcrumbPressEvent, type BreadcrumbProps, type BreadcrumbSeparatorProps, type BreadcrumbSize, type BreadcrumbType, Button, type ButtonAppearance, type ButtonProps, type ButtonSize, type ButtonSlot, type ButtonVariant, Card, type CardBodyProps, type CardBodySlot, type CardDescriptionProps, type CardDescriptionSlot, type CardFooterProps, type CardFooterSlot, type CardFooterType, type CardHeaderProps, type CardHeaderSlot, type CardHeaderType, type CardProps, type CardSlot, type CardTitleProps, type CardTitleSlot, Checkbox, type CheckboxIndicatorProps, type CheckboxIndicatorRenderProps, type CheckboxProps, type CheckboxRenderProps, type CheckboxSize, type CheckboxSlot, Chip, type ChipAppearance, type ChipProps, type ChipSize, type ChipSlot, type ChipVariant, type ClassNamesMap, type ColorMode, type ComponentName, type ComponentThemeConfig, type ComponentThemeRegistry, type ComponentsThemeMap, type ControlledState, type DataSlotName, Dialog, type DialogBodyProps, type DialogBodySlot, type DialogCloseProps, type DialogCloseSlot, type DialogDescriptionProps, type DialogDescriptionSlot, type DialogFooterProps, type DialogFooterSlot, type DialogFooterType, type DialogHeaderProps, type DialogHeaderSlot, type DialogHeaderType, type DialogOverlayIntensity, type DialogOverlayProps, type DialogOverlaySlot, type DialogPanelProps, type DialogPanelSlot, type DialogProps, type DialogTitleProps, type DialogTitleSlot, type DialogTriggerProps, type DialogTriggerSlot, Divider, type DividerAlign, type DividerAppearance, type DividerOrientation, type DividerProps, type DividerSlot, Drawer, type DrawerBodyProps, type DrawerCloseProps, type DrawerDescriptionProps, type DrawerFooterProps, type DrawerHeaderProps, type DrawerOverlayProps, type DrawerPanelProps, type DrawerPlacement, type DrawerProps, type DrawerTitleProps, type DrawerTriggerProps, Dropdown, type DropdownArrowProps, type DropdownContentProps, type DropdownContentWidth, type DropdownGroupProps, type DropdownItemProps, type DropdownLabelProps, type DropdownProps, type DropdownSeparatorProps, type DropdownSize, type DropdownTriggerProps, type DropdownViewportProps, Field, type FieldDescriptionProps, type FieldDescriptionSlot, type FieldErrorMessageProps, type FieldErrorMessageSlot, type FieldLabelProps, type FieldLabelSlot, type FieldProps, type FieldSlot, Input, type InputChipsProps, type InputChipsSlot, type InputClearButtonProps, type InputClearButtonSlot, type InputDecrementProps, type InputDecrementSlot, type InputFieldProps, type InputFieldSlot, type InputIncrementProps, type InputIncrementSlot, type InputLeadingIconProps, type InputLeadingIconSlot, type InputPrefixProps, type InputPrefixSlot, type InputProps, type InputRevealButtonProps, type InputRevealButtonSlot, type InputSize, type InputSlot, type InputSpinnerProps, type InputSpinnerSlot, type InputStepperProps, type InputStepperSlot, type InputStrengthProps, type InputStrengthSlot, type InputSuffixProps, type InputSuffixSlot, type InputTrailingIconProps, type InputTrailingIconSlot, Label, type LabelProps, type LabelSlot, Popover, type PopoverArrowProps, type PopoverArrowSlot, type PopoverCloseProps, type PopoverCloseSlot, type PopoverContentProps, type PopoverContentSlot, type PopoverDescriptionProps, type PopoverDescriptionSlot, type PopoverHeaderProps, type PopoverHeaderSlot, type PopoverProps, type PopoverTriggerProps, type PopoverTriggerSlot, type PopoverVariant, Progress, type ProgressAppearance, type ProgressIndicatorProps, type ProgressIndicatorSlot, type ProgressProps, type ProgressSize, type ProgressSlot, type ProgressTrackProps, type ProgressTrackSlot, type ProgressValueProps, type ProgressValueSlot, type ProgressVariant, Radio, type RadioIndicatorProps, type RadioItemProps, type RadioItemSlot, type RadioLabelProps, type RadioPosition, type RadioProps, type RadioRenderProps, type RadioSize, type RadioSlot, Select, type SelectArrowProps, type SelectContentProps, type SelectGroupProps, type SelectIndicatorProps, type SelectIndicatorRenderState, type SelectItemProps, type SelectLabelProps, type SelectProps, type SelectSeparatorProps, type SelectSize, type SelectTriggerProps, type SelectViewportProps, Skeleton, type SkeletonAnimation, type SkeletonProps, type SkeletonShape, type SkeletonSlot, Slider, type SliderOrientation, type SliderProps, type SliderRangeProps, type SliderRangeValueProps, type SliderSingleValueProps, type SliderSize, type SliderSlot, type SliderThumbProps, type SliderThumbRenderProps, type SliderTicksProps, type SliderTooltip, type SliderTrackMode, type SliderTrackProps, type SliderValue, type SliderValueProps, type SliderValueRenderProps, type SliderVariant, type SlotClassNames, type SlotPropsMap, Spinner, type SpinnerAppearance, type SpinnerProps, type SpinnerSize, type SpinnerSlot, type SpinnerVariant, type StateOnlyComponentThemeConfig$1 as StateOnlyComponentThemeConfig, Stepper, type StepperDescriptionProps, type StepperIndicatorState, type StepperItemProps, type StepperMode, type StepperOrientation, type StepperProps, type StepperSize, type StepperStepClickDetail, type StepperStepStatus, type StepperTitleProps, Switch, type SwitchIndicatorProps, type SwitchIndicatorRenderProps, type SwitchProps, type SwitchRenderProps, type SwitchSize, type SwitchSlot, type SwitchVariant, Table, type TableAlign, type TableColumnAccessor, type TableColumnDef, type TableColumnFilter, type TableColumnFilterContext, type TableColumnFilterOption, type TableColumnFilterType, type TableColumnMeta, type TableDataRequest, type TableExpansionConfig, type TableFilteringConfig, type TablePaginationConfig, type TableProps, type TableSelectionConfig, type TableSize, type TableSlot, type TableSortingConfig, type TableStickySide, Tabs, type TabsActivationMode, type TabsAppearance, type TabsContentProps, type TabsListProps, type TabsProps, type TabsSize, type TabsTriggerProps, type TabsTriggerRenderProps, type TabsVariant, TakeoffSparProvider, type TakeoffSparProviderProps, type TakeoffSparProviderValue, type ThemeValue, Toast, type ToastAppearance, type ToastData, type ToastOptions, type ToastProps, type ToastSlot, type ToastVariant, Toaster, type ToasterOwnProps, type ToasterProps, type ToasterSlot, Tooltip, type TooltipArrowProps, type TooltipArrowSlot, type TooltipContentProps, type TooltipContentSlot, type TooltipDescriptionProps, type TooltipDescriptionSlot, type TooltipHeaderProps, type TooltipHeaderSlot, type TooltipProps, type TooltipProviderProps, type TooltipTriggerProps, type TooltipTriggerSlot, type TooltipVariant, Upload, type UploadActionsProps, type UploadActionsSlot, type UploadDropzoneProps, type UploadDropzoneSlot, type UploadFile, type UploadFileStatus, type UploadItemActionProps, type UploadItemActionSlot, type UploadItemActionsProps, type UploadItemActionsSlot, type UploadItemContentProps, type UploadItemContentSlot, type UploadItemPreviewProps, type UploadItemPreviewSlot, type UploadItemPreviewSlotProps, type UploadItemProps, type UploadItemSlot, type UploadListProps, type UploadListSlot, type UploadProps, type UploadRejection, type UploadSlot, type UploadSubmitProps, type UploadSubmitSlot, type UploadTriggerProps, type UploadTriggerSlot, getExportRows, useComponentTheme, useTheme };
4270
+ /**
4271
+ * The text/`Date` bridge a date picker needs, without a DatePicker component.
4272
+ *
4273
+ * A date picker is `Popover` + `Calendar` composed by the consumer (see
4274
+ * `docs/datepicker-contract.md`). That decision stands: this hook owns no anatomy,
4275
+ * renders nothing, and every element stays the consumer's to place. What it
4276
+ * removes is the one part of the composition that was neither short nor
4277
+ * situational — keeping a typed string and a `Date` in step, in both
4278
+ * directions, plus the mask bounds that have to agree with the grid's.
4279
+ *
4280
+ * It qualifies under the no-adapter-hook rule on the same grounds as
4281
+ * `useControllableState`: real React state, and no Spar behaviour hidden behind
4282
+ * it. It maps nothing — `Input.Field` and `Calendar` keep their own contracts,
4283
+ * and the props below are ordinary values a caller may spread, override, or
4284
+ * ignore one at a time.
4285
+ *
4286
+ * The displayed month is deliberately absent: `Calendar` follows a value set
4287
+ * from outside the grid on its own, so a third piece of state would be a second
4288
+ * writer to a month the grid already moves.
4289
+ */
4290
+ /** How a `Date` is rendered into the field. */
4291
+ type DateFormatter = (value: Date) => string;
4292
+ interface UseDatePickerOptions {
4293
+ /** Earliest selectable date, inclusive. Bounds the grid *and* the mask. */
4294
+ min?: Date;
4295
+ /** Latest selectable date, inclusive. Bounds the grid *and* the mask. */
4296
+ max?: Date;
4297
+ /** Initial value, uncontrolled. */
4298
+ defaultValue?: Date;
4299
+ /**
4300
+ * Separator between the day, month and year blocks. Also the one the mask
4301
+ * inserts as you type.
4302
+ * @defaultValue '/'
4303
+ */
4304
+ delimiter?: string;
4305
+ /**
4306
+ * Renders the picked date into the field. The default is
4307
+ * `dd<delimiter>mm<delimiter>yyyy`, which is what the mask accepts back.
4308
+ */
4309
+ format?: DateFormatter;
4310
+ /** Fires whenever the value changes, from either half. */
4311
+ onValueChange?: (value: Date | undefined) => void;
4312
+ }
4313
+ interface UseDatePickerResult {
4314
+ /** The picked date, or `undefined` while the field is empty or incomplete. */
4315
+ value: Date | undefined;
4316
+ /** The field's text, masked. */
4317
+ text: string;
4318
+ /** Whether the panel is open. Pair with {@link UseDatePickerResult.popoverProps}. */
4319
+ open: boolean;
4320
+ /** Set the value from anywhere — a preset button, a reset, a restored form. */
4321
+ setValue: (value: Date | undefined) => void;
4322
+ /** Open state, for `Popover`. */
4323
+ popoverProps: {
4324
+ open: boolean;
4325
+ onOpenChange: (open: boolean) => void;
4326
+ };
4327
+ /**
4328
+ * Mask, value and change handling for `Input.Field`. `onKeyDown` opens the
4329
+ * panel on `ArrowDown`, which is what makes the grid reachable from the
4330
+ * keyboard; drop it if the field is read-only.
4331
+ */
4332
+ inputProps: {
4333
+ mask: MaskDateOptions;
4334
+ value: string;
4335
+ onValueChange: (next: string, meta: {
4336
+ completed?: boolean;
4337
+ iso?: string;
4338
+ }) => void;
4339
+ onKeyDown: (event: KeyboardEvent<HTMLInputElement>) => void;
4340
+ };
4341
+ /**
4342
+ * Value and bounds for `Calendar`. Selecting a day writes the formatted date
4343
+ * back into the field and closes the panel — spread `onValueChange` yourself
4344
+ * if a mode needs to stay open (a range is not finished on the first click).
4345
+ */
4346
+ calendarProps: {
4347
+ value: Date | undefined;
4348
+ minDate: Date | undefined;
4349
+ maxDate: Date | undefined;
4350
+ onValueChange: (value: Date | undefined) => void;
4351
+ };
4352
+ }
4353
+ declare function useDatePicker({ min, max, defaultValue, delimiter, format, onValueChange }?: UseDatePickerOptions): UseDatePickerResult;
4354
+
4355
+ export { Accordion, type AccordionContentProps, type AccordionCurrentValue, type AccordionHeaderProps, type AccordionHeadingLevel, type AccordionIndicatorProps, type AccordionIndicatorRenderState, type AccordionItemProps, type AccordionMode, type AccordionProps, type AccordionSize, type AccordionTriggerProps, type AccordionType, type AccordionValue, type AccordionValueChangeHandler, Alert, type AlertActionsProps, type AlertActionsSlot, type AlertAppearance, type AlertCloseProps, type AlertCloseSlot, type AlertContentProps, type AlertContentSlot, type AlertDescriptionProps, type AlertDescriptionSlot, type AlertProps, type AlertSlot, type AlertTitleProps, type AlertTitleSlot, type AlertVariant, Badge, type BadgeAppearance, type BadgeProps, type BadgeSize, type BadgeSlot, type BadgeVariant, Breadcrumb, type BreadcrumbItemProps, type BreadcrumbLinkProps, type BreadcrumbListProps, type BreadcrumbNavigationHandler, type BreadcrumbPageProps, type BreadcrumbPressEvent, type BreadcrumbProps, type BreadcrumbSeparatorProps, type BreadcrumbSize, type BreadcrumbType, Button, type ButtonAppearance, type ButtonProps, type ButtonSize, type ButtonSlot, type ButtonVariant, Calendar, type CalendarDayRenderer, type CalendarHeaderType, type CalendarMode, type CalendarMultipleProps, type CalendarProps, type CalendarRange, type CalendarRangeProps, type CalendarSingleProps, type CalendarSize, type CalendarSlot, type CalendarValue, type CalendarView, type CalendarWeekStart, Card, type CardBodyProps, type CardBodySlot, type CardDescriptionProps, type CardDescriptionSlot, type CardFooterProps, type CardFooterSlot, type CardFooterType, type CardHeaderProps, type CardHeaderSlot, type CardHeaderType, type CardProps, type CardSlot, type CardTitleProps, type CardTitleSlot, Checkbox, type CheckboxIndicatorProps, type CheckboxIndicatorRenderProps, type CheckboxProps, type CheckboxRenderProps, type CheckboxSize, type CheckboxSlot, Chip, type ChipAppearance, type ChipProps, type ChipSize, type ChipSlot, type ChipVariant, type ClassNamesMap, type ColorMode, type ComponentName, type ComponentThemeConfig, type ComponentThemeRegistry, type ComponentsThemeMap, type ControlledState, type DataSlotName, type DateFormatter, Dialog, type DialogBodyProps, type DialogBodySlot, type DialogCloseProps, type DialogCloseSlot, type DialogDescriptionProps, type DialogDescriptionSlot, type DialogFooterProps, type DialogFooterSlot, type DialogFooterType, type DialogHeaderProps, type DialogHeaderSlot, type DialogHeaderType, type DialogOverlayIntensity, type DialogOverlayProps, type DialogOverlaySlot, type DialogPanelProps, type DialogPanelSlot, type DialogProps, type DialogTitleProps, type DialogTitleSlot, type DialogTriggerProps, type DialogTriggerSlot, Divider, type DividerAlign, type DividerAppearance, type DividerOrientation, type DividerProps, type DividerSlot, Drawer, type DrawerBodyProps, type DrawerCloseProps, type DrawerDescriptionProps, type DrawerFooterProps, type DrawerHeaderProps, type DrawerOverlayProps, type DrawerPanelProps, type DrawerPlacement, type DrawerProps, type DrawerTitleProps, type DrawerTriggerProps, Dropdown, type DropdownArrowProps, type DropdownContentProps, type DropdownContentWidth, type DropdownGroupProps, type DropdownItemProps, type DropdownLabelProps, type DropdownProps, type DropdownSeparatorProps, type DropdownSize, type DropdownTriggerProps, type DropdownViewportProps, Field, type FieldDescriptionProps, type FieldDescriptionSlot, type FieldErrorMessageProps, type FieldErrorMessageSlot, type FieldLabelProps, type FieldLabelSlot, type FieldProps, type FieldSlot, Input, type InputChipsProps, type InputChipsSlot, type InputClearButtonProps, type InputClearButtonSlot, type InputDecrementProps, type InputDecrementSlot, type InputFieldProps, type InputFieldSlot, type InputIncrementProps, type InputIncrementSlot, type InputLeadingIconProps, type InputLeadingIconSlot, type InputPrefixProps, type InputPrefixSlot, type InputProps, type InputRevealButtonProps, type InputRevealButtonSlot, type InputSize, type InputSlot, type InputSpinnerProps, type InputSpinnerSlot, type InputStepperProps, type InputStepperSlot, type InputStrengthProps, type InputStrengthSlot, type InputSuffixProps, type InputSuffixSlot, type InputTrailingIconProps, type InputTrailingIconSlot, Label, type LabelProps, type LabelSlot, Popover, type PopoverArrowProps, type PopoverArrowSlot, type PopoverCloseProps, type PopoverCloseSlot, type PopoverContentProps, type PopoverContentSlot, type PopoverDescriptionProps, type PopoverDescriptionSlot, type PopoverHeaderProps, type PopoverHeaderSlot, type PopoverProps, type PopoverTriggerProps, type PopoverTriggerSlot, type PopoverVariant, Progress, type ProgressAppearance, type ProgressIndicatorProps, type ProgressIndicatorSlot, type ProgressProps, type ProgressSize, type ProgressSlot, type ProgressTrackProps, type ProgressTrackSlot, type ProgressValueProps, type ProgressValueSlot, type ProgressVariant, Radio, type RadioIndicatorProps, type RadioItemProps, type RadioItemSlot, type RadioLabelProps, type RadioPosition, type RadioProps, type RadioRenderProps, type RadioSize, type RadioSlot, Select, type SelectArrowProps, type SelectContentProps, type SelectGroupProps, type SelectIndicatorProps, type SelectIndicatorRenderState, type SelectItemProps, type SelectLabelProps, type SelectProps, type SelectSeparatorProps, type SelectSize, type SelectTriggerProps, type SelectViewportProps, Skeleton, type SkeletonAnimation, type SkeletonProps, type SkeletonShape, type SkeletonSlot, Slider, type SliderOrientation, type SliderProps, type SliderRangeProps, type SliderRangeValueProps, type SliderSingleValueProps, type SliderSize, type SliderSlot, type SliderThumbProps, type SliderThumbRenderProps, type SliderTicksProps, type SliderTooltip, type SliderTrackMode, type SliderTrackProps, type SliderValue, type SliderValueProps, type SliderValueRenderProps, type SliderVariant, type SlotClassNames, type SlotPropsMap, Spinner, type SpinnerAppearance, type SpinnerProps, type SpinnerSize, type SpinnerSlot, type SpinnerVariant, type StateOnlyComponentThemeConfig$1 as StateOnlyComponentThemeConfig, Stepper, type StepperDescriptionProps, type StepperIndicatorState, type StepperItemProps, type StepperMode, type StepperOrientation, type StepperProps, type StepperSize, type StepperStepClickDetail, type StepperStepStatus, type StepperTitleProps, Switch, type SwitchIndicatorProps, type SwitchIndicatorRenderProps, type SwitchProps, type SwitchRenderProps, type SwitchSize, type SwitchSlot, type SwitchVariant, Table, type TableAlign, type TableColumnAccessor, type TableColumnDef, type TableColumnFilter, type TableColumnFilterContext, type TableColumnFilterOption, type TableColumnFilterType, type TableColumnMeta, type TableDataRequest, type TableExpansionConfig, type TableFilteringConfig, type TablePaginationConfig, type TableProps, type TableSelectionConfig, type TableSize, type TableSlot, type TableSortingConfig, type TableStickySide, Tabs, type TabsActivationMode, type TabsAppearance, type TabsContentProps, type TabsListProps, type TabsProps, type TabsSize, type TabsTriggerProps, type TabsTriggerRenderProps, type TabsVariant, TakeoffSparProvider, type TakeoffSparProviderProps, type TakeoffSparProviderValue, type ThemeValue, Toast, type ToastAppearance, type ToastData, type ToastOptions, type ToastProps, type ToastSlot, type ToastVariant, Toaster, type ToasterOwnProps, type ToasterProps, type ToasterSlot, Tooltip, type TooltipArrowProps, type TooltipArrowSlot, type TooltipContentProps, type TooltipContentSlot, type TooltipDescriptionProps, type TooltipDescriptionSlot, type TooltipHeaderProps, type TooltipHeaderSlot, type TooltipProps, type TooltipProviderProps, type TooltipTriggerProps, type TooltipTriggerSlot, type TooltipVariant, Upload, type UploadActionsProps, type UploadActionsSlot, type UploadDropzoneProps, type UploadDropzoneSlot, type UploadFile, type UploadFileStatus, type UploadItemActionProps, type UploadItemActionSlot, type UploadItemActionsProps, type UploadItemActionsSlot, type UploadItemContentProps, type UploadItemContentSlot, type UploadItemPreviewProps, type UploadItemPreviewSlot, type UploadItemPreviewSlotProps, type UploadItemProps, type UploadItemSlot, type UploadListProps, type UploadListSlot, type UploadProps, type UploadRejection, type UploadSlot, type UploadSubmitProps, type UploadSubmitSlot, type UploadTriggerProps, type UploadTriggerSlot, type UseDatePickerOptions, type UseDatePickerResult, getExportRows, useComponentTheme, useDatePicker, useTheme };