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
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
2
3
|
import { isStringValueProps, } from "./DatePickerProps.js";
|
|
3
4
|
import { RangeDatePicker } from "./RangeDatePicker.js";
|
|
4
5
|
import { SingleDatePicker } from "./SingleDatePicker.js";
|
|
5
6
|
import { TimeOnlyPicker } from "./TimeOnlyPicker.js";
|
|
6
7
|
import { inferPickerTypeFromFormat } from "./pickerField.js";
|
|
7
|
-
|
|
8
|
+
function ThemeDatePickerInner(props, ref) {
|
|
8
9
|
var _a, _b;
|
|
9
10
|
if (props.isRange) {
|
|
10
|
-
return _jsx(RangeDatePicker, { ...props });
|
|
11
|
+
return _jsx(RangeDatePicker, { ref: ref, ...props });
|
|
11
12
|
}
|
|
12
13
|
const singleProps = props;
|
|
13
14
|
const dateFormat = (_a = singleProps.dateFormat) !== null && _a !== void 0 ? _a : "dd/MM/yyyy";
|
|
14
15
|
const pickerType = (_b = singleProps.pickerType) !== null && _b !== void 0 ? _b : inferPickerTypeFromFormat(dateFormat);
|
|
15
16
|
const isTime = pickerType === "time";
|
|
16
17
|
if (isStringValueProps(singleProps)) {
|
|
17
|
-
return isTime ? _jsx(TimeOnlyPicker, { ...singleProps }) : _jsx(SingleDatePicker, { ...singleProps });
|
|
18
|
+
return isTime ? _jsx(TimeOnlyPicker, { ref: ref, ...singleProps }) : _jsx(SingleDatePicker, { ref: ref, ...singleProps });
|
|
18
19
|
}
|
|
19
|
-
return isTime ? _jsx(TimeOnlyPicker, { ...singleProps }) : _jsx(SingleDatePicker, { ...singleProps });
|
|
20
|
+
return isTime ? _jsx(TimeOnlyPicker, { ref: ref, ...singleProps }) : _jsx(SingleDatePicker, { ref: ref, ...singleProps });
|
|
20
21
|
}
|
|
22
|
+
export const ThemeDatePicker = forwardRef(ThemeDatePickerInner);
|
|
23
|
+
ThemeDatePicker.displayName = "ThemeDatePicker";
|
|
21
24
|
export default ThemeDatePicker;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useMemo, useState, useRef } from "react";
|
|
2
|
+
import { forwardRef, useEffect, useMemo, useState, useRef } from "react";
|
|
3
3
|
import { Box, FormControl, Popover, PopoverBody, PopoverContent, PopoverAnchor, useDisclosure, Button as ChakraButton, } from "@chakra-ui/react";
|
|
4
4
|
import { addDays } from "date-fns";
|
|
5
5
|
import { isStringValueProps, } from "./DatePickerProps.js";
|
|
@@ -15,7 +15,7 @@ import { useExclusiveOverlay } from "../../Hooks/useExclusiveOverlay.js";
|
|
|
15
15
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
16
16
|
import { DEFAULT_CONTROL_SIZE } from "../../Theme/tokens/primitives/controlSizes.js";
|
|
17
17
|
const formatToPlaceholder = (formatStr) => formatStr.replace(/h{1,2}/gi, "HH").replace(/m{1,2}/gi, "mm").replace(/a{1,2}/gi, "AM");
|
|
18
|
-
|
|
18
|
+
function TimeOnlyPickerInner(props, ref) {
|
|
19
19
|
var _a, _b, _c, _d;
|
|
20
20
|
const { id, name, label, isRequired, isInformation, informationMessage, error, errorMessage, helperText, dateFormat = "HH:mm", width = "100%", disableToday = false, size = DEFAULT_CONTROL_SIZE, } = props;
|
|
21
21
|
const { isDisabled: disabled, placeholder: placeholderText } = resolvePickerAliases(props);
|
|
@@ -92,7 +92,7 @@ export function TimeOnlyPicker(props) {
|
|
|
92
92
|
};
|
|
93
93
|
}, [isOpen, onClose]);
|
|
94
94
|
const resolvedTempDate = tempDate !== null && tempDate !== void 0 ? tempDate : new Date((disableToday ? tomorrow : today).getFullYear(), (disableToday ? tomorrow : today).getMonth(), (disableToday ? tomorrow : today).getDate(), 0, 0, 0, 0);
|
|
95
|
-
return (_jsxs(FormControl, { id: ids.inputId, isDisabled: disabled, isInvalid: error, isRequired: isRequired, 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: onClose, placement: "bottom-start", closeOnBlur: false, returnFocusOnClose: false, children: [_jsx(PopoverAnchor, { children: _jsx(Box, { ref: triggerRef, as: "div", children: _jsx(Box, { ref: inputWrapperRef, children: _jsx(TimePickerInput, { value: tempDate, onChange: (date) => {
|
|
95
|
+
return (_jsxs(FormControl, { id: ids.inputId, isDisabled: disabled, isInvalid: error, isRequired: isRequired, 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: onClose, placement: "bottom-start", closeOnBlur: false, returnFocusOnClose: false, children: [_jsx(PopoverAnchor, { children: _jsx(Box, { ref: triggerRef, as: "div", children: _jsx(Box, { ref: inputWrapperRef, children: _jsx(TimePickerInput, { ref: ref, value: tempDate, onChange: (date) => {
|
|
96
96
|
handleTimeInputChange(date);
|
|
97
97
|
}, dateFormat: dateFormat, isDisabled: disabled, placeholder: placeholder, id: ids.inputId, name: name, isRequired: isRequired, describedBy: ids.describedBy, onFocus: () => {
|
|
98
98
|
if (!disabled && !isOpen)
|
|
@@ -101,4 +101,6 @@ export function TimeOnlyPicker(props) {
|
|
|
101
101
|
handleTimePickerChange(updatedDate);
|
|
102
102
|
} }), _jsxs(Box, { display: "flex", justifyContent: "space-between", mt: 4, pt: 4, borderTop: "1px solid", borderColor: theme.colors.boxborder[200], children: [_jsx(ChakraButton, { size: "sm", variant: "ghost", onClick: handleClear, children: "Clear" }), _jsx(ChakraButton, { size: "sm", colorScheme: "primary", onClick: handleOk, children: "OK" })] })] }) }) })] }), _jsx(FieldMessage, { error: error, errorMessage: errorMessage, helperText: helperText, helperId: ids.helperId, errorId: ids.errorId })] }));
|
|
103
103
|
}
|
|
104
|
+
export const TimeOnlyPicker = forwardRef(TimeOnlyPickerInner);
|
|
105
|
+
TimeOnlyPicker.displayName = "TimeOnlyPicker";
|
|
104
106
|
export default TimeOnlyPicker;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useRef, useEffect, useMemo, useCallback } from "react";
|
|
3
|
-
import { Box, Input, InputGroup, InputRightElement } from "@chakra-ui/react";
|
|
2
|
+
import { forwardRef, useState, useRef, useEffect, useMemo, useCallback } from "react";
|
|
3
|
+
import { Box, Input, InputGroup, InputRightElement, useMergeRefs } from "@chakra-ui/react";
|
|
4
4
|
import { format, parse, isValid } from "date-fns";
|
|
5
5
|
import { ClockIcon } from "lucide-react";
|
|
6
6
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
@@ -89,13 +89,14 @@ const caretFromDigitIndex = (digitIndex, digitsLen) => {
|
|
|
89
89
|
return digitIndex + 1;
|
|
90
90
|
};
|
|
91
91
|
const formatToPlaceholder = (formatStr) => formatStr.replace(/h{1,2}/gi, "HH").replace(/m{1,2}/gi, "mm").replace(/a{1,2}/gi, "AM");
|
|
92
|
-
/** Masked HH:mm digit input, no seconds
|
|
93
|
-
export const TimePickerInput = ({ value, onChange, dateFormat, isDisabled: disabled = false, placeholder, id, name, isRequired, describedBy, onFocus, onBlur, error, size = DEFAULT_CONTROL_SIZE, })
|
|
92
|
+
/** Masked HH:mm digit input, no seconds; `ref` is the `<input>`. */
|
|
93
|
+
export const TimePickerInput = forwardRef(function TimePickerInput({ value, onChange, dateFormat, isDisabled: disabled = false, placeholder, id, name, isRequired, describedBy, onFocus, onBlur, error, size = DEFAULT_CONTROL_SIZE, }, ref) {
|
|
94
94
|
const theme = useCustomTheme();
|
|
95
95
|
const sizeKey = typeof size === "string" ? size : DEFAULT_CONTROL_SIZE;
|
|
96
96
|
const iconPx = getTextInputIconSizePx(sizeKey);
|
|
97
97
|
const iconWrapperSx = getTextInputIconWrapperSx(sizeKey);
|
|
98
98
|
const inputRef = useRef(null);
|
|
99
|
+
const mergedRef = useMergeRefs(inputRef, ref);
|
|
99
100
|
const [digits, setDigits] = useState("");
|
|
100
101
|
const digitsRef = useRef("");
|
|
101
102
|
const [, setIsFocused] = useState(false);
|
|
@@ -402,5 +403,6 @@ export const TimePickerInput = ({ value, onChange, dateFormat, isDisabled: disab
|
|
|
402
403
|
inputRef.current.value = is12Hour && formatted ? `${formatted} ${ampm}` : formatted;
|
|
403
404
|
}
|
|
404
405
|
}, [digits, ampm, is12Hour]);
|
|
405
|
-
return (_jsxs(InputGroup, { size: sizeKey, children: [_jsx(Input, { ref:
|
|
406
|
-
};
|
|
406
|
+
return (_jsxs(InputGroup, { size: sizeKey, children: [_jsx(Input, { ref: mergedRef, id: id, name: name, isRequired: isRequired, "aria-describedby": describedBy, defaultValue: "", onChange: handleInput, onKeyDown: handleKeyDown, onFocus: handleFocus, onBlur: handleBlur, onClick: handleClick, onPaste: handlePaste, placeholder: placeholderText, isDisabled: disabled, autoComplete: "off", isInvalid: error, size: sizeKey }), _jsx(InputRightElement, { pointerEvents: "none", height: "100%", display: "flex", alignItems: "center", children: _jsx(Box, { as: "span", sx: iconWrapperSx, children: _jsx(ClockIcon, { size: iconPx, color: theme.colors.textMuted }) }) })] }));
|
|
407
|
+
});
|
|
408
|
+
TimePickerInput.displayName = "TimePickerInput";
|
|
@@ -7,13 +7,13 @@ const DEFAULT_COLUMNS = { base: 1, md: 2 };
|
|
|
7
7
|
const toTemplateColumns = (columns) => Object.fromEntries(Object.entries(columns).map(([bp, count]) => [bp, `repeat(${count}, minmax(0, 1fr))`]));
|
|
8
8
|
const isMissing = (value) => value === null || value === undefined || value === "";
|
|
9
9
|
/** Label/value read grid: semantic dl/dt/dd, "stacked" (label above) or "inline" (label left, value right). */
|
|
10
|
-
const DescriptionList = ({ items, columns = DEFAULT_COLUMNS, layout = "stacked", emptyValue = "—", isLoading = false, loadingRows = 6, }) => {
|
|
10
|
+
const DescriptionList = ({ items, columns = DEFAULT_COLUMNS, layout = "stacked", emptyValue = "—", isLoading = false, loadingRows = 6, ...rest }) => {
|
|
11
11
|
const { colors } = useCustomTheme();
|
|
12
12
|
const templateColumns = toTemplateColumns(columns);
|
|
13
13
|
if (isLoading) {
|
|
14
|
-
return (_jsx(Grid, { role: "group", "aria-busy": "true", "aria-label": "Loading", templateColumns: templateColumns, columnGap: 5, rowGap: 4, children: Array.from({ length: loadingRows }, (_, index) => (_jsxs(Flex, { direction: "column", gap: 1.5, children: [_jsx(Skeletons, { type: "skeleton", height: 3, width: "40%" }), _jsx(Skeletons, { type: "skeleton", height: 4, width: "75%" })] }, index))) }));
|
|
14
|
+
return (_jsx(Grid, { ...rest, role: "group", "aria-busy": "true", "aria-label": "Loading", templateColumns: templateColumns, columnGap: 5, rowGap: 4, children: Array.from({ length: loadingRows }, (_, index) => (_jsxs(Flex, { direction: "column", gap: 1.5, children: [_jsx(Skeletons, { type: "skeleton", height: 3, width: "40%" }), _jsx(Skeletons, { type: "skeleton", height: 4, width: "75%" })] }, index))) }));
|
|
15
15
|
}
|
|
16
|
-
return (_jsx(Grid, { as: "dl", m: 0, templateColumns: templateColumns, columnGap: 5, rowGap: 4, children: items.map((item, index) => {
|
|
16
|
+
return (_jsx(Grid, { ...rest, as: "dl", m: 0, templateColumns: templateColumns, columnGap: 5, rowGap: 4, children: items.map((item, index) => {
|
|
17
17
|
const displayValue = isMissing(item.value) ? emptyValue : item.value;
|
|
18
18
|
const canCopy = item.copyable && typeof item.value === "string" && item.value !== "";
|
|
19
19
|
const copyTooltip = typeof item.label === "string" ? `Copy ${item.label}` : "Copy";
|
|
@@ -11,6 +11,7 @@ import { rafThrottle } from "../../Utils/rafThrottle.js";
|
|
|
11
11
|
import { BUTTON_SIZES } from "../../Theme/tokens/primitives/controlSizes.js";
|
|
12
12
|
import { optionRowSpec, OPTION_ROW_RADIUS } from "../../Theme/tokens/primitives/optionRowSizes.js";
|
|
13
13
|
import { transitionFor } from "../../Theme/tokens/primitives/motion.js";
|
|
14
|
+
import { BORDER_WIDTHS } from "../../Theme/tokens/primitives/borderWidths.js";
|
|
14
15
|
import { reducedMotionSx } from "../../Theme/chakra/motion.js";
|
|
15
16
|
import { focusVisibleStyles } from "../../Theme/chakra/focusRing.styles.js";
|
|
16
17
|
const MotionBox = motion(forwardRef((props, ref) => (_jsx(Box, { ref: ref, ...props }))));
|
|
@@ -204,6 +205,8 @@ const Dropdown = forwardRef(({ dropDownButtonStyle, ButtonText, options, handleO
|
|
|
204
205
|
};
|
|
205
206
|
}, [isOpen, updateMenuPos]);
|
|
206
207
|
useEffect(() => {
|
|
208
|
+
if (!isOpen)
|
|
209
|
+
return;
|
|
207
210
|
const handleClickOutside = (event) => {
|
|
208
211
|
var _a, _b;
|
|
209
212
|
const target = event.target;
|
|
@@ -218,7 +221,7 @@ const Dropdown = forwardRef(({ dropDownButtonStyle, ButtonText, options, handleO
|
|
|
218
221
|
return () => {
|
|
219
222
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
220
223
|
};
|
|
221
|
-
}, [onClose]);
|
|
224
|
+
}, [isOpen, onClose]);
|
|
222
225
|
const setMenuRef = (node) => {
|
|
223
226
|
menuRef.current = node;
|
|
224
227
|
if (typeof ref === "function")
|
|
@@ -237,7 +240,7 @@ const Dropdown = forwardRef(({ dropDownButtonStyle, ButtonText, options, handleO
|
|
|
237
240
|
};
|
|
238
241
|
const DropdownContentRender = () => {
|
|
239
242
|
const hoverTint = rowBackgrounds.active;
|
|
240
|
-
return (_jsx(List, { id: menuId, role: "menu", onKeyDown: handleMenuKeyDown, bg: theme.colors.surfaceRaised, border:
|
|
243
|
+
return (_jsx(List, { id: menuId, role: "menu", onKeyDown: handleMenuKeyDown, bg: theme.colors.surfaceRaised, border: `${BORDER_WIDTHS.hairline} solid ${theme.colors.boxborder[200]}`, borderRadius: "xl", boxShadow: theme.shadows.lg, py: 1.5, mt: "0.375rem", minWidth: s.minW, maxH: "18rem", overflowY: "auto", overflowX: "hidden", sx: scrollbarStyles(theme.colors, "overlay"), style: ListStyle, children: options.map((option, index) => (_jsxs(ListItem, { ref: (node) => {
|
|
241
244
|
itemRefs.current[index] = node;
|
|
242
245
|
}, role: "menuitem", tabIndex: index === activeIndex ? 0 : -1, onClick: () => {
|
|
243
246
|
handleListItemClick(option.id, option.label);
|
|
@@ -254,10 +257,15 @@ const Dropdown = forwardRef(({ dropDownButtonStyle, ButtonText, options, handleO
|
|
|
254
257
|
color: theme.colors.accentText,
|
|
255
258
|
boxShadow: `inset 0 0 0 2px ${theme.colors.focusRing.ring}`,
|
|
256
259
|
}, borderBottom: divider
|
|
257
|
-
?
|
|
260
|
+
? `${BORDER_WIDTHS.hairline} solid ${theme.colors.boxborder[200]}`
|
|
258
261
|
: undefined, sx: { "&:last-child": { borderBottom: "none" }, ...reducedMotionSx() }, style: ItemStyle, fontWeight: 500, children: [option.image && (_jsx(Box, { as: option.image, boxSize: s.img, flexShrink: 0, color: theme.colors.textMuted, style: ImageStyle })), _jsx(Box, { as: "span", fontSize: rowSpec.fontSize, isTruncated: true, style: LabelStyle, children: option.label })] }, option.id))) }));
|
|
259
262
|
};
|
|
260
|
-
return (_jsxs(Box, { ref: dropdownRef, position: "relative", display: "inline-block", children: [dropDownToggleOption(), isOpen && (_jsx(Portal, { children: _jsx(MotionBox, { ref: setMenuRef, position: "fixed",
|
|
263
|
+
return (_jsxs(Box, { ref: dropdownRef, position: "relative", display: "inline-block", children: [dropDownToggleOption(), isOpen && (_jsx(Portal, { children: _jsx(MotionBox, { ref: setMenuRef, position: "fixed", zIndex: "popover", initial: prefersReducedMotion ? false : { opacity: 0, y: -6 }, animate: { opacity: 1, y: 0 }, exit: { opacity: 0, y: -6 }, style: {
|
|
264
|
+
top: `${menuPos.top}px`,
|
|
265
|
+
left: `${menuPos.left}px`,
|
|
266
|
+
minWidth: `${menuPos.width}px`,
|
|
267
|
+
...headStyle,
|
|
268
|
+
}, children: DropdownContentRender() }) }))] }));
|
|
261
269
|
});
|
|
262
270
|
Dropdown.displayName = "Dropdown";
|
|
263
271
|
export default Dropdown;
|
|
@@ -2,9 +2,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { HStack, PinInput, PinInputField, Box, Text, Button, Flex, } from "@chakra-ui/react";
|
|
3
3
|
import { useCustomTheme } from "../../../Theme/useCustomTheme.js";
|
|
4
4
|
import { fieldFocusVisible } from "../../../Theme/chakra/focusRing.styles.js";
|
|
5
|
+
import { BORDER_WIDTHS } from "../../../Theme/tokens/primitives/borderWidths.js";
|
|
5
6
|
import { MailCheck } from "lucide-react";
|
|
6
7
|
/** Full verification card (icon, title, description, resend link, digits-only PinInput) — for a bare OTP field in your own layout, use PinInput instead. */
|
|
7
8
|
export default function VerifyEmailOtp({ resendMail, onChange, onComplete, placeholder = "", pins = 5, description, title, isDisabled = false, isInvalid = false, styles, }) {
|
|
8
9
|
const theme = useCustomTheme();
|
|
9
|
-
return (_jsxs(Box, { style: styles, display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", p: 6, w: "100%", maxW: "25rem", mx: "auto", bg: theme.colors.background[50], border: "1px solid", borderColor: theme.colors.boxborder[200], borderRadius: "xl", children: [_jsx(Box, { mb: 4, children: _jsx(MailCheck, { size: 80, color: theme.colors.accentText }) }), _jsx(Text, { fontSize: "2xl", fontWeight:
|
|
10
|
+
return (_jsxs(Box, { style: styles, display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", p: 6, w: "100%", maxW: "25rem", mx: "auto", bg: theme.colors.background[50], border: "1px solid", borderColor: theme.colors.boxborder[200], borderRadius: "xl", children: [_jsx(Box, { mb: 4, children: _jsx(MailCheck, { size: 80, color: theme.colors.accentText }) }), _jsx(Text, { fontSize: "2xl", fontWeight: 700, mb: 2, textAlign: "center", children: title }), _jsxs(Text, { fontSize: "md", textAlign: "center", color: theme.colors.textMuted, mb: 6, children: [description, _jsx("br", {}), "your new Pixel Account"] }), _jsx(HStack, { spacing: 3, mb: 6, role: "group", "aria-label": title || "Verification code", children: _jsx(PinInput, { placeholder: placeholder, onChange: onChange, onComplete: onComplete, isDisabled: isDisabled, isInvalid: isInvalid, size: "lg", focusBorderColor: theme.colors.primary[500], children: Array.from({ length: pins }).map((_, index) => (_jsx(PinInputField, { "aria-label": `${title || "Verification code"}, digit ${index + 1} of ${pins}`, borderRadius: "lg", border: `${BORDER_WIDTHS.hairline} solid`, borderColor: theme.colors.boxborder[500], backgroundColor: theme.colors.background[200], _focus: { borderColor: theme.colors.primary[500], ...fieldFocusVisible(theme.colors) } }, index))) }) }), _jsx(Flex, { justify: "center", children: _jsxs(Text, { fontSize: "sm", color: theme.colors.textMuted, children: ["Didn\u2019t receive the code?", " ", _jsx(Button, { variant: "link", color: theme.colors.accentText, fontWeight: 600, onClick: resendMail, children: "Resend Code" })] }) })] }));
|
|
10
11
|
}
|
|
@@ -21,7 +21,7 @@ const scaleFor = (colors, scheme) => scheme === "primary" || scheme === "seconda
|
|
|
21
21
|
? colors.gray
|
|
22
22
|
: colors.semantic[scheme];
|
|
23
23
|
/** Centered empty/zero-data placeholder — purely decorative; pass `action` for any real button(s)/CTA. */
|
|
24
|
-
const EmptyState = ({ title = "No data found", titleAs = "h3", description, icon: IconComp = Inbox, image, imageAlt = "", size = "md", colorScheme = "primary", variant = "default", action, animate = false, minH = "15rem", sx, }) => {
|
|
24
|
+
const EmptyState = ({ title = "No data found", titleAs = "h3", description, icon: IconComp = Inbox, image, imageAlt = "", size = "md", colorScheme = "primary", variant = "default", action, animate = false, minH = "15rem", sx, ...rest }) => {
|
|
25
25
|
const theme = useCustomTheme();
|
|
26
26
|
const s = sizeMap[size];
|
|
27
27
|
const hasDescription = description !== undefined && description !== null && description !== false && description !== "";
|
|
@@ -39,7 +39,7 @@ const EmptyState = ({ title = "No data found", titleAs = "h3", description, icon
|
|
|
39
39
|
bg: "transparent",
|
|
40
40
|
}
|
|
41
41
|
: {};
|
|
42
|
-
return (_jsxs(Flex, { direction: "column", align: "center", justify: "center", textAlign: "center", minH: minH, px: s.pad, py: s.pad, gap: s.gap, width: "100%", sx: { ...containerStyles, ...sx }, children: [image ? (_jsx(Image, { src: image, alt: imageAlt, boxSize: s.badge, objectFit: "contain", animation: animate ? `${float} 3s ease-in-out infinite` : undefined, sx: reducedMotionSx() })) : (_jsx(Flex, { align: "center", justify: "center", boxSize: s.badge, borderRadius: "full", bg: accentSoft, color: accent, animation: animate ? `${float} 3s ease-in-out infinite` : undefined, position: "relative", isolation: "isolate", _before: {
|
|
42
|
+
return (_jsxs(Flex, { ...rest, direction: "column", align: "center", justify: "center", textAlign: "center", minH: minH, px: s.pad, py: s.pad, gap: s.gap, width: "100%", sx: { ...containerStyles, ...sx }, children: [image ? (_jsx(Image, { src: image, alt: imageAlt, boxSize: s.badge, objectFit: "contain", animation: animate ? `${float} 3s ease-in-out infinite` : undefined, sx: reducedMotionSx() })) : (_jsx(Flex, { align: "center", justify: "center", boxSize: s.badge, borderRadius: "full", bg: accentSoft, color: accent, animation: animate ? `${float} 3s ease-in-out infinite` : undefined, position: "relative", isolation: "isolate", _before: {
|
|
43
43
|
content: '""',
|
|
44
44
|
position: "absolute",
|
|
45
45
|
inset: "-0.5rem",
|
|
@@ -6,12 +6,28 @@ import { Upload, FileText, Eye } from "lucide-react";
|
|
|
6
6
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
7
7
|
import { accentTextOnCanvas } from "../../Theme/tokens/builders/accentText.js";
|
|
8
8
|
import { DEFAULT_MAX_SIZE_KB, mimeMap, toMB } from "./constants.js";
|
|
9
|
+
import { useObjectUrl } from "./useObjectUrl.js";
|
|
9
10
|
import Modal, { ModalBody, ModalHeader } from "../Modal/Modal.js";
|
|
10
11
|
import { TextLabel } from "../Common/FormLabel.js";
|
|
11
12
|
import FieldMessage from "../Common/FieldMessage.js";
|
|
12
13
|
import { useFieldIds } from "../Common/useFieldIds.js";
|
|
13
14
|
import { FIELD_RADIUS, FIELD_TRANSITION } from "../Common/fieldStyles.js";
|
|
14
15
|
import { focusVisibleStyles } from "../../Theme/chakra/focusRing.styles.js";
|
|
16
|
+
import { BORDER_WIDTHS } from "../../Theme/tokens/primitives/borderWidths.js";
|
|
17
|
+
const FileThumbnail = ({ file, radius, onPreview, }) => {
|
|
18
|
+
const url = useObjectUrl(file);
|
|
19
|
+
return (_jsxs(Box, { boxSize: "2.5rem", cursor: "pointer", position: "relative", _hover: {
|
|
20
|
+
".hover-icon": {
|
|
21
|
+
opacity: 1,
|
|
22
|
+
bg: "blackAlpha.500",
|
|
23
|
+
},
|
|
24
|
+
}, onClick: () => url && onPreview(url), children: [_jsx("img", { src: url, alt: file.name, style: {
|
|
25
|
+
width: "100%",
|
|
26
|
+
height: "100%",
|
|
27
|
+
objectFit: "cover",
|
|
28
|
+
borderRadius: radius,
|
|
29
|
+
} }), _jsx(Box, { className: "hover-icon", position: "absolute", top: "0.5rem", left: "0.5rem", opacity: 0, children: _jsx(Eye, { color: "white" }) })] }));
|
|
30
|
+
};
|
|
15
31
|
/** Controlled drop zone — you own the `uploadedFiles`/File[] state; `maxSizeKB` defaults to 5 MB. */
|
|
16
32
|
const FileUpload = ({ onFilesUploaded, uploadedFiles, onRemoveFile, acceptTypes = [".jpg", ".png"], maxSizeKB = DEFAULT_MAX_SIZE_KB, maxFiles = undefined, progress = {}, size = "md", inputAriaLabel = "Upload files", id, label, isRequired = false, isDisabled = false, error = false, errorMessage, helperText, }) => {
|
|
17
33
|
const ids = useFieldIds(id, { error, errorMessage, helperText });
|
|
@@ -66,29 +82,19 @@ const FileUpload = ({ onFilesUploaded, uploadedFiles, onRemoveFile, acceptTypes
|
|
|
66
82
|
"aria-label": label !== null && label !== void 0 ? label : inputAriaLabel,
|
|
67
83
|
"aria-describedby": ids.describedBy,
|
|
68
84
|
"aria-disabled": isDisabled || undefined,
|
|
69
|
-
}), border: "1px dashed", borderColor: border, borderRadius: FIELD_RADIUS, p: compact ? 3 : 10, textAlign: "center", bg: isDisabled ? colors.background[100] : colors.background[50], color: isDisabled ? colors.textMuted : undefined, cursor: isDisabled ? "not-allowed" : "pointer", transition: FIELD_TRANSITION, _hover: isDisabled ? undefined : { bg: colors.background[100] }, sx: focusVisibleStyles(colors), position: "relative", children: _jsxs(Stack, { direction: compact ? "row" : "column", spacing: compact ? 3 : 2, align: "center", justify: "center", children: [_jsx(Icon, { as: Upload, boxSize: compact ? 4 : 6 }), _jsxs(Stack, { spacing: 0, align: compact ? "start" : "center", children: [_jsx(Text, { fontWeight:
|
|
85
|
+
}), border: "1px dashed", borderColor: border, borderRadius: FIELD_RADIUS, p: compact ? 3 : 10, textAlign: "center", bg: isDisabled ? colors.background[100] : colors.background[50], color: isDisabled ? colors.textMuted : undefined, cursor: isDisabled ? "not-allowed" : "pointer", transition: FIELD_TRANSITION, _hover: isDisabled ? undefined : { bg: colors.background[100] }, sx: focusVisibleStyles(colors), position: "relative", children: _jsxs(Stack, { direction: compact ? "row" : "column", spacing: compact ? 3 : 2, align: "center", justify: "center", children: [_jsx(Icon, { as: Upload, boxSize: compact ? 4 : 6 }), _jsxs(Stack, { spacing: 0, align: compact ? "start" : "center", children: [_jsx(Text, { fontWeight: 500, fontSize: compact ? "sm" : "md", color: colors.textMuted, children: "Drag and drop files here" }), _jsxs(Text, { fontSize: compact ? "xs" : "sm", color: colors.textMuted, children: [acceptTypes.join(", "), " up to ", toMB(maxSizeKB), " ", maxFiles ? `- ${maxFiles} file(s) max` : ""] })] })] }) }), _jsx("input", { ...getInputProps({
|
|
70
86
|
id: ids.inputId,
|
|
71
87
|
disabled: isDisabled,
|
|
72
88
|
"aria-label": label ? undefined : inputAriaLabel,
|
|
73
89
|
"aria-describedby": ids.describedBy,
|
|
74
|
-
}) }), _jsx(FieldMessage, { error: error, errorMessage: errorMessage, helperText: helperText, helperId: ids.helperId, errorId: ids.errorId })] }), errors.length > 0 && (_jsx(Box, { children: errors.map((err, idx) => (_jsx(Text, { fontSize: "sm", color: colors.semanticText.error, children: err }, idx))) })), uploadedFiles.length > 0 && (_jsxs(Box, { children: [_jsx(Box, { display: "flex", alignItems: "center", gap: 2, children: _jsx(Text, { fontFamily: "open-sans, sans-serif", fontWeight: 600, fontSize:
|
|
75
|
-
|
|
76
|
-
opacity: 1,
|
|
77
|
-
bg: "blackAlpha.500",
|
|
78
|
-
},
|
|
79
|
-
}, onClick: () => {
|
|
80
|
-
setPreviewUrl(URL.createObjectURL(file));
|
|
90
|
+
}) }), _jsx(FieldMessage, { error: error, errorMessage: errorMessage, helperText: helperText, helperId: ids.helperId, errorId: ids.errorId })] }), errors.length > 0 && (_jsx(Box, { children: errors.map((err, idx) => (_jsx(Text, { fontSize: "sm", color: colors.semanticText.error, children: err }, idx))) })), uploadedFiles.length > 0 && (_jsxs(Box, { children: [_jsx(Box, { display: "flex", alignItems: "center", gap: 2, children: _jsx(Text, { fontFamily: "open-sans, sans-serif", fontWeight: 600, fontSize: "sm", lineHeight: "100%", letterSpacing: "4%", textTransform: "uppercase", py: 4, children: "Uploaded Files" }) }), _jsx(List, { spacing: 2, children: uploadedFiles.map((file, index) => (_jsxs(ListItem, { borderWidth: BORDER_WIDTHS.hairline, borderRadius: "md", px: 3, py: 2, bg: colors.background[50], children: [_jsxs(Box, { display: "flex", justifyContent: "space-between", alignItems: "center", children: [_jsxs(HStack, { spacing: 3, flex: "1", children: [file.type.startsWith("image/") ? (_jsx(FileThumbnail, { file: file, radius: radii.base, onPreview: (url) => {
|
|
91
|
+
setPreviewUrl(url);
|
|
81
92
|
setPreviewTitle(file.name);
|
|
82
93
|
onOpen();
|
|
83
|
-
}, children: [_jsx("
|
|
84
|
-
width: "100%",
|
|
85
|
-
height: "100%",
|
|
86
|
-
objectFit: "cover",
|
|
87
|
-
borderRadius: radii.base,
|
|
88
|
-
} }), _jsx(Box, { className: "hover-icon", position: "absolute", top: "0.5rem", left: "0.5rem", opacity: 0, children: _jsx(Eye, { color: "white" }) })] })) : (_jsx(ListIcon, { as: FileText, color: accentTextOnCanvas(colors.blue, colors.background[50]), boxSize: 8 })), _jsxs(VStack, { align: "start", spacing: 0, flex: "1", children: [_jsx(Text, { fontSize: "sm", noOfLines: 1, children: file.name }), _jsxs(Text, { fontSize: "xs", color: colors.textMuted, children: [toMB(file.size / 1024), " \u2022", " ", file.type || "Unknown type"] })] })] }), onRemoveFile && (_jsx(CloseButton, { onClick: () => onRemoveFile(file), size: "sm", color: colors.semanticText.error }))] }), (progress === null || progress === void 0 ? void 0 : progress[file.name]) !== undefined && (_jsx(Progress, { value: progress === null || progress === void 0 ? void 0 : progress[file.name], size: "xs", mt: 1, hasStripe: (progress === null || progress === void 0 ? void 0 : progress[file.name]) < 100, isAnimated: (progress === null || progress === void 0 ? void 0 : progress[file.name]) < 100, colorScheme: (progress === null || progress === void 0 ? void 0 : progress[file.name]) >= 100 ? "green" : "blue", borderRadius: "md" }))] }, index))) })] }))] }), _jsxs(Modal, { isOpen: isOpen, onClose: () => {
|
|
94
|
+
} })) : (_jsx(ListIcon, { as: FileText, color: accentTextOnCanvas(colors.blue, colors.background[50]), boxSize: 8 })), _jsxs(VStack, { align: "start", spacing: 0, flex: "1", children: [_jsx(Text, { fontSize: "sm", noOfLines: 1, children: file.name }), _jsxs(Text, { fontSize: "xs", color: colors.textMuted, children: [toMB(file.size / 1024), " \u2022", " ", file.type || "Unknown type"] })] })] }), onRemoveFile && (_jsx(CloseButton, { onClick: () => onRemoveFile(file), size: "sm", color: colors.semanticText.error }))] }), (progress === null || progress === void 0 ? void 0 : progress[file.name]) !== undefined && (_jsx(Progress, { value: progress === null || progress === void 0 ? void 0 : progress[file.name], size: "xs", mt: 1, hasStripe: (progress === null || progress === void 0 ? void 0 : progress[file.name]) < 100, isAnimated: (progress === null || progress === void 0 ? void 0 : progress[file.name]) < 100, colorScheme: (progress === null || progress === void 0 ? void 0 : progress[file.name]) >= 100 ? "green" : "blue", borderRadius: "md" }))] }, index))) })] }))] }), _jsxs(Modal, { isOpen: isOpen, onClose: () => {
|
|
89
95
|
onClose();
|
|
90
96
|
setPreviewUrl(null);
|
|
91
97
|
setPreviewTitle(null);
|
|
92
|
-
}, size: "xl", isCentered: true, children: [_jsx(ModalHeader, { children: _jsx(Text, { fontFamily: "open-sans, sans-serif", fontWeight: 600, fontSize:
|
|
98
|
+
}, size: "xl", isCentered: true, children: [_jsx(ModalHeader, { children: _jsx(Text, { fontFamily: "open-sans, sans-serif", fontWeight: 600, fontSize: "md", textTransform: "uppercase", children: previewTitle }) }), _jsx(ModalBody, { children: previewUrl && (_jsx(Image, { src: previewUrl, alt: "Preview", w: "100%", h: "auto", objectFit: "contain" })) })] })] }));
|
|
93
99
|
};
|
|
94
100
|
export default FileUpload;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
export const useObjectUrl = (file) => {
|
|
3
|
+
const [url, setUrl] = useState();
|
|
4
|
+
useEffect(() => {
|
|
5
|
+
const created = URL.createObjectURL(file);
|
|
6
|
+
setUrl(created);
|
|
7
|
+
return () => URL.revokeObjectURL(created);
|
|
8
|
+
}, [file]);
|
|
9
|
+
return url;
|
|
10
|
+
};
|
|
@@ -7,6 +7,7 @@ import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
|
7
7
|
import { accentTextOnCanvas } from "../../Theme/tokens/builders/accentText.js";
|
|
8
8
|
import { FIELD_RADIUS } from "../Common/fieldStyles.js";
|
|
9
9
|
import { transitionFor } from "../../Theme/tokens/primitives/motion.js";
|
|
10
|
+
import { focusVisibleRing } from "../../Theme/chakra/focusRing.styles.js";
|
|
10
11
|
/** Self-contained widget; onFilesChange returns {id,name,size,previewUrl} metadata, never real File objects — cannot be used to upload bytes. */
|
|
11
12
|
const FileUploader = ({ maxFiles = 10, maxTotalSize = 20, onFilesChange, acceptTypes = ["jpeg", "jpg", "png"], }) => {
|
|
12
13
|
const { showToast } = useToaster();
|
|
@@ -71,9 +72,14 @@ const FileUploader = ({ maxFiles = 10, maxTotalSize = 20, onFilesChange, acceptT
|
|
|
71
72
|
const handleBrowseClick = () => { var _a; return (_a = fileInputRef.current) === null || _a === void 0 ? void 0 : _a.click(); };
|
|
72
73
|
// ✅ Convert ["png","pdf","zip"] → ".png,.pdf,.zip" for input accept
|
|
73
74
|
const acceptString = acceptTypes.map((ext) => `.${ext}`).join(",");
|
|
74
|
-
return (_jsxs(Box, { maxW: "500px", mx: "auto", p: 6, children: [_jsxs(Text, { fontSize: "sm", color: colors.textMuted, mb: 4, children: ["Files Uploaded:", " ", _jsxs(Text, { as: "span", fontWeight:
|
|
75
|
+
return (_jsxs(Box, { maxW: "500px", mx: "auto", p: 6, children: [_jsxs(Text, { fontSize: "sm", color: colors.textMuted, mb: 4, children: ["Files Uploaded:", " ", _jsxs(Text, { as: "span", fontWeight: 500, color: accentColor, children: [uploadedFiles.length, " / ", maxFiles] }), " ", "| Total size:", " ", _jsxs(Text, { as: "span", fontWeight: 500, children: [formatFileSize(totalSize), " / ", maxTotalSize, " MB"] })] }), _jsxs(Box, { "data-testid": "file-uploader-dropzone", border: "1px dashed", borderColor: isDragOver ? colors.primary[500] : colors.boxborder[500], bg: isDragOver ? colors.backgroundColor.muted : undefined, borderRadius: FIELD_RADIUS, transition: transitionFor(["border-color", "background-color"]), p: 1, mt: 1, mb: 1, children: [uploadedFiles.length > 0 && (_jsx(Box, { children: _jsx(Grid, { templateColumns: "repeat(2, 1fr)", gap: 3, children: uploadedFiles.map((file) => {
|
|
75
76
|
var _a;
|
|
76
|
-
return (_jsxs(Flex, { align: "center", justify: "space-between", border: "1px solid", borderColor: colors.boxborder[500], borderRadius: "md", pl: 1, bg: colors.backgroundColor.secondary, children: [_jsxs(HStack, { spacing: 3, flex: "1", minW: "0", children: [file.previewUrl ? (_jsx(Image, { src: file.previewUrl, alt: file.name, boxSize: "28px", borderRadius: "sm", objectFit: "cover" })) : (_jsx(Box, { boxSize: "28px", borderRadius: "sm", bg: colors.backgroundColor.muted, display: "flex", alignItems: "center", justifyContent: "center", fontSize: "xs", color: colors.textMuted, children: (_a = file.name.split(".").pop()) === null || _a === void 0 ? void 0 : _a.toUpperCase() })), _jsxs(Box, { minW: "0", children: [_jsx(Text, { fontSize: "sm", fontWeight:
|
|
77
|
-
}) }) })), _jsx("input", { ref: fileInputRef, type: "file", multiple: true, accept: acceptString, onChange: handleFileInput, style: { display: "none" } }), _jsxs(Box, { "data-testid": "file-uploader-drop-target", p: uploadedFiles.length ? 0 : 5, mb: 2, textAlign: uploadedFiles.length ? "left" : "center", pt: uploadedFiles.length ? 5 : 5, onDrop: handleDrop, onDragOver: handleDragOver, onDragLeave: handleDragLeave, cursor: "pointer",
|
|
77
|
+
return (_jsxs(Flex, { align: "center", justify: "space-between", border: "1px solid", borderColor: colors.boxborder[500], borderRadius: "md", pl: 1, bg: colors.backgroundColor.secondary, children: [_jsxs(HStack, { spacing: 3, flex: "1", minW: "0", children: [file.previewUrl ? (_jsx(Image, { src: file.previewUrl, alt: file.name, boxSize: "28px", borderRadius: "sm", objectFit: "cover" })) : (_jsx(Box, { boxSize: "28px", borderRadius: "sm", bg: colors.backgroundColor.muted, display: "flex", alignItems: "center", justifyContent: "center", fontSize: "xs", color: colors.textMuted, children: (_a = file.name.split(".").pop()) === null || _a === void 0 ? void 0 : _a.toUpperCase() })), _jsxs(Box, { minW: "0", children: [_jsx(Text, { fontSize: "sm", fontWeight: 500, noOfLines: 1, children: file.name }), _jsxs(Text, { fontSize: "xs", color: colors.textMuted, children: ["(", formatFileSize(file.size), ")"] })] })] }), _jsx(HStack, { spacing: 1, children: _jsx(Tooltip, { label: "Remove", children: _jsx(IconButton, { "aria-label": "Remove", icon: _jsx(X, { size: 14 }), size: "xs", variant: "ghost", colorScheme: "red", onClick: () => removeFile(file.id) }) }) })] }, file.id));
|
|
78
|
+
}) }) })), _jsx("input", { ref: fileInputRef, type: "file", multiple: true, accept: acceptString, onChange: handleFileInput, style: { display: "none" } }), _jsxs(Box, { "data-testid": "file-uploader-drop-target", p: uploadedFiles.length ? 0 : 5, mb: 2, textAlign: uploadedFiles.length ? "left" : "center", pt: uploadedFiles.length ? 5 : 5, onDrop: handleDrop, onDragOver: handleDragOver, onDragLeave: handleDragLeave, cursor: "pointer", role: "button", tabIndex: 0, _focusVisible: focusVisibleRing(colors), onClick: handleBrowseClick, onKeyDown: (e) => {
|
|
79
|
+
if (e.key !== "Enter" && e.key !== " ")
|
|
80
|
+
return;
|
|
81
|
+
e.preventDefault();
|
|
82
|
+
handleBrowseClick();
|
|
83
|
+
}, children: [_jsx(Box, { children: _jsxs(Text, { fontWeight: 500, fontSize: "md", children: ["Drag and drop the files here, or", _jsx(Box, { as: "span", color: accentColor, ml: 1, children: "Click here" })] }) }), _jsxs(Text, { fontSize: "xs", color: colors.textMuted, children: ["Supported formats: ", acceptTypes.map((t) => t.toUpperCase()).join(", "), "."] })] })] })] }));
|
|
78
84
|
};
|
|
79
85
|
export default FileUploader;
|
|
@@ -5,8 +5,8 @@ import Tag from "../Tag/Tag.js";
|
|
|
5
5
|
import Button from "../Button/Button.js";
|
|
6
6
|
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
7
7
|
/** Toolbar row: search + filter controls left, summary + actions right, active filters as chips below. */
|
|
8
|
-
const FilterBar = ({ search, searchLabel = "Search", children, actions, summary, activeFilters = [], onRemoveFilter, onClearAll, }) => {
|
|
8
|
+
const FilterBar = ({ search, searchLabel = "Search", children, actions, summary, activeFilters = [], onRemoveFilter, onClearAll, ...rest }) => {
|
|
9
9
|
const { colors } = useCustomTheme();
|
|
10
|
-
return (_jsxs(Flex, { direction: "column", gap: 2, w: "100%", children: [_jsxs(Flex, { gap: 3, wrap: "wrap", align: "center", children: [search && (_jsx(Flex, { role: "search", "aria-label": searchLabel, children: search })), children, _jsxs(Flex, { gap: 2, align: "center", wrap: "wrap", ml: { base: 0, md: "auto" }, children: [summary && (_jsx(Text, { fontSize: "xs", color: colors.textMuted, whiteSpace: "nowrap", children: summary })), actions] })] }), activeFilters.length > 0 && (_jsxs(Flex, { gap: 1.5, wrap: "wrap", align: "center", children: [activeFilters.map((filter) => (_jsx(Tag, { label: filter.label, colorScheme: "gray", icon: onRemoveFilter ? X : undefined, onIconClick: onRemoveFilter ? () => onRemoveFilter(filter.id) : undefined }, filter.id))), onClearAll && _jsx(Button, { variant: "ghost", colorScheme: "gray", label: "Clear all", onClick: onClearAll })] }))] }));
|
|
10
|
+
return (_jsxs(Flex, { ...rest, direction: "column", gap: 2, w: "100%", children: [_jsxs(Flex, { gap: 3, wrap: "wrap", align: "center", children: [search && (_jsx(Flex, { role: "search", "aria-label": searchLabel, children: search })), children, _jsxs(Flex, { gap: 2, align: "center", wrap: "wrap", ml: { base: 0, md: "auto" }, children: [summary && (_jsx(Text, { fontSize: "xs", color: colors.textMuted, whiteSpace: "nowrap", children: summary })), actions] })] }), activeFilters.length > 0 && (_jsxs(Flex, { gap: 1.5, wrap: "wrap", align: "center", children: [activeFilters.map((filter) => (_jsx(Tag, { label: filter.label, colorScheme: "gray", icon: onRemoveFilter ? X : undefined, onIconClick: onRemoveFilter ? () => onRemoveFilter(filter.id) : undefined }, filter.id))), onClearAll && _jsx(Button, { variant: "ghost", colorScheme: "gray", label: "Clear all", onClick: onClearAll })] }))] }));
|
|
11
11
|
};
|
|
12
12
|
export default FilterBar;
|
|
@@ -77,7 +77,7 @@ panelPadding = 3, clearAllButton = true, onClearAllHandler,
|
|
|
77
77
|
});
|
|
78
78
|
};
|
|
79
79
|
const items = sidebarOptions.map((section) => ({
|
|
80
|
-
header: (_jsxs(Flex, { justify: "space-between", align: "center", w: "full", py: 1, children: [_jsx(ToolTip, { label: section.label, hasArrow: true, placement: "top", fontSize: "
|
|
80
|
+
header: (_jsxs(Flex, { justify: "space-between", align: "center", w: "full", py: 1, children: [_jsx(ToolTip, { label: section.label, hasArrow: true, placement: "top", fontSize: "xs", children: _jsx(Text, { fontWeight: 700, fontSize: "md", color: theme.colors.text[500], textAlign: "left", isTruncated: true, flex: "1", minW: 0, children: section.label }) }), (() => {
|
|
81
81
|
const sel = internalSelected[section.id];
|
|
82
82
|
const hasValue = Array.isArray(sel) ? sel.length > 0 : !!sel;
|
|
83
83
|
return hasValue;
|
|
@@ -116,7 +116,11 @@ panelPadding = 3, clearAllButton = true, onClearAllHandler,
|
|
|
116
116
|
border: none;
|
|
117
117
|
cursor: pointer;
|
|
118
118
|
}
|
|
119
|
-
` }), _jsxs(Box, { w: "full", position: "relative", h: { base: "24px", md: "30px" }, display: "flex", alignItems: "center", children: [_jsx(Box, { position: "absolute", left: "0", right: "0", height: "6px", bg: theme.colors.boxborder[200], borderRadius: "full" }), _jsx(Box, { position: "absolute",
|
|
119
|
+
` }), _jsxs(Box, { w: "full", position: "relative", h: { base: "24px", md: "30px" }, display: "flex", alignItems: "center", children: [_jsx(Box, { position: "absolute", left: "0", right: "0", height: "6px", bg: theme.colors.boxborder[200], borderRadius: "full" }), _jsx(Box, { position: "absolute", height: "6px", style: {
|
|
120
|
+
left: `${minPercent}%`,
|
|
121
|
+
width: `${maxPercent - minPercent}%`,
|
|
122
|
+
background: `linear-gradient(to right, ${primaryColor}, ${secondaryColor})`,
|
|
123
|
+
}, borderRadius: "full", boxShadow: `0 0 8px ${primaryGlowColor}` }), _jsx(Box, { position: "absolute", style: { left: `${minPercent}%` }, transform: "translate(-50%, 0)", w: { base: "16px", md: "20px" }, h: { base: "16px", md: "20px" }, borderRadius: "full", bg: theme.colors.background[50], border: "3px solid", borderColor: primaryColor, boxShadow: thumbShadow, zIndex: 2 }), _jsx(Box, { position: "absolute", style: { left: `${maxPercent}%` }, transform: "translate(-50%, 0)", w: { base: "16px", md: "20px" }, h: { base: "16px", md: "20px" }, borderRadius: "full", bg: theme.colors.background[50], border: "3px solid", borderColor: secondaryColor, boxShadow: thumbShadow, zIndex: 2 }), _jsxs(Box, { position: "absolute", style: { left: `${minPercent}%` }, top: { base: "-18px", md: "-22px" }, transform: "translate(-50%, -100%)", px: 2, py: 1, bg: theme.colors.background[50], border: `1px solid ${theme.colors.boxborder[200]}`, borderRadius: "lg", fontSize: "xs-minus", color: theme.colors.text[500], boxShadow: "sm", zIndex: 3, children: [currentMin, range.unit ? ` ${range.unit}` : ""] }), _jsxs(Box, { position: "absolute", style: { left: `${maxPercent}%` }, top: { base: "-18px", md: "-22px" }, transform: "translate(-50%, -100%)", px: 2, py: 1, bg: theme.colors.background[50], border: `1px solid ${theme.colors.boxborder[200]}`, borderRadius: "lg", fontSize: "xs-minus", color: theme.colors.text[500], boxShadow: "sm", zIndex: 3, children: [currentMax, range.unit ? ` ${range.unit}` : ""] }), [0, 25, 50, 75, 100].map((p) => (_jsx(Box, { position: "absolute", left: `${p}%`, bottom: "-8px", transform: "translateX(-50%)", w: "1px", h: "8px", bg: theme.colors.boxborder[500] }, `tick-${p}`))), _jsx("input", { type: "range", "aria-label": `${section.label}: minimum`, min: range.min, max: range.max, step: step, value: currentMin, className: "custom-range-slider", onChange: (e) => {
|
|
120
124
|
const min = Math.min(Number(e.target.value), currentMax - (step || 1));
|
|
121
125
|
const nextVal = [min, currentMax];
|
|
122
126
|
setInternalSelected((prev) => { const next = { ...prev, [section.id]: nextVal }; onChange === null || onChange === void 0 ? void 0 : onChange(next); return next; });
|
|
@@ -142,13 +146,13 @@ panelPadding = 3, clearAllButton = true, onClearAllHandler,
|
|
|
142
146
|
pointerEvents: 'none', // Allow clicks to pass through track
|
|
143
147
|
zIndex: 3,
|
|
144
148
|
margin: 0,
|
|
145
|
-
} })] }), _jsxs(SimpleGrid, { columns: 2, spacing: 2, pt: 2, w: "full", children: [_jsxs(Popover, { isOpen: openPrice.id === section.id && openPrice.target === "min", onClose: () => setOpenPrice({}), placement: "bottom-start", closeOnBlur: true, children: [_jsx(PopoverTrigger, { children: _jsx(Flex, { borderWidth: "0", borderRadius: "md", alignItems: "center", px: 3, py: 2, bg: theme.colors.background[50], borderColor: theme.colors.boxborder[500], cursor: "pointer", "data-testid": `range-trigger-min-${section.id}`, onClick: () => setOpenPrice({ id: section.id, target: "min" }), gap: 2, overflow: "hidden", children: _jsx(Box, { ml: "auto", children: _jsxs(Text, { fontSize: "
|
|
149
|
+
} })] }), _jsxs(SimpleGrid, { columns: 2, spacing: 2, pt: 2, w: "full", children: [_jsxs(Popover, { isOpen: openPrice.id === section.id && openPrice.target === "min", onClose: () => setOpenPrice({}), placement: "bottom-start", closeOnBlur: true, children: [_jsx(PopoverTrigger, { children: _jsx(Flex, { borderWidth: "0", borderRadius: "md", alignItems: "center", px: 3, py: 2, bg: theme.colors.background[50], borderColor: theme.colors.boxborder[500], cursor: "pointer", "data-testid": `range-trigger-min-${section.id}`, onClick: () => setOpenPrice({ id: section.id, target: "min" }), gap: 2, overflow: "hidden", children: _jsx(Box, { ml: "auto", children: _jsxs(Text, { fontSize: "xs", color: theme.colors.text[500], whiteSpace: "nowrap", children: [currentMin, range.unit ? ` ${range.unit}` : ""] }) }) }) }), _jsx(Portal, { children: _jsx(PopoverContent, { width: "6rem", p: 0, zIndex: 1600, bg: theme.colors.surfaceRaised, children: _jsx(PopoverBody, { p: 0, children: _jsx(VStack, { align: "stretch", spacing: 0, maxH: "12rem", overflowY: "auto", children: values.map((v) => (_jsxs(Flex, { px: 2, py: 1, align: "center", justify: "space-between", cursor: "pointer", bg: currentMin === v ? theme.colors.primary[50] : theme.colors.surfaceRaised, borderLeftWidth: currentMin === v ? 3 : 0, borderLeftStyle: "solid", borderLeftColor: currentMin === v ? theme.colors.primary[400] : "transparent", _hover: { bg: hoverBg }, "data-testid": `range-option-min-${section.id}-${v}`, onClick: () => {
|
|
146
150
|
const min = v;
|
|
147
151
|
const max = currentMax;
|
|
148
152
|
const nextVal = [Math.min(min, max), Math.max(min, max)];
|
|
149
153
|
setInternalSelected((prev) => { const next = { ...prev, [section.id]: nextVal }; onChange === null || onChange === void 0 ? void 0 : onChange(next); return next; });
|
|
150
154
|
setOpenPrice({});
|
|
151
|
-
}, children: [_jsxs(Text, { fontSize: "sm", color: theme.colors.text[500], children: [v, range.unit ? ` ${range.unit}` : ""] }), currentMin === v ? (_jsx(Box, { bg: theme.colors.primary[100], borderRadius: "full", p: 1, display: "flex", alignItems: "center", children: _jsx(Check, { size: 9, color: onFilled(theme.colors.primary[100], theme.colors.white, theme.colors.black) }) })) : null] }, `min-${v}`))) }) }) }) })] }), _jsxs(Popover, { isOpen: openPrice.id === section.id && openPrice.target === "max", onClose: () => setOpenPrice({}), placement: "bottom-start", closeOnBlur: true, children: [_jsx(PopoverTrigger, { children: _jsx(Flex, { borderWidth: "0", borderRadius: "md", alignItems: "center", px: 3, py: 2, bg: theme.colors.background[50], borderColor: theme.colors.boxborder[500], cursor: "pointer", "data-testid": `range-trigger-max-${section.id}`, onClick: () => setOpenPrice({ id: section.id, target: "max" }), gap: 2, overflow: "hidden", children: _jsx(Box, { ml: "auto", children: _jsxs(Text, { fontSize: "
|
|
155
|
+
}, children: [_jsxs(Text, { fontSize: "sm", color: theme.colors.text[500], children: [v, range.unit ? ` ${range.unit}` : ""] }), currentMin === v ? (_jsx(Box, { bg: theme.colors.primary[100], borderRadius: "full", p: 1, display: "flex", alignItems: "center", children: _jsx(Check, { size: 9, color: onFilled(theme.colors.primary[100], theme.colors.white, theme.colors.black) }) })) : null] }, `min-${v}`))) }) }) }) })] }), _jsxs(Popover, { isOpen: openPrice.id === section.id && openPrice.target === "max", onClose: () => setOpenPrice({}), placement: "bottom-start", closeOnBlur: true, children: [_jsx(PopoverTrigger, { children: _jsx(Flex, { borderWidth: "0", borderRadius: "md", alignItems: "center", px: 3, py: 2, bg: theme.colors.background[50], borderColor: theme.colors.boxborder[500], cursor: "pointer", "data-testid": `range-trigger-max-${section.id}`, onClick: () => setOpenPrice({ id: section.id, target: "max" }), gap: 2, overflow: "hidden", children: _jsx(Box, { ml: "auto", children: _jsxs(Text, { fontSize: "xs", color: theme.colors.text[500], whiteSpace: "nowrap", children: [currentMax, range.unit ? ` ${range.unit}` : ""] }) }) }) }), _jsx(PopoverContent, { width: "6rem", p: 0, bg: theme.colors.surfaceRaised, children: _jsx(PopoverBody, { p: 0, children: _jsx(VStack, { align: "stretch", spacing: 0, maxH: "12rem", overflowY: "auto", children: values.map((v) => (_jsxs(Flex, { px: 2, py: 1, align: "center", justify: "space-between", cursor: "pointer", bg: currentMax === v ? theme.colors.primary[50] : theme.colors.surfaceRaised, borderLeftWidth: currentMax === v ? 3 : 0, borderLeftStyle: "solid", borderLeftColor: currentMax === v ? theme.colors.primary[400] : "transparent", _hover: { bg: hoverBg }, "data-testid": `range-option-max-${section.id}-${v}`, onClick: () => {
|
|
152
156
|
const max = v;
|
|
153
157
|
const min = currentMin;
|
|
154
158
|
const nextVal = [Math.min(min, max), Math.max(min, max)];
|
|
@@ -198,7 +202,7 @@ panelPadding = 3, clearAllButton = true, onClearAllHandler,
|
|
|
198
202
|
toggleOption(section.id, opt.id, !isChecked);
|
|
199
203
|
}, children: opt.label })] }), typeof opt.count === "number" && (_jsx(Badge, { fontSize: "xs", colorScheme: "gray", borderRadius: "full", px: 2, children: opt.count }))] }, opt.id));
|
|
200
204
|
}));
|
|
201
|
-
})(), (section.options && section.options.length > maxVisible) && (_jsx(Text, { as: "span", role: "button", tabIndex: 0, fontSize: "sm", fontWeight:
|
|
205
|
+
})(), (section.options && section.options.length > maxVisible) && (_jsx(Text, { as: "span", role: "button", tabIndex: 0, fontSize: "sm", fontWeight: 500, color: theme.colors.accentText, cursor: "pointer", _hover: { textDecoration: "underline" }, onClick: () => setExpanded((prev) => ({ ...prev, [section.id]: !prev[section.id] })), onKeyDown: (e) => {
|
|
202
206
|
if (e.key === "Enter" || e.key === " ") {
|
|
203
207
|
e.preventDefault();
|
|
204
208
|
setExpanded((prev) => ({ ...prev, [section.id]: !prev[section.id] }));
|
|
@@ -244,6 +248,6 @@ panelPadding = 3, clearAllButton = true, onClearAllHandler,
|
|
|
244
248
|
},
|
|
245
249
|
},
|
|
246
250
|
}));
|
|
247
|
-
return (_jsxs(Box, { w: width, bg: theme.colors.background[50], p: containerPadding !== undefined ? containerPadding : (variant === "minimal" ? 3 : 2), borderRadius: variant === "minimal" ? "lg" : "none", boxShadow: variant === "minimal" ? "sm" : "none", border: variant === "minimal" ? `1px solid ${theme.colors.boxborder[200]}` : "none", h: "fit-content", maxH: containerHeight !== undefined ? containerHeight : undefined, overflowY: containerHeight !== undefined ? "auto" : "visible", children: [_jsxs(Flex, { className: "filters-header", align: "center", justify: "space-between", mb: 2, borderBottom: "2px solid", borderColor: theme.colors.boxborder[200], children: [_jsx(Text, { fontSize: "lg", fontWeight:
|
|
251
|
+
return (_jsxs(Box, { w: width, bg: theme.colors.background[50], p: containerPadding !== undefined ? containerPadding : (variant === "minimal" ? 3 : 2), borderRadius: variant === "minimal" ? "lg" : "none", boxShadow: variant === "minimal" ? "sm" : "none", border: variant === "minimal" ? `1px solid ${theme.colors.boxborder[200]}` : "none", h: "fit-content", maxH: containerHeight !== undefined ? containerHeight : undefined, overflowY: containerHeight !== undefined ? "auto" : "visible", children: [_jsxs(Flex, { className: "filters-header", align: "center", justify: "space-between", mb: 2, borderBottom: "2px solid", borderColor: theme.colors.boxborder[200], children: [_jsx(Text, { fontSize: "lg", fontWeight: 700, color: theme.colors.text[500], children: "Filters" }), activeCount > 0 && clearAllButton && (_jsx(_Fragment, { children: _jsx(Button, { size: "xs", variant: "outline", leftIcon: _jsx(X, { size: 12 }), onClick: clearAll, "aria-label": "Clear All", className: "clear-all-btn", colorScheme: "red", children: "Clear All" }) }))] }), _jsx(Accordion, { allowMultiple: true, defaultIndex: sidebarOptions.map((_, i) => i), items: items })] }));
|
|
248
252
|
};
|
|
249
253
|
export default FilterSidebar;
|
|
@@ -4,6 +4,6 @@ import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
|
4
4
|
/** Renders an icon+label header above a bordered card — not an HTML form; no submit/validation, just a section wrapper. */
|
|
5
5
|
const FormWrapper = ({ icon, text, children, }) => {
|
|
6
6
|
const { colors } = useCustomTheme();
|
|
7
|
-
return (_jsxs(Box, { children: [_jsxs(Box, { display: "flex", alignItems: "center", gap: 2, mb: 2, children: [icon && _jsx(Icon, { as: icon, boxSize: "1rem", color: colors.header[500] }), text && (_jsx(Box, { fontWeight: 600, fontSize: "
|
|
7
|
+
return (_jsxs(Box, { children: [_jsxs(Box, { display: "flex", alignItems: "center", gap: 2, mb: 2, children: [icon && _jsx(Icon, { as: icon, boxSize: "1rem", color: colors.header[500] }), text && (_jsx(Box, { fontWeight: 600, fontSize: "xs", lineHeight: "1", textTransform: "uppercase", color: colors.header[500], children: text }))] }), _jsx(Box, { borderRadius: "xl", bg: colors.background[50], borderWidth: "1px", borderStyle: "solid", borderColor: colors.boxborder[200], p: "1.5rem", children: children })] }));
|
|
8
8
|
};
|
|
9
9
|
export default FormWrapper;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment, cloneElement, forwardRef, isValidElement } from "react";
|
|
3
|
+
import { Box, FormControl } from "@chakra-ui/react";
|
|
4
|
+
import ErrorMessage from "../Common/ErrorMessage.js";
|
|
5
|
+
import { fieldLabelStyles } from "../Common/FormLabel.js";
|
|
6
|
+
import { fieldMessageStyles, fieldMessageVisibility } from "../Common/fieldMessageStyles.js";
|
|
7
|
+
import { useFieldIds } from "../Common/useFieldIds.js";
|
|
8
|
+
import { useCustomTheme } from "../../Theme/useCustomTheme.js";
|
|
9
|
+
const joinIds = (...ids) => [...new Set(ids.flatMap((value) => { var _a; return (_a = value === null || value === void 0 ? void 0 : value.split(/\s+/)) !== null && _a !== void 0 ? _a : []; }).filter(Boolean))].join(" ") || undefined;
|
|
10
|
+
const asWirableElement = (children) => typeof children !== "function" && isValidElement(children) && children.type !== Fragment
|
|
11
|
+
? children
|
|
12
|
+
: undefined;
|
|
13
|
+
const FormField = forwardRef(function FormField({ label, id, isRequired = false, error = false, errorMessage, helperText, layout = "vertical", labelWidth = "12rem", children, ...rest }, ref) {
|
|
14
|
+
var _a;
|
|
15
|
+
const { colors } = useCustomTheme();
|
|
16
|
+
const element = asWirableElement(children);
|
|
17
|
+
const own = (_a = element === null || element === void 0 ? void 0 : element.props) !== null && _a !== void 0 ? _a : {};
|
|
18
|
+
const ids = useFieldIds(id !== null && id !== void 0 ? id : own.id, { error, errorMessage, helperText });
|
|
19
|
+
const { showError, showHelper } = fieldMessageVisibility({ error, errorMessage, helperText });
|
|
20
|
+
const describedBy = joinIds(own["aria-describedby"], ids.describedBy);
|
|
21
|
+
const control = {
|
|
22
|
+
id: ids.inputId,
|
|
23
|
+
"aria-labelledby": ids.labelId,
|
|
24
|
+
"aria-describedby": describedBy,
|
|
25
|
+
"aria-invalid": ids.controlProps["aria-invalid"],
|
|
26
|
+
"aria-required": isRequired || undefined,
|
|
27
|
+
};
|
|
28
|
+
const isSelfNamed = Boolean(own["aria-label"] || own["aria-labelledby"]);
|
|
29
|
+
const wired = element
|
|
30
|
+
? cloneElement(element, {
|
|
31
|
+
id: control.id,
|
|
32
|
+
...(isSelfNamed ? {} : { "aria-labelledby": control["aria-labelledby"] }),
|
|
33
|
+
...(describedBy ? { "aria-describedby": describedBy } : {}),
|
|
34
|
+
...(error ? { "aria-invalid": true } : {}),
|
|
35
|
+
...(isRequired ? { "aria-required": true } : {}),
|
|
36
|
+
})
|
|
37
|
+
: typeof children === "function"
|
|
38
|
+
? children(control)
|
|
39
|
+
: children;
|
|
40
|
+
const message = showError && errorMessage ? (_jsx(ErrorMessage, { id: ids.errorId, errorMessage: errorMessage })) : showHelper ? (_jsx(Box, { id: ids.helperId, ...fieldMessageStyles(colors), children: helperText })) : null;
|
|
41
|
+
const isHorizontal = layout === "horizontal";
|
|
42
|
+
const labelStyles = fieldLabelStyles(colors);
|
|
43
|
+
return (_jsxs(FormControl, { ...rest, ref: ref, id: ids.inputId, isRequired: isRequired, isInvalid: error, ...(isHorizontal
|
|
44
|
+
? {
|
|
45
|
+
display: "grid",
|
|
46
|
+
gridTemplateColumns: { base: "minmax(0, 1fr)", md: `${labelWidth} minmax(0, 1fr)` },
|
|
47
|
+
columnGap: 4,
|
|
48
|
+
alignItems: "start",
|
|
49
|
+
}
|
|
50
|
+
: {}), children: [_jsx(Box, { as: "label", id: ids.labelId, htmlFor: ids.inputId, ...labelStyles, display: "block", ...(isHorizontal ? { alignSelf: { md: "center" }, mb: { base: labelStyles.mb, md: 0 } } : {}), children: _jsxs(Box, { as: "span", display: "inline-flex", alignItems: "center", gap: "0.35rem", children: [_jsx(Box, { as: "span", children: label }), isRequired && (_jsx(Box, { as: "span", color: colors.semanticText.error, ml: "0.125rem", children: "*" }))] }) }), isHorizontal ? (_jsxs(_Fragment, { children: [_jsx(Box, { minW: 0, children: wired }), message && _jsx(Box, { gridColumn: { md: 2 }, children: message })] })) : (_jsxs(_Fragment, { children: [wired, message] }))] }));
|
|
51
|
+
});
|
|
52
|
+
export default FormField;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -18,10 +18,10 @@ const HeaderActions = ({ select, edit, create, surface, }) => {
|
|
|
18
18
|
elements.push(_jsx(Box, { width: (_a = select.width) !== null && _a !== void 0 ? _a : "12.5rem", children: _jsx(Select, { options: (_b = select.options) !== null && _b !== void 0 ? _b : [], placeholder: select.selectPlaceholderText, "aria-label": select.ariaLabel || select.selectPlaceholderText || "Select", native: (_c = select.native) !== null && _c !== void 0 ? _c : false, onChange: (option) => { var _a; return (_a = select.onSelectChange) === null || _a === void 0 ? void 0 : _a.call(select, option); }, value: select.value }, "select") }, "select"));
|
|
19
19
|
}
|
|
20
20
|
if (edit === null || edit === void 0 ? void 0 : edit.isEditable) {
|
|
21
|
-
elements.push(_jsxs(Box, { as: "button", type: "button", bg: "transparent", borderRadius: "lg", _focusVisible: { boxShadow: `0 0 0 2px ${iconInk}`, outline: "none" }, display: "flex", alignItems: "center", gap: "0.375rem", cursor: "pointer", fontSize:
|
|
21
|
+
elements.push(_jsxs(Box, { as: "button", type: "button", bg: "transparent", borderRadius: "lg", _focusVisible: { boxShadow: `0 0 0 2px ${iconInk}`, outline: "none" }, display: "flex", alignItems: "center", gap: "0.375rem", cursor: "pointer", fontSize: "sm", onClick: () => { var _a; return (_a = edit.onEdit) === null || _a === void 0 ? void 0 : _a.call(edit); }, children: [_jsx(SquarePen, { size: 16, color: iconInk }), _jsx(Text, { color: ink, children: edit.label ? edit.label : "Edit Layout" })] }, "edit"));
|
|
22
22
|
}
|
|
23
23
|
if (create === null || create === void 0 ? void 0 : create.isCreatable) {
|
|
24
|
-
elements.push(_jsxs(Box, { as: "button", type: "button", bg: "transparent", borderRadius: "lg", _focusVisible: { boxShadow: `0 0 0 2px ${iconInk}`, outline: "none" }, display: "flex", alignItems: "center", gap: "0.375rem", cursor: "pointer", fontSize:
|
|
24
|
+
elements.push(_jsxs(Box, { as: "button", type: "button", bg: "transparent", borderRadius: "lg", _focusVisible: { boxShadow: `0 0 0 2px ${iconInk}`, outline: "none" }, display: "flex", alignItems: "center", gap: "0.375rem", cursor: "pointer", fontSize: "sm", onClick: () => { var _a; return (_a = create.onCreate) === null || _a === void 0 ? void 0 : _a.call(create); }, children: [_jsx(CirclePlus, { size: 16, color: iconInk }), _jsxs(Text, { color: ink, children: [" ", create.label ? create.label : "Create New", " "] })] }, "create"));
|
|
25
25
|
}
|
|
26
26
|
return (_jsx(Box, { display: "flex", alignItems: "center", gap: "0.625rem", children: elements.map((el, i) => (_jsxs(React.Fragment, { children: [i > 0 && _jsx(VeritcalDivider, {}), el] }, i))) }));
|
|
27
27
|
};
|
|
@@ -20,7 +20,7 @@ const MobileMenu = ({ menuItems, isOpen, isActive, hoverBg, activeBg, color, sur
|
|
|
20
20
|
? onFilled(activeBg, colors.white, colors.black)
|
|
21
21
|
: color, bg: item.children.some((subItem) => isActive(subItem.href))
|
|
22
22
|
? activeBg
|
|
23
|
-
: "transparent", _hover: { bg: hoverBg }, rightIcon: openMenuLabel === item.label ? (_jsx(ChevronDown, { size: 16 })) : (_jsx(ChevronRight, { size: 16 })), px: 2, children: _jsx(HStack, { w: "full", justify: "space-between", align: "center", children: _jsxs(VStack, { spacing: 0, align: "start", children: [item.badge && (_jsx(Badge, { bg: badgeTone(item.badge.colorScheme).bg, color: badgeTone(item.badge.colorScheme).fg, variant: "subtle", fontSize: "0.65em", borderRadius: "full", boxShadow: "sm", px: 2, py: 0.5, children: item.badge.label })), _jsx(Text, { fontWeight:
|
|
23
|
+
: "transparent", _hover: { bg: hoverBg }, rightIcon: openMenuLabel === item.label ? (_jsx(ChevronDown, { size: 16 })) : (_jsx(ChevronRight, { size: 16 })), px: 2, children: _jsx(HStack, { w: "full", justify: "space-between", align: "center", children: _jsxs(VStack, { spacing: 0, align: "start", children: [item.badge && (_jsx(Badge, { bg: badgeTone(item.badge.colorScheme).bg, color: badgeTone(item.badge.colorScheme).fg, variant: "subtle", fontSize: "0.65em", borderRadius: "full", boxShadow: "sm", px: 2, py: 0.5, children: item.badge.label })), _jsx(Text, { fontWeight: 700, children: item.label })] }) }) }), _jsx(Collapse, { in: openMenuLabel === item.label, animateOpacity: true, children: _jsx(Stack, { pl: 4, mt: 1, spacing: 1, children: item.children.map((subItem) => {
|
|
24
24
|
var _a;
|
|
25
25
|
return (_jsx(Button, { onClick: () => {
|
|
26
26
|
var _a;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, memo, useEffect, useRef } from "react";
|
|
3
|
+
import { IconButton as ChakraIconButton, } from "@chakra-ui/react";
|
|
4
|
+
// NOTE: Chakra omits a missing aria-label at runtime; only its type insists on one.
|
|
5
|
+
const UnlabelledChakraIconButton = ChakraIconButton;
|
|
6
|
+
export const UNNAMED_ICON_BUTTON_WARNING = "[pixelize-design-library] IconButton: no aria-label or aria-labelledby, so screen readers announce it as an unnamed button.";
|
|
7
|
+
const useUnnamedWarning = (isUnnamed) => {
|
|
8
|
+
const warned = useRef(false);
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
if (process.env.NODE_ENV === "production" || !isUnnamed || warned.current)
|
|
11
|
+
return;
|
|
12
|
+
warned.current = true;
|
|
13
|
+
console.warn(UNNAMED_ICON_BUTTON_WARNING);
|
|
14
|
+
}, [isUnnamed]);
|
|
15
|
+
};
|
|
16
|
+
const IconButton = forwardRef(function IconButton(props, ref) {
|
|
17
|
+
var _a, _b;
|
|
18
|
+
useUnnamedWarning(!((_a = props["aria-label"]) === null || _a === void 0 ? void 0 : _a.trim()) && !((_b = props["aria-labelledby"]) === null || _b === void 0 ? void 0 : _b.trim()));
|
|
19
|
+
return _jsx(UnlabelledChakraIconButton, { ref: ref, ...props });
|
|
20
|
+
});
|
|
21
|
+
export default memo(IconButton);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|