@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,234 @@
|
|
|
1
|
+
/* oxlint-disable react/only-export-components -- Compound members are exported through Modal. */
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
Modal as NinnaModal,
|
|
5
|
+
type ModalBodyProps,
|
|
6
|
+
type ModalContentProps,
|
|
7
|
+
type ModalFooterProps,
|
|
8
|
+
} from '@ninna-ui/overlays';
|
|
9
|
+
import { XIcon } from 'lucide-react';
|
|
10
|
+
import {
|
|
11
|
+
type ComponentProps,
|
|
12
|
+
createContext,
|
|
13
|
+
forwardRef,
|
|
14
|
+
type ReactNode,
|
|
15
|
+
type Ref,
|
|
16
|
+
useCallback,
|
|
17
|
+
useContext,
|
|
18
|
+
} from 'react';
|
|
19
|
+
|
|
20
|
+
import { IconButton } from '../actions/IconButton';
|
|
21
|
+
import { useDesignSystemLabels } from '../foundations/DesignSystemProvider';
|
|
22
|
+
import { Heading, Text } from '../typography/Typography';
|
|
23
|
+
import { useModalAutoFocus } from './useModalAutoFocus';
|
|
24
|
+
import { useScrollFade } from './useScrollFade';
|
|
25
|
+
|
|
26
|
+
const ModalLoadingContext = createContext(false);
|
|
27
|
+
|
|
28
|
+
interface ModalContentPolicyProps extends Omit<ModalContentProps, 'className' | 'size' | 'title'> {
|
|
29
|
+
accessibleTitle?: string;
|
|
30
|
+
/** Whether opening focuses the first editable field; off while the caller focuses something else. */
|
|
31
|
+
focusFirstField?: boolean;
|
|
32
|
+
headerActions?: ReactNode;
|
|
33
|
+
sidebar?: ReactNode;
|
|
34
|
+
/** The dialog's size; a dialog with a sidebar is `paned` unless it says otherwise. */
|
|
35
|
+
presentation?: 'default' | 'paned' | 'workspace';
|
|
36
|
+
title: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const ModalContent = forwardRef<HTMLDivElement, ModalContentPolicyProps>(
|
|
40
|
+
(
|
|
41
|
+
{
|
|
42
|
+
accessibleTitle,
|
|
43
|
+
children,
|
|
44
|
+
closeOnEscape,
|
|
45
|
+
closeOnOverlayClick,
|
|
46
|
+
description,
|
|
47
|
+
focusFirstField,
|
|
48
|
+
headerActions,
|
|
49
|
+
onPointerDownOutside,
|
|
50
|
+
sidebar,
|
|
51
|
+
presentation = sidebar ? 'paned' : 'default',
|
|
52
|
+
title,
|
|
53
|
+
...props
|
|
54
|
+
},
|
|
55
|
+
ref,
|
|
56
|
+
) => {
|
|
57
|
+
const loading = useContext(ModalLoadingContext);
|
|
58
|
+
const focusProps = useModalAutoFocus(focusFirstField);
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<NinnaModal.Content
|
|
62
|
+
ref={ref}
|
|
63
|
+
{...props}
|
|
64
|
+
{...focusProps}
|
|
65
|
+
title={accessibleTitle ?? title}
|
|
66
|
+
description={description}
|
|
67
|
+
closeOnEscape={loading ? false : closeOnEscape}
|
|
68
|
+
closeOnOverlayClick={loading ? false : closeOnOverlayClick}
|
|
69
|
+
onPointerDownOutside={(event) => {
|
|
70
|
+
if (event.target instanceof Element && event.target.closest('[data-slot="toaster"]')) {
|
|
71
|
+
event.preventDefault();
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
onPointerDownOutside?.(event);
|
|
75
|
+
}}
|
|
76
|
+
size={presentation === 'workspace' ? 'full' : undefined}
|
|
77
|
+
className={`flex max-h-[calc(100dvh-1rem)] w-[calc(100vw-1rem)] flex-col overflow-hidden sm:max-h-[calc(100dvh-2rem)] sm:w-[calc(100vw-2rem)] ${
|
|
78
|
+
sidebar ? 'md:grid md:grid-cols-[14rem_minmax(0,1fr)] md:grid-rows-[auto_minmax(0,1fr)]' : ''
|
|
79
|
+
} ${
|
|
80
|
+
presentation === 'workspace'
|
|
81
|
+
? 'h-[calc(100dvh-1rem)] max-w-6xl sm:h-[calc(100dvh-2rem)] sm:max-w-6xl'
|
|
82
|
+
: presentation === 'paned'
|
|
83
|
+
? // Paned dialogs keep one height across panes; the body scrolls instead of the dialog resizing.
|
|
84
|
+
'h-[calc(100dvh-1rem)] max-w-4xl sm:h-[min(44rem,calc(100dvh-2rem))] sm:max-w-4xl'
|
|
85
|
+
: 'max-w-160 sm:max-w-160'
|
|
86
|
+
}`}
|
|
87
|
+
>
|
|
88
|
+
<header
|
|
89
|
+
data-slot="modal-header"
|
|
90
|
+
className={`@container min-w-0 shrink-0 px-5 pt-5 sm:px-6 sm:pt-6 ${
|
|
91
|
+
description ? (sidebar ? 'pb-4 md:pb-0' : '') : 'pb-4'
|
|
92
|
+
} ${sidebar ? 'md:col-start-2 md:row-start-1' : ''}`}
|
|
93
|
+
>
|
|
94
|
+
<div className="flex min-w-0 flex-wrap items-center justify-between gap-x-4 gap-y-3">
|
|
95
|
+
<Heading as="h2" className="min-w-0 flex-1 wrap-break-word" variant="section">
|
|
96
|
+
{title}
|
|
97
|
+
</Heading>
|
|
98
|
+
{headerActions ? (
|
|
99
|
+
<div className="order-3 flex basis-full items-center justify-end gap-2 @min-[32rem]:order-0 @min-[32rem]:ml-auto @min-[32rem]:basis-auto">
|
|
100
|
+
{headerActions}
|
|
101
|
+
</div>
|
|
102
|
+
) : null}
|
|
103
|
+
<div className="shrink-0">
|
|
104
|
+
<ModalClose />
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
</header>
|
|
108
|
+
{sidebar ? (
|
|
109
|
+
<div className="min-h-0 min-w-0 shrink-0 md:col-start-1 md:row-span-2 md:row-start-1">
|
|
110
|
+
{sidebar}
|
|
111
|
+
</div>
|
|
112
|
+
) : null}
|
|
113
|
+
<div
|
|
114
|
+
className={`flex min-h-0 min-w-0 flex-1 flex-col ${sidebar ? 'md:col-start-2 md:row-start-2' : ''}`}
|
|
115
|
+
>
|
|
116
|
+
{description ? (
|
|
117
|
+
<Text
|
|
118
|
+
className={`shrink-0 px-5 pb-4 sm:px-6 ${sidebar ? 'pt-4 md:pt-2' : 'pt-2'}`}
|
|
119
|
+
tone="muted"
|
|
120
|
+
>
|
|
121
|
+
{description}
|
|
122
|
+
</Text>
|
|
123
|
+
) : null}
|
|
124
|
+
{children}
|
|
125
|
+
</div>
|
|
126
|
+
</NinnaModal.Content>
|
|
127
|
+
);
|
|
128
|
+
},
|
|
129
|
+
);
|
|
130
|
+
|
|
131
|
+
ModalContent.displayName = 'Modal.Content';
|
|
132
|
+
|
|
133
|
+
const ModalBody = forwardRef<HTMLDivElement, Omit<ModalBodyProps, 'className'> & { layout?: 'scroll' | 'fill' }>(
|
|
134
|
+
({ layout = 'scroll', children, ...props }, ref: Ref<HTMLDivElement>) => {
|
|
135
|
+
const { setViewport, setContent, className } = useScrollFade();
|
|
136
|
+
const bodyRef = useCallback(
|
|
137
|
+
(element: HTMLDivElement) => {
|
|
138
|
+
setViewport(element);
|
|
139
|
+
|
|
140
|
+
const cleanup = typeof ref === 'function' ? ref(element) : undefined;
|
|
141
|
+
|
|
142
|
+
if (ref && typeof ref !== 'function') ref.current = element;
|
|
143
|
+
|
|
144
|
+
return () => {
|
|
145
|
+
setViewport(null);
|
|
146
|
+
|
|
147
|
+
if (typeof cleanup === 'function') cleanup();
|
|
148
|
+
else if (typeof ref === 'function') ref(null);
|
|
149
|
+
else if (ref) ref.current = null;
|
|
150
|
+
};
|
|
151
|
+
},
|
|
152
|
+
[ref, setViewport],
|
|
153
|
+
);
|
|
154
|
+
|
|
155
|
+
return (
|
|
156
|
+
<NinnaModal.Body
|
|
157
|
+
ref={bodyRef}
|
|
158
|
+
{...props}
|
|
159
|
+
className={`min-h-0 flex-1 overflow-y-auto overscroll-contain px-5 pt-2 pb-6 sm:px-6 ${layout === 'fill' ? 'flex flex-col' : ''} ${className}`}
|
|
160
|
+
>
|
|
161
|
+
<div
|
|
162
|
+
ref={setContent}
|
|
163
|
+
className={layout === 'fill' ? 'flex min-h-0 flex-1 flex-col gap-3' : 'flow-root'}
|
|
164
|
+
>
|
|
165
|
+
{children}
|
|
166
|
+
</div>
|
|
167
|
+
</NinnaModal.Body>
|
|
168
|
+
);
|
|
169
|
+
},
|
|
170
|
+
);
|
|
171
|
+
|
|
172
|
+
ModalBody.displayName = 'Modal.Body';
|
|
173
|
+
|
|
174
|
+
function ModalForm(props: Omit<ComponentProps<'form'>, 'className'>) {
|
|
175
|
+
return <form {...props} className="flex min-h-0 flex-1 flex-col" />;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
function ModalPane({ active, children }: { active: boolean; children: ReactNode }) {
|
|
179
|
+
return (
|
|
180
|
+
<div hidden={!active} className={active ? 'flex min-h-0 flex-1 flex-col' : 'hidden'}>
|
|
181
|
+
{children}
|
|
182
|
+
</div>
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
const ModalFooter = forwardRef<HTMLDivElement, Omit<ModalFooterProps, 'className'> & { leading?: ReactNode }>(
|
|
187
|
+
({ leading, children, ...props }, ref) => (
|
|
188
|
+
<NinnaModal.Footer
|
|
189
|
+
ref={ref}
|
|
190
|
+
{...props}
|
|
191
|
+
className="border-base-300 bg-base-50/60 shrink-0 border-t px-5 py-4 sm:px-6 sm:pb-4"
|
|
192
|
+
>
|
|
193
|
+
{leading ? <div className="mr-auto min-w-0 basis-full pb-2 sm:basis-auto sm:pb-0">{leading}</div> : null}
|
|
194
|
+
{children}
|
|
195
|
+
</NinnaModal.Footer>
|
|
196
|
+
),
|
|
197
|
+
);
|
|
198
|
+
|
|
199
|
+
ModalFooter.displayName = 'Modal.Footer';
|
|
200
|
+
|
|
201
|
+
function ModalClose() {
|
|
202
|
+
const labels = useDesignSystemLabels();
|
|
203
|
+
const loading = useContext(ModalLoadingContext);
|
|
204
|
+
|
|
205
|
+
return (
|
|
206
|
+
<NinnaModal.Close asChild>
|
|
207
|
+
<IconButton aria-label={labels.close} disabled={loading} icon={<XIcon />} variant="header" />
|
|
208
|
+
</NinnaModal.Close>
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
interface ModalRootPolicyProps {
|
|
213
|
+
children: ReactNode;
|
|
214
|
+
loading?: boolean;
|
|
215
|
+
onClose: () => void;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
function ModalRoot({ children, loading = false, onClose }: ModalRootPolicyProps) {
|
|
219
|
+
return (
|
|
220
|
+
<ModalLoadingContext.Provider value={loading}>
|
|
221
|
+
<NinnaModal open onOpenChange={(open) => !open && !loading && onClose()}>
|
|
222
|
+
{children}
|
|
223
|
+
</NinnaModal>
|
|
224
|
+
</ModalLoadingContext.Provider>
|
|
225
|
+
);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
export const Modal = Object.assign(ModalRoot, {
|
|
229
|
+
Body: ModalBody,
|
|
230
|
+
Form: ModalForm,
|
|
231
|
+
Pane: ModalPane,
|
|
232
|
+
Content: ModalContent,
|
|
233
|
+
Footer: ModalFooter,
|
|
234
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/* oxlint-disable react/only-export-components -- Compound members are exported through Popover. */
|
|
2
|
+
|
|
3
|
+
import { Popover as NinnaPopover, type PopoverContentProps } from '@ninna-ui/overlays';
|
|
4
|
+
import { type ComponentProps, forwardRef } from 'react';
|
|
5
|
+
|
|
6
|
+
interface PopoverContentPolicyProps extends Omit<PopoverContentProps, 'className'> {
|
|
7
|
+
layout?: 'fill' | 'scroll';
|
|
8
|
+
onOpenAutoFocus?: (event: Event) => void;
|
|
9
|
+
onCloseAutoFocus?: (event: Event) => void;
|
|
10
|
+
presentation?: 'default' | 'menu';
|
|
11
|
+
width?: 'content' | 'sm' | 'trigger';
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const popoverWidthClasses: Record<NonNullable<PopoverContentPolicyProps['width']>, string | undefined> = {
|
|
15
|
+
content: undefined,
|
|
16
|
+
sm: 'w-64',
|
|
17
|
+
trigger: 'w-(--radix-popover-trigger-width)',
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const PopoverContent = forwardRef<HTMLDivElement, PopoverContentPolicyProps>(
|
|
21
|
+
({ layout = 'scroll', presentation = 'default', width = 'content', ...props }, ref) => (
|
|
22
|
+
<NinnaPopover.Content
|
|
23
|
+
ref={ref}
|
|
24
|
+
{...props}
|
|
25
|
+
data-layout={layout}
|
|
26
|
+
className={`${popoverWidthClasses[width] ?? ''} ${presentation === 'menu' ? 'p-1' : ''}`}
|
|
27
|
+
/>
|
|
28
|
+
),
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
PopoverContent.displayName = 'Popover.Content';
|
|
32
|
+
|
|
33
|
+
function PopoverRoot(props: ComponentProps<typeof NinnaPopover>) {
|
|
34
|
+
return <NinnaPopover {...props} />;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const Popover = Object.assign(PopoverRoot, {
|
|
38
|
+
...NinnaPopover,
|
|
39
|
+
Content: PopoverContent,
|
|
40
|
+
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Tooltip as NinnaTooltip, type TooltipContentProps, type TooltipTriggerProps } from '@ninna-ui/overlays';
|
|
2
|
+
import { Slot, TooltipEngine } from '@ninna-ui/react-internal';
|
|
3
|
+
import { type ComponentProps, forwardRef, isValidElement } from 'react';
|
|
4
|
+
|
|
5
|
+
/** Shares one open delay across the tooltips inside it. */
|
|
6
|
+
export function TooltipProvider(props: ComponentProps<typeof TooltipEngine.Provider>) {
|
|
7
|
+
return <TooltipEngine.Provider {...props} />;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function Tooltip({ disabled, ...props }: ComponentProps<typeof TooltipEngine.Root> & { disabled?: boolean }) {
|
|
11
|
+
return <TooltipEngine.Root {...props} open={disabled ? false : props.open} />;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const TooltipTrigger = forwardRef<HTMLButtonElement, TooltipTriggerProps>(
|
|
15
|
+
({ asChild, children, ...props }, ref) => {
|
|
16
|
+
const childProps = asChild && isValidElement<TooltipTriggerProps>(children) ? children.props : undefined;
|
|
17
|
+
|
|
18
|
+
if (props.disabled || childProps?.disabled) {
|
|
19
|
+
const Trigger = asChild ? Slot : 'button';
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<NinnaTooltip.Trigger asChild>
|
|
23
|
+
<span
|
|
24
|
+
tabIndex={0}
|
|
25
|
+
role="button"
|
|
26
|
+
aria-disabled="true"
|
|
27
|
+
aria-label={props['aria-label'] ?? childProps?.['aria-label']}
|
|
28
|
+
aria-labelledby={props['aria-labelledby'] ?? childProps?.['aria-labelledby']}
|
|
29
|
+
className="inline-flex [&>*]:pointer-events-none"
|
|
30
|
+
>
|
|
31
|
+
<Trigger type="button" {...props} ref={ref}>
|
|
32
|
+
{children}
|
|
33
|
+
</Trigger>
|
|
34
|
+
</span>
|
|
35
|
+
</NinnaTooltip.Trigger>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<NinnaTooltip.Trigger {...props} ref={ref} asChild={asChild}>
|
|
41
|
+
{children}
|
|
42
|
+
</NinnaTooltip.Trigger>
|
|
43
|
+
);
|
|
44
|
+
},
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
TooltipTrigger.displayName = 'TooltipTrigger';
|
|
48
|
+
|
|
49
|
+
export const TooltipPopup = forwardRef<HTMLDivElement, Omit<TooltipContentProps, 'color' | 'hasArrow'>>(
|
|
50
|
+
(props, ref) => (
|
|
51
|
+
// Radix supplies the tooltip role on its visually hidden accessible description.
|
|
52
|
+
<NinnaTooltip.Content {...props} ref={ref} role={undefined} />
|
|
53
|
+
),
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
TooltipPopup.displayName = 'TooltipPopup';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { ActionModal } from './ActionModal';
|
|
2
|
+
export { CommandPalette, CommandPaletteGroup, useCommandPaletteOption } from './CommandPalette';
|
|
3
|
+
export { Drawer } from './Drawer';
|
|
4
|
+
export { DropdownMenu } from './DropdownMenu';
|
|
5
|
+
export { ImageViewer } from './ImageViewer';
|
|
6
|
+
export { Modal } from './Modal';
|
|
7
|
+
export { Popover } from './Popover';
|
|
8
|
+
export { Tooltip, TooltipPopup, TooltipProvider, TooltipTrigger } from './Tooltip';
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
|
+
|
|
3
|
+
/** Focuses a dialog's first editable field when it opens, or once one appears, unless `focusFirstField` is
|
|
4
|
+
* false, such as while the caller focuses something else; turning it off stops a pending wait. */
|
|
5
|
+
export function useModalAutoFocus(focusFirstField = true) {
|
|
6
|
+
const cleanup = useRef<(() => void) | undefined>(undefined);
|
|
7
|
+
const returnFocus = useRef<HTMLElement | null>(null);
|
|
8
|
+
|
|
9
|
+
useEffect(() => () => cleanup.current?.(), []);
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
if (!focusFirstField) cleanup.current?.();
|
|
12
|
+
}, [focusFirstField]);
|
|
13
|
+
|
|
14
|
+
const onOpenAutoFocus = (event: Event) => {
|
|
15
|
+
cleanup.current?.();
|
|
16
|
+
|
|
17
|
+
const dialog = event.target;
|
|
18
|
+
|
|
19
|
+
if (!(dialog instanceof HTMLElement)) return;
|
|
20
|
+
|
|
21
|
+
returnFocus.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
22
|
+
|
|
23
|
+
if (!focusFirstField) return;
|
|
24
|
+
|
|
25
|
+
if (focusFirstEditable(dialog)) {
|
|
26
|
+
event.preventDefault();
|
|
27
|
+
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const observer = new MutationObserver(() => {
|
|
32
|
+
if (focusFirstEditable(dialog)) stop();
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const stop = () => {
|
|
36
|
+
observer.disconnect();
|
|
37
|
+
dialog.removeEventListener('pointerdown', stop, true);
|
|
38
|
+
dialog.removeEventListener('keydown', stop, true);
|
|
39
|
+
cleanup.current = undefined;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
cleanup.current = stop;
|
|
43
|
+
observer.observe(dialog, {
|
|
44
|
+
childList: true,
|
|
45
|
+
subtree: true,
|
|
46
|
+
attributes: true,
|
|
47
|
+
attributeFilter: [
|
|
48
|
+
'disabled',
|
|
49
|
+
'readonly',
|
|
50
|
+
'hidden',
|
|
51
|
+
'inert',
|
|
52
|
+
'class',
|
|
53
|
+
'style',
|
|
54
|
+
'aria-disabled',
|
|
55
|
+
'aria-readonly',
|
|
56
|
+
'aria-hidden',
|
|
57
|
+
],
|
|
58
|
+
});
|
|
59
|
+
dialog.addEventListener('pointerdown', stop, true);
|
|
60
|
+
dialog.addEventListener('keydown', stop, true);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const onCloseAutoFocus = (event: Event) => {
|
|
64
|
+
cleanup.current?.();
|
|
65
|
+
|
|
66
|
+
if (returnFocus.current?.isConnected) {
|
|
67
|
+
event.preventDefault();
|
|
68
|
+
returnFocus.current.focus({ preventScroll: true });
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
return { onOpenAutoFocus, onCloseAutoFocus };
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function focusFirstEditable(dialog: HTMLElement): boolean {
|
|
76
|
+
const candidates = dialog.querySelectorAll<HTMLElement>(
|
|
77
|
+
'input, textarea, select, [role="combobox"], [role="switch"], [role="checkbox"], [role="radio"], [contenteditable="true"], [data-slot="field"] button[aria-haspopup="dialog"]',
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
for (const field of candidates) {
|
|
81
|
+
if (
|
|
82
|
+
field.tabIndex < 0 ||
|
|
83
|
+
field.matches(
|
|
84
|
+
':disabled, [readonly], [aria-disabled="true"], [aria-readonly="true"], input[type="hidden"], input[type="button"], input[type="submit"], input[type="reset"], input[type="image"]',
|
|
85
|
+
) ||
|
|
86
|
+
field.closest('[hidden], [inert], [aria-hidden="true"], details:not([open])') ||
|
|
87
|
+
field.closest('[role="dialog"]') !== dialog ||
|
|
88
|
+
!isVisible(field, dialog)
|
|
89
|
+
)
|
|
90
|
+
continue;
|
|
91
|
+
|
|
92
|
+
field.focus({ preventScroll: true });
|
|
93
|
+
|
|
94
|
+
if (document.activeElement !== field) continue;
|
|
95
|
+
|
|
96
|
+
if (
|
|
97
|
+
field instanceof HTMLTextAreaElement ||
|
|
98
|
+
(field instanceof HTMLInputElement && field.selectionStart !== null)
|
|
99
|
+
) {
|
|
100
|
+
field.select();
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return true;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function isVisible(field: HTMLElement, dialog: HTMLElement): boolean {
|
|
110
|
+
if (getComputedStyle(field).visibility !== 'visible') return false;
|
|
111
|
+
|
|
112
|
+
for (let element: HTMLElement | null = field; element; element = element.parentElement) {
|
|
113
|
+
if (getComputedStyle(element).display === 'none') return false;
|
|
114
|
+
|
|
115
|
+
if (element === dialog) return true;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { useLayoutEffect, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
/** Attach to the scroll owner and its content so async content and viewport changes update the mask. */
|
|
4
|
+
export function useScrollFade() {
|
|
5
|
+
const [viewport, setViewport] = useState<HTMLDivElement | null>(null);
|
|
6
|
+
const [content, setContent] = useState<HTMLDivElement | null>(null);
|
|
7
|
+
|
|
8
|
+
useLayoutEffect(() => {
|
|
9
|
+
if (!viewport || !content) return;
|
|
10
|
+
|
|
11
|
+
const measure = () => {
|
|
12
|
+
const { scrollTop, scrollHeight, clientHeight } = viewport;
|
|
13
|
+
|
|
14
|
+
viewport.style.setProperty('--scroll-fade-top', `${Math.max(0, scrollTop)}px`);
|
|
15
|
+
viewport.style.setProperty(
|
|
16
|
+
'--scroll-fade-bottom',
|
|
17
|
+
`${Math.max(0, scrollHeight - clientHeight - scrollTop)}px`,
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
const observer = new ResizeObserver(measure);
|
|
21
|
+
|
|
22
|
+
const observeContent = () => {
|
|
23
|
+
observer.disconnect();
|
|
24
|
+
observer.observe(viewport);
|
|
25
|
+
observer.observe(content);
|
|
26
|
+
// Fill layouts can keep ancestors fixed while descendants change the scroll extent.
|
|
27
|
+
content.querySelectorAll('*').forEach((element) => observer.observe(element));
|
|
28
|
+
measure();
|
|
29
|
+
};
|
|
30
|
+
const mutations = new MutationObserver(observeContent);
|
|
31
|
+
|
|
32
|
+
mutations.observe(content, { childList: true, subtree: true });
|
|
33
|
+
viewport.addEventListener('scroll', measure, { passive: true });
|
|
34
|
+
observeContent();
|
|
35
|
+
|
|
36
|
+
return () => {
|
|
37
|
+
mutations.disconnect();
|
|
38
|
+
observer.disconnect();
|
|
39
|
+
viewport.removeEventListener('scroll', measure);
|
|
40
|
+
};
|
|
41
|
+
}, [viewport, content]);
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
setViewport,
|
|
45
|
+
setContent,
|
|
46
|
+
className:
|
|
47
|
+
'[mask-image:linear-gradient(to_bottom,transparent,black_min(1.5rem,var(--scroll-fade-top,0px)),black_calc(100%_-_min(1.5rem,var(--scroll-fade-bottom,0px))),transparent)] focus-visible:[mask-image:none] has-[:focus-visible]:[mask-image:none]',
|
|
48
|
+
};
|
|
49
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
import { Heading, Text } from '../typography/Typography';
|
|
4
|
+
|
|
5
|
+
const MARK_L = 'M0 0H27.52V72.48H100V100H3a3 3 0 0 1-3-3z';
|
|
6
|
+
const MARK_S =
|
|
7
|
+
'M50.68 0H91.97a8.03 8.03 0 0 1 8.03 8.03V49.32a8.03 8.03 0 0 1-8.03 8.03H50.68a8.03 8.03 0 0 1-8.03-8.03V8.03a8.03 8.03 0 0 1 8.03-8.03z';
|
|
8
|
+
|
|
9
|
+
interface CallToActionProps {
|
|
10
|
+
title: ReactNode;
|
|
11
|
+
lead: ReactNode;
|
|
12
|
+
actions: ReactNode;
|
|
13
|
+
note?: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** The closing panel of a page: the Lar mark drawn large and faint behind one last invitation. */
|
|
17
|
+
export function CallToAction({ title, lead, actions, note }: CallToActionProps) {
|
|
18
|
+
return (
|
|
19
|
+
<div className="border-base-300 bg-base-100 dark:bg-base-100/70 relative isolate overflow-hidden rounded-[1.75rem] border px-6 py-16 text-center sm:px-12 sm:py-20">
|
|
20
|
+
<div
|
|
21
|
+
aria-hidden="true"
|
|
22
|
+
className="absolute inset-0 -z-10 bg-[radial-gradient(60%_80%_at_50%_0%,var(--lar-glow),transparent_70%)]"
|
|
23
|
+
/>
|
|
24
|
+
<div className="mx-auto flex max-w-[640px] flex-col items-center gap-5">
|
|
25
|
+
<svg aria-hidden="true" viewBox="0 0 100 100" className="mb-1 size-9 text-(--color-brand-ink)">
|
|
26
|
+
<path d={MARK_L} fill="currentColor" />
|
|
27
|
+
<path d={MARK_S} fill="#355292" />
|
|
28
|
+
</svg>
|
|
29
|
+
<Heading as="h2" variant="headline">
|
|
30
|
+
{title}
|
|
31
|
+
</Heading>
|
|
32
|
+
<Text variant="lead" tone="muted">
|
|
33
|
+
{lead}
|
|
34
|
+
</Text>
|
|
35
|
+
<div className="mt-3 flex w-full flex-col items-center justify-center gap-3 sm:w-auto sm:flex-row sm:flex-wrap max-sm:[&>a]:w-full max-sm:[&>a]:max-w-[320px]">
|
|
36
|
+
{actions}
|
|
37
|
+
</div>
|
|
38
|
+
{note ? (
|
|
39
|
+
<Text variant="caption" tone="muted" className="text-balance dark:text-[#96969f]">
|
|
40
|
+
{note}
|
|
41
|
+
</Text>
|
|
42
|
+
) : null}
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
);
|
|
46
|
+
}
|