@lar-works/design-system 0.0.0-stage → 0.1.1
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 +24 -2
- package/dist/actions/Button.d.ts +25 -0
- package/dist/actions/Button.js +55 -0
- package/dist/actions/Button.js.map +1 -0
- package/dist/actions/ButtonLink.d.ts +21 -0
- package/dist/actions/ButtonLink.js +40 -0
- package/dist/actions/ButtonLink.js.map +1 -0
- package/dist/actions/IconButton.d.ts +14 -0
- package/dist/actions/IconButton.js +29 -0
- package/dist/actions/IconButton.js.map +1 -0
- package/dist/actions/ThemeSwitch.d.ts +7 -0
- package/dist/actions/ThemeSwitch.js +42 -0
- package/dist/actions/ThemeSwitch.js.map +1 -0
- package/dist/actions/index.d.ts +5 -0
- package/dist/collections/CollectionSectionHeader.d.ts +5 -0
- package/dist/collections/CollectionSectionHeader.js +18 -0
- package/dist/collections/CollectionSectionHeader.js.map +1 -0
- package/dist/collections/CollectionState.d.ts +37 -0
- package/dist/collections/CollectionState.js +69 -0
- package/dist/collections/CollectionState.js.map +1 -0
- package/dist/collections/CollectionTokens.d.ts +16 -0
- package/dist/collections/CollectionTokens.js +19 -0
- package/dist/collections/CollectionTokens.js.map +1 -0
- package/dist/collections/CollectionViewport.js +36 -0
- package/dist/collections/CollectionViewport.js.map +1 -0
- package/dist/collections/DataRow.d.ts +23 -0
- package/dist/collections/DataRow.js +57 -0
- package/dist/collections/DataRow.js.map +1 -0
- package/dist/collections/ResultList.d.ts +29 -0
- package/dist/collections/ResultList.js +128 -0
- package/dist/collections/ResultList.js.map +1 -0
- package/dist/collections/ScrollRow.d.ts +23 -0
- package/dist/collections/ScrollRow.js +59 -0
- package/dist/collections/ScrollRow.js.map +1 -0
- package/dist/collections/VirtualGrid.d.ts +14 -0
- package/dist/collections/VirtualGrid.js +71 -0
- package/dist/collections/VirtualGrid.js.map +1 -0
- package/dist/collections/VirtualList.d.ts +34 -0
- package/dist/collections/VirtualList.js +128 -0
- package/dist/collections/VirtualList.js.map +1 -0
- package/dist/collections/index.d.ts +10 -0
- package/dist/collections/useCollectionMotion.d.ts +3 -0
- package/dist/collections/useCollectionMotion.js +34 -0
- package/dist/collections/useCollectionMotion.js.map +1 -0
- package/dist/collections/useScrollRow.d.ts +17 -0
- package/dist/collections/useScrollRow.js +63 -0
- package/dist/collections/useScrollRow.js.map +1 -0
- package/dist/display/ActivityCard.d.ts +17 -0
- package/dist/display/ActivityCard.js +58 -0
- package/dist/display/ActivityCard.js.map +1 -0
- package/dist/display/Artwork.d.ts +25 -0
- package/dist/display/Artwork.js +97 -0
- package/dist/display/Artwork.js.map +1 -0
- package/dist/display/Avatar.d.ts +5 -0
- package/dist/display/Avatar.js +13 -0
- package/dist/display/Avatar.js.map +1 -0
- package/dist/display/Badge.d.ts +10 -0
- package/dist/display/Badge.js +28 -0
- package/dist/display/Badge.js.map +1 -0
- package/dist/display/BadgeList.d.ts +11 -0
- package/dist/display/BadgeList.js +20 -0
- package/dist/display/BadgeList.js.map +1 -0
- package/dist/display/BrandMark.d.ts +21 -0
- package/dist/display/BrandMark.js +60 -0
- package/dist/display/BrandMark.js.map +1 -0
- package/dist/display/ChangeList.d.ts +16 -0
- package/dist/display/ChangeList.js +56 -0
- package/dist/display/ChangeList.js.map +1 -0
- package/dist/display/CheckList.d.ts +10 -0
- package/dist/display/CheckList.js +25 -0
- package/dist/display/CheckList.js.map +1 -0
- package/dist/display/CodeBlock.d.ts +6 -0
- package/dist/display/CodeBlock.js +12 -0
- package/dist/display/CodeBlock.js.map +1 -0
- package/dist/display/CopyButton.d.ts +9 -0
- package/dist/display/CopyButton.js +59 -0
- package/dist/display/CopyButton.js.map +1 -0
- package/dist/display/DataTable.d.ts +35 -0
- package/dist/display/DataTable.js +53 -0
- package/dist/display/DataTable.js.map +1 -0
- package/dist/display/DetailHero.d.ts +39 -0
- package/dist/display/DetailHero.js +146 -0
- package/dist/display/DetailHero.js.map +1 -0
- package/dist/display/DetailList.d.ts +15 -0
- package/dist/display/DetailList.js +53 -0
- package/dist/display/DetailList.js.map +1 -0
- package/dist/display/DeviceCard.d.ts +18 -0
- package/dist/display/DeviceCard.js +48 -0
- package/dist/display/DeviceCard.js.map +1 -0
- package/dist/display/Identity.d.ts +14 -0
- package/dist/display/Identity.js +54 -0
- package/dist/display/Identity.js.map +1 -0
- package/dist/display/ImageCard.d.ts +22 -0
- package/dist/display/ImageCard.js +63 -0
- package/dist/display/ImageCard.js.map +1 -0
- package/dist/display/ImagePicker.d.ts +30 -0
- package/dist/display/ImagePicker.js +108 -0
- package/dist/display/ImagePicker.js.map +1 -0
- package/dist/display/InfoBox.d.ts +15 -0
- package/dist/display/InfoBox.js +41 -0
- package/dist/display/InfoBox.js.map +1 -0
- package/dist/display/InsetPanel.d.ts +13 -0
- package/dist/display/InsetPanel.js +26 -0
- package/dist/display/InsetPanel.js.map +1 -0
- package/dist/display/ItemAction.d.ts +10 -0
- package/dist/display/ItemAction.js +35 -0
- package/dist/display/ItemAction.js.map +1 -0
- package/dist/display/Kbd.d.ts +6 -0
- package/dist/display/Kbd.js +12 -0
- package/dist/display/Kbd.js.map +1 -0
- package/dist/display/KindIcon.d.ts +8 -0
- package/dist/display/KindIcon.js +15 -0
- package/dist/display/KindIcon.js.map +1 -0
- package/dist/display/NoticeCard.d.ts +24 -0
- package/dist/display/NoticeCard.js +59 -0
- package/dist/display/NoticeCard.js.map +1 -0
- package/dist/display/PairingList.d.ts +19 -0
- package/dist/display/PairingList.js +53 -0
- package/dist/display/PairingList.js.map +1 -0
- package/dist/display/PathList.d.ts +9 -0
- package/dist/display/PathList.js +21 -0
- package/dist/display/PathList.js.map +1 -0
- package/dist/display/PeoplePreview.d.ts +16 -0
- package/dist/display/PeoplePreview.js +41 -0
- package/dist/display/PeoplePreview.js.map +1 -0
- package/dist/display/PropertySheet.d.ts +56 -0
- package/dist/display/PropertySheet.js +150 -0
- package/dist/display/PropertySheet.js.map +1 -0
- package/dist/display/QrCode.d.ts +6 -0
- package/dist/display/QrCode.js +47 -0
- package/dist/display/QrCode.js.map +1 -0
- package/dist/display/RadioChoice.d.ts +9 -0
- package/dist/display/RadioChoice.js +28 -0
- package/dist/display/RadioChoice.js.map +1 -0
- package/dist/display/RatingLink.d.ts +10 -0
- package/dist/display/RatingLink.js +80 -0
- package/dist/display/RatingLink.js.map +1 -0
- package/dist/display/ResourceCard.d.ts +20 -0
- package/dist/display/ResourceCard.js +200 -0
- package/dist/display/ResourceCard.js.map +1 -0
- package/dist/display/RowList.d.ts +28 -0
- package/dist/display/RowList.js +76 -0
- package/dist/display/RowList.js.map +1 -0
- package/dist/display/StackedMeter.d.ts +28 -0
- package/dist/display/StackedMeter.js +48 -0
- package/dist/display/StackedMeter.js.map +1 -0
- package/dist/display/StatTile.d.ts +13 -0
- package/dist/display/StatTile.js +35 -0
- package/dist/display/StatTile.js.map +1 -0
- package/dist/display/StepList.d.ts +5 -0
- package/dist/display/StepList.js +12 -0
- package/dist/display/StepList.js.map +1 -0
- package/dist/display/TextPreview.d.ts +14 -0
- package/dist/display/TextPreview.js +46 -0
- package/dist/display/TextPreview.js.map +1 -0
- package/dist/display/TimeSeriesChart.d.ts +19 -0
- package/dist/display/TimeSeriesChart.js +163 -0
- package/dist/display/TimeSeriesChart.js.map +1 -0
- package/dist/display/ToneTile.js +12 -0
- package/dist/display/ToneTile.js.map +1 -0
- package/dist/display/index.d.ts +38 -0
- package/dist/feedback/Alert.d.ts +15 -0
- package/dist/feedback/Alert.js +19 -0
- package/dist/feedback/Alert.js.map +1 -0
- package/dist/feedback/AsyncState.d.ts +16 -0
- package/dist/feedback/AsyncState.js +29 -0
- package/dist/feedback/AsyncState.js.map +1 -0
- package/dist/feedback/ErrorNotification.d.ts +8 -0
- package/dist/feedback/ErrorNotification.js +20 -0
- package/dist/feedback/ErrorNotification.js.map +1 -0
- package/dist/feedback/Notifications.d.ts +2 -0
- package/dist/feedback/Notifications.js +9 -0
- package/dist/feedback/Notifications.js.map +1 -0
- package/dist/feedback/ProgressStatusRow.d.ts +23 -0
- package/dist/feedback/ProgressStatusRow.js +74 -0
- package/dist/feedback/ProgressStatusRow.js.map +1 -0
- package/dist/feedback/SkeletonLoader.d.ts +19 -0
- package/dist/feedback/SkeletonLoader.js +59 -0
- package/dist/feedback/SkeletonLoader.js.map +1 -0
- package/dist/feedback/StatusIndicator.d.ts +9 -0
- package/dist/feedback/StatusIndicator.js +28 -0
- package/dist/feedback/StatusIndicator.js.map +1 -0
- package/dist/feedback/StatusPopoverContent.d.ts +13 -0
- package/dist/feedback/StatusPopoverContent.js +50 -0
- package/dist/feedback/StatusPopoverContent.js.map +1 -0
- package/dist/feedback/StatusRow.d.ts +16 -0
- package/dist/feedback/StatusRow.js +60 -0
- package/dist/feedback/StatusRow.js.map +1 -0
- package/dist/feedback/index.d.ts +11 -0
- package/dist/feedback/index.js +11 -0
- package/dist/forms/Checkbox.d.ts +10 -0
- package/dist/forms/Checkbox.js +48 -0
- package/dist/forms/Checkbox.js.map +1 -0
- package/dist/forms/Field.d.ts +5 -0
- package/dist/forms/Field.js +15 -0
- package/dist/forms/Field.js.map +1 -0
- package/dist/forms/FormControlStyles.js +14 -0
- package/dist/forms/FormControlStyles.js.map +1 -0
- package/dist/forms/FormSection.d.ts +48 -0
- package/dist/forms/FormSection.js +142 -0
- package/dist/forms/FormSection.js.map +1 -0
- package/dist/forms/InlineFields.d.ts +13 -0
- package/dist/forms/InlineFields.js +24 -0
- package/dist/forms/InlineFields.js.map +1 -0
- package/dist/forms/Input.d.ts +5 -0
- package/dist/forms/Input.js +18 -0
- package/dist/forms/Input.js.map +1 -0
- package/dist/forms/OptionSelect.d.ts +21 -0
- package/dist/forms/OptionSelect.js +28 -0
- package/dist/forms/OptionSelect.js.map +1 -0
- package/dist/forms/RadioGroup.d.ts +5 -0
- package/dist/forms/RadioGroup.js +35 -0
- package/dist/forms/RadioGroup.js.map +1 -0
- package/dist/forms/Select.d.ts +6 -0
- package/dist/forms/Select.js +36 -0
- package/dist/forms/Select.js.map +1 -0
- package/dist/forms/Switch.d.ts +4 -0
- package/dist/forms/Switch.js +16 -0
- package/dist/forms/Switch.js.map +1 -0
- package/dist/forms/TagInput.d.ts +19 -0
- package/dist/forms/TagInput.js +60 -0
- package/dist/forms/TagInput.js.map +1 -0
- package/dist/forms/Textarea.d.ts +4 -0
- package/dist/forms/Textarea.js +15 -0
- package/dist/forms/Textarea.js.map +1 -0
- package/dist/forms/index.d.ts +12 -0
- package/dist/foundations/DesignSystemProvider.d.ts +64 -0
- package/dist/foundations/DesignSystemProvider.js +66 -0
- package/dist/foundations/DesignSystemProvider.js.map +1 -0
- package/dist/foundations/KeyboardFocus.d.ts +9 -0
- package/dist/foundations/KeyboardFocus.js +10 -0
- package/dist/foundations/KeyboardFocus.js.map +1 -0
- package/dist/foundations/KeyboardShortcut.d.ts +5 -0
- package/dist/foundations/KeyboardShortcut.js +10 -0
- package/dist/foundations/KeyboardShortcut.js.map +1 -0
- package/dist/foundations/Theme.d.ts +14 -0
- package/dist/foundations/Theme.js +54 -0
- package/dist/foundations/Theme.js.map +1 -0
- package/dist/foundations/index.d.ts +5 -0
- package/dist/icons/BrandIcons.d.ts +3 -0
- package/dist/icons/BrandIcons.js +14 -0
- package/dist/icons/BrandIcons.js.map +1 -0
- package/dist/icons/index.d.ts +3 -0
- package/dist/icons/index.js +2 -0
- package/dist/icons.d.ts +4 -0
- package/dist/icons.js +2 -0
- package/dist/index.d.ts +133 -0
- package/dist/index.js +125 -0
- package/dist/layout/AppShell.d.ts +11 -0
- package/dist/layout/AppShell.js +46 -0
- package/dist/layout/AppShell.js.map +1 -0
- package/dist/layout/AuthLayout.d.ts +11 -0
- package/dist/layout/AuthLayout.js +48 -0
- package/dist/layout/AuthLayout.js.map +1 -0
- package/dist/layout/ContentContainer.d.ts +9 -0
- package/dist/layout/ContentContainer.js +15 -0
- package/dist/layout/ContentContainer.js.map +1 -0
- package/dist/layout/Flow.d.ts +26 -0
- package/dist/layout/Flow.js +65 -0
- package/dist/layout/Flow.js.map +1 -0
- package/dist/layout/PageLayout.d.ts +12 -0
- package/dist/layout/PageLayout.js +31 -0
- package/dist/layout/PageLayout.js.map +1 -0
- package/dist/layout/PageSection.d.ts +43 -0
- package/dist/layout/PageSection.js +63 -0
- package/dist/layout/PageSection.js.map +1 -0
- package/dist/layout/ScrollArea.d.ts +4 -0
- package/dist/layout/ScrollArea.js +11 -0
- package/dist/layout/ScrollArea.js.map +1 -0
- package/dist/layout/Section.d.ts +12 -0
- package/dist/layout/Section.js +36 -0
- package/dist/layout/Section.js.map +1 -0
- package/dist/layout/Site.d.ts +41 -0
- package/dist/layout/Site.js +157 -0
- package/dist/layout/Site.js.map +1 -0
- package/dist/layout/TitleBar.d.ts +28 -0
- package/dist/layout/TitleBar.js +83 -0
- package/dist/layout/TitleBar.js.map +1 -0
- package/dist/layout/WorkspaceActionsHeader.d.ts +8 -0
- package/dist/layout/WorkspaceActionsHeader.js +18 -0
- package/dist/layout/WorkspaceActionsHeader.js.map +1 -0
- package/dist/layout/index.d.ts +19 -0
- package/dist/layout/index.js +19 -0
- package/dist/layout/sidebar/SidebarNavigationItem.d.ts +10 -0
- package/dist/layout/sidebar/SidebarNavigationItem.js +36 -0
- package/dist/layout/sidebar/SidebarNavigationItem.js.map +1 -0
- package/dist/layout/sidebar/SidebarPane.d.ts +13 -0
- package/dist/layout/sidebar/SidebarPane.js +30 -0
- package/dist/layout/sidebar/SidebarPane.js.map +1 -0
- package/dist/layout/toolbar/CommandPaletteTrigger.d.ts +11 -0
- package/dist/layout/toolbar/CommandPaletteTrigger.js +46 -0
- package/dist/layout/toolbar/CommandPaletteTrigger.js.map +1 -0
- package/dist/layout/toolbar/ToolbarStatusGroup.d.ts +5 -0
- package/dist/layout/toolbar/ToolbarStatusGroup.js +14 -0
- package/dist/layout/toolbar/ToolbarStatusGroup.js.map +1 -0
- package/dist/layout/toolbar/ToolbarStatusItem.d.ts +9 -0
- package/dist/layout/toolbar/ToolbarStatusItem.js +18 -0
- package/dist/layout/toolbar/ToolbarStatusItem.js.map +1 -0
- package/dist/navigation/ArtworkTabs.d.ts +18 -0
- package/dist/navigation/ArtworkTabs.js +72 -0
- package/dist/navigation/ArtworkTabs.js.map +1 -0
- package/dist/navigation/Breadcrumbs.d.ts +13 -0
- package/dist/navigation/Breadcrumbs.js +32 -0
- package/dist/navigation/Breadcrumbs.js.map +1 -0
- package/dist/navigation/CollectionBrowseSelector.d.ts +22 -0
- package/dist/navigation/CollectionBrowseSelector.js +70 -0
- package/dist/navigation/CollectionBrowseSelector.js.map +1 -0
- package/dist/navigation/CollectionViewToggle.d.ts +12 -0
- package/dist/navigation/CollectionViewToggle.js +36 -0
- package/dist/navigation/CollectionViewToggle.js.map +1 -0
- package/dist/navigation/DrilldownBrowseSelector.d.ts +31 -0
- package/dist/navigation/DrilldownBrowseSelector.js +174 -0
- package/dist/navigation/DrilldownBrowseSelector.js.map +1 -0
- package/dist/navigation/FolderSelector.d.ts +24 -0
- package/dist/navigation/FolderSelector.js +142 -0
- package/dist/navigation/FolderSelector.js.map +1 -0
- package/dist/navigation/TabKeys.js +13 -0
- package/dist/navigation/TabKeys.js.map +1 -0
- package/dist/navigation/ViewTabs.d.ts +19 -0
- package/dist/navigation/ViewTabs.js +48 -0
- package/dist/navigation/ViewTabs.js.map +1 -0
- package/dist/navigation/index.d.ts +8 -0
- package/dist/overlays/ActionModal.d.ts +21 -0
- package/dist/overlays/ActionModal.js +48 -0
- package/dist/overlays/ActionModal.js.map +1 -0
- package/dist/overlays/CommandPalette.d.ts +43 -0
- package/dist/overlays/CommandPalette.js +163 -0
- package/dist/overlays/CommandPalette.js.map +1 -0
- package/dist/overlays/Drawer.d.ts +19 -0
- package/dist/overlays/Drawer.js +83 -0
- package/dist/overlays/Drawer.js.map +1 -0
- package/dist/overlays/DropdownMenu.d.ts +47 -0
- package/dist/overlays/DropdownMenu.js +58 -0
- package/dist/overlays/DropdownMenu.js.map +1 -0
- package/dist/overlays/ImageViewer.d.ts +21 -0
- package/dist/overlays/ImageViewer.js +82 -0
- package/dist/overlays/ImageViewer.js.map +1 -0
- package/dist/overlays/Modal.d.ts +36 -0
- package/dist/overlays/Modal.js +149 -0
- package/dist/overlays/Modal.js.map +1 -0
- package/dist/overlays/Popover.d.ts +19 -0
- package/dist/overlays/Popover.js +26 -0
- package/dist/overlays/Popover.js.map +1 -0
- package/dist/overlays/Tooltip.d.ts +12 -0
- package/dist/overlays/Tooltip.js +54 -0
- package/dist/overlays/Tooltip.js.map +1 -0
- package/dist/overlays/index.d.ts +9 -0
- package/dist/overlays/useModalAutoFocus.js +84 -0
- package/dist/overlays/useModalAutoFocus.js.map +1 -0
- package/dist/overlays/useScrollFade.js +43 -0
- package/dist/overlays/useScrollFade.js.map +1 -0
- package/dist/showcase/CallToAction.d.ts +11 -0
- package/dist/showcase/CallToAction.js +54 -0
- package/dist/showcase/CallToAction.js.map +1 -0
- package/dist/showcase/Cards.d.ts +34 -0
- package/dist/showcase/Cards.js +122 -0
- package/dist/showcase/Cards.js.map +1 -0
- package/dist/showcase/Devices.d.ts +72 -0
- package/dist/showcase/Devices.js +249 -0
- package/dist/showcase/Devices.js.map +1 -0
- package/dist/showcase/FeatureRow.d.ts +30 -0
- package/dist/showcase/FeatureRow.js +91 -0
- package/dist/showcase/FeatureRow.js.map +1 -0
- package/dist/showcase/Hero.d.ts +15 -0
- package/dist/showcase/Hero.js +73 -0
- package/dist/showcase/Hero.js.map +1 -0
- package/dist/showcase/PhotoSearchConcept.d.ts +14 -0
- package/dist/showcase/PhotoSearchConcept.js +43 -0
- package/dist/showcase/PhotoSearchConcept.js.map +1 -0
- package/dist/showcase/Platforms.d.ts +15 -0
- package/dist/showcase/Platforms.js +48 -0
- package/dist/showcase/Platforms.js.map +1 -0
- package/dist/showcase/ProductBand.d.ts +38 -0
- package/dist/showcase/ProductBand.js +120 -0
- package/dist/showcase/ProductBand.js.map +1 -0
- package/dist/showcase/Roadmap.d.ts +21 -0
- package/dist/showcase/Roadmap.js +111 -0
- package/dist/showcase/Roadmap.js.map +1 -0
- package/dist/showcase/RouteDiagram.d.ts +14 -0
- package/dist/showcase/RouteDiagram.js +57 -0
- package/dist/showcase/RouteDiagram.js.map +1 -0
- package/dist/showcase/ServerUnit.d.ts +50 -0
- package/dist/showcase/ServerUnit.js +175 -0
- package/dist/showcase/ServerUnit.js.map +1 -0
- package/dist/showcase/Stage.d.ts +46 -0
- package/dist/showcase/Stage.js +106 -0
- package/dist/showcase/Stage.js.map +1 -0
- package/dist/showcase/Status.d.ts +30 -0
- package/dist/showcase/Status.js +84 -0
- package/dist/showcase/Status.js.map +1 -0
- package/dist/showcase/StepFlow.d.ts +13 -0
- package/dist/showcase/StepFlow.js +47 -0
- package/dist/showcase/StepFlow.js.map +1 -0
- package/dist/showcase/index.d.ts +15 -0
- package/dist/testing.d.ts +5 -0
- package/dist/testing.js +43 -0
- package/dist/testing.js.map +1 -0
- package/dist/typography/Link.d.ts +21 -0
- package/dist/typography/Link.js +60 -0
- package/dist/typography/Link.js.map +1 -0
- package/dist/typography/Typography.d.ts +53 -0
- package/dist/typography/Typography.js +67 -0
- package/dist/typography/Typography.js.map +1 -0
- package/dist/typography/index.d.ts +4 -0
- package/dist/typography/index.js +4 -0
- package/package.json +80 -3
- package/src/actions/Button.tsx +68 -0
- package/src/actions/ButtonLink.tsx +75 -0
- package/src/actions/IconButton.tsx +55 -0
- package/src/actions/ThemeSwitch.tsx +46 -0
- package/src/actions/index.ts +4 -0
- package/src/collections/CollectionSectionHeader.tsx +13 -0
- package/src/collections/CollectionState.tsx +76 -0
- package/src/collections/CollectionTokens.ts +12 -0
- package/src/collections/CollectionViewport.ts +40 -0
- package/src/collections/DataRow.tsx +79 -0
- package/src/collections/ResultList.tsx +164 -0
- package/src/collections/ScrollRow.tsx +90 -0
- package/src/collections/VirtualGrid.tsx +92 -0
- package/src/collections/VirtualList.tsx +224 -0
- package/src/collections/index.ts +10 -0
- package/src/collections/useCollectionMotion.ts +42 -0
- package/src/collections/useScrollRow.ts +64 -0
- package/src/display/ActivityCard.tsx +76 -0
- package/src/display/Artwork.tsx +140 -0
- package/src/display/Avatar.tsx +7 -0
- package/src/display/Badge.tsx +33 -0
- package/src/display/BadgeList.tsx +25 -0
- package/src/display/BrandMark.tsx +72 -0
- package/src/display/ChangeList.tsx +41 -0
- package/src/display/CheckList.tsx +27 -0
- package/src/display/CodeBlock.tsx +12 -0
- package/src/display/CopyButton.tsx +77 -0
- package/src/display/DataTable.tsx +80 -0
- package/src/display/DetailHero.tsx +191 -0
- package/src/display/DetailList.tsx +74 -0
- package/src/display/DeviceCard.tsx +49 -0
- package/src/display/Identity.tsx +56 -0
- package/src/display/ImageCard.tsx +102 -0
- package/src/display/ImagePicker.tsx +149 -0
- package/src/display/InfoBox.tsx +48 -0
- package/src/display/InsetPanel.tsx +37 -0
- package/src/display/ItemAction.tsx +53 -0
- package/src/display/Kbd.tsx +6 -0
- package/src/display/KindIcon.tsx +15 -0
- package/src/display/NoticeCard.tsx +77 -0
- package/src/display/PairingList.tsx +55 -0
- package/src/display/PathList.tsx +16 -0
- package/src/display/PeoplePreview.tsx +66 -0
- package/src/display/PropertySheet.tsx +180 -0
- package/src/display/QrCode.tsx +47 -0
- package/src/display/RadioChoice.tsx +34 -0
- package/src/display/RatingLink.tsx +76 -0
- package/src/display/ResourceCard.tsx +201 -0
- package/src/display/RowList.tsx +110 -0
- package/src/display/StackedMeter.tsx +72 -0
- package/src/display/StatTile.tsx +39 -0
- package/src/display/StepList.tsx +10 -0
- package/src/display/TextPreview.tsx +66 -0
- package/src/display/TimeSeriesChart.tsx +191 -0
- package/src/display/ToneTile.ts +10 -0
- package/src/display/index.ts +37 -0
- package/src/feedback/Alert.tsx +35 -0
- package/src/feedback/AsyncState.tsx +56 -0
- package/src/feedback/ErrorNotification.ts +24 -0
- package/src/feedback/Notifications.tsx +5 -0
- package/src/feedback/ProgressStatusRow.tsx +104 -0
- package/src/feedback/SkeletonLoader.tsx +88 -0
- package/src/feedback/StatusIndicator.tsx +28 -0
- package/src/feedback/StatusPopoverContent.tsx +54 -0
- package/src/feedback/StatusRow.tsx +70 -0
- package/src/feedback/index.ts +15 -0
- package/src/forms/Checkbox.tsx +61 -0
- package/src/forms/Field.tsx +17 -0
- package/src/forms/FormControlStyles.ts +9 -0
- package/src/forms/FormSection.tsx +175 -0
- package/src/forms/InlineFields.tsx +22 -0
- package/src/forms/Input.tsx +22 -0
- package/src/forms/OptionSelect.tsx +49 -0
- package/src/forms/RadioGroup.tsx +48 -0
- package/src/forms/Select.tsx +46 -0
- package/src/forms/Switch.tsx +10 -0
- package/src/forms/TagInput.tsx +76 -0
- package/src/forms/Textarea.tsx +14 -0
- package/src/forms/index.ts +11 -0
- package/src/foundations/DesignSystemProvider.tsx +79 -0
- package/src/foundations/KeyboardFocus.ts +6 -0
- package/src/foundations/KeyboardShortcut.ts +12 -0
- package/src/foundations/Theme.ts +71 -0
- package/src/foundations/index.ts +10 -0
- package/src/foundations/theme.css +425 -0
- package/src/icons/BrandIcons.tsx +8 -0
- package/src/icons/index.ts +4 -0
- package/src/icons.ts +1 -0
- package/src/index.ts +13 -0
- package/src/layout/AppShell.tsx +63 -0
- package/src/layout/AuthLayout.tsx +40 -0
- package/src/layout/ContentContainer.tsx +16 -0
- package/src/layout/Flow.tsx +56 -0
- package/src/layout/PageLayout.tsx +35 -0
- package/src/layout/PageSection.tsx +103 -0
- package/src/layout/ScrollArea.tsx +7 -0
- package/src/layout/Section.tsx +36 -0
- package/src/layout/Site.tsx +205 -0
- package/src/layout/TitleBar.tsx +97 -0
- package/src/layout/WorkspaceActionsHeader.tsx +17 -0
- package/src/layout/index.ts +18 -0
- package/src/layout/sidebar/SidebarNavigationItem.tsx +45 -0
- package/src/layout/sidebar/SidebarPane.tsx +37 -0
- package/src/layout/toolbar/CommandPaletteTrigger.tsx +53 -0
- package/src/layout/toolbar/ToolbarStatusGroup.tsx +9 -0
- package/src/layout/toolbar/ToolbarStatusItem.tsx +18 -0
- package/src/navigation/ArtworkTabs.tsx +107 -0
- package/src/navigation/Breadcrumbs.tsx +31 -0
- package/src/navigation/CollectionBrowseSelector.tsx +90 -0
- package/src/navigation/CollectionViewToggle.tsx +52 -0
- package/src/navigation/DrilldownBrowseSelector.tsx +229 -0
- package/src/navigation/FolderSelector.tsx +172 -0
- package/src/navigation/TabKeys.ts +21 -0
- package/src/navigation/ViewTabs.tsx +85 -0
- package/src/navigation/index.ts +15 -0
- package/src/overlays/ActionModal.tsx +81 -0
- package/src/overlays/CommandPalette.tsx +199 -0
- package/src/overlays/Drawer.tsx +107 -0
- package/src/overlays/DropdownMenu.tsx +122 -0
- package/src/overlays/ImageViewer.tsx +96 -0
- package/src/overlays/Modal.tsx +234 -0
- package/src/overlays/Popover.tsx +40 -0
- package/src/overlays/Tooltip.tsx +56 -0
- package/src/overlays/index.ts +8 -0
- package/src/overlays/useModalAutoFocus.ts +119 -0
- package/src/overlays/useScrollFade.ts +49 -0
- package/src/showcase/CallToAction.tsx +46 -0
- package/src/showcase/Cards.tsx +133 -0
- package/src/showcase/Devices.tsx +259 -0
- package/src/showcase/FeatureRow.tsx +107 -0
- package/src/showcase/Hero.tsx +70 -0
- package/src/showcase/PhotoSearchConcept.tsx +50 -0
- package/src/showcase/Platforms.tsx +49 -0
- package/src/showcase/ProductBand.tsx +148 -0
- package/src/showcase/Roadmap.tsx +115 -0
- package/src/showcase/RouteDiagram.tsx +56 -0
- package/src/showcase/ServerUnit.tsx +191 -0
- package/src/showcase/Stage.tsx +160 -0
- package/src/showcase/Status.tsx +107 -0
- package/src/showcase/StepFlow.tsx +48 -0
- package/src/showcase/devices.css +441 -0
- package/src/showcase/index.ts +34 -0
- package/src/showcase/server-unit.css +258 -0
- package/src/showcase/stage.css +175 -0
- package/src/styles.css +5 -0
- package/src/testing.ts +34 -0
- package/src/typography/Link.tsx +105 -0
- package/src/typography/Typography.tsx +113 -0
- package/src/typography/index.ts +3 -0
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { type PointerEvent, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import { SkeletonLoader } from '../feedback/SkeletonLoader';
|
|
4
|
+
|
|
5
|
+
export interface TimeSeriesPoint {
|
|
6
|
+
timestamp: number;
|
|
7
|
+
lar: number | null;
|
|
8
|
+
host: number | null;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function TimeSeriesChartSkeleton() {
|
|
12
|
+
return (
|
|
13
|
+
<figure className="border-base-300 bg-base-100 min-w-0 rounded-lg border p-4">
|
|
14
|
+
<div className="mb-3 h-5">
|
|
15
|
+
<SkeletonLoader.Shape width="short" />
|
|
16
|
+
</div>
|
|
17
|
+
<SkeletonLoader.Shape presentation="chart" />
|
|
18
|
+
<div className="mt-3 flex h-4 items-center gap-5">
|
|
19
|
+
<SkeletonLoader.Shape width="short" />
|
|
20
|
+
<SkeletonLoader.Shape width="short" />
|
|
21
|
+
</div>
|
|
22
|
+
<div className="mt-1 flex h-4 items-center justify-between">
|
|
23
|
+
<SkeletonLoader.Shape width="short" />
|
|
24
|
+
<SkeletonLoader.Shape width="short" />
|
|
25
|
+
</div>
|
|
26
|
+
</figure>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
type Series = 'host' | 'lar';
|
|
31
|
+
|
|
32
|
+
interface TimeSeriesChartProps {
|
|
33
|
+
label: string;
|
|
34
|
+
larLabel: string;
|
|
35
|
+
hostLabel: string;
|
|
36
|
+
points: readonly TimeSeriesPoint[];
|
|
37
|
+
formatValue: (value: number) => string;
|
|
38
|
+
maximum?: number;
|
|
39
|
+
unavailableLabel: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const colors: Record<Series, string> = { host: 'var(--color-base-600)', lar: 'var(--color-primary)' };
|
|
43
|
+
const time = (timestamp: number) => new Date(timestamp).toLocaleTimeString();
|
|
44
|
+
|
|
45
|
+
/** Host and lar series, each drawn only when the server measured it, with gaps for missed samples. */
|
|
46
|
+
export function TimeSeriesChart({
|
|
47
|
+
label,
|
|
48
|
+
larLabel,
|
|
49
|
+
hostLabel,
|
|
50
|
+
points,
|
|
51
|
+
formatValue,
|
|
52
|
+
maximum,
|
|
53
|
+
unavailableLabel,
|
|
54
|
+
}: TimeSeriesChartProps) {
|
|
55
|
+
const [hovered, setHovered] = useState<number | null>(null);
|
|
56
|
+
const labels: Record<Series, string> = { host: hostLabel, lar: larLabel };
|
|
57
|
+
const series = (['host', 'lar'] as const).filter((kind) => points.some((point) => point[kind] !== null));
|
|
58
|
+
|
|
59
|
+
if (series.length === 0) return null;
|
|
60
|
+
|
|
61
|
+
const observed = points.flatMap((point) => series.map((kind) => point[kind])).filter((value) => value !== null);
|
|
62
|
+
const upper = Math.max(maximum ?? 0, ...observed, 1);
|
|
63
|
+
const latest = points.at(-1);
|
|
64
|
+
const first = points[0]?.timestamp ?? 0;
|
|
65
|
+
const last = latest?.timestamp ?? first;
|
|
66
|
+
const span = Math.max(last - first, 1);
|
|
67
|
+
// Plot coordinates in percent of the viewBox, shared by the SVG lines and the HTML hover layer.
|
|
68
|
+
const x = (timestamp: number) => 2 + ((timestamp - first) / span) * 96;
|
|
69
|
+
const y = (value: number) => 38 - (Math.max(0, value) / upper) * 36;
|
|
70
|
+
const path = (kind: Series) =>
|
|
71
|
+
points
|
|
72
|
+
.map((point, index) => {
|
|
73
|
+
const value = point[kind];
|
|
74
|
+
|
|
75
|
+
if (value === null) return '';
|
|
76
|
+
|
|
77
|
+
// A sample after a gap starts a segment; a zero-length one draws as a dot through the round cap.
|
|
78
|
+
const start = points[index - 1]?.[kind] == null;
|
|
79
|
+
|
|
80
|
+
return `${start ? 'M' : 'L'}${x(point.timestamp).toFixed(2)},${y(value).toFixed(2)}${start ? 'h0' : ''}`;
|
|
81
|
+
})
|
|
82
|
+
.join(' ');
|
|
83
|
+
const latestText = (kind: Series) => (latest?.[kind] == null ? unavailableLabel : formatValue(latest[kind]));
|
|
84
|
+
const swatch = (kind: Series) => (
|
|
85
|
+
<span aria-hidden="true" className="size-2 shrink-0 rounded-full" style={{ backgroundColor: colors[kind] }} />
|
|
86
|
+
);
|
|
87
|
+
const active = hovered === null ? undefined : points[hovered];
|
|
88
|
+
const readings = active
|
|
89
|
+
? series.flatMap((kind) => {
|
|
90
|
+
const value = active[kind];
|
|
91
|
+
|
|
92
|
+
return value === null ? [] : [{ kind, value }];
|
|
93
|
+
})
|
|
94
|
+
: [];
|
|
95
|
+
const trackPointer = (event: PointerEvent<HTMLDivElement>) => {
|
|
96
|
+
const bounds = event.currentTarget.getBoundingClientRect();
|
|
97
|
+
const target = ((event.clientX - bounds.left) / bounds.width) * 100;
|
|
98
|
+
const distance = (point: TimeSeriesPoint) => Math.abs(x(point.timestamp) - target);
|
|
99
|
+
|
|
100
|
+
setHovered(
|
|
101
|
+
points.reduce(
|
|
102
|
+
(best, point, index) => (distance(point) < distance(points[best] ?? point) ? index : best),
|
|
103
|
+
0,
|
|
104
|
+
),
|
|
105
|
+
);
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
return (
|
|
109
|
+
<figure className="border-base-300 bg-base-100 min-w-0 rounded-lg border p-4">
|
|
110
|
+
<figcaption className="text-base-content mb-3 text-sm font-medium">{label}</figcaption>
|
|
111
|
+
<div
|
|
112
|
+
className="relative h-36 w-full touch-pan-y"
|
|
113
|
+
onPointerMove={trackPointer}
|
|
114
|
+
onPointerLeave={() => setHovered(null)}
|
|
115
|
+
>
|
|
116
|
+
<svg
|
|
117
|
+
aria-label={`${label}: ${series.map((kind) => `${labels[kind]} ${latestText(kind)}`).join(', ')}`}
|
|
118
|
+
className="size-full overflow-visible"
|
|
119
|
+
preserveAspectRatio="none"
|
|
120
|
+
role="img"
|
|
121
|
+
viewBox="0 0 100 40"
|
|
122
|
+
>
|
|
123
|
+
<path
|
|
124
|
+
d="M2,38 H98 M2,20 H98 M2,2 H98"
|
|
125
|
+
fill="none"
|
|
126
|
+
stroke="currentColor"
|
|
127
|
+
strokeOpacity="0.12"
|
|
128
|
+
strokeWidth="0.25"
|
|
129
|
+
/>
|
|
130
|
+
{series.map((kind) => (
|
|
131
|
+
<path
|
|
132
|
+
key={kind}
|
|
133
|
+
d={path(kind)}
|
|
134
|
+
fill="none"
|
|
135
|
+
stroke={colors[kind]}
|
|
136
|
+
strokeLinecap="round"
|
|
137
|
+
strokeWidth="2"
|
|
138
|
+
vectorEffect="non-scaling-stroke"
|
|
139
|
+
/>
|
|
140
|
+
))}
|
|
141
|
+
</svg>
|
|
142
|
+
{active && readings.length > 0 ? (
|
|
143
|
+
<div aria-hidden="true" className="pointer-events-none absolute inset-0">
|
|
144
|
+
<div
|
|
145
|
+
className="bg-base-content/20 absolute inset-y-0 w-px -translate-x-1/2"
|
|
146
|
+
style={{ left: `${x(active.timestamp)}%` }}
|
|
147
|
+
/>
|
|
148
|
+
{readings.map(({ kind, value }) => (
|
|
149
|
+
<div
|
|
150
|
+
key={kind}
|
|
151
|
+
className="ring-base-50 absolute size-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full ring-2"
|
|
152
|
+
style={{
|
|
153
|
+
left: `${x(active.timestamp)}%`,
|
|
154
|
+
top: `${(y(value) / 40) * 100}%`,
|
|
155
|
+
backgroundColor: colors[kind],
|
|
156
|
+
}}
|
|
157
|
+
/>
|
|
158
|
+
))}
|
|
159
|
+
<div
|
|
160
|
+
className={`border-base-300 bg-base-100 absolute top-0 z-10 w-max rounded-md border px-2 py-1 text-xs shadow-sm ${x(active.timestamp) > 50 ? '-ml-2 -translate-x-full' : 'ml-2'}`}
|
|
161
|
+
style={{ left: `${x(active.timestamp)}%` }}
|
|
162
|
+
>
|
|
163
|
+
<div className="text-base-600 tabular-nums">{time(active.timestamp)}</div>
|
|
164
|
+
{readings.map(({ kind, value }) => (
|
|
165
|
+
<div key={kind} className="text-base-content flex items-center gap-1.5 tabular-nums">
|
|
166
|
+
{swatch(kind)}
|
|
167
|
+
{labels[kind]}: {formatValue(value)}
|
|
168
|
+
</div>
|
|
169
|
+
))}
|
|
170
|
+
</div>
|
|
171
|
+
</div>
|
|
172
|
+
) : null}
|
|
173
|
+
</div>
|
|
174
|
+
<div className="text-base-700 mt-3 flex flex-wrap items-center gap-x-5 gap-y-1 text-xs">
|
|
175
|
+
{series.map((kind) => (
|
|
176
|
+
<span key={kind} className="inline-flex items-center gap-1.5">
|
|
177
|
+
{swatch(kind)}
|
|
178
|
+
{labels[kind]}: {latestText(kind)}
|
|
179
|
+
</span>
|
|
180
|
+
))}
|
|
181
|
+
<span className="ml-auto tabular-nums">{formatValue(upper)}</span>
|
|
182
|
+
</div>
|
|
183
|
+
{points.length > 1 ? (
|
|
184
|
+
<div className="text-base-600 mt-1 flex justify-between text-xs tabular-nums">
|
|
185
|
+
<span>{time(first)}</span>
|
|
186
|
+
<span>{time(last)}</span>
|
|
187
|
+
</div>
|
|
188
|
+
) : null}
|
|
189
|
+
</figure>
|
|
190
|
+
);
|
|
191
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { StatusTone } from '../feedback/StatusIndicator';
|
|
2
|
+
|
|
3
|
+
/** A small square holding an icon, tinted by tone: T3 Code's 8% tint behind its foreground colour. */
|
|
4
|
+
export const toneTileClasses: Record<StatusTone, string> = {
|
|
5
|
+
neutral: 'bg-base-200 text-base-700 ring-1 ring-inset ring-base-300/70 dark:bg-base-300/60',
|
|
6
|
+
success: 'bg-success/10 text-(--lar-success-text) dark:bg-success/16',
|
|
7
|
+
warning: 'bg-warning/12 text-(--lar-warning-text) dark:bg-warning/16',
|
|
8
|
+
danger: 'bg-danger/10 text-(--lar-danger-text) dark:bg-danger/16',
|
|
9
|
+
info: 'bg-info/10 text-(--lar-info-text) dark:bg-info/16',
|
|
10
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export { ActivityCard, ActivityCardSkeleton } from './ActivityCard';
|
|
2
|
+
export { Artwork } from './Artwork';
|
|
3
|
+
export { Avatar } from './Avatar';
|
|
4
|
+
export { Badge, type BadgeProps } from './Badge';
|
|
5
|
+
export { BadgeList, type BadgeListItem } from './BadgeList';
|
|
6
|
+
export { BrandLink, BrandMark } from './BrandMark';
|
|
7
|
+
export { ChangeList, type ChangeListItem } from './ChangeList';
|
|
8
|
+
export { CheckList, type CheckListItem } from './CheckList';
|
|
9
|
+
export { CodeBlock } from './CodeBlock';
|
|
10
|
+
export { CopyButton } from './CopyButton';
|
|
11
|
+
export { DataTable, type DataTableCell, type DataTableRow } from './DataTable';
|
|
12
|
+
export { DetailHero, DetailHeroDetail, DetailHeroDetails, DetailHeroTags } from './DetailHero';
|
|
13
|
+
export { DetailList } from './DetailList';
|
|
14
|
+
export { DeviceCard } from './DeviceCard';
|
|
15
|
+
export { Identity } from './Identity';
|
|
16
|
+
export { ImageCard } from './ImageCard';
|
|
17
|
+
export { ImagePicker, ImagePickerGrid, ImagePickerOption, ImageUpload } from './ImagePicker';
|
|
18
|
+
export { InfoBox } from './InfoBox';
|
|
19
|
+
export { InsetPanel } from './InsetPanel';
|
|
20
|
+
export { ItemAction } from './ItemAction';
|
|
21
|
+
export { Kbd } from './Kbd';
|
|
22
|
+
export { KindIcon } from './KindIcon';
|
|
23
|
+
export { NoticeCard } from './NoticeCard';
|
|
24
|
+
export { PairingList, type PairingListItem } from './PairingList';
|
|
25
|
+
export { PathList } from './PathList';
|
|
26
|
+
export { PeoplePreview } from './PeoplePreview';
|
|
27
|
+
export { PropertySheet, type PropertySheetRow, type PropertySheetTag } from './PropertySheet';
|
|
28
|
+
export { QrCode } from './QrCode';
|
|
29
|
+
export { RadioChoice } from './RadioChoice';
|
|
30
|
+
export { RatingLink } from './RatingLink';
|
|
31
|
+
export { ResourceCard, ResourceCardSkeleton } from './ResourceCard';
|
|
32
|
+
export { RowList, RowListItem } from './RowList';
|
|
33
|
+
export { MeterLegend, type MeterSegment, type MeterTone, StackedMeter } from './StackedMeter';
|
|
34
|
+
export { StatTile } from './StatTile';
|
|
35
|
+
export { StepList } from './StepList';
|
|
36
|
+
export { TextPreview } from './TextPreview';
|
|
37
|
+
export { TimeSeriesChart, TimeSeriesChartSkeleton, type TimeSeriesPoint } from './TimeSeriesChart';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Alert as NinnaAlert, type AlertProps as NinnaAlertProps } from '@ninna-ui/feedback';
|
|
2
|
+
|
|
3
|
+
import type { StatusTone } from './StatusIndicator';
|
|
4
|
+
|
|
5
|
+
type AlertProps = Omit<NinnaAlertProps, 'color' | 'size' | 'variant'> & {
|
|
6
|
+
compact?: boolean;
|
|
7
|
+
/** Stays below the application header while its containing region is visible. */
|
|
8
|
+
sticky?: boolean;
|
|
9
|
+
tone?: Exclude<StatusTone, 'neutral'>;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* An immediate status about a condition or operation. Compact notes can hold short inline guidance.
|
|
14
|
+
* Use NoticeCard for content that needs examination and InfoBox for guidance that opens another surface.
|
|
15
|
+
*/
|
|
16
|
+
export function Alert({ compact = false, sticky = false, tone = 'info', className = '', ...props }: AlertProps) {
|
|
17
|
+
return (
|
|
18
|
+
<NinnaAlert
|
|
19
|
+
size={compact ? 'xs' : 'sm'}
|
|
20
|
+
showIcon
|
|
21
|
+
{...props}
|
|
22
|
+
color={tone}
|
|
23
|
+
className={
|
|
24
|
+
(sticky ? 'bg-base-50 sticky top-(--lar-header-height,0px) z-30 shadow-sm ' : '') +
|
|
25
|
+
(compact
|
|
26
|
+
? '[&_[data-slot=description]]:text-xs [&_[data-slot=icon]>svg]:size-4 [&_[data-slot=title]]:text-xs '
|
|
27
|
+
: '') +
|
|
28
|
+
(tone === 'warning'
|
|
29
|
+
? '[&_[data-slot=description]]:text-(--lar-warning-text) [&_[data-slot=description]]:opacity-100 [&_[data-slot=title]]:text-(--lar-warning-text) '
|
|
30
|
+
: '') +
|
|
31
|
+
className
|
|
32
|
+
}
|
|
33
|
+
/>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Alert } from '@ninna-ui/feedback';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
import { Button } from '../actions/Button';
|
|
5
|
+
import { SkeletonLoader } from './SkeletonLoader';
|
|
6
|
+
|
|
7
|
+
interface AsyncStateProps {
|
|
8
|
+
placeholder?: ReactNode;
|
|
9
|
+
error?: string;
|
|
10
|
+
errorTitle: string;
|
|
11
|
+
label: string;
|
|
12
|
+
loading: boolean;
|
|
13
|
+
onRetry?: () => void;
|
|
14
|
+
presentation?: 'card' | 'line';
|
|
15
|
+
retryLabel?: string;
|
|
16
|
+
retrying?: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** Owns a region's loading geometry and load failure; use Alert for other operation feedback. */
|
|
20
|
+
export function AsyncState({
|
|
21
|
+
error,
|
|
22
|
+
errorTitle,
|
|
23
|
+
label,
|
|
24
|
+
loading,
|
|
25
|
+
onRetry,
|
|
26
|
+
presentation = 'card',
|
|
27
|
+
placeholder,
|
|
28
|
+
retryLabel,
|
|
29
|
+
retrying = false,
|
|
30
|
+
}: AsyncStateProps) {
|
|
31
|
+
if (loading) {
|
|
32
|
+
return (
|
|
33
|
+
<SkeletonLoader label={label}>
|
|
34
|
+
{placeholder ?? <SkeletonLoader.Shape presentation={presentation} />}
|
|
35
|
+
</SkeletonLoader>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (!error) return null;
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<Alert
|
|
43
|
+
color="danger"
|
|
44
|
+
title={errorTitle}
|
|
45
|
+
description={error}
|
|
46
|
+
showIcon
|
|
47
|
+
action={
|
|
48
|
+
onRetry && retryLabel ? (
|
|
49
|
+
<Button type="button" onClick={onRetry} variant="primary" loading={retrying}>
|
|
50
|
+
{retryLabel}
|
|
51
|
+
</Button>
|
|
52
|
+
) : undefined
|
|
53
|
+
}
|
|
54
|
+
/>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { toast } from '@ninna-ui/feedback';
|
|
2
|
+
|
|
3
|
+
export interface ErrorNotification {
|
|
4
|
+
description: string;
|
|
5
|
+
title: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function dismissAllNotifications(): void {
|
|
9
|
+
toast.dismissAll();
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function showErrorNotification(notification: ErrorNotification): void {
|
|
13
|
+
toast.create({
|
|
14
|
+
...notification,
|
|
15
|
+
color: 'danger',
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function showSuccessNotification(message: string): void {
|
|
20
|
+
toast.create({
|
|
21
|
+
color: 'success',
|
|
22
|
+
title: message,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { ChevronRightIcon } from 'lucide-react';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
import { Button } from '../actions/Button';
|
|
5
|
+
import { StatusIndicator, type StatusTone } from './StatusIndicator';
|
|
6
|
+
|
|
7
|
+
interface ProgressStatusRowProps {
|
|
8
|
+
active: boolean;
|
|
9
|
+
detail?: string;
|
|
10
|
+
secondaryDetail?: string;
|
|
11
|
+
issue?: string;
|
|
12
|
+
label: string;
|
|
13
|
+
progress?: { max: number; value: number };
|
|
14
|
+
tone?: StatusTone;
|
|
15
|
+
trailing?: ReactNode;
|
|
16
|
+
onDetails?: () => void;
|
|
17
|
+
detailsLabel?: string;
|
|
18
|
+
progressLabel?: string;
|
|
19
|
+
compact?: boolean;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Ledger rows reserve the count line and track so updates never displace controls. */
|
|
23
|
+
export function ProgressStatusRow({
|
|
24
|
+
active,
|
|
25
|
+
detail,
|
|
26
|
+
secondaryDetail,
|
|
27
|
+
issue,
|
|
28
|
+
label,
|
|
29
|
+
progress,
|
|
30
|
+
tone = 'info',
|
|
31
|
+
trailing,
|
|
32
|
+
onDetails,
|
|
33
|
+
detailsLabel,
|
|
34
|
+
progressLabel,
|
|
35
|
+
compact = false,
|
|
36
|
+
}: ProgressStatusRowProps) {
|
|
37
|
+
const known = progress && progress.max > 0 ? progress : undefined;
|
|
38
|
+
const colors = {
|
|
39
|
+
info: 'bg-primary',
|
|
40
|
+
success: 'bg-success',
|
|
41
|
+
danger: 'bg-danger',
|
|
42
|
+
warning: 'bg-warning',
|
|
43
|
+
neutral: 'bg-base-400',
|
|
44
|
+
};
|
|
45
|
+
const heading = (
|
|
46
|
+
<>
|
|
47
|
+
<StatusIndicator tone={tone} />
|
|
48
|
+
<span className="text-base-content min-w-0 flex-1 truncate" title={label}>
|
|
49
|
+
{label}
|
|
50
|
+
</span>
|
|
51
|
+
</>
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<div className="w-full min-w-0">
|
|
56
|
+
<div className="grid min-h-12 min-w-0 grid-cols-[minmax(0,1fr)_auto] content-center items-center gap-x-3 gap-y-1">
|
|
57
|
+
{onDetails ? (
|
|
58
|
+
<Button
|
|
59
|
+
variant="status"
|
|
60
|
+
className="w-full"
|
|
61
|
+
onClick={onDetails}
|
|
62
|
+
aria-label={detailsLabel}
|
|
63
|
+
aria-haspopup="dialog"
|
|
64
|
+
>
|
|
65
|
+
{heading}
|
|
66
|
+
<ChevronRightIcon />
|
|
67
|
+
</Button>
|
|
68
|
+
) : (
|
|
69
|
+
<div className="flex h-4 min-w-0 items-center gap-1.5 text-xs">{heading}</div>
|
|
70
|
+
)}
|
|
71
|
+
{trailing ? <div className="col-start-2 row-span-3 row-start-1 shrink-0">{trailing}</div> : null}
|
|
72
|
+
<div
|
|
73
|
+
className={`text-2xs text-base-700 col-start-1 tabular-nums ${compact ? 'truncate' : 'break-words'}`}
|
|
74
|
+
title={detail}
|
|
75
|
+
>
|
|
76
|
+
{detail || '\u00a0'}
|
|
77
|
+
</div>
|
|
78
|
+
<div
|
|
79
|
+
className="bg-base-300/70 col-start-1 h-1.5 overflow-hidden rounded-full"
|
|
80
|
+
role={active ? 'progressbar' : undefined}
|
|
81
|
+
aria-label={active ? progressLabel || detail || label : undefined}
|
|
82
|
+
aria-valuenow={active && known ? known.value : undefined}
|
|
83
|
+
aria-valuemin={active && known ? 0 : undefined}
|
|
84
|
+
aria-valuemax={active && known ? known.max : undefined}
|
|
85
|
+
>
|
|
86
|
+
{active ? (
|
|
87
|
+
<div
|
|
88
|
+
className={`h-full rounded-full ${colors[tone]} ${known ? '' : 'lar-progress-indeterminate'}`}
|
|
89
|
+
style={
|
|
90
|
+
known
|
|
91
|
+
? { width: `${Math.min(100, Math.max(0, (known.value / known.max) * 100))}%` }
|
|
92
|
+
: undefined
|
|
93
|
+
}
|
|
94
|
+
/>
|
|
95
|
+
) : null}
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
{issue ? <div className="text-2xs break-words text-(--lar-danger-text) tabular-nums">{issue}</div> : null}
|
|
99
|
+
{secondaryDetail ? (
|
|
100
|
+
<div className="text-2xs text-base-700 break-words tabular-nums">{secondaryDetail}</div>
|
|
101
|
+
) : null}
|
|
102
|
+
</div>
|
|
103
|
+
);
|
|
104
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/* oxlint-disable react/only-export-components -- Compound members are exported through SkeletonLoader. */
|
|
2
|
+
|
|
3
|
+
import { Fragment, type ReactNode } from 'react';
|
|
4
|
+
|
|
5
|
+
type SkeletonPresentation =
|
|
6
|
+
| 'artwork'
|
|
7
|
+
| 'poster'
|
|
8
|
+
| 'video'
|
|
9
|
+
| 'card'
|
|
10
|
+
| 'chart'
|
|
11
|
+
| 'circle'
|
|
12
|
+
| 'control'
|
|
13
|
+
| 'heading'
|
|
14
|
+
| 'line'
|
|
15
|
+
| 'metric';
|
|
16
|
+
type SkeletonWidth = 'action' | 'full' | 'medium' | 'short' | 'wide';
|
|
17
|
+
|
|
18
|
+
const presentationClasses: Record<SkeletonPresentation, string> = {
|
|
19
|
+
artwork: 'aspect-square',
|
|
20
|
+
poster: 'aspect-[2/3]',
|
|
21
|
+
video: 'aspect-video',
|
|
22
|
+
card: 'h-32',
|
|
23
|
+
chart: 'h-36',
|
|
24
|
+
circle: 'size-9',
|
|
25
|
+
control: 'h-10',
|
|
26
|
+
heading: 'h-[1cap]',
|
|
27
|
+
line: 'h-3.5',
|
|
28
|
+
metric: 'h-8',
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const presentationRadius = {
|
|
32
|
+
artwork: 'rounded-lg',
|
|
33
|
+
poster: 'rounded-lg',
|
|
34
|
+
video: 'rounded-lg',
|
|
35
|
+
card: 'rounded-xl',
|
|
36
|
+
chart: 'rounded-md',
|
|
37
|
+
circle: 'rounded-full',
|
|
38
|
+
control: 'rounded-md',
|
|
39
|
+
heading: 'rounded-md',
|
|
40
|
+
line: 'rounded-full',
|
|
41
|
+
metric: 'rounded-md',
|
|
42
|
+
} as const;
|
|
43
|
+
|
|
44
|
+
const widthClasses: Record<SkeletonWidth, string> = {
|
|
45
|
+
action: 'w-20',
|
|
46
|
+
full: 'w-full',
|
|
47
|
+
medium: 'w-1/2',
|
|
48
|
+
short: 'w-1/3',
|
|
49
|
+
wide: 'w-3/4',
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
interface SkeletonLoaderProps {
|
|
53
|
+
children: ReactNode;
|
|
54
|
+
label: string;
|
|
55
|
+
loading?: boolean;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function SkeletonLoaderRoot({ children, label, loading = true }: SkeletonLoaderProps) {
|
|
59
|
+
if (!loading) return <Fragment>{children}</Fragment>;
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<div role="status" aria-busy="true" aria-label={label}>
|
|
63
|
+
<div aria-hidden="true">{children}</div>
|
|
64
|
+
</div>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
interface SkeletonShapeProps {
|
|
69
|
+
presentation?: SkeletonPresentation;
|
|
70
|
+
width?: SkeletonWidth;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function SkeletonShape({ presentation = 'line', width = 'full' }: SkeletonShapeProps) {
|
|
74
|
+
const classes = [presentationClasses[presentation], presentation === 'circle' ? null : widthClasses[width]]
|
|
75
|
+
.filter(Boolean)
|
|
76
|
+
.join(' ');
|
|
77
|
+
|
|
78
|
+
return (
|
|
79
|
+
<span
|
|
80
|
+
aria-hidden="true"
|
|
81
|
+
role="presentation"
|
|
82
|
+
data-slot="skeleton"
|
|
83
|
+
className={`lar-skeleton block ${classes} ${presentationRadius[presentation]}`}
|
|
84
|
+
/>
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export const SkeletonLoader = Object.assign(SkeletonLoaderRoot, { Shape: SkeletonShape });
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type StatusTone = 'neutral' | 'success' | 'warning' | 'danger' | 'info';
|
|
2
|
+
|
|
3
|
+
interface StatusIndicatorProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
size?: 'sm' | 'md';
|
|
6
|
+
tone: StatusTone;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const toneClasses: Record<StatusTone, string> = {
|
|
10
|
+
neutral: 'bg-base-400',
|
|
11
|
+
success: 'bg-success',
|
|
12
|
+
warning: 'bg-warning',
|
|
13
|
+
danger: 'bg-danger',
|
|
14
|
+
info: 'bg-info',
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const sizeClasses: Record<NonNullable<StatusIndicatorProps['size']>, string> = {
|
|
18
|
+
sm: 'size-1.5',
|
|
19
|
+
md: 'size-2',
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export function StatusIndicator({ className, size = 'md', tone }: StatusIndicatorProps) {
|
|
23
|
+
const classes = ['inline-block shrink-0 rounded-full', sizeClasses[size], toneClasses[tone], className]
|
|
24
|
+
.filter(Boolean)
|
|
25
|
+
.join(' ');
|
|
26
|
+
|
|
27
|
+
return <span aria-hidden="true" className={classes} />;
|
|
28
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Box } from '@ninna-ui/layout';
|
|
2
|
+
import { Popover } from '@ninna-ui/overlays';
|
|
3
|
+
import type { ReactNode } from 'react';
|
|
4
|
+
|
|
5
|
+
import { Badge } from '../display/Badge';
|
|
6
|
+
import { Inline, Stack } from '../layout/Flow';
|
|
7
|
+
import { Text } from '../typography/Typography';
|
|
8
|
+
import { type StatusTone } from './StatusIndicator';
|
|
9
|
+
|
|
10
|
+
interface StatusPopoverContentProps {
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
detail?: string;
|
|
13
|
+
status: string;
|
|
14
|
+
title: string;
|
|
15
|
+
tone: StatusTone;
|
|
16
|
+
width?: 'sm' | 'md';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const widthClasses: Record<NonNullable<StatusPopoverContentProps['width']>, string> = {
|
|
20
|
+
sm: 'w-72',
|
|
21
|
+
md: 'w-80',
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export function StatusPopoverContent({
|
|
25
|
+
children,
|
|
26
|
+
detail,
|
|
27
|
+
status,
|
|
28
|
+
title,
|
|
29
|
+
tone,
|
|
30
|
+
width = 'sm',
|
|
31
|
+
}: StatusPopoverContentProps) {
|
|
32
|
+
return (
|
|
33
|
+
<Popover.Content side="bottom" align="end" sideOffset={8} className={`${widthClasses[width]} p-0`}>
|
|
34
|
+
<Box className="border-base-300 border-b p-4">
|
|
35
|
+
<Inline align="center" justify="between" space="group">
|
|
36
|
+
<Stack space="none">
|
|
37
|
+
<Text as="span" variant="label">
|
|
38
|
+
{title}
|
|
39
|
+
</Text>
|
|
40
|
+
{detail ? (
|
|
41
|
+
<Text as="span" variant="caption" tone="muted">
|
|
42
|
+
{detail}
|
|
43
|
+
</Text>
|
|
44
|
+
) : null}
|
|
45
|
+
</Stack>
|
|
46
|
+
<Badge tone={tone}>{status}</Badge>
|
|
47
|
+
</Inline>
|
|
48
|
+
</Box>
|
|
49
|
+
<Stack space="tight" className="p-2">
|
|
50
|
+
{children}
|
|
51
|
+
</Stack>
|
|
52
|
+
</Popover.Content>
|
|
53
|
+
);
|
|
54
|
+
}
|