pixelize-design-library 2.4.2-beta.0 → 2.4.2-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Components/Accordion/Accordion.js +13 -15
- package/dist/Components/Accordion/accordionColors.js +6 -9
- package/dist/Components/AlertDialog/AlertDialog.js +1 -2
- package/dist/Components/Apexcharts/ApexAreaChart/ApexAreaChart.js +2 -3
- package/dist/Components/Apexcharts/ApexPieChart/ApexPieChart.js +2 -3
- package/dist/Components/Apexcharts/ApexRadialChart/ApexRadialChart.js +2 -3
- package/dist/Components/AppearanceSettings/AppearanceSettings.js +9 -7
- package/dist/Components/Button/Button.styles.js +4 -10
- package/dist/Components/ButtonGroupIcon/ButtonGroupIcon.js +9 -10
- package/dist/Components/Common/ErrorComponent.js +5 -8
- package/dist/Components/Common/ErrorMessage.js +2 -8
- package/dist/Components/Common/FormLabel.js +1 -3
- package/dist/Components/Common/FormattedDescription.js +3 -1
- package/dist/Components/Common/Label.js +3 -8
- package/dist/Components/Common/fieldStyles.js +6 -7
- package/dist/Components/ContactForm/ContactForm.js +1 -2
- package/dist/Components/CopyButton/CopyButton.js +3 -6
- package/dist/Components/CustomModulesTable/CustomModulesTable.js +7 -10
- package/dist/Components/CustomModulesTable/DeleteModuleModal.js +2 -2
- package/dist/Components/CustomModulesTable/EditModuleModal.js +2 -3
- package/dist/Components/DatePicker/CalendarPanel.js +2 -3
- package/dist/Components/DatePicker/RangeDatePicker.js +9 -9
- package/dist/Components/DatePicker/SingleDatePicker.js +11 -11
- package/dist/Components/DatePicker/TimeOnlyPicker.js +2 -2
- package/dist/Components/DatePicker/TimePicker.js +6 -7
- package/dist/Components/DatePicker/TimePickerInput.js +6 -7
- package/dist/Components/Divider/Divider.js +1 -2
- package/dist/Components/Drawer/Drawer.js +1 -2
- package/dist/Components/Dropdown/DropDown.js +22 -26
- package/dist/Components/Editor/Editor.js +10 -13
- package/dist/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +2 -2
- package/dist/Components/EmptyState/EmptyState.js +11 -11
- package/dist/Components/FieldSelectModal/FieldSelectModal.js +1 -1
- package/dist/Components/FilePreview/FilePreview.js +2 -2
- package/dist/Components/FileUpload/FileUpload.js +18 -24
- package/dist/Components/FileUploader/FileUploader.js +5 -6
- package/dist/Components/FilterSidebar/FilterSidebar.js +156 -160
- package/dist/Components/Form/FormWrapper.js +1 -2
- package/dist/Components/Header/Header.js +6 -6
- package/dist/Components/Header/HeaderActions.d.ts +3 -1
- package/dist/Components/Header/HeaderActions.js +8 -4
- package/dist/Components/Header/components/desktopMenu.js +7 -20
- package/dist/Components/Header/components/mobileMenu.js +3 -15
- package/dist/Components/Input/Input/Input.js +13 -17
- package/dist/Components/Input/TextInput.styles.js +10 -13
- package/dist/Components/InputTextArea/InputTextArea.d.ts +1 -1
- package/dist/Components/InputTextArea/InputTextArea.style.js +10 -11
- package/dist/Components/KanbanBoard/AccountCard.js +10 -4
- package/dist/Components/KanbanBoard/AccountRow.js +1 -2
- package/dist/Components/KanbanBoard/KanbanActions/KanbanActions.js +2 -2
- package/dist/Components/KanbanBoard/KanbanBoard.js +21 -28
- package/dist/Components/LazyWrapper/LazyWrapper.js +1 -1
- package/dist/Components/LimitReachedModal/LimitReachedModal.js +3 -15
- package/dist/Components/Loading/Loading.js +1 -1
- package/dist/Components/Modal/Modal.js +3 -1
- package/dist/Components/MoreItems/MoreItems.js +3 -7
- package/dist/Components/MultiSelect/MultiSelect.js +5 -6
- package/dist/Components/NavigationBar/NavigationBar.d.ts +1 -1
- package/dist/Components/NavigationBar/NavigationBar.js +22 -18
- package/dist/Components/NavigationBar/NavigationBarProps.d.ts +5 -0
- package/dist/Components/NoteTextArea/NoteTextArea.js +4 -8
- package/dist/Components/Notification/Notification.js +17 -15
- package/dist/Components/NumberInput/NumberInput.styles.js +10 -11
- package/dist/Components/OrgSwitcher/OrgSwitcher.js +6 -7
- package/dist/Components/OrgSwitcher/OrgSwitcherProps.d.ts +2 -0
- package/dist/Components/OrgSwitcher/OrgSwitcherProps.js +6 -2
- package/dist/Components/OrganizationDetails/CreateOrgModal.js +1 -2
- package/dist/Components/OrganizationDetails/DeleteOrgModal.js +5 -2
- package/dist/Components/OrganizationDetails/OrganizationDetails.js +25 -22
- package/dist/Components/PdfViewer/PdfViewer.js +1 -1
- package/dist/Components/PinInputs/PinInputs.js +7 -14
- package/dist/Components/PlanPill/PlanPill.js +5 -8
- package/dist/Components/PlanPill/planPillGradient.d.ts +19 -0
- package/dist/Components/PlanPill/planPillGradient.js +30 -1
- package/dist/Components/ProductCard/ProductPrice.js +6 -6
- package/dist/Components/ProductCard/ProductReview.js +4 -1
- package/dist/Components/ProductCard/ProductTags.js +4 -4
- package/dist/Components/ProductDetails/ProductDetails.js +3 -1
- package/dist/Components/ProductDetails/ProductDtlPrice.js +3 -3
- package/dist/Components/ProfileCard/ProfileCard.js +4 -4
- package/dist/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +19 -16
- package/dist/Components/Reorder/Reorder.js +3 -4
- package/dist/Components/RolesPermission/DeleteRoleModal.js +5 -4
- package/dist/Components/RolesPermission/RolesPermission.js +12 -14
- package/dist/Components/ScrollToTop/ScrollToTop.js +2 -3
- package/dist/Components/SearchSelect/SearchSelect.js +25 -28
- package/dist/Components/Select/Select.styles.js +33 -37
- package/dist/Components/SelectSearch/SelectSearch.js +8 -8
- package/dist/Components/SelectV2/SelectV2.js +14 -20
- package/dist/Components/SideBar/SecondaryBar.js +10 -15
- package/dist/Components/SideBar/SideBar.d.ts +1 -1
- package/dist/Components/SideBar/SideBar.js +41 -34
- package/dist/Components/SideBar/SideBarProps.d.ts +6 -0
- package/dist/Components/SideBar/components/MenuItemBox.js +10 -12
- package/dist/Components/SideBar/components/MenuItems.js +3 -1
- package/dist/Components/SideBar/components/MenuPopoverContent.js +7 -9
- package/dist/Components/SideBar/components/OtherApps.js +4 -4
- package/dist/Components/SideBar/sidebarAccentColors.d.ts +4 -17
- package/dist/Components/SideBar/sidebarAccentColors.js +6 -33
- package/dist/Components/SignInActivityTable/SignInActivityTable.js +6 -7
- package/dist/Components/Slider/Slider.js +2 -2
- package/dist/Components/StageProgress/StageProgressProps.js +9 -13
- package/dist/Components/Table/Table.js +10 -10
- package/dist/Components/Table/components/HeaderActions.js +6 -7
- package/dist/Components/Table/components/Pagination.js +1 -1
- package/dist/Components/Table/components/TableActions.js +4 -4
- package/dist/Components/Table/components/TableBody.js +18 -20
- package/dist/Components/Table/components/TableGroupRow.js +1 -2
- package/dist/Components/Table/components/TableHeader.js +8 -12
- package/dist/Components/Table/components/TableSearch.js +1 -2
- package/dist/Components/Table/components/tableRowHoverStyle.js +2 -3
- package/dist/Components/Table/filters/ActiveFilters.js +5 -8
- package/dist/Components/Table/filters/CompactSelect.js +4 -5
- package/dist/Components/Table/filters/LeftFilterPane.js +4 -5
- package/dist/Components/Table/filters/TableFilters.js +1 -2
- package/dist/Components/Table/hooks/useTable.js +8 -11
- package/dist/Components/Table/settings/ManageColumns.js +1 -1
- package/dist/Components/Table/settings/TableSettings.js +12 -14
- package/dist/Components/Tag/Tag.styles.js +8 -6
- package/dist/Components/Timeline/Timeline.js +32 -45
- package/dist/Components/Toaster/Toaster.js +43 -44
- package/dist/Components/ToolTip/ToolTip.js +1 -6
- package/dist/Components/Trail/EditableCell.js +4 -1
- package/dist/Components/Trail/TrailWorks.js +3 -3
- package/dist/Components/UpgradeButton/UpgradeButton.js +2 -4
- package/dist/Components/UserDetails/AddUserModal.js +3 -3
- package/dist/Components/UserDetails/ChangeRoleModal.js +2 -2
- package/dist/Components/UserDetails/DeactivateConfirmModal.js +5 -5
- package/dist/Components/UserDetails/UserDetails.js +14 -16
- package/dist/Components/WorkspaceWindow/WorkspaceTrayPreview.js +1 -2
- package/dist/Components/WorkspaceWindow/WorkspaceWindow.js +3 -4
- package/dist/Theme/assertPalette.d.ts +11 -0
- package/dist/Theme/assertPalette.js +55 -0
- package/dist/Theme/chakra/Avatar.styles.d.ts +5 -5
- package/dist/Theme/chakra/Avatar.styles.js +2 -2
- package/dist/Theme/chakra/Drawer.styles.d.ts +5 -5
- package/dist/Theme/chakra/Drawer.styles.js +8 -10
- package/dist/Theme/chakra/Modal.styles.d.ts +5 -5
- package/dist/Theme/chakra/Modal.styles.js +8 -10
- package/dist/Theme/chakra/Popover.styles.d.ts +3 -3
- package/dist/Theme/chakra/Slider.styles.d.ts +1 -1
- package/dist/Theme/chakra/Slider.styles.js +7 -9
- package/dist/Theme/chakra/Tabs.styles.d.ts +2 -2
- package/dist/Theme/chakra/Tabs.styles.js +13 -18
- package/dist/Theme/chakra/componentStyles.d.ts +54 -21
- package/dist/Theme/chakra/componentStyles.js +52 -43
- package/dist/Theme/chakra/paletteFromTheme.d.ts +10 -0
- package/dist/Theme/chakra/paletteFromTheme.js +14 -0
- package/dist/Theme/provider/PixelizeThemeProvider.js +5 -0
- package/dist/Theme/testing/testPalette.d.ts +16 -0
- package/dist/Theme/testing/testPalette.js +24 -0
- package/dist/Theme/tokens/brands/emerald/palette.light.d.ts +2 -373
- package/dist/Theme/tokens/brands/emerald/palette.light.js +5 -7
- package/dist/Theme/tokens/brands/index.d.ts +3 -2
- package/dist/Theme/tokens/brands/index.js +29 -23
- package/dist/Theme/tokens/brands/lavender/palette.light.d.ts +2 -373
- package/dist/Theme/tokens/brands/lavender/palette.light.js +3 -110
- package/dist/Theme/tokens/brands/meadow/palette.light.d.ts +2 -373
- package/dist/Theme/tokens/brands/meadow/palette.light.js +5 -7
- package/dist/Theme/tokens/brands/neutrals.d.ts +8 -0
- package/dist/Theme/tokens/brands/neutrals.js +119 -0
- package/dist/Theme/tokens/brands/radiant/palette.light.d.ts +2 -373
- package/dist/Theme/tokens/brands/radiant/palette.light.js +5 -7
- package/dist/Theme/tokens/brands/rosewood/palette.light.d.ts +2 -373
- package/dist/Theme/tokens/brands/rosewood/palette.light.js +5 -7
- package/dist/Theme/tokens/brands/skyline/palette.light.d.ts +2 -373
- package/dist/Theme/tokens/brands/skyline/palette.light.js +5 -7
- package/dist/Theme/tokens/brands/slate/palette.light.d.ts +2 -373
- package/dist/Theme/tokens/brands/slate/palette.light.js +6 -8
- package/dist/Theme/tokens/brands/storefront/palette.light.d.ts +2 -373
- package/dist/Theme/tokens/brands/storefront/palette.light.js +5 -7
- package/dist/Theme/tokens/brands/zinc/palette.dark.d.ts +5 -3
- package/dist/Theme/tokens/brands/zinc/palette.dark.js +2 -1
- package/dist/Theme/tokens/brands/zinc/palette.light.d.ts +2 -373
- package/dist/Theme/tokens/builders/accentText.d.ts +2 -2
- package/dist/Theme/tokens/builders/accentText.js +8 -27
- package/dist/Theme/tokens/builders/brandInk.d.ts +11 -0
- package/dist/Theme/tokens/builders/brandInk.js +106 -0
- package/dist/Theme/tokens/builders/buildDarkPalette.d.ts +2 -2
- package/dist/Theme/tokens/builders/buildDarkPalette.js +16 -8
- package/dist/Theme/tokens/builders/mutedText.d.ts +5 -0
- package/dist/Theme/tokens/builders/mutedText.js +9 -0
- package/dist/Theme/tokens/builders/outlineRung.d.ts +7 -6
- package/dist/Theme/tokens/builders/outlineRung.js +20 -18
- package/dist/Theme/tokens/builders/resolvedRungs.d.ts +7 -0
- package/dist/Theme/tokens/builders/resolvedRungs.js +25 -0
- package/dist/Theme/tokens/builders/semanticText.d.ts +10 -0
- package/dist/Theme/tokens/builders/semanticText.js +22 -0
- package/dist/Theme/tokens/builders/sidebarAccent.d.ts +9 -0
- package/dist/Theme/tokens/builders/sidebarAccent.js +29 -0
- package/dist/Theme/tokens/builders/statusTone.js +3 -4
- package/dist/Theme/tokens/builders/surfaceRungs.d.ts +5 -0
- package/dist/Theme/tokens/builders/surfaceRungs.js +39 -0
- package/dist/Theme/tokens/types.d.ts +41 -13
- package/dist/Theme/useCustomTheme.js +4 -1
- package/dist/Utils/table.d.ts +1 -7
- package/dist/Utils/table.js +27 -35
- package/dist/esm/Components/Accordion/Accordion.js +14 -16
- package/dist/esm/Components/Accordion/accordionColors.js +6 -9
- package/dist/esm/Components/AlertDialog/AlertDialog.js +1 -2
- package/dist/esm/Components/Apexcharts/ApexAreaChart/ApexAreaChart.js +2 -3
- package/dist/esm/Components/Apexcharts/ApexPieChart/ApexPieChart.js +2 -3
- package/dist/esm/Components/Apexcharts/ApexRadialChart/ApexRadialChart.js +2 -3
- package/dist/esm/Components/AppearanceSettings/AppearanceSettings.js +9 -7
- package/dist/esm/Components/Button/Button.styles.js +4 -10
- package/dist/esm/Components/ButtonGroupIcon/ButtonGroupIcon.js +9 -10
- package/dist/esm/Components/Common/ErrorComponent.js +6 -9
- package/dist/esm/Components/Common/ErrorMessage.js +2 -8
- package/dist/esm/Components/Common/FormLabel.js +1 -3
- package/dist/esm/Components/Common/FormattedDescription.js +3 -1
- package/dist/esm/Components/Common/Label.js +3 -8
- package/dist/esm/Components/Common/fieldStyles.js +6 -7
- package/dist/esm/Components/ContactForm/ContactForm.js +1 -2
- package/dist/esm/Components/CopyButton/CopyButton.js +3 -6
- package/dist/esm/Components/CustomModulesTable/CustomModulesTable.js +7 -10
- package/dist/esm/Components/CustomModulesTable/DeleteModuleModal.js +2 -2
- package/dist/esm/Components/CustomModulesTable/EditModuleModal.js +2 -3
- package/dist/esm/Components/DatePicker/CalendarPanel.js +2 -3
- package/dist/esm/Components/DatePicker/RangeDatePicker.js +9 -9
- package/dist/esm/Components/DatePicker/SingleDatePicker.js +11 -11
- package/dist/esm/Components/DatePicker/TimeOnlyPicker.js +2 -2
- package/dist/esm/Components/DatePicker/TimePicker.js +6 -7
- package/dist/esm/Components/DatePicker/TimePickerInput.js +6 -7
- package/dist/esm/Components/Divider/Divider.js +1 -2
- package/dist/esm/Components/Drawer/Drawer.js +1 -2
- package/dist/esm/Components/Dropdown/DropDown.js +22 -26
- package/dist/esm/Components/Editor/Editor.js +11 -14
- package/dist/esm/Components/EmailCards/VerifyEmailOtp/VerifyEmailOtp.js +2 -2
- package/dist/esm/Components/EmptyState/EmptyState.js +11 -11
- package/dist/esm/Components/FieldSelectModal/FieldSelectModal.js +1 -1
- package/dist/esm/Components/FilePreview/FilePreview.js +2 -2
- package/dist/esm/Components/FileUpload/FileUpload.js +18 -24
- package/dist/esm/Components/FileUploader/FileUploader.js +6 -7
- package/dist/esm/Components/FilterSidebar/FilterSidebar.js +157 -161
- package/dist/esm/Components/Form/FormWrapper.js +1 -2
- package/dist/esm/Components/Header/Header.js +6 -6
- package/dist/esm/Components/Header/HeaderActions.js +9 -5
- package/dist/esm/Components/Header/components/desktopMenu.js +8 -21
- package/dist/esm/Components/Header/components/mobileMenu.js +3 -15
- package/dist/esm/Components/Input/Input/Input.js +14 -18
- package/dist/esm/Components/Input/TextInput.styles.js +10 -13
- package/dist/esm/Components/InputTextArea/InputTextArea.style.js +10 -11
- package/dist/esm/Components/KanbanBoard/AccountCard.js +10 -4
- package/dist/esm/Components/KanbanBoard/AccountRow.js +1 -2
- package/dist/esm/Components/KanbanBoard/KanbanActions/KanbanActions.js +2 -2
- package/dist/esm/Components/KanbanBoard/KanbanBoard.js +21 -28
- package/dist/esm/Components/LazyWrapper/LazyWrapper.js +1 -1
- package/dist/esm/Components/LimitReachedModal/LimitReachedModal.js +4 -16
- package/dist/esm/Components/Loading/Loading.js +1 -1
- package/dist/esm/Components/Modal/Modal.js +3 -1
- package/dist/esm/Components/MoreItems/MoreItems.js +3 -7
- package/dist/esm/Components/MultiSelect/MultiSelect.js +5 -6
- package/dist/esm/Components/NavigationBar/NavigationBar.js +23 -19
- package/dist/esm/Components/NoteTextArea/NoteTextArea.js +4 -8
- package/dist/esm/Components/Notification/Notification.js +18 -16
- package/dist/esm/Components/NumberInput/NumberInput.styles.js +10 -11
- package/dist/esm/Components/OrgSwitcher/OrgSwitcher.js +7 -8
- package/dist/esm/Components/OrgSwitcher/OrgSwitcherProps.js +5 -1
- package/dist/esm/Components/OrganizationDetails/CreateOrgModal.js +1 -2
- package/dist/esm/Components/OrganizationDetails/DeleteOrgModal.js +5 -2
- package/dist/esm/Components/OrganizationDetails/OrganizationDetails.js +25 -22
- package/dist/esm/Components/PdfViewer/PdfViewer.js +1 -1
- package/dist/esm/Components/PinInputs/PinInputs.js +8 -15
- package/dist/esm/Components/PlanPill/PlanPill.js +6 -9
- package/dist/esm/Components/PlanPill/planPillGradient.js +24 -0
- package/dist/esm/Components/ProductCard/ProductPrice.js +6 -6
- package/dist/esm/Components/ProductCard/ProductReview.js +4 -1
- package/dist/esm/Components/ProductCard/ProductTags.js +5 -5
- package/dist/esm/Components/ProductDetails/ProductDetails.js +3 -1
- package/dist/esm/Components/ProductDetails/ProductDtlPrice.js +3 -3
- package/dist/esm/Components/ProfileCard/ProfileCard.js +5 -5
- package/dist/esm/Components/ProfilePhotoViewer/ProfilePhotoViewer.js +20 -17
- package/dist/esm/Components/Reorder/Reorder.js +3 -4
- package/dist/esm/Components/RolesPermission/DeleteRoleModal.js +5 -4
- package/dist/esm/Components/RolesPermission/RolesPermission.js +12 -14
- package/dist/esm/Components/ScrollToTop/ScrollToTop.js +2 -3
- package/dist/esm/Components/SearchSelect/SearchSelect.js +25 -28
- package/dist/esm/Components/Select/Select.styles.js +33 -37
- package/dist/esm/Components/SelectSearch/SelectSearch.js +8 -8
- package/dist/esm/Components/SelectV2/SelectV2.js +14 -20
- package/dist/esm/Components/SideBar/SecondaryBar.js +11 -16
- package/dist/esm/Components/SideBar/SideBar.js +43 -36
- package/dist/esm/Components/SideBar/components/MenuItemBox.js +11 -13
- package/dist/esm/Components/SideBar/components/MenuItems.js +3 -1
- package/dist/esm/Components/SideBar/components/MenuPopoverContent.js +8 -10
- package/dist/esm/Components/SideBar/components/OtherApps.js +4 -4
- package/dist/esm/Components/SideBar/sidebarAccentColors.js +5 -31
- package/dist/esm/Components/SignInActivityTable/SignInActivityTable.js +6 -7
- package/dist/esm/Components/Slider/Slider.js +2 -2
- package/dist/esm/Components/StageProgress/StageProgressProps.js +9 -13
- package/dist/esm/Components/Table/Table.js +10 -10
- package/dist/esm/Components/Table/components/HeaderActions.js +6 -7
- package/dist/esm/Components/Table/components/Pagination.js +1 -1
- package/dist/esm/Components/Table/components/TableActions.js +4 -4
- package/dist/esm/Components/Table/components/TableBody.js +18 -20
- package/dist/esm/Components/Table/components/TableGroupRow.js +1 -2
- package/dist/esm/Components/Table/components/TableHeader.js +8 -12
- package/dist/esm/Components/Table/components/TableSearch.js +1 -2
- package/dist/esm/Components/Table/components/tableRowHoverStyle.js +2 -3
- package/dist/esm/Components/Table/filters/ActiveFilters.js +5 -8
- package/dist/esm/Components/Table/filters/CompactSelect.js +4 -5
- package/dist/esm/Components/Table/filters/LeftFilterPane.js +4 -5
- package/dist/esm/Components/Table/filters/TableFilters.js +1 -2
- package/dist/esm/Components/Table/hooks/useTable.js +8 -11
- package/dist/esm/Components/Table/settings/ManageColumns.js +1 -1
- package/dist/esm/Components/Table/settings/TableSettings.js +12 -14
- package/dist/esm/Components/Tag/Tag.styles.js +9 -7
- package/dist/esm/Components/Timeline/Timeline.js +33 -46
- package/dist/esm/Components/Toaster/Toaster.js +44 -45
- package/dist/esm/Components/ToolTip/ToolTip.js +1 -6
- package/dist/esm/Components/Trail/EditableCell.js +4 -1
- package/dist/esm/Components/Trail/TrailWorks.js +4 -4
- package/dist/esm/Components/UpgradeButton/UpgradeButton.js +2 -4
- package/dist/esm/Components/UserDetails/AddUserModal.js +3 -3
- package/dist/esm/Components/UserDetails/ChangeRoleModal.js +2 -2
- package/dist/esm/Components/UserDetails/DeactivateConfirmModal.js +5 -5
- package/dist/esm/Components/UserDetails/UserDetails.js +15 -17
- package/dist/esm/Components/WorkspaceWindow/WorkspaceTrayPreview.js +1 -2
- package/dist/esm/Components/WorkspaceWindow/WorkspaceWindow.js +3 -4
- package/dist/esm/Theme/assertPalette.js +50 -0
- package/dist/esm/Theme/chakra/Avatar.styles.js +2 -2
- package/dist/esm/Theme/chakra/Drawer.styles.js +8 -10
- package/dist/esm/Theme/chakra/Modal.styles.js +8 -10
- package/dist/esm/Theme/chakra/Slider.styles.js +7 -9
- package/dist/esm/Theme/chakra/Tabs.styles.js +13 -18
- package/dist/esm/Theme/chakra/componentStyles.js +53 -44
- package/dist/esm/Theme/chakra/paletteFromTheme.js +9 -0
- package/dist/esm/Theme/provider/PixelizeThemeProvider.js +5 -0
- package/dist/esm/Theme/testing/testPalette.js +19 -0
- package/dist/esm/Theme/tokens/brands/emerald/palette.light.js +5 -4
- package/dist/esm/Theme/tokens/brands/index.js +28 -23
- package/dist/esm/Theme/tokens/brands/lavender/palette.light.js +3 -110
- package/dist/esm/Theme/tokens/brands/meadow/palette.light.js +5 -4
- package/dist/esm/Theme/tokens/brands/neutrals.js +116 -0
- package/dist/esm/Theme/tokens/brands/radiant/palette.light.js +5 -4
- package/dist/esm/Theme/tokens/brands/rosewood/palette.light.js +5 -4
- package/dist/esm/Theme/tokens/brands/skyline/palette.light.js +5 -4
- package/dist/esm/Theme/tokens/brands/slate/palette.light.js +6 -5
- package/dist/esm/Theme/tokens/brands/storefront/palette.light.js +5 -4
- package/dist/esm/Theme/tokens/brands/zinc/palette.dark.js +3 -2
- package/dist/esm/Theme/tokens/builders/accentText.js +8 -27
- package/dist/esm/Theme/tokens/builders/brandInk.js +103 -0
- package/dist/esm/Theme/tokens/builders/buildDarkPalette.js +17 -9
- package/dist/esm/Theme/tokens/builders/mutedText.js +5 -0
- package/dist/esm/Theme/tokens/builders/outlineRung.js +21 -19
- package/dist/esm/Theme/tokens/builders/resolvedRungs.js +20 -0
- package/dist/esm/Theme/tokens/builders/semanticText.js +17 -0
- package/dist/esm/Theme/tokens/builders/sidebarAccent.js +23 -0
- package/dist/esm/Theme/tokens/builders/statusTone.js +3 -4
- package/dist/esm/Theme/tokens/builders/surfaceRungs.js +33 -0
- package/dist/esm/Theme/useCustomTheme.js +4 -1
- package/dist/esm/Utils/table.js +28 -36
- package/dist/esm/index.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +9 -2
- package/package.json +1 -1
|
@@ -20,26 +20,14 @@ const KIND_ICON = {
|
|
|
20
20
|
tickets: lucide_react_1.Crown,
|
|
21
21
|
};
|
|
22
22
|
const LimitReachedModal = ({ isOpen, onClose, kind, limit = null, used = null, canManageBilling, onUpgrade, title, message, features, }) => {
|
|
23
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
24
23
|
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
25
24
|
const copy = (0, limitReachedCopy_1.resolveLimitCopy)(kind, canManageBilling);
|
|
26
25
|
const usage = (0, limitReachedCopy_1.formatLimitUsage)(kind, used, limit);
|
|
27
26
|
const KindIcon = KIND_ICON[kind];
|
|
28
|
-
|
|
29
|
-
// theme missing `primary`/`white`/`black` (a bare ChakraProvider, or a future
|
|
30
|
-
// palette shape change) threw here instead of falling back like the rest of
|
|
31
|
-
// the component does, so the header specifically went from possible-wrong-tint
|
|
32
|
-
// to fully unrendered.
|
|
33
|
-
const gradient = (_a = colors === null || colors === void 0 ? void 0 : colors.gradient) !== null && _a !== void 0 ? _a : {
|
|
34
|
-
from: (_c = (_b = colors === null || colors === void 0 ? void 0 : colors.primary) === null || _b === void 0 ? void 0 : _b[500]) !== null && _c !== void 0 ? _c : accentText_1.DEFAULT_BLACK,
|
|
35
|
-
to: (_e = (_d = colors === null || colors === void 0 ? void 0 : colors.primary) === null || _d === void 0 ? void 0 : _d[700]) !== null && _e !== void 0 ? _e : accentText_1.DEFAULT_BLACK,
|
|
36
|
-
};
|
|
27
|
+
const gradient = colors.gradient;
|
|
37
28
|
// Header banner uses the brand gradient (not a fixed blue/purple) so it reads correctly
|
|
38
29
|
// across all 9 brand themes, with ink picked for AA against whichever stop is lighter.
|
|
39
|
-
const ink = (0, accentText_1.onGradient)(gradient.from, gradient.to,
|
|
40
|
-
return ((0, jsx_runtime_1.jsxs)(react_1.Modal, { isOpen: isOpen, onClose: onClose, isCentered: true, size: "lg", motionPreset: "slideInBottom", children: [(0, jsx_runtime_1.jsx)(react_1.ModalOverlay, { backdropFilter: "blur(5px)" }), (0, jsx_runtime_1.jsxs)(react_1.ModalContent, { borderRadius: "xl", overflow: "hidden", boxShadow: "2xl", mx: 4, children: [(0, jsx_runtime_1.jsxs)(react_1.Box, { bgGradient: `linear(to-r, ${gradient.from}, ${gradient.to})`, color: ink, children: [(0, jsx_runtime_1.jsx)(react_1.ModalHeader, { pb: 4, children: (0, jsx_runtime_1.jsxs)(react_1.Flex, { align: "center", children: [(0, jsx_runtime_1.jsx)(react_1.Icon, { as: KindIcon, boxSize: "24px", mr: "12px" }), (0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "xl", fontWeight: "bold", children: title !== null && title !== void 0 ? title : copy.title })] }) }), (0, jsx_runtime_1.jsx)(react_1.ModalCloseButton, { "aria-label": "Dismiss", color: ink, _hover: { opacity: 0.7 } })] }), (0, jsx_runtime_1.jsxs)(react_1.ModalBody, { py: 6, children: [(0, jsx_runtime_1.jsx)(react_1.Text, { textAlign: "center", fontSize: "md", fontWeight: 600, color:
|
|
41
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
42
|
-
return ((0, jsx_runtime_1.jsxs)(react_1.ListItem, { display: "flex", alignItems: "center", fontSize: "sm", color: (_b = (_a = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _a === void 0 ? void 0 : _a[600]) !== null && _b !== void 0 ? _b : (_c = colors === null || colors === void 0 ? void 0 : colors.text) === null || _c === void 0 ? void 0 : _c[600], children: [(0, jsx_runtime_1.jsx)(react_1.ListIcon, { as: lucide_react_1.CheckCircle, color: (_f = (_e = (_d = colors === null || colors === void 0 ? void 0 : colors.semantic) === null || _d === void 0 ? void 0 : _d.success) === null || _e === void 0 ? void 0 : _e[500]) !== null && _f !== void 0 ? _f : (_g = colors === null || colors === void 0 ? void 0 : colors.green) === null || _g === void 0 ? void 0 : _g[500] }), feature] }, feature));
|
|
43
|
-
}) }))] }), (0, jsx_runtime_1.jsx)(react_1.Divider, {}), (0, jsx_runtime_1.jsx)(react_1.ModalFooter, { children: (0, jsx_runtime_1.jsxs)(react_1.HStack, { spacing: 3, children: [(0, jsx_runtime_1.jsx)(Button_1.default, { label: canManageBilling ? "Maybe later" : "Close", variant: "outline", colorScheme: "gray", size: "md", onClick: onClose }), canManageBilling && ((0, jsx_runtime_1.jsx)(UpgradeButton_1.default, { label: "Upgrade plan", size: "md", onClick: () => onUpgrade === null || onUpgrade === void 0 ? void 0 : onUpgrade() }))] }) })] })] }));
|
|
30
|
+
const ink = (0, accentText_1.onGradient)(gradient.from, gradient.to, colors.white, colors.black);
|
|
31
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Modal, { isOpen: isOpen, onClose: onClose, isCentered: true, size: "lg", motionPreset: "slideInBottom", children: [(0, jsx_runtime_1.jsx)(react_1.ModalOverlay, { backdropFilter: "blur(5px)" }), (0, jsx_runtime_1.jsxs)(react_1.ModalContent, { borderRadius: "xl", overflow: "hidden", boxShadow: "2xl", mx: 4, children: [(0, jsx_runtime_1.jsxs)(react_1.Box, { bgGradient: `linear(to-r, ${gradient.from}, ${gradient.to})`, color: ink, children: [(0, jsx_runtime_1.jsx)(react_1.ModalHeader, { pb: 4, children: (0, jsx_runtime_1.jsxs)(react_1.Flex, { align: "center", children: [(0, jsx_runtime_1.jsx)(react_1.Icon, { as: KindIcon, boxSize: "24px", mr: "12px" }), (0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "xl", fontWeight: "bold", children: title !== null && title !== void 0 ? title : copy.title })] }) }), (0, jsx_runtime_1.jsx)(react_1.ModalCloseButton, { "aria-label": "Dismiss", color: ink, _hover: { opacity: 0.7 } })] }), (0, jsx_runtime_1.jsxs)(react_1.ModalBody, { py: 6, children: [(0, jsx_runtime_1.jsx)(react_1.Text, { textAlign: "center", fontSize: "md", fontWeight: 600, color: colors.text[700], children: message !== null && message !== void 0 ? message : copy.message }), usage && ((0, jsx_runtime_1.jsx)(react_1.Text, { textAlign: "center", fontSize: "sm", color: colors.textMuted, mt: 2, children: usage })), features && features.length > 0 && ((0, jsx_runtime_1.jsx)(react_1.List, { spacing: 2, mt: 5, children: features.map((feature) => ((0, jsx_runtime_1.jsxs)(react_1.ListItem, { display: "flex", alignItems: "center", fontSize: "sm", color: colors.text[600], children: [(0, jsx_runtime_1.jsx)(react_1.ListIcon, { as: lucide_react_1.CheckCircle, color: colors.semanticText.success }), feature] }, feature))) }))] }), (0, jsx_runtime_1.jsx)(react_1.Divider, {}), (0, jsx_runtime_1.jsx)(react_1.ModalFooter, { children: (0, jsx_runtime_1.jsxs)(react_1.HStack, { spacing: 3, children: [(0, jsx_runtime_1.jsx)(Button_1.default, { label: canManageBilling ? "Maybe later" : "Close", variant: "outline", colorScheme: "gray", size: "md", onClick: onClose }), canManageBilling && ((0, jsx_runtime_1.jsx)(UpgradeButton_1.default, { label: "Upgrade plan", size: "md", onClick: () => onUpgrade === null || onUpgrade === void 0 ? void 0 : onUpgrade() }))] }) })] })] }));
|
|
44
32
|
};
|
|
45
33
|
exports.default = LimitReachedModal;
|
|
@@ -21,7 +21,7 @@ function Loading({ text, isLoading, onlytext, container }) {
|
|
|
21
21
|
if (!isLoading) {
|
|
22
22
|
return null;
|
|
23
23
|
}
|
|
24
|
-
return ((0, jsx_runtime_1.jsx)(react_1.Box, { position: container ? "absolute" : "fixed", top: "0", right: "0", bottom: "0", left: "0", backgroundColor: container ? "blackAlpha.500" : "blackAlpha.600", backdropFilter: container ? undefined : "blur(60px)", display: "flex", alignItems: "center", justifyContent: "center", flexDirection: "column", zIndex: container ? "10" : "9999", children: (0, jsx_runtime_1.jsx)(react_1.Center, { height: container ? "100%" : "100vh", children: !onlytext ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_1.Spinner, { thickness: "4px", speed: "0.65s", emptyColor: "gray.200", color: theme.colors.
|
|
24
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Box, { position: container ? "absolute" : "fixed", top: "0", right: "0", bottom: "0", left: "0", backgroundColor: container ? "blackAlpha.500" : "blackAlpha.600", backdropFilter: container ? undefined : "blur(60px)", display: "flex", alignItems: "center", justifyContent: "center", flexDirection: "column", zIndex: container ? "10" : "9999", children: (0, jsx_runtime_1.jsx)(react_1.Center, { height: container ? "100%" : "100vh", children: !onlytext ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_1.Spinner, { thickness: "4px", speed: "0.65s", emptyColor: "gray.200", color: theme.colors.accentText, size: "xl" }), (0, jsx_runtime_1.jsx)(react_1.Text, { mt: "2", ml: "5", children: text })] })) : ((0, jsx_runtime_1.jsx)(react_1.Text, { mt: "2", ml: "5", fontSize: "50px", textTransform: "uppercase", fontWeight: 500, css: (0, react_2.css) `
|
|
25
25
|
animation: ${colorTransition} 2s infinite;
|
|
26
26
|
`, children: text })) }) }));
|
|
27
27
|
}
|
|
@@ -8,6 +8,7 @@ exports.default = Modal;
|
|
|
8
8
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
9
9
|
const react_1 = __importDefault(require("react"));
|
|
10
10
|
const react_2 = require("@chakra-ui/react");
|
|
11
|
+
const useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
11
12
|
const ModalHeader = ({ children }) => {
|
|
12
13
|
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
|
|
13
14
|
};
|
|
@@ -21,6 +22,7 @@ const ModalFooter = ({ children }) => {
|
|
|
21
22
|
};
|
|
22
23
|
exports.ModalFooter = ModalFooter;
|
|
23
24
|
function Modal({ size, isOpen = false, onClose, overlaybg = "blackAlpha.300", overlaybackdropFilter = "blur(10px) hue-rotate(90deg)", overlaybackdropInvert, overlaybackdropBlur, isCentered, finalFocusRef, blockScrollOnMount, initialFocusRef, closeOnOverlayClick, motionPreset, scrollBehavior, children, isLoading, }) {
|
|
25
|
+
const theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
24
26
|
if (!isOpen)
|
|
25
27
|
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
|
|
26
28
|
const isReactElement = (child) => {
|
|
@@ -36,5 +38,5 @@ function Modal({ size, isOpen = false, onClose, overlaybg = "blackAlpha.300", ov
|
|
|
36
38
|
height: "100%",
|
|
37
39
|
width: "100%",
|
|
38
40
|
padding: "25%",
|
|
39
|
-
}, children: (0, jsx_runtime_1.jsx)(react_2.Spinner, { thickness: "4px", speed: "0.65s", emptyColor:
|
|
41
|
+
}, children: (0, jsx_runtime_1.jsx)(react_2.Spinner, { thickness: "4px", speed: "0.65s", emptyColor: theme.colors.gray[200], color: theme.colors.accentText, size: "xl" }) })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [header && (0, jsx_runtime_1.jsx)(react_2.ModalHeader, { children: header }), (0, jsx_runtime_1.jsx)(react_2.ModalCloseButton, {}), (0, jsx_runtime_1.jsx)(react_2.ModalBody, { children: body }), footer && (0, jsx_runtime_1.jsx)(react_2.ModalFooter, { children: footer })] })) })] }));
|
|
40
42
|
}
|
|
@@ -4,21 +4,17 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
4
4
|
const react_1 = require("@chakra-ui/react");
|
|
5
5
|
const useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
6
6
|
const MoreItems = ({ items, moreCount, triggerText, colorResolver, hideDots = false, columns = 2, minWidth = "260px", triggerMaxWidth = "250px", trigger = "hover", placement = "bottom-start", }) => {
|
|
7
|
-
var _a, _b;
|
|
8
7
|
const theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
9
8
|
const count = moreCount !== null && moreCount !== void 0 ? moreCount : items.length;
|
|
10
9
|
if (count <= 0)
|
|
11
10
|
return triggerText ? (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: triggerText }) : null;
|
|
12
|
-
return ((0, jsx_runtime_1.jsxs)(react_1.Popover, { trigger: trigger, placement: placement, isLazy: true, children: [(0, jsx_runtime_1.jsx)(react_1.PopoverTrigger, { children: (0, jsx_runtime_1.jsxs)(react_1.Box, { display: "inline-flex", alignItems: "center", maxW: triggerMaxWidth, cursor: "pointer", children: [triggerText !== undefined && ((0, jsx_runtime_1.jsx)(react_1.Box, { as: "span", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", children: triggerText })), (0, jsx_runtime_1.jsxs)(react_1.Box, { as: "span", ml: "6px", px: "8px", py: "1px", fontSize: "12px", fontWeight: 600, lineHeight: "1.4", borderRadius: "full", color:
|
|
11
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Popover, { trigger: trigger, placement: placement, isLazy: true, children: [(0, jsx_runtime_1.jsx)(react_1.PopoverTrigger, { children: (0, jsx_runtime_1.jsxs)(react_1.Box, { display: "inline-flex", alignItems: "center", maxW: triggerMaxWidth, cursor: "pointer", children: [triggerText !== undefined && ((0, jsx_runtime_1.jsx)(react_1.Box, { as: "span", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", children: triggerText })), (0, jsx_runtime_1.jsxs)(react_1.Box, { as: "span", ml: "6px", px: "8px", py: "1px", fontSize: "12px", fontWeight: 600, lineHeight: "1.4", borderRadius: "full", color: theme.colors.accentText, bg: theme.colors.primary[50], transition: "all 0.15s ease", _hover: { bg: theme.colors.primary[100] }, children: ["+", count, " more"] })] }) }), (0, jsx_runtime_1.jsxs)(react_1.PopoverContent, { width: "auto", minWidth: minWidth, maxH: "280px", overflowY: "auto", borderRadius: "xl",
|
|
13
12
|
// Chakra defaults this surface to `colors.gray.700` in dark, which against the
|
|
14
13
|
// swapped (dark-inverted) palette is a *light* grey — wrong for a popover bg. Pin it.
|
|
15
14
|
bg: theme.colors.background[50], boxShadow: "lg", _focus: { outline: "none", boxShadow: "lg" }, children: [(0, jsx_runtime_1.jsx)(react_1.PopoverArrow, { bg: theme.colors.background[50] }), (0, jsx_runtime_1.jsx)(react_1.PopoverBody, { p: 3, children: (0, jsx_runtime_1.jsx)(react_1.SimpleGrid, { columns: columns, spacingX: 4, spacingY: 2, children: items === null || items === void 0 ? void 0 : items.map((item, index) => {
|
|
16
15
|
var _a, _b, _c;
|
|
17
|
-
const color = (_b = (_a = item.color) !== null && _a !== void 0 ? _a : colorResolver === null || colorResolver === void 0 ? void 0 : colorResolver(item)) !== null && _b !== void 0 ? _b : theme.colors.
|
|
18
|
-
return ((0, jsx_runtime_1.jsxs)(react_1.Box, { display: "flex", alignItems: "center", gap: "8px", minW: 0, children: [!hideDots && ((0, jsx_runtime_1.jsx)(react_1.Box, { flexShrink: 0, width: "8px", height: "8px", borderRadius: "full", bg: color })), (0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "13px",
|
|
19
|
-
// gray[500]: the library's verified muted-text token (clears AA against
|
|
20
|
-
// every named surface), rather than an arbitrary local rung.
|
|
21
|
-
color: theme.colors.gray[500], overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", children: item.label })] }, (_c = item.id) !== null && _c !== void 0 ? _c : index));
|
|
16
|
+
const color = (_b = (_a = item.color) !== null && _a !== void 0 ? _a : colorResolver === null || colorResolver === void 0 ? void 0 : colorResolver(item)) !== null && _b !== void 0 ? _b : theme.colors.textMuted;
|
|
17
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Box, { display: "flex", alignItems: "center", gap: "8px", minW: 0, children: [!hideDots && ((0, jsx_runtime_1.jsx)(react_1.Box, { flexShrink: 0, width: "8px", height: "8px", borderRadius: "full", bg: color })), (0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "13px", color: theme.colors.textMuted, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", children: item.label })] }, (_c = item.id) !== null && _c !== void 0 ? _c : index));
|
|
22
18
|
}) }) })] })] }));
|
|
23
19
|
};
|
|
24
20
|
exports.default = MoreItems;
|
|
@@ -22,7 +22,6 @@ const generateUniqueId = (() => {
|
|
|
22
22
|
};
|
|
23
23
|
})();
|
|
24
24
|
function MultiSelect({ value, onValueChange, width = "100%", label = "label", isRequired = true, isInformation = false, informationMessage = "", name, id, placeholderText = "Type valid email and press enter", isDisabled, isReadOnly, size = "md", inputStyle, helperText, error, errorMessage, }) {
|
|
25
|
-
var _a, _b, _c, _d;
|
|
26
25
|
const theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
27
26
|
const s = (0, searchSelectSize_1.getSearchSelectSizeStyles)((size || "md"));
|
|
28
27
|
const options = value;
|
|
@@ -61,14 +60,14 @@ function MultiSelect({ value, onValueChange, width = "100%", label = "label", is
|
|
|
61
60
|
// [800], not [500]: WCAG 1.4.11 needs >=3.0 for a control boundary against any named
|
|
62
61
|
// surface up to `muted` (lightest); [500] fails there, [800] clears all with margin.
|
|
63
62
|
borderColor: error || localError
|
|
64
|
-
? theme.colors.
|
|
65
|
-
:
|
|
63
|
+
? theme.colors.semanticText.error
|
|
64
|
+
: theme.colors.boxborder[800], borderRadius: "lg", bg: theme.colors.gray[50], minH: s.minH, transition: "border-color 0.2s, box-shadow 0.2s", _focusWithin: {
|
|
66
65
|
borderColor: error || localError
|
|
67
|
-
? theme.colors.
|
|
66
|
+
? theme.colors.semanticText.error
|
|
68
67
|
: theme.colors.primary[500],
|
|
69
68
|
boxShadow: `0 0 0 0.125rem ${error || localError
|
|
70
|
-
?
|
|
71
|
-
:
|
|
69
|
+
? theme.colors.boxShadow.error
|
|
70
|
+
: theme.colors.boxShadow.primary}`,
|
|
72
71
|
}, children: [options.map((option) => ((0, jsx_runtime_1.jsx)(Tag_1.default, { size: s.tagSize, colorScheme: "primary", label: option.label, onIconClick: () => handleRemove(option), icon: lucide_react_1.X }, option.id))), (0, jsx_runtime_1.jsx)(react_2.Input, { ref: inputRef, type: "text", value: inputValue, isDisabled: isDisabled, isReadOnly: isReadOnly, id: id, name: name, size: size, variant: "unstyled", h: s.fieldHeight, minH: s.fieldHeight, fontSize: s.fieldFontSize, fontWeight: "500", color: theme.colors.gray[700], letterSpacing: "0.02em", flex: "1", minW: 0, style: {
|
|
73
72
|
backgroundColor: "transparent",
|
|
74
73
|
...inputStyle,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { NavbarProps } from "./NavigationBarProps";
|
|
2
|
-
export default function NavBar({ userAvathar, userName, userRole, navMenu, moreIcon, handleNavOnClick, handleLogout, logoutText, navigationBarText, sideBarToggole, onSideBarToggole, forceSideBarToggle, }: NavbarProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function NavBar({ userAvathar, userName, userRole, navMenu, moreIcon, handleNavOnClick, handleLogout, logoutText, navigationBarText, sideBarToggole, onSideBarToggole, forceSideBarToggle, onSideBarPeek, }: NavbarProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,10 +6,18 @@ const react_1 = require("@chakra-ui/react");
|
|
|
6
6
|
const useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
7
7
|
const accentText_1 = require("../../Theme/tokens/builders/accentText");
|
|
8
8
|
const outlineRung_1 = require("../../Theme/tokens/builders/outlineRung");
|
|
9
|
+
const statusTone_1 = require("../../Theme/tokens/builders/statusTone");
|
|
9
10
|
const lucide_react_1 = require("lucide-react");
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
// Roomy enough to hover without aiming: the glyph is only 1.25rem.
|
|
12
|
+
const SIDEBAR_TOGGLE_HIT = "2.5rem";
|
|
13
|
+
function NavBar({ userAvathar, userName, userRole, navMenu, moreIcon, handleNavOnClick, handleLogout, logoutText, navigationBarText, sideBarToggole, onSideBarToggole, forceSideBarToggle = false, onSideBarPeek, }) {
|
|
12
14
|
const theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
15
|
+
// For a near-neutral brand (e.g. zinc), `primary[50]` is itself a pale near-white tint — on
|
|
16
|
+
// the menu's own near-white surface that measured as low as ~1.02:1, an invisible hover.
|
|
17
|
+
const menuHoverBg = (0, outlineRung_1.resolveHoverTint)(theme.colors.primary[50], theme.colors.backgroundColor.light);
|
|
18
|
+
const barHoverBg = (0, outlineRung_1.resolveHoverTint)(theme.colors.gray[100], theme.colors.backgroundColor.light);
|
|
19
|
+
const menuHoverInk = (0, accentText_1.accentTextOnCanvas)(theme.colors.primary, menuHoverBg);
|
|
20
|
+
const dangerTone = (0, statusTone_1.resolveStatusTone)(theme.colors.semantic.error, (0, accentText_1.isDarkCanvas)(theme.colors.backgroundColor.main) ? "dark" : "light");
|
|
13
21
|
// Shared rounded pill affordance for the bar's icon controls.
|
|
14
22
|
const iconButtonStyle = {
|
|
15
23
|
w: "1.75rem",
|
|
@@ -21,12 +29,8 @@ function NavBar({ userAvathar, userName, userRole, navMenu, moreIcon, handleNavO
|
|
|
21
29
|
border: "none",
|
|
22
30
|
bg: "transparent",
|
|
23
31
|
transition: "background 0.15s",
|
|
24
|
-
_hover: { bg:
|
|
32
|
+
_hover: { bg: barHoverBg },
|
|
25
33
|
};
|
|
26
|
-
// For a near-neutral brand (e.g. zinc), `primary[50]` is itself a pale near-white tint — on
|
|
27
|
-
// the menu's own near-white surface that measured as low as ~1.02:1, an invisible hover.
|
|
28
|
-
const menuHoverBg = (0, outlineRung_1.resolveHoverTint)(theme.colors.primary[50], (_d = (_b = (_a = theme.colors.backgroundColor) === null || _a === void 0 ? void 0 : _a.light) !== null && _b !== void 0 ? _b : (_c = theme.colors.background) === null || _c === void 0 ? void 0 : _c[50]) !== null && _d !== void 0 ? _d : accentText_1.DEFAULT_CANVAS);
|
|
29
|
-
// Light elevated pill item.
|
|
30
34
|
const menuItemStyle = {
|
|
31
35
|
bg: "transparent",
|
|
32
36
|
borderRadius: "lg",
|
|
@@ -37,28 +41,28 @@ function NavBar({ userAvathar, userName, userRole, navMenu, moreIcon, handleNavO
|
|
|
37
41
|
py: "0.5rem",
|
|
38
42
|
fontWeight: 500,
|
|
39
43
|
fontSize: "13px",
|
|
40
|
-
color:
|
|
44
|
+
color: theme.colors.text[900],
|
|
41
45
|
gap: theme.space["2"],
|
|
42
46
|
transition: "background 0.12s",
|
|
43
|
-
_hover: { bg: menuHoverBg, color:
|
|
44
|
-
_focus: { bg: menuHoverBg, color:
|
|
45
|
-
_active: { bg: menuHoverBg, color:
|
|
47
|
+
_hover: { bg: menuHoverBg, color: menuHoverInk },
|
|
48
|
+
_focus: { bg: menuHoverBg, color: menuHoverInk },
|
|
49
|
+
_active: { bg: menuHoverBg, color: menuHoverInk },
|
|
46
50
|
};
|
|
47
|
-
return ((0, jsx_runtime_1.jsx)(react_1.Box, { bg: theme.colors.backgroundColor.light, px: 4, borderBottom: "1px solid", borderColor:
|
|
51
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Box, { bg: theme.colors.backgroundColor.light, px: 4, borderBottom: "1px solid", borderColor: theme.colors.border[500], children: (0, jsx_runtime_1.jsxs)(react_1.Flex, { h: 16, alignItems: "center", justifyContent: "space-between", children: [(0, jsx_runtime_1.jsxs)(react_1.Box, { display: "flex", gap: 1.5, alignItems: "center", children: [(0, jsx_runtime_1.jsx)(react_1.Box, { as: "button", type: "button", onClick: () => onSideBarToggole === null || onSideBarToggole === void 0 ? void 0 : onSideBarToggole(), onMouseEnter: onSideBarPeek, onFocus: onSideBarPeek, "aria-label": sideBarToggole ? "Close navigation menu" : "Open navigation menu", "aria-expanded": !!sideBarToggole, ...iconButtonStyle, display: forceSideBarToggle ? "flex" : { base: "flex", lg: "none" }, w: SIDEBAR_TOGGLE_HIT, h: SIDEBAR_TOGGLE_HIT, children: sideBarToggole ? ((0, jsx_runtime_1.jsx)(lucide_react_1.PanelLeftClose, { size: "1.25rem" })) : ((0, jsx_runtime_1.jsx)(lucide_react_1.PanelRightClose, { size: "1.25rem" })) }), (navigationBarText === null || navigationBarText === void 0 ? void 0 : navigationBarText.onIconClick) && ((0, jsx_runtime_1.jsx)(react_1.Box, { ...iconButtonStyle, as: "button", type: "button", "aria-label": "Go back", display: "flex", onClick: () => { var _a; return (_a = navigationBarText === null || navigationBarText === void 0 ? void 0 : navigationBarText.onIconClick) === null || _a === void 0 ? void 0 : _a.call(navigationBarText); }, children: (0, jsx_runtime_1.jsx)(lucide_react_1.CircleArrowLeft, { size: "1.25rem", color: theme.colors.text[500] }) })), (navigationBarText === null || navigationBarText === void 0 ? void 0 : navigationBarText.text) && ((0, jsx_runtime_1.jsx)(react_1.Text, { color: (0, accentText_1.accentTextOnCanvas)(theme.colors.secondary, theme.colors.backgroundColor.light), fontSize: "1.25rem", fontWeight: 600, fontFamily: "open-sans, sans-serif", letterSpacing: "-0.013rem", children: navigationBarText === null || navigationBarText === void 0 ? void 0 : navigationBarText.text }))] }), (0, jsx_runtime_1.jsx)(react_1.Flex, { minW: 0, flexShrink: 1, children: (0, jsx_runtime_1.jsxs)(react_1.Stack, { direction: "row", alignItems: "center", spacing: 4, minW: 0, children: [moreIcon && ((0, jsx_runtime_1.jsx)(react_1.Box, { display: "flex", alignItems: "center", minW: 0, children: moreIcon })), (0, jsx_runtime_1.jsxs)(react_1.Menu, { children: [(0, jsx_runtime_1.jsx)(react_1.MenuButton, { as: react_1.Button, rounded: "full", variant: "link", cursor: "pointer", minW: 0, flexShrink: 0, children: (0, jsx_runtime_1.jsx)(react_1.Avatar, { size: "sm", name: userName, src: userAvathar }) }), (0, jsx_runtime_1.jsx)(react_1.MenuList, { alignItems: "center", zIndex: 5, p: 0, py: "0.375rem",
|
|
48
52
|
// Without a cap one long title stretches the whole dropdown; titles truncate instead.
|
|
49
53
|
maxW: "18rem", bg: theme.colors.backgroundColor.light,
|
|
50
54
|
// Chakra's MenuItem renders `background: var(--menu-bg)` at rest; its MenuList
|
|
51
55
|
// baseStyle hardcodes that var to "#fff" (gated behind `_dark`, which this theme-swap
|
|
52
56
|
// app never triggers). The `bg` prop above only recolors the list itself, not the
|
|
53
57
|
// inherited var, so items fall back to white until hover/focus — set the var too.
|
|
54
|
-
sx: { "--menu-bg": theme.colors.backgroundColor.light }, border: "1px solid", borderColor:
|
|
58
|
+
sx: { "--menu-bg": theme.colors.backgroundColor.light }, border: "1px solid", borderColor: theme.colors.boxborder[500], borderRadius: "xl", boxShadow: "lg", color: theme.colors.text[900], overflow: "hidden", children: (0, jsx_runtime_1.jsxs)(react_1.Box, { display: "flex", flexDirection: "column", maxH: "90vh", children: [(0, jsx_runtime_1.jsx)(react_1.Center, { pt: 4, pb: 2, children: (0, jsx_runtime_1.jsx)(react_1.Avatar, { size: "xl", name: userName, src: userAvathar }) }), (0, jsx_runtime_1.jsxs)(react_1.Center, { flexDirection: "column", gap: "0.125rem", pb: 2, px: 4, children: [(0, jsx_runtime_1.jsx)(react_1.Text, { fontWeight: 600, fontSize: "14px", color: theme.colors.text[900], isTruncated: true, maxW: "100%", children: userName }), userRole && ((0, jsx_runtime_1.jsx)(react_1.Text, { fontSize: "11px", color: theme.colors.text[500], isTruncated: true, maxW: "100%", children: userRole }))] }), (0, jsx_runtime_1.jsx)(react_1.MenuDivider, { borderColor: theme.colors.border[500] }), (0, jsx_runtime_1.jsx)(react_1.Box, { flex: 1, overflowY: "auto", overflowX: "hidden", children: navMenu === null || navMenu === void 0 ? void 0 : navMenu.map((menu, idx) => {
|
|
55
59
|
var _a, _b, _c, _d;
|
|
56
60
|
return ((0, jsx_runtime_1.jsxs)(react_1.MenuItem, { onClick: () => handleNavOnClick(menu.url), sx: menuItemStyle, children: [menu.icon && ((0, jsx_runtime_1.jsx)(react_1.Box, { display: "flex", alignItems: "center", flexShrink: 0, sx: { "& svg": { width: "16px", height: "16px" } }, children: menu === null || menu === void 0 ? void 0 : menu.icon })), (0, jsx_runtime_1.jsx)(react_1.Box, { minW: 0, isTruncated: true, title: String((_a = menu.title) !== null && _a !== void 0 ? _a : ""), children: menu.title })] }, `${String((_d = (_c = (_b = menu.id) !== null && _b !== void 0 ? _b : menu.url) !== null && _c !== void 0 ? _c : menu.title) !== null && _d !== void 0 ? _d : idx)}-${idx}`));
|
|
57
|
-
}) }), (0, jsx_runtime_1.jsx)(react_1.MenuDivider, { borderColor:
|
|
61
|
+
}) }), (0, jsx_runtime_1.jsx)(react_1.MenuDivider, { borderColor: theme.colors.border[500] }), (0, jsx_runtime_1.jsxs)(react_1.MenuItem, { onClick: handleLogout, sx: {
|
|
58
62
|
...menuItemStyle,
|
|
59
|
-
color:
|
|
60
|
-
_hover: { bg:
|
|
61
|
-
_focus: { bg:
|
|
62
|
-
_active: { bg:
|
|
63
|
+
color: theme.colors.semanticText.error,
|
|
64
|
+
_hover: { bg: dangerTone.bg, color: dangerTone.fg },
|
|
65
|
+
_focus: { bg: dangerTone.bg, color: dangerTone.fg },
|
|
66
|
+
_active: { bg: dangerTone.bg, color: dangerTone.fg },
|
|
63
67
|
}, children: [(0, jsx_runtime_1.jsx)(react_1.Box, { display: "flex", alignItems: "center", flexShrink: 0, children: (0, jsx_runtime_1.jsx)(lucide_react_1.LogOut, { size: 16 }) }), (0, jsx_runtime_1.jsx)(react_1.Box, { minW: 0, isTruncated: true, title: String(logoutText !== null && logoutText !== void 0 ? logoutText : ""), children: logoutText })] })] }) })] })] }) })] }) }));
|
|
64
68
|
}
|
|
@@ -21,6 +21,11 @@ export type NavbarProps = {
|
|
|
21
21
|
* (hamburger shows only below `lg`).
|
|
22
22
|
*/
|
|
23
23
|
forceSideBarToggle?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Hovering the sidebar toggle peeks the sidebar open without pinning it. Wire this to the
|
|
26
|
+
* same state the SideBar's `peekOpen` reads; it closes itself when the pointer leaves.
|
|
27
|
+
*/
|
|
28
|
+
onSideBarPeek?: () => void;
|
|
24
29
|
};
|
|
25
30
|
export type MenuProps = {
|
|
26
31
|
id?: string | number;
|
|
@@ -14,7 +14,6 @@ const countWords = (text = "") => {
|
|
|
14
14
|
return t.split(/\s+/).length;
|
|
15
15
|
};
|
|
16
16
|
function NoteTextArea({ width = "100%", handleSubmit, handleCancel, value, title, file, isEditable = false, saveButtonLoading, maxFileSize = 1 * 1024 * 1024, maxFilesSizeError = "Some files are too large. Maximum allowed size is", maxNoteWordCount = 15, onChange, ref: inputRef, customPlaceholder = "Add a note...", cancelButtonHide = false, }) {
|
|
17
|
-
var _a;
|
|
18
17
|
const theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
19
18
|
const noteAreaRef = (0, react_1.useRef)(null);
|
|
20
19
|
const [isActive, setIsActive] = (0, react_1.useState)(false);
|
|
@@ -118,17 +117,14 @@ function NoteTextArea({ width = "100%", handleSubmit, handleCancel, value, title
|
|
|
118
117
|
};
|
|
119
118
|
const noteWordCount = countWords(noteValue);
|
|
120
119
|
const isOverLimit = noteWordCount > maxNoteWordCount;
|
|
121
|
-
return ((0, jsx_runtime_1.jsxs)(react_2.Box, { w: width, borderRadius: fieldStyles_1.FIELD_RADIUS, overflow: "hidden", border: "1px solid",
|
|
122
|
-
// [800], not [500]: WCAG 1.4.11 needs >=3.0 for a control boundary against any named
|
|
123
|
-
// surface up to `muted` (lightest); [500] fails there, [800] clears all with margin.
|
|
124
|
-
borderColor: isActive ? theme.colors.primary[500] : (_a = theme.colors.boxborder) === null || _a === void 0 ? void 0 : _a[800], bg: isActive ? theme.colors.gray[50] : theme.colors.background[50], transition: "border-color 0.2s", children: [!isActive && ((0, jsx_runtime_1.jsxs)(react_2.Flex, { px: 3, gap: 2, align: "center", cursor: "text", onClick: handleTextArea, bg: theme.colors.background[50], borderRadius: fieldStyles_1.FIELD_RADIUS, minH: "2.5rem", transition: "background 0.15s", _hover: { bg: theme.colors.gray[50] }, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.SquarePen, { size: 16, color: theme.colors.gray[500] }), (0, jsx_runtime_1.jsx)(react_2.Text, { color: theme.colors.gray[500], fontSize: "sm", children: customPlaceholder })] })), isActive && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(react_2.Box, { bg: theme.colors.background[50], children: [titleShow && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_2.Input, { ref: inputRef, value: titleValue, onChange: (e) => {
|
|
120
|
+
return ((0, jsx_runtime_1.jsxs)(react_2.Box, { w: width, borderRadius: fieldStyles_1.FIELD_RADIUS, overflow: "hidden", border: "1px solid", borderColor: isActive ? theme.colors.primary[500] : theme.colors.boxborder[500], bg: isActive ? theme.colors.gray[50] : theme.colors.background[50], transition: "border-color 0.2s", children: [!isActive && ((0, jsx_runtime_1.jsxs)(react_2.Flex, { px: 3, gap: 2, align: "center", cursor: "text", onClick: handleTextArea, bg: theme.colors.background[50], borderRadius: fieldStyles_1.FIELD_RADIUS, minH: "2.5rem", transition: "background 0.15s", _hover: { bg: theme.colors.gray[50] }, children: [(0, jsx_runtime_1.jsx)(lucide_react_1.SquarePen, { size: 16, color: theme.colors.textMuted }), (0, jsx_runtime_1.jsx)(react_2.Text, { color: theme.colors.textMuted, fontSize: "sm", children: customPlaceholder })] })), isActive && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(react_2.Box, { bg: theme.colors.background[50], children: [titleShow && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_2.Input, { ref: inputRef, value: titleValue, onChange: (e) => {
|
|
125
121
|
if (e.target.value.length === 0)
|
|
126
122
|
setTitleShow(false);
|
|
127
123
|
setTitleValue(e.target.value);
|
|
128
124
|
}, placeholder: "Add a title...", variant: "unstyled", px: 3, pt: 2.5, pb: 1.5, fontWeight: 600, fontSize: "0.875rem", color: theme.colors.text[700], _placeholder: {
|
|
129
125
|
fontStyle: "italic",
|
|
130
|
-
color: theme.colors.
|
|
131
|
-
} }), (0, jsx_runtime_1.jsx)(react_2.Divider, { borderColor: theme.colors.gray[200] })] })), (0, jsx_runtime_1.jsx)(react_2.Box, { bg: theme.colors.background[50], minH: "76px", px: 3, pt: 2.5, position: "relative", children: (0, jsx_runtime_1.jsx)(react_2.Textarea, { ref: noteAreaRef, value: noteValue, onChange: handleNoteChange, placeholder: customPlaceholder, variant: "unstyled", resize: "none", minH: "76px", fontSize: "0.75rem", color: theme.colors.text[700], _placeholder: { fontStyle: "italic", color: theme.colors.
|
|
126
|
+
color: theme.colors.textMuted,
|
|
127
|
+
} }), (0, jsx_runtime_1.jsx)(react_2.Divider, { borderColor: theme.colors.gray[200] })] })), (0, jsx_runtime_1.jsx)(react_2.Box, { bg: theme.colors.background[50], minH: "76px", px: 3, pt: 2.5, position: "relative", children: (0, jsx_runtime_1.jsx)(react_2.Textarea, { ref: noteAreaRef, value: noteValue, onChange: handleNoteChange, placeholder: customPlaceholder, variant: "unstyled", resize: "none", minH: "76px", fontSize: "0.75rem", color: theme.colors.text[700], _placeholder: { fontStyle: "italic", color: theme.colors.textMuted }, style: { overflow: "hidden" }, p: 0 }) })] }), (0, jsx_runtime_1.jsx)(react_2.Divider, { borderColor: theme.colors.gray[200] }), (0, jsx_runtime_1.jsxs)(react_2.Box, { px: 3, py: 2.5, children: [(0, jsx_runtime_1.jsxs)(react_2.Flex, { align: "center", justify: "space-between", w: "100%", gap: 3, children: [(0, jsx_runtime_1.jsxs)(react_2.Flex, { align: "center", gap: 2, minW: 0, children: [(0, jsx_runtime_1.jsx)(react_2.Tooltip, { label: "Attach files", hasArrow: true, placement: "top", children: (0, jsx_runtime_1.jsx)(react_2.Box, { as: "label", htmlFor: "file-upload", cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "center", w: "1.75rem", h: "1.75rem", borderRadius: "md", color: theme.colors.textMuted, transition: "background 0.15s", _hover: { bg: theme.colors.gray[100] }, children: (0, jsx_runtime_1.jsx)(lucide_react_1.Paperclip, { size: 16 }) }) }), (0, jsx_runtime_1.jsx)(react_2.Box, { h: "1rem", w: "1px", bg: theme.colors.gray[200] }), !titleShow ? ((0, jsx_runtime_1.jsx)(react_2.Box, { as: "button", type: "button", onClick: () => setTitleShow(true), px: 2, py: 1, borderRadius: "md", color: theme.colors.textMuted, fontWeight: 500, fontSize: "sm", transition: "background 0.15s", _hover: { bg: theme.colors.gray[100] }, children: "+ Add a title" })) : ((0, jsx_runtime_1.jsx)(react_2.Tooltip, { label: titleValue, hasArrow: true, isDisabled: !titleValue, children: (0, jsx_runtime_1.jsx)(react_2.Text, { color: theme.colors.textMuted, fontSize: "sm", fontWeight: 500, isTruncated: true, maxW: "180px", children: titleValue || "Title" }) }))] }), (0, jsx_runtime_1.jsxs)(react_2.Flex, { gap: 2.5, align: "center", ml: "auto", flexShrink: 0, children: [(0, jsx_runtime_1.jsxs)(react_2.Text, { fontSize: "xs", fontWeight: 500, color: isOverLimit ? theme.colors.semanticText.error : theme.colors.textMuted, whiteSpace: "nowrap", children: [noteWordCount, "/", maxNoteWordCount] }), cancelButtonHide ? null : ((0, jsx_runtime_1.jsx)(react_2.Button, { size: "sm", variant: "ghost", colorScheme: "gray", onClick: handleCloseTextArea, children: "Cancel" })), (0, jsx_runtime_1.jsxs)(react_2.Button, { size: "sm", variant: "solid", isLoading: !!saveButtonLoading, isDisabled: !noteValue || isSaveDisabled, onClick: () => handleSubmit(noteValue, titleValue, files), children: [saveButtonLoading ? ((0, jsx_runtime_1.jsx)(react_2.Spinner, { size: "xs", thickness: "2px", mr: 2 })) : null, "Save"] })] })] }), (0, jsx_runtime_1.jsx)("input", { id: "file-upload", type: "file", style: { display: "none" }, onChange: (e) => {
|
|
132
128
|
const newFiles = Array.from(e.target.files || []);
|
|
133
129
|
const validFiles = newFiles.filter((f) => f.size <= maxFileSize);
|
|
134
130
|
const invalidFiles = newFiles.filter((f) => f.size > maxFileSize);
|
|
@@ -141,5 +137,5 @@ function NoteTextArea({ width = "100%", handleSubmit, handleCancel, value, title
|
|
|
141
137
|
if (validFiles.length > 0) {
|
|
142
138
|
setFiles((prev) => [...prev, ...validFiles]);
|
|
143
139
|
}
|
|
144
|
-
}, multiple: true }), fileError && ((0, jsx_runtime_1.jsx)(react_2.Text, { color: theme.colors.
|
|
140
|
+
}, multiple: true }), fileError && ((0, jsx_runtime_1.jsx)(react_2.Text, { color: theme.colors.semanticText.error, mt: 2, fontSize: "xs", children: fileError })), files.length > 0 && ((0, jsx_runtime_1.jsx)(react_2.Flex, { mt: 3, gap: 2, wrap: "wrap", children: files.map((f, idx) => ((0, jsx_runtime_1.jsxs)(react_2.Flex, { align: "center", gap: 2, pl: 2.5, pr: 1.5, py: 1, borderRadius: "full", bg: theme.colors.gray[100], maxW: "100%", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.File, { size: 13, color: theme.colors.textMuted }), (0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: "xs", color: theme.colors.text[700], isTruncated: true, maxW: "160px", children: shortenFileName(f.name) }), (0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: "xs", color: theme.colors.textMuted, whiteSpace: "nowrap", children: formatBytes(f.size) }), (0, jsx_runtime_1.jsx)(react_2.Box, { as: "button", type: "button", display: "flex", alignItems: "center", justifyContent: "center", borderRadius: "full", p: 0.5, color: theme.colors.textMuted, transition: "all 0.15s", _hover: { bg: theme.colors.gray[200], color: theme.colors.semanticText.error }, onClick: () => setFiles((prev) => prev.filter((fileItem) => fileItem !== f)), children: (0, jsx_runtime_1.jsx)(lucide_react_1.X, { size: 13 }) })] }, idx))) }))] })] }))] }));
|
|
145
141
|
}
|
|
@@ -6,18 +6,20 @@ const react_2 = require("@chakra-ui/react");
|
|
|
6
6
|
const lucide_react_1 = require("lucide-react");
|
|
7
7
|
const useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
8
8
|
const accentText_1 = require("../../Theme/tokens/builders/accentText");
|
|
9
|
+
const statusTone_1 = require("../../Theme/tokens/builders/statusTone");
|
|
9
10
|
const Notification = ({ notification, onClose, showStatus, onClick, isLoading = false, colors, }) => {
|
|
11
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
10
12
|
const theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
//
|
|
18
|
-
const warningColor = (colors === null || colors === void 0 ? void 0 : colors.warningColor)
|
|
19
|
-
const errorColor = (colors === null || colors === void 0 ? void 0 : colors.errorColor)
|
|
20
|
-
const successColor = (colors === null || colors === void 0 ? void 0 : colors.successColor)
|
|
13
|
+
const mode = (0, accentText_1.isDarkCanvas)(theme.colors.backgroundColor.main) ? "dark" : "light";
|
|
14
|
+
const closeTone = (0, statusTone_1.resolveStatusTone)(theme.colors.semantic.error, mode);
|
|
15
|
+
const bgColor = (_a = colors === null || colors === void 0 ? void 0 : colors.bgColor) !== null && _a !== void 0 ? _a : theme.colors.background[50];
|
|
16
|
+
const borderColor = (_b = colors === null || colors === void 0 ? void 0 : colors.borderColor) !== null && _b !== void 0 ? _b : theme.colors.boxborder[200];
|
|
17
|
+
const textColor = (_c = colors === null || colors === void 0 ? void 0 : colors.textColor) !== null && _c !== void 0 ? _c : theme.colors.text[700];
|
|
18
|
+
const titleColor = (_d = colors === null || colors === void 0 ? void 0 : colors.titleColor) !== null && _d !== void 0 ? _d : theme.colors.text[800];
|
|
19
|
+
// The dot is a graphic on the canvas: `semantic[tone][500]` measures under 3:1 there.
|
|
20
|
+
const warningColor = (_e = colors === null || colors === void 0 ? void 0 : colors.warningColor) !== null && _e !== void 0 ? _e : theme.colors.semanticText.warning;
|
|
21
|
+
const errorColor = (_f = colors === null || colors === void 0 ? void 0 : colors.errorColor) !== null && _f !== void 0 ? _f : theme.colors.semanticText.error;
|
|
22
|
+
const successColor = (_g = colors === null || colors === void 0 ? void 0 : colors.successColor) !== null && _g !== void 0 ? _g : theme.colors.semanticText.success;
|
|
21
23
|
const startDate = (0, react_1.useMemo)(() => notification.startDate
|
|
22
24
|
? new Date(notification.startDate)
|
|
23
25
|
: null, [notification.startDate]);
|
|
@@ -62,13 +64,13 @@ const Notification = ({ notification, onClose, showStatus, onClick, isLoading =
|
|
|
62
64
|
}, [notification.dueDate, notification.endDate, notification.type]);
|
|
63
65
|
const getStatusColor = () => {
|
|
64
66
|
if (diffDays === null)
|
|
65
|
-
return theme.colors.
|
|
67
|
+
return theme.colors.textMuted;
|
|
66
68
|
if (diffDays < 0)
|
|
67
69
|
return errorColor;
|
|
68
70
|
if (diffDays <= 0.04)
|
|
69
71
|
return warningColor;
|
|
70
72
|
if (diffDays <= 1)
|
|
71
|
-
return theme.colors.yellow
|
|
73
|
+
return (0, accentText_1.accentTextOnCanvas)(theme.colors.yellow, bgColor);
|
|
72
74
|
return successColor;
|
|
73
75
|
};
|
|
74
76
|
const TimeIcon = diffDays !== null && diffDays < 0 ? lucide_react_1.AlertCircle : lucide_react_1.Clock;
|
|
@@ -100,9 +102,9 @@ const Notification = ({ notification, onClose, showStatus, onClick, isLoading =
|
|
|
100
102
|
onClose();
|
|
101
103
|
}
|
|
102
104
|
}, tabIndex: 0, p: 1, borderRadius: "md", _hover: {
|
|
103
|
-
bg:
|
|
104
|
-
color:
|
|
105
|
+
bg: closeTone.bg,
|
|
106
|
+
color: closeTone.fg,
|
|
105
107
|
transform: "scale(1.1)",
|
|
106
|
-
}, transition: "all 0.2s ease", children: (0, jsx_runtime_1.jsx)(lucide_react_1.X, { size: 16 }) })), (0, jsx_runtime_1.jsxs)(react_2.VStack, { align: "start", spacing: 3, w: "100%", children: [(0, jsx_runtime_1.jsxs)(react_2.HStack, { spacing: 2, children: [(0, jsx_runtime_1.jsx)(react_2.Icon, { as: TimeIcon, color: (0, accentText_1.accentTextOnCanvas)(theme.colors.orange, bgColor), boxSize: 4 }), (0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: "sm", color: (0, accentText_1.accentTextOnCanvas)(theme.colors.orange, bgColor), fontWeight: "semibold", children: timeLabel })] }), (0, jsx_runtime_1.jsxs)(react_2.HStack, { align: "center", spacing: 3, w: "100%", children: [(0, jsx_runtime_1.jsx)(react_2.Avatar, { size: "sm", name: notification.host || notification.title, src: notification.avatarUrl || "" }), (0, jsx_runtime_1.jsxs)(react_2.VStack, { align: "start", spacing: 0, flex: "1", children: [(0, jsx_runtime_1.jsx)(react_2.Text, { fontWeight: "bold", fontSize: "md", color: titleColor, cursor: "pointer", _hover: { textColor: theme.colors.
|
|
108
|
+
}, transition: "all 0.2s ease", children: (0, jsx_runtime_1.jsx)(lucide_react_1.X, { size: 16 }) })), (0, jsx_runtime_1.jsxs)(react_2.VStack, { align: "start", spacing: 3, w: "100%", children: [(0, jsx_runtime_1.jsxs)(react_2.HStack, { spacing: 2, children: [(0, jsx_runtime_1.jsx)(react_2.Icon, { as: TimeIcon, color: (0, accentText_1.accentTextOnCanvas)(theme.colors.orange, bgColor), boxSize: 4 }), (0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: "sm", color: (0, accentText_1.accentTextOnCanvas)(theme.colors.orange, bgColor), fontWeight: "semibold", children: timeLabel })] }), (0, jsx_runtime_1.jsxs)(react_2.HStack, { align: "center", spacing: 3, w: "100%", children: [(0, jsx_runtime_1.jsx)(react_2.Avatar, { size: "sm", name: notification.host || notification.title, src: notification.avatarUrl || "" }), (0, jsx_runtime_1.jsxs)(react_2.VStack, { align: "start", spacing: 0, flex: "1", children: [(0, jsx_runtime_1.jsx)(react_2.Text, { fontWeight: "bold", fontSize: "md", color: titleColor, cursor: "pointer", _hover: { textColor: theme.colors.accentText }, onClick: () => onClick === null || onClick === void 0 ? void 0 : onClick(notification.id, notification.type), children: notification.title }), notification.description && ((0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: "sm", color: textColor, children: notification.description }))] })] }), (0, jsx_runtime_1.jsx)(react_2.Divider, { borderColor: borderColor }), (0, jsx_runtime_1.jsxs)(react_2.HStack, { justify: "space-between", w: "100%", children: [(0, jsx_runtime_1.jsxs)(react_2.HStack, { spacing: 2, children: [(0, jsx_runtime_1.jsx)(react_2.Icon, { as: lucide_react_1.Calendar, color: theme.colors.textMuted, boxSize: 4 }), (0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: "sm", color: theme.colors.textMuted, children: formattedStartDateTime })] }), (0, jsx_runtime_1.jsxs)(react_2.HStack, { spacing: 2, children: [(0, jsx_runtime_1.jsx)(react_2.Icon, { as: lucide_react_1.User, color: theme.colors.textMuted, boxSize: 4 }), notification.host && ((0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: "sm", color: theme.colors.textMuted, children: notification.host }))] }), showStatus && ((0, jsx_runtime_1.jsx)(react_2.Box, { boxSize: "3", bg: getStatusColor(), borderRadius: "full" }))] })] })] }));
|
|
107
109
|
};
|
|
108
110
|
exports.default = Notification;
|
|
@@ -26,21 +26,20 @@ exports.NumberInput = {
|
|
|
26
26
|
},
|
|
27
27
|
variants: {
|
|
28
28
|
outline: (props) => {
|
|
29
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
30
29
|
const { theme } = props;
|
|
31
|
-
const errorColor =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
const shadowPrimary = (_g = (_f = theme.colors.boxShadow) === null || _f === void 0 ? void 0 : _f.primary) !== null && _g !== void 0 ? _g : "blue.100";
|
|
37
|
-
const shadowError = (_j = (_h = theme.colors.boxShadow) === null || _h === void 0 ? void 0 : _h.error) !== null && _j !== void 0 ? _j : "red.100";
|
|
38
|
-
const primary = (_l = (_k = theme.colors.primary) === null || _k === void 0 ? void 0 : _k[500]) !== null && _l !== void 0 ? _l : "blue.500";
|
|
30
|
+
const errorColor = theme.colors.semanticText.error;
|
|
31
|
+
const borderColor = theme.colors.boxborder[500];
|
|
32
|
+
const shadowPrimary = theme.colors.boxShadow.primary;
|
|
33
|
+
const shadowError = theme.colors.boxShadow.error;
|
|
34
|
+
const primary = theme.colors.primary[500];
|
|
39
35
|
return {
|
|
40
36
|
field: {
|
|
41
|
-
bg:
|
|
37
|
+
bg: theme.colors.gray[50],
|
|
42
38
|
border: "0.063rem solid",
|
|
43
39
|
borderColor,
|
|
40
|
+
_placeholder: {
|
|
41
|
+
color: theme.colors.textMuted,
|
|
42
|
+
},
|
|
44
43
|
_hover: {
|
|
45
44
|
borderColor: primary,
|
|
46
45
|
// boxShadow: `0 0 0 0.125rem ${shadowPrimary}`,
|
|
@@ -69,7 +68,7 @@ exports.NumberInput = {
|
|
|
69
68
|
boxShadow: 'inherit',
|
|
70
69
|
},
|
|
71
70
|
_disabled: {
|
|
72
|
-
bg:
|
|
71
|
+
bg: theme.colors.gray[100],
|
|
73
72
|
opacity: 1,
|
|
74
73
|
cursor: "not-allowed",
|
|
75
74
|
_hover: {
|
|
@@ -15,16 +15,15 @@ const sizeMap = {
|
|
|
15
15
|
lg: { h: "48px", avatar: "34px", font: "1rem", sub: "0.78rem", px: 4 },
|
|
16
16
|
};
|
|
17
17
|
const Avatar = ({ org, boxSize, fontSize, }) => {
|
|
18
|
-
var _a, _b;
|
|
19
18
|
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
20
19
|
if (org.logoUrl) {
|
|
21
20
|
return ((0, jsx_runtime_1.jsx)(react_2.Image, { src: org.logoUrl, alt: org.name, boxSize: boxSize, borderRadius: "lg", objectFit: "cover", flexShrink: 0 }));
|
|
22
21
|
}
|
|
23
22
|
const fill = (0, OrgSwitcherProps_1.avatarColor)(org.name, (0, chartColorsFromTheme_1.chartMode)(colors));
|
|
24
|
-
return ((0, jsx_runtime_1.jsx)(react_2.Flex, { align: "center", justify: "center", boxSize: boxSize, borderRadius: "lg", flexShrink: 0, bg: fill, color: (0, accentText_1.onFilled)(fill,
|
|
23
|
+
return ((0, jsx_runtime_1.jsx)(react_2.Flex, { align: "center", justify: "center", boxSize: boxSize, borderRadius: "lg", flexShrink: 0, bg: fill, color: (0, accentText_1.onFilled)(fill, colors.white, colors.black), fontSize: fontSize, fontWeight: 700, children: (0, OrgSwitcherProps_1.orgInitial)(org.name) }));
|
|
25
24
|
};
|
|
26
25
|
const OrgSwitcher = ({ organizations, value, onChange, isLoading = false, isSearchable, searchThreshold = 6, triggerVariant = "ghost", size = "md", maxWidth = "200px", menuMinWidth = "280px", placeholder = "Select organization", ariaLabel = "Switch organization", showRole = true, }) => {
|
|
27
|
-
var _a
|
|
26
|
+
var _a;
|
|
28
27
|
const theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
29
28
|
const s = sizeMap[size];
|
|
30
29
|
const { isOpen, onOpen, onClose } = (0, react_2.useDisclosure)();
|
|
@@ -70,7 +69,7 @@ const OrgSwitcher = ({ organizations, value, onChange, isLoading = false, isSear
|
|
|
70
69
|
// so its border is a control boundary — WCAG 1.4.11 needs >=3.0 against any named surface up
|
|
71
70
|
// to `muted` (lightest); gray[200] fails there in dark mode.
|
|
72
71
|
const triggerStyles = triggerVariant === "outline"
|
|
73
|
-
? { border: "1px solid", borderColor:
|
|
72
|
+
? { border: "1px solid", borderColor: theme.colors.boxborder[800], bg: theme.colors.background[50] }
|
|
74
73
|
: triggerVariant === "subtle"
|
|
75
74
|
? { bg: theme.colors.gray[50] }
|
|
76
75
|
: { bg: "transparent" };
|
|
@@ -88,12 +87,12 @@ const OrgSwitcher = ({ organizations, value, onChange, isLoading = false, isSear
|
|
|
88
87
|
return ((0, jsx_runtime_1.jsxs)(react_2.Popover, { isOpen: isOpen, onOpen: onOpen, onClose: () => {
|
|
89
88
|
onClose();
|
|
90
89
|
setQuery("");
|
|
91
|
-
}, placement: "bottom-start", initialFocusRef: showSearch ? searchRef : firstOptionRef, isLazy: true, children: [(0, jsx_runtime_1.jsx)(react_2.PopoverTrigger, { children: (0, jsx_runtime_1.jsxs)(react_2.Flex, { as: "button", type: "button", "aria-label": ariaLabel, align: "center", gap: s.px === 2 ? "8px" : "10px", h: s.h, px: s.px, borderRadius: "lg", cursor: isLoading ? "default" : "pointer", opacity: isLoading ? 0.6 : 1, pointerEvents: isLoading ? "none" : "auto", transition: "background 0.15s ease", _hover: { bg: triggerVariant === "ghost" ? triggerHoverBg : undefined }, ...triggerStyles, children: [selected ? ((0, jsx_runtime_1.jsx)(Avatar, { org: selected, boxSize: s.avatar, fontSize: s.sub })) : ((0, jsx_runtime_1.jsx)(react_2.Flex, { align: "center", justify: "center", boxSize: s.avatar, borderRadius: "lg", bg: theme.colors.gray[100], color: theme.colors.gray[
|
|
90
|
+
}, placement: "bottom-start", initialFocusRef: showSearch ? searchRef : firstOptionRef, isLazy: true, children: [(0, jsx_runtime_1.jsx)(react_2.PopoverTrigger, { children: (0, jsx_runtime_1.jsxs)(react_2.Flex, { as: "button", type: "button", "aria-label": ariaLabel, align: "center", gap: s.px === 2 ? "8px" : "10px", h: s.h, px: s.px, borderRadius: "lg", cursor: isLoading ? "default" : "pointer", opacity: isLoading ? 0.6 : 1, pointerEvents: isLoading ? "none" : "auto", transition: "background 0.15s ease", _hover: { bg: triggerVariant === "ghost" ? triggerHoverBg : undefined }, ...triggerStyles, children: [selected ? ((0, jsx_runtime_1.jsx)(Avatar, { org: selected, boxSize: s.avatar, fontSize: s.sub })) : ((0, jsx_runtime_1.jsx)(react_2.Flex, { align: "center", justify: "center", boxSize: s.avatar, borderRadius: "lg", bg: theme.colors.gray[100], color: (0, accentText_1.accentTextOnCanvas)(theme.colors.gray, theme.colors.gray[100]), flexShrink: 0, children: (0, jsx_runtime_1.jsx)(lucide_react_1.Building2, { size: 14 }) })), (0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: s.font, fontWeight: 600, color: theme.colors.gray[700], maxW: maxWidth, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", textAlign: "left", children: (_a = selected === null || selected === void 0 ? void 0 : selected.name) !== null && _a !== void 0 ? _a : placeholder }), isLoading ? ((0, jsx_runtime_1.jsx)(react_2.Spinner, { size: "xs", thickness: "1.5px", color: theme.colors.accentText, flexShrink: 0 })) : ((0, jsx_runtime_1.jsx)(react_2.Box, { as: lucide_react_1.ChevronsUpDown, size: 16, color: theme.colors.textMuted, flexShrink: 0 }))] }) }), (0, jsx_runtime_1.jsx)(react_2.PopoverContent, { minW: menuMinWidth, w: "auto",
|
|
92
91
|
// Chakra's PopoverContent baseStyle defaults bg to var(--popper-bg), which is hardcoded
|
|
93
92
|
// to colors.white and only repointed under Chakra's own `_dark` — dead code here since
|
|
94
93
|
// this app toggles dark mode by swapping the palette, not Chakra's colorMode. Without an
|
|
95
94
|
// explicit bg the panel always rendered white regardless of the active theme.
|
|
96
|
-
bg: theme.colors.backgroundColor.light, borderRadius: "xl", overflow: "hidden", boxShadow: `0 10px 30px ${theme.colors.boxShadow.default}`, _focus: { outline: "none", boxShadow: `0 10px 30px ${theme.colors.boxShadow.default}` }, children: (0, jsx_runtime_1.jsxs)(react_2.PopoverBody, { p: 0, children: [showSearch && ((0, jsx_runtime_1.jsx)(react_2.Box, { p: 2, borderBottom: "1px solid", borderColor: theme.colors.gray[100], children: (0, jsx_runtime_1.jsxs)(react_2.InputGroup, { size: "sm", children: [(0, jsx_runtime_1.jsx)(react_2.InputLeftElement, { pointerEvents: "none", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Search, { size: 15, color: theme.colors.
|
|
95
|
+
bg: theme.colors.backgroundColor.light, borderRadius: "xl", overflow: "hidden", boxShadow: `0 10px 30px ${theme.colors.boxShadow.default}`, _focus: { outline: "none", boxShadow: `0 10px 30px ${theme.colors.boxShadow.default}` }, children: (0, jsx_runtime_1.jsxs)(react_2.PopoverBody, { p: 0, children: [showSearch && ((0, jsx_runtime_1.jsx)(react_2.Box, { p: 2, borderBottom: "1px solid", borderColor: theme.colors.gray[100], children: (0, jsx_runtime_1.jsxs)(react_2.InputGroup, { size: "sm", children: [(0, jsx_runtime_1.jsx)(react_2.InputLeftElement, { pointerEvents: "none", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Search, { size: 15, color: theme.colors.textMuted }) }), (0, jsx_runtime_1.jsx)(react_2.Input, { ref: searchRef, placeholder: "Search organizations", value: query, onChange: (e) => setQuery(e.target.value), onKeyDown: (e) => {
|
|
97
96
|
if (e.key === "ArrowDown" && filtered.length > 0) {
|
|
98
97
|
e.preventDefault();
|
|
99
98
|
focusOption(0);
|
|
@@ -111,7 +110,7 @@ const OrgSwitcher = ({ organizations, value, onChange, isLoading = false, isSear
|
|
|
111
110
|
optionRefs.current[idx] = el;
|
|
112
111
|
if (idx === 0)
|
|
113
112
|
firstOptionRef.current = el;
|
|
114
|
-
}, tabIndex: idx === activeIndex ? 0 : -1, align: "center", gap: "10px", w: "100%", textAlign: "left", border: "none", fontFamily: "inherit", px: 3, py: 2, cursor: "pointer", bg: isActive ? theme.colors.primary[50] : "transparent", transition: "background 0.12s ease", _hover: { bg: rowHoverBg }, onClick: () => handleSelect(org), children: [(0, jsx_runtime_1.jsx)(Avatar, { org: org, boxSize: s.avatar, fontSize: s.sub }), (0, jsx_runtime_1.jsxs)(react_2.Box, { flex: "1", minW: 0, children: [(0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: s.font, fontWeight: isActive ? 600 : 500, color: theme.colors.text[900], overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", children: org.name }), showRole && org.role && ((0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: s.sub, color: theme.colors.text[500], overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", children: org.role }))] }), isActive && ((0, jsx_runtime_1.jsx)(react_2.Box, { as: lucide_react_1.Check, size: 16, color: theme.colors.primary[
|
|
113
|
+
}, tabIndex: idx === activeIndex ? 0 : -1, align: "center", gap: "10px", w: "100%", textAlign: "left", border: "none", fontFamily: "inherit", px: 3, py: 2, cursor: "pointer", bg: isActive ? theme.colors.primary[50] : "transparent", transition: "background 0.12s ease", _hover: { bg: rowHoverBg }, onClick: () => handleSelect(org), children: [(0, jsx_runtime_1.jsx)(Avatar, { org: org, boxSize: s.avatar, fontSize: s.sub }), (0, jsx_runtime_1.jsxs)(react_2.Box, { flex: "1", minW: 0, children: [(0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: s.font, fontWeight: isActive ? 600 : 500, color: theme.colors.text[900], overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", children: org.name }), showRole && org.role && ((0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: s.sub, color: theme.colors.text[500], overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", children: org.role }))] }), isActive && ((0, jsx_runtime_1.jsx)(react_2.Box, { as: lucide_react_1.Check, size: 16, color: (0, accentText_1.accentTextOnCanvas)(theme.colors.primary, theme.colors.primary[50]), flexShrink: 0 }))] }, org.id));
|
|
115
114
|
}), filtered.length === 0 && ((0, jsx_runtime_1.jsx)(react_2.Text, { fontSize: "sm", color: theme.colors.gray[500], textAlign: "center", py: 6, children: "No organizations found" }))] })] }) })] }));
|
|
116
115
|
};
|
|
117
116
|
exports.default = OrgSwitcher;
|
|
@@ -37,6 +37,8 @@ export interface OrgSwitcherProps {
|
|
|
37
37
|
showRole?: boolean;
|
|
38
38
|
}
|
|
39
39
|
export declare const AVATAR_COLORS: readonly string[];
|
|
40
|
+
/** Chart hues are tuned to sit apart from each other, not to carry a label. */
|
|
41
|
+
export declare const AVATAR_INK = "#ffffff";
|
|
40
42
|
export declare const avatarColor: (seed: string, mode?: ChartMode) => string;
|
|
41
43
|
/**
|
|
42
44
|
* Fallback-avatar initials, up to 2 characters. A single letter reads well for one
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.orgInitial = exports.avatarColor = exports.AVATAR_COLORS = void 0;
|
|
3
|
+
exports.orgInitial = exports.avatarColor = exports.AVATAR_INK = exports.AVATAR_COLORS = void 0;
|
|
4
4
|
const chartColorsFromTheme_1 = require("../../Theme/tokens/builders/chartColorsFromTheme");
|
|
5
|
+
const statusTone_1 = require("../../Theme/tokens/builders/statusTone");
|
|
5
6
|
exports.AVATAR_COLORS = [
|
|
6
7
|
...chartColorsFromTheme_1.CATEGORICAL_SERIES.light,
|
|
7
8
|
...chartColorsFromTheme_1.CATEGORICAL_SERIES.dark,
|
|
8
9
|
];
|
|
10
|
+
/** Chart hues are tuned to sit apart from each other, not to carry a label. */
|
|
11
|
+
exports.AVATAR_INK = "#ffffff";
|
|
9
12
|
const avatarColor = (seed, mode = "light") => {
|
|
10
13
|
let hash = 0;
|
|
11
14
|
for (let i = 0; i < seed.length; i += 1) {
|
|
12
15
|
hash = seed.charCodeAt(i) + ((hash << 5) - hash);
|
|
13
16
|
}
|
|
14
17
|
const ramp = chartColorsFromTheme_1.CATEGORICAL_SERIES[mode];
|
|
15
|
-
|
|
18
|
+
const hue = ramp[Math.abs(hash) % ramp.length];
|
|
19
|
+
return (0, statusTone_1.resolveAvatarFill)(hue);
|
|
16
20
|
};
|
|
17
21
|
exports.avatarColor = avatarColor;
|
|
18
22
|
/**
|
|
@@ -15,7 +15,6 @@ const EMPTY = {
|
|
|
15
15
|
phone: "",
|
|
16
16
|
};
|
|
17
17
|
const CreateOrgModal = ({ isOpen, onClose, isLoading, onSubmit, labels, }) => {
|
|
18
|
-
var _a, _b, _c;
|
|
19
18
|
const { colors } = (0, useCustomTheme_1.useCustomTheme)();
|
|
20
19
|
const [values, setValues] = (0, react_1.useState)(EMPTY);
|
|
21
20
|
const [errors, setErrors] = (0, react_1.useState)({});
|
|
@@ -57,6 +56,6 @@ const CreateOrgModal = ({ isOpen, onClose, isLoading, onSubmit, labels, }) => {
|
|
|
57
56
|
phone: (_a = values === null || values === void 0 ? void 0 : values.phone) === null || _a === void 0 ? void 0 : _a.trim(),
|
|
58
57
|
});
|
|
59
58
|
};
|
|
60
|
-
return ((0, jsx_runtime_1.jsxs)(react_2.Modal, { isOpen: isOpen, onClose: onClose, isCentered: true, autoFocus: false, children: [(0, jsx_runtime_1.jsx)(react_2.ModalOverlay, { backdropFilter: "blur(4px)" }), (0, jsx_runtime_1.jsxs)(react_2.ModalContent, { bg: colors.background[50], borderRadius: "2xl", overflow: "hidden", children: [(0, jsx_runtime_1.jsx)(react_2.ModalHeader, { borderBottom: "1px solid", borderColor:
|
|
59
|
+
return ((0, jsx_runtime_1.jsxs)(react_2.Modal, { isOpen: isOpen, onClose: onClose, isCentered: true, autoFocus: false, children: [(0, jsx_runtime_1.jsx)(react_2.ModalOverlay, { backdropFilter: "blur(4px)" }), (0, jsx_runtime_1.jsxs)(react_2.ModalContent, { bg: colors.background[50], borderRadius: "2xl", overflow: "hidden", children: [(0, jsx_runtime_1.jsx)(react_2.ModalHeader, { borderBottom: "1px solid", borderColor: colors.boxborder[200], fontSize: "1.05rem", fontWeight: 600, children: labels.createOrganization }), (0, jsx_runtime_1.jsx)(react_2.ModalCloseButton, {}), (0, jsx_runtime_1.jsxs)(react_2.ModalBody, { py: 6, children: [(0, jsx_runtime_1.jsxs)(react_2.VStack, { spacing: 4, align: "stretch", children: [(0, jsx_runtime_1.jsx)(TextInput_1.default, { label: labels.companyName, value: values.company_name, onChange: (e) => setField("company_name", e.target.value), isRequired: true, width: "100%", placeholder: "Enter Company Name", error: !!errors.company_name, errorMessage: errors.company_name }), (0, jsx_runtime_1.jsx)(TextInput_1.default, { label: labels.companyAddress, value: values.company_address, onChange: (e) => setField("company_address", e.target.value), isRequired: true, width: "100%", placeholder: "Enter Company Address", error: !!errors.company_address, errorMessage: errors.company_address }), (0, jsx_runtime_1.jsx)(TextInput_1.default, { label: labels.phone, value: values.phone, onChange: (e) => setField("phone", e.target.value), isRequired: true, width: "100%", placeholder: "Enter Phone Number", error: !!errors.phone, errorMessage: errors.phone })] }), (0, jsx_runtime_1.jsxs)(react_2.HStack, { justifyContent: "center", spacing: 4, mt: 6, children: [(0, jsx_runtime_1.jsx)(Button_1.default, { label: labels.cancel, onClick: onClose, variant: "outline", colorScheme: "red", size: "sm" }), (0, jsx_runtime_1.jsx)(Button_1.default, { label: labels.submit, onClick: handleSubmit, colorScheme: "primary", size: "sm", isLoading: isLoading })] })] })] })] }));
|
|
61
60
|
};
|
|
62
61
|
exports.default = CreateOrgModal;
|