@slipstream-ui/core 0.13.0 → 0.14.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.mts +32 -3
- package/dist/index.d.ts +32 -3
- package/dist/index.js +242 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +242 -11
- package/dist/index.mjs.map +1 -1
- package/dist/manifests/accordion.manifest.json +1 -1
- package/dist/manifests/alert.manifest.json +1 -1
- package/dist/manifests/announcement-bar.manifest.json +1 -1
- package/dist/manifests/app-shell.manifest.json +1 -1
- package/dist/manifests/applied-filters.manifest.json +1 -1
- package/dist/manifests/article-card.manifest.json +1 -1
- package/dist/manifests/auth-layout.manifest.json +1 -1
- package/dist/manifests/autocomplete.manifest.json +1 -1
- package/dist/manifests/avatar.manifest.json +1 -1
- package/dist/manifests/badge.manifest.json +1 -1
- package/dist/manifests/block.manifest.json +1 -1
- package/dist/manifests/bottom-nav.manifest.json +1 -1
- package/dist/manifests/breadcrumb.manifest.json +1 -1
- package/dist/manifests/button-group.manifest.json +1 -1
- package/dist/manifests/button.manifest.json +1 -1
- package/dist/manifests/calendar.manifest.json +1 -1
- package/dist/manifests/card.manifest.json +1 -1
- package/dist/manifests/checkbox.manifest.json +1 -1
- package/dist/manifests/comparison-table.manifest.json +1 -1
- package/dist/manifests/confirm-dialog.manifest.json +1 -1
- package/dist/manifests/consent-banner.manifest.json +1 -1
- package/dist/manifests/contact-strip.manifest.json +1 -1
- package/dist/manifests/container.manifest.json +1 -1
- package/dist/manifests/cover-image.manifest.json +1 -1
- package/dist/manifests/cta-section.manifest.json +1 -1
- package/dist/manifests/data-table.manifest.json +1 -1
- package/dist/manifests/date-picker-popover.manifest.json +1 -1
- package/dist/manifests/date-picker.manifest.json +1 -1
- package/dist/manifests/date-range-picker.manifest.json +1 -1
- package/dist/manifests/deal-card.manifest.json +1 -1
- package/dist/manifests/dialog.manifest.json +1 -1
- package/dist/manifests/document-card.manifest.json +1 -1
- package/dist/manifests/drawer.manifest.json +1 -1
- package/dist/manifests/empty-state.manifest.json +1 -1
- package/dist/manifests/entity-card.manifest.json +1 -1
- package/dist/manifests/feature-grid.manifest.json +1 -1
- package/dist/manifests/feature-row.manifest.json +1 -1
- package/dist/manifests/fieldset.manifest.json +1 -1
- package/dist/manifests/figure.manifest.json +1 -1
- package/dist/manifests/file-upload.manifest.json +1 -1
- package/dist/manifests/filter-bar.manifest.json +1 -1
- package/dist/manifests/filter-chips.manifest.json +1 -1
- package/dist/manifests/filter-panel.manifest.json +1 -1
- package/dist/manifests/flex.manifest.json +1 -1
- package/dist/manifests/form-field.manifest.json +1 -1
- package/dist/manifests/form-layout.manifest.json +1 -1
- package/dist/manifests/form.manifest.json +1 -1
- package/dist/manifests/grid.manifest.json +1 -1
- package/dist/manifests/heading.manifest.json +1 -1
- package/dist/manifests/hero.manifest.json +1 -1
- package/dist/manifests/icon-button.manifest.json +1 -1
- package/dist/manifests/icon-tile.manifest.json +1 -1
- package/dist/manifests/icon.manifest.json +1 -1
- package/dist/manifests/image.manifest.json +1 -1
- package/dist/manifests/input-group.manifest.json +1 -1
- package/dist/manifests/input.manifest.json +1 -1
- package/dist/manifests/label.manifest.json +1 -1
- package/dist/manifests/link-tabs.manifest.json +1 -1
- package/dist/manifests/link.manifest.json +1 -1
- package/dist/manifests/list-toolbar.manifest.json +1 -1
- package/dist/manifests/list.manifest.json +1 -1
- package/dist/manifests/load-more.manifest.json +1 -1
- package/dist/manifests/logo-cloud.manifest.json +1 -1
- package/dist/manifests/media-card.manifest.json +1 -1
- package/dist/manifests/media.manifest.json +1 -1
- package/dist/manifests/menu.manifest.json +1 -1
- package/dist/manifests/metric-card.manifest.json +1 -1
- package/dist/manifests/month-schedule.manifest.json +1 -1
- package/dist/manifests/multi-select.manifest.json +1 -1
- package/dist/manifests/newsletter.manifest.json +1 -1
- package/dist/manifests/page-header.manifest.json +1 -1
- package/dist/manifests/pagination.manifest.json +1 -1
- package/dist/manifests/password-input.manifest.json +1 -1
- package/dist/manifests/popover.manifest.json +1 -1
- package/dist/manifests/process-steps.manifest.json +1 -1
- package/dist/manifests/progress.manifest.json +1 -1
- package/dist/manifests/prose.manifest.json +1 -1
- package/dist/manifests/radio.manifest.json +1 -1
- package/dist/manifests/range-slider.manifest.json +1 -1
- package/dist/manifests/search.manifest.json +1 -1
- package/dist/manifests/section-heading.manifest.json +1 -1
- package/dist/manifests/section.manifest.json +1 -1
- package/dist/manifests/segmented-control.manifest.json +1 -1
- package/dist/manifests/select-menu.manifest.json +1 -1
- package/dist/manifests/select.manifest.json +1 -1
- package/dist/manifests/separator.manifest.json +1 -1
- package/dist/manifests/site-footer.manifest.json +1 -1
- package/dist/manifests/site-header.manifest.json +1 -1
- package/dist/manifests/skeleton.manifest.json +1 -1
- package/dist/manifests/social-links.manifest.json +1 -1
- package/dist/manifests/spinner.manifest.json +1 -1
- package/dist/manifests/stat-band.manifest.json +1 -1
- package/dist/manifests/stepper.manifest.json +1 -1
- package/dist/manifests/switch.manifest.json +1 -1
- package/dist/manifests/table-card.manifest.json +1 -1
- package/dist/manifests/table-of-contents.manifest.json +1 -1
- package/dist/manifests/table.manifest.json +1 -1
- package/dist/manifests/tabs.manifest.json +1 -1
- package/dist/manifests/testimonial.manifest.json +1 -1
- package/dist/manifests/text.manifest.json +1 -1
- package/dist/manifests/textarea.manifest.json +1 -1
- package/dist/manifests/theme-toggle.manifest.json +1 -1
- package/dist/manifests/time-picker.manifest.json +49 -6
- package/dist/manifests/timeline.manifest.json +1 -1
- package/dist/manifests/toast.manifest.json +1 -1
- package/dist/manifests/tombstone-card.manifest.json +1 -1
- package/dist/manifests/tooltip.manifest.json +1 -1
- package/dist/src/components/time-picker/TimePicker.d.ts +31 -2
- package/dist/src/components/time-picker/TimePicker.js +244 -11
- package/dist/src/components/time-picker/TimePicker.js.map +1 -1
- package/dist/src/components/time-picker/TimePicker.mjs +244 -11
- package/dist/src/components/time-picker/TimePicker.mjs.map +1 -1
- package/package.json +4 -4
- package/src/components/time-picker/TimePicker.test.tsx +77 -0
- package/src/components/time-picker/TimePicker.tsx +315 -12
- package/src/manifests/accordion.manifest.json +1 -1
- package/src/manifests/alert.manifest.json +1 -1
- package/src/manifests/announcement-bar.manifest.json +1 -1
- package/src/manifests/app-shell.manifest.json +1 -1
- package/src/manifests/applied-filters.manifest.json +1 -1
- package/src/manifests/article-card.manifest.json +1 -1
- package/src/manifests/auth-layout.manifest.json +1 -1
- package/src/manifests/autocomplete.manifest.json +1 -1
- package/src/manifests/avatar.manifest.json +1 -1
- package/src/manifests/badge.manifest.json +1 -1
- package/src/manifests/block.manifest.json +1 -1
- package/src/manifests/bottom-nav.manifest.json +1 -1
- package/src/manifests/breadcrumb.manifest.json +1 -1
- package/src/manifests/button-group.manifest.json +1 -1
- package/src/manifests/button.manifest.json +1 -1
- package/src/manifests/calendar.manifest.json +1 -1
- package/src/manifests/card.manifest.json +1 -1
- package/src/manifests/checkbox.manifest.json +1 -1
- package/src/manifests/comparison-table.manifest.json +1 -1
- package/src/manifests/confirm-dialog.manifest.json +1 -1
- package/src/manifests/consent-banner.manifest.json +1 -1
- package/src/manifests/contact-strip.manifest.json +1 -1
- package/src/manifests/container.manifest.json +1 -1
- package/src/manifests/cover-image.manifest.json +1 -1
- package/src/manifests/cta-section.manifest.json +1 -1
- package/src/manifests/data-table.manifest.json +1 -1
- package/src/manifests/date-picker-popover.manifest.json +1 -1
- package/src/manifests/date-picker.manifest.json +1 -1
- package/src/manifests/date-range-picker.manifest.json +1 -1
- package/src/manifests/deal-card.manifest.json +1 -1
- package/src/manifests/dialog.manifest.json +1 -1
- package/src/manifests/document-card.manifest.json +1 -1
- package/src/manifests/drawer.manifest.json +1 -1
- package/src/manifests/empty-state.manifest.json +1 -1
- package/src/manifests/entity-card.manifest.json +1 -1
- package/src/manifests/feature-grid.manifest.json +1 -1
- package/src/manifests/feature-row.manifest.json +1 -1
- package/src/manifests/fieldset.manifest.json +1 -1
- package/src/manifests/figure.manifest.json +1 -1
- package/src/manifests/file-upload.manifest.json +1 -1
- package/src/manifests/filter-bar.manifest.json +1 -1
- package/src/manifests/filter-chips.manifest.json +1 -1
- package/src/manifests/filter-panel.manifest.json +1 -1
- package/src/manifests/flex.manifest.json +1 -1
- package/src/manifests/form-field.manifest.json +1 -1
- package/src/manifests/form-layout.manifest.json +1 -1
- package/src/manifests/form.manifest.json +1 -1
- package/src/manifests/grid.manifest.json +1 -1
- package/src/manifests/heading.manifest.json +1 -1
- package/src/manifests/hero.manifest.json +1 -1
- package/src/manifests/icon-button.manifest.json +1 -1
- package/src/manifests/icon-tile.manifest.json +1 -1
- package/src/manifests/icon.manifest.json +1 -1
- package/src/manifests/image.manifest.json +1 -1
- package/src/manifests/input-group.manifest.json +1 -1
- package/src/manifests/input.manifest.json +1 -1
- package/src/manifests/label.manifest.json +1 -1
- package/src/manifests/link-tabs.manifest.json +1 -1
- package/src/manifests/link.manifest.json +1 -1
- package/src/manifests/list-toolbar.manifest.json +1 -1
- package/src/manifests/list.manifest.json +1 -1
- package/src/manifests/load-more.manifest.json +1 -1
- package/src/manifests/logo-cloud.manifest.json +1 -1
- package/src/manifests/media-card.manifest.json +1 -1
- package/src/manifests/media.manifest.json +1 -1
- package/src/manifests/menu.manifest.json +1 -1
- package/src/manifests/metric-card.manifest.json +1 -1
- package/src/manifests/month-schedule.manifest.json +1 -1
- package/src/manifests/multi-select.manifest.json +1 -1
- package/src/manifests/newsletter.manifest.json +1 -1
- package/src/manifests/page-header.manifest.json +1 -1
- package/src/manifests/pagination.manifest.json +1 -1
- package/src/manifests/password-input.manifest.json +1 -1
- package/src/manifests/popover.manifest.json +1 -1
- package/src/manifests/process-steps.manifest.json +1 -1
- package/src/manifests/progress.manifest.json +1 -1
- package/src/manifests/prose.manifest.json +1 -1
- package/src/manifests/radio.manifest.json +1 -1
- package/src/manifests/range-slider.manifest.json +1 -1
- package/src/manifests/search.manifest.json +1 -1
- package/src/manifests/section-heading.manifest.json +1 -1
- package/src/manifests/section.manifest.json +1 -1
- package/src/manifests/segmented-control.manifest.json +1 -1
- package/src/manifests/select-menu.manifest.json +1 -1
- package/src/manifests/select.manifest.json +1 -1
- package/src/manifests/separator.manifest.json +1 -1
- package/src/manifests/site-footer.manifest.json +1 -1
- package/src/manifests/site-header.manifest.json +1 -1
- package/src/manifests/skeleton.manifest.json +1 -1
- package/src/manifests/social-links.manifest.json +1 -1
- package/src/manifests/spinner.manifest.json +1 -1
- package/src/manifests/stat-band.manifest.json +1 -1
- package/src/manifests/stepper.manifest.json +1 -1
- package/src/manifests/switch.manifest.json +1 -1
- package/src/manifests/table-card.manifest.json +1 -1
- package/src/manifests/table-of-contents.manifest.json +1 -1
- package/src/manifests/table.manifest.json +1 -1
- package/src/manifests/tabs.manifest.json +1 -1
- package/src/manifests/testimonial.manifest.json +1 -1
- package/src/manifests/text.manifest.json +1 -1
- package/src/manifests/textarea.manifest.json +1 -1
- package/src/manifests/theme-toggle.manifest.json +1 -1
- package/src/manifests/time-picker.manifest.json +49 -6
- package/src/manifests/timeline.manifest.json +1 -1
- package/src/manifests/toast.manifest.json +1 -1
- package/src/manifests/tombstone-card.manifest.json +1 -1
- package/src/manifests/tooltip.manifest.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -2742,6 +2742,7 @@ type DatePickerPopoverProps = {
|
|
|
2742
2742
|
*/
|
|
2743
2743
|
declare const DatePickerPopover: React.ForwardRefExoticComponent<DatePickerPopoverProps & React.RefAttributes<HTMLButtonElement>>;
|
|
2744
2744
|
|
|
2745
|
+
type TimePickerFormat = '24h' | '12h';
|
|
2745
2746
|
type TimePickerProps = Omit<InputProps, 'type' | 'value' | 'defaultValue'> & {
|
|
2746
2747
|
/** "HH:MM" (24h) — controlled. */
|
|
2747
2748
|
value?: string;
|
|
@@ -2753,10 +2754,24 @@ type TimePickerProps = Omit<InputProps, 'type' | 'value' | 'defaultValue'> & {
|
|
|
2753
2754
|
clearable?: boolean;
|
|
2754
2755
|
/** Accessible label for the clear button. Default 'Clear time'. */
|
|
2755
2756
|
clearLabel?: string;
|
|
2757
|
+
/**
|
|
2758
|
+
* Display contract. '24h' (default) renders the native time input.
|
|
2759
|
+
* '12h' renders a button trigger with an hour/minute/AM-PM panel because
|
|
2760
|
+
* input[type=time] cannot show AM/PM portably. Both emit "HH:MM".
|
|
2761
|
+
*/
|
|
2762
|
+
format?: TimePickerFormat;
|
|
2763
|
+
/** Minute granularity for the panel options and the native input step. Default 1. */
|
|
2764
|
+
minuteStep?: number;
|
|
2765
|
+
/** Earliest selectable time, "HH:MM" inclusive. */
|
|
2766
|
+
min?: string;
|
|
2767
|
+
/** Latest selectable time, "HH:MM" inclusive. */
|
|
2768
|
+
max?: string;
|
|
2769
|
+
/** Text shown before a time is chosen (12h mode). */
|
|
2770
|
+
placeholder?: string;
|
|
2756
2771
|
};
|
|
2757
2772
|
/**
|
|
2758
|
-
*
|
|
2759
|
-
*
|
|
2773
|
+
* Time field with an "HH:MM" contract. The 24h format is a native time input;
|
|
2774
|
+
* the 12h format is a button trigger with an hour/minute/period panel.
|
|
2760
2775
|
*/
|
|
2761
2776
|
declare const TimePicker: React.ForwardRefExoticComponent<Omit<InputProps, "type" | "value" | "defaultValue"> & {
|
|
2762
2777
|
/** "HH:MM" (24h) — controlled. */
|
|
@@ -2769,6 +2784,20 @@ declare const TimePicker: React.ForwardRefExoticComponent<Omit<InputProps, "type
|
|
|
2769
2784
|
clearable?: boolean;
|
|
2770
2785
|
/** Accessible label for the clear button. Default 'Clear time'. */
|
|
2771
2786
|
clearLabel?: string;
|
|
2787
|
+
/**
|
|
2788
|
+
* Display contract. '24h' (default) renders the native time input.
|
|
2789
|
+
* '12h' renders a button trigger with an hour/minute/AM-PM panel because
|
|
2790
|
+
* input[type=time] cannot show AM/PM portably. Both emit "HH:MM".
|
|
2791
|
+
*/
|
|
2792
|
+
format?: TimePickerFormat;
|
|
2793
|
+
/** Minute granularity for the panel options and the native input step. Default 1. */
|
|
2794
|
+
minuteStep?: number;
|
|
2795
|
+
/** Earliest selectable time, "HH:MM" inclusive. */
|
|
2796
|
+
min?: string;
|
|
2797
|
+
/** Latest selectable time, "HH:MM" inclusive. */
|
|
2798
|
+
max?: string;
|
|
2799
|
+
/** Text shown before a time is chosen (12h mode). */
|
|
2800
|
+
placeholder?: string;
|
|
2772
2801
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
2773
2802
|
|
|
2774
2803
|
type StepperStep = {
|
|
@@ -4872,4 +4901,4 @@ declare const Media: React.ForwardRefExoticComponent<Omit<FigureProps, "children
|
|
|
4872
4901
|
} & React.RefAttributes<HTMLElement>>;
|
|
4873
4902
|
|
|
4874
4903
|
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, AnnouncementBar, AppShell, AppliedFilters, ArticleCard, AuthLayout, Autocomplete, Avatar, AvatarFallback, AvatarImage, Badge, Block, BottomNav, Breadcrumb, Button, ButtonGroup, CONSENT_CHANGE_EVENT, CTASection, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CheckboxGroup, CheckboxGroupItem, ComparisonTable, ConfirmDialog, ConsentBanner, ContactStrip, Container, CoverImage, DataTable, DatePicker, DatePickerPopover, DateRangePicker, DealCard, Dialog, DialogBody, DialogDescription, DialogFooter, DialogHeader, DialogTitle, Divider, DocumentCard, Drawer, EmptyState, EntityCard, FeatureGrid, FeatureRow, Fieldset, Figure, FileUpload, FilterBar, FilterChips, FilterPanel, Flex, FlexItem, Form, FormField, FormLayout, Grid, GridItem, Heading, Hero, Icon, IconButton, IconTile, Image, Input, InputGroup, InputGroupAddon, Label, Link, LinkTabs, List, ListItem, ListToolbar, LoadMore, LogoCloud, Media, MediaCard, Menu, MenuContent, MenuItem, MenuLabel, MenuSeparator, MenuTrigger, MetricCard, MonthSchedule, MultiSelect, Newsletter, PageHeader, Pagination, PasswordInput, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, ProcessSteps, ProfileCard, Progress, Prose, Radio, RadioCard, RadioGroup, RadioGroupContext, RadioGroupItem, RangeSlider, Search, Section, SectionHeading, SegmentedControl, Select, SelectMenu, Separator, Sidebar, SiteFooter, SiteHeader, Skeleton, SocialLinks, Spinner, StatBand, Stepper, Switch, Table, TableBody, TableCaption, TableCard, TableCell, TableFooter, TableHead, TableHeader, TableOfContents, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Testimonial, Text, Textarea, ThemeToggle, TimePicker, Timeline, ToastProvider, Toaster, TombstoneCard, Tooltip, alertVariants, badgeVariants, buttonVariants, cn, documentHead, iconTileVariants, iconVariants, isComponentManifest, resolveGap, separatorVariants, spinnerVariants, toast, useCombobox, useConsent, usePresence, useScrollSpy, useToast };
|
|
4875
|
-
export type { AccessibilityRequirement, AccordionContentProps, AccordionItemProps, AccordionProps, AccordionSection, AccordionTriggerProps, AlertDescriptionProps, AlertProps, AlertTitleProps, AnnouncementBarProps, AntiPattern, AppShellProps, AppliedFiltersProps, ArticleCardProps, AuthLayoutProps, AutocompleteOption, AutocompleteProps, BadgeProps, BlockElement, BlockProps, BottomNavItem, BottomNavProps, BreadcrumbItem, BreadcrumbProps, ButtonGroupProps, ButtonProps, CTASectionProps, CTASectionTone, CalendarProps, CardContentProps, CardDescriptionProps, CardFooterProps, CardHeaderProps, CardProps, CardTitleProps, CheckboxGroupItemProps, CheckboxGroupOrientation, CheckboxGroupProps, CheckboxProps, ComboboxItem, ComparisonColumn, ComparisonRow, ComparisonTableProps, ComponentManifest, ComponentTier, CompositionRule, ConfirmDialogProps, Consent, ConsentBannerProps, ConsentPreferences, ContactItem, ContactStripProps, ContainerProps, ContainerWidth, ContentGuideline, CoverImageProps, DataTableCardBreakpoint, DataTableColumn, DataTableProps, DatePickerPopoverProps, DatePickerProps, DateRange, DateRangePickerProps, DateRangePreset, DealCardProps, DealMetric, DealStatus, DialogBodyProps, DialogDescriptionProps, DialogFooterProps, DialogHeaderProps, DialogProps, DialogSize, DialogTitleProps, DocumentCardProps, DocumentHead, DocumentHeadInput, DocumentStatus, DrawerProps, DrawerSide, DrawerSize, EmptyStateAction, EmptyStateProps, EntityCardProps, EntityStat, FeatureGridProps, FeatureItem, FeatureRowProps, FieldsetProps, FigureProps, FileUploadProps, FilterBarProps, FilterChip, FilterChipsProps, FilterPanelProps, FilterSection, FlexItemProps, FlexProps, FormFieldLabelPlacement, FormFieldProps, FormLayoutColumns, FormLayoutProps, FormProps, FormVariant, GapValue, GridItemProps, GridProps, HeadingLevel, HeadingProps, HeroProps, IconButtonProps, IconProps, IconTileProps, ImageProps, InputGroupAddonProps, InputGroupProps, InputProps, LabelProps, LinkLikeProps, LinkProps, LinkTabsItem, LinkTabsProps, LinkVariant, ListItemProps, ListProps, ListToolbarProps, LoadMoreProps, LogoCloudProps, LogoItem, MediaCardChip, MediaCardProps, MediaProps, MenuContentProps, MenuItemProps, MenuLabelProps, MenuProps, MenuSeparatorProps, MenuTriggerProps, MetricCardProps, MetricTone, MetricTrend, MonthScheduleLegendItem, MonthScheduleProps, MultiSelectOption, MultiSelectProps, NewsletterProps, PageHeaderProps, PaginationIcons, PaginationProps, PasswordInputProps, PopoverAnchorProps, PopoverContentProps, PopoverProps, PopoverTriggerProps, ProcessStep, ProcessStepsProps, ProfileCardProps, ProgressProps, PropSchema, ProseProps, RadioCardProps, RadioGroupItemProps, RadioGroupProps, RadioProps, RangeSliderProps, SearchOption, SearchProps, SectionHeadingProps, SectionProps, SectionTone, SegmentedControlProps, SegmentedOption, SelectMenuItem, SelectMenuProps, SelectOption, SelectOptionGroup, SelectProps, SeparatorProps, SidebarItem, SidebarProps, SidebarSection, SiteFooterColumn, SiteFooterLink, SiteFooterProps, SiteHeaderProps, SiteNavColumn, SiteNavItem, SiteNavLink, SkeletonProps, SocialLink, SocialLinksProps, SortIconState, SpinnerProps, StatBandProps, StatItem, StepperProps, StepperStep, SwitchProps, TableBodyProps, TableCaptionProps, TableCardProps, TableCellProps, TableFooterProps, TableHeadProps, TableHeaderProps, TableOfContentsProps, TableProps, TableRowProps, TabsContentProps, TabsListProps, TabsProps, TabsTriggerProps, TestimonialProps, TextProps, TextareaProps, ThemeToggleProps, TimePickerProps, TimelineItem, TimelineProps, ToastAction, ToastContextValue, ToastOptions, ToastRecord, ToastVariant, ToasterPosition, ToasterProps, TocHeading, TombstoneCardProps, TombstoneStatus, TooltipProps, UsageExample, UseConsentOptions };
|
|
4904
|
+
export type { AccessibilityRequirement, AccordionContentProps, AccordionItemProps, AccordionProps, AccordionSection, AccordionTriggerProps, AlertDescriptionProps, AlertProps, AlertTitleProps, AnnouncementBarProps, AntiPattern, AppShellProps, AppliedFiltersProps, ArticleCardProps, AuthLayoutProps, AutocompleteOption, AutocompleteProps, BadgeProps, BlockElement, BlockProps, BottomNavItem, BottomNavProps, BreadcrumbItem, BreadcrumbProps, ButtonGroupProps, ButtonProps, CTASectionProps, CTASectionTone, CalendarProps, CardContentProps, CardDescriptionProps, CardFooterProps, CardHeaderProps, CardProps, CardTitleProps, CheckboxGroupItemProps, CheckboxGroupOrientation, CheckboxGroupProps, CheckboxProps, ComboboxItem, ComparisonColumn, ComparisonRow, ComparisonTableProps, ComponentManifest, ComponentTier, CompositionRule, ConfirmDialogProps, Consent, ConsentBannerProps, ConsentPreferences, ContactItem, ContactStripProps, ContainerProps, ContainerWidth, ContentGuideline, CoverImageProps, DataTableCardBreakpoint, DataTableColumn, DataTableProps, DatePickerPopoverProps, DatePickerProps, DateRange, DateRangePickerProps, DateRangePreset, DealCardProps, DealMetric, DealStatus, DialogBodyProps, DialogDescriptionProps, DialogFooterProps, DialogHeaderProps, DialogProps, DialogSize, DialogTitleProps, DocumentCardProps, DocumentHead, DocumentHeadInput, DocumentStatus, DrawerProps, DrawerSide, DrawerSize, EmptyStateAction, EmptyStateProps, EntityCardProps, EntityStat, FeatureGridProps, FeatureItem, FeatureRowProps, FieldsetProps, FigureProps, FileUploadProps, FilterBarProps, FilterChip, FilterChipsProps, FilterPanelProps, FilterSection, FlexItemProps, FlexProps, FormFieldLabelPlacement, FormFieldProps, FormLayoutColumns, FormLayoutProps, FormProps, FormVariant, GapValue, GridItemProps, GridProps, HeadingLevel, HeadingProps, HeroProps, IconButtonProps, IconProps, IconTileProps, ImageProps, InputGroupAddonProps, InputGroupProps, InputProps, LabelProps, LinkLikeProps, LinkProps, LinkTabsItem, LinkTabsProps, LinkVariant, ListItemProps, ListProps, ListToolbarProps, LoadMoreProps, LogoCloudProps, LogoItem, MediaCardChip, MediaCardProps, MediaProps, MenuContentProps, MenuItemProps, MenuLabelProps, MenuProps, MenuSeparatorProps, MenuTriggerProps, MetricCardProps, MetricTone, MetricTrend, MonthScheduleLegendItem, MonthScheduleProps, MultiSelectOption, MultiSelectProps, NewsletterProps, PageHeaderProps, PaginationIcons, PaginationProps, PasswordInputProps, PopoverAnchorProps, PopoverContentProps, PopoverProps, PopoverTriggerProps, ProcessStep, ProcessStepsProps, ProfileCardProps, ProgressProps, PropSchema, ProseProps, RadioCardProps, RadioGroupItemProps, RadioGroupProps, RadioProps, RangeSliderProps, SearchOption, SearchProps, SectionHeadingProps, SectionProps, SectionTone, SegmentedControlProps, SegmentedOption, SelectMenuItem, SelectMenuProps, SelectOption, SelectOptionGroup, SelectProps, SeparatorProps, SidebarItem, SidebarProps, SidebarSection, SiteFooterColumn, SiteFooterLink, SiteFooterProps, SiteHeaderProps, SiteNavColumn, SiteNavItem, SiteNavLink, SkeletonProps, SocialLink, SocialLinksProps, SortIconState, SpinnerProps, StatBandProps, StatItem, StepperProps, StepperStep, SwitchProps, TableBodyProps, TableCaptionProps, TableCardProps, TableCellProps, TableFooterProps, TableHeadProps, TableHeaderProps, TableOfContentsProps, TableProps, TableRowProps, TabsContentProps, TabsListProps, TabsProps, TabsTriggerProps, TestimonialProps, TextProps, TextareaProps, ThemeToggleProps, TimePickerFormat, TimePickerProps, TimelineItem, TimelineProps, ToastAction, ToastContextValue, ToastOptions, ToastRecord, ToastVariant, ToasterPosition, ToasterProps, TocHeading, TombstoneCardProps, TombstoneStatus, TooltipProps, UsageExample, UseConsentOptions };
|
package/dist/index.d.ts
CHANGED
|
@@ -2742,6 +2742,7 @@ type DatePickerPopoverProps = {
|
|
|
2742
2742
|
*/
|
|
2743
2743
|
declare const DatePickerPopover: React.ForwardRefExoticComponent<DatePickerPopoverProps & React.RefAttributes<HTMLButtonElement>>;
|
|
2744
2744
|
|
|
2745
|
+
type TimePickerFormat = '24h' | '12h';
|
|
2745
2746
|
type TimePickerProps = Omit<InputProps, 'type' | 'value' | 'defaultValue'> & {
|
|
2746
2747
|
/** "HH:MM" (24h) — controlled. */
|
|
2747
2748
|
value?: string;
|
|
@@ -2753,10 +2754,24 @@ type TimePickerProps = Omit<InputProps, 'type' | 'value' | 'defaultValue'> & {
|
|
|
2753
2754
|
clearable?: boolean;
|
|
2754
2755
|
/** Accessible label for the clear button. Default 'Clear time'. */
|
|
2755
2756
|
clearLabel?: string;
|
|
2757
|
+
/**
|
|
2758
|
+
* Display contract. '24h' (default) renders the native time input.
|
|
2759
|
+
* '12h' renders a button trigger with an hour/minute/AM-PM panel because
|
|
2760
|
+
* input[type=time] cannot show AM/PM portably. Both emit "HH:MM".
|
|
2761
|
+
*/
|
|
2762
|
+
format?: TimePickerFormat;
|
|
2763
|
+
/** Minute granularity for the panel options and the native input step. Default 1. */
|
|
2764
|
+
minuteStep?: number;
|
|
2765
|
+
/** Earliest selectable time, "HH:MM" inclusive. */
|
|
2766
|
+
min?: string;
|
|
2767
|
+
/** Latest selectable time, "HH:MM" inclusive. */
|
|
2768
|
+
max?: string;
|
|
2769
|
+
/** Text shown before a time is chosen (12h mode). */
|
|
2770
|
+
placeholder?: string;
|
|
2756
2771
|
};
|
|
2757
2772
|
/**
|
|
2758
|
-
*
|
|
2759
|
-
*
|
|
2773
|
+
* Time field with an "HH:MM" contract. The 24h format is a native time input;
|
|
2774
|
+
* the 12h format is a button trigger with an hour/minute/period panel.
|
|
2760
2775
|
*/
|
|
2761
2776
|
declare const TimePicker: React.ForwardRefExoticComponent<Omit<InputProps, "type" | "value" | "defaultValue"> & {
|
|
2762
2777
|
/** "HH:MM" (24h) — controlled. */
|
|
@@ -2769,6 +2784,20 @@ declare const TimePicker: React.ForwardRefExoticComponent<Omit<InputProps, "type
|
|
|
2769
2784
|
clearable?: boolean;
|
|
2770
2785
|
/** Accessible label for the clear button. Default 'Clear time'. */
|
|
2771
2786
|
clearLabel?: string;
|
|
2787
|
+
/**
|
|
2788
|
+
* Display contract. '24h' (default) renders the native time input.
|
|
2789
|
+
* '12h' renders a button trigger with an hour/minute/AM-PM panel because
|
|
2790
|
+
* input[type=time] cannot show AM/PM portably. Both emit "HH:MM".
|
|
2791
|
+
*/
|
|
2792
|
+
format?: TimePickerFormat;
|
|
2793
|
+
/** Minute granularity for the panel options and the native input step. Default 1. */
|
|
2794
|
+
minuteStep?: number;
|
|
2795
|
+
/** Earliest selectable time, "HH:MM" inclusive. */
|
|
2796
|
+
min?: string;
|
|
2797
|
+
/** Latest selectable time, "HH:MM" inclusive. */
|
|
2798
|
+
max?: string;
|
|
2799
|
+
/** Text shown before a time is chosen (12h mode). */
|
|
2800
|
+
placeholder?: string;
|
|
2772
2801
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
2773
2802
|
|
|
2774
2803
|
type StepperStep = {
|
|
@@ -4872,4 +4901,4 @@ declare const Media: React.ForwardRefExoticComponent<Omit<FigureProps, "children
|
|
|
4872
4901
|
} & React.RefAttributes<HTMLElement>>;
|
|
4873
4902
|
|
|
4874
4903
|
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, AnnouncementBar, AppShell, AppliedFilters, ArticleCard, AuthLayout, Autocomplete, Avatar, AvatarFallback, AvatarImage, Badge, Block, BottomNav, Breadcrumb, Button, ButtonGroup, CONSENT_CHANGE_EVENT, CTASection, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CheckboxGroup, CheckboxGroupItem, ComparisonTable, ConfirmDialog, ConsentBanner, ContactStrip, Container, CoverImage, DataTable, DatePicker, DatePickerPopover, DateRangePicker, DealCard, Dialog, DialogBody, DialogDescription, DialogFooter, DialogHeader, DialogTitle, Divider, DocumentCard, Drawer, EmptyState, EntityCard, FeatureGrid, FeatureRow, Fieldset, Figure, FileUpload, FilterBar, FilterChips, FilterPanel, Flex, FlexItem, Form, FormField, FormLayout, Grid, GridItem, Heading, Hero, Icon, IconButton, IconTile, Image, Input, InputGroup, InputGroupAddon, Label, Link, LinkTabs, List, ListItem, ListToolbar, LoadMore, LogoCloud, Media, MediaCard, Menu, MenuContent, MenuItem, MenuLabel, MenuSeparator, MenuTrigger, MetricCard, MonthSchedule, MultiSelect, Newsletter, PageHeader, Pagination, PasswordInput, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, ProcessSteps, ProfileCard, Progress, Prose, Radio, RadioCard, RadioGroup, RadioGroupContext, RadioGroupItem, RangeSlider, Search, Section, SectionHeading, SegmentedControl, Select, SelectMenu, Separator, Sidebar, SiteFooter, SiteHeader, Skeleton, SocialLinks, Spinner, StatBand, Stepper, Switch, Table, TableBody, TableCaption, TableCard, TableCell, TableFooter, TableHead, TableHeader, TableOfContents, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Testimonial, Text, Textarea, ThemeToggle, TimePicker, Timeline, ToastProvider, Toaster, TombstoneCard, Tooltip, alertVariants, badgeVariants, buttonVariants, cn, documentHead, iconTileVariants, iconVariants, isComponentManifest, resolveGap, separatorVariants, spinnerVariants, toast, useCombobox, useConsent, usePresence, useScrollSpy, useToast };
|
|
4875
|
-
export type { AccessibilityRequirement, AccordionContentProps, AccordionItemProps, AccordionProps, AccordionSection, AccordionTriggerProps, AlertDescriptionProps, AlertProps, AlertTitleProps, AnnouncementBarProps, AntiPattern, AppShellProps, AppliedFiltersProps, ArticleCardProps, AuthLayoutProps, AutocompleteOption, AutocompleteProps, BadgeProps, BlockElement, BlockProps, BottomNavItem, BottomNavProps, BreadcrumbItem, BreadcrumbProps, ButtonGroupProps, ButtonProps, CTASectionProps, CTASectionTone, CalendarProps, CardContentProps, CardDescriptionProps, CardFooterProps, CardHeaderProps, CardProps, CardTitleProps, CheckboxGroupItemProps, CheckboxGroupOrientation, CheckboxGroupProps, CheckboxProps, ComboboxItem, ComparisonColumn, ComparisonRow, ComparisonTableProps, ComponentManifest, ComponentTier, CompositionRule, ConfirmDialogProps, Consent, ConsentBannerProps, ConsentPreferences, ContactItem, ContactStripProps, ContainerProps, ContainerWidth, ContentGuideline, CoverImageProps, DataTableCardBreakpoint, DataTableColumn, DataTableProps, DatePickerPopoverProps, DatePickerProps, DateRange, DateRangePickerProps, DateRangePreset, DealCardProps, DealMetric, DealStatus, DialogBodyProps, DialogDescriptionProps, DialogFooterProps, DialogHeaderProps, DialogProps, DialogSize, DialogTitleProps, DocumentCardProps, DocumentHead, DocumentHeadInput, DocumentStatus, DrawerProps, DrawerSide, DrawerSize, EmptyStateAction, EmptyStateProps, EntityCardProps, EntityStat, FeatureGridProps, FeatureItem, FeatureRowProps, FieldsetProps, FigureProps, FileUploadProps, FilterBarProps, FilterChip, FilterChipsProps, FilterPanelProps, FilterSection, FlexItemProps, FlexProps, FormFieldLabelPlacement, FormFieldProps, FormLayoutColumns, FormLayoutProps, FormProps, FormVariant, GapValue, GridItemProps, GridProps, HeadingLevel, HeadingProps, HeroProps, IconButtonProps, IconProps, IconTileProps, ImageProps, InputGroupAddonProps, InputGroupProps, InputProps, LabelProps, LinkLikeProps, LinkProps, LinkTabsItem, LinkTabsProps, LinkVariant, ListItemProps, ListProps, ListToolbarProps, LoadMoreProps, LogoCloudProps, LogoItem, MediaCardChip, MediaCardProps, MediaProps, MenuContentProps, MenuItemProps, MenuLabelProps, MenuProps, MenuSeparatorProps, MenuTriggerProps, MetricCardProps, MetricTone, MetricTrend, MonthScheduleLegendItem, MonthScheduleProps, MultiSelectOption, MultiSelectProps, NewsletterProps, PageHeaderProps, PaginationIcons, PaginationProps, PasswordInputProps, PopoverAnchorProps, PopoverContentProps, PopoverProps, PopoverTriggerProps, ProcessStep, ProcessStepsProps, ProfileCardProps, ProgressProps, PropSchema, ProseProps, RadioCardProps, RadioGroupItemProps, RadioGroupProps, RadioProps, RangeSliderProps, SearchOption, SearchProps, SectionHeadingProps, SectionProps, SectionTone, SegmentedControlProps, SegmentedOption, SelectMenuItem, SelectMenuProps, SelectOption, SelectOptionGroup, SelectProps, SeparatorProps, SidebarItem, SidebarProps, SidebarSection, SiteFooterColumn, SiteFooterLink, SiteFooterProps, SiteHeaderProps, SiteNavColumn, SiteNavItem, SiteNavLink, SkeletonProps, SocialLink, SocialLinksProps, SortIconState, SpinnerProps, StatBandProps, StatItem, StepperProps, StepperStep, SwitchProps, TableBodyProps, TableCaptionProps, TableCardProps, TableCellProps, TableFooterProps, TableHeadProps, TableHeaderProps, TableOfContentsProps, TableProps, TableRowProps, TabsContentProps, TabsListProps, TabsProps, TabsTriggerProps, TestimonialProps, TextProps, TextareaProps, ThemeToggleProps, TimePickerProps, TimelineItem, TimelineProps, ToastAction, ToastContextValue, ToastOptions, ToastRecord, ToastVariant, ToasterPosition, ToasterProps, TocHeading, TombstoneCardProps, TombstoneStatus, TooltipProps, UsageExample, UseConsentOptions };
|
|
4904
|
+
export type { AccessibilityRequirement, AccordionContentProps, AccordionItemProps, AccordionProps, AccordionSection, AccordionTriggerProps, AlertDescriptionProps, AlertProps, AlertTitleProps, AnnouncementBarProps, AntiPattern, AppShellProps, AppliedFiltersProps, ArticleCardProps, AuthLayoutProps, AutocompleteOption, AutocompleteProps, BadgeProps, BlockElement, BlockProps, BottomNavItem, BottomNavProps, BreadcrumbItem, BreadcrumbProps, ButtonGroupProps, ButtonProps, CTASectionProps, CTASectionTone, CalendarProps, CardContentProps, CardDescriptionProps, CardFooterProps, CardHeaderProps, CardProps, CardTitleProps, CheckboxGroupItemProps, CheckboxGroupOrientation, CheckboxGroupProps, CheckboxProps, ComboboxItem, ComparisonColumn, ComparisonRow, ComparisonTableProps, ComponentManifest, ComponentTier, CompositionRule, ConfirmDialogProps, Consent, ConsentBannerProps, ConsentPreferences, ContactItem, ContactStripProps, ContainerProps, ContainerWidth, ContentGuideline, CoverImageProps, DataTableCardBreakpoint, DataTableColumn, DataTableProps, DatePickerPopoverProps, DatePickerProps, DateRange, DateRangePickerProps, DateRangePreset, DealCardProps, DealMetric, DealStatus, DialogBodyProps, DialogDescriptionProps, DialogFooterProps, DialogHeaderProps, DialogProps, DialogSize, DialogTitleProps, DocumentCardProps, DocumentHead, DocumentHeadInput, DocumentStatus, DrawerProps, DrawerSide, DrawerSize, EmptyStateAction, EmptyStateProps, EntityCardProps, EntityStat, FeatureGridProps, FeatureItem, FeatureRowProps, FieldsetProps, FigureProps, FileUploadProps, FilterBarProps, FilterChip, FilterChipsProps, FilterPanelProps, FilterSection, FlexItemProps, FlexProps, FormFieldLabelPlacement, FormFieldProps, FormLayoutColumns, FormLayoutProps, FormProps, FormVariant, GapValue, GridItemProps, GridProps, HeadingLevel, HeadingProps, HeroProps, IconButtonProps, IconProps, IconTileProps, ImageProps, InputGroupAddonProps, InputGroupProps, InputProps, LabelProps, LinkLikeProps, LinkProps, LinkTabsItem, LinkTabsProps, LinkVariant, ListItemProps, ListProps, ListToolbarProps, LoadMoreProps, LogoCloudProps, LogoItem, MediaCardChip, MediaCardProps, MediaProps, MenuContentProps, MenuItemProps, MenuLabelProps, MenuProps, MenuSeparatorProps, MenuTriggerProps, MetricCardProps, MetricTone, MetricTrend, MonthScheduleLegendItem, MonthScheduleProps, MultiSelectOption, MultiSelectProps, NewsletterProps, PageHeaderProps, PaginationIcons, PaginationProps, PasswordInputProps, PopoverAnchorProps, PopoverContentProps, PopoverProps, PopoverTriggerProps, ProcessStep, ProcessStepsProps, ProfileCardProps, ProgressProps, PropSchema, ProseProps, RadioCardProps, RadioGroupItemProps, RadioGroupProps, RadioProps, RangeSliderProps, SearchOption, SearchProps, SectionHeadingProps, SectionProps, SectionTone, SegmentedControlProps, SegmentedOption, SelectMenuItem, SelectMenuProps, SelectOption, SelectOptionGroup, SelectProps, SeparatorProps, SidebarItem, SidebarProps, SidebarSection, SiteFooterColumn, SiteFooterLink, SiteFooterProps, SiteHeaderProps, SiteNavColumn, SiteNavItem, SiteNavLink, SkeletonProps, SocialLink, SocialLinksProps, SortIconState, SpinnerProps, StatBandProps, StatItem, StepperProps, StepperStep, SwitchProps, TableBodyProps, TableCaptionProps, TableCardProps, TableCellProps, TableFooterProps, TableHeadProps, TableHeaderProps, TableOfContentsProps, TableProps, TableRowProps, TabsContentProps, TabsListProps, TabsProps, TabsTriggerProps, TestimonialProps, TextProps, TextareaProps, ThemeToggleProps, TimePickerFormat, TimePickerProps, TimelineItem, TimelineProps, ToastAction, ToastContextValue, ToastOptions, ToastRecord, ToastVariant, ToasterPosition, ToasterProps, TocHeading, TombstoneCardProps, TombstoneStatus, TooltipProps, UsageExample, UseConsentOptions };
|
package/dist/index.js
CHANGED
|
@@ -6385,13 +6385,108 @@ DatePickerPopover.displayName = "DatePickerPopover";
|
|
|
6385
6385
|
// src/components/time-picker/TimePicker.tsx
|
|
6386
6386
|
var React66 = __toESM(require("react"));
|
|
6387
6387
|
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
6388
|
-
var
|
|
6388
|
+
var pad2 = (n) => String(n).padStart(2, "0");
|
|
6389
|
+
function toMinutes(value) {
|
|
6390
|
+
if (!value) return null;
|
|
6391
|
+
const match = /^(\d{1,2}):(\d{2})/.exec(value.trim());
|
|
6392
|
+
if (!match) return null;
|
|
6393
|
+
const minutes = Number(match[1]) * 60 + Number(match[2]);
|
|
6394
|
+
return minutes >= 0 && minutes <= 1439 ? minutes : null;
|
|
6395
|
+
}
|
|
6396
|
+
function fromMinutes(total) {
|
|
6397
|
+
return `${pad2(Math.floor(total / 60))}:${pad2(total % 60)}`;
|
|
6398
|
+
}
|
|
6399
|
+
function minuteChoices(step) {
|
|
6400
|
+
const out = [];
|
|
6401
|
+
for (let m = 0; m < 60; m += step) out.push(m);
|
|
6402
|
+
return out;
|
|
6403
|
+
}
|
|
6404
|
+
function allowedMinutes(hour24, minBound, maxBound, step) {
|
|
6405
|
+
const base = hour24 * 60;
|
|
6406
|
+
return minuteChoices(step).filter((m) => {
|
|
6407
|
+
const total = base + m;
|
|
6408
|
+
return total >= minBound && total <= maxBound;
|
|
6409
|
+
});
|
|
6410
|
+
}
|
|
6411
|
+
function hourHasValidMinute(hour24, minBound, maxBound, step) {
|
|
6412
|
+
return allowedMinutes(hour24, minBound, maxBound, step).length > 0;
|
|
6413
|
+
}
|
|
6414
|
+
function to12(hour24, minute) {
|
|
6415
|
+
const period = hour24 >= 12 ? "PM" : "AM";
|
|
6416
|
+
const hour12 = hour24 % 12 === 0 ? 12 : hour24 % 12;
|
|
6417
|
+
return { hour12, minute, period };
|
|
6418
|
+
}
|
|
6419
|
+
function from12(hour12, minute, period) {
|
|
6420
|
+
const hour24 = hour12 % 12 + (period === "PM" ? 12 : 0);
|
|
6421
|
+
return hour24 * 60 + minute;
|
|
6422
|
+
}
|
|
6423
|
+
function format12(value) {
|
|
6424
|
+
const total = toMinutes(value);
|
|
6425
|
+
if (total === null) return "";
|
|
6426
|
+
const { hour12, minute, period } = to12(Math.floor(total / 60), total % 60);
|
|
6427
|
+
return `${hour12}:${pad2(minute)} ${period}`;
|
|
6428
|
+
}
|
|
6429
|
+
var PERIODS = ["AM", "PM"];
|
|
6430
|
+
var TimePicker = React66.forwardRef(function TimePicker2({
|
|
6431
|
+
value,
|
|
6432
|
+
defaultValue,
|
|
6433
|
+
onValueChange,
|
|
6434
|
+
onChange,
|
|
6435
|
+
clearable = false,
|
|
6436
|
+
clearLabel = "Clear time",
|
|
6437
|
+
format = "24h",
|
|
6438
|
+
minuteStep = 1,
|
|
6439
|
+
min,
|
|
6440
|
+
max,
|
|
6441
|
+
placeholder,
|
|
6442
|
+
className,
|
|
6443
|
+
name,
|
|
6444
|
+
id,
|
|
6445
|
+
disabled,
|
|
6446
|
+
required,
|
|
6447
|
+
"aria-label": ariaLabel,
|
|
6448
|
+
"aria-describedby": ariaDescribedBy,
|
|
6449
|
+
"aria-invalid": ariaInvalid,
|
|
6450
|
+
...props
|
|
6451
|
+
}, ref) {
|
|
6389
6452
|
const [internal, setInternal] = React66.useState(defaultValue ?? "");
|
|
6390
6453
|
const current = value ?? internal;
|
|
6454
|
+
const step = Math.min(60, Math.max(1, Math.floor(minuteStep)));
|
|
6391
6455
|
const commit = (next) => {
|
|
6392
6456
|
if (value === void 0) setInternal(next);
|
|
6393
6457
|
onValueChange?.(next);
|
|
6394
6458
|
};
|
|
6459
|
+
const clearButton = clearable && current ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
6460
|
+
"button",
|
|
6461
|
+
{
|
|
6462
|
+
type: "button",
|
|
6463
|
+
onClick: () => commit(""),
|
|
6464
|
+
"aria-label": clearLabel,
|
|
6465
|
+
className: "absolute right-1.5 top-1/2 z-10 inline-flex h-6 w-6 -translate-y-1/2 items-center justify-center rounded text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
6466
|
+
children: "\u2715"
|
|
6467
|
+
}
|
|
6468
|
+
) : null;
|
|
6469
|
+
if (format === "12h") {
|
|
6470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
6471
|
+
TimePicker12h,
|
|
6472
|
+
{
|
|
6473
|
+
current,
|
|
6474
|
+
commit,
|
|
6475
|
+
clearButton,
|
|
6476
|
+
step,
|
|
6477
|
+
min,
|
|
6478
|
+
max,
|
|
6479
|
+
placeholder: placeholder ?? "Pick a time",
|
|
6480
|
+
className,
|
|
6481
|
+
name,
|
|
6482
|
+
id,
|
|
6483
|
+
disabled,
|
|
6484
|
+
ariaLabel,
|
|
6485
|
+
ariaDescribedBy,
|
|
6486
|
+
ariaInvalid
|
|
6487
|
+
}
|
|
6488
|
+
);
|
|
6489
|
+
}
|
|
6395
6490
|
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: cn("relative flex items-center", className), children: [
|
|
6396
6491
|
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
6397
6492
|
Input,
|
|
@@ -6399,6 +6494,17 @@ var TimePicker = React66.forwardRef(function TimePicker2({ value, defaultValue,
|
|
|
6399
6494
|
ref,
|
|
6400
6495
|
type: "time",
|
|
6401
6496
|
value: current,
|
|
6497
|
+
min,
|
|
6498
|
+
max,
|
|
6499
|
+
step: step * 60,
|
|
6500
|
+
placeholder,
|
|
6501
|
+
name,
|
|
6502
|
+
id,
|
|
6503
|
+
disabled,
|
|
6504
|
+
required,
|
|
6505
|
+
"aria-label": ariaLabel,
|
|
6506
|
+
"aria-describedby": ariaDescribedBy,
|
|
6507
|
+
"aria-invalid": ariaInvalid,
|
|
6402
6508
|
onChange: (event) => {
|
|
6403
6509
|
commit(event.target.value);
|
|
6404
6510
|
onChange?.(event);
|
|
@@ -6407,18 +6513,143 @@ var TimePicker = React66.forwardRef(function TimePicker2({ value, defaultValue,
|
|
|
6407
6513
|
...props
|
|
6408
6514
|
}
|
|
6409
6515
|
),
|
|
6410
|
-
|
|
6411
|
-
"button",
|
|
6412
|
-
{
|
|
6413
|
-
type: "button",
|
|
6414
|
-
onClick: () => commit(""),
|
|
6415
|
-
"aria-label": clearLabel,
|
|
6416
|
-
className: "absolute right-1.5 inline-flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
6417
|
-
children: "\u2715"
|
|
6418
|
-
}
|
|
6419
|
-
)
|
|
6516
|
+
clearButton
|
|
6420
6517
|
] });
|
|
6421
6518
|
});
|
|
6519
|
+
TimePicker.displayName = "TimePicker";
|
|
6520
|
+
function TimePicker12h({
|
|
6521
|
+
current,
|
|
6522
|
+
commit,
|
|
6523
|
+
clearButton,
|
|
6524
|
+
step,
|
|
6525
|
+
min,
|
|
6526
|
+
max,
|
|
6527
|
+
placeholder,
|
|
6528
|
+
className,
|
|
6529
|
+
name,
|
|
6530
|
+
id,
|
|
6531
|
+
disabled,
|
|
6532
|
+
ariaLabel,
|
|
6533
|
+
ariaDescribedBy,
|
|
6534
|
+
ariaInvalid
|
|
6535
|
+
}) {
|
|
6536
|
+
const [open, setOpen] = React66.useState(false);
|
|
6537
|
+
const total = toMinutes(current);
|
|
6538
|
+
const minBound = toMinutes(min) ?? 0;
|
|
6539
|
+
const maxBound = toMinutes(max) ?? 1439;
|
|
6540
|
+
const draft = React66.useMemo(() => {
|
|
6541
|
+
if (total !== null) {
|
|
6542
|
+
const hour242 = Math.floor(total / 60);
|
|
6543
|
+
const { hour12: hour122, minute: minute2, period: period2 } = to12(hour242, total % 60);
|
|
6544
|
+
return { hour12: hour122, minute: minute2, period: period2 };
|
|
6545
|
+
}
|
|
6546
|
+
const anchor = minBound;
|
|
6547
|
+
const hour24 = Math.floor(anchor / 60);
|
|
6548
|
+
const { hour12, minute, period } = to12(hour24, anchor % 60);
|
|
6549
|
+
return { hour12, minute, period };
|
|
6550
|
+
}, [total, minBound]);
|
|
6551
|
+
const minutesFor = (hour12, period) => {
|
|
6552
|
+
const hour24 = hour12 % 12 + (period === "PM" ? 12 : 0);
|
|
6553
|
+
return allowedMinutes(hour24, minBound, maxBound, step);
|
|
6554
|
+
};
|
|
6555
|
+
const hours12 = Array.from({ length: 12 }, (_, i) => i + 1);
|
|
6556
|
+
const hour24Of = (h12, p) => h12 % 12 + (p === "PM" ? 12 : 0);
|
|
6557
|
+
const isHourEnabled = (h12) => minutesFor(h12, draft.period).length > 0;
|
|
6558
|
+
const isPeriodEnabled = (p) => hours12.some((h) => hourHasValidMinute(hour24Of(h, p), minBound, maxBound, step));
|
|
6559
|
+
const minuteOptions = minutesFor(draft.hour12, draft.period);
|
|
6560
|
+
const validMinute = minuteOptions.includes(draft.minute) ? draft.minute : minuteOptions[0];
|
|
6561
|
+
const emit2 = (h12, minute, p) => {
|
|
6562
|
+
commit(fromMinutes(from12(h12, minute, p)));
|
|
6563
|
+
};
|
|
6564
|
+
const onHour = (h12) => {
|
|
6565
|
+
const options = minutesFor(h12, draft.period);
|
|
6566
|
+
if (options.length === 0) return;
|
|
6567
|
+
const minute = options.includes(draft.minute) ? draft.minute : options[0];
|
|
6568
|
+
emit2(h12, minute, draft.period);
|
|
6569
|
+
};
|
|
6570
|
+
const onPeriod = (p) => {
|
|
6571
|
+
let hour = draft.hour12;
|
|
6572
|
+
let options = minutesFor(hour, p);
|
|
6573
|
+
if (options.length === 0) {
|
|
6574
|
+
hour = hours12.find((h) => minutesFor(h, p).length > 0) ?? hour;
|
|
6575
|
+
options = minutesFor(hour, p);
|
|
6576
|
+
if (options.length === 0) return;
|
|
6577
|
+
}
|
|
6578
|
+
const minute = options.includes(draft.minute) ? draft.minute : options[0];
|
|
6579
|
+
emit2(hour, minute, p);
|
|
6580
|
+
};
|
|
6581
|
+
const label = total !== null ? format12(current) : placeholder;
|
|
6582
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: cn("relative flex items-center", className), children: [
|
|
6583
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(Popover, { open, onOpenChange: setOpen, children: [
|
|
6584
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
|
|
6585
|
+
PopoverTrigger,
|
|
6586
|
+
{
|
|
6587
|
+
id,
|
|
6588
|
+
type: "button",
|
|
6589
|
+
disabled,
|
|
6590
|
+
"aria-label": ariaLabel,
|
|
6591
|
+
"aria-describedby": ariaDescribedBy,
|
|
6592
|
+
"aria-invalid": ariaInvalid,
|
|
6593
|
+
className: cn(
|
|
6594
|
+
"flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-left text-sm",
|
|
6595
|
+
"hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
|
|
6596
|
+
total === null && "text-muted-foreground",
|
|
6597
|
+
clearButton && "pr-9"
|
|
6598
|
+
),
|
|
6599
|
+
children: [
|
|
6600
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { children: label }),
|
|
6601
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { "aria-hidden": "true", className: "text-muted-foreground", children: "\u25BE" })
|
|
6602
|
+
]
|
|
6603
|
+
}
|
|
6604
|
+
),
|
|
6605
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(PopoverContent, { side: "bottom", align: "start", matchTriggerWidth: true, className: "p-3", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex items-end gap-2", children: [
|
|
6606
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
6607
|
+
Select,
|
|
6608
|
+
{
|
|
6609
|
+
label: "Hour",
|
|
6610
|
+
labelHidden: true,
|
|
6611
|
+
className: "flex-1",
|
|
6612
|
+
value: String(draft.hour12),
|
|
6613
|
+
onValueChange: (v) => onHour(Number(Array.isArray(v) ? v[0] : v)),
|
|
6614
|
+
options: hours12.map((h) => ({
|
|
6615
|
+
value: String(h),
|
|
6616
|
+
label: pad2(h),
|
|
6617
|
+
disabled: !isHourEnabled(h)
|
|
6618
|
+
}))
|
|
6619
|
+
}
|
|
6620
|
+
),
|
|
6621
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
6622
|
+
Select,
|
|
6623
|
+
{
|
|
6624
|
+
label: "Minute",
|
|
6625
|
+
labelHidden: true,
|
|
6626
|
+
className: "flex-1",
|
|
6627
|
+
value: String(validMinute),
|
|
6628
|
+
onValueChange: (v) => emit2(draft.hour12, Number(Array.isArray(v) ? v[0] : v), draft.period),
|
|
6629
|
+
options: minuteOptions.map((m) => ({ value: String(m), label: pad2(m) }))
|
|
6630
|
+
}
|
|
6631
|
+
),
|
|
6632
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
6633
|
+
Select,
|
|
6634
|
+
{
|
|
6635
|
+
label: "AM or PM",
|
|
6636
|
+
labelHidden: true,
|
|
6637
|
+
className: "flex-1",
|
|
6638
|
+
value: draft.period,
|
|
6639
|
+
onValueChange: (v) => onPeriod(Array.isArray(v) ? v[0] : v),
|
|
6640
|
+
options: PERIODS.map((p) => ({
|
|
6641
|
+
value: p,
|
|
6642
|
+
label: p,
|
|
6643
|
+
disabled: !isPeriodEnabled(p)
|
|
6644
|
+
}))
|
|
6645
|
+
}
|
|
6646
|
+
)
|
|
6647
|
+
] }) })
|
|
6648
|
+
] }),
|
|
6649
|
+
clearButton,
|
|
6650
|
+
name ? /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("input", { type: "hidden", name, value: current }) : null
|
|
6651
|
+
] });
|
|
6652
|
+
}
|
|
6422
6653
|
|
|
6423
6654
|
// src/components/stepper/Stepper.tsx
|
|
6424
6655
|
var React67 = __toESM(require("react"));
|