@fairgarden/design 0.1.0-alpha.1 → 0.1.0-alpha.2
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 +51 -27
- package/actions/button/Button.d.ts.map +1 -1
- package/actions/button/Button.js +13 -1
- package/actions/button/Button.js.map +1 -1
- package/actions/button/button.module.css +85 -25
- package/actions/chip/Chip.d.ts +2 -2
- package/actions/chip/Chip.js +2 -2
- package/actions/chip/chip.module.css +12 -18
- package/actions/link/Link.d.ts +1 -1
- package/actions/link/link.module.css +22 -19
- package/actions/toggle/Toggle.js +1 -1
- package/actions/toggle/toggle.module.css +27 -23
- package/content/card/card.module.css +27 -27
- package/content/card-grid/CardGrid.js +1 -1
- package/content/card-grid/card-grid.module.css +3 -3
- package/content/carousel/Carousel.d.ts.map +1 -1
- package/content/carousel/Carousel.js +1 -4
- package/content/carousel/Carousel.js.map +1 -1
- package/content/carousel/carousel.module.css +19 -9
- package/content/code-block/CodeActionsMenu.d.ts +34 -0
- package/content/code-block/CodeActionsMenu.d.ts.map +1 -0
- package/content/code-block/CodeActionsMenu.js +102 -0
- package/content/code-block/CodeActionsMenu.js.map +1 -0
- package/content/code-block/CodeBlock.d.ts +37 -0
- package/content/code-block/CodeBlock.d.ts.map +1 -0
- package/content/code-block/CodeBlock.js +30 -0
- package/content/code-block/CodeBlock.js.map +1 -0
- package/content/code-block/CodeBlockFrame.d.ts +54 -0
- package/content/code-block/CodeBlockFrame.d.ts.map +1 -0
- package/content/code-block/CodeBlockFrame.js +80 -0
- package/content/code-block/CodeBlockFrame.js.map +1 -0
- package/content/code-block/CodeBlockHeader.d.ts +26 -0
- package/content/code-block/CodeBlockHeader.d.ts.map +1 -0
- package/content/code-block/CodeBlockHeader.js +16 -0
- package/content/code-block/CodeBlockHeader.js.map +1 -0
- package/content/code-block/CodeBlockLazy.d.ts +11 -0
- package/content/code-block/CodeBlockLazy.d.ts.map +1 -0
- package/content/code-block/CodeBlockLazy.js +14 -0
- package/content/code-block/CodeBlockLazy.js.map +1 -0
- package/content/code-block/CodeBlockLoading.d.ts +31 -0
- package/content/code-block/CodeBlockLoading.d.ts.map +1 -0
- package/content/code-block/CodeBlockLoading.js +90 -0
- package/content/code-block/CodeBlockLoading.js.map +1 -0
- package/content/code-block/CodeBlockSection.d.ts +40 -0
- package/content/code-block/CodeBlockSection.d.ts.map +1 -0
- package/content/code-block/CodeBlockSection.js +105 -0
- package/content/code-block/CodeBlockSection.js.map +1 -0
- package/content/code-block/CodeBlockToasts.d.ts +26 -0
- package/content/code-block/CodeBlockToasts.d.ts.map +1 -0
- package/content/code-block/CodeBlockToasts.js +88 -0
- package/content/code-block/CodeBlockToasts.js.map +1 -0
- package/content/code-block/code-block.module.css +949 -0
- package/content/code-block/index.d.ts +4 -0
- package/content/code-block/index.d.ts.map +1 -0
- package/content/code-block/index.js +4 -0
- package/content/code-block/index.js.map +1 -0
- package/content/demo/DemoContent.d.ts +32 -0
- package/content/demo/DemoContent.d.ts.map +1 -0
- package/content/demo/DemoContent.js +87 -0
- package/content/demo/DemoContent.js.map +1 -0
- package/content/demo/DemoFrame.d.ts +6 -0
- package/content/demo/DemoFrame.d.ts.map +1 -0
- package/content/demo/DemoFrame.js +17 -0
- package/content/demo/DemoFrame.js.map +1 -0
- package/content/demo/DemoLazy.d.ts +11 -0
- package/content/demo/DemoLazy.d.ts.map +1 -0
- package/content/demo/DemoLazy.js +14 -0
- package/content/demo/DemoLazy.js.map +1 -0
- package/content/demo/DemoLoading.d.ts +23 -0
- package/content/demo/DemoLoading.d.ts.map +1 -0
- package/content/demo/DemoLoading.js +26 -0
- package/content/demo/DemoLoading.js.map +1 -0
- package/content/demo/demo.module.css +163 -0
- package/content/demo/index.d.ts +4 -0
- package/content/demo/index.d.ts.map +1 -0
- package/content/demo/index.js +4 -0
- package/content/demo/index.js.map +1 -0
- package/content/empty-state/EmptyState.d.ts +1 -1
- package/content/empty-state/EmptyState.js +1 -1
- package/content/empty-state/empty-state.module.css +11 -11
- package/content/feature-grid/feature-grid.module.css +22 -22
- package/content/index-rows/IndexRows.d.ts +2 -2
- package/content/index-rows/IndexRows.d.ts.map +1 -1
- package/content/index-rows/IndexRows.js +1 -1
- package/content/index-rows/index-rows.module.css +29 -29
- package/content/pricing/Pricing.d.ts +4 -4
- package/content/pricing/Pricing.d.ts.map +1 -1
- package/content/pricing/Pricing.js +4 -4
- package/content/pricing/Pricing.js.map +1 -1
- package/content/pricing/pricing.module.css +22 -22
- package/content/profile/Profile.d.ts +1 -1
- package/content/profile/Profile.js +2 -2
- package/content/profile/profile.module.css +13 -13
- package/content/quote/Quote.d.ts +1 -1
- package/content/quote/quote.module.css +9 -9
- package/content/timeline/Timeline.d.ts +1 -1
- package/content/timeline/Timeline.d.ts.map +1 -1
- package/content/timeline/Timeline.js +5 -5
- package/content/timeline/Timeline.js.map +1 -1
- package/content/timeline/timeline.module.css +12 -12
- package/content/types-table/TypePre.d.ts +11 -0
- package/content/types-table/TypePre.d.ts.map +1 -0
- package/content/types-table/TypePre.js +13 -0
- package/content/types-table/TypePre.js.map +1 -0
- package/content/types-table/TypesTable.d.ts +22 -0
- package/content/types-table/TypesTable.d.ts.map +1 -0
- package/content/types-table/TypesTable.js +124 -0
- package/content/types-table/TypesTable.js.map +1 -0
- package/content/types-table/index.d.ts +3 -0
- package/content/types-table/index.d.ts.map +1 -0
- package/content/types-table/index.js +3 -0
- package/content/types-table/index.js.map +1 -0
- package/content/types-table/types-table.module.css +160 -0
- package/data/chart/Chart.d.ts +8 -1
- package/data/chart/Chart.d.ts.map +1 -1
- package/data/chart/Chart.js +28 -15
- package/data/chart/Chart.js.map +1 -1
- package/data/chart/chart.module.css +20 -6
- package/data/figure/Figure.d.ts +1 -1
- package/data/figure/Figure.js +1 -1
- package/data/figure/figure.module.css +7 -7
- package/data/map/Map.d.ts +3 -3
- package/data/map/Map.d.ts.map +1 -1
- package/data/map/Map.js +10 -8
- package/data/map/Map.js.map +1 -1
- package/data/map/MapCanvas.d.ts.map +1 -1
- package/data/map/MapCanvas.js +5 -9
- package/data/map/MapCanvas.js.map +1 -1
- package/data/map/map.module.css +39 -14
- package/data/map/mapStyle.d.ts +2 -2
- package/data/map/mapStyle.d.ts.map +1 -1
- package/data/map/mapStyle.js +5 -5
- package/data/map/mapStyle.js.map +1 -1
- package/data/scroll-area/ScrollArea.d.ts.map +1 -1
- package/data/scroll-area/ScrollArea.js +8 -4
- package/data/scroll-area/ScrollArea.js.map +1 -1
- package/data/scroll-area/scroll-area.module.css +28 -9
- package/data/spec-grid/spec-grid.module.css +8 -8
- package/data/spec-list/spec-list.module.css +3 -3
- package/data/spec-sheet/SpecSheet.d.ts +2 -2
- package/data/spec-sheet/SpecSheet.js +1 -1
- package/data/spec-sheet/spec-sheet.module.css +9 -9
- package/data/stat/Stat.d.ts +1 -1
- package/data/stat/Stat.d.ts.map +1 -1
- package/data/stat/stat.module.css +4 -4
- package/data/table/Table.d.ts +6 -5
- package/data/table/Table.d.ts.map +1 -1
- package/data/table/Table.js.map +1 -1
- package/data/table/table.module.css +43 -46
- package/disclosure/accordion/Accordion.d.ts +1 -1
- package/disclosure/accordion/Accordion.js +1 -1
- package/disclosure/accordion/accordion.module.css +12 -12
- package/disclosure/collapsible/Collapsible.d.ts +4 -4
- package/disclosure/collapsible/Collapsible.js +4 -4
- package/disclosure/collapsible/collapsible.module.css +10 -10
- package/disclosure/faq/FAQ.d.ts +3 -3
- package/disclosure/faq/FAQ.d.ts.map +1 -1
- package/disclosure/faq/FAQ.js +3 -3
- package/disclosure/faq/FAQ.js.map +1 -1
- package/disclosure/faq/faq.module.css +20 -20
- package/feedback/alert/alert.module.css +4 -4
- package/feedback/avatar/avatar-group.module.css +2 -2
- package/feedback/avatar/avatar.module.css +9 -9
- package/feedback/badge/Badge.d.ts +1 -1
- package/feedback/badge/badge.module.css +7 -7
- package/feedback/meter/Meter.d.ts +2 -2
- package/feedback/meter/meter.module.css +14 -14
- package/feedback/progress/Progress.d.ts +1 -1
- package/feedback/progress/progress.module.css +7 -7
- package/feedback/tag/tag.module.css +7 -7
- package/feedback/toast/Toast.d.ts +3 -3
- package/feedback/toast/Toast.d.ts.map +1 -1
- package/feedback/toast/Toast.js +17 -7
- package/feedback/toast/Toast.js.map +1 -1
- package/feedback/toast/toast.module.css +31 -20
- package/forms/autocomplete/Autocomplete.d.ts +11 -0
- package/forms/autocomplete/Autocomplete.d.ts.map +1 -1
- package/forms/autocomplete/Autocomplete.js +27 -6
- package/forms/autocomplete/Autocomplete.js.map +1 -1
- package/forms/autocomplete/autocomplete.module.css +35 -41
- package/forms/checkbox/Checkbox.js +1 -1
- package/forms/checkbox/checkbox.module.css +29 -25
- package/forms/checkbox-group/checkbox-group.module.css +4 -4
- package/forms/combobox/Combobox.d.ts +10 -0
- package/forms/combobox/Combobox.d.ts.map +1 -1
- package/forms/combobox/Combobox.js +28 -7
- package/forms/combobox/Combobox.js.map +1 -1
- package/forms/combobox/combobox.module.css +34 -41
- package/forms/field/field.module.css +1 -1
- package/forms/fieldset/Fieldset.d.ts +1 -1
- package/forms/fieldset/Fieldset.js +2 -2
- package/forms/fieldset/fieldset.module.css +14 -14
- package/forms/form/form.module.css +2 -2
- package/forms/input/Input.d.ts +10 -3
- package/forms/input/Input.d.ts.map +1 -1
- package/forms/input/Input.js +10 -4
- package/forms/input/Input.js.map +1 -1
- package/forms/input/input.module.css +38 -21
- package/forms/number-field/number-field.module.css +24 -23
- package/forms/radio/Radio.d.ts +1 -1
- package/forms/radio/Radio.d.ts.map +1 -1
- package/forms/radio/Radio.js +5 -3
- package/forms/radio/Radio.js.map +1 -1
- package/forms/radio/radio.module.css +38 -30
- package/forms/radio-group/RadioGroup.d.ts +1 -1
- package/forms/radio-group/radio-group.module.css +3 -3
- package/forms/search/Search.d.ts +10 -0
- package/forms/search/Search.d.ts.map +1 -1
- package/forms/search/Search.js +25 -6
- package/forms/search/Search.js.map +1 -1
- package/forms/search/search.module.css +25 -33
- package/forms/select/Select.d.ts +10 -2
- package/forms/select/Select.d.ts.map +1 -1
- package/forms/select/Select.js +27 -12
- package/forms/select/Select.js.map +1 -1
- package/forms/select/select.module.css +42 -48
- package/forms/slider/Slider.js +2 -2
- package/forms/slider/slider.module.css +23 -23
- package/forms/switch/Switch.js +1 -1
- package/forms/switch/switch.module.css +23 -19
- package/foundations/expanding-box/ExpandingBox.d.ts +86 -0
- package/foundations/expanding-box/ExpandingBox.d.ts.map +1 -0
- package/foundations/expanding-box/ExpandingBox.js +179 -0
- package/foundations/expanding-box/ExpandingBox.js.map +1 -0
- package/foundations/expanding-box/expanding-box.module.css +415 -0
- package/foundations/expanding-box/index.d.ts +3 -0
- package/foundations/expanding-box/index.d.ts.map +1 -0
- package/foundations/expanding-box/index.js +3 -0
- package/foundations/expanding-box/index.js.map +1 -0
- package/foundations/expanding-box/startExpandingTransition.d.ts +33 -0
- package/foundations/expanding-box/startExpandingTransition.d.ts.map +1 -0
- package/foundations/expanding-box/startExpandingTransition.js +82 -0
- package/foundations/expanding-box/startExpandingTransition.js.map +1 -0
- package/foundations/ground/Ground.d.ts +1 -1
- package/foundations/ground/ground.module.css +4 -4
- package/foundations/icon/Icon.d.ts +1 -1
- package/foundations/icon/Icon.js +1 -1
- package/foundations/icon/icon.module.css +1 -1
- package/foundations/outline-morph/OutlineMorph.d.ts +112 -0
- package/foundations/outline-morph/OutlineMorph.d.ts.map +1 -0
- package/foundations/outline-morph/OutlineMorph.js +83 -0
- package/foundations/outline-morph/OutlineMorph.js.map +1 -0
- package/foundations/outline-morph/index.d.ts +3 -0
- package/foundations/outline-morph/index.d.ts.map +1 -0
- package/foundations/outline-morph/index.js +3 -0
- package/foundations/outline-morph/index.js.map +1 -0
- package/foundations/outline-morph/morphEngine.d.ts +219 -0
- package/foundations/outline-morph/morphEngine.d.ts.map +1 -0
- package/foundations/outline-morph/morphEngine.js +1331 -0
- package/foundations/outline-morph/morphEngine.js.map +1 -0
- package/foundations/outline-morph/outline-morph.module.css +113 -0
- package/foundations/outline-morph/useOutlineMorphRoot.d.ts +50 -0
- package/foundations/outline-morph/useOutlineMorphRoot.d.ts.map +1 -0
- package/foundations/outline-morph/useOutlineMorphRoot.js +55 -0
- package/foundations/outline-morph/useOutlineMorphRoot.js.map +1 -0
- package/foundations/separator/separator.module.css +10 -10
- package/foundations/sticker/Sticker.d.ts +4 -4
- package/foundations/sticker/Sticker.d.ts.map +1 -1
- package/foundations/sticker/Sticker.js +3 -3
- package/foundations/sticker/sticker.module.css +10 -10
- package/icons/paths.d.ts +1 -1
- package/icons/paths.d.ts.map +1 -1
- package/icons/paths.js +50 -0
- package/icons/paths.js.map +1 -1
- package/navigation/breadcrumb/Breadcrumb.d.ts +7 -1
- package/navigation/breadcrumb/Breadcrumb.d.ts.map +1 -1
- package/navigation/breadcrumb/Breadcrumb.js +8 -8
- package/navigation/breadcrumb/Breadcrumb.js.map +1 -1
- package/navigation/breadcrumb/breadcrumb.module.css +14 -14
- package/navigation/file-tabs/FileTabs.d.ts +169 -0
- package/navigation/file-tabs/FileTabs.d.ts.map +1 -0
- package/navigation/file-tabs/FileTabs.js +253 -0
- package/navigation/file-tabs/FileTabs.js.map +1 -0
- package/navigation/file-tabs/file-tabs.module.css +868 -0
- package/navigation/file-tabs/index.d.ts +2 -0
- package/navigation/file-tabs/index.d.ts.map +1 -0
- package/navigation/file-tabs/index.js +2 -0
- package/navigation/file-tabs/index.js.map +1 -0
- package/navigation/nav-drawer/NavDrawer.d.ts +32 -6
- package/navigation/nav-drawer/NavDrawer.d.ts.map +1 -1
- package/navigation/nav-drawer/NavDrawer.js +94 -28
- package/navigation/nav-drawer/NavDrawer.js.map +1 -1
- package/navigation/nav-drawer/nav-drawer.module.css +78 -55
- package/navigation/navigation-bar/NavigationBar.d.ts +31 -11
- package/navigation/navigation-bar/NavigationBar.d.ts.map +1 -1
- package/navigation/navigation-bar/NavigationBar.js +40 -17
- package/navigation/navigation-bar/NavigationBar.js.map +1 -1
- package/navigation/navigation-bar/navigation-bar.module.css +58 -27
- package/navigation/navigation-menu/NavigationMenu.d.ts +9 -9
- package/navigation/navigation-menu/NavigationMenu.d.ts.map +1 -1
- package/navigation/navigation-menu/NavigationMenu.js +15 -15
- package/navigation/navigation-menu/navigation-menu.module.css +39 -53
- package/navigation/pagination/Pagination.js +1 -1
- package/navigation/pagination/pagination.module.css +24 -24
- package/navigation/sidebar-nav/SidebarNav.d.ts +71 -0
- package/navigation/sidebar-nav/SidebarNav.d.ts.map +1 -0
- package/navigation/sidebar-nav/SidebarNav.js +169 -0
- package/navigation/sidebar-nav/SidebarNav.js.map +1 -0
- package/navigation/sidebar-nav/index.d.ts +2 -0
- package/navigation/sidebar-nav/index.d.ts.map +1 -0
- package/navigation/sidebar-nav/index.js +2 -0
- package/navigation/sidebar-nav/index.js.map +1 -0
- package/navigation/sidebar-nav/sidebar-nav.module.css +270 -0
- package/navigation/table-of-contents/TableOfContents.d.ts +92 -0
- package/navigation/table-of-contents/TableOfContents.d.ts.map +1 -0
- package/navigation/table-of-contents/TableOfContents.js +211 -0
- package/navigation/table-of-contents/TableOfContents.js.map +1 -0
- package/navigation/table-of-contents/index.d.ts +3 -0
- package/navigation/table-of-contents/index.d.ts.map +1 -0
- package/navigation/table-of-contents/index.js +3 -0
- package/navigation/table-of-contents/index.js.map +1 -0
- package/navigation/table-of-contents/table-of-contents.module.css +322 -0
- package/navigation/table-of-contents/useActiveHeading.d.ts +37 -0
- package/navigation/table-of-contents/useActiveHeading.d.ts.map +1 -0
- package/navigation/table-of-contents/useActiveHeading.js +111 -0
- package/navigation/table-of-contents/useActiveHeading.js.map +1 -0
- package/navigation/tabs/Tabs.d.ts +2 -2
- package/navigation/tabs/Tabs.js +3 -3
- package/navigation/tabs/tabs.module.css +22 -19
- package/navigation/toolbar/Toolbar.d.ts +7 -1
- package/navigation/toolbar/Toolbar.d.ts.map +1 -1
- package/navigation/toolbar/Toolbar.js +3 -3
- package/navigation/toolbar/Toolbar.js.map +1 -1
- package/navigation/toolbar/toolbar.module.css +6 -6
- package/overlays/alert-dialog/AlertDialog.d.ts +14 -4
- package/overlays/alert-dialog/AlertDialog.d.ts.map +1 -1
- package/overlays/alert-dialog/AlertDialog.js +15 -5
- package/overlays/alert-dialog/AlertDialog.js.map +1 -1
- package/overlays/alert-dialog/alert-dialog.module.css +4 -4
- package/overlays/context-menu/ContextMenu.d.ts +1 -1
- package/overlays/context-menu/ContextMenu.js +1 -1
- package/overlays/dialog/Dialog.d.ts +26 -11
- package/overlays/dialog/Dialog.d.ts.map +1 -1
- package/overlays/dialog/Dialog.js +36 -17
- package/overlays/dialog/Dialog.js.map +1 -1
- package/overlays/dialog/dialog.module.css +32 -31
- package/overlays/dialog/morph.d.ts +17 -0
- package/overlays/dialog/morph.d.ts.map +1 -0
- package/overlays/dialog/morph.js +44 -0
- package/overlays/dialog/morph.js.map +1 -0
- package/overlays/menu/Menu.d.ts +18 -7
- package/overlays/menu/Menu.d.ts.map +1 -1
- package/overlays/menu/Menu.js +35 -12
- package/overlays/menu/Menu.js.map +1 -1
- package/overlays/menu/menu.module.css +26 -50
- package/overlays/menu/morph.d.ts +16 -0
- package/overlays/menu/morph.d.ts.map +1 -0
- package/overlays/menu/morph.js +36 -0
- package/overlays/menu/morph.js.map +1 -0
- package/overlays/menu/popup.d.ts +2 -0
- package/overlays/menu/popup.d.ts.map +1 -1
- package/overlays/menu/popup.js +11 -3
- package/overlays/menu/popup.js.map +1 -1
- package/overlays/menubar/Menubar.d.ts +10 -1
- package/overlays/menubar/Menubar.d.ts.map +1 -1
- package/overlays/menubar/Menubar.js +22 -12
- package/overlays/menubar/Menubar.js.map +1 -1
- package/overlays/menubar/menubar.module.css +13 -13
- package/overlays/popover/Popover.d.ts +22 -8
- package/overlays/popover/Popover.d.ts.map +1 -1
- package/overlays/popover/Popover.js +51 -16
- package/overlays/popover/Popover.js.map +1 -1
- package/overlays/popover/popover.module.css +73 -47
- package/overlays/preview-card/PreviewCard.d.ts +3 -3
- package/overlays/preview-card/PreviewCard.d.ts.map +1 -1
- package/overlays/preview-card/PreviewCard.js +5 -6
- package/overlays/preview-card/PreviewCard.js.map +1 -1
- package/overlays/preview-card/preview-card.module.css +19 -54
- package/overlays/search-dialog/SearchDialog.d.ts +89 -0
- package/overlays/search-dialog/SearchDialog.d.ts.map +1 -0
- package/overlays/search-dialog/SearchDialog.js +220 -0
- package/overlays/search-dialog/SearchDialog.js.map +1 -0
- package/overlays/search-dialog/SearchDialogPopup.d.ts +39 -0
- package/overlays/search-dialog/SearchDialogPopup.d.ts.map +1 -0
- package/overlays/search-dialog/SearchDialogPopup.js +80 -0
- package/overlays/search-dialog/SearchDialogPopup.js.map +1 -0
- package/overlays/search-dialog/SearchDialogTrigger.d.ts +24 -0
- package/overlays/search-dialog/SearchDialogTrigger.d.ts.map +1 -0
- package/overlays/search-dialog/SearchDialogTrigger.js +32 -0
- package/overlays/search-dialog/SearchDialogTrigger.js.map +1 -0
- package/overlays/search-dialog/index.d.ts +3 -0
- package/overlays/search-dialog/index.d.ts.map +1 -0
- package/overlays/search-dialog/index.js +3 -0
- package/overlays/search-dialog/index.js.map +1 -0
- package/overlays/search-dialog/search-dialog.module.css +492 -0
- package/overlays/search-dialog/useShortcutLabel.d.ts +13 -0
- package/overlays/search-dialog/useShortcutLabel.d.ts.map +1 -0
- package/overlays/search-dialog/useShortcutLabel.js +19 -0
- package/overlays/search-dialog/useShortcutLabel.js.map +1 -0
- package/overlays/search-dialog/variants.d.ts +25 -0
- package/overlays/search-dialog/variants.d.ts.map +1 -0
- package/overlays/search-dialog/variants.js +31 -0
- package/overlays/search-dialog/variants.js.map +1 -0
- package/overlays/tooltip/Tooltip.d.ts +3 -3
- package/overlays/tooltip/Tooltip.d.ts.map +1 -1
- package/overlays/tooltip/Tooltip.js +3 -3
- package/overlays/tooltip/Tooltip.js.map +1 -1
- package/overlays/tooltip/tooltip.module.css +2 -2
- package/package.json +27 -19
- package/page/announcement-bar/AnnouncementBar.d.ts +1 -1
- package/page/announcement-bar/AnnouncementBar.js +4 -4
- package/page/announcement-bar/AnnouncementBar.js.map +1 -1
- package/page/announcement-bar/announcement-bar.module.css +11 -17
- package/page/cta-block/CTABlock.d.ts +5 -5
- package/page/cta-block/CTABlock.d.ts.map +1 -1
- package/page/cta-block/CTABlock.js +2 -2
- package/page/cta-block/cta-block.module.css +26 -26
- package/page/docs-layout/DocsLayout.d.ts +83 -0
- package/page/docs-layout/DocsLayout.d.ts.map +1 -0
- package/page/docs-layout/DocsLayout.js +108 -0
- package/page/docs-layout/DocsLayout.js.map +1 -0
- package/page/docs-layout/docs-layout.module.css +266 -0
- package/page/docs-layout/index.d.ts +2 -0
- package/page/docs-layout/index.d.ts.map +1 -0
- package/page/docs-layout/index.js +2 -0
- package/page/docs-layout/index.js.map +1 -0
- package/page/footer/Footer.d.ts +1 -1
- package/page/footer/Footer.js +1 -1
- package/page/footer/footer.module.css +31 -31
- package/page/hero/Hero.d.ts +3 -3
- package/page/hero/Hero.d.ts.map +1 -1
- package/page/hero/Hero.js +1 -1
- package/page/hero/hero.module.css +36 -36
- package/page/marquee/Marquee.d.ts +2 -2
- package/page/marquee/Marquee.js +1 -1
- package/page/marquee/marquee.module.css +11 -11
- package/page/newsletter/Newsletter.d.ts.map +1 -1
- package/page/newsletter/Newsletter.js +4 -59
- package/page/newsletter/Newsletter.js.map +1 -1
- package/page/newsletter/newsletter.module.css +44 -22
- package/page/section-bar/SectionBar.d.ts +10 -3
- package/page/section-bar/SectionBar.d.ts.map +1 -1
- package/page/section-bar/SectionBar.js +21 -11
- package/page/section-bar/SectionBar.js.map +1 -1
- package/page/section-bar/section-bar.module.css +43 -46
- package/page/section-divider/SectionDivider.d.ts +2 -2
- package/page/section-divider/SectionDivider.js +4 -4
- package/page/section-divider/SectionDivider.js.map +1 -1
- package/page/section-divider/section-divider.module.css +18 -18
- package/page/section-header/SectionHeader.d.ts +7 -7
- package/page/section-header/SectionHeader.d.ts.map +1 -1
- package/page/section-header/SectionHeader.js +3 -3
- package/page/section-header/SectionHeader.js.map +1 -1
- package/page/section-header/section-header.module.css +16 -16
- package/utils/Ornament.d.ts +1 -1
- package/utils/Ornament.js +2 -2
- package/utils/assignRef.d.ts +7 -1
- package/utils/assignRef.d.ts.map +1 -1
- package/utils/assignRef.js +18 -0
- package/utils/assignRef.js.map +1 -1
- package/utils/docs/DemoTitle.d.ts +12 -0
- package/utils/docs/DemoTitle.d.ts.map +1 -0
- package/utils/docs/DemoTitle.js +11 -0
- package/utils/docs/DemoTitle.js.map +1 -0
- package/utils/docs/Pre.d.ts +39 -0
- package/utils/docs/Pre.d.ts.map +1 -0
- package/utils/docs/Pre.js +26 -0
- package/utils/docs/Pre.js.map +1 -0
- package/utils/docs/createDemo.d.ts +89 -0
- package/utils/docs/createDemo.d.ts.map +1 -0
- package/utils/docs/createDemo.js +51 -0
- package/utils/docs/createDemo.js.map +1 -0
- package/utils/docs/createMdxComponents.d.ts +52 -0
- package/utils/docs/createMdxComponents.d.ts.map +1 -0
- package/utils/docs/createMdxComponents.js +59 -0
- package/utils/docs/createMdxComponents.js.map +1 -0
- package/utils/docs/createTypes.d.ts +23 -0
- package/utils/docs/createTypes.d.ts.map +1 -0
- package/utils/docs/createTypes.js +27 -0
- package/utils/docs/createTypes.js.map +1 -0
- package/utils/docs/index.d.ts +8 -0
- package/utils/docs/index.d.ts.map +1 -0
- package/utils/docs/index.js +16 -0
- package/utils/docs/index.js.map +1 -0
- package/utils/docs/mdx.module.css +201 -0
- package/utils/docs/serverSourceEnhancers.d.ts +26 -0
- package/utils/docs/serverSourceEnhancers.d.ts.map +1 -0
- package/utils/docs/serverSourceEnhancers.js +32 -0
- package/utils/docs/serverSourceEnhancers.js.map +1 -0
- package/utils/docs/toSidebarItems.d.ts +23 -0
- package/utils/docs/toSidebarItems.d.ts.map +1 -0
- package/utils/docs/toSidebarItems.js +36 -0
- package/utils/docs/toSidebarItems.js.map +1 -0
- package/utils/font-fallbacks.css +176 -0
- package/utils/fonts.d.ts +1 -0
- package/utils/fonts.d.ts.map +1 -1
- package/utils/fonts.js +12 -0
- package/utils/fonts.js.map +1 -1
- package/utils/frame.d.ts +4 -0
- package/utils/frame.d.ts.map +1 -0
- package/utils/frame.js +11 -0
- package/utils/frame.js.map +1 -0
- package/utils/global.css +480 -266
- package/utils/line.module.css +17 -17
- package/utils/media.css +1 -1
- package/utils/ornament.module.css +19 -19
- package/utils/overlay.d.ts +4 -4
- package/utils/overlay.js +4 -4
- package/utils/pattern.module.css +45 -45
- package/utils/print.css +48 -34
- package/utils/reset.css +9 -2
- package/utils/roles.css +29 -29
- package/utils/seriesPatterns.js +3 -3
- package/utils/syntax.module.css +92 -0
- package/utils/theme.css +6 -6
- package/utils/tokens.css +262 -192
- package/utils/tokens.d.ts +51 -8
- package/utils/tokens.d.ts.map +1 -1
- package/utils/tokens.js +46 -9
- package/utils/tokens.js.map +1 -1
- package/utils/type.module.css +87 -87
- package/utils/useReleaseMark.d.ts +13 -0
- package/utils/useReleaseMark.d.ts.map +1 -0
- package/utils/useReleaseMark.js +44 -0
- package/utils/useReleaseMark.js.map +1 -0
- package/utils/view-transitions.css +122 -0
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Popover as BasePopover } from '@base-ui/react/popover';
|
|
4
|
+
import { cva } from 'class-variance-authority';
|
|
5
|
+
import { Link } from '../../actions/link';
|
|
6
|
+
import { Icon, iconHost } from '../../foundations/icon';
|
|
7
|
+
import { OutlineMorphFrame, useOutlineMorph } from '../../foundations/outline-morph';
|
|
8
|
+
import { cx } from '../../utils/className';
|
|
9
|
+
import { OVERLAY_COLLISION_PADDING, OVERLAY_SIDE_OFFSET, OverlayScope, overlayAttributes, overlayScaleClassName, } from '../../utils/overlay';
|
|
10
|
+
import { primaryScaleVariants, secondaryScaleVariants } from '../../utils/scales';
|
|
11
|
+
import { useScopeAttributes } from '../../utils/scope';
|
|
12
|
+
import styles from './table-of-contents.module.css';
|
|
13
|
+
/*
|
|
14
|
+
* Table of Contents (§9.16) [D202, D203]: the page's "On this page" list,
|
|
15
|
+
* the docs layout's right column; and, as `kind="bar"`, the compact bar
|
|
16
|
+
* the layout pins at the top of the page below that column's threshold.
|
|
17
|
+
*
|
|
18
|
+
* Implementation (CSS Modules + CVA)
|
|
19
|
+
* - Module: table-of-contents.module.css; CVA function `tableOfContents`.
|
|
20
|
+
* - Axes: `kind` → list | bar → kindList, kindBar (the root: the nav, or
|
|
21
|
+
* the bar's box); `primary`, `secondary` → scales module classes.
|
|
22
|
+
* - Compound variants: none. Defaults: kind list; color axes none.
|
|
23
|
+
* - Color fallback: inherits the scope; the bar's panel is a portaled
|
|
24
|
+
* `white` overlay scope (§10.1).
|
|
25
|
+
* - States: entries are Link `kind="nav"` with `list`: `:hover` →
|
|
26
|
+
* --role-link-hover only (plus the underline where it is --primary12)
|
|
27
|
+
* [D181]; `aria-current="location"` (the section in view, `activeId`) →
|
|
28
|
+
* the --border-size-2-25 start-edge bar over the guide and weight 700,
|
|
29
|
+
* whose box every entry reserves, so scrollspy never rewraps a line;
|
|
30
|
+
* `:focus-visible` → the ring, inset inside the row. Bar trigger:
|
|
31
|
+
* `:hover` → the field edge steps to --primary12 [D140];
|
|
32
|
+
* `data-popup-open` → the edge --primary12 and the chevron turned;
|
|
33
|
+
* `:focus-visible` → the ring. The panel opens and closes by the outline
|
|
34
|
+
* morph or at once [D205]; `data-outline-morph` → its edge takes its face
|
|
35
|
+
* while the morph draws the frame [D204].
|
|
36
|
+
* - Parts: base (the nav, or the bar's box), heading, list, item, link,
|
|
37
|
+
* label, labelText; the bar's trigger, barLabel, barTitle, barChevron,
|
|
38
|
+
* positioner, panel, panelScroll, visuallyHidden.
|
|
39
|
+
* - Scope: none; the panel declares the overlay's `white` scope.
|
|
40
|
+
* - Container: none; its host sets its width (the docs layout's column, or
|
|
41
|
+
* the page column for the bar).
|
|
42
|
+
* - Data: `items` is plain data ({ id, title, level }), the page's
|
|
43
|
+
* headings, so it can come from the docs engine (utils/docs, planned) or
|
|
44
|
+
* from the rendered page.
|
|
45
|
+
* - Outline morph [D204]: with `kind="bar"`, on by default (`morph={false}`
|
|
46
|
+
* opts out; `--fgd-outline-morph: none` for a subtree): the bar's ring
|
|
47
|
+
* or edge grows into the panel's frame and back
|
|
48
|
+
* (foundations/outline-morph), as the Select and the Section Bar's Jump
|
|
49
|
+
* to do.
|
|
50
|
+
*/
|
|
51
|
+
export const tableOfContents = cva(styles.base, {
|
|
52
|
+
variants: {
|
|
53
|
+
kind: {
|
|
54
|
+
list: styles.kindList,
|
|
55
|
+
bar: styles.kindBar,
|
|
56
|
+
},
|
|
57
|
+
// Color axes: never defaulted, so an omitted prop inherits the scope [D133].
|
|
58
|
+
primary: primaryScaleVariants,
|
|
59
|
+
secondary: secondaryScaleVariants,
|
|
60
|
+
},
|
|
61
|
+
defaultVariants: {
|
|
62
|
+
kind: 'list',
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
/** Provided by a host of the contents, such as the docs layout. */
|
|
66
|
+
export const TableOfContentsContext = React.createContext({});
|
|
67
|
+
TableOfContentsContext.displayName = 'TableOfContentsContext';
|
|
68
|
+
/** Nests the flat heading list: each entry under the nearest shallower one before it. */
|
|
69
|
+
function toTree(items) {
|
|
70
|
+
const roots = [];
|
|
71
|
+
const stack = [];
|
|
72
|
+
for (const item of items) {
|
|
73
|
+
const node = { item, children: [] };
|
|
74
|
+
while (stack.length > 0 && stack[stack.length - 1].item.level >= item.level)
|
|
75
|
+
stack.pop();
|
|
76
|
+
const parent = stack[stack.length - 1];
|
|
77
|
+
if (parent)
|
|
78
|
+
parent.children.push(node);
|
|
79
|
+
else
|
|
80
|
+
roots.push(node);
|
|
81
|
+
stack.push(node);
|
|
82
|
+
}
|
|
83
|
+
return roots;
|
|
84
|
+
}
|
|
85
|
+
/** The heading a followed entry lands on, made focusable (as the Section Bar's Jump list does). */
|
|
86
|
+
function headingFor(id) {
|
|
87
|
+
if (typeof document === 'undefined')
|
|
88
|
+
return null;
|
|
89
|
+
const target = document.getElementById(id);
|
|
90
|
+
if (target == null)
|
|
91
|
+
return null;
|
|
92
|
+
if (!target.hasAttribute('tabindex') && !target.matches('a[href], button, input, select, textarea')) {
|
|
93
|
+
target.setAttribute('tabindex', '-1');
|
|
94
|
+
}
|
|
95
|
+
return target;
|
|
96
|
+
}
|
|
97
|
+
/** The list: a `nav` named by its heading (or `aria-label`), over the nested `ol` of entries. */
|
|
98
|
+
function ContentsList(props) {
|
|
99
|
+
const { items, activeId, label, labelHidden, renderLink, onFollow, className, rootProps } = props;
|
|
100
|
+
const headingId = React.useId();
|
|
101
|
+
const tree = React.useMemo(() => toTree(items), [items]);
|
|
102
|
+
const renderNodes = (nodes) => (React.createElement("ol", { className: styles.list }, nodes.map(({ item, children }) => {
|
|
103
|
+
const href = `#${item.id}`;
|
|
104
|
+
return (React.createElement("li", { key: item.id, className: styles.item },
|
|
105
|
+
React.createElement(Link, { kind: "nav", list: true, href: href, render: renderLink?.(href), "aria-current": item.id === activeId ? 'location' : undefined, onClick: onFollow ? () => onFollow(item.id) : undefined, className: styles.link },
|
|
106
|
+
React.createElement("span", { className: styles.label, "data-label": item.title },
|
|
107
|
+
React.createElement("span", { className: styles.labelText }, item.title))),
|
|
108
|
+
children.length > 0 ? renderNodes(children) : null));
|
|
109
|
+
})));
|
|
110
|
+
return (React.createElement("nav", { ...rootProps, ...(labelHidden ? { 'aria-label': label } : { 'aria-labelledby': headingId }), className: className },
|
|
111
|
+
labelHidden ? null : (React.createElement("p", { id: headingId, className: styles.heading }, label)),
|
|
112
|
+
renderNodes(tree)));
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* The page's contents [D202, D203].
|
|
116
|
+
*
|
|
117
|
+
* `kind="list"` (default): a `nav` named by its caps heading (`type-label`)
|
|
118
|
+
* over an `ol` of in-page links in `type-caption`, H2s at the top level and
|
|
119
|
+
* H3 and H4 nested on the --role-hairline guide. The section in view
|
|
120
|
+
* (`activeId`) takes `aria-current="location"`, the --border-size-2-25
|
|
121
|
+
* start-edge bar and weight 700; every entry reserves that weight's box, so
|
|
122
|
+
* marking a section never moves the list.
|
|
123
|
+
*
|
|
124
|
+
* `kind="bar"`: one field-box line, "On this page" and the section in view
|
|
125
|
+
* (the first before scrollspy runs), truncated, with a chevron. It opens
|
|
126
|
+
* the same list in an anchored panel about a third of the viewport tall,
|
|
127
|
+
* scrolled inside so the section in view sits centered and marked, with
|
|
128
|
+
* focus on it; following an entry goes to its heading and closes the
|
|
129
|
+
* panel; Escape and an outside press close it and focus returns to the
|
|
130
|
+
* bar. The bar's ring or edge morphs into the panel's frame [D204].
|
|
131
|
+
*
|
|
132
|
+
* Presentational: pair it with `useActiveHeading` for scrollspy. The docs
|
|
133
|
+
* layout shows the list in a sticky column from --xl-n-above and the bar,
|
|
134
|
+
* pinned under the header, below. With no items it renders nothing. Hidden
|
|
135
|
+
* in print.
|
|
136
|
+
*/
|
|
137
|
+
export function TableOfContents(props) {
|
|
138
|
+
const { items, activeId, label = 'On this page', kind: kindProp, morph = true, renderLink, primary, secondary, className, ref, ...rest } = props;
|
|
139
|
+
const scope = useScopeAttributes();
|
|
140
|
+
const context = React.useContext(TableOfContentsContext);
|
|
141
|
+
const kind = kindProp ?? context.kind ?? 'list';
|
|
142
|
+
if (items.length === 0)
|
|
143
|
+
return null;
|
|
144
|
+
if (kind === 'bar') {
|
|
145
|
+
return (React.createElement(ContentsBar, { items: items, activeId: activeId, label: label, morph: morph, renderLink: renderLink, className: tableOfContents({ kind, primary, secondary, className }), scope: scope, rootRef: ref, rootProps: rest }));
|
|
146
|
+
}
|
|
147
|
+
return (React.createElement(ContentsList, { items: items, activeId: activeId, label: label, labelHidden: context.labelHidden ?? false, renderLink: renderLink, className: tableOfContents({ kind, primary, secondary, className }), rootProps: { ...rest, ...scope, ref } }));
|
|
148
|
+
}
|
|
149
|
+
/** `kind="bar"`: the one-line trigger and its anchored panel. */
|
|
150
|
+
function ContentsBar(props) {
|
|
151
|
+
const { items, activeId, label, morph, renderLink, className, scope, rootRef, rootProps } = props;
|
|
152
|
+
const [open, setOpen] = React.useState(false);
|
|
153
|
+
const refs = useOutlineMorph({ open, enabled: morph });
|
|
154
|
+
const panelId = React.useId();
|
|
155
|
+
const scrollRef = React.useRef(null);
|
|
156
|
+
const pendingFocus = React.useRef(null);
|
|
157
|
+
// Before scrollspy runs (and on the server), the first section.
|
|
158
|
+
const current = items.find((item) => item.id === activeId) ?? items[0];
|
|
159
|
+
const follow = React.useCallback((id) => {
|
|
160
|
+
pendingFocus.current = headingFor(id);
|
|
161
|
+
setOpen(false);
|
|
162
|
+
}, []);
|
|
163
|
+
return (React.createElement("div", { ...rootProps, ...scope, ref: rootRef, className: className },
|
|
164
|
+
React.createElement(BasePopover.Root, { open: open, onOpenChange: (next) => setOpen(next) },
|
|
165
|
+
React.createElement(BasePopover.Trigger, { ref: morph ? refs.sourceRef : undefined, "aria-controls": open ? panelId : undefined, className: cx(styles.trigger, iconHost) },
|
|
166
|
+
React.createElement("span", { className: styles.barLabel }, label),
|
|
167
|
+
React.createElement("span", { className: styles.visuallyHidden }, ": "),
|
|
168
|
+
React.createElement("span", { className: styles.barTitle }, current.title),
|
|
169
|
+
React.createElement(Icon, { name: "expand_more", weight: "interactive", className: styles.barChevron })),
|
|
170
|
+
React.createElement(BasePopover.Portal, null,
|
|
171
|
+
React.createElement(BasePopover.Positioner, { className: styles.positioner, side: "bottom", align: "start", sideOffset: OVERLAY_SIDE_OFFSET, collisionPadding: OVERLAY_COLLISION_PADDING },
|
|
172
|
+
React.createElement(BasePopover.Popup, { ref: morph ? refs.targetRef : undefined, id: panelId, ...overlayAttributes, "aria-label": label, className: cx(styles.panel, overlayScaleClassName), initialFocus: () => {
|
|
173
|
+
const scroller = scrollRef.current;
|
|
174
|
+
return (scroller?.querySelector('a[aria-current="location"]') ??
|
|
175
|
+
scroller?.querySelector('a[href]') ??
|
|
176
|
+
true);
|
|
177
|
+
}, finalFocus: () => {
|
|
178
|
+
const element = pendingFocus.current;
|
|
179
|
+
pendingFocus.current = null;
|
|
180
|
+
return element ?? true;
|
|
181
|
+
} },
|
|
182
|
+
React.createElement(OverlayScope, null,
|
|
183
|
+
React.createElement(PanelScroll, { scrollRef: scrollRef },
|
|
184
|
+
React.createElement(ContentsList, { items: items, activeId: current.id, label: label, labelHidden: true, renderLink: renderLink, onFollow: follow, className: cx(styles.base, styles.kindList) })))),
|
|
185
|
+
morph ? React.createElement(OutlineMorphFrame, { ref: refs.frameRef }) : null))),
|
|
186
|
+
React.createElement("span", { className: styles.visuallyHidden, "aria-live": "polite", "aria-atomic": "true" }, current.title)));
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* The panel's scroller. On mount it scrolls itself, never the page, so the
|
|
190
|
+
* section in view sits centered; the panel's height is final before it
|
|
191
|
+
* paints (its fallback cap), and a second pass a frame later follows the
|
|
192
|
+
* positioner's measured room.
|
|
193
|
+
*/
|
|
194
|
+
function PanelScroll({ scrollRef, children, }) {
|
|
195
|
+
React.useLayoutEffect(() => {
|
|
196
|
+
const center = () => {
|
|
197
|
+
const scroller = scrollRef.current;
|
|
198
|
+
const link = scroller?.querySelector('a[aria-current="location"]');
|
|
199
|
+
if (scroller == null || link == null)
|
|
200
|
+
return;
|
|
201
|
+
const box = scroller.getBoundingClientRect();
|
|
202
|
+
const target = link.getBoundingClientRect();
|
|
203
|
+
scroller.scrollTop += target.top - box.top - (box.height - target.height) / 2;
|
|
204
|
+
};
|
|
205
|
+
center();
|
|
206
|
+
const frame = window.requestAnimationFrame(center);
|
|
207
|
+
return () => window.cancelAnimationFrame(frame);
|
|
208
|
+
}, [scrollRef]);
|
|
209
|
+
return (React.createElement("div", { ref: scrollRef, className: styles.panelScroll }, children));
|
|
210
|
+
}
|
|
211
|
+
//# sourceMappingURL=TableOfContents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableOfContents.js","sourceRoot":"","sources":["../../src/navigation/table-of-contents/T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ACT,QAAQ,GAIT;IACC,KAAK,CAAC,eAAe,CAAC,GAAG,EAAE;QACzB,MAAM,MAAM,GAAG,GAAG,EAAE;YAClB,MAAM,QAAQ,GAAG,SAAS,CAAC,OAAO,CAAA;YAClC,MAAM,IAAI,GAAG,QAAQ,EAAE,aAAa,CAAc,4BAA4B,CAAC,CAAA;YAC/E,IAAI,QAAQ,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI;gBAAE,OAAM;YAC5C,MAAM,GAAG,GAAG,QAAQ,CAAC,qBAAqB,EAAE,CAAA;YAC5C,MAAM,MAAM,GAAG,IAAI,CAAC,qBAAqB,EAAE,CAAA;YAC3C,QAAQ,CAAC,SAAS,IAAI,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QAC/E,CAAC,CAAA;QACD,MAAM,EAAE,CAAA;QACR,MAAM,KAAK,GAAG,MAAM,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAA;QAClD,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAA;IACjD,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAA;IAEf,OAAO,CACL,6BAAK,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,WAAW,IAC/C,QAAQ,CACL,CACP,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/navigation/table-of-contents/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/navigation/table-of-contents/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA"}
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Table of Contents (§9.16). CVA function `tableOfContents` in
|
|
3
|
+
* TableOfContents.tsx.
|
|
4
|
+
*
|
|
5
|
+
* Parts: base (the nav, or the bar's box; `kindList`, `kindBar`), heading,
|
|
6
|
+
* list, item, link, label, labelText; the bar's trigger, barLabel,
|
|
7
|
+
* barTitle, barChevron, positioner, panel (the Popover Popup),
|
|
8
|
+
* panelScroll, visuallyHidden.
|
|
9
|
+
*
|
|
10
|
+
* Line-based [D202]: the entries hang on a --border-size-1 --role-hairline
|
|
11
|
+
* guide at the list's start edge, H3 and H4 one step in on their own
|
|
12
|
+
* guide; the section in view draws the --border-size-2-25 --primary12 bar
|
|
13
|
+
* over it, the current-item grammar of the drawer, tab strip and Jump list.
|
|
14
|
+
* No fills, no shadows. Colors are role variables only; there are no local
|
|
15
|
+
* custom properties.
|
|
16
|
+
*
|
|
17
|
+
* The bar (`kind="bar"`) [D203]: one §10.1 field-box line, fixed at
|
|
18
|
+
* --fgd-size-control-md with a --fgd-size-hit target, whose words never
|
|
19
|
+
* change its size (the title truncates). Its panel is the anchored overlay
|
|
20
|
+
* surface (§10.1): a portaled `white` scope, --primary1 face, --border-size-2
|
|
21
|
+
* --primary12 frame at --radius-2-25, a third of the viewport tall (at
|
|
22
|
+
* least --size-px-13, at most the room below the bar), scrolling natively
|
|
23
|
+
* inside a --size-px-1 inset, which keeps the scrollbar clear of the
|
|
24
|
+
* rounded corners (≥ 0.293 × the 6 px inner radius). With the outline
|
|
25
|
+
* morph (the default) the panel answers `data-outline-morph` [D204].
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/* Composition sits in top-level rules, outside the layers: Lightning CSS
|
|
29
|
+
* (Next.js with Turbopack) rejects `composes` inside @layer or any nesting.
|
|
30
|
+
* The composed classes keep their own layers. */
|
|
31
|
+
.heading {
|
|
32
|
+
composes: typeLabel from '../../utils/type.module.css';
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.link {
|
|
36
|
+
composes: typeCaption from '../../utils/type.module.css';
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.barLabel {
|
|
40
|
+
composes: typeLabel typeMuted from '../../utils/type.module.css';
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.barTitle {
|
|
44
|
+
composes: typeBodyUi from '../../utils/type.module.css';
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@layer base {
|
|
48
|
+
.base {
|
|
49
|
+
display: block;
|
|
50
|
+
min-inline-size: 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* The list (`kind="list"`, the default): a block in its column. */
|
|
54
|
+
.kindList {
|
|
55
|
+
display: block;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* The caps heading on a 44 px row, level with the sidebar's first group heading. */
|
|
59
|
+
.heading {
|
|
60
|
+
display: flex;
|
|
61
|
+
align-items: center;
|
|
62
|
+
min-block-size: var(--fgd-size-hit);
|
|
63
|
+
margin: 0;
|
|
64
|
+
color: var(--primary12);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.list {
|
|
68
|
+
margin: 0;
|
|
69
|
+
padding: 0;
|
|
70
|
+
list-style: none;
|
|
71
|
+
border-inline-start: var(--border-size-1) solid var(--role-hairline);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* H3 and H4: one step in, on their own guide. */
|
|
75
|
+
.list .list {
|
|
76
|
+
margin-inline-start: var(--size-px-3);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.item {
|
|
80
|
+
display: block;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/* An entry: type-caption at weight 400 on a 44 px row, --size-px-3 off the guide. */
|
|
84
|
+
.link {
|
|
85
|
+
position: relative;
|
|
86
|
+
display: flex;
|
|
87
|
+
align-items: center;
|
|
88
|
+
box-sizing: border-box;
|
|
89
|
+
min-block-size: var(--fgd-size-hit);
|
|
90
|
+
padding-block: var(--size-px-2);
|
|
91
|
+
padding-inline: var(--size-px-3) 0;
|
|
92
|
+
color: var(--primary12);
|
|
93
|
+
text-decoration-line: none;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/* The current bar, over the guide: a border, so it survives forced colors. */
|
|
97
|
+
.link::before {
|
|
98
|
+
content: '';
|
|
99
|
+
position: absolute;
|
|
100
|
+
inset-block: 0;
|
|
101
|
+
inset-inline-start: calc(-1 * var(--border-size-1));
|
|
102
|
+
border-inline-start: 0 solid var(--primary12);
|
|
103
|
+
pointer-events: none;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/*
|
|
107
|
+
* The label reserves its weight-700 box: a hidden copy of its words at
|
|
108
|
+
* --font-weight-7 (`data-label`) shares the one grid cell, so scrollspy
|
|
109
|
+
* never widens or rewraps an entry (no layout shift while scrolling).
|
|
110
|
+
*/
|
|
111
|
+
.label {
|
|
112
|
+
display: grid;
|
|
113
|
+
min-inline-size: 0;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.label::after {
|
|
117
|
+
content: attr(data-label);
|
|
118
|
+
grid-area: 1 / 1;
|
|
119
|
+
font-weight: var(--font-weight-7);
|
|
120
|
+
visibility: hidden;
|
|
121
|
+
pointer-events: none;
|
|
122
|
+
user-select: none;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.labelText {
|
|
126
|
+
grid-area: 1 / 1;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/* ── The bar (`kind="bar"`) ───────────────────────────────────────── */
|
|
130
|
+
|
|
131
|
+
.kindBar {
|
|
132
|
+
inline-size: 100%;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/*
|
|
136
|
+
* The trigger: the §10.1 field box, one line, --fgd-size-control-md tall
|
|
137
|
+
* with a --fgd-size-hit target; the label, a hairline, the section in view
|
|
138
|
+
* (truncated) and the chevron. Its size never depends on its words.
|
|
139
|
+
*/
|
|
140
|
+
.trigger {
|
|
141
|
+
position: relative;
|
|
142
|
+
display: flex;
|
|
143
|
+
align-items: center;
|
|
144
|
+
gap: var(--size-px-2);
|
|
145
|
+
box-sizing: border-box;
|
|
146
|
+
inline-size: 100%;
|
|
147
|
+
min-inline-size: 0;
|
|
148
|
+
block-size: var(--fgd-size-control-md);
|
|
149
|
+
margin: 0;
|
|
150
|
+
padding-block: 0;
|
|
151
|
+
padding-inline: var(--size-px-2-5) var(--size-px-2);
|
|
152
|
+
border: var(--border-size-1) solid var(--role-rule);
|
|
153
|
+
border-radius: var(--radius-1);
|
|
154
|
+
background: none;
|
|
155
|
+
color: var(--primary12);
|
|
156
|
+
text-align: start;
|
|
157
|
+
cursor: pointer;
|
|
158
|
+
appearance: none;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.trigger::after {
|
|
162
|
+
content: '';
|
|
163
|
+
position: absolute;
|
|
164
|
+
inset-inline: 0;
|
|
165
|
+
inset-block: calc((var(--fgd-size-control-md) - var(--fgd-size-hit)) / 2);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.barLabel {
|
|
169
|
+
flex: none;
|
|
170
|
+
padding-inline-end: var(--size-px-2);
|
|
171
|
+
border-inline-end: var(--border-size-1) solid var(--role-hairline);
|
|
172
|
+
white-space: nowrap;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.barTitle {
|
|
176
|
+
flex: 1 1 auto;
|
|
177
|
+
min-inline-size: 0;
|
|
178
|
+
overflow: hidden;
|
|
179
|
+
font-weight: var(--font-weight-6);
|
|
180
|
+
white-space: nowrap;
|
|
181
|
+
text-overflow: ellipsis;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/* The chevron: expand_more, inline tier; it turns while open, as the Select's [D166]. */
|
|
185
|
+
.barChevron {
|
|
186
|
+
flex: none;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.visuallyHidden {
|
|
190
|
+
position: absolute;
|
|
191
|
+
inline-size: var(--border-size-1);
|
|
192
|
+
block-size: var(--border-size-1);
|
|
193
|
+
margin: calc(-1 * var(--border-size-1));
|
|
194
|
+
padding: 0;
|
|
195
|
+
border: 0;
|
|
196
|
+
overflow: hidden;
|
|
197
|
+
clip-path: inset(50%);
|
|
198
|
+
white-space: nowrap;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/* Below 360 px the label drops from view to leave the title room; it stays in the name [D73]. */
|
|
202
|
+
@media (max-width: 359.98px) {
|
|
203
|
+
.barLabel {
|
|
204
|
+
position: absolute;
|
|
205
|
+
inline-size: var(--border-size-1);
|
|
206
|
+
block-size: var(--border-size-1);
|
|
207
|
+
margin: calc(-1 * var(--border-size-1));
|
|
208
|
+
padding: 0;
|
|
209
|
+
border: 0;
|
|
210
|
+
overflow: hidden;
|
|
211
|
+
clip-path: inset(50%);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/* The panel sits --fgd-popup-offset below the bar on --layer-3. */
|
|
216
|
+
.positioner {
|
|
217
|
+
z-index: var(--layer-3);
|
|
218
|
+
outline: 0;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/*
|
|
222
|
+
* The overlay face (§10.1): the bar's width, a third of the viewport tall
|
|
223
|
+
* with a --size-px-13 floor and the room below the bar as its ceiling
|
|
224
|
+
* (the fallback holds before the positioner measures, so the panel's
|
|
225
|
+
* height is final when it first paints and its list can be centered).
|
|
226
|
+
*/
|
|
227
|
+
.panel {
|
|
228
|
+
display: flex;
|
|
229
|
+
flex-direction: column;
|
|
230
|
+
box-sizing: border-box;
|
|
231
|
+
inline-size: min(var(--anchor-width, 100%), 100vw - 2 * var(--fgd-space-margin));
|
|
232
|
+
max-block-size: min(max(33svh, var(--size-px-13)), var(--available-height, 100dvh));
|
|
233
|
+
padding: var(--size-px-1);
|
|
234
|
+
border: var(--border-size-2) solid var(--primary12);
|
|
235
|
+
border-radius: var(--radius-2-25);
|
|
236
|
+
background-color: var(--primary1);
|
|
237
|
+
color: var(--primary12);
|
|
238
|
+
clip-path: inset(0);
|
|
239
|
+
outline: 0;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/* The native scrollbar, inset --size-px-1 from the frame's inner edge on every side. */
|
|
243
|
+
.panelScroll {
|
|
244
|
+
flex: 1 1 auto;
|
|
245
|
+
min-block-size: 0;
|
|
246
|
+
padding-block: var(--size-px-1);
|
|
247
|
+
padding-inline: var(--size-px-2);
|
|
248
|
+
overflow-y: auto;
|
|
249
|
+
overscroll-behavior: contain;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
253
|
+
.trigger {
|
|
254
|
+
transition-property: border-color;
|
|
255
|
+
transition-duration: var(--fgd-duration-quick);
|
|
256
|
+
transition-timing-function: var(--ease-out-3);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.barChevron {
|
|
260
|
+
transition: rotate var(--fgd-duration-quick) var(--ease-out-3);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
@layer compounds {
|
|
266
|
+
/* Entries fill their row: a block flex box, over Link's inline `nav` row. */
|
|
267
|
+
.link {
|
|
268
|
+
display: flex;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
@layer states {
|
|
273
|
+
.list .link:focus-visible {
|
|
274
|
+
outline: var(--border-size-2) solid var(--primary12);
|
|
275
|
+
outline-offset: calc(-1 * var(--border-size-2));
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/* The section in view: the --border-size-2-25 start-edge bar and weight 700 [D15]. */
|
|
279
|
+
.list .link[aria-current='location']::before {
|
|
280
|
+
border-inline-start-width: var(--border-size-2-25);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.list .link[aria-current='location'] {
|
|
284
|
+
font-weight: var(--font-weight-7);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/* The bar: the field edge steps to --primary12 on hover and while open [D140]. */
|
|
288
|
+
.trigger:hover,
|
|
289
|
+
.trigger[data-popup-open] {
|
|
290
|
+
border-color: var(--primary12);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.trigger[data-popup-open] .barChevron {
|
|
294
|
+
rotate: 180deg;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/* Focus: keyboard only, the ring the outline morph grows from [D45, D204]. */
|
|
298
|
+
.trigger:focus-visible {
|
|
299
|
+
outline: var(--border-size-2) solid var(--primary12);
|
|
300
|
+
outline-offset: var(--border-size-2);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/*
|
|
304
|
+
* Outline morph [D204] (`morph`, the default): while the overlay draws the
|
|
305
|
+
* frame, the panel's own edge takes its face. Without the morph the panel
|
|
306
|
+
* opens and closes at once [D205].
|
|
307
|
+
*/
|
|
308
|
+
.panel[data-outline-morph] {
|
|
309
|
+
border-color: var(--primary1);
|
|
310
|
+
transition: none;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
@layer print {
|
|
315
|
+
@media print {
|
|
316
|
+
/* Screen wayfinding: the document's own headings carry its structure (§7.7). */
|
|
317
|
+
.base,
|
|
318
|
+
.positioner {
|
|
319
|
+
display: none;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/** Options for useActiveHeading. */
|
|
3
|
+
export interface UseActiveHeadingOptions {
|
|
4
|
+
/**
|
|
5
|
+
* The scroll container the headings move in. Default: the viewport. Pass
|
|
6
|
+
* a ref when the content scrolls inside its own box (a panel, a demo).
|
|
7
|
+
*/
|
|
8
|
+
root?: React.RefObject<Element | null>;
|
|
9
|
+
/**
|
|
10
|
+
* Where a heading becomes current: the activation line's distance below
|
|
11
|
+
* the root's top edge, in `px` (`'80px'`) or as a percentage of the
|
|
12
|
+
* root's height (`'25%'`). Default `'25%'`: a heading is current once
|
|
13
|
+
* its top has passed the top quarter of the view, and stays current
|
|
14
|
+
* until the next one passes.
|
|
15
|
+
*/
|
|
16
|
+
line?: string;
|
|
17
|
+
/** `false` pauses the hook (it then returns `undefined`). Default `true`. */
|
|
18
|
+
enabled?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Scrollspy for a table of contents [D202]: the id of the heading whose
|
|
22
|
+
* section is in view, for `TableOfContents`' `activeId`. An
|
|
23
|
+
* IntersectionObserver watches the headings against a band from the root's
|
|
24
|
+
* top edge down to `line`; each time one crosses the line the hook takes
|
|
25
|
+
* the last heading above it (the first while none has passed, the last
|
|
26
|
+
* once the root is scrolled to its end). The heading a link just landed on
|
|
27
|
+
* (the URL's hash) stays current while it sits above the line, so a short
|
|
28
|
+
* section chosen from the contents is the one marked. A `scrollend` pass
|
|
29
|
+
* re-reads the positions after jumps that cross no line.
|
|
30
|
+
*
|
|
31
|
+
* It only reads layout and returns an id: nothing it drives changes size
|
|
32
|
+
* (the list reserves each entry's current weight), so it causes no layout
|
|
33
|
+
* shift. It returns `undefined` on the server and before the first
|
|
34
|
+
* observation, so the server HTML marks no section.
|
|
35
|
+
*/
|
|
36
|
+
export declare function useActiveHeading(ids: readonly string[], options?: UseActiveHeadingOptions): string | undefined;
|
|
37
|
+
//# sourceMappingURL=useActiveHeading.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useActiveHeading.d.ts","sourceRoot":"","sources":["../../src/navigation/table-of-contents/useActiveHeading.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,oCAAoC;AACpC,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC,CAAA;IACtC;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,6EAA6E;IAC7E,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAWD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,SAAS,MAAM,EAAE,EACtB,OAAO,GAAE,uBAA4B,GACpC,MAAM,GAAG,SAAS,CAoFpB"}
|