@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,67 @@
|
|
|
1
|
+
import { type ButtonHTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
import { cn } from "../utils/cn";
|
|
3
|
+
|
|
4
|
+
type ButtonHierarchy = "primary" | "secondary" | "tertiary" | "quaternary";
|
|
5
|
+
type ButtonOutcome = "action" | "destructive";
|
|
6
|
+
|
|
7
|
+
export type ButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children"> & {
|
|
8
|
+
hierarchy?: ButtonHierarchy;
|
|
9
|
+
outcome?: ButtonOutcome;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
startIcon?: ReactNode;
|
|
12
|
+
endIcon?: ReactNode;
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const baseStyles =
|
|
17
|
+
"inline-flex min-h-10 items-center justify-center gap-2 rounded-control px-2 text-caption-1 transition-colors disabled:cursor-not-allowed";
|
|
18
|
+
|
|
19
|
+
const actionStyles: Record<ButtonHierarchy, string> = {
|
|
20
|
+
primary:
|
|
21
|
+
"bg-action-primary-idle text-action-primary-on-idle hover:bg-action-primary-hover hover:text-action-primary-on-hover disabled:bg-action-primary-disabled disabled:text-action-primary-on-disabled",
|
|
22
|
+
secondary:
|
|
23
|
+
"border border-divider-primary bg-action-secondary-idle text-action-secondary-on-idle hover:bg-action-secondary-hover hover:text-action-secondary-on-hover disabled:bg-action-secondary-disabled disabled:text-action-secondary-on-disabled",
|
|
24
|
+
tertiary:
|
|
25
|
+
"bg-action-tertiary-idle text-action-tertiary-on-idle hover:bg-action-tertiary-hover hover:text-action-tertiary-on-hover disabled:bg-action-tertiary-disabled disabled:text-action-tertiary-on-disabled",
|
|
26
|
+
quaternary:
|
|
27
|
+
"bg-action-quaternary-idle text-action-quaternary-on-idle hover:bg-action-quaternary-hover hover:text-action-quaternary-on-hover disabled:bg-action-quaternary-disabled disabled:text-action-quaternary-on-disabled",
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const destructiveStyles: Record<ButtonHierarchy, string> = {
|
|
31
|
+
primary:
|
|
32
|
+
"bg-action-destructive-idle text-action-destructive-on-idle hover:bg-action-destructive-hover hover:text-action-destructive-on-hover disabled:bg-action-destructive-disabled disabled:text-action-destructive-on-disabled",
|
|
33
|
+
secondary:
|
|
34
|
+
"border border-red-300 bg-grey-50 text-red-500 hover:bg-red-50 hover:text-red-700 disabled:bg-grey-50 disabled:text-red-300",
|
|
35
|
+
tertiary:
|
|
36
|
+
"bg-white text-red-500 hover:bg-red-50 hover:text-red-700 disabled:bg-white disabled:text-red-300",
|
|
37
|
+
quaternary:
|
|
38
|
+
"bg-white text-red-500 hover:bg-grey-100 hover:text-red-700 disabled:bg-white disabled:text-red-300",
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const Button = ({
|
|
42
|
+
hierarchy = "primary",
|
|
43
|
+
outcome = "action",
|
|
44
|
+
disabled = false,
|
|
45
|
+
startIcon,
|
|
46
|
+
endIcon,
|
|
47
|
+
children,
|
|
48
|
+
className,
|
|
49
|
+
type = "button",
|
|
50
|
+
...props
|
|
51
|
+
}: ButtonProps) => {
|
|
52
|
+
const variantStyles =
|
|
53
|
+
outcome === "destructive" ? destructiveStyles[hierarchy] : actionStyles[hierarchy];
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<button
|
|
57
|
+
type={type}
|
|
58
|
+
disabled={disabled}
|
|
59
|
+
className={cn(baseStyles, variantStyles, className)}
|
|
60
|
+
{...props}
|
|
61
|
+
>
|
|
62
|
+
{startIcon && <span className="shrink-0 [&>svg]:size-4">{startIcon}</span>}
|
|
63
|
+
<span>{children}</span>
|
|
64
|
+
{endIcon && <span className="shrink-0 [&>svg]:size-4">{endIcon}</span>}
|
|
65
|
+
</button>
|
|
66
|
+
);
|
|
67
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { cn } from "../utils/cn";
|
|
3
|
+
|
|
4
|
+
export type CalloutProps = {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const Callout = ({ children, icon, className }: CalloutProps) => (
|
|
11
|
+
<div
|
|
12
|
+
className={cn(
|
|
13
|
+
"flex items-start gap-2 rounded-control bg-meta-blue px-3 py-2 text-caption-2 text-meta-on-blue",
|
|
14
|
+
className,
|
|
15
|
+
)}
|
|
16
|
+
role="note"
|
|
17
|
+
>
|
|
18
|
+
{icon && <span className="shrink-0 pt-0.5 [&>svg]:size-4">{icon}</span>}
|
|
19
|
+
<span>{children}</span>
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { cn } from "../utils/cn";
|
|
2
|
+
|
|
3
|
+
export type CountProps = {
|
|
4
|
+
value: number;
|
|
5
|
+
className?: string;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const Count = ({ value, className }: CountProps) => (
|
|
9
|
+
<span
|
|
10
|
+
className={cn(
|
|
11
|
+
"inline-flex min-w-5 items-center justify-center rounded-full bg-blue-600 px-1.5 py-0.5 text-footnote-em text-white",
|
|
12
|
+
className,
|
|
13
|
+
)}
|
|
14
|
+
aria-label={`Count: ${value}`}
|
|
15
|
+
>
|
|
16
|
+
{value > 99 ? "99+" : value}
|
|
17
|
+
</span>
|
|
18
|
+
);
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
2
|
+
import { type ReactNode } from "react";
|
|
3
|
+
import { cn } from "../utils/cn";
|
|
4
|
+
|
|
5
|
+
export type DropdownMenuProps = {
|
|
6
|
+
trigger: ReactNode;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
side?: "top" | "bottom" | "left" | "right";
|
|
9
|
+
align?: "start" | "center" | "end";
|
|
10
|
+
open?: boolean;
|
|
11
|
+
onOpenChange?: (open: boolean) => void;
|
|
12
|
+
triggerClassName?: string;
|
|
13
|
+
contentClassName?: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const DropdownMenu = ({
|
|
17
|
+
trigger,
|
|
18
|
+
children,
|
|
19
|
+
side = "bottom",
|
|
20
|
+
align = "start",
|
|
21
|
+
open,
|
|
22
|
+
onOpenChange,
|
|
23
|
+
triggerClassName,
|
|
24
|
+
contentClassName,
|
|
25
|
+
}: DropdownMenuProps) => (
|
|
26
|
+
<DropdownMenuPrimitive.Root open={open} onOpenChange={onOpenChange} modal={false}>
|
|
27
|
+
<DropdownMenuPrimitive.Trigger asChild>{trigger}</DropdownMenuPrimitive.Trigger>
|
|
28
|
+
<DropdownMenuPrimitive.Portal>
|
|
29
|
+
<DropdownMenuPrimitive.Content
|
|
30
|
+
side={side}
|
|
31
|
+
align={align}
|
|
32
|
+
sideOffset={4}
|
|
33
|
+
collisionPadding={8}
|
|
34
|
+
className={cn(
|
|
35
|
+
"z-[200] min-w-40 rounded-control border border-divider-primary bg-background-primary p-1 shadow-raise2",
|
|
36
|
+
contentClassName,
|
|
37
|
+
)}
|
|
38
|
+
>
|
|
39
|
+
{children}
|
|
40
|
+
</DropdownMenuPrimitive.Content>
|
|
41
|
+
</DropdownMenuPrimitive.Portal>
|
|
42
|
+
</DropdownMenuPrimitive.Root>
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
export const DropdownMenuItem = ({
|
|
46
|
+
className,
|
|
47
|
+
...props
|
|
48
|
+
}: DropdownMenuPrimitive.DropdownMenuItemProps) => (
|
|
49
|
+
<DropdownMenuPrimitive.Item
|
|
50
|
+
className={cn(
|
|
51
|
+
"flex cursor-pointer items-center gap-2 rounded-control px-2 py-1.5 text-caption-1 text-display-on-light-primary outline-none transition-colors hover:bg-grey-100 focus:bg-grey-100 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
52
|
+
className,
|
|
53
|
+
)}
|
|
54
|
+
{...props}
|
|
55
|
+
/>
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
export const DropdownMenuSeparator = () => (
|
|
59
|
+
<DropdownMenuPrimitive.Separator className="my-1 h-px bg-divider-primary" />
|
|
60
|
+
);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Avatar } from "./Avatar";
|
|
2
|
+
import { cn } from "../utils/cn";
|
|
3
|
+
|
|
4
|
+
type GroupCount = 1 | 2 | 3;
|
|
5
|
+
|
|
6
|
+
export type GroupedAvatarsProps = {
|
|
7
|
+
count: GroupCount;
|
|
8
|
+
className?: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const groups: Record<GroupCount, Array<{ chief: "technical" | "compliance" | "initials"; initials?: string }>> = {
|
|
12
|
+
1: [{ chief: "technical" }],
|
|
13
|
+
2: [
|
|
14
|
+
{ chief: "technical" },
|
|
15
|
+
{ chief: "compliance" },
|
|
16
|
+
],
|
|
17
|
+
3: [
|
|
18
|
+
{ chief: "technical" },
|
|
19
|
+
{ chief: "compliance" },
|
|
20
|
+
{ chief: "initials", initials: "AC" },
|
|
21
|
+
],
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const GroupedAvatars = ({ count, className }: GroupedAvatarsProps) => (
|
|
25
|
+
<div className={cn("inline-flex items-center", className)}>
|
|
26
|
+
{groups[count].map((avatar, index) => (
|
|
27
|
+
<Avatar
|
|
28
|
+
key={`${avatar.chief}-${index}`}
|
|
29
|
+
chief={avatar.chief}
|
|
30
|
+
initials={avatar.initials}
|
|
31
|
+
size={24}
|
|
32
|
+
className={cn("ring-2 ring-white", index > 0 && "-ml-2")}
|
|
33
|
+
/>
|
|
34
|
+
))}
|
|
35
|
+
</div>
|
|
36
|
+
);
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { forwardRef, type ButtonHTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
import { cn } from "../utils/cn";
|
|
3
|
+
|
|
4
|
+
type IconButtonHierarchy = "tertiary" | "quaternary";
|
|
5
|
+
type IconButtonSize = "large" | "small";
|
|
6
|
+
|
|
7
|
+
export type IconButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children"> & {
|
|
8
|
+
hierarchy?: IconButtonHierarchy;
|
|
9
|
+
size?: IconButtonSize;
|
|
10
|
+
"aria-label": string;
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const hierarchyStyles: Record<IconButtonHierarchy, string> = {
|
|
15
|
+
tertiary:
|
|
16
|
+
"bg-action-tertiary-idle text-action-tertiary-on-idle hover:bg-action-tertiary-hover hover:text-action-tertiary-on-hover disabled:bg-action-tertiary-disabled disabled:text-action-tertiary-on-disabled",
|
|
17
|
+
quaternary:
|
|
18
|
+
"bg-action-quaternary-idle text-action-quaternary-on-idle hover:bg-action-quaternary-hover hover:text-action-quaternary-on-hover disabled:bg-action-quaternary-disabled disabled:text-action-quaternary-on-disabled",
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const sizeStyles: Record<IconButtonSize, string> = {
|
|
22
|
+
large: "size-10 [&>svg]:size-6",
|
|
23
|
+
small: "size-8 [&>svg]:size-4",
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(
|
|
27
|
+
(
|
|
28
|
+
{
|
|
29
|
+
hierarchy = "tertiary",
|
|
30
|
+
size = "large",
|
|
31
|
+
disabled = false,
|
|
32
|
+
children,
|
|
33
|
+
className,
|
|
34
|
+
type = "button",
|
|
35
|
+
...props
|
|
36
|
+
},
|
|
37
|
+
ref,
|
|
38
|
+
) => (
|
|
39
|
+
<button
|
|
40
|
+
ref={ref}
|
|
41
|
+
type={type}
|
|
42
|
+
disabled={disabled}
|
|
43
|
+
className={cn(
|
|
44
|
+
"inline-flex shrink-0 items-center justify-center rounded-control transition-colors disabled:cursor-not-allowed",
|
|
45
|
+
hierarchyStyles[hierarchy],
|
|
46
|
+
sizeStyles[size],
|
|
47
|
+
className,
|
|
48
|
+
)}
|
|
49
|
+
{...props}
|
|
50
|
+
>
|
|
51
|
+
{children}
|
|
52
|
+
</button>
|
|
53
|
+
),
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
IconButton.displayName = "IconButton";
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { cn } from "../utils/cn";
|
|
2
|
+
|
|
3
|
+
type ChiefType = "technical" | "compliance";
|
|
4
|
+
|
|
5
|
+
export type LogoProps = {
|
|
6
|
+
chief: ChiefType;
|
|
7
|
+
className?: string;
|
|
8
|
+
muted?: boolean;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const ASK_CHIEF_A =
|
|
12
|
+
"M9.89258 5.62793L13.2041 14.625H11.9316L9.20117 11.8926H9.03223L6.29785 14.623C6.29785 14.623 6.29573 14.6211 6.29395 14.6211V14.625H5.0625L8.38867 5.62793H9.89258ZM9.01172 7.12305L7.16016 12.2334L8.87109 10.5234H9.36133L11.0762 12.2402L9.23828 7.12305H9.01172ZM12.6904 3.375V4.64355H5.61328V3.375H12.6904Z";
|
|
13
|
+
|
|
14
|
+
const TechnicalGlyph = () => <path d={ASK_CHIEF_A} fill="currentColor" />;
|
|
15
|
+
|
|
16
|
+
const ComplianceGlyph = () => (
|
|
17
|
+
<>
|
|
18
|
+
<path d={ASK_CHIEF_A} fill="currentColor" />
|
|
19
|
+
<path
|
|
20
|
+
d="M6.2 5.2C7.4 4.1 10.6 4.1 11.8 5.2"
|
|
21
|
+
stroke="currentColor"
|
|
22
|
+
strokeWidth="0.9"
|
|
23
|
+
fill="none"
|
|
24
|
+
strokeLinecap="round"
|
|
25
|
+
/>
|
|
26
|
+
</>
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
export const Logo = ({ chief, className, muted = false }: LogoProps) => (
|
|
30
|
+
<svg
|
|
31
|
+
viewBox="0 0 18 18"
|
|
32
|
+
fill="none"
|
|
33
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
34
|
+
className={cn(
|
|
35
|
+
"shrink-0",
|
|
36
|
+
muted ? "text-display-on-light-quaternary" : "text-display-on-light-primary",
|
|
37
|
+
className,
|
|
38
|
+
)}
|
|
39
|
+
aria-hidden
|
|
40
|
+
>
|
|
41
|
+
{chief === "technical" ? <TechnicalGlyph /> : <ComplianceGlyph />}
|
|
42
|
+
</svg>
|
|
43
|
+
);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type ButtonHTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
import { cn } from "../utils/cn";
|
|
3
|
+
|
|
4
|
+
export type MenuItemProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children"> & {
|
|
5
|
+
header?: boolean;
|
|
6
|
+
destructive?: boolean;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const MenuItem = ({
|
|
11
|
+
header = false,
|
|
12
|
+
destructive = false,
|
|
13
|
+
children,
|
|
14
|
+
className,
|
|
15
|
+
type = "button",
|
|
16
|
+
...props
|
|
17
|
+
}: MenuItemProps) => (
|
|
18
|
+
<button
|
|
19
|
+
type={type}
|
|
20
|
+
className={cn(
|
|
21
|
+
"flex w-full items-center gap-2 rounded-control px-2 py-1.5 text-left text-caption-1 transition-colors",
|
|
22
|
+
header
|
|
23
|
+
? "cursor-default text-caption-1-em text-display-on-light-tertiary hover:bg-transparent"
|
|
24
|
+
: destructive
|
|
25
|
+
? "text-red-500 hover:bg-red-50 hover:text-red-700 disabled:text-red-300"
|
|
26
|
+
: "text-display-on-light-primary hover:bg-grey-100 disabled:text-display-on-light-quaternary",
|
|
27
|
+
"disabled:cursor-not-allowed",
|
|
28
|
+
className,
|
|
29
|
+
)}
|
|
30
|
+
disabled={header || props.disabled}
|
|
31
|
+
{...props}
|
|
32
|
+
>
|
|
33
|
+
{children}
|
|
34
|
+
</button>
|
|
35
|
+
);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type ButtonHTMLAttributes } from "react";
|
|
2
|
+
import { cn } from "../utils/cn";
|
|
3
|
+
|
|
4
|
+
export type SwitchProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onChange"> & {
|
|
5
|
+
checked: boolean;
|
|
6
|
+
onChange: (checked: boolean) => void;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const Switch = ({
|
|
11
|
+
checked,
|
|
12
|
+
onChange,
|
|
13
|
+
disabled = false,
|
|
14
|
+
className,
|
|
15
|
+
...props
|
|
16
|
+
}: SwitchProps) => (
|
|
17
|
+
<button
|
|
18
|
+
type="button"
|
|
19
|
+
role="switch"
|
|
20
|
+
aria-checked={checked}
|
|
21
|
+
disabled={disabled}
|
|
22
|
+
onClick={() => onChange(!checked)}
|
|
23
|
+
className={cn(
|
|
24
|
+
"relative inline-flex h-6 w-10 shrink-0 items-center rounded-full transition-colors disabled:cursor-not-allowed",
|
|
25
|
+
checked ? "bg-blue-600" : "bg-grey-200",
|
|
26
|
+
disabled && "opacity-50",
|
|
27
|
+
className,
|
|
28
|
+
)}
|
|
29
|
+
{...props}
|
|
30
|
+
>
|
|
31
|
+
<span
|
|
32
|
+
className={cn(
|
|
33
|
+
"inline-block size-5 rounded-full bg-white shadow-raise1 transition-transform",
|
|
34
|
+
checked ? "translate-x-[18px]" : "translate-x-0.5",
|
|
35
|
+
)}
|
|
36
|
+
/>
|
|
37
|
+
</button>
|
|
38
|
+
);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { cn } from "../utils/cn";
|
|
2
|
+
|
|
3
|
+
export type ThinkingDotProps = {
|
|
4
|
+
className?: string;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
const frames = [0, 1, 2];
|
|
8
|
+
|
|
9
|
+
export const ThinkingDot = ({ className }: ThinkingDotProps) => (
|
|
10
|
+
<span
|
|
11
|
+
className={cn("inline-flex items-center gap-1", className)}
|
|
12
|
+
role="status"
|
|
13
|
+
aria-label="Thinking"
|
|
14
|
+
>
|
|
15
|
+
{frames.map((frame) => (
|
|
16
|
+
<span
|
|
17
|
+
key={frame}
|
|
18
|
+
className="size-1.5 rounded-full bg-blue-600 motion-reduce:animate-none motion-reduce:opacity-60 animate-[thinking-dot_1.8s_ease-in-out_infinite]"
|
|
19
|
+
style={{ animationDelay: `${frame * 0.3}s` }}
|
|
20
|
+
/>
|
|
21
|
+
))}
|
|
22
|
+
<style>{`
|
|
23
|
+
@keyframes thinking-dot {
|
|
24
|
+
0%, 16.67%, 100% { opacity: 0.3; transform: scale(1); }
|
|
25
|
+
8.33% { opacity: 1; transform: scale(1.25); }
|
|
26
|
+
33.33% { opacity: 0.3; transform: scale(1); }
|
|
27
|
+
41.67% { opacity: 1; transform: scale(1.25); }
|
|
28
|
+
58.33% { opacity: 0.3; transform: scale(1); }
|
|
29
|
+
66.67% { opacity: 1; transform: scale(1.25); }
|
|
30
|
+
83.33% { opacity: 0.3; transform: scale(1); }
|
|
31
|
+
}
|
|
32
|
+
`}</style>
|
|
33
|
+
</span>
|
|
34
|
+
);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
2
|
+
import { type ReactNode } from "react";
|
|
3
|
+
import { cn } from "../utils/cn";
|
|
4
|
+
|
|
5
|
+
export type TooltipSide = "top" | "right" | "bottom" | "left";
|
|
6
|
+
|
|
7
|
+
export type TooltipProps = {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
content: ReactNode;
|
|
10
|
+
hint?: boolean;
|
|
11
|
+
side?: TooltipSide;
|
|
12
|
+
className?: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const TooltipProvider = TooltipPrimitive.Provider;
|
|
16
|
+
|
|
17
|
+
export const Tooltip = ({
|
|
18
|
+
children,
|
|
19
|
+
content,
|
|
20
|
+
hint = false,
|
|
21
|
+
side = "top",
|
|
22
|
+
className,
|
|
23
|
+
}: TooltipProps) => (
|
|
24
|
+
<TooltipPrimitive.Root>
|
|
25
|
+
<TooltipPrimitive.Trigger asChild>
|
|
26
|
+
<span className={cn("inline-flex", className)}>{children}</span>
|
|
27
|
+
</TooltipPrimitive.Trigger>
|
|
28
|
+
<TooltipPrimitive.Portal>
|
|
29
|
+
<TooltipPrimitive.Content
|
|
30
|
+
side={side}
|
|
31
|
+
sideOffset={6}
|
|
32
|
+
collisionPadding={8}
|
|
33
|
+
className={cn(
|
|
34
|
+
"z-[300] max-w-xs rounded-control bg-grey-900 px-2 py-1 text-footnote text-white shadow-raise2",
|
|
35
|
+
hint ? "whitespace-normal text-center leading-snug" : "whitespace-nowrap",
|
|
36
|
+
)}
|
|
37
|
+
>
|
|
38
|
+
{content}
|
|
39
|
+
</TooltipPrimitive.Content>
|
|
40
|
+
</TooltipPrimitive.Portal>
|
|
41
|
+
</TooltipPrimitive.Root>
|
|
42
|
+
);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { Button, type ButtonProps } from "./Button";
|
|
2
|
+
export { IconButton, type IconButtonProps } from "./IconButton";
|
|
3
|
+
export { Logo, type LogoProps } from "./Logo";
|
|
4
|
+
export { Avatar, type AvatarProps } from "./Avatar";
|
|
5
|
+
export { GroupedAvatars, type GroupedAvatarsProps } from "./GroupedAvatars";
|
|
6
|
+
export { DropdownMenu, DropdownMenuItem, DropdownMenuSeparator, type DropdownMenuProps } from "./DropdownMenu";
|
|
7
|
+
export { MenuItem, type MenuItemProps } from "./MenuItem";
|
|
8
|
+
export { Tooltip, TooltipProvider, type TooltipProps, type TooltipSide } from "./Tooltip";
|
|
9
|
+
export { ThinkingDot, type ThinkingDotProps } from "./ThinkingDot";
|
|
10
|
+
export { Count, type CountProps } from "./Count";
|
|
11
|
+
export { Switch, type SwitchProps } from "./Switch";
|
|
12
|
+
export { Badge, type BadgeProps } from "./Badge";
|
|
13
|
+
export { Callout, type CalloutProps } from "./Callout";
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { cn } from "../../utils/cn";
|
|
3
|
+
|
|
4
|
+
type FigmaPageProps = {
|
|
5
|
+
title: string;
|
|
6
|
+
width: number;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const FigmaPage = ({ title, width, children, className }: FigmaPageProps) => (
|
|
12
|
+
<div
|
|
13
|
+
className={cn("bg-white font-sans text-display-on-light-primary", className)}
|
|
14
|
+
style={{ width }}
|
|
15
|
+
data-figma-page={title}
|
|
16
|
+
>
|
|
17
|
+
<div className="px-8 pt-8 pb-4">
|
|
18
|
+
<h1 className="font-heading text-heading text-display-on-light-primary">{title}</h1>
|
|
19
|
+
<p className="mt-2 text-caption-2 text-display-on-light-tertiary">AskChief Design System</p>
|
|
20
|
+
</div>
|
|
21
|
+
{children}
|
|
22
|
+
</div>
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
type FigmaContentProps = {
|
|
26
|
+
children: ReactNode;
|
|
27
|
+
padding?: number;
|
|
28
|
+
className?: string;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const FigmaContent = ({ children, padding = 24, className }: FigmaContentProps) => (
|
|
32
|
+
<div className={cn("px-8 pb-8", className)} style={{ paddingLeft: 32, paddingRight: 32 }}>
|
|
33
|
+
<div style={{ padding }}>{children}</div>
|
|
34
|
+
</div>
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
type FigmaSectionProps = {
|
|
38
|
+
label?: string;
|
|
39
|
+
children: ReactNode;
|
|
40
|
+
className?: string;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const FigmaSection = ({ label, children, className }: FigmaSectionProps) => (
|
|
44
|
+
<div className={cn("mb-6", className)}>
|
|
45
|
+
{label && (
|
|
46
|
+
<p className="mb-3 text-caption-2-em text-display-on-light-tertiary">{label}</p>
|
|
47
|
+
)}
|
|
48
|
+
{children}
|
|
49
|
+
</div>
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
type FigmaGridProps = {
|
|
53
|
+
children: ReactNode;
|
|
54
|
+
gap?: number;
|
|
55
|
+
className?: string;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export const FigmaGrid = ({ children, gap = 16, className }: FigmaGridProps) => (
|
|
59
|
+
<div className={cn("flex flex-wrap items-center", className)} style={{ gap }}>
|
|
60
|
+
{children}
|
|
61
|
+
</div>
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
type FigmaRowProps = {
|
|
65
|
+
label?: string;
|
|
66
|
+
children: ReactNode;
|
|
67
|
+
gap?: number;
|
|
68
|
+
className?: string;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export const FigmaRow = ({ label, children, gap = 16, className }: FigmaRowProps) => (
|
|
72
|
+
<div className={cn("mb-4", className)}>
|
|
73
|
+
{label && (
|
|
74
|
+
<p className="mb-2 w-24 text-caption-2 text-display-on-light-quaternary">{label}</p>
|
|
75
|
+
)}
|
|
76
|
+
<FigmaGrid gap={gap}>{children}</FigmaGrid>
|
|
77
|
+
</div>
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
type FigmaVariantProps = {
|
|
81
|
+
label?: string;
|
|
82
|
+
children: ReactNode;
|
|
83
|
+
className?: string;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/** Wraps a single variant for static snapshot display */
|
|
87
|
+
export const FigmaVariant = ({ label, children, className }: FigmaVariantProps) => (
|
|
88
|
+
<div className={cn("flex flex-col items-center gap-1", className)}>
|
|
89
|
+
<div>{children}</div>
|
|
90
|
+
{label && (
|
|
91
|
+
<span className="text-footnote text-display-on-light-quaternary">{label}</span>
|
|
92
|
+
)}
|
|
93
|
+
</div>
|
|
94
|
+
);
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FigmaContent,
|
|
3
|
+
FigmaGrid,
|
|
4
|
+
FigmaPage,
|
|
5
|
+
FigmaSection,
|
|
6
|
+
} from "../_layout";
|
|
7
|
+
import { ButtonSnapshot } from "./helpers";
|
|
8
|
+
import { FIGMA_WIDTHS } from "./figma-widths";
|
|
9
|
+
|
|
10
|
+
const hierarchies = ["primary", "secondary", "tertiary", "quaternary"] as const;
|
|
11
|
+
|
|
12
|
+
export const ButtonsCanvas = () => (
|
|
13
|
+
<FigmaPage title="Buttons" width={FIGMA_WIDTHS.buttons}>
|
|
14
|
+
<FigmaContent>
|
|
15
|
+
<FigmaSection label="Button">
|
|
16
|
+
<FigmaGrid gap={24}>
|
|
17
|
+
{hierarchies.map((hierarchy) => (
|
|
18
|
+
<div key={hierarchy} className="flex flex-col gap-4">
|
|
19
|
+
{(["idle", "hover", "disabled"] as const).map((state) => (
|
|
20
|
+
<ButtonSnapshot key={state} hierarchy={hierarchy} visualState={state} />
|
|
21
|
+
))}
|
|
22
|
+
</div>
|
|
23
|
+
))}
|
|
24
|
+
<div className="flex flex-col gap-4">
|
|
25
|
+
{(["idle", "hover", "disabled"] as const).map((state) => (
|
|
26
|
+
<ButtonSnapshot
|
|
27
|
+
key={state}
|
|
28
|
+
hierarchy="primary"
|
|
29
|
+
outcome="destructive"
|
|
30
|
+
visualState={state}
|
|
31
|
+
/>
|
|
32
|
+
))}
|
|
33
|
+
</div>
|
|
34
|
+
</FigmaGrid>
|
|
35
|
+
</FigmaSection>
|
|
36
|
+
|
|
37
|
+
<FigmaSection label="Icon Button">
|
|
38
|
+
<FigmaGrid gap={24}>
|
|
39
|
+
<ButtonSnapshot hierarchy="tertiary" visualState="idle" />
|
|
40
|
+
<ButtonSnapshot hierarchy="tertiary" visualState="hover" />
|
|
41
|
+
<ButtonSnapshot hierarchy="quaternary" visualState="idle" />
|
|
42
|
+
<ButtonSnapshot hierarchy="quaternary" visualState="hover" />
|
|
43
|
+
<span className="inline-flex size-8 items-center justify-center rounded-control bg-action-quaternary-idle text-action-quaternary-on-idle">
|
|
44
|
+
<svg viewBox="0 0 16 16" className="size-4" fill="none" stroke="currentColor" strokeWidth="1.5" aria-hidden>
|
|
45
|
+
<path d="M8 3.33v9.34M3.33 8h9.34" strokeLinecap="round" />
|
|
46
|
+
</svg>
|
|
47
|
+
</span>
|
|
48
|
+
<span className="inline-flex size-8 items-center justify-center rounded-control bg-action-quaternary-hover text-action-quaternary-on-hover">
|
|
49
|
+
<svg viewBox="0 0 16 16" className="size-4" fill="none" stroke="currentColor" strokeWidth="1.5" aria-hidden>
|
|
50
|
+
<path d="M8 3.33v9.34M3.33 8h9.34" strokeLinecap="round" />
|
|
51
|
+
</svg>
|
|
52
|
+
</span>
|
|
53
|
+
</FigmaGrid>
|
|
54
|
+
</FigmaSection>
|
|
55
|
+
</FigmaContent>
|
|
56
|
+
</FigmaPage>
|
|
57
|
+
);
|