@thewhatmatters/wmds 0.4.9 → 0.4.28
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/CHANGELOG.md +303 -0
- package/CONSUMING.md +62 -1
- package/README.md +1 -1
- package/bin/wmds-check.mjs +47 -0
- package/dist/colors.css +92 -0
- package/dist/components/atoms/Badge/Badge.d.ts +13 -5
- package/dist/components/atoms/Badge/Badge.d.ts.map +1 -1
- package/dist/components/atoms/Badge/Badge.js +56 -48
- package/dist/components/atoms/Badge/badgeStyles.d.ts +15 -0
- package/dist/components/atoms/Badge/badgeStyles.d.ts.map +1 -1
- package/dist/components/atoms/Badge/badgeStyles.js +42 -20
- package/dist/components/atoms/Band/Band.d.ts +27 -0
- package/dist/components/atoms/Band/Band.d.ts.map +1 -0
- package/dist/components/atoms/Band/Band.js +22 -0
- package/dist/components/atoms/Band/bandStyles.d.ts +20 -0
- package/dist/components/atoms/Band/bandStyles.d.ts.map +1 -0
- package/dist/components/atoms/Band/bandStyles.js +23 -0
- package/dist/components/atoms/Button/Button.d.ts +1 -1
- package/dist/components/atoms/Button/Button.d.ts.map +1 -1
- package/dist/components/atoms/Button/Button.js +67 -48
- package/dist/components/atoms/Button/ButtonStatusButton.d.ts.map +1 -1
- package/dist/components/atoms/Button/ButtonStatusButton.js +12 -5
- package/dist/components/atoms/Button/buttonStatusMotion.d.ts.map +1 -1
- package/dist/components/atoms/Button/buttonStatusMotion.js +6 -1
- package/dist/components/atoms/Button/buttonStyles.d.ts +2 -2
- package/dist/components/atoms/Button/buttonStyles.d.ts.map +1 -1
- package/dist/components/atoms/Button/buttonStyles.js +16 -14
- package/dist/components/atoms/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/atoms/Checkbox/Checkbox.js +69 -68
- package/dist/components/atoms/Checkbox/checkboxStyles.d.ts +1 -1
- package/dist/components/atoms/Checkbox/checkboxStyles.d.ts.map +1 -1
- package/dist/components/atoms/Checkbox/checkboxStyles.js +1 -1
- package/dist/components/atoms/IconButton/IconButton.d.ts.map +1 -1
- package/dist/components/atoms/IconButton/IconButton.js +13 -12
- package/dist/components/atoms/IconButton/iconButtonStyles.d.ts +2 -2
- package/dist/components/atoms/IconButton/iconButtonStyles.d.ts.map +1 -1
- package/dist/components/atoms/IconButton/iconButtonStyles.js +1 -1
- package/dist/components/atoms/InlinePill/InlinePill.d.ts +42 -0
- package/dist/components/atoms/InlinePill/InlinePill.d.ts.map +1 -0
- package/dist/components/atoms/InlinePill/InlinePill.js +48 -0
- package/dist/components/atoms/InlinePill/inlinePillStyles.d.ts +27 -0
- package/dist/components/atoms/InlinePill/inlinePillStyles.d.ts.map +1 -0
- package/dist/components/atoms/InlinePill/inlinePillStyles.js +19 -0
- package/dist/components/atoms/Input/Input.d.ts +9 -4
- package/dist/components/atoms/Input/Input.d.ts.map +1 -1
- package/dist/components/atoms/Input/Input.js +59 -59
- package/dist/components/atoms/Input/inputShellStyles.d.ts +10 -4
- package/dist/components/atoms/Input/inputShellStyles.d.ts.map +1 -1
- package/dist/components/atoms/Input/inputShellStyles.js +40 -40
- package/dist/components/atoms/RiveHand/RiveHand.d.ts.map +1 -1
- package/dist/components/atoms/RiveHand/RiveHand.js +83 -81
- package/dist/components/atoms/Skeleton/skeletonStyles.js +1 -1
- package/dist/components/atoms/Switch/Switch.d.ts.map +1 -1
- package/dist/components/atoms/Switch/Switch.js +45 -44
- package/dist/components/atoms/Switch/switchStyles.d.ts +1 -1
- package/dist/components/atoms/Switch/switchStyles.d.ts.map +1 -1
- package/dist/components/atoms/Switch/switchStyles.js +1 -1
- package/dist/components/atoms/Table/Table.d.ts +54 -0
- package/dist/components/atoms/Table/Table.d.ts.map +1 -0
- package/dist/components/atoms/Table/Table.js +66 -0
- package/dist/components/atoms/Table/tableStyles.d.ts +18 -0
- package/dist/components/atoms/Table/tableStyles.d.ts.map +1 -0
- package/dist/components/atoms/Table/tableStyles.js +14 -0
- package/dist/components/atoms/TextArea/TextArea.d.ts +6 -0
- package/dist/components/atoms/TextArea/TextArea.d.ts.map +1 -1
- package/dist/components/atoms/TextArea/TextArea.js +86 -78
- package/dist/components/atoms/TextArea/textareaShellStyles.d.ts +2 -2
- package/dist/components/atoms/TextArea/textareaShellStyles.d.ts.map +1 -1
- package/dist/components/atoms/TextArea/textareaShellStyles.js +5 -5
- package/dist/components/molecules/Accordion/accordionStyles.d.ts +1 -1
- package/dist/components/molecules/Accordion/accordionStyles.d.ts.map +1 -1
- package/dist/components/molecules/Accordion/accordionStyles.js +1 -1
- package/dist/components/molecules/Breadcrumb/Breadcrumb.d.ts.map +1 -1
- package/dist/components/molecules/Breadcrumb/Breadcrumb.js +80 -122
- package/dist/components/molecules/Card/Card.d.ts +28 -6
- package/dist/components/molecules/Card/Card.d.ts.map +1 -1
- package/dist/components/molecules/Card/Card.js +83 -42
- package/dist/components/molecules/Card/cardStyles.d.ts +16 -1
- package/dist/components/molecules/Card/cardStyles.d.ts.map +1 -1
- package/dist/components/molecules/Card/cardStyles.js +19 -5
- package/dist/components/molecules/ChatQa/chatQaStyles.d.ts +1 -1
- package/dist/components/molecules/ChatQa/chatQaStyles.d.ts.map +1 -1
- package/dist/components/molecules/ChatQa/chatQaStyles.js +1 -1
- package/dist/components/molecules/Chip/chipStyles.js +9 -9
- package/dist/components/molecules/CopyField/CopyField.d.ts +41 -0
- package/dist/components/molecules/CopyField/CopyField.d.ts.map +1 -0
- package/dist/components/molecules/CopyField/CopyField.js +120 -0
- package/dist/components/molecules/CopyField/copyFieldStyles.d.ts +28 -0
- package/dist/components/molecules/CopyField/copyFieldStyles.d.ts.map +1 -0
- package/dist/components/molecules/CopyField/copyFieldStyles.js +7 -0
- package/dist/components/molecules/DisplayControls/DisplayControls.d.ts +16 -7
- package/dist/components/molecules/DisplayControls/DisplayControls.d.ts.map +1 -1
- package/dist/components/molecules/DisplayControls/DisplayControls.js +41 -39
- package/dist/components/molecules/DisplayControls/displayControlsState.d.ts +21 -0
- package/dist/components/molecules/DisplayControls/displayControlsState.d.ts.map +1 -1
- package/dist/components/molecules/DisplayControls/displayControlsState.js +46 -4
- package/dist/components/molecules/Dropdown/Dropdown.d.ts +1 -1
- package/dist/components/molecules/Dropdown/DropdownItem.d.ts +2 -2
- package/dist/components/molecules/Dropdown/DropdownItem.d.ts.map +1 -1
- package/dist/components/molecules/Dropdown/DropdownItem.js +30 -27
- package/dist/components/molecules/Dropdown/dropdownStyles.js +1 -1
- package/dist/components/molecules/Dropdown/resolveOverflow.d.ts +14 -0
- package/dist/components/molecules/Dropdown/resolveOverflow.d.ts.map +1 -0
- package/dist/components/{organisms/Tab/tabOverflow.js → molecules/Dropdown/resolveOverflow.js} +2 -2
- package/dist/components/molecules/Dropdown/useDropdownMenu.d.ts +70 -0
- package/dist/components/molecules/Dropdown/useDropdownMenu.d.ts.map +1 -0
- package/dist/components/molecules/Dropdown/useDropdownMenu.js +155 -0
- package/dist/components/molecules/Dropdown/useOverflowMenu.d.ts +71 -0
- package/dist/components/molecules/Dropdown/useOverflowMenu.d.ts.map +1 -0
- package/dist/components/molecules/Dropdown/useOverflowMenu.js +61 -0
- package/dist/components/molecules/Field/Field.d.ts.map +1 -1
- package/dist/components/molecules/Field/Field.js +11 -10
- package/dist/components/molecules/LogView/LogView.d.ts +31 -0
- package/dist/components/molecules/LogView/LogView.d.ts.map +1 -0
- package/dist/components/molecules/LogView/LogView.js +109 -0
- package/dist/components/molecules/LogView/logViewStyles.d.ts +11 -0
- package/dist/components/molecules/LogView/logViewStyles.d.ts.map +1 -0
- package/dist/components/molecules/LogView/logViewStyles.js +6 -0
- package/dist/components/molecules/NavList/NavList.d.ts +23 -4
- package/dist/components/molecules/NavList/NavList.d.ts.map +1 -1
- package/dist/components/molecules/NavList/NavList.js +65 -52
- package/dist/components/molecules/NavList/navListStyles.d.ts +2 -0
- package/dist/components/molecules/NavList/navListStyles.d.ts.map +1 -1
- package/dist/components/molecules/NavList/navListStyles.js +3 -3
- package/dist/components/molecules/PageHeader/PageHeader.js +3 -3
- package/dist/components/molecules/PillGroup/pillGroupStyles.js +1 -1
- package/dist/components/molecules/Search/searchStyles.js +1 -1
- package/dist/components/molecules/SegmentedControl/segmentedControlStyles.d.ts +1 -1
- package/dist/components/molecules/SegmentedControl/segmentedControlStyles.d.ts.map +1 -1
- package/dist/components/molecules/SegmentedControl/segmentedControlStyles.js +8 -8
- package/dist/components/molecules/Select/Select.d.ts +3 -1
- package/dist/components/molecules/Select/Select.d.ts.map +1 -1
- package/dist/components/molecules/Select/Select.js +75 -119
- package/dist/components/molecules/Select/selectStyles.js +3 -3
- package/dist/components/molecules/Stat/Stat.d.ts +31 -5
- package/dist/components/molecules/Stat/Stat.d.ts.map +1 -1
- package/dist/components/molecules/Stat/Stat.js +83 -49
- package/dist/components/molecules/Stat/statStyles.d.ts +24 -4
- package/dist/components/molecules/Stat/statStyles.d.ts.map +1 -1
- package/dist/components/molecules/Stat/statStyles.js +30 -13
- package/dist/components/molecules/TaskRows/TaskRows.d.ts +13 -3
- package/dist/components/molecules/TaskRows/TaskRows.d.ts.map +1 -1
- package/dist/components/molecules/TaskRows/TaskRows.js +81 -57
- package/dist/components/molecules/TaskRows/TaskRowsTable.d.ts +54 -0
- package/dist/components/molecules/TaskRows/TaskRowsTable.d.ts.map +1 -0
- package/dist/components/molecules/TaskRows/TaskRowsTable.js +200 -0
- package/dist/components/molecules/TaskRows/taskRowsStyles.d.ts +19 -1
- package/dist/components/molecules/TaskRows/taskRowsStyles.d.ts.map +1 -1
- package/dist/components/molecules/TaskRows/taskRowsStyles.js +7 -3
- package/dist/components/molecules/TextSequence/TextSequence.d.ts.map +1 -1
- package/dist/components/molecules/TextSequence/TextSequence.js +35 -35
- package/dist/components/organisms/AppShell/AppShell.d.ts +84 -0
- package/dist/components/organisms/AppShell/AppShell.d.ts.map +1 -0
- package/dist/components/organisms/AppShell/AppShell.js +231 -0
- package/dist/components/organisms/AppShell/appShellStyles.d.ts +20 -0
- package/dist/components/organisms/AppShell/appShellStyles.d.ts.map +1 -0
- package/dist/components/organisms/AppShell/appShellStyles.js +8 -0
- package/dist/components/organisms/Carousel/Carousel.d.ts +9 -1
- package/dist/components/organisms/Carousel/Carousel.d.ts.map +1 -1
- package/dist/components/organisms/Carousel/Carousel.js +220 -182
- package/dist/components/organisms/Carousel/carouselMath.d.ts +5 -0
- package/dist/components/organisms/Carousel/carouselMath.d.ts.map +1 -1
- package/dist/components/organisms/Carousel/carouselMath.js +9 -1
- package/dist/components/organisms/Carousel/carouselStyles.d.ts +2 -0
- package/dist/components/organisms/Carousel/carouselStyles.d.ts.map +1 -1
- package/dist/components/organisms/Carousel/carouselStyles.js +8 -7
- package/dist/components/organisms/Chart/Chart.d.ts +5 -1
- package/dist/components/organisms/Chart/Chart.d.ts.map +1 -1
- package/dist/components/organisms/Chart/Chart.js +126 -62
- package/dist/components/organisms/Chart/ChartLegend.d.ts +8 -1
- package/dist/components/organisms/Chart/ChartLegend.d.ts.map +1 -1
- package/dist/components/organisms/Chart/ChartLegend.js +43 -13
- package/dist/components/organisms/Chart/ChartSegmentedRing.d.ts +52 -0
- package/dist/components/organisms/Chart/ChartSegmentedRing.d.ts.map +1 -0
- package/dist/components/organisms/Chart/ChartSegmentedRing.js +95 -0
- package/dist/components/organisms/Chart/chartStyles.d.ts +32 -0
- package/dist/components/organisms/Chart/chartStyles.d.ts.map +1 -1
- package/dist/components/organisms/Chart/chartStyles.js +15 -3
- package/dist/components/organisms/ChatDock/ChatDock.d.ts.map +1 -1
- package/dist/components/organisms/ChatDock/ChatDock.js +29 -25
- package/dist/components/organisms/Dialog/AlertDialog.d.ts +7 -1
- package/dist/components/organisms/Dialog/AlertDialog.d.ts.map +1 -1
- package/dist/components/organisms/Dialog/AlertDialog.js +54 -50
- package/dist/components/organisms/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/organisms/Dialog/Dialog.js +52 -71
- package/dist/components/organisms/Dialog/OverlayPanelHeader.d.ts.map +1 -1
- package/dist/components/organisms/Dialog/OverlayPanelHeader.js +1 -0
- package/dist/components/organisms/Dialog/dialogStyles.d.ts +14 -1
- package/dist/components/organisms/Dialog/dialogStyles.d.ts.map +1 -1
- package/dist/components/organisms/Dialog/dialogStyles.js +3 -3
- package/dist/components/organisms/FilterPanel/FilterPanel.d.ts.map +1 -1
- package/dist/components/organisms/FilterPanel/FilterPanel.js +52 -42
- package/dist/components/organisms/IntakeModal/IntakeModal.d.ts +6 -1
- package/dist/components/organisms/IntakeModal/IntakeModal.d.ts.map +1 -1
- package/dist/components/organisms/IntakeModal/IntakeModal.js +54 -66
- package/dist/components/organisms/MoreMenu/MoreMenu.d.ts.map +1 -1
- package/dist/components/organisms/MoreMenu/MoreMenu.js +45 -101
- package/dist/components/organisms/Panel/Panel.d.ts.map +1 -1
- package/dist/components/organisms/Panel/Panel.js +44 -53
- package/dist/components/organisms/Sheet/Sheet.d.ts +3 -1
- package/dist/components/organisms/Sheet/Sheet.d.ts.map +1 -1
- package/dist/components/organisms/Sheet/Sheet.js +66 -81
- package/dist/components/organisms/Sheet/sheetStyles.d.ts +8 -2
- package/dist/components/organisms/Sheet/sheetStyles.d.ts.map +1 -1
- package/dist/components/organisms/Sheet/sheetStyles.js +16 -11
- package/dist/components/organisms/SiteNav/SiteNav.d.ts +0 -9
- package/dist/components/organisms/SiteNav/SiteNav.d.ts.map +1 -1
- package/dist/components/organisms/SiteNav/SiteNav.js +236 -286
- package/dist/components/organisms/SiteNav/siteNavStyles.js +1 -1
- package/dist/components/organisms/Tab/Tab.d.ts.map +1 -1
- package/dist/components/organisms/Tab/Tab.js +77 -127
- package/dist/components/organisms/Tab/tabStyles.d.ts +2 -1
- package/dist/components/organisms/Tab/tabStyles.d.ts.map +1 -1
- package/dist/components/organisms/Tab/tabStyles.js +7 -7
- package/dist/fonts.css +10 -0
- package/dist/grid.css +38 -0
- package/dist/index.d.ts +16 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +152 -139
- package/dist/lib/chartTheme.d.ts +11 -0
- package/dist/lib/chartTheme.d.ts.map +1 -1
- package/dist/lib/compositionAudit.d.ts.map +1 -1
- package/dist/lib/contrast.d.ts +11 -0
- package/dist/lib/contrast.d.ts.map +1 -0
- package/dist/lib/dialogOverlay.d.ts +34 -1
- package/dist/lib/dialogOverlay.d.ts.map +1 -1
- package/dist/lib/dialogOverlay.js +100 -23
- package/dist/lib/sheetParam/index.d.ts +3 -0
- package/dist/lib/sheetParam/index.d.ts.map +1 -0
- package/dist/lib/sheetParam/sheetParam.d.ts +15 -0
- package/dist/lib/sheetParam/sheetParam.d.ts.map +1 -0
- package/dist/lib/sheetParam/sheetParam.js +26 -0
- package/dist/lib/sheetParam/useSheetParam.d.ts +25 -0
- package/dist/lib/sheetParam/useSheetParam.d.ts.map +1 -0
- package/dist/lib/sheetParam/useSheetParam.js +29 -0
- package/dist/lib/typography.d.ts +1 -1
- package/dist/lib/typography.d.ts.map +1 -1
- package/dist/shape.css +24 -3
- package/dist/styles.css +1 -1
- package/dist/typography.css +55 -8
- package/docs/README.md +1 -1
- package/docs/component-contracts.md +101 -0
- package/docs/components.md +19 -12
- package/docs/exports.json +142 -15
- package/docs/patterns/components-accordion--flush.tsx +1 -1
- package/docs/patterns/components-appshell--portal-dashboard-pattern.tsx +176 -0
- package/docs/patterns/components-avatar--dropdown-row.tsx +1 -1
- package/docs/patterns/components-badge--outline-tags.tsx +1 -1
- package/docs/patterns/components-badge--status-pill.tsx +31 -0
- package/docs/patterns/components-badge--with-avatar.tsx +1 -1
- package/docs/patterns/components-band--page-in-bands.tsx +39 -0
- package/docs/patterns/components-breadcrumb--editorial.tsx +1 -1
- package/docs/patterns/components-breadcrumb--long-path.tsx +1 -1
- package/docs/patterns/components-breadcrumb--path.tsx +1 -1
- package/docs/patterns/components-breadcrumb--router-links.tsx +1 -1
- package/docs/patterns/components-button-button--copy-button.tsx +1 -1
- package/docs/patterns/components-button-button--destructive-action.tsx +1 -1
- package/docs/patterns/components-button-button--external-link.tsx +1 -1
- package/docs/patterns/components-button-button--ghost-action.tsx +1 -1
- package/docs/patterns/components-button-button--inverse-action.tsx +1 -1
- package/docs/patterns/components-button-button--link-render.tsx +1 -1
- package/docs/patterns/components-button-button--multi-state-badge.tsx +1 -1
- package/docs/patterns/components-button-button--outline-mono.tsx +1 -1
- package/docs/patterns/components-button-button--primary-action.tsx +1 -1
- package/docs/patterns/components-button-button--row-hug.tsx +1 -1
- package/docs/patterns/components-button-button--row-layout.tsx +1 -1
- package/docs/patterns/components-button-button--secondary-action.tsx +1 -1
- package/docs/patterns/components-button-button--suggestion-pills.tsx +1 -1
- package/docs/patterns/components-button-button--with-count.tsx +1 -1
- package/docs/patterns/components-button-button--with-icon.tsx +1 -1
- package/docs/patterns/components-button-floatingactionbutton--vertical-actions.tsx +1 -1
- package/docs/patterns/components-calembed--pattern-skip-in-footer.tsx +1 -1
- package/docs/patterns/components-card-card--body-slot-occupancy-history.tsx +1 -1
- package/docs/patterns/components-card-card--headerless-media.tsx +1 -1
- package/docs/patterns/components-card-card--outlined-layout.tsx +1 -1
- package/docs/patterns/components-card-card--pinned-height.tsx +1 -1
- package/docs/patterns/components-card-card--terminal-frame.tsx +48 -0
- package/docs/patterns/components-card-selectablecard--selectable-cards-pattern.tsx +1 -1
- package/docs/patterns/components-carousel--image-carousel.tsx +1 -1
- package/docs/patterns/components-chart--audience-activity-heatmap.tsx +1 -1
- package/docs/patterns/components-chart--cartesian-no-data-gaps.tsx +1 -1
- package/docs/patterns/components-chart--occupancy-history-in-card.tsx +1 -1
- package/docs/patterns/components-chart--occupancy-in-card.tsx +1 -1
- package/docs/patterns/components-chart--post-reach-distribution.tsx +1 -1
- package/docs/patterns/components-chart--ranked-audience-breakdown.tsx +1 -1
- package/docs/patterns/components-chart--revenue-by-line.tsx +68 -0
- package/docs/patterns/components-chart--segmented-ring-pattern.tsx +144 -0
- package/docs/patterns/components-chart--unit-grid-composition.tsx +1 -1
- package/docs/patterns/components-chatdock--pattern-chat-dock.tsx +1 -1
- package/docs/patterns/components-chatdock--pattern-start-project-gate.tsx +1 -1
- package/docs/patterns/components-chatqa--pattern-qa-with-reply.tsx +1 -1
- package/docs/patterns/components-checkbox-checkbox--default.tsx +1 -1
- package/docs/patterns/components-checkbox-checkbox--with-count.tsx +1 -1
- package/docs/patterns/components-checkbox-checkbox--with-description.tsx +1 -1
- package/docs/patterns/components-checkbox-checkboxgroup--default.tsx +1 -1
- package/docs/patterns/components-checkbox-checkboxgroup--option-counts.tsx +1 -1
- package/docs/patterns/components-copyfield--clipboard-blocked.tsx +9 -0
- package/docs/patterns/components-copyfield--copied.tsx +9 -0
- package/docs/patterns/components-copyfield--copy-key.tsx +9 -0
- package/docs/patterns/components-copyfield--on-navy.tsx +29 -0
- package/docs/patterns/components-descriptionlist--details.tsx +1 -1
- package/docs/patterns/components-descriptionlist--post-metadata.tsx +1 -1
- package/docs/patterns/components-dialog--alert-dialog-destructive.tsx +1 -1
- package/docs/patterns/components-dialog--alert-dialog-typed-confirmation.tsx +54 -0
- package/docs/patterns/components-dialog--default-dialog.tsx +1 -1
- package/docs/patterns/components-dialog--form-dialog.tsx +1 -1
- package/docs/patterns/components-displaycontrols--page-utilities.tsx +1 -1
- package/docs/patterns/components-displaycontrols--theme-switch.tsx +35 -0
- package/docs/patterns/components-field--horizontal-input.tsx +1 -1
- package/docs/patterns/components-field--horizontal-text-area.tsx +1 -1
- package/docs/patterns/components-field--multi-control.tsx +1 -1
- package/docs/patterns/components-filterpanel--panel.tsx +1 -1
- package/docs/patterns/components-footerreveal--marketing-hero-pattern.tsx +1 -1
- package/docs/patterns/components-footerreveal--marketing-hero-ruled-pattern.tsx +1 -1
- package/docs/patterns/components-footerreveal--marketing-hero-with-gallery-intro.tsx +1 -1
- package/docs/patterns/components-footerreveal--marketing-page-pattern.tsx +1 -1
- package/docs/patterns/components-footerreveal--ruled-grid-footer-pattern.tsx +1 -1
- package/docs/patterns/components-footerreveal--sequenced-marketing-hero.tsx +1 -1
- package/docs/patterns/components-herointro--two-line-intro.tsx +1 -1
- package/docs/patterns/components-herotilestack--marketing-hero-pattern.tsx +1 -1
- package/docs/patterns/components-herotilestack--marketing-hero-text-sequence.tsx +1 -1
- package/docs/patterns/components-herotilestack--marketing-hero-with-gallery-intro.tsx +1 -1
- package/docs/patterns/components-indexlist--post-index.tsx +1 -1
- package/docs/patterns/components-intakeconfirmation--booked-pattern.tsx +1 -1
- package/docs/patterns/components-intakeconfirmation--emailed-pattern.tsx +1 -1
- package/docs/patterns/components-intakeform--about-you-pattern.tsx +1 -1
- package/docs/patterns/components-intakeform--short-form-pattern.tsx +1 -1
- package/docs/patterns/components-intakemodal--intake-modal-pattern.tsx +1 -1
- package/docs/patterns/components-kbd--command-row.tsx +1 -1
- package/docs/patterns/components-kbd--numbered-choices.tsx +1 -1
- package/docs/patterns/components-kbd--shortcut.tsx +1 -1
- package/docs/patterns/components-linktile--resource-tile.tsx +1 -1
- package/docs/patterns/components-linktile--router-link.tsx +1 -1
- package/docs/patterns/components-logview--detail-pane.tsx +80 -0
- package/docs/patterns/components-logview--log-viewer.tsx +20 -0
- package/docs/patterns/components-moremenu--action-menu.tsx +1 -1
- package/docs/patterns/components-moremenu--in-card-header.tsx +1 -1
- package/docs/patterns/components-navlist--app-sidebar.tsx +118 -0
- package/docs/patterns/components-navlist--side-nav-settings.tsx +1 -1
- package/docs/patterns/components-pageheader--app-header-pattern.tsx +1 -1
- package/docs/patterns/components-pageheader--page-section-header.tsx +1 -1
- package/docs/patterns/components-pageheader--toolbar-header.tsx +1 -1
- package/docs/patterns/components-panel--end-detail-rail.tsx +1 -1
- package/docs/patterns/components-pillgroup--pill-group-pattern.tsx +1 -1
- package/docs/patterns/components-promptbar--pattern-prompt-bar.tsx +1 -1
- package/docs/patterns/components-prose--article-body.tsx +1 -1
- package/docs/patterns/components-radio-radiogroup--default.tsx +1 -1
- package/docs/patterns/components-scrollhorizontal--project-gallery-pattern.tsx +1 -1
- package/docs/patterns/components-scrollhorizontal--with-intro.tsx +1 -1
- package/docs/patterns/components-sectioncaption--column-caption.tsx +1 -1
- package/docs/patterns/components-sectioncaption--with-action.tsx +1 -1
- package/docs/patterns/components-sheet--bottom-sheet.tsx +1 -1
- package/docs/patterns/components-sheet--end-sheet.tsx +1 -1
- package/docs/patterns/components-sheet--side-sheet-header-actions.tsx +50 -0
- package/docs/patterns/components-sheet--side-sheet-url-deep-link.tsx +51 -0
- package/docs/patterns/components-sheet--side-sheet.tsx +38 -0
- package/docs/patterns/components-sitenav--brand-and-cta.tsx +1 -1
- package/docs/patterns/components-sitenav--centered-links.tsx +1 -1
- package/docs/patterns/components-sitenav--compact.tsx +1 -1
- package/docs/patterns/components-sitenav--marketing-header.tsx +1 -1
- package/docs/patterns/components-sitenav--mega-menu.tsx +1 -1
- package/docs/patterns/components-stat--hero-stat.tsx +54 -0
- package/docs/patterns/components-stat--insights-row.tsx +1 -1
- package/docs/patterns/components-stepprogress--step-progress-pattern.tsx +1 -1
- package/docs/patterns/components-switch--default.tsx +1 -1
- package/docs/patterns/components-switch--settings-row.tsx +1 -1
- package/docs/patterns/components-tab--settings-pages.tsx +1 -1
- package/docs/patterns/components-table--approvals-with-sheet.tsx +81 -0
- package/docs/patterns/components-table--approvals.tsx +223 -0
- package/docs/patterns/components-table--basic.tsx +60 -0
- package/docs/patterns/components-taskrows--action-details.tsx +1 -1
- package/docs/patterns/components-taskrows--capsules.tsx +1 -1
- package/docs/patterns/components-taskrows--card-with-status-rows.tsx +1 -1
- package/docs/patterns/components-taskrows--controlled-expand.tsx +1 -1
- package/docs/patterns/components-taskrows--custom-slots.tsx +1 -1
- package/docs/patterns/components-taskrows--needs-you-table.tsx +62 -0
- package/docs/patterns/components-taskrows--status-list.tsx +1 -1
- package/docs/patterns/components-taskrows--tag-chips.tsx +1 -1
- package/docs/patterns/components-textarea--save-status.tsx +32 -0
- package/docs/patterns/components-textlink--external-destination.tsx +1 -1
- package/docs/patterns/components-textlink--inline-prose.tsx +1 -1
- package/docs/patterns/components-textlink--quiet-title.tsx +1 -1
- package/docs/patterns/components-textlink--supporting-copy.tsx +1 -1
- package/docs/patterns/components-textsequence--default.tsx +1 -1
- package/docs/patterns/components-textsequence--reduced-motion.tsx +1 -1
- package/docs/patterns/components-textsequence--shapes.tsx +1 -1
- package/docs/patterns/components-tilegrid--masonry.tsx +1 -1
- package/docs/patterns/components-toast--stacked-notifications.tsx +1 -1
- package/docs/patterns/components-tooltip--controlled.tsx +1 -1
- package/docs/patterns/components-tooltip--disabled-control.tsx +1 -1
- package/docs/patterns/components-tooltip--icon-action.tsx +1 -1
- package/docs/patterns/components-tooltip--keyboard-shortcut.tsx +1 -1
- package/docs/patterns/components-tooltip--placement.tsx +1 -1
- package/docs/patterns/foundations-scroll-fade--horizontal-rail.tsx +1 -1
- package/docs/patterns/foundations-scroll-fade--overflowing-list.tsx +1 -1
- package/docs/patterns/guides-chart-explorations--comparison-gallery.tsx +1 -1
- package/docs/patterns/guides-filter-panel--filtered-grid.tsx +1 -1
- package/docs/patterns/guides-filter-panel--filtered-index.tsx +1 -1
- package/docs/patterns/guides-overlay-flows--notification-preferences.tsx +1 -1
- package/docs/patterns/guides-post-page--post-page.tsx +1 -1
- package/docs/patterns/guides-profile-typography--editorial-profile.tsx +1 -1
- package/docs/patterns/guides-resource-detail--detail.tsx +1 -1
- package/docs/patterns/index.json +193 -1
- package/package.json +1 -1
- package/dist/components/organisms/Tab/tabOverflow.d.ts +0 -14
- package/dist/components/organisms/Tab/tabOverflow.d.ts.map +0 -1
|
@@ -1,52 +1,55 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../../../lib/cn.js";
|
|
3
3
|
import { dropdownItemButtonClasses as t, dropdownItemEndClasses as n, dropdownItemLabelClasses as r, dropdownItemLabelFullClasses as i, dropdownItemSelectedCheckClasses as a, dropdownItemStartClasses as o } from "./dropdownStyles.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { forwardRef as s } from "react";
|
|
5
|
+
import { Check as c } from "lucide-react";
|
|
6
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
7
|
+
import { useRender as f } from "@base-ui/react/use-render";
|
|
7
8
|
//#region src/components/molecules/Dropdown/DropdownItem.tsx
|
|
8
|
-
|
|
9
|
-
let
|
|
9
|
+
var p = s(function({ children: s, start: f, end: p, selected: h = !1, active: g = !1, truncate: _ = !0, disabled: v, className: y, type: b = "button", render: x, ...S }, C) {
|
|
10
|
+
let w = h ? /* @__PURE__ */ u("span", {
|
|
10
11
|
className: a,
|
|
11
12
|
"aria-hidden": !0,
|
|
12
|
-
children: /* @__PURE__ */
|
|
13
|
-
}) :
|
|
13
|
+
children: /* @__PURE__ */ u(c, { strokeWidth: 2 })
|
|
14
|
+
}) : p == null ? null : /* @__PURE__ */ u("span", {
|
|
14
15
|
className: n,
|
|
15
|
-
children:
|
|
16
|
-
}),
|
|
17
|
-
f == null ? null : /* @__PURE__ */
|
|
16
|
+
children: p
|
|
17
|
+
}), T = e(t, h && !g && "hover:bg-transparent", g && "bg-accent-muted", v && "pointer-events-none opacity-50", y), E = /* @__PURE__ */ d(l, { children: [
|
|
18
|
+
f == null ? null : /* @__PURE__ */ u("span", {
|
|
18
19
|
className: o,
|
|
19
20
|
"aria-hidden": !0,
|
|
20
21
|
children: f
|
|
21
22
|
}),
|
|
22
|
-
/* @__PURE__ */
|
|
23
|
+
/* @__PURE__ */ u("span", {
|
|
23
24
|
className: _ ? r : i,
|
|
24
|
-
children:
|
|
25
|
+
children: s
|
|
25
26
|
}),
|
|
26
|
-
|
|
27
|
+
w
|
|
27
28
|
] });
|
|
28
|
-
return /* @__PURE__ */
|
|
29
|
+
return /* @__PURE__ */ u(m, {
|
|
29
30
|
...S,
|
|
31
|
+
elementRef: C,
|
|
30
32
|
render: x,
|
|
31
33
|
type: b,
|
|
32
34
|
disabled: v,
|
|
33
|
-
className:
|
|
34
|
-
children:
|
|
35
|
+
className: T,
|
|
36
|
+
children: E
|
|
35
37
|
});
|
|
36
|
-
}
|
|
37
|
-
function
|
|
38
|
-
return
|
|
39
|
-
render:
|
|
38
|
+
});
|
|
39
|
+
function m({ elementRef: e, render: t, type: n, disabled: r, ...i }) {
|
|
40
|
+
return f({
|
|
41
|
+
render: t,
|
|
42
|
+
ref: e,
|
|
40
43
|
defaultTagName: "button",
|
|
41
|
-
props:
|
|
42
|
-
...
|
|
43
|
-
"aria-disabled":
|
|
44
|
+
props: t ? {
|
|
45
|
+
...i,
|
|
46
|
+
"aria-disabled": r ? !0 : void 0
|
|
44
47
|
} : {
|
|
45
|
-
...
|
|
46
|
-
type:
|
|
47
|
-
disabled:
|
|
48
|
+
...i,
|
|
49
|
+
type: n,
|
|
50
|
+
disabled: r
|
|
48
51
|
}
|
|
49
52
|
});
|
|
50
53
|
}
|
|
51
54
|
//#endregion
|
|
52
|
-
export {
|
|
55
|
+
export { p as DropdownItem };
|
|
@@ -3,6 +3,6 @@ import { cn as e } from "../../../lib/cn.js";
|
|
|
3
3
|
import { typographyClass as t } from "../../../lib/typography.js";
|
|
4
4
|
import { motionTransition as n } from "../../../lib/motion.js";
|
|
5
5
|
//#region src/components/molecules/Dropdown/dropdownStyles.ts
|
|
6
|
-
var r = e("z-50 max-h-60 overflow-y-auto rounded-
|
|
6
|
+
var r = e("z-50 max-h-60 overflow-y-auto rounded-[var(--radius-surface)] border border-elevation-edge bg-surface p-0.5 shadow-soft-sm", n("fast")), i = "m-0 flex list-none flex-col gap-0.5 p-0", a = e(t("body"), "cursor-pointer items-center gap-2 rounded-[14px] px-3.5 py-2 text-left text-fg", "transition-[color,background-color] hover:bg-accent-muted focus-visible:outline-none focus-visible:bg-accent-muted", n("fast")), o = e(a, "flex w-full"), s = e(a, "inline-flex w-max max-w-none"), c = "bg-accent-muted", l = "pointer-events-none opacity-50", u = "flex shrink-0 items-center text-muted [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:stroke-current", d = "min-w-0 flex-1 truncate text-left", f = "min-w-0 flex-1 whitespace-nowrap text-left", p = e(t("body"), "whitespace-nowrap text-left"), m = e(t("caption"), "shrink-0 font-mono tabular-nums text-muted"), h = "flex shrink-0 items-center text-fg [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:stroke-current";
|
|
7
7
|
//#endregion
|
|
8
8
|
export { c as dropdownItemActiveClasses, o as dropdownItemButtonClasses, l as dropdownItemDisabledClasses, m as dropdownItemEndClasses, d as dropdownItemLabelClasses, f as dropdownItemLabelFullClasses, s as dropdownItemMeasureButtonClasses, p as dropdownItemMeasureLabelClasses, a as dropdownItemRowClasses, h as dropdownItemSelectedCheckClasses, u as dropdownItemStartClasses, r as dropdownMenuClasses, i as dropdownMenuListClasses };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface OverflowItem {
|
|
2
|
+
value: string;
|
|
3
|
+
width: number;
|
|
4
|
+
}
|
|
5
|
+
export interface OverflowResult {
|
|
6
|
+
visibleValues: string[];
|
|
7
|
+
overflowValues: string[];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Fits a stable prefix plus More. When the active item came from overflow, it
|
|
11
|
+
* occupies the final visible slot immediately before More. Shared by **Tab** and **SiteNav**.
|
|
12
|
+
*/
|
|
13
|
+
export declare function resolveOverflow(items: OverflowItem[], activeValue: string, availableWidth: number, moreWidth: number, trackInset?: number): OverflowResult;
|
|
14
|
+
//# sourceMappingURL=resolveOverflow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveOverflow.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/Dropdown/resolveOverflow.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,cAAc;IAC7B,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,YAAY,EAAE,EACrB,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,EACtB,SAAS,EAAE,MAAM,EACjB,UAAU,SAAI,GACb,cAAc,CA+ChB"}
|
package/dist/components/{organisms/Tab/tabOverflow.js → molecules/Dropdown/resolveOverflow.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
//#region src/components/
|
|
2
|
+
//#region src/components/molecules/Dropdown/resolveOverflow.ts
|
|
3
3
|
function e(e, t, n, r, i = 0) {
|
|
4
4
|
let a = Math.max(n - i, 0);
|
|
5
5
|
if (e.reduce((e, t) => e + t.width, 0) <= a) return {
|
|
@@ -23,4 +23,4 @@ function e(e, t, n, r, i = 0) {
|
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
//#endregion
|
|
26
|
-
export { e as
|
|
26
|
+
export { e as resolveOverflow };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { type CSSProperties, type FocusEvent, type KeyboardEvent, type RefObject } from "react";
|
|
2
|
+
export type DropdownMenuRow = {
|
|
3
|
+
label: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Where keyboard focus lives while the menu is open.
|
|
8
|
+
* - `trigger`: focus stays on the trigger, which names the active row with `aria-activedescendant`
|
|
9
|
+
* (a select-only combobox: **Select**).
|
|
10
|
+
* - `items`: focus moves onto the rows (roving focus: the menu-button pattern for action menus and
|
|
11
|
+
* menus of links). `aria-activedescendant` is not allowed on a `button`.
|
|
12
|
+
*/
|
|
13
|
+
export type DropdownMenuFocus = "trigger" | "items";
|
|
14
|
+
export type DropdownMenuOpenAt = "first" | "last" | "initial" | number;
|
|
15
|
+
export interface DropdownMenuOptions {
|
|
16
|
+
/** Rows in order. Labels drive type-ahead; disabled rows are skipped by the keyboard. */
|
|
17
|
+
rows: readonly DropdownMenuRow[];
|
|
18
|
+
/** The focusable trigger. Focus returns here on Escape. */
|
|
19
|
+
triggerRef: RefObject<HTMLElement | null>;
|
|
20
|
+
/** Positions the menu against the trigger (or a wider shell); called on open, scroll and resize. */
|
|
21
|
+
measure: () => CSSProperties | null;
|
|
22
|
+
focus: DropdownMenuFocus;
|
|
23
|
+
/** Row the menu opens on with `"initial"`: the selected option of a Select. Default: first enabled. */
|
|
24
|
+
initialIndex?: number;
|
|
25
|
+
/** `trigger` focus only: Enter or Space on the trigger chooses the active row. */
|
|
26
|
+
onChoose?: (index: number) => void;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Open state, dismissal, keyboard, and position for every WMDS dropdown menu (Select, MoreMenu,
|
|
30
|
+
* Breadcrumb, Tab and SiteNav More). Spread `rootProps` on an element that wraps the trigger and the
|
|
31
|
+
* menu (a portaled menu still counts: React events bubble through portals).
|
|
32
|
+
*
|
|
33
|
+
* Dismissal: Escape (handled here, `preventDefault` so an enclosing Dialog or Sheet stays open), a
|
|
34
|
+
* pointer press outside, focus leaving (Tab), and choosing a row. Scroll and resize reposition the menu.
|
|
35
|
+
*/
|
|
36
|
+
export declare function useDropdownMenu({ rows, triggerRef, measure, focus, initialIndex, onChoose, }: DropdownMenuOptions): {
|
|
37
|
+
open: boolean;
|
|
38
|
+
activeIndex: number;
|
|
39
|
+
menuStyle: CSSProperties | null;
|
|
40
|
+
openMenu: (at?: DropdownMenuOpenAt) => void;
|
|
41
|
+
close: ({ returnFocus }?: {
|
|
42
|
+
returnFocus?: boolean;
|
|
43
|
+
}) => void;
|
|
44
|
+
toggle: () => void;
|
|
45
|
+
rootProps: {
|
|
46
|
+
ref: (node: HTMLElement | null) => void;
|
|
47
|
+
onKeyDown: (event: KeyboardEvent<HTMLElement>) => void;
|
|
48
|
+
onBlur: (event: FocusEvent<HTMLElement>) => void;
|
|
49
|
+
};
|
|
50
|
+
triggerProps: {
|
|
51
|
+
"aria-expanded": boolean;
|
|
52
|
+
"aria-controls": string | undefined;
|
|
53
|
+
"aria-activedescendant": string | undefined;
|
|
54
|
+
};
|
|
55
|
+
menuProps: {
|
|
56
|
+
id: string;
|
|
57
|
+
ref: (node: HTMLElement | null) => void;
|
|
58
|
+
style: CSSProperties | undefined;
|
|
59
|
+
};
|
|
60
|
+
rowProps: (index: number) => {
|
|
61
|
+
id: string;
|
|
62
|
+
ref: (node: HTMLElement | null) => void;
|
|
63
|
+
tabIndex: number;
|
|
64
|
+
active: boolean;
|
|
65
|
+
onMouseEnter: () => void;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
/** The next enabled row from `from` in `direction`, wrapping; `from` itself if none is enabled. */
|
|
69
|
+
export declare function stepEnabled(rows: readonly DropdownMenuRow[], from: number, direction: 1 | -1): number;
|
|
70
|
+
//# sourceMappingURL=useDropdownMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDropdownMenu.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/Dropdown/useDropdownMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,MAAM,MAAM,eAAe,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAEpE;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,OAAO,CAAC;AAEpD,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;AAEvE,MAAM,WAAW,mBAAmB;IAClC,yFAAyF;IACzF,IAAI,EAAE,SAAS,eAAe,EAAE,CAAC;IACjC,2DAA2D;IAC3D,UAAU,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAC1C,oGAAoG;IACpG,OAAO,EAAE,MAAM,aAAa,GAAG,IAAI,CAAC;IACpC,KAAK,EAAE,iBAAiB,CAAC;IACzB,uGAAuG;IACvG,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kFAAkF;IAClF,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AAID;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,UAAU,EACV,OAAO,EACP,KAAK,EACL,YAAY,EACZ,QAAQ,GACT,EAAE,mBAAmB;;;;oBA8Bb,kBAAkB;8BASG;QAAE,WAAW,CAAC,EAAE,OAAO,CAAA;KAAE;;;oBA4IrC,WAAW,GAAG,IAAI;2BAzEJ,aAAa,CAAC,WAAW,CAAC;wBA6D7B,UAAU,CAAC,WAAW,CAAC;;;;;;;;;oBAyBlC,WAAW,GAAG,IAAI;;;sBAKd,MAAM;;oBAEV,WAAW,GAAG,IAAI;;;;;EAUnC;AAED,mGAAmG;AACnG,wBAAgB,WAAW,CAAC,IAAI,EAAE,SAAS,eAAe,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,CAQrG"}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback as e, useEffect as t, useId as n, useLayoutEffect as r, useRef as i, useState as a } from "react";
|
|
3
|
+
//#region src/components/molecules/Dropdown/useDropdownMenu.ts
|
|
4
|
+
var o = 500;
|
|
5
|
+
function s({ rows: s, triggerRef: l, measure: u, focus: d, initialIndex: f, onChoose: p }) {
|
|
6
|
+
let m = n(), h = i(null), g = i(null), _ = i([]), v = i({
|
|
7
|
+
text: "",
|
|
8
|
+
at: 0
|
|
9
|
+
}), [y, b] = a(!1), [x, S] = a(0), [C, w] = a(null), T = i(u);
|
|
10
|
+
t(() => {
|
|
11
|
+
T.current = u;
|
|
12
|
+
});
|
|
13
|
+
let E = e((e) => `${m}-row-${e}`, [m]), D = e((e) => typeof e == "number" ? e : e === "last" ? c(s, s.length, -1) : e === "initial" && f != null && f >= 0 && !s[f]?.disabled ? f : c(s, -1, 1), [f, s]), O = e((e = "initial") => {
|
|
14
|
+
w(T.current()), S(D(e)), b(!0);
|
|
15
|
+
}, [D]), k = e(({ returnFocus: e = !1 } = {}) => {
|
|
16
|
+
b(!1), w(null), v.current = {
|
|
17
|
+
text: "",
|
|
18
|
+
at: 0
|
|
19
|
+
}, e && l.current?.focus();
|
|
20
|
+
}, [l]), A = e(() => y ? k() : O(), [
|
|
21
|
+
k,
|
|
22
|
+
y,
|
|
23
|
+
O
|
|
24
|
+
]);
|
|
25
|
+
r(() => {
|
|
26
|
+
if (!y) return;
|
|
27
|
+
let e = () => w(T.current());
|
|
28
|
+
return window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), () => {
|
|
29
|
+
window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
|
|
30
|
+
};
|
|
31
|
+
}, [y]), t(() => {
|
|
32
|
+
if (!y) return;
|
|
33
|
+
function e(e) {
|
|
34
|
+
j(e.target) || k();
|
|
35
|
+
}
|
|
36
|
+
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
37
|
+
}), r(() => {
|
|
38
|
+
!y || d !== "items" || C == null || _.current[x]?.focus({ preventScroll: !0 });
|
|
39
|
+
}, [
|
|
40
|
+
x,
|
|
41
|
+
d,
|
|
42
|
+
C,
|
|
43
|
+
y
|
|
44
|
+
]), r(() => {
|
|
45
|
+
!y || d !== "trigger" || _.current[x]?.scrollIntoView?.({ block: "nearest" });
|
|
46
|
+
}, [
|
|
47
|
+
x,
|
|
48
|
+
d,
|
|
49
|
+
y
|
|
50
|
+
]);
|
|
51
|
+
function j(e) {
|
|
52
|
+
return e != null && (h.current?.contains(e) === !0 || g.current?.contains(e) === !0);
|
|
53
|
+
}
|
|
54
|
+
function M(e) {
|
|
55
|
+
let t = Date.now(), n = v.current;
|
|
56
|
+
n.text = t - n.at > o ? e : n.text + e, n.at = t;
|
|
57
|
+
let r = n.text.toLowerCase(), i = r.length > 1 && [...r].every((e) => e === r[0]), a = i ? r[0] : r, c = y ? x + (i || r.length === 1 ? 1 : 0) : 0;
|
|
58
|
+
for (let e = 0; e < s.length; e += 1) {
|
|
59
|
+
let t = (c + e) % s.length, n = s[t];
|
|
60
|
+
if (n != null && !n.disabled && n.label.toLowerCase().startsWith(a)) return t;
|
|
61
|
+
}
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
function N(e) {
|
|
65
|
+
if (e.nativeEvent.isComposing) return;
|
|
66
|
+
let { key: t } = e, n = t.length === 1 && t !== " " && !e.metaKey && !e.ctrlKey && !e.altKey, r = l.current?.contains(e.target) === !0;
|
|
67
|
+
if (!y) {
|
|
68
|
+
if (!r) return;
|
|
69
|
+
if (t === "ArrowDown" || t === "ArrowUp") e.preventDefault(), O(d === "trigger" ? "initial" : t === "ArrowDown" ? "first" : "last");
|
|
70
|
+
else if (d === "trigger" && (t === "Home" || t === "End")) e.preventDefault(), O(t === "Home" ? "first" : "last");
|
|
71
|
+
else if (d === "trigger" && (t === "Enter" || t === " ")) e.preventDefault(), O();
|
|
72
|
+
else if (d === "trigger" && n) {
|
|
73
|
+
let e = M(t);
|
|
74
|
+
e != null && O(e);
|
|
75
|
+
}
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
switch (t) {
|
|
79
|
+
case "Escape":
|
|
80
|
+
e.preventDefault(), k({ returnFocus: !0 });
|
|
81
|
+
return;
|
|
82
|
+
case "Tab":
|
|
83
|
+
k();
|
|
84
|
+
return;
|
|
85
|
+
case "ArrowDown":
|
|
86
|
+
case "ArrowUp":
|
|
87
|
+
e.preventDefault(), S((e) => c(s, e, t === "ArrowDown" ? 1 : -1));
|
|
88
|
+
return;
|
|
89
|
+
case "Home":
|
|
90
|
+
case "End":
|
|
91
|
+
e.preventDefault(), S(D(t === "Home" ? "first" : "last"));
|
|
92
|
+
return;
|
|
93
|
+
case "Enter":
|
|
94
|
+
case " ":
|
|
95
|
+
d === "trigger" ? (e.preventDefault(), s[x]?.disabled || p?.(x)) : t === " " && !r && (e.preventDefault(), _.current[x]?.click());
|
|
96
|
+
return;
|
|
97
|
+
default: if (n) {
|
|
98
|
+
let e = M(t);
|
|
99
|
+
e != null && S(e);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
function P(e) {
|
|
104
|
+
y && !j(e.relatedTarget) && k();
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
open: y,
|
|
108
|
+
activeIndex: x,
|
|
109
|
+
menuStyle: C,
|
|
110
|
+
openMenu: O,
|
|
111
|
+
close: k,
|
|
112
|
+
toggle: A,
|
|
113
|
+
rootProps: {
|
|
114
|
+
ref: (e) => {
|
|
115
|
+
h.current = e;
|
|
116
|
+
},
|
|
117
|
+
onKeyDown: N,
|
|
118
|
+
onBlur: P
|
|
119
|
+
},
|
|
120
|
+
triggerProps: {
|
|
121
|
+
"aria-expanded": y,
|
|
122
|
+
"aria-controls": y ? m : void 0,
|
|
123
|
+
"aria-activedescendant": d === "trigger" && y ? E(x) : void 0
|
|
124
|
+
},
|
|
125
|
+
menuProps: {
|
|
126
|
+
id: m,
|
|
127
|
+
ref: (e) => {
|
|
128
|
+
g.current = e;
|
|
129
|
+
},
|
|
130
|
+
style: C ?? void 0
|
|
131
|
+
},
|
|
132
|
+
rowProps: (e) => ({
|
|
133
|
+
id: E(e),
|
|
134
|
+
ref: (t) => {
|
|
135
|
+
_.current[e] = t;
|
|
136
|
+
},
|
|
137
|
+
tabIndex: -1,
|
|
138
|
+
active: e === x,
|
|
139
|
+
onMouseEnter: () => {
|
|
140
|
+
s[e]?.disabled || S(e);
|
|
141
|
+
}
|
|
142
|
+
})
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
function c(e, t, n) {
|
|
146
|
+
let r = e.length;
|
|
147
|
+
if (r === 0) return 0;
|
|
148
|
+
for (let i = 1; i <= r; i += 1) {
|
|
149
|
+
let a = ((t + n * i) % r + r) % r;
|
|
150
|
+
if (!e[a]?.disabled) return a;
|
|
151
|
+
}
|
|
152
|
+
return Math.min(Math.max(t, 0), r - 1);
|
|
153
|
+
}
|
|
154
|
+
//#endregion
|
|
155
|
+
export { c as stepEnabled, s as useDropdownMenu };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type DropdownMenuMeasureRow } from "./dropdownMenuPosition";
|
|
3
|
+
import { type DropdownMenuRow } from "./useDropdownMenu";
|
|
4
|
+
export interface OverflowMenuOptions {
|
|
5
|
+
/** Every item's stable id, in order. */
|
|
6
|
+
ids: readonly string[];
|
|
7
|
+
/** The current item: it stays visible, promoted into the last slot before More. */
|
|
8
|
+
activeId: string;
|
|
9
|
+
/** The More menu's rows for the items that don't fit (a SiteNav menu flattens into several). */
|
|
10
|
+
toMenuRows: (overflowIds: readonly string[]) => DropdownMenuRow[];
|
|
11
|
+
/** How to size the menu (slots, counts, a check). Default: the rows' labels. */
|
|
12
|
+
toMeasureRows?: (overflowIds: readonly string[]) => DropdownMenuMeasureRow[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A row of items that folds what doesn't fit into a More menu: **Tab** and **SiteNav**.
|
|
16
|
+
*
|
|
17
|
+
* Owns the measuring (an offscreen rail of every item plus More, a ResizeObserver on the row, a
|
|
18
|
+
* remeasure once fonts load), the fit ({@link resolveOverflow}), and the More menu's behaviour
|
|
19
|
+
* ({@link useDropdownMenu}, roving focus). Callers render their own items, More button, and rows.
|
|
20
|
+
*/
|
|
21
|
+
export declare function useOverflowMenu({ ids, activeId, toMenuRows, toMeasureRows }: OverflowMenuOptions): {
|
|
22
|
+
visibleIds: readonly string[];
|
|
23
|
+
overflowIds: readonly string[];
|
|
24
|
+
menuRows: DropdownMenuRow[];
|
|
25
|
+
menu: {
|
|
26
|
+
open: boolean;
|
|
27
|
+
activeIndex: number;
|
|
28
|
+
menuStyle: import("react").CSSProperties | null;
|
|
29
|
+
openMenu: (at?: import("./useDropdownMenu").DropdownMenuOpenAt) => void;
|
|
30
|
+
close: ({ returnFocus }?: {
|
|
31
|
+
returnFocus?: boolean;
|
|
32
|
+
}) => void;
|
|
33
|
+
toggle: () => void;
|
|
34
|
+
rootProps: {
|
|
35
|
+
ref: (node: HTMLElement | null) => void;
|
|
36
|
+
onKeyDown: (event: import("react").KeyboardEvent<HTMLElement>) => void;
|
|
37
|
+
onBlur: (event: import("react").FocusEvent<HTMLElement>) => void;
|
|
38
|
+
};
|
|
39
|
+
triggerProps: {
|
|
40
|
+
"aria-expanded": boolean;
|
|
41
|
+
"aria-controls": string | undefined;
|
|
42
|
+
"aria-activedescendant": string | undefined;
|
|
43
|
+
};
|
|
44
|
+
menuProps: {
|
|
45
|
+
id: string;
|
|
46
|
+
ref: (node: HTMLElement | null) => void;
|
|
47
|
+
style: import("react").CSSProperties | undefined;
|
|
48
|
+
};
|
|
49
|
+
rowProps: (index: number) => {
|
|
50
|
+
id: string;
|
|
51
|
+
ref: (node: HTMLElement | null) => void;
|
|
52
|
+
tabIndex: number;
|
|
53
|
+
active: boolean;
|
|
54
|
+
onMouseEnter: () => void;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
moreRef: import("react").RefObject<HTMLButtonElement | null>;
|
|
58
|
+
/** Spread on the element whose width the items share; it also wraps More and its menu. */
|
|
59
|
+
rowProps: {
|
|
60
|
+
ref: (node: HTMLElement | null) => void;
|
|
61
|
+
onKeyDown: (event: import("react").KeyboardEvent<HTMLElement>) => void;
|
|
62
|
+
onBlur: (event: import("react").FocusEvent<HTMLElement>) => void;
|
|
63
|
+
};
|
|
64
|
+
/** Ref for an item's copy in the offscreen measure rail. */
|
|
65
|
+
measureRef: (id: string) => (node: HTMLElement | null) => void;
|
|
66
|
+
/** Ref for More's copy in the offscreen measure rail. */
|
|
67
|
+
moreMeasureRef: (node: HTMLElement | null) => void;
|
|
68
|
+
};
|
|
69
|
+
/** Plain text of a label, for type-ahead in a More menu. */
|
|
70
|
+
export declare function textOf(node: ReactNode): string;
|
|
71
|
+
//# sourceMappingURL=useOverflowMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOverflowMenu.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/Dropdown/useOverflowMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACvG,OAAO,EAA4B,KAAK,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAE/F,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE1E,MAAM,WAAW,mBAAmB;IAClC,wCAAwC;IACxC,GAAG,EAAE,SAAS,MAAM,EAAE,CAAC;IACvB,mFAAmF;IACnF,QAAQ,EAAE,MAAM,CAAC;IACjB,gGAAgG;IAChG,UAAU,EAAE,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,KAAK,eAAe,EAAE,CAAC;IAClE,gFAAgF;IAChF,aAAa,CAAC,EAAE,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,KAAK,sBAAsB,EAAE,CAAC;CAC9E;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAE,EAAE,mBAAmB;;;;;;;;;;uBA0DR,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAtF,0FAA0F;;oBAG5E,WAAW,GAAG,IAAI;;;;IAKhC,4DAA4D;qBAC3C,MAAM,MAAM,MAAM,WAAW,GAAG,IAAI;IAIrD,yDAAyD;2BAClC,WAAW,GAAG,IAAI;EAI5C;AAED,4DAA4D;AAC5D,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAK9C"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { measureDropdownMenuStyle as e } from "./dropdownMenuPosition.js";
|
|
3
|
+
import { useDropdownMenu as t } from "./useDropdownMenu.js";
|
|
4
|
+
import { resolveOverflow as n } from "./resolveOverflow.js";
|
|
5
|
+
import { isValidElement as r, useCallback as i, useLayoutEffect as a, useRef as o, useState as s } from "react";
|
|
6
|
+
//#region src/components/molecules/Dropdown/useOverflowMenu.ts
|
|
7
|
+
function c({ ids: r, activeId: c, toMenuRows: l, toMeasureRows: u }) {
|
|
8
|
+
let d = o(null), f = o(null), p = o(null), m = o(/* @__PURE__ */ new Map()), [h, g] = s(r), [_, v] = s([]), y = l(_), b = t({
|
|
9
|
+
rows: y,
|
|
10
|
+
triggerRef: f,
|
|
11
|
+
focus: "items",
|
|
12
|
+
measure: () => f.current == null ? null : e(f.current, u?.(_) ?? y.map((e) => ({ label: e.label })), {
|
|
13
|
+
align: "end",
|
|
14
|
+
widthMode: "content"
|
|
15
|
+
})
|
|
16
|
+
}), { close: x } = b, S = r.join("\0"), C = i(() => {
|
|
17
|
+
let e = d.current, t = p.current;
|
|
18
|
+
if (e == null || t == null) return;
|
|
19
|
+
let r = S.split("\0").map((e) => ({
|
|
20
|
+
value: e,
|
|
21
|
+
width: Math.ceil(m.current.get(e)?.getBoundingClientRect().width ?? 0)
|
|
22
|
+
}));
|
|
23
|
+
if (r.some((e) => e.width === 0)) return;
|
|
24
|
+
let i = n(r, c, e.clientWidth, Math.ceil(t.getBoundingClientRect().width));
|
|
25
|
+
g(i.visibleValues), v(i.overflowValues), i.overflowValues.length === 0 && x();
|
|
26
|
+
}, [
|
|
27
|
+
c,
|
|
28
|
+
x,
|
|
29
|
+
S
|
|
30
|
+
]);
|
|
31
|
+
return a(() => {
|
|
32
|
+
C();
|
|
33
|
+
let e = d.current;
|
|
34
|
+
if (e == null) return;
|
|
35
|
+
let t = new ResizeObserver(C);
|
|
36
|
+
return t.observe(e), document.fonts?.ready.then(C), () => t.disconnect();
|
|
37
|
+
}, [C]), {
|
|
38
|
+
visibleIds: h,
|
|
39
|
+
overflowIds: _,
|
|
40
|
+
menuRows: y,
|
|
41
|
+
menu: b,
|
|
42
|
+
moreRef: f,
|
|
43
|
+
rowProps: {
|
|
44
|
+
...b.rootProps,
|
|
45
|
+
ref: (e) => {
|
|
46
|
+
d.current = e, b.rootProps.ref(e);
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
measureRef: (e) => (t) => {
|
|
50
|
+
t == null ? m.current.delete(e) : m.current.set(e, t);
|
|
51
|
+
},
|
|
52
|
+
moreMeasureRef: (e) => {
|
|
53
|
+
p.current = e;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
function l(e) {
|
|
58
|
+
return typeof e == "string" || typeof e == "number" ? String(e) : Array.isArray(e) ? e.map(l).join("") : r(e) ? l(e.props.children) : "";
|
|
59
|
+
}
|
|
60
|
+
//#endregion
|
|
61
|
+
export { l as textOf, c as useOverflowMenu };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/Field/Field.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,EAQL,KAAK,gBAAgB,EACtB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEzE,sEAAsE;AACtE,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC;AAE1C,MAAM,WAAW,UAAU;IACzB,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2CAA2C;IAC3C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+CAA+C;IAC/C,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,wEAAwE;IACxE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wFAAwF;IACxF,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,oBAAoB,CAAC;CAClC;AA8BD;;;GAGG;AACH,wBAAgB,KAAK,CAAC,EACpB,KAAK,EACL,WAAW,EACX,WAAwB,EACxB,OAAO,EACP,QAAgB,EAChB,QAAQ,EACR,SAAS,GACV,EAAE,UAAU,+
|
|
1
|
+
{"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/Field/Field.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,EAQL,KAAK,gBAAgB,EACtB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEzE,sEAAsE;AACtE,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC;AAE1C,MAAM,WAAW,UAAU;IACzB,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2CAA2C;IAC3C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+CAA+C;IAC/C,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,wEAAwE;IACxE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wFAAwF;IACxF,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,oBAAoB,CAAC;CAClC;AA8BD;;;GAGG;AACH,wBAAgB,KAAK,CAAC,EACpB,KAAK,EACL,WAAW,EACX,WAAwB,EACxB,OAAO,EACP,QAAgB,EAChB,QAAQ,EACR,SAAS,GACV,EAAE,UAAU,+BAsFZ"}
|
|
@@ -16,13 +16,13 @@ function _(e) {
|
|
|
16
16
|
let t = g(e.children);
|
|
17
17
|
t != null && t.props.label != null && console.warn("[WMDS Field] Child has its own `label` — omit one label source (Field or control).");
|
|
18
18
|
}
|
|
19
|
-
function v({ label: s, description: l, orientation:
|
|
19
|
+
function v({ label: s, description: l, orientation: u = "vertical", htmlFor: d, disabled: v = !1, children: b, className: x }) {
|
|
20
20
|
let S = f();
|
|
21
21
|
_({
|
|
22
22
|
label: s,
|
|
23
23
|
children: b
|
|
24
24
|
});
|
|
25
|
-
let C = h(b), w = g(b), T =
|
|
25
|
+
let C = h(b), w = g(b), T = d ?? w?.props.id ?? (w == null ? void 0 : `${S}-control`), E = l == null ? void 0 : `${S}-description`, D = s == null ? void 0 : `${S}-legend`, O = w == null ? w : y(w, T, E), k = C > 1 ? /* @__PURE__ */ p("div", {
|
|
26
26
|
className: o,
|
|
27
27
|
children: b
|
|
28
28
|
}) : O ?? b, A = l == null ? null : /* @__PURE__ */ p("p", {
|
|
@@ -35,8 +35,7 @@ function v({ label: s, description: l, orientation: d = "vertical", htmlFor: v,
|
|
|
35
35
|
children: b
|
|
36
36
|
}) : s == null ? /* @__PURE__ */ m("div", {
|
|
37
37
|
className: e(c, x),
|
|
38
|
-
|
|
39
|
-
children: [b, A]
|
|
38
|
+
children: [C > 1 ? b : O ?? b, A]
|
|
40
39
|
}) : C > 1 ? /* @__PURE__ */ m("div", {
|
|
41
40
|
role: "group",
|
|
42
41
|
"aria-labelledby": D,
|
|
@@ -45,18 +44,17 @@ function v({ label: s, description: l, orientation: d = "vertical", htmlFor: v,
|
|
|
45
44
|
children: [
|
|
46
45
|
/* @__PURE__ */ p("span", {
|
|
47
46
|
id: D,
|
|
48
|
-
className: a(
|
|
47
|
+
className: a(v),
|
|
49
48
|
children: s
|
|
50
49
|
}),
|
|
51
50
|
k,
|
|
52
51
|
A
|
|
53
52
|
]
|
|
54
|
-
}) :
|
|
53
|
+
}) : u === "horizontal" ? /* @__PURE__ */ m("div", {
|
|
55
54
|
className: e(i, x),
|
|
56
|
-
"aria-describedby": E,
|
|
57
55
|
children: [/* @__PURE__ */ p("label", {
|
|
58
56
|
htmlFor: T,
|
|
59
|
-
className: e(r, a(
|
|
57
|
+
className: e(r, a(v)),
|
|
60
58
|
children: s
|
|
61
59
|
}), /* @__PURE__ */ m("div", {
|
|
62
60
|
className: n,
|
|
@@ -64,11 +62,10 @@ function v({ label: s, description: l, orientation: d = "vertical", htmlFor: v,
|
|
|
64
62
|
})]
|
|
65
63
|
}) : /* @__PURE__ */ m("div", {
|
|
66
64
|
className: e(c, x),
|
|
67
|
-
"aria-describedby": E,
|
|
68
65
|
children: [
|
|
69
66
|
/* @__PURE__ */ p("label", {
|
|
70
67
|
htmlFor: T,
|
|
71
|
-
className: a(
|
|
68
|
+
className: a(v),
|
|
72
69
|
children: s
|
|
73
70
|
}),
|
|
74
71
|
k,
|
|
@@ -76,5 +73,9 @@ function v({ label: s, description: l, orientation: d = "vertical", htmlFor: v,
|
|
|
76
73
|
]
|
|
77
74
|
});
|
|
78
75
|
}
|
|
76
|
+
function y(e, t, n) {
|
|
77
|
+
let r = e.props, i = {};
|
|
78
|
+
return r.id == null && t != null && (i.id = t), n != null && (i["aria-describedby"] = [r["aria-describedby"], n].filter(Boolean).join(" ")), Object.keys(i).length > 0 ? u(e, i) : e;
|
|
79
|
+
}
|
|
79
80
|
//#endregion
|
|
80
81
|
export { v as Field, s as fieldOrientations };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
/** Layout-only — height and margin. Not for re-theming the log. */
|
|
3
|
+
export type LogViewLayoutClassName = string;
|
|
4
|
+
export interface LogViewLabels {
|
|
5
|
+
copy: string;
|
|
6
|
+
copied: string;
|
|
7
|
+
follow: string;
|
|
8
|
+
following: string;
|
|
9
|
+
empty: string;
|
|
10
|
+
}
|
|
11
|
+
export interface LogViewProps {
|
|
12
|
+
/** Log text, one entry per line. */
|
|
13
|
+
lines: readonly string[];
|
|
14
|
+
/** Accessible name of the log, for example "Scan log". */
|
|
15
|
+
label: string;
|
|
16
|
+
/** When true, the scroller stays on the last line. */
|
|
17
|
+
follow?: boolean;
|
|
18
|
+
onFollowChange?: (follow: boolean) => void;
|
|
19
|
+
/** Skeleton in the scroller. The line count stays hidden. */
|
|
20
|
+
loading?: boolean;
|
|
21
|
+
/** Replaces the lines when there are none. Default: "No log lines". */
|
|
22
|
+
empty?: ReactNode;
|
|
23
|
+
labels?: Partial<LogViewLabels>;
|
|
24
|
+
className?: LogViewLayoutClassName;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Scrolling log — line numbers, a tabular count, Copy, and Follow.
|
|
28
|
+
* Compose it inside a dark detail pane. The pane owns `data-theme`.
|
|
29
|
+
*/
|
|
30
|
+
export declare function LogView({ lines, label, follow, onFollowChange, loading, empty, labels: labelsProp, className, }: LogViewProps): import("react").JSX.Element;
|
|
31
|
+
//# sourceMappingURL=LogView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LogView.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/LogView/LogView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAiB1E,mEAAmE;AACnE,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC;AAE5C,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,YAAY;IAC3B,oCAAoC;IACpC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,0DAA0D;IAC1D,KAAK,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C,6DAA6D;IAC7D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,uEAAuE;IACvE,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IAChC,SAAS,CAAC,EAAE,sBAAsB,CAAC;CACpC;AAcD;;;GAGG;AACH,wBAAgB,OAAO,CAAC,EACtB,KAAK,EACL,KAAK,EACL,MAAc,EACd,cAAc,EACd,OAAe,EACf,KAAK,EACL,MAAM,EAAE,UAAU,EAClB,SAAS,GACV,EAAE,YAAY,+BAsFd"}
|