@ncds/ui-admin 1.3.0 → 1.5.0
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/comboBox.js +280 -0
- package/dist/cjs/assets/scripts/datePicker.js +231 -60
- package/dist/cjs/assets/scripts/featuredIcon.js +95 -0
- package/dist/cjs/assets/scripts/fileInput/FileInput.js +183 -0
- package/dist/cjs/assets/scripts/fileInput/FileInputModel.js +246 -0
- package/dist/cjs/assets/scripts/fileInput/FileInputView.js +455 -0
- package/dist/cjs/assets/scripts/fileInput/const/classNames.js +35 -0
- package/dist/cjs/assets/scripts/fileInput/const/index.js +27 -0
- package/dist/cjs/assets/scripts/fileInput/const/types.js +13 -0
- package/dist/cjs/assets/scripts/fileInput/index.js +44 -0
- package/dist/cjs/assets/scripts/imageFileInput/ImageFileInput.js +187 -0
- package/dist/cjs/assets/scripts/imageFileInput/ImageFileInputModel.js +255 -0
- package/dist/cjs/assets/scripts/imageFileInput/ImageFileInputView.js +354 -0
- package/dist/cjs/assets/scripts/imageFileInput/const/classNames.js +41 -0
- package/dist/cjs/assets/scripts/imageFileInput/const/index.js +27 -0
- package/dist/cjs/assets/scripts/imageFileInput/const/types.js +13 -0
- package/dist/cjs/assets/scripts/imageFileInput/index.js +44 -0
- package/dist/cjs/assets/scripts/index.js +21 -1
- package/dist/cjs/assets/scripts/modal/Modal.js +116 -0
- package/dist/cjs/assets/scripts/modal/ModalActions.js +128 -0
- package/dist/cjs/assets/scripts/modal/ModalContent.js +46 -0
- package/dist/cjs/assets/scripts/modal/ModalHeader.js +115 -0
- package/dist/cjs/assets/scripts/modal/const/classNames.js +41 -0
- package/dist/cjs/assets/scripts/modal/const/index.js +27 -0
- package/dist/cjs/assets/scripts/modal/const/types.js +5 -0
- package/dist/cjs/assets/scripts/modal/index.js +61 -0
- package/dist/cjs/assets/scripts/modal/utils/contentUtils.js +35 -0
- package/dist/cjs/assets/scripts/notification/FloatingNotification.js +180 -0
- package/dist/cjs/assets/scripts/notification/FullWidthNotification.js +120 -0
- package/dist/cjs/assets/scripts/notification/MessageNotification.js +146 -0
- package/dist/cjs/assets/scripts/notification/Notification.js +116 -0
- package/dist/cjs/assets/scripts/notification/const/classNames.js +50 -0
- package/dist/cjs/assets/scripts/notification/const/icons.js +45 -0
- package/dist/cjs/assets/scripts/notification/const/index.js +87 -0
- package/dist/cjs/assets/scripts/notification/const/sizes.js +54 -0
- package/dist/cjs/assets/scripts/notification/const/types.js +14 -0
- package/dist/cjs/assets/scripts/notification/index.js +92 -0
- package/dist/cjs/assets/scripts/notification/utils.js +92 -0
- package/dist/cjs/assets/scripts/progress-bar/ProgressBar.js +272 -0
- package/dist/cjs/assets/scripts/progress-bar/index.js +12 -0
- package/dist/cjs/assets/scripts/selectBox.js +319 -0
- package/dist/cjs/assets/scripts/shared/ButtonCloseX.js +46 -0
- package/dist/cjs/assets/scripts/tag/Tag.js +268 -0
- package/dist/cjs/assets/scripts/tag/const/classNames.js +24 -0
- package/dist/cjs/assets/scripts/tag/const/index.js +38 -0
- package/dist/cjs/assets/scripts/tag/const/sizes.js +13 -0
- package/dist/cjs/assets/scripts/tag/const/types.js +5 -0
- package/dist/cjs/assets/scripts/tag/index.js +44 -0
- package/dist/cjs/assets/scripts/tooltip/Tooltip.js +380 -0
- package/dist/cjs/assets/scripts/tooltip/TooltipLayerManager.js +84 -0
- package/dist/cjs/assets/scripts/tooltip/const/classNames.js +29 -0
- package/dist/cjs/assets/scripts/tooltip/const/constants.js +56 -0
- package/dist/cjs/assets/scripts/tooltip/const/icons.js +15 -0
- package/dist/cjs/assets/scripts/tooltip/const/index.js +123 -0
- package/dist/cjs/assets/scripts/tooltip/const/templates.js +49 -0
- package/dist/cjs/assets/scripts/tooltip/const/types.js +5 -0
- package/dist/cjs/assets/scripts/tooltip/index.js +57 -0
- package/dist/cjs/assets/scripts/tooltip/utils.js +41 -0
- package/dist/cjs/assets/scripts/utils/selectbox/DOMRenderer.js +384 -0
- package/dist/cjs/assets/scripts/utils/selectbox/DropdownModel.js +368 -0
- package/dist/cjs/assets/scripts/utils/selectbox/SelectBoxController.js +681 -0
- package/dist/cjs/assets/scripts/utils/selectbox/UnifiedSelectBox.js +711 -0
- package/dist/cjs/constant/color.js +2 -0
- package/dist/cjs/src/components/button/Button.js +9 -35
- package/dist/cjs/src/components/button/ButtonGroup.js +9 -10
- package/dist/cjs/src/components/button/ButtonStepper.js +22 -0
- package/dist/cjs/src/components/button/index.js +22 -0
- package/dist/cjs/src/components/checkbox/Checkbox.js +20 -19
- package/dist/cjs/src/components/checkbox/CheckboxInput.js +22 -45
- package/dist/cjs/src/components/combobox/ComboBox.js +337 -0
- package/dist/cjs/src/components/combobox/index.js +12 -0
- package/dist/cjs/src/components/date-picker/CustomInput.js +52 -0
- package/dist/cjs/src/components/date-picker/DatePicker.js +126 -24
- package/dist/cjs/src/components/date-picker/RangeDatePicker.js +3 -1
- package/dist/cjs/src/components/date-picker/RangeDatePickerWithButtons.js +7 -3
- package/dist/cjs/src/components/{input → file-upload}/FileInput.js +17 -9
- package/dist/cjs/src/components/file-upload/index.js +16 -0
- package/dist/cjs/src/components/image-file-input/ImageFileInput.js +263 -0
- package/dist/cjs/src/components/image-file-input/components/ImagePreview.js +44 -0
- package/dist/cjs/src/components/image-file-input/index.js +16 -0
- package/dist/cjs/src/components/index.js +44 -0
- package/dist/cjs/src/components/input/InputBase.js +54 -10
- package/dist/cjs/src/components/input/NumberInput.js +130 -0
- package/dist/cjs/src/components/input/Textarea.js +12 -20
- package/dist/cjs/src/components/input/index.js +11 -11
- package/dist/cjs/src/components/modal/Modal.js +7 -3
- package/dist/cjs/src/components/notification/FloatingNotification.js +34 -3
- package/dist/cjs/src/components/notification/FullWidthNotification.js +54 -5
- package/dist/cjs/src/components/notification/MessageNotification.js +137 -0
- package/dist/cjs/src/components/notification/Notification.js +23 -9
- package/dist/cjs/src/components/notification/index.js +11 -0
- package/dist/cjs/src/components/pagination/NavButton.js +1 -13
- package/dist/cjs/src/components/pagination/Pagination.js +6 -20
- package/dist/cjs/src/components/progress-bar/ProgressBar.js +89 -20
- package/dist/cjs/src/components/progress-bar/components/SegmentBar.js +25 -0
- package/dist/cjs/src/components/progress-bar/components/SegmentLabels.js +74 -0
- package/dist/cjs/src/components/progress-bar/hooks/useProgressBar.js +119 -0
- package/dist/cjs/src/components/progress-bar/index.js +11 -0
- package/dist/cjs/src/components/progress-bar/types.js +5 -0
- package/dist/cjs/src/components/progress-bar/utils.js +31 -0
- package/dist/cjs/src/components/radio/Radio.js +5 -6
- package/dist/cjs/src/components/select/Select.js +7 -4
- package/dist/cjs/src/components/select-dropdown/SelectDropdown.js +146 -0
- package/dist/cjs/src/components/select-dropdown/index.js +12 -0
- package/dist/cjs/src/components/selectbox/SelectBox.js +283 -0
- package/dist/cjs/src/components/selectbox/index.js +12 -0
- package/dist/cjs/src/components/shared/hintText/HintText.js +1 -1
- package/dist/cjs/src/components/switch/Switch.js +123 -0
- package/dist/cjs/src/components/switch/index.js +12 -0
- package/dist/cjs/src/components/tab/HorizontalTab.js +8 -20
- package/dist/cjs/src/components/tab/TabButton.js +33 -16
- package/dist/cjs/src/components/tab/VerticalTab.js +15 -30
- package/dist/cjs/src/components/tag/Tag.js +92 -3
- package/dist/cjs/src/components/tooltip/Tooltip.js +138 -30
- package/dist/cjs/src/hooks/dropdown/index.js +47 -0
- package/dist/cjs/src/hooks/dropdown/useDropdown.js +109 -0
- package/dist/cjs/src/hooks/dropdown/useDropdownKeyboard.js +131 -0
- package/dist/cjs/src/hooks/dropdown/useDropdownPosition.js +27 -0
- package/dist/cjs/src/hooks/dropdown/useOutsideClick.js +33 -0
- package/dist/cjs/src/hooks/dropdown/useScrollLock.js +78 -0
- package/dist/cjs/src/hooks/dropdown/useWindowResize.js +52 -0
- package/dist/cjs/src/hooks/index.js +18 -1
- package/dist/cjs/src/types/dropdown/dropdown.js +5 -0
- package/dist/cjs/src/types/dropdown/index.js +27 -0
- package/dist/cjs/src/types/dropdown/option.js +5 -0
- package/dist/cjs/src/types/index.js +16 -0
- package/dist/cjs/src/utils/date-picker.js +37 -1
- package/dist/cjs/src/utils/dropdown/dropdownUtils.js +107 -0
- package/dist/cjs/src/utils/dropdown/index.js +27 -0
- package/dist/cjs/src/utils/dropdown/multiSelect.js +100 -0
- package/dist/cjs/src/utils/index.js +27 -0
- package/dist/esm/assets/scripts/comboBox.js +275 -0
- package/dist/esm/assets/scripts/datePicker.js +228 -59
- package/dist/esm/assets/scripts/featuredIcon.js +90 -0
- package/dist/esm/assets/scripts/fileInput/FileInput.js +178 -0
- package/dist/esm/assets/scripts/fileInput/FileInputModel.js +241 -0
- package/dist/esm/assets/scripts/fileInput/FileInputView.js +450 -0
- package/dist/esm/assets/scripts/fileInput/const/classNames.js +25 -0
- package/dist/esm/assets/scripts/fileInput/const/index.js +2 -0
- package/dist/esm/assets/scripts/fileInput/const/types.js +7 -0
- package/dist/esm/assets/scripts/fileInput/index.js +9 -0
- package/dist/esm/assets/scripts/imageFileInput/ImageFileInput.js +182 -0
- package/dist/esm/assets/scripts/imageFileInput/ImageFileInputModel.js +250 -0
- package/dist/esm/assets/scripts/imageFileInput/ImageFileInputView.js +349 -0
- package/dist/esm/assets/scripts/imageFileInput/const/classNames.js +30 -0
- package/dist/esm/assets/scripts/imageFileInput/const/index.js +2 -0
- package/dist/esm/assets/scripts/imageFileInput/const/types.js +7 -0
- package/dist/esm/assets/scripts/imageFileInput/index.js +9 -0
- package/dist/esm/assets/scripts/index.js +21 -1
- package/dist/esm/assets/scripts/modal/Modal.js +110 -0
- package/dist/esm/assets/scripts/modal/ModalActions.js +123 -0
- package/dist/esm/assets/scripts/modal/ModalContent.js +41 -0
- package/dist/esm/assets/scripts/modal/ModalHeader.js +110 -0
- package/dist/esm/assets/scripts/modal/const/classNames.js +31 -0
- package/dist/esm/assets/scripts/modal/const/index.js +2 -0
- package/dist/esm/assets/scripts/modal/const/types.js +1 -0
- package/dist/esm/assets/scripts/modal/index.js +15 -0
- package/dist/esm/assets/scripts/modal/utils/contentUtils.js +28 -0
- package/dist/esm/assets/scripts/notification/FloatingNotification.js +176 -0
- package/dist/esm/assets/scripts/notification/FullWidthNotification.js +115 -0
- package/dist/esm/assets/scripts/notification/MessageNotification.js +141 -0
- package/dist/esm/assets/scripts/notification/Notification.js +111 -0
- package/dist/esm/assets/scripts/notification/const/classNames.js +44 -0
- package/dist/esm/assets/scripts/notification/const/icons.js +39 -0
- package/dist/esm/assets/scripts/notification/const/index.js +4 -0
- package/dist/esm/assets/scripts/notification/const/sizes.js +48 -0
- package/dist/esm/assets/scripts/notification/const/types.js +8 -0
- package/dist/esm/assets/scripts/notification/index.js +11 -0
- package/dist/esm/assets/scripts/notification/utils.js +79 -0
- package/dist/esm/assets/scripts/progress-bar/ProgressBar.js +267 -0
- package/dist/esm/assets/scripts/progress-bar/index.js +1 -0
- package/dist/esm/assets/scripts/selectBox.js +314 -0
- package/dist/esm/assets/scripts/shared/ButtonCloseX.js +38 -0
- package/dist/esm/assets/scripts/tag/Tag.js +263 -0
- package/dist/esm/assets/scripts/tag/const/classNames.js +16 -0
- package/dist/esm/assets/scripts/tag/const/index.js +3 -0
- package/dist/esm/assets/scripts/tag/const/sizes.js +7 -0
- package/dist/esm/assets/scripts/tag/const/types.js +1 -0
- package/dist/esm/assets/scripts/tag/index.js +9 -0
- package/dist/esm/assets/scripts/tooltip/Tooltip.js +375 -0
- package/dist/esm/assets/scripts/tooltip/TooltipLayerManager.js +79 -0
- package/dist/esm/assets/scripts/tooltip/const/classNames.js +23 -0
- package/dist/esm/assets/scripts/tooltip/const/constants.js +50 -0
- package/dist/esm/assets/scripts/tooltip/const/icons.js +9 -0
- package/dist/esm/assets/scripts/tooltip/const/index.js +4 -0
- package/dist/esm/assets/scripts/tooltip/const/templates.js +42 -0
- package/dist/esm/assets/scripts/tooltip/const/types.js +1 -0
- package/dist/esm/assets/scripts/tooltip/index.js +10 -0
- package/dist/esm/assets/scripts/tooltip/utils.js +35 -0
- package/dist/esm/assets/scripts/utils/selectbox/DOMRenderer.js +379 -0
- package/dist/esm/assets/scripts/utils/selectbox/DropdownModel.js +363 -0
- package/dist/esm/assets/scripts/utils/selectbox/SelectBoxController.js +676 -0
- package/dist/esm/assets/scripts/utils/selectbox/UnifiedSelectBox.js +706 -0
- package/dist/esm/constant/color.js +2 -0
- package/dist/esm/src/components/button/Button.js +10 -36
- package/dist/esm/src/components/button/ButtonGroup.js +9 -10
- package/dist/esm/src/components/button/ButtonStepper.js +14 -0
- package/dist/esm/src/components/button/index.js +3 -1
- package/dist/esm/src/components/checkbox/Checkbox.js +21 -19
- package/dist/esm/src/components/checkbox/CheckboxInput.js +24 -47
- package/dist/esm/src/components/combobox/ComboBox.js +330 -0
- package/dist/esm/src/components/combobox/index.js +1 -0
- package/dist/esm/src/components/date-picker/CustomInput.js +45 -0
- package/dist/esm/src/components/date-picker/DatePicker.js +127 -25
- package/dist/esm/src/components/date-picker/RangeDatePicker.js +3 -1
- package/dist/esm/src/components/date-picker/RangeDatePickerWithButtons.js +7 -3
- package/dist/esm/src/components/{input → file-upload}/FileInput.js +17 -9
- package/dist/esm/src/components/file-upload/index.js +1 -0
- package/dist/esm/src/components/image-file-input/ImageFileInput.js +256 -0
- package/dist/esm/src/components/image-file-input/components/ImagePreview.js +37 -0
- package/dist/esm/src/components/image-file-input/index.js +1 -0
- package/dist/esm/src/components/index.js +4 -0
- package/dist/esm/src/components/input/InputBase.js +55 -11
- package/dist/esm/src/components/input/NumberInput.js +124 -0
- package/dist/esm/src/components/input/Textarea.js +12 -20
- package/dist/esm/src/components/input/index.js +2 -2
- package/dist/esm/src/components/modal/Modal.js +7 -3
- package/dist/esm/src/components/notification/FloatingNotification.js +35 -4
- package/dist/esm/src/components/notification/FullWidthNotification.js +55 -6
- package/dist/esm/src/components/notification/MessageNotification.js +130 -0
- package/dist/esm/src/components/notification/Notification.js +23 -9
- package/dist/esm/src/components/notification/index.js +2 -1
- package/dist/esm/src/components/pagination/NavButton.js +1 -13
- package/dist/esm/src/components/pagination/Pagination.js +6 -20
- package/dist/esm/src/components/progress-bar/ProgressBar.js +89 -20
- package/dist/esm/src/components/progress-bar/components/SegmentBar.js +18 -0
- package/dist/esm/src/components/progress-bar/components/SegmentLabels.js +66 -0
- package/dist/esm/src/components/progress-bar/hooks/useProgressBar.js +112 -0
- package/dist/esm/src/components/progress-bar/index.js +2 -1
- package/dist/esm/src/components/progress-bar/types.js +1 -0
- package/dist/esm/src/components/progress-bar/utils.js +22 -0
- package/dist/esm/src/components/radio/Radio.js +5 -5
- package/dist/esm/src/components/select/Select.js +7 -4
- package/dist/esm/src/components/select-dropdown/SelectDropdown.js +139 -0
- package/dist/esm/src/components/select-dropdown/index.js +1 -0
- package/dist/esm/src/components/selectbox/SelectBox.js +276 -0
- package/dist/esm/src/components/selectbox/index.js +1 -0
- package/dist/esm/src/components/shared/hintText/HintText.js +1 -1
- package/dist/esm/src/components/switch/Switch.js +116 -0
- package/dist/esm/src/components/switch/index.js +1 -0
- package/dist/esm/src/components/tab/HorizontalTab.js +7 -19
- package/dist/esm/src/components/tab/TabButton.js +34 -17
- package/dist/esm/src/components/tab/VerticalTab.js +15 -30
- package/dist/esm/src/components/tag/Tag.js +92 -3
- package/dist/esm/src/components/tooltip/Tooltip.js +139 -31
- package/dist/esm/src/hooks/dropdown/index.js +6 -0
- package/dist/esm/src/hooks/dropdown/useDropdown.js +102 -0
- package/dist/esm/src/hooks/dropdown/useDropdownKeyboard.js +124 -0
- package/dist/esm/src/hooks/dropdown/useDropdownPosition.js +20 -0
- package/dist/esm/src/hooks/dropdown/useOutsideClick.js +26 -0
- package/dist/esm/src/hooks/dropdown/useScrollLock.js +71 -0
- package/dist/esm/src/hooks/dropdown/useWindowResize.js +45 -0
- package/dist/esm/src/hooks/index.js +4 -1
- package/dist/esm/src/types/dropdown/dropdown.js +1 -0
- package/dist/esm/src/types/dropdown/index.js +2 -0
- package/dist/esm/src/types/dropdown/option.js +1 -0
- package/dist/esm/src/types/index.js +2 -0
- package/dist/esm/src/utils/date-picker.js +33 -1
- package/dist/esm/src/utils/dropdown/dropdownUtils.js +97 -0
- package/dist/esm/src/utils/dropdown/index.js +2 -0
- package/dist/esm/src/utils/dropdown/multiSelect.js +88 -0
- package/dist/esm/src/utils/index.js +4 -0
- package/dist/types/assets/scripts/comboBox.d.ts +91 -0
- package/dist/types/assets/scripts/datePicker.d.ts +17 -13
- package/dist/types/assets/scripts/featuredIcon.d.ts +23 -0
- package/dist/types/assets/scripts/fileInput/FileInput.d.ts +67 -0
- package/dist/types/assets/scripts/fileInput/FileInputModel.d.ts +70 -0
- package/dist/types/assets/scripts/fileInput/FileInputView.d.ts +77 -0
- package/dist/types/assets/scripts/fileInput/const/classNames.d.ts +17 -0
- package/dist/types/assets/scripts/fileInput/const/index.d.ts +3 -0
- package/dist/types/assets/scripts/fileInput/const/types.d.ts +132 -0
- package/dist/types/assets/scripts/fileInput/index.d.ts +4 -0
- package/dist/types/assets/scripts/imageFileInput/ImageFileInput.d.ts +64 -0
- package/dist/types/assets/scripts/imageFileInput/ImageFileInputModel.d.ts +74 -0
- package/dist/types/assets/scripts/imageFileInput/ImageFileInputView.d.ts +80 -0
- package/dist/types/assets/scripts/imageFileInput/const/classNames.d.ts +20 -0
- package/dist/types/assets/scripts/imageFileInput/const/index.d.ts +3 -0
- package/dist/types/assets/scripts/imageFileInput/const/types.d.ts +126 -0
- package/dist/types/assets/scripts/imageFileInput/index.d.ts +4 -0
- package/dist/types/assets/scripts/index.d.ts +28 -2
- package/dist/types/assets/scripts/modal/Modal.d.ts +28 -0
- package/dist/types/assets/scripts/modal/ModalActions.d.ts +19 -0
- package/dist/types/assets/scripts/modal/ModalContent.d.ts +14 -0
- package/dist/types/assets/scripts/modal/ModalHeader.d.ts +16 -0
- package/dist/types/assets/scripts/modal/const/classNames.d.ts +23 -0
- package/dist/types/assets/scripts/modal/const/index.d.ts +3 -0
- package/dist/types/assets/scripts/modal/const/types.d.ts +62 -0
- package/dist/types/assets/scripts/modal/index.d.ts +8 -0
- package/dist/types/assets/scripts/modal/utils/contentUtils.d.ts +11 -0
- package/dist/types/assets/scripts/notification/FloatingNotification.d.ts +25 -0
- package/dist/types/assets/scripts/notification/FullWidthNotification.d.ts +22 -0
- package/dist/types/assets/scripts/notification/MessageNotification.d.ts +23 -0
- package/dist/types/assets/scripts/notification/Notification.d.ts +22 -0
- package/dist/types/assets/scripts/notification/const/classNames.d.ts +44 -0
- package/dist/types/assets/scripts/notification/const/icons.d.ts +26 -0
- package/dist/types/assets/scripts/notification/const/index.d.ts +6 -0
- package/dist/types/assets/scripts/notification/const/sizes.d.ts +33 -0
- package/dist/types/assets/scripts/notification/const/types.d.ts +20 -0
- package/dist/types/assets/scripts/notification/index.d.ts +8 -0
- package/dist/types/assets/scripts/notification/utils.d.ts +9 -0
- package/dist/types/assets/scripts/progress-bar/ProgressBar.d.ts +68 -0
- package/dist/types/assets/scripts/progress-bar/index.d.ts +2 -0
- package/dist/types/assets/scripts/selectBox.d.ts +77 -0
- package/dist/types/assets/scripts/shared/ButtonCloseX.d.ts +6 -0
- package/dist/types/assets/scripts/tag/Tag.d.ts +28 -0
- package/dist/types/assets/scripts/tag/const/classNames.d.ts +12 -0
- package/dist/types/assets/scripts/tag/const/index.d.ts +4 -0
- package/dist/types/assets/scripts/tag/const/sizes.d.ts +8 -0
- package/dist/types/assets/scripts/tag/const/types.d.ts +34 -0
- package/dist/types/assets/scripts/tag/index.d.ts +4 -0
- package/dist/types/assets/scripts/tooltip/Tooltip.d.ts +55 -0
- package/dist/types/assets/scripts/tooltip/TooltipLayerManager.d.ts +22 -0
- package/dist/types/assets/scripts/tooltip/const/classNames.d.ts +18 -0
- package/dist/types/assets/scripts/tooltip/const/constants.d.ts +34 -0
- package/dist/types/assets/scripts/tooltip/const/icons.d.ts +5 -0
- package/dist/types/assets/scripts/tooltip/const/index.d.ts +6 -0
- package/dist/types/assets/scripts/tooltip/const/templates.d.ts +17 -0
- package/dist/types/assets/scripts/tooltip/const/types.d.ts +15 -0
- package/dist/types/assets/scripts/tooltip/index.d.ts +7 -0
- package/dist/types/assets/scripts/tooltip/utils.d.ts +3 -0
- package/dist/types/assets/scripts/utils/selectbox/DOMRenderer.d.ts +108 -0
- package/dist/types/assets/scripts/utils/selectbox/DropdownModel.d.ts +158 -0
- package/dist/types/assets/scripts/utils/selectbox/SelectBoxController.d.ts +171 -0
- package/dist/types/assets/scripts/utils/selectbox/UnifiedSelectBox.d.ts +99 -0
- package/dist/types/constant/color.d.ts +3 -1
- package/dist/types/src/components/button/Button.d.ts +14 -12
- package/dist/types/src/components/button/ButtonGroup.d.ts +4 -289
- package/dist/types/src/components/button/ButtonStepper.d.ts +10 -0
- package/dist/types/src/components/button/index.d.ts +2 -0
- package/dist/types/src/components/checkbox/Checkbox.d.ts +2 -3
- package/dist/types/src/components/combobox/ComboBox.d.ts +28 -0
- package/dist/types/src/components/combobox/index.d.ts +3 -0
- package/dist/types/src/components/date-picker/CustomInput.d.ts +12 -0
- package/dist/types/src/components/date-picker/DatePicker.d.ts +3 -0
- package/dist/types/src/components/date-picker/RangeDatePickerWithButtons.d.ts +4 -4
- package/dist/types/src/components/{input → file-upload}/FileInput.d.ts +1 -1
- package/dist/types/src/components/file-upload/index.d.ts +2 -0
- package/dist/types/src/components/image-file-input/ImageFileInput.d.ts +78 -0
- package/dist/types/src/components/image-file-input/components/ImagePreview.d.ts +6 -0
- package/dist/types/src/components/image-file-input/index.d.ts +2 -0
- package/dist/types/src/components/index.d.ts +4 -0
- package/dist/types/src/components/input/InputBase.d.ts +2 -0
- package/dist/types/src/components/input/NumberInput.d.ts +10 -0
- package/dist/types/src/components/input/index.d.ts +1 -1
- package/dist/types/src/components/modal/Modal.d.ts +3 -2
- package/dist/types/src/components/notification/FloatingNotification.d.ts +5 -0
- package/dist/types/src/components/notification/FullWidthNotification.d.ts +15 -1
- package/dist/types/src/components/notification/MessageNotification.d.ts +40 -0
- package/dist/types/src/components/notification/Notification.d.ts +14 -3
- package/dist/types/src/components/notification/index.d.ts +1 -0
- package/dist/types/src/components/pagination/NavButton.d.ts +1 -4
- package/dist/types/src/components/pagination/Pagination.d.ts +2 -13
- package/dist/types/src/components/progress-bar/ProgressBar.d.ts +2 -6
- package/dist/types/src/components/progress-bar/components/SegmentBar.d.ts +8 -0
- package/dist/types/src/components/progress-bar/components/SegmentLabels.d.ts +16 -0
- package/dist/types/src/components/progress-bar/hooks/useProgressBar.d.ts +14 -0
- package/dist/types/src/components/progress-bar/index.d.ts +1 -0
- package/dist/types/src/components/progress-bar/types.d.ts +16 -0
- package/dist/types/src/components/progress-bar/utils.d.ts +13 -0
- package/dist/types/src/components/radio/Radio.d.ts +2 -3
- package/dist/types/src/components/select/Select.d.ts +1 -4
- package/dist/types/src/components/select-dropdown/SelectDropdown.d.ts +28 -0
- package/dist/types/src/components/select-dropdown/index.d.ts +2 -0
- package/dist/types/src/components/selectbox/SelectBox.d.ts +25 -0
- package/dist/types/src/components/selectbox/index.d.ts +2 -0
- package/dist/types/src/components/switch/Switch.d.ts +22 -0
- package/dist/types/src/components/switch/index.d.ts +3 -0
- package/dist/types/src/components/tab/HorizontalTab.d.ts +1 -2
- package/dist/types/src/components/tab/TabButton.d.ts +9 -12
- package/dist/types/src/components/tab/VerticalTab.d.ts +2 -2
- package/dist/types/src/components/tag/Tag.d.ts +3 -1
- package/dist/types/src/components/tooltip/Tooltip.d.ts +7 -3
- package/dist/types/src/hooks/dropdown/index.d.ts +7 -0
- package/dist/types/src/hooks/dropdown/useDropdown.d.ts +30 -0
- package/dist/types/src/hooks/dropdown/useDropdownKeyboard.d.ts +11 -0
- package/dist/types/src/hooks/dropdown/useDropdownPosition.d.ts +10 -0
- package/dist/types/src/hooks/dropdown/useOutsideClick.d.ts +6 -0
- package/dist/types/src/hooks/dropdown/useScrollLock.d.ts +5 -0
- package/dist/types/src/hooks/dropdown/useWindowResize.d.ts +8 -0
- package/dist/types/src/hooks/index.d.ts +2 -1
- package/dist/types/src/types/dropdown/dropdown.d.ts +40 -0
- package/dist/types/src/types/dropdown/index.d.ts +3 -0
- package/dist/types/src/types/dropdown/option.d.ts +20 -0
- package/dist/types/src/types/index.d.ts +2 -0
- package/dist/types/src/utils/date-picker.d.ts +3 -0
- package/dist/types/src/utils/dropdown/dropdownUtils.d.ts +18 -0
- package/dist/types/src/utils/dropdown/index.d.ts +3 -0
- package/dist/types/src/utils/dropdown/multiSelect.d.ts +32 -0
- package/dist/types/src/utils/index.d.ts +3 -0
- package/dist/ui-admin/assets/styles/style.css +2065 -397
- package/package.json +8 -4
|
@@ -19,7 +19,7 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
19
19
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
20
|
import Icon from '@ncds/ui-admin-icon/dynamic';
|
|
21
21
|
import classNames from 'classnames';
|
|
22
|
-
import { forwardRef } from 'react';
|
|
22
|
+
import { forwardRef, useEffect, useRef, useState } from 'react';
|
|
23
23
|
import { COLOR } from '../../../constant/color';
|
|
24
24
|
import { HintText } from '../shared/hintText/HintText';
|
|
25
25
|
import { Label } from '../shared/label/Label';
|
|
@@ -43,7 +43,27 @@ export var InputBase = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
43
43
|
leadingElement = _a.leadingElement,
|
|
44
44
|
trailingElement = _a.trailingElement,
|
|
45
45
|
showHelpIcon = _a.showHelpIcon,
|
|
46
|
-
|
|
46
|
+
maxLength = _a.maxLength,
|
|
47
|
+
showTextCount = _a.showTextCount,
|
|
48
|
+
props = __rest(_a, ["size", "required", "label", "hintText", "disabled", "validation", "destructive", "leadingElement", "trailingElement", "showHelpIcon", "maxLength", "showTextCount"]);
|
|
49
|
+
var inputRef = useRef(null);
|
|
50
|
+
var _c = useState(0),
|
|
51
|
+
textCount = _c[0],
|
|
52
|
+
setTextCount = _c[1];
|
|
53
|
+
useEffect(function () {
|
|
54
|
+
if (inputRef.current && showTextCount) {
|
|
55
|
+
setTextCount(inputRef.current.value.length);
|
|
56
|
+
var handleInput_1 = function () {
|
|
57
|
+
var _a, _b;
|
|
58
|
+
setTextCount((_b = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.value.length) !== null && _b !== void 0 ? _b : 0);
|
|
59
|
+
};
|
|
60
|
+
inputRef.current.addEventListener('input', handleInput_1);
|
|
61
|
+
return function () {
|
|
62
|
+
var _a;
|
|
63
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('input', handleInput_1);
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
}, [showTextCount]);
|
|
47
67
|
var renderOutsideSlot = function (slot) {
|
|
48
68
|
if (slot.type === 'custom' && slot.placement !== 'outside') {
|
|
49
69
|
return null;
|
|
@@ -156,17 +176,41 @@ export var InputBase = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
156
176
|
})
|
|
157
177
|
}, {
|
|
158
178
|
children: [renderLabel(), _jsxs("div", __assign({
|
|
159
|
-
className: "ncua-input__content"
|
|
179
|
+
className: "ncua-input__content-wrap"
|
|
160
180
|
}, {
|
|
161
|
-
children: [
|
|
162
|
-
className:
|
|
181
|
+
children: [_jsxs("div", __assign({
|
|
182
|
+
className: "ncua-input__content"
|
|
183
|
+
}, {
|
|
184
|
+
children: [leadingElement && renderOutsideSlot(leadingElement), _jsxs("div", __assign({
|
|
185
|
+
className: classNames('ncua-input__field', "ncua-input__field--".concat(size))
|
|
186
|
+
}, {
|
|
187
|
+
children: [leadingElement && renderInsideSlot(leadingElement, 'left'), _jsx("input", __assign({
|
|
188
|
+
ref: function (node) {
|
|
189
|
+
if (typeof ref === 'function') {
|
|
190
|
+
ref(node);
|
|
191
|
+
} else if (ref) {
|
|
192
|
+
ref.current = node;
|
|
193
|
+
}
|
|
194
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
195
|
+
// @ts-ignore - ref assignment is needed for internal tracking
|
|
196
|
+
inputRef.current = node;
|
|
197
|
+
},
|
|
198
|
+
type: "text",
|
|
199
|
+
disabled: disabled,
|
|
200
|
+
maxLength: maxLength
|
|
201
|
+
}, props)), renderClearButton(), renderStatusIcon(), trailingElement && renderInsideSlot(trailingElement, 'right')]
|
|
202
|
+
})), trailingElement && renderOutsideSlot(trailingElement)]
|
|
203
|
+
})), showTextCount && maxLength && _jsxs("div", __assign({
|
|
204
|
+
className: "ncua-input__field-text-count"
|
|
163
205
|
}, {
|
|
164
|
-
children: [
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}
|
|
169
|
-
|
|
206
|
+
children: [_jsx("output", __assign({
|
|
207
|
+
className: "ncua-input__field-text-count-current"
|
|
208
|
+
}, {
|
|
209
|
+
children: textCount
|
|
210
|
+
})), _jsxs("span", {
|
|
211
|
+
children: ["/", maxLength]
|
|
212
|
+
})]
|
|
213
|
+
}))]
|
|
170
214
|
})), hintText && _jsx(HintText, __assign({
|
|
171
215
|
className: "ncua-input__hint-text",
|
|
172
216
|
destructive: destructive
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
var __assign = this && this.__assign || function () {
|
|
2
|
+
__assign = Object.assign || function (t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
6
|
+
}
|
|
7
|
+
return t;
|
|
8
|
+
};
|
|
9
|
+
return __assign.apply(this, arguments);
|
|
10
|
+
};
|
|
11
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
14
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
15
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
16
|
+
}
|
|
17
|
+
return t;
|
|
18
|
+
};
|
|
19
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
+
import { forwardRef, useCallback, useRef } from 'react';
|
|
21
|
+
import { useMergeRefs } from '../../hooks';
|
|
22
|
+
import { ButtonStepper } from '../button';
|
|
23
|
+
import { InputBase } from './InputBase';
|
|
24
|
+
export var NumberInput = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
25
|
+
var _b = _a.size,
|
|
26
|
+
size = _b === void 0 ? 'xs' : _b,
|
|
27
|
+
minValue = _a.minValue,
|
|
28
|
+
maxValue = _a.maxValue,
|
|
29
|
+
_c = _a.step,
|
|
30
|
+
step = _c === void 0 ? 1 : _c,
|
|
31
|
+
stepperPosition = _a.stepperPosition,
|
|
32
|
+
disabled = _a.disabled,
|
|
33
|
+
props = __rest(_a, ["size", "minValue", "maxValue", "step", "stepperPosition", "disabled"]);
|
|
34
|
+
var inputRef = useRef(null);
|
|
35
|
+
var mergedRef = useMergeRefs([ref, inputRef]);
|
|
36
|
+
var getCurrentValue = useCallback(function () {
|
|
37
|
+
var _a;
|
|
38
|
+
var value = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.value;
|
|
39
|
+
return value ? parseFloat(value) : 0;
|
|
40
|
+
}, []);
|
|
41
|
+
var updateValue = useCallback(function (newValue) {
|
|
42
|
+
if (!inputRef.current) return;
|
|
43
|
+
// min/max 범위 체크
|
|
44
|
+
var clampedValue = newValue;
|
|
45
|
+
if (minValue !== undefined && clampedValue < minValue) {
|
|
46
|
+
clampedValue = minValue;
|
|
47
|
+
}
|
|
48
|
+
if (maxValue !== undefined && clampedValue > maxValue) {
|
|
49
|
+
clampedValue = maxValue;
|
|
50
|
+
}
|
|
51
|
+
inputRef.current.value = clampedValue.toString();
|
|
52
|
+
// onChange 이벤트 트리거
|
|
53
|
+
var event = new Event('input', {
|
|
54
|
+
bubbles: true
|
|
55
|
+
});
|
|
56
|
+
inputRef.current.dispatchEvent(event);
|
|
57
|
+
}, [minValue, maxValue]);
|
|
58
|
+
var handleIncrement = useCallback(function () {
|
|
59
|
+
var currentValue = getCurrentValue();
|
|
60
|
+
var newValue = currentValue + step;
|
|
61
|
+
if (maxValue === undefined || newValue <= maxValue) {
|
|
62
|
+
updateValue(newValue);
|
|
63
|
+
}
|
|
64
|
+
}, [getCurrentValue, step, maxValue, updateValue]);
|
|
65
|
+
var handleDecrement = useCallback(function () {
|
|
66
|
+
var currentValue = getCurrentValue();
|
|
67
|
+
var newValue = currentValue - step;
|
|
68
|
+
if (minValue === undefined || newValue >= minValue) {
|
|
69
|
+
updateValue(newValue);
|
|
70
|
+
}
|
|
71
|
+
}, [getCurrentValue, step, minValue, updateValue]);
|
|
72
|
+
var handleKeyDown = useCallback(function (event) {
|
|
73
|
+
var _a;
|
|
74
|
+
if (disabled) return;
|
|
75
|
+
if (event.key === 'ArrowUp') {
|
|
76
|
+
event.preventDefault();
|
|
77
|
+
handleIncrement();
|
|
78
|
+
} else if (event.key === 'ArrowDown') {
|
|
79
|
+
event.preventDefault();
|
|
80
|
+
handleDecrement();
|
|
81
|
+
}
|
|
82
|
+
// 기존 onKeyDown prop이 있으면 호출
|
|
83
|
+
(_a = props.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(props, event);
|
|
84
|
+
}, [disabled, handleIncrement, handleDecrement, props]);
|
|
85
|
+
var renderStepperButtonGroup = function (position) {
|
|
86
|
+
if (position !== stepperPosition) {
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
return _jsxs("div", __assign({
|
|
90
|
+
className: "ncua-input__stepper-button-group"
|
|
91
|
+
}, {
|
|
92
|
+
children: [_jsx(ButtonStepper, {
|
|
93
|
+
size: size,
|
|
94
|
+
direction: "up",
|
|
95
|
+
onClick: handleIncrement,
|
|
96
|
+
disabled: disabled
|
|
97
|
+
}), _jsx(ButtonStepper, {
|
|
98
|
+
size: size,
|
|
99
|
+
direction: "down",
|
|
100
|
+
onClick: handleDecrement,
|
|
101
|
+
disabled: disabled
|
|
102
|
+
})]
|
|
103
|
+
}));
|
|
104
|
+
};
|
|
105
|
+
return _jsx(InputBase, __assign({
|
|
106
|
+
type: "number",
|
|
107
|
+
leadingElement: renderStepperButtonGroup('leading') ? {
|
|
108
|
+
type: 'custom',
|
|
109
|
+
children: renderStepperButtonGroup('leading')
|
|
110
|
+
} : props.leadingElement,
|
|
111
|
+
trailingElement: renderStepperButtonGroup('trailing') ? {
|
|
112
|
+
type: 'custom',
|
|
113
|
+
children: renderStepperButtonGroup('trailing')
|
|
114
|
+
} : props.trailingElement,
|
|
115
|
+
ref: mergedRef,
|
|
116
|
+
size: size,
|
|
117
|
+
disabled: disabled,
|
|
118
|
+
min: minValue,
|
|
119
|
+
max: maxValue,
|
|
120
|
+
step: step,
|
|
121
|
+
onKeyDown: handleKeyDown,
|
|
122
|
+
className: "ncua-input__number"
|
|
123
|
+
}, props));
|
|
124
|
+
});
|
|
@@ -63,26 +63,18 @@ export var Textarea = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
63
63
|
isRequired: required
|
|
64
64
|
}, {
|
|
65
65
|
children: label
|
|
66
|
-
})), _jsx("
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
textareaRef.current = node;
|
|
80
|
-
},
|
|
81
|
-
className: "ncua-input__textarea",
|
|
82
|
-
disabled: disabled
|
|
83
|
-
}, props))
|
|
84
|
-
}))
|
|
85
|
-
})), shouldShowHintArea && _jsxs("div", __assign({
|
|
66
|
+
})), _jsx("textarea", __assign({
|
|
67
|
+
ref: function (node) {
|
|
68
|
+
if (typeof ref === 'function') {
|
|
69
|
+
ref(node);
|
|
70
|
+
} else if (ref) {
|
|
71
|
+
ref.current = node;
|
|
72
|
+
}
|
|
73
|
+
textareaRef.current = node;
|
|
74
|
+
},
|
|
75
|
+
className: "ncua-input__textarea",
|
|
76
|
+
disabled: disabled
|
|
77
|
+
}, props)), shouldShowHintArea && _jsxs("div", __assign({
|
|
86
78
|
className: "ncua-input__text-count-wrap"
|
|
87
79
|
}, {
|
|
88
80
|
children: [hintText && _jsx(HintText, __assign({
|
|
@@ -29,11 +29,12 @@ export var Modal = function (_a) {
|
|
|
29
29
|
_b = _a.size,
|
|
30
30
|
size = _b === void 0 ? 'md' : _b,
|
|
31
31
|
_c = _a.closeOnBackdropClick,
|
|
32
|
-
closeOnBackdropClick = _c === void 0 ?
|
|
32
|
+
closeOnBackdropClick = _c === void 0 ? false : _c,
|
|
33
33
|
_d = _a.closeOnEsc,
|
|
34
34
|
closeOnEsc = _d === void 0 ? true : _d,
|
|
35
35
|
className = _a.className,
|
|
36
|
-
|
|
36
|
+
zIndex = _a.zIndex,
|
|
37
|
+
restProps = __rest(_a, ["isOpen", "onClose", "children", "size", "closeOnBackdropClick", "closeOnEsc", "className", "zIndex"]);
|
|
37
38
|
var modalRef = useRef(null);
|
|
38
39
|
var handleBackdropClick = function (e) {
|
|
39
40
|
if (closeOnBackdropClick && e.target === e.currentTarget) {
|
|
@@ -59,7 +60,10 @@ export var Modal = function (_a) {
|
|
|
59
60
|
var modalContent = _jsx("div", __assign({
|
|
60
61
|
className: classnames('ncua-modal-backdrop', className),
|
|
61
62
|
onClick: handleBackdropClick,
|
|
62
|
-
ref: modalRef
|
|
63
|
+
ref: modalRef,
|
|
64
|
+
style: zIndex ? {
|
|
65
|
+
zIndex: zIndex
|
|
66
|
+
} : undefined
|
|
63
67
|
}, restProps, {
|
|
64
68
|
children: _jsx("div", __assign({
|
|
65
69
|
className: classnames('ncua-modal', "ncua-modal--".concat(size))
|
|
@@ -18,7 +18,7 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
18
18
|
};
|
|
19
19
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
20
|
import classNames from 'classnames';
|
|
21
|
-
import { forwardRef } from 'react';
|
|
21
|
+
import { forwardRef, useEffect, useRef, useState } from 'react';
|
|
22
22
|
import { MEDIA_QUERY } from '../../constant/breakpoint';
|
|
23
23
|
import { useMediaQuery } from '../../hooks/useMediaQuery';
|
|
24
24
|
import { Button } from '../button';
|
|
@@ -29,6 +29,7 @@ var iconNameMap = {
|
|
|
29
29
|
error: 'alert-triangle',
|
|
30
30
|
warning: 'alert-circle',
|
|
31
31
|
success: 'check-circle'
|
|
32
|
+
// info는 floating에서는 지원하지 않음
|
|
32
33
|
};
|
|
33
34
|
export var FloatingNotification = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
34
35
|
var title = _a.title,
|
|
@@ -38,10 +39,15 @@ export var FloatingNotification = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
38
39
|
onClose = _a.onClose,
|
|
39
40
|
className = _a.className,
|
|
40
41
|
actions = _a.actions,
|
|
41
|
-
|
|
42
|
+
_c = _a.autoClose,
|
|
43
|
+
autoClose = _c === void 0 ? 0 : _c,
|
|
44
|
+
rest = __rest(_a, ["title", "supportingText", "color", "onClose", "className", "actions", "autoClose"]);
|
|
45
|
+
var _d = useState(false),
|
|
46
|
+
shouldRemove = _d[0],
|
|
47
|
+
setShouldRemove = _d[1];
|
|
42
48
|
var iconColor = color;
|
|
43
49
|
var featuredIconProps = {
|
|
44
|
-
name: iconNameMap[color],
|
|
50
|
+
name: iconNameMap[color] || 'pin-02',
|
|
45
51
|
size: 'sm',
|
|
46
52
|
color: iconColor,
|
|
47
53
|
theme: 'dark-circle'
|
|
@@ -49,6 +55,31 @@ export var FloatingNotification = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
49
55
|
var isMobile = useMediaQuery(MEDIA_QUERY.mobile, {
|
|
50
56
|
onMatched: onClose
|
|
51
57
|
});
|
|
58
|
+
// autoClose 타이머 관리
|
|
59
|
+
var timerRef = useRef(null);
|
|
60
|
+
useEffect(function () {
|
|
61
|
+
// autoClose가 0보다 크면 무조건 타이머 설정
|
|
62
|
+
if (autoClose > 0) {
|
|
63
|
+
timerRef.current = setTimeout(function () {
|
|
64
|
+
if (onClose) {
|
|
65
|
+
onClose();
|
|
66
|
+
}
|
|
67
|
+
// DOM에서 바로 제거
|
|
68
|
+
setShouldRemove(true);
|
|
69
|
+
}, autoClose);
|
|
70
|
+
}
|
|
71
|
+
// cleanup 함수: 컴포넌트 언마운트 시 타이머 정리
|
|
72
|
+
return function () {
|
|
73
|
+
if (timerRef.current) {
|
|
74
|
+
clearTimeout(timerRef.current);
|
|
75
|
+
timerRef.current = null;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
}, [autoClose, onClose]);
|
|
79
|
+
// DOM에서 완전히 제거
|
|
80
|
+
if (shouldRemove) {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
52
83
|
return _jsxs("div", __assign({
|
|
53
84
|
ref: ref,
|
|
54
85
|
className: classNames('ncua-floating-notification', "ncua-floating-notification--".concat(color), className),
|
|
@@ -83,7 +114,7 @@ export var FloatingNotification = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
83
114
|
children: actions.map(function (action) {
|
|
84
115
|
return _jsx(Button, {
|
|
85
116
|
size: "xs",
|
|
86
|
-
hierarchy: action.hierarchy || '
|
|
117
|
+
hierarchy: action.hierarchy || 'text',
|
|
87
118
|
label: action.label,
|
|
88
119
|
onClick: action === null || action === void 0 ? void 0 : action.onClick
|
|
89
120
|
}, "".concat(action.label, "-").concat(action.hierarchy));
|
|
@@ -19,19 +19,21 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
19
19
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
20
|
import Icon from '@ncds/ui-admin-icon/dynamic';
|
|
21
21
|
import classNames from 'classnames';
|
|
22
|
-
import { forwardRef } from 'react';
|
|
22
|
+
import { forwardRef, useEffect, useRef, useState } from 'react';
|
|
23
23
|
import { COLOR } from '../../../constant/color';
|
|
24
24
|
var iconNameMap = {
|
|
25
25
|
neutral: 'message-chat-square',
|
|
26
26
|
error: 'alert-triangle',
|
|
27
27
|
warning: 'alert-triangle',
|
|
28
|
-
success: 'check-circle'
|
|
28
|
+
success: 'check-circle',
|
|
29
|
+
info: 'info-circle'
|
|
29
30
|
};
|
|
30
31
|
var iconColorMap = {
|
|
31
32
|
neutral: 'gray700',
|
|
32
33
|
error: 'red500',
|
|
33
34
|
warning: 'orange500',
|
|
34
|
-
success: 'green600'
|
|
35
|
+
success: 'green600',
|
|
36
|
+
info: 'violet600'
|
|
35
37
|
};
|
|
36
38
|
export var FullWidthNotification = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
37
39
|
var title = _a.title,
|
|
@@ -41,11 +43,43 @@ export var FullWidthNotification = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
41
43
|
onClose = _a.onClose,
|
|
42
44
|
className = _a.className,
|
|
43
45
|
actions = _a.actions,
|
|
44
|
-
|
|
46
|
+
_c = _a.autoClose,
|
|
47
|
+
autoClose = _c === void 0 ? 0 : _c,
|
|
48
|
+
supportTextLink = _a.supportTextLink,
|
|
49
|
+
onHidePermanently = _a.onHidePermanently,
|
|
50
|
+
rest = __rest(_a, ["title", "supportingText", "color", "onClose", "className", "actions", "autoClose", "supportTextLink", "onHidePermanently"]);
|
|
51
|
+
var _d = useState(false),
|
|
52
|
+
shouldRemove = _d[0],
|
|
53
|
+
setShouldRemove = _d[1];
|
|
45
54
|
var closeIconSize = {
|
|
46
55
|
width: 20,
|
|
47
56
|
height: 20
|
|
48
57
|
};
|
|
58
|
+
// autoClose 타이머 관리
|
|
59
|
+
var timerRef = useRef(null);
|
|
60
|
+
useEffect(function () {
|
|
61
|
+
// autoClose가 0보다 크면 무조건 타이머 설정
|
|
62
|
+
if (autoClose > 0) {
|
|
63
|
+
timerRef.current = setTimeout(function () {
|
|
64
|
+
if (onClose) {
|
|
65
|
+
onClose();
|
|
66
|
+
}
|
|
67
|
+
// DOM에서 바로 제거
|
|
68
|
+
setShouldRemove(true);
|
|
69
|
+
}, autoClose);
|
|
70
|
+
}
|
|
71
|
+
// cleanup 함수: 컴포넌트 언마운트 시 타이머 정리
|
|
72
|
+
return function () {
|
|
73
|
+
if (timerRef.current) {
|
|
74
|
+
clearTimeout(timerRef.current);
|
|
75
|
+
timerRef.current = null;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
}, [autoClose, onClose]);
|
|
79
|
+
// DOM에서 완전히 제거
|
|
80
|
+
if (shouldRemove) {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
49
83
|
return _jsx("div", __assign({
|
|
50
84
|
ref: ref,
|
|
51
85
|
className: classNames('ncua-full-width-notification', "ncua-full-width-notification--".concat(color), className),
|
|
@@ -73,10 +107,19 @@ export var FullWidthNotification = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
73
107
|
className: "ncua-full-width-notification__title"
|
|
74
108
|
}, {
|
|
75
109
|
children: title
|
|
76
|
-
})), supportingText && _jsx("span", __assign({
|
|
110
|
+
})), !supportTextLink && supportingText && _jsx("span", __assign({
|
|
77
111
|
className: "ncua-full-width-notification__supporting-text"
|
|
78
112
|
}, {
|
|
79
113
|
children: supportingText
|
|
114
|
+
})), supportTextLink && supportingText && _jsx("a", __assign({
|
|
115
|
+
href: supportTextLink,
|
|
116
|
+
className: "ncua-full-width-notification__link"
|
|
117
|
+
}, {
|
|
118
|
+
children: _jsx("span", __assign({
|
|
119
|
+
className: "ncua-full-width-notification__supporting-text"
|
|
120
|
+
}, {
|
|
121
|
+
children: supportingText
|
|
122
|
+
}))
|
|
80
123
|
}))]
|
|
81
124
|
}))]
|
|
82
125
|
})), _jsxs("div", __assign({
|
|
@@ -88,11 +131,17 @@ export var FullWidthNotification = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
88
131
|
children: actions.map(function (action) {
|
|
89
132
|
return _jsx("button", __assign({
|
|
90
133
|
onClick: action.onClick,
|
|
91
|
-
className: classNames('ncua-notification__action-button', "ncua-notification__action-button--".concat(action.hierarchy || '
|
|
134
|
+
className: classNames('ncua-notification__action-button', "ncua-notification__action-button--".concat(action.hierarchy || 'text'))
|
|
92
135
|
}, {
|
|
93
136
|
children: action.label
|
|
94
137
|
}), "".concat(action.label, "-").concat(action.hierarchy));
|
|
95
138
|
})
|
|
139
|
+
})), onHidePermanently && _jsx("button", __assign({
|
|
140
|
+
type: "button",
|
|
141
|
+
className: classNames('ncua-notification__action-button', 'ncua-notification__action-button--text', 'ncua-full-width-notification__link'),
|
|
142
|
+
onClick: onHidePermanently
|
|
143
|
+
}, {
|
|
144
|
+
children: "\uB2E4\uC2DC\uBCF4\uC9C0 \uC54A\uAE30"
|
|
96
145
|
})), onClose && _jsx("button", __assign({
|
|
97
146
|
type: "button",
|
|
98
147
|
className: "ncua-full-width-notification__close-button",
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
var __assign = this && this.__assign || function () {
|
|
2
|
+
__assign = Object.assign || function (t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
6
|
+
}
|
|
7
|
+
return t;
|
|
8
|
+
};
|
|
9
|
+
return __assign.apply(this, arguments);
|
|
10
|
+
};
|
|
11
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
14
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
15
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
16
|
+
}
|
|
17
|
+
return t;
|
|
18
|
+
};
|
|
19
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
+
import Icon from '@ncds/ui-admin-icon/dynamic';
|
|
21
|
+
import classNames from 'classnames';
|
|
22
|
+
import { forwardRef } from 'react';
|
|
23
|
+
import { COLOR } from '../../../constant/color';
|
|
24
|
+
import { Button } from '../button';
|
|
25
|
+
import { FeaturedIcon } from '../featured-icon/FeaturedIcon';
|
|
26
|
+
var iconNameMap = {
|
|
27
|
+
neutral: 'pin-02',
|
|
28
|
+
error: 'alert-triangle',
|
|
29
|
+
warning: 'alert-circle',
|
|
30
|
+
success: 'check-circle'
|
|
31
|
+
};
|
|
32
|
+
var iconColorMap = {
|
|
33
|
+
neutral: 'gray700',
|
|
34
|
+
error: 'red500',
|
|
35
|
+
warning: 'orange500',
|
|
36
|
+
success: 'green600'
|
|
37
|
+
};
|
|
38
|
+
export var MessageNotification = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
39
|
+
var title = _a.title,
|
|
40
|
+
supportingText = _a.supportingText,
|
|
41
|
+
icon = _a.icon,
|
|
42
|
+
_b = _a.color,
|
|
43
|
+
color = _b === void 0 ? 'neutral' : _b,
|
|
44
|
+
onClose = _a.onClose,
|
|
45
|
+
className = _a.className,
|
|
46
|
+
actions = _a.actions,
|
|
47
|
+
onHidePermanently = _a.onHidePermanently,
|
|
48
|
+
rest = __rest(_a, ["title", "supportingText", "icon", "color", "onClose", "className", "actions", "onHidePermanently"]);
|
|
49
|
+
// message 타입은 neutral, error, warning, success 4가지 색상만 지원
|
|
50
|
+
var validColor = color === 'info' ? 'neutral' : color;
|
|
51
|
+
var iconColor = validColor;
|
|
52
|
+
var featuredIconProps = {
|
|
53
|
+
name: icon || iconNameMap[validColor] || 'pin-02',
|
|
54
|
+
size: 'lg',
|
|
55
|
+
color: iconColor,
|
|
56
|
+
theme: 'light-circle'
|
|
57
|
+
};
|
|
58
|
+
var closeIconColor = COLOR[iconColorMap[validColor] || 'gray700'];
|
|
59
|
+
return _jsx("div", __assign({
|
|
60
|
+
ref: ref,
|
|
61
|
+
className: classNames('ncua-message-notification', "ncua-message-notification--".concat(validColor), className),
|
|
62
|
+
role: "alert"
|
|
63
|
+
}, rest, {
|
|
64
|
+
children: _jsx("div", __assign({
|
|
65
|
+
className: "ncua-message-notification__container"
|
|
66
|
+
}, {
|
|
67
|
+
children: _jsxs("div", __assign({
|
|
68
|
+
className: "ncua-message-notification__content"
|
|
69
|
+
}, {
|
|
70
|
+
children: [_jsxs("div", __assign({
|
|
71
|
+
className: "ncua-message-notification__content-wrapper"
|
|
72
|
+
}, {
|
|
73
|
+
children: [iconNameMap[validColor] && _jsx(FeaturedIcon, __assign({}, featuredIconProps, {
|
|
74
|
+
className: "ncua-message-notification__icon"
|
|
75
|
+
})), _jsxs("div", __assign({
|
|
76
|
+
className: "ncua-message-notification__text-container"
|
|
77
|
+
}, {
|
|
78
|
+
children: [_jsx("span", __assign({
|
|
79
|
+
className: "ncua-message-notification__title"
|
|
80
|
+
}, {
|
|
81
|
+
children: title
|
|
82
|
+
})), supportingText && _jsx("span", __assign({
|
|
83
|
+
className: "ncua-message-notification__supporting-text"
|
|
84
|
+
}, {
|
|
85
|
+
children: supportingText
|
|
86
|
+
}))]
|
|
87
|
+
}))]
|
|
88
|
+
})), _jsx("div", __assign({
|
|
89
|
+
className: "ncua-message-notification__actions-container"
|
|
90
|
+
}, {
|
|
91
|
+
children: actions && _jsx("div", __assign({
|
|
92
|
+
className: "ncua-message-notification__actions"
|
|
93
|
+
}, {
|
|
94
|
+
children: actions.map(function (action) {
|
|
95
|
+
return _jsx(Button, {
|
|
96
|
+
size: "xs",
|
|
97
|
+
hierarchy: action.hierarchy || 'text',
|
|
98
|
+
label: action.label,
|
|
99
|
+
onClick: action === null || action === void 0 ? void 0 : action.onClick
|
|
100
|
+
}, "".concat(action.label, "-").concat(action.hierarchy));
|
|
101
|
+
})
|
|
102
|
+
}))
|
|
103
|
+
})), _jsxs("div", __assign({
|
|
104
|
+
className: "ncua-message-notification__footer-container"
|
|
105
|
+
}, {
|
|
106
|
+
children: [onHidePermanently && _jsx("button", __assign({
|
|
107
|
+
type: "button",
|
|
108
|
+
className: classNames('ncua-notification__action-button', 'ncua-notification__action-button--text', 'ncua-message-notification__hide-link'),
|
|
109
|
+
onClick: onHidePermanently
|
|
110
|
+
}, {
|
|
111
|
+
children: "\uB2E4\uC2DC \uBCF4\uC9C0 \uC54A\uAE30"
|
|
112
|
+
})), onClose && _jsx("button", __assign({
|
|
113
|
+
type: "button",
|
|
114
|
+
className: "ncua-message-notification__close-button",
|
|
115
|
+
onClick: onClose,
|
|
116
|
+
"aria-label": "\uC54C\uB9BC \uB2EB\uAE30"
|
|
117
|
+
}, {
|
|
118
|
+
children: _jsx(Icon, {
|
|
119
|
+
name: "x-close",
|
|
120
|
+
width: 20,
|
|
121
|
+
height: 20,
|
|
122
|
+
color: closeIconColor
|
|
123
|
+
})
|
|
124
|
+
}))]
|
|
125
|
+
}))]
|
|
126
|
+
}))
|
|
127
|
+
}))
|
|
128
|
+
}));
|
|
129
|
+
});
|
|
130
|
+
MessageNotification.displayName = 'MessageNotification';
|
|
@@ -20,20 +20,34 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
20
20
|
import { forwardRef } from 'react';
|
|
21
21
|
import { FloatingNotification } from './FloatingNotification';
|
|
22
22
|
import { FullWidthNotification } from './FullWidthNotification';
|
|
23
|
+
import { MessageNotification } from './MessageNotification';
|
|
23
24
|
export var Notification = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
24
25
|
var _b = _a.type,
|
|
25
26
|
type = _b === void 0 ? 'floating' : _b,
|
|
26
27
|
_c = _a.color,
|
|
27
28
|
color = _c === void 0 ? 'neutral' : _c,
|
|
28
29
|
rest = __rest(_a, ["type", "color"]);
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
if (type === 'floating') {
|
|
31
|
+
return _jsx(FloatingNotification, __assign({
|
|
32
|
+
color: color
|
|
33
|
+
}, rest, {
|
|
34
|
+
ref: ref
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
if (type === 'full-width') {
|
|
38
|
+
return _jsx(FullWidthNotification, __assign({
|
|
39
|
+
color: color
|
|
40
|
+
}, rest, {
|
|
41
|
+
ref: ref
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
44
|
+
if (type === 'message') {
|
|
45
|
+
return _jsx(MessageNotification, __assign({
|
|
46
|
+
color: color
|
|
47
|
+
}, rest, {
|
|
48
|
+
ref: ref
|
|
49
|
+
}));
|
|
50
|
+
}
|
|
51
|
+
return null;
|
|
38
52
|
});
|
|
39
53
|
Notification.displayName = 'Notification';
|