@lar-works/design-system 0.2.0 → 0.3.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 +5 -1
- package/dist/actions/Button.d.ts +39 -1
- package/dist/actions/Button.js +39 -9
- package/dist/actions/Button.js.map +1 -1
- package/dist/actions/ButtonLink.d.ts +5 -1
- package/dist/actions/ButtonLink.js +28 -2
- package/dist/actions/ButtonLink.js.map +1 -1
- package/dist/actions/ButtonRecipes.js +7 -0
- package/dist/actions/ButtonRecipes.js.map +1 -0
- package/dist/actions/IconButton.d.ts +2 -2
- package/dist/actions/IconButton.js +1 -1
- package/dist/actions/IconButton.js.map +1 -1
- package/dist/actions/ThemeSwitch.js +1 -1
- package/dist/board/ActivityLine.d.ts +36 -0
- package/dist/board/ActivityLine.js +144 -0
- package/dist/board/ActivityLine.js.map +1 -0
- package/dist/board/ActivityTrack.d.ts +11 -0
- package/dist/board/ActivityTrack.js +25 -0
- package/dist/board/ActivityTrack.js.map +1 -0
- package/dist/board/AddItem.d.ts +82 -0
- package/dist/board/AddItem.js +185 -0
- package/dist/board/AddItem.js.map +1 -0
- package/dist/board/Archive.d.ts +21 -0
- package/dist/board/Archive.js +63 -0
- package/dist/board/Archive.js.map +1 -0
- package/dist/board/Attention.d.ts +66 -0
- package/dist/board/Attention.js +122 -0
- package/dist/board/Attention.js.map +1 -0
- package/dist/board/BoardShell.d.ts +16 -0
- package/dist/board/BoardShell.js +35 -0
- package/dist/board/BoardShell.js.map +1 -0
- package/dist/board/BoardTitleBar.d.ts +50 -0
- package/dist/board/BoardTitleBar.js +125 -0
- package/dist/board/BoardTitleBar.js.map +1 -0
- package/dist/board/ButtonKinds.d.ts +24 -0
- package/dist/board/ButtonKinds.js +19 -0
- package/dist/board/ButtonKinds.js.map +1 -0
- package/dist/board/Cleanup.d.ts +8 -0
- package/dist/board/Cleanup.js +15 -0
- package/dist/board/Cleanup.js.map +1 -0
- package/dist/board/Counters.d.ts +101 -0
- package/dist/board/Counters.js +202 -0
- package/dist/board/Counters.js.map +1 -0
- package/dist/board/DataAttributes.d.ts +6 -0
- package/dist/board/Dependencies.d.ts +17 -0
- package/dist/board/Dependencies.js +44 -0
- package/dist/board/Dependencies.js.map +1 -0
- package/dist/board/Desk.d.ts +52 -0
- package/dist/board/Desk.js +130 -0
- package/dist/board/Desk.js.map +1 -0
- package/dist/board/Dossier.d.ts +100 -0
- package/dist/board/Dossier.js +194 -0
- package/dist/board/Dossier.js.map +1 -0
- package/dist/board/Filters.d.ts +33 -0
- package/dist/board/Filters.js +64 -0
- package/dist/board/Filters.js.map +1 -0
- package/dist/board/ItemDetails.d.ts +167 -0
- package/dist/board/ItemDetails.js +339 -0
- package/dist/board/ItemDetails.js.map +1 -0
- package/dist/board/ItemDialog.d.ts +73 -0
- package/dist/board/ItemDialog.js +140 -0
- package/dist/board/ItemDialog.js.map +1 -0
- package/dist/board/ItemParts.d.ts +42 -0
- package/dist/board/ItemParts.js +82 -0
- package/dist/board/ItemParts.js.map +1 -0
- package/dist/board/ItemProgress.d.ts +56 -0
- package/dist/board/ItemProgress.js +138 -0
- package/dist/board/ItemProgress.js.map +1 -0
- package/dist/board/List.d.ts +65 -0
- package/dist/board/List.js +118 -0
- package/dist/board/List.js.map +1 -0
- package/dist/board/LoadingScreen.d.ts +38 -0
- package/dist/board/LoadingScreen.js +74 -0
- package/dist/board/LoadingScreen.js.map +1 -0
- package/dist/board/NeedsYou.d.ts +13 -0
- package/dist/board/NeedsYou.js +31 -0
- package/dist/board/NeedsYou.js.map +1 -0
- package/dist/board/Onboarding.d.ts +53 -0
- package/dist/board/Onboarding.js +122 -0
- package/dist/board/Onboarding.js.map +1 -0
- package/dist/board/PartsList.d.ts +60 -0
- package/dist/board/PartsList.js +115 -0
- package/dist/board/PartsList.js.map +1 -0
- package/dist/board/ProjectIcon.d.ts +51 -0
- package/dist/board/ProjectIcon.js +120 -0
- package/dist/board/ProjectIcon.js.map +1 -0
- package/dist/board/PullRequests.d.ts +43 -0
- package/dist/board/PullRequests.js +83 -0
- package/dist/board/PullRequests.js.map +1 -0
- package/dist/board/RowStyles.js +14 -0
- package/dist/board/RowStyles.js.map +1 -0
- package/dist/board/Settings.d.ts +54 -0
- package/dist/board/Settings.js +112 -0
- package/dist/board/Settings.js.map +1 -0
- package/dist/board/Slices.d.ts +32 -0
- package/dist/board/Slices.js +88 -0
- package/dist/board/Slices.js.map +1 -0
- package/dist/board/SourceIcon.d.ts +12 -0
- package/dist/board/SourceIcon.js +24 -0
- package/dist/board/SourceIcon.js.map +1 -0
- package/dist/board/StagePane.d.ts +43 -0
- package/dist/board/StagePane.js +97 -0
- package/dist/board/StagePane.js.map +1 -0
- package/dist/board/StageRow.d.ts +141 -0
- package/dist/board/StageRow.js +287 -0
- package/dist/board/StageRow.js.map +1 -0
- package/dist/board/StageTrack.d.ts +18 -0
- package/dist/board/StageTrack.js +38 -0
- package/dist/board/StageTrack.js.map +1 -0
- package/dist/board/StartControls.d.ts +30 -0
- package/dist/board/StartControls.js +51 -0
- package/dist/board/StartControls.js.map +1 -0
- package/dist/board/StatusColors.d.ts +5 -0
- package/dist/board/StatusColors.js +17 -0
- package/dist/board/StatusColors.js.map +1 -0
- package/dist/board/StatusGlyph.d.ts +18 -0
- package/dist/board/StatusGlyph.js +51 -0
- package/dist/board/StatusGlyph.js.map +1 -0
- package/dist/board/Threads.d.ts +13 -0
- package/dist/board/Threads.js +35 -0
- package/dist/board/Threads.js.map +1 -0
- package/dist/board/TrackerLabels.d.ts +27 -0
- package/dist/board/TrackerLabels.js +56 -0
- package/dist/board/TrackerLabels.js.map +1 -0
- package/dist/board/UpdatePill.d.ts +52 -0
- package/dist/board/UpdatePill.js +188 -0
- package/dist/board/UpdatePill.js.map +1 -0
- package/dist/board/Vocabulary.d.ts +56 -0
- package/dist/board/Vocabulary.js +104 -0
- package/dist/board/Vocabulary.js.map +1 -0
- package/dist/board/Warnings.d.ts +35 -0
- package/dist/board/Warnings.js +85 -0
- package/dist/board/Warnings.js.map +1 -0
- package/dist/board/WorkMap.d.ts +136 -0
- package/dist/board/WorkMap.js +274 -0
- package/dist/board/WorkMap.js.map +1 -0
- package/dist/board/index.d.ts +42 -0
- package/dist/collections/CollectionState.d.ts +10 -1
- package/dist/collections/CollectionState.js +12 -5
- package/dist/collections/CollectionState.js.map +1 -1
- package/dist/collections/ResultList.js +1 -1
- package/dist/collections/ScrollRow.js +1 -1
- package/dist/collections/VirtualList.js +1 -1
- package/dist/display/Avatar.d.ts +5 -2
- package/dist/display/Avatar.js +2 -2
- package/dist/display/Avatar.js.map +1 -1
- package/dist/display/Badge.d.ts +6 -1
- package/dist/display/Badge.js +9 -4
- package/dist/display/Badge.js.map +1 -1
- package/dist/display/CheckList.js +1 -1
- package/dist/display/Comment.d.ts +12 -0
- package/dist/display/Comment.js +39 -0
- package/dist/display/Comment.js.map +1 -0
- package/dist/display/CopyButton.d.ts +10 -2
- package/dist/display/CopyButton.js +29 -16
- package/dist/display/CopyButton.js.map +1 -1
- package/dist/display/Diagram.d.ts +17 -0
- package/dist/display/Diagram.js +49 -0
- package/dist/display/Diagram.js.map +1 -0
- package/dist/display/ImagePicker.js +1 -1
- package/dist/display/InfoBox.js +2 -2
- package/dist/display/InsetPanel.d.ts +3 -1
- package/dist/display/InsetPanel.js +7 -4
- package/dist/display/InsetPanel.js.map +1 -1
- package/dist/display/ItemAction.js +2 -2
- package/dist/display/LabelChip.d.ts +26 -0
- package/dist/display/LabelChip.js +41 -0
- package/dist/display/LabelChip.js.map +1 -0
- package/dist/display/LabelTint.js +60 -0
- package/dist/display/LabelTint.js.map +1 -0
- package/dist/display/Person.d.ts +5 -0
- package/dist/display/Person.js +19 -0
- package/dist/display/Person.js.map +1 -0
- package/dist/display/PropertySheet.js +1 -1
- package/dist/display/RadioChoice.d.ts +9 -2
- package/dist/display/RadioChoice.js +5 -1
- package/dist/display/RadioChoice.js.map +1 -1
- package/dist/display/RatingLink.js +1 -1
- package/dist/display/RichText.d.ts +12 -0
- package/dist/display/RichText.js +94 -0
- package/dist/display/RichText.js.map +1 -0
- package/dist/display/RowList.js +1 -1
- package/dist/display/index.d.ts +6 -1
- package/dist/feedback/Alert.js +1 -1
- package/dist/feedback/AsyncState.js +1 -1
- package/dist/feedback/DismissButton.d.ts +12 -0
- package/dist/feedback/DismissButton.js +20 -0
- package/dist/feedback/DismissButton.js.map +1 -0
- package/dist/feedback/ErrorNotification.js +2 -0
- package/dist/feedback/ErrorNotification.js.map +1 -1
- package/dist/feedback/FormResult.d.ts +16 -0
- package/dist/feedback/FormResult.js +30 -0
- package/dist/feedback/FormResult.js.map +1 -0
- package/dist/feedback/LiveRegion.d.ts +7 -0
- package/dist/feedback/LiveRegion.js +15 -0
- package/dist/feedback/LiveRegion.js.map +1 -0
- package/dist/feedback/Loading.d.ts +19 -0
- package/dist/feedback/Loading.js +63 -0
- package/dist/feedback/Loading.js.map +1 -0
- package/dist/feedback/Notifications.d.ts +35 -1
- package/dist/feedback/Notifications.js +196 -4
- package/dist/feedback/Notifications.js.map +1 -1
- package/dist/feedback/Progress.d.ts +15 -0
- package/dist/feedback/Progress.js +38 -0
- package/dist/feedback/Progress.js.map +1 -0
- package/dist/feedback/ProgressStatusRow.js +1 -1
- package/dist/feedback/StatusIndicator.d.ts +6 -1
- package/dist/feedback/StatusIndicator.js +19 -5
- package/dist/feedback/StatusIndicator.js.map +1 -1
- package/dist/feedback/index.d.ts +8 -4
- package/dist/forms/Checkbox.js +1 -1
- package/dist/forms/ColorSwatches.d.ts +21 -0
- package/dist/forms/ColorSwatches.js +26 -0
- package/dist/forms/ColorSwatches.js.map +1 -0
- package/dist/forms/FormSection.d.ts +68 -6
- package/dist/forms/FormSection.js +139 -8
- package/dist/forms/FormSection.js.map +1 -1
- package/dist/forms/HiddenField.d.ts +6 -0
- package/dist/forms/HiddenField.js +13 -0
- package/dist/forms/HiddenField.js.map +1 -0
- package/dist/forms/Input.d.ts +12 -2
- package/dist/forms/Input.js +10 -3
- package/dist/forms/Input.js.map +1 -1
- package/dist/forms/LabelPicker.d.ts +43 -0
- package/dist/forms/LabelPicker.js +107 -0
- package/dist/forms/LabelPicker.js.map +1 -0
- package/dist/forms/MarkdownEditor.d.ts +21 -0
- package/dist/forms/MarkdownEditor.js +175 -0
- package/dist/forms/MarkdownEditor.js.map +1 -0
- package/dist/forms/MarkdownToolbar.js +204 -0
- package/dist/forms/MarkdownToolbar.js.map +1 -0
- package/dist/forms/OptionSelect.d.ts +30 -9
- package/dist/forms/OptionSelect.js +53 -13
- package/dist/forms/OptionSelect.js.map +1 -1
- package/dist/forms/Select.d.ts +4 -1
- package/dist/forms/Select.js +3 -1
- package/dist/forms/Select.js.map +1 -1
- package/dist/forms/Switch.d.ts +4 -1
- package/dist/forms/Switch.js +5 -2
- package/dist/forms/Switch.js.map +1 -1
- package/dist/forms/TagInput.js +1 -1
- package/dist/forms/index.d.ts +7 -3
- package/dist/foundations/AmbientMotion.d.ts +2 -0
- package/dist/foundations/AmbientMotion.js +39 -0
- package/dist/foundations/AmbientMotion.js.map +1 -0
- package/dist/foundations/DesignSystemProvider.d.ts +34 -0
- package/dist/foundations/DesignSystemProvider.js +26 -1
- package/dist/foundations/DesignSystemProvider.js.map +1 -1
- package/dist/foundations/index.d.ts +2 -1
- package/dist/icons/BrandIcons.d.ts +8 -2
- package/dist/icons/BrandIcons.js +14 -3
- package/dist/icons/BrandIcons.js.map +1 -1
- package/dist/icons/dynamic.d.ts +2 -0
- package/dist/icons/dynamic.js +1 -0
- package/dist/icons/index.d.ts +2 -2
- package/dist/icons/index.js +1 -1
- package/dist/icons.d.ts +2 -2
- package/dist/icons.js +1 -1
- package/dist/index.d.ts +71 -10
- package/dist/index.js +78 -21
- package/dist/layout/Site.js +1 -1
- package/dist/layout/TitleBar.js +1 -1
- package/dist/layout/index.d.ts +2 -2
- package/dist/layout/index.js +3 -3
- package/dist/layout/toolbar/CommandPaletteTrigger.d.ts +17 -2
- package/dist/layout/toolbar/CommandPaletteTrigger.js +89 -6
- package/dist/layout/toolbar/CommandPaletteTrigger.js.map +1 -1
- package/dist/layout/toolbar/TriggerFit.js +56 -0
- package/dist/layout/toolbar/TriggerFit.js.map +1 -0
- package/dist/navigation/CollectionBrowseSelector.js +1 -1
- package/dist/navigation/CollectionViewToggle.d.ts +26 -0
- package/dist/navigation/CollectionViewToggle.js +54 -23
- package/dist/navigation/CollectionViewToggle.js.map +1 -1
- package/dist/navigation/DrilldownBrowseSelector.js +1 -1
- package/dist/navigation/FolderSelector.js +2 -2
- package/dist/navigation/SortMenu.d.ts +10 -0
- package/dist/navigation/SortMenu.js +33 -0
- package/dist/navigation/SortMenu.js.map +1 -0
- package/dist/navigation/index.d.ts +3 -2
- package/dist/overlays/CommandPalette.d.ts +38 -4
- package/dist/overlays/CommandPalette.js +140 -54
- package/dist/overlays/CommandPalette.js.map +1 -1
- package/dist/overlays/Drawer.js +1 -1
- package/dist/overlays/DropdownMenu.d.ts +7 -1
- package/dist/overlays/DropdownMenu.js +13 -2
- package/dist/overlays/DropdownMenu.js.map +1 -1
- package/dist/overlays/HelpTip.d.ts +8 -0
- package/dist/overlays/HelpTip.js +29 -0
- package/dist/overlays/HelpTip.js.map +1 -0
- package/dist/overlays/ImageViewer.js +2 -2
- package/dist/overlays/Modal.d.ts +5 -0
- package/dist/overlays/Modal.js +17 -2
- package/dist/overlays/Modal.js.map +1 -1
- package/dist/overlays/ModalExpandButton.d.ts +18 -0
- package/dist/overlays/ModalExpandButton.js +43 -0
- package/dist/overlays/ModalExpandButton.js.map +1 -0
- package/dist/overlays/Popover.d.ts +2 -1
- package/dist/overlays/Popover.js +1 -0
- package/dist/overlays/Popover.js.map +1 -1
- package/dist/overlays/index.d.ts +4 -2
- package/dist/showcase/Cards.js +1 -1
- package/dist/showcase/FeatureRow.js +1 -1
- package/dist/showcase/PhotoSearchConcept.js +1 -1
- package/dist/showcase/ProductBand.js +1 -1
- package/dist/showcase/Status.js +1 -1
- package/dist/typography/Code.d.ts +18 -0
- package/dist/typography/Code.js +24 -0
- package/dist/typography/Code.js.map +1 -0
- package/dist/typography/Link.d.ts +7 -2
- package/dist/typography/Link.js +15 -5
- package/dist/typography/Link.js.map +1 -1
- package/dist/typography/Typography.d.ts +19 -1
- package/dist/typography/Typography.js +11 -3
- package/dist/typography/Typography.js.map +1 -1
- package/dist/typography/index.d.ts +3 -3
- package/package.json +26 -3
- package/src/actions/Button.tsx +78 -11
- package/src/actions/ButtonLink.tsx +34 -0
- package/src/actions/ButtonRecipes.ts +10 -0
- package/src/actions/IconButton.tsx +7 -4
- package/src/board/ActivityLine.tsx +176 -0
- package/src/board/ActivityTrack.tsx +23 -0
- package/src/board/AddItem.tsx +259 -0
- package/src/board/Archive.tsx +75 -0
- package/src/board/Attention.tsx +135 -0
- package/src/board/BoardShell.tsx +30 -0
- package/src/board/BoardTitleBar.tsx +167 -0
- package/src/board/ButtonKinds.ts +32 -0
- package/src/board/Cleanup.tsx +19 -0
- package/src/board/Counters.tsx +224 -0
- package/src/board/DataAttributes.ts +3 -0
- package/src/board/Dependencies.tsx +49 -0
- package/src/board/Desk.tsx +155 -0
- package/src/board/Dossier.tsx +262 -0
- package/src/board/Filters.tsx +85 -0
- package/src/board/ItemDetails.tsx +435 -0
- package/src/board/ItemDialog.tsx +179 -0
- package/src/board/ItemParts.tsx +128 -0
- package/src/board/ItemProgress.tsx +164 -0
- package/src/board/List.tsx +154 -0
- package/src/board/LoadingScreen.tsx +78 -0
- package/src/board/NeedsYou.tsx +30 -0
- package/src/board/Onboarding.tsx +124 -0
- package/src/board/PartsList.tsx +160 -0
- package/src/board/ProjectIcon.tsx +172 -0
- package/src/board/PullRequests.tsx +106 -0
- package/src/board/RowStyles.ts +17 -0
- package/src/board/Settings.tsx +124 -0
- package/src/board/Slices.tsx +103 -0
- package/src/board/SourceIcon.tsx +33 -0
- package/src/board/StagePane.tsx +128 -0
- package/src/board/StageRow.tsx +320 -0
- package/src/board/StageTrack.tsx +61 -0
- package/src/board/StartControls.tsx +77 -0
- package/src/board/StatusColors.ts +28 -0
- package/src/board/StatusGlyph.tsx +70 -0
- package/src/board/Threads.tsx +38 -0
- package/src/board/TrackerLabels.tsx +75 -0
- package/src/board/UpdatePill.tsx +222 -0
- package/src/board/Vocabulary.tsx +155 -0
- package/src/board/Warnings.tsx +83 -0
- package/src/board/WorkMap.tsx +436 -0
- package/src/board/base.css +121 -0
- package/src/board/button-kinds.css +8 -0
- package/src/board/index.ts +224 -0
- package/src/board/items.css +75 -0
- package/src/board/loading-screen.css +171 -0
- package/src/board/rows.css +180 -0
- package/src/board/title-bar.css +56 -0
- package/src/board/tokens.css +52 -0
- package/src/board.css +19 -0
- package/src/collections/CollectionState.tsx +20 -7
- package/src/display/Avatar.tsx +6 -3
- package/src/display/Badge.tsx +25 -3
- package/src/display/Comment.tsx +26 -0
- package/src/display/CopyButton.tsx +48 -18
- package/src/display/Diagram.tsx +59 -0
- package/src/display/InsetPanel.tsx +4 -1
- package/src/display/LabelChip.tsx +73 -0
- package/src/display/LabelTint.ts +72 -0
- package/src/display/Person.tsx +11 -0
- package/src/display/RadioChoice.tsx +11 -2
- package/src/display/RichText.tsx +114 -0
- package/src/display/index.ts +5 -0
- package/src/feedback/DismissButton.tsx +28 -0
- package/src/feedback/ErrorNotification.ts +3 -0
- package/src/feedback/FormResult.tsx +50 -0
- package/src/feedback/LiveRegion.tsx +10 -0
- package/src/feedback/Loading.tsx +75 -0
- package/src/feedback/Notifications.tsx +267 -2
- package/src/feedback/Progress.tsx +44 -0
- package/src/feedback/StatusIndicator.tsx +34 -3
- package/src/feedback/index.ts +12 -2
- package/src/forms/ColorSwatches.tsx +50 -0
- package/src/forms/FormSection.tsx +245 -10
- package/src/forms/HiddenField.tsx +4 -0
- package/src/forms/Input.tsx +26 -4
- package/src/forms/LabelPicker.tsx +140 -0
- package/src/forms/MarkdownEditor.tsx +283 -0
- package/src/forms/MarkdownToolbar.tsx +267 -0
- package/src/forms/OptionSelect.tsx +110 -25
- package/src/forms/Select.tsx +20 -13
- package/src/forms/Switch.tsx +16 -2
- package/src/forms/index.ts +16 -2
- package/src/foundations/AmbientMotion.ts +51 -0
- package/src/foundations/DesignSystemProvider.tsx +19 -0
- package/src/foundations/index.ts +1 -0
- package/src/foundations/theme.css +64 -0
- package/src/icons/BrandIcons.tsx +12 -3
- package/src/icons/dynamic.ts +4 -0
- package/src/icons/index.ts +1 -1
- package/src/index.ts +2 -1
- package/src/layout/index.ts +1 -1
- package/src/layout/toolbar/CommandPaletteTrigger.tsx +187 -31
- package/src/layout/toolbar/TriggerFit.ts +84 -0
- package/src/navigation/CollectionViewToggle.tsx +94 -24
- package/src/navigation/SortMenu.tsx +41 -0
- package/src/navigation/index.ts +2 -1
- package/src/overlays/CommandPalette.tsx +190 -60
- package/src/overlays/DropdownMenu.tsx +12 -1
- package/src/overlays/HelpTip.tsx +29 -0
- package/src/overlays/Modal.tsx +23 -0
- package/src/overlays/ModalExpandButton.tsx +48 -0
- package/src/overlays/Popover.tsx +3 -1
- package/src/overlays/index.ts +9 -1
- package/src/showcase.css +6 -0
- package/src/styles.css +9 -1
- package/src/typography/Code.tsx +24 -0
- package/src/typography/Link.tsx +19 -10
- package/src/typography/Typography.tsx +25 -2
- package/src/typography/index.ts +1 -1
- package/dist/feedback/index.js +0 -11
- package/dist/typography/index.js +0 -4
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { LaptopIcon } from 'lucide-react';
|
|
2
|
+
|
|
3
|
+
import { AzureDevOpsIcon, GitHubIcon } from '../icons/BrandIcons';
|
|
4
|
+
|
|
5
|
+
/** Where a piece of work's ticket is saved: a GitHub issue, an Azure DevOps work item, or only on this machine. */
|
|
6
|
+
export type ItemSource = 'github' | 'azure' | 'local';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Where an item's ticket is saved, as a small muted mark named by `label`: a bordered square in rows and details, or
|
|
10
|
+
* with `corner` a tab in a card's top right corner, which lets clicks through to the card.
|
|
11
|
+
*/
|
|
12
|
+
export function SourceIcon({ source, label, corner = false }: { source: ItemSource; label: string; corner?: boolean }) {
|
|
13
|
+
const shape = corner
|
|
14
|
+
? 'absolute right-0 top-0 z-10 size-6 rounded-bl-lg rounded-tr-[inherit] border-b border-l pointer-events-none'
|
|
15
|
+
: 'size-5 shrink-0 rounded-md border';
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<span
|
|
19
|
+
role="img"
|
|
20
|
+
aria-label={label}
|
|
21
|
+
title={label}
|
|
22
|
+
className={`grid place-items-center border-(--border) bg-(--soft) text-(--muted-foreground) ${shape}`}
|
|
23
|
+
>
|
|
24
|
+
{source === 'local' ? (
|
|
25
|
+
<LaptopIcon className="size-3" strokeWidth={1.75} aria-hidden="true" />
|
|
26
|
+
) : source === 'github' ? (
|
|
27
|
+
<GitHubIcon className="size-3" />
|
|
28
|
+
) : (
|
|
29
|
+
<AzureDevOpsIcon className="size-3" />
|
|
30
|
+
)}
|
|
31
|
+
</span>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
// A section of Lar Factory's board's work by stage (Queue, Shaping, Ready to build, Build, Concepts and linked work): a
|
|
2
|
+
// titled list that takes the height of its rows, so a section with none stays small and the page scrolls past them all.
|
|
3
|
+
|
|
4
|
+
import type { ReactNode } from 'react';
|
|
5
|
+
|
|
6
|
+
/** A stage's section: its status glyph, title and count, anything at the header's `right`, then its rows. */
|
|
7
|
+
export function StagePane({
|
|
8
|
+
id,
|
|
9
|
+
title,
|
|
10
|
+
glyph,
|
|
11
|
+
count,
|
|
12
|
+
right,
|
|
13
|
+
children,
|
|
14
|
+
}: {
|
|
15
|
+
/** Names the section, as `data-stage`, and its heading's id. */
|
|
16
|
+
id: string;
|
|
17
|
+
title: string;
|
|
18
|
+
glyph?: ReactNode;
|
|
19
|
+
count: number;
|
|
20
|
+
right?: ReactNode;
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
}) {
|
|
23
|
+
return (
|
|
24
|
+
<section
|
|
25
|
+
data-stage={id}
|
|
26
|
+
aria-labelledby={`${id}-h`}
|
|
27
|
+
className="min-w-0 overflow-hidden rounded-xl border border-(--border) bg-(--card) shadow-xs"
|
|
28
|
+
>
|
|
29
|
+
<header className="flex min-h-10 flex-wrap items-center gap-x-2 gap-y-1 border-b border-(--border) px-3 py-1">
|
|
30
|
+
{glyph}
|
|
31
|
+
<h3 id={`${id}-h`} className="m-0 text-[13px] font-medium whitespace-nowrap">
|
|
32
|
+
{title} <span className="font-normal text-(--muted-foreground) tabular-nums">{count}</span>
|
|
33
|
+
</h3>
|
|
34
|
+
{right && <span className="ml-auto flex max-w-full min-w-0 items-center">{right}</span>}
|
|
35
|
+
</header>
|
|
36
|
+
<div className="@container">{children}</div>
|
|
37
|
+
</section>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** The rows of a stage's section. */
|
|
42
|
+
export function StageList({ children }: { children: ReactNode }) {
|
|
43
|
+
return <ol className="m-0 grid list-none p-0">{children}</ol>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** What a section says with no row: that it's loading, that nothing is in it, or that the filters hide every row. */
|
|
47
|
+
export function StagePaneEmpty({ children }: { children: ReactNode }) {
|
|
48
|
+
return (
|
|
49
|
+
<p data-pane-empty className="m-0 px-3 py-3 text-[12px] text-(--muted-foreground)">
|
|
50
|
+
{children}
|
|
51
|
+
</p>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Builds at work against the build limit, in a section's header: one bar per build the `limit` allows, more when
|
|
56
|
+
* they're over it, the bars at work in `color`, then the count in words. */
|
|
57
|
+
export function BuildLimit({
|
|
58
|
+
building,
|
|
59
|
+
limit,
|
|
60
|
+
color,
|
|
61
|
+
title,
|
|
62
|
+
children,
|
|
63
|
+
}: {
|
|
64
|
+
building: number;
|
|
65
|
+
limit?: number | undefined;
|
|
66
|
+
color: string;
|
|
67
|
+
title: string;
|
|
68
|
+
children: ReactNode;
|
|
69
|
+
}) {
|
|
70
|
+
return (
|
|
71
|
+
<span
|
|
72
|
+
className="build-limit inline-flex items-center gap-1.5 text-[11px] whitespace-nowrap text-(--muted-foreground) tabular-nums"
|
|
73
|
+
title={title}
|
|
74
|
+
>
|
|
75
|
+
{limit !== undefined && (
|
|
76
|
+
<span className="inline-flex gap-[3px]">
|
|
77
|
+
{Array.from({ length: Math.max(limit, building) }, (_, n) => (
|
|
78
|
+
<span
|
|
79
|
+
key={n}
|
|
80
|
+
className="bar h-1.5 w-3 rounded-full"
|
|
81
|
+
style={{ background: n < building ? color : 'var(--border)' }}
|
|
82
|
+
/>
|
|
83
|
+
))}
|
|
84
|
+
</span>
|
|
85
|
+
)}
|
|
86
|
+
{children}
|
|
87
|
+
</span>
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** A switch in a section's header with its visible `label` before it, and before that any `hold` that keeps it from
|
|
92
|
+
* acting, truncating; `title` says what it would do. */
|
|
93
|
+
export function HeaderSwitch({
|
|
94
|
+
label,
|
|
95
|
+
title,
|
|
96
|
+
hold,
|
|
97
|
+
control,
|
|
98
|
+
}: {
|
|
99
|
+
label: string;
|
|
100
|
+
title: string;
|
|
101
|
+
hold?: string | undefined;
|
|
102
|
+
/** The Switch, named by `label` for assistive technology. */
|
|
103
|
+
control: ReactNode;
|
|
104
|
+
}) {
|
|
105
|
+
return (
|
|
106
|
+
<span
|
|
107
|
+
className="auto-build inline-flex min-w-0 items-center gap-1.5 text-[11px] whitespace-nowrap text-(--muted-foreground)"
|
|
108
|
+
title={title}
|
|
109
|
+
>
|
|
110
|
+
{hold && (
|
|
111
|
+
<span className="min-w-0 truncate" title={hold} data-auto-build-hold>
|
|
112
|
+
{hold}
|
|
113
|
+
</span>
|
|
114
|
+
)}
|
|
115
|
+
<span aria-hidden="true">{label}</span>
|
|
116
|
+
{control}
|
|
117
|
+
</span>
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** The stages' sections, one under another, named by `label`. */
|
|
122
|
+
export function StageSections({ label, children }: { label: string; children: ReactNode }) {
|
|
123
|
+
return (
|
|
124
|
+
<section className="stages flex flex-col gap-3" aria-label={label}>
|
|
125
|
+
{children}
|
|
126
|
+
</section>
|
|
127
|
+
);
|
|
128
|
+
}
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
// The board's one work row (board/rows.css), in Queue, Shaping, Ready to build, Build and Concepts and linked work: a
|
|
2
|
+
// first line in columns that line up down the whole board, one button that opens the item's details with the row's
|
|
3
|
+
// action beside it, and under it a second line on the same columns.
|
|
4
|
+
|
|
5
|
+
import { ChevronDownIcon, ChevronRightIcon } from 'lucide-react';
|
|
6
|
+
import type { MouseEvent, ReactNode } from 'react';
|
|
7
|
+
|
|
8
|
+
import { Badge } from '../display/Badge';
|
|
9
|
+
import { Loading } from '../feedback/Loading';
|
|
10
|
+
import { pickedRow, ROW_ACTION, ROW_OPENS, ROW_RULE } from './RowStyles';
|
|
11
|
+
|
|
12
|
+
/** A stage row: `item` names it as `data-item`, and `picked` marks the item the dialog shows. */
|
|
13
|
+
export function StageRowItem({ item, picked, children }: { item: string; picked: boolean; children: ReactNode }) {
|
|
14
|
+
return (
|
|
15
|
+
<li data-item={item} className={`@container py-2 ${ROW_RULE} hover:bg-(--accent) ${pickedRow(picked)}`}>
|
|
16
|
+
{children}
|
|
17
|
+
</li>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** A row's first line: its cells, then its side. */
|
|
22
|
+
export function RowFirst({ children }: { children: ReactNode }) {
|
|
23
|
+
return <div className="row-first">{children}</div>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** A row's first line's cells as the one button that opens its item. */
|
|
27
|
+
export function RowOpen({ onOpen, children }: { onOpen: () => void; children: ReactNode }) {
|
|
28
|
+
return (
|
|
29
|
+
<button type="button" data-row-open data-meta onClick={onOpen} className={`row-cols ${ROW_OPENS}`}>
|
|
30
|
+
{children}
|
|
31
|
+
</button>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** A row's first line's cells, when its title opens the item and the rest of the line does something else. */
|
|
36
|
+
export function RowCells({ children }: { children: ReactNode }) {
|
|
37
|
+
return <div className="row-cols">{children}</div>;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** The first cell: the item's status glyph. */
|
|
41
|
+
export function RowGlyph({ children }: { children: ReactNode }) {
|
|
42
|
+
return (
|
|
43
|
+
<span className="grid size-6 place-items-center" data-glyph>
|
|
44
|
+
{children}
|
|
45
|
+
</span>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** The first cell of a Queue row: its place in the Queue. */
|
|
50
|
+
export function QueuePlace({ children }: { children: ReactNode }) {
|
|
51
|
+
return <span className="queue-n text-center font-medium tabular-nums">{children}</span>;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** Where the item's ticket is saved and its repository, in the source cell. */
|
|
55
|
+
export function RowIdentity({ children }: { children: ReactNode }) {
|
|
56
|
+
return (
|
|
57
|
+
<span data-row-identity className="flex min-w-0 items-center gap-1.5 text-[11px] text-(--muted-foreground)">
|
|
58
|
+
{children}
|
|
59
|
+
</span>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** The kind cell. */
|
|
64
|
+
export function RowKindCell({ children }: { children: ReactNode }) {
|
|
65
|
+
return (
|
|
66
|
+
<span className="flex min-w-0 items-center" data-kind>
|
|
67
|
+
{children}
|
|
68
|
+
</span>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** The title cell: the RowTitle and what it is part of. */
|
|
73
|
+
export function RowTitleCell({ children }: { children: ReactNode }) {
|
|
74
|
+
return (
|
|
75
|
+
<span className="flex min-w-0 items-center gap-2" data-title-cell>
|
|
76
|
+
{children}
|
|
77
|
+
</span>
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** The row's title, truncating; `name` gives it whole. */
|
|
82
|
+
export function RowTitle({ name, children }: { name: string; children: ReactNode }) {
|
|
83
|
+
return (
|
|
84
|
+
<span className="min-w-0 truncate text-sm leading-7 font-medium text-(--foreground)" title={name} data-title>
|
|
85
|
+
{children}
|
|
86
|
+
</span>
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** After the title: which concept or parent the row's work belongs to, giving its room up first. */
|
|
91
|
+
export function RowPartOf({ children }: { children: string }) {
|
|
92
|
+
return (
|
|
93
|
+
<span
|
|
94
|
+
data-concept
|
|
95
|
+
title={children}
|
|
96
|
+
className="max-w-44 min-w-16 shrink-[100] truncate rounded bg-(--muted) px-1.5 text-(--muted-foreground)"
|
|
97
|
+
>
|
|
98
|
+
{children}
|
|
99
|
+
</span>
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/** The state cell, which `clips` what overflows it unless what it holds keeps its own width. */
|
|
104
|
+
export function RowStateCell({ clips = true, children }: { clips?: boolean; children: ReactNode }) {
|
|
105
|
+
return (
|
|
106
|
+
<span className={`flex min-w-0 items-center gap-1.5${clips ? ' overflow-hidden' : ''}`} data-col="state">
|
|
107
|
+
{children}
|
|
108
|
+
</span>
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** The row's state in words; `title` says more. */
|
|
113
|
+
export function RowState({ title, children }: { title?: string; children: ReactNode }) {
|
|
114
|
+
return (
|
|
115
|
+
<span className="max-w-full shrink-0 truncate" title={title} data-state>
|
|
116
|
+
{children}
|
|
117
|
+
</span>
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** A Queue row's state: how long it has waited. */
|
|
122
|
+
export function QueueAge({ children }: { children: ReactNode }) {
|
|
123
|
+
return (
|
|
124
|
+
<span className="queue-age shrink-0 tabular-nums" data-state>
|
|
125
|
+
{children}
|
|
126
|
+
</span>
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/** The row's action slot, at its right. With `passEmpty`, clicks on its controls stay there, and a click beside them
|
|
131
|
+
* reaches the row. */
|
|
132
|
+
export function RowSide({ passEmpty = false, children }: { passEmpty?: boolean; children: ReactNode }) {
|
|
133
|
+
if (!passEmpty)
|
|
134
|
+
return (
|
|
135
|
+
<span data-col="side" className={`row-side ${ROW_ACTION}`}>
|
|
136
|
+
{children}
|
|
137
|
+
</span>
|
|
138
|
+
);
|
|
139
|
+
|
|
140
|
+
return (
|
|
141
|
+
<span data-col="side" className="row-side">
|
|
142
|
+
<span
|
|
143
|
+
className={ROW_ACTION}
|
|
144
|
+
onClick={(event) => {
|
|
145
|
+
if (event.target !== event.currentTarget) event.stopPropagation();
|
|
146
|
+
}}
|
|
147
|
+
>
|
|
148
|
+
{children}
|
|
149
|
+
</span>
|
|
150
|
+
</span>
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/** Where to act on an item that waits on you, in its action slot. */
|
|
155
|
+
export function OnYourDesk({ children }: { children: ReactNode }) {
|
|
156
|
+
return <span className="text-(--warning-foreground)">{children}</span>;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/** A row's second line: `bar` and `count` on the left, `children` in its text slot, then its pull requests and
|
|
160
|
+
* figures. A click on it beside its controls goes to `onClick`. */
|
|
161
|
+
export function RowSecondLine({
|
|
162
|
+
bar,
|
|
163
|
+
count,
|
|
164
|
+
prs,
|
|
165
|
+
figures,
|
|
166
|
+
onClick,
|
|
167
|
+
children,
|
|
168
|
+
}: {
|
|
169
|
+
bar?: ReactNode;
|
|
170
|
+
/** A RowCount or RowSliceToggle; with none, its cell stays empty. */
|
|
171
|
+
count?: ReactNode;
|
|
172
|
+
/** The pull requests, as PullRequestRefs. */
|
|
173
|
+
prs?: ReactNode;
|
|
174
|
+
figures?: ReactNode;
|
|
175
|
+
onClick?: ((event: MouseEvent<HTMLElement>) => void) | undefined;
|
|
176
|
+
children?: ReactNode;
|
|
177
|
+
}) {
|
|
178
|
+
return (
|
|
179
|
+
<div data-progress onClick={onClick} className={`row-second ${onClick ? 'cursor-pointer' : ''}`}>
|
|
180
|
+
<span data-col="bar" className="min-w-0">
|
|
181
|
+
{bar}
|
|
182
|
+
</span>
|
|
183
|
+
{count || <span data-col="count" />}
|
|
184
|
+
<span data-col="next" className="flex min-w-0 items-center gap-3">
|
|
185
|
+
{children}
|
|
186
|
+
</span>
|
|
187
|
+
<span data-col="pr" className="flex min-w-0 gap-2 overflow-hidden tabular-nums">
|
|
188
|
+
{prs}
|
|
189
|
+
</span>
|
|
190
|
+
<span data-col="figures">{figures}</span>
|
|
191
|
+
</div>
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/** The second line's count, such as `2/5 parts`. */
|
|
196
|
+
export function RowCount({ title, children }: { title?: string; children: ReactNode }) {
|
|
197
|
+
return (
|
|
198
|
+
<span data-col="count" className="tabular-nums" title={title}>
|
|
199
|
+
{children}
|
|
200
|
+
</span>
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/** The second line's slice count as a button that unfolds the row's slices under it. */
|
|
205
|
+
export function RowSliceToggle({
|
|
206
|
+
open,
|
|
207
|
+
label,
|
|
208
|
+
onToggle,
|
|
209
|
+
children,
|
|
210
|
+
}: {
|
|
211
|
+
open: boolean;
|
|
212
|
+
/** Names the button, as what it does now. */
|
|
213
|
+
label: string;
|
|
214
|
+
onToggle: () => void;
|
|
215
|
+
children: ReactNode;
|
|
216
|
+
}) {
|
|
217
|
+
return (
|
|
218
|
+
<button
|
|
219
|
+
type="button"
|
|
220
|
+
aria-expanded={open}
|
|
221
|
+
aria-label={label}
|
|
222
|
+
onClick={onToggle}
|
|
223
|
+
data-col="count"
|
|
224
|
+
className={`flex h-4 items-center gap-1 justify-self-start rounded tabular-nums hover:text-(--foreground) ${ROW_OPENS}`}
|
|
225
|
+
>
|
|
226
|
+
{children}
|
|
227
|
+
{open ? <ChevronDownIcon className="size-3" /> : <ChevronRightIcon className="size-3" />}
|
|
228
|
+
</button>
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/** Why the row is blocked, as a danger badge in its second line that truncates. */
|
|
233
|
+
export function RowBlocked({ children }: { children: string }) {
|
|
234
|
+
return (
|
|
235
|
+
<Badge tone="danger" className="min-w-0" title={children} data-blocked>
|
|
236
|
+
<span className="truncate">{children}</span>
|
|
237
|
+
</Badge>
|
|
238
|
+
);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
const SLICE_TONE = { blocked: 'text-(--st-review)', active: 'text-(--st-now)' } as const;
|
|
242
|
+
|
|
243
|
+
/** The second line's word on the row's slices: its first blocked or active slice, `more` after it, and anything `after`
|
|
244
|
+
* that (such as that every slice is implemented); `title` lists them all. */
|
|
245
|
+
export function RowSliceNote({
|
|
246
|
+
title,
|
|
247
|
+
first,
|
|
248
|
+
more,
|
|
249
|
+
after,
|
|
250
|
+
}: {
|
|
251
|
+
title?: string | undefined;
|
|
252
|
+
first?: { word: string; tone: keyof typeof SLICE_TONE; title: string } | undefined;
|
|
253
|
+
more?: string | undefined;
|
|
254
|
+
after?: string | undefined;
|
|
255
|
+
}) {
|
|
256
|
+
return (
|
|
257
|
+
<span data-note className="min-w-0 truncate" title={title}>
|
|
258
|
+
{first && (
|
|
259
|
+
<>
|
|
260
|
+
<span className={`font-medium ${SLICE_TONE[first.tone]}`}>{first.word}</span>{' '}
|
|
261
|
+
<span className="text-(--foreground)">{first.title}</span>
|
|
262
|
+
{more}
|
|
263
|
+
</>
|
|
264
|
+
)}
|
|
265
|
+
{after && <span>{after}</span>}
|
|
266
|
+
</span>
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/** Under a row: Start's message or error and what Auto-build says of it, taking no room when empty. */
|
|
271
|
+
export function RowFoot({ children }: { children: ReactNode }) {
|
|
272
|
+
return <div className="pt-1 pr-3 pl-12 empty:hidden">{children}</div>;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/** Under a row: its unfolded slices. */
|
|
276
|
+
export function RowSlices({ children }: { children: ReactNode }) {
|
|
277
|
+
return (
|
|
278
|
+
<div className="pt-1 pr-3 pl-10" data-slices>
|
|
279
|
+
{children}
|
|
280
|
+
</div>
|
|
281
|
+
);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/** The agent figures on one line, at the row's right: `text`, ending in a + when `partial`, or `incomplete` when there
|
|
285
|
+
* are no figures to show; while `updating`, a spinner named by it leads them. A row that stops animating keeps its
|
|
286
|
+
* spinner `still`. */
|
|
287
|
+
export function UsageFigures({
|
|
288
|
+
title,
|
|
289
|
+
text,
|
|
290
|
+
updating,
|
|
291
|
+
still = false,
|
|
292
|
+
partial,
|
|
293
|
+
incomplete,
|
|
294
|
+
}: {
|
|
295
|
+
title: string;
|
|
296
|
+
text?: string | null | undefined;
|
|
297
|
+
updating?: string | undefined;
|
|
298
|
+
still?: boolean;
|
|
299
|
+
/** Screen-reader words for the +. */
|
|
300
|
+
partial?: string | undefined;
|
|
301
|
+
/** The words in place of figures for an incomplete total with none to show. */
|
|
302
|
+
incomplete?: string | undefined;
|
|
303
|
+
}) {
|
|
304
|
+
return (
|
|
305
|
+
<span
|
|
306
|
+
className="flex min-w-0 items-center justify-end gap-1 text-(--muted-foreground) tabular-nums"
|
|
307
|
+
title={title}
|
|
308
|
+
>
|
|
309
|
+
{updating && <Loading presentation="inline" title={updating} still={still} />}
|
|
310
|
+
{text && <span className="truncate">{text}</span>}
|
|
311
|
+
{text
|
|
312
|
+
? partial && (
|
|
313
|
+
<span className="-ml-1 shrink-0" data-partial>
|
|
314
|
+
+<span className="sr-only"> {partial}</span>
|
|
315
|
+
</span>
|
|
316
|
+
)
|
|
317
|
+
: incomplete && <span className="shrink-0">{incomplete}</span>}
|
|
318
|
+
</span>
|
|
319
|
+
);
|
|
320
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
const PAST = 'color-mix(in srgb, var(--foreground) 28%, transparent)';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A piece of work's place on the board's active stages: one segment per stage, the past ones filled, and the current
|
|
7
|
+
* one half-filled in `color` under `glyph` (its status glyph), faint and ringed dashed while it `waiting`s. Complete
|
|
8
|
+
* work shows `glyph` alone, a tick, in place of the track.
|
|
9
|
+
*/
|
|
10
|
+
export function StageTrack({
|
|
11
|
+
stages,
|
|
12
|
+
at,
|
|
13
|
+
color,
|
|
14
|
+
glyph,
|
|
15
|
+
title,
|
|
16
|
+
waiting = false,
|
|
17
|
+
complete = false,
|
|
18
|
+
}: {
|
|
19
|
+
/** The stages' names, in order. */
|
|
20
|
+
stages: readonly string[];
|
|
21
|
+
/** The current stage's index. */
|
|
22
|
+
at: number;
|
|
23
|
+
color: string;
|
|
24
|
+
glyph: ReactNode;
|
|
25
|
+
title: string;
|
|
26
|
+
waiting?: boolean;
|
|
27
|
+
complete?: boolean;
|
|
28
|
+
}) {
|
|
29
|
+
if (complete)
|
|
30
|
+
return (
|
|
31
|
+
<span className="flex h-5 items-center" title={title}>
|
|
32
|
+
{glyph}
|
|
33
|
+
</span>
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<ol className="m-0 grid list-none grid-cols-5 gap-px p-0" title={title}>
|
|
38
|
+
{stages.map((name, n) => (
|
|
39
|
+
<li key={name} className="relative flex h-5 items-center justify-center">
|
|
40
|
+
<span
|
|
41
|
+
className={`absolute inset-x-0 h-1.5 ${n === 0 ? 'rounded-l-full' : ''} ${n === stages.length - 1 ? 'rounded-r-full' : ''}`}
|
|
42
|
+
style={{ background: n < at ? PAST : 'var(--soft)' }}
|
|
43
|
+
/>
|
|
44
|
+
{n === at && (
|
|
45
|
+
<>
|
|
46
|
+
<span
|
|
47
|
+
className={`absolute right-1/2 left-0 h-1.5 ${n === 0 ? 'rounded-l-full' : ''}`}
|
|
48
|
+
style={{ background: color, opacity: waiting ? 0.35 : 1 }}
|
|
49
|
+
/>
|
|
50
|
+
<span
|
|
51
|
+
className={`relative grid size-5 place-items-center rounded-full bg-(--card) ${waiting ? 'border border-dashed border-(--muted-foreground)' : ''}`}
|
|
52
|
+
>
|
|
53
|
+
{glyph}
|
|
54
|
+
</span>
|
|
55
|
+
</>
|
|
56
|
+
)}
|
|
57
|
+
</li>
|
|
58
|
+
))}
|
|
59
|
+
</ol>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// What sits around a piece of work's Start (board/items.css): the group that holds it, the tag that takes its place once
|
|
2
|
+
// a thread started, and the line under it with Start's message or error.
|
|
3
|
+
|
|
4
|
+
import type { ReactNode, Ref } from 'react';
|
|
5
|
+
|
|
6
|
+
import { Badge } from '../display/Badge';
|
|
7
|
+
import type { DataAttributes } from './DataAttributes';
|
|
8
|
+
|
|
9
|
+
/** Start and what goes with it, at the right of its row, wrapping. */
|
|
10
|
+
export function StartGroup({ children }: { children: ReactNode }) {
|
|
11
|
+
return <span className="start-group">{children}</span>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** A sentence on a line of its own in StartGroup, such as "Run finished.". */
|
|
15
|
+
export function StartNote({ children }: { children: ReactNode }) {
|
|
16
|
+
return <span className="basis-full">{children}</span>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** The tag that takes Start's place: Started, or May have started while it's `unsure`. It takes focus back from a closed
|
|
20
|
+
* message, so it is focusable from script. */
|
|
21
|
+
export function StartTag({
|
|
22
|
+
unsure = false,
|
|
23
|
+
title,
|
|
24
|
+
children,
|
|
25
|
+
...data
|
|
26
|
+
}: {
|
|
27
|
+
unsure?: boolean;
|
|
28
|
+
title: string;
|
|
29
|
+
children: ReactNode;
|
|
30
|
+
} & DataAttributes) {
|
|
31
|
+
return (
|
|
32
|
+
<Badge
|
|
33
|
+
{...data}
|
|
34
|
+
tone={unsure ? 'warning' : 'success'}
|
|
35
|
+
className={unsure ? 'started-tag unsure' : 'started-tag'}
|
|
36
|
+
tabIndex={-1}
|
|
37
|
+
title={title}
|
|
38
|
+
>
|
|
39
|
+
{children}
|
|
40
|
+
</Badge>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** The small line under Start: its message or error, or what Auto-build says of the item. */
|
|
45
|
+
export function StartLine({
|
|
46
|
+
ref,
|
|
47
|
+
tabIndex,
|
|
48
|
+
children,
|
|
49
|
+
...data
|
|
50
|
+
}: {
|
|
51
|
+
ref?: Ref<HTMLParagraphElement>;
|
|
52
|
+
tabIndex?: number;
|
|
53
|
+
children: ReactNode;
|
|
54
|
+
} & DataAttributes) {
|
|
55
|
+
return (
|
|
56
|
+
<p {...data} ref={ref} tabIndex={tabIndex} className="start">
|
|
57
|
+
{children}
|
|
58
|
+
</p>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** An action's error in the danger text colour, on its own line after the controls beside it. */
|
|
63
|
+
export function ActionError({
|
|
64
|
+
ref,
|
|
65
|
+
role,
|
|
66
|
+
children,
|
|
67
|
+
}: {
|
|
68
|
+
ref?: Ref<HTMLSpanElement>;
|
|
69
|
+
role?: 'alert';
|
|
70
|
+
children: ReactNode;
|
|
71
|
+
}) {
|
|
72
|
+
return (
|
|
73
|
+
<span ref={ref} role={role} className="action-error">
|
|
74
|
+
{children}
|
|
75
|
+
</span>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// The board's statuses and the colour each is drawn in (board/tokens.css's --st-* colours).
|
|
2
|
+
|
|
3
|
+
/** A piece of work's status on the board. */
|
|
4
|
+
export type BoardStatus =
|
|
5
|
+
| 'List'
|
|
6
|
+
| 'Queued'
|
|
7
|
+
| 'Shaping'
|
|
8
|
+
| 'Needs you'
|
|
9
|
+
| 'Ready'
|
|
10
|
+
| 'In progress'
|
|
11
|
+
| 'Review'
|
|
12
|
+
| 'Verify'
|
|
13
|
+
| 'Ready to merge'
|
|
14
|
+
| 'Done';
|
|
15
|
+
|
|
16
|
+
/** Each status's colour, as a CSS colour value. */
|
|
17
|
+
export const statusColor: Record<BoardStatus, string> = {
|
|
18
|
+
List: 'var(--st-idle)',
|
|
19
|
+
Queued: 'var(--st-idle)',
|
|
20
|
+
Shaping: 'var(--st-now)',
|
|
21
|
+
'Needs you': 'var(--st-amber)',
|
|
22
|
+
Ready: 'var(--st-now)',
|
|
23
|
+
'In progress': 'var(--st-now)',
|
|
24
|
+
Review: 'var(--st-review)',
|
|
25
|
+
Verify: 'var(--st-amber)',
|
|
26
|
+
'Ready to merge': 'var(--st-done)',
|
|
27
|
+
Done: 'var(--st-done)',
|
|
28
|
+
};
|