@jenesei-software/jenesei-kit-react 1.3.40 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -37
- package/build/AnimatePresence-19yP-TCg.js +134 -0
- package/build/AnimatePresence-19yP-TCg.js.map +1 -0
- package/build/AnimatePresence-BdBJCJuf.cjs +11 -0
- package/build/AnimatePresence-BdBJCJuf.cjs.map +1 -0
- package/build/area-outside.cjs.js +1 -2
- package/build/area-outside.d.ts +2 -28
- package/build/area-outside.es.js +2 -3
- package/build/area-preview.cjs.js +1 -2
- package/build/area-preview.d.ts +2 -48
- package/build/area-preview.es.js +3 -5
- package/build/area-skeleton.cjs.js +1 -2
- package/build/area-skeleton.d.ts +2 -68
- package/build/area-skeleton.es.js +2 -4
- package/build/areas/outside/area.d.ts +7 -0
- package/build/areas/outside/index.d.ts +1 -0
- package/build/areas/preview/area.d.ts +3 -0
- package/build/areas/preview/area.hooks.d.ts +1 -0
- package/build/areas/preview/area.types.d.ts +19 -0
- package/build/areas/preview/index.d.ts +3 -0
- package/build/areas/skeleton/area.d.ts +3 -0
- package/build/areas/skeleton/area.types.d.ts +21 -0
- package/build/areas/skeleton/index.d.ts +2 -0
- package/build/build-info.txt +3 -3
- package/build/button-BbGiFvok.js +102 -0
- package/build/button-BbGiFvok.js.map +1 -0
- package/build/button-BuPpgfL_.cjs +3 -0
- package/build/button-BuPpgfL_.cjs.map +1 -0
- package/build/checkbox-CXxWDklX.js +98 -0
- package/build/checkbox-CXxWDklX.js.map +1 -0
- package/build/checkbox-qgc_Ntc3.cjs +3 -0
- package/build/checkbox-qgc_Ntc3.cjs.map +1 -0
- package/build/chunk-Dd8m0Ver.cjs +1 -0
- package/build/chunk-cI0lbGMq.js +31 -0
- package/build/component-BHyXT2-h.js +71 -0
- package/build/component-BHyXT2-h.js.map +1 -0
- package/build/component-button.cjs.js +1 -2
- package/build/component-button.d.ts +2 -208
- package/build/component-button.es.js +2 -5
- package/build/component-checkbox.cjs.js +1 -2
- package/build/component-checkbox.d.ts +2 -208
- package/build/component-checkbox.es.js +2 -8
- package/build/component-date-picker.cjs.js +1 -2
- package/build/component-date-picker.d.ts +2 -582
- package/build/component-date-picker.es.js +2 -19
- package/build/component-icon.cjs.js +1 -2
- package/build/component-icon.d.ts +2 -136
- package/build/component-icon.es.js +4 -8
- package/build/component-input-otp.cjs.js +1 -2
- package/build/component-input-otp.d.ts +2 -211
- package/build/component-input-otp.es.js +2 -7
- package/build/component-input.cjs.js +1 -2
- package/build/component-input.d.ts +2 -286
- package/build/component-input.es.js +2 -18
- package/build/component-jsn2T8Hu.cjs +3 -0
- package/build/component-jsn2T8Hu.cjs.map +1 -0
- package/build/component-pagination.cjs.js +1 -2
- package/build/component-pagination.d.ts +2 -196
- package/build/component-pagination.es.js +2 -4
- package/build/component-popover.cjs.js +1 -0
- package/build/component-popover.d.ts +2 -0
- package/build/component-popover.es.js +5 -0
- package/build/component-select.cjs.js +1 -2
- package/build/component-select.d.ts +2 -411
- package/build/component-select.es.js +6 -18
- package/build/component-separator.cjs.js +1 -2
- package/build/component-separator.d.ts +2 -49
- package/build/component-separator.es.js +2 -5
- package/build/component-stack.cjs.js +1 -2
- package/build/component-stack.d.ts +2 -72
- package/build/component-stack.es.js +3 -6
- package/build/component-textarea.cjs.js +1 -2
- package/build/component-textarea.d.ts +2 -202
- package/build/component-textarea.es.js +2 -6
- package/build/component-toggle.cjs.js +1 -2
- package/build/component-toggle.d.ts +2 -150
- package/build/component-toggle.es.js +2 -6
- package/build/component-tooltip.cjs.js +1 -2
- package/build/component-tooltip.d.ts +2 -360
- package/build/component-tooltip.es.js +2 -10
- package/build/component-typography.cjs.js +1 -2
- package/build/component-typography.d.ts +2 -316
- package/build/component-typography.es.js +3 -9
- package/build/components/button/component.d.ts +3 -0
- package/build/components/button/component.types.d.ts +41 -0
- package/build/components/button/index.d.ts +2 -0
- package/build/components/checkbox/component.d.ts +3 -0
- package/build/components/checkbox/component.types.d.ts +51 -0
- package/build/components/checkbox/index.d.ts +2 -0
- package/build/components/date-picker/component.d.ts +2 -0
- package/build/components/date-picker/component.types.d.ts +86 -0
- package/build/components/date-picker/index.d.ts +2 -0
- package/build/components/error/component.d.ts +3 -0
- package/build/components/error/component.types.d.ts +11 -0
- package/build/components/error/index.d.ts +2 -0
- package/build/components/icon/component.consts.d.ts +6 -0
- package/build/components/icon/component.d.ts +9 -0
- package/build/components/icon/component.functions.d.ts +2 -0
- package/build/components/icon/component.hooks.d.ts +5 -0
- package/build/components/icon/component.types.d.ts +47 -0
- package/build/components/icon/index.d.ts +4 -0
- package/build/components/input/component.d.ts +6 -0
- package/build/components/input/component.types.d.ts +78 -0
- package/build/components/input/index.d.ts +2 -0
- package/build/components/input-otp/component.d.ts +2 -0
- package/build/components/input-otp/component.types.d.ts +8 -0
- package/build/components/input-otp/index.d.ts +2 -0
- package/build/components/pagination/component.constants.d.ts +1 -0
- package/build/components/pagination/component.d.ts +3 -0
- package/build/components/pagination/component.types.d.ts +22 -0
- package/build/components/pagination/index.d.ts +2 -0
- package/build/components/popover/component.constants.d.ts +3 -0
- package/build/components/popover/component.d.ts +34 -0
- package/build/components/popover/component.types.d.ts +113 -0
- package/build/components/popover/index.d.ts +2 -0
- package/build/components/select/component.d.ts +4 -0
- package/build/components/select/component.examples.d.ts +6 -0
- package/build/components/select/component.types.d.ts +109 -0
- package/build/components/select/index.d.ts +3 -0
- package/build/components/separator/component.d.ts +3 -0
- package/build/components/separator/component.types.d.ts +10 -0
- package/build/components/separator/index.d.ts +2 -0
- package/build/components/stack/component.d.ts +4 -0
- package/build/components/stack/component.types.d.ts +20 -0
- package/build/components/stack/index.d.ts +2 -0
- package/build/components/textarea/component.d.ts +2 -0
- package/build/components/textarea/component.types.d.ts +67 -0
- package/build/components/textarea/index.d.ts +2 -0
- package/build/components/toggle/component.d.ts +2 -0
- package/build/components/toggle/component.types.d.ts +25 -0
- package/build/components/toggle/index.d.ts +2 -0
- package/build/components/tooltip/component.constants.d.ts +3 -0
- package/build/components/tooltip/component.d.ts +4 -0
- package/build/components/tooltip/component.types.d.ts +12 -0
- package/build/components/tooltip/index.d.ts +2 -0
- package/build/components/typography/component.d.ts +3 -0
- package/build/components/typography/component.types.d.ts +18 -0
- package/build/components/typography/index.d.ts +2 -0
- package/build/components-error.cjs.js +1 -0
- package/build/components-error.d.ts +2 -0
- package/build/components-error.es.js +4 -0
- package/build/context-app-CMK9g6MI.js +417 -0
- package/build/context-app-CMK9g6MI.js.map +1 -0
- package/build/context-app-HhFcx1wY.cjs +9 -0
- package/build/context-app-HhFcx1wY.cjs.map +1 -0
- package/build/context-app.cjs.js +1 -2
- package/build/context-app.d.ts +2 -224
- package/build/context-app.es.js +3 -19
- package/build/context-browser-theme-Cb6siWO0.js +35 -0
- package/build/context-browser-theme-Cb6siWO0.js.map +1 -0
- package/build/context-browser-theme-Cso_rAT5.cjs +3 -0
- package/build/context-browser-theme-Cso_rAT5.cjs.map +1 -0
- package/build/context-browser-theme.cjs.js +1 -0
- package/build/context-browser-theme.d.ts +2 -0
- package/build/context-browser-theme.es.js +5 -0
- package/build/context-cookie-5CBhf-gb.js +138 -0
- package/build/context-cookie-5CBhf-gb.js.map +1 -0
- package/build/context-cookie-Btkd2aXy.cjs +3 -0
- package/build/context-cookie-Btkd2aXy.cjs.map +1 -0
- package/build/context-cookie.cjs.js +1 -2
- package/build/context-cookie.d.ts +2 -67
- package/build/context-cookie.es.js +3 -8
- package/build/context-dialog-B67-_jMH.cjs +3 -0
- package/build/context-dialog-B67-_jMH.cjs.map +1 -0
- package/build/context-dialog-CxGGmBqC.js +176 -0
- package/build/context-dialog-CxGGmBqC.js.map +1 -0
- package/build/context-dialog.cjs.js +1 -2
- package/build/context-dialog.d.ts +2 -106
- package/build/context-dialog.es.js +4 -17
- package/build/context-geolocation-C7PYGQ2g.js +42 -0
- package/build/context-geolocation-C7PYGQ2g.js.map +1 -0
- package/build/context-geolocation-CV4hV0NX.cjs +3 -0
- package/build/context-geolocation-CV4hV0NX.cjs.map +1 -0
- package/build/context-geolocation.cjs.js +1 -2
- package/build/context-geolocation.d.ts +2 -22
- package/build/context-geolocation.es.js +3 -6
- package/build/context-local-storage-Bb_vktd8.js +83 -0
- package/build/context-local-storage-Bb_vktd8.js.map +1 -0
- package/build/context-local-storage-DUKHVPAA.cjs +3 -0
- package/build/context-local-storage-DUKHVPAA.cjs.map +1 -0
- package/build/context-local-storage.cjs.js +1 -2
- package/build/context-local-storage.d.ts +2 -54
- package/build/context-local-storage.es.js +3 -8
- package/build/context-permission-Co4BKDOu.js +77 -0
- package/build/context-permission-Co4BKDOu.js.map +1 -0
- package/build/context-permission-DrcIwK9y.cjs +3 -0
- package/build/context-permission-DrcIwK9y.cjs.map +1 -0
- package/build/context-permission.cjs.js +1 -2
- package/build/context-permission.d.ts +2 -28
- package/build/context-permission.es.js +3 -7
- package/build/context-screen-width-CFexCIzV.js +53 -0
- package/build/context-screen-width-CFexCIzV.js.map +1 -0
- package/build/context-screen-width-hcRkxzy7.cjs +3 -0
- package/build/context-screen-width-hcRkxzy7.cjs.map +1 -0
- package/build/context-screen-width.cjs.js +1 -2
- package/build/context-screen-width.d.ts +2 -34
- package/build/context-screen-width.es.js +3 -5
- package/build/context-sonner-4gBa1F7G.cjs +3 -0
- package/build/context-sonner-4gBa1F7G.cjs.map +1 -0
- package/build/context-sonner-qDPLFpD5.js +218 -0
- package/build/context-sonner-qDPLFpD5.js.map +1 -0
- package/build/context-sonner.cjs.js +1 -2
- package/build/context-sonner.d.ts +2 -457
- package/build/context-sonner.es.js +3 -20
- package/build/contexts/context-app/context.d.ts +33 -0
- package/build/contexts/context-app/context.hooks.d.ts +2 -0
- package/build/contexts/context-app/context.styles.d.ts +14 -0
- package/build/contexts/context-app/context.types.d.ts +87 -0
- package/build/contexts/context-app/index.d.ts +2 -0
- package/build/contexts/context-browser-theme/context.d.ts +4 -0
- package/build/contexts/context-browser-theme/context.hooks.d.ts +2 -0
- package/build/contexts/context-browser-theme/context.types.d.ts +12 -0
- package/build/contexts/context-browser-theme/index.d.ts +2 -0
- package/build/contexts/context-cookie/context.d.ts +27 -0
- package/build/contexts/context-cookie/context.functions.d.ts +3 -0
- package/build/contexts/context-cookie/context.hooks.d.ts +9 -0
- package/build/contexts/context-cookie/context.types.d.ts +18 -0
- package/build/contexts/context-cookie/index.d.ts +3 -0
- package/build/contexts/context-dialog/context.constants.d.ts +8 -0
- package/build/contexts/context-dialog/context.d.ts +4 -0
- package/build/contexts/context-dialog/context.hooks.d.ts +3 -0
- package/build/contexts/context-dialog/context.styles.d.ts +9 -0
- package/build/contexts/context-dialog/context.types.d.ts +47 -0
- package/build/contexts/context-dialog/index.d.ts +3 -0
- package/build/contexts/context-geolocation/context.d.ts +4 -0
- package/build/contexts/context-geolocation/context.hooks.d.ts +2 -0
- package/build/contexts/context-geolocation/context.types.d.ts +10 -0
- package/build/contexts/context-geolocation/index.d.ts +2 -0
- package/build/contexts/context-local-storage/context.d.ts +21 -0
- package/build/contexts/context-local-storage/context.functions.d.ts +2 -0
- package/build/contexts/context-local-storage/context.hooks.d.ts +5 -0
- package/build/contexts/context-local-storage/context.types.d.ts +16 -0
- package/build/contexts/context-local-storage/index.d.ts +3 -0
- package/build/contexts/context-permission/context.d.ts +3 -0
- package/build/contexts/context-permission/context.functions.d.ts +1 -0
- package/build/contexts/context-permission/context.hooks.d.ts +5 -0
- package/build/contexts/context-permission/context.types.d.ts +11 -0
- package/build/contexts/context-permission/index.d.ts +2 -0
- package/build/contexts/context-screen-width/context.d.ts +4 -0
- package/build/contexts/context-screen-width/context.hooks.d.ts +2 -0
- package/build/contexts/context-screen-width/context.types.d.ts +11 -0
- package/build/contexts/context-screen-width/index.d.ts +3 -0
- package/build/contexts/context-sonner/context.constants.d.ts +9 -0
- package/build/contexts/context-sonner/context.d.ts +4 -0
- package/build/contexts/context-sonner/context.hooks.d.ts +2 -0
- package/build/contexts/context-sonner/context.styles.d.ts +30 -0
- package/build/contexts/context-sonner/context.types.d.ts +59 -0
- package/build/contexts/context-sonner/index.d.ts +3 -0
- package/build/cores/consts.d.ts +30 -0
- package/build/{functions.d.ts → cores/functions.d.ts} +18 -22
- package/build/cores/logger.d.ts +1 -0
- package/build/cores/types.d.ts +18 -0
- package/build/date-picker-CPNNIEa-.cjs +3 -0
- package/build/date-picker-CPNNIEa-.cjs.map +1 -0
- package/build/date-picker-Uuce_InW.js +689 -0
- package/build/date-picker-Uuce_InW.js.map +1 -0
- package/build/dist-BV0C3tLK.js +483 -0
- package/build/dist-BV0C3tLK.js.map +1 -0
- package/build/dist-DswBAjW1.cjs +3 -0
- package/build/dist-DswBAjW1.cjs.map +1 -0
- package/build/error-DzkkNL2H.cjs +3 -0
- package/build/error-DzkkNL2H.cjs.map +1 -0
- package/build/error-L2fvWcNv.js +50 -0
- package/build/error-L2fvWcNv.js.map +1 -0
- package/build/functions-CLGf7hqw.js +20 -0
- package/build/functions-CLGf7hqw.js.map +1 -0
- package/build/functions-Dwo54amB.cjs +3 -0
- package/build/functions-Dwo54amB.cjs.map +1 -0
- package/build/hooks/use-debounced-callback/index.d.ts +1 -0
- package/build/hooks/use-debounced-callback/use.d.ts +1 -0
- package/build/hooks/use-deep-compare-memoize/index.d.ts +1 -0
- package/build/hooks/use-deep-compare-memoize/use.d.ts +1 -0
- package/build/hooks/use-deep-memo/index.d.ts +1 -0
- package/build/hooks/use-deep-memo/use.d.ts +1 -0
- package/build/hooks/use-merge-refs/index.d.ts +1 -0
- package/build/hooks/use-merge-refs/use.d.ts +2 -0
- package/build/hooks/use-overflowing/index.d.ts +2 -0
- package/build/hooks/use-overflowing/use.d.ts +12 -0
- package/build/hooks/use-overflowing/use.types.d.ts +6 -0
- package/build/hooks/use-overflowing-advanced/index.d.ts +2 -0
- package/build/hooks/use-overflowing-advanced/use.d.ts +7 -0
- package/build/hooks/use-overflowing-advanced/use.types.d.ts +5 -0
- package/build/hooks/use-overflowing-in-container/index.d.ts +2 -0
- package/build/hooks/use-overflowing-in-container/use.d.ts +7 -0
- package/build/hooks/use-overflowing-in-container/use.types.d.ts +7 -0
- package/build/hooks/use-responsive-layout/index.d.ts +1 -0
- package/build/hooks/use-responsive-layout/use.d.ts +2 -0
- package/build/hooks/use-typography-styles/index.d.ts +2 -0
- package/build/hooks/use-typography-styles/use.d.ts +2 -0
- package/build/hooks/use-typography-styles/use.types.d.ts +11 -0
- package/build/hooks-use-debounced-callback.cjs.js +3 -2
- package/build/hooks-use-debounced-callback.cjs.js.map +1 -1
- package/build/hooks-use-debounced-callback.d.ts +2 -3
- package/build/hooks-use-debounced-callback.es.js +12 -3
- package/build/hooks-use-debounced-callback.es.js.map +1 -1
- package/build/hooks-use-deep-compare-memoize.cjs.js +3 -2
- package/build/hooks-use-deep-compare-memoize.cjs.js.map +1 -1
- package/build/hooks-use-deep-compare-memoize.d.ts +2 -3
- package/build/hooks-use-deep-compare-memoize.es.js +10 -3
- package/build/hooks-use-deep-compare-memoize.es.js.map +1 -1
- package/build/hooks-use-deep-memo.cjs.js +3 -0
- package/build/hooks-use-deep-memo.cjs.js.map +1 -0
- package/build/hooks-use-deep-memo.d.ts +2 -0
- package/build/hooks-use-deep-memo.es.js +13 -0
- package/build/hooks-use-deep-memo.es.js.map +1 -0
- package/build/hooks-use-merge-refs.cjs.js +3 -0
- package/build/hooks-use-merge-refs.cjs.js.map +1 -0
- package/build/hooks-use-merge-refs.d.ts +2 -0
- package/build/hooks-use-merge-refs.es.js +13 -0
- package/build/hooks-use-merge-refs.es.js.map +1 -0
- package/build/hooks-use-overflowing-advanced.cjs.js +3 -0
- package/build/hooks-use-overflowing-advanced.cjs.js.map +1 -0
- package/build/hooks-use-overflowing-advanced.d.ts +2 -0
- package/build/hooks-use-overflowing-advanced.es.js +24 -0
- package/build/hooks-use-overflowing-advanced.es.js.map +1 -0
- package/build/hooks-use-overflowing-in-container.cjs.js +3 -0
- package/build/hooks-use-overflowing-in-container.cjs.js.map +1 -0
- package/build/hooks-use-overflowing-in-container.d.ts +2 -0
- package/build/hooks-use-overflowing-in-container.es.js +20 -0
- package/build/hooks-use-overflowing-in-container.es.js.map +1 -0
- package/build/hooks-use-overflowing.cjs.js +3 -0
- package/build/hooks-use-overflowing.cjs.js.map +1 -0
- package/build/hooks-use-overflowing.d.ts +2 -0
- package/build/hooks-use-overflowing.es.js +28 -0
- package/build/hooks-use-overflowing.es.js.map +1 -0
- package/build/hooks-use-responsive-layout.cjs.js +3 -0
- package/build/hooks-use-responsive-layout.cjs.js.map +1 -0
- package/build/hooks-use-responsive-layout.d.ts +2 -0
- package/build/hooks-use-responsive-layout.es.js +22 -0
- package/build/hooks-use-responsive-layout.es.js.map +1 -0
- package/build/hooks-use-typography-styles.cjs.js +3 -0
- package/build/hooks-use-typography-styles.cjs.js.map +1 -0
- package/build/hooks-use-typography-styles.d.ts +2 -0
- package/build/hooks-use-typography-styles.es.js +37 -0
- package/build/hooks-use-typography-styles.es.js.map +1 -0
- package/build/icon-CoIQwke4.cjs +3 -0
- package/build/icon-CoIQwke4.cjs.map +1 -0
- package/build/icon-DzAWOQJg.js +277 -0
- package/build/icon-DzAWOQJg.js.map +1 -0
- package/build/index.cjs.js +1 -2
- package/build/index.d.ts +39 -2494
- package/build/index.es.js +104 -309
- package/build/input-CV02F03L.js +917 -0
- package/build/input-CV02F03L.js.map +1 -0
- package/build/input-otp-B9cYxJ7X.js +106 -0
- package/build/input-otp-B9cYxJ7X.js.map +1 -0
- package/build/input-otp-BVRCfoRK.cjs +3 -0
- package/build/input-otp-BVRCfoRK.cjs.map +1 -0
- package/build/input-zXF5f99Z.cjs +11 -0
- package/build/input-zXF5f99Z.cjs.map +1 -0
- package/build/isEqual-DeC2HFe5.cjs +3 -0
- package/build/isEqual-DeC2HFe5.cjs.map +1 -0
- package/build/isEqual-Qb81B2zH.js +676 -0
- package/build/isEqual-Qb81B2zH.js.map +1 -0
- package/build/logger-BRWLzI5S.js +174 -0
- package/build/logger-BRWLzI5S.js.map +1 -0
- package/build/logger-DZFY33QY.cjs +5 -0
- package/build/logger-DZFY33QY.cjs.map +1 -0
- package/build/motion-CAPq8wSn.cjs +3 -0
- package/build/motion-CAPq8wSn.cjs.map +1 -0
- package/build/motion-Dt6TyEjN.js +128 -0
- package/build/motion-Dt6TyEjN.js.map +1 -0
- package/build/outside-B3nRnDGb.cjs +3 -0
- package/build/outside-B3nRnDGb.cjs.map +1 -0
- package/build/outside-DpK1pI8b.js +24 -0
- package/build/outside-DpK1pI8b.js.map +1 -0
- package/build/pagination-Dbs4Lrpt.cjs +3 -0
- package/build/pagination-Dbs4Lrpt.cjs.map +1 -0
- package/build/pagination-YXSjZsMZ.js +110 -0
- package/build/pagination-YXSjZsMZ.js.map +1 -0
- package/build/popover-1k1MNFwv.js +1948 -0
- package/build/popover-1k1MNFwv.js.map +1 -0
- package/build/popover-CgwGn-55.cjs +3 -0
- package/build/popover-CgwGn-55.cjs.map +1 -0
- package/build/preview-C_yFxoFH.js +65 -0
- package/build/preview-C_yFxoFH.js.map +1 -0
- package/build/preview-dT7fmxcc.cjs +3 -0
- package/build/preview-dT7fmxcc.cjs.map +1 -0
- package/build/proxy-_gZenxVU.cjs +3 -0
- package/build/proxy-_gZenxVU.cjs.map +1 -0
- package/build/proxy-wCWa57J3.js +4354 -0
- package/build/proxy-wCWa57J3.js.map +1 -0
- package/build/select-B0adRX2_.cjs +9 -0
- package/build/select-B0adRX2_.cjs.map +1 -0
- package/build/select-D7EyxR2l.js +3443 -0
- package/build/select-D7EyxR2l.js.map +1 -0
- package/build/separator-CbeH8Lug.cjs +3 -0
- package/build/separator-CbeH8Lug.cjs.map +1 -0
- package/build/separator-hWp-s54-.js +29 -0
- package/build/separator-hWp-s54-.js.map +1 -0
- package/build/skeleton-BoVFwt7y.cjs +3 -0
- package/build/skeleton-BoVFwt7y.cjs.map +1 -0
- package/build/skeleton-DNwTI6w0.js +39 -0
- package/build/skeleton-DNwTI6w0.js.map +1 -0
- package/build/style-motion.cjs.js +1 -2
- package/build/style-motion.d.ts +2 -20
- package/build/style-motion.es.js +5 -6
- package/build/style-utils.cjs.js +1 -0
- package/build/style-utils.d.ts +2 -0
- package/build/style-utils.es.js +7 -0
- package/build/styles/motion/index.d.ts +1 -0
- package/build/styles/motion/motion.d.ts +13 -0
- package/build/styles/utils/constants.d.ts +1797 -0
- package/build/styles/utils/functions.d.ts +3 -0
- package/build/styles/utils/index.d.ts +3 -0
- package/build/styles/utils/types.d.ts +68 -0
- package/build/textarea-CbZSeqGR.cjs +3 -0
- package/build/textarea-CbZSeqGR.cjs.map +1 -0
- package/build/textarea-ChkjV_Ha.js +132 -0
- package/build/textarea-ChkjV_Ha.js.map +1 -0
- package/build/toggle-I6YvEX4w.js +86 -0
- package/build/toggle-I6YvEX4w.js.map +1 -0
- package/build/toggle-gYw5FUp-.cjs +3 -0
- package/build/toggle-gYw5FUp-.cjs.map +1 -0
- package/build/typography-B2KioMfq.js +116 -0
- package/build/typography-B2KioMfq.js.map +1 -0
- package/build/typography-DcxhX_9e.cjs +3 -0
- package/build/typography-DcxhX_9e.cjs.map +1 -0
- package/build/utils-Cona48dZ.js +925 -0
- package/build/utils-Cona48dZ.js.map +1 -0
- package/build/utils-DtinAjAU.cjs +3 -0
- package/build/utils-DtinAjAU.cjs.map +1 -0
- package/build/v4-BDi_Luux.cjs +3 -0
- package/build/v4-BDi_Luux.cjs.map +1 -0
- package/build/v4-CYaPyb-W.js +31 -0
- package/build/v4-CYaPyb-W.js.map +1 -0
- package/package.json +185 -194
- package/build/area-0BNtBqG8.cjs +0 -2
- package/build/area-0BNtBqG8.cjs.map +0 -1
- package/build/area-B6xxVQ87.js +0 -35
- package/build/area-B6xxVQ87.js.map +0 -1
- package/build/area-B7-4IFQB.js +0 -19
- package/build/area-B7-4IFQB.js.map +0 -1
- package/build/area-DxKLtDFZ.cjs +0 -2
- package/build/area-DxKLtDFZ.cjs.map +0 -1
- package/build/area-outside.cjs.js.map +0 -1
- package/build/area-outside.es.js.map +0 -1
- package/build/area-preview.cjs.js.map +0 -1
- package/build/area-preview.es.js.map +0 -1
- package/build/area-scroll.cjs.js +0 -2
- package/build/area-scroll.cjs.js.map +0 -1
- package/build/area-scroll.d.ts +0 -57
- package/build/area-scroll.es.js +0 -7
- package/build/area-scroll.es.js.map +0 -1
- package/build/area-skeleton.cjs.js.map +0 -1
- package/build/area-skeleton.es.js.map +0 -1
- package/build/area-smooth.cjs.js +0 -2
- package/build/area-smooth.cjs.js.map +0 -1
- package/build/area-smooth.d.ts +0 -37
- package/build/area-smooth.es.js +0 -5
- package/build/area-smooth.es.js.map +0 -1
- package/build/area.hooks-Bk04M7mk.js +0 -26
- package/build/area.hooks-Bk04M7mk.js.map +0 -1
- package/build/area.hooks-C_UKZzcb.cjs +0 -2
- package/build/area.hooks-C_UKZzcb.cjs.map +0 -1
- package/build/area.styles-Cpx4H0gc.cjs +0 -27
- package/build/area.styles-Cpx4H0gc.cjs.map +0 -1
- package/build/area.styles-DhCCEhuq.js +0 -32
- package/build/area.styles-DhCCEhuq.js.map +0 -1
- package/build/component-B72M2Tpw.js +0 -84
- package/build/component-B72M2Tpw.js.map +0 -1
- package/build/component-BIxOOifU.cjs +0 -2
- package/build/component-BIxOOifU.cjs.map +0 -1
- package/build/component-BMIqhbpK.js +0 -23
- package/build/component-BMIqhbpK.js.map +0 -1
- package/build/component-BQru5uoj.js +0 -10
- package/build/component-BQru5uoj.js.map +0 -1
- package/build/component-BRCDQbb-.js +0 -50
- package/build/component-BRCDQbb-.js.map +0 -1
- package/build/component-BUkf5TLO.js +0 -170
- package/build/component-BUkf5TLO.js.map +0 -1
- package/build/component-BmccRQ_Y.cjs +0 -2
- package/build/component-BmccRQ_Y.cjs.map +0 -1
- package/build/component-Bvq-fgCN.cjs +0 -2
- package/build/component-Bvq-fgCN.cjs.map +0 -1
- package/build/component-C448kBTA.js +0 -443
- package/build/component-C448kBTA.js.map +0 -1
- package/build/component-C6I01Mel.cjs +0 -2
- package/build/component-C6I01Mel.cjs.map +0 -1
- package/build/component-C8mTuBua.js +0 -74
- package/build/component-C8mTuBua.js.map +0 -1
- package/build/component-CVWsmIlg.cjs +0 -2
- package/build/component-CVWsmIlg.cjs.map +0 -1
- package/build/component-C_6x7Mk8.js +0 -88
- package/build/component-C_6x7Mk8.js.map +0 -1
- package/build/component-CbWtsuhz.js +0 -60
- package/build/component-CbWtsuhz.js.map +0 -1
- package/build/component-Cfs39n8Q.js +0 -21
- package/build/component-Cfs39n8Q.js.map +0 -1
- package/build/component-CoOTSdM5.cjs +0 -28
- package/build/component-CoOTSdM5.cjs.map +0 -1
- package/build/component-Cu2i_-RT.cjs +0 -2
- package/build/component-Cu2i_-RT.cjs.map +0 -1
- package/build/component-CyZbUCkT.js +0 -39
- package/build/component-CyZbUCkT.js.map +0 -1
- package/build/component-D-HMYzXU.js +0 -65
- package/build/component-D-HMYzXU.js.map +0 -1
- package/build/component-D2vDwS60.cjs +0 -2
- package/build/component-D2vDwS60.cjs.map +0 -1
- package/build/component-D3KCIC-G.js +0 -64
- package/build/component-D3KCIC-G.js.map +0 -1
- package/build/component-DJAq34yj.cjs +0 -2
- package/build/component-DJAq34yj.cjs.map +0 -1
- package/build/component-DRMRXUJA.cjs +0 -2
- package/build/component-DRMRXUJA.cjs.map +0 -1
- package/build/component-DfSTPgfj.js +0 -248
- package/build/component-DfSTPgfj.js.map +0 -1
- package/build/component-DqV_-YxZ.cjs +0 -2
- package/build/component-DqV_-YxZ.cjs.map +0 -1
- package/build/component-DrmSI_ni.cjs +0 -2
- package/build/component-DrmSI_ni.cjs.map +0 -1
- package/build/component-Qxjnm7yi.cjs +0 -2
- package/build/component-Qxjnm7yi.cjs.map +0 -1
- package/build/component-WmDPzhcW.cjs +0 -2
- package/build/component-WmDPzhcW.cjs.map +0 -1
- package/build/component-accordion.cjs.js +0 -2
- package/build/component-accordion.cjs.js.map +0 -1
- package/build/component-accordion.d.ts +0 -100
- package/build/component-accordion.es.js +0 -11
- package/build/component-accordion.es.js.map +0 -1
- package/build/component-button-group.cjs.js +0 -2
- package/build/component-button-group.cjs.js.map +0 -1
- package/build/component-button-group.d.ts +0 -195
- package/build/component-button-group.es.js +0 -7
- package/build/component-button-group.es.js.map +0 -1
- package/build/component-button.cjs.js.map +0 -1
- package/build/component-button.es.js.map +0 -1
- package/build/component-checkbox-group.cjs.js +0 -2
- package/build/component-checkbox-group.cjs.js.map +0 -1
- package/build/component-checkbox-group.d.ts +0 -224
- package/build/component-checkbox-group.es.js +0 -12
- package/build/component-checkbox-group.es.js.map +0 -1
- package/build/component-checkbox.cjs.js.map +0 -1
- package/build/component-checkbox.es.js.map +0 -1
- package/build/component-date-picker.cjs.js.map +0 -1
- package/build/component-date-picker.es.js.map +0 -1
- package/build/component-gcvwlILJ.js +0 -76
- package/build/component-gcvwlILJ.js.map +0 -1
- package/build/component-icon.cjs.js.map +0 -1
- package/build/component-icon.es.js.map +0 -1
- package/build/component-image-button.cjs.js +0 -2
- package/build/component-image-button.cjs.js.map +0 -1
- package/build/component-image-button.d.ts +0 -215
- package/build/component-image-button.es.js +0 -5
- package/build/component-image-button.es.js.map +0 -1
- package/build/component-image-select.cjs.js +0 -2
- package/build/component-image-select.cjs.js.map +0 -1
- package/build/component-image-select.d.ts +0 -313
- package/build/component-image-select.es.js +0 -12
- package/build/component-image-select.es.js.map +0 -1
- package/build/component-image-slider.cjs.js +0 -2
- package/build/component-image-slider.cjs.js.map +0 -1
- package/build/component-image-slider.d.ts +0 -108
- package/build/component-image-slider.es.js +0 -9
- package/build/component-image-slider.es.js.map +0 -1
- package/build/component-image.cjs.js +0 -2
- package/build/component-image.cjs.js.map +0 -1
- package/build/component-image.d.ts +0 -51
- package/build/component-image.es.js +0 -7
- package/build/component-image.es.js.map +0 -1
- package/build/component-input-otp.cjs.js.map +0 -1
- package/build/component-input-otp.es.js.map +0 -1
- package/build/component-input.cjs.js.map +0 -1
- package/build/component-input.es.js.map +0 -1
- package/build/component-mFXKTq1K.cjs +0 -2
- package/build/component-mFXKTq1K.cjs.map +0 -1
- package/build/component-pagination.cjs.js.map +0 -1
- package/build/component-pagination.es.js.map +0 -1
- package/build/component-range.cjs.js +0 -2
- package/build/component-range.cjs.js.map +0 -1
- package/build/component-range.d.ts +0 -212
- package/build/component-range.es.js +0 -9
- package/build/component-range.es.js.map +0 -1
- package/build/component-ripple.cjs.js +0 -2
- package/build/component-ripple.cjs.js.map +0 -1
- package/build/component-ripple.d.ts +0 -47
- package/build/component-ripple.es.js +0 -12
- package/build/component-ripple.es.js.map +0 -1
- package/build/component-select.cjs.js.map +0 -1
- package/build/component-select.es.js.map +0 -1
- package/build/component-separator.cjs.js.map +0 -1
- package/build/component-separator.es.js.map +0 -1
- package/build/component-stack.cjs.js.map +0 -1
- package/build/component-stack.es.js.map +0 -1
- package/build/component-textarea.cjs.js.map +0 -1
- package/build/component-textarea.es.js.map +0 -1
- package/build/component-toggle.cjs.js.map +0 -1
- package/build/component-toggle.es.js.map +0 -1
- package/build/component-tooltip.cjs.js.map +0 -1
- package/build/component-tooltip.es.js.map +0 -1
- package/build/component-typography.cjs.js.map +0 -1
- package/build/component-typography.es.js.map +0 -1
- package/build/component.constants-BQOzGr0l.js +0 -757
- package/build/component.constants-BQOzGr0l.js.map +0 -1
- package/build/component.constants-CFLrPu5_.cjs +0 -2
- package/build/component.constants-CFLrPu5_.cjs.map +0 -1
- package/build/component.constants-DI22AYyi.js +0 -142
- package/build/component.constants-DI22AYyi.js.map +0 -1
- package/build/component.constants-DnHO8qFb.cjs +0 -2
- package/build/component.constants-DnHO8qFb.cjs.map +0 -1
- package/build/component.functions-D9ffjEok.cjs +0 -8
- package/build/component.functions-D9ffjEok.cjs.map +0 -1
- package/build/component.functions-DNW6h8kk.js +0 -12
- package/build/component.functions-DNW6h8kk.js.map +0 -1
- package/build/component.styles-BX2Aiqp_.cjs +0 -43
- package/build/component.styles-BX2Aiqp_.cjs.map +0 -1
- package/build/component.styles-C0oU5oX_.js +0 -59
- package/build/component.styles-C0oU5oX_.js.map +0 -1
- package/build/component.styles-CD6ZzRrk.cjs +0 -14
- package/build/component.styles-CD6ZzRrk.cjs.map +0 -1
- package/build/component.styles-SZ5VuhNG.js +0 -20
- package/build/component.styles-SZ5VuhNG.js.map +0 -1
- package/build/component.types-6hyRS9ZB.cjs +0 -2
- package/build/component.types-6hyRS9ZB.cjs.map +0 -1
- package/build/component.types-e2YpVj0l.js +0 -907
- package/build/component.types-e2YpVj0l.js.map +0 -1
- package/build/consts.cjs.js +0 -2
- package/build/consts.cjs.js.map +0 -1
- package/build/consts.d.ts +0 -77
- package/build/consts.es.js +0 -151
- package/build/consts.es.js.map +0 -1
- package/build/context-BK9a46O1.cjs +0 -4
- package/build/context-BK9a46O1.cjs.map +0 -1
- package/build/context-CPZf131N.cjs +0 -2
- package/build/context-CPZf131N.cjs.map +0 -1
- package/build/context-Cr80KOpF.js +0 -122
- package/build/context-Cr80KOpF.js.map +0 -1
- package/build/context-DssNKJ_n.cjs +0 -2
- package/build/context-DssNKJ_n.cjs.map +0 -1
- package/build/context-PFdUnKga.js +0 -44
- package/build/context-PFdUnKga.js.map +0 -1
- package/build/context-app.cjs.js.map +0 -1
- package/build/context-app.es.js.map +0 -1
- package/build/context-cookie.cjs.js.map +0 -1
- package/build/context-cookie.es.js.map +0 -1
- package/build/context-dialog.cjs.js.map +0 -1
- package/build/context-dialog.es.js.map +0 -1
- package/build/context-geolocation.cjs.js.map +0 -1
- package/build/context-geolocation.es.js.map +0 -1
- package/build/context-local-storage.cjs.js.map +0 -1
- package/build/context-local-storage.es.js.map +0 -1
- package/build/context-permission.cjs.js.map +0 -1
- package/build/context-permission.es.js.map +0 -1
- package/build/context-screen-width.cjs.js.map +0 -1
- package/build/context-screen-width.es.js.map +0 -1
- package/build/context-sonner.cjs.js.map +0 -1
- package/build/context-sonner.es.js.map +0 -1
- package/build/context-w9weDPCZ.js +0 -200
- package/build/context-w9weDPCZ.js.map +0 -1
- package/build/context.constants-B14bB8O1.js +0 -254
- package/build/context.constants-B14bB8O1.js.map +0 -1
- package/build/context.constants-BA1u2p1r.cjs +0 -32
- package/build/context.constants-BA1u2p1r.cjs.map +0 -1
- package/build/context.constants-BWLe7YHv.js +0 -12598
- package/build/context.constants-BWLe7YHv.js.map +0 -1
- package/build/context.constants-baqYH-_k.cjs +0 -1742
- package/build/context.constants-baqYH-_k.cjs.map +0 -1
- package/build/context.functions--v7FClEV.cjs +0 -2
- package/build/context.functions--v7FClEV.cjs.map +0 -1
- package/build/context.functions-B8FDl7nJ.js +0 -14
- package/build/context.functions-B8FDl7nJ.js.map +0 -1
- package/build/context.functions-CB6--UcR.js +0 -35
- package/build/context.functions-CB6--UcR.js.map +0 -1
- package/build/context.functions-CHaPcuVS.cjs +0 -2
- package/build/context.functions-CHaPcuVS.cjs.map +0 -1
- package/build/context.functions-CPP8X6so.js +0 -35
- package/build/context.functions-CPP8X6so.js.map +0 -1
- package/build/context.functions-ar41xFVo.cjs +0 -2
- package/build/context.functions-ar41xFVo.cjs.map +0 -1
- package/build/context.hooks-B-YcyJ5E.cjs +0 -2
- package/build/context.hooks-B-YcyJ5E.cjs.map +0 -1
- package/build/context.hooks-B9dsW2kz.js +0 -117
- package/build/context.hooks-B9dsW2kz.js.map +0 -1
- package/build/context.hooks-Bi7spFak.cjs +0 -2
- package/build/context.hooks-Bi7spFak.cjs.map +0 -1
- package/build/context.hooks-BnHnPV_i.js +0 -49
- package/build/context.hooks-BnHnPV_i.js.map +0 -1
- package/build/context.hooks-CDnjxy35.cjs +0 -2
- package/build/context.hooks-CDnjxy35.cjs.map +0 -1
- package/build/context.hooks-DDD8ffJI.cjs +0 -2
- package/build/context.hooks-DDD8ffJI.cjs.map +0 -1
- package/build/context.hooks-Df0m0Voe.js +0 -13
- package/build/context.hooks-Df0m0Voe.js.map +0 -1
- package/build/context.hooks-DjafkFMD.cjs +0 -2
- package/build/context.hooks-DjafkFMD.cjs.map +0 -1
- package/build/context.hooks-DpwnIiRj.cjs +0 -2
- package/build/context.hooks-DpwnIiRj.cjs.map +0 -1
- package/build/context.hooks-HEeFGka7.js +0 -13
- package/build/context.hooks-HEeFGka7.js.map +0 -1
- package/build/context.hooks-NDk5ehgk.js +0 -13
- package/build/context.hooks-NDk5ehgk.js.map +0 -1
- package/build/context.hooks-oclt34zD.js +0 -68
- package/build/context.hooks-oclt34zD.js.map +0 -1
- package/build/functions.cjs.js +0 -2
- package/build/functions.cjs.js.map +0 -1
- package/build/functions.es.js +0 -50
- package/build/functions.es.js.map +0 -1
- package/build/index.cjs.js.map +0 -1
- package/build/index.es.js.map +0 -1
- package/build/jsx-runtime-C6yv_9g1.cjs +0 -11
- package/build/jsx-runtime-C6yv_9g1.cjs.map +0 -1
- package/build/jsx-runtime-DZS36FSE.js +0 -316
- package/build/jsx-runtime-DZS36FSE.js.map +0 -1
- package/build/motion-DrSN18V7.cjs +0 -2
- package/build/motion-DrSN18V7.cjs.map +0 -1
- package/build/motion-K7hUU4gL.js +0 -85
- package/build/motion-K7hUU4gL.js.map +0 -1
- package/build/style-BfuEu91g.js +0 -176
- package/build/style-BfuEu91g.js.map +0 -1
- package/build/style-Drq-Q1Im.cjs +0 -136
- package/build/style-Drq-Q1Im.cjs.map +0 -1
- package/build/style-add.cjs.js +0 -2
- package/build/style-add.cjs.js.map +0 -1
- package/build/style-add.d.ts +0 -88
- package/build/style-add.es.js +0 -17
- package/build/style-add.es.js.map +0 -1
- package/build/style-error.cjs.js +0 -2
- package/build/style-error.cjs.js.map +0 -1
- package/build/style-error.d.ts +0 -99
- package/build/style-error.es.js +0 -7
- package/build/style-error.es.js.map +0 -1
- package/build/style-fRZ6xrVp.cjs +0 -10
- package/build/style-fRZ6xrVp.cjs.map +0 -1
- package/build/style-motion.cjs.js.map +0 -1
- package/build/style-motion.es.js.map +0 -1
- package/build/style-plT9Ah7t.js +0 -33
- package/build/style-plT9Ah7t.js.map +0 -1
- package/build/style-sx.cjs.js +0 -2
- package/build/style-sx.cjs.js.map +0 -1
- package/build/style-sx.d.ts +0 -33
- package/build/style-sx.es.js +0 -5
- package/build/style-sx.es.js.map +0 -1
- package/build/style-theme.cjs.js +0 -2
- package/build/style-theme.cjs.js.map +0 -1
- package/build/style-theme.d.ts +0 -293
- package/build/style-theme.es.js +0 -16
- package/build/style-theme.es.js.map +0 -1
- package/build/types.cjs.js +0 -2
- package/build/types.cjs.js.map +0 -1
- package/build/types.d.ts +0 -27
- package/build/types.es.js +0 -2
- package/build/types.es.js.map +0 -1
- package/build/use-BF8VW4MA.cjs +0 -16
- package/build/use-BF8VW4MA.cjs.map +0 -1
- package/build/use-Bp8UVw4Y.js +0 -16
- package/build/use-Bp8UVw4Y.js.map +0 -1
- package/build/use-C7vngeRk.js +0 -882
- package/build/use-C7vngeRk.js.map +0 -1
- package/build/use-DdGWsOBo.js +0 -1577
- package/build/use-DdGWsOBo.js.map +0 -1
- package/build/use-IhzeVumv.cjs +0 -2
- package/build/use-IhzeVumv.cjs.map +0 -1
- package/build/use-zW3LuRc_.cjs +0 -2
- package/build/use-zW3LuRc_.cjs.map +0 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { CSS_CLASS, CSS_VARS, CSS_VARS_RAW } from './constants';
|
|
2
|
+
export type { IContainer, ILayoutValue, ISx, IThemeBreakpoint, IThemeGlobal, IThemeOrientation, IThemePalette, IThemeSize, IThemeTypographyFontFamily, IThemeTypographyHeading, IThemeTypographyWeight, ITypography, } from './types';
|
|
3
|
+
export { EXTRA_VALUE } from './types';
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { CSS_CLASS, CSS_VARS } from './constants';
|
|
3
|
+
type ITypographyDefault = {
|
|
4
|
+
align?: CSSProperties['textAlign'];
|
|
5
|
+
color?: IThemePalette;
|
|
6
|
+
cursor?: CSSProperties['cursor'];
|
|
7
|
+
decoration?: CSSProperties['textDecoration'];
|
|
8
|
+
family?: IThemeTypographyFontFamily;
|
|
9
|
+
transition?: IThemeTransition;
|
|
10
|
+
isBold?: boolean;
|
|
11
|
+
flex?: string;
|
|
12
|
+
height?: number | string;
|
|
13
|
+
isHoverUnderlining?: boolean;
|
|
14
|
+
letterSpacing?: CSSProperties['letterSpacing'];
|
|
15
|
+
line?: number;
|
|
16
|
+
overflow?: CSSProperties['overflow'];
|
|
17
|
+
shadow?: 'shadowPulse';
|
|
18
|
+
transform?: CSSProperties['textTransform'];
|
|
19
|
+
weight?: IThemeTypographyWeight;
|
|
20
|
+
wrap?: CSSProperties['textWrap'];
|
|
21
|
+
isNoUserSelect?: boolean;
|
|
22
|
+
};
|
|
23
|
+
type ITypographySize = ITypographyDefault & {
|
|
24
|
+
size?: number | string;
|
|
25
|
+
};
|
|
26
|
+
type ITypographyVariant = ITypographyDefault & {
|
|
27
|
+
variant: IThemeTypographyHeading;
|
|
28
|
+
};
|
|
29
|
+
export type ITypography = ITypographySize | ITypographyVariant;
|
|
30
|
+
export type IContainer = CSSProperties;
|
|
31
|
+
export type ILayoutValue<A> = {
|
|
32
|
+
default?: A;
|
|
33
|
+
breakpoints?: Record<IThemeBreakpoint, A>;
|
|
34
|
+
orientations?: Record<IThemeOrientation, A>;
|
|
35
|
+
};
|
|
36
|
+
export type ILayoutResponsive<A> = ILayoutValue<A>;
|
|
37
|
+
export type ISx = {
|
|
38
|
+
sx?: CSSProperties;
|
|
39
|
+
};
|
|
40
|
+
export type IThemeTypographyHeading = keyof typeof CSS_VARS.font.sizeHeading;
|
|
41
|
+
export type IThemeTypographyWeight = '100' | '300' | '400' | '500' | '700' | '900';
|
|
42
|
+
export type IThemeTypographyFontFamily = 'Inter' | 'Roboto' | 'Work Sans' | 'Roboto Mono' | 'Manrope';
|
|
43
|
+
export type IThemeSize = 'large' | 'largeMedium' | 'medium' | 'mediumSmall' | 'small';
|
|
44
|
+
export type IThemeGlobal = typeof CSS_VARS;
|
|
45
|
+
export type IThemeBreakpoint = 'tablet' | 'mobile';
|
|
46
|
+
export type IThemeOrientation = 'landscape' | 'portrait';
|
|
47
|
+
export type IThemePalette = keyof typeof CSS_VARS.palette;
|
|
48
|
+
export type IThemeShadow = keyof typeof CSS_CLASS.shadow;
|
|
49
|
+
export type IThemeGenreButton = keyof typeof CSS_VARS.genre.button;
|
|
50
|
+
export type IThemeGenreSonner = keyof typeof CSS_VARS.genre.button;
|
|
51
|
+
export type IThemeGenreCheckbox = keyof typeof CSS_VARS.genre.checkbox;
|
|
52
|
+
export type IThemeGenreToggle = keyof typeof CSS_VARS.genre.toggle;
|
|
53
|
+
export type IThemeGenreInput = keyof typeof CSS_VARS.genre.input;
|
|
54
|
+
export type IThemeGenreDatePicker = keyof typeof CSS_VARS.genre.select;
|
|
55
|
+
export type IThemeGenreTextArea = keyof typeof CSS_VARS.genre.textarea;
|
|
56
|
+
export type IThemeGenrePopover = keyof typeof CSS_VARS.genre.popover;
|
|
57
|
+
export type IThemeGenreSelect = keyof typeof CSS_VARS.genre.select;
|
|
58
|
+
export type IThemeControl = keyof typeof CSS_CLASS.control;
|
|
59
|
+
export type IThemeScrollbarGutter = keyof typeof CSS_CLASS.scrollbarGutter;
|
|
60
|
+
export type IThemeTransition = keyof typeof CSS_CLASS.transition;
|
|
61
|
+
export declare const EXTRA_VALUE: {
|
|
62
|
+
font: {
|
|
63
|
+
height: number;
|
|
64
|
+
size: number;
|
|
65
|
+
};
|
|
66
|
+
sizeToController: Record<IThemeSize, IThemeTypographyHeading>;
|
|
67
|
+
};
|
|
68
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
const f=require("./chunk-Dd8m0Ver.cjs"),t=require("./utils-DtinAjAU.cjs"),s=require("./functions-Dwo54amB.cjs"),R=require("./hooks-use-merge-refs.cjs.js"),y=require("./hooks-use-typography-styles.cjs.js"),b=require("./error-DzkkNL2H.cjs");let r=require("react/jsx-runtime"),i=require("react");var S=t.EXTRA_VALUE.font.size*t.EXTRA_VALUE.font.height,w=e=>{const o=(0,i.useRef)(null),m=R.useMergeRefs([o,e.ref]),l=(0,i.useMemo)(()=>e.maxRows?e.maxRows*S:0,[e.maxRows]),c=(0,i.useMemo)(()=>e.minRows?e.minRows*S:S,[e.minRows]),u=(0,i.useCallback)(()=>{const n=o.current;if(n&&e.isAutoHeight){n.style.height="auto";const a=Math.min(n.scrollHeight,l);n.style.height=`${a}px`}},[e.isAutoHeight,l]),h=(0,i.useCallback)(n=>{if(e.isNoSpaces){const a=n.replace(/\s+/g,"");e.onChange?.(a)}else e.onChange?.(n)},[e.isNoSpaces,e.onChange]);(0,i.useEffect)(()=>{e.isAutoHeight&&requestAnimationFrame(u)},[e.value,u,e.isAutoHeight]);const{className:d,style:g}=y.useTypographyStyles({sx:{family:e.isNiceNumber?"Roboto Mono":e.sxTypography?.family,size:16,weight:e.isBold?"700":"400",height:"1.2",...e?.sxTypography}}),{className:C,style:x}=(0,i.useMemo)(()=>{const n=s.setClasses([t.CSS_CLASS.component.textarea.wrapper,t.CSS_CLASS.transition.color,e.error?.isError&&t.CSS_CLASS.isError,t.CSS_CLASS.control[e.isDisabled?"none":e.control??"boxShadow"],e.isZeroRadius&&t.CSS_CLASS.component.textarea.wrapperIsZeroRadius,e.isHidden&&t.CSS_CLASS.component.textarea.wrapperIsHidden,e.isHiddenBorder&&t.CSS_CLASS.component.textarea.wrapperIsHiddenBorder,e.isFullRadius&&t.CSS_CLASS.component.textarea.wrapperIsFullRadius,!e.isResize&&t.CSS_CLASS.component.textarea.wrapperIsNotResize,e.className]),a={};return a[t.CSS_VARS_RAW.component.textarea.radius]=t.CSS_VARS.size[e.size].radius,a[t.CSS_VARS_RAW.component.textarea.borderColor]=t.CSS_VARS.genre.textarea[e.genre].border,a[t.CSS_VARS_RAW.component.textarea.background]=t.CSS_VARS.genre.textarea[e.genre].background,a[t.CSS_VARS_RAW.component.textarea.padding]=`calc(${t.CSS_VARS.size[e.size].padding} - 4px) 0px calc(${t.CSS_VARS.size[e.size].padding} - 4px) ${t.CSS_VARS.size[e.size].padding}`,{className:n,style:s.setStyles([Object.keys(a).length?a:void 0,e.style])}},[e.className,e.size,e.style,e.isDisabled,e.isHidden,e.isFullRadius,e.isHiddenBorder,e.isZeroRadius,e.genre,e.control,e.error?.isError,e.isResize]),{className:_,style:A}=(0,i.useMemo)(()=>{const n=s.setClasses([t.CSS_CLASS.component.textarea.root,t.CSS_CLASS.scrollbarGutter.stable,t.CSS_CLASS.transition.color,d]),a={};return a[t.CSS_VARS_RAW.component.textarea.color]=t.CSS_VARS.genre.textarea[e.genre].color,a[t.CSS_VARS_RAW.component.textarea.placeholderColor]=t.CSS_VARS.genre.textarea[e.genre].placeholder,{className:n,style:s.setStyles([e.style,g,Object.keys(a).length?a:void 0])}},[e.style,e.genre,d,g]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:C,style:x,children:(0,r.jsx)("textarea",{className:_,tabIndex:0,ref:m,maxLength:e.maxLength,minLength:e.minLength,disabled:e.isDisabled,readOnly:e.isReadOnly,required:e.isRequired,defaultValue:e.defaultValue===null?"":e.defaultValue,value:e.value===null?"":e.value,rows:e.minRows,placeholder:e.placeholder,onChange:n=>h(n.target.value),onBlur:e.onBlur,onFocus:e.onFocus,onKeyDown:e.onKeyDown,onMouseDown:e.onMouseDown,onClick:e.onClick,name:e.name,"aria-label":e.ariaLabel??e.name,autoComplete:e.autoComplete,id:e.id,style:{...A,minHeight:`${c}px`,maxHeight:e.isResize?"none":e.isAutoHeight?`${l}px`:`${c}px`}})}),e?.error?.isError&&(0,r.jsx)(b.ErrorMessage,{size:e?.error.size??e.size,sxTypography:{size:"16px",weight:"400",...e?.error.sxTypography},...e.error})]})};Object.defineProperty(exports,"TextArea",{enumerable:!0,get:function(){return w}});
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=textarea-CbZSeqGR.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textarea-CbZSeqGR.cjs","names":[],"sources":["../src/components/textarea/component.tsx"],"sourcesContent":["import { ErrorMessage } from '@local/components/error';\nimport { useMergeRefs } from '@local/hooks/use-merge-refs';\nimport { useTypographyStyles } from '@local/hooks/use-typography-styles/use';\nimport { CSS_CLASS, CSS_VARS, CSS_VARS_RAW, EXTRA_VALUE } from '@local/styles/utils';\nimport { setClasses, setStyles } from '@local/styles/utils/functions';\n\nimport { useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport { ITextArea } from './component.types';\n\nconst lineHeight = EXTRA_VALUE.font.size * EXTRA_VALUE.font.height;\n\nexport const TextArea = (props: ITextArea) => {\n const refLocal = useRef<HTMLTextAreaElement>(null);\n const ref = useMergeRefs([refLocal, props.ref]);\n\n const maxHeight = useMemo(() => (props.maxRows ? props.maxRows * lineHeight : 0), [props.maxRows]);\n const minHeight = useMemo(() => (props.minRows ? props.minRows * lineHeight : lineHeight), [props.minRows]);\n\n const resizeTextarea = useCallback(() => {\n const el = refLocal.current;\n if (el && props.isAutoHeight) {\n el.style.height = 'auto';\n const newHeight = Math.min(el.scrollHeight, maxHeight);\n el.style.height = `${newHeight}px`;\n }\n }, [props.isAutoHeight, maxHeight]);\n\n const handleOnChange = useCallback(\n (value: string) => {\n if (props.isNoSpaces) {\n const valueWithoutSpaces = value.replace(/\\s+/g, '');\n props.onChange?.(valueWithoutSpaces);\n } else {\n props.onChange?.(value);\n }\n },\n [props.isNoSpaces, props.onChange],\n );\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>\n useEffect(() => {\n if (props.isAutoHeight) {\n requestAnimationFrame(resizeTextarea);\n }\n }, [props.value, resizeTextarea, props.isAutoHeight]);\n\n const { className: classNameTypography, style: styleTypography } = useTypographyStyles({\n sx: {\n family: props.isNiceNumber ? 'Roboto Mono' : props.sxTypography?.family,\n size: 16,\n weight: props.isBold ? '700' : '400',\n height: '1.2',\n ...props?.sxTypography,\n },\n });\n\n const { className, style } = useMemo(() => {\n const className = setClasses([\n CSS_CLASS.component.textarea.wrapper,\n CSS_CLASS.transition.color,\n props.error?.isError && CSS_CLASS.isError,\n CSS_CLASS.control[props.isDisabled ? 'none' : (props.control ?? 'boxShadow')],\n props.isZeroRadius && CSS_CLASS.component.textarea.wrapperIsZeroRadius,\n props.isHidden && CSS_CLASS.component.textarea.wrapperIsHidden,\n props.isHiddenBorder && CSS_CLASS.component.textarea.wrapperIsHiddenBorder,\n props.isFullRadius && CSS_CLASS.component.textarea.wrapperIsFullRadius,\n !props.isResize && CSS_CLASS.component.textarea.wrapperIsNotResize,\n props.className,\n ]);\n\n const vars: Record<string, string> = {};\n\n vars[CSS_VARS_RAW.component.textarea.radius] = CSS_VARS.size[props.size].radius;\n vars[CSS_VARS_RAW.component.textarea.borderColor] = CSS_VARS.genre.textarea[props.genre].border;\n vars[CSS_VARS_RAW.component.textarea.background] = CSS_VARS.genre.textarea[props.genre].background;\n vars[CSS_VARS_RAW.component.textarea.padding] =\n `calc(${CSS_VARS.size[props.size].padding} - 4px) 0px calc(${CSS_VARS.size[props.size].padding} - 4px) ${CSS_VARS.size[props.size].padding}`;\n\n const style = setStyles([Object.keys(vars).length ? vars : undefined, props.style]);\n\n return { className, style };\n }, [\n props.className,\n props.size,\n props.style,\n props.isDisabled,\n props.isHidden,\n props.isFullRadius,\n props.isHiddenBorder,\n props.isZeroRadius,\n props.genre,\n props.control,\n props.error?.isError,\n props.isResize,\n ]);\n\n const { className: classNameTextarea, style: styleTextarea } = useMemo(() => {\n const className = setClasses([\n CSS_CLASS.component.textarea.root,\n CSS_CLASS.scrollbarGutter.stable,\n CSS_CLASS.transition.color,\n classNameTypography,\n ]);\n\n const vars: Record<string, string> = {};\n\n vars[CSS_VARS_RAW.component.textarea.color] = CSS_VARS.genre.textarea[props.genre].color;\n vars[CSS_VARS_RAW.component.textarea.placeholderColor] = CSS_VARS.genre.textarea[props.genre].placeholder;\n\n const style = setStyles([props.style, styleTypography, Object.keys(vars).length ? vars : undefined]);\n\n return { className, style };\n }, [props.style, props.genre, classNameTypography, styleTypography]);\n\n return (\n <>\n <div className={className} style={style}>\n <textarea\n className={classNameTextarea}\n tabIndex={0}\n ref={ref}\n maxLength={props.maxLength}\n minLength={props.minLength}\n disabled={props.isDisabled}\n readOnly={props.isReadOnly}\n required={props.isRequired}\n defaultValue={props.defaultValue === null ? '' : props.defaultValue}\n value={props.value === null ? '' : props.value}\n rows={props.minRows}\n placeholder={props.placeholder}\n onChange={(event) => handleOnChange(event.target.value)}\n onBlur={props.onBlur}\n onFocus={props.onFocus}\n onKeyDown={props.onKeyDown}\n onMouseDown={props.onMouseDown}\n onClick={props.onClick}\n name={props.name}\n aria-label={props.ariaLabel ?? props.name}\n autoComplete={props.autoComplete}\n id={props.id}\n style={{\n ...styleTextarea,\n minHeight: `${minHeight}px`,\n maxHeight: props.isResize ? 'none' : props.isAutoHeight ? `${maxHeight}px` : `${minHeight}px`,\n }}\n />\n </div>\n\n {props?.error?.isError && (\n <ErrorMessage\n size={props?.error.size ?? props.size}\n sxTypography={{ size: '16px', weight: '400', ...props?.error.sxTypography }}\n {...props.error}\n />\n )}\n </>\n );\n};\n"],"mappings":"qSAUA,IAAM,EAAa,EAAA,YAAY,KAAK,KAAO,EAAA,YAAY,KAAK,OAE/C,EAAY,GAAqB,CAC5C,MAAM,KAAA,EAAA,QAAuC,IAAA,EACvC,EAAM,EAAA,aAAa,CAAC,EAAU,EAAM,GAAA,CAAI,EAExC,KAAA,EAAA,SAAA,IAA2B,EAAM,QAAU,EAAM,QAAU,EAAa,EAAI,CAAC,EAAM,OAAA,CAAQ,EAC3F,KAAA,EAAA,SAAA,IAA2B,EAAM,QAAU,EAAM,QAAU,EAAa,EAAa,CAAC,EAAM,OAAA,CAAQ,EAEpG,KAAA,EAAA,aAAA,IAAmC,CACvC,MAAM,EAAK,EAAS,QACpB,GAAI,GAAM,EAAM,aAAc,CAC5B,EAAG,MAAM,OAAS,OAClB,MAAM,EAAY,KAAK,IAAI,EAAG,aAAc,CAAA,EAC5C,EAAG,MAAM,OAAS,GAAG,CAAA,OAEtB,CAAC,EAAM,aAAc,CAAA,CAAU,EAE5B,KAAA,EAAA,aACH,GAAkB,CACjB,GAAI,EAAM,WAAY,CACpB,MAAM,E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EAAM,WAChB,aAAc,EAAM,eAAiB,KAAO,GAAK,EAAM,aACvD,MAAO,EAAM,QAAU,KAAO,GAAK,EAAM,MACzC,KAAM,EAAM,QACZ,YAAa,EAAM,YACnB,SAAW,GAAU,EAAe,EAAM,OAAO,KAAA,EACjD,OAAQ,EAAM,OACd,QAAS,EAAM,QACf,UAAW,EAAM,UACjB,YAAa,EAAM,YACnB,QAAS,EAAM,QACf,KAAM,EAAM,KACZ,aAAY,EAAM,WAAa,EAAM,KACrC,aAAc,EAAM,aACpB,GAAI,EAAM,GACV,MAAO,CACL,GAAG,EACH,UAAW,GAAG,CAAA,KACd,UAAW,EAAM,SAAW,OAAS,EAAM,aAAe,GAAG,CAAA,KAAgB,GAAG,CAAA,MAElF,EACE,EAEL,GAAO,OAAO,YACb,EAAA,KAAC,EAAA,aAAD,CACE,KAAM,GAAO,MAAM,MAAQ,EAAM,KACjC,aAAc,CAAE,KAAM,OAAQ,OAAQ,MAAO,GAAG,GAAO,MAAM,cAC7D,GAAI,EAAM,MACV,CAAA,CAEH,CAAA"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { i as l, n, r as i, t as x } from "./utils-Cona48dZ.js";
|
|
2
|
+
import { n as y, t as R } from "./functions-CLGf7hqw.js";
|
|
3
|
+
import { useMergeRefs as N } from "./hooks-use-merge-refs.es.js";
|
|
4
|
+
import { useTypographyStyles as A } from "./hooks-use-typography-styles.es.js";
|
|
5
|
+
import { t as v } from "./error-L2fvWcNv.js";
|
|
6
|
+
import { Fragment as T, jsx as r, jsxs as E } from "react/jsx-runtime";
|
|
7
|
+
import { useCallback as f, useEffect as L, useMemo as s, useRef as k } from "react";
|
|
8
|
+
var c = x.font.size * x.font.height, O = (e) => {
|
|
9
|
+
const m = k(null), w = N([m, e.ref]), o = s(() => e.maxRows ? e.maxRows * c : 0, [e.maxRows]), d = s(() => e.minRows ? e.minRows * c : c, [e.minRows]), g = f(() => {
|
|
10
|
+
const t = m.current;
|
|
11
|
+
if (t && e.isAutoHeight) {
|
|
12
|
+
t.style.height = "auto";
|
|
13
|
+
const a = Math.min(t.scrollHeight, o);
|
|
14
|
+
t.style.height = `${a}px`;
|
|
15
|
+
}
|
|
16
|
+
}, [e.isAutoHeight, o]), z = f((t) => {
|
|
17
|
+
if (e.isNoSpaces) {
|
|
18
|
+
const a = t.replace(/\s+/g, "");
|
|
19
|
+
e.onChange?.(a);
|
|
20
|
+
} else e.onChange?.(t);
|
|
21
|
+
}, [e.isNoSpaces, e.onChange]);
|
|
22
|
+
L(() => {
|
|
23
|
+
e.isAutoHeight && requestAnimationFrame(g);
|
|
24
|
+
}, [
|
|
25
|
+
e.value,
|
|
26
|
+
g,
|
|
27
|
+
e.isAutoHeight
|
|
28
|
+
]);
|
|
29
|
+
const { className: u, style: h } = A({ sx: {
|
|
30
|
+
family: e.isNiceNumber ? "Roboto Mono" : e.sxTypography?.family,
|
|
31
|
+
size: 16,
|
|
32
|
+
weight: e.isBold ? "700" : "400",
|
|
33
|
+
height: "1.2",
|
|
34
|
+
...e?.sxTypography
|
|
35
|
+
} }), { className: b, style: H } = s(() => {
|
|
36
|
+
const t = R([
|
|
37
|
+
n.component.textarea.wrapper,
|
|
38
|
+
n.transition.color,
|
|
39
|
+
e.error?.isError && n.isError,
|
|
40
|
+
n.control[e.isDisabled ? "none" : e.control ?? "boxShadow"],
|
|
41
|
+
e.isZeroRadius && n.component.textarea.wrapperIsZeroRadius,
|
|
42
|
+
e.isHidden && n.component.textarea.wrapperIsHidden,
|
|
43
|
+
e.isHiddenBorder && n.component.textarea.wrapperIsHiddenBorder,
|
|
44
|
+
e.isFullRadius && n.component.textarea.wrapperIsFullRadius,
|
|
45
|
+
!e.isResize && n.component.textarea.wrapperIsNotResize,
|
|
46
|
+
e.className
|
|
47
|
+
]), a = {};
|
|
48
|
+
return a[l.component.textarea.radius] = i.size[e.size].radius, a[l.component.textarea.borderColor] = i.genre.textarea[e.genre].border, a[l.component.textarea.background] = i.genre.textarea[e.genre].background, a[l.component.textarea.padding] = `calc(${i.size[e.size].padding} - 4px) 0px calc(${i.size[e.size].padding} - 4px) ${i.size[e.size].padding}`, {
|
|
49
|
+
className: t,
|
|
50
|
+
style: y([Object.keys(a).length ? a : void 0, e.style])
|
|
51
|
+
};
|
|
52
|
+
}, [
|
|
53
|
+
e.className,
|
|
54
|
+
e.size,
|
|
55
|
+
e.style,
|
|
56
|
+
e.isDisabled,
|
|
57
|
+
e.isHidden,
|
|
58
|
+
e.isFullRadius,
|
|
59
|
+
e.isHiddenBorder,
|
|
60
|
+
e.isZeroRadius,
|
|
61
|
+
e.genre,
|
|
62
|
+
e.control,
|
|
63
|
+
e.error?.isError,
|
|
64
|
+
e.isResize
|
|
65
|
+
]), { className: C, style: S } = s(() => {
|
|
66
|
+
const t = R([
|
|
67
|
+
n.component.textarea.root,
|
|
68
|
+
n.scrollbarGutter.stable,
|
|
69
|
+
n.transition.color,
|
|
70
|
+
u
|
|
71
|
+
]), a = {};
|
|
72
|
+
return a[l.component.textarea.color] = i.genre.textarea[e.genre].color, a[l.component.textarea.placeholderColor] = i.genre.textarea[e.genre].placeholder, {
|
|
73
|
+
className: t,
|
|
74
|
+
style: y([
|
|
75
|
+
e.style,
|
|
76
|
+
h,
|
|
77
|
+
Object.keys(a).length ? a : void 0
|
|
78
|
+
])
|
|
79
|
+
};
|
|
80
|
+
}, [
|
|
81
|
+
e.style,
|
|
82
|
+
e.genre,
|
|
83
|
+
u,
|
|
84
|
+
h
|
|
85
|
+
]);
|
|
86
|
+
return /* @__PURE__ */ E(T, { children: [/* @__PURE__ */ r("div", {
|
|
87
|
+
className: b,
|
|
88
|
+
style: H,
|
|
89
|
+
children: /* @__PURE__ */ r("textarea", {
|
|
90
|
+
className: C,
|
|
91
|
+
tabIndex: 0,
|
|
92
|
+
ref: w,
|
|
93
|
+
maxLength: e.maxLength,
|
|
94
|
+
minLength: e.minLength,
|
|
95
|
+
disabled: e.isDisabled,
|
|
96
|
+
readOnly: e.isReadOnly,
|
|
97
|
+
required: e.isRequired,
|
|
98
|
+
defaultValue: e.defaultValue === null ? "" : e.defaultValue,
|
|
99
|
+
value: e.value === null ? "" : e.value,
|
|
100
|
+
rows: e.minRows,
|
|
101
|
+
placeholder: e.placeholder,
|
|
102
|
+
onChange: (t) => z(t.target.value),
|
|
103
|
+
onBlur: e.onBlur,
|
|
104
|
+
onFocus: e.onFocus,
|
|
105
|
+
onKeyDown: e.onKeyDown,
|
|
106
|
+
onMouseDown: e.onMouseDown,
|
|
107
|
+
onClick: e.onClick,
|
|
108
|
+
name: e.name,
|
|
109
|
+
"aria-label": e.ariaLabel ?? e.name,
|
|
110
|
+
autoComplete: e.autoComplete,
|
|
111
|
+
id: e.id,
|
|
112
|
+
style: {
|
|
113
|
+
...S,
|
|
114
|
+
minHeight: `${d}px`,
|
|
115
|
+
maxHeight: e.isResize ? "none" : e.isAutoHeight ? `${o}px` : `${d}px`
|
|
116
|
+
}
|
|
117
|
+
})
|
|
118
|
+
}), e?.error?.isError && /* @__PURE__ */ r(v, {
|
|
119
|
+
size: e?.error.size ?? e.size,
|
|
120
|
+
sxTypography: {
|
|
121
|
+
size: "16px",
|
|
122
|
+
weight: "400",
|
|
123
|
+
...e?.error.sxTypography
|
|
124
|
+
},
|
|
125
|
+
...e.error
|
|
126
|
+
})] });
|
|
127
|
+
};
|
|
128
|
+
export {
|
|
129
|
+
O as t
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
//# sourceMappingURL=textarea-ChkjV_Ha.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textarea-ChkjV_Ha.js","names":[],"sources":["../src/components/textarea/component.tsx"],"sourcesContent":["import { ErrorMessage } from '@local/components/error';\nimport { useMergeRefs } from '@local/hooks/use-merge-refs';\nimport { useTypographyStyles } from '@local/hooks/use-typography-styles/use';\nimport { CSS_CLASS, CSS_VARS, CSS_VARS_RAW, EXTRA_VALUE } from '@local/styles/utils';\nimport { setClasses, setStyles } from '@local/styles/utils/functions';\n\nimport { useCallback, useEffect, useMemo, useRef } from 'react';\n\nimport { ITextArea } from './component.types';\n\nconst lineHeight = EXTRA_VALUE.font.size * EXTRA_VALUE.font.height;\n\nexport const TextArea = (props: ITextArea) => {\n const refLocal = useRef<HTMLTextAreaElement>(null);\n const ref = useMergeRefs([refLocal, props.ref]);\n\n const maxHeight = useMemo(() => (props.maxRows ? props.maxRows * lineHeight : 0), [props.maxRows]);\n const minHeight = useMemo(() => (props.minRows ? props.minRows * lineHeight : lineHeight), [props.minRows]);\n\n const resizeTextarea = useCallback(() => {\n const el = refLocal.current;\n if (el && props.isAutoHeight) {\n el.style.height = 'auto';\n const newHeight = Math.min(el.scrollHeight, maxHeight);\n el.style.height = `${newHeight}px`;\n }\n }, [props.isAutoHeight, maxHeight]);\n\n const handleOnChange = useCallback(\n (value: string) => {\n if (props.isNoSpaces) {\n const valueWithoutSpaces = value.replace(/\\s+/g, '');\n props.onChange?.(valueWithoutSpaces);\n } else {\n props.onChange?.(value);\n }\n },\n [props.isNoSpaces, props.onChange],\n );\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>\n useEffect(() => {\n if (props.isAutoHeight) {\n requestAnimationFrame(resizeTextarea);\n }\n }, [props.value, resizeTextarea, props.isAutoHeight]);\n\n const { className: classNameTypography, style: styleTypography } = useTypographyStyles({\n sx: {\n family: props.isNiceNumber ? 'Roboto Mono' : props.sxTypography?.family,\n size: 16,\n weight: props.isBold ? '700' : '400',\n height: '1.2',\n ...props?.sxTypography,\n },\n });\n\n const { className, style } = useMemo(() => {\n const className = setClasses([\n CSS_CLASS.component.textarea.wrapper,\n CSS_CLASS.transition.color,\n props.error?.isError && CSS_CLASS.isError,\n CSS_CLASS.control[props.isDisabled ? 'none' : (props.control ?? 'boxShadow')],\n props.isZeroRadius && CSS_CLASS.component.textarea.wrapperIsZeroRadius,\n props.isHidden && CSS_CLASS.component.textarea.wrapperIsHidden,\n props.isHiddenBorder && CSS_CLASS.component.textarea.wrapperIsHiddenBorder,\n props.isFullRadius && CSS_CLASS.component.textarea.wrapperIsFullRadius,\n !props.isResize && CSS_CLASS.component.textarea.wrapperIsNotResize,\n props.className,\n ]);\n\n const vars: Record<string, string> = {};\n\n vars[CSS_VARS_RAW.component.textarea.radius] = CSS_VARS.size[props.size].radius;\n vars[CSS_VARS_RAW.component.textarea.borderColor] = CSS_VARS.genre.textarea[props.genre].border;\n vars[CSS_VARS_RAW.component.textarea.background] = CSS_VARS.genre.textarea[props.genre].background;\n vars[CSS_VARS_RAW.component.textarea.padding] =\n `calc(${CSS_VARS.size[props.size].padding} - 4px) 0px calc(${CSS_VARS.size[props.size].padding} - 4px) ${CSS_VARS.size[props.size].padding}`;\n\n const style = setStyles([Object.keys(vars).length ? vars : undefined, props.style]);\n\n return { className, style };\n }, [\n props.className,\n props.size,\n props.style,\n props.isDisabled,\n props.isHidden,\n props.isFullRadius,\n props.isHiddenBorder,\n props.isZeroRadius,\n props.genre,\n props.control,\n props.error?.isError,\n props.isResize,\n ]);\n\n const { className: classNameTextarea, style: styleTextarea } = useMemo(() => {\n const className = setClasses([\n CSS_CLASS.component.textarea.root,\n CSS_CLASS.scrollbarGutter.stable,\n CSS_CLASS.transition.color,\n classNameTypography,\n ]);\n\n const vars: Record<string, string> = {};\n\n vars[CSS_VARS_RAW.component.textarea.color] = CSS_VARS.genre.textarea[props.genre].color;\n vars[CSS_VARS_RAW.component.textarea.placeholderColor] = CSS_VARS.genre.textarea[props.genre].placeholder;\n\n const style = setStyles([props.style, styleTypography, Object.keys(vars).length ? vars : undefined]);\n\n return { className, style };\n }, [props.style, props.genre, classNameTypography, styleTypography]);\n\n return (\n <>\n <div className={className} style={style}>\n <textarea\n className={classNameTextarea}\n tabIndex={0}\n ref={ref}\n maxLength={props.maxLength}\n minLength={props.minLength}\n disabled={props.isDisabled}\n readOnly={props.isReadOnly}\n required={props.isRequired}\n defaultValue={props.defaultValue === null ? '' : props.defaultValue}\n value={props.value === null ? '' : props.value}\n rows={props.minRows}\n placeholder={props.placeholder}\n onChange={(event) => handleOnChange(event.target.value)}\n onBlur={props.onBlur}\n onFocus={props.onFocus}\n onKeyDown={props.onKeyDown}\n onMouseDown={props.onMouseDown}\n onClick={props.onClick}\n name={props.name}\n aria-label={props.ariaLabel ?? props.name}\n autoComplete={props.autoComplete}\n id={props.id}\n style={{\n ...styleTextarea,\n minHeight: `${minHeight}px`,\n maxHeight: props.isResize ? 'none' : props.isAutoHeight ? `${maxHeight}px` : `${minHeight}px`,\n }}\n />\n </div>\n\n {props?.error?.isError && (\n <ErrorMessage\n size={props?.error.size ?? props.size}\n sxTypography={{ size: '16px', weight: '400', ...props?.error.sxTypography }}\n {...props.error}\n />\n )}\n </>\n );\n};\n"],"mappings":";;;;;;;AAUA,IAAM,IAAa,EAAY,KAAK,OAAO,EAAY,KAAK,QAE/C,IAAA,CAAY,MAAqB;AAC5C,QAAM,IAAW,EAA4B,IAAA,GACvC,IAAM,EAAa,CAAC,GAAU,EAAM,GAAA,CAAI,GAExC,IAAY,EAAA,MAAe,EAAM,UAAU,EAAM,UAAU,IAAa,GAAI,CAAC,EAAM,OAAA,CAAQ,GAC3F,IAAY,EAAA,MAAe,EAAM,UAAU,EAAM,UAAU,IAAa,GAAa,CAAC,EAAM,OAAA,CAAQ,GAEpG,IAAiB,EAAA,MAAkB;AACvC,UAAM,IAAK,EAAS;AACpB,QAAI,KAAM,EAAM,cAAc;AAC5B,MAAA,EAAG,MAAM,SAAS;AAClB,YAAM,IAAY,KAAK,IAAI,EAAG,cAAc,CAAA;AAC5C,MAAA,EAAG,MAAM,SAAS,GAAG,CAAA;AAAA;KAEtB,CAAC,EAAM,cAAc,CAAA,CAAU,GAE5B,IAAiB,EAAA,CACpB,MAAkB;AACjB,QAAI,EAAM,YAAY;AACpB,YAAM,IAAqB,EAAM,QAAQ,QAAQ,EAAA;AACjD,MAAA,EAAM,WAAW,CAAA;AAAA,UAEjB,CAAA,EAAM,WAAW,CAAA;AAAA,KAGrB,CAAC,EAA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AW,EAAM;AAAA,MACjB,WAAW,EAAM;AAAA,MACjB,UAAU,EAAM;AAAA,MAChB,UAAU,EAAM;AAAA,MAChB,UAAU,EAAM;AAAA,MAChB,cAAc,EAAM,iBAAiB,OAAO,KAAK,EAAM;AAAA,MACvD,OAAO,EAAM,UAAU,OAAO,KAAK,EAAM;AAAA,MACzC,MAAM,EAAM;AAAA,MACZ,aAAa,EAAM;AAAA,MACnB,UAAA,CAAW,MAAU,EAAe,EAAM,OAAO,KAAA;AAAA,MACjD,QAAQ,EAAM;AAAA,MACd,SAAS,EAAM;AAAA,MACf,WAAW,EAAM;AAAA,MACjB,aAAa,EAAM;AAAA,MACnB,SAAS,EAAM;AAAA,MACf,MAAM,EAAM;AAAA,MACZ,cAAY,EAAM,aAAa,EAAM;AAAA,MACrC,cAAc,EAAM;AAAA,MACpB,IAAI,EAAM;AAAA,MACV,OAAO;AAAA,QACL,GAAG;AAAA,QACH,WAAW,GAAG,CAAA;AAAA,QACd,WAAW,EAAM,WAAW,SAAS,EAAM,eAAe,GAAG,CAAA,OAAgB,GAAG,CAAA;AAAA;KAElF;AAAA,GACE,GAEL,GAAO,OAAO,WACb,gBAAA,EAAC,GAAD;AAAA,IACE,MAAM,GAAO,MAAM,QAAQ,EAAM;AAAA,IACjC,cAAc;AAAA,MAAE,MAAM;AAAA,MAAQ,QAAQ;AAAA,MAAO,GAAG,GAAO,MAAM;AAAA;IAC7D,GAAI,EAAM;AAAA,GACV,CAAA,EAEH,CAAA"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { i as o, n as g, r as n } from "./utils-Cona48dZ.js";
|
|
2
|
+
import { n as l, t as a } from "./functions-CLGf7hqw.js";
|
|
3
|
+
import { useMergeRefs as b } from "./hooks-use-merge-refs.es.js";
|
|
4
|
+
import { t as z } from "./error-L2fvWcNv.js";
|
|
5
|
+
import { Fragment as A, jsx as c, jsxs as y } from "react/jsx-runtime";
|
|
6
|
+
import { useCallback as S, useMemo as r, useRef as C } from "react";
|
|
7
|
+
var N = (e) => {
|
|
8
|
+
const { className: m, style: s } = r(() => {
|
|
9
|
+
const i = a([
|
|
10
|
+
g.component.toggle.root,
|
|
11
|
+
e.value ? g.component.toggle.active : g.component.toggle.unActive,
|
|
12
|
+
g.control[e.isDisabled ? "none" : e.control ?? "boxShadow"],
|
|
13
|
+
g.transition.color,
|
|
14
|
+
e.isZeroRadius && g.component.toggle.isZeroRadius,
|
|
15
|
+
e.error?.isError && g.isError,
|
|
16
|
+
e.isHidden && g.component.toggle.isHidden,
|
|
17
|
+
e.isHiddenBorder && g.component.toggle.isHiddenBorder,
|
|
18
|
+
e.className
|
|
19
|
+
]), t = {};
|
|
20
|
+
return t[o.component.toggle.height] = n.sizeToggle[e.size].height, t[o.component.toggle.width] = n.sizeToggle[e.size].width, t[o.component.toggle.padding] = n.sizeToggle[e.size].padding, t[o.component.toggle.backgroundActive] = n.genre.toggle[e.genre].active.track, t[o.component.toggle.backgroundUnActive] = n.genre.toggle[e.genre].unActive.track, t[o.component.toggle.borderActive] = n.genre.toggle[e.genre].active.border, t[o.component.toggle.borderUnActive] = n.genre.toggle[e.genre].unActive.border, {
|
|
21
|
+
className: i,
|
|
22
|
+
style: l([Object.keys(t).length ? t : void 0, e.style])
|
|
23
|
+
};
|
|
24
|
+
}, [
|
|
25
|
+
e.className,
|
|
26
|
+
e.style,
|
|
27
|
+
e.genre,
|
|
28
|
+
e.isDisabled,
|
|
29
|
+
e.isHidden,
|
|
30
|
+
e.isHiddenBorder,
|
|
31
|
+
e.size,
|
|
32
|
+
e.value,
|
|
33
|
+
e.error?.isError,
|
|
34
|
+
e.isZeroRadius,
|
|
35
|
+
e.control
|
|
36
|
+
]), { className: d, style: u } = r(() => {
|
|
37
|
+
const i = a([
|
|
38
|
+
g.component.toggle.center,
|
|
39
|
+
g.transition.color,
|
|
40
|
+
e.value ? g.component.toggle.centerActive : g.component.toggle.centerUnActive
|
|
41
|
+
]), t = {};
|
|
42
|
+
return t[o.component.toggle.centerHeight] = n.sizeToggle[e.size].thumb, t[o.component.toggle.centerWidth] = n.sizeToggle[e.size].thumb, t[o.component.toggle.centerBackgroundActive] = n.genre.toggle[e.genre].active.thumb, t[o.component.toggle.centerBackgroundUnActive] = n.genre.toggle[e.genre].unActive.thumb, t[o.component.toggle.centerBorderActive] = n.palette.transparent, t[o.component.toggle.centerBorderUnActive] = n.palette.transparent, t[o.component.toggle.centerBoxShadowActive] = n.genre.toggle[e.genre].active.thumbBoxShadow, t[o.component.toggle.centerBoxShadowUnActive] = n.genre.toggle[e.genre].unActive.thumbBoxShadow, t[o.component.toggle.centerX] = e.value ? `calc(${n.sizeToggle[e.size].width} - ${n.sizeToggle[e.size].thumb} - ${n.sizeToggle[e.size].padding} * 2)` : "0px", {
|
|
43
|
+
className: i,
|
|
44
|
+
style: l([Object.keys(t).length ? t : void 0])
|
|
45
|
+
};
|
|
46
|
+
}, [
|
|
47
|
+
e.genre,
|
|
48
|
+
e.size,
|
|
49
|
+
e.value
|
|
50
|
+
]), v = b([C(null), e.ref]), h = S(() => {
|
|
51
|
+
!e.isDisabled && e.onChange && e.onChange(!e.value);
|
|
52
|
+
}, [
|
|
53
|
+
e.isDisabled,
|
|
54
|
+
e.onChange,
|
|
55
|
+
e.value
|
|
56
|
+
]);
|
|
57
|
+
return /* @__PURE__ */ y(A, { children: [/* @__PURE__ */ c("button", {
|
|
58
|
+
className: m,
|
|
59
|
+
style: s,
|
|
60
|
+
type: e.type ?? "button",
|
|
61
|
+
ref: v,
|
|
62
|
+
name: e.name,
|
|
63
|
+
"aria-label": e.ariaLabel,
|
|
64
|
+
id: e.id,
|
|
65
|
+
onClick: h,
|
|
66
|
+
onFocus: e.onFocus,
|
|
67
|
+
onMouseDown: e.onMouseDown,
|
|
68
|
+
children: /* @__PURE__ */ c("div", {
|
|
69
|
+
className: d,
|
|
70
|
+
style: u
|
|
71
|
+
})
|
|
72
|
+
}), e?.error?.isError && /* @__PURE__ */ c(z, {
|
|
73
|
+
size: e?.error.size ?? e.size,
|
|
74
|
+
sxTypography: {
|
|
75
|
+
size: "16px",
|
|
76
|
+
weight: "400",
|
|
77
|
+
...e?.error.sxTypography
|
|
78
|
+
},
|
|
79
|
+
...e.error
|
|
80
|
+
})] });
|
|
81
|
+
};
|
|
82
|
+
export {
|
|
83
|
+
N as t
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
//# sourceMappingURL=toggle-I6YvEX4w.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle-I6YvEX4w.js","names":[],"sources":["../src/components/toggle/component.tsx"],"sourcesContent":["import { ErrorMessage } from '@local/components/error';\nimport { useMergeRefs } from '@local/hooks/use-merge-refs';\nimport { CSS_CLASS, CSS_VARS, CSS_VARS_RAW } from '@local/styles/utils/constants';\nimport { setClasses, setStyles } from '@local/styles/utils/functions';\n\nimport { Ref, useCallback, useMemo, useRef } from 'react';\n\nimport { IToggle } from './component.types';\n\nexport const Toggle = (props: IToggle) => {\n const { className, style } = useMemo(() => {\n const className = setClasses([\n CSS_CLASS.component.toggle.root,\n props.value ? CSS_CLASS.component.toggle.active : CSS_CLASS.component.toggle.unActive,\n CSS_CLASS.control[props.isDisabled ? 'none' : (props.control ?? 'boxShadow')],\n CSS_CLASS.transition.color,\n props.isZeroRadius && CSS_CLASS.component.toggle.isZeroRadius,\n props.error?.isError && CSS_CLASS.isError,\n props.isHidden && CSS_CLASS.component.toggle.isHidden,\n props.isHiddenBorder && CSS_CLASS.component.toggle.isHiddenBorder,\n props.className,\n ]);\n\n const vars: Record<string, string> = {};\n\n vars[CSS_VARS_RAW.component.toggle.height] = CSS_VARS.sizeToggle[props.size].height;\n vars[CSS_VARS_RAW.component.toggle.width] = CSS_VARS.sizeToggle[props.size].width;\n vars[CSS_VARS_RAW.component.toggle.padding] = CSS_VARS.sizeToggle[props.size].padding;\n vars[CSS_VARS_RAW.component.toggle.backgroundActive] = CSS_VARS.genre.toggle[props.genre].active.track;\n vars[CSS_VARS_RAW.component.toggle.backgroundUnActive] = CSS_VARS.genre.toggle[props.genre].unActive.track;\n vars[CSS_VARS_RAW.component.toggle.borderActive] = CSS_VARS.genre.toggle[props.genre].active.border;\n vars[CSS_VARS_RAW.component.toggle.borderUnActive] = CSS_VARS.genre.toggle[props.genre].unActive.border;\n\n const style = setStyles([Object.keys(vars).length ? vars : undefined, props.style]);\n\n return { className, style };\n }, [\n props.className,\n props.style,\n props.genre,\n props.isDisabled,\n props.isHidden,\n props.isHiddenBorder,\n props.size,\n props.value,\n props.error?.isError,\n props.isZeroRadius,\n props.control,\n ]);\n\n const { className: classNameCenter, style: styleCenter } = useMemo(() => {\n const className = setClasses([\n CSS_CLASS.component.toggle.center,\n CSS_CLASS.transition.color,\n props.value ? CSS_CLASS.component.toggle.centerActive : CSS_CLASS.component.toggle.centerUnActive,\n ]);\n\n const vars: Record<string, string> = {};\n\n vars[CSS_VARS_RAW.component.toggle.centerHeight] = CSS_VARS.sizeToggle[props.size].thumb;\n vars[CSS_VARS_RAW.component.toggle.centerWidth] = CSS_VARS.sizeToggle[props.size].thumb;\n vars[CSS_VARS_RAW.component.toggle.centerBackgroundActive] = CSS_VARS.genre.toggle[props.genre].active.thumb;\n vars[CSS_VARS_RAW.component.toggle.centerBackgroundUnActive] = CSS_VARS.genre.toggle[props.genre].unActive.thumb;\n vars[CSS_VARS_RAW.component.toggle.centerBorderActive] = CSS_VARS.palette.transparent;\n vars[CSS_VARS_RAW.component.toggle.centerBorderUnActive] = CSS_VARS.palette.transparent;\n vars[CSS_VARS_RAW.component.toggle.centerBoxShadowActive] =\n CSS_VARS.genre.toggle[props.genre].active.thumbBoxShadow;\n vars[CSS_VARS_RAW.component.toggle.centerBoxShadowUnActive] =\n CSS_VARS.genre.toggle[props.genre].unActive.thumbBoxShadow;\n\n vars[CSS_VARS_RAW.component.toggle.centerX] = props.value\n ? `calc(${CSS_VARS.sizeToggle[props.size].width} - ${CSS_VARS.sizeToggle[props.size].thumb} - ${CSS_VARS.sizeToggle[props.size].padding} * 2)`\n : '0px';\n\n const style = setStyles([Object.keys(vars).length ? vars : undefined]);\n\n return { className, style };\n }, [props.genre, props.size, props.value]);\n\n const refDefault = useRef<HTMLButtonElement>(null);\n\n const ref = useMergeRefs([refDefault, props.ref]);\n\n const handleClick = useCallback(() => {\n if (!props.isDisabled && props.onChange) {\n props.onChange(!props.value);\n }\n }, [props.isDisabled, props.onChange, props.value]);\n\n return (\n <>\n <button\n className={className}\n style={style}\n type={props.type ?? 'button'}\n ref={ref as Ref<HTMLButtonElement>}\n name={props.name}\n aria-label={props.ariaLabel}\n id={props.id}\n onClick={handleClick}\n onFocus={props.onFocus}\n onMouseDown={props.onMouseDown}\n >\n <div className={classNameCenter} style={styleCenter} />\n </button>\n {props?.error?.isError && (\n <ErrorMessage\n size={props?.error.size ?? props.size}\n sxTypography={{ size: '16px', weight: '400', ...props?.error.sxTypography }}\n {...props.error}\n />\n )}\n </>\n );\n};\n"],"mappings":";;;;;;AASA,IAAa,IAAA,CAAU,MAAmB;AACxC,QAAM,EAAE,WAAA,GAAW,OAAA,EAAA,IAAU,EAAA,MAAc;AACzC,UAAM,IAAY,EAAW;AAAA,MAC3B,EAAU,UAAU,OAAO;AAAA,MAC3B,EAAM,QAAQ,EAAU,UAAU,OAAO,SAAS,EAAU,UAAU,OAAO;AAAA,MAC7E,EAAU,QAAQ,EAAM,aAAa,SAAU,EAAM,WAAW,WAAA;AAAA,MAChE,EAAU,WAAW;AAAA,MACrB,EAAM,gBAAgB,EAAU,UAAU,OAAO;AAAA,MACjD,EAAM,OAAO,WAAW,EAAU;AAAA,MAClC,EAAM,YAAY,EAAU,UAAU,OAAO;AAAA,MAC7C,EAAM,kBAAkB,EAAU,UAAU,OAAO;AAAA,MACnD,EAAM;AAAA,KACP,GAEK,IAA+B,CAAA;AAErC,WAAA,EAAK,EAAa,UAAU,OAAO,MAAA,IAAU,EAAS,WAAW,EAAM,IAAA,EAAM,QAC7E,EAAK,EAAa,UAAU,OAAO,KAAA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AI,EAAM;AAAA,IACV,SAAS;AAAA,IACT,SAAS,EAAM;AAAA,IACf,aAAa,EAAM;AAAA,cAEnB,gBAAA,EAAC,OAAD;AAAA,MAAK,WAAW;AAAA,MAAiB,OAAO;AAAA,KAAe;AAAA,GAChD,GACR,GAAO,OAAO,WACb,gBAAA,EAAC,GAAD;AAAA,IACE,MAAM,GAAO,MAAM,QAAQ,EAAM;AAAA,IACjC,cAAc;AAAA,MAAE,MAAM;AAAA,MAAQ,QAAQ;AAAA,MAAO,GAAG,GAAO,MAAM;AAAA;IAC7D,GAAI,EAAM;AAAA,GACV,CAAA,EAEH,CAAA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
const d=require("./chunk-Dd8m0Ver.cjs"),t=require("./utils-DtinAjAU.cjs"),g=require("./functions-Dwo54amB.cjs"),C=require("./hooks-use-merge-refs.cjs.js"),s=require("./error-DzkkNL2H.cjs");let S=require("react/jsx-runtime"),o=require("react");var u=e=>{const{className:c,style:r}=(0,o.useMemo)(()=>{const i=g.setClasses([t.CSS_CLASS.component.toggle.root,e.value?t.CSS_CLASS.component.toggle.active:t.CSS_CLASS.component.toggle.unActive,t.CSS_CLASS.control[e.isDisabled?"none":e.control??"boxShadow"],t.CSS_CLASS.transition.color,e.isZeroRadius&&t.CSS_CLASS.component.toggle.isZeroRadius,e.error?.isError&&t.CSS_CLASS.isError,e.isHidden&&t.CSS_CLASS.component.toggle.isHidden,e.isHiddenBorder&&t.CSS_CLASS.component.toggle.isHiddenBorder,e.className]),n={};return n[t.CSS_VARS_RAW.component.toggle.height]=t.CSS_VARS.sizeToggle[e.size].height,n[t.CSS_VARS_RAW.component.toggle.width]=t.CSS_VARS.sizeToggle[e.size].width,n[t.CSS_VARS_RAW.component.toggle.padding]=t.CSS_VARS.sizeToggle[e.size].padding,n[t.CSS_VARS_RAW.component.toggle.backgroundActive]=t.CSS_VARS.genre.toggle[e.genre].active.track,n[t.CSS_VARS_RAW.component.toggle.backgroundUnActive]=t.CSS_VARS.genre.toggle[e.genre].unActive.track,n[t.CSS_VARS_RAW.component.toggle.borderActive]=t.CSS_VARS.genre.toggle[e.genre].active.border,n[t.CSS_VARS_RAW.component.toggle.borderUnActive]=t.CSS_VARS.genre.toggle[e.genre].unActive.border,{className:i,style:g.setStyles([Object.keys(n).length?n:void 0,e.style])}},[e.className,e.style,e.genre,e.isDisabled,e.isHidden,e.isHiddenBorder,e.size,e.value,e.error?.isError,e.isZeroRadius,e.control]),{className:l,style:a}=(0,o.useMemo)(()=>{const i=g.setClasses([t.CSS_CLASS.component.toggle.center,t.CSS_CLASS.transition.color,e.value?t.CSS_CLASS.component.toggle.centerActive:t.CSS_CLASS.component.toggle.centerUnActive]),n={};return n[t.CSS_VARS_RAW.component.toggle.centerHeight]=t.CSS_VARS.sizeToggle[e.size].thumb,n[t.CSS_VARS_RAW.component.toggle.centerWidth]=t.CSS_VARS.sizeToggle[e.size].thumb,n[t.CSS_VARS_RAW.component.toggle.centerBackgroundActive]=t.CSS_VARS.genre.toggle[e.genre].active.thumb,n[t.CSS_VARS_RAW.component.toggle.centerBackgroundUnActive]=t.CSS_VARS.genre.toggle[e.genre].unActive.thumb,n[t.CSS_VARS_RAW.component.toggle.centerBorderActive]=t.CSS_VARS.palette.transparent,n[t.CSS_VARS_RAW.component.toggle.centerBorderUnActive]=t.CSS_VARS.palette.transparent,n[t.CSS_VARS_RAW.component.toggle.centerBoxShadowActive]=t.CSS_VARS.genre.toggle[e.genre].active.thumbBoxShadow,n[t.CSS_VARS_RAW.component.toggle.centerBoxShadowUnActive]=t.CSS_VARS.genre.toggle[e.genre].unActive.thumbBoxShadow,n[t.CSS_VARS_RAW.component.toggle.centerX]=e.value?`calc(${t.CSS_VARS.sizeToggle[e.size].width} - ${t.CSS_VARS.sizeToggle[e.size].thumb} - ${t.CSS_VARS.sizeToggle[e.size].padding} * 2)`:"0px",{className:i,style:g.setStyles([Object.keys(n).length?n:void 0])}},[e.genre,e.size,e.value]),A=C.useMergeRefs([(0,o.useRef)(null),e.ref]),_=(0,o.useCallback)(()=>{!e.isDisabled&&e.onChange&&e.onChange(!e.value)},[e.isDisabled,e.onChange,e.value]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("button",{className:c,style:r,type:e.type??"button",ref:A,name:e.name,"aria-label":e.ariaLabel,id:e.id,onClick:_,onFocus:e.onFocus,onMouseDown:e.onMouseDown,children:(0,S.jsx)("div",{className:l,style:a})}),e?.error?.isError&&(0,S.jsx)(s.ErrorMessage,{size:e?.error.size??e.size,sxTypography:{size:"16px",weight:"400",...e?.error.sxTypography},...e.error})]})};Object.defineProperty(exports,"Toggle",{enumerable:!0,get:function(){return u}});
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=toggle-gYw5FUp-.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle-gYw5FUp-.cjs","names":[],"sources":["../src/components/toggle/component.tsx"],"sourcesContent":["import { ErrorMessage } from '@local/components/error';\nimport { useMergeRefs } from '@local/hooks/use-merge-refs';\nimport { CSS_CLASS, CSS_VARS, CSS_VARS_RAW } from '@local/styles/utils/constants';\nimport { setClasses, setStyles } from '@local/styles/utils/functions';\n\nimport { Ref, useCallback, useMemo, useRef } from 'react';\n\nimport { IToggle } from './component.types';\n\nexport const Toggle = (props: IToggle) => {\n const { className, style } = useMemo(() => {\n const className = setClasses([\n CSS_CLASS.component.toggle.root,\n props.value ? CSS_CLASS.component.toggle.active : CSS_CLASS.component.toggle.unActive,\n CSS_CLASS.control[props.isDisabled ? 'none' : (props.control ?? 'boxShadow')],\n CSS_CLASS.transition.color,\n props.isZeroRadius && CSS_CLASS.component.toggle.isZeroRadius,\n props.error?.isError && CSS_CLASS.isError,\n props.isHidden && CSS_CLASS.component.toggle.isHidden,\n props.isHiddenBorder && CSS_CLASS.component.toggle.isHiddenBorder,\n props.className,\n ]);\n\n const vars: Record<string, string> = {};\n\n vars[CSS_VARS_RAW.component.toggle.height] = CSS_VARS.sizeToggle[props.size].height;\n vars[CSS_VARS_RAW.component.toggle.width] = CSS_VARS.sizeToggle[props.size].width;\n vars[CSS_VARS_RAW.component.toggle.padding] = CSS_VARS.sizeToggle[props.size].padding;\n vars[CSS_VARS_RAW.component.toggle.backgroundActive] = CSS_VARS.genre.toggle[props.genre].active.track;\n vars[CSS_VARS_RAW.component.toggle.backgroundUnActive] = CSS_VARS.genre.toggle[props.genre].unActive.track;\n vars[CSS_VARS_RAW.component.toggle.borderActive] = CSS_VARS.genre.toggle[props.genre].active.border;\n vars[CSS_VARS_RAW.component.toggle.borderUnActive] = CSS_VARS.genre.toggle[props.genre].unActive.border;\n\n const style = setStyles([Object.keys(vars).length ? vars : undefined, props.style]);\n\n return { className, style };\n }, [\n props.className,\n props.style,\n props.genre,\n props.isDisabled,\n props.isHidden,\n props.isHiddenBorder,\n props.size,\n props.value,\n props.error?.isError,\n props.isZeroRadius,\n props.control,\n ]);\n\n const { className: classNameCenter, style: styleCenter } = useMemo(() => {\n const className = setClasses([\n CSS_CLASS.component.toggle.center,\n CSS_CLASS.transition.color,\n props.value ? CSS_CLASS.component.toggle.centerActive : CSS_CLASS.component.toggle.centerUnActive,\n ]);\n\n const vars: Record<string, string> = {};\n\n vars[CSS_VARS_RAW.component.toggle.centerHeight] = CSS_VARS.sizeToggle[props.size].thumb;\n vars[CSS_VARS_RAW.component.toggle.centerWidth] = CSS_VARS.sizeToggle[props.size].thumb;\n vars[CSS_VARS_RAW.component.toggle.centerBackgroundActive] = CSS_VARS.genre.toggle[props.genre].active.thumb;\n vars[CSS_VARS_RAW.component.toggle.centerBackgroundUnActive] = CSS_VARS.genre.toggle[props.genre].unActive.thumb;\n vars[CSS_VARS_RAW.component.toggle.centerBorderActive] = CSS_VARS.palette.transparent;\n vars[CSS_VARS_RAW.component.toggle.centerBorderUnActive] = CSS_VARS.palette.transparent;\n vars[CSS_VARS_RAW.component.toggle.centerBoxShadowActive] =\n CSS_VARS.genre.toggle[props.genre].active.thumbBoxShadow;\n vars[CSS_VARS_RAW.component.toggle.centerBoxShadowUnActive] =\n CSS_VARS.genre.toggle[props.genre].unActive.thumbBoxShadow;\n\n vars[CSS_VARS_RAW.component.toggle.centerX] = props.value\n ? `calc(${CSS_VARS.sizeToggle[props.size].width} - ${CSS_VARS.sizeToggle[props.size].thumb} - ${CSS_VARS.sizeToggle[props.size].padding} * 2)`\n : '0px';\n\n const style = setStyles([Object.keys(vars).length ? vars : undefined]);\n\n return { className, style };\n }, [props.genre, props.size, props.value]);\n\n const refDefault = useRef<HTMLButtonElement>(null);\n\n const ref = useMergeRefs([refDefault, props.ref]);\n\n const handleClick = useCallback(() => {\n if (!props.isDisabled && props.onChange) {\n props.onChange(!props.value);\n }\n }, [props.isDisabled, props.onChange, props.value]);\n\n return (\n <>\n <button\n className={className}\n style={style}\n type={props.type ?? 'button'}\n ref={ref as Ref<HTMLButtonElement>}\n name={props.name}\n aria-label={props.ariaLabel}\n id={props.id}\n onClick={handleClick}\n onFocus={props.onFocus}\n onMouseDown={props.onMouseDown}\n >\n <div className={classNameCenter} style={styleCenter} />\n </button>\n {props?.error?.isError && (\n <ErrorMessage\n size={props?.error.size ?? props.size}\n sxTypography={{ size: '16px', weight: '400', ...props?.error.sxTypography }}\n {...props.error}\n />\n )}\n </>\n );\n};\n"],"mappings":"mPASA,IAAa,EAAU,GAAmB,CACxC,KAAM,CAAE,UAAA,EAAW,MAAA,CAAA,KAAA,EAAA,SAAA,IAAwB,CACzC,MAAM,EAAY,EAAA,WAAW,CAC3B,EAAA,UAAU,UAAU,OAAO,KAC3B,EAAM,MAAQ,EAAA,UAAU,UAAU,OAAO,OAAS,EAAA,UAAU,UAAU,OAAO,SAC7E,EAAA,UAAU,QAAQ,EAAM,WAAa,OAAU,EAAM,SAAW,WAAA,EAChE,EAAA,UAAU,WAAW,MACrB,EAAM,cAAgB,EAAA,UAAU,UAAU,OAAO,aACjD,EAAM,OAAO,SAAW,EAAA,UAAU,QAClC,EAAM,UAAY,EAAA,UAAU,UA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AAS,CAAC,EAAM,KAAA,GAEvB,CAAC,EAAM,WAAY,EAAM,SAAU,EAAM,MAAM,EAElD,SACE,EAAA,MAAA,EAAA,SAAA,CAAA,SAAA,IACE,EAAA,KAAC,SAAD,CACa,UAAA,EACJ,MAAA,EACP,KAAM,EAAM,MAAQ,SACf,IAAA,EACL,KAAM,EAAM,KACZ,aAAY,EAAM,UAClB,GAAI,EAAM,GACV,QAAS,EACT,QAAS,EAAM,QACf,YAAa,EAAM,wBAEnB,EAAA,KAAC,MAAD,CAAK,UAAW,EAAiB,MAAO,EAAe,EAChD,EACR,GAAO,OAAO,YACb,EAAA,KAAC,EAAA,aAAD,CACE,KAAM,GAAO,MAAM,MAAQ,EAAM,KACjC,aAAc,CAAE,KAAM,OAAQ,OAAQ,MAAO,GAAG,GAAO,MAAM,cAC7D,GAAI,EAAM,MACV,CAAA,CAEH,CAAA"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { i as c, n as l, r as s, t as z } from "./utils-Cona48dZ.js";
|
|
2
|
+
import { n as P, t as r } from "./functions-CLGf7hqw.js";
|
|
3
|
+
import { useTypographyStyles as d } from "./hooks-use-typography-styles.es.js";
|
|
4
|
+
import { n as O, t as W } from "./popover-1k1MNFwv.js";
|
|
5
|
+
import { useOverflowing as b } from "./hooks-use-overflowing.es.js";
|
|
6
|
+
import { Fragment as _, jsx as t, jsxs as w } from "react/jsx-runtime";
|
|
7
|
+
import { memo as o, useMemo as h } from "react";
|
|
8
|
+
var m = o((e) => e.isDisabled ? /* @__PURE__ */ t("div", {
|
|
9
|
+
className: r([l.component.tooltip.wrapper, e.classNameWrapper]),
|
|
10
|
+
style: e.styleWrapper,
|
|
11
|
+
children: e.children
|
|
12
|
+
}) : /* @__PURE__ */ t(D, { ...e })), D = (e) => {
|
|
13
|
+
const { isOpen: i, refReference: a, refFloating: v, floatingStyles: f, context: g, refArrow: x, placement: u } = O({
|
|
14
|
+
placement: e.placement ?? "bottom-start",
|
|
15
|
+
offset: e.offset ?? 8,
|
|
16
|
+
mode: e.mode ?? "hover",
|
|
17
|
+
isClickOutside: e.isClickOutside ?? !0,
|
|
18
|
+
isFloatingHover: e.isFloatingHover ?? !0,
|
|
19
|
+
isWidthAsContent: e.isWidthAsContent ?? !1,
|
|
20
|
+
hoverCloseDelay: e.hoverCloseDelay ?? void 0,
|
|
21
|
+
hoverOffset: e.hoverOffset ?? void 0
|
|
22
|
+
}), { className: A, style: C } = h(() => {
|
|
23
|
+
const S = r([l.component.tooltip.root, e.classNamePopover]), n = {};
|
|
24
|
+
return n[c.component.tooltip.height] = s.size[e.size].padding, n[c.component.tooltip.padding] = `${s.size[e.size].padding} ${s.size[e.size].padding} 0px ${s.size[e.size].padding}`, {
|
|
25
|
+
className: S,
|
|
26
|
+
style: P([Object.keys(n).length ? n : void 0, e.stylePopover])
|
|
27
|
+
};
|
|
28
|
+
}, [
|
|
29
|
+
e.size,
|
|
30
|
+
e.classNamePopover,
|
|
31
|
+
e.stylePopover
|
|
32
|
+
]), { className: T, style: N } = d({
|
|
33
|
+
sx: {
|
|
34
|
+
variant: z.sizeToController[e.size],
|
|
35
|
+
isBold: !0,
|
|
36
|
+
...e?.sxTypography
|
|
37
|
+
},
|
|
38
|
+
style: {
|
|
39
|
+
order: 0,
|
|
40
|
+
display: "inline-flex"
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
return /* @__PURE__ */ w(_, { children: [/* @__PURE__ */ t("div", {
|
|
44
|
+
className: r([l.component.tooltip.wrapper, e.classNameWrapper]),
|
|
45
|
+
style: e.styleWrapper,
|
|
46
|
+
ref: a,
|
|
47
|
+
children: e.children
|
|
48
|
+
}), /* @__PURE__ */ t(W, {
|
|
49
|
+
className: A,
|
|
50
|
+
style: C,
|
|
51
|
+
size: e.size,
|
|
52
|
+
isOpen: i,
|
|
53
|
+
genre: e.genre,
|
|
54
|
+
floatingStyles: f,
|
|
55
|
+
ref: v,
|
|
56
|
+
maxHeight: e.maxHeight,
|
|
57
|
+
maxWidth: e.maxWidth,
|
|
58
|
+
context: g,
|
|
59
|
+
refArrow: x,
|
|
60
|
+
placement: u,
|
|
61
|
+
isArrow: !0,
|
|
62
|
+
isCenteredArrow: e.isCenteredArrow,
|
|
63
|
+
children: /* @__PURE__ */ t(y, {
|
|
64
|
+
className: T,
|
|
65
|
+
style: N,
|
|
66
|
+
sx: e.sxTypography,
|
|
67
|
+
children: e.content
|
|
68
|
+
})
|
|
69
|
+
})] });
|
|
70
|
+
};
|
|
71
|
+
m.displayName = "Tooltip";
|
|
72
|
+
var y = o((e) => {
|
|
73
|
+
const { className: i, style: a } = d({
|
|
74
|
+
sx: e?.sx ?? {},
|
|
75
|
+
className: e.className,
|
|
76
|
+
style: e.style
|
|
77
|
+
});
|
|
78
|
+
return /* @__PURE__ */ t(h(() => e.isAnchor ? "a" : e.isParagraph ? "p" : e.isSpan ? "span" : e.sx && "variant" in e.sx ? e.sx.variant === "headline" ? "h1" : e.sx.variant === "sub-headline" ? "h2" : e.sx.variant === "title-1" ? "h3" : e.sx.variant === "title-2" ? "h4" : e.sx.variant === "title-3" ? "h5" : e.sx.variant === "title-4" ? "h6" : "span" : "span", [
|
|
79
|
+
e.isAnchor,
|
|
80
|
+
e.isParagraph,
|
|
81
|
+
e.isSpan,
|
|
82
|
+
e.sx
|
|
83
|
+
]), {
|
|
84
|
+
ref: e.ref,
|
|
85
|
+
href: e.href,
|
|
86
|
+
className: i,
|
|
87
|
+
style: a,
|
|
88
|
+
children: e.children
|
|
89
|
+
});
|
|
90
|
+
}), V = o((e) => {
|
|
91
|
+
const { isDisabled: i, ref: a } = b({
|
|
92
|
+
isCheckSize: e.tooltip.isDisabled !== void 0 ? !e.tooltip.isDisabled : !0,
|
|
93
|
+
dependencies: [e.children]
|
|
94
|
+
});
|
|
95
|
+
return /* @__PURE__ */ t(m, {
|
|
96
|
+
isDisabled: i,
|
|
97
|
+
content: e.children,
|
|
98
|
+
...e.tooltip,
|
|
99
|
+
children: /* @__PURE__ */ t(y, {
|
|
100
|
+
ref: a,
|
|
101
|
+
...e.typography,
|
|
102
|
+
style: {
|
|
103
|
+
position: "relative",
|
|
104
|
+
...e.typography.style
|
|
105
|
+
},
|
|
106
|
+
children: e.children
|
|
107
|
+
})
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
export {
|
|
111
|
+
V as n,
|
|
112
|
+
m as r,
|
|
113
|
+
y as t
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
//# sourceMappingURL=typography-B2KioMfq.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typography-B2KioMfq.js","names":[],"sources":["../src/components/tooltip/component.constants.ts","../src/components/tooltip/component.tsx","../src/components/typography/component.tsx"],"sourcesContent":["import { Placement } from '@floating-ui/react';\n\nexport const DEFAULT_TOOLTIP_PLACEMENT_FALLBACK: Placement = 'bottom-start';\nexport const DEFAULT_TOOLTIP_OFFSET_FALLBACK: number = 8;\n","import { Popover, usePopover } from '@local/components/popover';\nimport { Typography } from '@local/components/typography';\nimport { useTypographyStyles } from '@local/hooks/use-typography-styles';\nimport { CSS_CLASS, EXTRA_VALUE } from '@local/styles/utils';\nimport { CSS_VARS, CSS_VARS_RAW } from '@local/styles/utils/constants';\nimport { setClasses, setStyles } from '@local/styles/utils/functions';\n\nimport { FC, memo, Ref, useMemo } from 'react';\n\nimport { DEFAULT_TOOLTIP_OFFSET_FALLBACK, DEFAULT_TOOLTIP_PLACEMENT_FALLBACK } from './component.constants';\nimport { ITooltip } from './component.types';\n\nexport const Tooltip: FC<ITooltip> = memo((props) => {\n if (props.isDisabled)\n return (\n <div\n className={setClasses([CSS_CLASS.component.tooltip.wrapper, props.classNameWrapper])}\n style={props.styleWrapper}\n >\n {props.children}\n </div>\n );\n\n return <TooltipContent {...props} />;\n});\n\nexport const TooltipContent: FC<ITooltip> = (props) => {\n const { isOpen, refReference, refFloating, floatingStyles, context, refArrow, placement } = usePopover({\n placement: props.placement ?? DEFAULT_TOOLTIP_PLACEMENT_FALLBACK,\n offset: props.offset ?? DEFAULT_TOOLTIP_OFFSET_FALLBACK,\n mode: props.mode ?? 'hover',\n isClickOutside: props.isClickOutside ?? true,\n isFloatingHover: props.isFloatingHover ?? true,\n isWidthAsContent: props.isWidthAsContent ?? false,\n hoverCloseDelay: props.hoverCloseDelay ?? undefined,\n hoverOffset: props.hoverOffset ?? undefined,\n });\n\n const { className, style } = useMemo(() => {\n const className = setClasses([CSS_CLASS.component.tooltip.root, props.classNamePopover]);\n\n const vars: Record<string, string> = {};\n\n vars[CSS_VARS_RAW.component.tooltip.height] = CSS_VARS.size[props.size].padding;\n vars[CSS_VARS_RAW.component.tooltip.padding] =\n `${CSS_VARS.size[props.size].padding} ${CSS_VARS.size[props.size].padding} 0px ${CSS_VARS.size[props.size].padding}`;\n\n const style = setStyles([Object.keys(vars).length ? vars : undefined, props.stylePopover]);\n\n return { className, style };\n }, [props.size, props.classNamePopover, props.stylePopover]);\n\n const { className: classNameTypography, style: styleTypography } = useTypographyStyles({\n sx: { variant: EXTRA_VALUE.sizeToController[props.size], isBold: true, ...props?.sxTypography },\n style: { order: 0, display: 'inline-flex' },\n });\n\n return (\n <>\n <div\n className={setClasses([CSS_CLASS.component.tooltip.wrapper, props.classNameWrapper])}\n style={props.styleWrapper}\n ref={refReference as Ref<HTMLDivElement | null>}\n >\n {props.children}\n </div>\n <Popover\n className={className}\n style={style}\n size={props.size}\n isOpen={isOpen}\n genre={props.genre}\n floatingStyles={floatingStyles}\n ref={refFloating}\n maxHeight={props.maxHeight}\n maxWidth={props.maxWidth}\n context={context}\n refArrow={refArrow}\n placement={placement}\n isArrow\n isCenteredArrow={props.isCenteredArrow}\n >\n <Typography className={classNameTypography} style={styleTypography} sx={props.sxTypography}>\n {props.content}\n </Typography>\n </Popover>\n </>\n );\n};\n\nTooltip.displayName = 'Tooltip';\n","import { Tooltip } from '@local/components/tooltip';\nimport { useOverflowing } from '@local/hooks/use-overflowing';\nimport { useTypographyStyles } from '@local/hooks/use-typography-styles';\n\nimport { ElementType, memo, useMemo } from 'react';\n\nimport { ITypographyComponent, ITypographyTooltip } from './component.types';\n\nexport const Typography = memo((props: ITypographyComponent) => {\n const { className, style } = useTypographyStyles({\n sx: props?.sx ?? {},\n className: props.className,\n style: props.style,\n });\n\n const Component = useMemo(() => {\n const Component: ElementType = props.isAnchor\n ? 'a'\n : props.isParagraph\n ? 'p'\n : props.isSpan\n ? 'span'\n : props.sx && 'variant' in props.sx\n ? props.sx.variant === 'headline'\n ? 'h1'\n : props.sx.variant === 'sub-headline'\n ? 'h2'\n : props.sx.variant === 'title-1'\n ? 'h3'\n : props.sx.variant === 'title-2'\n ? 'h4'\n : props.sx.variant === 'title-3'\n ? 'h5'\n : props.sx.variant === 'title-4'\n ? 'h6'\n : 'span'\n : 'span';\n return Component;\n }, [props.isAnchor, props.isParagraph, props.isSpan, props.sx]);\n\n return (\n <Component ref={props.ref as any} href={props.href} className={className} style={style}>\n {props.children}\n </Component>\n );\n});\n\nexport const TypographyTooltip = memo((props: ITypographyTooltip) => {\n const { isDisabled, ref } = useOverflowing<HTMLDivElement>({\n isCheckSize: props.tooltip.isDisabled !== undefined ? !props.tooltip.isDisabled : true,\n dependencies: [props.children],\n });\n return (\n <Tooltip isDisabled={isDisabled} content={props.children} {...props.tooltip}>\n <Typography ref={ref} {...props.typography} style={{ position: 'relative', ...props.typography.style }}>\n {props.children}\n </Typography>\n </Tooltip>\n );\n});\n"],"mappings":";;;;;;;ACYA,IAAa,IAAwB,EAAA,CAAM,MACrC,EAAM,aAEN,gBAAA,EAAC,OAAD;AAAA,EACE,WAAW,EAAW,CAAC,EAAU,UAAU,QAAQ,SAAS,EAAM,gBAAA,CAAiB;AAAA,EACnF,OAAO,EAAM;AAAA,YAEZ,EAAM;CACH,IAGH,gBAAA,EAAC,GAAD,EAAgB,GAAI,EAAA,CAAS,IAGzB,IAAA,CAAgC,MAAU;AACrD,QAAM,EAAE,QAAA,GAAQ,cAAA,GAAc,aAAA,GAAa,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AY,MAAM,EAAM;AAAA,IAAiB,WAAA;AAAA,IAAkB,OAAA;AAAA,cAC9E,EAAM;AAAA,GACG;IAIH,IAAoB,EAAA,CAAM,MAA8B;AACnE,QAAM,EAAE,YAAA,GAAY,KAAA,EAAA,IAAQ,EAA+B;AAAA,IACzD,aAAa,EAAM,QAAQ,eAAe,SAAY,CAAC,EAAM,QAAQ,aAAa;AAAA,IAClF,cAAc,CAAC,EAAM,QAAA;AAAA,GACtB;AACD,SACE,gBAAA,EAAC,GAAD;AAAA,IAAqB,YAAA;AAAA,IAAY,SAAS,EAAM;AAAA,IAAU,GAAI,EAAM;AAAA,cAClE,gBAAA,EAAC,GAAD;AAAA,MAAiB,KAAA;AAAA,MAAK,GAAI,EAAM;AAAA,MAAY,OAAO;AAAA,QAAE,UAAU;AAAA,QAAY,GAAG,EAAM,WAAW;AAAA;gBAC5F,EAAM;AAAA,KACI;AAAA,GACL"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
const b=require("./chunk-Dd8m0Ver.cjs"),t=require("./utils-DtinAjAU.cjs"),l=require("./functions-Dwo54amB.cjs"),y=require("./hooks-use-typography-styles.cjs.js"),h=require("./popover-CgwGn-55.cjs"),A=require("./hooks-use-overflowing.cjs.js");let i=require("react/jsx-runtime"),s=require("react");var o=(0,s.memo)(e=>e.isDisabled?(0,i.jsx)("div",{className:l.setClasses([t.CSS_CLASS.component.tooltip.wrapper,e.classNameWrapper]),style:e.styleWrapper,children:e.children}):(0,i.jsx)(T,{...e})),T=e=>{const{isOpen:a,refReference:n,refFloating:d,floatingStyles:u,context:m,refArrow:v,placement:S}=h.usePopover({placement:e.placement??"bottom-start",offset:e.offset??8,mode:e.mode??"hover",isClickOutside:e.isClickOutside??!0,isFloatingHover:e.isFloatingHover??!0,isWidthAsContent:e.isWidthAsContent??!1,hoverCloseDelay:e.hoverCloseDelay??void 0,hoverOffset:e.hoverOffset??void 0}),{className:g,style:f}=(0,s.useMemo)(()=>{const _=l.setClasses([t.CSS_CLASS.component.tooltip.root,e.classNamePopover]),r={};return r[t.CSS_VARS_RAW.component.tooltip.height]=t.CSS_VARS.size[e.size].padding,r[t.CSS_VARS_RAW.component.tooltip.padding]=`${t.CSS_VARS.size[e.size].padding} ${t.CSS_VARS.size[e.size].padding} 0px ${t.CSS_VARS.size[e.size].padding}`,{className:_,style:l.setStyles([Object.keys(r).length?r:void 0,e.stylePopover])}},[e.size,e.classNamePopover,e.stylePopover]),{className:x,style:C}=y.useTypographyStyles({sx:{variant:t.EXTRA_VALUE.sizeToController[e.size],isBold:!0,...e?.sxTypography},style:{order:0,display:"inline-flex"}});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:l.setClasses([t.CSS_CLASS.component.tooltip.wrapper,e.classNameWrapper]),style:e.styleWrapper,ref:n,children:e.children}),(0,i.jsx)(h.Popover,{className:g,style:f,size:e.size,isOpen:a,genre:e.genre,floatingStyles:u,ref:d,maxHeight:e.maxHeight,maxWidth:e.maxWidth,context:m,refArrow:v,placement:S,isArrow:!0,isCenteredArrow:e.isCenteredArrow,children:(0,i.jsx)(c,{className:x,style:C,sx:e.sxTypography,children:e.content})})]})};o.displayName="Tooltip";var c=(0,s.memo)(e=>{const{className:a,style:n}=y.useTypographyStyles({sx:e?.sx??{},className:e.className,style:e.style});return(0,i.jsx)((0,s.useMemo)(()=>e.isAnchor?"a":e.isParagraph?"p":e.isSpan?"span":e.sx&&"variant"in e.sx?e.sx.variant==="headline"?"h1":e.sx.variant==="sub-headline"?"h2":e.sx.variant==="title-1"?"h3":e.sx.variant==="title-2"?"h4":e.sx.variant==="title-3"?"h5":e.sx.variant==="title-4"?"h6":"span":"span",[e.isAnchor,e.isParagraph,e.isSpan,e.sx]),{ref:e.ref,href:e.href,className:a,style:n,children:e.children})}),N=(0,s.memo)(e=>{const{isDisabled:a,ref:n}=A.useOverflowing({isCheckSize:e.tooltip.isDisabled!==void 0?!e.tooltip.isDisabled:!0,dependencies:[e.children]});return(0,i.jsx)(o,{isDisabled:a,content:e.children,...e.tooltip,children:(0,i.jsx)(c,{ref:n,...e.typography,style:{position:"relative",...e.typography.style},children:e.children})})});Object.defineProperty(exports,"Tooltip",{enumerable:!0,get:function(){return o}});Object.defineProperty(exports,"Typography",{enumerable:!0,get:function(){return c}});Object.defineProperty(exports,"TypographyTooltip",{enumerable:!0,get:function(){return N}});
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=typography-DcxhX_9e.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typography-DcxhX_9e.cjs","names":[],"sources":["../src/components/tooltip/component.constants.ts","../src/components/tooltip/component.tsx","../src/components/typography/component.tsx"],"sourcesContent":["import { Placement } from '@floating-ui/react';\n\nexport const DEFAULT_TOOLTIP_PLACEMENT_FALLBACK: Placement = 'bottom-start';\nexport const DEFAULT_TOOLTIP_OFFSET_FALLBACK: number = 8;\n","import { Popover, usePopover } from '@local/components/popover';\nimport { Typography } from '@local/components/typography';\nimport { useTypographyStyles } from '@local/hooks/use-typography-styles';\nimport { CSS_CLASS, EXTRA_VALUE } from '@local/styles/utils';\nimport { CSS_VARS, CSS_VARS_RAW } from '@local/styles/utils/constants';\nimport { setClasses, setStyles } from '@local/styles/utils/functions';\n\nimport { FC, memo, Ref, useMemo } from 'react';\n\nimport { DEFAULT_TOOLTIP_OFFSET_FALLBACK, DEFAULT_TOOLTIP_PLACEMENT_FALLBACK } from './component.constants';\nimport { ITooltip } from './component.types';\n\nexport const Tooltip: FC<ITooltip> = memo((props) => {\n if (props.isDisabled)\n return (\n <div\n className={setClasses([CSS_CLASS.component.tooltip.wrapper, props.classNameWrapper])}\n style={props.styleWrapper}\n >\n {props.children}\n </div>\n );\n\n return <TooltipContent {...props} />;\n});\n\nexport const TooltipContent: FC<ITooltip> = (props) => {\n const { isOpen, refReference, refFloating, floatingStyles, context, refArrow, placement } = usePopover({\n placement: props.placement ?? DEFAULT_TOOLTIP_PLACEMENT_FALLBACK,\n offset: props.offset ?? DEFAULT_TOOLTIP_OFFSET_FALLBACK,\n mode: props.mode ?? 'hover',\n isClickOutside: props.isClickOutside ?? true,\n isFloatingHover: props.isFloatingHover ?? true,\n isWidthAsContent: props.isWidthAsContent ?? false,\n hoverCloseDelay: props.hoverCloseDelay ?? undefined,\n hoverOffset: props.hoverOffset ?? undefined,\n });\n\n const { className, style } = useMemo(() => {\n const className = setClasses([CSS_CLASS.component.tooltip.root, props.classNamePopover]);\n\n const vars: Record<string, string> = {};\n\n vars[CSS_VARS_RAW.component.tooltip.height] = CSS_VARS.size[props.size].padding;\n vars[CSS_VARS_RAW.component.tooltip.padding] =\n `${CSS_VARS.size[props.size].padding} ${CSS_VARS.size[props.size].padding} 0px ${CSS_VARS.size[props.size].padding}`;\n\n const style = setStyles([Object.keys(vars).length ? vars : undefined, props.stylePopover]);\n\n return { className, style };\n }, [props.size, props.classNamePopover, props.stylePopover]);\n\n const { className: classNameTypography, style: styleTypography } = useTypographyStyles({\n sx: { variant: EXTRA_VALUE.sizeToController[props.size], isBold: true, ...props?.sxTypography },\n style: { order: 0, display: 'inline-flex' },\n });\n\n return (\n <>\n <div\n className={setClasses([CSS_CLASS.component.tooltip.wrapper, props.classNameWrapper])}\n style={props.styleWrapper}\n ref={refReference as Ref<HTMLDivElement | null>}\n >\n {props.children}\n </div>\n <Popover\n className={className}\n style={style}\n size={props.size}\n isOpen={isOpen}\n genre={props.genre}\n floatingStyles={floatingStyles}\n ref={refFloating}\n maxHeight={props.maxHeight}\n maxWidth={props.maxWidth}\n context={context}\n refArrow={refArrow}\n placement={placement}\n isArrow\n isCenteredArrow={props.isCenteredArrow}\n >\n <Typography className={classNameTypography} style={styleTypography} sx={props.sxTypography}>\n {props.content}\n </Typography>\n </Popover>\n </>\n );\n};\n\nTooltip.displayName = 'Tooltip';\n","import { Tooltip } from '@local/components/tooltip';\nimport { useOverflowing } from '@local/hooks/use-overflowing';\nimport { useTypographyStyles } from '@local/hooks/use-typography-styles';\n\nimport { ElementType, memo, useMemo } from 'react';\n\nimport { ITypographyComponent, ITypographyTooltip } from './component.types';\n\nexport const Typography = memo((props: ITypographyComponent) => {\n const { className, style } = useTypographyStyles({\n sx: props?.sx ?? {},\n className: props.className,\n style: props.style,\n });\n\n const Component = useMemo(() => {\n const Component: ElementType = props.isAnchor\n ? 'a'\n : props.isParagraph\n ? 'p'\n : props.isSpan\n ? 'span'\n : props.sx && 'variant' in props.sx\n ? props.sx.variant === 'headline'\n ? 'h1'\n : props.sx.variant === 'sub-headline'\n ? 'h2'\n : props.sx.variant === 'title-1'\n ? 'h3'\n : props.sx.variant === 'title-2'\n ? 'h4'\n : props.sx.variant === 'title-3'\n ? 'h5'\n : props.sx.variant === 'title-4'\n ? 'h6'\n : 'span'\n : 'span';\n return Component;\n }, [props.isAnchor, props.isParagraph, props.isSpan, props.sx]);\n\n return (\n <Component ref={props.ref as any} href={props.href} className={className} style={style}>\n {props.children}\n </Component>\n );\n});\n\nexport const TypographyTooltip = memo((props: ITypographyTooltip) => {\n const { isDisabled, ref } = useOverflowing<HTMLDivElement>({\n isCheckSize: props.tooltip.isDisabled !== undefined ? !props.tooltip.isDisabled : true,\n dependencies: [props.children],\n });\n return (\n <Tooltip isDisabled={isDisabled} content={props.children} {...props.tooltip}>\n <Typography ref={ref} {...props.typography} style={{ position: 'relative', ...props.typography.style }}>\n {props.children}\n </Typography>\n </Tooltip>\n );\n});\n"],"mappings":"wSCYA,IAAa,KAAA,EAAA,MAA8B,GACrC,EAAM,cAEN,EAAA,KAAC,MAAD,CACE,UAAW,EAAA,WAAW,CAAC,EAAA,UAAU,UAAU,QAAQ,QAAS,EAAM,gBAAA,CAAiB,EACnF,MAAO,EAAM,sBAEZ,EAAM,SACH,KAGH,EAAA,KAAC,EAAD,CAAgB,GAAI,CAAA,CAAS,GAGzB,EAAgC,GAAU,CACrD,KAAM,CAAE,OAAA,EAAQ,aAAA,EAAc,YAAA,EAAa,eAAA,EAAgB,QAAA,EAAS,SAAA,EAAU,UAAA,CAAA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