@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,292 @@
|
|
|
1
|
+
// @vitest-environment jsdom
|
|
2
|
+
//
|
|
3
|
+
// React ImageFileInput 선택 · 삭제 · 검증 · 찾기 · 표시 — 위험 목록표 RIF-xx (PR-7d).
|
|
4
|
+
// 저장 이미지(uploadedFiles) 미리보기 · 슬롯 합산 · disabled 는 ImageFileInput.test.ts 가 덮는다.
|
|
5
|
+
// 하위 컴포넌트(Button · Tooltip · ImagePreview · useObjectUrl)는 실구현을 쓴다.
|
|
6
|
+
import { createElement } from 'react';
|
|
7
|
+
import { createRoot } from 'react-dom/client';
|
|
8
|
+
import { act } from 'react-dom/test-utils';
|
|
9
|
+
import { afterEach, describe, expect, it, vi } from 'vitest';
|
|
10
|
+
import { browseButton, createFileFactory, fileInputOf, indexesIn, lastFilesOf, mockObjectUrls, selectFiles as selectFilesIn, } from '../../../../__tests__/helpers/fileInput';
|
|
11
|
+
import { ImageFileInput, ImageFileInputErrorType } from '../ImageFileInput';
|
|
12
|
+
globalThis.IS_REACT_ACT_ENVIRONMENT = true;
|
|
13
|
+
const MAX_FILE_SIZE = 8;
|
|
14
|
+
const OVER_SIZE = 16;
|
|
15
|
+
const MAX_COUNT = 3;
|
|
16
|
+
const LAST_MODIFIED = 1700000000000;
|
|
17
|
+
mockObjectUrls();
|
|
18
|
+
const mounted = [];
|
|
19
|
+
afterEach(() => {
|
|
20
|
+
for (const { root, container } of mounted.splice(0)) {
|
|
21
|
+
act(() => {
|
|
22
|
+
root.unmount();
|
|
23
|
+
});
|
|
24
|
+
container.remove();
|
|
25
|
+
}
|
|
26
|
+
document.getElementById('tooltip-global-layer')?.remove();
|
|
27
|
+
vi.restoreAllMocks();
|
|
28
|
+
});
|
|
29
|
+
/* ========== 공통 헬퍼 ========== */
|
|
30
|
+
const mount = (props) => {
|
|
31
|
+
const container = document.createElement('div');
|
|
32
|
+
document.body.appendChild(container);
|
|
33
|
+
const root = createRoot(container);
|
|
34
|
+
const render = (nextProps) => {
|
|
35
|
+
act(() => {
|
|
36
|
+
root.render(createElement(ImageFileInput, nextProps));
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
render(props);
|
|
40
|
+
mounted.push({ root, container });
|
|
41
|
+
return { container, rerender: render };
|
|
42
|
+
};
|
|
43
|
+
const makeFile = createFileFactory({ type: 'image/png', lastModified: LAST_MODIFIED });
|
|
44
|
+
const selectFiles = (container, filesToSelect) => selectFilesIn(container, filesToSelect, act);
|
|
45
|
+
const previewImages = (container) => Array.from(container.querySelectorAll('.ncua-image-file-input__preview-image'));
|
|
46
|
+
const removeButtons = (container) => Array.from(container.querySelectorAll('.ncua-image-file-input__preview-remove-button'));
|
|
47
|
+
const emptySlotWrapper = (container) => container.querySelector('.ncua-image-file-input__empty-slot-wrapper');
|
|
48
|
+
/** 요소가 없으면 throw 한다 — 선택적 체이닝은 요소 부재에도 이후 단언이 통과해 버린다 */
|
|
49
|
+
const clickElement = (element) => {
|
|
50
|
+
if (!element)
|
|
51
|
+
throw new Error('클릭할 요소를 찾지 못했습니다');
|
|
52
|
+
act(() => {
|
|
53
|
+
element.click();
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
/* ========== P0 — uncontrolled · 삭제 · 크기 검증 · 찾기 ========== */
|
|
57
|
+
describe('RIF-01 uncontrolled(value 없음)', () => {
|
|
58
|
+
it('RIF-01 선택하면 내부 목록으로 onFileSelect 를 부르고 미리보기를 표시한다', () => {
|
|
59
|
+
const onFileSelect = vi.fn();
|
|
60
|
+
const { container } = mount({ onFileSelect, maxFileCount: MAX_COUNT });
|
|
61
|
+
const picked = makeFile('a.png');
|
|
62
|
+
selectFiles(container, [picked]);
|
|
63
|
+
expect(indexesIn([picked], lastFilesOf(onFileSelect))).toEqual([0]);
|
|
64
|
+
expect(previewImages(container).map((img) => img.getAttribute('src'))).toEqual(['blob:mock/1']);
|
|
65
|
+
});
|
|
66
|
+
it('RIF-01 다시 고르면 내부 목록에 누적한다', () => {
|
|
67
|
+
const onFileSelect = vi.fn();
|
|
68
|
+
const { container } = mount({ onFileSelect, maxFileCount: MAX_COUNT });
|
|
69
|
+
const first = makeFile('first.png');
|
|
70
|
+
const second = makeFile('second.png');
|
|
71
|
+
selectFiles(container, [first]);
|
|
72
|
+
selectFiles(container, [second]);
|
|
73
|
+
expect(indexesIn([first, second], lastFilesOf(onFileSelect))).toEqual([0, 1]);
|
|
74
|
+
expect(previewImages(container)).toHaveLength(2);
|
|
75
|
+
});
|
|
76
|
+
it('RIF-01 새 파일을 삭제하면 나머지로 onFileSelect 를 부르고 미리보기가 줄어든다', () => {
|
|
77
|
+
const onFileSelect = vi.fn();
|
|
78
|
+
const { container } = mount({ onFileSelect, multiple: true, maxFileCount: MAX_COUNT });
|
|
79
|
+
const first = makeFile('first.png');
|
|
80
|
+
const second = makeFile('second.png');
|
|
81
|
+
selectFiles(container, [first, second]);
|
|
82
|
+
clickElement(removeButtons(container)[0]);
|
|
83
|
+
expect(indexesIn([second], lastFilesOf(onFileSelect))).toEqual([0]);
|
|
84
|
+
expect(previewImages(container).map((img) => img.alt)).toEqual(['second.png']);
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
describe('RIF-02 controlled 새 파일 삭제', () => {
|
|
88
|
+
it('RIF-02 미리보기 삭제는 그 index 를 뺀 목록으로 onChange 를 부른다', () => {
|
|
89
|
+
const onChange = vi.fn();
|
|
90
|
+
const first = makeFile('first.png');
|
|
91
|
+
const second = makeFile('second.png');
|
|
92
|
+
const { container } = mount({ value: [first, second], onChange, maxFileCount: MAX_COUNT });
|
|
93
|
+
clickElement(removeButtons(container)[1]);
|
|
94
|
+
expect(indexesIn([first], lastFilesOf(onChange))).toEqual([0]);
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
describe('RIF-03 maxFileSize 초과', () => {
|
|
98
|
+
it('RIF-03 EXCEED_MAX_FILE_SIZE 로 onFail 을 부르고 항목이 파일 정보를 보존한다', () => {
|
|
99
|
+
const onFail = vi.fn();
|
|
100
|
+
const onFileSelect = vi.fn();
|
|
101
|
+
const { container } = mount({ onFail, onFileSelect, maxFileSize: MAX_FILE_SIZE });
|
|
102
|
+
selectFiles(container, [makeFile('big.png', OVER_SIZE)]);
|
|
103
|
+
const [item] = onFail.mock.calls[0][0];
|
|
104
|
+
expect(item.errorType).toBe(ImageFileInputErrorType.EXCEED_MAX_FILE_SIZE);
|
|
105
|
+
expect(item.name).toBe('big.png');
|
|
106
|
+
expect(item.size).toBe(OVER_SIZE);
|
|
107
|
+
expect(item.type).toBe('image/png');
|
|
108
|
+
expect(item.lastModified).toBe(LAST_MODIFIED);
|
|
109
|
+
expect(onFileSelect).not.toHaveBeenCalled();
|
|
110
|
+
});
|
|
111
|
+
it('RIF-03 항목의 arrayBuffer · stream · text · slice 는 원본 File 로 위임한다', () => {
|
|
112
|
+
const onFail = vi.fn();
|
|
113
|
+
const { container } = mount({ onFail, maxFileSize: MAX_FILE_SIZE });
|
|
114
|
+
const big = makeFile('big.png', OVER_SIZE);
|
|
115
|
+
const delegates = {
|
|
116
|
+
arrayBuffer: vi.fn(),
|
|
117
|
+
stream: vi.fn(),
|
|
118
|
+
text: vi.fn(),
|
|
119
|
+
slice: vi.fn(),
|
|
120
|
+
};
|
|
121
|
+
for (const [key, fn] of Object.entries(delegates)) {
|
|
122
|
+
Object.defineProperty(big, key, { configurable: true, value: fn });
|
|
123
|
+
}
|
|
124
|
+
selectFiles(container, [big]);
|
|
125
|
+
const [item] = onFail.mock.calls[0][0];
|
|
126
|
+
item.arrayBuffer();
|
|
127
|
+
item.stream();
|
|
128
|
+
item.text();
|
|
129
|
+
item.slice(0, 1);
|
|
130
|
+
expect(delegates.arrayBuffer).toHaveBeenCalled();
|
|
131
|
+
expect(delegates.stream).toHaveBeenCalled();
|
|
132
|
+
expect(delegates.text).toHaveBeenCalled();
|
|
133
|
+
expect(delegates.slice).toHaveBeenCalledWith(0, 1);
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
describe('RIF-04 찾기 버튼 · 빈 슬롯 click', () => {
|
|
137
|
+
it('RIF-04 찾기 버튼 click 은 숨은 input.click() 을 부른다', () => {
|
|
138
|
+
const { container } = mount({});
|
|
139
|
+
const clickSpy = vi.spyOn(fileInputOf(container), 'click');
|
|
140
|
+
clickElement(browseButton(container));
|
|
141
|
+
expect(clickSpy).toHaveBeenCalled();
|
|
142
|
+
});
|
|
143
|
+
it('RIF-04 빈 슬롯 wrapper click 도 input.click() 을 부른다', () => {
|
|
144
|
+
const { container } = mount({});
|
|
145
|
+
const clickSpy = vi.spyOn(fileInputOf(container), 'click');
|
|
146
|
+
clickElement(emptySlotWrapper(container));
|
|
147
|
+
expect(clickSpy).toHaveBeenCalled();
|
|
148
|
+
});
|
|
149
|
+
it('RIF-04 disabled 면 빈 슬롯 wrapper click 을 무시한다', () => {
|
|
150
|
+
const { container } = mount({ disabled: true });
|
|
151
|
+
const clickSpy = vi.spyOn(fileInputOf(container), 'click');
|
|
152
|
+
clickElement(emptySlotWrapper(container));
|
|
153
|
+
expect(clickSpy).not.toHaveBeenCalled();
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
/* ========== 나머지 분기 — hover · 표시 옵션 · 방어 분기 · 결함 후보 ========== */
|
|
157
|
+
const slotTooltipPanel = () => document.querySelector('.ncua-image-file-input__slot-tooltip');
|
|
158
|
+
const isSlotTooltipVisible = () => slotTooltipPanel()?.classList.contains('ncua-tooltip__bg--visible') ?? false;
|
|
159
|
+
/** React 의 onMouseEnter/onMouseLeave 는 relatedTarget 이 있는 mouseover/mouseout 으로 구동된다 */
|
|
160
|
+
const hover = (element, type) => {
|
|
161
|
+
if (!element)
|
|
162
|
+
throw new Error('hover 할 요소를 찾지 못했습니다');
|
|
163
|
+
act(() => {
|
|
164
|
+
element.dispatchEvent(new MouseEvent(type, { bubbles: true, relatedTarget: document.body }));
|
|
165
|
+
});
|
|
166
|
+
};
|
|
167
|
+
describe('RIF-05 빈 슬롯 hover 툴팁', () => {
|
|
168
|
+
it('RIF-05 hover 하면 툴팁을 보이고 mouseleave 로 숨긴다', () => {
|
|
169
|
+
const { container } = mount({});
|
|
170
|
+
expect(isSlotTooltipVisible()).toBe(false);
|
|
171
|
+
hover(emptySlotWrapper(container), 'mouseover');
|
|
172
|
+
expect(isSlotTooltipVisible()).toBe(true);
|
|
173
|
+
hover(emptySlotWrapper(container), 'mouseout');
|
|
174
|
+
expect(isSlotTooltipVisible()).toBe(false);
|
|
175
|
+
});
|
|
176
|
+
it('RIF-05 disabled 면 hover 해도 툴팁을 보이지 않는다', () => {
|
|
177
|
+
const { container } = mount({ disabled: true });
|
|
178
|
+
hover(emptySlotWrapper(container), 'mouseover');
|
|
179
|
+
expect(isSlotTooltipVisible()).toBe(false);
|
|
180
|
+
});
|
|
181
|
+
it('RIF-05 hover 중 disabled 로 바뀌면 툴팁을 숨긴다', () => {
|
|
182
|
+
const { container, rerender } = mount({});
|
|
183
|
+
hover(emptySlotWrapper(container), 'mouseover');
|
|
184
|
+
expect(isSlotTooltipVisible()).toBe(true);
|
|
185
|
+
rerender({ disabled: true });
|
|
186
|
+
expect(isSlotTooltipVisible()).toBe(false);
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
describe('RIF-06 표시 옵션', () => {
|
|
190
|
+
it('RIF-06 hintItems 를 ul/li 목록으로 렌더한다', () => {
|
|
191
|
+
const { container } = mount({ hintItems: ['첫째 안내', '둘째 안내'] });
|
|
192
|
+
expect(Array.from(container.querySelectorAll('.ncua-file-input__hint-item')).map((li) => li.textContent)).toEqual([
|
|
193
|
+
'첫째 안내',
|
|
194
|
+
'둘째 안내',
|
|
195
|
+
]);
|
|
196
|
+
});
|
|
197
|
+
it('RIF-06 hintItems 가 빈 배열이면 목록을 렌더하지 않는다', () => {
|
|
198
|
+
const { container } = mount({ hintItems: [] });
|
|
199
|
+
expect(container.querySelector('.ncua-file-input__hint-list')).toBeNull();
|
|
200
|
+
});
|
|
201
|
+
it('RIF-06 hintText 를 렌더하고 destructive 면 destructive 클래스를 붙인다', () => {
|
|
202
|
+
const { container } = mount({ hintText: '5MB 이하', destructive: true });
|
|
203
|
+
const hint = container.querySelector('.ncua-hint-text');
|
|
204
|
+
expect(hint?.textContent).toBe('5MB 이하');
|
|
205
|
+
expect(hint?.classList.contains('destructive')).toBe(true);
|
|
206
|
+
});
|
|
207
|
+
it('RIF-06 showHintText false 면 hintText 와 hintItems 를 모두 숨긴다', () => {
|
|
208
|
+
const { container } = mount({ hintText: '5MB 이하', hintItems: ['안내'], showHintText: false });
|
|
209
|
+
expect(container.querySelector('.ncua-hint-text')).toBeNull();
|
|
210
|
+
expect(container.querySelector('.ncua-file-input__hint-list')).toBeNull();
|
|
211
|
+
});
|
|
212
|
+
it('RIF-06 showHelpIcon 이면 label 옆에 help icon 을 렌더한다', () => {
|
|
213
|
+
const { container } = mount({ label: '대표 이미지', showHelpIcon: true });
|
|
214
|
+
expect(container.querySelector('.ncua-file-input__label .ncua-input__help-icon')).not.toBeNull();
|
|
215
|
+
});
|
|
216
|
+
it('RIF-06 showFileInput false 면 찾기 버튼 영역을 렌더하지 않는다', () => {
|
|
217
|
+
const { container } = mount({ showFileInput: false });
|
|
218
|
+
expect(container.querySelector('.ncua-file-input')).toBeNull();
|
|
219
|
+
expect(emptySlotWrapper(container)).not.toBeNull();
|
|
220
|
+
});
|
|
221
|
+
});
|
|
222
|
+
describe('RIF-07 방어 분기', () => {
|
|
223
|
+
it.each([
|
|
224
|
+
['files 가 null', null],
|
|
225
|
+
['빈 목록', []],
|
|
226
|
+
])('RIF-07 %s 인 change 는 무시한다', (_label, files) => {
|
|
227
|
+
const onFileSelect = vi.fn();
|
|
228
|
+
const onFail = vi.fn();
|
|
229
|
+
const { container } = mount({ onFileSelect, onFail });
|
|
230
|
+
selectFiles(container, files);
|
|
231
|
+
expect(onFileSelect).not.toHaveBeenCalled();
|
|
232
|
+
expect(onFail).not.toHaveBeenCalled();
|
|
233
|
+
});
|
|
234
|
+
it('RIF-07 fileName 이 없는 저장 항목(타입 밖 사용)은 alt 를 빈 문자열로 둔다', () => {
|
|
235
|
+
const { container } = mount({
|
|
236
|
+
uploadedFiles: [
|
|
237
|
+
{ fileImageUrl: 'https://cdn.example/no-name.jpg' },
|
|
238
|
+
],
|
|
239
|
+
});
|
|
240
|
+
expect(previewImages(container)[0].getAttribute('alt')).toBe('');
|
|
241
|
+
});
|
|
242
|
+
});
|
|
243
|
+
describe('RIF-08 maxFileCount 1 + multiple', () => {
|
|
244
|
+
it('RIF-08 두 장을 한 번에 고르면 개수 검사 없이 두 장 모두 onChange 로 전달한다', () => {
|
|
245
|
+
// 현재 동작 고정 — 결함 후보: 후속 이슈 (교체 분기가 개수 검사를 건너뛰어 한 장 제한을 넘김 — vanilla IFM-09 와 같은 뿌리)
|
|
246
|
+
const onChange = vi.fn();
|
|
247
|
+
const { container } = mount({ value: [], onChange, multiple: true, maxFileCount: 1 });
|
|
248
|
+
const first = makeFile('first.png');
|
|
249
|
+
const second = makeFile('second.png');
|
|
250
|
+
selectFiles(container, [first, second]);
|
|
251
|
+
expect(indexesIn([first, second], lastFilesOf(onChange))).toEqual([0, 1]);
|
|
252
|
+
});
|
|
253
|
+
it.todo('RIF-08 maxFileCount 1 이면 한 번에 여러 장을 골라도 한 장만 수용하고 나머지는 반려한다 (기대 동작)');
|
|
254
|
+
});
|
|
255
|
+
describe('RIF-09 빈 슬롯 버튼 click', () => {
|
|
256
|
+
it('RIF-09 빈 슬롯 버튼 click 한 번에 input.click() 이 두 번 불린다', () => {
|
|
257
|
+
// 현재 동작 고정 — 결함 후보: 후속 이슈 (Button onClick + wrapper onClick 버블링으로 중복 호출 — vanilla IFE-12 와 같은 뿌리)
|
|
258
|
+
const { container } = mount({});
|
|
259
|
+
const clickSpy = vi.spyOn(fileInputOf(container), 'click');
|
|
260
|
+
clickElement(emptySlotWrapper(container)?.querySelector('button'));
|
|
261
|
+
expect(clickSpy).toHaveBeenCalledTimes(2);
|
|
262
|
+
});
|
|
263
|
+
it.todo('RIF-09 빈 슬롯 버튼 click 한 번에 input.click() 은 한 번만 불린다 (기대 동작)');
|
|
264
|
+
});
|
|
265
|
+
describe('RIF-10 문서화된 validation · showFileTagList', () => {
|
|
266
|
+
it('RIF-10 validation · showFileTagList 를 바꿔도 렌더 결과가 달라지지 않는다', () => {
|
|
267
|
+
// 현재 동작 고정 — 결함 후보: 후속 이슈 (문서화된 prop 을 받기만 하고 쓰지 않음 — vanilla IFV-06 과 한 행으로 묶음)
|
|
268
|
+
const first = mount({ validation: true, showFileTagList: true, hintText: '안내' });
|
|
269
|
+
const second = mount({ validation: false, showFileTagList: false, hintText: '안내' });
|
|
270
|
+
expect(first.container.innerHTML).toBe(second.container.innerHTML);
|
|
271
|
+
});
|
|
272
|
+
it.todo('RIF-10 validation · showFileTagList 가 화면에 반영되거나, 쓰지 않는 prop 이면 타입·문서에서 빠진다 (기대 동작)');
|
|
273
|
+
});
|
|
274
|
+
describe('RIF-11 나머지 props 전달 위치', () => {
|
|
275
|
+
it('RIF-11 className · name 이 루트가 아닌 숨은 input 에 붙는다', () => {
|
|
276
|
+
// 현재 동작 고정 — 결함 후보: 후속 이슈 (나머지 props 를 숨은 input 에 펼쳐 className 이 루트 스타일링에 쓰이지 않음)
|
|
277
|
+
const { container } = mount({ className: 'custom-host', name: 'images' });
|
|
278
|
+
const root = container.querySelector('.ncua-image-file-input');
|
|
279
|
+
const input = fileInputOf(container);
|
|
280
|
+
expect(input.classList.contains('custom-host')).toBe(true);
|
|
281
|
+
expect(input.name).toBe('images');
|
|
282
|
+
expect(root?.classList.contains('custom-host')).toBe(false);
|
|
283
|
+
});
|
|
284
|
+
it('RIF-11 타입이 허용하는 InputBase 전용 prop(fullWidth)은 DOM 미인식 prop 경고를 낸다', () => {
|
|
285
|
+
// 현재 동작 고정 — 결함 후보: 후속 이슈 (InputBaseProps 를 그대로 받아 input 에 펼쳐 React 미인식 prop 경고)
|
|
286
|
+
// 경고는 prop 이름별로 모듈 수명 동안 한 번만 나고 boolean 값은 DOM 에 남지 않는다 — 이 파일에서 fullWidth 를 처음 렌더하는 테스트여야 한다
|
|
287
|
+
const consoleError = vi.spyOn(console, 'error').mockImplementation(() => undefined);
|
|
288
|
+
mount({ fullWidth: true });
|
|
289
|
+
expect(consoleError.mock.calls.flat().some((arg) => String(arg).includes('fullWidth'))).toBe(true);
|
|
290
|
+
});
|
|
291
|
+
it.todo('RIF-11 className 은 루트에 붙고, 숨은 input 에는 input 속성만 전달된다 (기대 동작)');
|
|
292
|
+
});
|
package/dist/temp/src/components/forms-and-input/input-base/__tests__/InputBase.slots.test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
// @vitest-environment jsdom
|
|
2
|
+
import { createElement, createRef } from 'react';
|
|
3
|
+
import { createRoot } from 'react-dom/client';
|
|
4
|
+
import { act } from 'react-dom/test-utils';
|
|
5
|
+
import { afterEach, describe, expect, it, vi } from 'vitest';
|
|
6
|
+
import { InputBase } from '../InputBase';
|
|
7
|
+
// React 18에서 act() 사용 시 필요한 플래그 (미설정 시 console.error 경고 발생)
|
|
8
|
+
globalThis.IS_REACT_ACT_ENVIRONMENT = true;
|
|
9
|
+
const BUTTON_LABEL = '조회';
|
|
10
|
+
/** afterEach 에서 unmount 할 루트 */
|
|
11
|
+
const mounted = [];
|
|
12
|
+
afterEach(() => {
|
|
13
|
+
vi.restoreAllMocks();
|
|
14
|
+
for (const { root, container } of mounted.splice(0)) {
|
|
15
|
+
act(() => root.unmount());
|
|
16
|
+
container.remove();
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const mount = (node) => {
|
|
20
|
+
const container = document.createElement('div');
|
|
21
|
+
document.body.appendChild(container);
|
|
22
|
+
const root = createRoot(container);
|
|
23
|
+
mounted.push({ root, container });
|
|
24
|
+
act(() => root.render(node));
|
|
25
|
+
return {
|
|
26
|
+
container,
|
|
27
|
+
rerender: (next) => act(() => root.render(next)),
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
const inputBase = (props) => createElement(InputBase, props);
|
|
31
|
+
/** 폼 안에 렌더하고 submit 발생을 기록한다 (preventDefault 로 jsdom 의 폼 전송을 막는다) */
|
|
32
|
+
const mountInForm = (node) => {
|
|
33
|
+
const submits = [];
|
|
34
|
+
const view = mount(createElement('form', {
|
|
35
|
+
onSubmit: (event) => {
|
|
36
|
+
event.preventDefault();
|
|
37
|
+
submits.push(event.nativeEvent);
|
|
38
|
+
},
|
|
39
|
+
}, node));
|
|
40
|
+
return { ...view, submits };
|
|
41
|
+
};
|
|
42
|
+
const mustQuery = (root, selector) => {
|
|
43
|
+
const found = root.querySelector(selector);
|
|
44
|
+
if (!found)
|
|
45
|
+
throw new Error(`요소를 찾을 수 없습니다: ${selector}`);
|
|
46
|
+
return found;
|
|
47
|
+
};
|
|
48
|
+
const click = (element) => act(() => element.click());
|
|
49
|
+
describe('InputBase — 바깥 button 슬롯 (INB-01)', () => {
|
|
50
|
+
it('INB-01 isSubmit 이 true 면 type submit 버튼이라 폼 안에서 클릭하면 폼을 제출한다', () => {
|
|
51
|
+
// Given: isSubmit 버튼 슬롯을 가진 인풋을 폼 안에 렌더
|
|
52
|
+
const view = mountInForm(inputBase({ trailingElement: { type: 'button', label: BUTTON_LABEL, isSubmit: true, onClick: vi.fn() } }));
|
|
53
|
+
const button = mustQuery(view.container, '.ncua-input__button');
|
|
54
|
+
// When: 버튼을 클릭한다
|
|
55
|
+
click(button);
|
|
56
|
+
// Then: type 은 submit 이고 폼이 제출된다
|
|
57
|
+
expect(button.getAttribute('type')).toBe('submit');
|
|
58
|
+
expect(view.submits).toHaveLength(1);
|
|
59
|
+
});
|
|
60
|
+
it('INB-01 isSubmit 을 생략하면 type button 이라 폼 안에서 클릭해도 제출하지 않는다', () => {
|
|
61
|
+
// Given: 기본 버튼 슬롯을 폼 안에 렌더
|
|
62
|
+
const view = mountInForm(inputBase({ trailingElement: { type: 'button', label: BUTTON_LABEL, onClick: vi.fn() } }));
|
|
63
|
+
const button = mustQuery(view.container, '.ncua-input__button');
|
|
64
|
+
// When: 버튼을 클릭한다
|
|
65
|
+
click(button);
|
|
66
|
+
// Then: type 은 button 이고 제출되지 않는다 (양성 대조: 위 isSubmit 케이스)
|
|
67
|
+
expect(button.getAttribute('type')).toBe('button');
|
|
68
|
+
expect(view.submits).toEqual([]);
|
|
69
|
+
});
|
|
70
|
+
it('INB-01 버튼 클릭은 slot.onClick 을 부르고 label 을 표시하며 루트에 trailing-button modifier 를 붙인다', () => {
|
|
71
|
+
// Given: 버튼 슬롯을 가진 인풋
|
|
72
|
+
const onClick = vi.fn();
|
|
73
|
+
const view = mount(inputBase({ trailingElement: { type: 'button', label: BUTTON_LABEL, onClick } }));
|
|
74
|
+
const button = mustQuery(view.container, '.ncua-input__button');
|
|
75
|
+
// When: 버튼을 클릭한다
|
|
76
|
+
click(button);
|
|
77
|
+
// Then: onClick 이 불리고 label·modifier 가 보인다
|
|
78
|
+
expect(onClick).toHaveBeenCalled();
|
|
79
|
+
expect(button.textContent).toBe(BUTTON_LABEL);
|
|
80
|
+
expect(mustQuery(view.container, '.ncua-input').classList.contains('ncua-input__trailing-button')).toBe(true);
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
const OUTSIDE_SLOT_CLASS = 'outside-slot';
|
|
84
|
+
const INSIDE_SLOT_CLASS = 'inside-slot';
|
|
85
|
+
const MAX_LENGTH = 10;
|
|
86
|
+
const CONTROLLED_VALUE = 'abc';
|
|
87
|
+
const UNCONTROLLED_DEFAULT = 'ab';
|
|
88
|
+
const TYPED_VALUE = 'abcd';
|
|
89
|
+
const customSlot = (className, placement) => ({
|
|
90
|
+
type: 'custom',
|
|
91
|
+
placement,
|
|
92
|
+
children: createElement('i', { className }),
|
|
93
|
+
});
|
|
94
|
+
const textCount = (root) => mustQuery(root, '.ncua-input__field-text-count').textContent ?? '';
|
|
95
|
+
describe('InputBase — custom 슬롯 placement (INB-02 · INB-07)', () => {
|
|
96
|
+
it.each(['leadingElement', 'trailingElement'])('INB-02 %s 의 outside 는 필드 바깥(content 직계)에만 그린다', (prop) => {
|
|
97
|
+
const view = mount(inputBase({ [prop]: customSlot(OUTSIDE_SLOT_CLASS, 'outside') }));
|
|
98
|
+
const slots = Array.from(view.container.querySelectorAll(`.${OUTSIDE_SLOT_CLASS}`));
|
|
99
|
+
expect(slots.map((slot) => Array.from(slot.parentElement?.classList ?? []))).toEqual([
|
|
100
|
+
expect.arrayContaining(['ncua-input__content']),
|
|
101
|
+
]);
|
|
102
|
+
});
|
|
103
|
+
it.each(['leadingElement', 'trailingElement'])('INB-02 %s 의 inside 는 필드 안쪽에만 그린다', (prop) => {
|
|
104
|
+
const view = mount(inputBase({ [prop]: customSlot(INSIDE_SLOT_CLASS, 'inside') }));
|
|
105
|
+
const slots = Array.from(view.container.querySelectorAll(`.${INSIDE_SLOT_CLASS}`));
|
|
106
|
+
expect(slots.map((slot) => Array.from(slot.parentElement?.classList ?? []))).toEqual([
|
|
107
|
+
expect.arrayContaining(['ncua-input__field']),
|
|
108
|
+
]);
|
|
109
|
+
});
|
|
110
|
+
it('INB-07 placement 를 생략한 custom 슬롯은 안쪽 · 바깥 어디에도 그리지 않는다', () => {
|
|
111
|
+
// 현재 동작 고정 — 결함 후보: #627 INB-07 (placement 는 선택 prop 인데 기본값이 없어 생략하면 슬롯이 사라짐)
|
|
112
|
+
const view = mount(inputBase({ trailingElement: customSlot(INSIDE_SLOT_CLASS) }));
|
|
113
|
+
expect(view.container.querySelector(`.${INSIDE_SLOT_CLASS}`)).toBeNull();
|
|
114
|
+
});
|
|
115
|
+
it.todo('INB-07 기대 동작 (#627): placement 를 생략한 custom 슬롯도 기본 위치(문서화된 기본값)에 그린다');
|
|
116
|
+
});
|
|
117
|
+
describe('InputBase — 글자 수 (INB-03 · INB-05)', () => {
|
|
118
|
+
it('INB-03 controlled 는 value 길이로 "현재/최대" 를 그린다', () => {
|
|
119
|
+
const view = mount(inputBase({ showTextCount: true, maxLength: MAX_LENGTH, value: CONTROLLED_VALUE, onChange: vi.fn() }));
|
|
120
|
+
expect(textCount(view.container)).toBe(`${CONTROLLED_VALUE.length}/${MAX_LENGTH}`);
|
|
121
|
+
});
|
|
122
|
+
it('INB-03 uncontrolled 는 초기값 길이에서 시작해 input 이벤트로 갱신한다', () => {
|
|
123
|
+
const view = mount(inputBase({ showTextCount: true, maxLength: MAX_LENGTH, defaultValue: UNCONTROLLED_DEFAULT }));
|
|
124
|
+
const before = textCount(view.container);
|
|
125
|
+
const input = mustQuery(view.container, 'input');
|
|
126
|
+
act(() => {
|
|
127
|
+
input.value = TYPED_VALUE;
|
|
128
|
+
input.dispatchEvent(new Event('input', { bubbles: true }));
|
|
129
|
+
});
|
|
130
|
+
expect([before, textCount(view.container)]).toEqual([
|
|
131
|
+
`${UNCONTROLLED_DEFAULT.length}/${MAX_LENGTH}`,
|
|
132
|
+
`${TYPED_VALUE.length}/${MAX_LENGTH}`,
|
|
133
|
+
]);
|
|
134
|
+
});
|
|
135
|
+
it('INB-03 maxLength 가 없으면 showTextCount 여도 글자 수 영역이 없다', () => {
|
|
136
|
+
const view = mount(inputBase({ showTextCount: true, defaultValue: UNCONTROLLED_DEFAULT }));
|
|
137
|
+
expect(view.container.querySelector('.ncua-input__field-text-count')).toBeNull();
|
|
138
|
+
});
|
|
139
|
+
it('INB-05 maxLength={0} 이면 글자 수 영역 대신 텍스트 "0" 이 content-wrap 끝에 그려진다', () => {
|
|
140
|
+
// 현재 동작 고정 — 결함 후보: #627 INB-05 (`showTextCount && maxLength && …` 가 0 을 그대로 렌더, #614 RTP-13 같은 유형)
|
|
141
|
+
const view = mount(inputBase({ showTextCount: true, maxLength: 0 }));
|
|
142
|
+
const wrap = mustQuery(view.container, '.ncua-input__content-wrap');
|
|
143
|
+
expect(view.container.querySelector('.ncua-input__field-text-count')).toBeNull();
|
|
144
|
+
expect([wrap.lastChild?.nodeType, wrap.lastChild?.textContent]).toEqual([Node.TEXT_NODE, '0']);
|
|
145
|
+
});
|
|
146
|
+
it.todo('INB-05 기대 동작 (#627): maxLength={0} 이어도 텍스트 "0" 이 새지 않는다 (영역 없음 · "현재/0" 중 표시는 이슈에서 결정)');
|
|
147
|
+
});
|
|
148
|
+
describe('InputBase — help 아이콘 · null value (INB-04 · INB-06)', () => {
|
|
149
|
+
it.each([
|
|
150
|
+
['showHelpIcon', '있음', true, true],
|
|
151
|
+
['생략', '없음', undefined, false],
|
|
152
|
+
])('INB-04 label 옆 help 아이콘: %s → %s', (_name, _expectedLabel, showHelpIcon, expected) => {
|
|
153
|
+
const view = mount(inputBase({ label: '이름', showHelpIcon }));
|
|
154
|
+
expect(mustQuery(view.container, '.ncua-input__label').querySelector('.ncua-input__help-icon') !== null).toBe(expected);
|
|
155
|
+
});
|
|
156
|
+
it('INB-06 controlled value 가 null(타입 밖)이면 길이 0 으로 계산해 has-value 가 없다', () => {
|
|
157
|
+
// React 는 value={null} 에 경고만 내고 받는다 — 경고 출력만 막는다 (afterEach 에서 복원)
|
|
158
|
+
vi.spyOn(console, 'error').mockImplementation(() => undefined);
|
|
159
|
+
const nullValue = { value: null };
|
|
160
|
+
const view = mount(inputBase({ ...nullValue, showTextCount: true, maxLength: MAX_LENGTH, onChange: vi.fn() }));
|
|
161
|
+
expect(textCount(view.container)).toBe(`0/${MAX_LENGTH}`);
|
|
162
|
+
expect(mustQuery(view.container, '.ncua-input').classList.contains('has-value')).toBe(false);
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
describe('InputBase — ref 전달 (INB-08)', () => {
|
|
166
|
+
// 합본에서는 NumberInput 등 형제 PR 테스트가 부수로 덮는 경로 — base 단독 자립을 위해 직접 단언한다
|
|
167
|
+
it('INB-08 객체 ref 는 input 요소를 가리킨다', () => {
|
|
168
|
+
const ref = createRef();
|
|
169
|
+
const view = mount(createElement(InputBase, { ref }));
|
|
170
|
+
expect(ref.current).toBe(mustQuery(view.container, 'input'));
|
|
171
|
+
});
|
|
172
|
+
it('INB-08 함수 ref 는 input 요소로 호출된다', () => {
|
|
173
|
+
const received = [];
|
|
174
|
+
const view = mount(createElement(InputBase, { ref: (node) => received.push(node) }));
|
|
175
|
+
expect(received[0]).toBe(mustQuery(view.container, 'input'));
|
|
176
|
+
});
|
|
177
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|