@ghxstship/xos-ui 0.0.0-stage → 4.16.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/LICENSE +21 -0
- package/README.md +32 -2
- package/package.json +76 -4
- package/scripts/generate-stories.mjs +85 -0
- package/src/AIDisclosureBadge/README.md +7 -0
- package/src/AccessGridMatrix/README.md +3 -0
- package/src/Accordion/README.md +7 -0
- package/src/ActivityFeedItem/README.md +3 -0
- package/src/AgencySlate/README.md +3 -0
- package/src/AppShell/README.md +5 -0
- package/src/ApplicationForm/README.md +3 -0
- package/src/AssertionRankBadge/README.md +5 -0
- package/src/AvailabilityCalendar/README.md +3 -0
- package/src/Avatar/Avatar.tsx +56 -0
- package/src/Avatar/README.md +3 -0
- package/src/Avatar/avatar-class.ts +19 -0
- package/src/AvatarStack/README.md +3 -0
- package/src/Badge/README.md +3 -0
- package/src/Banner/README.md +3 -0
- package/src/BidSheet/README.md +3 -0
- package/src/Board/README.md +6 -0
- package/src/BrandMark/BrandMark.tsx +95 -0
- package/src/BrandMark/README.md +7 -0
- package/src/BrandSlot/README.md +6 -0
- package/src/Breadcrumbs/README.md +3 -0
- package/src/BudgetGrid/README.md +10 -0
- package/src/BulkActionBar/README.md +3 -0
- package/src/Button/Button.tsx +100 -0
- package/src/Button/README.md +10 -0
- package/src/Button/button-class.ts +54 -0
- package/src/ButtonLink/README.md +7 -0
- package/src/Calendar/README.md +3 -0
- package/src/Card/README.md +3 -0
- package/src/Chart/README.md +9 -0
- package/src/Charts/Calendar.tsx +228 -0
- package/src/Charts/Chart.tsx +547 -0
- package/src/Charts/Charts.tsx +20 -0
- package/src/Charts/Charts.types.ts +40 -0
- package/src/Charts/Gallery.tsx +25 -0
- package/src/Charts/Heatmap.tsx +116 -0
- package/src/Charts/OrgChart.tsx +53 -0
- package/src/Charts/ResourceSchedule.tsx +91 -0
- package/src/Charts/Sparkline.tsx +59 -0
- package/src/Charts/Timeline.tsx +777 -0
- package/src/Charts/categories.ts +21 -0
- package/src/Charts/timeline-plan.ts +191 -0
- package/src/Checkbox/README.md +6 -0
- package/src/ChecklistRunner/README.md +3 -0
- package/src/Chips/Badge.tsx +27 -0
- package/src/Chips/Chips.shared.tsx +34 -0
- package/src/Chips/Chips.tsx +21 -0
- package/src/Chips/Chips.types.ts +35 -0
- package/src/Chips/DepartmentChip.tsx +16 -0
- package/src/Chips/PhaseChip.tsx +16 -0
- package/src/Chips/PropertyChip.tsx +15 -0
- package/src/Chips/RecordKindChip.tsx +14 -0
- package/src/Chips/StateChip.tsx +19 -0
- package/src/Chips/Tag.tsx +47 -0
- package/src/Chips/URIDChip.tsx +14 -0
- package/src/Chips/chipClass.tsx +8 -0
- package/src/Chips/codeClass.tsx +6 -0
- package/src/ClockButton/README.md +6 -0
- package/src/CodeSample/README.md +7 -0
- package/src/ColorPicker/README.md +5 -0
- package/src/Combobox/README.md +7 -0
- package/src/CommandMenu/CommandMenu.tsx +179 -0
- package/src/CommandMenu/README.md +5 -0
- package/src/ComparisonTable/README.md +9 -0
- package/src/Compass/ChecklistRunner.tsx +128 -0
- package/src/Compass/ClockButton.tsx +57 -0
- package/src/Compass/Compass.shared.tsx +58 -0
- package/src/Compass/Compass.tsx +26 -0
- package/src/Compass/Compass.types.ts +79 -0
- package/src/Compass/DaySheetView.tsx +104 -0
- package/src/Compass/ForceUpdateScreen.tsx +29 -0
- package/src/Compass/LiveActivity.tsx +60 -0
- package/src/Compass/OfflineBanner.tsx +31 -0
- package/src/Compass/PhotoCapture.tsx +69 -0
- package/src/Compass/QuickIncidentSheet.tsx +46 -0
- package/src/Compass/ScanSheet.tsx +83 -0
- package/src/Compass/ShiftCard.tsx +55 -0
- package/src/Compass/SignaturePad.tsx +71 -0
- package/src/Compass/SyncConflictSheet.tsx +60 -0
- package/src/ConsentBanner/ConsentBanner.tsx +210 -0
- package/src/ConsentBanner/ConsentBannerStatic.tsx +163 -0
- package/src/ConsentBanner/ConsentSettings.tsx +213 -0
- package/src/ConsentBanner/README.md +101 -0
- package/src/ConsentBanner/consent.ts +238 -0
- package/src/ConsentBanner/index.ts +40 -0
- package/src/ConsentBanner/static.ts +11 -0
- package/src/ConsentBanner/useConsent.ts +160 -0
- package/src/ContextMenu/README.md +3 -0
- package/src/CoordinateMatrix/README.md +6 -0
- package/src/CredentialBadge/README.md +7 -0
- package/src/CurrencyInput/README.md +7 -0
- package/src/DataTable/DataTable.tsx +1034 -0
- package/src/DataTable/DataTableResizer.tsx +72 -0
- package/src/DataTable/DataTableVirtualizer.tsx +58 -0
- package/src/DataTable/README.md +9 -0
- package/src/DatePicker/README.md +5 -0
- package/src/DateRangePicker/README.md +3 -0
- package/src/DaySheetView/README.md +3 -0
- package/src/DepartmentChip/README.md +3 -0
- package/src/DepartmentGlyph/README.md +18 -0
- package/src/Dialog/README.md +3 -0
- package/src/DiffViewer/README.md +3 -0
- package/src/Divider/README.md +3 -0
- package/src/Drawer/README.md +3 -0
- package/src/DropdownMenu/README.md +3 -0
- package/src/EPKViewer/README.md +3 -0
- package/src/Editing/ColorPicker.tsx +125 -0
- package/src/Editing/DiffViewer.tsx +49 -0
- package/src/Editing/Editing.tsx +29 -0
- package/src/Editing/Editing.types.ts +71 -0
- package/src/Editing/FilterBuilder.tsx +72 -0
- package/src/Editing/QuickAdd.tsx +102 -0
- package/src/Editing/QuickAddChips.tsx +180 -0
- package/src/Editing/contrastRatio.tsx +11 -0
- package/src/Editing/parseQuickAdd.tsx +187 -0
- package/src/Editing/quickAddCore.ts +204 -0
- package/src/Editing/timeShorthand.ts +157 -0
- package/src/Editing/useQuickAdd.ts +201 -0
- package/src/EmergencyCodeCard/README.md +10 -0
- package/src/EmptyState/README.md +5 -0
- package/src/EngagementTimeline/README.md +3 -0
- package/src/ErrorState/README.md +3 -0
- package/src/FAQ/README.md +7 -0
- package/src/FeatureGrid/README.md +7 -0
- package/src/Feedback/Banner.tsx +40 -0
- package/src/Feedback/EmptyState.tsx +32 -0
- package/src/Feedback/ErrorState.tsx +32 -0
- package/src/Feedback/Feedback.shared.tsx +38 -0
- package/src/Feedback/Feedback.tsx +18 -0
- package/src/Feedback/Feedback.types.ts +40 -0
- package/src/Feedback/InlineAlert.tsx +19 -0
- package/src/Feedback/RefusalNotice.tsx +46 -0
- package/src/Feedback/RegionBoundary.tsx +102 -0
- package/src/Feedback/Toast.tsx +31 -0
- package/src/Feedback/ToastRegion.tsx +26 -0
- package/src/Feedback/UndoToast.tsx +97 -0
- package/src/FeedbackWidget/README.md +3 -0
- package/src/Field/Field.tsx +81 -0
- package/src/FileDrop/README.md +3 -0
- package/src/FilePreviewer/README.md +3 -0
- package/src/FilterBuilder/README.md +3 -0
- package/src/ForceUpdateScreen/README.md +3 -0
- package/src/Forms/Checkbox.tsx +14 -0
- package/src/Forms/CurrencyInput.tsx +40 -0
- package/src/Forms/Forms.shared.tsx +5 -0
- package/src/Forms/Forms.tsx +20 -0
- package/src/Forms/Forms.types.ts +33 -0
- package/src/Forms/Input.tsx +28 -0
- package/src/Forms/Money.tsx +15 -0
- package/src/Forms/NumberInput.tsx +85 -0
- package/src/Forms/Radio.tsx +31 -0
- package/src/Forms/Select.tsx +54 -0
- package/src/Forms/Switch.tsx +14 -0
- package/src/Forms/Textarea.tsx +30 -0
- package/src/Gallery/README.md +5 -0
- package/src/GateLifecycleRail/README.md +7 -0
- package/src/GateReadinessPanel/README.md +8 -0
- package/src/Gateway/AgencySlate.tsx +76 -0
- package/src/Gateway/ApplicationForm.tsx +48 -0
- package/src/Gateway/AvailabilityCalendar.tsx +82 -0
- package/src/Gateway/EPKViewer.tsx +77 -0
- package/src/Gateway/EngagementTimeline.tsx +43 -0
- package/src/Gateway/Gateway.shared.tsx +5 -0
- package/src/Gateway/Gateway.tsx +30 -0
- package/src/Gateway/Gateway.types.ts +69 -0
- package/src/Gateway/OnboardingPacket.tsx +61 -0
- package/src/Gateway/OpportunityCard.tsx +73 -0
- package/src/Gateway/OpportunityFilters.tsx +64 -0
- package/src/Gateway/PaymentTracker.tsx +71 -0
- package/src/Gateway/PayoutDetailsForm.tsx +62 -0
- package/src/Gateway/ProfileEditor.tsx +45 -0
- package/src/Gateway/ProgressBar.tsx +30 -0
- package/src/Gateway/RatingDialog.tsx +83 -0
- package/src/Gateway/UpNextCard.tsx +76 -0
- package/src/Glyphs/Glyphs.tsx +66 -0
- package/src/Grids/BidSheet.tsx +63 -0
- package/src/Grids/BudgetGrid.tsx +164 -0
- package/src/Grids/Grids.shared.tsx +5 -0
- package/src/Grids/Grids.tsx +11 -0
- package/src/Grids/Grids.types.ts +38 -0
- package/src/Grids/SpreadsheetGrid.tsx +445 -0
- package/src/Grids/columnTotal.tsx +14 -0
- package/src/Grids/glForCode.tsx +11 -0
- package/src/Grids/parseCell.tsx +16 -0
- package/src/Help/FeedbackWidget.tsx +89 -0
- package/src/Help/Help.tsx +14 -0
- package/src/Help/Help.types.ts +51 -0
- package/src/Help/HelpPanel.tsx +116 -0
- package/src/Help/NotificationCenter.tsx +100 -0
- package/src/Help/OnboardingChecklist.tsx +57 -0
- package/src/Help/ShortcutEditor.tsx +81 -0
- package/src/Help/WhatsNew.tsx +33 -0
- package/src/HelpPanel/README.md +5 -0
- package/src/HoverCard/README.md +3 -0
- package/src/Icon/Icon.tsx +47 -0
- package/src/Icon/README.md +9 -0
- package/src/IconButton/README.md +6 -0
- package/src/Identity/BrandSlot.tsx +20 -0
- package/src/Identity/BrandSlotFrame.tsx +38 -0
- package/src/Identity/CredentialBadge.tsx +92 -0
- package/src/Identity/Identity.tsx +14 -0
- package/src/Identity/Identity.types.ts +25 -0
- package/src/Identity/PresenceIndicator.tsx +37 -0
- package/src/Identity/QRCode.tsx +22 -0
- package/src/Identity/WhiteLabelPreview.tsx +33 -0
- package/src/Identity/qrPath.tsx +16 -0
- package/src/Identity/tokenVariable.tsx +9 -0
- package/src/InlineAlert/README.md +3 -0
- package/src/Input/README.md +8 -0
- package/src/Kbd/Kbd.tsx +30 -0
- package/src/Kbd/README.md +6 -0
- package/src/Layout/AppShell.tsx +151 -0
- package/src/Layout/Layout.tsx +14 -0
- package/src/Layout/Layout.types.ts +43 -0
- package/src/Layout/PageHeader.tsx +22 -0
- package/src/Layout/ResizablePanel.tsx +81 -0
- package/src/Layout/ScrollRegion.tsx +107 -0
- package/src/Layout/SplitView.tsx +78 -0
- package/src/Layout/Stepper.tsx +39 -0
- package/src/LegalText/LegalText.tsx +289 -0
- package/src/LegalText/README.md +10 -0
- package/src/LegalText/index.ts +29 -0
- package/src/LegalText/legal-markdown.ts +581 -0
- package/src/Link/Link.tsx +25 -0
- package/src/Link/README.md +5 -0
- package/src/Link/link-class.ts +10 -0
- package/src/LiveActivity/README.md +3 -0
- package/src/LogoSlotWall/README.md +7 -0
- package/src/MapView/README.md +5 -0
- package/src/Marketing/AIDisclosureBadge.tsx +31 -0
- package/src/Marketing/ButtonLink.tsx +32 -0
- package/src/Marketing/CodeSample.tsx +47 -0
- package/src/Marketing/ComparisonScroll.tsx +7 -0
- package/src/Marketing/ComparisonTable.tsx +104 -0
- package/src/Marketing/FAQ.tsx +26 -0
- package/src/Marketing/FeatureGrid.tsx +65 -0
- package/src/Marketing/GateLifecycleRail.tsx +52 -0
- package/src/Marketing/LogoSlotWall.tsx +53 -0
- package/src/Marketing/Marketing.tsx +49 -0
- package/src/Marketing/Marketing.types.ts +64 -0
- package/src/Marketing/MarketingFooter.tsx +88 -0
- package/src/Marketing/MarketingHero.tsx +45 -0
- package/src/Marketing/MarketingNav.tsx +76 -0
- package/src/Marketing/MarketingPoints.tsx +16 -0
- package/src/Marketing/MarketingSection.tsx +52 -0
- package/src/Marketing/PersonaSwitcher.tsx +137 -0
- package/src/Marketing/PriceDisplay.tsx +56 -0
- package/src/Marketing/PricingTable.tsx +122 -0
- package/src/Marketing/ProofStatStrip.tsx +35 -0
- package/src/Marketing/ScreenshotFrame.tsx +56 -0
- package/src/Marketing/SurfaceTriptych.tsx +43 -0
- package/src/Marketing/Testimonial.tsx +45 -0
- package/src/Marketing/marketing-copy.ts +25 -0
- package/src/Marketing/provided.tsx +36 -0
- package/src/MarketingFooter/README.md +7 -0
- package/src/MarketingHero/README.md +7 -0
- package/src/MarketingNav/README.md +7 -0
- package/src/MarketingSection/README.md +7 -0
- package/src/Media/FilePreviewer.tsx +86 -0
- package/src/Media/MapView.tsx +200 -0
- package/src/Media/Media.tsx +11 -0
- package/src/Media/Media.types.ts +47 -0
- package/src/Media/RichTextEditor.tsx +198 -0
- package/src/Media/toLngLat.tsx +13 -0
- package/src/Menus/ContextMenu.tsx +106 -0
- package/src/Menus/DropdownMenu.tsx +51 -0
- package/src/Menus/Menus.shared.tsx +67 -0
- package/src/Menus/Menus.tsx +13 -0
- package/src/Menus/Menus.types.ts +49 -0
- package/src/Menus/OrgSwitcher.tsx +69 -0
- package/src/Menus/compactTriggerClass.tsx +7 -0
- package/src/Menus/menuClass.tsx +4 -0
- package/src/Menus/menuItemClass.tsx +7 -0
- package/src/Menus/orgSwitcherTriggerClass.tsx +7 -0
- package/src/Money/README.md +6 -0
- package/src/MultiSelect/README.md +3 -0
- package/src/Navigation/Accordion.tsx +59 -0
- package/src/Navigation/Breadcrumbs.tsx +59 -0
- package/src/Navigation/MoreFields.tsx +42 -0
- package/src/Navigation/Navigation.shared.tsx +32 -0
- package/src/Navigation/Navigation.tsx +21 -0
- package/src/Navigation/Navigation.types.ts +63 -0
- package/src/Navigation/Pagination.tsx +30 -0
- package/src/Navigation/SegmentedControl.tsx +87 -0
- package/src/Navigation/Sidebar.tsx +106 -0
- package/src/Navigation/TabBar.tsx +61 -0
- package/src/Navigation/Tabs.tsx +79 -0
- package/src/Navigation/TopNav.tsx +86 -0
- package/src/Navigation/sidebar-classes.ts +18 -0
- package/src/NotificationCenter/README.md +3 -0
- package/src/NumberInput/README.md +3 -0
- package/src/OfflineBanner/README.md +3 -0
- package/src/OnboardingChecklist/README.md +3 -0
- package/src/OnboardingPacket/README.md +3 -0
- package/src/OpportunityCard/README.md +5 -0
- package/src/OpportunityFilters/README.md +3 -0
- package/src/OrgChart/README.md +5 -0
- package/src/OrgSwitcher/README.md +3 -0
- package/src/Overlays/Dialog.tsx +54 -0
- package/src/Overlays/Drawer.tsx +62 -0
- package/src/Overlays/HoverCard.tsx +59 -0
- package/src/Overlays/Overlays.shared.tsx +12 -0
- package/src/Overlays/Overlays.tsx +20 -0
- package/src/Overlays/Overlays.types.ts +66 -0
- package/src/Overlays/Popover.tsx +70 -0
- package/src/Overlays/PropertyList.tsx +19 -0
- package/src/Overlays/ShortcutSheet.tsx +62 -0
- package/src/Overlays/SidePeek.tsx +117 -0
- package/src/Overlays/Tooltip.tsx +73 -0
- package/src/Overlays/panelClass.tsx +6 -0
- package/src/Overlays/popoverPanelClass.tsx +6 -0
- package/src/PageHeader/README.md +3 -0
- package/src/Pagination/README.md +3 -0
- package/src/PaymentTracker/README.md +3 -0
- package/src/PayoutDetailsForm/README.md +3 -0
- package/src/PersonaSwitcher/README.md +7 -0
- package/src/PhaseChip/README.md +5 -0
- package/src/PhaseGlyph/README.md +17 -0
- package/src/PhotoCapture/README.md +3 -0
- package/src/Pickers/Combobox.tsx +91 -0
- package/src/Pickers/DatePicker.tsx +60 -0
- package/src/Pickers/DateRangePicker.tsx +78 -0
- package/src/Pickers/FileDrop.tsx +84 -0
- package/src/Pickers/MultiSelect.tsx +118 -0
- package/src/Pickers/Pickers.shared.tsx +337 -0
- package/src/Pickers/Pickers.tsx +17 -0
- package/src/Pickers/Pickers.types.ts +47 -0
- package/src/Pickers/Slider.tsx +59 -0
- package/src/Pickers/TimePicker.tsx +68 -0
- package/src/Pickers/rankOptions.tsx +12 -0
- package/src/Popover/README.md +3 -0
- package/src/PresenceIndicator/README.md +3 -0
- package/src/PriceDisplay/README.md +7 -0
- package/src/PricingTable/README.md +9 -0
- package/src/ProfileEditor/README.md +3 -0
- package/src/ProgressBar/README.md +3 -0
- package/src/ProofStatStrip/README.md +7 -0
- package/src/PropertyChip/README.md +3 -0
- package/src/ProvenanceBadge/README.md +3 -0
- package/src/QRCode/README.md +6 -0
- package/src/QuickAdd/README.md +5 -0
- package/src/QuickIncidentSheet/README.md +3 -0
- package/src/Radio/README.md +3 -0
- package/src/RadioChannelTable/README.md +7 -0
- package/src/RatingDialog/README.md +3 -0
- package/src/ReconciliationTable/README.md +3 -0
- package/src/RecordKindChip/README.md +3 -0
- package/src/RecordKindGlyph/README.md +34 -0
- package/src/RecordRow/README.md +7 -0
- package/src/RefusalNotice/README.md +5 -0
- package/src/ResizablePanel/README.md +3 -0
- package/src/ResourceSchedule/README.md +6 -0
- package/src/RichTextEditor/README.md +3 -0
- package/src/RichTextEditor/extensions.ts +217 -0
- package/src/RunOfShowLive/README.md +5 -0
- package/src/ScanSheet/README.md +3 -0
- package/src/ScreenshotFrame/README.md +7 -0
- package/src/ScrollRegion/README.md +9 -0
- package/src/SegmentedControl/README.md +5 -0
- package/src/Select/README.md +5 -0
- package/src/ShiftCard/README.md +3 -0
- package/src/ShortcutEditor/README.md +3 -0
- package/src/ShortcutSheet/README.md +3 -0
- package/src/SidePeek/README.md +6 -0
- package/src/Sidebar/README.md +5 -0
- package/src/SignaturePad/README.md +3 -0
- package/src/Skeleton/README.md +3 -0
- package/src/Slider/README.md +3 -0
- package/src/SplitView/README.md +3 -0
- package/src/SpreadsheetGrid/README.md +9 -0
- package/src/StalenessIndicator/README.md +3 -0
- package/src/StatTile/README.md +6 -0
- package/src/StateChip/README.md +6 -0
- package/src/StateIcon/README.md +6 -0
- package/src/StateIcon/StateIcon.tsx +127 -0
- package/src/StatusHeatmap/README.md +15 -0
- package/src/Stepper/README.md +3 -0
- package/src/Surface/Skeleton.tsx +21 -0
- package/src/Surface/Surface.tsx +63 -0
- package/src/SurfaceTriptych/README.md +7 -0
- package/src/Switch/README.md +5 -0
- package/src/SyncConflictSheet/README.md +3 -0
- package/src/TabBar/README.md +7 -0
- package/src/Tabs/README.md +6 -0
- package/src/Tag/README.md +3 -0
- package/src/TemplateAuth/README.md +6 -0
- package/src/TemplateCollection/README.md +6 -0
- package/src/TemplateDashboard/README.md +8 -0
- package/src/TemplateDocument/README.md +5 -0
- package/src/TemplateGatewayShell/README.md +5 -0
- package/src/TemplateGridEditor/README.md +3 -0
- package/src/TemplateRecord/README.md +3 -0
- package/src/TemplateSettings/README.md +5 -0
- package/src/TemplateSplitView/README.md +3 -0
- package/src/TemplateSystem/README.md +5 -0
- package/src/TemplateWizard/README.md +3 -0
- package/src/Templates/TemplateAuth.tsx +16 -0
- package/src/Templates/TemplateCollection.tsx +35 -0
- package/src/Templates/TemplateDashboard.tsx +200 -0
- package/src/Templates/TemplateDocument.tsx +24 -0
- package/src/Templates/TemplateGatewayShell.tsx +36 -0
- package/src/Templates/TemplateGridEditor.tsx +17 -0
- package/src/Templates/TemplateRecord.tsx +31 -0
- package/src/Templates/TemplateSettings.tsx +26 -0
- package/src/Templates/TemplateSplitView.tsx +27 -0
- package/src/Templates/TemplateSystem.tsx +19 -0
- package/src/Templates/TemplateSystemLink.tsx +55 -0
- package/src/Templates/TemplateWizard.tsx +43 -0
- package/src/Templates/Templates.tsx +29 -0
- package/src/Templates/Templates.types.ts +153 -0
- package/src/Testimonial/README.md +7 -0
- package/src/Textarea/README.md +3 -0
- package/src/TimePicker/README.md +5 -0
- package/src/Timeline/README.md +6 -0
- package/src/Toast/README.md +3 -0
- package/src/Tooltip/README.md +3 -0
- package/src/TopNav/README.md +5 -0
- package/src/TreeView/README.md +3 -0
- package/src/URIDChip/README.md +5 -0
- package/src/UndoToast/README.md +3 -0
- package/src/UpNextCard/README.md +6 -0
- package/src/Views/ActivityFeedItem.tsx +52 -0
- package/src/Views/Board.tsx +229 -0
- package/src/Views/BulkActionBar.tsx +76 -0
- package/src/Views/RecordList.tsx +146 -0
- package/src/Views/RecordRow.tsx +132 -0
- package/src/Views/StatTile.tsx +88 -0
- package/src/Views/TreeView.tsx +161 -0
- package/src/Views/Views.tsx +18 -0
- package/src/Views/Views.types.ts +99 -0
- package/src/WhatsNew/README.md +3 -0
- package/src/WhiteLabelPreview/README.md +8 -0
- package/src/XOS/AccessGridMatrix.tsx +111 -0
- package/src/XOS/AssertionRankBadge.tsx +27 -0
- package/src/XOS/CoordinateMatrix.tsx +123 -0
- package/src/XOS/EmergencyCodeCard.tsx +109 -0
- package/src/XOS/GateReadinessPanel.tsx +100 -0
- package/src/XOS/ProvenanceBadge.tsx +19 -0
- package/src/XOS/RadioChannelTable.tsx +50 -0
- package/src/XOS/ReconciliationTable.tsx +64 -0
- package/src/XOS/RunOfShowLive.tsx +97 -0
- package/src/XOS/StalenessIndicator.tsx +31 -0
- package/src/XOS/StatusHeatmap.tsx +200 -0
- package/src/XOS/XOS.shared.tsx +90 -0
- package/src/XOS/XOS.tsx +29 -0
- package/src/XOS/XOS.types.ts +99 -0
- package/src/XOS/resolveStep.tsx +16 -0
- package/src/brand/defaults/README.md +13 -0
- package/src/brand/defaults/app-icon.svg +6 -0
- package/src/brand/defaults/favicon.svg +6 -0
- package/src/brand/defaults/logo-dark.svg +6 -0
- package/src/brand/defaults/logo-light.svg +6 -0
- package/src/brand/defaults/splash.svg +6 -0
- package/src/index.ts +606 -0
- package/src/lib/context.tsx +156 -0
- package/src/lib/cx.ts +4 -0
- package/src/lib/format.ts +200 -0
- package/src/lib/hooks.ts +187 -0
- package/src/lib/i18n.ts +97 -0
- package/src/lib/icons.ts +45 -0
- package/src/lib/live.ts +92 -0
- package/src/lib/preferences.ts +242 -0
- package/src/lib/route-transition.tsx +22 -0
- package/src/lib/selection.ts +92 -0
- package/src/lib/shortcut-targets.ts +125 -0
- package/src/lib/theme.ts +50 -0
- package/src/lib/undo-stack.ts +125 -0
- package/src/marketing.ts +33 -0
- package/src/pwa/action-outcome.tsx +81 -0
- package/src/pwa/analytics.ts +236 -0
- package/src/pwa/browser-push.tsx +132 -0
- package/src/pwa/client.ts +126 -0
- package/src/pwa/index.ts +40 -0
- package/src/pwa/offline-key.ts +18 -0
- package/src/pwa/service-worker.ts +229 -0
- package/src/static.ts +10 -0
- package/src/styles/base.css +208 -0
- package/src/styles/components.css +453 -0
- package/src/styles/index.css +16 -0
- package/src/styles/marketing.css +1260 -0
- package/src/styles/reference.css +5792 -0
- package/src/types/reference.d.ts +1608 -0
- package/tailwind.config.cjs +3 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
import { ContextMenu as RContextMenu, DropdownMenu as RDropdownMenu } from "radix-ui";
|
|
3
|
+
import { cx } from "../lib/cx.ts";
|
|
4
|
+
import { useT } from "../lib/context.tsx";
|
|
5
|
+
import { ItemBody, dangerClass, headClass, renderItems, sepClass } from "./Menus.shared.tsx";
|
|
6
|
+
import { type ContextMenuProps } from "./Menus.types.ts";
|
|
7
|
+
import { menuClass } from "./menuClass.tsx";
|
|
8
|
+
import { menuItemClass } from "./menuItemClass.tsx";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The record menu's actions on right-click or Shift+F10 over `children`, or at a point the page
|
|
12
|
+
* gives (`at`). The point menu is Radix's dropdown anchored to an empty mark at the point: arrow
|
|
13
|
+
* keys, typeahead and Esc work as in every menu, and focus returns to `returnFocus` on close.
|
|
14
|
+
*/
|
|
15
|
+
export function ContextMenu({
|
|
16
|
+
label,
|
|
17
|
+
items,
|
|
18
|
+
children,
|
|
19
|
+
at,
|
|
20
|
+
onClose,
|
|
21
|
+
returnFocus,
|
|
22
|
+
}: ContextMenuProps): ReactElement {
|
|
23
|
+
const t = useT();
|
|
24
|
+
const name = label ?? t("menu.actions");
|
|
25
|
+
if (at) {
|
|
26
|
+
return (
|
|
27
|
+
<RDropdownMenu.Root
|
|
28
|
+
open
|
|
29
|
+
modal={false}
|
|
30
|
+
onOpenChange={(open) => {
|
|
31
|
+
if (!open) onClose?.();
|
|
32
|
+
}}
|
|
33
|
+
>
|
|
34
|
+
<RDropdownMenu.Trigger asChild>
|
|
35
|
+
<span
|
|
36
|
+
aria-hidden="true"
|
|
37
|
+
className="pointer-events-none fixed size-0"
|
|
38
|
+
// design-audit-allow: the pointer's viewport position, data rather than design
|
|
39
|
+
style={{ left: at.x, top: at.y }}
|
|
40
|
+
/>
|
|
41
|
+
</RDropdownMenu.Trigger>
|
|
42
|
+
<RDropdownMenu.Portal>
|
|
43
|
+
<RDropdownMenu.Content
|
|
44
|
+
className={menuClass}
|
|
45
|
+
aria-label={name}
|
|
46
|
+
// The anchor mark is empty, so the menu takes its name from the label instead.
|
|
47
|
+
aria-labelledby={undefined}
|
|
48
|
+
align="start"
|
|
49
|
+
collisionPadding={16}
|
|
50
|
+
onCloseAutoFocus={(event) => {
|
|
51
|
+
if (returnFocus?.isConnected) {
|
|
52
|
+
event.preventDefault();
|
|
53
|
+
returnFocus.focus();
|
|
54
|
+
}
|
|
55
|
+
}}
|
|
56
|
+
>
|
|
57
|
+
{renderItems(RDropdownMenu, items)}
|
|
58
|
+
</RDropdownMenu.Content>
|
|
59
|
+
</RDropdownMenu.Portal>
|
|
60
|
+
</RDropdownMenu.Root>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
if (children === undefined) {
|
|
64
|
+
return (
|
|
65
|
+
<div role="menu" aria-label={name} className={menuClass}>
|
|
66
|
+
{items.map((item, i) =>
|
|
67
|
+
item.separator ? (
|
|
68
|
+
<div key={i} role="separator" className={sepClass} />
|
|
69
|
+
) : item.heading ? (
|
|
70
|
+
<div key={i} role="presentation" className={headClass}>
|
|
71
|
+
{item.heading}
|
|
72
|
+
</div>
|
|
73
|
+
) : (
|
|
74
|
+
<div
|
|
75
|
+
key={i}
|
|
76
|
+
role="menuitem"
|
|
77
|
+
tabIndex={-1}
|
|
78
|
+
onClick={item.onSelect}
|
|
79
|
+
onKeyDown={(e) => {
|
|
80
|
+
if (e.key === "Enter" || e.key === " ") item.onSelect?.();
|
|
81
|
+
}}
|
|
82
|
+
className={cx(
|
|
83
|
+
menuItemClass,
|
|
84
|
+
"hover:bg-bg-hover",
|
|
85
|
+
item.danger && dangerClass,
|
|
86
|
+
item.active && "bg-bg-hover",
|
|
87
|
+
)}
|
|
88
|
+
>
|
|
89
|
+
<ItemBody item={item} />
|
|
90
|
+
</div>
|
|
91
|
+
),
|
|
92
|
+
)}
|
|
93
|
+
</div>
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
return (
|
|
97
|
+
<RContextMenu.Root modal={false}>
|
|
98
|
+
<RContextMenu.Trigger asChild>{children}</RContextMenu.Trigger>
|
|
99
|
+
<RContextMenu.Portal>
|
|
100
|
+
<RContextMenu.Content className={menuClass} aria-label={name} collisionPadding={16}>
|
|
101
|
+
{renderItems(RContextMenu, items)}
|
|
102
|
+
</RContextMenu.Content>
|
|
103
|
+
</RContextMenu.Portal>
|
|
104
|
+
</RContextMenu.Root>
|
|
105
|
+
);
|
|
106
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
import { DropdownMenu as RDropdownMenu } from "radix-ui";
|
|
3
|
+
import { Icon } from "../Icon/Icon.tsx";
|
|
4
|
+
import { buttonClass } from "../Button/Button.tsx";
|
|
5
|
+
import { renderItems } from "./Menus.shared.tsx";
|
|
6
|
+
import { type DropdownMenuProps } from "./Menus.types.ts";
|
|
7
|
+
import { menuClass } from "./menuClass.tsx";
|
|
8
|
+
import { compactChevronClass, compactLabelClass } from "./compactTriggerClass.tsx";
|
|
9
|
+
|
|
10
|
+
/** A short list of actions from a button. Arrow keys move, typing jumps, Enter selects, Esc closes. */
|
|
11
|
+
export function DropdownMenu({
|
|
12
|
+
label,
|
|
13
|
+
icon,
|
|
14
|
+
items,
|
|
15
|
+
defaultOpen,
|
|
16
|
+
open,
|
|
17
|
+
onOpenChange,
|
|
18
|
+
compact = false,
|
|
19
|
+
}: DropdownMenuProps): ReactElement {
|
|
20
|
+
const short = compact && icon !== undefined;
|
|
21
|
+
return (
|
|
22
|
+
<RDropdownMenu.Root
|
|
23
|
+
{...(defaultOpen === undefined ? {} : { defaultOpen })}
|
|
24
|
+
{...(open === undefined ? {} : { open })}
|
|
25
|
+
{...(onOpenChange ? { onOpenChange } : {})}
|
|
26
|
+
modal={false}
|
|
27
|
+
>
|
|
28
|
+
<RDropdownMenu.Trigger className={buttonClass()}>
|
|
29
|
+
{icon ? <Icon name={icon} size={14} /> : null}
|
|
30
|
+
{short ? <span className={compactLabelClass}>{label}</span> : label}
|
|
31
|
+
{short ? (
|
|
32
|
+
<span className={compactChevronClass}>
|
|
33
|
+
<Icon name="ChevronDown" size={14} />
|
|
34
|
+
</span>
|
|
35
|
+
) : (
|
|
36
|
+
<Icon name="ChevronDown" size={14} />
|
|
37
|
+
)}
|
|
38
|
+
</RDropdownMenu.Trigger>
|
|
39
|
+
<RDropdownMenu.Portal>
|
|
40
|
+
<RDropdownMenu.Content
|
|
41
|
+
className={menuClass}
|
|
42
|
+
sideOffset={4}
|
|
43
|
+
align="start"
|
|
44
|
+
collisionPadding={16}
|
|
45
|
+
>
|
|
46
|
+
{renderItems(RDropdownMenu, items)}
|
|
47
|
+
</RDropdownMenu.Content>
|
|
48
|
+
</RDropdownMenu.Portal>
|
|
49
|
+
</RDropdownMenu.Root>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { cx } from "../lib/cx.ts";
|
|
3
|
+
import { Icon } from "../Icon/Icon.tsx";
|
|
4
|
+
import { Keys } from "../Kbd/Kbd.tsx";
|
|
5
|
+
import { type MenuItem, type Parts } from "./Menus.types.ts";
|
|
6
|
+
import { menuClass } from "./menuClass.tsx";
|
|
7
|
+
import { menuItemClass } from "./menuItemClass.tsx";
|
|
8
|
+
|
|
9
|
+
export const dangerClass = cx("text-danger-text [&_svg]:text-danger");
|
|
10
|
+
|
|
11
|
+
export const headClass = cx("px-8 pt-6 pb-2 text-text-11 font-medium text-text-secondary");
|
|
12
|
+
|
|
13
|
+
export const sepClass = cx("h-(--stroke-width-hairline) my-4 bg-border-subtle");
|
|
14
|
+
|
|
15
|
+
export function ItemBody({ item }: { item: MenuItem }) {
|
|
16
|
+
return (
|
|
17
|
+
<>
|
|
18
|
+
{item.icon ? <Icon name={item.icon} /> : null}
|
|
19
|
+
<span className="flex-1">{item.label}</span>
|
|
20
|
+
{item.shortcut ? (
|
|
21
|
+
<span className="ms-auto">
|
|
22
|
+
<Keys keys={item.shortcut} />
|
|
23
|
+
</span>
|
|
24
|
+
) : item.submenu || item.items ? (
|
|
25
|
+
<Icon name="ChevronRight" size={14} className="ms-auto" />
|
|
26
|
+
) : null}
|
|
27
|
+
</>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function renderItems(P: Parts, items: MenuItem[]): ReactNode {
|
|
32
|
+
return items.map((item, i) => {
|
|
33
|
+
const key = `${item.label ?? item.heading ?? "sep"}-${i}`;
|
|
34
|
+
if (item.separator) return <P.Separator key={key} className={sepClass} />;
|
|
35
|
+
if (item.heading) {
|
|
36
|
+
return (
|
|
37
|
+
<P.Label key={key} className={headClass}>
|
|
38
|
+
{item.heading}
|
|
39
|
+
</P.Label>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
if (item.items) {
|
|
43
|
+
return (
|
|
44
|
+
<P.Sub key={key}>
|
|
45
|
+
<P.SubTrigger className={cx(menuItemClass, item.danger && dangerClass)}>
|
|
46
|
+
<ItemBody item={item} />
|
|
47
|
+
</P.SubTrigger>
|
|
48
|
+
<P.Portal>
|
|
49
|
+
<P.SubContent className={menuClass} sideOffset={4}>
|
|
50
|
+
{renderItems(P, item.items)}
|
|
51
|
+
</P.SubContent>
|
|
52
|
+
</P.Portal>
|
|
53
|
+
</P.Sub>
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
return (
|
|
57
|
+
<P.Item
|
|
58
|
+
key={key}
|
|
59
|
+
className={cx(menuItemClass, item.danger && dangerClass, item.active && "bg-bg-hover")}
|
|
60
|
+
{...(item.disabled ? { disabled: true } : {})}
|
|
61
|
+
{...(item.onSelect ? { onSelect: item.onSelect } : {})}
|
|
62
|
+
>
|
|
63
|
+
<ItemBody item={item} />
|
|
64
|
+
</P.Item>
|
|
65
|
+
);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export {
|
|
2
|
+
type MenuItem,
|
|
3
|
+
type DropdownMenuProps,
|
|
4
|
+
type ContextMenuProps,
|
|
5
|
+
type OrgSwitcherProps,
|
|
6
|
+
} from "./Menus.types.ts";
|
|
7
|
+
export { menuClass } from "./menuClass.tsx";
|
|
8
|
+
export { menuItemClass } from "./menuItemClass.tsx";
|
|
9
|
+
export { DropdownMenu } from "./DropdownMenu.tsx";
|
|
10
|
+
export { ContextMenu } from "./ContextMenu.tsx";
|
|
11
|
+
export { OrgSwitcher } from "./OrgSwitcher.tsx";
|
|
12
|
+
export { orgSwitcherTriggerClass } from "./orgSwitcherTriggerClass.tsx";
|
|
13
|
+
export { compactChevronClass, compactLabelClass } from "./compactTriggerClass.tsx";
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { ContextMenu as RContextMenu, DropdownMenu as RDropdownMenu } from "radix-ui";
|
|
3
|
+
import type {
|
|
4
|
+
ContextMenuProps as ReferenceContextMenuProps,
|
|
5
|
+
DropdownMenuProps as ReferenceDropdownMenuProps,
|
|
6
|
+
MenuItem as ReferenceMenuItem,
|
|
7
|
+
OrgSwitcherProps as ReferenceOrgSwitcherProps,
|
|
8
|
+
} from "../types/reference";
|
|
9
|
+
|
|
10
|
+
export interface MenuItem extends ReferenceMenuItem {
|
|
11
|
+
onSelect?: () => void;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
/** Items of a submenu; the item opens it with Arrow Right (Arrow Left in right-to-left). */
|
|
14
|
+
items?: MenuItem[];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export type DropdownMenuProps = Omit<ReferenceDropdownMenuProps, "items"> & {
|
|
18
|
+
items: MenuItem[];
|
|
19
|
+
open?: boolean;
|
|
20
|
+
onOpenChange?: (open: boolean) => void;
|
|
21
|
+
/**
|
|
22
|
+
* Below md, a trigger with an icon shows only the icon; the label stays as its accessible name
|
|
23
|
+
* (the account menu in a phone's top bar).
|
|
24
|
+
*/
|
|
25
|
+
compact?: boolean;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export type ContextMenuProps = Omit<ReferenceContextMenuProps, "items"> & {
|
|
29
|
+
items: MenuItem[];
|
|
30
|
+
/** The region that opens the menu on right-click, long press or Shift+F10. Without it the menu renders on its own. */
|
|
31
|
+
children?: ReactNode;
|
|
32
|
+
/**
|
|
33
|
+
* Opens the menu at a viewport point instead of over `children`: where the pointer was, or a
|
|
34
|
+
* focused cell's corner from the keyboard. The page opens it (a table row's right-click or
|
|
35
|
+
* Shift+F10), so the menu code can load on demand; `onClose` runs when it closes.
|
|
36
|
+
*/
|
|
37
|
+
at?: { x: number; y: number };
|
|
38
|
+
onClose?: () => void;
|
|
39
|
+
/** Takes focus back when a point menu closes; the element that opened it, such as a table cell. */
|
|
40
|
+
returnFocus?: HTMLElement | null;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export type OrgSwitcherProps = ReferenceOrgSwitcherProps & {
|
|
44
|
+
onSelect?: (name: string) => void;
|
|
45
|
+
onMarketplace?: () => void;
|
|
46
|
+
defaultOpen?: boolean;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export type Parts = typeof RDropdownMenu | typeof RContextMenu;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
import { DropdownMenu as RDropdownMenu } from "radix-ui";
|
|
3
|
+
import { cx } from "../lib/cx.ts";
|
|
4
|
+
import { useT } from "../lib/context.tsx";
|
|
5
|
+
import { Icon } from "../Icon/Icon.tsx";
|
|
6
|
+
import { Badge } from "../Chips/Chips.tsx";
|
|
7
|
+
import { BrandMark } from "../BrandMark/BrandMark.tsx";
|
|
8
|
+
import { headClass, sepClass } from "./Menus.shared.tsx";
|
|
9
|
+
import { type OrgSwitcherProps } from "./Menus.types.ts";
|
|
10
|
+
import { menuClass } from "./menuClass.tsx";
|
|
11
|
+
import { menuItemClass } from "./menuItemClass.tsx";
|
|
12
|
+
import { orgSwitcherTriggerClass } from "./orgSwitcherTriggerClass.tsx";
|
|
13
|
+
|
|
14
|
+
/** Moves between every org a person works with; the marketplace sits at the bottom. */
|
|
15
|
+
export function OrgSwitcher({
|
|
16
|
+
current,
|
|
17
|
+
heading,
|
|
18
|
+
orgs,
|
|
19
|
+
onSelect,
|
|
20
|
+
onMarketplace,
|
|
21
|
+
defaultOpen,
|
|
22
|
+
}: OrgSwitcherProps): ReactElement {
|
|
23
|
+
const t = useT();
|
|
24
|
+
return (
|
|
25
|
+
<RDropdownMenu.Root {...(defaultOpen === undefined ? {} : { defaultOpen })} modal={false}>
|
|
26
|
+
<RDropdownMenu.Trigger aria-label={current} className={orgSwitcherTriggerClass}>
|
|
27
|
+
<BrandMark name={current} size="sm" />
|
|
28
|
+
<Icon name="ChevronsUpDown" size={14} color="var(--color-text-secondary)" />
|
|
29
|
+
</RDropdownMenu.Trigger>
|
|
30
|
+
<RDropdownMenu.Portal>
|
|
31
|
+
<RDropdownMenu.Content
|
|
32
|
+
className={cx(menuClass, "w-(--ui-orgsw)")}
|
|
33
|
+
sideOffset={4}
|
|
34
|
+
align="start"
|
|
35
|
+
collisionPadding={16}
|
|
36
|
+
>
|
|
37
|
+
<RDropdownMenu.Label className={headClass}>{heading}</RDropdownMenu.Label>
|
|
38
|
+
<RDropdownMenu.RadioGroup value={current} onValueChange={(name) => onSelect?.(name)}>
|
|
39
|
+
{orgs.map((o) => (
|
|
40
|
+
<RDropdownMenu.RadioItem
|
|
41
|
+
key={o.name}
|
|
42
|
+
value={o.name}
|
|
43
|
+
className={cx(menuItemClass, "h-row-comfortable")}
|
|
44
|
+
>
|
|
45
|
+
<BrandMark name={o.name} size="sm" iconOnly />
|
|
46
|
+
<span className="flex flex-1 flex-col">
|
|
47
|
+
<span>{o.name}</span>
|
|
48
|
+
<span className="text-text-12 text-text-secondary">{o.role}</span>
|
|
49
|
+
</span>
|
|
50
|
+
<RDropdownMenu.ItemIndicator>
|
|
51
|
+
<Icon name="Check" size={14} />
|
|
52
|
+
</RDropdownMenu.ItemIndicator>
|
|
53
|
+
{o.name !== current && o.badge ? <Badge count={o.badge} tone="accent" /> : null}
|
|
54
|
+
</RDropdownMenu.RadioItem>
|
|
55
|
+
))}
|
|
56
|
+
</RDropdownMenu.RadioGroup>
|
|
57
|
+
<RDropdownMenu.Separator className={sepClass} />
|
|
58
|
+
<RDropdownMenu.Item
|
|
59
|
+
className={menuItemClass}
|
|
60
|
+
{...(onMarketplace ? { onSelect: onMarketplace } : {})}
|
|
61
|
+
>
|
|
62
|
+
<Icon name="Compass" />
|
|
63
|
+
<span>{t("org.marketplace")}</span>
|
|
64
|
+
</RDropdownMenu.Item>
|
|
65
|
+
</RDropdownMenu.Content>
|
|
66
|
+
</RDropdownMenu.Portal>
|
|
67
|
+
</RDropdownMenu.Root>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A compact DropdownMenu trigger's label and chevron classes: below md only the icon shows and the
|
|
3
|
+
* label stays as the accessible name. Exported for a host that renders the closed trigger before
|
|
4
|
+
* the menu loads.
|
|
5
|
+
*/
|
|
6
|
+
export const compactLabelClass = "max-md:sr-only";
|
|
7
|
+
export const compactChevronClass = "contents max-md:hidden";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { cx } from "../lib/cx.ts";
|
|
2
|
+
|
|
3
|
+
export const menuItemClass = cx(
|
|
4
|
+
"flex items-center gap-8 h-control-lg px-8 rounded-control text-text-primary cursor-pointer outline-none select-none",
|
|
5
|
+
"data-highlighted:bg-bg-hover data-[state=open]:bg-bg-hover data-disabled:opacity-disabled data-disabled:cursor-not-allowed",
|
|
6
|
+
"pointer-coarse:min-h-target-coarse [&_svg]:text-text-secondary",
|
|
7
|
+
);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { cx } from "../lib/cx.ts";
|
|
2
|
+
|
|
3
|
+
/** The OrgSwitcher trigger's classes, for a host that renders the closed trigger before the menu loads. */
|
|
4
|
+
export const orgSwitcherTriggerClass = cx(
|
|
5
|
+
"flex items-center justify-between gap-8 w-(--ui-orgsw) max-w-full h-row-default px-8 rounded-control",
|
|
6
|
+
"bg-transparent text-text-primary cursor-pointer hover:bg-bg-hover pointer-coarse:min-h-target-coarse",
|
|
7
|
+
);
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { type ReactElement } from "react";
|
|
2
|
+
import { Accordion as RAccordion } from "radix-ui";
|
|
3
|
+
import { cx } from "../lib/cx.ts";
|
|
4
|
+
import { Icon } from "../Icon/Icon.tsx";
|
|
5
|
+
import { type AccordionProps } from "./Navigation.types.ts";
|
|
6
|
+
|
|
7
|
+
/** Progressively discloses sections; each header is a button that Enter or Space toggles. */
|
|
8
|
+
export function Accordion({
|
|
9
|
+
items,
|
|
10
|
+
keepMounted = false,
|
|
11
|
+
headingLevel = 3,
|
|
12
|
+
}: AccordionProps): ReactElement {
|
|
13
|
+
const Heading = `h${headingLevel}` as const;
|
|
14
|
+
return (
|
|
15
|
+
<RAccordion.Root
|
|
16
|
+
type="multiple"
|
|
17
|
+
defaultValue={items.filter((it) => it.open).map((it) => it.title)}
|
|
18
|
+
className="rounded-card border border-border-subtle"
|
|
19
|
+
>
|
|
20
|
+
{items.map((it) => (
|
|
21
|
+
<RAccordion.Item
|
|
22
|
+
key={it.title}
|
|
23
|
+
value={it.title}
|
|
24
|
+
className="group border-b border-border-subtle last:border-b-0"
|
|
25
|
+
>
|
|
26
|
+
<RAccordion.Header asChild>
|
|
27
|
+
<Heading className="m-0">
|
|
28
|
+
<RAccordion.Trigger
|
|
29
|
+
className={cx(
|
|
30
|
+
"flex items-center gap-6 w-full h-(--ui-accordion-row) px-12 bg-transparent border-0 cursor-pointer",
|
|
31
|
+
"font-medium text-text-13 text-start pointer-coarse:min-h-target-coarse",
|
|
32
|
+
)}
|
|
33
|
+
>
|
|
34
|
+
<Icon
|
|
35
|
+
name="ChevronRight"
|
|
36
|
+
size={14}
|
|
37
|
+
className="text-text-secondary transition-transform duration-fast ease-standard group-data-[state=open]:rotate-90 group-data-[state=open]:rtl:-rotate-90"
|
|
38
|
+
/>
|
|
39
|
+
<span>{it.title}</span>
|
|
40
|
+
{it.meta ? (
|
|
41
|
+
<span className="ms-auto text-text-secondary font-regular">{it.meta}</span>
|
|
42
|
+
) : null}
|
|
43
|
+
</RAccordion.Trigger>
|
|
44
|
+
</Heading>
|
|
45
|
+
</RAccordion.Header>
|
|
46
|
+
<RAccordion.Content
|
|
47
|
+
{...(keepMounted ? { forceMount: true as const } : {})}
|
|
48
|
+
className={cx(
|
|
49
|
+
"pb-12 ps-(--ui-accordion-indent) pe-12 text-text-secondary",
|
|
50
|
+
keepMounted && "data-[state=closed]:hidden",
|
|
51
|
+
)}
|
|
52
|
+
>
|
|
53
|
+
{it.content}
|
|
54
|
+
</RAccordion.Content>
|
|
55
|
+
</RAccordion.Item>
|
|
56
|
+
))}
|
|
57
|
+
</RAccordion.Root>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { type ReactElement } from "react";
|
|
2
|
+
import { cx } from "../lib/cx.ts";
|
|
3
|
+
import { useT } from "../lib/context.tsx";
|
|
4
|
+
import { Icon } from "../Icon/Icon.tsx";
|
|
5
|
+
import { type BreadcrumbsProps } from "./Navigation.types.ts";
|
|
6
|
+
|
|
7
|
+
/** One crumb's text: shrinks with an ellipsis when the trail runs out of room, titled in full. */
|
|
8
|
+
const LABEL = "block truncate";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Org, workspace, project, scope node, module and record; the last is the current page. The trail
|
|
12
|
+
* stays on one line: in a narrow header (a phone's top bar) or under a longer translation each crumb
|
|
13
|
+
* shrinks with an ellipsis and keeps its whole label as a title, instead of wrapping out of the
|
|
14
|
+
* header's height (Section 15, gate 16). Below md only the parent and the current page show, so a
|
|
15
|
+
* phone's top bar keeps two readable crumbs instead of five cut to a letter each (A59-004).
|
|
16
|
+
*/
|
|
17
|
+
export function Breadcrumbs({ items }: BreadcrumbsProps): ReactElement {
|
|
18
|
+
const t = useT();
|
|
19
|
+
return (
|
|
20
|
+
<nav aria-label={t("nav.breadcrumb")} className="min-w-0">
|
|
21
|
+
<ol className="flex items-center gap-4 m-0 p-0 list-none text-text-13 text-text-secondary max-w-full min-w-0">
|
|
22
|
+
{items.map((it, i) => {
|
|
23
|
+
const last = i === items.length - 1;
|
|
24
|
+
const early = i < items.length - 2;
|
|
25
|
+
return (
|
|
26
|
+
<li
|
|
27
|
+
key={`${it.label}-${i}`}
|
|
28
|
+
className={cx("inline-flex items-center gap-4 min-w-0", early && "max-md:hidden")}
|
|
29
|
+
>
|
|
30
|
+
{last ? (
|
|
31
|
+
<span aria-current="page" className={`${LABEL} text-text-primary`} title={it.label}>
|
|
32
|
+
{it.label}
|
|
33
|
+
</span>
|
|
34
|
+
) : it.href ? (
|
|
35
|
+
<a
|
|
36
|
+
href={it.href}
|
|
37
|
+
className="xos-hit min-w-0 text-inherit no-underline hover:text-text-primary"
|
|
38
|
+
>
|
|
39
|
+
<span className={LABEL} title={it.label}>
|
|
40
|
+
{it.label}
|
|
41
|
+
</span>
|
|
42
|
+
</a>
|
|
43
|
+
) : (
|
|
44
|
+
<span className={LABEL} title={it.label}>
|
|
45
|
+
{it.label}
|
|
46
|
+
</span>
|
|
47
|
+
)}
|
|
48
|
+
{last ? null : (
|
|
49
|
+
<span className="shrink-0 text-text-tertiary">
|
|
50
|
+
<Icon name="chevron-right" size={12} />
|
|
51
|
+
</span>
|
|
52
|
+
)}
|
|
53
|
+
</li>
|
|
54
|
+
);
|
|
55
|
+
})}
|
|
56
|
+
</ol>
|
|
57
|
+
</nav>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type ReactElement, type ReactNode } from "react";
|
|
2
|
+
import { useT } from "../lib/context.tsx";
|
|
3
|
+
import { Accordion } from "./Accordion.tsx";
|
|
4
|
+
|
|
5
|
+
export interface MoreFieldsProps {
|
|
6
|
+
/** The fields past the seventh. */
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
/** Opens the section, for example when one of its fields has an error to show. */
|
|
9
|
+
open?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* The section header's heading level. A form most often sits right under the page title, where a
|
|
12
|
+
* level 3 header skips a level; 2 follows any heading without skipping one.
|
|
13
|
+
*/
|
|
14
|
+
headingLevel?: 2 | 3 | 4;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The More fields section of a long form (Section 11.10, Section 18 gate 27): a form shows at most
|
|
19
|
+
* seven fields and puts the rest here. Collapsed fields stay in the DOM, hidden, so they keep their
|
|
20
|
+
* values and submit with the form.
|
|
21
|
+
*/
|
|
22
|
+
export function MoreFields({
|
|
23
|
+
children,
|
|
24
|
+
open = false,
|
|
25
|
+
headingLevel = 2,
|
|
26
|
+
}: MoreFieldsProps): ReactElement {
|
|
27
|
+
const t = useT();
|
|
28
|
+
return (
|
|
29
|
+
<Accordion
|
|
30
|
+
key={open ? "open" : "closed"}
|
|
31
|
+
keepMounted
|
|
32
|
+
headingLevel={headingLevel}
|
|
33
|
+
items={[
|
|
34
|
+
{
|
|
35
|
+
title: t("form.moreFields"),
|
|
36
|
+
open,
|
|
37
|
+
content: <div className="flex flex-col gap-16 pt-4 text-text-primary">{children}</div>,
|
|
38
|
+
},
|
|
39
|
+
]}
|
|
40
|
+
/>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { cx } from "../lib/cx.ts";
|
|
3
|
+
import { type NavItem } from "./Navigation.types.ts";
|
|
4
|
+
|
|
5
|
+
/** A destination: a link when it has an href, otherwise a button that runs the item's action. */
|
|
6
|
+
export function ItemAction({
|
|
7
|
+
item,
|
|
8
|
+
active,
|
|
9
|
+
className,
|
|
10
|
+
children,
|
|
11
|
+
}: {
|
|
12
|
+
item: NavItem;
|
|
13
|
+
active: boolean;
|
|
14
|
+
className: string;
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
}) {
|
|
17
|
+
const current = active ? ("page" as const) : undefined;
|
|
18
|
+
return item.href ? (
|
|
19
|
+
<a href={item.href} aria-current={current} onClick={item.onSelect} className={className}>
|
|
20
|
+
{children}
|
|
21
|
+
</a>
|
|
22
|
+
) : (
|
|
23
|
+
<button
|
|
24
|
+
type="button"
|
|
25
|
+
aria-current={current}
|
|
26
|
+
onClick={item.onSelect}
|
|
27
|
+
className={cx(className, "bg-transparent border-0 cursor-pointer")}
|
|
28
|
+
>
|
|
29
|
+
{children}
|
|
30
|
+
</button>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export {
|
|
2
|
+
type TabsProps,
|
|
3
|
+
type SegmentedControlProps,
|
|
4
|
+
type AccordionProps,
|
|
5
|
+
type BreadcrumbsProps,
|
|
6
|
+
type PaginationProps,
|
|
7
|
+
type NavItem,
|
|
8
|
+
type SidebarProps,
|
|
9
|
+
type TopNavProps,
|
|
10
|
+
type TabBarProps,
|
|
11
|
+
} from "./Navigation.types.ts";
|
|
12
|
+
export { Tabs } from "./Tabs.tsx";
|
|
13
|
+
export { SegmentedControl } from "./SegmentedControl.tsx";
|
|
14
|
+
export { Accordion } from "./Accordion.tsx";
|
|
15
|
+
export { MoreFields, type MoreFieldsProps } from "./MoreFields.tsx";
|
|
16
|
+
export { Breadcrumbs } from "./Breadcrumbs.tsx";
|
|
17
|
+
export { Pagination } from "./Pagination.tsx";
|
|
18
|
+
export { Sidebar } from "./Sidebar.tsx";
|
|
19
|
+
export { sidebarClass, sidebarItemClass } from "./sidebar-classes.ts";
|
|
20
|
+
export { TopNav } from "./TopNav.tsx";
|
|
21
|
+
export { TabBar } from "./TabBar.tsx";
|