@ncds/ui-admin 1.8.28-alpha.0 → 1.8.28-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/__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/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/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 +16 -10
- 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/__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/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/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 +16 -10
- 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/__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/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/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 +15 -9
- 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/__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/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/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,52 @@
|
|
|
1
|
+
export const MARGIN = 10;
|
|
2
|
+
export const DEFAULT_TOOLTIP_WIDTH = 200;
|
|
3
|
+
export const DEFAULT_TOOLTIP_HEIGHT = 60;
|
|
4
|
+
export const POSITION_PRIORITY = ['bottom', 'top', 'right', 'left'];
|
|
5
|
+
// 툴팁 위치 계산 관련 상수
|
|
6
|
+
export const TOOLTIP_OFFSET = 8; // 툴팁과 앵커 사이의 거리
|
|
7
|
+
export const VIEWPORT_MARGIN = 8; // 뷰포트 경계와의 최소 거리
|
|
8
|
+
// 아이콘 크기 상수
|
|
9
|
+
export const ICON_SIZES = {
|
|
10
|
+
sm: 14,
|
|
11
|
+
md: 16
|
|
12
|
+
};
|
|
13
|
+
// 애니메이션 관련 상수
|
|
14
|
+
export const TRANSITION_DURATION = '0.18s';
|
|
15
|
+
export const OFFSCREEN_POSITION = '-99999px';
|
|
16
|
+
// 툴팁 상태 관련 상수
|
|
17
|
+
export const OPACITY = {
|
|
18
|
+
HIDDEN: '0',
|
|
19
|
+
VISIBLE: '1'
|
|
20
|
+
};
|
|
21
|
+
export const POSITION = {
|
|
22
|
+
INITIAL: '0px',
|
|
23
|
+
OFFSCREEN: OFFSCREEN_POSITION
|
|
24
|
+
};
|
|
25
|
+
// z-index 관련 상수
|
|
26
|
+
// SCSS 토큰 `--z-index-tooltip`(base/_custom-variable.scss)과 동기 유지 — 변경 시 양쪽 같이 수정
|
|
27
|
+
export const Z_INDEX = {
|
|
28
|
+
TOOLTIP_LAYER: 2000 // 툴팁 전역 레이어 기본 z-index (고도몰 기준)
|
|
29
|
+
};
|
|
30
|
+
// 이벤트 관련 상수
|
|
31
|
+
export const EVENT_OPTIONS = {
|
|
32
|
+
PASSIVE: {
|
|
33
|
+
passive: true
|
|
34
|
+
},
|
|
35
|
+
ONCE: {
|
|
36
|
+
once: true
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
export const TOOLTIP_DEFAULT_VALUE = {
|
|
40
|
+
tooltipType: 'white',
|
|
41
|
+
iconType: 'stroke',
|
|
42
|
+
position: 'auto',
|
|
43
|
+
size: 'sm',
|
|
44
|
+
hideArrow: false,
|
|
45
|
+
title: '',
|
|
46
|
+
content: '',
|
|
47
|
+
type: 'short',
|
|
48
|
+
zIndex: Z_INDEX.TOOLTIP_LAYER,
|
|
49
|
+
useShadowDOM: false,
|
|
50
|
+
className: '',
|
|
51
|
+
iconColor: 'var(--gray-300)' // React Tooltip의 iconColor 기본값과 동일
|
|
52
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// SVG 아이콘들
|
|
2
|
+
export const SVG_ICONS = {
|
|
3
|
+
'help-circle-stroke': size => `<svg xmlns="http://www.w3.org/2000/svg" width="${size}" height="${size}" fill="none" viewBox="0 0 24 24" stroke="none">
|
|
4
|
+
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3m.08 4h.01M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10"></path>
|
|
5
|
+
</svg>`,
|
|
6
|
+
'help-circle-fill': size => `<svg xmlns="http://www.w3.org/2000/svg" width="${size}" height="${size}" fill="none" viewBox="0 0 24 24" stroke="none">
|
|
7
|
+
<path fill="currentColor" fill-rule="evenodd" d="M12 1C5.925 1 1 5.925 1 12s4.925 11 11 11 11-4.925 11-11S18.075 1 12 1m-1.093 7.271a2 2 0 0 1 3.013 1.727V10c0 .47-.365.958-1.055 1.418a6 6 0 0 1-1.262.634 1 1 0 0 0 .633 1.897l.169-.061a8.05 8.05 0 0 0 1.57-.806c.81-.54 1.944-1.55 1.945-3.081a4 4 0 0 0-7.773-1.333 1 1 0 0 0 1.886.664 2 2 0 0 1 .874-1.06M12 16a1 1 0 1 0 0 2h.01a1 1 0 0 0 0-2z" clip-rule="evenodd"></path>
|
|
8
|
+
</svg>`
|
|
9
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// Re-export all constants and types from separate files
|
|
2
|
+
export { CLASS_NAMES } from './classNames';
|
|
3
|
+
export { DEFAULT_TOOLTIP_HEIGHT, DEFAULT_TOOLTIP_WIDTH, EVENT_OPTIONS, ICON_SIZES, MARGIN, OFFSCREEN_POSITION, OPACITY, POSITION, POSITION_PRIORITY, TOOLTIP_DEFAULT_VALUE, TOOLTIP_OFFSET, VIEWPORT_MARGIN, Z_INDEX } from './constants';
|
|
4
|
+
export { SVG_ICONS } from './icons';
|
|
5
|
+
export { CSS_TEMPLATES, FALLBACK_ICON_SVG, HTML_TEMPLATES } from './templates';
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { OFFSCREEN_POSITION, TRANSITION_DURATION } from './constants';
|
|
2
|
+
/**
|
|
3
|
+
* 툴팁 관련 CSS 및 HTML 템플릿
|
|
4
|
+
*/
|
|
5
|
+
// CSS 템플릿
|
|
6
|
+
export const CSS_TEMPLATES = {
|
|
7
|
+
// 레이어 컨테이너 스타일 (클릭 통과)
|
|
8
|
+
LAYER_CONTAINER: zIndex => `
|
|
9
|
+
position: fixed;
|
|
10
|
+
inset: 0;
|
|
11
|
+
pointer-events: none;
|
|
12
|
+
z-index: ${zIndex};
|
|
13
|
+
display: block;
|
|
14
|
+
`,
|
|
15
|
+
// 툴팁 패널 스타일 (클릭 허용)
|
|
16
|
+
TOOLTIP_PANEL: zIndex => `
|
|
17
|
+
position: fixed;
|
|
18
|
+
left: ${OFFSCREEN_POSITION};
|
|
19
|
+
top: ${OFFSCREEN_POSITION};
|
|
20
|
+
opacity: 0;
|
|
21
|
+
transition: opacity ${TRANSITION_DURATION} ease;
|
|
22
|
+
pointer-events: auto;
|
|
23
|
+
z-index: ${zIndex};
|
|
24
|
+
right: auto;
|
|
25
|
+
bottom: auto;
|
|
26
|
+
transform: none;
|
|
27
|
+
`,
|
|
28
|
+
// 앵커 래퍼 스타일
|
|
29
|
+
ANCHOR_WRAPPER: `
|
|
30
|
+
display: inline-flex;
|
|
31
|
+
vertical-align: middle;
|
|
32
|
+
margin: 0 4px;
|
|
33
|
+
`,
|
|
34
|
+
// Shadow DOM 기본 스타일
|
|
35
|
+
// Shadow boundary는 스타일 격리하지만 CSS 커스텀 프로퍼티는 통과하므로 host 변수를 그대로 참조 가능
|
|
36
|
+
SHADOW_DOM_HOST: `
|
|
37
|
+
:host {
|
|
38
|
+
all: unset;
|
|
39
|
+
display: block;
|
|
40
|
+
font-family: var(--font-families-commerce-sans, system-ui);
|
|
41
|
+
color: black;
|
|
42
|
+
}
|
|
43
|
+
`
|
|
44
|
+
};
|
|
45
|
+
// HTML 템플릿
|
|
46
|
+
export const HTML_TEMPLATES = {
|
|
47
|
+
// 아이콘 래퍼
|
|
48
|
+
ICON_WRAPPER: (className, iconSvg) => `<span class="${className}">${iconSvg}</span>`,
|
|
49
|
+
// 툴팁 제목
|
|
50
|
+
TOOLTIP_TITLE: (className, title) => `<span class="${className}">${title}</span>`,
|
|
51
|
+
// 툴팁 콘텐츠 (일반)
|
|
52
|
+
TOOLTIP_CONTENT: (className, content) => `<span class="${className}">${content}</span>`,
|
|
53
|
+
// 툴팁 콘텐츠 (Shadow DOM)
|
|
54
|
+
TOOLTIP_CONTENT_SHADOW: className => `<span class="${className}" data-shadow-content></span>`
|
|
55
|
+
};
|
|
56
|
+
// 폴백 아이콘 SVG
|
|
57
|
+
export const FALLBACK_ICON_SVG = size => `<svg width="${size}" height="${size}" viewBox="0 0 16 16" aria-hidden="true">
|
|
58
|
+
<circle cx="8" cy="8" r="7" stroke="currentColor" fill="none"/>
|
|
59
|
+
<text x="8" y="11" font-size="8" text-anchor="middle" fill="currentColor">?</text>
|
|
60
|
+
</svg>`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -16,16 +16,4 @@ import DOMPurify from 'dompurify';
|
|
|
16
16
|
*/
|
|
17
17
|
export function sanitizeHtml(dirty) {
|
|
18
18
|
return DOMPurify.sanitize(dirty);
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* 엘리먼트에 콘텐츠를 안전하게 설정한다.
|
|
22
|
-
* - string: sanitize 후 innerHTML 교체
|
|
23
|
-
* - HTMLElement: 기존 자식 제거 후 appendChild
|
|
24
|
-
*/
|
|
25
|
-
export function setSafeInnerHTML(element, content) {
|
|
26
|
-
if (content instanceof HTMLElement) {
|
|
27
|
-
element.replaceChildren(content);
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
element.innerHTML = sanitizeHtml(content);
|
|
31
19
|
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// 파일 첨부 테스트 공용 헬퍼 — vanilla(assets/scripts/imageFileInput) · React(file-input · image-file-input) 가 함께 쓴다.
|
|
2
|
+
// React 전용 act 감싸기는 selectFiles 의 dispatch 인자로 받아 이 모듈은 React 에 의존하지 않는다.
|
|
3
|
+
import { afterEach, beforeEach, vi } from 'vitest';
|
|
4
|
+
/** 내용은 검증 대상이 아니므로 최소 크기만 채운다 */
|
|
5
|
+
export const DUMMY_FILE_BYTES = 4;
|
|
6
|
+
/** 파일마다 type 등 속성이 달라 팩토리로 받는다 — 반환 함수는 (이름, 크기) 만 받는다 */
|
|
7
|
+
export const createFileFactory = properties => function (name) {
|
|
8
|
+
let size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DUMMY_FILE_BYTES;
|
|
9
|
+
return new File([new Uint8Array(size)], name, properties);
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* URL.createObjectURL · revokeObjectURL 을 테스트마다 새 목으로 바꾸고 끝나면 원복한다.
|
|
13
|
+
* 모듈 최상위에서 호출해 beforeEach · afterEach 를 등록한다. 발급 URL 은 테스트마다 blob:mock/1 부터 센다.
|
|
14
|
+
*/
|
|
15
|
+
// 반환 타입을 적지 않으면 NPM 빌드(declaration: true)가 vi.fn 의 타입을 pnpm 내부 경로로만 이름 붙일 수 있어 TS2742 로 실패한다
|
|
16
|
+
export const mockObjectUrls = () => {
|
|
17
|
+
const originalCreateObjectURL = URL.createObjectURL;
|
|
18
|
+
const originalRevokeObjectURL = URL.revokeObjectURL;
|
|
19
|
+
const createObjectURL = vi.fn();
|
|
20
|
+
const revokeObjectURL = vi.fn();
|
|
21
|
+
beforeEach(() => {
|
|
22
|
+
let issued = 0;
|
|
23
|
+
createObjectURL.mockReset().mockImplementation(() => `blob:mock/${++issued}`);
|
|
24
|
+
revokeObjectURL.mockReset();
|
|
25
|
+
URL.createObjectURL = createObjectURL;
|
|
26
|
+
URL.revokeObjectURL = revokeObjectURL;
|
|
27
|
+
});
|
|
28
|
+
afterEach(() => {
|
|
29
|
+
URL.createObjectURL = originalCreateObjectURL;
|
|
30
|
+
URL.revokeObjectURL = originalRevokeObjectURL;
|
|
31
|
+
});
|
|
32
|
+
return {
|
|
33
|
+
createObjectURL,
|
|
34
|
+
revokeObjectURL
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
export const fileInputOf = scope => {
|
|
38
|
+
const input = scope.querySelector('input[type="file"]');
|
|
39
|
+
if (!input) throw new Error('file input을 찾지 못했습니다');
|
|
40
|
+
return input;
|
|
41
|
+
};
|
|
42
|
+
export const browseButton = scope => {
|
|
43
|
+
const button = scope.querySelector('.ncua-file-input__input-container button.ncua-btn');
|
|
44
|
+
if (!button) throw new Error('찾기 버튼을 찾지 못했습니다');
|
|
45
|
+
return button;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* jsdom 에는 파일 선택 UI 가 없어 files 를 직접 정의한 뒤 change 를 발생시킨다.
|
|
49
|
+
* React 는 상태 갱신을 반영하도록 dispatch 에 act 를 넘긴다.
|
|
50
|
+
*/
|
|
51
|
+
export const selectFiles = function (scope, filesToSelect) {
|
|
52
|
+
let dispatch = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : fire => fire();
|
|
53
|
+
const input = fileInputOf(scope);
|
|
54
|
+
const value = filesToSelect === null ? null : {
|
|
55
|
+
...filesToSelect,
|
|
56
|
+
length: filesToSelect.length,
|
|
57
|
+
item: index => filesToSelect[index] ?? null,
|
|
58
|
+
[Symbol.iterator]: function* () {
|
|
59
|
+
yield* filesToSelect;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
Object.defineProperty(input, 'files', {
|
|
63
|
+
configurable: true,
|
|
64
|
+
value
|
|
65
|
+
});
|
|
66
|
+
dispatch(() => {
|
|
67
|
+
input.dispatchEvent(new Event('change', {
|
|
68
|
+
bubbles: true
|
|
69
|
+
}));
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* actual 의 각 File 이 expected 의 몇 번째 인스턴스인지 (없으면 -1).
|
|
74
|
+
* 이 환경에서 File 은 열거 가능한 own 속성이 없어 서로 다른 File 도 toEqual 이 통과하므로 동일성으로 비교한다.
|
|
75
|
+
*/
|
|
76
|
+
export const indexesIn = (expected, actual) => actual.map(file => expected.indexOf(file));
|
|
77
|
+
/** 목(mock) 의 마지막 호출에서 첫 인자(File[])를 꺼낸다 — 호출이 없으면 빈 배열 */
|
|
78
|
+
export const lastFilesOf = mock => mock.mock.lastCall?.[0] ?? [];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { vi } from 'vitest';
|
|
2
|
+
/** 2026-10-21 (수) 정오 — 자정 경계 영향을 받지 않도록 정오로 둔다 */
|
|
3
|
+
export const FIXED_TODAY = new Date('2026-10-21T12:00:00');
|
|
4
|
+
/** Date 만 가짜로 고정한다 — flatpickr 내부 타이머는 실제로 흐른다. 해제는 호출 측 afterEach 의 vi.useRealTimers() */
|
|
5
|
+
export const useFixedToday = () => {
|
|
6
|
+
vi.useFakeTimers({
|
|
7
|
+
toFake: ['Date']
|
|
8
|
+
});
|
|
9
|
+
vi.setSystemTime(FIXED_TODAY);
|
|
10
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
const dispatchDirectly = dispatchToListeners => dispatchToListeners();
|
|
2
|
+
/**
|
|
3
|
+
* jsdom 에 없는 matchMedia 를 change 리스너를 보관하는 가짜로 바꾼다.
|
|
4
|
+
* 원본 복원 함수는 `cleanups` 에 넣으므로 호출 측 afterEach 가 되돌린다.
|
|
5
|
+
*/
|
|
6
|
+
export function installMatchMedia(cleanups, initial) {
|
|
7
|
+
let dispatch = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : dispatchDirectly;
|
|
8
|
+
const listeners = new Set();
|
|
9
|
+
let matches = initial;
|
|
10
|
+
const hadOwn = Object.hasOwn(window, 'matchMedia');
|
|
11
|
+
const original = window.matchMedia;
|
|
12
|
+
window.matchMedia = query => ({
|
|
13
|
+
get matches() {
|
|
14
|
+
return matches;
|
|
15
|
+
},
|
|
16
|
+
media: query,
|
|
17
|
+
onchange: null,
|
|
18
|
+
addEventListener: (_type, listener) => listeners.add(listener),
|
|
19
|
+
removeEventListener: (_type, listener) => listeners.delete(listener),
|
|
20
|
+
addListener: () => undefined,
|
|
21
|
+
removeListener: () => undefined,
|
|
22
|
+
dispatchEvent: () => false
|
|
23
|
+
});
|
|
24
|
+
cleanups.push(() => {
|
|
25
|
+
if (hadOwn) {
|
|
26
|
+
window.matchMedia = original;
|
|
27
|
+
} else {
|
|
28
|
+
Reflect.deleteProperty(window, 'matchMedia');
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
return {
|
|
32
|
+
fire: next => {
|
|
33
|
+
matches = next;
|
|
34
|
+
dispatch(() => {
|
|
35
|
+
for (const listener of Array.from(listeners)) {
|
|
36
|
+
listener({
|
|
37
|
+
matches: next
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
listenerCount: () => listeners.size
|
|
43
|
+
};
|
|
44
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** jsdom 은 레이아웃이 없어 getBoundingClientRect 가 전부 0 이다 — 테스트가 쓸 좌표만 채운 DOMRect 를 만든다. */
|
|
2
|
+
export const toRect = rect => {
|
|
3
|
+
const resolved = {
|
|
4
|
+
top: 0,
|
|
5
|
+
bottom: 0,
|
|
6
|
+
left: 0,
|
|
7
|
+
right: 0,
|
|
8
|
+
width: 0,
|
|
9
|
+
height: 0,
|
|
10
|
+
x: 0,
|
|
11
|
+
y: 0,
|
|
12
|
+
...rect
|
|
13
|
+
};
|
|
14
|
+
return {
|
|
15
|
+
...resolved,
|
|
16
|
+
toJSON: () => resolved
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,257 @@
|
|
|
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 { COLOR } from '../../../../../constant/color';
|
|
7
|
+
import { Button } from '../Button';
|
|
8
|
+
// React 18에서 act() 사용 시 필요한 플래그 (미설정 시 console.error 경고 발생)
|
|
9
|
+
globalThis.IS_REACT_ACT_ENVIRONMENT = true;
|
|
10
|
+
const LABEL = '저장';
|
|
11
|
+
/** afterEach 에서 unmount 할 루트 */
|
|
12
|
+
const mounted = [];
|
|
13
|
+
afterEach(() => {
|
|
14
|
+
for (const {
|
|
15
|
+
root,
|
|
16
|
+
container
|
|
17
|
+
} of mounted.splice(0)) {
|
|
18
|
+
act(() => root.unmount());
|
|
19
|
+
container.remove();
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
const mount = node => {
|
|
23
|
+
const container = document.createElement('div');
|
|
24
|
+
document.body.appendChild(container);
|
|
25
|
+
const root = createRoot(container);
|
|
26
|
+
mounted.push({
|
|
27
|
+
root,
|
|
28
|
+
container
|
|
29
|
+
});
|
|
30
|
+
act(() => root.render(node));
|
|
31
|
+
return {
|
|
32
|
+
container
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
const button = function () {
|
|
36
|
+
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
37
|
+
return /*#__PURE__*/createElement(Button, {
|
|
38
|
+
label: LABEL,
|
|
39
|
+
...props
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
/** 폼 안에 렌더하고 submit 발생을 기록한다 (preventDefault 로 jsdom 의 폼 전송을 막는다) */
|
|
43
|
+
const mountInForm = node => {
|
|
44
|
+
const submits = [];
|
|
45
|
+
const view = mount(/*#__PURE__*/createElement('form', {
|
|
46
|
+
onSubmit: event => {
|
|
47
|
+
event.preventDefault();
|
|
48
|
+
submits.push(event.nativeEvent);
|
|
49
|
+
}
|
|
50
|
+
}, node));
|
|
51
|
+
return {
|
|
52
|
+
...view,
|
|
53
|
+
submits
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
const mustQuery = (root, selector) => {
|
|
57
|
+
const found = root.querySelector(selector);
|
|
58
|
+
if (!found) throw new Error(`요소를 찾을 수 없습니다: ${selector}`);
|
|
59
|
+
return found;
|
|
60
|
+
};
|
|
61
|
+
describe('Button — type 기본값 (BTN-04)', () => {
|
|
62
|
+
it('BTN-04 type 을 넘기지 않은 Button 은 폼 안에서 클릭하면 폼을 제출한다', () => {
|
|
63
|
+
// 현재 동작 고정 — 결함 후보: #620 BTN-04 추가 기록 (VNT-12 같은 뿌리 — 공용 Button 에 type 기본값이 없어 의도 없는 폼 제출)
|
|
64
|
+
// Given: type 없이 폼 안에 렌더
|
|
65
|
+
const view = mountInForm(button());
|
|
66
|
+
const element = mustQuery(view.container, 'button');
|
|
67
|
+
// When: 클릭한다
|
|
68
|
+
act(() => element.click());
|
|
69
|
+
// Then: type 속성이 없어 브라우저 기본값 submit 으로 동작해 폼이 제출된다
|
|
70
|
+
expect(element.getAttribute('type')).toBeNull();
|
|
71
|
+
expect(element.type).toBe('submit');
|
|
72
|
+
expect(view.submits).toHaveLength(1);
|
|
73
|
+
});
|
|
74
|
+
it('BTN-04 (대조) type="button" 을 넘기면 폼 안에서 클릭해도 제출하지 않는다', () => {
|
|
75
|
+
// Given: type="button" 으로 폼 안에 렌더
|
|
76
|
+
const view = mountInForm(button({
|
|
77
|
+
type: 'button'
|
|
78
|
+
}));
|
|
79
|
+
// When: 클릭한다
|
|
80
|
+
act(() => mustQuery(view.container, 'button').click());
|
|
81
|
+
// Then: submit 이 없다 — 위 케이스의 submit 기록이 배선 착시가 아님을 보인다
|
|
82
|
+
expect(view.submits).toEqual([]);
|
|
83
|
+
});
|
|
84
|
+
it.todo('BTN-04 기대 동작 (#620): type 을 넘기지 않으면 type="button" 으로 렌더해 폼을 제출하지 않는다');
|
|
85
|
+
});
|
|
86
|
+
/** 받은 width · height · color 를 속성으로 남기는 합성 아이콘 — 실제 아이콘의 SVG 반영은 아이콘 패키지 소관 */
|
|
87
|
+
const makeIcon = name => {
|
|
88
|
+
const Icon = _ref => {
|
|
89
|
+
let {
|
|
90
|
+
width,
|
|
91
|
+
height,
|
|
92
|
+
color
|
|
93
|
+
} = _ref;
|
|
94
|
+
return /*#__PURE__*/createElement('svg', {
|
|
95
|
+
'data-icon': name,
|
|
96
|
+
width,
|
|
97
|
+
height,
|
|
98
|
+
color
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
return Icon;
|
|
102
|
+
};
|
|
103
|
+
const LeadingIcon = makeIcon('leading');
|
|
104
|
+
const TrailingIcon = makeIcon('trailing');
|
|
105
|
+
/** 기본 아이콘 크기(12 · 14 · 16 · 20)와 겹치지 않는 지정 크기 */
|
|
106
|
+
const CUSTOM_ICON_SIZE = 18;
|
|
107
|
+
/** xs 버튼 기본 아이콘 크기 — 일반 14 · onlyIcon 16 */
|
|
108
|
+
const XS_ICON_SIZE = 14;
|
|
109
|
+
const XS_ICON_ONLY_SIZE = 16;
|
|
110
|
+
const mustIcon = (root, name) => mustQuery(root, `[data-icon="${name}"]`);
|
|
111
|
+
describe('Button — loading (BTN-01)', () => {
|
|
112
|
+
it.each(['primary', 'secondary', 'secondary-gray', 'destructive'])('BTN-01 로딩 가능 hierarchy %s 는 loading 이면 스피너 · disabled · aria-busy 를 켠다', hierarchy => {
|
|
113
|
+
const view = mount(button({
|
|
114
|
+
hierarchy,
|
|
115
|
+
loading: true
|
|
116
|
+
}));
|
|
117
|
+
const element = mustQuery(view.container, 'button');
|
|
118
|
+
expect(element.querySelector('.ncua-btn__spinner')).not.toBeNull();
|
|
119
|
+
expect(element.disabled).toBe(true);
|
|
120
|
+
expect(element.getAttribute('aria-busy')).toBe('true');
|
|
121
|
+
expect(element.classList.contains('is-loading')).toBe(true);
|
|
122
|
+
});
|
|
123
|
+
it('BTN-01 loading 중에는 leadingIcon 자리를 스피너가 대신하고 trailingIcon 은 유지한다', () => {
|
|
124
|
+
const view = mount(button({
|
|
125
|
+
hierarchy: 'primary',
|
|
126
|
+
loading: true,
|
|
127
|
+
leadingIcon: {
|
|
128
|
+
type: 'icon',
|
|
129
|
+
icon: LeadingIcon
|
|
130
|
+
},
|
|
131
|
+
trailingIcon: {
|
|
132
|
+
type: 'icon',
|
|
133
|
+
icon: TrailingIcon
|
|
134
|
+
}
|
|
135
|
+
}));
|
|
136
|
+
const element = mustQuery(view.container, 'button');
|
|
137
|
+
expect(element.firstElementChild?.classList.contains('ncua-btn__spinner')).toBe(true);
|
|
138
|
+
expect(element.querySelector('[data-icon="leading"]')).toBeNull();
|
|
139
|
+
expect(element.lastElementChild?.getAttribute('data-icon')).toBe('trailing');
|
|
140
|
+
});
|
|
141
|
+
it.each([['로딩 불가 hierarchy(tertiary)', {
|
|
142
|
+
hierarchy: 'tertiary'
|
|
143
|
+
}], ['onlyIcon', {
|
|
144
|
+
hierarchy: 'primary',
|
|
145
|
+
onlyIcon: true
|
|
146
|
+
}]])('BTN-01 %s 이면 loading 을 무시한다', (_name, props) => {
|
|
147
|
+
const view = mount(button({
|
|
148
|
+
...props,
|
|
149
|
+
loading: true
|
|
150
|
+
}));
|
|
151
|
+
const element = mustQuery(view.container, 'button');
|
|
152
|
+
expect(element.querySelector('.ncua-btn__spinner')).toBeNull();
|
|
153
|
+
expect(element.disabled).toBe(false);
|
|
154
|
+
expect(element.hasAttribute('aria-busy')).toBe(false);
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
describe('Button — 슬롯 (BTN-02)', () => {
|
|
158
|
+
it.each([['지정 size 가 우선', {
|
|
159
|
+
size: CUSTOM_ICON_SIZE
|
|
160
|
+
}, {}, CUSTOM_ICON_SIZE], ['일반 버튼 기본 크기', {}, {}, XS_ICON_SIZE], ['onlyIcon 기본 크기', {}, {
|
|
161
|
+
onlyIcon: true
|
|
162
|
+
}, XS_ICON_ONLY_SIZE]])('BTN-02 icon 슬롯 크기: %s', (_name, slotExtra, buttonExtra, expected) => {
|
|
163
|
+
const view = mount(button({
|
|
164
|
+
...buttonExtra,
|
|
165
|
+
leadingIcon: {
|
|
166
|
+
type: 'icon',
|
|
167
|
+
icon: LeadingIcon,
|
|
168
|
+
...slotExtra
|
|
169
|
+
}
|
|
170
|
+
}));
|
|
171
|
+
const icon = mustIcon(view.container, 'leading');
|
|
172
|
+
expect([icon.getAttribute('width'), icon.getAttribute('height')]).toEqual([String(expected), String(expected)]);
|
|
173
|
+
});
|
|
174
|
+
it.each([['color 지정 시 COLOR 값', 'gray700', COLOR.gray700], ['color 생략 시 없음', undefined, null]])('BTN-02 icon 슬롯 색: %s', (_name, color, expected) => {
|
|
175
|
+
const view = mount(button({
|
|
176
|
+
leadingIcon: {
|
|
177
|
+
type: 'icon',
|
|
178
|
+
icon: LeadingIcon,
|
|
179
|
+
color
|
|
180
|
+
}
|
|
181
|
+
}));
|
|
182
|
+
expect(mustIcon(view.container, 'leading').getAttribute('color')).toBe(expected);
|
|
183
|
+
});
|
|
184
|
+
it.each([['지정 size', {
|
|
185
|
+
type: 'dot',
|
|
186
|
+
color: 'error',
|
|
187
|
+
size: 'lg'
|
|
188
|
+
}, 'sm', 'ncua-dot--lg'], ['size 생략 시 버튼 크기 매핑(sm → md)', {
|
|
189
|
+
type: 'dot',
|
|
190
|
+
color: 'error'
|
|
191
|
+
}, 'sm', 'ncua-dot--md']])('BTN-02 dot 슬롯: %s', (_name, slot, size, expectedClass) => {
|
|
192
|
+
// size 생략은 타입 밖이라 캐스팅한다 — `slot.size ?? dotSize[size]` 폴백 경로
|
|
193
|
+
const view = mount(button({
|
|
194
|
+
size,
|
|
195
|
+
leadingIcon: slot
|
|
196
|
+
}));
|
|
197
|
+
const dot = mustQuery(view.container, '.ncua-dot');
|
|
198
|
+
expect(Array.from(dot.classList)).toEqual(expect.arrayContaining(['ncua-dot--error', expectedClass]));
|
|
199
|
+
});
|
|
200
|
+
it('BTN-02 custom 슬롯은 children 을 그대로 그리고 trailingIcon 도 슬롯 규칙을 따른다', () => {
|
|
201
|
+
const view = mount(button({
|
|
202
|
+
leadingIcon: {
|
|
203
|
+
type: 'custom',
|
|
204
|
+
children: /*#__PURE__*/createElement('i', {
|
|
205
|
+
className: 'custom-slot'
|
|
206
|
+
})
|
|
207
|
+
},
|
|
208
|
+
trailingIcon: {
|
|
209
|
+
type: 'icon',
|
|
210
|
+
icon: TrailingIcon
|
|
211
|
+
}
|
|
212
|
+
}));
|
|
213
|
+
const element = mustQuery(view.container, 'button');
|
|
214
|
+
expect(element.querySelector('.custom-slot')).not.toBeNull();
|
|
215
|
+
expect(element.lastElementChild?.getAttribute('data-icon')).toBe('trailing');
|
|
216
|
+
});
|
|
217
|
+
});
|
|
218
|
+
describe('Button — 클래스 · ref · 나머지 props (BTN-03)', () => {
|
|
219
|
+
it('BTN-03 size · hierarchy · onlyIcon · underline · className 을 클래스로 반영하고 onlyIcon 이면 label 을 숨긴다', () => {
|
|
220
|
+
const view = mount(button({
|
|
221
|
+
size: 'md',
|
|
222
|
+
hierarchy: 'primary',
|
|
223
|
+
onlyIcon: true,
|
|
224
|
+
underline: true,
|
|
225
|
+
className: 'custom-btn'
|
|
226
|
+
}));
|
|
227
|
+
const element = mustQuery(view.container, 'button');
|
|
228
|
+
expect(Array.from(element.classList)).toEqual(expect.arrayContaining(['ncua-btn', 'ncua-btn--md', 'ncua-btn--primary', 'only-icon', 'has-underline', 'custom-btn']));
|
|
229
|
+
expect(element.querySelector('.ncua-btn__label')).toBeNull();
|
|
230
|
+
});
|
|
231
|
+
it('BTN-03 기본값: xs · secondary-gray, label 표시, disabled 면 is-disable', () => {
|
|
232
|
+
const view = mount(button({
|
|
233
|
+
disabled: true
|
|
234
|
+
}));
|
|
235
|
+
const element = mustQuery(view.container, 'button');
|
|
236
|
+
expect(Array.from(element.classList)).toEqual(expect.arrayContaining(['ncua-btn--xs', 'ncua-btn--secondary-gray', 'is-disable']));
|
|
237
|
+
expect(mustQuery(element, '.ncua-btn__label').textContent).toBe(LABEL);
|
|
238
|
+
});
|
|
239
|
+
it('BTN-03 ref 는 button 요소를 가리키고 나머지 props · children 을 전달한다', () => {
|
|
240
|
+
const ref = /*#__PURE__*/createRef();
|
|
241
|
+
const onClick = vi.fn();
|
|
242
|
+
const view = mount(/*#__PURE__*/createElement(Button, {
|
|
243
|
+
label: LABEL,
|
|
244
|
+
ref,
|
|
245
|
+
onClick,
|
|
246
|
+
'aria-label': '저장하기'
|
|
247
|
+
}, /*#__PURE__*/createElement('span', {
|
|
248
|
+
className: 'extra'
|
|
249
|
+
})));
|
|
250
|
+
const element = mustQuery(view.container, 'button');
|
|
251
|
+
act(() => element.click());
|
|
252
|
+
expect(ref.current).toBe(element);
|
|
253
|
+
expect(element.getAttribute('aria-label')).toBe('저장하기');
|
|
254
|
+
expect(element.querySelector('.extra')).not.toBeNull();
|
|
255
|
+
expect(onClick).toHaveBeenCalled();
|
|
256
|
+
});
|
|
257
|
+
});
|