@lateralus-ai/shipping-ui 1.4.16 → 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,193 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { SidebarIcon } from "../../icons";
|
|
3
|
+
import { DropdownMenu, DropdownMenuItem, IconButton, Tooltip } from "../../primitives";
|
|
4
|
+
import { cn } from "../../utils/cn";
|
|
5
|
+
import { accountAvatar, accountAvatar24 } from "./figma-assets";
|
|
6
|
+
import { FIGMA_ACCOUNT_NAME } from "./figma-demo-content";
|
|
7
|
+
import {
|
|
8
|
+
sidebarSectionContent,
|
|
9
|
+
sidebarSectionIconClass,
|
|
10
|
+
sidebarSectionLabelClass,
|
|
11
|
+
sidebarSectionShell,
|
|
12
|
+
sidebarSectionShellCollapsed,
|
|
13
|
+
sidebarSurfaceHover,
|
|
14
|
+
sidebarQuaternaryIconButton,
|
|
15
|
+
sidebarRowInteractiveHover,
|
|
16
|
+
} from "./sidebar-styles";
|
|
17
|
+
|
|
18
|
+
export type AccountMenuItem = {
|
|
19
|
+
id: string;
|
|
20
|
+
label: string;
|
|
21
|
+
icon?: ReactNode;
|
|
22
|
+
destructive?: boolean;
|
|
23
|
+
onSelect: () => void;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export type AccountProps = {
|
|
27
|
+
name?: string;
|
|
28
|
+
avatarSrc?: string;
|
|
29
|
+
collapsed?: boolean;
|
|
30
|
+
/** Storybook / subcomponent grid forced state. */
|
|
31
|
+
state?: "idle" | "hover";
|
|
32
|
+
/** Composed sidebar: true when pointer is over collapsed sidebar (shipping-ai pattern). */
|
|
33
|
+
sidebarHovered?: boolean;
|
|
34
|
+
presentation?: boolean;
|
|
35
|
+
menuItems?: AccountMenuItem[];
|
|
36
|
+
onToggleCollapsed?: () => void;
|
|
37
|
+
className?: string;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const defaultMenuItems: AccountMenuItem[] = [
|
|
41
|
+
{ id: "settings", label: "Settings", onSelect: () => undefined },
|
|
42
|
+
{ id: "logout", label: "Log out", destructive: true, onSelect: () => undefined },
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
const AccountAvatar = ({ src, className }: { src: string; className?: string }) => (
|
|
46
|
+
<img src={src} alt="" className={cn("size-full object-cover", className)} />
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
const AccountRow = ({
|
|
50
|
+
name,
|
|
51
|
+
avatarSrc,
|
|
52
|
+
collapsed,
|
|
53
|
+
state,
|
|
54
|
+
sidebarHovered = false,
|
|
55
|
+
onToggleCollapsed,
|
|
56
|
+
className,
|
|
57
|
+
}: Pick<
|
|
58
|
+
AccountProps,
|
|
59
|
+
| "name"
|
|
60
|
+
| "avatarSrc"
|
|
61
|
+
| "collapsed"
|
|
62
|
+
| "state"
|
|
63
|
+
| "sidebarHovered"
|
|
64
|
+
| "onToggleCollapsed"
|
|
65
|
+
| "className"
|
|
66
|
+
>) => {
|
|
67
|
+
const showExpandIcon = collapsed && (sidebarHovered || state === "hover");
|
|
68
|
+
|
|
69
|
+
if (showExpandIcon) {
|
|
70
|
+
return (
|
|
71
|
+
<div
|
|
72
|
+
className={cn(sidebarSectionShellCollapsed, sidebarSurfaceHover, className)}
|
|
73
|
+
data-collapsed={collapsed}
|
|
74
|
+
data-state="hover"
|
|
75
|
+
>
|
|
76
|
+
<IconButton
|
|
77
|
+
hierarchy="quaternary"
|
|
78
|
+
size="small"
|
|
79
|
+
aria-label="Expand sidebar"
|
|
80
|
+
className={cn("size-6 p-1", sidebarQuaternaryIconButton)}
|
|
81
|
+
onClick={onToggleCollapsed}
|
|
82
|
+
>
|
|
83
|
+
<SidebarIcon size="small" />
|
|
84
|
+
</IconButton>
|
|
85
|
+
</div>
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (collapsed) {
|
|
90
|
+
return (
|
|
91
|
+
<div
|
|
92
|
+
className={cn(
|
|
93
|
+
sidebarSectionShellCollapsed,
|
|
94
|
+
state === "idle" && sidebarRowInteractiveHover,
|
|
95
|
+
className,
|
|
96
|
+
)}
|
|
97
|
+
data-collapsed={collapsed}
|
|
98
|
+
data-state={state}
|
|
99
|
+
>
|
|
100
|
+
<span className="size-6 shrink-0 overflow-hidden rounded-2xl">
|
|
101
|
+
<AccountAvatar src={avatarSrc ?? accountAvatar24} />
|
|
102
|
+
</span>
|
|
103
|
+
</div>
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return (
|
|
108
|
+
<div
|
|
109
|
+
className={cn("flex h-9 w-full items-center gap-1 pr-2", className)}
|
|
110
|
+
data-collapsed={collapsed}
|
|
111
|
+
data-state={state}
|
|
112
|
+
>
|
|
113
|
+
<div
|
|
114
|
+
className={cn(
|
|
115
|
+
sidebarSectionShell,
|
|
116
|
+
"min-w-0 flex-1",
|
|
117
|
+
state === "hover" && sidebarSurfaceHover,
|
|
118
|
+
state === "idle" && sidebarRowInteractiveHover,
|
|
119
|
+
)}
|
|
120
|
+
>
|
|
121
|
+
<div className={sidebarSectionContent}>
|
|
122
|
+
<span className={cn(sidebarSectionIconClass, "size-4 overflow-hidden rounded-full")}>
|
|
123
|
+
<AccountAvatar src={avatarSrc ?? accountAvatar} />
|
|
124
|
+
</span>
|
|
125
|
+
<span className={sidebarSectionLabelClass}>{name}</span>
|
|
126
|
+
</div>
|
|
127
|
+
</div>
|
|
128
|
+
<IconButton
|
|
129
|
+
hierarchy="quaternary"
|
|
130
|
+
size="small"
|
|
131
|
+
aria-label="Collapse sidebar"
|
|
132
|
+
className={cn("size-6 shrink-0 p-1", sidebarQuaternaryIconButton)}
|
|
133
|
+
onClick={onToggleCollapsed}
|
|
134
|
+
>
|
|
135
|
+
<SidebarIcon size="small" />
|
|
136
|
+
</IconButton>
|
|
137
|
+
</div>
|
|
138
|
+
);
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
export const Account = ({
|
|
142
|
+
name = FIGMA_ACCOUNT_NAME,
|
|
143
|
+
avatarSrc,
|
|
144
|
+
collapsed = false,
|
|
145
|
+
state = "idle",
|
|
146
|
+
sidebarHovered = false,
|
|
147
|
+
presentation = false,
|
|
148
|
+
menuItems = defaultMenuItems,
|
|
149
|
+
onToggleCollapsed,
|
|
150
|
+
className,
|
|
151
|
+
}: AccountProps) => {
|
|
152
|
+
const row = (
|
|
153
|
+
<AccountRow
|
|
154
|
+
name={name}
|
|
155
|
+
avatarSrc={avatarSrc}
|
|
156
|
+
collapsed={collapsed}
|
|
157
|
+
state={state}
|
|
158
|
+
sidebarHovered={sidebarHovered}
|
|
159
|
+
onToggleCollapsed={onToggleCollapsed}
|
|
160
|
+
className={className}
|
|
161
|
+
/>
|
|
162
|
+
);
|
|
163
|
+
|
|
164
|
+
if (presentation) return row;
|
|
165
|
+
|
|
166
|
+
if (collapsed && !sidebarHovered && state !== "hover") {
|
|
167
|
+
return (
|
|
168
|
+
<Tooltip content={name} side="right" className="w-full">
|
|
169
|
+
{row}
|
|
170
|
+
</Tooltip>
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
if (collapsed) return row;
|
|
175
|
+
|
|
176
|
+
return (
|
|
177
|
+
<DropdownMenu side="top" align="start" trigger={row}>
|
|
178
|
+
{menuItems.map((item) => (
|
|
179
|
+
<DropdownMenuItem
|
|
180
|
+
key={item.id}
|
|
181
|
+
className={cn(item.destructive && "text-red-500 hover:bg-red-50 hover:text-red-700")}
|
|
182
|
+
onSelect={(event) => {
|
|
183
|
+
event.preventDefault();
|
|
184
|
+
item.onSelect();
|
|
185
|
+
}}
|
|
186
|
+
>
|
|
187
|
+
{item.icon && <span className="shrink-0 [&>svg]:size-4">{item.icon}</span>}
|
|
188
|
+
{item.label}
|
|
189
|
+
</DropdownMenuItem>
|
|
190
|
+
))}
|
|
191
|
+
</DropdownMenu>
|
|
192
|
+
);
|
|
193
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { type MouseEvent, type ReactNode } from "react";
|
|
2
|
+
import { ActivityIcon, ChatIcon, ChatProIcon, StatusIcon } from "../../icons";
|
|
3
|
+
import { Count } from "../../primitives";
|
|
4
|
+
import { cn } from "../../utils/cn";
|
|
5
|
+
import { FIGMA_ACTIVITY_ENTRIES, type FigmaActivityIcon } from "./figma-demo-content";
|
|
6
|
+
import { sidebarGroupGap } from "./sidebar-styles";
|
|
7
|
+
import { SidebarEntry, type SidebarEntryMenuItem } from "./SidebarEntry";
|
|
8
|
+
import { SidebarLink } from "./SidebarLink";
|
|
9
|
+
import type { Chief } from "./Switcher";
|
|
10
|
+
|
|
11
|
+
export type ActivityNavGroupProps = {
|
|
12
|
+
href: string;
|
|
13
|
+
chief: Chief;
|
|
14
|
+
empty?: boolean;
|
|
15
|
+
label?: string;
|
|
16
|
+
icon?: ReactNode;
|
|
17
|
+
className?: string;
|
|
18
|
+
onNavigate?: (event: MouseEvent<HTMLAnchorElement>) => void;
|
|
19
|
+
entryMenuItems?: SidebarEntryMenuItem[];
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const activityEntryIcon = (icon: FigmaActivityIcon) => {
|
|
23
|
+
if (icon === "status") return <StatusIcon size="small" />;
|
|
24
|
+
if (icon === "statusClosed") return <StatusIcon size="small" variant="closed" />;
|
|
25
|
+
if (icon === "chatPro") return <ChatProIcon size="small" />;
|
|
26
|
+
return <ChatIcon size="small" />;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const ActivityNavGroup = ({
|
|
30
|
+
href,
|
|
31
|
+
chief,
|
|
32
|
+
empty = false,
|
|
33
|
+
label = "Activity",
|
|
34
|
+
icon = <ActivityIcon size="small" className="text-display-on-light-tertiary" />,
|
|
35
|
+
className,
|
|
36
|
+
onNavigate,
|
|
37
|
+
entryMenuItems,
|
|
38
|
+
}: ActivityNavGroupProps) => (
|
|
39
|
+
<div
|
|
40
|
+
className={cn("flex w-full max-w-[248px] flex-col", sidebarGroupGap, className)}
|
|
41
|
+
data-chief={chief}
|
|
42
|
+
data-empty={empty}
|
|
43
|
+
>
|
|
44
|
+
<SidebarLink href={href} label={label} icon={icon} onNavigate={onNavigate} />
|
|
45
|
+
|
|
46
|
+
{!empty &&
|
|
47
|
+
FIGMA_ACTIVITY_ENTRIES.map((entry) => (
|
|
48
|
+
<SidebarEntry
|
|
49
|
+
key={entry.id}
|
|
50
|
+
href={entry.href}
|
|
51
|
+
label={entry.label}
|
|
52
|
+
icon={activityEntryIcon(entry.icon)}
|
|
53
|
+
badge={
|
|
54
|
+
entry.count ? (
|
|
55
|
+
<Count
|
|
56
|
+
value={entry.count}
|
|
57
|
+
className="min-h-5 min-w-5 bg-red-600 px-0.5 py-0.5 text-[13px] font-medium leading-4 tracking-[0.02em] text-white"
|
|
58
|
+
/>
|
|
59
|
+
) : undefined
|
|
60
|
+
}
|
|
61
|
+
menuItems={entryMenuItems}
|
|
62
|
+
/>
|
|
63
|
+
))}
|
|
64
|
+
|
|
65
|
+
{!empty && <SidebarEntry href={href} label="Show all" onNavigate={onNavigate} />}
|
|
66
|
+
</div>
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
/** @deprecated Use ActivityNavGroup */
|
|
70
|
+
export const Activity = ActivityNavGroup;
|
|
71
|
+
export type ActivityProps = ActivityNavGroupProps;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { type MouseEvent, type ReactNode } from "react";
|
|
2
|
+
import { ChevronIcon, ShipIcon } from "../../icons";
|
|
3
|
+
import { Count, IconButton } from "../../primitives";
|
|
4
|
+
import { cn } from "../../utils/cn";
|
|
5
|
+
import { FIGMA_SHIP_ENTRIES } from "./figma-demo-content";
|
|
6
|
+
import { sidebarGroupGap, sidebarQuaternaryIconButton } from "./sidebar-styles";
|
|
7
|
+
import { SidebarEntry, type SidebarEntryMenuItem } from "./SidebarEntry";
|
|
8
|
+
import { SidebarLink } from "./SidebarLink";
|
|
9
|
+
|
|
10
|
+
export type Ship = {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
href?: string;
|
|
14
|
+
count?: number;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type CollapsibleNavGroupProps = {
|
|
18
|
+
href: string;
|
|
19
|
+
label?: string;
|
|
20
|
+
icon?: ReactNode;
|
|
21
|
+
expanded: boolean;
|
|
22
|
+
onExpandedChange: (expanded: boolean) => void;
|
|
23
|
+
ships?: Ship[];
|
|
24
|
+
className?: string;
|
|
25
|
+
onNavigate?: (event: MouseEvent<HTMLAnchorElement>) => void;
|
|
26
|
+
entryMenuItems?: SidebarEntryMenuItem[];
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const CollapsibleNavGroup = ({
|
|
30
|
+
href,
|
|
31
|
+
label = "Ships",
|
|
32
|
+
icon = <ShipIcon size="small" className="text-display-on-light-primary" />,
|
|
33
|
+
expanded,
|
|
34
|
+
onExpandedChange,
|
|
35
|
+
ships = FIGMA_SHIP_ENTRIES,
|
|
36
|
+
className,
|
|
37
|
+
onNavigate,
|
|
38
|
+
entryMenuItems,
|
|
39
|
+
}: CollapsibleNavGroupProps) => (
|
|
40
|
+
<div
|
|
41
|
+
className={cn("flex w-full max-w-[264px] flex-col", sidebarGroupGap, className)}
|
|
42
|
+
data-expanded={expanded}
|
|
43
|
+
>
|
|
44
|
+
<SidebarLink
|
|
45
|
+
href={href}
|
|
46
|
+
label={label}
|
|
47
|
+
icon={icon}
|
|
48
|
+
tall
|
|
49
|
+
onNavigate={onNavigate}
|
|
50
|
+
trailing={
|
|
51
|
+
<IconButton
|
|
52
|
+
hierarchy="quaternary"
|
|
53
|
+
size="small"
|
|
54
|
+
aria-expanded={expanded}
|
|
55
|
+
aria-label={expanded ? `Collapse ${label}` : `Expand ${label}`}
|
|
56
|
+
className={cn("size-6 shrink-0 p-1", sidebarQuaternaryIconButton)}
|
|
57
|
+
onClick={(event) => {
|
|
58
|
+
event.preventDefault();
|
|
59
|
+
event.stopPropagation();
|
|
60
|
+
onExpandedChange(!expanded);
|
|
61
|
+
}}
|
|
62
|
+
>
|
|
63
|
+
<ChevronIcon
|
|
64
|
+
direction="right"
|
|
65
|
+
className={cn(
|
|
66
|
+
"size-4 transition-transform duration-200 ease-in-out",
|
|
67
|
+
expanded && "rotate-90",
|
|
68
|
+
)}
|
|
69
|
+
/>
|
|
70
|
+
</IconButton>
|
|
71
|
+
}
|
|
72
|
+
/>
|
|
73
|
+
|
|
74
|
+
<div
|
|
75
|
+
className={cn(
|
|
76
|
+
"grid transition-[grid-template-rows,opacity] duration-200 ease-in-out",
|
|
77
|
+
expanded ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0",
|
|
78
|
+
)}
|
|
79
|
+
>
|
|
80
|
+
<div className={cn("flex min-h-0 flex-col overflow-hidden", sidebarGroupGap)}>
|
|
81
|
+
{ships.map((ship) => (
|
|
82
|
+
<SidebarEntry
|
|
83
|
+
key={ship.id}
|
|
84
|
+
href={ship.href ?? `#${ship.id}`}
|
|
85
|
+
label={ship.name}
|
|
86
|
+
icon={<ShipIcon size="small" className="text-display-on-light-primary" />}
|
|
87
|
+
badge={
|
|
88
|
+
ship.count ? (
|
|
89
|
+
<Count
|
|
90
|
+
value={ship.count}
|
|
91
|
+
className="min-h-5 min-w-5 bg-red-600 px-0.5 py-0.5 text-[13px] font-medium leading-4 tracking-[0.02em] text-white"
|
|
92
|
+
/>
|
|
93
|
+
) : undefined
|
|
94
|
+
}
|
|
95
|
+
menuItems={entryMenuItems}
|
|
96
|
+
/>
|
|
97
|
+
))}
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
/** @deprecated Use CollapsibleNavGroup */
|
|
104
|
+
export const Ships = CollapsibleNavGroup;
|
|
105
|
+
export type ShipsProps = CollapsibleNavGroupProps;
|
|
106
|
+
export type ShipsState = "collapsed" | "expanded";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Logo } from "../../primitives";
|
|
2
|
+
import { cn } from "../../utils/cn";
|
|
3
|
+
import type { Chief } from "./Switcher";
|
|
4
|
+
|
|
5
|
+
export type IndicatorProps = {
|
|
6
|
+
chief: Chief;
|
|
7
|
+
className?: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const Indicator = ({ chief, className }: IndicatorProps) => (
|
|
11
|
+
<div className={cn("size-6 shrink-0", className)} aria-label={`Active chief: ${chief}`}>
|
|
12
|
+
<Logo chief={chief} className="size-6" />
|
|
13
|
+
</div>
|
|
14
|
+
);
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { type MouseEvent } from "react";
|
|
2
|
+
import { AddIcon } from "../../icons";
|
|
3
|
+
import { Tooltip } from "../../primitives";
|
|
4
|
+
import { cn } from "../../utils/cn";
|
|
5
|
+
import {
|
|
6
|
+
sidebarNewChatIconHover,
|
|
7
|
+
sidebarNewChatInteractiveHover,
|
|
8
|
+
} from "./sidebar-styles";
|
|
9
|
+
|
|
10
|
+
export type NewChatProps = {
|
|
11
|
+
href?: string;
|
|
12
|
+
collapsed?: boolean;
|
|
13
|
+
state?: "idle" | "hover";
|
|
14
|
+
className?: string;
|
|
15
|
+
presentation?: boolean;
|
|
16
|
+
onNavigate?: (event: MouseEvent<HTMLAnchorElement>) => void;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const NewChat = ({
|
|
20
|
+
href = "#new-chat",
|
|
21
|
+
collapsed = false,
|
|
22
|
+
state = "idle",
|
|
23
|
+
presentation = false,
|
|
24
|
+
className,
|
|
25
|
+
onNavigate,
|
|
26
|
+
}: NewChatProps) => {
|
|
27
|
+
const isForcedHover = state === "hover";
|
|
28
|
+
|
|
29
|
+
const link = (
|
|
30
|
+
<a
|
|
31
|
+
href={href}
|
|
32
|
+
aria-label="New chat"
|
|
33
|
+
onClick={onNavigate}
|
|
34
|
+
className={cn(
|
|
35
|
+
"box-border flex w-full flex-col rounded-control p-2 text-display-on-light-primary",
|
|
36
|
+
collapsed && "items-center justify-center",
|
|
37
|
+
state === "idle" && sidebarNewChatInteractiveHover,
|
|
38
|
+
isForcedHover && "bg-action-primary-hover text-action-primary-on-hover",
|
|
39
|
+
className,
|
|
40
|
+
)}
|
|
41
|
+
data-collapsed={collapsed}
|
|
42
|
+
data-state={state}
|
|
43
|
+
>
|
|
44
|
+
<span className={cn("flex w-full items-center", collapsed ? "justify-center" : "gap-2")}>
|
|
45
|
+
<AddIcon
|
|
46
|
+
size="large"
|
|
47
|
+
filled
|
|
48
|
+
className={cn(
|
|
49
|
+
"size-6 shrink-0",
|
|
50
|
+
isForcedHover
|
|
51
|
+
? "text-action-primary-on-hover"
|
|
52
|
+
: cn("text-display-on-light-primary", sidebarNewChatIconHover),
|
|
53
|
+
)}
|
|
54
|
+
/>
|
|
55
|
+
{!collapsed && (
|
|
56
|
+
<span className="min-w-0 flex-1 truncate text-left text-caption-2 tracking-[0.01em]">
|
|
57
|
+
New chat
|
|
58
|
+
</span>
|
|
59
|
+
)}
|
|
60
|
+
</span>
|
|
61
|
+
</a>
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
if (presentation || !collapsed) return link;
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<Tooltip content="New chat" side="right" className="w-full">
|
|
68
|
+
{link}
|
|
69
|
+
</Tooltip>
|
|
70
|
+
);
|
|
71
|
+
};
|