ncore-ui-kit 1.0.0-pre-alpha.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/LICENSE +20 -0
- package/README.md +2 -0
- package/lib/module/assets/fonts/Geist-Black.ttf +0 -0
- package/lib/module/assets/fonts/Geist-Bold.ttf +0 -0
- package/lib/module/assets/fonts/Geist-ExtraBold.ttf +0 -0
- package/lib/module/assets/fonts/Geist-ExtraLight.ttf +0 -0
- package/lib/module/assets/fonts/Geist-Light.ttf +0 -0
- package/lib/module/assets/fonts/Geist-Medium.ttf +0 -0
- package/lib/module/assets/fonts/Geist-Regular.ttf +0 -0
- package/lib/module/assets/fonts/Geist-SemiBold.ttf +0 -0
- package/lib/module/assets/fonts/Geist-Thin.ttf +0 -0
- package/lib/module/assets/svg/badgeAlertIcon/index.js +33 -0
- package/lib/module/assets/svg/badgeAlertIcon/index.js.map +1 -0
- package/lib/module/assets/svg/badgeDangerIcon/index.js +32 -0
- package/lib/module/assets/svg/badgeDangerIcon/index.js.map +1 -0
- package/lib/module/assets/svg/badgeInfoIcon/index.js +32 -0
- package/lib/module/assets/svg/badgeInfoIcon/index.js.map +1 -0
- package/lib/module/assets/svg/badgeQuestionMarkIcon/index.js +40 -0
- package/lib/module/assets/svg/badgeQuestionMarkIcon/index.js.map +1 -0
- package/lib/module/assets/svg/badgeRightIcon/index.js +32 -0
- package/lib/module/assets/svg/badgeRightIcon/index.js.map +1 -0
- package/lib/module/assets/svg/badgeSuccessIcon/index.js +40 -0
- package/lib/module/assets/svg/badgeSuccessIcon/index.js.map +1 -0
- package/lib/module/assets/svg/chevronRightIcon/index.js +32 -0
- package/lib/module/assets/svg/chevronRightIcon/index.js.map +1 -0
- package/lib/module/assets/svg/cleanIcon/index.js +32 -0
- package/lib/module/assets/svg/cleanIcon/index.js.map +1 -0
- package/lib/module/assets/svg/eyeClosedIcon/index.js +40 -0
- package/lib/module/assets/svg/eyeClosedIcon/index.js.map +1 -0
- package/lib/module/assets/svg/eyeOpenedIcon/index.js +40 -0
- package/lib/module/assets/svg/eyeOpenedIcon/index.js.map +1 -0
- package/lib/module/assets/svg/index.js +13 -0
- package/lib/module/assets/svg/index.js.map +1 -0
- package/lib/module/assets/svg/loadingIcon/index.js +65 -0
- package/lib/module/assets/svg/loadingIcon/index.js.map +1 -0
- package/lib/module/components/bottomSheet/index.js +915 -0
- package/lib/module/components/bottomSheet/index.js.map +1 -0
- package/lib/module/components/bottomSheet/stylesheet.js +26 -0
- package/lib/module/components/bottomSheet/stylesheet.js.map +1 -0
- package/lib/module/components/bottomSheet/type.js +4 -0
- package/lib/module/components/bottomSheet/type.js.map +1 -0
- package/lib/module/components/button/index.js +143 -0
- package/lib/module/components/button/index.js.map +1 -0
- package/lib/module/components/button/stylesheet.js +231 -0
- package/lib/module/components/button/stylesheet.js.map +1 -0
- package/lib/module/components/button/type.js +4 -0
- package/lib/module/components/button/type.js.map +1 -0
- package/lib/module/components/checkBox/index.js +186 -0
- package/lib/module/components/checkBox/index.js.map +1 -0
- package/lib/module/components/checkBox/stylesheet.js +182 -0
- package/lib/module/components/checkBox/stylesheet.js.map +1 -0
- package/lib/module/components/checkBox/type.js +4 -0
- package/lib/module/components/checkBox/type.js.map +1 -0
- package/lib/module/components/chip/index.js +131 -0
- package/lib/module/components/chip/index.js.map +1 -0
- package/lib/module/components/chip/stylesheet.js +134 -0
- package/lib/module/components/chip/stylesheet.js.map +1 -0
- package/lib/module/components/chip/type.js +4 -0
- package/lib/module/components/chip/type.js.map +1 -0
- package/lib/module/components/dateSelector/index.js +293 -0
- package/lib/module/components/dateSelector/index.js.map +1 -0
- package/lib/module/components/dateSelector/stylesheet.js +82 -0
- package/lib/module/components/dateSelector/stylesheet.js.map +1 -0
- package/lib/module/components/dateSelector/type.js +7 -0
- package/lib/module/components/dateSelector/type.js.map +1 -0
- package/lib/module/components/dateSelector/util.js +17 -0
- package/lib/module/components/dateSelector/util.js.map +1 -0
- package/lib/module/components/dateTimePicker/index.js +704 -0
- package/lib/module/components/dateTimePicker/index.js.map +1 -0
- package/lib/module/components/dateTimePicker/stylesheet.js +213 -0
- package/lib/module/components/dateTimePicker/stylesheet.js.map +1 -0
- package/lib/module/components/dateTimePicker/type.js +5 -0
- package/lib/module/components/dateTimePicker/type.js.map +1 -0
- package/lib/module/components/dateTimeSheet/index.js +313 -0
- package/lib/module/components/dateTimeSheet/index.js.map +1 -0
- package/lib/module/components/dateTimeSheet/stylesheet.js +88 -0
- package/lib/module/components/dateTimeSheet/stylesheet.js.map +1 -0
- package/lib/module/components/dateTimeSheet/type.js +5 -0
- package/lib/module/components/dateTimeSheet/type.js.map +1 -0
- package/lib/module/components/dialog/index.js +228 -0
- package/lib/module/components/dialog/index.js.map +1 -0
- package/lib/module/components/dialog/stylesheet.js +99 -0
- package/lib/module/components/dialog/stylesheet.js.map +1 -0
- package/lib/module/components/dialog/type.js +5 -0
- package/lib/module/components/dialog/type.js.map +1 -0
- package/lib/module/components/index.js +32 -0
- package/lib/module/components/index.js.map +1 -0
- package/lib/module/components/loading/index.js +22 -0
- package/lib/module/components/loading/index.js.map +1 -0
- package/lib/module/components/loading/stylesheet.js +10 -0
- package/lib/module/components/loading/stylesheet.js.map +1 -0
- package/lib/module/components/loading/type.js +4 -0
- package/lib/module/components/loading/type.js.map +1 -0
- package/lib/module/components/markdownViewer/constant.js +18 -0
- package/lib/module/components/markdownViewer/constant.js.map +1 -0
- package/lib/module/components/markdownViewer/index.js +368 -0
- package/lib/module/components/markdownViewer/index.js.map +1 -0
- package/lib/module/components/markdownViewer/stylesheet.js +66 -0
- package/lib/module/components/markdownViewer/stylesheet.js.map +1 -0
- package/lib/module/components/markdownViewer/type.js +5 -0
- package/lib/module/components/markdownViewer/type.js.map +1 -0
- package/lib/module/components/markdownViewer/util.js +344 -0
- package/lib/module/components/markdownViewer/util.js.map +1 -0
- package/lib/module/components/modal/index.js +170 -0
- package/lib/module/components/modal/index.js.map +1 -0
- package/lib/module/components/modal/stylesheet.js +36 -0
- package/lib/module/components/modal/stylesheet.js.map +1 -0
- package/lib/module/components/modal/type.js +5 -0
- package/lib/module/components/modal/type.js.map +1 -0
- package/lib/module/components/monthSelector/index.js +284 -0
- package/lib/module/components/monthSelector/index.js.map +1 -0
- package/lib/module/components/monthSelector/stylesheet.js +80 -0
- package/lib/module/components/monthSelector/stylesheet.js.map +1 -0
- package/lib/module/components/monthSelector/type.js +7 -0
- package/lib/module/components/monthSelector/type.js.map +1 -0
- package/lib/module/components/monthSelector/util.js +17 -0
- package/lib/module/components/monthSelector/util.js.map +1 -0
- package/lib/module/components/notificationIndicator/index.js +121 -0
- package/lib/module/components/notificationIndicator/index.js.map +1 -0
- package/lib/module/components/notificationIndicator/stylesheet.js +119 -0
- package/lib/module/components/notificationIndicator/stylesheet.js.map +1 -0
- package/lib/module/components/notificationIndicator/type.js +4 -0
- package/lib/module/components/notificationIndicator/type.js.map +1 -0
- package/lib/module/components/numericInput/index.js +409 -0
- package/lib/module/components/numericInput/index.js.map +1 -0
- package/lib/module/components/numericInput/stylesheet.js +245 -0
- package/lib/module/components/numericInput/stylesheet.js.map +1 -0
- package/lib/module/components/numericInput/type.js +5 -0
- package/lib/module/components/numericInput/type.js.map +1 -0
- package/lib/module/components/pageContainer/index.js +81 -0
- package/lib/module/components/pageContainer/index.js.map +1 -0
- package/lib/module/components/pageContainer/stylesheet.js +13 -0
- package/lib/module/components/pageContainer/stylesheet.js.map +1 -0
- package/lib/module/components/pageContainer/type.js +4 -0
- package/lib/module/components/pageContainer/type.js.map +1 -0
- package/lib/module/components/radioButton/index.js +179 -0
- package/lib/module/components/radioButton/index.js.map +1 -0
- package/lib/module/components/radioButton/stylesheet.js +192 -0
- package/lib/module/components/radioButton/stylesheet.js.map +1 -0
- package/lib/module/components/radioButton/type.js +4 -0
- package/lib/module/components/radioButton/type.js.map +1 -0
- package/lib/module/components/rowCard/index.js +153 -0
- package/lib/module/components/rowCard/index.js.map +1 -0
- package/lib/module/components/rowCard/stylesheet.js +78 -0
- package/lib/module/components/rowCard/stylesheet.js.map +1 -0
- package/lib/module/components/rowCard/type.js +4 -0
- package/lib/module/components/rowCard/type.js.map +1 -0
- package/lib/module/components/selectBox/index.js +612 -0
- package/lib/module/components/selectBox/index.js.map +1 -0
- package/lib/module/components/selectBox/stylesheet.js +216 -0
- package/lib/module/components/selectBox/stylesheet.js.map +1 -0
- package/lib/module/components/selectBox/type.js +5 -0
- package/lib/module/components/selectBox/type.js.map +1 -0
- package/lib/module/components/selectSheet/index.js +285 -0
- package/lib/module/components/selectSheet/index.js.map +1 -0
- package/lib/module/components/selectSheet/stylesheet.js +90 -0
- package/lib/module/components/selectSheet/stylesheet.js.map +1 -0
- package/lib/module/components/selectSheet/type.js +5 -0
- package/lib/module/components/selectSheet/type.js.map +1 -0
- package/lib/module/components/snackBar/index.js +314 -0
- package/lib/module/components/snackBar/index.js.map +1 -0
- package/lib/module/components/snackBar/stylesheet.js +131 -0
- package/lib/module/components/snackBar/stylesheet.js.map +1 -0
- package/lib/module/components/snackBar/type.js +5 -0
- package/lib/module/components/snackBar/type.js.map +1 -0
- package/lib/module/components/stateCard/index.js +101 -0
- package/lib/module/components/stateCard/index.js.map +1 -0
- package/lib/module/components/stateCard/stylesheet.js +96 -0
- package/lib/module/components/stateCard/stylesheet.js.map +1 -0
- package/lib/module/components/stateCard/type.js +4 -0
- package/lib/module/components/stateCard/type.js.map +1 -0
- package/lib/module/components/sticker/index.js +85 -0
- package/lib/module/components/sticker/index.js.map +1 -0
- package/lib/module/components/sticker/stylesheet.js +95 -0
- package/lib/module/components/sticker/stylesheet.js.map +1 -0
- package/lib/module/components/sticker/type.js +4 -0
- package/lib/module/components/sticker/type.js.map +1 -0
- package/lib/module/components/switch/index.js +192 -0
- package/lib/module/components/switch/index.js.map +1 -0
- package/lib/module/components/switch/stylesheet.js +174 -0
- package/lib/module/components/switch/stylesheet.js.map +1 -0
- package/lib/module/components/switch/type.js +4 -0
- package/lib/module/components/switch/type.js.map +1 -0
- package/lib/module/components/text/index.js +29 -0
- package/lib/module/components/text/index.js.map +1 -0
- package/lib/module/components/text/type.js +4 -0
- package/lib/module/components/text/type.js.map +1 -0
- package/lib/module/components/textAreaInput/index.js +367 -0
- package/lib/module/components/textAreaInput/index.js.map +1 -0
- package/lib/module/components/textAreaInput/stylesheet.js +256 -0
- package/lib/module/components/textAreaInput/stylesheet.js.map +1 -0
- package/lib/module/components/textAreaInput/type.js +5 -0
- package/lib/module/components/textAreaInput/type.js.map +1 -0
- package/lib/module/components/textInput/index.js +362 -0
- package/lib/module/components/textInput/index.js.map +1 -0
- package/lib/module/components/textInput/stylesheet.js +245 -0
- package/lib/module/components/textInput/stylesheet.js.map +1 -0
- package/lib/module/components/textInput/type.js +5 -0
- package/lib/module/components/textInput/type.js.map +1 -0
- package/lib/module/components/timeSelector/components/timeInput/index.js +135 -0
- package/lib/module/components/timeSelector/components/timeInput/index.js.map +1 -0
- package/lib/module/components/timeSelector/components/timeInput/stylesheet.js +27 -0
- package/lib/module/components/timeSelector/components/timeInput/stylesheet.js.map +1 -0
- package/lib/module/components/timeSelector/components/timeInput/type.js +5 -0
- package/lib/module/components/timeSelector/components/timeInput/type.js.map +1 -0
- package/lib/module/components/timeSelector/index.js +329 -0
- package/lib/module/components/timeSelector/index.js.map +1 -0
- package/lib/module/components/timeSelector/stylesheet.js +44 -0
- package/lib/module/components/timeSelector/stylesheet.js.map +1 -0
- package/lib/module/components/timeSelector/type.js +5 -0
- package/lib/module/components/timeSelector/type.js.map +1 -0
- package/lib/module/components/toast/index.js +199 -0
- package/lib/module/components/toast/index.js.map +1 -0
- package/lib/module/components/toast/stylesheet.js +124 -0
- package/lib/module/components/toast/stylesheet.js.map +1 -0
- package/lib/module/components/toast/type.js +5 -0
- package/lib/module/components/toast/type.js.map +1 -0
- package/lib/module/components/yearSelector/index.js +278 -0
- package/lib/module/components/yearSelector/index.js.map +1 -0
- package/lib/module/components/yearSelector/stylesheet.js +80 -0
- package/lib/module/components/yearSelector/stylesheet.js.map +1 -0
- package/lib/module/components/yearSelector/type.js +7 -0
- package/lib/module/components/yearSelector/type.js.map +1 -0
- package/lib/module/components/yearSelector/util.js +17 -0
- package/lib/module/components/yearSelector/util.js.map +1 -0
- package/lib/module/context/bottomSheet.js +86 -0
- package/lib/module/context/bottomSheet.js.map +1 -0
- package/lib/module/context/dialog.js +85 -0
- package/lib/module/context/dialog.js.map +1 -0
- package/lib/module/context/index.js +92 -0
- package/lib/module/context/index.js.map +1 -0
- package/lib/module/context/localize.js +143 -0
- package/lib/module/context/localize.js.map +1 -0
- package/lib/module/context/modal.js +82 -0
- package/lib/module/context/modal.js.map +1 -0
- package/lib/module/context/snackBar.js +79 -0
- package/lib/module/context/snackBar.js.map +1 -0
- package/lib/module/context/theme.js +142 -0
- package/lib/module/context/theme.js.map +1 -0
- package/lib/module/context/toast.js +79 -0
- package/lib/module/context/toast.js.map +1 -0
- package/lib/module/core/hooks.js +19 -0
- package/lib/module/core/hooks.js.map +1 -0
- package/lib/module/core/index.js +91 -0
- package/lib/module/core/index.js.map +1 -0
- package/lib/module/helpers/index.js +7 -0
- package/lib/module/helpers/index.js.map +1 -0
- package/lib/module/helpers/locale/index.js +23 -0
- package/lib/module/helpers/locale/index.js.map +1 -0
- package/lib/module/helpers/portalize/Consumer.js +33 -0
- package/lib/module/helpers/portalize/Consumer.js.map +1 -0
- package/lib/module/helpers/portalize/Host.js +73 -0
- package/lib/module/helpers/portalize/Host.js.map +1 -0
- package/lib/module/helpers/portalize/Manager.js +36 -0
- package/lib/module/helpers/portalize/Manager.js.map +1 -0
- package/lib/module/helpers/portalize/Portal.js +18 -0
- package/lib/module/helpers/portalize/Portal.js.map +1 -0
- package/lib/module/helpers/portalize/context/index.js +33 -0
- package/lib/module/helpers/portalize/context/index.js.map +1 -0
- package/lib/module/helpers/portalize/hooks/useKey.js +34 -0
- package/lib/module/helpers/portalize/hooks/useKey.js.map +1 -0
- package/lib/module/helpers/portalize/index.js +7 -0
- package/lib/module/helpers/portalize/index.js.map +1 -0
- package/lib/module/helpers/theme/palette.js +61 -0
- package/lib/module/helpers/theme/palette.js.map +1 -0
- package/lib/module/helpers/theme/shapes.js +79 -0
- package/lib/module/helpers/theme/shapes.js.map +1 -0
- package/lib/module/helpers/theme/typography.js +33 -0
- package/lib/module/helpers/theme/typography.js.map +1 -0
- package/lib/module/index.js +10 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +4 -0
- package/lib/module/types/bottomSheet.js +4 -0
- package/lib/module/types/bottomSheet.js.map +1 -0
- package/lib/module/types/dialog.js +4 -0
- package/lib/module/types/dialog.js.map +1 -0
- package/lib/module/types/icon.js +4 -0
- package/lib/module/types/icon.js.map +1 -0
- package/lib/module/types/index.js +7 -0
- package/lib/module/types/index.js.map +1 -0
- package/lib/module/types/locale.js +4 -0
- package/lib/module/types/locale.js.map +1 -0
- package/lib/module/types/modal.js +4 -0
- package/lib/module/types/modal.js.map +1 -0
- package/lib/module/types/portalize.js +2 -0
- package/lib/module/types/portalize.js.map +1 -0
- package/lib/module/types/snackBar.js +4 -0
- package/lib/module/types/snackBar.js.map +1 -0
- package/lib/module/types/theme.js +2 -0
- package/lib/module/types/theme.js.map +1 -0
- package/lib/module/types/toast.js +4 -0
- package/lib/module/types/toast.js.map +1 -0
- package/lib/module/utils/index.js +54 -0
- package/lib/module/utils/index.js.map +1 -0
- package/lib/module/variants/locales/default.json +208 -0
- package/lib/module/variants/themes/default.json +669 -0
- package/lib/package.json +4 -0
- package/lib/src/assets/svg/badgeAlertIcon/index.js +11 -0
- package/lib/src/assets/svg/badgeDangerIcon/index.js +10 -0
- package/lib/src/assets/svg/badgeInfoIcon/index.js +10 -0
- package/lib/src/assets/svg/badgeQuestionMarkIcon/index.js +11 -0
- package/lib/src/assets/svg/badgeRightIcon/index.js +10 -0
- package/lib/src/assets/svg/badgeSuccessIcon/index.js +11 -0
- package/lib/src/assets/svg/chevronRightIcon/index.js +10 -0
- package/lib/src/assets/svg/cleanIcon/index.js +10 -0
- package/lib/src/assets/svg/eyeClosedIcon/index.js +11 -0
- package/lib/src/assets/svg/eyeOpenedIcon/index.js +11 -0
- package/lib/src/assets/svg/index.js +10 -0
- package/lib/src/assets/svg/loadingIcon/index.js +41 -0
- package/lib/src/components/bottomSheet/index.js +897 -0
- package/lib/src/components/bottomSheet/stylesheet.js +23 -0
- package/lib/src/components/bottomSheet/type.js +1 -0
- package/lib/src/components/button/index.js +107 -0
- package/lib/src/components/button/stylesheet.js +209 -0
- package/lib/src/components/button/type.js +2 -0
- package/lib/src/components/checkBox/index.js +133 -0
- package/lib/src/components/checkBox/stylesheet.js +166 -0
- package/lib/src/components/checkBox/type.js +1 -0
- package/lib/src/components/chip/index.js +84 -0
- package/lib/src/components/chip/stylesheet.js +117 -0
- package/lib/src/components/chip/type.js +1 -0
- package/lib/src/components/dateSelector/index.js +251 -0
- package/lib/src/components/dateSelector/stylesheet.js +74 -0
- package/lib/src/components/dateSelector/type.js +4 -0
- package/lib/src/components/dateSelector/util.js +12 -0
- package/lib/src/components/dateTimePicker/index.js +591 -0
- package/lib/src/components/dateTimePicker/stylesheet.js +198 -0
- package/lib/src/components/dateTimePicker/type.js +3 -0
- package/lib/src/components/dateTimeSheet/index.js +154 -0
- package/lib/src/components/dateTimeSheet/stylesheet.js +81 -0
- package/lib/src/components/dateTimeSheet/type.js +2 -0
- package/lib/src/components/dialog/index.js +166 -0
- package/lib/src/components/dialog/stylesheet.js +90 -0
- package/lib/src/components/dialog/type.js +3 -0
- package/lib/src/components/index.js +29 -0
- package/lib/src/components/loading/index.js +11 -0
- package/lib/src/components/loading/stylesheet.js +7 -0
- package/lib/src/components/loading/type.js +2 -0
- package/lib/src/components/markdownViewer/constant.js +15 -0
- package/lib/src/components/markdownViewer/index.js +237 -0
- package/lib/src/components/markdownViewer/stylesheet.js +59 -0
- package/lib/src/components/markdownViewer/type.js +2 -0
- package/lib/src/components/markdownViewer/util.js +316 -0
- package/lib/src/components/modal/index.js +140 -0
- package/lib/src/components/modal/stylesheet.js +33 -0
- package/lib/src/components/modal/type.js +3 -0
- package/lib/src/components/monthSelector/index.js +271 -0
- package/lib/src/components/monthSelector/stylesheet.js +72 -0
- package/lib/src/components/monthSelector/type.js +4 -0
- package/lib/src/components/monthSelector/util.js +12 -0
- package/lib/src/components/notificationIndicator/index.js +91 -0
- package/lib/src/components/notificationIndicator/stylesheet.js +105 -0
- package/lib/src/components/notificationIndicator/type.js +1 -0
- package/lib/src/components/numericInput/index.js +319 -0
- package/lib/src/components/numericInput/stylesheet.js +230 -0
- package/lib/src/components/numericInput/type.js +3 -0
- package/lib/src/components/pageContainer/index.js +62 -0
- package/lib/src/components/pageContainer/stylesheet.js +10 -0
- package/lib/src/components/pageContainer/type.js +1 -0
- package/lib/src/components/radioButton/index.js +135 -0
- package/lib/src/components/radioButton/stylesheet.js +175 -0
- package/lib/src/components/radioButton/type.js +1 -0
- package/lib/src/components/rowCard/index.js +99 -0
- package/lib/src/components/rowCard/stylesheet.js +71 -0
- package/lib/src/components/rowCard/type.js +1 -0
- package/lib/src/components/selectBox/index.js +501 -0
- package/lib/src/components/selectBox/stylesheet.js +201 -0
- package/lib/src/components/selectBox/type.js +3 -0
- package/lib/src/components/selectSheet/index.js +179 -0
- package/lib/src/components/selectSheet/stylesheet.js +83 -0
- package/lib/src/components/selectSheet/type.js +2 -0
- package/lib/src/components/snackBar/index.js +249 -0
- package/lib/src/components/snackBar/stylesheet.js +118 -0
- package/lib/src/components/snackBar/type.js +3 -0
- package/lib/src/components/stateCard/index.js +69 -0
- package/lib/src/components/stateCard/stylesheet.js +90 -0
- package/lib/src/components/stateCard/type.js +1 -0
- package/lib/src/components/sticker/index.js +54 -0
- package/lib/src/components/sticker/stylesheet.js +83 -0
- package/lib/src/components/sticker/type.js +1 -0
- package/lib/src/components/switch/index.js +149 -0
- package/lib/src/components/switch/stylesheet.js +158 -0
- package/lib/src/components/switch/type.js +1 -0
- package/lib/src/components/text/index.js +15 -0
- package/lib/src/components/text/type.js +2 -0
- package/lib/src/components/textAreaInput/index.js +279 -0
- package/lib/src/components/textAreaInput/stylesheet.js +240 -0
- package/lib/src/components/textAreaInput/type.js +3 -0
- package/lib/src/components/textInput/index.js +273 -0
- package/lib/src/components/textInput/stylesheet.js +230 -0
- package/lib/src/components/textInput/type.js +3 -0
- package/lib/src/components/timeSelector/components/timeInput/index.js +112 -0
- package/lib/src/components/timeSelector/components/timeInput/stylesheet.js +21 -0
- package/lib/src/components/timeSelector/components/timeInput/type.js +2 -0
- package/lib/src/components/timeSelector/index.js +141 -0
- package/lib/src/components/timeSelector/stylesheet.js +37 -0
- package/lib/src/components/timeSelector/type.js +2 -0
- package/lib/src/components/toast/index.js +143 -0
- package/lib/src/components/toast/stylesheet.js +112 -0
- package/lib/src/components/toast/type.js +3 -0
- package/lib/src/components/yearSelector/index.js +269 -0
- package/lib/src/components/yearSelector/stylesheet.js +72 -0
- package/lib/src/components/yearSelector/type.js +4 -0
- package/lib/src/components/yearSelector/util.js +12 -0
- package/lib/src/context/bottomSheet.js +72 -0
- package/lib/src/context/dialog.js +72 -0
- package/lib/src/context/index.js +60 -0
- package/lib/src/context/localize.js +135 -0
- package/lib/src/context/modal.js +70 -0
- package/lib/src/context/snackBar.js +67 -0
- package/lib/src/context/theme.js +127 -0
- package/lib/src/context/toast.js +67 -0
- package/lib/src/core/hooks.js +16 -0
- package/lib/src/core/index.js +85 -0
- package/lib/src/helpers/index.js +4 -0
- package/lib/src/helpers/locale/index.js +20 -0
- package/lib/src/helpers/portalize/Consumer.js +31 -0
- package/lib/src/helpers/portalize/Host.js +55 -0
- package/lib/src/helpers/portalize/Manager.js +25 -0
- package/lib/src/helpers/portalize/Portal.js +7 -0
- package/lib/src/helpers/portalize/context/index.js +33 -0
- package/lib/src/helpers/portalize/hooks/useKey.js +33 -0
- package/lib/src/helpers/portalize/index.js +4 -0
- package/lib/src/helpers/theme/palette.js +63 -0
- package/lib/src/helpers/theme/shapes.js +75 -0
- package/lib/src/helpers/theme/typography.js +28 -0
- package/lib/src/index.js +7 -0
- package/lib/src/types/bottomSheet.js +1 -0
- package/lib/src/types/dialog.js +1 -0
- package/lib/src/types/icon.js +2 -0
- package/lib/src/types/index.js +11 -0
- package/lib/src/types/locale.js +1 -0
- package/lib/src/types/modal.js +1 -0
- package/lib/src/types/portalize.js +1 -0
- package/lib/src/types/snackBar.js +1 -0
- package/lib/src/types/theme.js +1 -0
- package/lib/src/types/toast.js +1 -0
- package/lib/src/utils/index.js +55 -0
- package/lib/src/variants/locales/default.json +208 -0
- package/lib/src/variants/themes/default.json +669 -0
- package/lib/tsconfig.build.tsbuildinfo +1 -0
- package/lib/typescript/package.json +4 -0
- package/lib/typescript/src/assets/svg/badgeAlertIcon/index.d.ts +4 -0
- package/lib/typescript/src/assets/svg/badgeAlertIcon/index.d.ts.map +1 -0
- package/lib/typescript/src/assets/svg/badgeDangerIcon/index.d.ts +4 -0
- package/lib/typescript/src/assets/svg/badgeDangerIcon/index.d.ts.map +1 -0
- package/lib/typescript/src/assets/svg/badgeInfoIcon/index.d.ts +4 -0
- package/lib/typescript/src/assets/svg/badgeInfoIcon/index.d.ts.map +1 -0
- package/lib/typescript/src/assets/svg/badgeQuestionMarkIcon/index.d.ts +4 -0
- package/lib/typescript/src/assets/svg/badgeQuestionMarkIcon/index.d.ts.map +1 -0
- package/lib/typescript/src/assets/svg/badgeRightIcon/index.d.ts +4 -0
- package/lib/typescript/src/assets/svg/badgeRightIcon/index.d.ts.map +1 -0
- package/lib/typescript/src/assets/svg/badgeSuccessIcon/index.d.ts +4 -0
- package/lib/typescript/src/assets/svg/badgeSuccessIcon/index.d.ts.map +1 -0
- package/lib/typescript/src/assets/svg/chevronRightIcon/index.d.ts +4 -0
- package/lib/typescript/src/assets/svg/chevronRightIcon/index.d.ts.map +1 -0
- package/lib/typescript/src/assets/svg/cleanIcon/index.d.ts +4 -0
- package/lib/typescript/src/assets/svg/cleanIcon/index.d.ts.map +1 -0
- package/lib/typescript/src/assets/svg/eyeClosedIcon/index.d.ts +4 -0
- package/lib/typescript/src/assets/svg/eyeClosedIcon/index.d.ts.map +1 -0
- package/lib/typescript/src/assets/svg/eyeOpenedIcon/index.d.ts +4 -0
- package/lib/typescript/src/assets/svg/eyeOpenedIcon/index.d.ts.map +1 -0
- package/lib/typescript/src/assets/svg/index.d.ts +11 -0
- package/lib/typescript/src/assets/svg/index.d.ts.map +1 -0
- package/lib/typescript/src/assets/svg/loadingIcon/index.d.ts +4 -0
- package/lib/typescript/src/assets/svg/loadingIcon/index.d.ts.map +1 -0
- package/lib/typescript/src/components/bottomSheet/index.d.ts +5 -0
- package/lib/typescript/src/components/bottomSheet/index.d.ts.map +1 -0
- package/lib/typescript/src/components/bottomSheet/stylesheet.d.ts +22 -0
- package/lib/typescript/src/components/bottomSheet/stylesheet.d.ts.map +1 -0
- package/lib/typescript/src/components/bottomSheet/type.d.ts +59 -0
- package/lib/typescript/src/components/bottomSheet/type.d.ts.map +1 -0
- package/lib/typescript/src/components/button/index.d.ts +10 -0
- package/lib/typescript/src/components/button/index.d.ts.map +1 -0
- package/lib/typescript/src/components/button/stylesheet.d.ts +51 -0
- package/lib/typescript/src/components/button/stylesheet.d.ts.map +1 -0
- package/lib/typescript/src/components/button/type.d.ts +84 -0
- package/lib/typescript/src/components/button/type.d.ts.map +1 -0
- package/lib/typescript/src/components/checkBox/index.d.ts +5 -0
- package/lib/typescript/src/components/checkBox/index.d.ts.map +1 -0
- package/lib/typescript/src/components/checkBox/stylesheet.d.ts +63 -0
- package/lib/typescript/src/components/checkBox/stylesheet.d.ts.map +1 -0
- package/lib/typescript/src/components/checkBox/type.d.ts +57 -0
- package/lib/typescript/src/components/checkBox/type.d.ts.map +1 -0
- package/lib/typescript/src/components/chip/index.d.ts +5 -0
- package/lib/typescript/src/components/chip/index.d.ts.map +1 -0
- package/lib/typescript/src/components/chip/stylesheet.d.ts +48 -0
- package/lib/typescript/src/components/chip/stylesheet.d.ts.map +1 -0
- package/lib/typescript/src/components/chip/type.d.ts +53 -0
- package/lib/typescript/src/components/chip/type.d.ts.map +1 -0
- package/lib/typescript/src/components/dateSelector/index.d.ts +5 -0
- package/lib/typescript/src/components/dateSelector/index.d.ts.map +1 -0
- package/lib/typescript/src/components/dateSelector/stylesheet.d.ts +49 -0
- package/lib/typescript/src/components/dateSelector/stylesheet.d.ts.map +1 -0
- package/lib/typescript/src/components/dateSelector/type.d.ts +46 -0
- package/lib/typescript/src/components/dateSelector/type.d.ts.map +1 -0
- package/lib/typescript/src/components/dateSelector/util.d.ts +3 -0
- package/lib/typescript/src/components/dateSelector/util.d.ts.map +1 -0
- package/lib/typescript/src/components/dateTimePicker/index.d.ts +5 -0
- package/lib/typescript/src/components/dateTimePicker/index.d.ts.map +1 -0
- package/lib/typescript/src/components/dateTimePicker/stylesheet.d.ts +85 -0
- package/lib/typescript/src/components/dateTimePicker/stylesheet.d.ts.map +1 -0
- package/lib/typescript/src/components/dateTimePicker/type.d.ts +173 -0
- package/lib/typescript/src/components/dateTimePicker/type.d.ts.map +1 -0
- package/lib/typescript/src/components/dateTimeSheet/index.d.ts +4 -0
- package/lib/typescript/src/components/dateTimeSheet/index.d.ts.map +1 -0
- package/lib/typescript/src/components/dateTimeSheet/stylesheet.d.ts +54 -0
- package/lib/typescript/src/components/dateTimeSheet/stylesheet.d.ts.map +1 -0
- package/lib/typescript/src/components/dateTimeSheet/type.d.ts +67 -0
- package/lib/typescript/src/components/dateTimeSheet/type.d.ts.map +1 -0
- package/lib/typescript/src/components/dialog/index.d.ts +5 -0
- package/lib/typescript/src/components/dialog/index.d.ts.map +1 -0
- package/lib/typescript/src/components/dialog/stylesheet.d.ts +48 -0
- package/lib/typescript/src/components/dialog/stylesheet.d.ts.map +1 -0
- package/lib/typescript/src/components/dialog/type.d.ts +62 -0
- package/lib/typescript/src/components/dialog/type.d.ts.map +1 -0
- package/lib/typescript/src/components/index.d.ts +38 -0
- package/lib/typescript/src/components/index.d.ts.map +1 -0
- package/lib/typescript/src/components/loading/index.d.ts +5 -0
- package/lib/typescript/src/components/loading/index.d.ts.map +1 -0
- package/lib/typescript/src/components/loading/stylesheet.d.ts +7 -0
- package/lib/typescript/src/components/loading/stylesheet.d.ts.map +1 -0
- package/lib/typescript/src/components/loading/type.d.ts +12 -0
- package/lib/typescript/src/components/loading/type.d.ts.map +1 -0
- package/lib/typescript/src/components/markdownViewer/constant.d.ts +3 -0
- package/lib/typescript/src/components/markdownViewer/constant.d.ts.map +1 -0
- package/lib/typescript/src/components/markdownViewer/index.d.ts +5 -0
- package/lib/typescript/src/components/markdownViewer/index.d.ts.map +1 -0
- package/lib/typescript/src/components/markdownViewer/stylesheet.d.ts +57 -0
- package/lib/typescript/src/components/markdownViewer/stylesheet.d.ts.map +1 -0
- package/lib/typescript/src/components/markdownViewer/type.d.ts +57 -0
- package/lib/typescript/src/components/markdownViewer/type.d.ts.map +1 -0
- package/lib/typescript/src/components/markdownViewer/util.d.ts +53 -0
- package/lib/typescript/src/components/markdownViewer/util.d.ts.map +1 -0
- package/lib/typescript/src/components/modal/index.d.ts +5 -0
- package/lib/typescript/src/components/modal/index.d.ts.map +1 -0
- package/lib/typescript/src/components/modal/stylesheet.d.ts +33 -0
- package/lib/typescript/src/components/modal/stylesheet.d.ts.map +1 -0
- package/lib/typescript/src/components/modal/type.d.ts +45 -0
- package/lib/typescript/src/components/modal/type.d.ts.map +1 -0
- package/lib/typescript/src/components/monthSelector/index.d.ts +5 -0
- package/lib/typescript/src/components/monthSelector/index.d.ts.map +1 -0
- package/lib/typescript/src/components/monthSelector/stylesheet.d.ts +49 -0
- package/lib/typescript/src/components/monthSelector/stylesheet.d.ts.map +1 -0
- package/lib/typescript/src/components/monthSelector/type.d.ts +46 -0
- package/lib/typescript/src/components/monthSelector/type.d.ts.map +1 -0
- package/lib/typescript/src/components/monthSelector/util.d.ts +3 -0
- package/lib/typescript/src/components/monthSelector/util.d.ts.map +1 -0
- package/lib/typescript/src/components/notificationIndicator/index.d.ts +5 -0
- package/lib/typescript/src/components/notificationIndicator/index.d.ts.map +1 -0
- package/lib/typescript/src/components/notificationIndicator/stylesheet.d.ts +46 -0
- package/lib/typescript/src/components/notificationIndicator/stylesheet.d.ts.map +1 -0
- package/lib/typescript/src/components/notificationIndicator/type.d.ts +52 -0
- package/lib/typescript/src/components/notificationIndicator/type.d.ts.map +1 -0
- package/lib/typescript/src/components/numericInput/index.d.ts +5 -0
- package/lib/typescript/src/components/numericInput/index.d.ts.map +1 -0
- package/lib/typescript/src/components/numericInput/stylesheet.d.ts +103 -0
- package/lib/typescript/src/components/numericInput/stylesheet.d.ts.map +1 -0
- package/lib/typescript/src/components/numericInput/type.d.ts +87 -0
- package/lib/typescript/src/components/numericInput/type.d.ts.map +1 -0
- package/lib/typescript/src/components/pageContainer/index.d.ts +5 -0
- package/lib/typescript/src/components/pageContainer/index.d.ts.map +1 -0
- package/lib/typescript/src/components/pageContainer/stylesheet.d.ts +10 -0
- package/lib/typescript/src/components/pageContainer/stylesheet.d.ts.map +1 -0
- package/lib/typescript/src/components/pageContainer/type.d.ts +22 -0
- package/lib/typescript/src/components/pageContainer/type.d.ts.map +1 -0
- package/lib/typescript/src/components/radioButton/index.d.ts +5 -0
- package/lib/typescript/src/components/radioButton/index.d.ts.map +1 -0
- package/lib/typescript/src/components/radioButton/stylesheet.d.ts +67 -0
- package/lib/typescript/src/components/radioButton/stylesheet.d.ts.map +1 -0
- package/lib/typescript/src/components/radioButton/type.d.ts +58 -0
- package/lib/typescript/src/components/radioButton/type.d.ts.map +1 -0
- package/lib/typescript/src/components/rowCard/index.d.ts +5 -0
- package/lib/typescript/src/components/rowCard/index.d.ts.map +1 -0
- package/lib/typescript/src/components/rowCard/stylesheet.d.ts +45 -0
- package/lib/typescript/src/components/rowCard/stylesheet.d.ts.map +1 -0
- package/lib/typescript/src/components/rowCard/type.d.ts +49 -0
- package/lib/typescript/src/components/rowCard/type.d.ts.map +1 -0
- package/lib/typescript/src/components/selectBox/index.d.ts +4 -0
- package/lib/typescript/src/components/selectBox/index.d.ts.map +1 -0
- package/lib/typescript/src/components/selectBox/stylesheet.d.ts +86 -0
- package/lib/typescript/src/components/selectBox/stylesheet.d.ts.map +1 -0
- package/lib/typescript/src/components/selectBox/type.d.ts +151 -0
- package/lib/typescript/src/components/selectBox/type.d.ts.map +1 -0
- package/lib/typescript/src/components/selectSheet/index.d.ts +4 -0
- package/lib/typescript/src/components/selectSheet/index.d.ts.map +1 -0
- package/lib/typescript/src/components/selectSheet/stylesheet.d.ts +54 -0
- package/lib/typescript/src/components/selectSheet/stylesheet.d.ts.map +1 -0
- package/lib/typescript/src/components/selectSheet/type.d.ts +80 -0
- package/lib/typescript/src/components/selectSheet/type.d.ts.map +1 -0
- package/lib/typescript/src/components/snackBar/index.d.ts +5 -0
- package/lib/typescript/src/components/snackBar/index.d.ts.map +1 -0
- package/lib/typescript/src/components/snackBar/stylesheet.d.ts +50 -0
- package/lib/typescript/src/components/snackBar/stylesheet.d.ts.map +1 -0
- package/lib/typescript/src/components/snackBar/type.d.ts +70 -0
- package/lib/typescript/src/components/snackBar/type.d.ts.map +1 -0
- package/lib/typescript/src/components/stateCard/index.d.ts +5 -0
- package/lib/typescript/src/components/stateCard/index.d.ts.map +1 -0
- package/lib/typescript/src/components/stateCard/stylesheet.d.ts +43 -0
- package/lib/typescript/src/components/stateCard/stylesheet.d.ts.map +1 -0
- package/lib/typescript/src/components/stateCard/type.d.ts +35 -0
- package/lib/typescript/src/components/stateCard/type.d.ts.map +1 -0
- package/lib/typescript/src/components/sticker/index.d.ts +5 -0
- package/lib/typescript/src/components/sticker/index.d.ts.map +1 -0
- package/lib/typescript/src/components/sticker/stylesheet.d.ts +34 -0
- package/lib/typescript/src/components/sticker/stylesheet.d.ts.map +1 -0
- package/lib/typescript/src/components/sticker/type.d.ts +45 -0
- package/lib/typescript/src/components/sticker/type.d.ts.map +1 -0
- package/lib/typescript/src/components/switch/index.d.ts +5 -0
- package/lib/typescript/src/components/switch/index.d.ts.map +1 -0
- package/lib/typescript/src/components/switch/stylesheet.d.ts +64 -0
- package/lib/typescript/src/components/switch/stylesheet.d.ts.map +1 -0
- package/lib/typescript/src/components/switch/type.d.ts +56 -0
- package/lib/typescript/src/components/switch/type.d.ts.map +1 -0
- package/lib/typescript/src/components/text/index.d.ts +5 -0
- package/lib/typescript/src/components/text/index.d.ts.map +1 -0
- package/lib/typescript/src/components/text/type.d.ts +17 -0
- package/lib/typescript/src/components/text/type.d.ts.map +1 -0
- package/lib/typescript/src/components/textAreaInput/index.d.ts +5 -0
- package/lib/typescript/src/components/textAreaInput/index.d.ts.map +1 -0
- package/lib/typescript/src/components/textAreaInput/stylesheet.d.ts +113 -0
- package/lib/typescript/src/components/textAreaInput/stylesheet.d.ts.map +1 -0
- package/lib/typescript/src/components/textAreaInput/type.d.ts +86 -0
- package/lib/typescript/src/components/textAreaInput/type.d.ts.map +1 -0
- package/lib/typescript/src/components/textInput/index.d.ts +5 -0
- package/lib/typescript/src/components/textInput/index.d.ts.map +1 -0
- package/lib/typescript/src/components/textInput/stylesheet.d.ts +104 -0
- package/lib/typescript/src/components/textInput/stylesheet.d.ts.map +1 -0
- package/lib/typescript/src/components/textInput/type.d.ts +86 -0
- package/lib/typescript/src/components/textInput/type.d.ts.map +1 -0
- package/lib/typescript/src/components/timeSelector/components/timeInput/index.d.ts +5 -0
- package/lib/typescript/src/components/timeSelector/components/timeInput/index.d.ts.map +1 -0
- package/lib/typescript/src/components/timeSelector/components/timeInput/stylesheet.d.ts +17 -0
- package/lib/typescript/src/components/timeSelector/components/timeInput/stylesheet.d.ts.map +1 -0
- package/lib/typescript/src/components/timeSelector/components/timeInput/type.d.ts +32 -0
- package/lib/typescript/src/components/timeSelector/components/timeInput/type.d.ts.map +1 -0
- package/lib/typescript/src/components/timeSelector/index.d.ts +4 -0
- package/lib/typescript/src/components/timeSelector/index.d.ts.map +1 -0
- package/lib/typescript/src/components/timeSelector/stylesheet.d.ts +27 -0
- package/lib/typescript/src/components/timeSelector/stylesheet.d.ts.map +1 -0
- package/lib/typescript/src/components/timeSelector/type.d.ts +36 -0
- package/lib/typescript/src/components/timeSelector/type.d.ts.map +1 -0
- package/lib/typescript/src/components/toast/index.d.ts +5 -0
- package/lib/typescript/src/components/toast/index.d.ts.map +1 -0
- package/lib/typescript/src/components/toast/stylesheet.d.ts +49 -0
- package/lib/typescript/src/components/toast/stylesheet.d.ts.map +1 -0
- package/lib/typescript/src/components/toast/type.d.ts +64 -0
- package/lib/typescript/src/components/toast/type.d.ts.map +1 -0
- package/lib/typescript/src/components/yearSelector/index.d.ts +5 -0
- package/lib/typescript/src/components/yearSelector/index.d.ts.map +1 -0
- package/lib/typescript/src/components/yearSelector/stylesheet.d.ts +49 -0
- package/lib/typescript/src/components/yearSelector/stylesheet.d.ts.map +1 -0
- package/lib/typescript/src/components/yearSelector/type.d.ts +43 -0
- package/lib/typescript/src/components/yearSelector/type.d.ts.map +1 -0
- package/lib/typescript/src/components/yearSelector/util.d.ts +3 -0
- package/lib/typescript/src/components/yearSelector/util.d.ts.map +1 -0
- package/lib/typescript/src/context/bottomSheet.d.ts +18 -0
- package/lib/typescript/src/context/bottomSheet.d.ts.map +1 -0
- package/lib/typescript/src/context/dialog.d.ts +18 -0
- package/lib/typescript/src/context/dialog.d.ts.map +1 -0
- package/lib/typescript/src/context/index.d.ts +24 -0
- package/lib/typescript/src/context/index.d.ts.map +1 -0
- package/lib/typescript/src/context/localize.d.ts +24 -0
- package/lib/typescript/src/context/localize.d.ts.map +1 -0
- package/lib/typescript/src/context/modal.d.ts +18 -0
- package/lib/typescript/src/context/modal.d.ts.map +1 -0
- package/lib/typescript/src/context/snackBar.d.ts +18 -0
- package/lib/typescript/src/context/snackBar.d.ts.map +1 -0
- package/lib/typescript/src/context/theme.d.ts +32 -0
- package/lib/typescript/src/context/theme.d.ts.map +1 -0
- package/lib/typescript/src/context/toast.d.ts +18 -0
- package/lib/typescript/src/context/toast.d.ts.map +1 -0
- package/lib/typescript/src/core/hooks.d.ts +18 -0
- package/lib/typescript/src/core/hooks.d.ts.map +1 -0
- package/lib/typescript/src/core/index.d.ts +13 -0
- package/lib/typescript/src/core/index.d.ts.map +1 -0
- package/lib/typescript/src/helpers/index.d.ts +5 -0
- package/lib/typescript/src/helpers/index.d.ts.map +1 -0
- package/lib/typescript/src/helpers/locale/index.d.ts +8 -0
- package/lib/typescript/src/helpers/locale/index.d.ts.map +1 -0
- package/lib/typescript/src/helpers/portalize/Consumer.d.ts +10 -0
- package/lib/typescript/src/helpers/portalize/Consumer.d.ts.map +1 -0
- package/lib/typescript/src/helpers/portalize/Host.d.ts +17 -0
- package/lib/typescript/src/helpers/portalize/Host.d.ts.map +1 -0
- package/lib/typescript/src/helpers/portalize/Manager.d.ts +10 -0
- package/lib/typescript/src/helpers/portalize/Manager.d.ts.map +1 -0
- package/lib/typescript/src/helpers/portalize/Portal.d.ts +8 -0
- package/lib/typescript/src/helpers/portalize/Portal.d.ts.map +1 -0
- package/lib/typescript/src/helpers/portalize/context/index.d.ts +14 -0
- package/lib/typescript/src/helpers/portalize/context/index.d.ts.map +1 -0
- package/lib/typescript/src/helpers/portalize/hooks/useKey.d.ts +7 -0
- package/lib/typescript/src/helpers/portalize/hooks/useKey.d.ts.map +1 -0
- package/lib/typescript/src/helpers/portalize/index.d.ts +5 -0
- package/lib/typescript/src/helpers/portalize/index.d.ts.map +1 -0
- package/lib/typescript/src/helpers/theme/palette.d.ts +3 -0
- package/lib/typescript/src/helpers/theme/palette.d.ts.map +1 -0
- package/lib/typescript/src/helpers/theme/shapes.d.ts +33 -0
- package/lib/typescript/src/helpers/theme/shapes.d.ts.map +1 -0
- package/lib/typescript/src/helpers/theme/typography.d.ts +22 -0
- package/lib/typescript/src/helpers/theme/typography.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +10 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/types/bottomSheet.d.ts +20 -0
- package/lib/typescript/src/types/bottomSheet.d.ts.map +1 -0
- package/lib/typescript/src/types/dialog.d.ts +20 -0
- package/lib/typescript/src/types/dialog.d.ts.map +1 -0
- package/lib/typescript/src/types/icon.d.ts +14 -0
- package/lib/typescript/src/types/icon.d.ts.map +1 -0
- package/lib/typescript/src/types/index.d.ts +134 -0
- package/lib/typescript/src/types/index.d.ts.map +1 -0
- package/lib/typescript/src/types/locale.d.ts +17 -0
- package/lib/typescript/src/types/locale.d.ts.map +1 -0
- package/lib/typescript/src/types/modal.d.ts +20 -0
- package/lib/typescript/src/types/modal.d.ts.map +1 -0
- package/lib/typescript/src/types/portalize.d.ts +4 -0
- package/lib/typescript/src/types/portalize.d.ts.map +1 -0
- package/lib/typescript/src/types/snackBar.d.ts +19 -0
- package/lib/typescript/src/types/snackBar.d.ts.map +1 -0
- package/lib/typescript/src/types/theme.d.ts +25 -0
- package/lib/typescript/src/types/theme.d.ts.map +1 -0
- package/lib/typescript/src/types/toast.d.ts +19 -0
- package/lib/typescript/src/types/toast.d.ts.map +1 -0
- package/lib/typescript/src/utils/index.d.ts +5 -0
- package/lib/typescript/src/utils/index.d.ts.map +1 -0
- package/lib/typescript/src/variants/locales/default.json +208 -0
- package/lib/typescript/src/variants/themes/default.json +669 -0
- package/package.json +213 -0
- package/react-native.config.js +5 -0
- package/src/assets/fonts/Geist-Black.ttf +0 -0
- package/src/assets/fonts/Geist-Bold.ttf +0 -0
- package/src/assets/fonts/Geist-ExtraBold.ttf +0 -0
- package/src/assets/fonts/Geist-ExtraLight.ttf +0 -0
- package/src/assets/fonts/Geist-Light.ttf +0 -0
- package/src/assets/fonts/Geist-Medium.ttf +0 -0
- package/src/assets/fonts/Geist-Regular.ttf +0 -0
- package/src/assets/fonts/Geist-SemiBold.ttf +0 -0
- package/src/assets/fonts/Geist-Thin.ttf +0 -0
- package/src/assets/svg/badgeAlertIcon/index.tsx +42 -0
- package/src/assets/svg/badgeDangerIcon/index.tsx +40 -0
- package/src/assets/svg/badgeInfoIcon/index.tsx +40 -0
- package/src/assets/svg/badgeQuestionMarkIcon/index.tsx +50 -0
- package/src/assets/svg/badgeRightIcon/index.tsx +40 -0
- package/src/assets/svg/badgeSuccessIcon/index.tsx +50 -0
- package/src/assets/svg/chevronRightIcon/index.tsx +40 -0
- package/src/assets/svg/cleanIcon/index.tsx +40 -0
- package/src/assets/svg/eyeClosedIcon/index.tsx +50 -0
- package/src/assets/svg/eyeOpenedIcon/index.tsx +50 -0
- package/src/assets/svg/index.ts +39 -0
- package/src/assets/svg/loadingIcon/index.tsx +95 -0
- package/src/components/bottomSheet/index.tsx +1218 -0
- package/src/components/bottomSheet/stylesheet.ts +28 -0
- package/src/components/bottomSheet/type.ts +68 -0
- package/src/components/button/index.tsx +191 -0
- package/src/components/button/stylesheet.ts +294 -0
- package/src/components/button/type.ts +108 -0
- package/src/components/checkBox/index.tsx +274 -0
- package/src/components/checkBox/stylesheet.ts +223 -0
- package/src/components/checkBox/type.ts +69 -0
- package/src/components/chip/index.tsx +183 -0
- package/src/components/chip/stylesheet.ts +172 -0
- package/src/components/chip/type.ts +68 -0
- package/src/components/dateSelector/index.tsx +434 -0
- package/src/components/dateSelector/stylesheet.ts +92 -0
- package/src/components/dateSelector/type.ts +59 -0
- package/src/components/dateSelector/util.ts +20 -0
- package/src/components/dateTimePicker/index.tsx +977 -0
- package/src/components/dateTimePicker/stylesheet.ts +252 -0
- package/src/components/dateTimePicker/type.ts +214 -0
- package/src/components/dateTimeSheet/index.tsx +418 -0
- package/src/components/dateTimeSheet/stylesheet.ts +99 -0
- package/src/components/dateTimeSheet/type.ts +98 -0
- package/src/components/dialog/index.tsx +336 -0
- package/src/components/dialog/stylesheet.ts +129 -0
- package/src/components/dialog/type.ts +79 -0
- package/src/components/index.ts +163 -0
- package/src/components/loading/index.tsx +26 -0
- package/src/components/loading/stylesheet.ts +10 -0
- package/src/components/loading/type.ts +18 -0
- package/src/components/markdownViewer/constant.ts +19 -0
- package/src/components/markdownViewer/index.tsx +503 -0
- package/src/components/markdownViewer/stylesheet.ts +72 -0
- package/src/components/markdownViewer/type.ts +87 -0
- package/src/components/markdownViewer/util.ts +453 -0
- package/src/components/modal/index.tsx +234 -0
- package/src/components/modal/stylesheet.ts +36 -0
- package/src/components/modal/type.ts +58 -0
- package/src/components/monthSelector/index.tsx +447 -0
- package/src/components/monthSelector/stylesheet.ts +89 -0
- package/src/components/monthSelector/type.ts +59 -0
- package/src/components/monthSelector/util.ts +20 -0
- package/src/components/notificationIndicator/index.tsx +172 -0
- package/src/components/notificationIndicator/stylesheet.ts +154 -0
- package/src/components/notificationIndicator/type.ts +65 -0
- package/src/components/numericInput/index.tsx +617 -0
- package/src/components/numericInput/stylesheet.ts +278 -0
- package/src/components/numericInput/type.ts +109 -0
- package/src/components/pageContainer/index.tsx +119 -0
- package/src/components/pageContainer/stylesheet.ts +13 -0
- package/src/components/pageContainer/type.ts +30 -0
- package/src/components/radioButton/index.tsx +269 -0
- package/src/components/radioButton/stylesheet.ts +233 -0
- package/src/components/radioButton/type.ts +70 -0
- package/src/components/rowCard/index.tsx +231 -0
- package/src/components/rowCard/stylesheet.ts +95 -0
- package/src/components/rowCard/type.ts +59 -0
- package/src/components/selectBox/index.tsx +867 -0
- package/src/components/selectBox/stylesheet.ts +250 -0
- package/src/components/selectBox/type.ts +193 -0
- package/src/components/selectSheet/index.tsx +372 -0
- package/src/components/selectSheet/stylesheet.ts +102 -0
- package/src/components/selectSheet/type.ts +103 -0
- package/src/components/snackBar/index.tsx +430 -0
- package/src/components/snackBar/stylesheet.ts +164 -0
- package/src/components/snackBar/type.ts +85 -0
- package/src/components/stateCard/index.tsx +152 -0
- package/src/components/stateCard/stylesheet.ts +121 -0
- package/src/components/stateCard/type.ts +47 -0
- package/src/components/sticker/index.tsx +123 -0
- package/src/components/sticker/stylesheet.ts +124 -0
- package/src/components/sticker/type.ts +60 -0
- package/src/components/switch/index.tsx +284 -0
- package/src/components/switch/stylesheet.ts +214 -0
- package/src/components/switch/type.ts +68 -0
- package/src/components/text/index.tsx +42 -0
- package/src/components/text/type.ts +25 -0
- package/src/components/textAreaInput/index.tsx +551 -0
- package/src/components/textAreaInput/stylesheet.ts +294 -0
- package/src/components/textAreaInput/type.ts +104 -0
- package/src/components/textInput/index.tsx +555 -0
- package/src/components/textInput/stylesheet.ts +279 -0
- package/src/components/textInput/type.ts +105 -0
- package/src/components/timeSelector/components/timeInput/index.tsx +172 -0
- package/src/components/timeSelector/components/timeInput/stylesheet.ts +38 -0
- package/src/components/timeSelector/components/timeInput/type.ts +47 -0
- package/src/components/timeSelector/index.tsx +433 -0
- package/src/components/timeSelector/stylesheet.ts +59 -0
- package/src/components/timeSelector/type.ts +48 -0
- package/src/components/toast/index.tsx +272 -0
- package/src/components/toast/stylesheet.ts +156 -0
- package/src/components/toast/type.ts +79 -0
- package/src/components/yearSelector/index.tsx +444 -0
- package/src/components/yearSelector/stylesheet.ts +89 -0
- package/src/components/yearSelector/type.ts +55 -0
- package/src/components/yearSelector/util.ts +20 -0
- package/src/context/bottomSheet.tsx +121 -0
- package/src/context/dialog.tsx +120 -0
- package/src/context/index.tsx +110 -0
- package/src/context/localize.tsx +202 -0
- package/src/context/modal.tsx +116 -0
- package/src/context/snackBar.tsx +114 -0
- package/src/context/theme.tsx +217 -0
- package/src/context/toast.tsx +114 -0
- package/src/core/hooks.ts +33 -0
- package/src/core/index.tsx +126 -0
- package/src/helpers/index.ts +20 -0
- package/src/helpers/locale/index.ts +28 -0
- package/src/helpers/portalize/Consumer.tsx +53 -0
- package/src/helpers/portalize/Host.tsx +122 -0
- package/src/helpers/portalize/Manager.tsx +75 -0
- package/src/helpers/portalize/Portal.tsx +30 -0
- package/src/helpers/portalize/context/index.ts +49 -0
- package/src/helpers/portalize/hooks/useKey.ts +49 -0
- package/src/helpers/portalize/index.tsx +15 -0
- package/src/helpers/theme/palette.ts +90 -0
- package/src/helpers/theme/shapes.ts +106 -0
- package/src/helpers/theme/typography.ts +46 -0
- package/src/index.tsx +117 -0
- package/src/types/bottomSheet.ts +23 -0
- package/src/types/dialog.ts +23 -0
- package/src/types/icon.ts +20 -0
- package/src/types/index.ts +217 -0
- package/src/types/locale.ts +30 -0
- package/src/types/modal.ts +25 -0
- package/src/types/portalize.ts +3 -0
- package/src/types/snackBar.ts +24 -0
- package/src/types/theme.ts +30 -0
- package/src/types/toast.ts +24 -0
- package/src/utils/index.ts +65 -0
- package/src/variants/locales/default.json +208 -0
- package/src/variants/themes/default.json +669 -0
|
@@ -0,0 +1,1218 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useImperativeHandle,
|
|
3
|
+
type ComponentRef,
|
|
4
|
+
forwardRef,
|
|
5
|
+
useEffect,
|
|
6
|
+
useState,
|
|
7
|
+
useRef,
|
|
8
|
+
type PointerEvent
|
|
9
|
+
} from "react";
|
|
10
|
+
import {
|
|
11
|
+
type LayoutChangeEvent,
|
|
12
|
+
PanResponder,
|
|
13
|
+
ScrollView,
|
|
14
|
+
Platform,
|
|
15
|
+
Animated,
|
|
16
|
+
Easing,
|
|
17
|
+
View
|
|
18
|
+
} from "react-native";
|
|
19
|
+
import type IBottomSheetProps from "./type";
|
|
20
|
+
import type {
|
|
21
|
+
IBottomSheetRef
|
|
22
|
+
} from "./type";
|
|
23
|
+
import stylesheet from "./stylesheet";
|
|
24
|
+
import {
|
|
25
|
+
NCoreUIKitTheme
|
|
26
|
+
} from "../../core/hooks";
|
|
27
|
+
import {
|
|
28
|
+
useSafeAreaInsets
|
|
29
|
+
} from "react-native-safe-area-context";
|
|
30
|
+
import {
|
|
31
|
+
safeGlobal,
|
|
32
|
+
webStyle,
|
|
33
|
+
type RefForwardingComponent,
|
|
34
|
+
type SafePointerEvent
|
|
35
|
+
} from "../../types";
|
|
36
|
+
import type {
|
|
37
|
+
IModalRef
|
|
38
|
+
} from "../modal/type";
|
|
39
|
+
import {
|
|
40
|
+
windowHeight,
|
|
41
|
+
uuid,
|
|
42
|
+
windowWidth
|
|
43
|
+
} from "../../utils";
|
|
44
|
+
import Modal from "../modal";
|
|
45
|
+
|
|
46
|
+
const BottomSheet: RefForwardingComponent<IBottomSheetRef, IBottomSheetProps> = ({
|
|
47
|
+
isContentReady: isContentReadyProp = true,
|
|
48
|
+
renderHeader: RenderHeaderComponent,
|
|
49
|
+
renderBottom: RenderBottomComponent,
|
|
50
|
+
isForceFullScreenOnSwipe = false,
|
|
51
|
+
isCanFullScreenOnSwipe = false,
|
|
52
|
+
handleContainerBackgroundColor,
|
|
53
|
+
handleHeight: handleHeightProp,
|
|
54
|
+
isWrapSafeAreaContext = true,
|
|
55
|
+
backgroundColor = "default",
|
|
56
|
+
isWorkAsFullScreen = false,
|
|
57
|
+
scrollEndThreshold = 0.85,
|
|
58
|
+
isWorkWithPortal = true,
|
|
59
|
+
isCloseOnOverlay = true,
|
|
60
|
+
handleContainerSpacing,
|
|
61
|
+
isActive: isActiveProp,
|
|
62
|
+
handleBackgroundColor,
|
|
63
|
+
isAutoHeight = false,
|
|
64
|
+
isSwipeClose = true,
|
|
65
|
+
isShowHandle = true,
|
|
66
|
+
isCanSwipe = true,
|
|
67
|
+
onOverlayPressed,
|
|
68
|
+
scrollViewProps,
|
|
69
|
+
scrollViewStyle,
|
|
70
|
+
onScrollEnd,
|
|
71
|
+
customTheme,
|
|
72
|
+
portalName,
|
|
73
|
+
modalProps,
|
|
74
|
+
snapPoint,
|
|
75
|
+
customKey,
|
|
76
|
+
id: outID,
|
|
77
|
+
children,
|
|
78
|
+
onClosed,
|
|
79
|
+
onOpened,
|
|
80
|
+
onClose,
|
|
81
|
+
onOpen,
|
|
82
|
+
style,
|
|
83
|
+
...props
|
|
84
|
+
}, ref) => {
|
|
85
|
+
const {
|
|
86
|
+
radiuses,
|
|
87
|
+
colors,
|
|
88
|
+
spaces
|
|
89
|
+
} = NCoreUIKitTheme.useContext(customTheme);
|
|
90
|
+
|
|
91
|
+
const {
|
|
92
|
+
bottom,
|
|
93
|
+
top
|
|
94
|
+
} = useSafeAreaInsets();
|
|
95
|
+
|
|
96
|
+
const [
|
|
97
|
+
isMeasured,
|
|
98
|
+
setIsMeasured
|
|
99
|
+
] = useState(false);
|
|
100
|
+
|
|
101
|
+
const [
|
|
102
|
+
isActive,
|
|
103
|
+
setIsActive
|
|
104
|
+
] = useState(isActiveProp === undefined ? false : isActiveProp);
|
|
105
|
+
|
|
106
|
+
const id = useRef(outID ? outID : uuid());
|
|
107
|
+
|
|
108
|
+
const bottomSheetKey = useRef(customKey ? customKey : uuid());
|
|
109
|
+
|
|
110
|
+
let bottomSafeArea = isWrapSafeAreaContext ? bottom : 0;
|
|
111
|
+
let topSafeArea = isWrapSafeAreaContext ? top : 0;
|
|
112
|
+
|
|
113
|
+
if(isForceFullScreenOnSwipe) {
|
|
114
|
+
topSafeArea = 0;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
if(!isWorkWithPortal) {
|
|
118
|
+
bottomSafeArea = 0;
|
|
119
|
+
topSafeArea = 0;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const scrollViewRef = useRef<ComponentRef<ScrollView>>(null);
|
|
123
|
+
const modalRef = useRef<IModalRef>(null);
|
|
124
|
+
|
|
125
|
+
const containerHeightRef = useRef(windowHeight);
|
|
126
|
+
|
|
127
|
+
const animatedTranslateY = useRef(new Animated.Value(snapPoint && !isWorkAsFullScreen ? snapPoint : containerHeightRef.current)).current;
|
|
128
|
+
const animatedHeight = useRef(new Animated.Value(
|
|
129
|
+
isAutoHeight ? 0 : snapPoint ?? 0
|
|
130
|
+
)).current;
|
|
131
|
+
|
|
132
|
+
const TOP_GRAB_AREA = 140;
|
|
133
|
+
|
|
134
|
+
const maxHeight = useRef(isWorkAsFullScreen ? containerHeightRef.current - (isWrapSafeAreaContext ? topSafeArea : 0) : containerHeightRef.current - (isForceFullScreenOnSwipe ? 0 : isWrapSafeAreaContext ? topSafeArea : 0));
|
|
135
|
+
const heightValue = useRef(isWorkAsFullScreen ? containerHeightRef.current : snapPoint ?? 0);
|
|
136
|
+
const initialTranslateY = useRef(0);
|
|
137
|
+
const translateYValue = useRef(0);
|
|
138
|
+
const contentHeight = useRef(-1);
|
|
139
|
+
const initialHeight = useRef(0);
|
|
140
|
+
|
|
141
|
+
const scrollViewContentHeight = useRef(-1);
|
|
142
|
+
const scrollViewLayoutHeight = useRef(-1);
|
|
143
|
+
const initialScrollOffset = useRef(0);
|
|
144
|
+
const scrollOffset = useRef(0);
|
|
145
|
+
|
|
146
|
+
const gestureStartY = useRef(0);
|
|
147
|
+
|
|
148
|
+
const isCanFullScreenOnSwipeRef = useRef(isCanFullScreenOnSwipe);
|
|
149
|
+
const isWorkAsFullScreenRef = useRef(isWorkAsFullScreen);
|
|
150
|
+
const isSwipeCloseRef = useRef(isSwipeClose);
|
|
151
|
+
const isCanSwipeRef = useRef(isCanSwipe);
|
|
152
|
+
|
|
153
|
+
const isContentReadyRef = useRef(isContentReadyProp);
|
|
154
|
+
|
|
155
|
+
if(!isWorkAsFullScreen && !isCanFullScreenOnSwipe && snapPoint) {
|
|
156
|
+
maxHeight.current = snapPoint;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
useImperativeHandle(
|
|
160
|
+
ref,
|
|
161
|
+
() => ({
|
|
162
|
+
close: (onClosed?) => {
|
|
163
|
+
closeAnimation(undefined, onClosed);
|
|
164
|
+
},
|
|
165
|
+
open: () => {
|
|
166
|
+
setIsActive(true);
|
|
167
|
+
},
|
|
168
|
+
setIsContentReady: (status) => {
|
|
169
|
+
isContentReadyRef.current = status;
|
|
170
|
+
}
|
|
171
|
+
}),
|
|
172
|
+
[]
|
|
173
|
+
);
|
|
174
|
+
|
|
175
|
+
useEffect(() => {
|
|
176
|
+
isCanSwipeRef.current = isCanSwipe;
|
|
177
|
+
}, [isCanSwipe]);
|
|
178
|
+
|
|
179
|
+
useEffect(() => {
|
|
180
|
+
isSwipeCloseRef.current = isSwipeClose;
|
|
181
|
+
}, [isSwipeClose]);
|
|
182
|
+
|
|
183
|
+
useEffect(() => {
|
|
184
|
+
isCanFullScreenOnSwipeRef.current = isCanFullScreenOnSwipe;
|
|
185
|
+
}, [isCanFullScreenOnSwipe]);
|
|
186
|
+
|
|
187
|
+
useEffect(() => {
|
|
188
|
+
isWorkAsFullScreenRef.current = isWorkAsFullScreen;
|
|
189
|
+
}, [isWorkAsFullScreen]);
|
|
190
|
+
|
|
191
|
+
useEffect(() => {
|
|
192
|
+
isContentReadyRef.current = isContentReadyProp;
|
|
193
|
+
}, [isContentReadyProp]);
|
|
194
|
+
|
|
195
|
+
useEffect(() => {
|
|
196
|
+
if (!isMeasured || contentHeight.current === -1) return;
|
|
197
|
+
|
|
198
|
+
if (isCanFullScreenOnSwipe && !isWorkAsFullScreen) {
|
|
199
|
+
maxHeight.current = containerHeightRef.current - (isForceFullScreenOnSwipe ? 0 : topSafeArea);
|
|
200
|
+
} else if (isAutoHeight || !snapPoint) {
|
|
201
|
+
maxHeight.current = contentHeight.current;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
if (isActive) {
|
|
205
|
+
open();
|
|
206
|
+
}
|
|
207
|
+
}, [
|
|
208
|
+
isActive,
|
|
209
|
+
isMeasured
|
|
210
|
+
]);
|
|
211
|
+
|
|
212
|
+
if(isActiveProp !== undefined) {
|
|
213
|
+
useEffect(() => {
|
|
214
|
+
setIsActive(isActiveProp);
|
|
215
|
+
}, [
|
|
216
|
+
isActiveProp
|
|
217
|
+
]);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
useEffect(() => {
|
|
221
|
+
if (!isWorkAsFullScreen && !isCanFullScreenOnSwipe && snapPoint) {
|
|
222
|
+
maxHeight.current = snapPoint;
|
|
223
|
+
} else if (!isWorkAsFullScreen) {
|
|
224
|
+
maxHeight.current = containerHeightRef.current - (isForceFullScreenOnSwipe ? 0 : isWrapSafeAreaContext ? topSafeArea : 0);
|
|
225
|
+
} else {
|
|
226
|
+
maxHeight.current = containerHeightRef.current - (isWrapSafeAreaContext ? topSafeArea : 0);
|
|
227
|
+
}
|
|
228
|
+
}, [
|
|
229
|
+
isForceFullScreenOnSwipe,
|
|
230
|
+
isCanFullScreenOnSwipe,
|
|
231
|
+
isWrapSafeAreaContext,
|
|
232
|
+
isWorkAsFullScreen,
|
|
233
|
+
topSafeArea,
|
|
234
|
+
snapPoint
|
|
235
|
+
]);
|
|
236
|
+
|
|
237
|
+
useEffect(() => {
|
|
238
|
+
if (!isActive) {
|
|
239
|
+
const newSnapValue = isWorkAsFullScreen
|
|
240
|
+
? containerHeightRef.current
|
|
241
|
+
: (snapPoint ?? contentHeight.current);
|
|
242
|
+
|
|
243
|
+
animatedHeight.setValue(isAutoHeight ? 0 : newSnapValue);
|
|
244
|
+
animatedTranslateY.setValue(newSnapValue);
|
|
245
|
+
|
|
246
|
+
heightValue.current = newSnapValue;
|
|
247
|
+
translateYValue.current = newSnapValue;
|
|
248
|
+
initialHeight.current = newSnapValue;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
if (!isWorkAsFullScreen && !isCanFullScreenOnSwipe && snapPoint) {
|
|
252
|
+
maxHeight.current = snapPoint;
|
|
253
|
+
} else if (!isWorkAsFullScreen) {
|
|
254
|
+
maxHeight.current = containerHeightRef.current - (
|
|
255
|
+
isForceFullScreenOnSwipe ? 0 : isWrapSafeAreaContext ? topSafeArea : 0
|
|
256
|
+
);
|
|
257
|
+
} else {
|
|
258
|
+
maxHeight.current = containerHeightRef.current - (
|
|
259
|
+
isWrapSafeAreaContext ? topSafeArea : 0
|
|
260
|
+
);
|
|
261
|
+
}
|
|
262
|
+
}, [
|
|
263
|
+
snapPoint,
|
|
264
|
+
isWorkAsFullScreen
|
|
265
|
+
]);
|
|
266
|
+
|
|
267
|
+
useEffect(() => {
|
|
268
|
+
const listenerAHeightId = animatedHeight.addListener(({
|
|
269
|
+
value
|
|
270
|
+
}) => {
|
|
271
|
+
heightValue.current = value;
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
const listenerTYId = animatedTranslateY.addListener(({
|
|
275
|
+
value
|
|
276
|
+
}) => {
|
|
277
|
+
translateYValue.current = value;
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
return () => {
|
|
281
|
+
animatedHeight.removeListener(listenerAHeightId);
|
|
282
|
+
animatedTranslateY.removeListener(listenerTYId);
|
|
283
|
+
};
|
|
284
|
+
}, []);
|
|
285
|
+
|
|
286
|
+
const checkScrollThreshold = () => {
|
|
287
|
+
if (!onScrollEnd) return;
|
|
288
|
+
|
|
289
|
+
const maxS = Math.max(0, scrollViewContentHeight.current - scrollViewLayoutHeight.current);
|
|
290
|
+
|
|
291
|
+
if (maxS <= 0) return;
|
|
292
|
+
|
|
293
|
+
const ratio = scrollOffset.current / maxS;
|
|
294
|
+
|
|
295
|
+
if (ratio >= scrollEndThreshold) {
|
|
296
|
+
onScrollEnd();
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
const openAnimation = (runIndex?: number) => {
|
|
301
|
+
if(isContentReadyRef.current) {
|
|
302
|
+
Animated.timing(animatedTranslateY, {
|
|
303
|
+
useNativeDriver: false,
|
|
304
|
+
duration: 300,
|
|
305
|
+
toValue: 0
|
|
306
|
+
}).start(({
|
|
307
|
+
finished
|
|
308
|
+
}) => {
|
|
309
|
+
if(finished) {
|
|
310
|
+
if(onOpened) onOpened();
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
} else {
|
|
314
|
+
if(!runIndex || runIndex < 10) {
|
|
315
|
+
setTimeout(() => {
|
|
316
|
+
openAnimation(runIndex ? runIndex + 1 : 1);
|
|
317
|
+
}, 100);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
const open = () => {
|
|
323
|
+
if (translateYValue.current < 0) {
|
|
324
|
+
const safeValue = snapPoint ?? contentHeight.current;
|
|
325
|
+
animatedTranslateY.setValue(safeValue);
|
|
326
|
+
translateYValue.current = safeValue;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
resetState();
|
|
330
|
+
|
|
331
|
+
if (isAutoHeight || !snapPoint) {
|
|
332
|
+
animatedHeight.setValue(contentHeight.current);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
if(onOpen) onOpen();
|
|
336
|
+
|
|
337
|
+
setTimeout(() => {
|
|
338
|
+
openAnimation();
|
|
339
|
+
}, 100);
|
|
340
|
+
};
|
|
341
|
+
|
|
342
|
+
const closeAnimation = (toValue?: number, _onClosed?: (props: {
|
|
343
|
+
id: string;
|
|
344
|
+
}) => void) => {
|
|
345
|
+
if(onClose) onClose({
|
|
346
|
+
id: id.current
|
|
347
|
+
});
|
|
348
|
+
|
|
349
|
+
const currentSnapPoint = isWorkAsFullScreen
|
|
350
|
+
? containerHeightRef.current
|
|
351
|
+
: (isAutoHeight || !snapPoint ? contentHeight.current : snapPoint);
|
|
352
|
+
|
|
353
|
+
Animated.timing(animatedTranslateY, {
|
|
354
|
+
toValue: toValue ?? currentSnapPoint,
|
|
355
|
+
useNativeDriver: false,
|
|
356
|
+
duration: 300
|
|
357
|
+
}).start(({
|
|
358
|
+
finished
|
|
359
|
+
}) => {
|
|
360
|
+
if(finished) {
|
|
361
|
+
resetState();
|
|
362
|
+
|
|
363
|
+
setIsActive(false);
|
|
364
|
+
|
|
365
|
+
if(onClosed) onClosed({
|
|
366
|
+
id: id.current
|
|
367
|
+
});
|
|
368
|
+
|
|
369
|
+
if(_onClosed) _onClosed({
|
|
370
|
+
id: id.current
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
});
|
|
374
|
+
};
|
|
375
|
+
|
|
376
|
+
const onLayout = (event: LayoutChangeEvent) => {
|
|
377
|
+
const {
|
|
378
|
+
height
|
|
379
|
+
} = event.nativeEvent.layout;
|
|
380
|
+
|
|
381
|
+
if (height === contentHeight.current) return;
|
|
382
|
+
|
|
383
|
+
contentHeight.current = height;
|
|
384
|
+
|
|
385
|
+
if(!isMeasured) {
|
|
386
|
+
animatedHeight.setValue(height);
|
|
387
|
+
setIsMeasured(true);
|
|
388
|
+
}
|
|
389
|
+
};
|
|
390
|
+
|
|
391
|
+
const resetState = () => {
|
|
392
|
+
animatedHeight.setOffset(0);
|
|
393
|
+
animatedTranslateY.setOffset(0);
|
|
394
|
+
|
|
395
|
+
scrollOffset.current = 0;
|
|
396
|
+
initialScrollOffset.current = 0;
|
|
397
|
+
|
|
398
|
+
const pivot = isWorkAsFullScreen
|
|
399
|
+
? containerHeightRef.current
|
|
400
|
+
: (isAutoHeight ? 0 : (snapPoint ?? contentHeight.current));
|
|
401
|
+
|
|
402
|
+
initialHeight.current = pivot;
|
|
403
|
+
initialTranslateY.current = 0;
|
|
404
|
+
|
|
405
|
+
heightValue.current = pivot;
|
|
406
|
+
translateYValue.current = 0;
|
|
407
|
+
};
|
|
408
|
+
|
|
409
|
+
const panResponder = useRef(
|
|
410
|
+
PanResponder.create({
|
|
411
|
+
onStartShouldSetPanResponder: () => false,
|
|
412
|
+
onMoveShouldSetPanResponderCapture: (_, gestureState) => {
|
|
413
|
+
const {
|
|
414
|
+
dy
|
|
415
|
+
} = gestureState;
|
|
416
|
+
|
|
417
|
+
if(!isCanSwipeRef.current) {
|
|
418
|
+
return false;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
if(Math.abs(dy) < 20) {
|
|
422
|
+
return false;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
return true;
|
|
426
|
+
},
|
|
427
|
+
onPanResponderGrant: (evt) => {
|
|
428
|
+
console.log("GRANT", evt.nativeEvent);
|
|
429
|
+
if(!isCanSwipeRef.current) return;
|
|
430
|
+
|
|
431
|
+
gestureStartY.current = evt.nativeEvent.pageY;
|
|
432
|
+
|
|
433
|
+
animatedTranslateY.stopAnimation((currentY) => {
|
|
434
|
+
translateYValue.current = currentY;
|
|
435
|
+
});
|
|
436
|
+
|
|
437
|
+
animatedHeight.stopAnimation((currentH) => {
|
|
438
|
+
heightValue.current = currentH;
|
|
439
|
+
});
|
|
440
|
+
|
|
441
|
+
animatedTranslateY.flattenOffset();
|
|
442
|
+
animatedHeight.flattenOffset();
|
|
443
|
+
|
|
444
|
+
initialTranslateY.current = translateYValue.current;
|
|
445
|
+
initialScrollOffset.current = scrollOffset.current;
|
|
446
|
+
initialHeight.current = heightValue.current;
|
|
447
|
+
|
|
448
|
+
animatedHeight.setOffset(heightValue.current);
|
|
449
|
+
animatedHeight.setValue(0);
|
|
450
|
+
|
|
451
|
+
animatedTranslateY.setOffset(translateYValue.current);
|
|
452
|
+
animatedTranslateY.setValue(0);
|
|
453
|
+
},
|
|
454
|
+
onPanResponderMove: (_, gestureState) => {
|
|
455
|
+
if(!isCanSwipeRef.current) return;
|
|
456
|
+
|
|
457
|
+
const {
|
|
458
|
+
dy
|
|
459
|
+
} = gestureState;
|
|
460
|
+
|
|
461
|
+
const isAtTop = scrollOffset.current <= 0;
|
|
462
|
+
const isAtTavan = heightValue.current >= maxHeight.current - 1;
|
|
463
|
+
const hasScroll = scrollViewContentHeight.current > scrollViewLayoutHeight.current;
|
|
464
|
+
|
|
465
|
+
const isFromTopArea = gestureStartY.current < TOP_GRAB_AREA;
|
|
466
|
+
|
|
467
|
+
if (dy > 0 && isAtTavan && hasScroll && !isAtTop && !isFromTopArea) {
|
|
468
|
+
const currentDelta = -dy;
|
|
469
|
+
|
|
470
|
+
const initialS = initialScrollOffset.current;
|
|
471
|
+
|
|
472
|
+
const usedForS = Math.max(currentDelta, -initialS);
|
|
473
|
+
|
|
474
|
+
scrollOffset.current = initialS + usedForS;
|
|
475
|
+
|
|
476
|
+
scrollViewRef.current?.scrollTo({
|
|
477
|
+
y: scrollOffset.current,
|
|
478
|
+
animated: false
|
|
479
|
+
});
|
|
480
|
+
|
|
481
|
+
return;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
const delta = -dy;
|
|
485
|
+
|
|
486
|
+
const pivot = snapPoint ?? contentHeight.current;
|
|
487
|
+
|
|
488
|
+
const initialH = initialHeight.current;
|
|
489
|
+
const initialS = initialScrollOffset.current;
|
|
490
|
+
const initialT = initialTranslateY.current;
|
|
491
|
+
|
|
492
|
+
const maxS = Math.max(0, scrollViewContentHeight.current - scrollViewLayoutHeight.current);
|
|
493
|
+
|
|
494
|
+
if (dy < 0) {
|
|
495
|
+
let currentDelta = delta;
|
|
496
|
+
|
|
497
|
+
const effectiveInitialT = Math.max(0, initialT);
|
|
498
|
+
const usedForT = Math.min(currentDelta, effectiveInitialT);
|
|
499
|
+
|
|
500
|
+
animatedTranslateY.setValue(-usedForT);
|
|
501
|
+
currentDelta -= usedForT;
|
|
502
|
+
|
|
503
|
+
if (currentDelta > 0) {
|
|
504
|
+
if (initialH < pivot) {
|
|
505
|
+
const spaceToPivot = pivot - initialH;
|
|
506
|
+
const usedForH = Math.min(currentDelta, spaceToPivot);
|
|
507
|
+
|
|
508
|
+
animatedHeight.setValue(usedForH);
|
|
509
|
+
|
|
510
|
+
currentDelta -= usedForH;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
const isRestoringHeight = initialH < pivot;
|
|
514
|
+
const canScroll = isCanFullScreenOnSwipeRef.current || isWorkAsFullScreenRef.current || !isRestoringHeight;
|
|
515
|
+
|
|
516
|
+
if (currentDelta > 0 && canScroll) {
|
|
517
|
+
const remainingScroll = maxS - initialS;
|
|
518
|
+
if (remainingScroll > 0) {
|
|
519
|
+
const usedForS = Math.min(currentDelta, remainingScroll);
|
|
520
|
+
scrollOffset.current = initialS + usedForS;
|
|
521
|
+
|
|
522
|
+
scrollViewRef.current?.scrollTo({
|
|
523
|
+
y: scrollOffset.current,
|
|
524
|
+
animated: false
|
|
525
|
+
});
|
|
526
|
+
|
|
527
|
+
currentDelta -= usedForS;
|
|
528
|
+
|
|
529
|
+
animatedHeight.setValue(initialH < pivot ? (pivot - initialH) : 0);
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
if (currentDelta > 0) {
|
|
534
|
+
if (isCanFullScreenOnSwipeRef.current) {
|
|
535
|
+
const totalUsedBefore = (initialH < pivot ? (pivot - initialH) : 0);
|
|
536
|
+
|
|
537
|
+
animatedHeight.setValue(totalUsedBefore + currentDelta);
|
|
538
|
+
} else {
|
|
539
|
+
animatedHeight.setValue(initialH < pivot ? (pivot - initialH) : 0);
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
} else {
|
|
544
|
+
let currentDelta = delta;
|
|
545
|
+
|
|
546
|
+
if (initialH > pivot || initialS > 0) {
|
|
547
|
+
if (initialS > 0) {
|
|
548
|
+
const usedForS = Math.max(currentDelta, -initialS);
|
|
549
|
+
scrollOffset.current = initialS + usedForS;
|
|
550
|
+
|
|
551
|
+
scrollViewRef.current?.scrollTo({
|
|
552
|
+
y: scrollOffset.current,
|
|
553
|
+
animated: false
|
|
554
|
+
});
|
|
555
|
+
|
|
556
|
+
currentDelta -= usedForS;
|
|
557
|
+
|
|
558
|
+
animatedHeight.setValue(initialH > pivot ? 0 : pivot - initialH);
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
if (currentDelta < 0 && initialH > pivot) {
|
|
562
|
+
const distanceToPivot = pivot - initialH;
|
|
563
|
+
const usedForH = Math.max(currentDelta, distanceToPivot);
|
|
564
|
+
|
|
565
|
+
animatedHeight.setValue(usedForH);
|
|
566
|
+
|
|
567
|
+
currentDelta -= usedForH;
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
if (currentDelta < 0) {
|
|
572
|
+
animatedHeight.setValue(initialH > pivot ? (pivot - initialH) : 0);
|
|
573
|
+
animatedTranslateY.setValue(-currentDelta);
|
|
574
|
+
|
|
575
|
+
scrollOffset.current = 0;
|
|
576
|
+
|
|
577
|
+
scrollViewRef.current?.scrollTo({
|
|
578
|
+
y: 0,
|
|
579
|
+
animated: false
|
|
580
|
+
});
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
},
|
|
584
|
+
onPanResponderEnd: (_, gestureState) => {
|
|
585
|
+
if(!isCanSwipeRef.current) return;
|
|
586
|
+
|
|
587
|
+
const isAtTop = scrollOffset.current <= 1;
|
|
588
|
+
const isAtTavan = heightValue.current >= maxHeight.current - 1;
|
|
589
|
+
const hasScroll = scrollViewContentHeight.current > scrollViewLayoutHeight.current;
|
|
590
|
+
|
|
591
|
+
const isFromTopArea = gestureStartY.current < TOP_GRAB_AREA;
|
|
592
|
+
|
|
593
|
+
if (isAtTavan && hasScroll && !isAtTop && !isFromTopArea) {
|
|
594
|
+
const velocity = gestureState.vy;
|
|
595
|
+
|
|
596
|
+
if (Math.abs(velocity) > 0.1) {
|
|
597
|
+
const momentum = velocity * -350;
|
|
598
|
+
|
|
599
|
+
const maxS = Math.max(0, scrollViewContentHeight.current - scrollViewLayoutHeight.current);
|
|
600
|
+
|
|
601
|
+
const targetOffset = Math.max(0, Math.min(scrollOffset.current + momentum, maxS));
|
|
602
|
+
|
|
603
|
+
const scrollAnim = new Animated.Value(scrollOffset.current);
|
|
604
|
+
|
|
605
|
+
scrollAnim.addListener(({
|
|
606
|
+
value
|
|
607
|
+
}) => {
|
|
608
|
+
scrollViewRef.current?.scrollTo({
|
|
609
|
+
y: value,
|
|
610
|
+
animated: false
|
|
611
|
+
});
|
|
612
|
+
scrollOffset.current = value;
|
|
613
|
+
});
|
|
614
|
+
|
|
615
|
+
Animated.timing(scrollAnim, {
|
|
616
|
+
duration: Math.min(Math.abs(momentum) * 2, 600),
|
|
617
|
+
easing: Easing.out(Easing.quad),
|
|
618
|
+
useNativeDriver: false,
|
|
619
|
+
toValue: targetOffset
|
|
620
|
+
}).start(() => {
|
|
621
|
+
scrollAnim.removeAllListeners();
|
|
622
|
+
|
|
623
|
+
checkScrollThreshold();
|
|
624
|
+
});
|
|
625
|
+
} else {
|
|
626
|
+
checkScrollThreshold();
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
return;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
const currentH = (animatedHeight as Animated.Value & {
|
|
633
|
+
__getValue(): number;
|
|
634
|
+
}).__getValue();
|
|
635
|
+
|
|
636
|
+
const currentT = (animatedTranslateY as Animated.Value & {
|
|
637
|
+
__getValue(): number;
|
|
638
|
+
}).__getValue();
|
|
639
|
+
|
|
640
|
+
animatedHeight.flattenOffset();
|
|
641
|
+
animatedTranslateY.flattenOffset();
|
|
642
|
+
|
|
643
|
+
heightValue.current = currentH;
|
|
644
|
+
translateYValue.current = currentT;
|
|
645
|
+
|
|
646
|
+
const pivot = snapPoint ?? contentHeight.current;
|
|
647
|
+
const tavan = maxHeight.current;
|
|
648
|
+
|
|
649
|
+
const isFastSwipeDown = gestureState.vy > 0.5;
|
|
650
|
+
const isFastSwipeUp = gestureState.vy < -0.5;
|
|
651
|
+
|
|
652
|
+
if (currentT <= Math.max(pivot * 0.2, 60)) {
|
|
653
|
+
let toValue = pivot;
|
|
654
|
+
|
|
655
|
+
if (isFastSwipeUp && isCanFullScreenOnSwipeRef.current) {
|
|
656
|
+
toValue = tavan;
|
|
657
|
+
} else if (isFastSwipeDown) {
|
|
658
|
+
toValue = pivot;
|
|
659
|
+
} else {
|
|
660
|
+
if (!isCanFullScreenOnSwipeRef.current) {
|
|
661
|
+
toValue = pivot;
|
|
662
|
+
} else {
|
|
663
|
+
const totalRange = tavan - pivot;
|
|
664
|
+
const distFromPivot = currentH - pivot;
|
|
665
|
+
|
|
666
|
+
if (distFromPivot < totalRange * 0.33) {
|
|
667
|
+
toValue = pivot;
|
|
668
|
+
} else if (distFromPivot > totalRange * 0.66) {
|
|
669
|
+
toValue = tavan;
|
|
670
|
+
} else {
|
|
671
|
+
toValue = (tavan - currentH) < (currentH - pivot) ? tavan : pivot;
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
Animated.spring(animatedHeight, {
|
|
677
|
+
useNativeDriver: false,
|
|
678
|
+
toValue: toValue,
|
|
679
|
+
friction: 10,
|
|
680
|
+
tension: 40
|
|
681
|
+
}).start();
|
|
682
|
+
|
|
683
|
+
Animated.spring(animatedTranslateY, {
|
|
684
|
+
useNativeDriver: false,
|
|
685
|
+
toValue: 0,
|
|
686
|
+
friction: 10,
|
|
687
|
+
tension: 40
|
|
688
|
+
}).start();
|
|
689
|
+
} else {
|
|
690
|
+
let toValueT = 0;
|
|
691
|
+
let isClosing = false;
|
|
692
|
+
|
|
693
|
+
if (!isSwipeCloseRef.current) {
|
|
694
|
+
Animated.spring(animatedHeight, {
|
|
695
|
+
useNativeDriver: false,
|
|
696
|
+
toValue: pivot,
|
|
697
|
+
friction: 10,
|
|
698
|
+
tension: 40
|
|
699
|
+
}).start();
|
|
700
|
+
|
|
701
|
+
Animated.timing(animatedTranslateY, {
|
|
702
|
+
useNativeDriver: false,
|
|
703
|
+
duration: 300,
|
|
704
|
+
toValue: 0
|
|
705
|
+
}).start();
|
|
706
|
+
} else {
|
|
707
|
+
if (isFastSwipeDown) {
|
|
708
|
+
toValueT = pivot + 100;
|
|
709
|
+
|
|
710
|
+
isClosing = true;
|
|
711
|
+
} else {
|
|
712
|
+
if (currentT > pivot * 0.5) {
|
|
713
|
+
toValueT = pivot + 100;
|
|
714
|
+
|
|
715
|
+
isClosing = true;
|
|
716
|
+
} else {
|
|
717
|
+
toValueT = 0;
|
|
718
|
+
|
|
719
|
+
isClosing = false;
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
if(onClose) onClose({
|
|
724
|
+
id: id.current
|
|
725
|
+
});
|
|
726
|
+
|
|
727
|
+
Animated.timing(animatedTranslateY, {
|
|
728
|
+
useNativeDriver: false,
|
|
729
|
+
toValue: toValueT,
|
|
730
|
+
duration: 300
|
|
731
|
+
}).start(({
|
|
732
|
+
finished
|
|
733
|
+
}) => {
|
|
734
|
+
if (finished && isClosing) {
|
|
735
|
+
setIsActive(false);
|
|
736
|
+
|
|
737
|
+
if (onClosed) onClosed({
|
|
738
|
+
id: id.current
|
|
739
|
+
});
|
|
740
|
+
}
|
|
741
|
+
});
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
},
|
|
745
|
+
onPanResponderTerminationRequest: () => false,
|
|
746
|
+
onShouldBlockNativeResponder: () => true
|
|
747
|
+
})
|
|
748
|
+
).current;
|
|
749
|
+
|
|
750
|
+
const renderView = () => {
|
|
751
|
+
return <Animated.View
|
|
752
|
+
{...props}
|
|
753
|
+
{...(Platform.OS === "web" ? {} : panResponder.panHandlers)}
|
|
754
|
+
onPointerDown={Platform.OS === "web" ? (evt) => {
|
|
755
|
+
const nativeEvt = evt as unknown as PointerEvent;
|
|
756
|
+
const startY = nativeEvt.clientY;
|
|
757
|
+
gestureStartY.current = nativeEvt.clientY;
|
|
758
|
+
|
|
759
|
+
const initialT = translateYValue.current;
|
|
760
|
+
const initialH = heightValue.current;
|
|
761
|
+
const initialS = scrollOffset.current;
|
|
762
|
+
|
|
763
|
+
animatedTranslateY.setOffset(initialT);
|
|
764
|
+
animatedTranslateY.setValue(0);
|
|
765
|
+
|
|
766
|
+
animatedHeight.setOffset(initialH);
|
|
767
|
+
animatedHeight.setValue(0);
|
|
768
|
+
|
|
769
|
+
let lastY = startY;
|
|
770
|
+
let lastTime = Date.now();
|
|
771
|
+
let velocityY = 0;
|
|
772
|
+
|
|
773
|
+
const handlePointerMove = (moveEvt: SafePointerEvent) => {
|
|
774
|
+
if (!isCanSwipeRef.current) return;
|
|
775
|
+
|
|
776
|
+
const dy = moveEvt.clientY - startY;
|
|
777
|
+
if (Math.abs(dy) < 5) return;
|
|
778
|
+
|
|
779
|
+
const now = Date.now();
|
|
780
|
+
const dt = now - lastTime;
|
|
781
|
+
if (dt > 0) {
|
|
782
|
+
velocityY = (moveEvt.clientY - lastY) / dt;
|
|
783
|
+
}
|
|
784
|
+
lastY = moveEvt.clientY;
|
|
785
|
+
lastTime = now;
|
|
786
|
+
|
|
787
|
+
const delta = -dy;
|
|
788
|
+
const pivot = snapPoint ?? contentHeight.current;
|
|
789
|
+
const isAtTavan = heightValue.current >= maxHeight.current - 1;
|
|
790
|
+
const hasScroll = scrollViewContentHeight.current > scrollViewLayoutHeight.current;
|
|
791
|
+
const isAtTop = scrollOffset.current <= 0;
|
|
792
|
+
const isFromTopArea = gestureStartY.current < TOP_GRAB_AREA;
|
|
793
|
+
const maxS = Math.max(0, scrollViewContentHeight.current - scrollViewLayoutHeight.current);
|
|
794
|
+
|
|
795
|
+
if (dy > 0 && isAtTavan && hasScroll && !isAtTop && !isFromTopArea) {
|
|
796
|
+
const usedForS = Math.max(-dy, -initialS);
|
|
797
|
+
scrollOffset.current = initialS + usedForS;
|
|
798
|
+
scrollViewRef.current?.scrollTo({
|
|
799
|
+
y: scrollOffset.current,
|
|
800
|
+
animated: false
|
|
801
|
+
});
|
|
802
|
+
return;
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
if (dy < 0) {
|
|
806
|
+
let currentDelta = delta;
|
|
807
|
+
|
|
808
|
+
const effectiveInitialT = Math.max(0, initialT);
|
|
809
|
+
const usedForT = Math.min(currentDelta, effectiveInitialT);
|
|
810
|
+
animatedTranslateY.setValue(-usedForT);
|
|
811
|
+
currentDelta -= usedForT;
|
|
812
|
+
|
|
813
|
+
if (currentDelta > 0) {
|
|
814
|
+
if (initialH < pivot) {
|
|
815
|
+
const spaceToPivot = pivot - initialH;
|
|
816
|
+
const usedForH = Math.min(currentDelta, spaceToPivot);
|
|
817
|
+
animatedHeight.setValue(usedForH);
|
|
818
|
+
currentDelta -= usedForH;
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
const isRestoringHeight = initialH < pivot;
|
|
822
|
+
const canScroll = isCanFullScreenOnSwipeRef.current || isWorkAsFullScreenRef.current || !isRestoringHeight;
|
|
823
|
+
|
|
824
|
+
if (currentDelta > 0 && canScroll) {
|
|
825
|
+
const remainingScroll = maxS - initialS;
|
|
826
|
+
if (remainingScroll > 0) {
|
|
827
|
+
const usedForS = Math.min(currentDelta, remainingScroll);
|
|
828
|
+
scrollOffset.current = initialS + usedForS;
|
|
829
|
+
scrollViewRef.current?.scrollTo({
|
|
830
|
+
y: scrollOffset.current,
|
|
831
|
+
animated: false
|
|
832
|
+
});
|
|
833
|
+
currentDelta -= usedForS;
|
|
834
|
+
animatedHeight.setValue(initialH < pivot ? (pivot - initialH) : 0);
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
if (currentDelta > 0) {
|
|
839
|
+
if (isCanFullScreenOnSwipeRef.current) {
|
|
840
|
+
const totalUsedBefore = initialH < pivot ? (pivot - initialH) : 0;
|
|
841
|
+
animatedHeight.setValue(totalUsedBefore + currentDelta);
|
|
842
|
+
} else {
|
|
843
|
+
animatedHeight.setValue(initialH < pivot ? (pivot - initialH) : 0);
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
} else {
|
|
848
|
+
let currentDelta = delta;
|
|
849
|
+
|
|
850
|
+
if (initialH > pivot || initialS > 0) {
|
|
851
|
+
if (initialS > 0) {
|
|
852
|
+
const usedForS = Math.max(currentDelta, -initialS);
|
|
853
|
+
scrollOffset.current = initialS + usedForS;
|
|
854
|
+
scrollViewRef.current?.scrollTo({
|
|
855
|
+
y: scrollOffset.current,
|
|
856
|
+
animated: false
|
|
857
|
+
});
|
|
858
|
+
currentDelta -= usedForS;
|
|
859
|
+
animatedHeight.setValue(initialH > pivot ? 0 : pivot - initialH);
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
if (currentDelta < 0 && initialH > pivot) {
|
|
863
|
+
const distanceToPivot = pivot - initialH;
|
|
864
|
+
const usedForH = Math.max(currentDelta, distanceToPivot);
|
|
865
|
+
animatedHeight.setValue(usedForH);
|
|
866
|
+
currentDelta -= usedForH;
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
if (currentDelta < 0) {
|
|
871
|
+
animatedHeight.setValue(initialH > pivot ? (pivot - initialH) : 0);
|
|
872
|
+
animatedTranslateY.setValue(-currentDelta);
|
|
873
|
+
scrollOffset.current = 0;
|
|
874
|
+
scrollViewRef.current?.scrollTo({
|
|
875
|
+
y: 0,
|
|
876
|
+
animated: false
|
|
877
|
+
});
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
};
|
|
881
|
+
|
|
882
|
+
const handlePointerUp = () => {
|
|
883
|
+
safeGlobal.removeEventListener("pointermove", handlePointerMove);
|
|
884
|
+
safeGlobal.removeEventListener("pointerup", handlePointerUp);
|
|
885
|
+
|
|
886
|
+
animatedHeight.flattenOffset();
|
|
887
|
+
animatedTranslateY.flattenOffset();
|
|
888
|
+
|
|
889
|
+
const currentT = translateYValue.current;
|
|
890
|
+
const currentH = heightValue.current;
|
|
891
|
+
const pivot = snapPoint ?? contentHeight.current;
|
|
892
|
+
const tavan = maxHeight.current;
|
|
893
|
+
|
|
894
|
+
const isAtTavan = currentH >= tavan - 1;
|
|
895
|
+
const hasScroll = scrollViewContentHeight.current > scrollViewLayoutHeight.current;
|
|
896
|
+
const isAtTop = scrollOffset.current <= 1;
|
|
897
|
+
const isFromTopArea = gestureStartY.current < TOP_GRAB_AREA;
|
|
898
|
+
|
|
899
|
+
if (isAtTavan && hasScroll && !isAtTop && !isFromTopArea) {
|
|
900
|
+
if (Math.abs(velocityY) > 0.1) {
|
|
901
|
+
const momentum = velocityY * -350;
|
|
902
|
+
const maxS = Math.max(0, scrollViewContentHeight.current - scrollViewLayoutHeight.current);
|
|
903
|
+
const targetOffset = Math.max(0, Math.min(scrollOffset.current + momentum, maxS));
|
|
904
|
+
|
|
905
|
+
const scrollAnim = new Animated.Value(scrollOffset.current);
|
|
906
|
+
scrollAnim.addListener(({
|
|
907
|
+
value
|
|
908
|
+
}) => {
|
|
909
|
+
scrollViewRef.current?.scrollTo({
|
|
910
|
+
y: value,
|
|
911
|
+
animated: false
|
|
912
|
+
});
|
|
913
|
+
scrollOffset.current = value;
|
|
914
|
+
});
|
|
915
|
+
|
|
916
|
+
Animated.timing(scrollAnim, {
|
|
917
|
+
toValue: targetOffset,
|
|
918
|
+
duration: Math.min(Math.abs(momentum) * 2, 600),
|
|
919
|
+
easing: Easing.out(Easing.quad),
|
|
920
|
+
useNativeDriver: false
|
|
921
|
+
}).start(() => {
|
|
922
|
+
scrollAnim.removeAllListeners();
|
|
923
|
+
checkScrollThreshold();
|
|
924
|
+
});
|
|
925
|
+
} else {
|
|
926
|
+
checkScrollThreshold();
|
|
927
|
+
}
|
|
928
|
+
return;
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
const isFastSwipeDown = velocityY > 0.5;
|
|
932
|
+
const isFastSwipeUp = velocityY < -0.5;
|
|
933
|
+
|
|
934
|
+
if (currentT <= Math.max(pivot * 0.2, 60)) {
|
|
935
|
+
let toValue = pivot;
|
|
936
|
+
|
|
937
|
+
if (isFastSwipeUp && isCanFullScreenOnSwipeRef.current) {
|
|
938
|
+
toValue = tavan;
|
|
939
|
+
} else if (isFastSwipeDown) {
|
|
940
|
+
toValue = pivot;
|
|
941
|
+
} else {
|
|
942
|
+
if (!isCanFullScreenOnSwipeRef.current) {
|
|
943
|
+
toValue = pivot;
|
|
944
|
+
} else {
|
|
945
|
+
const totalRange = tavan - pivot;
|
|
946
|
+
const distFromPivot = currentH - pivot;
|
|
947
|
+
|
|
948
|
+
if (distFromPivot < totalRange * 0.33) toValue = pivot;
|
|
949
|
+
else if (distFromPivot > totalRange * 0.66) toValue = tavan;
|
|
950
|
+
else toValue = (tavan - currentH) < (currentH - pivot) ? tavan : pivot;
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
Animated.spring(animatedHeight, {
|
|
955
|
+
toValue,
|
|
956
|
+
useNativeDriver: false,
|
|
957
|
+
friction: 10,
|
|
958
|
+
tension: 40
|
|
959
|
+
}).start();
|
|
960
|
+
Animated.spring(animatedTranslateY, {
|
|
961
|
+
toValue: 0,
|
|
962
|
+
useNativeDriver: false,
|
|
963
|
+
friction: 10,
|
|
964
|
+
tension: 40
|
|
965
|
+
}).start();
|
|
966
|
+
} else {
|
|
967
|
+
if (!isSwipeCloseRef.current) {
|
|
968
|
+
Animated.spring(animatedHeight, {
|
|
969
|
+
toValue: pivot,
|
|
970
|
+
useNativeDriver: false,
|
|
971
|
+
friction: 10,
|
|
972
|
+
tension: 40
|
|
973
|
+
}).start();
|
|
974
|
+
Animated.timing(animatedTranslateY, {
|
|
975
|
+
toValue: 0,
|
|
976
|
+
useNativeDriver: false,
|
|
977
|
+
duration: 300
|
|
978
|
+
}).start();
|
|
979
|
+
} else {
|
|
980
|
+
let toValueT = 0;
|
|
981
|
+
let isClosing = false;
|
|
982
|
+
|
|
983
|
+
if (isFastSwipeDown) {
|
|
984
|
+
toValueT = pivot + 100;
|
|
985
|
+
isClosing = true;
|
|
986
|
+
} else {
|
|
987
|
+
if (currentT > pivot * 0.5) {
|
|
988
|
+
toValueT = pivot + 100;
|
|
989
|
+
isClosing = true;
|
|
990
|
+
} else {
|
|
991
|
+
toValueT = 0;
|
|
992
|
+
isClosing = false;
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
if (onClose) onClose({
|
|
997
|
+
id: id.current
|
|
998
|
+
});
|
|
999
|
+
|
|
1000
|
+
Animated.timing(animatedTranslateY, {
|
|
1001
|
+
toValue: toValueT,
|
|
1002
|
+
useNativeDriver: false,
|
|
1003
|
+
duration: 300
|
|
1004
|
+
}).start(({
|
|
1005
|
+
finished
|
|
1006
|
+
}) => {
|
|
1007
|
+
if (finished && isClosing) {
|
|
1008
|
+
setIsActive(false);
|
|
1009
|
+
if (onClosed) onClosed({
|
|
1010
|
+
id: id.current
|
|
1011
|
+
});
|
|
1012
|
+
}
|
|
1013
|
+
});
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
};
|
|
1017
|
+
|
|
1018
|
+
safeGlobal.addEventListener("pointermove", handlePointerMove);
|
|
1019
|
+
safeGlobal.addEventListener("pointerup", handlePointerUp);
|
|
1020
|
+
} : undefined}
|
|
1021
|
+
onLayout={onLayout}
|
|
1022
|
+
style={[
|
|
1023
|
+
{
|
|
1024
|
+
borderTopStartRadius: radiuses.lg,
|
|
1025
|
+
borderTopEndRadius: radiuses.lg
|
|
1026
|
+
},
|
|
1027
|
+
style,
|
|
1028
|
+
{
|
|
1029
|
+
height: (isAutoHeight || !snapPoint) && !isMeasured ? "auto" : animatedHeight,
|
|
1030
|
+
backgroundColor: colors.content.container[backgroundColor],
|
|
1031
|
+
paddingBottom: bottomSafeArea + spaces.spacingMd,
|
|
1032
|
+
opacity: isMeasured || !isAutoHeight ? 1 : 0,
|
|
1033
|
+
paddingRight: spaces.spacingMd,
|
|
1034
|
+
paddingLeft: spaces.spacingMd,
|
|
1035
|
+
paddingTop: spaces.spacingMd,
|
|
1036
|
+
maxHeight: maxHeight.current,
|
|
1037
|
+
transform: [{
|
|
1038
|
+
translateY: animatedTranslateY
|
|
1039
|
+
}]
|
|
1040
|
+
},
|
|
1041
|
+
stylesheet.container,
|
|
1042
|
+
webStyle({
|
|
1043
|
+
touchAction: "none",
|
|
1044
|
+
userSelect: "none",
|
|
1045
|
+
cursor: "grab"
|
|
1046
|
+
})
|
|
1047
|
+
]}
|
|
1048
|
+
>
|
|
1049
|
+
{renderHeader()}
|
|
1050
|
+
<ScrollView
|
|
1051
|
+
{...scrollViewProps}
|
|
1052
|
+
onContentSizeChange={(_, h) => {
|
|
1053
|
+
scrollViewContentHeight.current = h;
|
|
1054
|
+
}}
|
|
1055
|
+
onLayout={(e) => {
|
|
1056
|
+
scrollViewLayoutHeight.current = e.nativeEvent.layout.height;
|
|
1057
|
+
}}
|
|
1058
|
+
onStartShouldSetResponderCapture={() => false}
|
|
1059
|
+
onMoveShouldSetResponderCapture={() => false}
|
|
1060
|
+
showsHorizontalScrollIndicator={false}
|
|
1061
|
+
showsVerticalScrollIndicator={false}
|
|
1062
|
+
scrollEnabled={!isCanSwipe}
|
|
1063
|
+
scrollEventThrottle={1}
|
|
1064
|
+
overScrollMode="never"
|
|
1065
|
+
ref={scrollViewRef}
|
|
1066
|
+
bounces={false}
|
|
1067
|
+
style={[
|
|
1068
|
+
scrollViewStyle,
|
|
1069
|
+
webStyle({
|
|
1070
|
+
maxWidth: windowWidth > 500 ? 500 : undefined,
|
|
1071
|
+
width: windowWidth > 500 ? 500 : undefined,
|
|
1072
|
+
alignSelf: "center"
|
|
1073
|
+
})
|
|
1074
|
+
]}
|
|
1075
|
+
>
|
|
1076
|
+
{children}
|
|
1077
|
+
</ScrollView>
|
|
1078
|
+
{renderBottom()}
|
|
1079
|
+
{renderHandle()}
|
|
1080
|
+
</Animated.View>;
|
|
1081
|
+
};
|
|
1082
|
+
|
|
1083
|
+
const renderHeader = () => {
|
|
1084
|
+
if(!RenderHeaderComponent) {
|
|
1085
|
+
return null;
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
if(Platform.OS === "web") {
|
|
1089
|
+
return <View
|
|
1090
|
+
style={[
|
|
1091
|
+
webStyle({
|
|
1092
|
+
maxWidth: windowWidth > 500 ? 500 : undefined,
|
|
1093
|
+
width: windowWidth > 500 ? 500 : undefined,
|
|
1094
|
+
alignSelf: "center"
|
|
1095
|
+
})
|
|
1096
|
+
]}
|
|
1097
|
+
>
|
|
1098
|
+
{RenderHeaderComponent()}
|
|
1099
|
+
</View>;
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
return RenderHeaderComponent();
|
|
1103
|
+
};
|
|
1104
|
+
|
|
1105
|
+
const renderBottom = () => {
|
|
1106
|
+
if(!RenderBottomComponent) {
|
|
1107
|
+
return null;
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
if(Platform.OS === "web") {
|
|
1111
|
+
return <View
|
|
1112
|
+
style={[
|
|
1113
|
+
webStyle({
|
|
1114
|
+
maxWidth: windowWidth > 500 ? 500 : undefined,
|
|
1115
|
+
width: windowWidth > 500 ? 500 : undefined,
|
|
1116
|
+
alignSelf: "center"
|
|
1117
|
+
})
|
|
1118
|
+
]}
|
|
1119
|
+
>
|
|
1120
|
+
<RenderBottomComponent/>
|
|
1121
|
+
</View>;
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
return <RenderBottomComponent/>;
|
|
1125
|
+
};
|
|
1126
|
+
|
|
1127
|
+
const renderHandle = () => {
|
|
1128
|
+
if(!isShowHandle || isWorkAsFullScreen) {
|
|
1129
|
+
return null;
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
const handleHeight = handleHeightProp ? handleHeightProp : 8;
|
|
1133
|
+
const handleContainerHeight = handleHeight + ((handleContainerSpacing ? spaces[handleContainerSpacing] : spaces.spacingSm) * 2);
|
|
1134
|
+
const handleBorderRadius = Math.ceil(handleHeight / 2);
|
|
1135
|
+
|
|
1136
|
+
return <View
|
|
1137
|
+
onStartShouldSetResponderCapture={() => Platform.OS === "web"}
|
|
1138
|
+
onMoveShouldSetResponderCapture={() => Platform.OS === "web"}
|
|
1139
|
+
style={[
|
|
1140
|
+
stylesheet.handleContainer,
|
|
1141
|
+
{
|
|
1142
|
+
backgroundColor: handleContainerBackgroundColor
|
|
1143
|
+
? colors.content.container[handleContainerBackgroundColor]
|
|
1144
|
+
: "transparent",
|
|
1145
|
+
height: handleContainerHeight,
|
|
1146
|
+
transform: [{
|
|
1147
|
+
translateY: -handleContainerHeight * (Platform.OS === "web" ? 1.75 : 1)
|
|
1148
|
+
}]
|
|
1149
|
+
},
|
|
1150
|
+
webStyle({
|
|
1151
|
+
touchAction: "none !important",
|
|
1152
|
+
userSelect: "none",
|
|
1153
|
+
cursor: "grab"
|
|
1154
|
+
})
|
|
1155
|
+
]}
|
|
1156
|
+
>
|
|
1157
|
+
<View
|
|
1158
|
+
style={[
|
|
1159
|
+
stylesheet.handle,
|
|
1160
|
+
{
|
|
1161
|
+
backgroundColor: handleBackgroundColor
|
|
1162
|
+
? colors.content.container[handleBackgroundColor]
|
|
1163
|
+
: colors.content.container.default,
|
|
1164
|
+
borderRadius: handleBorderRadius,
|
|
1165
|
+
height: handleHeight
|
|
1166
|
+
}
|
|
1167
|
+
]}
|
|
1168
|
+
/>
|
|
1169
|
+
</View>;
|
|
1170
|
+
};
|
|
1171
|
+
|
|
1172
|
+
return <Modal
|
|
1173
|
+
{...modalProps}
|
|
1174
|
+
portalName={portalName ? portalName : "bottomSheet-system"}
|
|
1175
|
+
isWorkWithPortal={isWorkWithPortal}
|
|
1176
|
+
key={`${bottomSheetKey}-modal`}
|
|
1177
|
+
isContentRequired={false}
|
|
1178
|
+
isActive={isActive}
|
|
1179
|
+
alignContent="free"
|
|
1180
|
+
isAnimated={false}
|
|
1181
|
+
id={id.current}
|
|
1182
|
+
ref={modalRef}
|
|
1183
|
+
onContainerLayout={(e) => {
|
|
1184
|
+
const containerLayoutHeight = e.nativeEvent.layout.height;
|
|
1185
|
+
|
|
1186
|
+
if (containerLayoutHeight && containerLayoutHeight !== containerHeightRef.current) {
|
|
1187
|
+
containerHeightRef.current = containerLayoutHeight;
|
|
1188
|
+
|
|
1189
|
+
if (!isWorkAsFullScreen && !isCanFullScreenOnSwipe && snapPoint) {
|
|
1190
|
+
maxHeight.current = snapPoint;
|
|
1191
|
+
} else if (!isWorkAsFullScreen) {
|
|
1192
|
+
maxHeight.current = containerLayoutHeight - (isForceFullScreenOnSwipe ? 0 : isWrapSafeAreaContext ? topSafeArea : 0);
|
|
1193
|
+
} else {
|
|
1194
|
+
maxHeight.current = containerLayoutHeight;
|
|
1195
|
+
}
|
|
1196
|
+
}
|
|
1197
|
+
}}
|
|
1198
|
+
overlayProps={{
|
|
1199
|
+
onStartShouldSetResponderCapture: () => false,
|
|
1200
|
+
onMoveShouldSetResponderCapture: () => false
|
|
1201
|
+
}}
|
|
1202
|
+
onOverlayPress={() => {
|
|
1203
|
+
if(onOverlayPressed) onOverlayPressed();
|
|
1204
|
+
|
|
1205
|
+
if(isCloseOnOverlay) {
|
|
1206
|
+
closeAnimation();
|
|
1207
|
+
}
|
|
1208
|
+
}}
|
|
1209
|
+
style={[
|
|
1210
|
+
{
|
|
1211
|
+
paddingTop: topSafeArea
|
|
1212
|
+
}
|
|
1213
|
+
]}
|
|
1214
|
+
>
|
|
1215
|
+
{renderView()}
|
|
1216
|
+
</Modal>;
|
|
1217
|
+
};
|
|
1218
|
+
export default forwardRef(BottomSheet);
|