@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,27 @@
|
|
|
1
|
+
import { DataAttributes } from "./DataAttributes.js";
|
|
2
|
+
import { FormEvent, ReactNode } from "react";
|
|
3
|
+
/** The tracker's labels, a row each, in a bordered list that never grows past its section. */
|
|
4
|
+
export declare function TrackerLabelList({ children }: {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
7
|
+
/**
|
|
8
|
+
* A label's row: its `chip`, its `detail` (truncating, its tooltip giving it whole), then its `actions`, with the
|
|
9
|
+
* `editor` it has open under them.
|
|
10
|
+
*/
|
|
11
|
+
export declare function TrackerLabelRow({ chip, detail, actions, editor, ...data }: {
|
|
12
|
+
chip: ReactNode;
|
|
13
|
+
detail?: string | undefined;
|
|
14
|
+
actions?: ReactNode;
|
|
15
|
+
editor?: ReactNode;
|
|
16
|
+
} & DataAttributes): import("react").JSX.Element;
|
|
17
|
+
/** The editor a label's row opens, ruled off under it on a faint tint. */
|
|
18
|
+
export declare function TrackerLabelEditor({ onSubmit, children }: {
|
|
19
|
+
onSubmit: (event: FormEvent<HTMLFormElement>) => void;
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
}): import("react").JSX.Element;
|
|
22
|
+
/** The line that creates a label: its name field and the button that submits it, wrapping when they don't fit. */
|
|
23
|
+
export declare function CreateLabelForm({ onSubmit, children }: {
|
|
24
|
+
onSubmit: (event: FormEvent<HTMLFormElement>) => void;
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
}): import("react").JSX.Element;
|
|
27
|
+
//# sourceMappingURL=TrackerLabels.d.ts.map
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
// src/board/TrackerLabels.tsx
|
|
3
|
+
/** The tracker's labels, a row each, in a bordered list that never grows past its section. */
|
|
4
|
+
function TrackerLabelList({ children }) {
|
|
5
|
+
return /* @__PURE__ */ jsx("ul", {
|
|
6
|
+
className: "m-0 grid list-none grid-cols-[minmax(0,1fr)] overflow-hidden rounded-lg border p-0",
|
|
7
|
+
children
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A label's row: its `chip`, its `detail` (truncating, its tooltip giving it whole), then its `actions`, with the
|
|
12
|
+
* `editor` it has open under them.
|
|
13
|
+
*/
|
|
14
|
+
function TrackerLabelRow({ chip, detail, actions, editor, ...data }) {
|
|
15
|
+
return /* @__PURE__ */ jsxs("li", {
|
|
16
|
+
...data,
|
|
17
|
+
className: "border-b last:border-b-0",
|
|
18
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
19
|
+
className: "flex min-w-0 items-center gap-3 px-3 py-1.5",
|
|
20
|
+
children: [
|
|
21
|
+
/* @__PURE__ */ jsx("span", {
|
|
22
|
+
className: "max-w-[45%] min-w-0",
|
|
23
|
+
children: chip
|
|
24
|
+
}),
|
|
25
|
+
/* @__PURE__ */ jsx("span", {
|
|
26
|
+
className: "text-base-700 min-w-0 flex-1 truncate text-xs",
|
|
27
|
+
title: detail,
|
|
28
|
+
children: detail
|
|
29
|
+
}),
|
|
30
|
+
actions && /* @__PURE__ */ jsx("span", {
|
|
31
|
+
className: "flex shrink-0 gap-1",
|
|
32
|
+
children: actions
|
|
33
|
+
})
|
|
34
|
+
]
|
|
35
|
+
}), editor]
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
/** The editor a label's row opens, ruled off under it on a faint tint. */
|
|
39
|
+
function TrackerLabelEditor({ onSubmit, children }) {
|
|
40
|
+
return /* @__PURE__ */ jsx("form", {
|
|
41
|
+
className: "bg-base-200/40 grid gap-3 border-t p-3",
|
|
42
|
+
onSubmit,
|
|
43
|
+
children
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
/** The line that creates a label: its name field and the button that submits it, wrapping when they don't fit. */
|
|
47
|
+
function CreateLabelForm({ onSubmit, children }) {
|
|
48
|
+
return /* @__PURE__ */ jsx("form", {
|
|
49
|
+
className: "flex max-w-full min-w-0 flex-wrap gap-2",
|
|
50
|
+
onSubmit,
|
|
51
|
+
children
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
export { CreateLabelForm, TrackerLabelEditor, TrackerLabelList, TrackerLabelRow };
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=TrackerLabels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TrackerLabels.js","names":[],"sources":["../../src/board/TrackerLabels.tsx"],"sourcesContent":["// The tracker's labels on a Lar Factory project's settings page: the list of them, each row with its chip, detail and\n// actions and the editor it opens, and the line that creates one.\n\nimport type { FormEvent, ReactNode } from 'react';\n\nimport type { DataAttributes } from './DataAttributes';\n\n/** The tracker's labels, a row each, in a bordered list that never grows past its section. */\nexport function TrackerLabelList({ children }: { children: ReactNode }) {\n return (\n <ul className=\"m-0 grid list-none grid-cols-[minmax(0,1fr)] overflow-hidden rounded-lg border p-0\">\n {children}\n </ul>\n );\n}\n\n/**\n * A label's row: its `chip`, its `detail` (truncating, its tooltip giving it whole), then its `actions`, with the\n * `editor` it has open under them.\n */\nexport function TrackerLabelRow({\n chip,\n detail,\n actions,\n editor,\n ...data\n}: {\n chip: ReactNode;\n detail?: string | undefined;\n actions?: ReactNode;\n editor?: ReactNode;\n} & DataAttributes) {\n return (\n <li {...data} className=\"border-b last:border-b-0\">\n <div className=\"flex min-w-0 items-center gap-3 px-3 py-1.5\">\n <span className=\"max-w-[45%] min-w-0\">{chip}</span>\n <span className=\"text-base-700 min-w-0 flex-1 truncate text-xs\" title={detail}>\n {detail}\n </span>\n {actions && <span className=\"flex shrink-0 gap-1\">{actions}</span>}\n </div>\n {editor}\n </li>\n );\n}\n\n/** The editor a label's row opens, ruled off under it on a faint tint. */\nexport function TrackerLabelEditor({\n onSubmit,\n children,\n}: {\n onSubmit: (event: FormEvent<HTMLFormElement>) => void;\n children: ReactNode;\n}) {\n return (\n <form className=\"bg-base-200/40 grid gap-3 border-t p-3\" onSubmit={onSubmit}>\n {children}\n </form>\n );\n}\n\n/** The line that creates a label: its name field and the button that submits it, wrapping when they don't fit. */\nexport function CreateLabelForm({\n onSubmit,\n children,\n}: {\n onSubmit: (event: FormEvent<HTMLFormElement>) => void;\n children: ReactNode;\n}) {\n return (\n <form className=\"flex max-w-full min-w-0 flex-wrap gap-2\" onSubmit={onSubmit}>\n {children}\n </form>\n );\n}\n"],"mappings":";;;AAQA,SAAgB,iBAAiB,EAAE,YAAqC;CACpE,OACI,oBAAC,MAAD;EAAI,WAAU;EACT;CACD,CAAA;AAEZ;;;;;AAMA,SAAgB,gBAAgB,EAC5B,MACA,QACA,SACA,QACA,GAAG,QAMa;CAChB,OACI,qBAAC,MAAD;EAAI,GAAI;EAAM,WAAU;EAAxB,UAAA,CACI,qBAAC,OAAD;GAAK,WAAU;GAAf,UAAA;IACI,oBAAC,QAAD;KAAM,WAAU;KAAuB,UAAA;IAAW,CAAA;IAClD,oBAAC,QAAD;KAAM,WAAU;KAAgD,OAAO;KAClE,UAAA;IACC,CAAA;IACL,WAAW,oBAAC,QAAD;KAAM,WAAU;KAAuB,UAAA;IAAc,CAAA;GAChE;EACJ,CAAA,GAAA,MACD;;AAEZ;;AAGA,SAAgB,mBAAmB,EAC/B,UACA,YAID;CACC,OACI,oBAAC,QAAD;EAAM,WAAU;EAAmD;EAC9D;CACC,CAAA;AAEd;;AAGA,SAAgB,gBAAgB,EAC5B,UACA,YAID;CACC,OACI,oBAAC,QAAD;EAAM,WAAU;EAAoD;EAC/D;CACC,CAAA;AAEd"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
/** The pill's icon: an arrow for an available update, a progress ring in the primary colour while it downloads, and a
|
|
3
|
+
* restart arrow once it's downloaded. 16 px, as every title bar icon is. */
|
|
4
|
+
export declare function UpdateStatusIcon({ status, percent }: {
|
|
5
|
+
status: 'available' | 'downloading' | 'downloaded';
|
|
6
|
+
/** The download's whole percentage, 0 to 100. */
|
|
7
|
+
percent?: number;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
9
|
+
/** The pill while the update downloads: nothing to click, a progress bar to screen readers, with more in its tooltip.
|
|
10
|
+
* `text` is what it says before the percentage, `label` its accessible name. */
|
|
11
|
+
export declare function UpdateDownloading({ percent, text, label, tooltip }: {
|
|
12
|
+
percent: number;
|
|
13
|
+
text: string;
|
|
14
|
+
label: string;
|
|
15
|
+
tooltip: string;
|
|
16
|
+
}): import("react").JSX.Element;
|
|
17
|
+
interface UpdatePillProps {
|
|
18
|
+
/** Whether the update is downloaded and waits for a restart, or still to download. */
|
|
19
|
+
status: 'available' | 'downloaded';
|
|
20
|
+
/** What the pill says, such as "Update available" or "Installing…". */
|
|
21
|
+
label: string;
|
|
22
|
+
/** The popover's heading, such as "Lar Factory 1.4.0 is available". */
|
|
23
|
+
heading: string;
|
|
24
|
+
/** The update's changes, such as ReleaseNotes. */
|
|
25
|
+
notes?: ReactNode;
|
|
26
|
+
/** The popover's button, such as "Download". */
|
|
27
|
+
actionLabel: string;
|
|
28
|
+
disabled: boolean;
|
|
29
|
+
/** Runs the step: the pill and the popover's button both run it. */
|
|
30
|
+
onRun: () => void;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The pill with an update to download or install. Clicking it runs that step. Hovering it, or focusing it from the
|
|
34
|
+
* keyboard, opens the changelog below it, with the step's button; it closes 150 ms after the pointer leaves both, and
|
|
35
|
+
* on Escape. The focus stays on the pill.
|
|
36
|
+
*/
|
|
37
|
+
export declare function UpdatePill({ status, label, heading, notes, actionLabel, disabled, onRun }: UpdatePillProps): import("react").JSX.Element;
|
|
38
|
+
export interface ReleaseNote {
|
|
39
|
+
version: string;
|
|
40
|
+
/** The section's heading, such as "What's changed" or "Changes in 1.3.0". */
|
|
41
|
+
title: string;
|
|
42
|
+
items: readonly string[];
|
|
43
|
+
/** What the app left out, such as "3 more changes in this Release". */
|
|
44
|
+
more?: string;
|
|
45
|
+
}
|
|
46
|
+
/** Each Release's changes, newest first, and a note of older Releases left out. */
|
|
47
|
+
export declare function ReleaseNotes({ releases, older }: {
|
|
48
|
+
releases: readonly ReleaseNote[];
|
|
49
|
+
older?: string;
|
|
50
|
+
}): import("react").JSX.Element;
|
|
51
|
+
export {};
|
|
52
|
+
//# sourceMappingURL=UpdatePill.d.ts.map
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { Button } from "../actions/Button.js";
|
|
2
|
+
import { Popover } from "../overlays/Popover.js";
|
|
3
|
+
import { Tooltip, TooltipPopup, TooltipTrigger } from "../overlays/Tooltip.js";
|
|
4
|
+
import { buttonKind } from "./ButtonKinds.js";
|
|
5
|
+
import { useEffect, useRef, useState } from "react";
|
|
6
|
+
import { ArrowDownToLineIcon, RotateCcwIcon } from "lucide-react";
|
|
7
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
// src/board/UpdatePill.tsx
|
|
9
|
+
const RADIUS = 7;
|
|
10
|
+
const CIRCUMFERENCE = 2 * Math.PI * RADIUS;
|
|
11
|
+
const CLOSE_DELAY_MS = 150;
|
|
12
|
+
/** The pill's icon: an arrow for an available update, a progress ring in the primary colour while it downloads, and a
|
|
13
|
+
* restart arrow once it's downloaded. 16 px, as every title bar icon is. */
|
|
14
|
+
function UpdateStatusIcon({ status, percent = 0 }) {
|
|
15
|
+
if (status === "downloading") return /* @__PURE__ */ jsxs("svg", {
|
|
16
|
+
"aria-hidden": "true",
|
|
17
|
+
className: "size-4 shrink-0 -rotate-90",
|
|
18
|
+
viewBox: "0 0 20 20",
|
|
19
|
+
children: [/* @__PURE__ */ jsx("circle", {
|
|
20
|
+
cx: "10",
|
|
21
|
+
cy: "10",
|
|
22
|
+
r: RADIUS,
|
|
23
|
+
fill: "none",
|
|
24
|
+
stroke: "currentColor",
|
|
25
|
+
strokeOpacity: "0.2",
|
|
26
|
+
strokeWidth: "2"
|
|
27
|
+
}), /* @__PURE__ */ jsx("circle", {
|
|
28
|
+
cx: "10",
|
|
29
|
+
cy: "10",
|
|
30
|
+
r: RADIUS,
|
|
31
|
+
fill: "none",
|
|
32
|
+
className: "stroke-primary transition-[stroke-dashoffset] duration-300 ease-out motion-reduce:transition-none",
|
|
33
|
+
strokeDasharray: CIRCUMFERENCE,
|
|
34
|
+
strokeDashoffset: CIRCUMFERENCE * (1 - percent / 100),
|
|
35
|
+
strokeLinecap: "round",
|
|
36
|
+
strokeWidth: "2"
|
|
37
|
+
})]
|
|
38
|
+
});
|
|
39
|
+
return /* @__PURE__ */ jsx(status === "downloaded" ? RotateCcwIcon : ArrowDownToLineIcon, {
|
|
40
|
+
className: "size-4 shrink-0",
|
|
41
|
+
"aria-hidden": "true"
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/** The pill while the update downloads: nothing to click, a progress bar to screen readers, with more in its tooltip.
|
|
45
|
+
* `text` is what it says before the percentage, `label` its accessible name. */
|
|
46
|
+
function UpdateDownloading({ percent, text, label, tooltip }) {
|
|
47
|
+
return /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
|
|
48
|
+
asChild: true,
|
|
49
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
50
|
+
tabIndex: 0,
|
|
51
|
+
role: "progressbar",
|
|
52
|
+
"aria-label": label,
|
|
53
|
+
"aria-valuemin": 0,
|
|
54
|
+
"aria-valuemax": 100,
|
|
55
|
+
"aria-valuenow": percent,
|
|
56
|
+
"data-kind": "control",
|
|
57
|
+
className: "update-button text-primary focus-visible:ring-primary inline-flex h-7 items-center gap-1.5 rounded-md bg-[color-mix(in_srgb,var(--color-primary)_10%,var(--color-base-100))] px-[11px] text-xs font-medium outline-none hover:bg-[color-mix(in_srgb,var(--color-primary)_18%,var(--color-base-100))] focus-visible:ring-2",
|
|
58
|
+
children: [
|
|
59
|
+
/* @__PURE__ */ jsx(UpdateStatusIcon, {
|
|
60
|
+
status: "downloading",
|
|
61
|
+
percent
|
|
62
|
+
}),
|
|
63
|
+
text,
|
|
64
|
+
" ",
|
|
65
|
+
/* @__PURE__ */ jsxs("span", {
|
|
66
|
+
className: "w-7 tabular-nums",
|
|
67
|
+
children: [percent, "%"]
|
|
68
|
+
})
|
|
69
|
+
]
|
|
70
|
+
})
|
|
71
|
+
}), /* @__PURE__ */ jsx(TooltipPopup, {
|
|
72
|
+
side: "bottom",
|
|
73
|
+
children: tooltip
|
|
74
|
+
})] });
|
|
75
|
+
}
|
|
76
|
+
/** Open while the pointer is on the pill or its popover, and for 150 ms after it leaves both. */
|
|
77
|
+
function useHoverOpen() {
|
|
78
|
+
const [open, setOpen] = useState(false);
|
|
79
|
+
const timer = useRef(void 0);
|
|
80
|
+
useEffect(() => () => clearTimeout(timer.current), []);
|
|
81
|
+
const show = () => {
|
|
82
|
+
clearTimeout(timer.current);
|
|
83
|
+
setOpen(true);
|
|
84
|
+
};
|
|
85
|
+
const close = () => {
|
|
86
|
+
clearTimeout(timer.current);
|
|
87
|
+
setOpen(false);
|
|
88
|
+
};
|
|
89
|
+
return {
|
|
90
|
+
open,
|
|
91
|
+
show,
|
|
92
|
+
close,
|
|
93
|
+
hover: {
|
|
94
|
+
onPointerEnter: (event) => event.pointerType !== "touch" && show(),
|
|
95
|
+
onPointerLeave: (event) => {
|
|
96
|
+
if (event.pointerType === "touch") return;
|
|
97
|
+
clearTimeout(timer.current);
|
|
98
|
+
timer.current = setTimeout(() => setOpen(false), CLOSE_DELAY_MS);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* The pill with an update to download or install. Clicking it runs that step. Hovering it, or focusing it from the
|
|
105
|
+
* keyboard, opens the changelog below it, with the step's button; it closes 150 ms after the pointer leaves both, and
|
|
106
|
+
* on Escape. The focus stays on the pill.
|
|
107
|
+
*/
|
|
108
|
+
function UpdatePill({ status, label, heading, notes, actionLabel, disabled, onRun }) {
|
|
109
|
+
const { open, show, close, hover } = useHoverOpen();
|
|
110
|
+
return /* @__PURE__ */ jsxs(Popover, {
|
|
111
|
+
open,
|
|
112
|
+
onOpenChange: (next) => !next && close(),
|
|
113
|
+
children: [/* @__PURE__ */ jsx(Popover.Trigger, {
|
|
114
|
+
asChild: true,
|
|
115
|
+
children: /* @__PURE__ */ jsxs(Button, {
|
|
116
|
+
...buttonKind("control"),
|
|
117
|
+
variant: "tinted",
|
|
118
|
+
"aria-disabled": disabled || void 0,
|
|
119
|
+
className: `update-button gap-1.5 font-medium ${disabled ? "cursor-not-allowed" : ""}`,
|
|
120
|
+
onClick: (event) => {
|
|
121
|
+
event.preventDefault();
|
|
122
|
+
if (!disabled) onRun();
|
|
123
|
+
},
|
|
124
|
+
onFocus: (event) => event.currentTarget.matches(":focus-visible") && show(),
|
|
125
|
+
...hover,
|
|
126
|
+
children: [/* @__PURE__ */ jsx(UpdateStatusIcon, { status }), label]
|
|
127
|
+
})
|
|
128
|
+
}), /* @__PURE__ */ jsx(Popover.Content, {
|
|
129
|
+
side: "bottom",
|
|
130
|
+
align: "end",
|
|
131
|
+
onOpenAutoFocus: (event) => event.preventDefault(),
|
|
132
|
+
onCloseAutoFocus: (event) => event.preventDefault(),
|
|
133
|
+
...hover,
|
|
134
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
135
|
+
className: "grid w-80 max-w-full gap-3 text-left",
|
|
136
|
+
children: [
|
|
137
|
+
/* @__PURE__ */ jsx("p", {
|
|
138
|
+
className: "update-heading text-base-content m-0 text-sm font-medium",
|
|
139
|
+
children: heading
|
|
140
|
+
}),
|
|
141
|
+
notes ? /* @__PURE__ */ jsx("div", {
|
|
142
|
+
className: "max-h-[min(28rem,calc(100vh-10rem))] overflow-y-auto",
|
|
143
|
+
children: notes
|
|
144
|
+
}) : null,
|
|
145
|
+
/* @__PURE__ */ jsx("span", {
|
|
146
|
+
className: "justify-self-start",
|
|
147
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
148
|
+
...buttonKind("main"),
|
|
149
|
+
className: "update-next",
|
|
150
|
+
disabled,
|
|
151
|
+
onClick: onRun,
|
|
152
|
+
children: actionLabel
|
|
153
|
+
})
|
|
154
|
+
})
|
|
155
|
+
]
|
|
156
|
+
})
|
|
157
|
+
})]
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
/** Each Release's changes, newest first, and a note of older Releases left out. */
|
|
161
|
+
function ReleaseNotes({ releases, older }) {
|
|
162
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [releases.map((note) => /* @__PURE__ */ jsxs("section", {
|
|
163
|
+
className: "not-first:border-base-300 not-first:mt-3 not-first:border-t not-first:pt-3",
|
|
164
|
+
children: [
|
|
165
|
+
/* @__PURE__ */ jsx("h3", {
|
|
166
|
+
className: "text-base-content m-0 text-xs leading-4 font-semibold",
|
|
167
|
+
children: note.title
|
|
168
|
+
}),
|
|
169
|
+
/* @__PURE__ */ jsx("ul", {
|
|
170
|
+
className: "text-base-700 m-0 mt-2 space-y-1.5 pl-4 text-xs leading-5",
|
|
171
|
+
children: note.items.map((item, i) => /* @__PURE__ */ jsx("li", {
|
|
172
|
+
className: "list-disc break-words",
|
|
173
|
+
children: item
|
|
174
|
+
}, i))
|
|
175
|
+
}),
|
|
176
|
+
note.more ? /* @__PURE__ */ jsx("p", {
|
|
177
|
+
className: "text-base-700 m-0 mt-2 text-xs leading-5",
|
|
178
|
+
children: note.more
|
|
179
|
+
}) : null
|
|
180
|
+
]
|
|
181
|
+
}, note.version)), older ? /* @__PURE__ */ jsx("p", {
|
|
182
|
+
className: "border-base-300 text-base-700 m-0 mt-3 border-t pt-3 text-xs leading-5",
|
|
183
|
+
children: older
|
|
184
|
+
}) : null] });
|
|
185
|
+
}
|
|
186
|
+
export { ReleaseNotes, UpdateDownloading, UpdatePill, UpdateStatusIcon };
|
|
187
|
+
|
|
188
|
+
//# sourceMappingURL=UpdatePill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UpdatePill.js","names":[],"sources":["../../src/board/UpdatePill.tsx"],"sourcesContent":["// The title bar's update pill, from T3 Code's update pill (apps/web/src/components/sidebar/SidebarUpdatePill.tsx at\n// d53873b) and its status icon (DesktopUpdateStatusIcon.tsx at 9a391eb), drawn as the board's other App controls are,\n// tinted in every state, instead of as T3's pill. Copyright (c) 2026 T3 Tools Inc. MIT License.\n\nimport { ArrowDownToLineIcon, RotateCcwIcon } from 'lucide-react';\nimport { type PointerEvent, type ReactNode, useEffect, useRef, useState } from 'react';\n\nimport { Button } from '../actions/Button';\nimport { Popover } from '../overlays/Popover';\nimport { Tooltip, TooltipPopup, TooltipTrigger } from '../overlays/Tooltip';\nimport { buttonKind } from './ButtonKinds';\n\nconst RADIUS = 7;\nconst CIRCUMFERENCE = 2 * Math.PI * RADIUS;\nconst CLOSE_DELAY_MS = 150;\n\n/** The pill's icon: an arrow for an available update, a progress ring in the primary colour while it downloads, and a\n * restart arrow once it's downloaded. 16 px, as every title bar icon is. */\nexport function UpdateStatusIcon({\n status,\n percent = 0,\n}: {\n status: 'available' | 'downloading' | 'downloaded';\n /** The download's whole percentage, 0 to 100. */\n percent?: number;\n}) {\n if (status === 'downloading')\n return (\n <svg aria-hidden=\"true\" className=\"size-4 shrink-0 -rotate-90\" viewBox=\"0 0 20 20\">\n <circle\n cx=\"10\"\n cy=\"10\"\n r={RADIUS}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeOpacity=\"0.2\"\n strokeWidth=\"2\"\n />\n <circle\n cx=\"10\"\n cy=\"10\"\n r={RADIUS}\n fill=\"none\"\n className=\"stroke-primary transition-[stroke-dashoffset] duration-300 ease-out motion-reduce:transition-none\"\n strokeDasharray={CIRCUMFERENCE}\n strokeDashoffset={CIRCUMFERENCE * (1 - percent / 100)}\n strokeLinecap=\"round\"\n strokeWidth=\"2\"\n />\n </svg>\n );\n\n const Icon = status === 'downloaded' ? RotateCcwIcon : ArrowDownToLineIcon;\n\n return <Icon className=\"size-4 shrink-0\" aria-hidden=\"true\" />;\n}\n\n/** The pill while the update downloads: nothing to click, a progress bar to screen readers, with more in its tooltip.\n * `text` is what it says before the percentage, `label` its accessible name. */\nexport function UpdateDownloading({\n percent,\n text,\n label,\n tooltip,\n}: {\n percent: number;\n text: string;\n label: string;\n tooltip: string;\n}) {\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <span\n tabIndex={0}\n role=\"progressbar\"\n aria-label={label}\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuenow={percent}\n data-kind=\"control\"\n className=\"update-button text-primary focus-visible:ring-primary inline-flex h-7 items-center gap-1.5 rounded-md bg-[color-mix(in_srgb,var(--color-primary)_10%,var(--color-base-100))] px-[11px] text-xs font-medium outline-none hover:bg-[color-mix(in_srgb,var(--color-primary)_18%,var(--color-base-100))] focus-visible:ring-2\"\n >\n <UpdateStatusIcon status=\"downloading\" percent={percent} />\n {text} <span className=\"w-7 tabular-nums\">{percent}%</span>\n </span>\n </TooltipTrigger>\n <TooltipPopup side=\"bottom\">{tooltip}</TooltipPopup>\n </Tooltip>\n );\n}\n\n/** Open while the pointer is on the pill or its popover, and for 150 ms after it leaves both. */\nfunction useHoverOpen() {\n const [open, setOpen] = useState(false);\n const timer = useRef<ReturnType<typeof setTimeout>>(undefined);\n\n useEffect(() => () => clearTimeout(timer.current), []);\n\n const show = () => {\n clearTimeout(timer.current);\n setOpen(true);\n };\n const close = () => {\n clearTimeout(timer.current);\n setOpen(false);\n };\n const hover = {\n // A touch has no hover: a tap runs the step.\n onPointerEnter: (event: PointerEvent) => event.pointerType !== 'touch' && show(),\n onPointerLeave: (event: PointerEvent) => {\n if (event.pointerType === 'touch') return;\n\n clearTimeout(timer.current);\n timer.current = setTimeout(() => setOpen(false), CLOSE_DELAY_MS);\n },\n };\n\n return { open, show, close, hover };\n}\n\ninterface UpdatePillProps {\n /** Whether the update is downloaded and waits for a restart, or still to download. */\n status: 'available' | 'downloaded';\n /** What the pill says, such as \"Update available\" or \"Installing…\". */\n label: string;\n /** The popover's heading, such as \"Lar Factory 1.4.0 is available\". */\n heading: string;\n /** The update's changes, such as ReleaseNotes. */\n notes?: ReactNode;\n /** The popover's button, such as \"Download\". */\n actionLabel: string;\n disabled: boolean;\n /** Runs the step: the pill and the popover's button both run it. */\n onRun: () => void;\n}\n\n/**\n * The pill with an update to download or install. Clicking it runs that step. Hovering it, or focusing it from the\n * keyboard, opens the changelog below it, with the step's button; it closes 150 ms after the pointer leaves both, and\n * on Escape. The focus stays on the pill.\n */\nexport function UpdatePill({ status, label, heading, notes, actionLabel, disabled, onRun }: UpdatePillProps) {\n const { open, show, close, hover } = useHoverOpen();\n\n return (\n <Popover open={open} onOpenChange={(next) => !next && close()}>\n <Popover.Trigger asChild>\n <Button\n {...buttonKind('control')}\n variant=\"tinted\"\n aria-disabled={disabled || undefined}\n className={`update-button gap-1.5 font-medium ${disabled ? 'cursor-not-allowed' : ''}`}\n // The pill runs the step; the changelog opens on hover and focus, not on the click.\n onClick={(event) => {\n event.preventDefault();\n\n if (!disabled) onRun();\n }}\n onFocus={(event) => event.currentTarget.matches(':focus-visible') && show()}\n {...hover}\n >\n <UpdateStatusIcon status={status} />\n {label}\n </Button>\n </Popover.Trigger>\n <Popover.Content\n side=\"bottom\"\n align=\"end\"\n onOpenAutoFocus={(event) => event.preventDefault()}\n onCloseAutoFocus={(event) => event.preventDefault()}\n {...hover}\n >\n <div className=\"grid w-80 max-w-full gap-3 text-left\">\n <p className=\"update-heading text-base-content m-0 text-sm font-medium\">{heading}</p>\n {notes ? <div className=\"max-h-[min(28rem,calc(100vh-10rem))] overflow-y-auto\">{notes}</div> : null}\n <span className=\"justify-self-start\">\n <Button {...buttonKind('main')} className=\"update-next\" disabled={disabled} onClick={onRun}>\n {actionLabel}\n </Button>\n </span>\n </div>\n </Popover.Content>\n </Popover>\n );\n}\n\nexport interface ReleaseNote {\n version: string;\n /** The section's heading, such as \"What's changed\" or \"Changes in 1.3.0\". */\n title: string;\n items: readonly string[];\n /** What the app left out, such as \"3 more changes in this Release\". */\n more?: string;\n}\n\n/** Each Release's changes, newest first, and a note of older Releases left out. */\nexport function ReleaseNotes({ releases, older }: { releases: readonly ReleaseNote[]; older?: string }) {\n return (\n <>\n {releases.map((note) => (\n <section\n className=\"not-first:border-base-300 not-first:mt-3 not-first:border-t not-first:pt-3\"\n key={note.version}\n >\n <h3 className=\"text-base-content m-0 text-xs leading-4 font-semibold\">{note.title}</h3>\n <ul className=\"text-base-700 m-0 mt-2 space-y-1.5 pl-4 text-xs leading-5\">\n {note.items.map((item, i) => (\n <li className=\"list-disc break-words\" key={i}>\n {item}\n </li>\n ))}\n </ul>\n {note.more ? <p className=\"text-base-700 m-0 mt-2 text-xs leading-5\">{note.more}</p> : null}\n </section>\n ))}\n {older ? (\n <p className=\"border-base-300 text-base-700 m-0 mt-3 border-t pt-3 text-xs leading-5\">{older}</p>\n ) : null}\n </>\n );\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { DataAttributes } from "./DataAttributes.js";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* One kind's row: its `title`, its `type` control, then its labels' chips in a group `labelsLabel` names, which take a
|
|
5
|
+
* line of their own on a narrow page, ending with the `chooser` that edits them; what the row says about them (notes,
|
|
6
|
+
* problems, actions) follows under it.
|
|
7
|
+
*/
|
|
8
|
+
export declare function VocabularyRow({ title, type, labels, labelsLabel, chooser, children, ...data }: {
|
|
9
|
+
title: string;
|
|
10
|
+
type: ReactNode;
|
|
11
|
+
labels: ReactNode;
|
|
12
|
+
labelsLabel: string;
|
|
13
|
+
chooser: ReactNode;
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
} & DataAttributes): import("react").JSX.Element;
|
|
16
|
+
/** The chip that stands for the labels past the first few, which opens the chooser (`label` names it). */
|
|
17
|
+
export declare function VocabularyMore({ label, onClick, children }: {
|
|
18
|
+
label: string;
|
|
19
|
+
onClick: () => void;
|
|
20
|
+
children: string;
|
|
21
|
+
}): import("react").JSX.Element;
|
|
22
|
+
/** A suggested label, dashed, which a press maps. */
|
|
23
|
+
export declare function VocabularySuggestion({ disabled, onClick, children }: {
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
onClick: () => void;
|
|
26
|
+
children: ReactNode;
|
|
27
|
+
}): import("react").JSX.Element;
|
|
28
|
+
/** The chooser's panel inside its popover: the search field, the list, then its actions, one under the other. */
|
|
29
|
+
export declare function LabelChooser({ children, ...data }: {
|
|
30
|
+
children: ReactNode;
|
|
31
|
+
} & DataAttributes): import("react").JSX.Element;
|
|
32
|
+
/** The chooser's list of labels, which picks several (`label` names it); its wheel scrolls the list alone. */
|
|
33
|
+
export declare function LabelChooserList({ id, label, children }: {
|
|
34
|
+
id: string;
|
|
35
|
+
label: string;
|
|
36
|
+
children: ReactNode;
|
|
37
|
+
}): import("react").JSX.Element;
|
|
38
|
+
/** One label in the chooser's list, highlighted while `active`. A press picks it and keeps focus in the search field. */
|
|
39
|
+
export declare function LabelChooserOption({ id, selected, disabled, active, onHover, onPick, children }: {
|
|
40
|
+
id: string;
|
|
41
|
+
selected: boolean;
|
|
42
|
+
disabled: boolean;
|
|
43
|
+
active: boolean;
|
|
44
|
+
onHover: () => void;
|
|
45
|
+
onPick: () => void;
|
|
46
|
+
children: ReactNode;
|
|
47
|
+
}): import("react").JSX.Element;
|
|
48
|
+
/** What the chooser's list says when no label matches, announced. */
|
|
49
|
+
export declare function LabelChooserEmpty({ children }: {
|
|
50
|
+
children: ReactNode;
|
|
51
|
+
}): import("react").JSX.Element;
|
|
52
|
+
/** The chooser's closing actions, at either end of a ruled line. */
|
|
53
|
+
export declare function LabelChooserFooter({ children }: {
|
|
54
|
+
children: ReactNode;
|
|
55
|
+
}): import("react").JSX.Element;
|
|
56
|
+
//# sourceMappingURL=Vocabulary.d.ts.map
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
// src/board/Vocabulary.tsx
|
|
3
|
+
/**
|
|
4
|
+
* One kind's row: its `title`, its `type` control, then its labels' chips in a group `labelsLabel` names, which take a
|
|
5
|
+
* line of their own on a narrow page, ending with the `chooser` that edits them; what the row says about them (notes,
|
|
6
|
+
* problems, actions) follows under it.
|
|
7
|
+
*/
|
|
8
|
+
function VocabularyRow({ title, type, labels, labelsLabel, chooser, children, ...data }) {
|
|
9
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
10
|
+
...data,
|
|
11
|
+
className: "grid min-w-0 gap-2 px-3 py-3",
|
|
12
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
13
|
+
className: "grid min-w-0 grid-cols-[minmax(0,1fr)_8.5rem] items-center gap-x-3 gap-y-2 sm:grid-cols-[5.5rem_8.5rem_minmax(0,1fr)]",
|
|
14
|
+
children: [
|
|
15
|
+
/* @__PURE__ */ jsx("span", {
|
|
16
|
+
className: "text-[13px] font-medium",
|
|
17
|
+
children: title
|
|
18
|
+
}),
|
|
19
|
+
type,
|
|
20
|
+
/* @__PURE__ */ jsxs("div", {
|
|
21
|
+
role: "group",
|
|
22
|
+
"aria-label": labelsLabel,
|
|
23
|
+
className: "col-span-2 flex min-w-0 flex-wrap items-center gap-1 sm:col-span-1",
|
|
24
|
+
children: [labels, /* @__PURE__ */ jsx("span", {
|
|
25
|
+
className: "ms-auto flex",
|
|
26
|
+
children: chooser
|
|
27
|
+
})]
|
|
28
|
+
})
|
|
29
|
+
]
|
|
30
|
+
}), children]
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/** The chip that stands for the labels past the first few, which opens the chooser (`label` names it). */
|
|
34
|
+
function VocabularyMore({ label, onClick, children }) {
|
|
35
|
+
return /* @__PURE__ */ jsx("button", {
|
|
36
|
+
type: "button",
|
|
37
|
+
className: "cursor-pointer rounded-full bg-(--muted) px-2 text-xs",
|
|
38
|
+
"aria-label": label,
|
|
39
|
+
onClick,
|
|
40
|
+
children
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
/** A suggested label, dashed, which a press maps. */
|
|
44
|
+
function VocabularySuggestion({ disabled = false, onClick, children }) {
|
|
45
|
+
return /* @__PURE__ */ jsx("button", {
|
|
46
|
+
type: "button",
|
|
47
|
+
disabled,
|
|
48
|
+
className: "cursor-pointer rounded-full border border-dashed border-(--border) px-2 py-0.5 text-xs",
|
|
49
|
+
onClick,
|
|
50
|
+
children
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
/** The chooser's panel inside its popover: the search field, the list, then its actions, one under the other. */
|
|
54
|
+
function LabelChooser({ children, ...data }) {
|
|
55
|
+
return /* @__PURE__ */ jsx("div", {
|
|
56
|
+
...data,
|
|
57
|
+
className: "grid w-full min-w-0 gap-2",
|
|
58
|
+
children
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/** The chooser's list of labels, which picks several (`label` names it); its wheel scrolls the list alone. */
|
|
62
|
+
function LabelChooserList({ id, label, children }) {
|
|
63
|
+
return /* @__PURE__ */ jsx("ul", {
|
|
64
|
+
id,
|
|
65
|
+
role: "listbox",
|
|
66
|
+
"aria-multiselectable": true,
|
|
67
|
+
"aria-label": label,
|
|
68
|
+
className: "m-0 h-64 list-none overflow-y-auto overscroll-contain p-0",
|
|
69
|
+
onWheel: (event) => event.stopPropagation(),
|
|
70
|
+
children
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/** One label in the chooser's list, highlighted while `active`. A press picks it and keeps focus in the search field. */
|
|
74
|
+
function LabelChooserOption({ id, selected, disabled, active, onHover, onPick, children }) {
|
|
75
|
+
return /* @__PURE__ */ jsx("li", {
|
|
76
|
+
id,
|
|
77
|
+
role: "option",
|
|
78
|
+
"aria-selected": selected,
|
|
79
|
+
"aria-disabled": disabled,
|
|
80
|
+
className: `cursor-pointer rounded px-2 py-1 text-[13px] wrap-anywhere ${active ? "bg-(--muted)" : ""}`,
|
|
81
|
+
onMouseMove: onHover,
|
|
82
|
+
onMouseDown: (event) => event.preventDefault(),
|
|
83
|
+
onClick: onPick,
|
|
84
|
+
children
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
/** What the chooser's list says when no label matches, announced. */
|
|
88
|
+
function LabelChooserEmpty({ children }) {
|
|
89
|
+
return /* @__PURE__ */ jsx("li", {
|
|
90
|
+
role: "status",
|
|
91
|
+
className: "px-2 py-2 text-xs text-(--muted-foreground)",
|
|
92
|
+
children
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
/** The chooser's closing actions, at either end of a ruled line. */
|
|
96
|
+
function LabelChooserFooter({ children }) {
|
|
97
|
+
return /* @__PURE__ */ jsx("div", {
|
|
98
|
+
className: "flex justify-between gap-2 border-t border-(--border) pt-2",
|
|
99
|
+
children
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
export { LabelChooser, LabelChooserEmpty, LabelChooserFooter, LabelChooserList, LabelChooserOption, VocabularyMore, VocabularyRow, VocabularySuggestion };
|
|
103
|
+
|
|
104
|
+
//# sourceMappingURL=Vocabulary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Vocabulary.js","names":[],"sources":["../../src/board/Vocabulary.tsx"],"sourcesContent":["// A project's kind vocabulary in Lar Factory's settings and onboarding: each kind's row, with its type and the chips of\n// its labels, and the chooser that picks them from the tracker's labels.\n\nimport type { ReactNode } from 'react';\n\nimport type { DataAttributes } from './DataAttributes';\n\n/**\n * One kind's row: its `title`, its `type` control, then its labels' chips in a group `labelsLabel` names, which take a\n * line of their own on a narrow page, ending with the `chooser` that edits them; what the row says about them (notes,\n * problems, actions) follows under it.\n */\nexport function VocabularyRow({\n title,\n type,\n labels,\n labelsLabel,\n chooser,\n children,\n ...data\n}: {\n title: string;\n type: ReactNode;\n labels: ReactNode;\n labelsLabel: string;\n chooser: ReactNode;\n children?: ReactNode;\n} & DataAttributes) {\n return (\n <div {...data} className=\"grid min-w-0 gap-2 px-3 py-3\">\n <div className=\"grid min-w-0 grid-cols-[minmax(0,1fr)_8.5rem] items-center gap-x-3 gap-y-2 sm:grid-cols-[5.5rem_8.5rem_minmax(0,1fr)]\">\n <span className=\"text-[13px] font-medium\">{title}</span>\n {type}\n <div\n role=\"group\"\n aria-label={labelsLabel}\n className=\"col-span-2 flex min-w-0 flex-wrap items-center gap-1 sm:col-span-1\"\n >\n {labels}\n <span className=\"ms-auto flex\">{chooser}</span>\n </div>\n </div>\n {children}\n </div>\n );\n}\n\n/** The chip that stands for the labels past the first few, which opens the chooser (`label` names it). */\nexport function VocabularyMore({ label, onClick, children }: { label: string; onClick: () => void; children: string }) {\n return (\n <button\n type=\"button\"\n className=\"cursor-pointer rounded-full bg-(--muted) px-2 text-xs\"\n aria-label={label}\n onClick={onClick}\n >\n {children}\n </button>\n );\n}\n\n/** A suggested label, dashed, which a press maps. */\nexport function VocabularySuggestion({\n disabled = false,\n onClick,\n children,\n}: {\n disabled?: boolean;\n onClick: () => void;\n children: ReactNode;\n}) {\n return (\n <button\n type=\"button\"\n disabled={disabled}\n className=\"cursor-pointer rounded-full border border-dashed border-(--border) px-2 py-0.5 text-xs\"\n onClick={onClick}\n >\n {children}\n </button>\n );\n}\n\n/** The chooser's panel inside its popover: the search field, the list, then its actions, one under the other. */\nexport function LabelChooser({ children, ...data }: { children: ReactNode } & DataAttributes) {\n return (\n <div {...data} className=\"grid w-full min-w-0 gap-2\">\n {children}\n </div>\n );\n}\n\n/** The chooser's list of labels, which picks several (`label` names it); its wheel scrolls the list alone. */\nexport function LabelChooserList({ id, label, children }: { id: string; label: string; children: ReactNode }) {\n return (\n <ul\n id={id}\n role=\"listbox\"\n aria-multiselectable\n aria-label={label}\n className=\"m-0 h-64 list-none overflow-y-auto overscroll-contain p-0\"\n onWheel={(event) => event.stopPropagation()}\n >\n {children}\n </ul>\n );\n}\n\n/** One label in the chooser's list, highlighted while `active`. A press picks it and keeps focus in the search field. */\nexport function LabelChooserOption({\n id,\n selected,\n disabled,\n active,\n onHover,\n onPick,\n children,\n}: {\n id: string;\n selected: boolean;\n disabled: boolean;\n active: boolean;\n onHover: () => void;\n onPick: () => void;\n children: ReactNode;\n}) {\n return (\n <li\n id={id}\n role=\"option\"\n aria-selected={selected}\n aria-disabled={disabled}\n className={`cursor-pointer rounded px-2 py-1 text-[13px] wrap-anywhere ${active ? 'bg-(--muted)' : ''}`}\n onMouseMove={onHover}\n onMouseDown={(event) => event.preventDefault()}\n onClick={onPick}\n >\n {children}\n </li>\n );\n}\n\n/** What the chooser's list says when no label matches, announced. */\nexport function LabelChooserEmpty({ children }: { children: ReactNode }) {\n return (\n <li role=\"status\" className=\"px-2 py-2 text-xs text-(--muted-foreground)\">\n {children}\n </li>\n );\n}\n\n/** The chooser's closing actions, at either end of a ruled line. */\nexport function LabelChooserFooter({ children }: { children: ReactNode }) {\n return <div className=\"flex justify-between gap-2 border-t border-(--border) pt-2\">{children}</div>;\n}\n"],"mappings":";;;;;;;AAYA,SAAgB,cAAc,EAC1B,OACA,MACA,QACA,aACA,SACA,UACA,GAAG,QAQa;CAChB,OACI,qBAAC,OAAD;EAAK,GAAI;EAAM,WAAU;EAAzB,UAAA,CACI,qBAAC,OAAD;GAAK,WAAU;GAAf,UAAA;IACI,oBAAC,QAAD;KAAM,WAAU;KAA2B,UAAA;IAAY,CAAA;IACtD;IACD,qBAAC,OAAD;KACI,MAAK;KACL,cAAY;KACZ,WAAU;KAHd,UAAA,CAKK,QACD,oBAAC,QAAD;MAAM,WAAU;MAAgB,UAAA;KAAc,CAAA,CAC7C;;GACJ;EACJ,CAAA,GAAA,QACA;;AAEb;;AAGA,SAAgB,eAAe,EAAE,OAAO,SAAS,YAAsE;CACnH,OACI,oBAAC,UAAD;EACI,MAAK;EACL,WAAU;EACV,cAAY;EACH;EAER;CACG,CAAA;AAEhB;;AAGA,SAAgB,qBAAqB,EACjC,WAAW,OACX,SACA,YAKD;CACC,OACI,oBAAC,UAAD;EACI,MAAK;EACK;EACV,WAAU;EACD;EAER;CACG,CAAA;AAEhB;;AAGA,SAAgB,aAAa,EAAE,UAAU,GAAG,QAAkD;CAC1F,OACI,oBAAC,OAAD;EAAK,GAAI;EAAM,WAAU;EACpB;CACA,CAAA;AAEb;;AAGA,SAAgB,iBAAiB,EAAE,IAAI,OAAO,YAAgE;CAC1G,OACI,oBAAC,MAAD;EACQ;EACJ,MAAK;EACL,wBAAA;EACA,cAAY;EACZ,WAAU;EACV,UAAU,UAAU,MAAM,gBAAgB;EAEzC;CACD,CAAA;AAEZ;;AAGA,SAAgB,mBAAmB,EAC/B,IACA,UACA,UACA,QACA,SACA,QACA,YASD;CACC,OACI,oBAAC,MAAD;EACQ;EACJ,MAAK;EACL,iBAAe;EACf,iBAAe;EACf,WAAW,8DAA8D,SAAS,iBAAiB;EACnG,aAAa;EACb,cAAc,UAAU,MAAM,eAAe;EAC7C,SAAS;EAER;CACD,CAAA;AAEZ;;AAGA,SAAgB,kBAAkB,EAAE,YAAqC;CACrE,OACI,oBAAC,MAAD;EAAI,MAAK;EAAS,WAAU;EACvB;CACD,CAAA;AAEZ;;AAGA,SAAgB,mBAAmB,EAAE,YAAqC;CACtE,OAAO,oBAAC,OAAD;EAAK,WAAU;EAA8D;CAAc,CAAA;AACtG"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { MouseEvent, ReactNode } from "react";
|
|
2
|
+
interface BoardWarningsProps {
|
|
3
|
+
/** A warning shown open above the rest, such as a lost board server, which every number on the page depends on. */
|
|
4
|
+
lead?: ReactNode;
|
|
5
|
+
/** The collapsed list's summary, such as "2 connections need attention"; without it, no list. */
|
|
6
|
+
summary?: ReactNode;
|
|
7
|
+
/** The warnings in the collapsed list. */
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
/** At the banner's right, such as Diagnostics. */
|
|
10
|
+
action: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
/** The board's warnings, in a banner under the title bar: connection problems stay in a collapsed list, inline
|
|
13
|
+
* details that never open a notification or a dialog. */
|
|
14
|
+
export declare function BoardWarnings({ lead, summary, children, action }: BoardWarningsProps): import("react").JSX.Element;
|
|
15
|
+
interface BoardWarningProps {
|
|
16
|
+
/** What the warning is about, as `data-warning`. */
|
|
17
|
+
name: string;
|
|
18
|
+
title: string;
|
|
19
|
+
dismissLabel: string;
|
|
20
|
+
onDismiss: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
21
|
+
/** Under the text, such as a button that fixes it. */
|
|
22
|
+
action?: ReactNode;
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
}
|
|
25
|
+
/** One warning in the banner: its title, what to do, and a close button. Commands in it wrap anywhere. */
|
|
26
|
+
export declare function BoardWarning({ name, title, dismissLabel, onDismiss, action, children }: BoardWarningProps): import("react").JSX.Element;
|
|
27
|
+
/** What fills the board's main area while a tool it can't work without is missing: the Lar mark, what's missing, why
|
|
28
|
+
* and how to fix it, and a way to look again. */
|
|
29
|
+
export declare function ToolMissing({ title, children, action }: {
|
|
30
|
+
title: string;
|
|
31
|
+
children: ReactNode;
|
|
32
|
+
action: ReactNode;
|
|
33
|
+
}): import("react").JSX.Element;
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=Warnings.d.ts.map
|