@ncds/ui-admin 1.8.27 → 1.8.28-alpha.1
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/dist/cjs/assets/scripts/notification/const/icons.js +1 -2
- package/dist/cjs/assets/scripts/notification/const/index.js +0 -30
- package/dist/cjs/assets/scripts/notification/const/sizes.js +5 -5
- package/dist/cjs/assets/scripts/notification/index.js +0 -7
- package/dist/cjs/assets/scripts/shared/ButtonCloseX.js +5 -4
- package/dist/cjs/assets/scripts/tooltip/const/classNames.js +29 -0
- package/dist/cjs/assets/scripts/tooltip/const/constants.js +58 -0
- package/dist/cjs/assets/scripts/tooltip/const/icons.js +15 -0
- package/dist/cjs/assets/scripts/tooltip/const/index.js +117 -0
- package/dist/cjs/assets/scripts/tooltip/const/templates.js +67 -0
- package/dist/cjs/assets/scripts/tooltip/const/types.js +5 -0
- package/dist/cjs/assets/scripts/utils/sanitize.js +0 -13
- package/dist/cjs/src/__tests__/helpers/dom.js +14 -0
- package/dist/cjs/src/__tests__/helpers/fileInput.js +92 -0
- package/dist/cjs/src/__tests__/helpers/fixedToday.js +17 -0
- package/dist/cjs/src/__tests__/helpers/matchMedia.js +50 -0
- package/dist/cjs/src/__tests__/helpers/rect.js +25 -0
- package/dist/cjs/src/components/action/button/__tests__/Button.test.js +260 -0
- package/dist/cjs/src/components/action/button-group/__tests__/ButtonGroup.test.js +267 -0
- package/dist/cjs/src/components/data-display/data-grid/__tests__/DataGrid.test.js +350 -0
- package/dist/cjs/src/components/data-display/table/__tests__/Table.dnd.dragCell.test.js +320 -0
- package/dist/cjs/src/components/data-display/table/__tests__/Table.dnd.test.js +313 -0
- package/dist/cjs/src/components/data-display/table/__tests__/Table.scroll.test.js +194 -0
- package/dist/cjs/src/components/data-display/table/__tests__/Table.test.js +382 -0
- package/dist/cjs/src/components/data-display/table/__tests__/dnd-context.test.js +61 -0
- package/dist/cjs/src/components/data-display/table/__tests__/dnd-preview.test.js +230 -0
- package/dist/cjs/src/components/data-display/table/__tests__/tableDndTestUtils.js +266 -0
- package/dist/cjs/src/components/data-display/table/__tests__/tableTestUtils.js +48 -0
- package/dist/cjs/src/components/data-display/table/__tests__/useTableScrollbars.ownership.test.js +362 -0
- package/dist/cjs/src/components/data-display/table/useTableScrollbars.js +0 -24
- package/dist/cjs/src/components/feedback-and-status/badge/Badge.js +1 -1
- package/dist/cjs/src/components/feedback-and-status/badge/__tests__/Badge.test.js +189 -0
- package/dist/cjs/src/components/feedback-and-status/badge-group/__tests__/BadgeGroup.test.js +119 -0
- package/dist/cjs/src/components/feedback-and-status/carousel-arrow/__tests__/CarouselArrow.test.js +94 -0
- package/dist/cjs/src/components/feedback-and-status/carousel-number-group/__tests__/CarouselNumberGroup.test.js +64 -0
- package/dist/cjs/src/components/feedback-and-status/empty-state/__tests__/EmptyState.test.js +126 -0
- package/dist/cjs/src/components/feedback-and-status/progress-bar/__tests__/ProgressBar.test.js +277 -0
- package/dist/cjs/src/components/feedback-and-status/progress-bar/__tests__/useProgressBar.test.js +249 -0
- package/dist/cjs/src/components/feedback-and-status/progress-bar/__tests__/utils.test.js +22 -0
- package/dist/cjs/src/components/feedback-and-status/progress-circle/__tests__/ProgressCircle.test.js +102 -0
- package/dist/cjs/src/components/feedback-and-status/spinner/__tests__/Spinner.test.js +76 -0
- package/dist/cjs/src/components/feedback-and-status/tag/__tests__/Tag.test.js +604 -0
- package/dist/cjs/src/components/forms-and-input/checkbox/__tests__/Checkbox.test.js +213 -0
- package/dist/cjs/src/components/forms-and-input/combo-box/ComboBox.js +2 -2
- package/dist/cjs/src/components/forms-and-input/combo-box/__tests__/ComboBox.interaction.test.js +442 -0
- package/dist/cjs/src/components/forms-and-input/combo-box/__tests__/ComboBox.register.test.js +153 -0
- package/dist/cjs/src/components/forms-and-input/combo-box/__tests__/comboBoxTestUtils.js +92 -0
- package/dist/cjs/src/components/forms-and-input/date-picker/__tests__/DatePicker.input.test.js +546 -0
- package/dist/cjs/src/components/forms-and-input/date-picker/__tests__/DatePicker.position.test.js +550 -0
- package/dist/cjs/src/components/forms-and-input/date-picker/__tests__/utils.test.js +34 -0
- package/dist/cjs/src/components/forms-and-input/file-input/__tests__/FileInput.select.test.js +266 -0
- package/dist/cjs/src/components/forms-and-input/image-file-input/__tests__/ImageFileInput.select.test.js +416 -0
- package/dist/cjs/src/components/forms-and-input/input-base/__tests__/InputBase.slots.test.js +236 -0
- package/dist/cjs/src/components/forms-and-input/number-input/__tests__/NumberInput.test.js +570 -0
- package/dist/cjs/src/components/forms-and-input/password-input/__tests__/PasswordInput.toggle.test.js +113 -0
- package/dist/cjs/src/components/forms-and-input/radio/__tests__/Radio.test.js +57 -0
- package/dist/cjs/src/components/forms-and-input/range-date-picker/__tests__/RangeDatePicker.test.js +275 -0
- package/dist/cjs/src/components/forms-and-input/range-date-picker-with-buttons/__tests__/RangeDatePickerWithButtons.test.js +235 -2
- package/dist/cjs/src/components/forms-and-input/select/__tests__/Select.test.js +275 -0
- package/dist/cjs/src/components/forms-and-input/select-box/SelectBox.js +2 -2
- package/dist/cjs/src/components/forms-and-input/select-box/__tests__/SelectBox.portal.test.js +371 -0
- package/dist/cjs/src/components/forms-and-input/select-box/__tests__/SelectBox.test.js +1335 -0
- package/dist/cjs/src/components/forms-and-input/slider/__tests__/Slider.test.js +390 -0
- package/dist/cjs/src/components/forms-and-input/switch/__tests__/Switch.test.js +317 -0
- package/dist/cjs/src/components/forms-and-input/textarea/__tests__/Textarea.test.js +255 -0
- package/dist/cjs/src/components/forms-and-input/textarea/__tests__/Textarea.unmount.test.js +158 -0
- package/dist/cjs/src/components/forms-and-input/toggle/__tests__/Toggle.test.js +138 -0
- package/dist/cjs/src/components/image-and-icons/featured-icon/__tests__/FeaturedIcon.test.js +67 -0
- package/dist/cjs/src/components/layout/block-container/__tests__/BlockContainer.test.js +59 -0
- package/dist/cjs/src/components/layout/block-header/__tests__/BlockHeader.test.js +169 -0
- package/dist/cjs/src/components/layout/block-header/__tests__/SubTitle.test.js +77 -0
- package/dist/cjs/src/components/layout/divider/__tests__/Divider.test.js +65 -0
- package/dist/cjs/src/components/layout/ncua-scope/__tests__/NcuaScope.test.js +146 -0
- package/dist/cjs/src/components/layout/page-title/__tests__/PageTitle.test.js +164 -0
- package/dist/cjs/src/components/layout/page-title/__tests__/pageTitleStyle.test.js +94 -0
- package/dist/cjs/src/components/navigation/context-tab/__tests__/ContextTab.test.js +616 -0
- package/dist/cjs/src/components/navigation/context-tab/__tests__/useContextTabScroll.test.js +592 -0
- package/dist/cjs/src/components/navigation/horizontal-tab/__tests__/HorizontalTab.test.js +211 -0
- package/dist/cjs/src/components/navigation/pagination/__tests__/Pagination.navigation.test.js +285 -0
- package/dist/cjs/src/components/navigation/vertical-tab/__tests__/VerticalTab.test.js +255 -0
- package/dist/cjs/src/components/overlays/dropdown/__tests__/Dropdown.dnd.test.js +558 -0
- package/dist/cjs/src/components/overlays/dropdown/__tests__/Dropdown.test.js +1020 -0
- package/dist/cjs/src/components/overlays/dropdown/__tests__/dropdownTestUtils.js +24 -0
- package/dist/cjs/src/components/overlays/dropdown/__tests__/utils.test.js +56 -0
- package/dist/cjs/src/components/overlays/modal/__tests__/Modal.test.js +426 -0
- package/dist/cjs/src/components/overlays/notification/__tests__/FloatingNotification.test.js +284 -0
- package/dist/cjs/src/components/overlays/notification/__tests__/MessageNotification.test.js +12 -0
- package/dist/cjs/src/components/overlays/postcode-search-modal/PostcodeSearchModalTip.js +2 -2
- package/dist/cjs/src/components/overlays/postcode-search-modal/__tests__/PostcodeSearchModal.viewport.test.js +141 -0
- package/dist/cjs/src/components/overlays/tooltip/__tests__/Tooltip.test.js +829 -0
- package/dist/cjs/src/components/tab/__tests__/TabButton.test.js +252 -0
- package/dist/cjs/src/generated/scoped-css.js +1 -1
- package/dist/cjs/src/hooks/__tests__/useCallbackRef.test.js +152 -0
- package/dist/cjs/src/hooks/__tests__/useMediaQuery.test.js +119 -0
- package/dist/cjs/src/hooks/__tests__/usePortalState.ssr.test.js +25 -0
- package/dist/cjs/src/hooks/dropdown/__tests__/dropdownHooks.test.js +168 -0
- package/dist/cjs/src/types/component-meta.js +0 -4
- package/dist/cjs/src/utils/__tests__/date-picker.test.js +105 -0
- package/dist/cjs/src/utils/dropdown/__tests__/dropdownUtils.test.js +24 -0
- package/dist/cjs/src/utils/dropdown/__tests__/multiSelect.test.js +49 -0
- package/dist/cjs/src/utils/dropdown/multiSelect.js +1 -6
- package/dist/cjs/src/utils/portal-position/__tests__/portalPosition.nullAnchor.test.js +67 -0
- package/dist/cjs/vitest.config.js +22 -5
- package/dist/esm/assets/scripts/notification/const/icons.js +0 -1
- package/dist/esm/assets/scripts/notification/const/index.js +2 -2
- package/dist/esm/assets/scripts/notification/const/sizes.js +4 -4
- package/dist/esm/assets/scripts/notification/index.js +1 -1
- package/dist/esm/assets/scripts/shared/ButtonCloseX.js +6 -3
- package/dist/esm/assets/scripts/tooltip/const/classNames.js +23 -0
- package/dist/esm/assets/scripts/tooltip/const/constants.js +52 -0
- package/dist/esm/assets/scripts/tooltip/const/icons.js +9 -0
- package/dist/esm/assets/scripts/tooltip/const/index.js +5 -0
- package/dist/esm/assets/scripts/tooltip/const/templates.js +60 -0
- package/dist/esm/assets/scripts/tooltip/const/types.js +1 -0
- package/dist/esm/assets/scripts/utils/sanitize.js +0 -12
- package/dist/esm/src/__tests__/helpers/dom.js +8 -0
- package/dist/esm/src/__tests__/helpers/fileInput.js +78 -0
- package/dist/esm/src/__tests__/helpers/fixedToday.js +10 -0
- package/dist/esm/src/__tests__/helpers/matchMedia.js +44 -0
- package/dist/esm/src/__tests__/helpers/rect.js +18 -0
- package/dist/esm/src/components/action/button/__tests__/Button.test.js +257 -0
- package/dist/esm/src/components/action/button-group/__tests__/ButtonGroup.test.js +264 -0
- package/dist/esm/src/components/data-display/data-grid/__tests__/DataGrid.test.js +347 -0
- package/dist/esm/src/components/data-display/table/__tests__/Table.dnd.dragCell.test.js +317 -0
- package/dist/esm/src/components/data-display/table/__tests__/Table.dnd.test.js +310 -0
- package/dist/esm/src/components/data-display/table/__tests__/Table.scroll.test.js +191 -0
- package/dist/esm/src/components/data-display/table/__tests__/Table.test.js +379 -0
- package/dist/esm/src/components/data-display/table/__tests__/dnd-context.test.js +58 -0
- package/dist/esm/src/components/data-display/table/__tests__/dnd-preview.test.js +227 -0
- package/dist/esm/src/components/data-display/table/__tests__/tableDndTestUtils.js +240 -0
- package/dist/esm/src/components/data-display/table/__tests__/tableTestUtils.js +40 -0
- package/dist/esm/src/components/data-display/table/__tests__/useTableScrollbars.ownership.test.js +359 -0
- package/dist/esm/src/components/data-display/table/useTableScrollbars.js +1 -1
- package/dist/esm/src/components/feedback-and-status/badge/Badge.js +1 -1
- package/dist/esm/src/components/feedback-and-status/badge/__tests__/Badge.test.js +186 -0
- package/dist/esm/src/components/feedback-and-status/badge-group/__tests__/BadgeGroup.test.js +116 -0
- package/dist/esm/src/components/feedback-and-status/carousel-arrow/__tests__/CarouselArrow.test.js +91 -0
- package/dist/esm/src/components/feedback-and-status/carousel-number-group/__tests__/CarouselNumberGroup.test.js +61 -0
- package/dist/esm/src/components/feedback-and-status/empty-state/__tests__/EmptyState.test.js +123 -0
- package/dist/esm/src/components/feedback-and-status/progress-bar/__tests__/ProgressBar.test.js +274 -0
- package/dist/esm/src/components/feedback-and-status/progress-bar/__tests__/useProgressBar.test.js +246 -0
- package/dist/esm/src/components/feedback-and-status/progress-bar/__tests__/utils.test.js +19 -0
- package/dist/esm/src/components/feedback-and-status/progress-circle/__tests__/ProgressCircle.test.js +99 -0
- package/dist/esm/src/components/feedback-and-status/spinner/__tests__/Spinner.test.js +73 -0
- package/dist/esm/src/components/feedback-and-status/tag/__tests__/Tag.test.js +601 -0
- package/dist/esm/src/components/forms-and-input/checkbox/__tests__/Checkbox.test.js +210 -0
- package/dist/esm/src/components/forms-and-input/combo-box/ComboBox.js +1 -1
- package/dist/esm/src/components/forms-and-input/combo-box/__tests__/ComboBox.interaction.test.js +439 -0
- package/dist/esm/src/components/forms-and-input/combo-box/__tests__/ComboBox.register.test.js +151 -0
- package/dist/esm/src/components/forms-and-input/combo-box/__tests__/comboBoxTestUtils.js +77 -0
- package/dist/esm/src/components/forms-and-input/date-picker/__tests__/DatePicker.input.test.js +544 -0
- package/dist/esm/src/components/forms-and-input/date-picker/__tests__/DatePicker.position.test.js +546 -0
- package/dist/esm/src/components/forms-and-input/date-picker/__tests__/utils.test.js +31 -0
- package/dist/esm/src/components/forms-and-input/file-input/__tests__/FileInput.select.test.js +263 -0
- package/dist/esm/src/components/forms-and-input/image-file-input/__tests__/ImageFileInput.select.test.js +413 -0
- package/dist/esm/src/components/forms-and-input/input-base/__tests__/InputBase.slots.test.js +233 -0
- package/dist/esm/src/components/forms-and-input/number-input/__tests__/NumberInput.test.js +567 -0
- package/dist/esm/src/components/forms-and-input/password-input/__tests__/PasswordInput.toggle.test.js +110 -0
- package/dist/esm/src/components/forms-and-input/radio/__tests__/Radio.test.js +54 -0
- package/dist/esm/src/components/forms-and-input/range-date-picker/__tests__/RangeDatePicker.test.js +275 -0
- package/dist/esm/src/components/forms-and-input/range-date-picker-with-buttons/__tests__/RangeDatePickerWithButtons.test.js +235 -1
- package/dist/esm/src/components/forms-and-input/select/__tests__/Select.test.js +272 -0
- package/dist/esm/src/components/forms-and-input/select-box/SelectBox.js +1 -1
- package/dist/esm/src/components/forms-and-input/select-box/__tests__/SelectBox.portal.test.js +368 -0
- package/dist/esm/src/components/forms-and-input/select-box/__tests__/SelectBox.test.js +1332 -0
- package/dist/esm/src/components/forms-and-input/slider/__tests__/Slider.test.js +387 -0
- package/dist/esm/src/components/forms-and-input/switch/__tests__/Switch.test.js +314 -0
- package/dist/esm/src/components/forms-and-input/textarea/__tests__/Textarea.test.js +252 -0
- package/dist/esm/src/components/forms-and-input/textarea/__tests__/Textarea.unmount.test.js +155 -0
- package/dist/esm/src/components/forms-and-input/toggle/__tests__/Toggle.test.js +135 -0
- package/dist/esm/src/components/image-and-icons/featured-icon/__tests__/FeaturedIcon.test.js +64 -0
- package/dist/esm/src/components/layout/block-container/__tests__/BlockContainer.test.js +56 -0
- package/dist/esm/src/components/layout/block-header/__tests__/BlockHeader.test.js +166 -0
- package/dist/esm/src/components/layout/block-header/__tests__/SubTitle.test.js +74 -0
- package/dist/esm/src/components/layout/divider/__tests__/Divider.test.js +62 -0
- package/dist/esm/src/components/layout/ncua-scope/__tests__/NcuaScope.test.js +144 -0
- package/dist/esm/src/components/layout/page-title/__tests__/PageTitle.test.js +161 -0
- package/dist/esm/src/components/layout/page-title/__tests__/pageTitleStyle.test.js +91 -0
- package/dist/esm/src/components/navigation/context-tab/__tests__/ContextTab.test.js +613 -0
- package/dist/esm/src/components/navigation/context-tab/__tests__/useContextTabScroll.test.js +589 -0
- package/dist/esm/src/components/navigation/horizontal-tab/__tests__/HorizontalTab.test.js +209 -0
- package/dist/esm/src/components/navigation/pagination/__tests__/Pagination.navigation.test.js +282 -0
- package/dist/esm/src/components/navigation/vertical-tab/__tests__/VerticalTab.test.js +252 -0
- package/dist/esm/src/components/overlays/dropdown/__tests__/Dropdown.dnd.test.js +556 -0
- package/dist/esm/src/components/overlays/dropdown/__tests__/Dropdown.test.js +1017 -0
- package/dist/esm/src/components/overlays/dropdown/__tests__/dropdownTestUtils.js +15 -0
- package/dist/esm/src/components/overlays/dropdown/__tests__/utils.test.js +57 -1
- package/dist/esm/src/components/overlays/modal/__tests__/Modal.test.js +423 -0
- package/dist/esm/src/components/overlays/notification/__tests__/FloatingNotification.test.js +281 -0
- package/dist/esm/src/components/overlays/notification/__tests__/MessageNotification.test.js +12 -0
- package/dist/esm/src/components/overlays/postcode-search-modal/PostcodeSearchModalTip.js +1 -1
- package/dist/esm/src/components/overlays/postcode-search-modal/__tests__/PostcodeSearchModal.viewport.test.js +139 -0
- package/dist/esm/src/components/overlays/tooltip/__tests__/Tooltip.test.js +826 -0
- package/dist/esm/src/components/tab/__tests__/TabButton.test.js +249 -0
- package/dist/esm/src/generated/scoped-css.js +1 -1
- package/dist/esm/src/hooks/__tests__/useCallbackRef.test.js +149 -0
- package/dist/esm/src/hooks/__tests__/useMediaQuery.test.js +116 -0
- package/dist/esm/src/hooks/__tests__/usePortalState.ssr.test.js +22 -0
- package/dist/esm/src/hooks/dropdown/__tests__/dropdownHooks.test.js +165 -0
- package/dist/esm/src/types/component-meta.js +0 -4
- package/dist/esm/src/utils/__tests__/date-picker.test.js +107 -2
- package/dist/esm/src/utils/dropdown/__tests__/dropdownUtils.test.js +24 -0
- package/dist/esm/src/utils/dropdown/__tests__/multiSelect.test.js +46 -0
- package/dist/esm/src/utils/dropdown/multiSelect.js +5 -5
- package/dist/esm/src/utils/portal-position/__tests__/portalPosition.nullAnchor.test.js +64 -0
- package/dist/esm/vitest.config.js +22 -5
- package/dist/temp/assets/scripts/notification/const/icons.d.ts +0 -7
- package/dist/temp/assets/scripts/notification/const/icons.js +0 -1
- package/dist/temp/assets/scripts/notification/const/index.d.ts +3 -3
- package/dist/temp/assets/scripts/notification/const/index.js +2 -2
- package/dist/temp/assets/scripts/notification/const/sizes.d.ts +2 -14
- package/dist/temp/assets/scripts/notification/const/sizes.js +4 -4
- package/dist/temp/assets/scripts/notification/const/types.d.ts +3 -2
- package/dist/temp/assets/scripts/notification/index.d.ts +1 -1
- package/dist/temp/assets/scripts/notification/index.js +1 -1
- package/dist/temp/assets/scripts/shared/ButtonCloseX.d.ts +0 -2
- package/dist/temp/assets/scripts/shared/ButtonCloseX.js +6 -3
- package/dist/temp/assets/scripts/table/scrollbar/const.d.ts +0 -1
- package/dist/temp/assets/scripts/tooltip/const/classNames.d.ts +17 -0
- package/dist/temp/assets/scripts/tooltip/const/classNames.js +23 -0
- package/dist/temp/assets/scripts/tooltip/const/constants.d.ts +33 -0
- package/dist/temp/assets/scripts/tooltip/const/constants.js +48 -0
- package/dist/temp/assets/scripts/tooltip/const/icons.d.ts +4 -0
- package/dist/temp/assets/scripts/tooltip/const/icons.js +9 -0
- package/dist/temp/assets/scripts/tooltip/const/index.d.ts +5 -0
- package/dist/temp/assets/scripts/tooltip/const/index.js +5 -0
- package/dist/temp/assets/scripts/tooltip/const/templates.d.ts +16 -0
- package/dist/temp/assets/scripts/tooltip/const/templates.js +60 -0
- package/dist/temp/assets/scripts/tooltip/const/types.d.ts +17 -0
- package/dist/temp/assets/scripts/tooltip/const/types.js +1 -0
- package/dist/temp/assets/scripts/utils/sanitize.d.ts +0 -6
- package/dist/temp/assets/scripts/utils/sanitize.js +0 -12
- package/dist/temp/src/__tests__/helpers/dom.d.ts +2 -0
- package/dist/temp/src/__tests__/helpers/dom.js +8 -0
- package/dist/temp/src/__tests__/helpers/fileInput.d.ts +27 -0
- package/dist/temp/src/__tests__/helpers/fileInput.js +70 -0
- package/dist/temp/src/__tests__/helpers/fixedToday.d.ts +4 -0
- package/dist/temp/src/__tests__/helpers/fixedToday.js +8 -0
- package/dist/temp/src/__tests__/helpers/matchMedia.d.ts +13 -0
- package/dist/temp/src/__tests__/helpers/matchMedia.js +42 -0
- package/dist/temp/src/__tests__/helpers/rect.d.ts +2 -0
- package/dist/temp/src/__tests__/helpers/rect.js +5 -0
- package/dist/temp/src/components/action/button/__tests__/Button.test.d.ts +1 -0
- package/dist/temp/src/components/action/button/__tests__/Button.test.js +180 -0
- package/dist/temp/src/components/action/button-group/__tests__/ButtonGroup.test.d.ts +1 -0
- package/dist/temp/src/components/action/button-group/__tests__/ButtonGroup.test.js +162 -0
- package/dist/temp/src/components/data-display/data-grid/__tests__/DataGrid.test.d.ts +1 -0
- package/dist/temp/src/components/data-display/data-grid/__tests__/DataGrid.test.js +291 -0
- package/dist/temp/src/components/data-display/table/__tests__/Table.dnd.dragCell.test.d.ts +1 -0
- package/dist/temp/src/components/data-display/table/__tests__/Table.dnd.dragCell.test.js +255 -0
- package/dist/temp/src/components/data-display/table/__tests__/Table.dnd.test.d.ts +1 -0
- package/dist/temp/src/components/data-display/table/__tests__/Table.dnd.test.js +240 -0
- package/dist/temp/src/components/data-display/table/__tests__/Table.scroll.test.d.ts +1 -0
- package/dist/temp/src/components/data-display/table/__tests__/Table.scroll.test.js +145 -0
- package/dist/temp/src/components/data-display/table/__tests__/Table.test.d.ts +1 -0
- package/dist/temp/src/components/data-display/table/__tests__/Table.test.js +295 -0
- package/dist/temp/src/components/data-display/table/__tests__/dnd-context.test.d.ts +1 -0
- package/dist/temp/src/components/data-display/table/__tests__/dnd-context.test.js +42 -0
- package/dist/temp/src/components/data-display/table/__tests__/dnd-preview.test.d.ts +1 -0
- package/dist/temp/src/components/data-display/table/__tests__/dnd-preview.test.js +226 -0
- package/dist/temp/src/components/data-display/table/__tests__/tableDndTestUtils.d.ts +76 -0
- package/dist/temp/src/components/data-display/table/__tests__/tableDndTestUtils.js +153 -0
- package/dist/temp/src/components/data-display/table/__tests__/tableTestUtils.d.ts +11 -0
- package/dist/temp/src/components/data-display/table/__tests__/tableTestUtils.js +40 -0
- package/dist/temp/src/components/data-display/table/__tests__/useTableScrollbars.ownership.test.d.ts +1 -0
- package/dist/temp/src/components/data-display/table/__tests__/useTableScrollbars.ownership.test.js +269 -0
- package/dist/temp/src/components/data-display/table/dnd-context.d.ts +1 -1
- package/dist/temp/src/components/data-display/table/useTableScrollbars.d.ts +2 -2
- package/dist/temp/src/components/data-display/table/useTableScrollbars.js +1 -1
- package/dist/temp/src/components/feedback-and-status/badge/Badge.d.ts +1 -1
- package/dist/temp/src/components/feedback-and-status/badge/Badge.js +1 -1
- package/dist/temp/src/components/feedback-and-status/badge/__tests__/Badge.test.d.ts +1 -0
- package/dist/temp/src/components/feedback-and-status/badge/__tests__/Badge.test.js +136 -0
- package/dist/temp/src/components/feedback-and-status/badge-group/__tests__/BadgeGroup.test.d.ts +1 -0
- package/dist/temp/src/components/feedback-and-status/badge-group/__tests__/BadgeGroup.test.js +103 -0
- package/dist/temp/src/components/feedback-and-status/carousel-arrow/__tests__/CarouselArrow.test.d.ts +1 -0
- package/dist/temp/src/components/feedback-and-status/carousel-arrow/__tests__/CarouselArrow.test.js +81 -0
- package/dist/temp/src/components/feedback-and-status/carousel-number-group/__tests__/CarouselNumberGroup.test.d.ts +1 -0
- package/dist/temp/src/components/feedback-and-status/carousel-number-group/__tests__/CarouselNumberGroup.test.js +53 -0
- package/dist/temp/src/components/feedback-and-status/empty-state/__tests__/EmptyState.test.d.ts +1 -0
- package/dist/temp/src/components/feedback-and-status/empty-state/__tests__/EmptyState.test.js +86 -0
- package/dist/temp/src/components/feedback-and-status/progress-bar/__tests__/ProgressBar.test.d.ts +1 -0
- package/dist/temp/src/components/feedback-and-status/progress-bar/__tests__/ProgressBar.test.js +221 -0
- package/dist/temp/src/components/feedback-and-status/progress-bar/__tests__/useProgressBar.test.d.ts +1 -0
- package/dist/temp/src/components/feedback-and-status/progress-bar/__tests__/useProgressBar.test.js +168 -0
- package/dist/temp/src/components/feedback-and-status/progress-bar/__tests__/utils.test.d.ts +1 -0
- package/dist/temp/src/components/feedback-and-status/progress-bar/__tests__/utils.test.js +35 -0
- package/dist/temp/src/components/feedback-and-status/progress-circle/__tests__/ProgressCircle.test.d.ts +1 -0
- package/dist/temp/src/components/feedback-and-status/progress-circle/__tests__/ProgressCircle.test.js +106 -0
- package/dist/temp/src/components/feedback-and-status/spinner/__tests__/Spinner.test.d.ts +1 -0
- package/dist/temp/src/components/feedback-and-status/spinner/__tests__/Spinner.test.js +73 -0
- package/dist/temp/src/components/feedback-and-status/tag/__tests__/Tag.test.d.ts +1 -0
- package/dist/temp/src/components/feedback-and-status/tag/__tests__/Tag.test.js +392 -0
- package/dist/temp/src/components/forms-and-input/checkbox/__tests__/Checkbox.test.d.ts +1 -0
- package/dist/temp/src/components/forms-and-input/checkbox/__tests__/Checkbox.test.js +180 -0
- package/dist/temp/src/components/forms-and-input/combo-box/ComboBox.d.ts +1 -2
- package/dist/temp/src/components/forms-and-input/combo-box/ComboBox.js +1 -1
- package/dist/temp/src/components/forms-and-input/combo-box/__tests__/ComboBox.interaction.test.d.ts +1 -0
- package/dist/temp/src/components/forms-and-input/combo-box/__tests__/ComboBox.interaction.test.js +295 -0
- package/dist/temp/src/components/forms-and-input/combo-box/__tests__/ComboBox.register.test.d.ts +1 -0
- package/dist/temp/src/components/forms-and-input/combo-box/__tests__/ComboBox.register.test.js +111 -0
- package/dist/temp/src/components/forms-and-input/combo-box/__tests__/comboBoxTestUtils.d.ts +22 -0
- package/dist/temp/src/components/forms-and-input/combo-box/__tests__/comboBoxTestUtils.js +69 -0
- package/dist/temp/src/components/forms-and-input/date-picker/__tests__/DatePicker.input.test.d.ts +1 -0
- package/dist/temp/src/components/forms-and-input/date-picker/__tests__/DatePicker.input.test.js +358 -0
- package/dist/temp/src/components/forms-and-input/date-picker/__tests__/DatePicker.position.test.d.ts +1 -0
- package/dist/temp/src/components/forms-and-input/date-picker/__tests__/DatePicker.position.test.js +361 -0
- package/dist/temp/src/components/forms-and-input/date-picker/__tests__/utils.test.d.ts +1 -0
- package/dist/temp/src/components/forms-and-input/date-picker/__tests__/utils.test.js +34 -0
- package/dist/temp/src/components/forms-and-input/file-input/__tests__/FileInput.select.test.d.ts +1 -0
- package/dist/temp/src/components/forms-and-input/file-input/__tests__/FileInput.select.test.js +206 -0
- package/dist/temp/src/components/forms-and-input/image-file-input/__tests__/ImageFileInput.select.test.d.ts +1 -0
- package/dist/temp/src/components/forms-and-input/image-file-input/__tests__/ImageFileInput.select.test.js +292 -0
- package/dist/temp/src/components/forms-and-input/input-base/__tests__/InputBase.slots.test.d.ts +1 -0
- package/dist/temp/src/components/forms-and-input/input-base/__tests__/InputBase.slots.test.js +177 -0
- package/dist/temp/src/components/forms-and-input/number-input/__tests__/NumberInput.test.d.ts +1 -0
- package/dist/temp/src/components/forms-and-input/number-input/__tests__/NumberInput.test.js +434 -0
- package/dist/temp/src/components/forms-and-input/password-input/__tests__/PasswordInput.toggle.test.d.ts +1 -0
- package/dist/temp/src/components/forms-and-input/password-input/__tests__/PasswordInput.toggle.test.js +88 -0
- package/dist/temp/src/components/forms-and-input/radio/__tests__/Radio.test.d.ts +1 -0
- package/dist/temp/src/components/forms-and-input/radio/__tests__/Radio.test.js +42 -0
- package/dist/temp/src/components/forms-and-input/range-date-picker/__tests__/RangeDatePicker.test.js +137 -0
- package/dist/temp/src/components/forms-and-input/range-date-picker-with-buttons/__tests__/RangeDatePickerWithButtons.test.js +201 -1
- package/dist/temp/src/components/forms-and-input/select/__tests__/Select.test.d.ts +1 -0
- package/dist/temp/src/components/forms-and-input/select/__tests__/Select.test.js +214 -0
- package/dist/temp/src/components/forms-and-input/select-box/SelectBox.d.ts +1 -2
- package/dist/temp/src/components/forms-and-input/select-box/SelectBox.js +1 -1
- package/dist/temp/src/components/forms-and-input/select-box/__tests__/SelectBox.portal.test.d.ts +1 -0
- package/dist/temp/src/components/forms-and-input/select-box/__tests__/SelectBox.portal.test.js +312 -0
- package/dist/temp/src/components/forms-and-input/select-box/__tests__/SelectBox.test.d.ts +1 -0
- package/dist/temp/src/components/forms-and-input/select-box/__tests__/SelectBox.test.js +991 -0
- package/dist/temp/src/components/forms-and-input/slider/__tests__/Slider.test.d.ts +1 -0
- package/dist/temp/src/components/forms-and-input/slider/__tests__/Slider.test.js +294 -0
- package/dist/temp/src/components/forms-and-input/switch/__tests__/Switch.test.d.ts +1 -0
- package/dist/temp/src/components/forms-and-input/switch/__tests__/Switch.test.js +234 -0
- package/dist/temp/src/components/forms-and-input/textarea/__tests__/Textarea.test.d.ts +1 -0
- package/dist/temp/src/components/forms-and-input/textarea/__tests__/Textarea.test.js +207 -0
- package/dist/temp/src/components/forms-and-input/textarea/__tests__/Textarea.unmount.test.d.ts +1 -0
- package/dist/temp/src/components/forms-and-input/textarea/__tests__/Textarea.unmount.test.js +120 -0
- package/dist/temp/src/components/forms-and-input/toggle/__tests__/Toggle.test.d.ts +1 -0
- package/dist/temp/src/components/forms-and-input/toggle/__tests__/Toggle.test.js +125 -0
- package/dist/temp/src/components/image-and-icons/featured-icon/__tests__/FeaturedIcon.test.d.ts +1 -0
- package/dist/temp/src/components/image-and-icons/featured-icon/__tests__/FeaturedIcon.test.js +47 -0
- package/dist/temp/src/components/layout/block-container/__tests__/BlockContainer.test.d.ts +1 -0
- package/dist/temp/src/components/layout/block-container/__tests__/BlockContainer.test.js +53 -0
- package/dist/temp/src/components/layout/block-header/__tests__/BlockHeader.test.d.ts +1 -0
- package/dist/temp/src/components/layout/block-header/__tests__/BlockHeader.test.js +127 -0
- package/dist/temp/src/components/layout/block-header/__tests__/SubTitle.test.d.ts +1 -0
- package/dist/temp/src/components/layout/block-header/__tests__/SubTitle.test.js +76 -0
- package/dist/temp/src/components/layout/divider/__tests__/Divider.test.d.ts +1 -0
- package/dist/temp/src/components/layout/divider/__tests__/Divider.test.js +53 -0
- package/dist/temp/src/components/layout/ncua-scope/__tests__/NcuaScope.test.d.ts +1 -0
- package/dist/temp/src/components/layout/ncua-scope/__tests__/NcuaScope.test.js +136 -0
- package/dist/temp/src/components/layout/page-title/__tests__/PageTitle.test.d.ts +1 -0
- package/dist/temp/src/components/layout/page-title/__tests__/PageTitle.test.js +119 -0
- package/dist/temp/src/components/layout/page-title/__tests__/pageTitleStyle.test.d.ts +1 -0
- package/dist/temp/src/components/layout/page-title/__tests__/pageTitleStyle.test.js +94 -0
- package/dist/temp/src/components/navigation/context-tab/__tests__/ContextTab.test.d.ts +1 -0
- package/dist/temp/src/components/navigation/context-tab/__tests__/ContextTab.test.js +447 -0
- package/dist/temp/src/components/navigation/context-tab/__tests__/useContextTabScroll.test.d.ts +1 -0
- package/dist/temp/src/components/navigation/context-tab/__tests__/useContextTabScroll.test.js +352 -0
- package/dist/temp/src/components/navigation/horizontal-tab/__tests__/HorizontalTab.test.d.ts +1 -0
- package/dist/temp/src/components/navigation/horizontal-tab/__tests__/HorizontalTab.test.js +152 -0
- package/dist/temp/src/components/navigation/pagination/__tests__/Pagination.navigation.test.d.ts +1 -0
- package/dist/temp/src/components/navigation/pagination/__tests__/Pagination.navigation.test.js +265 -0
- package/dist/temp/src/components/navigation/vertical-tab/__tests__/VerticalTab.test.d.ts +1 -0
- package/dist/temp/src/components/navigation/vertical-tab/__tests__/VerticalTab.test.js +172 -0
- package/dist/temp/src/components/overlays/dropdown/__tests__/Dropdown.dnd.test.d.ts +1 -0
- package/dist/temp/src/components/overlays/dropdown/__tests__/Dropdown.dnd.test.js +423 -0
- package/dist/temp/src/components/overlays/dropdown/__tests__/Dropdown.test.d.ts +1 -0
- package/dist/temp/src/components/overlays/dropdown/__tests__/Dropdown.test.js +699 -0
- package/dist/temp/src/components/overlays/dropdown/__tests__/dropdownTestUtils.d.ts +3 -0
- package/dist/temp/src/components/overlays/dropdown/__tests__/dropdownTestUtils.js +17 -0
- package/dist/temp/src/components/overlays/dropdown/__tests__/utils.test.js +24 -1
- package/dist/temp/src/components/overlays/modal/__tests__/Modal.test.d.ts +1 -0
- package/dist/temp/src/components/overlays/modal/__tests__/Modal.test.js +307 -0
- package/dist/temp/src/components/overlays/notification/MessageNotificationParts.d.ts +0 -1
- package/dist/temp/src/components/overlays/notification/NotificationActionButtons.d.ts +0 -1
- package/dist/temp/src/components/overlays/notification/__tests__/FloatingNotification.test.d.ts +1 -0
- package/dist/temp/src/components/overlays/notification/__tests__/FloatingNotification.test.js +218 -0
- package/dist/temp/src/components/overlays/notification/__tests__/MessageNotification.test.js +10 -0
- package/dist/temp/src/components/overlays/postcode-search-modal/PostcodeSearchModalTip.d.ts +1 -3
- package/dist/temp/src/components/overlays/postcode-search-modal/PostcodeSearchModalTip.js +1 -1
- package/dist/temp/src/components/overlays/postcode-search-modal/__tests__/PostcodeSearchModal.viewport.test.d.ts +1 -0
- package/dist/temp/src/components/overlays/postcode-search-modal/__tests__/PostcodeSearchModal.viewport.test.js +112 -0
- package/dist/temp/src/components/overlays/tooltip/__tests__/Tooltip.test.d.ts +1 -0
- package/dist/temp/src/components/overlays/tooltip/__tests__/Tooltip.test.js +538 -0
- package/dist/temp/src/components/tab/__tests__/TabButton.test.d.ts +1 -0
- package/dist/temp/src/components/tab/__tests__/TabButton.test.js +181 -0
- package/dist/temp/src/constant/date-picker.d.ts +2 -1
- package/dist/temp/src/generated/scoped-css.js +1 -1
- package/dist/temp/src/hooks/__tests__/useCallbackRef.test.d.ts +1 -0
- package/dist/temp/src/hooks/__tests__/useCallbackRef.test.js +99 -0
- package/dist/temp/src/hooks/__tests__/useMediaQuery.test.d.ts +1 -0
- package/dist/temp/src/hooks/__tests__/useMediaQuery.test.js +95 -0
- package/dist/temp/src/hooks/__tests__/usePortalState.ssr.test.d.ts +1 -0
- package/dist/temp/src/hooks/__tests__/usePortalState.ssr.test.js +19 -0
- package/dist/temp/src/hooks/dropdown/__tests__/dropdownHooks.test.d.ts +1 -0
- package/dist/temp/src/hooks/dropdown/__tests__/dropdownHooks.test.js +147 -0
- package/dist/temp/src/types/component-meta.d.ts +2 -1
- package/dist/temp/src/types/component-meta.js +0 -4
- package/dist/temp/src/utils/__tests__/date-picker.test.js +58 -2
- package/dist/temp/src/utils/dropdown/__tests__/dropdownUtils.test.js +9 -0
- package/dist/temp/src/utils/dropdown/__tests__/multiSelect.test.d.ts +1 -0
- package/dist/temp/src/utils/dropdown/__tests__/multiSelect.test.js +41 -0
- package/dist/temp/src/utils/dropdown/multiSelect.d.ts +0 -20
- package/dist/temp/src/utils/dropdown/multiSelect.js +5 -5
- package/dist/temp/src/utils/portal-position/__tests__/portalPosition.nullAnchor.test.d.ts +1 -0
- package/dist/temp/src/utils/portal-position/__tests__/portalPosition.nullAnchor.test.js +57 -0
- package/dist/temp/vitest.config.js +20 -3
- package/dist/types/assets/scripts/notification/const/icons.d.ts +0 -7
- package/dist/types/assets/scripts/notification/const/index.d.ts +3 -3
- package/dist/types/assets/scripts/notification/const/sizes.d.ts +2 -14
- package/dist/types/assets/scripts/notification/const/types.d.ts +3 -2
- package/dist/types/assets/scripts/notification/index.d.ts +1 -1
- package/dist/types/assets/scripts/shared/ButtonCloseX.d.ts +0 -2
- package/dist/types/assets/scripts/table/scrollbar/const.d.ts +0 -1
- package/dist/types/assets/scripts/tooltip/const/classNames.d.ts +17 -0
- package/dist/types/assets/scripts/tooltip/const/constants.d.ts +33 -0
- package/dist/types/assets/scripts/tooltip/const/icons.d.ts +4 -0
- package/dist/types/assets/scripts/tooltip/const/index.d.ts +5 -0
- package/dist/types/assets/scripts/tooltip/const/templates.d.ts +16 -0
- package/dist/types/assets/scripts/tooltip/const/types.d.ts +17 -0
- package/dist/types/assets/scripts/utils/sanitize.d.ts +0 -6
- package/dist/types/src/__tests__/helpers/dom.d.ts +2 -0
- package/dist/types/src/__tests__/helpers/fileInput.d.ts +27 -0
- package/dist/types/src/__tests__/helpers/fixedToday.d.ts +4 -0
- package/dist/types/src/__tests__/helpers/matchMedia.d.ts +13 -0
- package/dist/types/src/__tests__/helpers/rect.d.ts +2 -0
- package/dist/types/src/components/action/button/__tests__/Button.test.d.ts +1 -0
- package/dist/types/src/components/action/button-group/__tests__/ButtonGroup.test.d.ts +1 -0
- package/dist/types/src/components/data-display/data-grid/__tests__/DataGrid.test.d.ts +1 -0
- package/dist/types/src/components/data-display/table/__tests__/Table.dnd.dragCell.test.d.ts +1 -0
- package/dist/types/src/components/data-display/table/__tests__/Table.dnd.test.d.ts +1 -0
- package/dist/types/src/components/data-display/table/__tests__/Table.scroll.test.d.ts +1 -0
- package/dist/types/src/components/data-display/table/__tests__/Table.test.d.ts +1 -0
- package/dist/types/src/components/data-display/table/__tests__/dnd-context.test.d.ts +1 -0
- package/dist/types/src/components/data-display/table/__tests__/dnd-preview.test.d.ts +1 -0
- package/dist/types/src/components/data-display/table/__tests__/tableDndTestUtils.d.ts +76 -0
- package/dist/types/src/components/data-display/table/__tests__/tableTestUtils.d.ts +11 -0
- package/dist/types/src/components/data-display/table/__tests__/useTableScrollbars.ownership.test.d.ts +1 -0
- package/dist/types/src/components/data-display/table/dnd-context.d.ts +1 -1
- package/dist/types/src/components/data-display/table/useTableScrollbars.d.ts +2 -2
- package/dist/types/src/components/feedback-and-status/badge/Badge.d.ts +1 -1
- package/dist/types/src/components/feedback-and-status/badge/__tests__/Badge.test.d.ts +1 -0
- package/dist/types/src/components/feedback-and-status/badge-group/__tests__/BadgeGroup.test.d.ts +1 -0
- package/dist/types/src/components/feedback-and-status/carousel-arrow/__tests__/CarouselArrow.test.d.ts +1 -0
- package/dist/types/src/components/feedback-and-status/carousel-number-group/__tests__/CarouselNumberGroup.test.d.ts +1 -0
- package/dist/types/src/components/feedback-and-status/empty-state/__tests__/EmptyState.test.d.ts +1 -0
- package/dist/types/src/components/feedback-and-status/progress-bar/__tests__/ProgressBar.test.d.ts +1 -0
- package/dist/types/src/components/feedback-and-status/progress-bar/__tests__/useProgressBar.test.d.ts +1 -0
- package/dist/types/src/components/feedback-and-status/progress-bar/__tests__/utils.test.d.ts +1 -0
- package/dist/types/src/components/feedback-and-status/progress-circle/__tests__/ProgressCircle.test.d.ts +1 -0
- package/dist/types/src/components/feedback-and-status/spinner/__tests__/Spinner.test.d.ts +1 -0
- package/dist/types/src/components/feedback-and-status/tag/__tests__/Tag.test.d.ts +1 -0
- package/dist/types/src/components/forms-and-input/checkbox/__tests__/Checkbox.test.d.ts +1 -0
- package/dist/types/src/components/forms-and-input/combo-box/ComboBox.d.ts +1 -2
- package/dist/types/src/components/forms-and-input/combo-box/__tests__/ComboBox.interaction.test.d.ts +1 -0
- package/dist/types/src/components/forms-and-input/combo-box/__tests__/ComboBox.register.test.d.ts +1 -0
- package/dist/types/src/components/forms-and-input/combo-box/__tests__/comboBoxTestUtils.d.ts +22 -0
- package/dist/types/src/components/forms-and-input/date-picker/__tests__/DatePicker.input.test.d.ts +1 -0
- package/dist/types/src/components/forms-and-input/date-picker/__tests__/DatePicker.position.test.d.ts +1 -0
- package/dist/types/src/components/forms-and-input/date-picker/__tests__/utils.test.d.ts +1 -0
- package/dist/types/src/components/forms-and-input/file-input/__tests__/FileInput.select.test.d.ts +1 -0
- package/dist/types/src/components/forms-and-input/image-file-input/__tests__/ImageFileInput.select.test.d.ts +1 -0
- package/dist/types/src/components/forms-and-input/input-base/__tests__/InputBase.slots.test.d.ts +1 -0
- package/dist/types/src/components/forms-and-input/number-input/__tests__/NumberInput.test.d.ts +1 -0
- package/dist/types/src/components/forms-and-input/password-input/__tests__/PasswordInput.toggle.test.d.ts +1 -0
- package/dist/types/src/components/forms-and-input/radio/__tests__/Radio.test.d.ts +1 -0
- package/dist/types/src/components/forms-and-input/select/__tests__/Select.test.d.ts +1 -0
- package/dist/types/src/components/forms-and-input/select-box/SelectBox.d.ts +1 -2
- package/dist/types/src/components/forms-and-input/select-box/__tests__/SelectBox.portal.test.d.ts +1 -0
- package/dist/types/src/components/forms-and-input/select-box/__tests__/SelectBox.test.d.ts +1 -0
- package/dist/types/src/components/forms-and-input/slider/__tests__/Slider.test.d.ts +1 -0
- package/dist/types/src/components/forms-and-input/switch/__tests__/Switch.test.d.ts +1 -0
- package/dist/types/src/components/forms-and-input/textarea/__tests__/Textarea.test.d.ts +1 -0
- package/dist/types/src/components/forms-and-input/textarea/__tests__/Textarea.unmount.test.d.ts +1 -0
- package/dist/types/src/components/forms-and-input/toggle/__tests__/Toggle.test.d.ts +1 -0
- package/dist/types/src/components/image-and-icons/featured-icon/__tests__/FeaturedIcon.test.d.ts +1 -0
- package/dist/types/src/components/layout/block-container/__tests__/BlockContainer.test.d.ts +1 -0
- package/dist/types/src/components/layout/block-header/__tests__/BlockHeader.test.d.ts +1 -0
- package/dist/types/src/components/layout/block-header/__tests__/SubTitle.test.d.ts +1 -0
- package/dist/types/src/components/layout/divider/__tests__/Divider.test.d.ts +1 -0
- package/dist/types/src/components/layout/ncua-scope/__tests__/NcuaScope.test.d.ts +1 -0
- package/dist/types/src/components/layout/page-title/__tests__/PageTitle.test.d.ts +1 -0
- package/dist/types/src/components/layout/page-title/__tests__/pageTitleStyle.test.d.ts +1 -0
- package/dist/types/src/components/navigation/context-tab/__tests__/ContextTab.test.d.ts +1 -0
- package/dist/types/src/components/navigation/context-tab/__tests__/useContextTabScroll.test.d.ts +1 -0
- package/dist/types/src/components/navigation/horizontal-tab/__tests__/HorizontalTab.test.d.ts +1 -0
- package/dist/types/src/components/navigation/pagination/__tests__/Pagination.navigation.test.d.ts +1 -0
- package/dist/types/src/components/navigation/vertical-tab/__tests__/VerticalTab.test.d.ts +1 -0
- package/dist/types/src/components/overlays/dropdown/__tests__/Dropdown.dnd.test.d.ts +1 -0
- package/dist/types/src/components/overlays/dropdown/__tests__/Dropdown.test.d.ts +1 -0
- package/dist/types/src/components/overlays/dropdown/__tests__/dropdownTestUtils.d.ts +3 -0
- package/dist/types/src/components/overlays/modal/__tests__/Modal.test.d.ts +1 -0
- package/dist/types/src/components/overlays/notification/MessageNotificationParts.d.ts +0 -1
- package/dist/types/src/components/overlays/notification/NotificationActionButtons.d.ts +0 -1
- package/dist/types/src/components/overlays/notification/__tests__/FloatingNotification.test.d.ts +1 -0
- package/dist/types/src/components/overlays/postcode-search-modal/PostcodeSearchModalTip.d.ts +1 -3
- package/dist/types/src/components/overlays/postcode-search-modal/__tests__/PostcodeSearchModal.viewport.test.d.ts +1 -0
- package/dist/types/src/components/overlays/tooltip/__tests__/Tooltip.test.d.ts +1 -0
- package/dist/types/src/components/tab/__tests__/TabButton.test.d.ts +1 -0
- package/dist/types/src/constant/date-picker.d.ts +2 -1
- package/dist/types/src/hooks/__tests__/useCallbackRef.test.d.ts +1 -0
- package/dist/types/src/hooks/__tests__/useMediaQuery.test.d.ts +1 -0
- package/dist/types/src/hooks/__tests__/usePortalState.ssr.test.d.ts +1 -0
- package/dist/types/src/hooks/dropdown/__tests__/dropdownHooks.test.d.ts +1 -0
- package/dist/types/src/types/component-meta.d.ts +2 -1
- package/dist/types/src/utils/dropdown/__tests__/multiSelect.test.d.ts +1 -0
- package/dist/types/src/utils/dropdown/multiSelect.d.ts +0 -20
- package/dist/types/src/utils/portal-position/__tests__/portalPosition.nullAnchor.test.d.ts +1 -0
- package/dist/ui-admin/assets/styles/style.css +15 -18
- package/package.json +3 -8
- package/dist/cjs/src/constant/index.js +0 -27
- package/dist/cjs/src/constant/size.js +0 -7
- package/dist/cjs/src/contexts/index.js +0 -16
- package/dist/esm/src/constant/index.js +0 -2
- package/dist/esm/src/constant/size.js +0 -1
- package/dist/esm/src/contexts/index.js +0 -1
- package/dist/temp/src/constant/index.d.ts +0 -2
- package/dist/temp/src/constant/index.js +0 -2
- package/dist/temp/src/constant/size.d.ts +0 -1
- package/dist/temp/src/constant/size.js +0 -1
- package/dist/temp/src/contexts/index.d.ts +0 -1
- package/dist/temp/src/contexts/index.js +0 -1
- package/dist/types/src/constant/index.d.ts +0 -2
- package/dist/types/src/constant/size.d.ts +0 -1
- package/dist/types/src/contexts/index.d.ts +0 -1
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
// @vitest-environment jsdom
|
|
2
|
+
//
|
|
3
|
+
// useContextTabScroll 위험 경로 — 위험 목록표 CS-xx.
|
|
4
|
+
// 하네스 컴포넌트(Pattern C)로 훅을 직접 마운트한다. ContextTab 쪽 버튼 연결은 ContextTab.test.ts(CT-06).
|
|
5
|
+
// jsdom 은 레이아웃을 계산하지 않으므로 마운트 시점 측정은 Element.prototype getter spy,
|
|
6
|
+
// 마운트 뒤 측정 변화는 bar 인스턴스에 값을 정의한 뒤 scroll·ResizeObserver 콜백으로 재계산시킨다.
|
|
7
|
+
// scroll-snap 정렬·smooth 스크롤의 최종 위치(CS-10)는 실제 레이아웃이 필요해 단위 불가 — E2E 후보.
|
|
8
|
+
import { createElement } from 'react';
|
|
9
|
+
import { createRoot } from 'react-dom/client';
|
|
10
|
+
import { act } from 'react-dom/test-utils';
|
|
11
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
12
|
+
import { useContextTabScroll } from '../useContextTabScroll';
|
|
13
|
+
globalThis.IS_REACT_ACT_ENVIRONMENT = true;
|
|
14
|
+
const EDGE_THRESHOLD = 1;
|
|
15
|
+
const CLIENT_WIDTH = 300;
|
|
16
|
+
const SCROLL_WIDTH = 1000;
|
|
17
|
+
const MIDDLE_SCROLL_LEFT = 400;
|
|
18
|
+
const END_SCROLL_LEFT = SCROLL_WIDTH - CLIENT_WIDTH;
|
|
19
|
+
const observers = [];
|
|
20
|
+
class ResizeObserverStub {
|
|
21
|
+
constructor(callback) {
|
|
22
|
+
this.record = { callback, targets: [], disconnected: false };
|
|
23
|
+
observers.push(this.record);
|
|
24
|
+
}
|
|
25
|
+
observe(target) {
|
|
26
|
+
this.record.targets.push(target);
|
|
27
|
+
}
|
|
28
|
+
unobserve() {
|
|
29
|
+
// 전체 해제(disconnect)만 검증 대상이다.
|
|
30
|
+
}
|
|
31
|
+
disconnect() {
|
|
32
|
+
this.record.disconnected = true;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
const SCROLL_METHODS = ['scrollTo', 'scrollBy'];
|
|
36
|
+
const METRIC_NAMES = ['scrollLeft', 'clientWidth', 'scrollWidth'];
|
|
37
|
+
const originalMetricGetters = new Map(METRIC_NAMES.map((name) => [name, Object.getOwnPropertyDescriptor(Element.prototype, name)?.get]));
|
|
38
|
+
const originalOffsetLeftGetter = Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'offsetLeft')?.get;
|
|
39
|
+
let scrollTo;
|
|
40
|
+
let scrollBy;
|
|
41
|
+
let root = null;
|
|
42
|
+
let container = null;
|
|
43
|
+
beforeEach(() => {
|
|
44
|
+
scrollTo = vi.fn();
|
|
45
|
+
scrollBy = vi.fn();
|
|
46
|
+
Object.defineProperty(HTMLElement.prototype, 'scrollTo', { configurable: true, writable: true, value: scrollTo });
|
|
47
|
+
Object.defineProperty(HTMLElement.prototype, 'scrollBy', { configurable: true, writable: true, value: scrollBy });
|
|
48
|
+
vi.stubGlobal('ResizeObserver', ResizeObserverStub);
|
|
49
|
+
});
|
|
50
|
+
afterEach(() => {
|
|
51
|
+
if (root) {
|
|
52
|
+
act(() => {
|
|
53
|
+
root?.unmount();
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
root = null;
|
|
57
|
+
container = null;
|
|
58
|
+
observers.length = 0;
|
|
59
|
+
document.body.innerHTML = '';
|
|
60
|
+
for (const method of SCROLL_METHODS) {
|
|
61
|
+
delete HTMLElement.prototype[method];
|
|
62
|
+
}
|
|
63
|
+
vi.restoreAllMocks();
|
|
64
|
+
vi.unstubAllGlobals();
|
|
65
|
+
latest = null;
|
|
66
|
+
});
|
|
67
|
+
let latest = null;
|
|
68
|
+
/** 훅 결과를 latest 로 노출하고 menus 수만큼 탭 자식을 그리는 관찰용 컴포넌트 */
|
|
69
|
+
const Harness = ({ activeTab, menus, visibleTabsCount, attachBar = true, renderTabs = true, }) => {
|
|
70
|
+
const result = useContextTabScroll({ activeTab: activeTab, menus, visibleTabsCount });
|
|
71
|
+
latest = result;
|
|
72
|
+
return createElement('div', { ref: attachBar ? result.barRef : undefined, className: 'bar' }, ...(renderTabs
|
|
73
|
+
? menus.map((menu, index) => createElement('span', { key: menu.id, 'data-id': menu.id, 'data-index': index }))
|
|
74
|
+
: []));
|
|
75
|
+
};
|
|
76
|
+
const render = (props) => {
|
|
77
|
+
if (!container) {
|
|
78
|
+
container = document.createElement('div');
|
|
79
|
+
document.body.appendChild(container);
|
|
80
|
+
root = createRoot(container);
|
|
81
|
+
}
|
|
82
|
+
act(() => {
|
|
83
|
+
root?.render(createElement(Harness, props));
|
|
84
|
+
});
|
|
85
|
+
return container;
|
|
86
|
+
};
|
|
87
|
+
const hook = () => latest;
|
|
88
|
+
const barOf = (view) => view.querySelector('.bar');
|
|
89
|
+
const menusOf = (count) => Array.from({ length: count }, (_, index) => ({ id: `m${index}` }));
|
|
90
|
+
const MENU_COUNT = 10;
|
|
91
|
+
const VISIBLE_COUNT = 3;
|
|
92
|
+
const MENUS = menusOf(MENU_COUNT);
|
|
93
|
+
/** 마운트 시점에 읽힐 측정값을 Element.prototype getter 로 고정한다. */
|
|
94
|
+
const stubMountMetrics = (metrics) => {
|
|
95
|
+
for (const name of METRIC_NAMES) {
|
|
96
|
+
vi.spyOn(Element.prototype, name, 'get').mockReturnValue(metrics[name]);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
/** 마운트 뒤 측정값 변화를 bar 인스턴스에 직접 정의한다. */
|
|
100
|
+
const defineMetrics = (element, metrics) => {
|
|
101
|
+
for (const [key, value] of Object.entries(metrics)) {
|
|
102
|
+
Object.defineProperty(element, key, { configurable: true, writable: true, value });
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
/** 측정값을 정의한 뒤 scroll 이벤트로 에지를 다시 계산시킨다. */
|
|
106
|
+
const scrollBarTo = (element, metrics) => {
|
|
107
|
+
defineMetrics(element, metrics);
|
|
108
|
+
act(() => {
|
|
109
|
+
element.dispatchEvent(new Event('scroll'));
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
const edges = () => ({ isBeginning: hook().isBeginning, isEnd: hook().isEnd });
|
|
113
|
+
const TAB_WIDTH = 120;
|
|
114
|
+
const SHRUNK_MENU_COUNT = 9;
|
|
115
|
+
const WIDER_VISIBLE_COUNT = 5;
|
|
116
|
+
const FRACTIONAL_VISIBLE_COUNT = 2.5;
|
|
117
|
+
/** m7 → 3개씩이면 페이지 시작 6, 5개씩이면 5 */
|
|
118
|
+
const PAGE_START_OF_M7_BY_3 = 6;
|
|
119
|
+
const PAGE_START_OF_M7_BY_5 = 5;
|
|
120
|
+
/** 2.5개씩이면 m7 → floor(7 / 2.5) * 2.5 = 5, m8 → floor(8 / 2.5) * 2.5 = 7.5 */
|
|
121
|
+
const PAGE_START_OF_M7_BY_2_5 = 5;
|
|
122
|
+
/** 각 탭 자식의 offsetLeft 를 data-index × TAB_WIDTH 로 둔다 (마운트 시점 effect 도 읽을 수 있게 prototype getter). */
|
|
123
|
+
const stubTabOffsets = () => {
|
|
124
|
+
vi.spyOn(HTMLElement.prototype, 'offsetLeft', 'get').mockImplementation(function () {
|
|
125
|
+
return Number(this.dataset.index ?? 0) * TAB_WIDTH;
|
|
126
|
+
});
|
|
127
|
+
};
|
|
128
|
+
const smoothTo = (left) => ({ left, behavior: 'smooth' });
|
|
129
|
+
describe('useContextTabScroll — 마운트 시 에지 계산 (CS-01)', () => {
|
|
130
|
+
it('CS-01 scrollLeft 0 이고 뒤에 더 있으면 isBeginning 만 true 다', () => {
|
|
131
|
+
stubMountMetrics({ scrollLeft: 0, clientWidth: CLIENT_WIDTH, scrollWidth: SCROLL_WIDTH });
|
|
132
|
+
render({ menus: MENUS, visibleTabsCount: VISIBLE_COUNT });
|
|
133
|
+
expect(edges()).toEqual({ isBeginning: true, isEnd: false });
|
|
134
|
+
});
|
|
135
|
+
it('CS-01 중간 위치면 isBeginning·isEnd 모두 false 다', () => {
|
|
136
|
+
stubMountMetrics({ scrollLeft: MIDDLE_SCROLL_LEFT, clientWidth: CLIENT_WIDTH, scrollWidth: SCROLL_WIDTH });
|
|
137
|
+
render({ menus: MENUS, visibleTabsCount: VISIBLE_COUNT });
|
|
138
|
+
expect(edges()).toEqual({ isBeginning: false, isEnd: false });
|
|
139
|
+
});
|
|
140
|
+
it('CS-01 끝까지 스크롤된 위치면 isEnd 만 true 다', () => {
|
|
141
|
+
stubMountMetrics({ scrollLeft: END_SCROLL_LEFT, clientWidth: CLIENT_WIDTH, scrollWidth: SCROLL_WIDTH });
|
|
142
|
+
render({ menus: MENUS, visibleTabsCount: VISIBLE_COUNT });
|
|
143
|
+
expect(edges()).toEqual({ isBeginning: false, isEnd: true });
|
|
144
|
+
});
|
|
145
|
+
it('CS-01 시작 판정은 scrollLeft 1px 까지 true, 1px 을 넘으면 false 다', () => {
|
|
146
|
+
stubMountMetrics({ scrollLeft: EDGE_THRESHOLD, clientWidth: CLIENT_WIDTH, scrollWidth: SCROLL_WIDTH });
|
|
147
|
+
const view = render({ menus: MENUS, visibleTabsCount: VISIBLE_COUNT });
|
|
148
|
+
expect(hook().isBeginning).toBe(true);
|
|
149
|
+
scrollBarTo(barOf(view), { scrollLeft: EDGE_THRESHOLD + EDGE_THRESHOLD });
|
|
150
|
+
expect(hook().isBeginning).toBe(false);
|
|
151
|
+
});
|
|
152
|
+
it('CS-01 끝 판정은 남은 거리 1px 까지 true, 1px 을 넘으면 false 다', () => {
|
|
153
|
+
stubMountMetrics({
|
|
154
|
+
scrollLeft: END_SCROLL_LEFT - EDGE_THRESHOLD,
|
|
155
|
+
clientWidth: CLIENT_WIDTH,
|
|
156
|
+
scrollWidth: SCROLL_WIDTH,
|
|
157
|
+
});
|
|
158
|
+
const view = render({ menus: MENUS, visibleTabsCount: VISIBLE_COUNT });
|
|
159
|
+
expect(hook().isEnd).toBe(true);
|
|
160
|
+
scrollBarTo(barOf(view), { scrollLeft: END_SCROLL_LEFT - EDGE_THRESHOLD - EDGE_THRESHOLD });
|
|
161
|
+
expect(hook().isEnd).toBe(false);
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
describe('useContextTabScroll — scroll·리사이즈 시 재계산 (CS-02)', () => {
|
|
165
|
+
it('CS-02 bar 의 scroll 이벤트마다 에지를 다시 계산한다', () => {
|
|
166
|
+
const view = render({ menus: MENUS, visibleTabsCount: VISIBLE_COUNT });
|
|
167
|
+
const bar = barOf(view);
|
|
168
|
+
expect(edges()).toEqual({ isBeginning: true, isEnd: true });
|
|
169
|
+
scrollBarTo(bar, { scrollLeft: MIDDLE_SCROLL_LEFT, clientWidth: CLIENT_WIDTH, scrollWidth: SCROLL_WIDTH });
|
|
170
|
+
expect(edges()).toEqual({ isBeginning: false, isEnd: false });
|
|
171
|
+
scrollBarTo(bar, { scrollLeft: END_SCROLL_LEFT });
|
|
172
|
+
expect(edges()).toEqual({ isBeginning: false, isEnd: true });
|
|
173
|
+
});
|
|
174
|
+
it('CS-02 ResizeObserver 로 bar 를 관찰하고 콜백이 오면 에지를 다시 계산한다', () => {
|
|
175
|
+
const view = render({ menus: MENUS, visibleTabsCount: VISIBLE_COUNT });
|
|
176
|
+
const bar = barOf(view);
|
|
177
|
+
const [observer] = observers;
|
|
178
|
+
expect(observer.targets).toEqual([bar]);
|
|
179
|
+
defineMetrics(bar, { scrollLeft: 0, clientWidth: CLIENT_WIDTH, scrollWidth: SCROLL_WIDTH });
|
|
180
|
+
act(() => {
|
|
181
|
+
observer.callback();
|
|
182
|
+
});
|
|
183
|
+
expect(edges()).toEqual({ isBeginning: true, isEnd: false });
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
describe('useContextTabScroll — 페이지 단위 스크롤 (CS-03)', () => {
|
|
187
|
+
it('CS-03 scrollByPage(1) 은 보이는 폭만큼 오른쪽으로 smooth scrollBy 한다', () => {
|
|
188
|
+
const view = render({ menus: MENUS, visibleTabsCount: VISIBLE_COUNT });
|
|
189
|
+
defineMetrics(barOf(view), { clientWidth: CLIENT_WIDTH });
|
|
190
|
+
act(() => {
|
|
191
|
+
hook().scrollByPage(1);
|
|
192
|
+
});
|
|
193
|
+
expect(scrollBy).toHaveBeenCalledWith({ left: CLIENT_WIDTH, behavior: 'smooth' });
|
|
194
|
+
});
|
|
195
|
+
it('CS-03 scrollByPage(-1) 은 보이는 폭만큼 왼쪽으로 smooth scrollBy 한다', () => {
|
|
196
|
+
const view = render({ menus: MENUS, visibleTabsCount: VISIBLE_COUNT });
|
|
197
|
+
defineMetrics(barOf(view), { clientWidth: CLIENT_WIDTH });
|
|
198
|
+
act(() => {
|
|
199
|
+
hook().scrollByPage(-1);
|
|
200
|
+
});
|
|
201
|
+
expect(scrollBy).toHaveBeenCalledWith({ left: -CLIENT_WIDTH, behavior: 'smooth' });
|
|
202
|
+
});
|
|
203
|
+
});
|
|
204
|
+
describe('useContextTabScroll — 활성 탭 자동 스크롤 (CS-04)', () => {
|
|
205
|
+
it('CS-04 마운트 시 활성 탭이 속한 페이지의 첫 탭 offsetLeft 로 smooth scrollTo 한다', () => {
|
|
206
|
+
stubTabOffsets();
|
|
207
|
+
render({ activeTab: 'm7', menus: MENUS, visibleTabsCount: VISIBLE_COUNT });
|
|
208
|
+
expect(scrollTo).toHaveBeenCalledWith(smoothTo(PAGE_START_OF_M7_BY_3 * TAB_WIDTH));
|
|
209
|
+
});
|
|
210
|
+
it('CS-04 activeTab 이 바뀌면 새 활성 탭의 페이지로 다시 스크롤한다', () => {
|
|
211
|
+
stubTabOffsets();
|
|
212
|
+
render({ activeTab: 'm7', menus: MENUS, visibleTabsCount: VISIBLE_COUNT });
|
|
213
|
+
render({ activeTab: 'm1', menus: MENUS, visibleTabsCount: VISIBLE_COUNT });
|
|
214
|
+
expect(scrollTo).toHaveBeenLastCalledWith(smoothTo(0));
|
|
215
|
+
});
|
|
216
|
+
it('CS-04 visibleTabsCount 가 바뀌면 새 페이지 크기로 다시 계산한다', () => {
|
|
217
|
+
stubTabOffsets();
|
|
218
|
+
render({ activeTab: 'm7', menus: MENUS, visibleTabsCount: VISIBLE_COUNT });
|
|
219
|
+
render({ activeTab: 'm7', menus: MENUS, visibleTabsCount: WIDER_VISIBLE_COUNT });
|
|
220
|
+
expect(scrollTo).toHaveBeenLastCalledWith(smoothTo(PAGE_START_OF_M7_BY_5 * TAB_WIDTH));
|
|
221
|
+
});
|
|
222
|
+
it('CS-04 menus 배열 식별자만 바뀐 리렌더에서는 다시 스크롤하지 않는다', () => {
|
|
223
|
+
stubTabOffsets();
|
|
224
|
+
render({ activeTab: 'm7', menus: MENUS, visibleTabsCount: VISIBLE_COUNT });
|
|
225
|
+
scrollTo.mockClear();
|
|
226
|
+
render({ activeTab: 'm7', menus: [...MENUS], visibleTabsCount: VISIBLE_COUNT });
|
|
227
|
+
expect(scrollTo).not.toHaveBeenCalled();
|
|
228
|
+
});
|
|
229
|
+
});
|
|
230
|
+
describe('useContextTabScroll — 자동 스크롤 가드 (CS-05)', () => {
|
|
231
|
+
it('CS-05 activeTab 이 undefined 면 scrollTo 를 호출하지 않는다', () => {
|
|
232
|
+
render({ menus: MENUS, visibleTabsCount: VISIBLE_COUNT });
|
|
233
|
+
expect(scrollTo).not.toHaveBeenCalled();
|
|
234
|
+
});
|
|
235
|
+
it('CS-05 activeTab 이 null 이어도 scrollTo 를 호출하지 않는다', () => {
|
|
236
|
+
render({ activeTab: null, menus: MENUS, visibleTabsCount: VISIBLE_COUNT });
|
|
237
|
+
expect(scrollTo).not.toHaveBeenCalled();
|
|
238
|
+
});
|
|
239
|
+
it('CS-05 menus 에 없는 id 면 scrollTo 를 호출하지 않는다', () => {
|
|
240
|
+
render({ activeTab: 'unknown', menus: MENUS, visibleTabsCount: VISIBLE_COUNT });
|
|
241
|
+
expect(scrollTo).not.toHaveBeenCalled();
|
|
242
|
+
});
|
|
243
|
+
it('CS-05 페이지 시작 위치에 탭 자식이 없으면 scrollTo 를 호출하지 않는다', () => {
|
|
244
|
+
render({ activeTab: 'm7', menus: MENUS, visibleTabsCount: VISIBLE_COUNT, renderTabs: false });
|
|
245
|
+
expect(scrollTo).not.toHaveBeenCalled();
|
|
246
|
+
});
|
|
247
|
+
});
|
|
248
|
+
describe('useContextTabScroll — 리스너 재구독·정리 (CS-06)', () => {
|
|
249
|
+
it('CS-06 menus.length 가 바뀌면 이전 scroll 리스너·observer 를 정리하고 다시 구독한다', () => {
|
|
250
|
+
const view = render({ menus: MENUS, visibleTabsCount: VISIBLE_COUNT });
|
|
251
|
+
const bar = barOf(view);
|
|
252
|
+
const addListener = vi.spyOn(bar, 'addEventListener');
|
|
253
|
+
const removeListener = vi.spyOn(bar, 'removeEventListener');
|
|
254
|
+
render({ menus: menusOf(SHRUNK_MENU_COUNT), visibleTabsCount: VISIBLE_COUNT });
|
|
255
|
+
const [first, second] = observers;
|
|
256
|
+
expect(removeListener).toHaveBeenCalledWith('scroll', expect.any(Function));
|
|
257
|
+
expect(addListener).toHaveBeenCalledWith('scroll', expect.any(Function), { passive: true });
|
|
258
|
+
expect(first.disconnected).toBe(true);
|
|
259
|
+
expect(second.disconnected).toBe(false);
|
|
260
|
+
expect(second.targets).toEqual([bar]);
|
|
261
|
+
});
|
|
262
|
+
it('CS-06 visibleTabsCount 가 바뀌어도 다시 구독한다', () => {
|
|
263
|
+
render({ menus: MENUS, visibleTabsCount: VISIBLE_COUNT });
|
|
264
|
+
render({ menus: MENUS, visibleTabsCount: WIDER_VISIBLE_COUNT });
|
|
265
|
+
expect(observers.map((observer) => observer.disconnected)).toEqual([true, false]);
|
|
266
|
+
});
|
|
267
|
+
it('CS-06 길이·노출 수가 같으면 menus 배열이 새로 와도 다시 구독하지 않는다', () => {
|
|
268
|
+
render({ menus: MENUS, visibleTabsCount: VISIBLE_COUNT });
|
|
269
|
+
render({ menus: [...MENUS], visibleTabsCount: VISIBLE_COUNT });
|
|
270
|
+
expect(observers).toHaveLength(1);
|
|
271
|
+
expect(observers[0].disconnected).toBe(false);
|
|
272
|
+
});
|
|
273
|
+
it('CS-06 언마운트하면 scroll 리스너를 해제하고 observer 를 disconnect 한다', () => {
|
|
274
|
+
const view = render({ menus: MENUS, visibleTabsCount: VISIBLE_COUNT });
|
|
275
|
+
const bar = barOf(view);
|
|
276
|
+
const removeListener = vi.spyOn(bar, 'removeEventListener');
|
|
277
|
+
act(() => {
|
|
278
|
+
root?.unmount();
|
|
279
|
+
});
|
|
280
|
+
root = null;
|
|
281
|
+
expect(removeListener).toHaveBeenCalledWith('scroll', expect.any(Function));
|
|
282
|
+
expect(observers[0].disconnected).toBe(true);
|
|
283
|
+
});
|
|
284
|
+
it('CS-06 언마운트 뒤 늦게 도착한 ResizeObserver 콜백은 bar 가 없어 예외 없이 무시한다', () => {
|
|
285
|
+
render({ menus: MENUS, visibleTabsCount: VISIBLE_COUNT });
|
|
286
|
+
const [observer] = observers;
|
|
287
|
+
act(() => {
|
|
288
|
+
root?.unmount();
|
|
289
|
+
});
|
|
290
|
+
root = null;
|
|
291
|
+
expect(() => observer.callback()).not.toThrow();
|
|
292
|
+
});
|
|
293
|
+
});
|
|
294
|
+
describe('useContextTabScroll — barRef 미부착 (CS-07)', () => {
|
|
295
|
+
it('CS-07 barRef 를 붙이지 않으면 isBeginning·isEnd 는 초기값 true 이고 구독하지 않는다', () => {
|
|
296
|
+
render({ menus: MENUS, visibleTabsCount: VISIBLE_COUNT, attachBar: false });
|
|
297
|
+
expect(edges()).toEqual({ isBeginning: true, isEnd: true });
|
|
298
|
+
expect(observers).toHaveLength(0);
|
|
299
|
+
});
|
|
300
|
+
it('CS-07 barRef 가 없으면 scrollByPage·자동 스크롤이 예외 없이 아무것도 하지 않는다', () => {
|
|
301
|
+
render({ activeTab: 'm7', menus: MENUS, visibleTabsCount: VISIBLE_COUNT, attachBar: false });
|
|
302
|
+
expect(() => act(() => {
|
|
303
|
+
hook().scrollByPage(1);
|
|
304
|
+
})).not.toThrow();
|
|
305
|
+
expect(scrollBy).not.toHaveBeenCalled();
|
|
306
|
+
expect(scrollTo).not.toHaveBeenCalled();
|
|
307
|
+
});
|
|
308
|
+
});
|
|
309
|
+
describe('useContextTabScroll — menus 지연 도착 (CS-08)', () => {
|
|
310
|
+
it('CS-08 menus 가 마운트 뒤에 도착하면 activeTab 이 지정돼 있어도 활성 탭 페이지로 스크롤하지 않는다', () => {
|
|
311
|
+
// 현재 동작 고정 — 결함 후보: #593 (자동 스크롤 effect deps 가 [activeTab, visibleTabsCount] 뿐)
|
|
312
|
+
stubTabOffsets();
|
|
313
|
+
// ContextTab 은 menus 가 2개 미만이면 bar 를 그리지 않는다 — 처음엔 bar 없이 마운트.
|
|
314
|
+
render({ activeTab: 'm8', menus: [], visibleTabsCount: VISIBLE_COUNT, attachBar: false });
|
|
315
|
+
render({ activeTab: 'm8', menus: MENUS, visibleTabsCount: VISIBLE_COUNT });
|
|
316
|
+
expect(barOf(container).children).toHaveLength(MENU_COUNT);
|
|
317
|
+
expect(scrollTo).not.toHaveBeenCalled();
|
|
318
|
+
});
|
|
319
|
+
it.todo('CS-08 bar 가 처음 생기거나 활성 탭 인덱스가 처음 확정될 때 활성 탭 페이지로 1회 스크롤한다 (#593)');
|
|
320
|
+
});
|
|
321
|
+
describe('useContextTabScroll — visibleTabsCount 검증 없음 (CS-09)', () => {
|
|
322
|
+
it('CS-09 visibleTabsCount 0 이면 페이지 시작이 NaN 이 돼 자동 스크롤하지 않는다', () => {
|
|
323
|
+
// 현재 동작 고정 — 결함 후보: #593 (visibleTabsCount 를 1 이상 정수로 검증·보정하지 않음)
|
|
324
|
+
stubTabOffsets();
|
|
325
|
+
render({ activeTab: 'm7', menus: MENUS, visibleTabsCount: 0 });
|
|
326
|
+
expect(scrollTo).not.toHaveBeenCalled();
|
|
327
|
+
});
|
|
328
|
+
it('CS-09 비정수(2.5)에서 페이지 시작이 소수(m8 → 7.5)면 해당 탭이 없어 스크롤하지 않는다', () => {
|
|
329
|
+
// 현재 동작 고정 — 결함 후보: #593 (visibleTabsCount 를 1 이상 정수로 검증·보정하지 않음)
|
|
330
|
+
stubTabOffsets();
|
|
331
|
+
render({ activeTab: 'm8', menus: MENUS, visibleTabsCount: FRACTIONAL_VISIBLE_COUNT });
|
|
332
|
+
expect(scrollTo).not.toHaveBeenCalled();
|
|
333
|
+
});
|
|
334
|
+
it('CS-09 비정수(2.5)에서 페이지 시작이 정수(m7 → 5)면 5번째 탭으로 스크롤한다', () => {
|
|
335
|
+
// 현재 동작 고정 — 결함 후보: #593 (visibleTabsCount 를 1 이상 정수로 검증·보정하지 않음)
|
|
336
|
+
stubTabOffsets();
|
|
337
|
+
render({ activeTab: 'm7', menus: MENUS, visibleTabsCount: FRACTIONAL_VISIBLE_COUNT });
|
|
338
|
+
expect(scrollTo).toHaveBeenCalledWith(smoothTo(PAGE_START_OF_M7_BY_2_5 * TAB_WIDTH));
|
|
339
|
+
});
|
|
340
|
+
it.todo('CS-09 visibleTabsCount 를 1 이상 정수로 보정(또는 기본값 대체)해 0·비정수에서도 활성 탭 페이지로 스크롤한다 (#593)');
|
|
341
|
+
});
|
|
342
|
+
describe('useContextTabScroll — 테스트 격리', () => {
|
|
343
|
+
it('측정값·offsetLeft getter spy 는 restoreAllMocks 로 원래 getter 로 돌아간다', () => {
|
|
344
|
+
stubMountMetrics({ scrollLeft: 0, clientWidth: CLIENT_WIDTH, scrollWidth: SCROLL_WIDTH });
|
|
345
|
+
stubTabOffsets();
|
|
346
|
+
vi.restoreAllMocks();
|
|
347
|
+
for (const name of METRIC_NAMES) {
|
|
348
|
+
expect(Object.getOwnPropertyDescriptor(Element.prototype, name)?.get).toBe(originalMetricGetters.get(name));
|
|
349
|
+
}
|
|
350
|
+
expect(Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'offsetLeft')?.get).toBe(originalOffsetLeftGetter);
|
|
351
|
+
});
|
|
352
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
// @vitest-environment jsdom
|
|
2
|
+
//
|
|
3
|
+
// HorizontalTab (src/components/navigation/horizontal-tab/HorizontalTab.tsx) 위험 경로 — 위험 목록표 HT-xx.
|
|
4
|
+
// swiper/react 는 mock — Swiper 는 받은 props 를 기록하고 children 을 div 로, SwiperSlide 는
|
|
5
|
+
// className 을 가진 div 로 렌더한다 (슬라이드 계산은 swiper 소관). TabButton 은 실구현.
|
|
6
|
+
import { createElement } from 'react';
|
|
7
|
+
import { createRoot } from 'react-dom/client';
|
|
8
|
+
import { act } from 'react-dom/test-utils';
|
|
9
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
10
|
+
const mocks = vi.hoisted(() => ({
|
|
11
|
+
swiperProps: vi.fn(),
|
|
12
|
+
}));
|
|
13
|
+
vi.mock('swiper/react', async () => {
|
|
14
|
+
const { createElement: h } = await import('react');
|
|
15
|
+
return {
|
|
16
|
+
Swiper: ({ children, ...props }) => {
|
|
17
|
+
mocks.swiperProps(props);
|
|
18
|
+
return h('div', { className: 'swiper-mock' }, children);
|
|
19
|
+
},
|
|
20
|
+
SwiperSlide: ({ children, className }) => h('div', { className }, children),
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
import { HorizontalTab } from '../HorizontalTab';
|
|
24
|
+
globalThis.IS_REACT_ACT_ENVIRONMENT = true;
|
|
25
|
+
const UNDERLINE_GAP = 16;
|
|
26
|
+
const DEFAULT_GAP = 8;
|
|
27
|
+
let root = null;
|
|
28
|
+
let container = null;
|
|
29
|
+
beforeEach(() => {
|
|
30
|
+
mocks.swiperProps.mockReset();
|
|
31
|
+
});
|
|
32
|
+
afterEach(() => {
|
|
33
|
+
if (root) {
|
|
34
|
+
act(() => {
|
|
35
|
+
root?.unmount();
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
root = null;
|
|
39
|
+
container?.remove();
|
|
40
|
+
container = null;
|
|
41
|
+
vi.restoreAllMocks();
|
|
42
|
+
});
|
|
43
|
+
const render = (props) => {
|
|
44
|
+
if (!container) {
|
|
45
|
+
container = document.createElement('div');
|
|
46
|
+
document.body.appendChild(container);
|
|
47
|
+
root = createRoot(container);
|
|
48
|
+
}
|
|
49
|
+
act(() => {
|
|
50
|
+
root?.render(createElement(HorizontalTab, props));
|
|
51
|
+
});
|
|
52
|
+
return container;
|
|
53
|
+
};
|
|
54
|
+
const click = (element) => {
|
|
55
|
+
act(() => {
|
|
56
|
+
element.click();
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
const tabs = (view) => Array.from(view.querySelectorAll('.ncua-tab-button'));
|
|
60
|
+
const activeLabels = (view) => tabs(view)
|
|
61
|
+
.filter((tab) => tab.classList.contains('is-active'))
|
|
62
|
+
.map((tab) => tab.textContent);
|
|
63
|
+
const buttonMenus = (onClick) => [
|
|
64
|
+
{ id: 'order', label: '주문', onClick },
|
|
65
|
+
{ id: 'claim', label: '클레임', onClick },
|
|
66
|
+
{ id: 'settle', label: '정산', onClick },
|
|
67
|
+
];
|
|
68
|
+
describe('HorizontalTab — 탭 목록과 활성 탭 (HT-01)', () => {
|
|
69
|
+
it('HT-01 menus 를 슬라이드마다 TabButton 으로 렌더하고 activeTab 과 id 가 같은 탭만 is-active', () => {
|
|
70
|
+
const view = render({ menus: buttonMenus(), activeTab: 'claim' });
|
|
71
|
+
expect(view.querySelectorAll('.ncua-horizontal-tab__item')).toHaveLength(buttonMenus().length);
|
|
72
|
+
expect(tabs(view).map((tab) => tab.textContent)).toEqual(['주문', '클레임', '정산']);
|
|
73
|
+
expect(activeLabels(view)).toEqual(['클레임']);
|
|
74
|
+
});
|
|
75
|
+
it('HT-01 링크 메뉴는 id 가 아니라 href 를 activeTab 과 비교한다', () => {
|
|
76
|
+
const menus = [
|
|
77
|
+
{ id: 'order', label: '주문', href: '/orders' },
|
|
78
|
+
{ id: '/claims', label: '클레임', href: '/claims-list' },
|
|
79
|
+
];
|
|
80
|
+
const view = render({ menus, activeTab: '/orders' });
|
|
81
|
+
expect(activeLabels(view)).toEqual(['주문']);
|
|
82
|
+
});
|
|
83
|
+
it('HT-01 activeTab 이 어떤 탭과도 맞지 않으면 활성 탭이 없다', () => {
|
|
84
|
+
const view = render({ menus: buttonMenus(), activeTab: 'none' });
|
|
85
|
+
expect(activeLabels(view)).toEqual([]);
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
describe('HorizontalTab — 탭 click (HT-02)', () => {
|
|
89
|
+
it('HT-02 탭을 click 하면 그 메뉴의 onClick 을 그 메뉴 id 로 호출한다', () => {
|
|
90
|
+
const onClick = vi.fn();
|
|
91
|
+
const view = render({ menus: buttonMenus(onClick), activeTab: 'order' });
|
|
92
|
+
click(tabs(view)[2]);
|
|
93
|
+
expect(onClick).toHaveBeenCalledWith('settle');
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
describe('HorizontalTab — 빈 메뉴 (HT-03)', () => {
|
|
97
|
+
it.each([
|
|
98
|
+
['빈 배열', { menus: [] }],
|
|
99
|
+
['미지정', {}],
|
|
100
|
+
])('HT-03 menus 가 %s 이면 아무것도 렌더하지 않는다', (_label, props) => {
|
|
101
|
+
const view = render(props);
|
|
102
|
+
expect(view.innerHTML).toBe('');
|
|
103
|
+
expect(mocks.swiperProps).not.toHaveBeenCalled();
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
describe('HorizontalTab — 슬라이드 간격 (HT-04)', () => {
|
|
107
|
+
it.each([
|
|
108
|
+
['underline', UNDERLINE_GAP],
|
|
109
|
+
['button-primary', DEFAULT_GAP],
|
|
110
|
+
['button-white', DEFAULT_GAP],
|
|
111
|
+
['underline-fill', DEFAULT_GAP],
|
|
112
|
+
])('HT-04 type %s 면 Swiper 를 slidesPerView auto · spaceBetween %i 로 만든다', (type, gap) => {
|
|
113
|
+
render({ type, menus: buttonMenus() });
|
|
114
|
+
expect(mocks.swiperProps.mock.lastCall?.[0]).toEqual({ slidesPerView: 'auto', spaceBetween: gap });
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
describe('HorizontalTab — 재렌더 시 탭 재마운트 (HT-05)', () => {
|
|
118
|
+
it('HT-05 activeTab 이 바뀌어 다시 렌더하면 모든 탭 버튼이 새 노드로 바뀌어 포커스를 잃는다', () => {
|
|
119
|
+
// 현재 동작 고정 — 결함 후보: #597 (슬라이드 key 가 렌더마다 새 uniqueId 라 재렌더마다 재마운트, 키보드 포커스 유실)
|
|
120
|
+
const view = render({ menus: buttonMenus(), activeTab: 'order' });
|
|
121
|
+
const before = tabs(view)[1];
|
|
122
|
+
before.focus();
|
|
123
|
+
expect(document.activeElement).toBe(before);
|
|
124
|
+
render({ menus: buttonMenus(), activeTab: 'claim' });
|
|
125
|
+
expect(before.isConnected).toBe(false);
|
|
126
|
+
expect(tabs(view)[1]).not.toBe(before);
|
|
127
|
+
expect(document.activeElement).toBe(document.body);
|
|
128
|
+
});
|
|
129
|
+
it.todo('HT-05 activeTab 이 바뀌어도 탭 버튼 노드와 포커스가 유지된다 (기대, #597)');
|
|
130
|
+
});
|
|
131
|
+
describe('HorizontalTab — 클래스와 TabButton 전달 (HT-06)', () => {
|
|
132
|
+
it('HT-06 기본은 button-primary · sm 클래스이고 full-width 는 없다', () => {
|
|
133
|
+
const view = render({ menus: buttonMenus() });
|
|
134
|
+
const rootElement = view.querySelector('.ncua-horizontal-tab');
|
|
135
|
+
expect(rootElement?.classList.contains('ncua-horizontal-tab--button-primary')).toBe(true);
|
|
136
|
+
expect(rootElement?.classList.contains('ncua-horizontal-tab--sm')).toBe(true);
|
|
137
|
+
expect(rootElement?.classList.contains('full-width')).toBe(false);
|
|
138
|
+
});
|
|
139
|
+
it('HT-06 type·size·fullWidth·className 을 루트 클래스로 반영한다', () => {
|
|
140
|
+
const view = render({ menus: buttonMenus(), type: 'underline', size: 'lg', fullWidth: true, className: 'my-tabs' });
|
|
141
|
+
const rootElement = view.querySelector('.ncua-horizontal-tab');
|
|
142
|
+
expect(rootElement?.classList.contains('ncua-horizontal-tab--underline')).toBe(true);
|
|
143
|
+
expect(rootElement?.classList.contains('ncua-horizontal-tab--lg')).toBe(true);
|
|
144
|
+
expect(rootElement?.classList.contains('full-width')).toBe(true);
|
|
145
|
+
expect(rootElement?.classList.contains('my-tabs')).toBe(true);
|
|
146
|
+
});
|
|
147
|
+
it('HT-06 TabButton 에 넘기는 size·tabButtonType 은 DOM 속성으로 새지 않는다', () => {
|
|
148
|
+
const view = render({ menus: buttonMenus(), type: 'underline', size: 'lg' });
|
|
149
|
+
expect(tabs(view)[0].hasAttribute('size')).toBe(false);
|
|
150
|
+
expect(tabs(view)[0].hasAttribute('tabbuttontype')).toBe(false);
|
|
151
|
+
});
|
|
152
|
+
});
|
package/dist/temp/src/components/navigation/pagination/__tests__/Pagination.navigation.test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|