@lateralus-ai/shipping-ui 1.4.16 → 2.0.0-dev.10
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 +33 -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/Modal.d.ts +36 -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 +26 -12
- package/dist/components/index.d.ts +12 -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 +11535 -36619
- 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 +19 -0
- package/dist/patterns/Search/SearchModal.d.ts +88 -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 +14 -0
- package/dist/primitives/Button.d.ts +22 -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/button-styles.d.ts +4 -0
- package/dist/primitives/index.d.ts +15 -0
- package/dist/style.css +1 -1
- package/dist/tailwind-theme.d.ts +234 -198
- package/dist/theme-entry-BUK3MJUJ.mjs +261 -0
- package/dist/theme-entry-ygTpGaNC.js +1 -0
- package/dist/theme-entry.d.ts +2 -0
- package/dist/theme.cjs +1 -0
- package/dist/theme.d.ts +2 -0
- package/dist/theme.esm.js +5 -0
- 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 +36 -7
- 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 +138 -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/Modal.tsx +141 -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 +146 -43
- package/src/components/index.ts +43 -6
- 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 +76 -4
- 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 +44 -0
- package/src/patterns/Search/SearchModal.tsx +310 -0
- package/src/patterns/Search/SectionHeader.tsx +20 -0
- package/src/patterns/Search/index.ts +31 -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 +56 -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 +44 -0
- package/src/primitives/Button.tsx +231 -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/button-styles.ts +92 -0
- package/src/primitives/index.ts +18 -0
- package/src/stories/_layout/FigmaPage.tsx +94 -0
- package/src/stories/_layout/index.ts +8 -0
- package/src/stories/canvases/ButtonsCanvas.tsx +107 -0
- package/src/stories/canvases/ButtonsMatrixCanvas.tsx +65 -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 +157 -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 +150 -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-buttons-layout.ts +83 -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 +146 -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/theme-entry.ts +2 -0
- 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/tailwind.config.ts +12 -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
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import ExpandIcon from "
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import "react-pdf/dist/Page/
|
|
8
|
-
import "react-pdf/dist/Page/TextLayer.css"
|
|
1
|
+
import { Document, Page, pdfjs } from "react-pdf";
|
|
2
|
+
import { ModalPanel } from "../ModalPanel";
|
|
3
|
+
import { IconButton } from "../../primitives/IconButton";
|
|
4
|
+
import { ChevronIcon, MinusIcon, PlusIcon, ExpandIcon } from "../../icons";
|
|
5
|
+
import { cn } from "../../utils/cn";
|
|
6
|
+
import "react-pdf/dist/Page/AnnotationLayer.css";
|
|
7
|
+
import "react-pdf/dist/Page/TextLayer.css";
|
|
9
8
|
import {
|
|
10
9
|
useState,
|
|
11
|
-
ChangeEvent,
|
|
12
|
-
useMemo,
|
|
13
|
-
MouseEvent as ReactMouseEvent,
|
|
10
|
+
type ChangeEvent,
|
|
14
11
|
useRef,
|
|
15
12
|
useEffect,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
13
|
+
type MouseEvent as ReactMouseEvent,
|
|
14
|
+
} from "react";
|
|
15
|
+
import { useZoom } from "./useZoom";
|
|
16
|
+
import { useRotation } from "./useRotation";
|
|
17
|
+
import { usePageManagement } from "./usePageManagement";
|
|
18
|
+
import { usePanning } from "./usePanning";
|
|
21
19
|
|
|
22
|
-
pdfjs.GlobalWorkerOptions.workerSrc = `//unpkg.com/pdfjs-dist@${pdfjs.version}/build/pdf.worker.min.mjs
|
|
20
|
+
pdfjs.GlobalWorkerOptions.workerSrc = `//unpkg.com/pdfjs-dist@${pdfjs.version}/build/pdf.worker.min.mjs`;
|
|
23
21
|
|
|
24
|
-
|
|
25
|
-
onClose: () => void
|
|
26
|
-
src: string
|
|
27
|
-
title?: string
|
|
28
|
-
onOpen?: (event: ReactMouseEvent<HTMLButtonElement>) => void
|
|
29
|
-
}
|
|
22
|
+
type PdfViewerProps = React.HTMLProps<HTMLDivElement> & {
|
|
23
|
+
onClose: () => void;
|
|
24
|
+
src: string;
|
|
25
|
+
title?: string;
|
|
26
|
+
onOpen?: (event: ReactMouseEvent<HTMLButtonElement>) => void;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const toolbarButtonClass =
|
|
30
|
+
"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";
|
|
30
31
|
|
|
31
32
|
export const PdfViewer = ({
|
|
32
33
|
onClose,
|
|
@@ -35,80 +36,58 @@ export const PdfViewer = ({
|
|
|
35
36
|
className,
|
|
36
37
|
onOpen,
|
|
37
38
|
}: PdfViewerProps) => {
|
|
38
|
-
const [zoom, zoomActions] = useZoom()
|
|
39
|
-
const [rotation, rotationActions] = useRotation()
|
|
40
|
-
const [{ currentPage, totalPages }, pageActions] = usePageManagement()
|
|
41
|
-
const [{ pan, isDragging }, panActions] = usePanning()
|
|
42
|
-
const [scale, setScale] = useState(1)
|
|
43
|
-
const containerRef = useRef<HTMLDivElement>(null)
|
|
39
|
+
const [zoom, zoomActions] = useZoom();
|
|
40
|
+
const [rotation, rotationActions] = useRotation();
|
|
41
|
+
const [{ currentPage, totalPages }, pageActions] = usePageManagement();
|
|
42
|
+
const [{ pan, isDragging }, panActions] = usePanning();
|
|
43
|
+
const [scale, setScale] = useState(1);
|
|
44
|
+
const containerRef = useRef<HTMLDivElement>(null);
|
|
44
45
|
|
|
45
46
|
useEffect(() => {
|
|
46
47
|
const calculateScale = () => {
|
|
47
|
-
if (containerRef.current)
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
setScale(baseScale * (zoom / 100))
|
|
53
|
-
}
|
|
54
|
-
}
|
|
48
|
+
if (!containerRef.current) return;
|
|
49
|
+
const containerWidth = containerRef.current.offsetWidth;
|
|
50
|
+
const baseScale = containerWidth / 612;
|
|
51
|
+
setScale(baseScale * (zoom / 100));
|
|
52
|
+
};
|
|
55
53
|
|
|
56
|
-
calculateScale()
|
|
57
|
-
window.addEventListener("resize", calculateScale)
|
|
58
|
-
return () => window.removeEventListener("resize", calculateScale)
|
|
59
|
-
}, [zoom])
|
|
54
|
+
calculateScale();
|
|
55
|
+
window.addEventListener("resize", calculateScale);
|
|
56
|
+
return () => window.removeEventListener("resize", calculateScale);
|
|
57
|
+
}, [zoom]);
|
|
60
58
|
|
|
61
59
|
const handleOpen = (event: ReactMouseEvent<HTMLButtonElement>) => {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
onOpen(event)
|
|
67
|
-
} else {
|
|
68
|
-
console.debug("[PdfViewer] open button clicked", {
|
|
69
|
-
hasHandler: false,
|
|
70
|
-
})
|
|
71
|
-
}
|
|
72
|
-
if (event.defaultPrevented) {
|
|
73
|
-
return
|
|
60
|
+
onOpen?.(event);
|
|
61
|
+
if (event.defaultPrevented || !src) {
|
|
62
|
+
event.preventDefault();
|
|
63
|
+
return;
|
|
74
64
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
event.preventDefault()
|
|
78
|
-
return
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
window.open(src, "_blank", "noopener,noreferrer")
|
|
82
|
-
}
|
|
65
|
+
window.open(src, "_blank", "noopener,noreferrer");
|
|
66
|
+
};
|
|
83
67
|
|
|
84
68
|
const rightButtons = (
|
|
85
|
-
<IconButton
|
|
86
|
-
<ExpandIcon
|
|
69
|
+
<IconButton hierarchy="quaternary" size="small" aria-label="Open in new tab" onClick={handleOpen}>
|
|
70
|
+
<ExpandIcon size="small" />
|
|
87
71
|
</IconButton>
|
|
88
|
-
)
|
|
72
|
+
);
|
|
89
73
|
|
|
90
74
|
return (
|
|
91
|
-
<div
|
|
92
|
-
className={cn("shadow rounded-t-lg flex flex-col h-full", className)}
|
|
93
|
-
ref={containerRef}
|
|
94
|
-
>
|
|
75
|
+
<div className={cn("flex h-full flex-col rounded-t-lg shadow-raise2", className)} ref={containerRef}>
|
|
95
76
|
<ModalPanel.Header onClose={onClose} right={rightButtons}>
|
|
96
77
|
{title}
|
|
97
78
|
</ModalPanel.Header>
|
|
98
79
|
|
|
99
|
-
<div className="grid
|
|
80
|
+
<div className="grid h-full grow overflow-hidden shadow">
|
|
100
81
|
<div
|
|
101
82
|
className={cn(
|
|
102
|
-
"col-start-1 row-start-1
|
|
103
|
-
isDragging ? "cursor-grabbing" : "cursor-grab"
|
|
83
|
+
"col-start-1 row-start-1 mt-8 flex h-full items-center justify-center overflow-hidden bg-background-tertiary p-8 select-none",
|
|
84
|
+
isDragging ? "cursor-grabbing" : "cursor-grab",
|
|
104
85
|
)}
|
|
105
86
|
onMouseDown={panActions.handleMouseDown}
|
|
106
87
|
onMouseMove={panActions.handleMouseMove}
|
|
107
88
|
onMouseUp={panActions.handleMouseUp}
|
|
108
89
|
onMouseLeave={panActions.handleMouseUp}
|
|
109
|
-
style={{
|
|
110
|
-
userSelect: "none",
|
|
111
|
-
}}
|
|
90
|
+
style={{ userSelect: "none" }}
|
|
112
91
|
>
|
|
113
92
|
<div
|
|
114
93
|
style={{
|
|
@@ -122,111 +101,80 @@ export const PdfViewer = ({
|
|
|
122
101
|
externalLinkRel="noopener noreferrer"
|
|
123
102
|
externalLinkTarget="_blank"
|
|
124
103
|
file={src}
|
|
125
|
-
onLoadSuccess={({ numPages }) =>
|
|
126
|
-
pageActions.setTotalPages(numPages)
|
|
127
|
-
}}
|
|
104
|
+
onLoadSuccess={({ numPages }) => pageActions.setTotalPages(numPages)}
|
|
128
105
|
scale={scale}
|
|
129
106
|
rotate={rotation}
|
|
130
107
|
>
|
|
131
|
-
<Page
|
|
132
|
-
pageNumber={currentPage}
|
|
133
|
-
renderTextLayer={true}
|
|
134
|
-
renderAnnotationLayer={true}
|
|
135
|
-
/>
|
|
108
|
+
<Page pageNumber={currentPage} renderTextLayer renderAnnotationLayer />
|
|
136
109
|
</Document>
|
|
137
110
|
</div>
|
|
138
111
|
</div>
|
|
139
112
|
|
|
140
|
-
<div className="col-start-1 row-start-1
|
|
141
|
-
<
|
|
142
|
-
<
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
className="w-8 h-8 rounded border border-gray-300 bg-white p-2 text-gray-700 hover:bg-gray-200 disabled:opacity-50 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600 focus:outline-none max-w-auto"
|
|
113
|
+
<div className="z-10 col-start-1 row-start-1 flex w-full flex-wrap items-center justify-between gap-3 self-start bg-background-secondary p-2 shadow">
|
|
114
|
+
<div className="flex items-center gap-1">
|
|
115
|
+
<button
|
|
116
|
+
type="button"
|
|
117
|
+
className={toolbarButtonClass}
|
|
146
118
|
onClick={pageActions.prevPage}
|
|
147
119
|
disabled={currentPage === 1}
|
|
120
|
+
aria-label="Previous page"
|
|
148
121
|
>
|
|
149
|
-
<
|
|
150
|
-
</
|
|
122
|
+
<ChevronIcon direction="left" size="small" />
|
|
123
|
+
</button>
|
|
151
124
|
<input
|
|
152
|
-
className="w-14
|
|
125
|
+
className="h-8 w-14 rounded-control border border-divider-primary bg-white px-1 py-1 text-center text-caption-2 text-display-on-light-primary"
|
|
153
126
|
value={currentPage}
|
|
154
127
|
onChange={(e: ChangeEvent<HTMLInputElement>) => {
|
|
155
|
-
const page = parseInt(e.target.value)
|
|
156
|
-
if (!isNaN(page))
|
|
157
|
-
pageActions.goToPage(page)
|
|
158
|
-
}
|
|
128
|
+
const page = parseInt(e.target.value, 10);
|
|
129
|
+
if (!isNaN(page)) pageActions.goToPage(page);
|
|
159
130
|
}}
|
|
160
131
|
type="number"
|
|
161
132
|
min="1"
|
|
162
133
|
max={totalPages}
|
|
163
134
|
/>
|
|
164
|
-
<
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
variant="filled"
|
|
169
|
-
color="white"
|
|
170
|
-
className="w-8 h-8 rounded border !border-gray-300 bg-white p-2 text-gray-700 hover:bg-gray-200 disabled:opacity-50 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600 focus:outline-none max-w-auto"
|
|
135
|
+
<span className="px-2 text-caption-2 text-display-on-light-secondary">of {totalPages}</span>
|
|
136
|
+
<button
|
|
137
|
+
type="button"
|
|
138
|
+
className={toolbarButtonClass}
|
|
171
139
|
onClick={pageActions.nextPage}
|
|
172
140
|
disabled={currentPage === totalPages}
|
|
141
|
+
aria-label="Next page"
|
|
173
142
|
>
|
|
174
|
-
<
|
|
175
|
-
</
|
|
176
|
-
</
|
|
177
|
-
<div className="flex gap-2 items-center">
|
|
178
|
-
<ButtonGroup className="divide-x-1 gap-1">
|
|
179
|
-
<IconButton
|
|
180
|
-
variant="filled"
|
|
181
|
-
color="white"
|
|
182
|
-
className="w-8 h-8 rounded border !border-gray-300 bg-white p-2 text-gray-700 hover:bg-gray-200 disabled:opacity-50 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600 focus:outline-none max-w-auto"
|
|
183
|
-
onClick={zoomActions.zoomOut}
|
|
184
|
-
>
|
|
185
|
-
<Icon icon="lucide:minus" />
|
|
186
|
-
</IconButton>
|
|
187
|
-
<Tooltip content="Click to reset zoom and pan">
|
|
188
|
-
<button
|
|
189
|
-
className="w-14 h-8 rounded border !border-gray-300 bg-white px-1 py-1 text-center text-sm text-gray-700 dark:border-gray-600 dark:bg-gray-700 dark:text-white"
|
|
190
|
-
onClick={() => {
|
|
191
|
-
zoomActions.reset()
|
|
192
|
-
panActions.reset()
|
|
193
|
-
}}
|
|
194
|
-
>
|
|
195
|
-
{zoom}%
|
|
196
|
-
</button>
|
|
197
|
-
</Tooltip>
|
|
198
|
-
<IconButton
|
|
199
|
-
variant="filled"
|
|
200
|
-
color="white"
|
|
201
|
-
className="w-8 h-8 rounded border !border-gray-300 bg-white p-2 text-gray-700 hover:bg-gray-200 disabled:opacity-50 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600 focus:outline-none max-w-auto"
|
|
202
|
-
onClick={zoomActions.zoomIn}
|
|
203
|
-
>
|
|
204
|
-
<Icon icon="lucide:plus" />
|
|
205
|
-
</IconButton>
|
|
206
|
-
</ButtonGroup>
|
|
207
|
-
<div className="h-6 w-px bg-gray-300 dark:bg-gray-600"></div>
|
|
208
|
-
<ButtonGroup className="divide-x-1 gap-1">
|
|
209
|
-
{/* <IconButton
|
|
210
|
-
variant="filled"
|
|
211
|
-
color="white"
|
|
212
|
-
className="w-8 h-8 rounded border !border-gray-300 bg-white p-2 text-gray-700 hover:bg-gray-200 disabled:opacity-50 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600 focus:outline-none max-w-auto"
|
|
213
|
-
onClick={rotationActions.rotateClockwise}
|
|
214
|
-
>
|
|
215
|
-
<Icon icon="lucide:iteration-cw" />
|
|
216
|
-
</IconButton> */}
|
|
143
|
+
<ChevronIcon direction="right" size="small" />
|
|
144
|
+
</button>
|
|
145
|
+
</div>
|
|
217
146
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
147
|
+
<div className="flex items-center gap-2">
|
|
148
|
+
<div className="flex items-center gap-1">
|
|
149
|
+
<button type="button" className={toolbarButtonClass} onClick={zoomActions.zoomOut} aria-label="Zoom out">
|
|
150
|
+
<MinusIcon size="small" />
|
|
151
|
+
</button>
|
|
152
|
+
<button
|
|
153
|
+
type="button"
|
|
154
|
+
className="h-8 w-14 rounded-control border border-divider-primary bg-white text-center text-caption-2 text-display-on-light-primary hover:bg-background-secondary"
|
|
155
|
+
onClick={() => {
|
|
156
|
+
zoomActions.reset();
|
|
157
|
+
panActions.reset();
|
|
158
|
+
}}
|
|
223
159
|
>
|
|
224
|
-
|
|
225
|
-
</
|
|
226
|
-
|
|
160
|
+
{zoom}%
|
|
161
|
+
</button>
|
|
162
|
+
<button type="button" className={toolbarButtonClass} onClick={zoomActions.zoomIn} aria-label="Zoom in">
|
|
163
|
+
<PlusIcon size="small" />
|
|
164
|
+
</button>
|
|
165
|
+
</div>
|
|
166
|
+
<div className="h-6 w-px bg-divider-primary" />
|
|
167
|
+
<button
|
|
168
|
+
type="button"
|
|
169
|
+
className={toolbarButtonClass}
|
|
170
|
+
onClick={rotationActions.rotateCounterClockwise}
|
|
171
|
+
aria-label="Rotate counter-clockwise"
|
|
172
|
+
>
|
|
173
|
+
<ChevronIcon direction="left" size="small" />
|
|
174
|
+
</button>
|
|
227
175
|
</div>
|
|
228
176
|
</div>
|
|
229
177
|
</div>
|
|
230
178
|
</div>
|
|
231
|
-
)
|
|
232
|
-
}
|
|
179
|
+
);
|
|
180
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { type TextareaHTMLAttributes, useId } from "react";
|
|
2
|
+
import { cn } from "../utils/cn";
|
|
3
|
+
|
|
4
|
+
export type ReportInputState = "idle" | "hover" | "edit";
|
|
5
|
+
|
|
6
|
+
export type ReportInputProps = Omit<
|
|
7
|
+
TextareaHTMLAttributes<HTMLTextAreaElement>,
|
|
8
|
+
"onChange"
|
|
9
|
+
> & {
|
|
10
|
+
label?: string;
|
|
11
|
+
value?: string;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
state?: ReportInputState;
|
|
14
|
+
onChange?: (value: string) => void;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const fieldStyles: Record<ReportInputState, string> = {
|
|
18
|
+
idle: "border-divider-primary bg-white",
|
|
19
|
+
hover: "border-grey-300 bg-white",
|
|
20
|
+
edit: "border-accent-on-light bg-white ring-1 ring-accent-on-light",
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const ReportInput = ({
|
|
24
|
+
label,
|
|
25
|
+
value = "",
|
|
26
|
+
placeholder,
|
|
27
|
+
state = "idle",
|
|
28
|
+
onChange,
|
|
29
|
+
disabled,
|
|
30
|
+
className,
|
|
31
|
+
id: idProp,
|
|
32
|
+
rows = 4,
|
|
33
|
+
...props
|
|
34
|
+
}: ReportInputProps) => {
|
|
35
|
+
const generatedId = useId();
|
|
36
|
+
const id = idProp ?? generatedId;
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<div className={cn("flex w-full flex-col gap-1", className)}>
|
|
40
|
+
{label && (
|
|
41
|
+
<label htmlFor={id} className="text-caption-2-em text-display-on-light-secondary">
|
|
42
|
+
{label}
|
|
43
|
+
</label>
|
|
44
|
+
)}
|
|
45
|
+
<textarea
|
|
46
|
+
id={id}
|
|
47
|
+
value={value}
|
|
48
|
+
placeholder={placeholder}
|
|
49
|
+
disabled={disabled}
|
|
50
|
+
rows={rows}
|
|
51
|
+
data-state={state}
|
|
52
|
+
onChange={(event) => onChange?.(event.target.value)}
|
|
53
|
+
className={cn(
|
|
54
|
+
"min-h-[96px] w-full resize-y rounded-control border px-3 py-2 text-body text-display-on-light-primary outline-none transition-colors placeholder:text-display-on-light-quaternary",
|
|
55
|
+
"hover:border-grey-300 focus:border-accent-on-light focus:ring-1 focus:ring-accent-on-light",
|
|
56
|
+
"data-[state=hover]:border-grey-300",
|
|
57
|
+
"data-[state=edit]:border-accent-on-light data-[state=edit]:ring-1 data-[state=edit]:ring-accent-on-light",
|
|
58
|
+
disabled && "cursor-not-allowed border-divider-primary bg-grey-50 text-display-on-light-quaternary",
|
|
59
|
+
!disabled && fieldStyles[state],
|
|
60
|
+
)}
|
|
61
|
+
{...props}
|
|
62
|
+
/>
|
|
63
|
+
</div>
|
|
64
|
+
);
|
|
65
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type ButtonHTMLAttributes } from "react";
|
|
2
|
+
import { cn } from "../utils/cn";
|
|
3
|
+
|
|
4
|
+
export type TabState = "idle" | "active";
|
|
5
|
+
|
|
6
|
+
export type TabProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children"> & {
|
|
7
|
+
label: string;
|
|
8
|
+
state?: TabState;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const Tab = ({ label, state = "idle", className, ...props }: TabProps) => (
|
|
12
|
+
<button
|
|
13
|
+
type="button"
|
|
14
|
+
role="tab"
|
|
15
|
+
aria-selected={state === "active"}
|
|
16
|
+
data-state={state}
|
|
17
|
+
className={cn(
|
|
18
|
+
"relative inline-flex items-center px-3 py-2 text-caption-2 transition-colors",
|
|
19
|
+
"text-display-on-light-secondary hover:text-display-on-light-primary",
|
|
20
|
+
"data-[state=active]:text-display-on-light-primary data-[state=active]:text-caption-2-em",
|
|
21
|
+
className,
|
|
22
|
+
)}
|
|
23
|
+
{...props}
|
|
24
|
+
>
|
|
25
|
+
{label}
|
|
26
|
+
{state === "active" && (
|
|
27
|
+
<span
|
|
28
|
+
aria-hidden
|
|
29
|
+
className="absolute inset-x-0 -bottom-px h-0.5 rounded-full bg-grey-900"
|
|
30
|
+
/>
|
|
31
|
+
)}
|
|
32
|
+
</button>
|
|
33
|
+
);
|
package/src/components/Tabs.tsx
CHANGED
|
@@ -1,43 +1,146 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} from "
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
1
|
+
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
2
|
+
import {
|
|
3
|
+
createContext,
|
|
4
|
+
forwardRef,
|
|
5
|
+
useContext,
|
|
6
|
+
type ComponentPropsWithoutRef,
|
|
7
|
+
type ElementRef,
|
|
8
|
+
type ReactNode,
|
|
9
|
+
} from "react";
|
|
10
|
+
import { cn } from "../utils/cn";
|
|
11
|
+
|
|
12
|
+
export type TabsType = "tabs" | "pills";
|
|
13
|
+
|
|
14
|
+
/** Soft = search filters (filled idle). Solid = workflow shell (ghost idle, blue active). */
|
|
15
|
+
export type TabsAppearance = "soft" | "solid";
|
|
16
|
+
|
|
17
|
+
type TabsContextValue = {
|
|
18
|
+
type: TabsType;
|
|
19
|
+
appearance: TabsAppearance;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const TabsContext = createContext<TabsContextValue>({
|
|
23
|
+
type: "tabs",
|
|
24
|
+
appearance: "soft",
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export type TabsProps = ComponentPropsWithoutRef<typeof TabsPrimitive.Root> & {
|
|
28
|
+
type?: TabsType;
|
|
29
|
+
/** Only applies when `type="pills"`. Defaults to `soft`. */
|
|
30
|
+
appearance?: TabsAppearance;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const Tabs = ({
|
|
34
|
+
type = "tabs",
|
|
35
|
+
appearance = "soft",
|
|
36
|
+
className,
|
|
37
|
+
children,
|
|
38
|
+
...props
|
|
39
|
+
}: TabsProps) => (
|
|
40
|
+
<TabsContext.Provider value={{ type, appearance }}>
|
|
41
|
+
<TabsPrimitive.Root
|
|
42
|
+
className={cn("flex flex-col", className)}
|
|
43
|
+
data-type={type}
|
|
44
|
+
data-appearance={type === "pills" ? appearance : undefined}
|
|
45
|
+
{...props}
|
|
46
|
+
>
|
|
47
|
+
{children}
|
|
48
|
+
</TabsPrimitive.Root>
|
|
49
|
+
</TabsContext.Provider>
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
export type TabsListProps = ComponentPropsWithoutRef<typeof TabsPrimitive.List>;
|
|
53
|
+
|
|
54
|
+
export const TabsList = forwardRef<
|
|
55
|
+
ElementRef<typeof TabsPrimitive.List>,
|
|
56
|
+
TabsListProps
|
|
57
|
+
>(({ className, ...props }, ref) => {
|
|
58
|
+
const { type } = useContext(TabsContext);
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<TabsPrimitive.List
|
|
62
|
+
ref={ref}
|
|
63
|
+
className={cn(
|
|
64
|
+
"flex items-center",
|
|
65
|
+
type === "tabs" && "gap-6 border-b border-divider-primary",
|
|
66
|
+
type === "pills" && "gap-2",
|
|
67
|
+
className,
|
|
68
|
+
)}
|
|
69
|
+
{...props}
|
|
70
|
+
/>
|
|
71
|
+
);
|
|
72
|
+
});
|
|
73
|
+
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
74
|
+
|
|
75
|
+
export type TabsTriggerProps = ComponentPropsWithoutRef<
|
|
76
|
+
typeof TabsPrimitive.Trigger
|
|
77
|
+
> & {
|
|
78
|
+
children: ReactNode;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export const TabsTrigger = forwardRef<
|
|
82
|
+
ElementRef<typeof TabsPrimitive.Trigger>,
|
|
83
|
+
TabsTriggerProps
|
|
84
|
+
>(({ className, children, ...props }, ref) => {
|
|
85
|
+
const { type, appearance } = useContext(TabsContext);
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<TabsPrimitive.Trigger
|
|
89
|
+
ref={ref}
|
|
90
|
+
className={cn(
|
|
91
|
+
"inline-flex items-center justify-center gap-2.5 transition-colors outline-none",
|
|
92
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
93
|
+
type === "tabs" && [
|
|
94
|
+
"relative h-12 gap-2 px-0 py-0 text-caption-2 text-display-on-light-secondary",
|
|
95
|
+
"hover:text-display-on-light-primary",
|
|
96
|
+
"data-[state=active]:text-caption-2-em data-[state=active]:text-display-on-light-primary",
|
|
97
|
+
"data-[state=active]:after:absolute data-[state=active]:after:inset-x-0 data-[state=active]:after:-bottom-px",
|
|
98
|
+
"data-[state=active]:after:h-0.5 data-[state=active]:after:rounded-full data-[state=active]:after:bg-grey-900",
|
|
99
|
+
],
|
|
100
|
+
type === "pills" &&
|
|
101
|
+
appearance === "soft" && [
|
|
102
|
+
"min-h-9 rounded-full px-3 py-1 text-caption-2-em",
|
|
103
|
+
"bg-grey-100 text-display-on-light-secondary",
|
|
104
|
+
"hover:bg-grey-200",
|
|
105
|
+
"data-[state=active]:bg-accent-bg-light data-[state=active]:text-display-on-light-primary",
|
|
106
|
+
],
|
|
107
|
+
type === "pills" &&
|
|
108
|
+
appearance === "solid" && [
|
|
109
|
+
"min-h-9 rounded-full px-3 py-1 text-caption-2-em",
|
|
110
|
+
"bg-transparent text-display-on-light-primary",
|
|
111
|
+
"hover:bg-grey-900/[0.04]",
|
|
112
|
+
"data-[state=active]:bg-blue-600 data-[state=active]:text-white",
|
|
113
|
+
"data-[state=active]:hover:bg-blue-600",
|
|
114
|
+
],
|
|
115
|
+
className,
|
|
116
|
+
)}
|
|
117
|
+
{...props}
|
|
118
|
+
>
|
|
119
|
+
{children}
|
|
120
|
+
</TabsPrimitive.Trigger>
|
|
121
|
+
);
|
|
122
|
+
});
|
|
123
|
+
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
124
|
+
|
|
125
|
+
export type TabsContentProps = ComponentPropsWithoutRef<
|
|
126
|
+
typeof TabsPrimitive.Content
|
|
127
|
+
>;
|
|
128
|
+
|
|
129
|
+
export const TabsContent = forwardRef<
|
|
130
|
+
ElementRef<typeof TabsPrimitive.Content>,
|
|
131
|
+
TabsContentProps
|
|
132
|
+
>(({ className, ...props }, ref) => (
|
|
133
|
+
<TabsPrimitive.Content
|
|
134
|
+
ref={ref}
|
|
135
|
+
className={cn("outline-none", className)}
|
|
136
|
+
{...props}
|
|
137
|
+
/>
|
|
138
|
+
));
|
|
139
|
+
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
140
|
+
|
|
141
|
+
/** @deprecated Prefer Tabs + TabsTrigger. Kept for Storybook atom demos. */
|
|
142
|
+
export type TabsItem = {
|
|
143
|
+
label: string;
|
|
144
|
+
value?: string;
|
|
145
|
+
count?: number;
|
|
146
|
+
};
|
package/src/components/index.ts
CHANGED
|
@@ -1,6 +1,43 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
1
|
+
export { Input, type InputProps, type InputState } from "./Input";
|
|
2
|
+
export { ReportInput, type ReportInputProps, type ReportInputState } from "./ReportInput";
|
|
3
|
+
export { InputType, type InputTypeProps, type InputTypeKind, type InputTypeState } from "./InputType";
|
|
4
|
+
export { Chip, type ChipProps, type ChipVariant } from "./Chip";
|
|
5
|
+
export { Checkbox, type CheckboxProps } from "./Checkbox";
|
|
6
|
+
export { Tab, type TabProps, type TabState } from "./Tab";
|
|
7
|
+
export {
|
|
8
|
+
Tabs,
|
|
9
|
+
TabsList,
|
|
10
|
+
TabsTrigger,
|
|
11
|
+
TabsContent,
|
|
12
|
+
type TabsProps,
|
|
13
|
+
type TabsListProps,
|
|
14
|
+
type TabsTriggerProps,
|
|
15
|
+
type TabsContentProps,
|
|
16
|
+
type TabsItem,
|
|
17
|
+
type TabsType,
|
|
18
|
+
type TabsAppearance,
|
|
19
|
+
} from "./Tabs";
|
|
20
|
+
export { Header, type HeaderProps, type HeaderVariant } from "./Header";
|
|
21
|
+
export { Entry, type EntryProps, type EntryType, type EntryState, type EntryVariant } from "./Entry";
|
|
22
|
+
export { EmptyState, type EmptyStateProps } from "./EmptyState";
|
|
23
|
+
export {
|
|
24
|
+
Modal,
|
|
25
|
+
ModalTrigger,
|
|
26
|
+
ModalClose,
|
|
27
|
+
ModalPortal,
|
|
28
|
+
ModalOverlay,
|
|
29
|
+
ModalContent,
|
|
30
|
+
ModalTitle,
|
|
31
|
+
ModalDescription,
|
|
32
|
+
ModalHeaderSlot,
|
|
33
|
+
ModalBody,
|
|
34
|
+
type ModalProps,
|
|
35
|
+
type ModalOverlayProps,
|
|
36
|
+
type ModalContentProps,
|
|
37
|
+
type ModalTitleProps,
|
|
38
|
+
type ModalDescriptionProps,
|
|
39
|
+
type ModalBodyProps,
|
|
40
|
+
} from "./Modal";
|
|
41
|
+
export { ModalPanel } from "./ModalPanel";
|
|
42
|
+
export * from "./PdfViewer/";
|
|
43
|
+
export * from "./DocumentEditor";
|