@arkyn/components 3.0.1-beta.20 → 3.0.1-beta.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.js +1112 -1737
- package/dist/bundle.umd.cjs +1 -30
- package/dist/components/alert/alertContainer/index.d.ts.map +1 -0
- package/dist/{src/components → components}/alert/alertContainer/index.js +4 -1
- package/dist/components/alert/alertContent/index.d.ts.map +1 -0
- package/dist/components/alert/alertDescription/index.d.ts.map +1 -0
- package/dist/components/alert/alertIcon/index.d.ts.map +1 -0
- package/dist/components/alert/alertTitle/index.d.ts.map +1 -0
- package/dist/components/audioPlayer/index.d.ts.map +1 -0
- package/dist/components/badge/index.d.ts.map +1 -0
- package/dist/components/button/index.d.ts.map +1 -0
- package/dist/components/cardTab/cardTabButton/index.d.ts.map +1 -0
- package/dist/components/cardTab/cardTabContainer/index.d.ts.map +1 -0
- package/dist/components/cardTab/cardTabContext.d.ts.map +1 -0
- package/dist/components/checkbox/index.d.ts.map +1 -0
- package/dist/components/currencyInput/index.d.ts.map +1 -0
- package/dist/components/divider/index.d.ts.map +1 -0
- package/dist/components/drawer/drawerContainer/index.d.ts.map +1 -0
- package/dist/components/drawer/drawerContext.d.ts.map +1 -0
- package/dist/components/drawer/drawerHeader/index.d.ts.map +1 -0
- package/dist/components/fieldError/index.d.ts.map +1 -0
- package/dist/components/fieldLabel/index.d.ts.map +1 -0
- package/dist/components/fieldWrapper/index.d.ts.map +1 -0
- package/dist/components/iconButton/index.d.ts.map +1 -0
- package/dist/components/input/index.d.ts.map +1 -0
- package/dist/components/maskedInput/index.d.ts.map +1 -0
- package/dist/components/modal/modalContainer/index.d.ts.map +1 -0
- package/dist/components/modal/modalContext.d.ts.map +1 -0
- package/dist/components/modal/modalFooter/index.d.ts.map +1 -0
- package/dist/components/modal/modalHeader/index.d.ts.map +1 -0
- package/dist/components/multiSelect/index.d.ts.map +1 -0
- package/dist/components/multiSelect/multiSelectChevron/index.d.ts.map +1 -0
- package/dist/components/multiSelect/multiSelectContainer/index.d.ts.map +1 -0
- package/dist/components/multiSelect/multiSelectContent/index.d.ts.map +1 -0
- package/dist/components/multiSelect/multiSelectMark/index.d.ts.map +1 -0
- package/dist/components/multiSelect/multiSelectOption/index.d.ts.map +1 -0
- package/dist/components/multiSelect/multiSelectOptionsContainer/index.d.ts.map +1 -0
- package/dist/components/multiSelect/multiSelectOverlay/index.d.ts.map +1 -0
- package/dist/components/multiSelect/multiSelectSpinner/index.d.ts.map +1 -0
- package/dist/components/phoneInput/index.d.ts.map +1 -0
- package/dist/components/phoneInput/phoneInputContainer/index.d.ts.map +1 -0
- package/dist/components/phoneInput/phoneInputCountriesOverlay/index.d.ts.map +1 -0
- package/dist/components/phoneInput/phoneInputCountryOption/index.d.ts.map +1 -0
- package/dist/components/phoneInput/phoneInputCountryOptionsContainer/index.d.ts.map +1 -0
- package/dist/components/phoneInput/phoneInputCountrySelector/index.d.ts.map +1 -0
- package/dist/components/phoneInput/phoneInputMask/index.d.ts.map +1 -0
- package/dist/components/radio/radioBox/index.d.ts.map +1 -0
- package/dist/components/radio/radioContext.d.ts.map +1 -0
- package/dist/components/radio/radioGroup/index.d.ts.map +1 -0
- package/dist/components/slider/index.d.ts.map +1 -0
- package/dist/components/switch/index.d.ts.map +1 -0
- package/dist/components/tab/tabButton/index.d.ts.map +1 -0
- package/dist/components/tab/tabContainer/index.d.ts.map +1 -0
- package/dist/components/tab/tabContext.d.ts.map +1 -0
- package/dist/components/textarea/index.d.ts.map +1 -0
- package/dist/components/tooltip/index.d.ts.map +1 -0
- package/dist/hooks/useForm.d.ts.map +1 -0
- package/dist/hooks/useScopedParams.d.ts.map +1 -0
- package/dist/hooks/useScrollLock.d.ts.map +1 -0
- package/dist/hooks/useSlider.d.ts.map +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/providers/formProvider.d.ts.map +1 -0
- package/dist/services/iconRenderer.d.ts.map +1 -0
- package/dist/services/maskCurrencyValues.d.ts.map +1 -0
- package/dist/{src/utils → utils}/phoneInputUtilities.d.ts.map +1 -1
- package/package.json +5 -5
- package/dist/documentation/src/app.d.ts +0 -3
- package/dist/documentation/src/app.d.ts.map +0 -1
- package/dist/documentation/src/app.js +0 -55
- package/dist/documentation/src/components/examples.alert.d.ts +0 -3
- package/dist/documentation/src/components/examples.alert.d.ts.map +0 -1
- package/dist/documentation/src/components/examples.alert.js +0 -7
- package/dist/documentation/src/components/examples.audioPlayer.d.ts +0 -3
- package/dist/documentation/src/components/examples.audioPlayer.d.ts.map +0 -1
- package/dist/documentation/src/components/examples.audioPlayer.js +0 -8
- package/dist/documentation/src/components/examples.badge.d.ts +0 -3
- package/dist/documentation/src/components/examples.badge.d.ts.map +0 -1
- package/dist/documentation/src/components/examples.badge.js +0 -9
- package/dist/documentation/src/components/examples.button.d.ts +0 -3
- package/dist/documentation/src/components/examples.button.d.ts.map +0 -1
- package/dist/documentation/src/components/examples.button.js +0 -9
- package/dist/documentation/src/components/examples.cardTab.d.ts +0 -3
- package/dist/documentation/src/components/examples.cardTab.d.ts.map +0 -1
- package/dist/documentation/src/components/examples.cardTab.js +0 -7
- package/dist/documentation/src/components/examples.checkbox.d.ts +0 -3
- package/dist/documentation/src/components/examples.checkbox.d.ts.map +0 -1
- package/dist/documentation/src/components/examples.checkbox.js +0 -13
- package/dist/documentation/src/components/examples.currencyInput.d.ts +0 -3
- package/dist/documentation/src/components/examples.currencyInput.d.ts.map +0 -1
- package/dist/documentation/src/components/examples.currencyInput.js +0 -9
- package/dist/documentation/src/components/examples.divider.d.ts +0 -3
- package/dist/documentation/src/components/examples.divider.d.ts.map +0 -1
- package/dist/documentation/src/components/examples.divider.js +0 -7
- package/dist/documentation/src/components/examples.drawer.d.ts +0 -3
- package/dist/documentation/src/components/examples.drawer.d.ts.map +0 -1
- package/dist/documentation/src/components/examples.drawer.js +0 -11
- package/dist/documentation/src/components/examples.iconButton.d.ts +0 -3
- package/dist/documentation/src/components/examples.iconButton.d.ts.map +0 -1
- package/dist/documentation/src/components/examples.iconButton.js +0 -9
- package/dist/documentation/src/components/examples.input.d.ts +0 -3
- package/dist/documentation/src/components/examples.input.d.ts.map +0 -1
- package/dist/documentation/src/components/examples.input.js +0 -9
- package/dist/documentation/src/components/examples.maskedInput.d.ts +0 -3
- package/dist/documentation/src/components/examples.maskedInput.d.ts.map +0 -1
- package/dist/documentation/src/components/examples.maskedInput.js +0 -9
- package/dist/documentation/src/components/examples.modal.d.ts +0 -3
- package/dist/documentation/src/components/examples.modal.d.ts.map +0 -1
- package/dist/documentation/src/components/examples.modal.js +0 -10
- package/dist/documentation/src/components/examples.multiSelect.d.ts +0 -3
- package/dist/documentation/src/components/examples.multiSelect.d.ts.map +0 -1
- package/dist/documentation/src/components/examples.multiSelect.js +0 -92
- package/dist/documentation/src/components/examples.phoneInput.d.ts +0 -3
- package/dist/documentation/src/components/examples.phoneInput.d.ts.map +0 -1
- package/dist/documentation/src/components/examples.phoneInput.js +0 -26
- package/dist/documentation/src/components/examples.radio.d.ts +0 -3
- package/dist/documentation/src/components/examples.radio.d.ts.map +0 -1
- package/dist/documentation/src/components/examples.radio.js +0 -11
- package/dist/documentation/src/components/examples.slider.d.ts +0 -3
- package/dist/documentation/src/components/examples.slider.d.ts.map +0 -1
- package/dist/documentation/src/components/examples.slider.js +0 -10
- package/dist/documentation/src/components/examples.switch.d.ts +0 -3
- package/dist/documentation/src/components/examples.switch.d.ts.map +0 -1
- package/dist/documentation/src/components/examples.switch.js +0 -20
- package/dist/documentation/src/components/examples.tab.d.ts +0 -3
- package/dist/documentation/src/components/examples.tab.d.ts.map +0 -1
- package/dist/documentation/src/components/examples.tab.js +0 -7
- package/dist/documentation/src/components/examples.texarea.d.ts +0 -3
- package/dist/documentation/src/components/examples.texarea.d.ts.map +0 -1
- package/dist/documentation/src/components/examples.texarea.js +0 -34
- package/dist/documentation/src/components/examples.tooltip.d.ts +0 -3
- package/dist/documentation/src/components/examples.tooltip.d.ts.map +0 -1
- package/dist/documentation/src/components/examples.tooltip.js +0 -8
- package/dist/documentation/src/main.d.ts +0 -3
- package/dist/documentation/src/main.d.ts.map +0 -1
- package/dist/documentation/src/main.js +0 -7
- package/dist/documentation/src/ui/box.d.ts +0 -8
- package/dist/documentation/src/ui/box.d.ts.map +0 -1
- package/dist/documentation/src/ui/box.js +0 -5
- package/dist/documentation/src/ui/row.d.ts +0 -7
- package/dist/documentation/src/ui/row.d.ts.map +0 -1
- package/dist/documentation/src/ui/row.js +0 -5
- package/dist/documentation/vite.config.d.ts +0 -3
- package/dist/documentation/vite.config.d.ts.map +0 -1
- package/dist/documentation/vite.config.js +0 -12
- package/dist/src/components/alert/alertContainer/index.d.ts.map +0 -1
- package/dist/src/components/alert/alertContent/index.d.ts.map +0 -1
- package/dist/src/components/alert/alertDescription/index.d.ts.map +0 -1
- package/dist/src/components/alert/alertIcon/index.d.ts.map +0 -1
- package/dist/src/components/alert/alertTitle/index.d.ts.map +0 -1
- package/dist/src/components/audioPlayer/index.d.ts.map +0 -1
- package/dist/src/components/badge/index.d.ts.map +0 -1
- package/dist/src/components/button/index.d.ts.map +0 -1
- package/dist/src/components/cardTab/cardTabButton/index.d.ts.map +0 -1
- package/dist/src/components/cardTab/cardTabContainer/index.d.ts.map +0 -1
- package/dist/src/components/cardTab/cardTabContext.d.ts.map +0 -1
- package/dist/src/components/checkbox/index.d.ts.map +0 -1
- package/dist/src/components/currencyInput/index.d.ts.map +0 -1
- package/dist/src/components/divider/index.d.ts.map +0 -1
- package/dist/src/components/drawer/drawerContainer/index.d.ts.map +0 -1
- package/dist/src/components/drawer/drawerContext.d.ts.map +0 -1
- package/dist/src/components/drawer/drawerHeader/index.d.ts.map +0 -1
- package/dist/src/components/fieldError/index.d.ts.map +0 -1
- package/dist/src/components/fieldLabel/index.d.ts.map +0 -1
- package/dist/src/components/fieldWrapper/index.d.ts.map +0 -1
- package/dist/src/components/iconButton/index.d.ts.map +0 -1
- package/dist/src/components/input/index.d.ts.map +0 -1
- package/dist/src/components/maskedInput/index.d.ts.map +0 -1
- package/dist/src/components/modal/modalContainer/index.d.ts.map +0 -1
- package/dist/src/components/modal/modalContext.d.ts.map +0 -1
- package/dist/src/components/modal/modalFooter/index.d.ts.map +0 -1
- package/dist/src/components/modal/modalHeader/index.d.ts.map +0 -1
- package/dist/src/components/multiSelect/index.d.ts.map +0 -1
- package/dist/src/components/multiSelect/multiSelectChevron/index.d.ts.map +0 -1
- package/dist/src/components/multiSelect/multiSelectContainer/index.d.ts.map +0 -1
- package/dist/src/components/multiSelect/multiSelectContent/index.d.ts.map +0 -1
- package/dist/src/components/multiSelect/multiSelectMark/index.d.ts.map +0 -1
- package/dist/src/components/multiSelect/multiSelectOption/index.d.ts.map +0 -1
- package/dist/src/components/multiSelect/multiSelectOptionsContainer/index.d.ts.map +0 -1
- package/dist/src/components/multiSelect/multiSelectOverlay/index.d.ts.map +0 -1
- package/dist/src/components/multiSelect/multiSelectSpinner/index.d.ts.map +0 -1
- package/dist/src/components/phoneInput/index.d.ts.map +0 -1
- package/dist/src/components/phoneInput/phoneInputContainer/index.d.ts.map +0 -1
- package/dist/src/components/phoneInput/phoneInputCountriesOverlay/index.d.ts.map +0 -1
- package/dist/src/components/phoneInput/phoneInputCountryOption/index.d.ts.map +0 -1
- package/dist/src/components/phoneInput/phoneInputCountryOptionsContainer/index.d.ts.map +0 -1
- package/dist/src/components/phoneInput/phoneInputCountrySelector/index.d.ts.map +0 -1
- package/dist/src/components/phoneInput/phoneInputMask/index.d.ts.map +0 -1
- package/dist/src/components/radio/radioBox/index.d.ts.map +0 -1
- package/dist/src/components/radio/radioContext.d.ts.map +0 -1
- package/dist/src/components/radio/radioGroup/index.d.ts.map +0 -1
- package/dist/src/components/slider/index.d.ts.map +0 -1
- package/dist/src/components/switch/index.d.ts.map +0 -1
- package/dist/src/components/tab/tabButton/index.d.ts.map +0 -1
- package/dist/src/components/tab/tabContainer/index.d.ts.map +0 -1
- package/dist/src/components/tab/tabContext.d.ts.map +0 -1
- package/dist/src/components/textarea/index.d.ts.map +0 -1
- package/dist/src/components/tooltip/index.d.ts.map +0 -1
- package/dist/src/hooks/useForm.d.ts.map +0 -1
- package/dist/src/hooks/useScopedParams.d.ts.map +0 -1
- package/dist/src/hooks/useScrollLock.d.ts.map +0 -1
- package/dist/src/hooks/useSlider.d.ts.map +0 -1
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/providers/formProvider.d.ts.map +0 -1
- package/dist/src/services/iconRenderer.d.ts.map +0 -1
- package/dist/src/services/maskCurrencyValues.d.ts.map +0 -1
- package/dist/vite.config.d.ts +0 -3
- package/dist/vite.config.d.ts.map +0 -1
- package/dist/vite.config.js +0 -24
- package/dist/vitest.config.d.ts +0 -3
- package/dist/vitest.config.d.ts.map +0 -1
- package/dist/vitest.config.js +0 -4
- package/documentation/css/reset.css +0 -38
- package/documentation/css/variables.css +0 -41
- package/documentation/index.html +0 -13
- package/documentation/src/app.tsx +0 -93
- package/documentation/src/components/examples.alert.tsx +0 -49
- package/documentation/src/components/examples.audioPlayer.tsx +0 -16
- package/documentation/src/components/examples.badge.tsx +0 -38
- package/documentation/src/components/examples.button.tsx +0 -66
- package/documentation/src/components/examples.cardTab.tsx +0 -36
- package/documentation/src/components/examples.checkbox.tsx +0 -94
- package/documentation/src/components/examples.currencyInput.tsx +0 -263
- package/documentation/src/components/examples.divider.tsx +0 -12
- package/documentation/src/components/examples.drawer.tsx +0 -43
- package/documentation/src/components/examples.iconButton.tsx +0 -78
- package/documentation/src/components/examples.input.tsx +0 -256
- package/documentation/src/components/examples.maskedInput.tsx +0 -274
- package/documentation/src/components/examples.modal.tsx +0 -31
- package/documentation/src/components/examples.multiSelect.tsx +0 -320
- package/documentation/src/components/examples.phoneInput.tsx +0 -262
- package/documentation/src/components/examples.radio.tsx +0 -149
- package/documentation/src/components/examples.slider.tsx +0 -28
- package/documentation/src/components/examples.switch.tsx +0 -180
- package/documentation/src/components/examples.tab.tsx +0 -36
- package/documentation/src/components/examples.texarea.tsx +0 -188
- package/documentation/src/components/examples.tooltip.tsx +0 -45
- package/documentation/src/main.tsx +0 -12
- package/documentation/src/ui/box.tsx +0 -17
- package/documentation/src/ui/row.tsx +0 -11
- package/documentation/vite.config.ts +0 -13
- package/src/components/alert/alertContainer/index.tsx +0 -87
- package/src/components/alert/alertContainer/styles.css +0 -33
- package/src/components/alert/alertContent/index.tsx +0 -53
- package/src/components/alert/alertContent/styles.css +0 -5
- package/src/components/alert/alertDescription/index.tsx +0 -57
- package/src/components/alert/alertDescription/styles.css +0 -7
- package/src/components/alert/alertIcon/index.tsx +0 -79
- package/src/components/alert/alertIcon/styles.css +0 -23
- package/src/components/alert/alertTitle/index.tsx +0 -54
- package/src/components/alert/alertTitle/styles.css +0 -7
- package/src/components/audioPlayer/index.tsx +0 -187
- package/src/components/audioPlayer/styles.css +0 -50
- package/src/components/badge/index.tsx +0 -80
- package/src/components/badge/styles.css +0 -145
- package/src/components/button/index.tsx +0 -104
- package/src/components/button/styles.css +0 -208
- package/src/components/cardTab/cardTabButton/index.tsx +0 -114
- package/src/components/cardTab/cardTabButton/styles.css +0 -30
- package/src/components/cardTab/cardTabContainer/index.tsx +0 -121
- package/src/components/cardTab/cardTabContainer/styles.css +0 -9
- package/src/components/cardTab/cardTabContext.tsx +0 -30
- package/src/components/checkbox/index.tsx +0 -158
- package/src/components/checkbox/styles.css +0 -78
- package/src/components/currencyInput/index.tsx +0 -312
- package/src/components/currencyInput/style.css +0 -226
- package/src/components/divider/index.tsx +0 -58
- package/src/components/divider/styles.css +0 -17
- package/src/components/drawer/drawerContainer/index.tsx +0 -123
- package/src/components/drawer/drawerContainer/styles.css +0 -46
- package/src/components/drawer/drawerContext.tsx +0 -26
- package/src/components/drawer/drawerHeader/index.tsx +0 -88
- package/src/components/drawer/drawerHeader/styles.css +0 -38
- package/src/components/fieldError/index.tsx +0 -43
- package/src/components/fieldError/styles.css +0 -6
- package/src/components/fieldLabel/index.tsx +0 -52
- package/src/components/fieldLabel/styles.css +0 -15
- package/src/components/fieldWrapper/index.tsx +0 -54
- package/src/components/fieldWrapper/styles.css +0 -7
- package/src/components/iconButton/index.tsx +0 -83
- package/src/components/iconButton/styles.css +0 -166
- package/src/components/input/index.tsx +0 -233
- package/src/components/input/style.css +0 -226
- package/src/components/maskedInput/index.tsx +0 -260
- package/src/components/maskedInput/style.css +0 -226
- package/src/components/modal/modalContainer/index.tsx +0 -127
- package/src/components/modal/modalContainer/styles.css +0 -37
- package/src/components/modal/modalContext.tsx +0 -26
- package/src/components/modal/modalFooter/index.tsx +0 -80
- package/src/components/modal/modalFooter/styles.css +0 -27
- package/src/components/modal/modalHeader/index.tsx +0 -99
- package/src/components/modal/modalHeader/styles.css +0 -38
- package/src/components/multiSelect/index.tsx +0 -319
- package/src/components/multiSelect/multiSelectChevron/index.tsx +0 -26
- package/src/components/multiSelect/multiSelectChevron/styles.css +0 -7
- package/src/components/multiSelect/multiSelectContainer/index.tsx +0 -51
- package/src/components/multiSelect/multiSelectContainer/styles.css +0 -134
- package/src/components/multiSelect/multiSelectContent/index.tsx +0 -15
- package/src/components/multiSelect/multiSelectContent/styles.css +0 -24
- package/src/components/multiSelect/multiSelectMark/index.tsx +0 -32
- package/src/components/multiSelect/multiSelectMark/styles.css +0 -44
- package/src/components/multiSelect/multiSelectOption/index.tsx +0 -25
- package/src/components/multiSelect/multiSelectOption/styles.css +0 -37
- package/src/components/multiSelect/multiSelectOptionsContainer/index.tsx +0 -81
- package/src/components/multiSelect/multiSelectOptionsContainer/styles.css +0 -45
- package/src/components/multiSelect/multiSelectOverlay/index.tsx +0 -14
- package/src/components/multiSelect/multiSelectOverlay/styles.css +0 -8
- package/src/components/multiSelect/multiSelectSpinner/index.tsx +0 -22
- package/src/components/multiSelect/multiSelectSpinner/styles.css +0 -12
- package/src/components/phoneInput/index.tsx +0 -332
- package/src/components/phoneInput/phoneInputContainer/index.tsx +0 -46
- package/src/components/phoneInput/phoneInputContainer/styles.css +0 -59
- package/src/components/phoneInput/phoneInputCountriesOverlay/index.tsx +0 -16
- package/src/components/phoneInput/phoneInputCountriesOverlay/styles.css +0 -8
- package/src/components/phoneInput/phoneInputCountryOption/index.tsx +0 -35
- package/src/components/phoneInput/phoneInputCountryOption/styles.css +0 -50
- package/src/components/phoneInput/phoneInputCountryOptionsContainer/index.tsx +0 -77
- package/src/components/phoneInput/phoneInputCountryOptionsContainer/styles.css +0 -59
- package/src/components/phoneInput/phoneInputCountrySelector/index.tsx +0 -37
- package/src/components/phoneInput/phoneInputCountrySelector/styles.css +0 -26
- package/src/components/phoneInput/phoneInputMask/index.tsx +0 -105
- package/src/components/phoneInput/phoneInputMask/style.css +0 -36
- package/src/components/radio/radioBox/index.tsx +0 -124
- package/src/components/radio/radioBox/styles.css +0 -95
- package/src/components/radio/radioContext.tsx +0 -34
- package/src/components/radio/radioGroup/index.tsx +0 -150
- package/src/components/radio/radioGroup/styles.css +0 -5
- package/src/components/slider/index.tsx +0 -132
- package/src/components/slider/styles.css +0 -45
- package/src/components/switch/index.tsx +0 -156
- package/src/components/switch/styles.css +0 -90
- package/src/components/tab/tabButton/index.tsx +0 -114
- package/src/components/tab/tabButton/styles.css +0 -41
- package/src/components/tab/tabContainer/index.tsx +0 -121
- package/src/components/tab/tabContainer/styles.css +0 -11
- package/src/components/tab/tabContext.tsx +0 -28
- package/src/components/textarea/index.tsx +0 -193
- package/src/components/textarea/styles.css +0 -93
- package/src/components/tooltip/index.tsx +0 -172
- package/src/components/tooltip/styles.css +0 -112
- package/src/hooks/useForm.ts +0 -55
- package/src/hooks/useScopedParams.ts +0 -111
- package/src/hooks/useScrollLock.ts +0 -52
- package/src/hooks/useSlider.ts +0 -52
- package/src/index.ts +0 -44
- package/src/providers/formProvider.tsx +0 -88
- package/src/services/iconRenderer.tsx +0 -23
- package/src/services/maskCurrencyValues.ts +0 -54
- package/src/utils/phoneInputUtilities.ts +0 -138
- package/tsconfig.json +0 -35
- package/variables.css +0 -41
- package/vite.config.ts +0 -24
- package/vitest.config.ts +0 -5
- /package/dist/{src/components → components}/alert/alertContainer/index.d.ts +0 -0
- /package/dist/{src/components → components}/alert/alertContent/index.d.ts +0 -0
- /package/dist/{src/components → components}/alert/alertContent/index.js +0 -0
- /package/dist/{src/components → components}/alert/alertDescription/index.d.ts +0 -0
- /package/dist/{src/components → components}/alert/alertDescription/index.js +0 -0
- /package/dist/{src/components → components}/alert/alertIcon/index.d.ts +0 -0
- /package/dist/{src/components → components}/alert/alertIcon/index.js +0 -0
- /package/dist/{src/components → components}/alert/alertTitle/index.d.ts +0 -0
- /package/dist/{src/components → components}/alert/alertTitle/index.js +0 -0
- /package/dist/{src/components → components}/audioPlayer/index.d.ts +0 -0
- /package/dist/{src/components → components}/audioPlayer/index.js +0 -0
- /package/dist/{src/components → components}/badge/index.d.ts +0 -0
- /package/dist/{src/components → components}/badge/index.js +0 -0
- /package/dist/{src/components → components}/button/index.d.ts +0 -0
- /package/dist/{src/components → components}/button/index.js +0 -0
- /package/dist/{src/components → components}/cardTab/cardTabButton/index.d.ts +0 -0
- /package/dist/{src/components → components}/cardTab/cardTabButton/index.js +0 -0
- /package/dist/{src/components → components}/cardTab/cardTabContainer/index.d.ts +0 -0
- /package/dist/{src/components → components}/cardTab/cardTabContainer/index.js +0 -0
- /package/dist/{src/components → components}/cardTab/cardTabContext.d.ts +0 -0
- /package/dist/{src/components → components}/cardTab/cardTabContext.js +0 -0
- /package/dist/{src/components → components}/checkbox/index.d.ts +0 -0
- /package/dist/{src/components → components}/checkbox/index.js +0 -0
- /package/dist/{src/components → components}/currencyInput/index.d.ts +0 -0
- /package/dist/{src/components → components}/currencyInput/index.js +0 -0
- /package/dist/{src/components → components}/divider/index.d.ts +0 -0
- /package/dist/{src/components → components}/divider/index.js +0 -0
- /package/dist/{src/components → components}/drawer/drawerContainer/index.d.ts +0 -0
- /package/dist/{src/components → components}/drawer/drawerContainer/index.js +0 -0
- /package/dist/{src/components → components}/drawer/drawerContext.d.ts +0 -0
- /package/dist/{src/components → components}/drawer/drawerContext.js +0 -0
- /package/dist/{src/components → components}/drawer/drawerHeader/index.d.ts +0 -0
- /package/dist/{src/components → components}/drawer/drawerHeader/index.js +0 -0
- /package/dist/{src/components → components}/fieldError/index.d.ts +0 -0
- /package/dist/{src/components → components}/fieldError/index.js +0 -0
- /package/dist/{src/components → components}/fieldLabel/index.d.ts +0 -0
- /package/dist/{src/components → components}/fieldLabel/index.js +0 -0
- /package/dist/{src/components → components}/fieldWrapper/index.d.ts +0 -0
- /package/dist/{src/components → components}/fieldWrapper/index.js +0 -0
- /package/dist/{src/components → components}/iconButton/index.d.ts +0 -0
- /package/dist/{src/components → components}/iconButton/index.js +0 -0
- /package/dist/{src/components → components}/input/index.d.ts +0 -0
- /package/dist/{src/components → components}/input/index.js +0 -0
- /package/dist/{src/components → components}/maskedInput/index.d.ts +0 -0
- /package/dist/{src/components → components}/maskedInput/index.js +0 -0
- /package/dist/{src/components → components}/modal/modalContainer/index.d.ts +0 -0
- /package/dist/{src/components → components}/modal/modalContainer/index.js +0 -0
- /package/dist/{src/components → components}/modal/modalContext.d.ts +0 -0
- /package/dist/{src/components → components}/modal/modalContext.js +0 -0
- /package/dist/{src/components → components}/modal/modalFooter/index.d.ts +0 -0
- /package/dist/{src/components → components}/modal/modalFooter/index.js +0 -0
- /package/dist/{src/components → components}/modal/modalHeader/index.d.ts +0 -0
- /package/dist/{src/components → components}/modal/modalHeader/index.js +0 -0
- /package/dist/{src/components → components}/multiSelect/index.d.ts +0 -0
- /package/dist/{src/components → components}/multiSelect/index.js +0 -0
- /package/dist/{src/components → components}/multiSelect/multiSelectChevron/index.d.ts +0 -0
- /package/dist/{src/components → components}/multiSelect/multiSelectChevron/index.js +0 -0
- /package/dist/{src/components → components}/multiSelect/multiSelectContainer/index.d.ts +0 -0
- /package/dist/{src/components → components}/multiSelect/multiSelectContainer/index.js +0 -0
- /package/dist/{src/components → components}/multiSelect/multiSelectContent/index.d.ts +0 -0
- /package/dist/{src/components → components}/multiSelect/multiSelectContent/index.js +0 -0
- /package/dist/{src/components → components}/multiSelect/multiSelectMark/index.d.ts +0 -0
- /package/dist/{src/components → components}/multiSelect/multiSelectMark/index.js +0 -0
- /package/dist/{src/components → components}/multiSelect/multiSelectOption/index.d.ts +0 -0
- /package/dist/{src/components → components}/multiSelect/multiSelectOption/index.js +0 -0
- /package/dist/{src/components → components}/multiSelect/multiSelectOptionsContainer/index.d.ts +0 -0
- /package/dist/{src/components → components}/multiSelect/multiSelectOptionsContainer/index.js +0 -0
- /package/dist/{src/components → components}/multiSelect/multiSelectOverlay/index.d.ts +0 -0
- /package/dist/{src/components → components}/multiSelect/multiSelectOverlay/index.js +0 -0
- /package/dist/{src/components → components}/multiSelect/multiSelectSpinner/index.d.ts +0 -0
- /package/dist/{src/components → components}/multiSelect/multiSelectSpinner/index.js +0 -0
- /package/dist/{src/components → components}/phoneInput/index.d.ts +0 -0
- /package/dist/{src/components → components}/phoneInput/index.js +0 -0
- /package/dist/{src/components → components}/phoneInput/phoneInputContainer/index.d.ts +0 -0
- /package/dist/{src/components → components}/phoneInput/phoneInputContainer/index.js +0 -0
- /package/dist/{src/components → components}/phoneInput/phoneInputCountriesOverlay/index.d.ts +0 -0
- /package/dist/{src/components → components}/phoneInput/phoneInputCountriesOverlay/index.js +0 -0
- /package/dist/{src/components → components}/phoneInput/phoneInputCountryOption/index.d.ts +0 -0
- /package/dist/{src/components → components}/phoneInput/phoneInputCountryOption/index.js +0 -0
- /package/dist/{src/components → components}/phoneInput/phoneInputCountryOptionsContainer/index.d.ts +0 -0
- /package/dist/{src/components → components}/phoneInput/phoneInputCountryOptionsContainer/index.js +0 -0
- /package/dist/{src/components → components}/phoneInput/phoneInputCountrySelector/index.d.ts +0 -0
- /package/dist/{src/components → components}/phoneInput/phoneInputCountrySelector/index.js +0 -0
- /package/dist/{src/components → components}/phoneInput/phoneInputMask/index.d.ts +0 -0
- /package/dist/{src/components → components}/phoneInput/phoneInputMask/index.js +0 -0
- /package/dist/{src/components → components}/radio/radioBox/index.d.ts +0 -0
- /package/dist/{src/components → components}/radio/radioBox/index.js +0 -0
- /package/dist/{src/components → components}/radio/radioContext.d.ts +0 -0
- /package/dist/{src/components → components}/radio/radioContext.js +0 -0
- /package/dist/{src/components → components}/radio/radioGroup/index.d.ts +0 -0
- /package/dist/{src/components → components}/radio/radioGroup/index.js +0 -0
- /package/dist/{src/components → components}/slider/index.d.ts +0 -0
- /package/dist/{src/components → components}/slider/index.js +0 -0
- /package/dist/{src/components → components}/switch/index.d.ts +0 -0
- /package/dist/{src/components → components}/switch/index.js +0 -0
- /package/dist/{src/components → components}/tab/tabButton/index.d.ts +0 -0
- /package/dist/{src/components → components}/tab/tabButton/index.js +0 -0
- /package/dist/{src/components → components}/tab/tabContainer/index.d.ts +0 -0
- /package/dist/{src/components → components}/tab/tabContainer/index.js +0 -0
- /package/dist/{src/components → components}/tab/tabContext.d.ts +0 -0
- /package/dist/{src/components → components}/tab/tabContext.js +0 -0
- /package/dist/{src/components → components}/textarea/index.d.ts +0 -0
- /package/dist/{src/components → components}/textarea/index.js +0 -0
- /package/dist/{src/components → components}/tooltip/index.d.ts +0 -0
- /package/dist/{src/components → components}/tooltip/index.js +0 -0
- /package/dist/{src/hooks → hooks}/useForm.d.ts +0 -0
- /package/dist/{src/hooks → hooks}/useForm.js +0 -0
- /package/dist/{src/hooks → hooks}/useScopedParams.d.ts +0 -0
- /package/dist/{src/hooks → hooks}/useScopedParams.js +0 -0
- /package/dist/{src/hooks → hooks}/useScrollLock.d.ts +0 -0
- /package/dist/{src/hooks → hooks}/useScrollLock.js +0 -0
- /package/dist/{src/hooks → hooks}/useSlider.d.ts +0 -0
- /package/dist/{src/hooks → hooks}/useSlider.js +0 -0
- /package/dist/{src/index.d.ts → index.d.ts} +0 -0
- /package/dist/{src/index.js → index.js} +0 -0
- /package/dist/{src/providers → providers}/formProvider.d.ts +0 -0
- /package/dist/{src/providers → providers}/formProvider.js +0 -0
- /package/dist/{src/services → services}/iconRenderer.d.ts +0 -0
- /package/dist/{src/services → services}/iconRenderer.js +0 -0
- /package/dist/{src/services → services}/maskCurrencyValues.d.ts +0 -0
- /package/dist/{src/services → services}/maskCurrencyValues.js +0 -0
- /package/dist/{src/utils → utils}/phoneInputUtilities.d.ts +0 -0
- /package/dist/{src/utils → utils}/phoneInputUtilities.js +0 -0
@@ -1,121 +0,0 @@
|
|
1
|
-
import { HTMLAttributes, ReactNode, useState } from "react";
|
2
|
-
|
3
|
-
import { TabProvider } from "../cardTabContext";
|
4
|
-
import "./styles.css";
|
5
|
-
|
6
|
-
type CardTabContainerProps = Omit<
|
7
|
-
HTMLAttributes<HTMLElement>,
|
8
|
-
"onClick" | "children" | "ref"
|
9
|
-
> & {
|
10
|
-
children: ReactNode;
|
11
|
-
disabled?: boolean;
|
12
|
-
defaultValue?: string;
|
13
|
-
onChange?: (index: string) => void;
|
14
|
-
};
|
15
|
-
|
16
|
-
/**
|
17
|
-
* CardTabContainer component - used as a wrapper for CardTabButton components to create tabbed navigation
|
18
|
-
*
|
19
|
-
* @param props - CardTabContainer component properties
|
20
|
-
* @param props.children - CardTabButton components and other content (required)
|
21
|
-
* @param props.disabled - Whether all tab buttons are disabled. Default: false
|
22
|
-
* @param props.defaultValue - Initial tab value to be selected
|
23
|
-
* @param props.onChange - Callback function called when tab changes, receives the tab value
|
24
|
-
*
|
25
|
-
* **...Other valid HTML nav properties except onClick, children, and ref**
|
26
|
-
*
|
27
|
-
* @returns CardTabContainer JSX element
|
28
|
-
*
|
29
|
-
* @example
|
30
|
-
* ```tsx
|
31
|
-
* // Basic tab container
|
32
|
-
* <CardTabContainer>
|
33
|
-
* <CardTabButton value="home">Home</CardTabButton>
|
34
|
-
* <CardTabButton value="about">About</CardTabButton>
|
35
|
-
* <CardTabButton value="contact">Contact</CardTabButton>
|
36
|
-
* </CardTabContainer>
|
37
|
-
* ```
|
38
|
-
*
|
39
|
-
* @example
|
40
|
-
* ```tsx
|
41
|
-
* // Tab container with default value and change handler
|
42
|
-
* <CardTabContainer
|
43
|
-
* defaultValue="dashboard"
|
44
|
-
* onChange={(value) => console.log('Active tab:', value)}
|
45
|
-
* >
|
46
|
-
* <CardTabButton value="dashboard">Dashboard</CardTabButton>
|
47
|
-
* <CardTabButton value="analytics">Analytics</CardTabButton>
|
48
|
-
* <CardTabButton value="settings">Settings</CardTabButton>
|
49
|
-
* </CardTabContainer>
|
50
|
-
* ```
|
51
|
-
*
|
52
|
-
* @example
|
53
|
-
* ```tsx
|
54
|
-
* // Disabled all tabs
|
55
|
-
* <CardTabContainer disabled>
|
56
|
-
* <CardTabButton value="tab1">Tab 1</CardTabButton>
|
57
|
-
* <CardTabButton value="tab2">Tab 2</CardTabButton>
|
58
|
-
* </CardTabContainer>
|
59
|
-
* ```
|
60
|
-
*
|
61
|
-
* @example
|
62
|
-
* ```tsx
|
63
|
-
* // Tab container with custom styling and state management
|
64
|
-
* function MyTabs() {
|
65
|
-
* const [activeTab, setActiveTab] = useState('profile');
|
66
|
-
*
|
67
|
-
* return (
|
68
|
-
* <div>
|
69
|
-
* <CardTabContainer
|
70
|
-
* defaultValue={activeTab}
|
71
|
-
* onChange={setActiveTab}
|
72
|
-
* className="custom-tabs"
|
73
|
-
* role="tablist"
|
74
|
-
* >
|
75
|
-
* <CardTabButton value="profile">Profile</CardTabButton>
|
76
|
-
* <CardTabButton value="account">Account</CardTabButton>
|
77
|
-
* <CardTabButton value="notifications">Notifications</CardTabButton>
|
78
|
-
* </CardTabContainer>
|
79
|
-
*
|
80
|
-
* {activeTab === 'profile' && <ProfileContent />}
|
81
|
-
* {activeTab === 'account' && <AccountContent />}
|
82
|
-
* {activeTab === 'notifications' && <NotificationsContent />}
|
83
|
-
* </div>
|
84
|
-
* );
|
85
|
-
* }
|
86
|
-
* ```
|
87
|
-
*/
|
88
|
-
|
89
|
-
function CardTabContainer(props: CardTabContainerProps) {
|
90
|
-
const {
|
91
|
-
children,
|
92
|
-
onChange,
|
93
|
-
defaultValue,
|
94
|
-
disabled = false,
|
95
|
-
className: baseClassName,
|
96
|
-
...rest
|
97
|
-
} = props;
|
98
|
-
|
99
|
-
const [currentTab, setCurrentTab] = useState(defaultValue || "");
|
100
|
-
|
101
|
-
const className = `arkynCardTabContainer ${baseClassName || ""}`;
|
102
|
-
|
103
|
-
function changeCurrentTab(value: string) {
|
104
|
-
setCurrentTab(value);
|
105
|
-
if (onChange) onChange(value);
|
106
|
-
}
|
107
|
-
|
108
|
-
return (
|
109
|
-
<TabProvider
|
110
|
-
disabled={disabled}
|
111
|
-
currentTab={currentTab}
|
112
|
-
changeCurrentTab={changeCurrentTab}
|
113
|
-
>
|
114
|
-
<nav className={className.trim()} {...rest}>
|
115
|
-
{children}
|
116
|
-
</nav>
|
117
|
-
</TabProvider>
|
118
|
-
);
|
119
|
-
}
|
120
|
-
|
121
|
-
export { CardTabContainer };
|
@@ -1,30 +0,0 @@
|
|
1
|
-
import { createContext, ReactNode, useContext } from "react";
|
2
|
-
|
3
|
-
type CardTabContextProps = {
|
4
|
-
disabled: boolean;
|
5
|
-
currentTab: string;
|
6
|
-
changeCurrentTab: (tab: string) => void;
|
7
|
-
};
|
8
|
-
|
9
|
-
type TabProviderProps = {
|
10
|
-
children: ReactNode;
|
11
|
-
disabled: boolean;
|
12
|
-
currentTab: string;
|
13
|
-
changeCurrentTab: (tab: string) => void;
|
14
|
-
};
|
15
|
-
|
16
|
-
const CardTabContext = createContext({} as CardTabContextProps);
|
17
|
-
|
18
|
-
function useCardTab() {
|
19
|
-
return useContext(CardTabContext);
|
20
|
-
}
|
21
|
-
|
22
|
-
function TabProvider(props: TabProviderProps) {
|
23
|
-
return (
|
24
|
-
<CardTabContext.Provider value={props}>
|
25
|
-
{props.children}
|
26
|
-
</CardTabContext.Provider>
|
27
|
-
);
|
28
|
-
}
|
29
|
-
|
30
|
-
export { TabProvider, useCardTab };
|
@@ -1,158 +0,0 @@
|
|
1
|
-
import { Check } from "lucide-react";
|
2
|
-
import { ButtonHTMLAttributes, useId, useRef, useState } from "react";
|
3
|
-
|
4
|
-
import { useForm } from "../../hooks/useForm";
|
5
|
-
import { FieldWrapper } from "../fieldWrapper";
|
6
|
-
|
7
|
-
import { FieldError } from "../fieldError";
|
8
|
-
import { FieldLabel } from "../fieldLabel";
|
9
|
-
import "./styles.css";
|
10
|
-
|
11
|
-
type CheckboxProps = Omit<
|
12
|
-
ButtonHTMLAttributes<HTMLButtonElement>,
|
13
|
-
| "size"
|
14
|
-
| "prefix"
|
15
|
-
| "type"
|
16
|
-
| "name"
|
17
|
-
| "defaultValue"
|
18
|
-
| "value"
|
19
|
-
| "onChange"
|
20
|
-
| "onSelect"
|
21
|
-
| "onClick"
|
22
|
-
> & {
|
23
|
-
label?: string;
|
24
|
-
errorMessage?: boolean;
|
25
|
-
|
26
|
-
size?: "md" | "lg" | "sm";
|
27
|
-
|
28
|
-
name: string;
|
29
|
-
value?: string;
|
30
|
-
|
31
|
-
checked?: boolean;
|
32
|
-
defaultChecked?: boolean;
|
33
|
-
onCheck?: (value: string) => void;
|
34
|
-
};
|
35
|
-
|
36
|
-
/**
|
37
|
-
* Checkbox component - used for creating interactive checkbox inputs with customizable styling and validation
|
38
|
-
*
|
39
|
-
* @param props - Checkbox component properties
|
40
|
-
* @param props.name - Required field name for form handling and hidden input identification
|
41
|
-
* @param props.label - Optional label text to display next to the checkbox
|
42
|
-
* @param props.errorMessage - Error state indicator to display validation errors
|
43
|
-
* @param props.size - Size variant of the checkbox. Default: "md"
|
44
|
-
* @param props.value - Optional value to be used when checkbox is checked. Default: "checked"
|
45
|
-
* @param props.checked - Controlled checked state of the checkbox
|
46
|
-
* @param props.defaultChecked - Default checked state for uncontrolled usage. Default: false
|
47
|
-
* @param props.onCheck - Callback function called when checkbox state changes, receives the value or empty string
|
48
|
-
*
|
49
|
-
* **...Other valid HTML properties for button element (except type, name, defaultValue, value, onChange, onSelect, onClick)**
|
50
|
-
*
|
51
|
-
* @returns Checkbox JSX element wrapped in FieldWrapper with optional label and error
|
52
|
-
*
|
53
|
-
* @example
|
54
|
-
* ```tsx
|
55
|
-
* // Basic checkbox
|
56
|
-
* <Checkbox name="terms" label="I agree to the terms and conditions" />
|
57
|
-
*
|
58
|
-
* // Checkbox with custom value and validation
|
59
|
-
* <Checkbox
|
60
|
-
* name="newsletter"
|
61
|
-
* label="Subscribe to newsletter"
|
62
|
-
* value="subscribed"
|
63
|
-
* errorMessage={errors.newsletter}
|
64
|
-
* />
|
65
|
-
*
|
66
|
-
* // Large checkbox with controlled state
|
67
|
-
* <Checkbox
|
68
|
-
* name="premium"
|
69
|
-
* label="Enable premium features"
|
70
|
-
* size="lg"
|
71
|
-
* checked={isPremium}
|
72
|
-
* onCheck={(value) => setIsPremium(!!value)}
|
73
|
-
* />
|
74
|
-
*
|
75
|
-
* // Small checkbox with default checked state
|
76
|
-
* <Checkbox
|
77
|
-
* name="remember"
|
78
|
-
* label="Remember me"
|
79
|
-
* size="sm"
|
80
|
-
* defaultChecked={true}
|
81
|
-
* value="remember_user"
|
82
|
-
* />
|
83
|
-
*
|
84
|
-
* // Checkbox with custom styling and callback
|
85
|
-
* <Checkbox
|
86
|
-
* name="notifications"
|
87
|
-
* label="Enable notifications"
|
88
|
-
* className="custom-checkbox"
|
89
|
-
* onCheck={(value) => console.log('Notification setting:', value)}
|
90
|
-
* disabled={isLoading}
|
91
|
-
* />
|
92
|
-
* ```
|
93
|
-
*/
|
94
|
-
|
95
|
-
function Checkbox(props: CheckboxProps) {
|
96
|
-
const {
|
97
|
-
id,
|
98
|
-
name,
|
99
|
-
className: baseClassName = "",
|
100
|
-
size = "md",
|
101
|
-
errorMessage: baseErrorMessage,
|
102
|
-
defaultChecked = false,
|
103
|
-
label,
|
104
|
-
checked: baseChecked = null,
|
105
|
-
onCheck,
|
106
|
-
value,
|
107
|
-
...rest
|
108
|
-
} = props;
|
109
|
-
|
110
|
-
const { fieldErrors } = useForm();
|
111
|
-
|
112
|
-
const checkboxRef = useRef<HTMLInputElement>(null);
|
113
|
-
const checkboxId = id || useId();
|
114
|
-
|
115
|
-
const errorMessage = baseErrorMessage || fieldErrors?.[name];
|
116
|
-
const isError = !!errorMessage;
|
117
|
-
|
118
|
-
const [isChecked, setIsChecked] = useState(defaultChecked || false);
|
119
|
-
|
120
|
-
const currentChecked =
|
121
|
-
typeof baseChecked === "boolean" ? baseChecked : isChecked;
|
122
|
-
|
123
|
-
const errorClass = isError ? "errorTrue" : "errorFalse";
|
124
|
-
const currentCheckedClass = currentChecked ? "checkedTrue" : "checkedFalse";
|
125
|
-
|
126
|
-
const className = `arkynCheckbox ${size} ${errorClass} ${currentCheckedClass} ${baseClassName}`;
|
127
|
-
|
128
|
-
function handleCheck() {
|
129
|
-
const defaultChecked = isChecked;
|
130
|
-
setIsChecked(!defaultChecked);
|
131
|
-
onCheck && onCheck(!defaultChecked ? value || "checked" : "");
|
132
|
-
}
|
133
|
-
|
134
|
-
return (
|
135
|
-
<FieldWrapper>
|
136
|
-
{label && <FieldLabel>{label}</FieldLabel>}
|
137
|
-
<button
|
138
|
-
id={checkboxId}
|
139
|
-
type="button"
|
140
|
-
className={className}
|
141
|
-
onClick={handleCheck}
|
142
|
-
{...rest}
|
143
|
-
>
|
144
|
-
<input
|
145
|
-
type="hidden"
|
146
|
-
name={name}
|
147
|
-
ref={checkboxRef}
|
148
|
-
value={currentChecked ? value || "checked" : ""}
|
149
|
-
/>
|
150
|
-
|
151
|
-
<Check />
|
152
|
-
</button>
|
153
|
-
{errorMessage && <FieldError>{errorMessage}</FieldError>}
|
154
|
-
</FieldWrapper>
|
155
|
-
);
|
156
|
-
}
|
157
|
-
|
158
|
-
export { Checkbox };
|
@@ -1,78 +0,0 @@
|
|
1
|
-
.arkynCheckbox {
|
2
|
-
display: flex;
|
3
|
-
align-items: center;
|
4
|
-
justify-content: center;
|
5
|
-
|
6
|
-
border: 2px solid var(--border);
|
7
|
-
background-color: rgba(var(--spotlight-secondary), 1);
|
8
|
-
}
|
9
|
-
|
10
|
-
.arkynCheckbox:hover {
|
11
|
-
cursor: pointer;
|
12
|
-
}
|
13
|
-
|
14
|
-
.arkynCheckbox > svg {
|
15
|
-
display: none;
|
16
|
-
stroke-width: 3px;
|
17
|
-
}
|
18
|
-
|
19
|
-
/* SIZE */
|
20
|
-
.arkynCheckbox.sm {
|
21
|
-
min-height: 16px;
|
22
|
-
min-width: 16px;
|
23
|
-
max-height: 16px;
|
24
|
-
max-width: 16px;
|
25
|
-
border-radius: 4px;
|
26
|
-
}
|
27
|
-
|
28
|
-
.arkynCheckbox.sm > svg {
|
29
|
-
min-height: 12px;
|
30
|
-
min-width: 12px;
|
31
|
-
max-height: 12px;
|
32
|
-
max-width: 12px;
|
33
|
-
}
|
34
|
-
|
35
|
-
.arkynCheckbox.md {
|
36
|
-
min-height: 20px;
|
37
|
-
min-width: 20px;
|
38
|
-
max-height: 20px;
|
39
|
-
max-width: 20px;
|
40
|
-
border-radius: 4px;
|
41
|
-
}
|
42
|
-
|
43
|
-
.arkynCheckbox.md > svg {
|
44
|
-
min-height: 14px;
|
45
|
-
min-width: 14px;
|
46
|
-
max-height: 14px;
|
47
|
-
max-width: 14px;
|
48
|
-
}
|
49
|
-
|
50
|
-
.arkynCheckbox.lg {
|
51
|
-
min-height: 24px;
|
52
|
-
min-width: 24px;
|
53
|
-
max-height: 24px;
|
54
|
-
max-width: 24px;
|
55
|
-
border-radius: 6px;
|
56
|
-
}
|
57
|
-
|
58
|
-
.arkynCheckbox.lg > svg {
|
59
|
-
min-height: 14px;
|
60
|
-
min-width: 14px;
|
61
|
-
max-height: 14px;
|
62
|
-
max-width: 14px;
|
63
|
-
}
|
64
|
-
|
65
|
-
/* CHECKED */
|
66
|
-
.arkynCheckbox.checkedTrue {
|
67
|
-
background-color: rgb(var(--spotlight-primary), 1);
|
68
|
-
border-color: rgb(var(--spotlight-primary), 1);
|
69
|
-
}
|
70
|
-
|
71
|
-
.arkynCheckbox.checkedTrue > svg {
|
72
|
-
display: unset;
|
73
|
-
color: #fff;
|
74
|
-
}
|
75
|
-
|
76
|
-
.arkynCheckbox.errorTrue {
|
77
|
-
border-color: rgb(var(--spotlight-danger), 1);
|
78
|
-
}
|
@@ -1,312 +0,0 @@
|
|
1
|
-
import { Loader2, LucideIcon } from "lucide-react";
|
2
|
-
import {
|
3
|
-
ChangeEvent,
|
4
|
-
InputHTMLAttributes,
|
5
|
-
useEffect,
|
6
|
-
useId,
|
7
|
-
useRef,
|
8
|
-
useState,
|
9
|
-
type FocusEvent,
|
10
|
-
} from "react";
|
11
|
-
|
12
|
-
import { useForm } from "../../hooks/useForm";
|
13
|
-
import { IconRenderer } from "../../services/iconRenderer";
|
14
|
-
import { maskCurrencyValues } from "../../services/maskCurrencyValues";
|
15
|
-
|
16
|
-
import { FieldError } from "../fieldError";
|
17
|
-
import { FieldLabel } from "../fieldLabel";
|
18
|
-
import { FieldWrapper } from "../fieldWrapper";
|
19
|
-
|
20
|
-
import "./style.css";
|
21
|
-
|
22
|
-
type Locale =
|
23
|
-
| "USD"
|
24
|
-
| "EUR"
|
25
|
-
| "JPY"
|
26
|
-
| "GBP"
|
27
|
-
| "AUD"
|
28
|
-
| "CAD"
|
29
|
-
| "CHF"
|
30
|
-
| "CNY"
|
31
|
-
| "SEK"
|
32
|
-
| "NZD"
|
33
|
-
| "BRL"
|
34
|
-
| "INR"
|
35
|
-
| "RUB"
|
36
|
-
| "ZAR"
|
37
|
-
| "MXN"
|
38
|
-
| "SGD"
|
39
|
-
| "HKD"
|
40
|
-
| "NOK"
|
41
|
-
| "KRW"
|
42
|
-
| "TRY"
|
43
|
-
| "IDR"
|
44
|
-
| "THB";
|
45
|
-
|
46
|
-
type CurrencyInputProps = Omit<
|
47
|
-
InputHTMLAttributes<HTMLInputElement>,
|
48
|
-
| "size"
|
49
|
-
| "prefix"
|
50
|
-
| "name"
|
51
|
-
| "type"
|
52
|
-
| "max"
|
53
|
-
| "defaultValue"
|
54
|
-
| "value"
|
55
|
-
| "onChange"
|
56
|
-
> & {
|
57
|
-
name: string;
|
58
|
-
locale: Locale;
|
59
|
-
|
60
|
-
label?: string;
|
61
|
-
errorMessage?: string;
|
62
|
-
isLoading?: boolean;
|
63
|
-
|
64
|
-
size?: "md" | "lg";
|
65
|
-
variant?: "solid" | "outline" | "underline";
|
66
|
-
|
67
|
-
prefix?: string | LucideIcon;
|
68
|
-
suffix?: string | LucideIcon;
|
69
|
-
showAsterisk?: boolean;
|
70
|
-
|
71
|
-
leftIcon?: LucideIcon;
|
72
|
-
rightIcon?: LucideIcon;
|
73
|
-
|
74
|
-
max?: number;
|
75
|
-
value?: number;
|
76
|
-
defaultValue?: number | null;
|
77
|
-
|
78
|
-
onChange?: (
|
79
|
-
event: ChangeEvent<HTMLInputElement>,
|
80
|
-
originalValue: string,
|
81
|
-
maskedValue: string
|
82
|
-
) => void;
|
83
|
-
};
|
84
|
-
|
85
|
-
/**
|
86
|
-
* CurrencyInput component - used for currency input fields with automatic formatting based on locale
|
87
|
-
*
|
88
|
-
* @param props - CurrencyInput component properties
|
89
|
-
* @param props.name - Required field name for form handling
|
90
|
-
* @param props.locale - Currency locale for formatting (e.g., "USD", "EUR", "BRL", etc.)
|
91
|
-
* @param props.label - Optional label text to display above the input
|
92
|
-
* @param props.errorMessage - Error message to display below the input
|
93
|
-
* @param props.isLoading - Controls loading state with spinner. Default: false
|
94
|
-
* @param props.size - Input size. Default: "md"
|
95
|
-
* @param props.variant - Visual variant of the input. Default: "solid"
|
96
|
-
* @param props.prefix - Text or icon to display at the beginning of the input
|
97
|
-
* @param props.suffix - Text or icon to display at the end of the input
|
98
|
-
* @param props.showAsterisk - Whether to show asterisk on label for required fields
|
99
|
-
* @param props.leftIcon - Optional icon to display on the left side
|
100
|
-
* @param props.rightIcon - Optional icon to display on the right side
|
101
|
-
* @param props.max - Maximum allowed value for the currency input
|
102
|
-
* @param props.value - Controlled value (number) for the input
|
103
|
-
* @param props.defaultValue - Default value (number) for uncontrolled usage
|
104
|
-
* @param props.onChange - Callback function called when value changes, receives event, original value and masked value
|
105
|
-
*
|
106
|
-
* **...Other valid HTML properties for input element (except type, max, defaultValue, value, onChange)**
|
107
|
-
*
|
108
|
-
* @returns CurrencyInput JSX element wrapped in FieldGroup with optional label and error
|
109
|
-
*
|
110
|
-
* @example
|
111
|
-
* ```tsx
|
112
|
-
* // Basic currency input
|
113
|
-
* <CurrencyInput name="price" locale="USD" placeholder="Enter price" />
|
114
|
-
*
|
115
|
-
* // Currency input with label and validation
|
116
|
-
* <CurrencyInput
|
117
|
-
* name="salary"
|
118
|
-
* locale="BRL"
|
119
|
-
* label="Monthly Salary"
|
120
|
-
* showAsterisk
|
121
|
-
* errorMessage="Please enter a valid amount"
|
122
|
-
* />
|
123
|
-
*
|
124
|
-
* // Currency input with icons and loading state
|
125
|
-
* <CurrencyInput
|
126
|
-
* name="budget"
|
127
|
-
* locale="EUR"
|
128
|
-
* label="Budget"
|
129
|
-
* leftIcon={DollarSignIcon}
|
130
|
-
* rightIcon={CalculatorIcon}
|
131
|
-
* isLoading
|
132
|
-
* />
|
133
|
-
*
|
134
|
-
* // Currency input with max value and controlled state
|
135
|
-
* <CurrencyInput
|
136
|
-
* name="limit"
|
137
|
-
* locale="USD"
|
138
|
-
* label="Credit Limit"
|
139
|
-
* max={10000}
|
140
|
-
* value={creditLimit}
|
141
|
-
* onChange={(e, original, masked) => setCreditLimit(Number(original))}
|
142
|
-
* variant="outline"
|
143
|
-
* />
|
144
|
-
*
|
145
|
-
* // Large currency input with prefix/suffix
|
146
|
-
* <CurrencyInput
|
147
|
-
* name="investment"
|
148
|
-
* locale="GBP"
|
149
|
-
* label="Investment Amount"
|
150
|
-
* size="lg"
|
151
|
-
* variant="underline"
|
152
|
-
* prefix="£"
|
153
|
-
* suffix="GBP"
|
154
|
-
* placeholder="Enter investment amount"
|
155
|
-
* />
|
156
|
-
* ```
|
157
|
-
*/
|
158
|
-
|
159
|
-
function CurrencyInput(props: CurrencyInputProps) {
|
160
|
-
const {
|
161
|
-
name,
|
162
|
-
disabled,
|
163
|
-
title,
|
164
|
-
style,
|
165
|
-
variant = "solid",
|
166
|
-
label,
|
167
|
-
className: baseClassName = "",
|
168
|
-
value,
|
169
|
-
defaultValue,
|
170
|
-
max,
|
171
|
-
locale,
|
172
|
-
onChange,
|
173
|
-
prefix,
|
174
|
-
suffix,
|
175
|
-
isLoading = false,
|
176
|
-
leftIcon,
|
177
|
-
readOnly,
|
178
|
-
onFocus,
|
179
|
-
onBlur,
|
180
|
-
errorMessage: baseErrorMessage,
|
181
|
-
showAsterisk,
|
182
|
-
rightIcon,
|
183
|
-
size = "md",
|
184
|
-
id,
|
185
|
-
...rest
|
186
|
-
} = props;
|
187
|
-
|
188
|
-
const { fieldErrors } = useForm();
|
189
|
-
const [isFocused, setIsFocused] = useState(false);
|
190
|
-
const [maskedValue, setMaskedValue] = useState("0");
|
191
|
-
|
192
|
-
const inputRef = useRef<HTMLInputElement>(null);
|
193
|
-
const inputId = id || useId();
|
194
|
-
|
195
|
-
const errorMessage = baseErrorMessage || fieldErrors?.[name];
|
196
|
-
const isError = !!errorMessage;
|
197
|
-
|
198
|
-
const iconSizes = { md: 20, lg: 20 };
|
199
|
-
const iconSize = iconSizes[size];
|
200
|
-
|
201
|
-
const loadingPosition = rightIcon ? "right" : "left";
|
202
|
-
|
203
|
-
const showLeftSpinner = loadingPosition === "left" && isLoading;
|
204
|
-
const showRightSpinner = loadingPosition === "right" && isLoading;
|
205
|
-
|
206
|
-
function handleSectionClick() {
|
207
|
-
if (disabled || !inputRef?.current) return;
|
208
|
-
setIsFocused(true);
|
209
|
-
inputRef.current.focus();
|
210
|
-
}
|
211
|
-
|
212
|
-
function handleFocus(e: FocusEvent<HTMLInputElement>) {
|
213
|
-
setIsFocused(true);
|
214
|
-
if (onFocus) onFocus(e);
|
215
|
-
}
|
216
|
-
|
217
|
-
function handleBlur(e: FocusEvent<HTMLInputElement>) {
|
218
|
-
setIsFocused(false);
|
219
|
-
if (onBlur) onBlur(e);
|
220
|
-
}
|
221
|
-
|
222
|
-
const updateValues = (originalValue: string | number) => {
|
223
|
-
const [calculatedValue, calculatedMaskedValue] = maskCurrencyValues(
|
224
|
-
originalValue,
|
225
|
-
locale
|
226
|
-
);
|
227
|
-
|
228
|
-
if (!max || calculatedValue <= max) {
|
229
|
-
setMaskedValue(calculatedMaskedValue);
|
230
|
-
return [calculatedValue, calculatedMaskedValue];
|
231
|
-
}
|
232
|
-
|
233
|
-
return maskCurrencyValues(originalValue, locale);
|
234
|
-
};
|
235
|
-
|
236
|
-
const handleChange = (event: ChangeEvent<HTMLInputElement>) => {
|
237
|
-
event.preventDefault();
|
238
|
-
const [originalValue, maskedValue] = updateValues(event.target.value);
|
239
|
-
|
240
|
-
onChange && onChange(event, String(originalValue), String(maskedValue));
|
241
|
-
};
|
242
|
-
|
243
|
-
useEffect(() => {
|
244
|
-
const currentValue = value || +defaultValue || undefined;
|
245
|
-
const [, maskedValue] = maskCurrencyValues(currentValue, locale);
|
246
|
-
|
247
|
-
setMaskedValue(maskedValue);
|
248
|
-
}, [locale, defaultValue, value]);
|
249
|
-
|
250
|
-
const hasPrefix = !!prefix ? "hasPrefix" : "";
|
251
|
-
const hasSuffix = !!suffix ? "hasSuffix" : "";
|
252
|
-
const errored = isError ? "errored" : "";
|
253
|
-
const opacity = disabled || readOnly || isLoading ? "opacity" : "";
|
254
|
-
const focused = isFocused ? "focused" : "";
|
255
|
-
|
256
|
-
const className = `arkynCurrencyInput ${hasPrefix} ${hasSuffix} ${variant} ${size} ${opacity} ${errored} ${focused} ${baseClassName}`;
|
257
|
-
|
258
|
-
return (
|
259
|
-
<FieldWrapper>
|
260
|
-
{label && (
|
261
|
-
<FieldLabel showAsterisk={showAsterisk} htmlFor={inputId}>
|
262
|
-
{label}
|
263
|
-
</FieldLabel>
|
264
|
-
)}
|
265
|
-
|
266
|
-
<section
|
267
|
-
title={title}
|
268
|
-
style={style}
|
269
|
-
onClick={handleSectionClick}
|
270
|
-
className={className}
|
271
|
-
>
|
272
|
-
<IconRenderer iconSize={iconSize} icon={prefix} className="prefix" />
|
273
|
-
|
274
|
-
<IconRenderer
|
275
|
-
show={showLeftSpinner}
|
276
|
-
iconSize={iconSize}
|
277
|
-
className="spinner"
|
278
|
-
icon={Loader2}
|
279
|
-
/>
|
280
|
-
|
281
|
-
<IconRenderer show={!isLoading} icon={leftIcon} iconSize={iconSize} />
|
282
|
-
|
283
|
-
<input
|
284
|
-
value={maskedValue}
|
285
|
-
disabled={disabled || isLoading}
|
286
|
-
readOnly={readOnly}
|
287
|
-
ref={inputRef}
|
288
|
-
onFocus={handleFocus}
|
289
|
-
onBlur={handleBlur}
|
290
|
-
onChange={handleChange}
|
291
|
-
id={inputId}
|
292
|
-
{...rest}
|
293
|
-
/>
|
294
|
-
|
295
|
-
<IconRenderer show={!isLoading} icon={rightIcon} iconSize={iconSize} />
|
296
|
-
|
297
|
-
<IconRenderer
|
298
|
-
show={showRightSpinner}
|
299
|
-
iconSize={iconSize}
|
300
|
-
className="spinner"
|
301
|
-
icon={Loader2}
|
302
|
-
/>
|
303
|
-
|
304
|
-
<IconRenderer iconSize={iconSize} icon={suffix} className="suffix" />
|
305
|
-
</section>
|
306
|
-
|
307
|
-
{errorMessage && <FieldError>{errorMessage}</FieldError>}
|
308
|
-
</FieldWrapper>
|
309
|
-
);
|
310
|
-
}
|
311
|
-
|
312
|
-
export { CurrencyInput };
|