pixelize-design-library 2.4.2-beta.61 → 2.4.2-beta.62
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/CHANGELOG.md +153 -0
- package/COMPONENT-GOTCHAS.md +119 -1
- package/dist/Components/Accordion/Accordion.js +2 -2
- package/dist/Components/AddressCard/AddressCard.js +2 -1
- package/dist/Components/Apexcharts/ApexLineChart/ApexLineChart.js +1 -1
- package/dist/Components/AppSwitcher/AppSwitcher.js +1 -1
- package/dist/Components/AppearanceSettings/AppearanceSettings.js +1 -1
- package/dist/Components/AudioRecorder/AudioRecorder.js +2 -1
- package/dist/Components/Avatar/Avatar.d.ts +2 -1
- package/dist/Components/Avatar/Avatar.js +5 -3
- package/dist/Components/Backdrop/Backdrop.js +1 -1
- package/dist/Components/BagBar/BagBar.js +2 -1
- package/dist/Components/ButtonGroupIcon/ButtonGroupIcon.js +1 -1
- package/dist/Components/CalendarGrid/CalendarGrid.js +5 -5
- package/dist/Components/CalendarGrid/calendarMath.js +18 -6
- package/dist/Components/Card/PaymentCard/PaymentCard.js +6 -5
- package/dist/Components/CartItem/CartItem.js +2 -1
- package/dist/Components/Checkbox/Checkbox.d.ts +18 -3
- package/dist/Components/Checkbox/Checkbox.js +9 -7
- package/dist/Components/CheckoutKit/selectable.js +1 -1
- package/dist/Components/ChoiceCard/ChoiceCard.d.ts +3 -0
- package/dist/Components/ChoiceCard/ChoiceCard.js +16 -0
- package/dist/Components/ChoiceCard/ChoiceCardGroup.d.ts +3 -0
- package/dist/Components/ChoiceCard/ChoiceCardGroup.js +6 -0
- package/dist/Components/ChoiceCard/ChoiceCardProps.d.ts +28 -0
- package/dist/Components/ChoiceCard/ChoiceCardProps.js +2 -0
- package/dist/Components/CircularProgress/CircularProgress.js +4 -8
- package/dist/Components/CircularProgress/CircularProgressProps.d.ts +5 -3
- package/dist/Components/CircularProgress/arc.d.ts +9 -1
- package/dist/Components/CircularProgress/arc.js +15 -1
- package/dist/Components/Common/FormLabel.js +1 -1
- package/dist/Components/Common/FormattedDescription.js +1 -1
- package/dist/Components/Common/HelperText.d.ts +5 -4
- package/dist/Components/Common/HelperText.js +10 -7
- package/dist/Components/Common/fieldStyles.d.ts +4 -4
- package/dist/Components/Common/fieldStyles.js +2 -1
- package/dist/Components/ContactForm/ContactForm.js +1 -1
- package/dist/Components/CopyButton/CopyButton.js +12 -5
- package/dist/Components/CouponField/CouponField.js +4 -3
- package/dist/Components/CustomModulesTable/CustomModulesTableProps.d.ts +18 -0
- package/dist/Components/CustomModulesTable/EditModuleModal.js +1 -1
- package/dist/Components/DatePicker/CalendarPanel.js +2 -2
- package/dist/Components/DatePicker/DatePicker.js +8 -2
- package/dist/Components/DatePicker/RangeDatePicker.d.ts +9 -3
- package/dist/Components/DatePicker/RangeDatePicker.js +6 -5
- package/dist/Components/DatePicker/SingleDatePicker.d.ts +9 -5
- package/dist/Components/DatePicker/SingleDatePicker.js +7 -4
- package/dist/Components/DatePicker/ThemeDatePicker.d.ts +8 -4
- package/dist/Components/DatePicker/ThemeDatePicker.js +9 -6
- package/dist/Components/DatePicker/TimeOnlyPicker.d.ts +9 -5
- package/dist/Components/DatePicker/TimeOnlyPicker.js +6 -4
- package/dist/Components/DatePicker/TimePickerInput.d.ts +2 -2
- package/dist/Components/DatePicker/TimePickerInput.js +6 -5
- package/dist/Components/DescriptionList/DescriptionList.d.ts +1 -1
- package/dist/Components/DescriptionList/DescriptionList.js +3 -3
- package/dist/Components/DescriptionList/DescriptionListProps.d.ts +3 -3
- package/dist/Components/Dropdown/DropDown.js +12 -4
- package/dist/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +2 -1
- package/dist/Components/EmptyState/EmptyState.js +2 -2
- package/dist/Components/EmptyState/EmptyStateProps.d.ts +3 -3
- package/dist/Components/FileUpload/FileUpload.js +21 -15
- package/dist/Components/FileUpload/useObjectUrl.d.ts +1 -0
- package/dist/Components/FileUpload/useObjectUrl.js +14 -0
- package/dist/Components/FileUploader/FileUploader.js +9 -3
- package/dist/Components/FileUploader/FileUploaderProps.d.ts +8 -0
- package/dist/Components/FilterBar/FilterBar.d.ts +1 -1
- package/dist/Components/FilterBar/FilterBar.js +2 -2
- package/dist/Components/FilterBar/FilterBarProps.d.ts +3 -3
- package/dist/Components/FilterSidebar/FilterSidebar.js +10 -6
- package/dist/Components/Form/FormWrapper.js +1 -1
- package/dist/Components/FormField/FormField.d.ts +3 -0
- package/dist/Components/FormField/FormField.js +57 -0
- package/dist/Components/FormField/FormFieldProps.d.ts +33 -0
- package/dist/Components/FormField/FormFieldProps.js +2 -0
- package/dist/Components/Header/HeaderActions.js +2 -2
- package/dist/Components/Header/components/mobileMenu.js +1 -1
- package/dist/Components/IconButton/IconButton.d.ts +5 -0
- package/dist/Components/IconButton/IconButton.js +24 -0
- package/dist/Components/IconButton/IconButtonProps.d.ts +10 -0
- package/dist/Components/IconButton/IconButtonProps.js +2 -0
- package/dist/Components/Input/PhoneNumberInput.js +14 -0
- package/dist/Components/Input/PhoneNumberInputProps.d.ts +1 -0
- package/dist/Components/KanbanBoard/AccountCard.js +3 -2
- package/dist/Components/KanbanBoard/AccountRow.js +1 -1
- package/dist/Components/KanbanBoard/KanbanBoard.js +56 -39
- package/dist/Components/KanbanBoard/MeasuredItem.js +6 -14
- package/dist/Components/KanbanBoard/boardStore.d.ts +8 -0
- package/dist/Components/KanbanBoard/boardStore.js +27 -0
- package/dist/Components/Kbd/Kbd.js +1 -1
- package/dist/Components/LimitReachedModal/LimitReachedModal.js +1 -1
- package/dist/Components/Loading/Loading.js +1 -1
- package/dist/Components/MediaGallery/MediaGallery.js +1 -1
- package/dist/Components/MediaGallery/MediaLightbox.js +2 -1
- package/dist/Components/MediaGallery/glass.js +2 -1
- package/dist/Components/MediaViewer/MediaViewer.js +1 -1
- package/dist/Components/MediaViewer/components/MediaAudioPlayer.js +7 -7
- package/dist/Components/MediaViewer/components/MediaImageViewer.js +1 -1
- package/dist/Components/MediaViewer/components/MediaScrubber.js +5 -1
- package/dist/Components/MediaViewer/components/MediaVideoPlayer.js +7 -7
- package/dist/Components/MediaViewer/components/PlaybackTimeline.d.ts +20 -0
- package/dist/Components/MediaViewer/components/PlaybackTimeline.js +47 -0
- package/dist/Components/MediaViewer/components/TileChip.js +1 -1
- package/dist/Components/Modal/Modal.js +1 -1
- package/dist/Components/MoreItems/MoreItems.js +2 -2
- package/dist/Components/NavigationBar/NavigationBar.js +2 -2
- package/dist/Components/NoteTextArea/NoteTextArea.js +18 -4
- package/dist/Components/NoteTextArea/NoteTextAreaProps.d.ts +12 -0
- package/dist/Components/Notification/Notification.js +17 -3
- package/dist/Components/Notification/NotificationProps.d.ts +17 -1
- package/dist/Components/NotificationBell/NotificationBell.js +5 -1
- package/dist/Components/NotificationBell/NotificationItem.js +1 -1
- package/dist/Components/NotificationBell/NotificationList.js +1 -1
- package/dist/Components/OffersList/OffersList.js +2 -1
- package/dist/Components/OptionChip/OptionChip.js +3 -2
- package/dist/Components/OrderStatusTimeline/OrderStatusTimeline.js +2 -1
- package/dist/Components/OrderSummary/OrderSummary.js +5 -5
- package/dist/Components/OrganizationDetails/OrganizationDetails.js +7 -1
- package/dist/Components/PageHeader/PageHeader.d.ts +1 -1
- package/dist/Components/PageHeader/PageHeader.js +2 -2
- package/dist/Components/PageHeader/PageHeaderProps.d.ts +3 -3
- package/dist/Components/Pagination/Pagination.d.ts +5 -0
- package/dist/Components/Pagination/Pagination.js +48 -0
- package/dist/Components/Pagination/PaginationProps.d.ts +46 -0
- package/dist/Components/Pagination/PaginationProps.js +9 -0
- package/dist/Components/Pagination/pageWindow.d.ts +4 -0
- package/dist/Components/Pagination/pageWindow.js +22 -0
- package/dist/Components/PaymentOption/PaymentOption.js +1 -1
- package/dist/Components/PersonChip/PersonChip.js +2 -2
- package/dist/Components/PinInput/PinInput.d.ts +1 -1
- package/dist/Components/PinInput/PinInput.js +17 -2
- package/dist/Components/PinInput/PinInputProps.d.ts +9 -1
- package/dist/Components/PincodeChecker/PincodeChecker.js +4 -4
- package/dist/Components/PlanPill/PlanPill.js +2 -1
- package/dist/Components/PriceBlock/PriceBlock.js +3 -3
- package/dist/Components/Primitives/Primitives.d.ts +2 -2
- package/dist/Components/Primitives/Primitives.js +2 -3
- package/dist/Components/ProductBadges/ProductBadges.js +2 -1
- package/dist/Components/ProductCard/ProductCard.js +1 -1
- package/dist/Components/ProductCard/ProductCardAction.js +2 -2
- package/dist/Components/ProductCard/ProductCardSwatches.js +2 -1
- package/dist/Components/ProductCard/cardMetrics.d.ts +1 -1
- package/dist/Components/ProductCard/cardMetrics.js +5 -1
- package/dist/Components/ProfileCard/ProfileCardProps.d.ts +11 -0
- package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +3 -2
- package/dist/Components/QuantityStepper/QuantityStepper.js +2 -1
- package/dist/Components/RadioButton/RadioButton.d.ts +11 -2
- package/dist/Components/RadioButton/RadioButton.js +9 -6
- package/dist/Components/RangeSlider/RangeSlider.js +3 -3
- package/dist/Components/Rating/Rating.js +2 -1
- package/dist/Components/Reorder/Reorder.js +3 -2
- package/dist/Components/ReviewList/ReviewList.js +3 -3
- package/dist/Components/ReviewSummary/ReviewSummary.js +3 -3
- package/dist/Components/SaveBar/SaveBar.d.ts +1 -1
- package/dist/Components/SaveBar/SaveBar.js +2 -2
- package/dist/Components/SaveBar/SaveBarProps.d.ts +3 -3
- package/dist/Components/Search/Search.js +2 -9
- package/dist/Components/Search/ctrlShortcut.d.ts +1 -0
- package/dist/Components/Search/ctrlShortcut.js +29 -0
- package/dist/Components/SearchSelect/SearchSelect.js +117 -30
- package/dist/Components/SegmentedControl/SegmentedControl.d.ts +8 -2
- package/dist/Components/SegmentedControl/SegmentedControl.js +9 -5
- package/dist/Components/Select/SelectPopup.js +6 -4
- package/dist/Components/SelectSearch/SelectSearch.js +5 -4
- package/dist/Components/SettingRow/SettingRow.js +1 -1
- package/dist/Components/SideBar/SecondaryBar.js +2 -1
- package/dist/Components/SideBar/SideBar.js +82 -21
- package/dist/Components/SideBar/components/MenuItemBox.d.ts +2 -2
- package/dist/Components/SideBar/components/MenuItemBox.js +4 -3
- package/dist/Components/SideBar/components/MenuItems.d.ts +2 -2
- package/dist/Components/SideBar/components/MenuItems.js +3 -3
- package/dist/Components/SideBar/components/OtherApps.js +5 -1
- package/dist/Components/SideBar/components/OverflowTooltipText.js +4 -5
- package/dist/Components/SideBar/components/PinnedSection.js +2 -2
- package/dist/Components/SideBar/components/TextTruncation.js +11 -6
- package/dist/Components/SideBar/sidebarScale.d.ts +1 -1
- package/dist/Components/SideBar/sidebarScale.js +2 -1
- package/dist/Components/SignInActivityTable/SignInActivityTableProps.d.ts +8 -0
- package/dist/Components/Skeletons/SkeletonProps.d.ts +5 -2
- package/dist/Components/Skeletons/Skeletons.d.ts +1 -1
- package/dist/Components/Skeletons/Skeletons.js +4 -2
- package/dist/Components/SkipLink/SkipLink.d.ts +4 -0
- package/dist/Components/SkipLink/SkipLink.js +54 -0
- package/dist/Components/SkipLink/SkipLinkProps.d.ts +8 -0
- package/dist/Components/SkipLink/SkipLinkProps.js +2 -0
- package/dist/Components/Slider/Slider.d.ts +2 -2
- package/dist/Components/Slider/Slider.js +11 -4
- package/dist/Components/SpecTable/SpecTable.js +2 -1
- package/dist/Components/StageProgress/StageItem.js +2 -5
- package/dist/Components/StageProgress/StageProgress.js +2 -1
- package/dist/Components/StageProgress/StageProgressProps.d.ts +1 -1
- package/dist/Components/StageProgress/StepperStage.js +2 -6
- package/dist/Components/StageProgress/centerInStrip.d.ts +2 -0
- package/dist/Components/StageProgress/centerInStrip.js +15 -0
- package/dist/Components/StatCard/StatCard.d.ts +1 -1
- package/dist/Components/StatCard/StatCard.js +5 -4
- package/dist/Components/StatCard/StatCardProps.d.ts +3 -3
- package/dist/Components/StickyBuyBar/StickyBuyBar.js +1 -1
- package/dist/Components/Table/components/TableActions.js +40 -24
- package/dist/Components/Table/components/TableBody.js +25 -40
- package/dist/Components/Table/components/rowMeasurer.d.ts +8 -0
- package/dist/Components/Table/components/rowMeasurer.js +71 -0
- package/dist/Components/Table/filters/TableFilters.js +2 -13
- package/dist/Components/Table/hooks/useTable.js +12 -9
- package/dist/Components/Tabs/components/CountBadge.js +3 -3
- package/dist/Components/Tabs/components/Tab.d.ts +2 -1
- package/dist/Components/Tabs/components/Tab.js +4 -3
- package/dist/Components/Tabs/components/TabList.js +16 -1
- package/dist/Components/Tag/Tag.d.ts +2 -2
- package/dist/Components/Tag/Tag.js +15 -12
- package/dist/Components/Tag/Tag.styles.js +6 -4
- package/dist/Components/TagInput/TagInput.d.ts +3 -0
- package/dist/Components/TagInput/TagInput.js +99 -0
- package/dist/Components/TagInput/TagInputProps.d.ts +46 -0
- package/dist/Components/TagInput/TagInputProps.js +2 -0
- package/dist/Components/TagInput/tagEntries.d.ts +15 -0
- package/dist/Components/TagInput/tagEntries.js +45 -0
- package/dist/Components/TimePicker/TimePicker.d.ts +3 -0
- package/dist/Components/TimePicker/TimePicker.js +50 -0
- package/dist/Components/TimePicker/TimePickerProps.d.ts +44 -0
- package/dist/Components/TimePicker/TimePickerProps.js +2 -0
- package/dist/Components/TimePicker/timeParts.d.ts +10 -0
- package/dist/Components/TimePicker/timeParts.js +36 -0
- package/dist/Components/Timeline/Timeline.js +11 -9
- package/dist/Components/Toaster/Toaster.js +2 -1
- package/dist/Components/Toggle/TableToggle.js +4 -3
- package/dist/Components/ToggleSwitch/ToggleSwitch.d.ts +3 -2
- package/dist/Components/ToggleSwitch/ToggleSwitch.js +6 -5
- package/dist/Components/ToolTip/ToolTip.js +86 -8
- package/dist/Components/UpgradeButton/UpgradeButton.js +4 -2
- package/dist/Components/UserDetails/UserDetails.js +7 -1
- package/dist/Components/VisuallyHidden/VisuallyHidden.d.ts +15 -0
- package/dist/Components/VisuallyHidden/VisuallyHidden.js +21 -0
- package/dist/Components/VisuallyHidden/VisuallyHiddenProps.d.ts +3 -0
- package/dist/Components/VisuallyHidden/VisuallyHiddenProps.js +2 -0
- package/dist/Components/WizardDialog/WizardDialog.js +10 -5
- package/dist/Components/WizardDialog/WizardDialogProps.d.ts +4 -0
- package/dist/Components/WorkspaceWindow/WorkspaceTrayPreview.js +5 -1
- package/dist/Components/WorkspaceWindow/WorkspaceWindow.js +15 -2
- package/dist/Components/WorkspaceWindow/WorkspaceWindowProps.d.ts +2 -1
- package/dist/Hooks/sharedResizeObserver.d.ts +6 -0
- package/dist/Hooks/sharedResizeObserver.js +77 -0
- package/dist/Hooks/useIsTruncated.js +3 -4
- package/dist/Theme/chakra/Menu.styles.d.ts +1 -1
- package/dist/Theme/chakra/common.web.d.ts +1 -0
- package/dist/Theme/chakra/componentStyles.d.ts +1 -1
- package/dist/Theme/chakra/createBrandTheme.d.ts +3 -0
- package/dist/Theme/chakra/createBrandTheme.js +34 -4
- package/dist/Theme/chakra/focusRing.styles.d.ts +2 -0
- package/dist/Theme/chakra/focusRing.styles.js +5 -1
- package/dist/Theme/chakra/fonts.web.d.ts +2 -0
- package/dist/Theme/chakra/motion.d.ts +14 -0
- package/dist/Theme/chakra/motion.js +26 -1
- package/dist/Theme/index.d.ts +2 -1
- package/dist/Theme/index.js +12 -9
- package/dist/Theme/provider/PixelizeThemeProvider.d.ts +4 -1
- package/dist/Theme/provider/PixelizeThemeProvider.js +21 -12
- package/dist/Theme/provider/ThemeSwitcher.js +3 -2
- package/dist/Theme/themeProps.d.ts +3 -0
- package/dist/Theme/tokens/brands/emerald/palette.dark.js +2 -1
- package/dist/Theme/tokens/brands/index.d.ts +1 -1
- package/dist/Theme/tokens/brands/index.js +14 -13
- package/dist/Theme/tokens/brands/lavender/palette.dark.js +2 -1
- package/dist/Theme/tokens/brands/meadow/palette.dark.js +2 -1
- package/dist/Theme/tokens/brands/radiant/palette.dark.js +2 -1
- package/dist/Theme/tokens/brands/rosewood/palette.dark.js +2 -1
- package/dist/Theme/tokens/brands/skyline/palette.dark.js +2 -1
- package/dist/Theme/tokens/brands/slate/palette.dark.js +2 -1
- package/dist/Theme/tokens/brands/storefront/palette.dark.js +2 -1
- package/dist/Theme/tokens/brands/zinc/palette.dark.js +28 -24
- package/dist/Theme/tokens/builders/color.js +11 -7
- package/dist/Theme/tokens/builders/filledSurface.d.ts +3 -1
- package/dist/Theme/tokens/builders/filledSurface.js +7 -7
- package/dist/Theme/tokens/builders/lazy.d.ts +5 -0
- package/dist/Theme/tokens/builders/lazy.js +55 -0
- package/dist/Theme/tokens/builders/memo.d.ts +9 -0
- package/dist/Theme/tokens/builders/memo.js +28 -0
- package/dist/Theme/tokens/builders/memoByReads.d.ts +2 -0
- package/dist/Theme/tokens/builders/memoByReads.js +50 -0
- package/dist/Theme/tokens/builders/outlineRung.js +10 -2
- package/dist/Theme/tokens/builders/tone.js +5 -4
- package/dist/Theme/tokens/primitives/borderWidths.d.ts +6 -0
- package/dist/Theme/tokens/primitives/borderWidths.js +5 -0
- package/dist/Theme/tokens/primitives/index.d.ts +8 -3
- package/dist/Theme/tokens/primitives/index.js +8 -1
- package/dist/Theme/tokens/primitives/motion.d.ts +25 -2
- package/dist/Theme/tokens/primitives/motion.js +23 -5
- package/dist/Theme/tokens/primitives/optionRowSizes.d.ts +1 -1
- package/dist/Theme/tokens/primitives/optionRowSizes.js +2 -1
- package/dist/Theme/tokens/primitives/radii.d.ts +15 -0
- package/dist/Theme/tokens/primitives/radii.js +14 -0
- package/dist/Theme/tokens/primitives/shadows.d.ts +5 -1
- package/dist/Theme/tokens/primitives/shadows.js +5 -1
- package/dist/Theme/tokens/primitives/states.d.ts +1 -0
- package/dist/Theme/tokens/primitives/states.js +4 -0
- package/dist/Theme/tokens/primitives/typography.d.ts +17 -0
- package/dist/Theme/tokens/primitives/typography.js +21 -1
- package/dist/Theme/tokens/primitives/zIndices.d.ts +1 -0
- package/dist/Theme/tokens/primitives/zIndices.js +1 -0
- package/dist/Utils/formatDate.d.ts +25 -0
- package/dist/Utils/formatDate.js +144 -0
- package/dist/esm/Components/Accordion/Accordion.js +2 -2
- package/dist/esm/Components/AddressCard/AddressCard.js +2 -1
- package/dist/esm/Components/Apexcharts/ApexLineChart/ApexLineChart.js +1 -1
- package/dist/esm/Components/AppSwitcher/AppSwitcher.js +1 -1
- package/dist/esm/Components/AppearanceSettings/AppearanceSettings.js +1 -1
- package/dist/esm/Components/AudioRecorder/AudioRecorder.js +2 -1
- package/dist/esm/Components/Avatar/Avatar.js +6 -4
- package/dist/esm/Components/Backdrop/Backdrop.js +1 -1
- package/dist/esm/Components/BagBar/BagBar.js +2 -1
- package/dist/esm/Components/ButtonGroupIcon/ButtonGroupIcon.js +1 -1
- package/dist/esm/Components/CalendarGrid/CalendarGrid.js +6 -6
- package/dist/esm/Components/CalendarGrid/calendarMath.js +18 -6
- package/dist/esm/Components/Card/PaymentCard/PaymentCard.js +6 -5
- package/dist/esm/Components/CartItem/CartItem.js +2 -1
- package/dist/esm/Components/Checkbox/Checkbox.js +8 -5
- package/dist/esm/Components/CheckoutKit/selectable.js +1 -1
- package/dist/esm/Components/ChoiceCard/ChoiceCard.js +14 -0
- package/dist/esm/Components/ChoiceCard/ChoiceCardGroup.js +4 -0
- package/dist/esm/Components/ChoiceCard/ChoiceCardProps.js +1 -0
- package/dist/esm/Components/CircularProgress/CircularProgress.js +5 -9
- package/dist/esm/Components/CircularProgress/arc.js +13 -0
- package/dist/esm/Components/Common/FormLabel.js +1 -1
- package/dist/esm/Components/Common/FormattedDescription.js +1 -1
- package/dist/esm/Components/Common/HelperText.js +11 -8
- package/dist/esm/Components/Common/fieldStyles.js +2 -1
- package/dist/esm/Components/ContactForm/ContactForm.js +1 -1
- package/dist/esm/Components/CopyButton/CopyButton.js +14 -7
- package/dist/esm/Components/CouponField/CouponField.js +4 -3
- package/dist/esm/Components/CustomModulesTable/EditModuleModal.js +1 -1
- package/dist/esm/Components/DatePicker/CalendarPanel.js +2 -2
- package/dist/esm/Components/DatePicker/DatePicker.js +8 -2
- package/dist/esm/Components/DatePicker/RangeDatePicker.js +8 -6
- package/dist/esm/Components/DatePicker/SingleDatePicker.js +7 -4
- package/dist/esm/Components/DatePicker/ThemeDatePicker.js +7 -4
- package/dist/esm/Components/DatePicker/TimeOnlyPicker.js +5 -3
- package/dist/esm/Components/DatePicker/TimePickerInput.js +8 -6
- package/dist/esm/Components/DescriptionList/DescriptionList.js +3 -3
- package/dist/esm/Components/Dropdown/DropDown.js +12 -4
- package/dist/esm/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +2 -1
- package/dist/esm/Components/EmptyState/EmptyState.js +2 -2
- package/dist/esm/Components/FileUpload/FileUpload.js +21 -15
- package/dist/esm/Components/FileUpload/useObjectUrl.js +10 -0
- package/dist/esm/Components/FileUploader/FileUploader.js +9 -3
- package/dist/esm/Components/FilterBar/FilterBar.js +2 -2
- package/dist/esm/Components/FilterSidebar/FilterSidebar.js +10 -6
- package/dist/esm/Components/Form/FormWrapper.js +1 -1
- package/dist/esm/Components/FormField/FormField.js +52 -0
- package/dist/esm/Components/FormField/FormFieldProps.js +1 -0
- package/dist/esm/Components/Header/HeaderActions.js +2 -2
- package/dist/esm/Components/Header/components/mobileMenu.js +1 -1
- package/dist/esm/Components/IconButton/IconButton.js +21 -0
- package/dist/esm/Components/IconButton/IconButtonProps.js +1 -0
- package/dist/esm/Components/Input/PhoneNumberInput.js +15 -1
- package/dist/esm/Components/KanbanBoard/AccountCard.js +3 -2
- package/dist/esm/Components/KanbanBoard/AccountRow.js +1 -1
- package/dist/esm/Components/KanbanBoard/KanbanBoard.js +56 -39
- package/dist/esm/Components/KanbanBoard/MeasuredItem.js +6 -14
- package/dist/esm/Components/KanbanBoard/boardStore.js +22 -0
- package/dist/esm/Components/Kbd/Kbd.js +1 -1
- package/dist/esm/Components/LimitReachedModal/LimitReachedModal.js +1 -1
- package/dist/esm/Components/Loading/Loading.js +1 -1
- package/dist/esm/Components/MediaGallery/MediaGallery.js +2 -2
- package/dist/esm/Components/MediaGallery/MediaLightbox.js +2 -1
- package/dist/esm/Components/MediaGallery/glass.js +2 -1
- package/dist/esm/Components/MediaViewer/MediaViewer.js +1 -1
- package/dist/esm/Components/MediaViewer/components/MediaAudioPlayer.js +7 -7
- package/dist/esm/Components/MediaViewer/components/MediaImageViewer.js +1 -1
- package/dist/esm/Components/MediaViewer/components/MediaScrubber.js +5 -1
- package/dist/esm/Components/MediaViewer/components/MediaVideoPlayer.js +7 -7
- package/dist/esm/Components/MediaViewer/components/PlaybackTimeline.js +38 -0
- package/dist/esm/Components/MediaViewer/components/TileChip.js +1 -1
- package/dist/esm/Components/Modal/Modal.js +1 -1
- package/dist/esm/Components/MoreItems/MoreItems.js +2 -2
- package/dist/esm/Components/NavigationBar/NavigationBar.js +2 -2
- package/dist/esm/Components/NoteTextArea/NoteTextArea.js +18 -4
- package/dist/esm/Components/Notification/Notification.js +17 -3
- package/dist/esm/Components/NotificationBell/NotificationBell.js +2 -1
- package/dist/esm/Components/NotificationBell/NotificationItem.js +1 -1
- package/dist/esm/Components/NotificationBell/NotificationList.js +1 -1
- package/dist/esm/Components/OffersList/OffersList.js +2 -1
- package/dist/esm/Components/OptionChip/OptionChip.js +3 -2
- package/dist/esm/Components/OrderStatusTimeline/OrderStatusTimeline.js +2 -1
- package/dist/esm/Components/OrderSummary/OrderSummary.js +5 -5
- package/dist/esm/Components/OrganizationDetails/OrganizationDetails.js +7 -1
- package/dist/esm/Components/PageHeader/PageHeader.js +2 -2
- package/dist/esm/Components/Pagination/Pagination.js +42 -0
- package/dist/esm/Components/Pagination/PaginationProps.js +6 -0
- package/dist/esm/Components/Pagination/pageWindow.js +16 -0
- package/dist/esm/Components/PaymentOption/PaymentOption.js +1 -1
- package/dist/esm/Components/PersonChip/PersonChip.js +2 -2
- package/dist/esm/Components/PinInput/PinInput.js +14 -2
- package/dist/esm/Components/PincodeChecker/PincodeChecker.js +4 -4
- package/dist/esm/Components/PlanPill/PlanPill.js +2 -1
- package/dist/esm/Components/PriceBlock/PriceBlock.js +3 -3
- package/dist/esm/Components/Primitives/Primitives.js +1 -1
- package/dist/esm/Components/ProductBadges/ProductBadges.js +2 -1
- package/dist/esm/Components/ProductCard/ProductCard.js +1 -1
- package/dist/esm/Components/ProductCard/ProductCardAction.js +3 -3
- package/dist/esm/Components/ProductCard/ProductCardSwatches.js +2 -1
- package/dist/esm/Components/ProductCard/cardMetrics.js +2 -1
- package/dist/esm/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +3 -2
- package/dist/esm/Components/QuantityStepper/QuantityStepper.js +2 -1
- package/dist/esm/Components/RadioButton/RadioButton.js +7 -4
- package/dist/esm/Components/RangeSlider/RangeSlider.js +3 -3
- package/dist/esm/Components/Rating/Rating.js +2 -1
- package/dist/esm/Components/Reorder/Reorder.js +3 -2
- package/dist/esm/Components/ReviewList/ReviewList.js +3 -3
- package/dist/esm/Components/ReviewSummary/ReviewSummary.js +3 -3
- package/dist/esm/Components/SaveBar/SaveBar.js +2 -2
- package/dist/esm/Components/Search/Search.js +2 -9
- package/dist/esm/Components/Search/ctrlShortcut.js +25 -0
- package/dist/esm/Components/SearchSelect/SearchSelect.js +120 -33
- package/dist/esm/Components/SegmentedControl/SegmentedControl.js +11 -6
- package/dist/esm/Components/Select/SelectPopup.js +6 -4
- package/dist/esm/Components/SelectSearch/SelectSearch.js +5 -4
- package/dist/esm/Components/SettingRow/SettingRow.js +1 -1
- package/dist/esm/Components/SideBar/SecondaryBar.js +2 -1
- package/dist/esm/Components/SideBar/SideBar.js +83 -22
- package/dist/esm/Components/SideBar/components/MenuItemBox.js +4 -3
- package/dist/esm/Components/SideBar/components/MenuItems.js +4 -4
- package/dist/esm/Components/SideBar/components/OtherApps.js +2 -1
- package/dist/esm/Components/SideBar/components/OverflowTooltipText.js +4 -5
- package/dist/esm/Components/SideBar/components/PinnedSection.js +2 -2
- package/dist/esm/Components/SideBar/components/TextTruncation.js +9 -7
- package/dist/esm/Components/SideBar/sidebarScale.js +2 -1
- package/dist/esm/Components/Skeletons/Skeletons.js +4 -2
- package/dist/esm/Components/SkipLink/SkipLink.js +50 -0
- package/dist/esm/Components/SkipLink/SkipLinkProps.js +1 -0
- package/dist/esm/Components/Slider/Slider.js +11 -4
- package/dist/esm/Components/SpecTable/SpecTable.js +2 -1
- package/dist/esm/Components/StageProgress/StageItem.js +2 -5
- package/dist/esm/Components/StageProgress/StageProgress.js +2 -1
- package/dist/esm/Components/StageProgress/StepperStage.js +2 -6
- package/dist/esm/Components/StageProgress/centerInStrip.js +11 -0
- package/dist/esm/Components/StatCard/StatCard.js +5 -4
- package/dist/esm/Components/StickyBuyBar/StickyBuyBar.js +2 -2
- package/dist/esm/Components/Table/components/TableActions.js +42 -26
- package/dist/esm/Components/Table/components/TableBody.js +25 -40
- package/dist/esm/Components/Table/components/rowMeasurer.js +66 -0
- package/dist/esm/Components/Table/filters/TableFilters.js +3 -14
- package/dist/esm/Components/Table/hooks/useTable.js +12 -9
- package/dist/esm/Components/Tabs/components/CountBadge.js +3 -3
- package/dist/esm/Components/Tabs/components/Tab.js +5 -4
- package/dist/esm/Components/Tabs/components/TabList.js +16 -1
- package/dist/esm/Components/Tag/Tag.js +11 -8
- package/dist/esm/Components/Tag/Tag.styles.js +6 -4
- package/dist/esm/Components/TagInput/TagInput.js +94 -0
- package/dist/esm/Components/TagInput/TagInputProps.js +1 -0
- package/dist/esm/Components/TagInput/tagEntries.js +39 -0
- package/dist/esm/Components/TimePicker/TimePicker.js +45 -0
- package/dist/esm/Components/TimePicker/TimePickerProps.js +1 -0
- package/dist/esm/Components/TimePicker/timeParts.js +26 -0
- package/dist/esm/Components/Timeline/Timeline.js +11 -9
- package/dist/esm/Components/Toaster/Toaster.js +2 -1
- package/dist/esm/Components/Toggle/TableToggle.js +4 -3
- package/dist/esm/Components/ToggleSwitch/ToggleSwitch.js +7 -5
- package/dist/esm/Components/ToolTip/ToolTip.js +89 -11
- package/dist/esm/Components/UpgradeButton/UpgradeButton.js +4 -2
- package/dist/esm/Components/UserDetails/UserDetails.js +7 -1
- package/dist/esm/Components/VisuallyHidden/VisuallyHidden.js +18 -0
- package/dist/esm/Components/VisuallyHidden/VisuallyHiddenProps.js +1 -0
- package/dist/esm/Components/WizardDialog/WizardDialog.js +11 -6
- package/dist/esm/Components/WorkspaceWindow/WorkspaceTrayPreview.js +2 -1
- package/dist/esm/Components/WorkspaceWindow/WorkspaceWindow.js +13 -3
- package/dist/esm/Hooks/sharedResizeObserver.js +73 -0
- package/dist/esm/Hooks/useIsTruncated.js +3 -4
- package/dist/esm/Theme/chakra/createBrandTheme.js +34 -4
- package/dist/esm/Theme/chakra/focusRing.styles.js +3 -0
- package/dist/esm/Theme/chakra/motion.js +25 -0
- package/dist/esm/Theme/index.js +12 -9
- package/dist/esm/Theme/provider/PixelizeThemeProvider.js +22 -13
- package/dist/esm/Theme/provider/ThemeSwitcher.js +3 -2
- package/dist/esm/Theme/tokens/brands/emerald/palette.dark.js +2 -1
- package/dist/esm/Theme/tokens/brands/index.js +14 -13
- package/dist/esm/Theme/tokens/brands/lavender/palette.dark.js +2 -1
- package/dist/esm/Theme/tokens/brands/meadow/palette.dark.js +2 -1
- package/dist/esm/Theme/tokens/brands/radiant/palette.dark.js +2 -1
- package/dist/esm/Theme/tokens/brands/rosewood/palette.dark.js +2 -1
- package/dist/esm/Theme/tokens/brands/skyline/palette.dark.js +2 -1
- package/dist/esm/Theme/tokens/brands/slate/palette.dark.js +2 -1
- package/dist/esm/Theme/tokens/brands/storefront/palette.dark.js +2 -1
- package/dist/esm/Theme/tokens/brands/zinc/palette.dark.js +28 -24
- package/dist/esm/Theme/tokens/builders/color.js +10 -6
- package/dist/esm/Theme/tokens/builders/filledSurface.js +7 -7
- package/dist/esm/Theme/tokens/builders/lazy.js +49 -0
- package/dist/esm/Theme/tokens/builders/memo.js +21 -0
- package/dist/esm/Theme/tokens/builders/memoByReads.js +46 -0
- package/dist/esm/Theme/tokens/builders/outlineRung.js +10 -2
- package/dist/esm/Theme/tokens/builders/tone.js +5 -4
- package/dist/esm/Theme/tokens/primitives/borderWidths.js +2 -0
- package/dist/esm/Theme/tokens/primitives/index.js +5 -3
- package/dist/esm/Theme/tokens/primitives/motion.js +20 -4
- package/dist/esm/Theme/tokens/primitives/optionRowSizes.js +2 -1
- package/dist/esm/Theme/tokens/primitives/radii.js +13 -0
- package/dist/esm/Theme/tokens/primitives/shadows.js +3 -1
- package/dist/esm/Theme/tokens/primitives/states.js +1 -0
- package/dist/esm/Theme/tokens/primitives/typography.js +20 -0
- package/dist/esm/Theme/tokens/primitives/zIndices.js +1 -0
- package/dist/esm/Utils/formatDate.js +138 -0
- package/dist/esm/index.js +18 -2
- package/dist/index.d.ts +33 -5
- package/dist/index.js +47 -4
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ import { useCustomTheme } from "../../../Theme/useCustomTheme.js";
|
|
|
5
5
|
import { resolveFilledSurface } from "../../../Theme/tokens/builders/filledSurface.js";
|
|
6
6
|
import { accentTextOnCanvas } from "../../../Theme/tokens/builders/accentText.js";
|
|
7
7
|
import { transitionFor } from "../../../Theme/tokens/primitives/motion.js";
|
|
8
|
+
import { BORDER_WIDTHS } from "../../../Theme/tokens/primitives/borderWidths.js";
|
|
8
9
|
import { reducedMotionSx } from "../../../Theme/chakra/motion.js";
|
|
9
10
|
import Button from "../../Button/Button.js";
|
|
10
11
|
const getCardStyles = (isActive, isNextUpgrade, popular, theme) => {
|
|
@@ -21,7 +22,7 @@ const getCardStyles = (isActive, isNextUpgrade, popular, theme) => {
|
|
|
21
22
|
if (isActive) {
|
|
22
23
|
return withOnButtonColor({
|
|
23
24
|
badgeText: "Active Plan",
|
|
24
|
-
badgeColor:
|
|
25
|
+
badgeColor: `${BORDER_WIDTHS.hairline} solid ${theme.colors.green[500]}`,
|
|
25
26
|
buttonColor: theme.colors.green[500],
|
|
26
27
|
buttonScale: "green",
|
|
27
28
|
buttonColor50: theme.colors.green[50],
|
|
@@ -31,7 +32,7 @@ const getCardStyles = (isActive, isNextUpgrade, popular, theme) => {
|
|
|
31
32
|
if (isNextUpgrade) {
|
|
32
33
|
return withOnButtonColor({
|
|
33
34
|
badgeText: "Upgrade Your Plan",
|
|
34
|
-
badgeColor:
|
|
35
|
+
badgeColor: `${BORDER_WIDTHS.hairline} solid ${theme.colors.primary[500]}`,
|
|
35
36
|
buttonColor: theme.colors.primary[500],
|
|
36
37
|
buttonScale: "primary",
|
|
37
38
|
buttonColor50: theme.colors.primary[50],
|
|
@@ -41,7 +42,7 @@ const getCardStyles = (isActive, isNextUpgrade, popular, theme) => {
|
|
|
41
42
|
if (popular) {
|
|
42
43
|
return withOnButtonColor({
|
|
43
44
|
badgeText: "Most Popular",
|
|
44
|
-
badgeColor:
|
|
45
|
+
badgeColor: `${BORDER_WIDTHS.hairline} solid ${theme.colors.primary[500]}`,
|
|
45
46
|
buttonColor: theme.colors.primary[500],
|
|
46
47
|
buttonScale: "primary",
|
|
47
48
|
buttonColor50: theme.colors.primary[50],
|
|
@@ -50,7 +51,7 @@ const getCardStyles = (isActive, isNextUpgrade, popular, theme) => {
|
|
|
50
51
|
}
|
|
51
52
|
return withOnButtonColor({
|
|
52
53
|
badgeText: "",
|
|
53
|
-
badgeColor:
|
|
54
|
+
badgeColor: `${BORDER_WIDTHS.hairline} solid ${theme.colors.boxborder[200]}`,
|
|
54
55
|
buttonColor: theme.colors.primary[500],
|
|
55
56
|
buttonScale: "primary",
|
|
56
57
|
buttonColor50: theme.colors.primary[50],
|
|
@@ -71,7 +72,7 @@ const PaymentCard = ({ plan, isActive = false, isNextUpgrade = false, billingCyc
|
|
|
71
72
|
// 🔹 Skeleton Loader Layout
|
|
72
73
|
_jsxs(_Fragment, { children: [_jsx(Skeleton, { height: "24px", width: "120px", mx: "auto", mb: 4 }), _jsx(Skeleton, { height: "50px", width: "50px", borderRadius: "lg", mx: "auto", mb: 4 }), _jsx(Skeleton, { height: "24px", width: "100px", mx: "auto", mb: 3 }), _jsx(Skeleton, { height: "30px", width: "160px", mx: "auto", mb: 4 }), _jsx(SkeletonText, { noOfLines: 2, spacing: "2" }), _jsx(Skeleton, { height: "44px", width: "full", mt: 6, borderRadius: "lg" }), _jsx(VStack, { align: "start", spacing: 3, mt: 6, children: [1, 2, 3, 4].map((i) => (_jsx(Skeleton, { height: "16px", width: "80%" }, i))) })] })) : (
|
|
73
74
|
// 🔹 Actual Card Content
|
|
74
|
-
_jsxs(_Fragment, { children: [badgeText && (_jsx(Badge, { position: "absolute", top: "-0.75rem", left: "50%", transform: "translateX(-50%)", bg: buttonColor, color: onButtonColor, fontSize: "sm", px: 4, py: 1, borderRadius: "full", children: badgeText })), _jsxs(Box, { textAlign: "center", mb: 6, children: [_jsx(Flex, { justify: "center", align: "center", w: "3.125rem", h: "3.125rem", borderRadius: "lg", bg: buttonColor50, color: iconInk, mx: "auto", mb: 4, children: plan.icon }), _jsx(Heading, { as: "h3", size: "lg", mb: 4, color: theme.colors.header[900], children: plan.name }), (plan.yearlyPrice !== 0 || plan.monthlyPrice !== 0) && (_jsxs(Heading, { as: "h4", size: "2xl", mb: 1, color: theme.colors.header[900], display: "flex", justifyContent: "center", children: [_jsx(Box, { fontSize: "
|
|
75
|
+
_jsxs(_Fragment, { children: [badgeText && (_jsx(Badge, { position: "absolute", top: "-0.75rem", left: "50%", transform: "translateX(-50%)", bg: buttonColor, color: onButtonColor, fontSize: "sm", px: 4, py: 1, borderRadius: "full", children: badgeText })), _jsxs(Box, { textAlign: "center", mb: 6, children: [_jsx(Flex, { justify: "center", align: "center", w: "3.125rem", h: "3.125rem", borderRadius: "lg", bg: buttonColor50, color: iconInk, mx: "auto", mb: 4, children: plan.icon }), _jsx(Heading, { as: "h3", size: "lg", mb: 4, color: theme.colors.header[900], children: plan.name }), (plan.yearlyPrice !== 0 || plan.monthlyPrice !== 0) && (_jsxs(Heading, { as: "h4", size: "2xl", mb: 1, color: theme.colors.header[900], display: "flex", justifyContent: "center", children: [_jsx(Box, { fontSize: "2xl", children: "\u20B9" }), billingCycle === "yearly"
|
|
75
76
|
? plan.yearlyPrice
|
|
76
77
|
: plan.monthlyPrice, _jsxs(Box, { display: "flex", flexDirection: "column", justifyContent: "end", ml: 1, children: [_jsx(Text, { fontSize: "0.9rem", fontWeight: "normal", color: theme.colors.textMuted, children: plan.billing }), _jsx(Text, { fontSize: "0.7rem", fontWeight: "normal", color: theme.colors.textMuted, children: plan.tax })] })] })), plan.priceDescription && (_jsx(Text, { color: theme.colors.semanticText.success, mt: 2, children: plan === null || plan === void 0 ? void 0 : plan.priceDescription })), _jsx(Text, { color: theme.colors.textMuted, mt: 2, children: plan.description })] }), ((!isActive && plan.buttonText) || isRenewal) && (_jsx(Button, { isLoading: plan.plan_id === buttonLoading, loadingText: plan.buttonLoadingText, width: "full", variant: plan.buttonVariant, colorScheme: colorScheme, size: "lg", onClick: () => onSelect === null || onSelect === void 0 ? void 0 : onSelect(plan.plan_id), onMouseEnter: () => onHover === null || onHover === void 0 ? void 0 : onHover(plan.plan_id, "button", true), onMouseLeave: () => onHover === null || onHover === void 0 ? void 0 : onHover(plan.plan_id, "button", false), ...variantStyles, children: plan.buttonText })), _jsx(VStack, { align: "start", spacing: 3, mt: 6, children: plan.features.map((feature, i) => (_jsxs(Flex, { align: "center", children: [_jsx(Icon, { as: Check, color: theme.colors.semanticText.success, mr: 2 }), _jsx(Text, { fontSize: "sm", children: feature })] }, i))) })] })) }) }));
|
|
77
78
|
};
|
|
@@ -4,6 +4,7 @@ import { Truck } from "lucide-react";
|
|
|
4
4
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
5
5
|
import { focusVisibleStyles } from "../../Theme/chakra/focusRing.styles.js";
|
|
6
6
|
import { transitionFor } from "../../Theme/tokens/primitives/motion.js";
|
|
7
|
+
import { NUMERIC_TEXT } from "../../Theme/tokens/primitives/typography.js";
|
|
7
8
|
import { reducedMotionSx } from "../../Theme/chakra/motion.js";
|
|
8
9
|
import { formatPrice } from "../../Utils/price.js";
|
|
9
10
|
import Button from "../Button/Button.js";
|
|
@@ -50,6 +51,6 @@ const CartItem = ({ title, brand, href, onTitleClick, image, imageAlt = "", axes
|
|
|
50
51
|
: { as: "span" };
|
|
51
52
|
const linked = !!href || !!onTitleClick;
|
|
52
53
|
const stepper = (_jsx(QuantityStepper, { size: "sm", variant: "soft", value: quantity, min: minQuantity, max: maxQuantity, removable: !!onRemove, onRemove: onRemove, onValueChange: onQuantityChange, itemLabel: title }));
|
|
53
|
-
return (_jsxs(Flex, { gap: 3, align: "flex-start", "data-testid": testId, "data-unavailable": unavailable || undefined, children: [_jsx(Box, { flexShrink: 0, w: thumb.w, h: thumb.h, borderRadius: thumb.radius, overflow: "hidden", bg: colors.background[100], opacity: unavailable ? DIMMED_MEDIA : 1, children: image && _jsx(Box, { as: "img", src: image, alt: imageAlt, w: "100%", h: "100%", objectFit: "cover", display: "block" }) }), _jsxs(Flex, { direction: "column", flex: 1, minW: 0, gap: 1.5, children: [_jsxs(Flex, { direction: "column", gap: 0.5, minW: 0, children: [brand && (_jsx(Text, { as: "span", fontSize: "xs", fontWeight: 600, lineHeight: 1.4, color: colors.textMuted, noOfLines: 1, children: brand })), _jsx(Text, { ...titleProps, display: "block", textAlign: "left", fontSize: "sm", fontWeight: 600, lineHeight: 1.4, color: titleInk, noOfLines: 2, borderRadius: "sm", cursor: linked ? "pointer" : undefined, transition: transitionFor(["color"]), _hover: linked ? { textDecoration: "underline" } : undefined, sx: { ...focusVisibleStyles(colors), ...reducedMotionSx() }, children: title }), summary && (_jsx(Text, { as: "span", fontSize: "xs", lineHeight: 1.4, color: colors.textMuted, children: summary }))] }), unavailable ? (_jsxs(Flex, { direction: "column", gap: 0.5, children: [_jsx(StockStatus, { status: "out-of-stock", message: copy.outOfStock, size: "sm" }), _jsx(Text, { as: "span", fontSize: "xs", color: colors.textMuted, children: copy.notIncluded })] })) : (_jsxs(Flex, { align: "flex-end", justify: "space-between", gap: 3, wrap: "wrap", children: [compact ? (_jsx(Text, { as: "span", fontSize: "xs", color: colors.textMuted, sx:
|
|
54
|
+
return (_jsxs(Flex, { gap: 3, align: "flex-start", "data-testid": testId, "data-unavailable": unavailable || undefined, children: [_jsx(Box, { flexShrink: 0, w: thumb.w, h: thumb.h, borderRadius: thumb.radius, overflow: "hidden", bg: colors.background[100], opacity: unavailable ? DIMMED_MEDIA : 1, children: image && _jsx(Box, { as: "img", src: image, alt: imageAlt, w: "100%", h: "100%", objectFit: "cover", display: "block" }) }), _jsxs(Flex, { direction: "column", flex: 1, minW: 0, gap: 1.5, children: [_jsxs(Flex, { direction: "column", gap: 0.5, minW: 0, children: [brand && (_jsx(Text, { as: "span", fontSize: "xs", fontWeight: 600, lineHeight: 1.4, color: colors.textMuted, noOfLines: 1, children: brand })), _jsx(Text, { ...titleProps, display: "block", textAlign: "left", fontSize: "sm", fontWeight: 600, lineHeight: 1.4, color: titleInk, noOfLines: 2, borderRadius: "sm", cursor: linked ? "pointer" : undefined, transition: transitionFor(["color"]), _hover: linked ? { textDecoration: "underline" } : undefined, sx: { ...focusVisibleStyles(colors), ...reducedMotionSx() }, children: title }), summary && (_jsx(Text, { as: "span", fontSize: "xs", lineHeight: 1.4, color: colors.textMuted, children: summary }))] }), unavailable ? (_jsxs(Flex, { direction: "column", gap: 0.5, children: [_jsx(StockStatus, { status: "out-of-stock", message: copy.outOfStock, size: "sm" }), _jsx(Text, { as: "span", fontSize: "xs", color: colors.textMuted, children: copy.notIncluded })] })) : (_jsxs(Flex, { align: "flex-end", justify: "space-between", gap: 3, wrap: "wrap", children: [compact ? (_jsx(Text, { as: "span", fontSize: "xs", color: colors.textMuted, sx: NUMERIC_TEXT, children: copy.quantity(quantity) })) : (stepper), _jsx(Box, { ml: "auto", children: _jsx(PriceBlock, { size: compact ? "sm" : "md", align: "end", price: lineTotal, mrp: lineMrp, taxNote: quantity > 1 ? copy.each(formatPrice(price, fmt)) : undefined, ...fmt }) })] })), !unavailable && !compact && stock && stock !== "in-stock" && (_jsx(StockStatus, { status: stock, count: stockCount, message: stockMessage, size: "sm" })), !unavailable && deliveryBy && (_jsxs(Flex, { align: "center", gap: 1.5, color: colors.textMuted, children: [_jsx(Truck, { size: 13, "aria-hidden": true }), _jsx(Text, { as: "span", fontSize: "xs", lineHeight: 1.4, children: copy.delivery(deliveryBy) })] })), !compact && (onRemove || (onMoveToWishlist && !unavailable)) && (_jsxs(Flex, { gap: 1, ml: -3, mt: 0.5, children: [onMoveToWishlist && !unavailable && (_jsx(Button, { variant: "ghost", colorScheme: "gray", size: "sm", onClick: onMoveToWishlist, "aria-label": `${copy.moveToWishlist}: ${title}`, children: copy.moveToWishlist })), onRemove && (_jsx(Button, { variant: "ghost", colorScheme: "gray", size: "sm", onClick: onRemove, "aria-label": `${copy.remove}: ${title}`, children: copy.remove }))] }))] })] }));
|
|
54
55
|
};
|
|
55
56
|
export default CartItem;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
2
3
|
import { Checkbox as ChakraCheckbox, Box } from "@chakra-ui/react";
|
|
3
4
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
4
5
|
import FieldMessage from "../Common/FieldMessage.js";
|
|
5
6
|
import { useFieldIds } from "../Common/useFieldIds.js";
|
|
6
7
|
import ToolTip from "../ToolTip/ToolTip.js";
|
|
7
|
-
/**
|
|
8
|
-
|
|
8
|
+
/** Native checkbox with optional label (else aria-label); `error` links its message via aria-describedby; `ref` is the `<input>`. */
|
|
9
|
+
const CheckBox = forwardRef(function CheckBox({ label, labelFontSize, showLabelTooltip, labelTooltip, labelClampLines, spacing, isInvalid, color, iconColor, iconSize, isChecked, isIndeterminate, onChange, isDisabled, size = "md", value, defaultChecked, sx, error, errorMessage, helperText, onClick, labelSx, id, variant, ...aria }, ref) {
|
|
9
10
|
void variant;
|
|
10
11
|
const theme = useCustomTheme();
|
|
11
12
|
const ids = useFieldIds(id, { error, errorMessage, helperText });
|
|
@@ -24,8 +25,10 @@ export default function CheckBox({ label, labelFontSize, showLabelTooltip, label
|
|
|
24
25
|
...labelSx,
|
|
25
26
|
}
|
|
26
27
|
: { ...labelSx };
|
|
27
|
-
return (_jsxs(_Fragment, { children: [_jsx(ChakraCheckbox, { id: ids.inputId, "aria-describedby": ids.describedBy, ...aria, onClick: onClick, spacing: spacing !== null && spacing !== void 0 ? spacing : "0.5rem", isInvalid: isInvalid || error, colorScheme: color, iconColor: iconColor, iconSize: iconSize, isChecked: isChecked, isIndeterminate: isIndeterminate, onChange: onChange, isDisabled: isDisabled, size: size, value: value, defaultChecked: defaultChecked, borderColor: theme.colors.boxborder[500], display: "flex", alignItems: "center", sx: {
|
|
28
|
+
return (_jsxs(_Fragment, { children: [_jsx(ChakraCheckbox, { ref: ref, id: ids.inputId, "aria-describedby": ids.describedBy, ...aria, onClick: onClick, spacing: spacing !== null && spacing !== void 0 ? spacing : "0.5rem", isInvalid: isInvalid || error, colorScheme: color, iconColor: iconColor, iconSize: iconSize, isChecked: isChecked, isIndeterminate: isIndeterminate, onChange: onChange, isDisabled: isDisabled, size: size, value: value, defaultChecked: defaultChecked, borderColor: theme.colors.boxborder[500], display: "flex", alignItems: "center", sx: {
|
|
28
29
|
...sx,
|
|
29
30
|
".chakra-checkbox__control": { w: controlSize, h: controlSize },
|
|
30
|
-
}, children: label && (showLabelTooltip ? (_jsx(ToolTip, { label: labelTooltip !== null && labelTooltip !== void 0 ? labelTooltip : label, hasArrow: true, placement: "top", fontSize: "
|
|
31
|
-
}
|
|
31
|
+
}, children: label && (showLabelTooltip ? (_jsx(ToolTip, { label: labelTooltip !== null && labelTooltip !== void 0 ? labelTooltip : label, hasArrow: true, placement: "top", fontSize: "xs", children: _jsx(Box, { as: "span", sx: clampStyles, fontSize: labelFontSize !== null && labelFontSize !== void 0 ? labelFontSize : "0.875rem", color: theme.colors.text[700], fontWeight: 500, ml: 0, children: label }) })) : (_jsx(Box, { as: "span", sx: clampStyles, fontSize: labelFontSize !== null && labelFontSize !== void 0 ? labelFontSize : "0.875rem", color: theme.colors.text[700], fontWeight: 500, ml: 0, children: label }))) }), _jsx(FieldMessage, { error: error, errorMessage: errorMessage, helperText: helperText, helperId: ids.helperId, errorId: ids.errorId })] }));
|
|
32
|
+
});
|
|
33
|
+
CheckBox.displayName = "CheckBox";
|
|
34
|
+
export default CheckBox;
|
|
@@ -56,7 +56,7 @@ export const SelectableGroup = ({ value, defaultValue, onValueChange, gap = 3, c
|
|
|
56
56
|
/** Tonal card surface; selection is a 2px ink ring plus a check, never colour alone. */
|
|
57
57
|
export const selectableSurface = (colors, { selected, disabled, interactive, ringed }) => ({
|
|
58
58
|
bg: colors.background[100],
|
|
59
|
-
borderRadius: "
|
|
59
|
+
borderRadius: "2xl",
|
|
60
60
|
boxShadow: selected ? `inset 0 0 0 2px ${colors.header[900]}` : "none",
|
|
61
61
|
opacity: disabled ? 0.6 : 1,
|
|
62
62
|
transition: transitionFor(["background-color", "box-shadow"]),
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useId } from "react";
|
|
3
|
+
import { Box, Flex, Text } from "@chakra-ui/react";
|
|
4
|
+
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
5
|
+
import { RadioIndicator, selectableSurface, useSelectable } from "../CheckoutKit/selectable.js";
|
|
6
|
+
const ChoiceCard = ({ value, label, description, icon, disabled = false, "data-testid": testId }) => {
|
|
7
|
+
const { colors } = useCustomTheme();
|
|
8
|
+
const uid = useId();
|
|
9
|
+
const labelId = `${uid}-label`;
|
|
10
|
+
const descriptionId = `${uid}-description`;
|
|
11
|
+
const { isSelected, interactive, inGroup, ringed, props } = useSelectable({ value, disabled });
|
|
12
|
+
return (_jsx(Flex, { direction: "column", "data-testid": testId, "data-selected": isSelected || undefined, ...selectableSurface(colors, { selected: isSelected && inGroup, disabled, interactive, ringed }), children: _jsxs(Flex, { ...props, "data-radio": true, "aria-disabled": inGroup && disabled ? true : undefined, "aria-labelledby": props.role ? labelId : undefined, "aria-describedby": props.role && description ? descriptionId : undefined, align: "center", gap: 3, p: 4, borderRadius: "2xl", cursor: interactive ? "pointer" : "default", outline: "none", children: [inGroup && _jsx(RadioIndicator, { selected: isSelected }), icon && (_jsx(Flex, { as: "span", "aria-hidden": true, align: "center", justify: "center", boxSize: 10, flexShrink: 0, borderRadius: "xl", bg: colors.background[50], color: colors.header[900], children: icon })), _jsxs(Box, { flex: 1, minW: 0, children: [_jsx(Text, { as: "span", id: labelId, display: "block", fontSize: "sm", fontWeight: 600, lineHeight: 1.4, color: colors.header[900], children: label }), description && (_jsx(Text, { as: "span", id: descriptionId, display: "block", fontSize: "xs", lineHeight: 1.4, color: colors.textMuted, children: description }))] })] }) }));
|
|
13
|
+
};
|
|
14
|
+
export default ChoiceCard;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,20 +3,16 @@ import { Box, Flex, chakra } from "@chakra-ui/react";
|
|
|
3
3
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
4
4
|
import { resolveSoftTone, toneScale } from "../../Theme/tokens/builders/tone.js";
|
|
5
5
|
import { transitionFor } from "../../Theme/tokens/primitives/motion.js";
|
|
6
|
+
import { NUMERIC_TEXT } from "../../Theme/tokens/primitives/typography.js";
|
|
6
7
|
import { reducedMotionSx } from "../../Theme/chakra/motion.js";
|
|
7
|
-
import { arcGeometry,
|
|
8
|
+
import { arcGeometry, resolveDiameter } from "./arc.js";
|
|
8
9
|
const Circle = chakra("circle");
|
|
9
|
-
const LABEL_FONT = {
|
|
10
|
-
sm: "0.625rem",
|
|
11
|
-
md: "0.75rem",
|
|
12
|
-
lg: "1rem",
|
|
13
|
-
};
|
|
14
10
|
const scaleFor = (colors, tone) => tone === "info" ? colors.primary : toneScale(colors, tone);
|
|
15
11
|
/** Ring-shaped determinate progress with a centred label — for a linear bar use ProgressBar. */
|
|
16
12
|
const CircularProgress = ({ value, max = 100, size = "md", thickness, tone = "info", label, "aria-label": ariaLabel, "data-testid": testId, }) => {
|
|
17
13
|
const { colors } = useCustomTheme();
|
|
18
|
-
const diameter =
|
|
19
|
-
const stroke = thickness !== null && thickness !== void 0 ? thickness :
|
|
14
|
+
const { diameter, thickness: defaultStroke, label: labelSize } = resolveDiameter(size);
|
|
15
|
+
const stroke = thickness !== null && thickness !== void 0 ? thickness : defaultStroke;
|
|
20
16
|
const { radius, circumference, fraction, clamped, safeMax, dashOffset } = arcGeometry(diameter, stroke, value, max);
|
|
21
17
|
const ink = resolveSoftTone(colors, scaleFor(colors, tone), colors.background[50]).fg;
|
|
22
18
|
const center = diameter / 2;
|
|
@@ -32,6 +28,6 @@ const CircularProgress = ({ value, max = 100, size = "md", thickness, tone = "in
|
|
|
32
28
|
transformOrigin: "50% 50%",
|
|
33
29
|
transition: transitionFor(["stroke-dashoffset"]),
|
|
34
30
|
...reducedMotionSx(),
|
|
35
|
-
} })] }), label !== undefined && label !== null && (_jsx(Flex, { position: "absolute", inset: 0, align: "center", justify: "center", fontSize:
|
|
31
|
+
} })] }), label !== undefined && label !== null && (_jsx(Flex, { position: "absolute", inset: 0, align: "center", justify: "center", fontSize: labelSize, fontWeight: 600, lineHeight: 1, color: colors.header[900], sx: NUMERIC_TEXT, children: label }))] }));
|
|
36
32
|
};
|
|
37
33
|
export default CircularProgress;
|
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
export const SIZE_PX = { sm: 32, md: 48, lg: 72 };
|
|
2
2
|
export const THICKNESS_PX = { sm: 4, md: 5, lg: 7 };
|
|
3
|
+
export const LABEL_REM = { sm: "0.625rem", md: "0.75rem", lg: "1rem" };
|
|
4
|
+
export const MIN_DIAMETER = 24;
|
|
5
|
+
export const MAX_DIAMETER = 160;
|
|
6
|
+
export const resolveDiameter = (size) => {
|
|
7
|
+
if (typeof size === "string")
|
|
8
|
+
return { diameter: SIZE_PX[size], thickness: THICKNESS_PX[size], label: LABEL_REM[size] };
|
|
9
|
+
const diameter = Math.min(Math.max(Number.isFinite(size) ? Math.round(size) : SIZE_PX.md, MIN_DIAMETER), MAX_DIAMETER);
|
|
10
|
+
return {
|
|
11
|
+
diameter,
|
|
12
|
+
thickness: Math.min(Math.max(Math.round(diameter / 10), 3), 12),
|
|
13
|
+
label: `${Math.min(Math.max(Math.round(diameter / 4), 10), 32) / 16}rem`,
|
|
14
|
+
};
|
|
15
|
+
};
|
|
3
16
|
export const clampValue = (value, max) => Number.isFinite(value) ? Math.min(Math.max(value, 0), max) : 0;
|
|
4
17
|
export const arcGeometry = (diameter, thickness, value, max) => {
|
|
5
18
|
const safeMax = max > 0 ? max : 100;
|
|
@@ -30,7 +30,7 @@ export const TextLabel = ({ label, id, isRequired = false, isInformation = false
|
|
|
30
30
|
mb: inline ? 0 : base.mb,
|
|
31
31
|
fontSize: fontSize !== null && fontSize !== void 0 ? fontSize : base.fontSize,
|
|
32
32
|
};
|
|
33
|
-
const content = (_jsxs(Box, { as: "span", display: "inline-flex", alignItems: "center", gap: "0.35rem", children: [showTooltip ? (_jsx(ToolTip, { label: tooltipLabel !== null && tooltipLabel !== void 0 ? tooltipLabel : label, hasArrow: true, placement: "top", fontSize: "
|
|
33
|
+
const content = (_jsxs(Box, { as: "span", display: "inline-flex", alignItems: "center", gap: "0.35rem", children: [showTooltip ? (_jsx(ToolTip, { label: tooltipLabel !== null && tooltipLabel !== void 0 ? tooltipLabel : label, hasArrow: true, placement: "top", fontSize: "xs", children: _jsx(Box, { as: "span", sx: clampStyles, children: label }) })) : (_jsx(Box, { as: "span", sx: clampStyles, children: label })), isRequired && (_jsx("span", { style: { color: theme.colors.semanticText.error, marginLeft: "0.125rem" }, children: "*" })), isInformation && informationMessage && (_jsx(ToolTip, { label: informationMessage, hasArrow: true, placement: "top", fontSize: "xs", children: _jsx(Icon, { as: InfoIcon, color: theme.colors.text[700], boxSize: 3.5 }) }))] }));
|
|
34
34
|
// NOTE: real <label> only with a control id — Checkbox/Radio render this inline inside their own <label>.
|
|
35
35
|
return id ? (_jsx(Box, { as: "label", htmlFor: id, ...wrapperStyles, children: content })) : (_jsx(Box, { as: "span", ...wrapperStyles, children: content }));
|
|
36
36
|
};
|
|
@@ -8,7 +8,7 @@ const InlineText = ({ text }) => {
|
|
|
8
8
|
if (text.startsWith("**", i)) {
|
|
9
9
|
const end = text.indexOf("**", i + 2);
|
|
10
10
|
if (end !== -1) {
|
|
11
|
-
nodes.push(_jsx(Text, { as: "span", fontWeight:
|
|
11
|
+
nodes.push(_jsx(Text, { as: "span", fontWeight: 700, children: text.slice(i + 2, end) }, `b-${i}`));
|
|
12
12
|
i = end + 2;
|
|
13
13
|
continue;
|
|
14
14
|
}
|
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { FormHelperText, Text, useFormControlContext } from "@chakra-ui/react";
|
|
2
|
+
import { FormHelperText, Text, chakra, useFormControlContext, useFormControlStyles } from "@chakra-ui/react";
|
|
3
3
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
4
4
|
import { fieldMessageStyles } from "./fieldMessageStyles.js";
|
|
5
|
-
|
|
5
|
+
const UnregisteredHelperText = ({ helperText, id, style }) => {
|
|
6
|
+
const styles = useFormControlStyles();
|
|
7
|
+
return (_jsx(chakra.div, { id: id, ...style, __css: styles.helperText, className: "chakra-form__helper-text", children: helperText }));
|
|
8
|
+
};
|
|
9
|
+
/** `id` is optional — pass one to own aria-describedby; omitted, a FormControl wires its own. */
|
|
6
10
|
/** Renders `helperText` unconditionally; prefer `FieldMessage`, which swaps it for the error. */
|
|
7
11
|
const HelperText = ({ helperText, id }) => {
|
|
8
12
|
const theme = useCustomTheme();
|
|
9
13
|
const field = useFormControlContext();
|
|
10
|
-
// An explicit id={undefined} overwrites the id FormHelperText generates for aria-describedby.
|
|
11
|
-
const idProp = id ? { id } : {};
|
|
12
14
|
const style = fieldMessageStyles(theme.colors);
|
|
13
|
-
// FormHelperText throws without a FormControl ancestor; Checkbox, MultiSelect and
|
|
14
|
-
// SearchSelect render this outside one.
|
|
15
15
|
if (!field) {
|
|
16
|
-
return (_jsx(Text, {
|
|
16
|
+
return (_jsx(Text, { id: id, ...style, children: helperText }));
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
// NOTE: FormHelperText makes Chakra append a dangling `<fieldId>-helptext` to aria-describedby.
|
|
19
|
+
if (id)
|
|
20
|
+
return _jsx(UnregisteredHelperText, { helperText: helperText, id: id, style: style });
|
|
21
|
+
return _jsx(FormHelperText, { ...style, children: helperText });
|
|
19
22
|
};
|
|
20
23
|
export default HelperText;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { CONTROL_SIZES } from "../../Theme/tokens/primitives/controlSizes.js";
|
|
2
2
|
import { transitionFor } from "../../Theme/tokens/primitives/motion.js";
|
|
3
|
+
import { RADIUS_ROLE } from "../../Theme/tokens/primitives/radii.js";
|
|
3
4
|
import { placeholderInk } from "../../Theme/tokens/builders/placeholderInk.js";
|
|
4
5
|
import { AA_NON_TEXT, liftToContrast } from "../../Theme/tokens/builders/outlineRung.js";
|
|
5
6
|
import { fieldFocusVisible, focusGlowShadow } from "../../Theme/chakra/focusRing.styles.js";
|
|
6
|
-
export const FIELD_RADIUS =
|
|
7
|
+
export const FIELD_RADIUS = RADIUS_ROLE.field;
|
|
7
8
|
export const FIELD_BORDER_WIDTH = "1px";
|
|
8
9
|
/** No box-shadow: the focus ring must be present the frame focus lands, not fade in. */
|
|
9
10
|
export const FIELD_TRANSITION = transitionFor(["border-color", "background-color"]);
|
|
@@ -111,6 +111,6 @@ const ContactForm = ({ apiKey, onSubmit, customFields, getCustomValues, isDisabl
|
|
|
111
111
|
setIsLoading(false);
|
|
112
112
|
}
|
|
113
113
|
};
|
|
114
|
-
return (_jsxs(Box, { maxW: "lg", mx: "auto", p: 8, borderRadius: "xl", boxShadow: "lg", bg: colors.background[300], children: [response.title ? (_jsxs(Alert, { status: (response === null || response === void 0 ? void 0 : response.isSuccess) ? "success" : "error", fontWeight:
|
|
114
|
+
return (_jsxs(Box, { maxW: "lg", mx: "auto", p: 8, borderRadius: "xl", boxShadow: "lg", bg: colors.background[300], children: [response.title ? (_jsxs(Alert, { status: (response === null || response === void 0 ? void 0 : response.isSuccess) ? "success" : "error", fontWeight: 700, variant: "solid", mb: 1, children: [(response === null || response === void 0 ? void 0 : response.isSuccess) ? _jsx(CircleCheck, {}) : _jsx(CircleX, {}), " \u00A0", " ", response.title] })) : null, _jsx(Heading, { textAlign: "center", size: "lg", mb: 2, children: "Contact Us" }), _jsx(Text, { textAlign: "center", mb: 6, color: colors.textMuted, children: "Fill in the form below to reach out to us." }), _jsx(Box, { as: "form", onSubmit: handleSubmit, children: _jsxs(VStack, { spacing: 4, children: [_jsxs(SimpleGrid, { columns: { base: 1, md: 2 }, spacing: 4, w: "100%", children: [_jsx(FormControl, { children: _jsx(TextInput, { label: "First Name", placeholder: "Enter first name", value: formData.firstName, onChange: (e) => handleChange("firstName", e.target.value), error: Boolean(errors.firstName), errorMessage: errors.firstName, isRequired: true }) }), _jsx(FormControl, { children: _jsx(TextInput, { label: "Last Name", placeholder: "Enter last name", value: formData.lastName, onChange: (e) => handleChange("lastName", e.target.value) }) })] }), _jsxs(SimpleGrid, { columns: { base: 1, md: 2 }, spacing: 4, w: "100%", children: [_jsx(FormControl, { children: _jsx(TextInput, { label: "Phone", placeholder: "Enter phone number", value: formData.phone, onChange: (e) => handleChange("phone", e.target.value), isRequired: true, error: Boolean(errors.phone), errorMessage: errors.phone }) }), _jsx(FormControl, { isInvalid: !!errors.email, children: _jsx(TextInput, { label: "Email", placeholder: "Enter email", value: formData.email, onChange: (e) => handleChange("email", e.target.value), error: Boolean(errors.email), errorMessage: errors.email }) })] }), customFields, _jsx(InputTextArea, { label: "Enquiry", placeholder: "Enter your enquiry", rows: 4, width: "100%", value: formData.enquiry, onChange: (e) => handleChange("enquiry", e.target.value) }), _jsx(Button, { type: "submit", isDisabled: isDisabled, colorScheme: buttonColorScheme, width: "full", sx: buttonSx, isLoading: isLoading, loadingText: "Sending...", children: "Send Message" })] }) })] }));
|
|
115
115
|
};
|
|
116
116
|
export default ContactForm;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useRef, useState } from "react";
|
|
3
|
-
import { Box, Flex, IconButton, Text } from "@chakra-ui/react";
|
|
3
|
+
import { Box, Flex, IconButton, Text, VisuallyHidden } from "@chakra-ui/react";
|
|
4
4
|
import { Check, Copy } from "lucide-react";
|
|
5
5
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
6
6
|
import { accentTextOnCanvas, AA_NORMAL_TEXT } from "../../Theme/tokens/builders/accentText.js";
|
|
7
7
|
import { listRowBackgrounds } from "../../Theme/tokens/builders/rowStates.js";
|
|
8
8
|
import { liftToContrast } from "../../Theme/tokens/builders/outlineRung.js";
|
|
9
9
|
import { transitionFor } from "../../Theme/tokens/primitives/index.js";
|
|
10
|
+
import { focusVisibleRing } from "../../Theme/chakra/focusRing.styles.js";
|
|
10
11
|
import ToolTip from "../ToolTip/ToolTip.js";
|
|
11
12
|
/** Copies `value` to the clipboard in 3 layouts (icon/button/menu-item) — not a full share/export action. */
|
|
12
13
|
const CopyButton = ({ value, variant = "icon", label = "Copy", copiedLabel = "Copied!", tooltip = "Copy", feedbackDuration = 1500, iconSize = 16, size = "sm", onCopy, }) => {
|
|
@@ -31,16 +32,22 @@ const CopyButton = ({ value, variant = "icon", label = "Copy", copiedLabel = "Co
|
|
|
31
32
|
const accent = accentTextOnCanvas(theme.colors.primary, theme.colors.backgroundColor.main);
|
|
32
33
|
const success = theme.colors.semanticText.success;
|
|
33
34
|
const rowBackgrounds = listRowBackgrounds(theme.colors);
|
|
35
|
+
const announcement = (_jsx(VisuallyHidden, { role: "status", "aria-live": "polite", position: "fixed", top: 0, left: 0, children: copied ? copiedLabel : "" }));
|
|
34
36
|
if (variant === "menu-item") {
|
|
35
37
|
const hoverAccent = accentTextOnCanvas(theme.colors.primary, rowBackgrounds.active);
|
|
36
38
|
const hoverSuccess = liftToContrast(theme.colors.semantic.success[500], rowBackgrounds.active, AA_NORMAL_TEXT);
|
|
37
|
-
return (_jsxs(Flex, { align: "center", gap: "0.5rem", px: "12px", py: "8px", width: "100%", cursor: "pointer", borderRadius: "md", transition: "background 0.15s ease", _hover: { bg: rowBackgrounds.active },
|
|
39
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Flex, { role: "button", tabIndex: 0, align: "center", gap: "0.5rem", px: "12px", py: "8px", width: "100%", cursor: "pointer", borderRadius: "md", transition: "background 0.15s ease", _hover: { bg: rowBackgrounds.active }, _focusVisible: focusVisibleRing(theme.colors), onClick: handleCopy, onKeyDown: (e) => {
|
|
40
|
+
if (e.key !== "Enter" && e.key !== " ")
|
|
41
|
+
return;
|
|
42
|
+
e.preventDefault();
|
|
43
|
+
handleCopy(e);
|
|
44
|
+
}, children: [copied ? (_jsx(Check, { size: iconSize, color: hoverSuccess })) : (_jsx(Copy, { size: iconSize, color: hoverAccent })), _jsx(Box, { fontSize: "sm", fontWeight: 500, color: copied ? hoverSuccess : hoverAccent, children: copied ? copiedLabel : label })] }), announcement] }));
|
|
38
45
|
}
|
|
39
46
|
if (variant === "button") {
|
|
40
|
-
return (_jsxs(Flex, { as: "button", align: "center", gap: "6px", px: "12px", py: "6px", borderRadius: "lg", border: "1px solid",
|
|
41
|
-
|
|
42
|
-
|
|
47
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Flex, { as: "button", align: "center", gap: "6px", px: "12px", py: "6px", borderRadius: "lg", border: "1px solid",
|
|
48
|
+
// [800], not [500]: a real control boundary needs >=3:1 on every surface up to `muted`.
|
|
49
|
+
borderColor: copied ? success : theme.colors.boxborder[500], bg: "transparent", color: copied ? success : theme.colors.text[700], fontSize: "sm", fontWeight: 500, transition: transitionFor(["border-color", "color"]), _hover: { borderColor: accent, color: accent }, onClick: handleCopy, children: [copied ? _jsx(Check, { size: iconSize }) : _jsx(Copy, { size: iconSize }), _jsx(Text, { children: copied ? copiedLabel : label })] }), announcement] }));
|
|
43
50
|
}
|
|
44
|
-
return (_jsx(ToolTip, { label: copied ? copiedLabel : tooltip, placement: "top", children: _jsx(IconButton, { "aria-label": tooltip, size: size, variant: "ghost", onClick: handleCopy, color: copied ? success : theme.colors.textMuted, _hover: { color: accent, bg: rowBackgrounds.active }, icon: copied ? _jsx(Check, { size: iconSize }) : _jsx(Copy, { size: iconSize }) }) }));
|
|
51
|
+
return (_jsxs(_Fragment, { children: [_jsx(ToolTip, { label: copied ? copiedLabel : tooltip, placement: "top", children: _jsx(IconButton, { "aria-label": tooltip, size: size, variant: "ghost", onClick: handleCopy, color: copied ? success : theme.colors.textMuted, _hover: { color: accent, bg: rowBackgrounds.active }, icon: copied ? _jsx(Check, { size: iconSize }) : _jsx(Copy, { size: iconSize }) }) }), announcement] }));
|
|
45
52
|
};
|
|
46
53
|
export default CopyButton;
|
|
@@ -4,6 +4,7 @@ import { Box, Flex, Text, VisuallyHidden } from "@chakra-ui/react";
|
|
|
4
4
|
import { BadgeCheck, ChevronDown, Ticket } from "lucide-react";
|
|
5
5
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
6
6
|
import { transitionFor } from "../../Theme/tokens/primitives/motion.js";
|
|
7
|
+
import { NUMERIC_TEXT } from "../../Theme/tokens/primitives/typography.js";
|
|
7
8
|
import { reducedMotionSx } from "../../Theme/chakra/motion.js";
|
|
8
9
|
import { focusVisibleStyles } from "../../Theme/chakra/focusRing.styles.js";
|
|
9
10
|
import { resolveSoftTone, toneScale } from "../../Theme/tokens/builders/tone.js";
|
|
@@ -57,11 +58,11 @@ const CouponField = ({ status = "idle", appliedCode, savedAmount, error, onApply
|
|
|
57
58
|
};
|
|
58
59
|
const success = resolveSoftTone(colors, toneScale(colors, "success"), colors.background[100]);
|
|
59
60
|
if (status === "applied" && appliedCode) {
|
|
60
|
-
return (_jsxs(Flex, { align: "center", gap: 3, p: 3, pl: 4, borderRadius: "
|
|
61
|
+
return (_jsxs(Flex, { align: "center", gap: 3, p: 3, pl: 4, borderRadius: "2xl", bg: colors.background[100], "data-testid": testId, "data-status": "applied", children: [_jsx(Flex, { as: "span", align: "center", justify: "center", boxSize: 8, flexShrink: 0, borderRadius: "full", bg: success.bg, color: success.fg, children: _jsx(BadgeCheck, { size: 16, "aria-hidden": true }) }), _jsxs(Box, { flex: 1, minW: 0, role: "status", children: [_jsx(Text, { as: "span", display: "block", fontSize: "sm", fontWeight: 700, lineHeight: 1.4, color: colors.header[900], noOfLines: 1, children: copy.applied(appliedCode) }), savedAmount !== undefined && savedAmount > 0 && (_jsx(Text, { as: "span", display: "block", fontSize: "xs", fontWeight: 600, lineHeight: 1.4, color: colors.semanticText.success, sx: NUMERIC_TEXT, children: copy.saved(formatPrice(savedAmount, { currency, locale })) }))] }), _jsx(Button, { variant: "ghost", colorScheme: "gray", size: "sm", onClick: onRemove, "aria-label": `${copy.remove} coupon ${appliedCode}`, children: copy.remove })] }));
|
|
61
62
|
}
|
|
62
|
-
return (_jsxs(Flex, { direction: "column", gap: 3, "data-testid": testId, "data-status": status, children: [_jsxs(Box, { as: "button", type: "button", "aria-expanded": open, "aria-controls": panelId, disabled: applying || status === "error", onClick: () => setOpen(!open), display: "flex", alignItems: "center", gap: 3, w: "100%", minH: "3rem", px: 4, borderRadius: "
|
|
63
|
+
return (_jsxs(Flex, { direction: "column", gap: 3, "data-testid": testId, "data-status": status, children: [_jsxs(Box, { as: "button", type: "button", "aria-expanded": open, "aria-controls": panelId, disabled: applying || status === "error", onClick: () => setOpen(!open), display: "flex", alignItems: "center", gap: 3, w: "100%", minH: "3rem", px: 4, borderRadius: "2xl", bg: colors.background[100], color: colors.header[900], textAlign: "left", transition: transitionFor(["background-color"]), _hover: { bg: colors.background[200] }, sx: { ...focusVisibleStyles(colors), ...reducedMotionSx() }, children: [_jsx(Ticket, { size: 18, "aria-hidden": true }), _jsx(Text, { as: "span", flex: 1, fontSize: "sm", fontWeight: 600, children: copy.prompt }), _jsx(Box, { as: "span", display: "inline-flex", "aria-hidden": true, transform: open ? "rotate(180deg)" : undefined, transition: transitionFor(["transform"]), sx: reducedMotionSx({ transform: open ? "rotate(180deg)" : "none" }), children: _jsx(ChevronDown, { size: 16 }) })] }), _jsxs(Box, { id: panelId, hidden: !open, display: open ? "block" : "none", onKeyDown: onKeyDown, children: [_jsxs(Flex, { gap: 2, align: "flex-start", children: [_jsx(Box, { flex: 1, minW: 0, children: _jsx(TextInput, { size: "lg", variant: "filled", "aria-label": copy.inputLabel, placeholder: copy.placeholder, value: text, onChange: (event) => setText(normalise(event.target.value)), error: status === "error", errorMessage: status === "error" ? error : undefined, isDisabled: applying, autoComplete: "off", autoCapitalize: "characters", spellCheck: false }) }), _jsx(Button, { variant: "outline", colorScheme: "gray", size: "lg", isLoading: applying, isDisabled: !normalise(text), onClick: () => submit(text), children: copy.apply })] }), suggestions && suggestions.length > 0 && (_jsxs(Box, { mt: 4, children: [_jsx(Text, { as: "p", fontSize: "xs", fontWeight: 600, color: colors.textMuted, mb: 2, children: copy.suggestionsTitle }), _jsx(Flex, { as: "ul", direction: "column", gap: 2, m: 0, p: 0, listStyleType: "none", children: suggestions.map((s) => (_jsx(Box, { as: "li", children: _jsxs(Box, { as: "button", type: "button", disabled: applying, "aria-label": `${copy.applySuggestion(s.code)}: ${s.title}`, onClick: () => {
|
|
63
64
|
setText(s.code);
|
|
64
65
|
submit(s.code);
|
|
65
|
-
}, display: "flex", alignItems: "center", gap: 3, w: "100%", p: 3, borderRadius: "
|
|
66
|
+
}, display: "flex", alignItems: "center", gap: 3, w: "100%", p: 3, borderRadius: "xl", bg: colors.background[100], textAlign: "left", transition: transitionFor(["background-color"]), _hover: { bg: colors.background[200] }, _disabled: { cursor: "not-allowed", opacity: 0.6 }, sx: { ...focusVisibleStyles(colors), ...reducedMotionSx() }, children: [_jsx(Text, { as: "span", flexShrink: 0, px: 2, py: 1, borderRadius: "lg", bg: colors.background[200], fontSize: "xs", fontWeight: 700, letterSpacing: "0.04em", color: colors.header[900], children: s.code }), _jsxs(Box, { as: "span", flex: 1, minW: 0, children: [_jsx(Text, { as: "span", display: "block", fontSize: "sm", fontWeight: 600, lineHeight: 1.4, color: colors.header[900], children: s.title }), s.detail && (_jsx(Text, { as: "span", display: "block", fontSize: "xs", lineHeight: 1.4, color: colors.textMuted, children: s.detail }))] }), _jsx(Text, { as: "span", "aria-hidden": true, fontSize: "sm", fontWeight: 600, color: colors.accentText, children: copy.apply })] }) }, s.code))) })] }))] }), _jsx(VisuallyHidden, { role: "status", children: applying ? `${copy.apply}…` : "" })] }));
|
|
66
67
|
};
|
|
67
68
|
export default CouponField;
|
|
@@ -10,7 +10,7 @@ const EditModuleModal = ({ isOpen, onClose, initialName, isLoading, onSubmit, la
|
|
|
10
10
|
if (isOpen)
|
|
11
11
|
setName(initialName);
|
|
12
12
|
}, [isOpen, initialName]);
|
|
13
|
-
return (_jsxs(Modal, { isOpen: isOpen, onClose: onClose, isCentered: true, children: [_jsx(ModalOverlay, { backdropFilter: "blur(4px)" }), _jsxs(ModalContent, { borderRadius: "xl", overflow: "hidden", bg: colors.surfaceRaised, children: [_jsx(ModalHeader, { borderBottom: "1px solid", borderColor: colors.boxborder[200], fontSize: "1.05rem", fontWeight: 600, children: labels.editModuleTitle }), _jsx(ModalCloseButton, {}), _jsxs(ModalBody, { py: 6, children: [_jsx(Input, { value: name, onChange: (e) => setName(e.target.value), placeholder: labels.moduleNamePlaceholder,
|
|
13
|
+
return (_jsxs(Modal, { isOpen: isOpen, onClose: onClose, isCentered: true, children: [_jsx(ModalOverlay, { backdropFilter: "blur(4px)" }), _jsxs(ModalContent, { borderRadius: "xl", overflow: "hidden", bg: colors.surfaceRaised, children: [_jsx(ModalHeader, { borderBottom: "1px solid", borderColor: colors.boxborder[200], fontSize: "1.05rem", fontWeight: 600, children: labels.editModuleTitle }), _jsx(ModalCloseButton, {}), _jsxs(ModalBody, { py: 6, children: [_jsx(Input, { value: name, onChange: (e) => setName(e.target.value), placeholder: labels.moduleNamePlaceholder, "aria-label": labels.moduleNamePlaceholder,
|
|
14
14
|
// NOTE: [200] is the decorative divider rung — a real control's outline needs 1.4.11's 3:1, from [800].
|
|
15
15
|
borderColor: colors.boxborder[500], mb: 5 }), _jsxs(HStack, { justifyContent: "flex-end", spacing: 3, children: [_jsx(Button, { label: labels.cancel, onClick: onClose, variant: "outline", colorScheme: "gray", size: "sm" }), _jsx(Button, { label: labels.update, onClick: () => onSubmit(name.trim()), colorScheme: "primary", size: "sm", isLoading: isLoading, isDisabled: !name.trim() })] })] })] })] }));
|
|
16
16
|
};
|
|
@@ -118,11 +118,11 @@ export const CalendarPanel = ({ currentMonth, setCurrentMonth, today, isRange, t
|
|
|
118
118
|
const dayLabel = dayStates
|
|
119
119
|
? dayAccessibleName(format(thisDay, "d MMMM yyyy"), states)
|
|
120
120
|
: format(thisDay, "d MMMM yyyy");
|
|
121
|
-
days.push(_jsx(Box, { role: "gridcell", h: "2rem", display: "flex", alignItems: "center", justifyContent: "center", style: cellBg ? { background: cellBg } : undefined, children: _jsxs(Box, { as: "button", type: "button", disabled: disabled, className: dayStates ? dayStateClassName(states) : undefined, "aria-label": dayLabel, "aria-selected": isSelected || isStart || isEnd || undefined, "aria-current": isToday ? "date" : undefined, onClick: () => !disabled && onDaySelect(new Date(thisDay)), onMouseEnter: () => !disabled && (onDayHover === null || onDayHover === void 0 ? void 0 : onDayHover(new Date(thisDay))), position: hasDayOverlay ? "relative" : undefined, w: "1.75rem", h: "1.75rem", borderRadius: "full", display: "flex", alignItems: "center", justifyContent: "center", fontSize: "
|
|
121
|
+
days.push(_jsx(Box, { role: "gridcell", h: "2rem", display: "flex", alignItems: "center", justifyContent: "center", style: cellBg ? { background: cellBg } : undefined, children: _jsxs(Box, { as: "button", type: "button", disabled: disabled, className: dayStates ? dayStateClassName(states) : undefined, "aria-label": dayLabel, "aria-selected": isSelected || isStart || isEnd || undefined, "aria-current": isToday ? "date" : undefined, onClick: () => !disabled && onDaySelect(new Date(thisDay)), onMouseEnter: () => !disabled && (onDayHover === null || onDayHover === void 0 ? void 0 : onDayHover(new Date(thisDay))), position: hasDayOverlay ? "relative" : undefined, w: "1.75rem", h: "1.75rem", borderRadius: "full", display: "flex", alignItems: "center", justifyContent: "center", fontSize: "xs-plus", fontWeight: circleSolid ? 600 : 500, lineHeight: "1", cursor: disabled ? "not-allowed" : "pointer", bg: circleSolid ? solidFill : "transparent", color: dayColor, textDecoration: (stateVisual === null || stateVisual === void 0 ? void 0 : stateVisual.strikethrough) ? "line-through" : undefined, border: dayBorder, transition: "background 0.12s, color 0.12s", _hover: disabled
|
|
122
122
|
? {}
|
|
123
123
|
: circleSolid
|
|
124
124
|
? { bg: solidHoverFill, color: circleHoverColor }
|
|
125
|
-
: { bg: rangeBg }, children: [format(thisDay, "d"), hasDayOverlay && (_jsx(Box, { as: "span", className: `${DAY_CLASS}__content`, position: "absolute", left: 0, right: 0, bottom: "
|
|
125
|
+
: { bg: rangeBg }, children: [format(thisDay, "d"), hasDayOverlay && (_jsx(Box, { as: "span", className: `${DAY_CLASS}__content`, position: "absolute", left: 0, right: 0, bottom: "px", display: "flex", alignItems: "flex-end", justifyContent: "center", lineHeight: "1", fontSize: "0.5rem",
|
|
126
126
|
// The overlay is decoration: clicks belong to the day button under it.
|
|
127
127
|
pointerEvents: "none", children: customContent !== null && customContent !== void 0 ? customContent : (_jsx(Box, { as: "span", className: `${DAY_CLASS}__marker`, w: "0.25rem", h: "0.25rem", borderRadius: "full", bg: markerColor })) }))] }) }, thisDay.toString()));
|
|
128
128
|
day = addDays(day, 1);
|
|
@@ -57,6 +57,12 @@ function CustomDatePicker(props) {
|
|
|
57
57
|
}
|
|
58
58
|
onOpen();
|
|
59
59
|
};
|
|
60
|
+
const handleTriggerKeyDown = (event) => {
|
|
61
|
+
if (isOpen || (event.key !== "Enter" && event.key !== "ArrowDown"))
|
|
62
|
+
return;
|
|
63
|
+
event.preventDefault();
|
|
64
|
+
handleOpen();
|
|
65
|
+
};
|
|
60
66
|
useEffect(() => {
|
|
61
67
|
if (!isRange) {
|
|
62
68
|
if (selectedDate instanceof Date) {
|
|
@@ -169,7 +175,7 @@ function CustomDatePicker(props) {
|
|
|
169
175
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
170
176
|
};
|
|
171
177
|
}, [isOpen, onClose, tempDate, props, emitSingle]);
|
|
172
|
-
return (_jsxs(Box, { width: width, position: "relative", children: [label && (_jsx(TextLabel, { label: label, isRequired: isRequired, isInformation: isInformation, informationMessage: informationMessage })), _jsxs(Popover, { isLazy: true, isOpen: isOpen, onClose: onClose, placement: "bottom-start", initialFocusRef: inputRef, closeOnBlur: true, children: [_jsx(PopoverTrigger, { children: _jsx(Box, { onClick: handleOpen, children: _jsx(TextInput, { id: id, name: name, ref: inputRef, placeholder: placeholderText, value: displayValue, isReadOnly: true, error: error, errorMessage: errorMessage, helperText: helperText, autoComplete: autoComplete, isDisabled: disabled, width: width, size: size }) }) }), _jsx(Portal, { appendToParentPortal: false, children: _jsx(PopoverContent, { width: "auto", p: 2, ref: popoverRef, zIndex: 1600, bg: theme.colors.surfaceRaised, children: _jsxs(PopoverBody, { children: [showDate && (_jsxs(_Fragment, { children: [_jsxs(Box, { display: "flex", alignItems: "center", justifyContent: "space-between", mb: 2, children: [_jsx(Button, { variant: "ghost", size: "sm", onClick: () => setCurrentMonth((prev) => subMonths(prev, 1)), children: _jsx(ChevronLeftIcon, {}) }), _jsxs(Box, { display: "flex", alignItems: "center", gap: 2, children: [_jsx("select", { value: currentMonth.getMonth(), onChange: (e) => {
|
|
178
|
+
return (_jsxs(Box, { width: width, position: "relative", children: [label && (_jsx(TextLabel, { label: label, isRequired: isRequired, isInformation: isInformation, informationMessage: informationMessage })), _jsxs(Popover, { isLazy: true, isOpen: isOpen, onClose: onClose, placement: "bottom-start", initialFocusRef: inputRef, closeOnBlur: true, children: [_jsx(PopoverTrigger, { children: _jsx(Box, { onClick: handleOpen, onKeyDown: handleTriggerKeyDown, children: _jsx(TextInput, { id: id, name: name, ref: inputRef, placeholder: placeholderText, value: displayValue, isReadOnly: true, error: error, errorMessage: errorMessage, helperText: helperText, autoComplete: autoComplete, isDisabled: disabled, width: width, size: size }) }) }), _jsx(Portal, { appendToParentPortal: false, children: _jsx(PopoverContent, { width: "auto", p: 2, ref: popoverRef, zIndex: 1600, bg: theme.colors.surfaceRaised, children: _jsxs(PopoverBody, { children: [showDate && (_jsxs(_Fragment, { children: [_jsxs(Box, { display: "flex", alignItems: "center", justifyContent: "space-between", mb: 2, children: [_jsx(Button, { variant: "ghost", size: "sm", onClick: () => setCurrentMonth((prev) => subMonths(prev, 1)), children: _jsx(ChevronLeftIcon, {}) }), _jsxs(Box, { display: "flex", alignItems: "center", gap: 2, children: [_jsx("select", { value: currentMonth.getMonth(), onChange: (e) => {
|
|
173
179
|
const newMonth = parseInt(e.target.value, 10);
|
|
174
180
|
setCurrentMonth((prev) => new Date(prev.getFullYear(), newMonth, 1));
|
|
175
181
|
}, children: Array.from({ length: 12 }).map((_, i) => (_jsx("option", { value: i, children: format(new Date(2000, i, 1), "MMMM") }, i))) }), _jsx("select", { value: currentMonth.getFullYear(), onChange: (e) => {
|
|
@@ -183,7 +189,7 @@ function CustomDatePicker(props) {
|
|
|
183
189
|
if (!disableToday && !isRange) {
|
|
184
190
|
handleDaySelect(new Date(today));
|
|
185
191
|
}
|
|
186
|
-
}, "aria-label": "Today", sx: { fontSize: "
|
|
192
|
+
}, "aria-label": "Today", sx: { fontSize: "xs", px: 2 }, isDisabled: disableToday, children: "Today" })), _jsx(Button, { variant: "ghost", size: "sm", onClick: () => setCurrentMonth((prev) => addMonths(prev, 1)), children: _jsx(ChevronRightIcon, {}) })] })] }), _jsx(Grid, { templateColumns: "repeat(7, 1fr)", gap: 1, fontWeight: 700, mb: 1, children: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map((day) => (_jsx(Box, { textAlign: "center", children: day }, day))) }), renderDays()] })), !isRange && showTime && (_jsx(TimePicker, { date: tempDate !== null && tempDate !== void 0 ? tempDate : (disableToday ? tomorrow : today), dateFormat: dateFormat, onChange: (updatedDate) => {
|
|
187
193
|
setTempDate(updatedDate);
|
|
188
194
|
emitSingle(updatedDate);
|
|
189
195
|
} })), _jsxs(Box, { display: "flex", justifyContent: "space-between", mt: 3, children: [_jsx(Button, { size: "sm", variant: "ghost", onClick: () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useMemo, useRef, useState } from "react";
|
|
3
|
-
import { Box, FormControl, IconButton, Input, InputGroup, InputRightElement, Popover, PopoverAnchor, PopoverBody, PopoverContent, useDisclosure, } from "@chakra-ui/react";
|
|
2
|
+
import { forwardRef, useEffect, useMemo, useRef, useState } from "react";
|
|
3
|
+
import { Box, FormControl, IconButton, Input, InputGroup, InputRightElement, Popover, PopoverAnchor, PopoverBody, PopoverContent, useDisclosure, useMergeRefs, } from "@chakra-ui/react";
|
|
4
4
|
import { format, isAfter, isBefore, isSameDay, subDays, startOfMonth, endOfMonth } from "date-fns";
|
|
5
5
|
import { CalendarIcon } from "lucide-react";
|
|
6
6
|
import Button from "../Button/Button.js";
|
|
@@ -21,8 +21,8 @@ const setTimeFrom = (base, time) => {
|
|
|
21
21
|
const b = base ? new Date(base) : new Date();
|
|
22
22
|
return new Date(b.getFullYear(), b.getMonth(), b.getDate(), time.getHours(), time.getMinutes(), time.getSeconds(), 0);
|
|
23
23
|
};
|
|
24
|
-
/** Two-endpoint range field; `onChange` fires on Apply, outside click or
|
|
25
|
-
export const RangeDatePicker = (props)
|
|
24
|
+
/** Two-endpoint range field; `onChange` fires on Apply, outside click or calendar Escape, never a bare day click; `ref` is the `<input>`. */
|
|
25
|
+
export const RangeDatePicker = forwardRef(function RangeDatePicker(props, ref) {
|
|
26
26
|
var _a, _b, _c, _d;
|
|
27
27
|
const { id, name, label, isRequired, isInformation, informationMessage, error, errorMessage, helperText, dateFormat = "dd/MM/yyyy", minDate, maxDate, disableFutureDates, disablePastDates, autoComplete = "off", width = "100%", disableToday = false, size = DEFAULT_CONTROL_SIZE, dayStates, renderDayContent, } = props;
|
|
28
28
|
const { isDisabled: disabled, placeholder: placeholderText } = resolvePickerAliases(props);
|
|
@@ -36,6 +36,7 @@ export const RangeDatePicker = (props) => {
|
|
|
36
36
|
const pickerPortal = usePickerPortal(isOpen);
|
|
37
37
|
const calendarLabel = label !== null && label !== void 0 ? label : "Choose date range";
|
|
38
38
|
const inputRef = useRef(null);
|
|
39
|
+
const mergedInputRef = useMergeRefs(inputRef, ref);
|
|
39
40
|
const triggerRef = useRef(null);
|
|
40
41
|
const popoverRef = useRef(null);
|
|
41
42
|
const today = new Date();
|
|
@@ -181,7 +182,7 @@ export const RangeDatePicker = (props) => {
|
|
|
181
182
|
return `${format(tempRangeStart, dateFormat)} -`;
|
|
182
183
|
return "";
|
|
183
184
|
}, [inputValue, tempRangeStart, tempRangeEnd, dateFormat]);
|
|
184
|
-
return (_jsxs(FormControl, { id: ids.inputId, isInvalid: error, isRequired: isRequired, isDisabled: disabled, width: width, children: [label && (_jsx(TextLabel, { label: label, id: ids.inputId, isRequired: isRequired, isInformation: isInformation, informationMessage: informationMessage })), _jsxs(Popover, { isLazy: true, isOpen: pickerPortal.isPopoverOpen, onClose: requestClose, placement: "bottom-start", closeOnBlur: false, returnFocusOnClose: true, children: [_jsx(PopoverAnchor, { children: _jsx(Box, { ref: triggerRef, as: "div", children: _jsxs(InputGroup, { size: sizeKey, children: [_jsx(Input, { ref:
|
|
185
|
+
return (_jsxs(FormControl, { id: ids.inputId, isInvalid: error, isRequired: isRequired, isDisabled: disabled, width: width, children: [label && (_jsx(TextLabel, { label: label, id: ids.inputId, isRequired: isRequired, isInformation: isInformation, informationMessage: informationMessage })), _jsxs(Popover, { isLazy: true, isOpen: pickerPortal.isPopoverOpen, onClose: requestClose, placement: "bottom-start", closeOnBlur: false, returnFocusOnClose: true, children: [_jsx(PopoverAnchor, { children: _jsx(Box, { ref: triggerRef, as: "div", children: _jsxs(InputGroup, { size: sizeKey, children: [_jsx(Input, { ref: mergedInputRef, ...ids.controlProps, name: name, size: sizeKey, placeholder: placeholder, value: displayValue, readOnly: true, isDisabled: disabled, isInvalid: error, isRequired: isRequired, autoComplete: autoComplete, onKeyDown: handleInputKeyDown, onFocus: () => {
|
|
185
186
|
if (!isOpen)
|
|
186
187
|
handleOpen();
|
|
187
188
|
}, onClick: () => {
|
|
@@ -225,5 +226,6 @@ export const RangeDatePicker = (props) => {
|
|
|
225
226
|
}
|
|
226
227
|
setTempRangeEnd(setTimeFrom(endTimeBaseDate, t));
|
|
227
228
|
}, dateFormat: timePickerFormat, isDisabled: disabled || !tempRangeEnd, size: sizeKey }))] })] })), _jsxs(Box, { display: "flex", justifyContent: "space-between", alignItems: "center", mt: 3, pt: 3, borderTop: "1px solid", borderColor: theme.colors.boxborder[200], children: [_jsx(Button, { size: "sm", variant: "ghost", colorScheme: "gray", onClick: handleClear, children: "Clear" }), _jsx(Button, { size: "sm", variant: "gradient", onClick: requestClose, children: "Apply" })] })] }) }) })] }), _jsx(FieldMessage, { error: error, errorMessage: errorMessage, helperText: helperText, helperId: ids.helperId, errorId: ids.errorId })] }));
|
|
228
|
-
};
|
|
229
|
+
});
|
|
230
|
+
RangeDatePicker.displayName = "RangeDatePicker";
|
|
229
231
|
export default RangeDatePicker;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useRef, useEffect, useLayoutEffect, useMemo, useCallback } from "react";
|
|
3
|
-
import { Box, Popover, PopoverAnchor, PopoverContent, PopoverBody, useDisclosure, Input, InputGroup, InputRightElement, IconButton, FormControl, } from "@chakra-ui/react";
|
|
2
|
+
import { forwardRef, useState, useRef, useEffect, useLayoutEffect, useMemo, useCallback } from "react";
|
|
3
|
+
import { Box, Popover, PopoverAnchor, PopoverContent, PopoverBody, useDisclosure, Input, InputGroup, InputRightElement, IconButton, FormControl, useMergeRefs, } from "@chakra-ui/react";
|
|
4
4
|
import { format, parse, isValid, isSameDay, isBefore, isAfter, addDays, } from "date-fns";
|
|
5
5
|
import { CalendarIcon } from "lucide-react";
|
|
6
6
|
import Button from "../Button/Button.js";
|
|
@@ -214,7 +214,7 @@ const normalizeTimeBuffer = (tokenChar, rawBuffer, segmentLength, is12Hour) => {
|
|
|
214
214
|
}
|
|
215
215
|
return { value: buf, completed: buf.length >= segmentLength };
|
|
216
216
|
};
|
|
217
|
-
|
|
217
|
+
function SingleDatePickerInner(props, ref) {
|
|
218
218
|
var _a, _b, _c, _d;
|
|
219
219
|
const { id, name, label, isRequired, isInformation, informationMessage, error, errorMessage, helperText, dateFormat = "dd/MM/yyyy", pickerType, minDate, maxDate, disableFutureDates, disablePastDates, autoComplete = "off", width = "100%", disableToday = false, size = DEFAULT_CONTROL_SIZE, } = props;
|
|
220
220
|
const { isDisabled: disabled, placeholder: placeholderText } = resolvePickerAliases(props);
|
|
@@ -228,6 +228,7 @@ export function SingleDatePicker(props) {
|
|
|
228
228
|
const pickerPortal = usePickerPortal(isOpen);
|
|
229
229
|
const calendarLabel = label !== null && label !== void 0 ? label : "Choose date";
|
|
230
230
|
const inputRef = useRef(null);
|
|
231
|
+
const mergedInputRef = useMergeRefs(inputRef, ref);
|
|
231
232
|
const popoverRef = useRef(null);
|
|
232
233
|
const triggerRef = useRef(null);
|
|
233
234
|
const resolvedPickerType = pickerType !== null && pickerType !== void 0 ? pickerType : inferPickerTypeFromFormat(dateFormat);
|
|
@@ -970,7 +971,7 @@ export function SingleDatePicker(props) {
|
|
|
970
971
|
}
|
|
971
972
|
finalize();
|
|
972
973
|
onClose();
|
|
973
|
-
}, placement: "bottom-start", closeOnBlur: false, returnFocusOnClose: true, children: [_jsx(PopoverAnchor, { children: _jsx(Box, { ref: triggerRef, as: "div", children: _jsxs(InputGroup, { size: sizeKey, children: [_jsx(Input, { ref:
|
|
974
|
+
}, placement: "bottom-start", closeOnBlur: false, returnFocusOnClose: true, children: [_jsx(PopoverAnchor, { children: _jsx(Box, { ref: triggerRef, as: "div", children: _jsxs(InputGroup, { size: sizeKey, children: [_jsx(Input, { ref: mergedInputRef, ...ids.controlProps, name: name, size: sizeKey, placeholder: displayPlaceholder, value: displayValue, onChange: handleInputChange, onKeyDown: handleInputKeyDown, onPaste: handlePasteMask, onBlur: handleInputBlur, onClick: handleInputClickMask, onFocus: handleInputFocusMask, isDisabled: disabled, isInvalid: error, isRequired: isRequired, autoComplete: autoComplete, cursor: "text" }), _jsx(InputRightElement, { height: "100%", display: "flex", alignItems: "center", pointerEvents: "auto", children: _jsx(IconButton, { "aria-label": "Open calendar", variant: "ghost", size: "sm", minW: "auto", h: "auto", isDisabled: disabled, onClick: (e) => {
|
|
974
975
|
e.stopPropagation();
|
|
975
976
|
if (!isOpen) {
|
|
976
977
|
handleOpen();
|
|
@@ -991,4 +992,6 @@ export function SingleDatePicker(props) {
|
|
|
991
992
|
requestClose(null);
|
|
992
993
|
}, children: "Clear" }), _jsx(Button, { size: "sm", variant: "gradient", onClick: () => requestClose(), children: "Apply" })] })] }) }) })] }), _jsx(FieldMessage, { error: error, errorMessage: errorMessage, helperText: helperText, helperId: ids.helperId, errorId: ids.errorId })] }));
|
|
993
994
|
}
|
|
995
|
+
export const SingleDatePicker = forwardRef(SingleDatePickerInner);
|
|
996
|
+
SingleDatePicker.displayName = "SingleDatePicker";
|
|
994
997
|
export default SingleDatePicker;
|