@lar-works/design-system 0.0.0-stage → 0.1.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 +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 +56 -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 +75 -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,90 @@
|
|
|
1
|
+
import { ChevronRightIcon } from 'lucide-react';
|
|
2
|
+
import type { ReactNode, Ref } from 'react';
|
|
3
|
+
|
|
4
|
+
import { IconButton } from '../actions/IconButton';
|
|
5
|
+
import { SkeletonLoader } from '../feedback/SkeletonLoader';
|
|
6
|
+
import { Inline } from '../layout/Flow';
|
|
7
|
+
|
|
8
|
+
const row = '-mx-1 flex snap-x scroll-px-1 gap-4 overflow-x-auto px-1 pt-1 pb-3';
|
|
9
|
+
|
|
10
|
+
/** One row of wide cards, such as video stills, that scrolls sideways instead of wrapping. */
|
|
11
|
+
export function ScrollRow({
|
|
12
|
+
ref,
|
|
13
|
+
label,
|
|
14
|
+
loading = false,
|
|
15
|
+
loadingLabel = label,
|
|
16
|
+
children,
|
|
17
|
+
}: {
|
|
18
|
+
ref: Ref<HTMLUListElement>;
|
|
19
|
+
label: string;
|
|
20
|
+
loading?: boolean;
|
|
21
|
+
loadingLabel?: string;
|
|
22
|
+
children?: ReactNode;
|
|
23
|
+
}) {
|
|
24
|
+
if (loading)
|
|
25
|
+
return (
|
|
26
|
+
<SkeletonLoader label={loadingLabel}>
|
|
27
|
+
<div className={row}>
|
|
28
|
+
{Array.from({ length: 4 }, (_, index) => (
|
|
29
|
+
<div key={index} className="flex w-64 shrink-0 flex-col gap-2">
|
|
30
|
+
<SkeletonLoader.Shape presentation="video" />
|
|
31
|
+
<SkeletonLoader.Shape width="wide" />
|
|
32
|
+
</div>
|
|
33
|
+
))}
|
|
34
|
+
</div>
|
|
35
|
+
</SkeletonLoader>
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<ul ref={ref} aria-label={label} className={row}>
|
|
40
|
+
{children}
|
|
41
|
+
</ul>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** `value` identifies the item, so its row can scroll to it. */
|
|
46
|
+
export function ScrollRowItem({ value, children }: { value?: string; children: ReactNode }) {
|
|
47
|
+
return (
|
|
48
|
+
<li data-value={value} className="w-64 shrink-0 snap-start">
|
|
49
|
+
{children}
|
|
50
|
+
</li>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** Each arrow is disabled at its end of the row, so both are while the row fits. */
|
|
55
|
+
export function ScrollRowArrows({
|
|
56
|
+
onScroll,
|
|
57
|
+
canScrollBack,
|
|
58
|
+
canScrollForward,
|
|
59
|
+
backLabel,
|
|
60
|
+
forwardLabel,
|
|
61
|
+
}: {
|
|
62
|
+
onScroll: (direction: 1 | -1) => void;
|
|
63
|
+
canScrollBack: boolean;
|
|
64
|
+
canScrollForward: boolean;
|
|
65
|
+
backLabel: string;
|
|
66
|
+
forwardLabel: string;
|
|
67
|
+
}) {
|
|
68
|
+
return (
|
|
69
|
+
<Inline space="tight">
|
|
70
|
+
<IconButton
|
|
71
|
+
aria-label={backLabel}
|
|
72
|
+
title={backLabel}
|
|
73
|
+
disabled={!canScrollBack}
|
|
74
|
+
icon={
|
|
75
|
+
<span className="flex rotate-180">
|
|
76
|
+
<ChevronRightIcon />
|
|
77
|
+
</span>
|
|
78
|
+
}
|
|
79
|
+
onClick={() => onScroll(-1)}
|
|
80
|
+
/>
|
|
81
|
+
<IconButton
|
|
82
|
+
aria-label={forwardLabel}
|
|
83
|
+
title={forwardLabel}
|
|
84
|
+
disabled={!canScrollForward}
|
|
85
|
+
icon={<ChevronRightIcon />}
|
|
86
|
+
onClick={() => onScroll(1)}
|
|
87
|
+
/>
|
|
88
|
+
</Inline>
|
|
89
|
+
);
|
|
90
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { useWindowVirtualizer } from '@tanstack/react-virtual';
|
|
2
|
+
import { type ReactNode, useEffect, useRef } from 'react';
|
|
3
|
+
|
|
4
|
+
import { useCollectionViewport } from './CollectionViewport';
|
|
5
|
+
import { useCollectionMotion } from './useCollectionMotion';
|
|
6
|
+
|
|
7
|
+
interface VirtualGridProps {
|
|
8
|
+
count: number;
|
|
9
|
+
label: string;
|
|
10
|
+
onRangeChange: (startIndex: number, endIndex: number) => void;
|
|
11
|
+
renderItem: (index: number) => ReactNode;
|
|
12
|
+
textRows?: 1 | 2 | 3;
|
|
13
|
+
aspect?: 'square' | 'poster';
|
|
14
|
+
itemKey: (index: number) => string;
|
|
15
|
+
loading?: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function VirtualGrid({
|
|
19
|
+
count,
|
|
20
|
+
label,
|
|
21
|
+
onRangeChange,
|
|
22
|
+
renderItem,
|
|
23
|
+
itemKey,
|
|
24
|
+
loading,
|
|
25
|
+
textRows = 2,
|
|
26
|
+
aspect = 'square',
|
|
27
|
+
}: VirtualGridProps) {
|
|
28
|
+
const { scrollMargin, setCollectionElement, width } = useCollectionViewport();
|
|
29
|
+
const root = useRef<HTMLDivElement>(null);
|
|
30
|
+
|
|
31
|
+
useCollectionMotion(root);
|
|
32
|
+
|
|
33
|
+
const gap = 16;
|
|
34
|
+
const maxItemWidth = 170;
|
|
35
|
+
// Reserve the tallest grid until measured so history restoration is not clipped.
|
|
36
|
+
const layoutWidth = width || maxItemWidth * 2 + gap;
|
|
37
|
+
const columns = Math.max(2, Math.round((layoutWidth + gap) / (maxItemWidth + gap)));
|
|
38
|
+
const itemWidth = Math.min(maxItemWidth, Math.max(0, (layoutWidth - gap * (columns - 1)) / columns));
|
|
39
|
+
const rowHeight = itemWidth * (aspect === 'poster' ? 1.5 : 1) + 64 + (textRows - 2) * 16;
|
|
40
|
+
const rowCount = Math.ceil(count / columns);
|
|
41
|
+
const virtualizer = useWindowVirtualizer({
|
|
42
|
+
count: rowCount,
|
|
43
|
+
estimateSize: () => rowHeight,
|
|
44
|
+
overscan: 2,
|
|
45
|
+
scrollMargin,
|
|
46
|
+
});
|
|
47
|
+
const rows = virtualizer.getVirtualItems();
|
|
48
|
+
const startIndex = (rows[0]?.index ?? 0) * columns;
|
|
49
|
+
const endIndex = Math.min(count - 1, ((rows.at(-1)?.index ?? 0) + 1) * columns - 1);
|
|
50
|
+
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
virtualizer.measure();
|
|
53
|
+
}, [columns, rowHeight, virtualizer]);
|
|
54
|
+
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
if (count > 0) onRangeChange(startIndex, endIndex);
|
|
57
|
+
}, [count, endIndex, onRangeChange, startIndex]);
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<div ref={setCollectionElement} role="region" aria-label={label}>
|
|
61
|
+
<div
|
|
62
|
+
ref={root}
|
|
63
|
+
className="relative w-full"
|
|
64
|
+
aria-busy={loading}
|
|
65
|
+
style={{ height: virtualizer.getTotalSize() }}
|
|
66
|
+
>
|
|
67
|
+
{rows.flatMap((row) =>
|
|
68
|
+
Array.from({ length: columns }, (_, column) => {
|
|
69
|
+
const index = row.index * columns + column;
|
|
70
|
+
const key = itemKey(index);
|
|
71
|
+
|
|
72
|
+
return index < count ? (
|
|
73
|
+
<div
|
|
74
|
+
key={key}
|
|
75
|
+
data-collection-key={key}
|
|
76
|
+
data-index={index}
|
|
77
|
+
className="absolute"
|
|
78
|
+
style={{
|
|
79
|
+
left: column * (itemWidth + (layoutWidth - columns * itemWidth) / (columns - 1)),
|
|
80
|
+
top: row.start - scrollMargin,
|
|
81
|
+
width: itemWidth,
|
|
82
|
+
}}
|
|
83
|
+
>
|
|
84
|
+
{renderItem(index)}
|
|
85
|
+
</div>
|
|
86
|
+
) : null;
|
|
87
|
+
}),
|
|
88
|
+
)}
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
);
|
|
92
|
+
}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import { useWindowVirtualizer } from '@tanstack/react-virtual';
|
|
2
|
+
import { ChevronDownIcon } from 'lucide-react';
|
|
3
|
+
import { type CSSProperties, type ReactNode, useCallback, useEffect, useRef } from 'react';
|
|
4
|
+
|
|
5
|
+
import { SkeletonLoader } from '../feedback/SkeletonLoader';
|
|
6
|
+
import { tabbable } from '../foundations/KeyboardFocus';
|
|
7
|
+
import { LinkOverlay } from '../typography/Link';
|
|
8
|
+
import { columnBreakpoints, columnWidths } from './CollectionTokens';
|
|
9
|
+
import { useCollectionViewport } from './CollectionViewport';
|
|
10
|
+
import { DataRow } from './DataRow';
|
|
11
|
+
import { useCollectionMotion } from './useCollectionMotion';
|
|
12
|
+
|
|
13
|
+
export interface ListColumn<TItem> {
|
|
14
|
+
id: string;
|
|
15
|
+
label: string;
|
|
16
|
+
hideLabel?: boolean;
|
|
17
|
+
render: (item: TItem, visibleColumns: readonly string[], index: number) => ReactNode;
|
|
18
|
+
size: keyof typeof columnWidths;
|
|
19
|
+
priority?: keyof typeof columnBreakpoints;
|
|
20
|
+
placeholder?: (visibleColumns: readonly string[]) => ReactNode;
|
|
21
|
+
align?: 'right';
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface VirtualListProps<TItem> {
|
|
25
|
+
columns: readonly ListColumn<TItem>[];
|
|
26
|
+
count: number;
|
|
27
|
+
itemAt: (index: number) => TItem | undefined;
|
|
28
|
+
itemLabel: (item: TItem) => string;
|
|
29
|
+
label: string;
|
|
30
|
+
onRangeChange: (startIndex: number, endIndex: number) => void;
|
|
31
|
+
onSelect?: (item: TItem) => void;
|
|
32
|
+
itemHref?: (item: TItem) => string | undefined;
|
|
33
|
+
onNavigate?: (href: string) => void;
|
|
34
|
+
placeholderAt?: (index: number) => ReactNode;
|
|
35
|
+
itemKey: (index: number) => string;
|
|
36
|
+
loading?: boolean;
|
|
37
|
+
section?: {
|
|
38
|
+
isStart: (item: TItem, index: number, previous: TItem | undefined) => boolean;
|
|
39
|
+
render: (item: TItem) => ReactNode;
|
|
40
|
+
};
|
|
41
|
+
sort?: string;
|
|
42
|
+
direction?: 'asc' | 'desc';
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function VirtualList<TItem>({
|
|
46
|
+
columns,
|
|
47
|
+
count,
|
|
48
|
+
itemAt,
|
|
49
|
+
itemLabel,
|
|
50
|
+
label,
|
|
51
|
+
onRangeChange,
|
|
52
|
+
onSelect,
|
|
53
|
+
itemHref,
|
|
54
|
+
onNavigate,
|
|
55
|
+
placeholderAt,
|
|
56
|
+
itemKey,
|
|
57
|
+
loading,
|
|
58
|
+
section,
|
|
59
|
+
sort,
|
|
60
|
+
direction = 'asc',
|
|
61
|
+
}: VirtualListProps<TItem>) {
|
|
62
|
+
const { scrollMargin, setCollectionElement, width } = useCollectionViewport();
|
|
63
|
+
const root = useRef<HTMLDivElement>(null);
|
|
64
|
+
const attachRoot = useCallback(
|
|
65
|
+
(element: HTMLDivElement | null) => {
|
|
66
|
+
root.current = element;
|
|
67
|
+
setCollectionElement(element);
|
|
68
|
+
},
|
|
69
|
+
[setCollectionElement],
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
useCollectionMotion(root);
|
|
73
|
+
|
|
74
|
+
const visibleColumns = columns.filter(
|
|
75
|
+
(column) => column.id === sort || width >= columnBreakpoints[column.priority ?? 'primary'],
|
|
76
|
+
);
|
|
77
|
+
const visibleColumnIds = visibleColumns.map((column) => column.id);
|
|
78
|
+
const virtualizer = useWindowVirtualizer({
|
|
79
|
+
count,
|
|
80
|
+
// Layout belongs to stable catalog slots. Domain keys still identify
|
|
81
|
+
// mounted rows below; changing page data must not remeasure every slot.
|
|
82
|
+
// Section headers are measured with their mounted row wrappers.
|
|
83
|
+
estimateSize: () => 64,
|
|
84
|
+
overscan: 8,
|
|
85
|
+
scrollMargin,
|
|
86
|
+
});
|
|
87
|
+
const virtualItems = virtualizer.getVirtualItems();
|
|
88
|
+
const startIndex = Math.max(0, virtualItems[0]?.index ?? 0);
|
|
89
|
+
const endIndex = Math.min(count - 1, virtualItems.at(-1)?.index ?? 0);
|
|
90
|
+
|
|
91
|
+
useEffect(() => {
|
|
92
|
+
if (endIndex >= startIndex) onRangeChange(startIndex, endIndex);
|
|
93
|
+
}, [endIndex, onRangeChange, startIndex]);
|
|
94
|
+
|
|
95
|
+
return (
|
|
96
|
+
<div
|
|
97
|
+
role="table"
|
|
98
|
+
aria-label={label}
|
|
99
|
+
aria-busy={loading}
|
|
100
|
+
aria-rowcount={count + 1}
|
|
101
|
+
aria-colcount={visibleColumns.length}
|
|
102
|
+
className="border-base-300 bg-base-100 @container min-w-0 rounded-b-xl border-x border-b"
|
|
103
|
+
style={
|
|
104
|
+
{
|
|
105
|
+
'--lar-list-columns': visibleColumns.map((column) => columnWidths[column.size]).join(' '),
|
|
106
|
+
} as CSSProperties
|
|
107
|
+
}
|
|
108
|
+
>
|
|
109
|
+
<div
|
|
110
|
+
role="rowgroup"
|
|
111
|
+
className="bg-base-50 sticky top-(--lar-header-height,0px) z-20 -mx-px -mt-(--lar-page-gutter,0px) pt-(--lar-page-gutter,0px)"
|
|
112
|
+
>
|
|
113
|
+
<div
|
|
114
|
+
role="row"
|
|
115
|
+
aria-rowindex={1}
|
|
116
|
+
className="border-base-300 bg-base-100 box-content grid h-10 grid-cols-(--lar-list-columns) items-center gap-4 rounded-t-xl border px-3"
|
|
117
|
+
>
|
|
118
|
+
{visibleColumns.map((column) => (
|
|
119
|
+
<div
|
|
120
|
+
key={column.id}
|
|
121
|
+
role="columnheader"
|
|
122
|
+
aria-sort={
|
|
123
|
+
column.id === sort ? (direction === 'asc' ? 'ascending' : 'descending') : undefined
|
|
124
|
+
}
|
|
125
|
+
className={`flex min-w-0 items-center gap-1 text-xs font-medium ${column.align === 'right' ? 'justify-end' : ''} ${column.id === sort ? 'text-base-content' : 'text-base-content/50'}`}
|
|
126
|
+
>
|
|
127
|
+
<span className={column.hideLabel ? 'sr-only' : 'truncate'}>{column.label}</span>
|
|
128
|
+
{column.id === sort ? (
|
|
129
|
+
<span className={`size-3 shrink-0 ${direction === 'asc' ? 'rotate-180' : ''}`}>
|
|
130
|
+
<ChevronDownIcon />
|
|
131
|
+
</span>
|
|
132
|
+
) : null}
|
|
133
|
+
</div>
|
|
134
|
+
))}
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
<div
|
|
138
|
+
ref={attachRoot}
|
|
139
|
+
role="rowgroup"
|
|
140
|
+
className="relative w-full"
|
|
141
|
+
style={{ height: virtualizer.getTotalSize() }}
|
|
142
|
+
>
|
|
143
|
+
{virtualItems.map((item) => {
|
|
144
|
+
const index = item.index;
|
|
145
|
+
const key = itemKey(index);
|
|
146
|
+
const value = itemAt(index);
|
|
147
|
+
const href = value ? itemHref?.(value) : undefined;
|
|
148
|
+
const placeholder = placeholderAt?.(index);
|
|
149
|
+
const sectionStart = value && section?.isStart(value, index, itemAt(index - 1));
|
|
150
|
+
|
|
151
|
+
return (
|
|
152
|
+
<div
|
|
153
|
+
key={key}
|
|
154
|
+
data-collection-key={key}
|
|
155
|
+
role="presentation"
|
|
156
|
+
ref={virtualizer.measureElement}
|
|
157
|
+
data-index={item.index}
|
|
158
|
+
className="absolute top-0 left-0 w-full"
|
|
159
|
+
style={{ top: item.start - scrollMargin }}
|
|
160
|
+
>
|
|
161
|
+
{sectionStart ? section?.render(value) : null}
|
|
162
|
+
<div className="h-16">
|
|
163
|
+
<DataRow rowIndex={item.index + 2} interactive={Boolean(value && (href || onSelect))}>
|
|
164
|
+
{placeholder ? (
|
|
165
|
+
<div
|
|
166
|
+
role="cell"
|
|
167
|
+
aria-colspan={visibleColumns.length}
|
|
168
|
+
className="col-span-full min-w-0"
|
|
169
|
+
>
|
|
170
|
+
{placeholder}
|
|
171
|
+
</div>
|
|
172
|
+
) : (
|
|
173
|
+
visibleColumns.map((column, columnIndex) => {
|
|
174
|
+
const content = value
|
|
175
|
+
? column.render(value, visibleColumnIds, index)
|
|
176
|
+
: undefined;
|
|
177
|
+
|
|
178
|
+
return (
|
|
179
|
+
<div
|
|
180
|
+
key={column.id}
|
|
181
|
+
role="cell"
|
|
182
|
+
title={typeof content === 'string' ? content : undefined}
|
|
183
|
+
className={`min-w-0 truncate text-sm ${column.align === 'right' ? 'text-right tabular-nums' : ''} ${column.id === sort || columnIndex === 0 ? 'text-base-content' : 'text-base-content/55'}`}
|
|
184
|
+
>
|
|
185
|
+
{!value ? (
|
|
186
|
+
(column.placeholder?.(visibleColumnIds) ?? (
|
|
187
|
+
<SkeletonLoader.Shape width="wide" />
|
|
188
|
+
))
|
|
189
|
+
) : columnIndex === 0 ? (
|
|
190
|
+
<>
|
|
191
|
+
{href ? (
|
|
192
|
+
<LinkOverlay
|
|
193
|
+
href={href}
|
|
194
|
+
onNavigate={onNavigate}
|
|
195
|
+
aria-label={itemLabel(value)}
|
|
196
|
+
/>
|
|
197
|
+
) : onSelect ? (
|
|
198
|
+
<button
|
|
199
|
+
{...tabbable}
|
|
200
|
+
type="button"
|
|
201
|
+
data-slot="action-overlay"
|
|
202
|
+
aria-label={itemLabel(value)}
|
|
203
|
+
onClick={() => onSelect(value)}
|
|
204
|
+
className="focus-visible:outline-primary absolute inset-0 z-1 block w-full cursor-pointer rounded-md focus-visible:outline-2 focus-visible:-outline-offset-2"
|
|
205
|
+
/>
|
|
206
|
+
) : null}
|
|
207
|
+
<div className="py-2">{content}</div>
|
|
208
|
+
</>
|
|
209
|
+
) : (
|
|
210
|
+
content
|
|
211
|
+
)}
|
|
212
|
+
</div>
|
|
213
|
+
);
|
|
214
|
+
})
|
|
215
|
+
)}
|
|
216
|
+
</DataRow>
|
|
217
|
+
</div>
|
|
218
|
+
</div>
|
|
219
|
+
);
|
|
220
|
+
})}
|
|
221
|
+
</div>
|
|
222
|
+
</div>
|
|
223
|
+
);
|
|
224
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { CollectionSectionHeader } from './CollectionSectionHeader';
|
|
2
|
+
export { CollectionState } from './CollectionState';
|
|
3
|
+
export { DataRow } from './DataRow';
|
|
4
|
+
export { ResultEmpty, ResultList, ResultRow, type ResultRowProps } from './ResultList';
|
|
5
|
+
export { ScrollRow, ScrollRowArrows, ScrollRowItem } from './ScrollRow';
|
|
6
|
+
export { useCollectionMotion } from './useCollectionMotion';
|
|
7
|
+
export { revealInRow, useScrollRow } from './useScrollRow';
|
|
8
|
+
export { VirtualGrid } from './VirtualGrid';
|
|
9
|
+
export type { VirtualListProps } from './VirtualList';
|
|
10
|
+
export { type ListColumn, VirtualList } from './VirtualList';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type RefObject, useLayoutEffect, useRef } from 'react';
|
|
2
|
+
|
|
3
|
+
// Children identify their domain key and collection index, even across virtual
|
|
4
|
+
// rows. Only mounted items are measured, keeping large catalogs bounded.
|
|
5
|
+
export function useCollectionMotion(root: RefObject<HTMLDivElement | null>) {
|
|
6
|
+
const positions = useRef(new Map<string, { index: string | undefined; x: number; y: number }>());
|
|
7
|
+
|
|
8
|
+
useLayoutEffect(() => {
|
|
9
|
+
const next = new Map<string, { index: string | undefined; x: number; y: number }>();
|
|
10
|
+
const reducedMotion = window.matchMedia?.('(prefers-reduced-motion: reduce)').matches ?? false;
|
|
11
|
+
|
|
12
|
+
for (const element of root.current?.querySelectorAll<HTMLElement>('[data-collection-key]') ?? []) {
|
|
13
|
+
const key = element.dataset.collectionKey!;
|
|
14
|
+
const position = { index: element.dataset.index, x: element.offsetLeft, y: element.offsetTop };
|
|
15
|
+
const previous = positions.current.get(key);
|
|
16
|
+
|
|
17
|
+
next.set(key, position);
|
|
18
|
+
|
|
19
|
+
if (reducedMotion || !element.animate) continue;
|
|
20
|
+
|
|
21
|
+
// Initial measurement and resizing can change coordinates without
|
|
22
|
+
// changing order. Translate only to make room or reorder items.
|
|
23
|
+
if (
|
|
24
|
+
previous &&
|
|
25
|
+
previous.index !== position.index &&
|
|
26
|
+
(previous.x !== position.x || previous.y !== position.y)
|
|
27
|
+
) {
|
|
28
|
+
element.getAnimations().forEach((animation) => animation.cancel());
|
|
29
|
+
element.animate(
|
|
30
|
+
[
|
|
31
|
+
{ transform: `translate(${previous.x - position.x}px, ${previous.y - position.y}px)` },
|
|
32
|
+
{ transform: 'translate(0, 0)' },
|
|
33
|
+
],
|
|
34
|
+
{ duration: 280, easing: 'cubic-bezier(0.2, 0.8, 0.2, 1)' },
|
|
35
|
+
);
|
|
36
|
+
} else if (!previous) {
|
|
37
|
+
element.animate([{ opacity: 0 }, { opacity: 1 }], { duration: 220, easing: 'ease-out' });
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
positions.current = next;
|
|
41
|
+
});
|
|
42
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Scrolls `row` sideways, never its page, just far enough to show all of `item`. A snapping row settles on an item's
|
|
5
|
+
* start, so it scrolls to the first start that still shows all of `item`.
|
|
6
|
+
*/
|
|
7
|
+
export function revealInRow(row: HTMLElement, item: Element | null | undefined) {
|
|
8
|
+
if (!item) return;
|
|
9
|
+
|
|
10
|
+
const bounds = row.getBoundingClientRect();
|
|
11
|
+
const { left, right } = item.getBoundingClientRect();
|
|
12
|
+
const fit = right - bounds.right;
|
|
13
|
+
const style = getComputedStyle(row);
|
|
14
|
+
const padding = parseFloat(style.scrollPaddingLeft) || 0;
|
|
15
|
+
const starts =
|
|
16
|
+
style.scrollSnapType && style.scrollSnapType !== 'none'
|
|
17
|
+
? Array.from(row.children, (child) => child.getBoundingClientRect().left - bounds.left - padding).filter(
|
|
18
|
+
(start) => start >= fit,
|
|
19
|
+
)
|
|
20
|
+
: [];
|
|
21
|
+
const offset = left < bounds.left ? left - bounds.left : fit > 0 ? (starts.length ? Math.min(...starts) : fit) : 0;
|
|
22
|
+
|
|
23
|
+
if (offset) row.scrollTo({ left: row.scrollLeft + offset, behavior: 'smooth' });
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Pairs a `ScrollRow` with `ScrollRowArrows` placed elsewhere, such as in its section header. `content` is a stable
|
|
28
|
+
* key for what the row shows, such as its item count, so the arrows re-measure when it changes.
|
|
29
|
+
*/
|
|
30
|
+
export function useScrollRow(content?: unknown) {
|
|
31
|
+
const [row, setRow] = useState<HTMLUListElement | null>(null);
|
|
32
|
+
const [ends, setEnds] = useState({ back: false, forward: false });
|
|
33
|
+
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
const measure = () => {
|
|
36
|
+
const back = Boolean(row && row.scrollLeft > 1);
|
|
37
|
+
const forward = Boolean(row && row.scrollLeft + row.clientWidth < row.scrollWidth - 1);
|
|
38
|
+
|
|
39
|
+
setEnds((current) => (current.back === back && current.forward === forward ? current : { back, forward }));
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
measure();
|
|
43
|
+
|
|
44
|
+
if (!row) return;
|
|
45
|
+
|
|
46
|
+
const observer = new ResizeObserver(measure);
|
|
47
|
+
|
|
48
|
+
observer.observe(row);
|
|
49
|
+
row.addEventListener('scroll', measure, { passive: true });
|
|
50
|
+
|
|
51
|
+
return () => {
|
|
52
|
+
observer.disconnect();
|
|
53
|
+
row.removeEventListener('scroll', measure);
|
|
54
|
+
};
|
|
55
|
+
}, [row, content]);
|
|
56
|
+
|
|
57
|
+
return {
|
|
58
|
+
row,
|
|
59
|
+
setRow,
|
|
60
|
+
canScrollBack: ends.back,
|
|
61
|
+
canScrollForward: ends.forward,
|
|
62
|
+
scroll: (direction: 1 | -1) => row?.scrollBy({ left: direction * row.clientWidth * 0.8, behavior: 'smooth' }),
|
|
63
|
+
};
|
|
64
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
import { SkeletonLoader } from '../feedback/SkeletonLoader';
|
|
4
|
+
import { Inline, Stack } from '../layout/Flow';
|
|
5
|
+
import { Text } from '../typography/Typography';
|
|
6
|
+
|
|
7
|
+
interface ActivityCardProps {
|
|
8
|
+
loading?: boolean;
|
|
9
|
+
/** Cover, poster, or icon; the card gives it a fixed square to fill. */
|
|
10
|
+
artwork: ReactNode;
|
|
11
|
+
badges?: ReactNode;
|
|
12
|
+
/** A dense row of artwork and title with one subtitle, without the card chrome, detail, or badges. */
|
|
13
|
+
compact?: boolean;
|
|
14
|
+
detail?: string;
|
|
15
|
+
subtitle?: string;
|
|
16
|
+
title: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** One thing happening on the server, whatever the media type: what it is, who has it, and how. */
|
|
20
|
+
export function ActivityCard({
|
|
21
|
+
artwork,
|
|
22
|
+
badges,
|
|
23
|
+
compact = false,
|
|
24
|
+
detail,
|
|
25
|
+
subtitle,
|
|
26
|
+
title,
|
|
27
|
+
loading = false,
|
|
28
|
+
}: ActivityCardProps) {
|
|
29
|
+
return (
|
|
30
|
+
<article
|
|
31
|
+
className={`flex min-w-0 items-center ${compact ? 'gap-3 rounded-lg p-2' : 'border-base-300 bg-base-100 gap-4 rounded-xl border p-3 shadow-xs'}`}
|
|
32
|
+
>
|
|
33
|
+
<div className={`shrink-0 ${compact ? 'size-10' : 'size-20'}`}>{artwork}</div>
|
|
34
|
+
<Stack space="tight" className="min-w-0 flex-1">
|
|
35
|
+
<Stack space="none" className="min-w-0">
|
|
36
|
+
<Text as="span" variant="label" truncate title={title} loading={loading}>
|
|
37
|
+
{title}
|
|
38
|
+
</Text>
|
|
39
|
+
{Object.entries(compact ? { subtitle } : { subtitle, detail }).map(([key, line]) =>
|
|
40
|
+
line ? (
|
|
41
|
+
<Text
|
|
42
|
+
key={key}
|
|
43
|
+
as="span"
|
|
44
|
+
variant="caption"
|
|
45
|
+
tone="muted"
|
|
46
|
+
truncate
|
|
47
|
+
title={line}
|
|
48
|
+
loading={loading}
|
|
49
|
+
>
|
|
50
|
+
{line}
|
|
51
|
+
</Text>
|
|
52
|
+
) : null,
|
|
53
|
+
)}
|
|
54
|
+
</Stack>
|
|
55
|
+
{!compact && badges ? (
|
|
56
|
+
<Inline wrap space="tight">
|
|
57
|
+
{badges}
|
|
58
|
+
</Inline>
|
|
59
|
+
) : null}
|
|
60
|
+
</Stack>
|
|
61
|
+
</article>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function ActivityCardSkeleton() {
|
|
66
|
+
return (
|
|
67
|
+
<ActivityCard
|
|
68
|
+
loading
|
|
69
|
+
artwork={<SkeletonLoader.Shape presentation="artwork" />}
|
|
70
|
+
title=""
|
|
71
|
+
subtitle=" "
|
|
72
|
+
detail=" "
|
|
73
|
+
badges={<SkeletonLoader.Shape width="wide" />}
|
|
74
|
+
/>
|
|
75
|
+
);
|
|
76
|
+
}
|