@lateralus-ai/shipping-ui 1.4.15 → 2.0.0-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +70 -53
- package/dist/components/Checkbox.d.ts +9 -0
- package/dist/components/Chip.d.ts +15 -0
- package/dist/components/EmptyState.d.ts +10 -0
- package/dist/components/Entry.d.ts +13 -0
- package/dist/components/Header.d.ts +9 -0
- package/dist/components/Input.d.ts +11 -0
- package/dist/components/InputType.d.ts +10 -0
- package/dist/components/ModalPanel.d.ts +7 -7
- package/dist/components/PdfViewer/ImageViewer.d.ts +2 -2
- package/dist/components/PdfViewer/PdfViewer.d.ts +2 -2
- package/dist/components/ReportInput.d.ts +10 -0
- package/dist/components/Tab.d.ts +7 -0
- package/dist/components/Tabs.d.ts +11 -12
- package/dist/components/index.d.ts +11 -4
- package/dist/domain/Filters/FilterPill.d.ts +6 -0
- package/dist/domain/Filters/FilteredPill.d.ts +8 -0
- package/dist/domain/Filters/FiltersBar.d.ts +12 -0
- package/dist/domain/Filters/index.d.ts +3 -0
- package/dist/domain/Forms/FormCard.d.ts +12 -0
- package/dist/domain/Forms/FormHeader.d.ts +8 -0
- package/dist/domain/Forms/ListRow.d.ts +8 -0
- package/dist/domain/Forms/RiskMeter.d.ts +8 -0
- package/dist/domain/Forms/index.d.ts +4 -0
- package/dist/domain/Library/File.d.ts +8 -0
- package/dist/domain/Library/Folder.d.ts +8 -0
- package/dist/domain/Library/Folders.d.ts +11 -0
- package/dist/domain/Library/ListRow.d.ts +8 -0
- package/dist/domain/Library/Navigation.d.ts +7 -0
- package/dist/domain/Library/index.d.ts +5 -0
- package/dist/domain/Report/InfoHeading.d.ts +7 -0
- package/dist/domain/Report/InfoRow.d.ts +8 -0
- package/dist/domain/Report/Report.d.ts +7 -0
- package/dist/domain/Report/SectionHeader.d.ts +10 -0
- package/dist/domain/Report/TaskRow.d.ts +11 -0
- package/dist/domain/Report/index.d.ts +5 -0
- package/dist/domain/Settings/EquipmentRow.d.ts +8 -0
- package/dist/domain/Settings/MemberRow.d.ts +11 -0
- package/dist/domain/Settings/SettingRow.d.ts +10 -0
- package/dist/domain/Settings/index.d.ts +3 -0
- package/dist/domain/Ships/ShipRow.d.ts +10 -0
- package/dist/domain/Ships/index.d.ts +1 -0
- package/dist/domain/Workflows/GroupHeader.d.ts +8 -0
- package/dist/domain/Workflows/Importance.d.ts +8 -0
- package/dist/domain/Workflows/Progress.d.ts +7 -0
- package/dist/domain/Workflows/Question.d.ts +9 -0
- package/dist/domain/Workflows/StatusPopover.d.ts +7 -0
- package/dist/domain/Workflows/Task.d.ts +9 -0
- package/dist/domain/Workflows/TaskHeader.d.ts +9 -0
- package/dist/domain/Workflows/WorkflowFilters.d.ts +6 -0
- package/dist/domain/Workflows/WorkflowForm.d.ts +8 -0
- package/dist/domain/Workflows/WorkflowHeader.d.ts +11 -0
- package/dist/domain/Workflows/WorkflowListItem.d.ts +11 -0
- package/dist/domain/Workflows/WorkflowProgress.d.ts +6 -0
- package/dist/domain/Workflows/WorkflowRow.d.ts +10 -0
- package/dist/domain/Workflows/index.d.ts +13 -0
- package/dist/domain/index.d.ts +7 -0
- package/dist/icons/ArrowIcon.d.ts +8 -0
- package/dist/icons/ChevronIcon.d.ts +8 -0
- package/dist/icons/Icon.d.ts +96 -0
- package/dist/icons/arrow-paths.d.ts +12 -0
- package/dist/icons/chevron-paths.d.ts +27 -0
- package/dist/icons/createIcon.d.ts +34 -0
- package/dist/icons/generated.d.ts +68 -0
- package/dist/icons/icon-sizes.d.ts +5 -0
- package/dist/icons/icons-data.d.ts +1023 -0
- package/dist/icons/index.d.ts +13 -0
- package/dist/icons/types.d.ts +10 -0
- package/dist/illustrations/AuditPreparation.d.ts +4 -0
- package/dist/illustrations/CompletedTasks.d.ts +4 -0
- package/dist/illustrations/Creation.d.ts +4 -0
- package/dist/illustrations/InternalAudit.d.ts +4 -0
- package/dist/illustrations/Invite.d.ts +4 -0
- package/dist/illustrations/PortStateControl.d.ts +4 -0
- package/dist/illustrations/Processing.d.ts +4 -0
- package/dist/illustrations/QuestionsDone.d.ts +4 -0
- package/dist/illustrations/RightShipInspection.d.ts +4 -0
- package/dist/illustrations/Upload.d.ts +4 -0
- package/dist/illustrations/WorkflowCreated.d.ts +4 -0
- package/dist/illustrations/Workflows.d.ts +4 -0
- package/dist/illustrations/createIllustration.d.ts +11 -0
- package/dist/illustrations/index.d.ts +13 -0
- package/dist/index.cjs +64 -80
- package/dist/index.d.ts +9 -3
- package/dist/index.esm.js +10964 -36537
- package/dist/patterns/Chat/Attachment.d.ts +6 -0
- package/dist/patterns/Chat/ChatEntry.d.ts +10 -0
- package/dist/patterns/Chat/ChatHeader.d.ts +7 -0
- package/dist/patterns/Chat/ChatInput.d.ts +5 -0
- package/dist/patterns/Chat/ChatStatus.d.ts +6 -0
- package/dist/patterns/Chat/ChatTile.d.ts +9 -0
- package/dist/patterns/Chat/Copilot.d.ts +8 -0
- package/dist/patterns/Chat/Draft.d.ts +5 -0
- package/dist/patterns/Chat/Greeting.d.ts +7 -0
- package/dist/patterns/Chat/Reference.d.ts +6 -0
- package/dist/patterns/Chat/Source.d.ts +6 -0
- package/dist/patterns/Chat/Sources.d.ts +5 -0
- package/dist/patterns/Chat/Suggestion.d.ts +5 -0
- package/dist/patterns/Chat/Suggestions.d.ts +4 -0
- package/dist/patterns/Chat/index.d.ts +14 -0
- package/dist/patterns/Modal/Invitee.d.ts +8 -0
- package/dist/patterns/Modal/ModalFooter.d.ts +6 -0
- package/dist/patterns/Modal/ModalHeader.d.ts +10 -0
- package/dist/patterns/Modal/index.d.ts +3 -0
- package/dist/patterns/Search/Pill.d.ts +10 -0
- package/dist/patterns/Search/PillInfo.d.ts +8 -0
- package/dist/patterns/Search/ResultRow.d.ts +10 -0
- package/dist/patterns/Search/SearchModal.d.ts +6 -0
- package/dist/patterns/Search/SectionHeader.d.ts +5 -0
- package/dist/patterns/Search/index.d.ts +5 -0
- package/dist/patterns/Sidebar/Account.d.ts +22 -0
- package/dist/patterns/Sidebar/ActivityNavGroup.d.ts +17 -0
- package/dist/patterns/Sidebar/CollapsibleNavGroup.d.ts +24 -0
- package/dist/patterns/Sidebar/Indicator.d.ts +6 -0
- package/dist/patterns/Sidebar/NewChat.d.ts +10 -0
- package/dist/patterns/Sidebar/Sidebar.d.ts +13 -0
- package/dist/patterns/Sidebar/SidebarAction.d.ts +11 -0
- package/dist/patterns/Sidebar/SidebarEntry.d.ts +25 -0
- package/dist/patterns/Sidebar/SidebarHeading.d.ts +11 -0
- package/dist/patterns/Sidebar/SidebarLink.d.ts +22 -0
- package/dist/patterns/Sidebar/SidebarShell.d.ts +11 -0
- package/dist/patterns/Sidebar/Switcher.d.ts +8 -0
- package/dist/patterns/Sidebar/constants.d.ts +2 -0
- package/dist/patterns/Sidebar/figma-assets.d.ts +3 -0
- package/dist/patterns/Sidebar/figma-demo-content.d.ts +75 -0
- package/dist/patterns/Sidebar/figma-sidebar-nav.d.ts +12 -0
- package/dist/patterns/Sidebar/index.d.ts +13 -0
- package/dist/patterns/Sidebar/sidebar-styles.d.ts +45 -0
- package/dist/patterns/Skeleton/Skeleton.d.ts +6 -0
- package/dist/patterns/Skeleton/index.d.ts +1 -0
- package/dist/patterns/index.d.ts +5 -0
- package/dist/primitives/Avatar.d.ts +10 -0
- package/dist/primitives/Badge.d.ts +11 -0
- package/dist/primitives/Button.d.ts +13 -0
- package/dist/primitives/Callout.d.ts +7 -0
- package/dist/primitives/Count.d.ts +5 -0
- package/dist/primitives/DropdownMenu.d.ts +15 -0
- package/dist/primitives/GroupedAvatars.d.ts +7 -0
- package/dist/primitives/IconButton.d.ts +16 -0
- package/dist/primitives/Logo.d.ts +8 -0
- package/dist/primitives/MenuItem.d.ts +7 -0
- package/dist/primitives/Switch.d.ts +7 -0
- package/dist/primitives/ThinkingDot.d.ts +4 -0
- package/dist/primitives/Tooltip.d.ts +12 -0
- package/dist/primitives/index.d.ts +13 -0
- package/dist/style.css +1 -1
- package/dist/tailwind-theme.d.ts +234 -198
- package/dist/tokens/colors.d.ts +148 -0
- package/dist/tokens/elevation.d.ts +11 -0
- package/dist/tokens/index.d.ts +4 -0
- package/dist/tokens/semantic.d.ts +89 -0
- package/dist/tokens/typography.d.ts +85 -0
- package/package.json +27 -5
- package/src/components/Checkbox.tsx +77 -0
- package/src/components/Chip.tsx +69 -0
- package/src/components/EmptyState.tsx +44 -0
- package/src/components/Entry.tsx +64 -0
- package/src/components/Header.tsx +39 -0
- package/src/components/Input.tsx +69 -0
- package/src/components/InputType.tsx +76 -0
- package/src/components/ModalPanel.tsx +22 -37
- package/src/components/PdfViewer/ImageViewer.tsx +121 -182
- package/src/components/PdfViewer/PdfViewer.tsx +103 -155
- package/src/components/ReportInput.tsx +65 -0
- package/src/components/Tab.tsx +33 -0
- package/src/components/Tabs.tsx +43 -38
- package/src/components/index.ts +11 -4
- package/src/domain/Filters/FilterPill.tsx +25 -0
- package/src/domain/Filters/FilteredPill.tsx +39 -0
- package/src/domain/Filters/FiltersBar.tsx +76 -0
- package/src/domain/Filters/index.ts +3 -0
- package/src/domain/Forms/FormCard.tsx +61 -0
- package/src/domain/Forms/FormHeader.tsx +34 -0
- package/src/domain/Forms/ListRow.tsx +40 -0
- package/src/domain/Forms/RiskMeter.tsx +50 -0
- package/src/domain/Forms/index.ts +4 -0
- package/src/domain/Library/File.tsx +59 -0
- package/src/domain/Library/Folder.tsx +55 -0
- package/src/domain/Library/Folders.tsx +43 -0
- package/src/domain/Library/ListRow.tsx +40 -0
- package/src/domain/Library/Navigation.tsx +31 -0
- package/src/domain/Library/index.ts +5 -0
- package/src/domain/Report/InfoHeading.tsx +25 -0
- package/src/domain/Report/InfoRow.tsx +35 -0
- package/src/domain/Report/Report.tsx +53 -0
- package/src/domain/Report/SectionHeader.tsx +43 -0
- package/src/domain/Report/TaskRow.tsx +57 -0
- package/src/domain/Report/index.ts +5 -0
- package/src/domain/Settings/EquipmentRow.tsx +39 -0
- package/src/domain/Settings/MemberRow.tsx +53 -0
- package/src/domain/Settings/SettingRow.tsx +66 -0
- package/src/domain/Settings/index.ts +3 -0
- package/src/domain/Ships/ShipRow.tsx +49 -0
- package/src/domain/Ships/index.ts +1 -0
- package/src/domain/Workflows/GroupHeader.tsx +48 -0
- package/src/domain/Workflows/Importance.tsx +48 -0
- package/src/domain/Workflows/Progress.tsx +55 -0
- package/src/domain/Workflows/Question.tsx +42 -0
- package/src/domain/Workflows/StatusPopover.tsx +53 -0
- package/src/domain/Workflows/Task.tsx +46 -0
- package/src/domain/Workflows/TaskHeader.tsx +51 -0
- package/src/domain/Workflows/WorkflowFilters.tsx +40 -0
- package/src/domain/Workflows/WorkflowForm.tsx +40 -0
- package/src/domain/Workflows/WorkflowHeader.tsx +62 -0
- package/src/domain/Workflows/WorkflowListItem.tsx +45 -0
- package/src/domain/Workflows/WorkflowProgress.tsx +36 -0
- package/src/domain/Workflows/WorkflowRow.tsx +43 -0
- package/src/domain/Workflows/index.ts +13 -0
- package/src/domain/index.ts +37 -0
- package/src/icons/ArrowIcon.tsx +42 -0
- package/src/icons/ChevronIcon.tsx +42 -0
- package/src/icons/Icon.tsx +184 -0
- package/src/icons/arrow-paths.ts +8 -0
- package/src/icons/chevron-paths.ts +17 -0
- package/src/icons/createIcon.tsx +128 -0
- package/src/icons/generated.tsx +71 -0
- package/src/icons/icon-sizes.ts +20 -0
- package/src/icons/icons-data.ts +656 -0
- package/src/icons/index.ts +25 -0
- package/src/icons/types.ts +18 -0
- package/src/illustrations/AuditPreparation.tsx +15 -0
- package/src/illustrations/CompletedTasks.tsx +16 -0
- package/src/illustrations/Creation.tsx +13 -0
- package/src/illustrations/InternalAudit.tsx +13 -0
- package/src/illustrations/Invite.tsx +13 -0
- package/src/illustrations/PortStateControl.tsx +13 -0
- package/src/illustrations/Processing.tsx +17 -0
- package/src/illustrations/QuestionsDone.tsx +16 -0
- package/src/illustrations/RightShipInspection.tsx +18 -0
- package/src/illustrations/Upload.tsx +12 -0
- package/src/illustrations/WorkflowCreated.tsx +13 -0
- package/src/illustrations/Workflows.tsx +13 -0
- package/src/illustrations/createIllustration.tsx +30 -0
- package/src/illustrations/index.ts +14 -0
- package/src/index.ts +49 -3
- package/src/patterns/Chat/Attachment.tsx +27 -0
- package/src/patterns/Chat/ChatEntry.tsx +41 -0
- package/src/patterns/Chat/ChatHeader.tsx +39 -0
- package/src/patterns/Chat/ChatInput.tsx +35 -0
- package/src/patterns/Chat/ChatStatus.tsx +26 -0
- package/src/patterns/Chat/ChatTile.tsx +40 -0
- package/src/patterns/Chat/Copilot.tsx +50 -0
- package/src/patterns/Chat/Draft.tsx +23 -0
- package/src/patterns/Chat/Greeting.tsx +32 -0
- package/src/patterns/Chat/Reference.tsx +26 -0
- package/src/patterns/Chat/Source.tsx +27 -0
- package/src/patterns/Chat/Sources.tsx +23 -0
- package/src/patterns/Chat/Suggestion.tsx +23 -0
- package/src/patterns/Chat/Suggestions.tsx +21 -0
- package/src/patterns/Chat/index.ts +14 -0
- package/src/patterns/Modal/Invitee.tsx +44 -0
- package/src/patterns/Modal/ModalFooter.tsx +39 -0
- package/src/patterns/Modal/ModalHeader.tsx +77 -0
- package/src/patterns/Modal/index.ts +3 -0
- package/src/patterns/Search/Pill.tsx +44 -0
- package/src/patterns/Search/PillInfo.tsx +41 -0
- package/src/patterns/Search/ResultRow.tsx +52 -0
- package/src/patterns/Search/SearchModal.tsx +88 -0
- package/src/patterns/Search/SectionHeader.tsx +20 -0
- package/src/patterns/Search/index.ts +5 -0
- package/src/patterns/Sidebar/Account.tsx +193 -0
- package/src/patterns/Sidebar/ActivityNavGroup.tsx +71 -0
- package/src/patterns/Sidebar/CollapsibleNavGroup.tsx +106 -0
- package/src/patterns/Sidebar/Indicator.tsx +14 -0
- package/src/patterns/Sidebar/NewChat.tsx +71 -0
- package/src/patterns/Sidebar/Sidebar.tsx +363 -0
- package/src/patterns/Sidebar/SidebarAction.tsx +55 -0
- package/src/patterns/Sidebar/SidebarEntry.tsx +129 -0
- package/src/patterns/Sidebar/SidebarHeading.tsx +38 -0
- package/src/patterns/Sidebar/SidebarLink.tsx +125 -0
- package/src/patterns/Sidebar/SidebarShell.tsx +32 -0
- package/src/patterns/Sidebar/Switcher.tsx +116 -0
- package/src/patterns/Sidebar/assets/account-avatar-24.jpg +0 -0
- package/src/patterns/Sidebar/assets/account-avatar.jpg +0 -0
- package/src/patterns/Sidebar/assets/indicator-compliance.png +0 -0
- package/src/patterns/Sidebar/assets/indicator-technical.png +0 -0
- package/src/patterns/Sidebar/assets/logo-compliance-mark.png +5 -0
- package/src/patterns/Sidebar/assets/logo-compliance-mask.png +13 -0
- package/src/patterns/Sidebar/assets/logo-compliance.svg +17 -0
- package/src/patterns/Sidebar/assets/logo-technical-avatar.svg +17 -0
- package/src/patterns/Sidebar/assets/logo-technical-mark.png +5 -0
- package/src/patterns/Sidebar/assets/logo-technical.svg +16 -0
- package/src/patterns/Sidebar/constants.ts +2 -0
- package/src/patterns/Sidebar/figma-assets.ts +4 -0
- package/src/patterns/Sidebar/figma-demo-content.ts +30 -0
- package/src/patterns/Sidebar/figma-sidebar-nav.ts +79 -0
- package/src/patterns/Sidebar/index.ts +13 -0
- package/src/patterns/Sidebar/sidebar-styles.ts +101 -0
- package/src/patterns/Skeleton/Skeleton.tsx +57 -0
- package/src/patterns/Skeleton/index.ts +1 -0
- package/src/patterns/index.ts +5 -0
- package/src/primitives/Avatar.tsx +71 -0
- package/src/primitives/Badge.tsx +34 -0
- package/src/primitives/Button.tsx +67 -0
- package/src/primitives/Callout.tsx +21 -0
- package/src/primitives/Count.tsx +18 -0
- package/src/primitives/DropdownMenu.tsx +60 -0
- package/src/primitives/GroupedAvatars.tsx +36 -0
- package/src/primitives/IconButton.tsx +56 -0
- package/src/primitives/Logo.tsx +43 -0
- package/src/primitives/MenuItem.tsx +35 -0
- package/src/primitives/Switch.tsx +38 -0
- package/src/primitives/ThinkingDot.tsx +34 -0
- package/src/primitives/Tooltip.tsx +42 -0
- package/src/primitives/index.ts +13 -0
- package/src/stories/_layout/FigmaPage.tsx +94 -0
- package/src/stories/_layout/index.ts +8 -0
- package/src/stories/canvases/ButtonsCanvas.tsx +57 -0
- package/src/stories/canvases/ButtonsMatrixCanvas.tsx +64 -0
- package/src/stories/canvases/ChatCanvas.tsx +130 -0
- package/src/stories/canvases/ColorTokensCanvas.tsx +16 -0
- package/src/stories/canvases/ColorsCanvas.tsx +101 -0
- package/src/stories/canvases/ContentCanvas.tsx +88 -0
- package/src/stories/canvases/CoreCanvas.tsx +125 -0
- package/src/stories/canvases/DomainFormsCanvas.tsx +67 -0
- package/src/stories/canvases/FiltersCanvas.tsx +41 -0
- package/src/stories/canvases/FormsCanvas.tsx +71 -0
- package/src/stories/canvases/IconsCanvas.tsx +99 -0
- package/src/stories/canvases/IllustrationsCanvas.tsx +50 -0
- package/src/stories/canvases/LibraryCanvas.tsx +67 -0
- package/src/stories/canvases/ModalsCanvas.tsx +54 -0
- package/src/stories/canvases/RaiseLevelsCanvas.tsx +27 -0
- package/src/stories/canvases/ReportCanvas.tsx +33 -0
- package/src/stories/canvases/ReportLayoutCanvas.tsx +19 -0
- package/src/stories/canvases/SearchCanvas.tsx +65 -0
- package/src/stories/canvases/SettingsCanvas.tsx +41 -0
- package/src/stories/canvases/ShipsCanvas.tsx +38 -0
- package/src/stories/canvases/SidebarCanvas.tsx +147 -0
- package/src/stories/canvases/SidebarLayoutsCanvas.tsx +71 -0
- package/src/stories/canvases/SidebarPlayground.tsx +35 -0
- package/src/stories/canvases/SkeletonsCanvas.tsx +30 -0
- package/src/stories/canvases/TypographyCanvas.tsx +53 -0
- package/src/stories/canvases/WorkflowsCanvas.tsx +129 -0
- package/src/stories/canvases/figma-icons-layout.ts +318 -0
- package/src/stories/canvases/figma-sidebar-layout.ts +212 -0
- package/src/stories/canvases/figma-sidebar-layouts-layout.ts +84 -0
- package/src/stories/canvases/figma-widths.ts +28 -0
- package/src/stories/canvases/helpers.tsx +163 -0
- package/src/stories/components/Buttons.stories.tsx +12 -0
- package/src/stories/components/Chat.stories.tsx +12 -0
- package/src/stories/components/Content.stories.tsx +12 -0
- package/src/stories/components/Core.stories.tsx +12 -0
- package/src/stories/components/DomainForms.stories.tsx +12 -0
- package/src/stories/components/Filters.stories.tsx +12 -0
- package/src/stories/components/Forms.stories.tsx +12 -0
- package/src/stories/components/Icons.stories.tsx +12 -0
- package/src/stories/components/Illustrations.stories.tsx +12 -0
- package/src/stories/components/Library.stories.tsx +12 -0
- package/src/stories/components/Modals.stories.tsx +12 -0
- package/src/stories/components/Report.stories.tsx +12 -0
- package/src/stories/components/ReportLayout.stories.tsx +12 -0
- package/src/stories/components/Search.stories.tsx +12 -0
- package/src/stories/components/Settings.stories.tsx +12 -0
- package/src/stories/components/Ships.stories.tsx +12 -0
- package/src/stories/components/Sidebar.stories.tsx +37 -0
- package/src/stories/components/SidebarLayouts.stories.tsx +12 -0
- package/src/stories/components/Skeletons.stories.tsx +12 -0
- package/src/stories/components/Workflows.stories.tsx +12 -0
- package/src/stories/style-guide/Buttons.stories.tsx +12 -0
- package/src/stories/style-guide/ColorTokens.stories.tsx +12 -0
- package/src/stories/style-guide/Colors.stories.tsx +12 -0
- package/src/stories/style-guide/RaiseLevels.stories.tsx +12 -0
- package/src/stories/style-guide/Typography.stories.tsx +12 -0
- package/src/style.css +169 -2
- package/src/tailwind-theme.ts +164 -240
- package/src/tokens/colors.ts +82 -0
- package/src/tokens/elevation.ts +12 -0
- package/src/tokens/index.ts +4 -0
- package/src/tokens/semantic.ts +89 -0
- package/src/tokens/typography.ts +21 -0
- package/dist/components/HelloWorld.d.ts +0 -1
- package/dist/components/InputPrompt.d.ts +0 -20
- package/dist/components/SearchModal.d.ts +0 -24
- package/dist/components/Sidebar/Button.d.ts +0 -7
- package/dist/components/Sidebar/Container.d.ts +0 -5
- package/dist/components/Sidebar/Item.d.ts +0 -9
- package/dist/components/Sidebar/Layout.d.ts +0 -10
- package/dist/components/Sidebar/Provider.d.ts +0 -14
- package/dist/components/Sidebar/SecondaryItem.d.ts +0 -9
- package/dist/components/Sidebar/SideContainer.d.ts +0 -5
- package/dist/components/Sidebar/ToggleCollapseButton.d.ts +0 -1
- package/dist/components/Sidebar/index.d.ts +0 -8
- package/dist/components/icons/CloseSidebarIcon.d.ts +0 -2
- package/dist/components/icons/CloseSidebarMidIcon.d.ts +0 -1
- package/dist/components/icons/ExpandIcon.d.ts +0 -3
- package/dist/components/icons/SendArrowIcon.d.ts +0 -4
- package/dist/components/icons/SendArrowIconGreen.d.ts +0 -4
- package/dist/components/icons/SettingsIcon.d.ts +0 -3
- package/dist/components/icons/XIcon.d.ts +0 -3
- package/dist/material-theme.d.ts +0 -442
- package/dist/stories/Buttons.d.ts +0 -1
- package/dist/stories/Checkbox.d.ts +0 -1
- package/dist/stories/ColorPalette.d.ts +0 -1
- package/dist/stories/Dropdowns.d.ts +0 -1
- package/dist/stories/InputPrompt.d.ts +0 -1
- package/dist/stories/SearchModal.d.ts +0 -1
- package/dist/stories/Sidebar.d.ts +0 -1
- package/dist/stories/Typography.d.ts +0 -1
- package/src/components/HelloWorld.tsx +0 -3
- package/src/components/InputPrompt.tsx +0 -96
- package/src/components/SearchModal.tsx +0 -320
- package/src/components/Sidebar/Button.tsx +0 -20
- package/src/components/Sidebar/Container.tsx +0 -31
- package/src/components/Sidebar/Item.tsx +0 -39
- package/src/components/Sidebar/Layout.tsx +0 -32
- package/src/components/Sidebar/Provider.tsx +0 -47
- package/src/components/Sidebar/SecondaryItem.tsx +0 -39
- package/src/components/Sidebar/SideContainer.tsx +0 -31
- package/src/components/Sidebar/ToggleCollapseButton.tsx +0 -24
- package/src/components/Sidebar/index.ts +0 -8
- package/src/components/icons/CloseSidebarIcon.tsx +0 -19
- package/src/components/icons/CloseSidebarMidIcon.tsx +0 -19
- package/src/components/icons/ExpandIcon.tsx +0 -21
- package/src/components/icons/SendArrowIcon.tsx +0 -23
- package/src/components/icons/SendArrowIconGreen.tsx +0 -17
- package/src/components/icons/SettingsIcon.tsx +0 -33
- package/src/components/icons/XIcon.tsx +0 -21
- package/src/material-theme.ts +0 -477
- package/src/stories/Buttons.stories.tsx +0 -15
- package/src/stories/Buttons.tsx +0 -52
- package/src/stories/Checkbox.stories.tsx +0 -15
- package/src/stories/Checkbox.tsx +0 -56
- package/src/stories/ColorPalette.stories.tsx +0 -15
- package/src/stories/ColorPalette.tsx +0 -85
- package/src/stories/DocumentEditor.stories.tsx +0 -287
- package/src/stories/Dropdowns.stories.tsx +0 -15
- package/src/stories/Dropdowns.tsx +0 -52
- package/src/stories/InputPrompt.stories.tsx +0 -15
- package/src/stories/InputPrompt.tsx +0 -63
- package/src/stories/ModalHeader.stories.tsx +0 -36
- package/src/stories/PDFViewer.stories.tsx +0 -39
- package/src/stories/SearchModal.stories.tsx +0 -132
- package/src/stories/SearchModal.tsx +0 -82
- package/src/stories/Sidebar.stories.tsx +0 -15
- package/src/stories/Sidebar.tsx +0 -108
- package/src/stories/Tabs.stories.tsx +0 -51
- package/src/stories/Typography.stories.tsx +0 -15
- package/src/stories/Typography.tsx +0 -110
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { cn } from "../utils/cn";
|
|
3
|
+
|
|
4
|
+
export type HeaderVariant = "standard" | "nested";
|
|
5
|
+
|
|
6
|
+
export type HeaderProps = {
|
|
7
|
+
variant?: HeaderVariant;
|
|
8
|
+
title: string;
|
|
9
|
+
actions?: ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const Header = ({
|
|
14
|
+
variant = "standard",
|
|
15
|
+
title,
|
|
16
|
+
actions,
|
|
17
|
+
className,
|
|
18
|
+
}: HeaderProps) => (
|
|
19
|
+
<header
|
|
20
|
+
data-variant={variant}
|
|
21
|
+
className={cn(
|
|
22
|
+
"flex w-full items-center justify-between gap-4",
|
|
23
|
+
variant === "standard" && "border-b border-divider-primary px-6 py-4",
|
|
24
|
+
variant === "nested" && "px-4 py-3",
|
|
25
|
+
className,
|
|
26
|
+
)}
|
|
27
|
+
>
|
|
28
|
+
<h2
|
|
29
|
+
className={cn(
|
|
30
|
+
"text-display-on-light-primary",
|
|
31
|
+
variant === "standard" && "font-heading text-heading",
|
|
32
|
+
variant === "nested" && "text-subheader-em",
|
|
33
|
+
)}
|
|
34
|
+
>
|
|
35
|
+
{title}
|
|
36
|
+
</h2>
|
|
37
|
+
{actions && <div className="flex shrink-0 items-center gap-2">{actions}</div>}
|
|
38
|
+
</header>
|
|
39
|
+
);
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { type InputHTMLAttributes, useId } from "react";
|
|
2
|
+
import { cn } from "../utils/cn";
|
|
3
|
+
|
|
4
|
+
export type InputState = "idle" | "hover" | "disabled" | "edit";
|
|
5
|
+
|
|
6
|
+
export type InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "onChange"> & {
|
|
7
|
+
label?: string;
|
|
8
|
+
value?: string;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
error?: string;
|
|
11
|
+
state?: InputState;
|
|
12
|
+
onChange?: (value: string) => void;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const fieldStyles: Record<InputState, string> = {
|
|
16
|
+
idle: "border-divider-primary bg-white",
|
|
17
|
+
hover: "border-grey-300 bg-white",
|
|
18
|
+
disabled: "border-divider-primary bg-grey-50 text-display-on-light-quaternary cursor-not-allowed",
|
|
19
|
+
edit: "border-accent-on-light bg-white ring-1 ring-accent-on-light",
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const Input = ({
|
|
23
|
+
label,
|
|
24
|
+
value = "",
|
|
25
|
+
placeholder,
|
|
26
|
+
error,
|
|
27
|
+
state = "idle",
|
|
28
|
+
onChange,
|
|
29
|
+
disabled,
|
|
30
|
+
className,
|
|
31
|
+
id: idProp,
|
|
32
|
+
...props
|
|
33
|
+
}: InputProps) => {
|
|
34
|
+
const generatedId = useId();
|
|
35
|
+
const id = idProp ?? generatedId;
|
|
36
|
+
const isDisabled = disabled ?? state === "disabled";
|
|
37
|
+
const visualState = isDisabled ? "disabled" : state;
|
|
38
|
+
const hasError = Boolean(error);
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<div className={cn("flex w-full flex-col gap-1", className)}>
|
|
42
|
+
{label && (
|
|
43
|
+
<label htmlFor={id} className="text-caption-2-em text-display-on-light-secondary">
|
|
44
|
+
{label}
|
|
45
|
+
</label>
|
|
46
|
+
)}
|
|
47
|
+
<input
|
|
48
|
+
id={id}
|
|
49
|
+
type="text"
|
|
50
|
+
value={value}
|
|
51
|
+
placeholder={placeholder}
|
|
52
|
+
disabled={isDisabled}
|
|
53
|
+
data-state={visualState}
|
|
54
|
+
onChange={(event) => onChange?.(event.target.value)}
|
|
55
|
+
className={cn(
|
|
56
|
+
"h-10 w-full rounded-control border px-3 text-body text-display-on-light-primary outline-none transition-colors placeholder:text-display-on-light-quaternary",
|
|
57
|
+
"hover:border-grey-300 focus:border-accent-on-light focus:ring-1 focus:ring-accent-on-light",
|
|
58
|
+
"data-[state=hover]:border-grey-300",
|
|
59
|
+
"data-[state=edit]:border-accent-on-light data-[state=edit]:ring-1 data-[state=edit]:ring-accent-on-light",
|
|
60
|
+
"data-[state=disabled]:border-divider-primary data-[state=disabled]:bg-grey-50 data-[state=disabled]:text-display-on-light-quaternary",
|
|
61
|
+
hasError && "border-red-500 ring-1 ring-red-500",
|
|
62
|
+
!hasError && fieldStyles[visualState],
|
|
63
|
+
)}
|
|
64
|
+
{...props}
|
|
65
|
+
/>
|
|
66
|
+
{error && <span className="text-footnote text-red-500">{error}</span>}
|
|
67
|
+
</div>
|
|
68
|
+
);
|
|
69
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { cn } from "../utils/cn";
|
|
2
|
+
|
|
3
|
+
export type InputTypeKind = "text" | "binary";
|
|
4
|
+
export type InputTypeState = "on" | "off";
|
|
5
|
+
|
|
6
|
+
export type InputTypeProps = {
|
|
7
|
+
type: InputTypeKind;
|
|
8
|
+
state: InputTypeState;
|
|
9
|
+
onChange?: (state: InputTypeState) => void;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const labels: Record<InputTypeKind, { on: string; off: string }> = {
|
|
15
|
+
text: { on: "On", off: "Off" },
|
|
16
|
+
binary: { on: "Yes", off: "No" },
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const InputType = ({
|
|
20
|
+
type,
|
|
21
|
+
state,
|
|
22
|
+
onChange,
|
|
23
|
+
disabled = false,
|
|
24
|
+
className,
|
|
25
|
+
}: InputTypeProps) => {
|
|
26
|
+
const isOn = state === "on";
|
|
27
|
+
const { on: onLabel, off: offLabel } = labels[type];
|
|
28
|
+
|
|
29
|
+
const toggle = (next: InputTypeState) => {
|
|
30
|
+
if (disabled) return;
|
|
31
|
+
onChange?.(next);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<div
|
|
36
|
+
role="group"
|
|
37
|
+
aria-label={`${type} input type`}
|
|
38
|
+
data-type={type}
|
|
39
|
+
data-state={state}
|
|
40
|
+
className={cn(
|
|
41
|
+
"inline-flex rounded-control border border-divider-primary bg-white p-0.5",
|
|
42
|
+
disabled && "opacity-50",
|
|
43
|
+
className,
|
|
44
|
+
)}
|
|
45
|
+
>
|
|
46
|
+
<button
|
|
47
|
+
type="button"
|
|
48
|
+
disabled={disabled}
|
|
49
|
+
aria-pressed={!isOn}
|
|
50
|
+
onClick={() => toggle("off")}
|
|
51
|
+
className={cn(
|
|
52
|
+
"min-w-12 rounded-[6px] px-3 py-1.5 text-caption-2 transition-colors",
|
|
53
|
+
!isOn
|
|
54
|
+
? "bg-grey-900 text-display-on-dark-primary"
|
|
55
|
+
: "text-display-on-light-secondary hover:bg-grey-100",
|
|
56
|
+
)}
|
|
57
|
+
>
|
|
58
|
+
{offLabel}
|
|
59
|
+
</button>
|
|
60
|
+
<button
|
|
61
|
+
type="button"
|
|
62
|
+
disabled={disabled}
|
|
63
|
+
aria-pressed={isOn}
|
|
64
|
+
onClick={() => toggle("on")}
|
|
65
|
+
className={cn(
|
|
66
|
+
"min-w-12 rounded-[6px] px-3 py-1.5 text-caption-2 transition-colors",
|
|
67
|
+
isOn
|
|
68
|
+
? "bg-grey-900 text-display-on-dark-primary"
|
|
69
|
+
: "text-display-on-light-secondary hover:bg-grey-100",
|
|
70
|
+
)}
|
|
71
|
+
>
|
|
72
|
+
{onLabel}
|
|
73
|
+
</button>
|
|
74
|
+
</div>
|
|
75
|
+
);
|
|
76
|
+
};
|
|
@@ -1,48 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import { type PropsWithChildren, type ReactNode } from "react";
|
|
2
|
+
import { IconButton } from "../primitives/IconButton";
|
|
3
|
+
import { ClearIcon } from "../icons";
|
|
4
|
+
import { cn } from "../utils/cn";
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
type HeaderProps = {
|
|
6
7
|
onClose: () => void;
|
|
7
|
-
right?:
|
|
8
|
-
}
|
|
8
|
+
right?: ReactNode;
|
|
9
|
+
};
|
|
9
10
|
|
|
10
|
-
const Header = ({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
<div className="flex items-center gap-4">
|
|
19
|
-
{right}
|
|
20
|
-
<IconButton
|
|
21
|
-
variant="text"
|
|
22
|
-
size="sm"
|
|
23
|
-
color="gray"
|
|
24
|
-
className="rounded-full"
|
|
25
|
-
onClick={onClose}
|
|
26
|
-
>
|
|
27
|
-
<XIcon className="size-4 text-gray-600" />
|
|
28
|
-
</IconButton>
|
|
29
|
-
</div>
|
|
11
|
+
const Header = ({ onClose, right, children }: PropsWithChildren<HeaderProps>) => (
|
|
12
|
+
<div className="flex items-center gap-2 rounded-t-xl bg-background-secondary px-2 py-3">
|
|
13
|
+
<div className="grow text-subheader-em text-display-on-light-primary">{children}</div>
|
|
14
|
+
<div className="flex items-center gap-4">
|
|
15
|
+
{right}
|
|
16
|
+
<IconButton hierarchy="quaternary" size="small" aria-label="Close" onClick={onClose}>
|
|
17
|
+
<ClearIcon size="small" />
|
|
18
|
+
</IconButton>
|
|
30
19
|
</div>
|
|
31
|
-
|
|
32
|
-
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
33
22
|
|
|
34
|
-
|
|
23
|
+
type BodyProps = {
|
|
35
24
|
className?: string;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const Body = ({ children, className = "" }: PropsWithChildren<BodyProps>) => {
|
|
39
|
-
return (
|
|
40
|
-
<div className={`w-full overflow-auto ${className}`}>
|
|
41
|
-
{children}
|
|
42
|
-
</div>
|
|
43
|
-
);
|
|
44
25
|
};
|
|
45
26
|
|
|
27
|
+
const Body = ({ children, className }: PropsWithChildren<BodyProps>) => (
|
|
28
|
+
<div className={cn("w-full overflow-auto", className)}>{children}</div>
|
|
29
|
+
);
|
|
30
|
+
|
|
46
31
|
export const ModalPanel = {
|
|
47
32
|
Header,
|
|
48
33
|
Body,
|
|
@@ -1,25 +1,27 @@
|
|
|
1
|
-
import { IconButton
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { cn } from "../../utils/cn"
|
|
1
|
+
import { IconButton } from "../../primitives/IconButton";
|
|
2
|
+
import { ChevronIcon, MinusIcon, PlusIcon, ExpandIcon } from "../../icons";
|
|
3
|
+
import { ModalPanel } from "../ModalPanel";
|
|
4
|
+
import { type ChangeEvent, useEffect, useState } from "react";
|
|
5
|
+
import { useZoom } from "./useZoom";
|
|
6
|
+
import { useRotation } from "./useRotation";
|
|
7
|
+
import { usePanning } from "./usePanning";
|
|
8
|
+
import { usePageManagement } from "./usePageManagement";
|
|
9
|
+
import { cn } from "../../utils/cn";
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
className?: string
|
|
14
|
-
canvasClassName?: string
|
|
15
|
-
documentUrl?: string
|
|
16
|
-
mainCanvasClassname?: string
|
|
17
|
-
initialPage?: number
|
|
18
|
-
onClose: () => void
|
|
19
|
-
totalPages: number
|
|
20
|
-
getImageSrc: (page: number) => string | Promise<string
|
|
21
|
-
title?: string
|
|
22
|
-
}
|
|
11
|
+
type ImageViewerProps = {
|
|
12
|
+
className?: string;
|
|
13
|
+
canvasClassName?: string;
|
|
14
|
+
documentUrl?: string;
|
|
15
|
+
mainCanvasClassname?: string;
|
|
16
|
+
initialPage?: number;
|
|
17
|
+
onClose: () => void;
|
|
18
|
+
totalPages: number;
|
|
19
|
+
getImageSrc: (page: number) => string | Promise<string>;
|
|
20
|
+
title?: string;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const toolbarButtonClass =
|
|
24
|
+
"flex h-8 w-8 items-center justify-center rounded-control border border-divider-primary bg-white text-display-on-light-secondary hover:bg-background-secondary disabled:opacity-50";
|
|
23
25
|
|
|
24
26
|
export const ImageViewer = ({
|
|
25
27
|
className,
|
|
@@ -32,180 +34,117 @@ export const ImageViewer = ({
|
|
|
32
34
|
documentUrl,
|
|
33
35
|
title = "PDF Viewer",
|
|
34
36
|
}: ImageViewerProps) => {
|
|
35
|
-
const [zoom, zoomActions] = useZoom()
|
|
36
|
-
const [rotation, rotationActions] = useRotation()
|
|
37
|
-
const [{ pan, isDragging }, panActions] = usePanning()
|
|
38
|
-
const [{ currentPage }, pageActions] = usePageManagement(
|
|
39
|
-
|
|
40
|
-
initialPage
|
|
41
|
-
)
|
|
42
|
-
const [imageSrc, setImageSrc] = useState<string>(() => {
|
|
43
|
-
const initialResult = getImageSrc(currentPage)
|
|
44
|
-
return typeof initialResult === "string" ? initialResult : ""
|
|
45
|
-
})
|
|
37
|
+
const [zoom, zoomActions] = useZoom();
|
|
38
|
+
const [rotation, rotationActions] = useRotation();
|
|
39
|
+
const [{ pan, isDragging }, panActions] = usePanning();
|
|
40
|
+
const [{ currentPage }, pageActions] = usePageManagement(totalPages, initialPage);
|
|
41
|
+
const [imageSrc, setImageSrc] = useState<string>("");
|
|
46
42
|
|
|
47
43
|
useEffect(() => {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if (isActive) {
|
|
55
|
-
setImageSrc(resolvedSrc)
|
|
56
|
-
}
|
|
57
|
-
}
|
|
44
|
+
const load = async () => {
|
|
45
|
+
const src = await getImageSrc(currentPage);
|
|
46
|
+
setImageSrc(src);
|
|
47
|
+
};
|
|
48
|
+
load();
|
|
49
|
+
}, [currentPage, getImageSrc]);
|
|
58
50
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
}, [currentPage, getImageSrc])
|
|
65
|
-
|
|
66
|
-
const rightButtons = (
|
|
67
|
-
<IconButton variant="text" color="gray">
|
|
68
|
-
<a href={documentUrl} target="_blank" rel="noopener noreferrer">
|
|
69
|
-
<ExpandIcon className="size-4" />
|
|
70
|
-
</a>
|
|
71
|
-
</IconButton>
|
|
72
|
-
)
|
|
51
|
+
const handleOpen = () => {
|
|
52
|
+
if (!documentUrl) return;
|
|
53
|
+
window.open(documentUrl, "_blank", "noopener,noreferrer");
|
|
54
|
+
};
|
|
73
55
|
|
|
74
56
|
return (
|
|
75
|
-
<div className={cn("
|
|
76
|
-
<ModalPanel.Header
|
|
57
|
+
<div className={cn("flex h-full flex-col rounded-t-lg shadow-raise2", className)}>
|
|
58
|
+
<ModalPanel.Header
|
|
59
|
+
onClose={onClose}
|
|
60
|
+
right={
|
|
61
|
+
documentUrl ? (
|
|
62
|
+
<IconButton hierarchy="quaternary" size="small" aria-label="Open" onClick={handleOpen}>
|
|
63
|
+
<ExpandIcon size="small" />
|
|
64
|
+
</IconButton>
|
|
65
|
+
) : undefined
|
|
66
|
+
}
|
|
67
|
+
>
|
|
77
68
|
{title}
|
|
78
69
|
</ModalPanel.Header>
|
|
79
70
|
|
|
80
|
-
<div className="
|
|
81
|
-
<div
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
71
|
+
<div className={cn("grid h-full grow overflow-hidden", canvasClassName)}>
|
|
72
|
+
<div
|
|
73
|
+
className={cn(
|
|
74
|
+
"col-start-1 row-start-1 flex items-center justify-center overflow-hidden bg-background-tertiary p-8",
|
|
75
|
+
isDragging ? "cursor-grabbing" : "cursor-grab",
|
|
76
|
+
mainCanvasClassname,
|
|
77
|
+
)}
|
|
78
|
+
onMouseDown={panActions.handleMouseDown}
|
|
79
|
+
onMouseMove={panActions.handleMouseMove}
|
|
80
|
+
onMouseUp={panActions.handleMouseUp}
|
|
81
|
+
onMouseLeave={panActions.handleMouseUp}
|
|
82
|
+
>
|
|
83
|
+
{imageSrc && (
|
|
84
|
+
<img
|
|
85
|
+
src={imageSrc}
|
|
86
|
+
alt={`Page ${currentPage}`}
|
|
91
87
|
style={{
|
|
92
|
-
transform: `translate(${pan.x}px, ${pan.y}px)`,
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
88
|
+
transform: `translate(${pan.x}px, ${pan.y}px) rotate(${rotation}deg) scale(${zoom / 100})`,
|
|
89
|
+
}}
|
|
90
|
+
className="max-w-full"
|
|
91
|
+
draggable={false}
|
|
92
|
+
/>
|
|
93
|
+
)}
|
|
94
|
+
</div>
|
|
95
|
+
|
|
96
|
+
<div className="z-10 col-start-1 row-start-1 flex items-center justify-between gap-3 self-start bg-background-secondary p-2 shadow">
|
|
97
|
+
<div className="flex items-center gap-1">
|
|
98
|
+
<button
|
|
99
|
+
type="button"
|
|
100
|
+
className={toolbarButtonClass}
|
|
101
|
+
onClick={pageActions.prevPage}
|
|
102
|
+
disabled={currentPage === 1}
|
|
103
|
+
aria-label="Previous page"
|
|
104
|
+
>
|
|
105
|
+
<ChevronIcon direction="left" size="small" />
|
|
106
|
+
</button>
|
|
107
|
+
<input
|
|
108
|
+
className="h-8 w-14 rounded-control border border-divider-primary bg-white text-center text-caption-2"
|
|
109
|
+
value={currentPage}
|
|
110
|
+
onChange={(e: ChangeEvent<HTMLInputElement>) => {
|
|
111
|
+
const page = parseInt(e.target.value, 10);
|
|
112
|
+
if (!isNaN(page)) pageActions.goToPage(page);
|
|
99
113
|
}}
|
|
100
|
-
|
|
114
|
+
type="number"
|
|
115
|
+
min={1}
|
|
116
|
+
max={totalPages}
|
|
117
|
+
/>
|
|
118
|
+
<span className="px-2 text-caption-2">of {totalPages}</span>
|
|
119
|
+
<button
|
|
120
|
+
type="button"
|
|
121
|
+
className={toolbarButtonClass}
|
|
122
|
+
onClick={pageActions.nextPage}
|
|
123
|
+
disabled={currentPage === totalPages}
|
|
124
|
+
aria-label="Next page"
|
|
101
125
|
>
|
|
102
|
-
<
|
|
103
|
-
|
|
104
|
-
transform: `scale(${zoom / 100}) rotate(${rotation}deg)`,
|
|
105
|
-
transformOrigin: "center",
|
|
106
|
-
transition: isDragging ? "none" : "transform 0.3s ease",
|
|
107
|
-
}}
|
|
108
|
-
>
|
|
109
|
-
{imageSrc ? (
|
|
110
|
-
<img
|
|
111
|
-
src={imageSrc}
|
|
112
|
-
style={{ userSelect: "none", pointerEvents: "none" }}
|
|
113
|
-
/>
|
|
114
|
-
) : null}
|
|
115
|
-
</div>
|
|
116
|
-
</div>
|
|
126
|
+
<ChevronIcon direction="right" size="small" />
|
|
127
|
+
</button>
|
|
117
128
|
</div>
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
<
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
onClick={() => {
|
|
135
|
-
zoomActions.reset()
|
|
136
|
-
panActions.reset()
|
|
137
|
-
}}
|
|
138
|
-
>
|
|
139
|
-
{zoom}%
|
|
140
|
-
</button>
|
|
141
|
-
</Tooltip>
|
|
142
|
-
<IconButton
|
|
143
|
-
variant="filled"
|
|
144
|
-
color="white"
|
|
145
|
-
className="py-[26px]"
|
|
146
|
-
onClick={zoomActions.zoomIn}
|
|
147
|
-
>
|
|
148
|
-
<Icon icon="lucide:plus" />
|
|
149
|
-
</IconButton>
|
|
150
|
-
</ButtonGroup>
|
|
151
|
-
<ButtonGroup className="divide-x-0 h-[52px]">
|
|
152
|
-
<IconButton
|
|
153
|
-
variant="filled"
|
|
154
|
-
color="white"
|
|
155
|
-
className="py-[26px]"
|
|
156
|
-
onClick={rotationActions.rotateClockwise}
|
|
157
|
-
>
|
|
158
|
-
<Icon icon="lucide:iteration-cw" />
|
|
159
|
-
</IconButton>
|
|
160
|
-
|
|
161
|
-
<IconButton
|
|
162
|
-
variant="filled"
|
|
163
|
-
color="white"
|
|
164
|
-
className="py-[26px]"
|
|
165
|
-
onClick={rotationActions.rotateCounterClockwise}
|
|
166
|
-
>
|
|
167
|
-
<Icon icon="lucide:iteration-ccw" />
|
|
168
|
-
</IconButton>
|
|
169
|
-
</ButtonGroup>
|
|
170
|
-
<ButtonGroup className="divide-x-0 ">
|
|
171
|
-
<IconButton
|
|
172
|
-
variant="filled"
|
|
173
|
-
color="white"
|
|
174
|
-
className="py-[26px]"
|
|
175
|
-
onClick={pageActions.prevPage}
|
|
176
|
-
disabled={currentPage === 1}
|
|
177
|
-
>
|
|
178
|
-
<Icon icon="lucide:chevron-left" />
|
|
179
|
-
</IconButton>
|
|
180
|
-
<input
|
|
181
|
-
className="bg-white pl-4 flex items-center w-[50px] text-center focus:outline-none w-[60px]"
|
|
182
|
-
value={currentPage}
|
|
183
|
-
onChange={(e: ChangeEvent<HTMLInputElement>) => {
|
|
184
|
-
const page = parseInt(e.target.value)
|
|
185
|
-
if (!isNaN(page)) {
|
|
186
|
-
pageActions.goToPage(page)
|
|
187
|
-
}
|
|
188
|
-
}}
|
|
189
|
-
type="number"
|
|
190
|
-
min="1"
|
|
191
|
-
max={totalPages}
|
|
192
|
-
/>
|
|
193
|
-
<div className="flex items-center bg-white px-2">
|
|
194
|
-
of {totalPages}
|
|
195
|
-
</div>
|
|
196
|
-
<IconButton
|
|
197
|
-
variant="filled"
|
|
198
|
-
color="white"
|
|
199
|
-
className="py-[26px]"
|
|
200
|
-
onClick={pageActions.nextPage}
|
|
201
|
-
disabled={currentPage === totalPages}
|
|
202
|
-
>
|
|
203
|
-
<Icon icon="lucide:chevron-right" />
|
|
204
|
-
</IconButton>
|
|
205
|
-
</ButtonGroup>
|
|
129
|
+
<div className="flex items-center gap-1">
|
|
130
|
+
<button type="button" className={toolbarButtonClass} onClick={zoomActions.zoomOut} aria-label="Zoom out">
|
|
131
|
+
<MinusIcon size="small" />
|
|
132
|
+
</button>
|
|
133
|
+
<span className="w-14 text-center text-caption-2">{zoom}%</span>
|
|
134
|
+
<button type="button" className={toolbarButtonClass} onClick={zoomActions.zoomIn} aria-label="Zoom in">
|
|
135
|
+
<PlusIcon size="small" />
|
|
136
|
+
</button>
|
|
137
|
+
<button
|
|
138
|
+
type="button"
|
|
139
|
+
className={toolbarButtonClass}
|
|
140
|
+
onClick={rotationActions.rotateCounterClockwise}
|
|
141
|
+
aria-label="Rotate"
|
|
142
|
+
>
|
|
143
|
+
<ChevronIcon direction="left" size="small" />
|
|
144
|
+
</button>
|
|
206
145
|
</div>
|
|
207
146
|
</div>
|
|
208
147
|
</div>
|
|
209
148
|
</div>
|
|
210
|
-
)
|
|
211
|
-
}
|
|
149
|
+
);
|
|
150
|
+
};
|