@lar-works/design-system 0.2.1 → 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/styles.css +3 -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,435 @@
|
|
|
1
|
+
// What Lar Factory's item dialog shows from a piece of work's details: its sections' headings, the meta area's facts
|
|
2
|
+
// and people, the main column's description, record and comments, and the sidebar's lists.
|
|
3
|
+
|
|
4
|
+
import { CircleCheckIcon, CircleDotIcon } from 'lucide-react';
|
|
5
|
+
import type { ReactNode, Ref } from 'react';
|
|
6
|
+
|
|
7
|
+
import type { DataAttributes } from './DataAttributes';
|
|
8
|
+
|
|
9
|
+
const headings = {
|
|
10
|
+
section: 'm-0 text-[13px] font-medium',
|
|
11
|
+
muted: 'm-0 text-[13px] font-medium text-(--muted-foreground)',
|
|
12
|
+
label: 'm-0 text-[11px] font-medium tracking-wider text-(--muted-foreground) uppercase',
|
|
13
|
+
} as const;
|
|
14
|
+
|
|
15
|
+
/** A section's heading: a sidebar `section`'s, a `muted` one over the comments or a description's own section, or the
|
|
16
|
+
* small uppercase `label` over the description and the record. `as` a `label` it names the field `htmlFor` names, or
|
|
17
|
+
* as a `span` a group that names itself. */
|
|
18
|
+
export function DetailsHeading({
|
|
19
|
+
presentation = 'section',
|
|
20
|
+
as = 'h2',
|
|
21
|
+
htmlFor,
|
|
22
|
+
children,
|
|
23
|
+
}: {
|
|
24
|
+
presentation?: keyof typeof headings;
|
|
25
|
+
as?: 'h2' | 'label' | 'span';
|
|
26
|
+
htmlFor?: string | undefined;
|
|
27
|
+
children: ReactNode;
|
|
28
|
+
}) {
|
|
29
|
+
if (as === 'label')
|
|
30
|
+
return (
|
|
31
|
+
<label htmlFor={htmlFor} className={headings[presentation]}>
|
|
32
|
+
{children}
|
|
33
|
+
</label>
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
if (as === 'span') return <span className={headings[presentation]}>{children}</span>;
|
|
37
|
+
|
|
38
|
+
return <h2 className={headings[presentation]}>{children}</h2>;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** A sidebar section, or a section of the body such as a concept's parts: its heading over its content. */
|
|
42
|
+
export function DetailsSection({
|
|
43
|
+
heading,
|
|
44
|
+
children,
|
|
45
|
+
...data
|
|
46
|
+
}: {
|
|
47
|
+
heading: ReactNode;
|
|
48
|
+
children: ReactNode;
|
|
49
|
+
} & DataAttributes) {
|
|
50
|
+
return (
|
|
51
|
+
<section {...data} className="grid min-w-0 grid-cols-[minmax(0,1fr)] gap-2">
|
|
52
|
+
<DetailsHeading>{heading}</DetailsHeading>
|
|
53
|
+
{children}
|
|
54
|
+
</section>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** A section of the description, such as Acceptance Criteria: its muted heading over its text. */
|
|
59
|
+
export function TextSection({ heading, children }: { heading: ReactNode; children: ReactNode }) {
|
|
60
|
+
return (
|
|
61
|
+
<section className="grid min-w-0 gap-2">
|
|
62
|
+
<DetailsHeading presentation="muted">{heading}</DetailsHeading>
|
|
63
|
+
{children}
|
|
64
|
+
</section>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* A section of the main column, beside the sidebar: the record, description or comments, its `header` over its
|
|
70
|
+
* content. When it `fill`s, its content takes the height left.
|
|
71
|
+
*/
|
|
72
|
+
export function MainSection({
|
|
73
|
+
as: Tag = 'div',
|
|
74
|
+
header,
|
|
75
|
+
fill = false,
|
|
76
|
+
children,
|
|
77
|
+
...data
|
|
78
|
+
}: {
|
|
79
|
+
as?: 'div' | 'section';
|
|
80
|
+
header: ReactNode;
|
|
81
|
+
fill?: boolean;
|
|
82
|
+
children: ReactNode;
|
|
83
|
+
} & DataAttributes) {
|
|
84
|
+
return (
|
|
85
|
+
<Tag
|
|
86
|
+
{...data}
|
|
87
|
+
className={`grid min-w-0 gap-2 ${fill ? 'min-h-0 grid-rows-[auto_minmax(0,1fr)]' : ''} @min-[45rem]:col-start-1`}
|
|
88
|
+
>
|
|
89
|
+
{header}
|
|
90
|
+
{children}
|
|
91
|
+
</Tag>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** A main section's header row: its small uppercase `heading`, then its actions at the end. */
|
|
96
|
+
export function SectionHeader({ heading, children }: { heading: ReactNode; children?: ReactNode }) {
|
|
97
|
+
return (
|
|
98
|
+
<div className="flex h-7 items-center justify-between gap-2">
|
|
99
|
+
<DetailsHeading presentation="label">{heading}</DetailsHeading>
|
|
100
|
+
{children && <span className="flex min-w-0 items-center gap-3">{children}</span>}
|
|
101
|
+
</div>
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** A short status in a section's header, such as a save that could not be read back, truncating. */
|
|
106
|
+
export function HeaderStatus({ children }: { children: string }) {
|
|
107
|
+
return (
|
|
108
|
+
<span className="truncate text-xs text-(--muted-foreground)" role="status" title={children}>
|
|
109
|
+
{children}
|
|
110
|
+
</span>
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** A line of the details in the body size: an error, announced, or a muted empty state. `mainColumn` keeps it in the
|
|
115
|
+
* main column beside the sidebar. */
|
|
116
|
+
export function DetailsText({
|
|
117
|
+
tone = 'muted',
|
|
118
|
+
mainColumn = false,
|
|
119
|
+
children,
|
|
120
|
+
}: {
|
|
121
|
+
tone?: 'muted' | 'error';
|
|
122
|
+
mainColumn?: boolean;
|
|
123
|
+
children: ReactNode;
|
|
124
|
+
}) {
|
|
125
|
+
return (
|
|
126
|
+
<p
|
|
127
|
+
className={`m-0 text-sm ${tone === 'error' ? 'text-(--error-foreground)' : 'text-(--muted-foreground)'}${mainColumn ? ' @min-[45rem]:col-start-1' : ''}`}
|
|
128
|
+
role={tone === 'error' ? 'alert' : undefined}
|
|
129
|
+
>
|
|
130
|
+
{children}
|
|
131
|
+
</p>
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/** A placeholder that keeps the main column's place while the details load. */
|
|
136
|
+
export function MainColumnSlot({ children }: { children: ReactNode }) {
|
|
137
|
+
return <div className="@min-[45rem]:col-start-1">{children}</div>;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/** The meta area under the summary: its facts, wrapping onto as many lines as the width needs. */
|
|
141
|
+
export function MetaArea({ children, ...data }: { children: ReactNode } & DataAttributes) {
|
|
142
|
+
return (
|
|
143
|
+
<div {...data} className="flex min-w-0 flex-wrap items-center gap-x-5 gap-y-2">
|
|
144
|
+
{children}
|
|
145
|
+
</div>
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* A labelled fact: in the meta area, its value wrapping rather than running past the dialog; in a `record`, a fact of
|
|
151
|
+
* the work record whose value wraps onto lines of its own.
|
|
152
|
+
*/
|
|
153
|
+
export function DetailFact({
|
|
154
|
+
label,
|
|
155
|
+
presentation = 'meta',
|
|
156
|
+
children,
|
|
157
|
+
...data
|
|
158
|
+
}: {
|
|
159
|
+
label: string;
|
|
160
|
+
presentation?: 'meta' | 'record';
|
|
161
|
+
children: ReactNode;
|
|
162
|
+
} & DataAttributes) {
|
|
163
|
+
if (presentation === 'record')
|
|
164
|
+
return (
|
|
165
|
+
<div {...data} className="flex min-w-0 flex-wrap items-baseline gap-x-1.5 text-sm">
|
|
166
|
+
<span className="shrink-0 text-xs text-(--muted-foreground)">{label}</span>
|
|
167
|
+
{children}
|
|
168
|
+
</div>
|
|
169
|
+
);
|
|
170
|
+
|
|
171
|
+
return (
|
|
172
|
+
<div {...data} className="flex max-w-full min-w-0 items-baseline gap-1.5 text-sm">
|
|
173
|
+
<span className="shrink-0 text-xs text-(--muted-foreground)">{label}</span>
|
|
174
|
+
<span className="min-w-0 wrap-anywhere">{children}</span>
|
|
175
|
+
</div>
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/** A line of short items, such as a review round's verdicts, wrapping. */
|
|
180
|
+
export function InlineList({ items }: { items: readonly string[] }) {
|
|
181
|
+
return (
|
|
182
|
+
<ul className="m-0 flex list-none flex-wrap gap-x-3 p-0">
|
|
183
|
+
{items.map((item, index) => (
|
|
184
|
+
<li key={index}>{item}</li>
|
|
185
|
+
))}
|
|
186
|
+
</ul>
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/** Facts one under the other, such as a record's review rounds. */
|
|
191
|
+
export function FactList({ children, ...data }: { children: ReactNode } & DataAttributes) {
|
|
192
|
+
return (
|
|
193
|
+
<div {...data} className="grid gap-1">
|
|
194
|
+
{children}
|
|
195
|
+
</div>
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/** The editor's slot in a main section: a column that takes the height left when it `fill`s. */
|
|
200
|
+
export function EditorSlot({ fill, children }: { fill: boolean; children: ReactNode }) {
|
|
201
|
+
return <div className={fill ? 'flex min-h-0 flex-col' : 'contents'}>{children}</div>;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/** Under an editor: whether it changed, or `error` in its place, announced and wrapping, then its buttons. */
|
|
205
|
+
export function EditActions({
|
|
206
|
+
status,
|
|
207
|
+
error,
|
|
208
|
+
children,
|
|
209
|
+
...data
|
|
210
|
+
}: {
|
|
211
|
+
status: string;
|
|
212
|
+
error?: string | null | undefined;
|
|
213
|
+
children: ReactNode;
|
|
214
|
+
} & DataAttributes) {
|
|
215
|
+
return (
|
|
216
|
+
<div {...data} className="flex items-start gap-2">
|
|
217
|
+
{error ? (
|
|
218
|
+
<p className="m-0 me-auto min-w-0 flex-1 py-1.5 text-xs text-(--error-foreground)" role="alert">
|
|
219
|
+
{error}
|
|
220
|
+
</p>
|
|
221
|
+
) : (
|
|
222
|
+
<span className="me-auto min-w-0 flex-1 py-1.5 text-xs text-(--muted-foreground)">{status}</span>
|
|
223
|
+
)}
|
|
224
|
+
{children}
|
|
225
|
+
</div>
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/** How a Spec's sync stands: its `status`, announced, then what answers it, then an `error`, announced. */
|
|
230
|
+
export function SpecSync({
|
|
231
|
+
status,
|
|
232
|
+
error,
|
|
233
|
+
children,
|
|
234
|
+
}: {
|
|
235
|
+
status?: string | undefined;
|
|
236
|
+
error?: string | null | undefined;
|
|
237
|
+
children?: ReactNode;
|
|
238
|
+
}) {
|
|
239
|
+
return (
|
|
240
|
+
<div className="grid gap-2 text-sm" data-spec-sync>
|
|
241
|
+
{status && (
|
|
242
|
+
<p className="m-0" role="status">
|
|
243
|
+
{status}
|
|
244
|
+
</p>
|
|
245
|
+
)}
|
|
246
|
+
{children}
|
|
247
|
+
{error && (
|
|
248
|
+
<p className="m-0 text-(--error-foreground)" role="alert">
|
|
249
|
+
{error}
|
|
250
|
+
</p>
|
|
251
|
+
)}
|
|
252
|
+
</div>
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/** Linked work items, such as sub-tickets or blockers, one TicketLink each; or attachments, one AttachmentLink each. */
|
|
257
|
+
export function TicketLinkList({ children }: { children: ReactNode }) {
|
|
258
|
+
return <ul className="m-0 grid list-none gap-1.5 p-0">{children}</ul>;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/** A linked work item: done or open (`stateLabel` names it), its `reference` and `title` linked, and its tracker's
|
|
262
|
+
* `fields` under them. */
|
|
263
|
+
export function TicketLink({
|
|
264
|
+
closed,
|
|
265
|
+
stateLabel,
|
|
266
|
+
href,
|
|
267
|
+
reference,
|
|
268
|
+
title,
|
|
269
|
+
fields,
|
|
270
|
+
}: {
|
|
271
|
+
closed: boolean;
|
|
272
|
+
stateLabel: string;
|
|
273
|
+
href: string;
|
|
274
|
+
reference: string;
|
|
275
|
+
title: string;
|
|
276
|
+
fields?: ReactNode;
|
|
277
|
+
}) {
|
|
278
|
+
return (
|
|
279
|
+
<li className="flex items-start gap-2 text-sm">
|
|
280
|
+
{closed ? (
|
|
281
|
+
<CircleCheckIcon aria-label={stateLabel} className="mt-0.5 size-3.5 shrink-0 text-(--success)" />
|
|
282
|
+
) : (
|
|
283
|
+
<CircleDotIcon aria-label={stateLabel} className="mt-0.5 size-3.5 shrink-0 text-(--muted-foreground)" />
|
|
284
|
+
)}
|
|
285
|
+
<span className="min-w-0">
|
|
286
|
+
<a href={href} target="_blank" rel="noopener" className="wrap-anywhere hover:underline">
|
|
287
|
+
<span className="text-(--muted-foreground)">{reference}</span> {title}
|
|
288
|
+
</a>
|
|
289
|
+
{fields}
|
|
290
|
+
</span>
|
|
291
|
+
</li>
|
|
292
|
+
);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/** An attachment's name, linked. */
|
|
296
|
+
export function AttachmentLink({ href, name }: { href: string; name: string }) {
|
|
297
|
+
return (
|
|
298
|
+
<li className="text-sm">
|
|
299
|
+
<a href={href} target="_blank" rel="noopener" className="wrap-anywhere underline">
|
|
300
|
+
{name}
|
|
301
|
+
</a>
|
|
302
|
+
</li>
|
|
303
|
+
);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/** A sprint's count over its children: `count` ("This sprint: 2 of 5 done") and the sprint's `name`. */
|
|
307
|
+
export function SprintCount({ count, name }: { count: string; name: string }) {
|
|
308
|
+
return (
|
|
309
|
+
<div className="text-sm">
|
|
310
|
+
<p className="m-0 font-medium">{count}</p>
|
|
311
|
+
<p className="m-0 text-xs text-(--muted-foreground)">{name}</p>
|
|
312
|
+
</div>
|
|
313
|
+
);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/** The work an item waits on, struck through once closed. */
|
|
317
|
+
export function WaitsOnList({ items }: { items: readonly { key: string; title: string; closed: boolean }[] }) {
|
|
318
|
+
return (
|
|
319
|
+
<ul className="m-0 grid list-none gap-1.5 p-0 text-sm" data-waits-on>
|
|
320
|
+
{items.map((item) => (
|
|
321
|
+
<li key={item.key} className={item.closed ? 'text-(--muted-foreground) line-through' : ''}>
|
|
322
|
+
{item.title}
|
|
323
|
+
</li>
|
|
324
|
+
))}
|
|
325
|
+
</ul>
|
|
326
|
+
);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/** Chips in a wrapping line, grouped with no box of their own, such as the labels fact's, for tests to name. */
|
|
330
|
+
export function ChipGroup({ children, ...data }: { children: ReactNode } & DataAttributes) {
|
|
331
|
+
return (
|
|
332
|
+
<span {...data} className="contents">
|
|
333
|
+
{children}
|
|
334
|
+
</span>
|
|
335
|
+
);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/** A popover's panel for picking labels: 18rem wide, its picker over its status. */
|
|
339
|
+
export function LabelEditorPanel({ children }: { children: ReactNode }) {
|
|
340
|
+
return <div className="grid w-72 gap-2">{children}</div>;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/** A kind change that failed: each of its `lines`, then the `action` that retries it, announced. */
|
|
344
|
+
export function ChangeFailed({
|
|
345
|
+
lines,
|
|
346
|
+
action,
|
|
347
|
+
...data
|
|
348
|
+
}: {
|
|
349
|
+
lines: readonly string[];
|
|
350
|
+
action: ReactNode;
|
|
351
|
+
} & DataAttributes) {
|
|
352
|
+
return (
|
|
353
|
+
<div {...data} role="alert" className="grid w-full justify-items-start gap-1 text-xs text-(--error-foreground)">
|
|
354
|
+
{lines.map((line, index) => (
|
|
355
|
+
<p key={index} className="m-0">
|
|
356
|
+
{line}
|
|
357
|
+
</p>
|
|
358
|
+
))}
|
|
359
|
+
{action}
|
|
360
|
+
</div>
|
|
361
|
+
);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
/** Where the item's kind and its ticket's disagree: the `message`, the `actions` that answer it, then a `hint` and any
|
|
365
|
+
* `error`, which the caller renders as caption Text. */
|
|
366
|
+
export function KindQuestion({
|
|
367
|
+
message,
|
|
368
|
+
actions,
|
|
369
|
+
children,
|
|
370
|
+
...data
|
|
371
|
+
}: {
|
|
372
|
+
message: string;
|
|
373
|
+
actions: ReactNode;
|
|
374
|
+
children?: ReactNode;
|
|
375
|
+
} & DataAttributes) {
|
|
376
|
+
return (
|
|
377
|
+
<div {...data} className="grid w-full gap-2 rounded-lg border border-(--border) p-3">
|
|
378
|
+
<p className="m-0 text-sm">{message}</p>
|
|
379
|
+
<span className="flex flex-wrap gap-2">{actions}</span>
|
|
380
|
+
{children}
|
|
381
|
+
</div>
|
|
382
|
+
);
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
/** A ticket's outgoing title and text, as the tracker will receive them; the labels name each for assistive
|
|
386
|
+
* technology. */
|
|
387
|
+
export function OutgoingTicket({
|
|
388
|
+
title,
|
|
389
|
+
text,
|
|
390
|
+
titleLabel,
|
|
391
|
+
textLabel,
|
|
392
|
+
}: {
|
|
393
|
+
title: string;
|
|
394
|
+
text: string;
|
|
395
|
+
titleLabel: string;
|
|
396
|
+
textLabel: string;
|
|
397
|
+
}) {
|
|
398
|
+
return (
|
|
399
|
+
<>
|
|
400
|
+
<div aria-label={titleLabel} className="font-medium wrap-anywhere">
|
|
401
|
+
{title}
|
|
402
|
+
</div>
|
|
403
|
+
<pre
|
|
404
|
+
aria-label={textLabel}
|
|
405
|
+
className="m-0 max-h-64 overflow-auto text-xs wrap-anywhere whitespace-pre-wrap"
|
|
406
|
+
>
|
|
407
|
+
{text}
|
|
408
|
+
</pre>
|
|
409
|
+
</>
|
|
410
|
+
);
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
/** A check's run: its `command`, then what it says of the run. */
|
|
414
|
+
export function CheckRun({ command, children }: { command: string; children: ReactNode }) {
|
|
415
|
+
return (
|
|
416
|
+
<section className="min-w-0 rounded border border-(--border) p-2">
|
|
417
|
+
<code className="wrap-anywhere whitespace-pre-wrap">{command}</code>
|
|
418
|
+
{children}
|
|
419
|
+
</section>
|
|
420
|
+
);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
/** A section's own scrolling panel that focus moves to when it opens, such as Create issue's; `label` names it. */
|
|
424
|
+
export function FocusPanel({ label, ref, children }: { label: string; ref?: Ref<HTMLElement>; children: ReactNode }) {
|
|
425
|
+
return (
|
|
426
|
+
<section
|
|
427
|
+
ref={ref}
|
|
428
|
+
tabIndex={-1}
|
|
429
|
+
aria-label={label}
|
|
430
|
+
className="grid max-h-[50dvh] w-full gap-3 overflow-y-auto pt-1"
|
|
431
|
+
>
|
|
432
|
+
{children}
|
|
433
|
+
</section>
|
|
434
|
+
);
|
|
435
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
// The frame of Lar Factory's item dialog: the summary under its title, the body's column with the main column and the
|
|
2
|
+
// sidebar beside it, its notes, and the footer's groups of actions.
|
|
3
|
+
|
|
4
|
+
import type { ReactNode } from 'react';
|
|
5
|
+
|
|
6
|
+
import type { DataAttributes } from './DataAttributes';
|
|
7
|
+
import { WARNING_PANEL } from './RowStyles';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The summary under the dialog's title, a row each: `line` (the item's source, repository, status and age), its
|
|
11
|
+
* `parent`, its `kind` and its ticket `actions`.
|
|
12
|
+
*/
|
|
13
|
+
export function ItemSummary({
|
|
14
|
+
line,
|
|
15
|
+
parent,
|
|
16
|
+
kind,
|
|
17
|
+
actions,
|
|
18
|
+
...data
|
|
19
|
+
}: {
|
|
20
|
+
line: ReactNode;
|
|
21
|
+
parent?: ReactNode;
|
|
22
|
+
kind: ReactNode;
|
|
23
|
+
actions: ReactNode;
|
|
24
|
+
} & DataAttributes) {
|
|
25
|
+
return (
|
|
26
|
+
<div
|
|
27
|
+
{...data}
|
|
28
|
+
className="border-base-300 text-base-700 @container grid shrink-0 gap-1 border-b px-5 pb-3 text-xs sm:px-6"
|
|
29
|
+
>
|
|
30
|
+
<div className="flex min-w-0 flex-wrap items-center gap-2">{line}</div>
|
|
31
|
+
{parent}
|
|
32
|
+
<div className="flex flex-wrap items-center gap-2">{kind}</div>
|
|
33
|
+
<div className="flex flex-wrap items-start gap-2">{actions}</div>
|
|
34
|
+
</div>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** The summary's status word, in the text colour. */
|
|
39
|
+
export function SummaryStatus({ children }: { children: ReactNode }) {
|
|
40
|
+
return <span className="text-base-content font-medium">{children}</span>;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** The summary's age, which a narrow dialog leaves out. */
|
|
44
|
+
export function SummaryAge({ children }: { children: ReactNode }) {
|
|
45
|
+
return <span className="min-w-0 truncate @max-[30rem]:hidden">{children}</span>;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** What blocks the item, as a small chip in the danger colours. */
|
|
49
|
+
export function SummaryBlocked({ children }: { children: ReactNode }) {
|
|
50
|
+
return <span className="rounded bg-(--error-surface) px-1.5 text-(--error-foreground)">{children}</span>;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** The item's parent: `prefix` ("Part of"), then its `name`, linked when `href` opens it. */
|
|
54
|
+
export function SummaryParent({
|
|
55
|
+
prefix,
|
|
56
|
+
name,
|
|
57
|
+
href,
|
|
58
|
+
...data
|
|
59
|
+
}: {
|
|
60
|
+
prefix: string;
|
|
61
|
+
name: string;
|
|
62
|
+
href?: string | undefined;
|
|
63
|
+
} & DataAttributes) {
|
|
64
|
+
return (
|
|
65
|
+
<p {...data} className="m-0 min-w-0 wrap-anywhere">
|
|
66
|
+
{prefix}{' '}
|
|
67
|
+
{href ? (
|
|
68
|
+
<a href={href} target="_blank" rel="noopener" className="underline">
|
|
69
|
+
{name}
|
|
70
|
+
</a>
|
|
71
|
+
) : (
|
|
72
|
+
name
|
|
73
|
+
)}
|
|
74
|
+
</p>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** A labelled control the summary opens in place, such as Attach a ticket's picker: `label` over it. */
|
|
79
|
+
export function SummaryPanel({ label, children }: { label: string; children: ReactNode }) {
|
|
80
|
+
return (
|
|
81
|
+
<section aria-label={label} className="grid gap-1.5 pt-1">
|
|
82
|
+
<span className="text-base-content text-xs font-medium">{label}</span>
|
|
83
|
+
{children}
|
|
84
|
+
</section>
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* The dialog body's column: the progress, notes, meta area, record, description, comments and sidebar, one under the
|
|
90
|
+
* other; when it `fill`s, a column whose description and comments take what the rest leave.
|
|
91
|
+
*/
|
|
92
|
+
export function ItemDialogBody({ fill, children, ...data }: { fill: boolean; children: ReactNode } & DataAttributes) {
|
|
93
|
+
return (
|
|
94
|
+
<div
|
|
95
|
+
{...data}
|
|
96
|
+
className={`@container gap-3 pt-2 ${fill ? 'flex min-h-0 flex-1 flex-col' : 'grid grid-cols-[minmax(0,1fr)]'}`}
|
|
97
|
+
>
|
|
98
|
+
{children}
|
|
99
|
+
</div>
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* The main column with the sidebar beside it once the dialog is 45rem wide, when there is an `aside`. Filling, the
|
|
105
|
+
* main column's open editor takes the height the rest leaves.
|
|
106
|
+
*/
|
|
107
|
+
export function ItemDialogColumns({ aside, fill, children }: { aside: boolean; fill: boolean; children: ReactNode }) {
|
|
108
|
+
const rows = fill
|
|
109
|
+
? 'min-h-0 flex-1 grid-rows-[minmax(0,1fr)_auto]'
|
|
110
|
+
: aside
|
|
111
|
+
? '@min-[45rem]:grid-rows-[auto_1fr]'
|
|
112
|
+
: '';
|
|
113
|
+
|
|
114
|
+
return (
|
|
115
|
+
<div
|
|
116
|
+
className={`grid grid-cols-[minmax(0,1fr)] gap-x-6 gap-y-4 ${aside ? '@min-[45rem]:grid-cols-[minmax(0,1fr)_16rem]' : ''} ${rows}`}
|
|
117
|
+
>
|
|
118
|
+
{children}
|
|
119
|
+
</div>
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/** The sidebar beside the main column, ruled off from it once there is room. */
|
|
124
|
+
export function ItemDialogAside({ children }: { children: ReactNode }) {
|
|
125
|
+
return (
|
|
126
|
+
<aside className="grid min-w-0 grid-cols-[minmax(0,1fr)] content-start gap-4 @min-[45rem]:col-start-2 @min-[45rem]:row-span-2 @min-[45rem]:row-start-1 @min-[45rem]:border-l @min-[45rem]:border-(--border) @min-[45rem]:pl-6">
|
|
127
|
+
{children}
|
|
128
|
+
</aside>
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/** A warning about the item, such as why it is paused, in the warning panel: `icon` (a status glyph) before it when
|
|
133
|
+
* given. */
|
|
134
|
+
export function WarningNote({ icon, children, ...data }: { icon?: ReactNode; children: ReactNode } & DataAttributes) {
|
|
135
|
+
if (icon)
|
|
136
|
+
return (
|
|
137
|
+
<div {...data} className={`flex items-center gap-3 ${WARNING_PANEL}`}>
|
|
138
|
+
{icon}
|
|
139
|
+
<span className="min-w-0 flex-1 font-medium text-(--warning-foreground)">{children}</span>
|
|
140
|
+
</div>
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
return (
|
|
144
|
+
<p {...data} className={`m-0 ${WARNING_PANEL} font-medium text-(--warning-foreground)`}>
|
|
145
|
+
{children}
|
|
146
|
+
</p>
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/** Why the factory can't write to the item's tracker, announced, and the `action` that checks again. */
|
|
151
|
+
export function AccessNotice({ message, action }: { message: string; action: ReactNode }) {
|
|
152
|
+
return (
|
|
153
|
+
<div role="status">
|
|
154
|
+
<p>{message}</p>
|
|
155
|
+
{action}
|
|
156
|
+
</div>
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/** A group of the footer's actions: the `leading` ones that move the item, in small text, or the rest at its end. */
|
|
161
|
+
export function DialogActions({
|
|
162
|
+
presentation = 'trailing',
|
|
163
|
+
children,
|
|
164
|
+
}: {
|
|
165
|
+
presentation?: 'leading' | 'trailing';
|
|
166
|
+
children: ReactNode;
|
|
167
|
+
}) {
|
|
168
|
+
return (
|
|
169
|
+
<span
|
|
170
|
+
className={
|
|
171
|
+
presentation === 'leading'
|
|
172
|
+
? 'inline-flex items-center gap-3 text-xs'
|
|
173
|
+
: 'inline-flex items-center gap-1.5'
|
|
174
|
+
}
|
|
175
|
+
>
|
|
176
|
+
{children}
|
|
177
|
+
</span>
|
|
178
|
+
);
|
|
179
|
+
}
|