@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,70 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
import { Inline, Stack } from '../layout/Flow';
|
|
4
|
+
import { Text } from '../typography/Typography';
|
|
5
|
+
import { StatusIndicator, type StatusTone } from './StatusIndicator';
|
|
6
|
+
|
|
7
|
+
interface StatusRowProps {
|
|
8
|
+
loading?: boolean;
|
|
9
|
+
compact?: boolean;
|
|
10
|
+
detail?: string;
|
|
11
|
+
indicator?: ReactNode;
|
|
12
|
+
label: string;
|
|
13
|
+
tone: StatusTone;
|
|
14
|
+
trailing?: ReactNode;
|
|
15
|
+
value?: string;
|
|
16
|
+
secondaryDetail?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function StatusRow({
|
|
20
|
+
compact = false,
|
|
21
|
+
loading = false,
|
|
22
|
+
detail,
|
|
23
|
+
indicator,
|
|
24
|
+
label,
|
|
25
|
+
tone,
|
|
26
|
+
trailing,
|
|
27
|
+
value,
|
|
28
|
+
secondaryDetail,
|
|
29
|
+
}: StatusRowProps) {
|
|
30
|
+
return (
|
|
31
|
+
<Inline align="center" justify="between" space="section" className="min-w-0 rounded-lg px-2 py-2">
|
|
32
|
+
<Inline align="center" space="related" className="min-w-0 flex-1">
|
|
33
|
+
{indicator || compact ? (
|
|
34
|
+
<span
|
|
35
|
+
className={`flex shrink-0 items-center justify-center [&>[data-slot=skeleton]]:size-full ${compact ? 'size-5' : 'size-8'}`}
|
|
36
|
+
>
|
|
37
|
+
{indicator ?? <StatusIndicator tone={tone} />}
|
|
38
|
+
</span>
|
|
39
|
+
) : (
|
|
40
|
+
<StatusIndicator tone={tone} />
|
|
41
|
+
)}
|
|
42
|
+
<Stack space="none" className="min-w-0 flex-1">
|
|
43
|
+
<Text as="span" variant={compact ? 'caption' : 'body'} truncate title={label} loading={loading}>
|
|
44
|
+
{label}
|
|
45
|
+
</Text>
|
|
46
|
+
{detail ? (
|
|
47
|
+
<Text as="span" title={detail} variant="caption" tone="muted" loading={loading}>
|
|
48
|
+
{detail}
|
|
49
|
+
</Text>
|
|
50
|
+
) : null}
|
|
51
|
+
{secondaryDetail !== undefined ? (
|
|
52
|
+
<Text as="span" title={secondaryDetail} variant="caption" tone="muted" loading={loading}>
|
|
53
|
+
{secondaryDetail || '\u00a0'}
|
|
54
|
+
</Text>
|
|
55
|
+
) : null}
|
|
56
|
+
</Stack>
|
|
57
|
+
</Inline>
|
|
58
|
+
{trailing ?? (
|
|
59
|
+
<Text
|
|
60
|
+
as="span"
|
|
61
|
+
variant={compact ? 'caption' : 'body'}
|
|
62
|
+
tone="muted"
|
|
63
|
+
className={compact ? 'w-20 shrink-0 text-end' : undefined}
|
|
64
|
+
>
|
|
65
|
+
{value}
|
|
66
|
+
</Text>
|
|
67
|
+
)}
|
|
68
|
+
</Inline>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { Alert } from './Alert';
|
|
2
|
+
export { AsyncState } from './AsyncState';
|
|
3
|
+
export {
|
|
4
|
+
dismissAllNotifications,
|
|
5
|
+
type ErrorNotification,
|
|
6
|
+
showErrorNotification,
|
|
7
|
+
showSuccessNotification,
|
|
8
|
+
} from './ErrorNotification';
|
|
9
|
+
export { Notifications } from './Notifications';
|
|
10
|
+
export { ProgressStatusRow } from './ProgressStatusRow';
|
|
11
|
+
export { SkeletonLoader } from './SkeletonLoader';
|
|
12
|
+
export { StatusIndicator, type StatusTone } from './StatusIndicator';
|
|
13
|
+
export { StatusPopoverContent } from './StatusPopoverContent';
|
|
14
|
+
export { StatusRow } from './StatusRow';
|
|
15
|
+
export { Loading } from '@ninna-ui/feedback';
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { CheckIcon } from 'lucide-react';
|
|
2
|
+
import { forwardRef, type InputHTMLAttributes, useImperativeHandle, useLayoutEffect, useRef } from 'react';
|
|
3
|
+
|
|
4
|
+
import { tabbable } from '../foundations/KeyboardFocus';
|
|
5
|
+
import { formChoiceClasses } from './FormControlStyles';
|
|
6
|
+
|
|
7
|
+
export type CheckboxProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> & {
|
|
8
|
+
label?: string;
|
|
9
|
+
indeterminate?: boolean;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(
|
|
13
|
+
({ label, indeterminate = false, 'aria-checked': ariaChecked, className, onChange, ...props }, ref) => {
|
|
14
|
+
const inputRef = useRef<HTMLInputElement>(null);
|
|
15
|
+
|
|
16
|
+
useImperativeHandle(ref, () => inputRef.current!);
|
|
17
|
+
useLayoutEffect(() => {
|
|
18
|
+
if (inputRef.current) inputRef.current.indeterminate = indeterminate;
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const control = (
|
|
22
|
+
<span className="relative inline-flex size-4 shrink-0 align-middle">
|
|
23
|
+
<input
|
|
24
|
+
{...tabbable}
|
|
25
|
+
{...props}
|
|
26
|
+
ref={inputRef}
|
|
27
|
+
type="checkbox"
|
|
28
|
+
onChange={(event) => {
|
|
29
|
+
onChange?.(event);
|
|
30
|
+
event.currentTarget.indeterminate = indeterminate;
|
|
31
|
+
}}
|
|
32
|
+
aria-checked={indeterminate ? 'mixed' : ariaChecked}
|
|
33
|
+
className={`peer m-0 size-4 shrink-0 cursor-pointer appearance-none rounded-sm ${formChoiceClasses} checked:border-primary checked:bg-primary indeterminate:border-primary indeterminate:bg-primary dark:checked:border-primary dark:checked:bg-primary dark:indeterminate:border-primary dark:indeterminate:bg-primary forced-colors:appearance-auto ${className ?? ''}`}
|
|
34
|
+
/>
|
|
35
|
+
<span
|
|
36
|
+
aria-hidden="true"
|
|
37
|
+
className="text-primary-content pointer-events-none absolute inset-0 hidden peer-checked:block peer-indeterminate:hidden peer-disabled:opacity-50 forced-colors:hidden"
|
|
38
|
+
>
|
|
39
|
+
<CheckIcon />
|
|
40
|
+
</span>
|
|
41
|
+
<span
|
|
42
|
+
aria-hidden="true"
|
|
43
|
+
className="pointer-events-none absolute inset-0 hidden items-center justify-center peer-indeterminate:flex peer-disabled:opacity-50 forced-colors:hidden"
|
|
44
|
+
>
|
|
45
|
+
<span className="bg-primary-content h-0.5 w-2 rounded-full" />
|
|
46
|
+
</span>
|
|
47
|
+
</span>
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
return label === undefined ? (
|
|
51
|
+
control
|
|
52
|
+
) : (
|
|
53
|
+
<label className="text-base-content has-disabled:text-base-700 inline-flex cursor-pointer items-center gap-2 text-sm has-disabled:cursor-default">
|
|
54
|
+
{control}
|
|
55
|
+
<span>{label}</span>
|
|
56
|
+
</label>
|
|
57
|
+
);
|
|
58
|
+
},
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
Checkbox.displayName = 'Checkbox';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Field as NinnaField, type FieldProps as NinnaFieldProps } from '@ninna-ui/forms';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
|
|
4
|
+
import { formControlDefaults } from './FormControlStyles';
|
|
5
|
+
|
|
6
|
+
export type FieldProps = Omit<NinnaFieldProps, 'size'>;
|
|
7
|
+
|
|
8
|
+
export const Field = forwardRef<HTMLDivElement, FieldProps>(({ className, ...props }, ref) => (
|
|
9
|
+
<NinnaField
|
|
10
|
+
ref={ref}
|
|
11
|
+
{...props}
|
|
12
|
+
size={formControlDefaults.size}
|
|
13
|
+
className={`[&>div:first-child>label>span]:text-base-500 [&>p]:text-xs ${className ?? ''}`}
|
|
14
|
+
/>
|
|
15
|
+
));
|
|
16
|
+
|
|
17
|
+
Field.displayName = 'Field';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const formControlDefaults = { size: 'sm', variant: 'filled', color: 'primary' } as const;
|
|
2
|
+
|
|
3
|
+
export const formControlBorderClasses = 'border border-base-400/80 dark:border-base-400';
|
|
4
|
+
|
|
5
|
+
export const formChoiceClasses = `${formControlBorderClasses} bg-base-100 shadow-xs/5 focus-visible:border-primary focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-primary/20 disabled:cursor-default disabled:opacity-50 dark:bg-base-400/30`;
|
|
6
|
+
|
|
7
|
+
/** T3 Code's input: an 8px-radius field on the card surface with a hairline input border, a faint shadow and a
|
|
8
|
+
* 3px primary ring while focused. */
|
|
9
|
+
export const formControlClasses = `min-w-0 rounded-md ${formControlBorderClasses} bg-base-100 text-base-content shadow-xs/5 placeholder:text-base-700 data-placeholder:text-base-700 focus:border-primary focus:bg-base-100 focus:ring-[3px] focus:ring-primary/20 dark:bg-base-400/30 dark:focus:bg-base-400/30 data-invalid:border-danger/60 data-invalid:bg-base-100 aria-invalid:border-danger/60 aria-invalid:bg-base-100 data-invalid:focus:ring-danger/16 aria-invalid:focus:ring-danger/16`;
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { ChevronDownIcon } from 'lucide-react';
|
|
2
|
+
import { type ReactNode, useId, useState } from 'react';
|
|
3
|
+
|
|
4
|
+
import { Button, type ButtonProps } from '../actions/Button';
|
|
5
|
+
import { InsetPanel } from '../display/InsetPanel';
|
|
6
|
+
import { SkeletonLoader } from '../feedback/SkeletonLoader';
|
|
7
|
+
import { Stack } from '../layout/Flow';
|
|
8
|
+
import { Heading, Text } from '../typography/Typography';
|
|
9
|
+
import { Field, type FieldProps } from './Field';
|
|
10
|
+
|
|
11
|
+
const contentSpacing = 'px-4 py-3.5 sm:px-5';
|
|
12
|
+
const rowClasses = `grid min-w-0 gap-x-6 gap-y-3 sm:items-center ${contentSpacing}`;
|
|
13
|
+
|
|
14
|
+
export function FormContent({ children }: { children: ReactNode }) {
|
|
15
|
+
return (
|
|
16
|
+
<Stack space="group" className={contentSpacing}>
|
|
17
|
+
{children}
|
|
18
|
+
</Stack>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function FormStack({ children }: { children: ReactNode }) {
|
|
23
|
+
return <Stack space="page">{children}</Stack>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface FormSectionProps {
|
|
27
|
+
action?: ReactNode;
|
|
28
|
+
badges?: ReactNode;
|
|
29
|
+
children: ReactNode;
|
|
30
|
+
description?: string;
|
|
31
|
+
loading?: boolean;
|
|
32
|
+
loadingLabel?: string;
|
|
33
|
+
title: ReactNode;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function FormSection({
|
|
37
|
+
action,
|
|
38
|
+
badges,
|
|
39
|
+
children,
|
|
40
|
+
description,
|
|
41
|
+
loading = false,
|
|
42
|
+
loadingLabel,
|
|
43
|
+
title,
|
|
44
|
+
}: FormSectionProps) {
|
|
45
|
+
const titleId = useId();
|
|
46
|
+
const content = (
|
|
47
|
+
<section aria-labelledby={titleId}>
|
|
48
|
+
<div className="flex min-h-5 items-center justify-between gap-3">
|
|
49
|
+
<div className="flex min-w-0 flex-wrap items-center gap-2">
|
|
50
|
+
<Heading id={titleId} as="h3" className="text-base-700" variant="label">
|
|
51
|
+
{title}
|
|
52
|
+
</Heading>
|
|
53
|
+
{badges}
|
|
54
|
+
</div>
|
|
55
|
+
{action}
|
|
56
|
+
</div>
|
|
57
|
+
<div className="mt-3">
|
|
58
|
+
<InsetPanel presentation="settings">
|
|
59
|
+
{description ? (
|
|
60
|
+
<FormContent>
|
|
61
|
+
<Text variant="caption" tone="muted">
|
|
62
|
+
{description}
|
|
63
|
+
</Text>
|
|
64
|
+
</FormContent>
|
|
65
|
+
) : null}
|
|
66
|
+
{children}
|
|
67
|
+
</InsetPanel>
|
|
68
|
+
</div>
|
|
69
|
+
</section>
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
return loading ? (
|
|
73
|
+
<SkeletonLoader label={loadingLabel ?? (typeof title === 'string' ? title : '')}>{content}</SkeletonLoader>
|
|
74
|
+
) : (
|
|
75
|
+
content
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
interface FormRowProps {
|
|
80
|
+
badges?: ReactNode;
|
|
81
|
+
children: ReactNode;
|
|
82
|
+
description: string;
|
|
83
|
+
/** The row's element id, for linking or scrolling to it; a row with one can take focus when it is opened. */
|
|
84
|
+
id?: string;
|
|
85
|
+
label: ReactNode;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export function FormRow({ badges, children, description, id, label }: FormRowProps) {
|
|
89
|
+
return (
|
|
90
|
+
<div
|
|
91
|
+
id={id}
|
|
92
|
+
tabIndex={id ? -1 : undefined}
|
|
93
|
+
className={`${rowClasses} sm:grid-cols-[minmax(0,1fr)_13rem] sm:has-[[role=switch]]:grid-cols-[minmax(0,1fr)_auto]`}
|
|
94
|
+
>
|
|
95
|
+
<Stack space="tight" className="min-w-0">
|
|
96
|
+
<div className="flex flex-wrap items-center gap-x-2 gap-y-1.5">
|
|
97
|
+
<Text as="span" variant="label">
|
|
98
|
+
{label}
|
|
99
|
+
</Text>
|
|
100
|
+
{badges}
|
|
101
|
+
</div>
|
|
102
|
+
<Text variant="caption" tone="muted">
|
|
103
|
+
{description}
|
|
104
|
+
</Text>
|
|
105
|
+
</Stack>
|
|
106
|
+
<div className="min-w-0 sm:flex sm:justify-end [&>[role=status]]:w-full">{children}</div>
|
|
107
|
+
</div>
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
type FormFieldProps = Omit<FieldProps, 'children' | 'className'> & { action?: ReactNode } & (
|
|
112
|
+
| { children: ReactNode; loading?: false; loadingLabel?: never }
|
|
113
|
+
| { children?: never; loading: true; loadingLabel: string }
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
export function FormField({ action, children, loading = false, loadingLabel, ...props }: FormFieldProps) {
|
|
117
|
+
if (loading)
|
|
118
|
+
return (
|
|
119
|
+
<SkeletonLoader label={loadingLabel ?? ''}>
|
|
120
|
+
<div className={`${rowClasses} sm:grid-cols-[9rem_minmax(0,1fr)]`}>
|
|
121
|
+
<Text variant="label" className="w-3/4" loading />
|
|
122
|
+
<SkeletonLoader.Shape presentation="control" />
|
|
123
|
+
</div>
|
|
124
|
+
</SkeletonLoader>
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
const content = children;
|
|
128
|
+
|
|
129
|
+
if (action) {
|
|
130
|
+
return (
|
|
131
|
+
<div className={`${rowClasses} grid-cols-[minmax(0,1fr)_auto] sm:grid-cols-[9rem_minmax(0,1fr)_auto]`}>
|
|
132
|
+
<Field
|
|
133
|
+
{...props}
|
|
134
|
+
className="contents [&>div]:min-w-0 [&>div:first-child]:col-span-2 [&>div:first-child]:mb-0 sm:[&>div:first-child]:col-span-1 [&>p]:col-span-2 [&>p]:mt-0 sm:[&>p]:col-start-2"
|
|
135
|
+
>
|
|
136
|
+
{content}
|
|
137
|
+
</Field>
|
|
138
|
+
<div className="col-start-2 row-start-2 flex items-center gap-2 sm:col-start-3 sm:row-start-1">
|
|
139
|
+
{action}
|
|
140
|
+
</div>
|
|
141
|
+
</div>
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
return (
|
|
146
|
+
<Field
|
|
147
|
+
{...props}
|
|
148
|
+
className={`${rowClasses} sm:grid-cols-[9rem_minmax(0,1fr)] [&>div]:min-w-0 [&>div:first-child]:mb-0 [&>p]:mt-0 sm:[&>p]:col-start-2`}
|
|
149
|
+
>
|
|
150
|
+
{content}
|
|
151
|
+
</Field>
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export function FormAction(props: Omit<ButtonProps, 'type' | 'size' | 'variant' | 'color'>) {
|
|
156
|
+
return <Button {...props} type="button" variant="subtle" />;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export function Disclosure({ children, label, lazy = false }: { children: ReactNode; label: string; lazy?: boolean }) {
|
|
160
|
+
const [open, setOpen] = useState(false);
|
|
161
|
+
|
|
162
|
+
return (
|
|
163
|
+
<details className="group px-1" onToggle={(event) => setOpen(event.currentTarget.open)}>
|
|
164
|
+
<summary className="text-base-700 hover:text-base-content focus-visible:outline-primary flex w-fit cursor-pointer list-none items-center gap-1.5 rounded py-1 text-xs focus-visible:outline-2 focus-visible:outline-offset-2 [&::-webkit-details-marker]:hidden">
|
|
165
|
+
<span aria-hidden="true" className="-rotate-90 transition-transform group-open:rotate-0 [&>svg]:size-3">
|
|
166
|
+
<ChevronDownIcon />
|
|
167
|
+
</span>
|
|
168
|
+
{label}
|
|
169
|
+
</summary>
|
|
170
|
+
<div className="text-base-700 mt-2 space-y-2 text-xs leading-relaxed">
|
|
171
|
+
{!lazy || open ? children : null}
|
|
172
|
+
</div>
|
|
173
|
+
</details>
|
|
174
|
+
);
|
|
175
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
interface InlineFieldsProps {
|
|
4
|
+
/** Buttons after the fields, for example Cancel and Save. */
|
|
5
|
+
actions: ReactNode;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Fields side by side with their actions at the end. Sized by its container, not the window: in a
|
|
11
|
+
* narrow card the fields stack and the actions sit below them.
|
|
12
|
+
*/
|
|
13
|
+
export function InlineFields({ actions, children }: InlineFieldsProps) {
|
|
14
|
+
return (
|
|
15
|
+
<div className="@container min-w-0">
|
|
16
|
+
<div className="flex flex-col gap-3 @lg:flex-row @lg:items-end">
|
|
17
|
+
<div className="grid min-w-0 flex-1 gap-3 @lg:auto-cols-fr @lg:grid-flow-col">{children}</div>
|
|
18
|
+
<div className="flex shrink-0 justify-end gap-2">{actions}</div>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Input as NinnaInput, type InputProps as NinnaInputProps } from '@ninna-ui/forms';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
|
|
4
|
+
import { formControlClasses, formControlDefaults } from './FormControlStyles';
|
|
5
|
+
|
|
6
|
+
export type InputProps = Omit<NinnaInputProps, 'fullWidth'>;
|
|
7
|
+
|
|
8
|
+
export const Input = forwardRef<HTMLInputElement, InputProps>(
|
|
9
|
+
({ size = formControlDefaults.size, variant = formControlDefaults.variant, className, ...props }, ref) => (
|
|
10
|
+
<NinnaInput
|
|
11
|
+
ref={ref}
|
|
12
|
+
color={formControlDefaults.color}
|
|
13
|
+
{...props}
|
|
14
|
+
fullWidth
|
|
15
|
+
size={size}
|
|
16
|
+
variant={variant}
|
|
17
|
+
className={`${variant === 'filled' ? formControlClasses : ''} ${className ?? ''}`}
|
|
18
|
+
/>
|
|
19
|
+
),
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
Input.displayName = 'Input';
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { SkeletonLoader } from '../feedback/SkeletonLoader';
|
|
2
|
+
import { Select, SelectItem } from './Select';
|
|
3
|
+
|
|
4
|
+
interface LoadedOptionSelectProps<Value extends string> {
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
label: string;
|
|
7
|
+
loading?: false;
|
|
8
|
+
onChange: (value: Value) => void;
|
|
9
|
+
/** Disabled options stay visible but cannot be chosen. */
|
|
10
|
+
options: readonly { label: string; value: Value; disabled?: boolean }[];
|
|
11
|
+
value: Value;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface LoadingOptionSelectProps {
|
|
15
|
+
label: string;
|
|
16
|
+
loading: true;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
type OptionSelectProps<Value extends string> = LoadedOptionSelectProps<Value> | LoadingOptionSelectProps;
|
|
20
|
+
|
|
21
|
+
export function OptionSelect<Value extends string>(props: OptionSelectProps<Value>) {
|
|
22
|
+
if (props.loading)
|
|
23
|
+
return (
|
|
24
|
+
<SkeletonLoader label={props.label}>
|
|
25
|
+
<SkeletonLoader.Shape presentation="control" />
|
|
26
|
+
</SkeletonLoader>
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
const { disabled, label, onChange, options, value } = props;
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<Select
|
|
33
|
+
aria-label={label}
|
|
34
|
+
disabled={disabled}
|
|
35
|
+
value={value}
|
|
36
|
+
onValueChange={(next) => {
|
|
37
|
+
const option = options.find((candidate) => candidate.value === next);
|
|
38
|
+
|
|
39
|
+
if (option) onChange(option.value);
|
|
40
|
+
}}
|
|
41
|
+
>
|
|
42
|
+
{options.map((option) => (
|
|
43
|
+
<SelectItem key={option.value} value={option.value} disabled={option.disabled}>
|
|
44
|
+
{option.label}
|
|
45
|
+
</SelectItem>
|
|
46
|
+
))}
|
|
47
|
+
</Select>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import {
|
|
2
|
+
RadioGroup as NinnaRadioGroup,
|
|
3
|
+
RadioGroupItem as NinnaRadioGroupItem,
|
|
4
|
+
type RadioGroupItemProps,
|
|
5
|
+
type RadioGroupProps,
|
|
6
|
+
useFormControl,
|
|
7
|
+
} from '@ninna-ui/forms';
|
|
8
|
+
import { forwardRef, useImperativeHandle, useLayoutEffect, useRef } from 'react';
|
|
9
|
+
|
|
10
|
+
import { formChoiceClasses, formControlDefaults } from './FormControlStyles';
|
|
11
|
+
|
|
12
|
+
export type { RadioGroupItemProps, RadioGroupProps } from '@ninna-ui/forms';
|
|
13
|
+
|
|
14
|
+
export const RadioGroup = forwardRef<HTMLDivElement, RadioGroupProps>((props, ref) => {
|
|
15
|
+
const groupRef = useRef<HTMLDivElement>(null);
|
|
16
|
+
const formControl = useFormControl();
|
|
17
|
+
|
|
18
|
+
useImperativeHandle(ref, () => groupRef.current!);
|
|
19
|
+
// Ninna drops the group's ARIA props instead of forwarding them to its root.
|
|
20
|
+
useLayoutEffect(() => {
|
|
21
|
+
const attributes = {
|
|
22
|
+
'aria-label': props['aria-label'],
|
|
23
|
+
'aria-labelledby': props['aria-labelledby'] ?? (props['aria-label'] ? undefined : formControl?.labelId),
|
|
24
|
+
'aria-describedby': props['aria-describedby'] ?? formControl?.messageId,
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
for (const [name, value] of Object.entries(attributes)) {
|
|
28
|
+
if (value === undefined) groupRef.current?.removeAttribute(name);
|
|
29
|
+
else groupRef.current?.setAttribute(name, value);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<NinnaRadioGroup ref={groupRef} size={formControlDefaults.size} color={formControlDefaults.color} {...props} />
|
|
35
|
+
);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
RadioGroup.displayName = 'RadioGroup';
|
|
39
|
+
|
|
40
|
+
export const RadioGroupItem = forwardRef<HTMLButtonElement, RadioGroupItemProps>(({ className, ...props }, ref) => (
|
|
41
|
+
<NinnaRadioGroupItem
|
|
42
|
+
ref={ref}
|
|
43
|
+
{...props}
|
|
44
|
+
className={`${formChoiceClasses} cursor-pointer focus-visible:ring-offset-0 ${className ?? ''}`}
|
|
45
|
+
/>
|
|
46
|
+
));
|
|
47
|
+
|
|
48
|
+
RadioGroupItem.displayName = 'RadioGroupItem';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Select as NinnaSelect,
|
|
3
|
+
SelectItem as NinnaSelectItem,
|
|
4
|
+
type SelectItemProps,
|
|
5
|
+
type SelectProps as NinnaSelectProps,
|
|
6
|
+
} from '@ninna-ui/forms';
|
|
7
|
+
import { forwardRef } from 'react';
|
|
8
|
+
|
|
9
|
+
import { tabbable } from '../foundations/KeyboardFocus';
|
|
10
|
+
import { formControlClasses, formControlDefaults } from './FormControlStyles';
|
|
11
|
+
|
|
12
|
+
export type SelectProps = Omit<NinnaSelectProps, 'fullWidth'>;
|
|
13
|
+
|
|
14
|
+
export const Select = forwardRef<HTMLButtonElement, SelectProps>(
|
|
15
|
+
({ size = formControlDefaults.size, variant = formControlDefaults.variant, className, ...props }, ref) => (
|
|
16
|
+
<NinnaSelect
|
|
17
|
+
ref={ref}
|
|
18
|
+
color={formControlDefaults.color}
|
|
19
|
+
{...tabbable}
|
|
20
|
+
{...props}
|
|
21
|
+
fullWidth
|
|
22
|
+
size={size}
|
|
23
|
+
variant={variant}
|
|
24
|
+
className={`${variant === 'filled' ? formControlClasses : ''} [&>span:first-child]:truncate ${className ?? ''}`}
|
|
25
|
+
/>
|
|
26
|
+
),
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
Select.displayName = 'Select';
|
|
30
|
+
|
|
31
|
+
export const SelectItem = forwardRef<HTMLDivElement, SelectItemProps>(({ icon, children, ...props }, ref) => (
|
|
32
|
+
<NinnaSelectItem ref={ref} {...props}>
|
|
33
|
+
{icon ? (
|
|
34
|
+
<span className="inline-flex min-w-0 items-center gap-2 align-middle">
|
|
35
|
+
<span aria-hidden="true" className="size-4 shrink-0 [&>svg]:size-full">
|
|
36
|
+
{icon}
|
|
37
|
+
</span>
|
|
38
|
+
<span className="truncate">{children}</span>
|
|
39
|
+
</span>
|
|
40
|
+
) : (
|
|
41
|
+
children
|
|
42
|
+
)}
|
|
43
|
+
</NinnaSelectItem>
|
|
44
|
+
));
|
|
45
|
+
|
|
46
|
+
SelectItem.displayName = 'SelectItem';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Switch as NinnaSwitch, type SwitchProps } from '@ninna-ui/forms';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
|
|
4
|
+
import { tabbable } from '../foundations/KeyboardFocus';
|
|
5
|
+
|
|
6
|
+
export const Switch = forwardRef<HTMLButtonElement, SwitchProps>((props, ref) => (
|
|
7
|
+
<NinnaSwitch ref={ref} {...tabbable} size="sm" aria-busy={props.loading || undefined} {...props} />
|
|
8
|
+
));
|
|
9
|
+
|
|
10
|
+
Switch.displayName = 'Switch';
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { XIcon } from 'lucide-react';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
|
|
4
|
+
import { IconButton } from '../actions/IconButton';
|
|
5
|
+
import { Badge } from '../display/Badge';
|
|
6
|
+
import { Input } from './Input';
|
|
7
|
+
|
|
8
|
+
interface TagInputProps {
|
|
9
|
+
/** Names the field that adds a value. */
|
|
10
|
+
addLabel: string;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
/** Names the list of values. */
|
|
13
|
+
label: string;
|
|
14
|
+
onChange: (values: string[]) => void;
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
/** Names the button that removes a value. */
|
|
17
|
+
removeLabel: (value: string) => string;
|
|
18
|
+
values: readonly string[];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Values as removable tags, in order, and a field that adds one on Enter, a comma or a
|
|
23
|
+
* semicolon, or when it loses focus. A value already listed, in any case, is not added again.
|
|
24
|
+
*/
|
|
25
|
+
export function TagInput({ addLabel, disabled, label, onChange, placeholder, removeLabel, values }: TagInputProps) {
|
|
26
|
+
const [draft, setDraft] = useState('');
|
|
27
|
+
|
|
28
|
+
function add() {
|
|
29
|
+
const value = draft.trim();
|
|
30
|
+
|
|
31
|
+
setDraft('');
|
|
32
|
+
|
|
33
|
+
if (value && !values.some((known) => known.toLocaleLowerCase() === value.toLocaleLowerCase()))
|
|
34
|
+
onChange([...values, value]);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<div className="flex min-w-0 flex-col gap-2">
|
|
39
|
+
{values.length > 0 ? (
|
|
40
|
+
<ul aria-label={label} className="flex min-w-0 flex-wrap gap-1.5">
|
|
41
|
+
{values.map((value) => (
|
|
42
|
+
<li key={value} className="max-w-full min-w-0">
|
|
43
|
+
<Badge className="max-w-full pr-0.5">
|
|
44
|
+
<span className="truncate">{value}</span>
|
|
45
|
+
<IconButton
|
|
46
|
+
type="button"
|
|
47
|
+
aria-label={removeLabel(value)}
|
|
48
|
+
title={removeLabel(value)}
|
|
49
|
+
className="size-4 shrink-0 p-0.5"
|
|
50
|
+
disabled={disabled}
|
|
51
|
+
icon={<XIcon />}
|
|
52
|
+
onClick={() => onChange(values.filter((known) => known !== value))}
|
|
53
|
+
/>
|
|
54
|
+
</Badge>
|
|
55
|
+
</li>
|
|
56
|
+
))}
|
|
57
|
+
</ul>
|
|
58
|
+
) : null}
|
|
59
|
+
<Input
|
|
60
|
+
aria-label={addLabel}
|
|
61
|
+
placeholder={placeholder}
|
|
62
|
+
value={draft}
|
|
63
|
+
maxLength={4096}
|
|
64
|
+
disabled={disabled}
|
|
65
|
+
onBlur={add}
|
|
66
|
+
onChange={(event) => setDraft(event.target.value)}
|
|
67
|
+
onKeyDown={(event) => {
|
|
68
|
+
if (event.key !== 'Enter' && event.key !== ',' && event.key !== ';') return;
|
|
69
|
+
|
|
70
|
+
event.preventDefault();
|
|
71
|
+
add();
|
|
72
|
+
}}
|
|
73
|
+
/>
|
|
74
|
+
</div>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Textarea as NinnaTextarea, type TextareaProps } from '@ninna-ui/forms';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
|
|
4
|
+
import { formControlClasses, formControlDefaults } from './FormControlStyles';
|
|
5
|
+
|
|
6
|
+
export const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(({ className, ...props }, ref) => (
|
|
7
|
+
<NinnaTextarea
|
|
8
|
+
ref={ref}
|
|
9
|
+
{...formControlDefaults}
|
|
10
|
+
{...props}
|
|
11
|
+
className={`${formControlClasses} ${className ?? ''}`}
|
|
12
|
+
/>
|
|
13
|
+
));
|
|
14
|
+
Textarea.displayName = 'Textarea';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { Checkbox, type CheckboxProps } from './Checkbox';
|
|
2
|
+
export { Field, type FieldProps } from './Field';
|
|
3
|
+
export { Disclosure, FormAction, FormContent, FormField, FormRow, FormSection, FormStack } from './FormSection';
|
|
4
|
+
export { InlineFields } from './InlineFields';
|
|
5
|
+
export { Input, type InputProps } from './Input';
|
|
6
|
+
export { OptionSelect } from './OptionSelect';
|
|
7
|
+
export { RadioGroup, RadioGroupItem, type RadioGroupItemProps, type RadioGroupProps } from './RadioGroup';
|
|
8
|
+
export { Select, SelectItem, type SelectProps } from './Select';
|
|
9
|
+
export { Switch } from './Switch';
|
|
10
|
+
export { TagInput } from './TagInput';
|
|
11
|
+
export { Textarea } from './Textarea';
|