@xdev-asia/ui 0.0.0-stage → 4.15.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/AGENTS.md +66 -0
- package/LICENSE +202 -0
- package/README.md +149 -2
- package/assets/brand/mobile/android-background-1024.png +0 -0
- package/assets/brand/mobile/android-background.svg +13 -0
- package/assets/brand/mobile/android-foreground-1024.png +0 -0
- package/assets/brand/mobile/android-foreground.svg +13 -0
- package/assets/brand/mobile/android-monochrome-1024.png +0 -0
- package/assets/brand/mobile/android-monochrome.svg +3 -0
- package/assets/brand/mobile/ios-icon-1024.png +0 -0
- package/assets/brand/mobile/ios-icon-dark-1024.png +0 -0
- package/assets/brand/mobile/ios-icon-dark.svg +22 -0
- package/assets/brand/mobile/ios-icon.svg +22 -0
- package/assets/brand/systems/xdev-ui-icon.svg +23 -0
- package/assets/brand/systems/xdev-ui-lockup-dark.svg +24 -0
- package/assets/brand/systems/xdev-ui-lockup-light.svg +24 -0
- package/assets/brand/systems/xdev-ui-mark-lit.svg +13 -0
- package/assets/brand/systems/xdev-ui-mark.svg +3 -0
- package/assets/brand/xdev-icon-512.png +0 -0
- package/assets/brand/xdev-icon-blue.svg +23 -0
- package/assets/brand/xdev-icon.svg +23 -0
- package/assets/brand/xdev-lockup-dark.svg +24 -0
- package/assets/brand/xdev-lockup-light.svg +24 -0
- package/assets/brand/xdev-mark-lit.svg +13 -0
- package/assets/brand/xdev-mark-tile.svg +3 -0
- package/assets/brand/xdev-mark.svg +3 -0
- package/bin/xdev-ui-skills.mjs +142 -0
- package/dist/Workspace.stories.d.ts +15 -0
- package/dist/ai-manifest.json +3727 -0
- package/dist/chunks/FileDrop-C-ygn8kF.js +891 -0
- package/dist/chunks/FileDrop-C-ygn8kF.js.map +1 -0
- package/dist/chunks/Popover-Ds4RBtZv.js +121 -0
- package/dist/chunks/Popover-Ds4RBtZv.js.map +1 -0
- package/dist/chunks/crop-CahE3q01.js +55 -0
- package/dist/chunks/crop-CahE3q01.js.map +1 -0
- package/dist/chunks/modal-BYFY08ti.js +54 -0
- package/dist/chunks/modal-BYFY08ti.js.map +1 -0
- package/dist/components/ActionTile/ActionTile.d.ts +14 -0
- package/dist/components/ActionTile/ActionTile.stories.d.ts +18 -0
- package/dist/components/ActivityBar/ActivityBar.d.ts +36 -0
- package/dist/components/ActivityBar/ActivityBar.stories.d.ts +27 -0
- package/dist/components/AgentChip/AgentChip.d.ts +10 -0
- package/dist/components/AgentChip/AgentChip.stories.d.ts +21 -0
- package/dist/components/AgentRow/AgentRow.d.ts +24 -0
- package/dist/components/AgentRow/AgentRow.stories.d.ts +19 -0
- package/dist/components/AppShell/AppShell.d.ts +58 -0
- package/dist/components/AppShell/AppShell.stories.d.ts +17 -0
- package/dist/components/ApprovalBar/ApprovalBar.d.ts +23 -0
- package/dist/components/ApprovalBar/ApprovalBar.stories.d.ts +18 -0
- package/dist/components/AttentionInbox/AttentionInbox.d.ts +43 -0
- package/dist/components/AttentionInbox/AttentionInbox.stories.d.ts +16 -0
- package/dist/components/AudioPreview/AudioPreview.d.ts +33 -0
- package/dist/components/AudioPreview/AudioPreview.stories.d.ts +23 -0
- package/dist/components/AudioPreview/audio-preview-store.d.ts +14 -0
- package/dist/components/AuthShell/AuthShell.d.ts +24 -0
- package/dist/components/AuthShell/AuthShell.stories.d.ts +20 -0
- package/dist/components/Avatar/Avatar.d.ts +13 -0
- package/dist/components/Avatar/Avatar.stories.d.ts +21 -0
- package/dist/components/Badge/Badge.d.ts +14 -0
- package/dist/components/Badge/Badge.stories.d.ts +26 -0
- package/dist/components/Banner/Banner.d.ts +11 -0
- package/dist/components/Banner/Banner.stories.d.ts +23 -0
- package/dist/components/BarChart/BarChart.d.ts +20 -0
- package/dist/components/BarChart/BarChart.stories.d.ts +24 -0
- package/dist/components/Board/Board.d.ts +9 -0
- package/dist/components/Board/Board.stories.d.ts +18 -0
- package/dist/components/BoardCard/BoardCard.d.ts +32 -0
- package/dist/components/BoardColumn/BoardColumn.d.ts +24 -0
- package/dist/components/BottomNav/BottomNav.d.ts +40 -0
- package/dist/components/BottomNav/BottomNav.stories.d.ts +40 -0
- package/dist/components/BrandMark/BrandMark.d.ts +20 -0
- package/dist/components/BrandMark/BrandMark.stories.d.ts +28 -0
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +22 -0
- package/dist/components/Breadcrumb/Breadcrumb.stories.d.ts +27 -0
- package/dist/components/BulkBar/BulkBar.d.ts +21 -0
- package/dist/components/BulkBar/BulkBar.stories.d.ts +16 -0
- package/dist/components/Button/Button.d.ts +42 -0
- package/dist/components/Button/Button.stories.d.ts +41 -0
- package/dist/components/Card/Card.d.ts +22 -0
- package/dist/components/Card/Card.stories.d.ts +307 -0
- package/dist/components/Checkbox/Checkbox.d.ts +10 -0
- package/dist/components/Checkbox/Checkbox.stories.d.ts +18 -0
- package/dist/components/Coachmark/Coachmark.d.ts +31 -0
- package/dist/components/Coachmark/Coachmark.stories.d.ts +27 -0
- package/dist/components/Coachmark/placeCoachmark.d.ts +31 -0
- package/dist/components/CodeBlock/CodeBlock.d.ts +19 -0
- package/dist/components/CodeBlock/CodeBlock.stories.d.ts +22 -0
- package/dist/components/CodeInput/CodeInput.d.ts +25 -0
- package/dist/components/CodeInput/CodeInput.stories.d.ts +32 -0
- package/dist/components/CodeInput/normalizeCode.d.ts +10 -0
- package/dist/components/ColorField/ColorField.d.ts +29 -0
- package/dist/components/Combobox/Combobox.d.ts +105 -0
- package/dist/components/Combobox/Combobox.stories.d.ts +42 -0
- package/dist/components/CommandPalette/CommandPalette.d.ts +94 -0
- package/dist/components/CommandPalette/CommandPalette.stories.d.ts +39 -0
- package/dist/components/Comment/Comment.d.ts +25 -0
- package/dist/components/Comment/Comment.stories.d.ts +24 -0
- package/dist/components/CommitGraph/CommitGraph.d.ts +15 -0
- package/dist/components/CommitGraph/CommitGraph.stories.d.ts +15 -0
- package/dist/components/CommitGraph/graphLanes.d.ts +56 -0
- package/dist/components/Composer/Composer.d.ts +31 -0
- package/dist/components/Composer/Composer.stories.d.ts +17 -0
- package/dist/components/Container/Container.d.ts +11 -0
- package/dist/components/Container/Container.stories.d.ts +14 -0
- package/dist/components/DataTable/DataTable.d.ts +79 -0
- package/dist/components/DataTable/DataTable.stories.d.ts +26 -0
- package/dist/components/DataTable/table-helpers.d.ts +16 -0
- package/dist/components/DataTable/table-reorder.d.ts +40 -0
- package/dist/components/DatePicker/Calendar.d.ts +51 -0
- package/dist/components/DatePicker/DatePicker.d.ts +51 -0
- package/dist/components/DatePicker/DatePicker.stories.d.ts +42 -0
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +59 -0
- package/dist/components/DateRangePicker/DateRangePicker.stories.d.ts +42 -0
- package/dist/components/DescriptionList/DescriptionList.d.ts +14 -0
- package/dist/components/DescriptionList/DescriptionList.stories.d.ts +21 -0
- package/dist/components/Dialog/Dialog.d.ts +43 -0
- package/dist/components/Dialog/Dialog.stories.d.ts +22 -0
- package/dist/components/DiffStat/DiffStat.d.ts +12 -0
- package/dist/components/DiffStat/DiffStat.stories.d.ts +15 -0
- package/dist/components/Disclosure/Disclosure.d.ts +18 -0
- package/dist/components/Disclosure/Disclosure.stories.d.ts +27 -0
- package/dist/components/DonutChart/DonutChart.d.ts +30 -0
- package/dist/components/DonutChart/DonutChart.stories.d.ts +26 -0
- package/dist/components/Drawer/Drawer.d.ts +27 -0
- package/dist/components/Drawer/Drawer.stories.d.ts +18 -0
- package/dist/components/Emblem/Emblem.d.ts +19 -0
- package/dist/components/Emblem/Emblem.stories.d.ts +19 -0
- package/dist/components/EmptyState/EmptyState.d.ts +43 -0
- package/dist/components/EmptyState/EmptyState.stories.d.ts +17 -0
- package/dist/components/EndpointPanel/EndpointPanel.d.ts +29 -0
- package/dist/components/FacetFilter/FacetFilter.d.ts +39 -0
- package/dist/components/FacetFilter/FacetFilter.stories.d.ts +23 -0
- package/dist/components/FacetFilter/facet-helpers.d.ts +5 -0
- package/dist/components/Field/Field.d.ts +27 -0
- package/dist/components/Field/Field.stories.d.ts +25 -0
- package/dist/components/FieldMessage/FieldMessage.d.ts +10 -0
- package/dist/components/FieldMessage/FieldMessage.stories.d.ts +14 -0
- package/dist/components/FileDrop/FileDrop.d.ts +72 -0
- package/dist/components/FileDrop/FileDrop.stories.d.ts +18 -0
- package/dist/components/FileIcon/FileIcon.d.ts +25 -0
- package/dist/components/FileIcon/FileIcon.stories.d.ts +14 -0
- package/dist/components/FilterChip/FilterChip.d.ts +9 -0
- package/dist/components/FilterChip/FilterChip.stories.d.ts +19 -0
- package/dist/components/FlowMap/FlowMap.d.ts +74 -0
- package/dist/components/FlowMap/FlowMap.stories.d.ts +24 -0
- package/dist/components/FontField/FontField.d.ts +15 -0
- package/dist/components/FontField/FontField.stories.d.ts +17 -0
- package/dist/components/FormDialog/FormDialog.d.ts +40 -0
- package/dist/components/FormDialog/FormDialog.stories.d.ts +22 -0
- package/dist/components/FormSection/FormSection.d.ts +19 -0
- package/dist/components/FormSection/FormSection.stories.d.ts +16 -0
- package/dist/components/Grid/Grid.d.ts +23 -0
- package/dist/components/Grid/Grid.stories.d.ts +19 -0
- package/dist/components/Grid/breakpoints.d.ts +25 -0
- package/dist/components/Heatmap/Heatmap.d.ts +22 -0
- package/dist/components/Heatmap/Heatmap.stories.d.ts +24 -0
- package/dist/components/Icon/Icon.d.ts +14 -0
- package/dist/components/Icon/Icon.stories.d.ts +20 -0
- package/dist/components/IconButton/IconButton.d.ts +16 -0
- package/dist/components/IconButton/IconButton.stories.d.ts +27 -0
- package/dist/components/Identity/Identity.d.ts +14 -0
- package/dist/components/Identity/Identity.stories.d.ts +14 -0
- package/dist/components/Kbd/Kbd.d.ts +5 -0
- package/dist/components/Kbd/Kbd.stories.d.ts +13 -0
- package/dist/components/Label/Label.d.ts +15 -0
- package/dist/components/Label/Label.stories.d.ts +16 -0
- package/dist/components/LaunchCard/LaunchCard.d.ts +36 -0
- package/dist/components/LaunchCard/LaunchCard.stories.d.ts +32 -0
- package/dist/components/List/List.d.ts +11 -0
- package/dist/components/List/List.stories.d.ts +13 -0
- package/dist/components/ListRow/ListRow.d.ts +20 -0
- package/dist/components/ListRow/ListRow.stories.d.ts +27 -0
- package/dist/components/Menu/Menu.d.ts +53 -0
- package/dist/components/Menu/Menu.stories.d.ts +85 -0
- package/dist/components/Menu/MenuButton.d.ts +23 -0
- package/dist/components/Menu/MenuButton.stories.d.ts +46 -0
- package/dist/components/Menu/menu-keys.d.ts +26 -0
- package/dist/components/Meter/Meter.d.ts +18 -0
- package/dist/components/Meter/Meter.stories.d.ts +34 -0
- package/dist/components/ModelChip/ModelChip.d.ts +26 -0
- package/dist/components/ModelChip/ModelChip.stories.d.ts +18 -0
- package/dist/components/NavList/NavList.d.ts +56 -0
- package/dist/components/NavList/NavList.stories.d.ts +25 -0
- package/dist/components/PageHeader/PageHeader.d.ts +14 -0
- package/dist/components/PageHeader/PageHeader.stories.d.ts +14 -0
- package/dist/components/Pagination/Pagination.d.ts +28 -0
- package/dist/components/Pagination/Pagination.stories.d.ts +16 -0
- package/dist/components/PairingCode/PairingCode.d.ts +17 -0
- package/dist/components/PairingCode/PairingCode.stories.d.ts +24 -0
- package/dist/components/PaletteTrigger/PaletteTrigger.d.ts +16 -0
- package/dist/components/PanZoom/PanZoom.d.ts +24 -0
- package/dist/components/PanZoom/PanZoom.stories.d.ts +11 -0
- package/dist/components/Popover/Popover.d.ts +24 -0
- package/dist/components/Popover/Popover.stories.d.ts +25 -0
- package/dist/components/Prose/Prose.d.ts +8 -0
- package/dist/components/Prose/Prose.stories.d.ts +12 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +27 -0
- package/dist/components/RadioGroup/RadioGroup.stories.d.ts +22 -0
- package/dist/components/ReactionBar/ReactionBar.d.ts +21 -0
- package/dist/components/ReactionBar/ReactionBar.stories.d.ts +26 -0
- package/dist/components/ResourceCard/ResourceCard.d.ts +30 -0
- package/dist/components/ResourceCard/ResourceCard.stories.d.ts +19 -0
- package/dist/components/ReviewComment/ReviewComment.d.ts +41 -0
- package/dist/components/ReviewComment/ReviewComment.stories.d.ts +19 -0
- package/dist/components/RouteDiagram/RouteDiagram.d.ts +27 -0
- package/dist/components/RunTimeline/RunTimeline.d.ts +28 -0
- package/dist/components/RunTimeline/RunTimeline.stories.d.ts +31 -0
- package/dist/components/SaveBar/SaveBar.d.ts +56 -0
- package/dist/components/SaveBar/SaveBar.stories.d.ts +16 -0
- package/dist/components/SearchInput/SearchInput.d.ts +22 -0
- package/dist/components/SearchInput/SearchInput.stories.d.ts +18 -0
- package/dist/components/SearchPicker/SearchPicker.d.ts +49 -0
- package/dist/components/SearchPicker/SearchPicker.stories.d.ts +33 -0
- package/dist/components/Segmented/Segmented.d.ts +18 -0
- package/dist/components/Segmented/Segmented.stories.d.ts +18 -0
- package/dist/components/Select/Select.d.ts +26 -0
- package/dist/components/Select/Select.stories.d.ts +22 -0
- package/dist/components/ServiceStatus/ServiceStatus.d.ts +13 -0
- package/dist/components/SessionBar/SessionBar.d.ts +33 -0
- package/dist/components/SessionBar/SessionBar.stories.d.ts +27 -0
- package/dist/components/SettingRow/SettingRow.d.ts +17 -0
- package/dist/components/SettingRow/SettingRow.stories.d.ts +26 -0
- package/dist/components/SettingsShell/SettingsShell.d.ts +52 -0
- package/dist/components/SettingsShell/SettingsShell.stories.d.ts +9 -0
- package/dist/components/ShellTitle/ShellTitle.d.ts +25 -0
- package/dist/components/SiteShell/SiteShell.d.ts +24 -0
- package/dist/components/SiteShell/SiteShell.stories.d.ts +18 -0
- package/dist/components/Skeleton/Skeleton.d.ts +20 -0
- package/dist/components/Skeleton/Skeleton.stories.d.ts +15 -0
- package/dist/components/SortableList/SortableList.d.ts +30 -0
- package/dist/components/SortableList/SortableList.stories.d.ts +16 -0
- package/dist/components/Spinner/Spinner.d.ts +15 -0
- package/dist/components/Spinner/Spinner.stories.d.ts +14 -0
- package/dist/components/SplitHandle/SplitHandle.d.ts +25 -0
- package/dist/components/SplitHandle/SplitHandle.stories.d.ts +18 -0
- package/dist/components/Stack/Stack.d.ts +18 -0
- package/dist/components/Stack/Stack.stories.d.ts +12 -0
- package/dist/components/StatTile/StatTile.d.ts +30 -0
- package/dist/components/StatTile/StatTile.stories.d.ts +32 -0
- package/dist/components/StatusBar/StatusBar.d.ts +8 -0
- package/dist/components/StatusBar/StatusBar.stories.d.ts +15 -0
- package/dist/components/StatusDot/StatusDot.d.ts +18 -0
- package/dist/components/StatusDot/StatusDot.stories.d.ts +24 -0
- package/dist/components/StepDots/StepDots.d.ts +15 -0
- package/dist/components/StepDots/StepDots.stories.d.ts +15 -0
- package/dist/components/SwatchGroup/SwatchGroup.d.ts +20 -0
- package/dist/components/SwatchGroup/SwatchGroup.stories.d.ts +33 -0
- package/dist/components/Switch/Switch.d.ts +10 -0
- package/dist/components/Switch/Switch.stories.d.ts +17 -0
- package/dist/components/TabStrip/TabStrip.d.ts +44 -0
- package/dist/components/TabStrip/TabStrip.stories.d.ts +66 -0
- package/dist/components/Tabs/Tabs.d.ts +28 -0
- package/dist/components/Tabs/Tabs.stories.d.ts +34 -0
- package/dist/components/Tag/Tag.d.ts +12 -0
- package/dist/components/Tag/Tag.stories.d.ts +21 -0
- package/dist/components/Textarea/Textarea.d.ts +15 -0
- package/dist/components/Textarea/Textarea.stories.d.ts +19 -0
- package/dist/components/ThemeEditor/ThemeEditor.d.ts +56 -0
- package/dist/components/ThemePreview/ThemePreview.d.ts +15 -0
- package/dist/components/ThemeSwitch/ThemeSwitch.d.ts +30 -0
- package/dist/components/ThemeSwitch/ThemeSwitch.stories.d.ts +15 -0
- package/dist/components/TimeField/TimeField.d.ts +32 -0
- package/dist/components/TimeField/TimeField.stories.d.ts +36 -0
- package/dist/components/TimeField/time-text.d.ts +26 -0
- package/dist/components/TimeSeriesChart/TimeSeriesChart.d.ts +30 -0
- package/dist/components/TimeSeriesChart/TimeSeriesChart.stories.d.ts +29 -0
- package/dist/components/Toast/Toast.d.ts +18 -0
- package/dist/components/Toast/Toast.stories.d.ts +15 -0
- package/dist/components/Toast/Toaster.d.ts +18 -0
- package/dist/components/Toast/Toaster.stories.d.ts +16 -0
- package/dist/components/Toast/toast-region.d.ts +17 -0
- package/dist/components/Toast/toast-store.d.ts +46 -0
- package/dist/components/ToggleButton/ToggleButton.d.ts +16 -0
- package/dist/components/ToggleButton/ToggleButton.stories.d.ts +20 -0
- package/dist/components/Toolbar/Toolbar.d.ts +21 -0
- package/dist/components/Toolbar/Toolbar.stories.d.ts +25 -0
- package/dist/components/Tooltip/Tooltip.d.ts +13 -0
- package/dist/components/Tooltip/Tooltip.stories.d.ts +23 -0
- package/dist/components/TreeView/TreeView.d.ts +42 -0
- package/dist/components/TreeView/TreeView.stories.d.ts +26 -0
- package/dist/components/TreeView/pathRows.d.ts +16 -0
- package/dist/components/TreeView/treeKeys.d.ts +16 -0
- package/dist/components/UsageMeterRow/UsageMeterRow.d.ts +28 -0
- package/dist/components/UsageMeterRow/UsageMeterRow.stories.d.ts +26 -0
- package/dist/components/WorktreeRow/WorktreeRow.d.ts +32 -0
- package/dist/components/WorktreeRow/WorktreeRow.stories.d.ts +32 -0
- package/dist/components/ZoomBar/ZoomBar.d.ts +22 -0
- package/dist/components/ZoomBar/ZoomBar.stories.d.ts +17 -0
- package/dist/editor/RichTextEditor/EditorToolbar.d.ts +35 -0
- package/dist/editor/RichTextEditor/ImageBar.d.ts +17 -0
- package/dist/editor/RichTextEditor/LinkForm.d.ts +16 -0
- package/dist/editor/RichTextEditor/RichTextEditor.d.ts +45 -0
- package/dist/editor/RichTextEditor/RichTextEditor.stories.d.ts +43 -0
- package/dist/editor/RichTextEditor/extensions.d.ts +23 -0
- package/dist/editor/RichTextEditor/icons.d.ts +23 -0
- package/dist/editor/RichTextEditor/insertImage.d.ts +28 -0
- package/dist/editor/RichTextEditor/labels.d.ts +32 -0
- package/dist/editor/index.d.ts +4 -0
- package/dist/editor.js +629 -0
- package/dist/editor.js.map +1 -0
- package/dist/fonts.css +2 -0
- package/dist/icons.d.ts +891 -0
- package/dist/image/ImageCropper/ImageCropper.d.ts +39 -0
- package/dist/image/ImageCropper/ImageCropper.stories.d.ts +18 -0
- package/dist/image/ImageField/ImageField.d.ts +86 -0
- package/dist/image/ImageField/ImageField.stories.d.ts +29 -0
- package/dist/image/crop.d.ts +39 -0
- package/dist/image/index.d.ts +3 -0
- package/dist/image.js +377 -0
- package/dist/image.js.map +1 -0
- package/dist/index.d.ts +138 -0
- package/dist/index.js +8253 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/cx.d.ts +2 -0
- package/dist/internal/date.d.ts +96 -0
- package/dist/internal/duration.d.ts +4 -0
- package/dist/internal/focus.d.ts +34 -0
- package/dist/internal/keys.d.ts +21 -0
- package/dist/internal/modal.d.ts +8 -0
- package/dist/internal/portal.d.ts +9 -0
- package/dist/internal/position.d.ts +37 -0
- package/dist/internal/reveal.d.ts +6 -0
- package/dist/internal/roving.d.ts +25 -0
- package/dist/internal/scroll-fade.d.ts +16 -0
- package/dist/internal/session-labels.d.ts +3 -0
- package/dist/internal/text.d.ts +2 -0
- package/dist/llms-full.txt +9786 -0
- package/dist/llms.txt +162 -0
- package/dist/mcp.js +24706 -0
- package/dist/panZoom.d.ts +40 -0
- package/dist/styles.css +2 -0
- package/dist/styles.layered.css +4 -0
- package/dist/tailwind.css +38 -0
- package/dist/test-utils.d.ts +5 -0
- package/dist/theme/font.d.ts +20 -0
- package/dist/theme/index.d.ts +2 -0
- package/dist/theme/theme.d.ts +62 -0
- package/dist/tokens.css +308 -0
- package/dist/tokens.json +269 -0
- package/dist/types.d.ts +6 -0
- package/package.json +177 -4
- package/skills/xdev-ui-admin/SKILL.md +106 -0
- package/skills/xdev-ui-admin/references/audit-log.md +18 -0
- package/skills/xdev-ui-admin/references/console-chrome.md +119 -0
- package/skills/xdev-ui-admin/references/dashboard.md +24 -0
- package/skills/xdev-ui-admin/references/detail-and-forms.md +22 -0
- package/skills/xdev-ui-admin/references/dialogs.md +33 -0
- package/skills/xdev-ui-admin/references/forms.md +60 -0
- package/skills/xdev-ui-admin/references/from-other-kits.md +75 -0
- package/skills/xdev-ui-admin/references/layout.md +58 -0
- package/skills/xdev-ui-admin/references/navigation.md +10 -0
- package/skills/xdev-ui-admin/references/permissions.md +26 -0
- package/skills/xdev-ui-admin/references/resource-list.md +64 -0
- package/skills/xdev-ui-admin/references/responsive.md +68 -0
- package/skills/xdev-ui-admin/references/rich-content.md +37 -0
- package/skills/xdev-ui-admin/references/settings.md +20 -0
- package/skills/xdev-ui-admin/references/sign-in.md +47 -0
- package/skills/xdev-ui-admin/references/states-feedback.md +26 -0
- package/skills/xdev-ui-admin/references/tree-list.md +50 -0
- package/skills/xdev-ui-admin/references/users-roles.md +32 -0
- package/skills/xdev-ui-admin/references/ux-principles.md +43 -0
- package/skills/xdev-ui-admin/references/visual-identity.md +62 -0
- package/skills/xdev-ui-admin/templates/admin/_gitignore +3 -0
- package/skills/xdev-ui-admin/templates/admin/_mcp.json +5 -0
- package/skills/xdev-ui-admin/templates/admin/_npmrc +2 -0
- package/skills/xdev-ui-admin/templates/admin/index.html +14 -0
- package/skills/xdev-ui-admin/templates/admin/package.json +24 -0
- package/skills/xdev-ui-admin/templates/admin/src/App.tsx +66 -0
- package/skills/xdev-ui-admin/templates/admin/src/app.css +26 -0
- package/skills/xdev-ui-admin/templates/admin/src/auth/permissions.ts +7 -0
- package/skills/xdev-ui-admin/templates/admin/src/auth/session.ts +42 -0
- package/skills/xdev-ui-admin/templates/admin/src/data/context.ts +11 -0
- package/skills/xdev-ui-admin/templates/admin/src/data/store.ts +84 -0
- package/skills/xdev-ui-admin/templates/admin/src/data/useLoad.ts +25 -0
- package/skills/xdev-ui-admin/templates/admin/src/i18n/en.ts +98 -0
- package/skills/xdev-ui-admin/templates/admin/src/i18n/index.tsx +63 -0
- package/skills/xdev-ui-admin/templates/admin/src/i18n/vi.ts +98 -0
- package/skills/xdev-ui-admin/templates/admin/src/i18n/xdev-ui-labels.ts +47 -0
- package/skills/xdev-ui-admin/templates/admin/src/main.tsx +12 -0
- package/skills/xdev-ui-admin/templates/admin/src/notify.tsx +36 -0
- package/skills/xdev-ui-admin/templates/admin/src/pages/Dashboard.tsx +55 -0
- package/skills/xdev-ui-admin/templates/admin/src/pages/ItemDetail.tsx +83 -0
- package/skills/xdev-ui-admin/templates/admin/src/pages/ItemsList.tsx +140 -0
- package/skills/xdev-ui-admin/templates/admin/src/pages/NotFound.tsx +17 -0
- package/skills/xdev-ui-admin/templates/admin/src/pages/Settings.tsx +37 -0
- package/skills/xdev-ui-admin/templates/admin/src/pages/SignIn.tsx +105 -0
- package/skills/xdev-ui-admin/templates/admin/src/router.ts +49 -0
- package/skills/xdev-ui-admin/templates/admin/src/shell/AccountMenu.tsx +36 -0
- package/skills/xdev-ui-admin/templates/admin/src/shell/Shell.tsx +53 -0
- package/skills/xdev-ui-admin/templates/admin/src/theme.ts +34 -0
- package/skills/xdev-ui-admin/templates/admin/tsconfig.json +16 -0
- package/skills/xdev-ui-admin/templates/admin/vite.config.ts +4 -0
- package/skills/xdev-ui-build-app/SKILL.md +85 -0
- package/skills/xdev-ui-build-app/references/app-shell.md +20 -0
- package/skills/xdev-ui-build-app/references/i18n.md +9 -0
- package/skills/xdev-ui-build-app/references/responsive-a11y.md +10 -0
- package/skills/xdev-ui-build-app/references/routing.md +14 -0
- package/skills/xdev-ui-build-app/references/setup.md +25 -0
- package/skills/xdev-ui-build-app/references/states.md +25 -0
- package/skills/xdev-ui-build-app/references/theme.md +11 -0
- package/skills/xdev-ui-build-app/templates/app/_gitignore +3 -0
- package/skills/xdev-ui-build-app/templates/app/_mcp.json +5 -0
- package/skills/xdev-ui-build-app/templates/app/_npmrc +2 -0
- package/skills/xdev-ui-build-app/templates/app/index.html +14 -0
- package/skills/xdev-ui-build-app/templates/app/package.json +24 -0
- package/skills/xdev-ui-build-app/templates/app/src/App.tsx +77 -0
- package/skills/xdev-ui-build-app/templates/app/src/app.css +3 -0
- package/skills/xdev-ui-build-app/templates/app/src/i18n/en.ts +35 -0
- package/skills/xdev-ui-build-app/templates/app/src/i18n/index.tsx +63 -0
- package/skills/xdev-ui-build-app/templates/app/src/i18n/vi.ts +35 -0
- package/skills/xdev-ui-build-app/templates/app/src/i18n/xdev-ui-labels.ts +19 -0
- package/skills/xdev-ui-build-app/templates/app/src/main.tsx +12 -0
- package/skills/xdev-ui-build-app/templates/app/src/notify.tsx +36 -0
- package/skills/xdev-ui-build-app/templates/app/src/pages/Home.tsx +22 -0
- package/skills/xdev-ui-build-app/templates/app/src/pages/NotFound.tsx +17 -0
- package/skills/xdev-ui-build-app/templates/app/src/pages/Settings.tsx +35 -0
- package/skills/xdev-ui-build-app/templates/app/src/router.ts +26 -0
- package/skills/xdev-ui-build-app/templates/app/src/theme.ts +34 -0
- package/skills/xdev-ui-build-app/templates/app/tsconfig.json +16 -0
- package/skills/xdev-ui-build-app/templates/app/vite.config.ts +4 -0
- package/skills/xdev-ui-design/SKILL.md +111 -0
- package/skills/xdev-ui-design/references/brand.md +58 -0
- package/skills/xdev-ui-design/references/checklist.md +55 -0
- package/skills/xdev-ui-design/references/owner-notes.md +54 -0
- package/skills/xdev-ui-design/references/porting.md +56 -0
- package/skills/xdev-ui-design/references/rules.md +135 -0
- package/skills/xdev-ui-design/references/screens.md +61 -0
- package/skills/xdev-ui-design/references/tokens.md +97 -0
- package/skills/xdev-ui-improve/SKILL.md +96 -0
- package/skills/xdev-ui-improve/references/plan-template.md +59 -0
- package/skills/xdev-ui-motion/SKILL.md +87 -0
- package/skills/xdev-ui-motion/references/recipes.md +117 -0
- package/skills/xdev-ui-review/SKILL.md +141 -0
- package/skills/xdev-ui-review/references/checklist.md +92 -0
- package/skills/xdev-ui-review/references/grep-recipes.md +37 -0
- package/skills/xdev-ui-review/references/pages/dashboard.md +21 -0
- package/skills/xdev-ui-review/references/pages/dialogs-forms.md +23 -0
- package/skills/xdev-ui-review/references/pages/list.md +22 -0
- package/skills/xdev-ui-review/references/pages/provider-grid.md +19 -0
- package/skills/xdev-ui-review/references/pages/settings.md +18 -0
- package/skills/xdev-ui-review/references/pages/sign-in.md +21 -0
- package/skills/xdev-ui-review/references/web-interface.md +73 -0
- package/skills/xdev-ui-review/scripts/audit.mjs +775 -0
- package/skills/xdev-ui-ux-standards/SKILL.md +88 -0
- package/skills/xdev-ui-ux-standards/references/heuristics-checklist.md +129 -0
- package/skills/xdev-ui-ux-standards/references/patterns.md +120 -0
- package/skills/xdev-ui-ux-standards/references/platforms.md +104 -0
- package/skills/xdev-ui-ux-standards/references/standards-map.md +144 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { Coachmark } from "./Coachmark";
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof Coachmark;
|
|
6
|
+
args: {
|
|
7
|
+
anchor: {
|
|
8
|
+
top: number;
|
|
9
|
+
left: number;
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
};
|
|
13
|
+
title: string;
|
|
14
|
+
children: string;
|
|
15
|
+
step: number;
|
|
16
|
+
total: number;
|
|
17
|
+
onBack: () => void;
|
|
18
|
+
onNext: () => void;
|
|
19
|
+
onSkip: () => void;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export default meta;
|
|
23
|
+
type Story = StoryObj<typeof meta>;
|
|
24
|
+
export declare const First: Story;
|
|
25
|
+
export declare const Middle: Story;
|
|
26
|
+
export declare const Last: Story;
|
|
27
|
+
export declare const FlipsToTop: Story;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** Side of the anchor the card sits on. "start" is the left and "end" the right (left-to-right layouts). */
|
|
2
|
+
export type CoachmarkPlacement = "top" | "bottom" | "start" | "end";
|
|
3
|
+
/** The parts of a DOMRect the placement reads. */
|
|
4
|
+
export interface RectLike {
|
|
5
|
+
top: number;
|
|
6
|
+
left: number;
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
}
|
|
10
|
+
export interface CoachmarkSize {
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
}
|
|
14
|
+
export interface CoachmarkPosition {
|
|
15
|
+
top: number;
|
|
16
|
+
left: number;
|
|
17
|
+
/** The side actually used: the preferred one, or the opposite one when only that fits. */
|
|
18
|
+
placement: CoachmarkPlacement;
|
|
19
|
+
/** Offset of the arrow along the card edge that faces the anchor, in px. */
|
|
20
|
+
arrow: number;
|
|
21
|
+
}
|
|
22
|
+
/** Space kept between the card and the viewport edge (--x-space-2). */
|
|
23
|
+
export declare const COACHMARK_MARGIN = 8;
|
|
24
|
+
/** Space between the anchor and the card, room for the arrow (--x-space-3). */
|
|
25
|
+
export declare const COACHMARK_GAP = 12;
|
|
26
|
+
/**
|
|
27
|
+
* Where a card of `size` goes next to `anchor` inside `viewport`: the preferred side when it fits,
|
|
28
|
+
* else the opposite side when that fits, else the preferred side. The result is clamped into the
|
|
29
|
+
* viewport with COACHMARK_MARGIN. Null when there is no anchor or it has no size (hidden).
|
|
30
|
+
*/
|
|
31
|
+
export declare function placeCoachmark(anchor: RectLike | null | undefined, size: CoachmarkSize, viewport: CoachmarkSize, placement?: CoachmarkPlacement): CoachmarkPosition | null;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type JSX } from "react";
|
|
2
|
+
export interface CodeBlockLabels {
|
|
3
|
+
/** Copy button text. */
|
|
4
|
+
copy: string;
|
|
5
|
+
/** Button text for a short while after a copy. */
|
|
6
|
+
copied: string;
|
|
7
|
+
}
|
|
8
|
+
export interface CodeBlockProps {
|
|
9
|
+
/** Exact text to show and copy. Not highlighted. */
|
|
10
|
+
code: string;
|
|
11
|
+
/** Small label in the head ("bash", "json", "MCP config"). */
|
|
12
|
+
language?: string;
|
|
13
|
+
/** Called after a successful copy. */
|
|
14
|
+
onCopy?: (code: string) => void;
|
|
15
|
+
/** Override the English defaults (e.g. for vi). */
|
|
16
|
+
labels?: Partial<CodeBlockLabels>;
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function CodeBlock({ code, language, onCopy, labels, className }: CodeBlockProps): JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { CodeBlock } from "./CodeBlock";
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof CodeBlock;
|
|
6
|
+
args: {
|
|
7
|
+
language: string;
|
|
8
|
+
code: string;
|
|
9
|
+
};
|
|
10
|
+
decorators: ((Story: import("storybook/internal/csf").PartialStoryFn<import("@storybook/react-vite").ReactRenderer, {
|
|
11
|
+
code: string;
|
|
12
|
+
language?: string;
|
|
13
|
+
onCopy?: (code: string) => void;
|
|
14
|
+
labels?: Partial<import("./CodeBlock").CodeBlockLabels>;
|
|
15
|
+
className?: string;
|
|
16
|
+
}>) => import("react").JSX.Element)[];
|
|
17
|
+
};
|
|
18
|
+
export default meta;
|
|
19
|
+
type Story = StoryObj<typeof meta>;
|
|
20
|
+
export declare const Command: Story;
|
|
21
|
+
export declare const McpConfig: Story;
|
|
22
|
+
export declare const Vietnamese: Story;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { JSX } from "react";
|
|
2
|
+
import { type CodeAlphabet } from "./normalizeCode";
|
|
3
|
+
export interface CodeInputProps {
|
|
4
|
+
/** Number of characters: 10 for a pairing code, 6 for a check code. */
|
|
5
|
+
length: number;
|
|
6
|
+
/** Characters per visual group. Default 5. */
|
|
7
|
+
groupSize?: number;
|
|
8
|
+
/** The normalised code, without separators. */
|
|
9
|
+
value: string;
|
|
10
|
+
onChange: (value: string) => void;
|
|
11
|
+
/** Called once when typing or pasting brings the code to `length`. */
|
|
12
|
+
onComplete?: (value: string) => void;
|
|
13
|
+
/** "crockford" (default) is base32 without I, L, O, U; "digits" takes 0 to 9 only. */
|
|
14
|
+
alphabet?: CodeAlphabet;
|
|
15
|
+
/** Accessible name of the input. Pair it with a visible label (a `Field` or heading). */
|
|
16
|
+
label: string;
|
|
17
|
+
/** 1px danger border and aria-invalid. */
|
|
18
|
+
invalid?: boolean;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
autoFocus?: boolean;
|
|
21
|
+
/** Default "one-time-code", so the platform can offer a code it received by SMS or email. Pass "off" for a code it cannot know. */
|
|
22
|
+
autoComplete?: string;
|
|
23
|
+
className?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare function CodeInput({ length, groupSize, value, onChange, onComplete, alphabet, label, invalid, disabled, autoFocus, autoComplete, className, }: CodeInputProps): JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { CodeInput } from "./CodeInput";
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof CodeInput;
|
|
6
|
+
args: {
|
|
7
|
+
length: number;
|
|
8
|
+
value: string;
|
|
9
|
+
label: string;
|
|
10
|
+
onChange: () => void;
|
|
11
|
+
};
|
|
12
|
+
render: (args: import("./CodeInput").CodeInputProps) => import("react").JSX.Element;
|
|
13
|
+
decorators: ((Story: import("storybook/internal/csf").PartialStoryFn<import("@storybook/react-vite").ReactRenderer, {
|
|
14
|
+
length: number;
|
|
15
|
+
groupSize?: number;
|
|
16
|
+
value: string;
|
|
17
|
+
onChange: (value: string) => void;
|
|
18
|
+
onComplete?: (value: string) => void;
|
|
19
|
+
alphabet?: import("./normalizeCode").CodeAlphabet;
|
|
20
|
+
label: string;
|
|
21
|
+
invalid?: boolean;
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
autoFocus?: boolean;
|
|
24
|
+
autoComplete?: string;
|
|
25
|
+
className?: string;
|
|
26
|
+
}>) => import("react").JSX.Element)[];
|
|
27
|
+
};
|
|
28
|
+
export default meta;
|
|
29
|
+
type Story = StoryObj<typeof meta>;
|
|
30
|
+
export declare const Pairing: Story;
|
|
31
|
+
export declare const CheckDigits: Story;
|
|
32
|
+
export declare const Invalid: Story;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type CodeAlphabet = "crockford" | "digits";
|
|
2
|
+
/**
|
|
3
|
+
* Cleans typed or pasted text into code characters: upper case, no spaces or dashes.
|
|
4
|
+
* Crockford maps O to 0 and I or L to 1; characters outside the alphabet are dropped.
|
|
5
|
+
*/
|
|
6
|
+
export declare function normalizeCode(raw: string, alphabet?: CodeAlphabet): string;
|
|
7
|
+
/** Splits a code into groups of `size` characters; separators in `value` are ignored. */
|
|
8
|
+
export declare function groupCode(value: string, size: number): string[];
|
|
9
|
+
/** Writes a code in groups of `group` characters joined by `sep` (`7K4QM2XD9P` becomes `7K4QM-2XD9P`). */
|
|
10
|
+
export declare function formatCode(code: string, group?: number, sep?: string): string;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type HTMLAttributes, type JSX } from "react";
|
|
2
|
+
/** Reads `#rgb` or `#rrggbb` (with or without `#`, any case) and returns lower-case `#rrggbb`, or null. */
|
|
3
|
+
export declare function normalizeHex(text: string): string | null;
|
|
4
|
+
/** Calls `onChange` with the normalised colour when `text` is a valid hex; returns whether it did. */
|
|
5
|
+
export declare function commitHexText(text: string, onChange: (hex: string) => void): boolean;
|
|
6
|
+
export interface ColorFieldLabels {
|
|
7
|
+
/** Label of the reset button. */
|
|
8
|
+
reset: string;
|
|
9
|
+
/** aria-label of the colour swatch. */
|
|
10
|
+
picker: string;
|
|
11
|
+
/** Message shown while the hex text is not a colour. */
|
|
12
|
+
invalid: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ColorFieldProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" | "id"> {
|
|
15
|
+
/** The token name, shown as the visible label. */
|
|
16
|
+
label: string;
|
|
17
|
+
/** The colour in force: `#rrggbb`. */
|
|
18
|
+
value: string;
|
|
19
|
+
/** Whether a value of the user replaces the built-in one; enables reset. */
|
|
20
|
+
overridden: boolean;
|
|
21
|
+
/** Called with a valid lower-case `#rrggbb` only. */
|
|
22
|
+
onChange: (hex: string) => void;
|
|
23
|
+
onReset: () => void;
|
|
24
|
+
labels: ColorFieldLabels;
|
|
25
|
+
/** Id of the hex field; generated when omitted. */
|
|
26
|
+
id?: string;
|
|
27
|
+
"data-key"?: string;
|
|
28
|
+
}
|
|
29
|
+
export declare function ColorField({ label, value, overridden, onChange, onReset, labels, id, className, ...rest }: ColorFieldProps): JSX.Element;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { type JSX } from "react";
|
|
2
|
+
import { foldText } from "../../internal/text";
|
|
3
|
+
export interface ComboboxOption<T extends string = string> {
|
|
4
|
+
value: T;
|
|
5
|
+
label: string;
|
|
6
|
+
/** Muted second line. */
|
|
7
|
+
meta?: string;
|
|
8
|
+
/** Shown but skipped by the arrow keys and ignored by Enter and click. */
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface ComboboxLabels {
|
|
12
|
+
/** Line under the box when nothing matches the text. */
|
|
13
|
+
noResults: string;
|
|
14
|
+
/** The option that calls `onCreate`. */
|
|
15
|
+
create: (text: string) => string;
|
|
16
|
+
/** aria-label of a chip's remove button (multiple). */
|
|
17
|
+
remove: (label: string) => string;
|
|
18
|
+
/** aria-label of the clear button. */
|
|
19
|
+
clear: string;
|
|
20
|
+
}
|
|
21
|
+
export interface ComboboxBaseProps<T extends string> {
|
|
22
|
+
/** Accessible name of the box and the list; shown above the box unless `hideLabel`. */
|
|
23
|
+
label: string;
|
|
24
|
+
/** Keep `label` as aria-label only, when a heading or a table column already names the box. */
|
|
25
|
+
hideLabel?: boolean;
|
|
26
|
+
options: ComboboxOption<T>[];
|
|
27
|
+
placeholder?: string;
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
/** Draws the box as invalid and sets aria-invalid; pair it with a FieldMessage in `aria-describedby`. */
|
|
30
|
+
invalid?: boolean;
|
|
31
|
+
"aria-describedby"?: string;
|
|
32
|
+
/** Adds a "Create “text”" option when the text matches no option exactly. */
|
|
33
|
+
onCreate?: (text: string) => void;
|
|
34
|
+
/** Whether `option` matches the typed `query`. Default: case- and diacritic-insensitive contains on the label. */
|
|
35
|
+
filter?: (option: ComboboxOption<T>, query: string) => boolean;
|
|
36
|
+
/** Opens the list on first render (previews, stories). */
|
|
37
|
+
defaultOpen?: boolean;
|
|
38
|
+
/** Override the English defaults (e.g. for vi). */
|
|
39
|
+
labels?: Partial<ComboboxLabels>;
|
|
40
|
+
className?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface ComboboxSingleProps<T extends string = string> extends ComboboxBaseProps<T> {
|
|
43
|
+
multiple?: false;
|
|
44
|
+
value: T | null;
|
|
45
|
+
onChange: (value: T | null) => void;
|
|
46
|
+
}
|
|
47
|
+
export interface ComboboxMultipleProps<T extends string = string> extends ComboboxBaseProps<T> {
|
|
48
|
+
multiple: true;
|
|
49
|
+
value: T[];
|
|
50
|
+
onChange: (value: T[]) => void;
|
|
51
|
+
}
|
|
52
|
+
export type ComboboxProps<T extends string = string> = ComboboxSingleProps<T> | ComboboxMultipleProps<T>;
|
|
53
|
+
export { foldText };
|
|
54
|
+
/** Default filter: the folded label contains the folded, trimmed query. */
|
|
55
|
+
export declare function comboboxFilter(option: {
|
|
56
|
+
label: string;
|
|
57
|
+
}, query: string): boolean;
|
|
58
|
+
/** Id of the "Create" row; option values never collide with it because rows of options use their value. */
|
|
59
|
+
export declare const COMBOBOX_CREATE = "\0create";
|
|
60
|
+
export type ComboboxRow<T extends string = string> = {
|
|
61
|
+
kind: "option";
|
|
62
|
+
id: T;
|
|
63
|
+
option: ComboboxOption<T>;
|
|
64
|
+
disabled?: boolean;
|
|
65
|
+
} | {
|
|
66
|
+
kind: "create";
|
|
67
|
+
id: typeof COMBOBOX_CREATE;
|
|
68
|
+
text: string;
|
|
69
|
+
disabled?: undefined;
|
|
70
|
+
};
|
|
71
|
+
/** The rows of the list for `query`: matching options, then a Create row when `canCreate` and nothing matches exactly. Pure. */
|
|
72
|
+
export declare function comboboxRows<T extends string>(options: ComboboxOption<T>[], query: string, opts?: {
|
|
73
|
+
filter?: (option: ComboboxOption<T>, query: string) => boolean;
|
|
74
|
+
canCreate?: boolean;
|
|
75
|
+
}): ComboboxRow<T>[];
|
|
76
|
+
export interface ComboboxKeyState {
|
|
77
|
+
rows: {
|
|
78
|
+
id: string;
|
|
79
|
+
disabled?: boolean;
|
|
80
|
+
}[];
|
|
81
|
+
active: string | null;
|
|
82
|
+
open: boolean;
|
|
83
|
+
/** The text in the box. */
|
|
84
|
+
text: string;
|
|
85
|
+
multiple: boolean;
|
|
86
|
+
/** Something is chosen (single) or at least one chip exists (multiple). */
|
|
87
|
+
hasValue: boolean;
|
|
88
|
+
}
|
|
89
|
+
export interface ComboboxKeyResult {
|
|
90
|
+
/** The key was used: call preventDefault. */
|
|
91
|
+
handled: boolean;
|
|
92
|
+
/** Keep the key from reaching a parent (Escape inside a dialog). */
|
|
93
|
+
stop: boolean;
|
|
94
|
+
open: boolean;
|
|
95
|
+
active: string | null;
|
|
96
|
+
/** Row id to pick. */
|
|
97
|
+
pick: string | null;
|
|
98
|
+
/** Escape on a closed list: empty the box (single: also clear the value). */
|
|
99
|
+
clear: boolean;
|
|
100
|
+
/** Backspace on an empty box (multiple): drop the last chip. */
|
|
101
|
+
removeLast: boolean;
|
|
102
|
+
}
|
|
103
|
+
/** What a key does to the combobox. Arrows and Home/End move over enabled rows and wrap, Enter picks, Escape closes then clears, Tab closes. Pure. */
|
|
104
|
+
export declare function comboboxKey(s: ComboboxKeyState, key: string): ComboboxKeyResult;
|
|
105
|
+
export declare function Combobox<T extends string = string>(props: ComboboxProps<T>): JSX.Element;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { type JSX } from "react";
|
|
3
|
+
import { type ComboboxOption, type ComboboxSingleProps } from "./Combobox";
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: (props: ComboboxSingleProps) => JSX.Element;
|
|
7
|
+
args: {
|
|
8
|
+
label: string;
|
|
9
|
+
placeholder: string;
|
|
10
|
+
options: ComboboxOption<string>[];
|
|
11
|
+
value: null;
|
|
12
|
+
onChange: () => void;
|
|
13
|
+
};
|
|
14
|
+
decorators: ((Story: import("storybook/internal/csf").PartialStoryFn<import("@storybook/react-vite").ReactRenderer, {
|
|
15
|
+
label: string;
|
|
16
|
+
hideLabel?: boolean;
|
|
17
|
+
options: ComboboxOption<string>[];
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
invalid?: boolean;
|
|
21
|
+
"aria-describedby"?: string;
|
|
22
|
+
onCreate?: (text: string) => void;
|
|
23
|
+
filter?: ((option: ComboboxOption<string>, query: string) => boolean) | undefined;
|
|
24
|
+
defaultOpen?: boolean;
|
|
25
|
+
labels?: Partial<import("./Combobox").ComboboxLabels>;
|
|
26
|
+
className?: string;
|
|
27
|
+
multiple?: false;
|
|
28
|
+
value: string | null;
|
|
29
|
+
onChange: (value: string | null) => void;
|
|
30
|
+
}>) => JSX.Element)[];
|
|
31
|
+
};
|
|
32
|
+
export default meta;
|
|
33
|
+
type Story = StoryObj<typeof meta>;
|
|
34
|
+
/** Type "da nang" to find Đà Nẵng: matching ignores case and diacritics. */
|
|
35
|
+
export declare const Single: Story;
|
|
36
|
+
export declare const Open: Story;
|
|
37
|
+
export declare const Invalid: Story;
|
|
38
|
+
export declare const Disabled: Story;
|
|
39
|
+
/** Chips before the box; Backspace on an empty box removes the last one. */
|
|
40
|
+
export declare const Multiple: Story;
|
|
41
|
+
/** A "Create" row appears when the text matches no option exactly. */
|
|
42
|
+
export declare const Creatable: Story;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { type JSX, type KeyboardEvent, type ReactNode } from "react";
|
|
2
|
+
import type { IconName } from "../../icons";
|
|
3
|
+
import type { SessionState } from "../../types";
|
|
4
|
+
export interface PaletteRow {
|
|
5
|
+
/** Stable id of the row; used as the React key and as `data-row-id`. */
|
|
6
|
+
id?: string;
|
|
7
|
+
/** Plain text of the row: the default filter, the match highlight and the accessible name. */
|
|
8
|
+
title: string;
|
|
9
|
+
/** Rendered instead of `title` when present (for example the title with fuzzy hits wrapped). `title` stays the string. */
|
|
10
|
+
label?: ReactNode;
|
|
11
|
+
detail?: string;
|
|
12
|
+
state?: SessionState;
|
|
13
|
+
icon?: IconName;
|
|
14
|
+
/** Shortcut text on the right, after the detail. */
|
|
15
|
+
hint?: string;
|
|
16
|
+
/** Slot before the icon or status dot (for example a kind badge). */
|
|
17
|
+
leading?: ReactNode;
|
|
18
|
+
/** Slot on the right, after `hint` (for example a count or a digit key). */
|
|
19
|
+
meta?: ReactNode;
|
|
20
|
+
/** Row is shown but skipped by the arrow keys and cannot be selected. */
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface PaletteScope {
|
|
24
|
+
value: string;
|
|
25
|
+
label: string;
|
|
26
|
+
}
|
|
27
|
+
export interface CommandPaletteLabels {
|
|
28
|
+
/** aria-label of the dialog when no title is given. */
|
|
29
|
+
dialog: string;
|
|
30
|
+
/** Input placeholder (the placeholder prop wins). */
|
|
31
|
+
placeholder: string;
|
|
32
|
+
/** aria-label of the input when no title is given (the title names it otherwise). Never the placeholder. */
|
|
33
|
+
search: string;
|
|
34
|
+
noMatches: string;
|
|
35
|
+
move: string;
|
|
36
|
+
open: string;
|
|
37
|
+
close: string;
|
|
38
|
+
/** aria-label of the scope row (only used with `scopes`). */
|
|
39
|
+
scopes?: string;
|
|
40
|
+
/** Announced (politely) as the results change while typing. */
|
|
41
|
+
resultCount?: (n: number) => string;
|
|
42
|
+
}
|
|
43
|
+
export interface CommandPaletteProps {
|
|
44
|
+
title?: string;
|
|
45
|
+
placeholder?: string;
|
|
46
|
+
defaultQuery?: string;
|
|
47
|
+
filters?: string[];
|
|
48
|
+
sections: {
|
|
49
|
+
title: string;
|
|
50
|
+
rows: PaletteRow[];
|
|
51
|
+
}[];
|
|
52
|
+
/** Override the English defaults (e.g. for vi). */
|
|
53
|
+
labels?: Partial<CommandPaletteLabels>;
|
|
54
|
+
/** Controlled visibility: `false` renders nothing, and a backdrop wraps the dialog. Absent: always rendered inline. */
|
|
55
|
+
open?: boolean;
|
|
56
|
+
/** Called on Escape and on a backdrop click. */
|
|
57
|
+
onClose?: () => void;
|
|
58
|
+
/** Called with the row on click or Enter on the active row. */
|
|
59
|
+
onSelect?: (row: PaletteRow) => void;
|
|
60
|
+
/** Controlled query; pair with `onQueryChange`. `defaultQuery` seeds the uncontrolled one. */
|
|
61
|
+
query?: string;
|
|
62
|
+
onQueryChange?: (query: string) => void;
|
|
63
|
+
/** Scope row under the input (for example all, files, commands). The app filters `sections` itself. */
|
|
64
|
+
scopes?: PaletteScope[];
|
|
65
|
+
/** Controlled scope value; the first scope when absent. */
|
|
66
|
+
scope?: string;
|
|
67
|
+
onScopeChange?: (scope: string) => void;
|
|
68
|
+
/** Replaces the "No matches" text. */
|
|
69
|
+
emptyText?: ReactNode;
|
|
70
|
+
/** Extra content on the right of the key-hint bar. */
|
|
71
|
+
footer?: ReactNode;
|
|
72
|
+
/**
|
|
73
|
+
* Row filter. `true` (default): case-insensitive substring match on `title`.
|
|
74
|
+
* `false`: rows are shown as given, in order (the app filters and ranks).
|
|
75
|
+
* A function replaces the test; it gets the row and the current query.
|
|
76
|
+
*/
|
|
77
|
+
filter?: boolean | ((row: PaletteRow, query: string) => boolean);
|
|
78
|
+
/** Control rendered next to the input, on its right (for example a scope menu button). */
|
|
79
|
+
inputAddon?: ReactNode;
|
|
80
|
+
/**
|
|
81
|
+
* Called first for every key pressed in the input. If it calls `e.preventDefault()` the palette skips its own handling
|
|
82
|
+
* (arrows, Home/End, Enter). While an IME composes (`e.nativeEvent.isComposing`) the palette never handles keys,
|
|
83
|
+
* so Enter never selects a row.
|
|
84
|
+
*/
|
|
85
|
+
onInputKeyDown?: (e: KeyboardEvent<HTMLInputElement>) => void;
|
|
86
|
+
/**
|
|
87
|
+
* Controlled active row, matched against `PaletteRow.id`. Absent: the palette tracks it (first row, arrows move it).
|
|
88
|
+
* An id that matches no enabled row falls back to the first enabled row. Pair with `onActiveChange`.
|
|
89
|
+
*/
|
|
90
|
+
activeId?: string;
|
|
91
|
+
/** Called with the id of the row an arrow, Home or End key made active. Rows without an `id` are not reported. */
|
|
92
|
+
onActiveChange?: (id: string) => void;
|
|
93
|
+
}
|
|
94
|
+
export declare function CommandPalette({ title, placeholder, defaultQuery, filters, sections, labels, open, onClose, onSelect, query, onQueryChange, scopes, scope, onScopeChange, emptyText, footer, filter: rowFilter, inputAddon, onInputKeyDown, activeId, onActiveChange, }: CommandPaletteProps): JSX.Element | null;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { CommandPalette } from "./CommandPalette";
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof CommandPalette;
|
|
6
|
+
args: {
|
|
7
|
+
filters: string[];
|
|
8
|
+
sections: ({
|
|
9
|
+
title: string;
|
|
10
|
+
rows: ({
|
|
11
|
+
title: string;
|
|
12
|
+
detail: string;
|
|
13
|
+
state: "working";
|
|
14
|
+
} | {
|
|
15
|
+
title: string;
|
|
16
|
+
detail: string;
|
|
17
|
+
state: "waiting";
|
|
18
|
+
} | {
|
|
19
|
+
title: string;
|
|
20
|
+
detail: string;
|
|
21
|
+
state: "done";
|
|
22
|
+
})[];
|
|
23
|
+
} | {
|
|
24
|
+
title: string;
|
|
25
|
+
rows: ({
|
|
26
|
+
title: string;
|
|
27
|
+
icon: "branch";
|
|
28
|
+
} | {
|
|
29
|
+
title: string;
|
|
30
|
+
icon: "search";
|
|
31
|
+
})[];
|
|
32
|
+
})[];
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export default meta;
|
|
36
|
+
type Story = StoryObj<typeof meta>;
|
|
37
|
+
export declare const Default: Story;
|
|
38
|
+
export declare const WithQuery: Story;
|
|
39
|
+
export declare const NoMatches: Story;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { JSX, ReactNode } from "react";
|
|
2
|
+
export interface CommentProps {
|
|
3
|
+
/** Who wrote it. Gives the avatar initials. */
|
|
4
|
+
author: string;
|
|
5
|
+
/** The time as text, already formatted ("2h ago"). */
|
|
6
|
+
time?: string;
|
|
7
|
+
/** The author is an automation. Shows `botLabel` when that is given. */
|
|
8
|
+
bot?: boolean;
|
|
9
|
+
/** Text of the bot badge. */
|
|
10
|
+
botLabel?: string;
|
|
11
|
+
/** Tints the comment: a resolved or an outdated review thread. Shows `stateLabel` when that is given. */
|
|
12
|
+
state?: "resolved" | "outdated";
|
|
13
|
+
/** Text of the state badge. */
|
|
14
|
+
stateLabel?: string;
|
|
15
|
+
/** Under the header: a file and line label or a link. */
|
|
16
|
+
location?: ReactNode;
|
|
17
|
+
/** In the header, after the time: IconButtons or a Menu trigger. */
|
|
18
|
+
actions?: ReactNode;
|
|
19
|
+
/** Under the body: a ReactionBar or a reply composer. */
|
|
20
|
+
footer?: ReactNode;
|
|
21
|
+
className?: string;
|
|
22
|
+
/** The body. Render user text through a sanitizing renderer, never as raw HTML. */
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
}
|
|
25
|
+
export declare function Comment({ author, time, bot, botLabel, state, stateLabel, location, actions, footer, className, children, }: CommentProps): JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { Comment } from "./Comment";
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof Comment;
|
|
6
|
+
args: {
|
|
7
|
+
author: string;
|
|
8
|
+
time: string;
|
|
9
|
+
children: string;
|
|
10
|
+
};
|
|
11
|
+
argTypes: {
|
|
12
|
+
state: {
|
|
13
|
+
control: "inline-radio";
|
|
14
|
+
options: (string | undefined)[];
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export default meta;
|
|
19
|
+
type Story = StoryObj<typeof meta>;
|
|
20
|
+
export declare const Default: Story;
|
|
21
|
+
export declare const OnALine: Story;
|
|
22
|
+
export declare const Bot: Story;
|
|
23
|
+
export declare const Resolved: Story;
|
|
24
|
+
export declare const Outdated: Story;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { JSX } from "react";
|
|
2
|
+
import { type GraphRow, type LaneColor } from "./graphLanes";
|
|
3
|
+
/** Height of one row. */
|
|
4
|
+
export declare const GRAPH_ROW_HEIGHT = 24;
|
|
5
|
+
/** Width of one lane. */
|
|
6
|
+
export declare const GRAPH_LANE_WIDTH = 11;
|
|
7
|
+
export interface CommitGraphProps {
|
|
8
|
+
row: GraphRow;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
/** Width in px of a row whose lanes number `input` above and `output` below the node. */
|
|
12
|
+
export declare function graphWidth(input: number, output: number): number;
|
|
13
|
+
export declare function laneVar(color: LaneColor): string;
|
|
14
|
+
/** One row of the commit graph: the lanes passing through and the commit node. */
|
|
15
|
+
export declare function CommitGraph({ row, className }: CommitGraphProps): JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { StoryObj } from "@storybook/react-vite";
|
|
2
|
+
import { CommitGraph } from "./CommitGraph";
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof CommitGraph;
|
|
6
|
+
args: {
|
|
7
|
+
row: import("./graphLanes").GraphRow | undefined;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<typeof meta>;
|
|
12
|
+
export declare const Boundary: Story;
|
|
13
|
+
export declare const Head: Story;
|
|
14
|
+
export declare const Merge: Story;
|
|
15
|
+
export declare const Graph: Story;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/** Which ref a lane follows, or the index of a rotation colour (0..4). */
|
|
2
|
+
export type LaneColor = number | "head" | "remote" | "base";
|
|
3
|
+
export type RefMark = "head" | "remote" | "base";
|
|
4
|
+
export interface Lane {
|
|
5
|
+
/** The commit this lane is waiting for. */
|
|
6
|
+
id: string;
|
|
7
|
+
color: LaneColor;
|
|
8
|
+
}
|
|
9
|
+
export interface GraphItem {
|
|
10
|
+
id: string;
|
|
11
|
+
parents: string[];
|
|
12
|
+
/** Marks this commit carries beyond `refs` (e.g. a synthetic row). */
|
|
13
|
+
refIds?: RefMark[];
|
|
14
|
+
/** A boundary row (incoming or outgoing changes): drawn as a dashed ring. */
|
|
15
|
+
boundary?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface GraphRefs {
|
|
18
|
+
head?: string;
|
|
19
|
+
remote?: string;
|
|
20
|
+
base?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface GraphRow {
|
|
23
|
+
input: Lane[];
|
|
24
|
+
output: Lane[];
|
|
25
|
+
/** Index of the node in `input`, or `input.length` when the commit starts a lane. */
|
|
26
|
+
lane: number;
|
|
27
|
+
color: LaneColor;
|
|
28
|
+
kind: "commit" | "merge" | "head" | "boundary";
|
|
29
|
+
}
|
|
30
|
+
/** Rotation colours: `x-graph-lane-1..5`. */
|
|
31
|
+
export declare const LANE_COLORS = 5;
|
|
32
|
+
/**
|
|
33
|
+
* The lanes of a log, one row per item in log order. The rotation counter is
|
|
34
|
+
* local to the call, so the same log always gets the same colours.
|
|
35
|
+
*/
|
|
36
|
+
export declare function graphRows(items: GraphItem[], refs?: GraphRefs): GraphRow[];
|
|
37
|
+
export interface LaneLinks {
|
|
38
|
+
/** Lanes that go past the node: input index to output index. */
|
|
39
|
+
passes: {
|
|
40
|
+
from: number;
|
|
41
|
+
to: number;
|
|
42
|
+
color: LaneColor;
|
|
43
|
+
}[];
|
|
44
|
+
/** Input lanes that end at the node. */
|
|
45
|
+
joins: {
|
|
46
|
+
from: number;
|
|
47
|
+
color: LaneColor;
|
|
48
|
+
}[];
|
|
49
|
+
/** Output lanes that start at the node (one per parent). */
|
|
50
|
+
forks: {
|
|
51
|
+
to: number;
|
|
52
|
+
color: LaneColor;
|
|
53
|
+
}[];
|
|
54
|
+
}
|
|
55
|
+
/** Which lane goes where in one row; what the SVG draws. */
|
|
56
|
+
export declare function laneLinks(row: GraphRow): LaneLinks;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { JSX } from "react";
|
|
2
|
+
export interface ComposerLabels {
|
|
3
|
+
/** aria-label of the text box. */
|
|
4
|
+
input: string;
|
|
5
|
+
send: string;
|
|
6
|
+
attach: string;
|
|
7
|
+
/** aria-label of the model select. */
|
|
8
|
+
model: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ComposerProps {
|
|
11
|
+
value: string;
|
|
12
|
+
onChange: (value: string) => void;
|
|
13
|
+
/** Called with Enter or the Send button. Not called while `value` is blank or `disabled`. */
|
|
14
|
+
onSend: () => void;
|
|
15
|
+
/** The model select; omitted when not given. */
|
|
16
|
+
model?: {
|
|
17
|
+
value: string;
|
|
18
|
+
options: {
|
|
19
|
+
value: string;
|
|
20
|
+
label: string;
|
|
21
|
+
}[];
|
|
22
|
+
};
|
|
23
|
+
onModel?: (value: string) => void;
|
|
24
|
+
/** Adds the attach button when given. */
|
|
25
|
+
onAttach?: () => void;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
placeholder?: string;
|
|
28
|
+
labels?: Partial<ComposerLabels>;
|
|
29
|
+
className?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare function Composer({ value, onChange, onSend, model, onModel, onAttach, disabled, placeholder, labels, className }: ComposerProps): JSX.Element;
|