erp-pro-ui 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +512 -288
- package/dist/accordion.cjs +1 -1
- package/dist/accordion.mjs +1 -1
- package/dist/alert.cjs +1 -1
- package/dist/alert.mjs +1 -1
- package/dist/ascii-text.cjs +1 -1
- package/dist/ascii-text.mjs +1 -1
- package/dist/button.cjs +1 -1
- package/dist/button.mjs +1 -1
- package/dist/card.cjs +1 -1
- package/dist/card.mjs +1 -1
- package/dist/carousel.cjs +1 -1
- package/dist/carousel.mjs +1 -1
- package/dist/catalog.cjs +6 -0
- package/dist/catalog.cjs.map +1 -1
- package/dist/catalog.d.ts +11 -1
- package/dist/catalog.d.ts.map +1 -1
- package/dist/catalog.mjs +6 -0
- package/dist/catalog.mjs.map +1 -1
- package/dist/charts.cjs +4 -1
- package/dist/charts.mjs +2 -2
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.mjs +1 -1
- package/dist/chip.cjs +1 -1
- package/dist/chip.mjs +1 -1
- package/dist/chroma-grid.cjs +1 -1
- package/dist/chroma-grid.mjs +1 -1
- package/dist/chunks/{accordion-C_0oGZkZ.mjs → accordion-Cbt-SJhj.mjs} +4 -4
- package/dist/chunks/accordion-Cbt-SJhj.mjs.map +1 -0
- package/dist/chunks/{accordion-BZ5hyz0_.cjs → accordion-pfJR8YYA.cjs} +4 -4
- package/dist/chunks/accordion-pfJR8YYA.cjs.map +1 -0
- package/dist/chunks/{alert-DeVa-NR1.mjs → alert-CtdLy4Hv.mjs} +6 -6
- package/dist/chunks/alert-CtdLy4Hv.mjs.map +1 -0
- package/dist/chunks/{alert-BdBDWqBN.cjs → alert-Dvz1GoL5.cjs} +6 -6
- package/dist/chunks/alert-Dvz1GoL5.cjs.map +1 -0
- package/dist/chunks/{ascii-text-BzQCLfya.mjs → ascii-text-C5tyNsR3.mjs} +32 -5
- package/dist/chunks/ascii-text-C5tyNsR3.mjs.map +1 -0
- package/dist/chunks/{ascii-text-D6lVHWph.cjs → ascii-text-DlmArZXh.cjs} +32 -5
- package/dist/chunks/ascii-text-DlmArZXh.cjs.map +1 -0
- package/dist/chunks/background-gradient-animation-BL-lnrJe.mjs.map +1 -1
- package/dist/chunks/background-gradient-animation-CXV9GDH8.cjs.map +1 -1
- package/dist/chunks/{button-CmNEMp_O.mjs → button-B0Lhj0AS.mjs} +3 -3
- package/dist/chunks/button-B0Lhj0AS.mjs.map +1 -0
- package/dist/chunks/{button-BH1eUjae.cjs → button-CZL6kFzT.cjs} +3 -3
- package/dist/chunks/button-CZL6kFzT.cjs.map +1 -0
- package/dist/chunks/{card-CzstAQYy.mjs → card-CcIF6z2H.mjs} +2 -2
- package/dist/chunks/card-CcIF6z2H.mjs.map +1 -0
- package/dist/chunks/{card-DZGM4zLx.cjs → card-gt-HZh0h.cjs} +2 -2
- package/dist/chunks/card-gt-HZh0h.cjs.map +1 -0
- package/dist/chunks/{carousel-47Eiyzwg.cjs → carousel-Cq5uwqQt.cjs} +3 -3
- package/dist/chunks/{carousel-BJ3nm2bw.mjs.map → carousel-Cq5uwqQt.cjs.map} +1 -1
- package/dist/chunks/{carousel-BJ3nm2bw.mjs → carousel-DJdqBVRK.mjs} +3 -3
- package/dist/chunks/{carousel-47Eiyzwg.cjs.map → carousel-DJdqBVRK.mjs.map} +1 -1
- package/dist/chunks/charts-BpElnsoR.cjs +687 -0
- package/dist/chunks/charts-BpElnsoR.cjs.map +1 -0
- package/dist/chunks/charts-DugYWvEf.mjs +632 -0
- package/dist/chunks/charts-DugYWvEf.mjs.map +1 -0
- package/dist/chunks/{checkbox-B3eIojWs.mjs → checkbox-DvwlGwWe.mjs} +8 -8
- package/dist/chunks/checkbox-DvwlGwWe.mjs.map +1 -0
- package/dist/chunks/{checkbox-DQmZwRTt.cjs → checkbox-yHuSw-hV.cjs} +8 -8
- package/dist/chunks/checkbox-yHuSw-hV.cjs.map +1 -0
- package/dist/chunks/{chip-cZ7-HmWw.mjs → chip-BGSUmnlO.mjs} +12 -12
- package/dist/chunks/chip-BGSUmnlO.mjs.map +1 -0
- package/dist/chunks/{chip-BH6wzwat.cjs → chip-DcBji__g.cjs} +12 -12
- package/dist/chunks/chip-DcBji__g.cjs.map +1 -0
- package/dist/chunks/{chroma-grid-DtsqM4LW.cjs → chroma-grid-9E9j1s9I.cjs} +10 -10
- package/dist/chunks/chroma-grid-9E9j1s9I.cjs.map +1 -0
- package/dist/chunks/{chroma-grid-CC_fFzxO.mjs → chroma-grid-Cdeql_2C.mjs} +10 -10
- package/dist/chunks/chroma-grid-Cdeql_2C.mjs.map +1 -0
- package/dist/chunks/color-palette-BLvDnCOD.cjs +754 -0
- package/dist/chunks/color-palette-BLvDnCOD.cjs.map +1 -0
- package/dist/chunks/color-palette-CXlCDiZz.mjs +748 -0
- package/dist/chunks/color-palette-CXlCDiZz.mjs.map +1 -0
- package/dist/chunks/{combobox-mAvOcg-E.cjs → combobox-BXu3s0dt.cjs} +56 -32
- package/dist/chunks/combobox-BXu3s0dt.cjs.map +1 -0
- package/dist/chunks/combobox-CjK-qG4k.mjs +132 -0
- package/dist/chunks/combobox-CjK-qG4k.mjs.map +1 -0
- package/dist/chunks/{data-table-BRcGhJDf.cjs → data-table-9HELVsYR.cjs} +197 -292
- package/dist/chunks/data-table-9HELVsYR.cjs.map +1 -0
- package/dist/chunks/{data-table-Dp0t_I_z.mjs → data-table-DyEQn9Yj.mjs} +197 -292
- package/dist/chunks/data-table-DyEQn9Yj.mjs.map +1 -0
- package/dist/chunks/{date-picker-BWBkr6LG.mjs → date-picker-D8gaaMlJ.mjs} +39 -16
- package/dist/chunks/date-picker-D8gaaMlJ.mjs.map +1 -0
- package/dist/chunks/{date-picker-DooielHi.cjs → date-picker-W9om1j7A.cjs} +39 -16
- package/dist/chunks/date-picker-W9om1j7A.cjs.map +1 -0
- package/dist/chunks/{dialog-Cbuf8V0g.cjs → dialog-CYFiWN8M.cjs} +20 -20
- package/dist/chunks/dialog-CYFiWN8M.cjs.map +1 -0
- package/dist/chunks/{dialog-C6nxSfIl.mjs → dialog-DUWnV9tN.mjs} +20 -20
- package/dist/chunks/dialog-DUWnV9tN.mjs.map +1 -0
- package/dist/chunks/{drawer-Dn0u8Sck.cjs → drawer-CLjsYdxN.cjs} +39 -22
- package/dist/chunks/drawer-CLjsYdxN.cjs.map +1 -0
- package/dist/chunks/drawer-D82Jz6KO.mjs +122 -0
- package/dist/chunks/drawer-D82Jz6KO.mjs.map +1 -0
- package/dist/chunks/{form-TwlDrshv.mjs → form-B2vcaHwh.mjs} +4 -4
- package/dist/chunks/form-B2vcaHwh.mjs.map +1 -0
- package/dist/chunks/{form-DcEuk721.cjs → form-CzH9GQc6.cjs} +4 -4
- package/dist/chunks/form-CzH9GQc6.cjs.map +1 -0
- package/dist/chunks/{gradual-blur-2jVhPcND.cjs → gradual-blur-B9GoY8o1.cjs} +1 -1
- package/dist/chunks/{gradual-blur-2jVhPcND.cjs.map → gradual-blur-B9GoY8o1.cjs.map} +1 -1
- package/dist/chunks/{gradual-blur-jTzKCmAV.mjs → gradual-blur-Bl3dOMEz.mjs} +1 -1
- package/dist/chunks/{gradual-blur-jTzKCmAV.mjs.map → gradual-blur-Bl3dOMEz.mjs.map} +1 -1
- package/dist/chunks/{hover-card-KjWMnvt_.cjs → hover-card-v0QwmVBU.cjs} +9 -4
- package/dist/chunks/hover-card-v0QwmVBU.cjs.map +1 -0
- package/dist/chunks/{hover-card-DwTVfjgN.mjs → hover-card-xqwpmZNm.mjs} +9 -4
- package/dist/chunks/{hover-card-KjWMnvt_.cjs.map → hover-card-xqwpmZNm.mjs.map} +1 -1
- package/dist/chunks/{icons-DYkpqWYG.cjs → icons-BxIzP2jd.cjs} +131 -8
- package/dist/chunks/icons-BxIzP2jd.cjs.map +1 -0
- package/dist/chunks/{icons-CrM6pFkv.mjs → icons-DuumN7z-.mjs} +108 -9
- package/dist/chunks/icons-DuumN7z-.mjs.map +1 -0
- package/dist/chunks/{input-CoRHoZkB.cjs → input-D9qZNqXV.cjs} +8 -8
- package/dist/chunks/input-D9qZNqXV.cjs.map +1 -0
- package/dist/chunks/{input-ChhwdNGk.mjs → input-wNqevfQ4.mjs} +8 -8
- package/dist/chunks/input-wNqevfQ4.mjs.map +1 -0
- package/dist/chunks/{label-EciNc4hO.cjs → label-BWPEGVam.cjs} +1 -1
- package/dist/chunks/{label-EciNc4hO.cjs.map → label-BWPEGVam.cjs.map} +1 -1
- package/dist/chunks/{label-JZn7PmtR.mjs → label-KPA-yYOF.mjs} +1 -1
- package/dist/chunks/{label-JZn7PmtR.mjs.map → label-KPA-yYOF.mjs.map} +1 -1
- package/dist/chunks/{loading-DPNa_X3c.mjs → loading-S1TdIrbB.mjs} +2 -2
- package/dist/chunks/{loading-DPNa_X3c.mjs.map → loading-S1TdIrbB.mjs.map} +1 -1
- package/dist/chunks/{loading-Cqgps3nf.cjs → loading-q7IEg56I.cjs} +2 -2
- package/dist/chunks/{loading-Cqgps3nf.cjs.map → loading-q7IEg56I.cjs.map} +1 -1
- package/dist/chunks/multi-select-combobox-ELSH_Xr4.mjs +132 -0
- package/dist/chunks/multi-select-combobox-ELSH_Xr4.mjs.map +1 -0
- package/dist/chunks/multi-select-combobox-UW0X15W7.cjs +139 -0
- package/dist/chunks/multi-select-combobox-UW0X15W7.cjs.map +1 -0
- package/dist/chunks/{otp-input-DaQDfI9C.cjs → otp-input-B6zzOEqw.cjs} +13 -14
- package/dist/chunks/otp-input-B6zzOEqw.cjs.map +1 -0
- package/dist/chunks/{otp-input-CNungc1j.mjs → otp-input-Bg4nQG6x.mjs} +13 -14
- package/dist/chunks/otp-input-Bg4nQG6x.mjs.map +1 -0
- package/dist/chunks/{overlay-BfUR77DT.cjs → overlay-DWNTyQzK.cjs} +1 -1
- package/dist/chunks/{overlay-BfUR77DT.cjs.map → overlay-DWNTyQzK.cjs.map} +1 -1
- package/dist/chunks/{overlay-CpdakhXI.mjs → overlay-TycCIFOu.mjs} +1 -1
- package/dist/chunks/{overlay-CpdakhXI.mjs.map → overlay-TycCIFOu.mjs.map} +1 -1
- package/dist/chunks/{password-strength-meter-xtMqhhFg.mjs → password-strength-meter-CbNSBuh_.mjs} +10 -10
- package/dist/chunks/password-strength-meter-CbNSBuh_.mjs.map +1 -0
- package/dist/chunks/{password-strength-meter-u4YI00zE.cjs → password-strength-meter-DxMV6GAs.cjs} +10 -10
- package/dist/chunks/password-strength-meter-DxMV6GAs.cjs.map +1 -0
- package/dist/chunks/progress-bar-C1OvQ-NI.cjs +96 -0
- package/dist/chunks/progress-bar-C1OvQ-NI.cjs.map +1 -0
- package/dist/chunks/progress-bar-C9FZDrju.mjs +89 -0
- package/dist/chunks/progress-bar-C9FZDrju.mjs.map +1 -0
- package/dist/chunks/{radio-C-fPZgSY.mjs → radio-C9w_CoiY.mjs} +9 -9
- package/dist/chunks/radio-C9w_CoiY.mjs.map +1 -0
- package/dist/chunks/{radio-mCgvEhOR.cjs → radio-jMHDvaMY.cjs} +9 -9
- package/dist/chunks/radio-jMHDvaMY.cjs.map +1 -0
- package/dist/chunks/select-D71tk6-I.mjs +152 -0
- package/dist/chunks/select-D71tk6-I.mjs.map +1 -0
- package/dist/chunks/select-WC_kPqUP.cjs +158 -0
- package/dist/chunks/select-WC_kPqUP.cjs.map +1 -0
- package/dist/chunks/{skeleton-D1S4RyeL.mjs → skeleton-BhYWOp0Q.mjs} +1 -1
- package/dist/chunks/{skeleton-D1S4RyeL.mjs.map → skeleton-BhYWOp0Q.mjs.map} +1 -1
- package/dist/chunks/{skeleton-C-NHrM-w.cjs → skeleton-DTXpHYYB.cjs} +1 -1
- package/dist/chunks/{skeleton-C-NHrM-w.cjs.map → skeleton-DTXpHYYB.cjs.map} +1 -1
- package/dist/chunks/{spinners-hf553hP9.mjs → spinners-BBCWD2gw.mjs} +2 -2
- package/dist/chunks/{spinners-hf553hP9.mjs.map → spinners-BBCWD2gw.mjs.map} +1 -1
- package/dist/chunks/{spinners-CU3bLaoo.cjs → spinners-BL4ERCCw.cjs} +2 -2
- package/dist/chunks/{spinners-CU3bLaoo.cjs.map → spinners-BL4ERCCw.cjs.map} +1 -1
- package/dist/chunks/{splash-cursor-Dpzl_YXx.cjs → splash-cursor-BVSmbcIX.cjs} +9 -8
- package/dist/chunks/splash-cursor-BVSmbcIX.cjs.map +1 -0
- package/dist/chunks/{splash-cursor-9BsoQZl0.mjs → splash-cursor-rSrTnawZ.mjs} +9 -8
- package/dist/chunks/splash-cursor-rSrTnawZ.mjs.map +1 -0
- package/dist/chunks/{spotlight-card-Bl0aXnT4.mjs → spotlight-card-BpZLMOp6.mjs} +1 -1
- package/dist/chunks/{spotlight-card-Bl0aXnT4.mjs.map → spotlight-card-BpZLMOp6.mjs.map} +1 -1
- package/dist/chunks/{spotlight-card-SUhrgstF.cjs → spotlight-card-DS1dy1W3.cjs} +1 -1
- package/dist/chunks/{spotlight-card-SUhrgstF.cjs.map → spotlight-card-DS1dy1W3.cjs.map} +1 -1
- package/dist/chunks/{stepper-uz8iRzlY.mjs → stepper-D4yQsQB0.mjs} +14 -14
- package/dist/chunks/stepper-D4yQsQB0.mjs.map +1 -0
- package/dist/chunks/{stepper-BDz6PkjV.cjs → stepper-fY-Sx72k.cjs} +14 -14
- package/dist/chunks/stepper-fY-Sx72k.cjs.map +1 -0
- package/dist/chunks/{sun-to-moon-button-3E6qah0o.mjs → sun-to-moon-button-B2Aje05o.mjs} +3 -3
- package/dist/chunks/{sun-to-moon-button-3E6qah0o.mjs.map → sun-to-moon-button-B2Aje05o.mjs.map} +1 -1
- package/dist/chunks/{sun-to-moon-button-B__3FWnK.cjs → sun-to-moon-button-BmFwRBye.cjs} +3 -3
- package/dist/chunks/{sun-to-moon-button-B__3FWnK.cjs.map → sun-to-moon-button-BmFwRBye.cjs.map} +1 -1
- package/dist/chunks/{switch-y8oWcyLp.cjs → switch-C5otDb4c.cjs} +3 -3
- package/dist/chunks/switch-C5otDb4c.cjs.map +1 -0
- package/dist/chunks/{switch-DYLavKgf.mjs → switch-DOVl_i_s.mjs} +3 -3
- package/dist/chunks/switch-DOVl_i_s.mjs.map +1 -0
- package/dist/chunks/textarea-CAUsyu4-.cjs +63 -0
- package/dist/chunks/textarea-CAUsyu4-.cjs.map +1 -0
- package/dist/chunks/textarea-CU5C-Zw9.mjs +57 -0
- package/dist/chunks/textarea-CU5C-Zw9.mjs.map +1 -0
- package/dist/chunks/{theme-CBtWIFMT.cjs → theme-7DWLxJK_.cjs} +4 -2
- package/dist/chunks/theme-7DWLxJK_.cjs.map +1 -0
- package/dist/chunks/{theme-Bwu0HKqZ.mjs → theme-BceKeYhw.mjs} +4 -2
- package/dist/chunks/theme-BceKeYhw.mjs.map +1 -0
- package/dist/chunks/{toast-C8JRhbSo.mjs → toast-CvfP7PUP.mjs} +20 -20
- package/dist/chunks/toast-CvfP7PUP.mjs.map +1 -0
- package/dist/chunks/{toast-DWOwpD2F.cjs → toast-Ds7_19Ap.cjs} +20 -20
- package/dist/chunks/toast-Ds7_19Ap.cjs.map +1 -0
- package/dist/chunks/{tooltip-YtA_66_1.mjs → tooltip-efHETBo1.mjs} +1 -1
- package/dist/chunks/{tooltip-YtA_66_1.mjs.map → tooltip-efHETBo1.mjs.map} +1 -1
- package/dist/chunks/{tooltip-BHXNmXsa.cjs → tooltip-nkIqViGk.cjs} +1 -1
- package/dist/chunks/{tooltip-BHXNmXsa.cjs.map → tooltip-nkIqViGk.cjs.map} +1 -1
- package/dist/chunks/{typography-BzprBnQc.mjs → typography-CLu6Hx9j.mjs} +7 -3
- package/dist/chunks/{typography-BzprBnQc.mjs.map → typography-CLu6Hx9j.mjs.map} +1 -1
- package/dist/chunks/{typography-3wSx67DZ.cjs → typography-DaLu9tty.cjs} +7 -3
- package/dist/chunks/{typography-3wSx67DZ.cjs.map → typography-DaLu9tty.cjs.map} +1 -1
- package/dist/color-palette.cjs +1 -1
- package/dist/color-palette.mjs +1 -1
- package/dist/colors.css +121 -186
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.mjs +1 -1
- package/dist/components/data-display/charts/AreaChart.d.ts.map +1 -1
- package/dist/components/data-display/charts/BarChart.d.ts.map +1 -1
- package/dist/components/data-display/charts/NeonLineChart.d.ts.map +1 -1
- package/dist/components/data-display/charts/PieChart.d.ts.map +1 -1
- package/dist/components/data-display/charts/StackedBarChart.d.ts.map +1 -1
- package/dist/components/data-display/charts/ThinBreakdownBar.d.ts.map +1 -1
- package/dist/components/data-display/charts/chartPalette.d.ts +10 -0
- package/dist/components/data-display/charts/chartPalette.d.ts.map +1 -0
- package/dist/components/data-display/charts/index.d.ts +2 -0
- package/dist/components/data-display/charts/index.d.ts.map +1 -1
- package/dist/components/data-display/chip/Chip.d.ts.map +1 -1
- package/dist/components/data-display/color-palette/ColorPalette.d.ts.map +1 -1
- package/dist/components/data-display/data-table/DataTable.d.ts +17 -10
- package/dist/components/data-display/data-table/DataTable.d.ts.map +1 -1
- package/dist/components/data-display/data-table/index.d.ts +1 -1
- package/dist/components/data-display/data-table/index.d.ts.map +1 -1
- package/dist/components/data-display/index.d.ts +1 -0
- package/dist/components/data-display/index.d.ts.map +1 -1
- package/dist/components/data-display/progress-bar/ProgressBar.d.ts +18 -0
- package/dist/components/data-display/progress-bar/ProgressBar.d.ts.map +1 -0
- package/dist/components/data-display/progress-bar/index.d.ts +3 -0
- package/dist/components/data-display/progress-bar/index.d.ts.map +1 -0
- package/dist/components/effects/ascii-text/ASCIIText.d.ts.map +1 -1
- package/dist/components/effects/border-beam/BorderBeam.d.ts.map +1 -1
- package/dist/components/effects/chroma-grid/ChromaGrid.d.ts.map +1 -1
- package/dist/components/effects/splash-cursor/SplashCursor.d.ts.map +1 -1
- package/dist/components/forms/combobox/Combobox.d.ts.map +1 -1
- package/dist/components/forms/date-picker/DatePicker.d.ts.map +1 -1
- package/dist/components/forms/input/Input.d.ts.map +1 -1
- package/dist/components/forms/multi-select-combobox/MultiSelectCombobox.d.ts.map +1 -1
- package/dist/components/forms/otp-input/OTPInput.d.ts.map +1 -1
- package/dist/components/forms/password-strength-meter/PasswordCriteria.d.ts.map +1 -1
- package/dist/components/forms/select/Select.d.ts.map +1 -1
- package/dist/components/forms/select/types.d.ts +2 -0
- package/dist/components/forms/select/types.d.ts.map +1 -1
- package/dist/components/forms/textarea/Textarea.d.ts.map +1 -1
- package/dist/components/icons/ColumnsIcon.d.ts +9 -0
- package/dist/components/icons/ColumnsIcon.d.ts.map +1 -0
- package/dist/components/icons/MailIcon.d.ts +9 -0
- package/dist/components/icons/MailIcon.d.ts.map +1 -0
- package/dist/components/icons/PlayIcon.d.ts +9 -0
- package/dist/components/icons/PlayIcon.d.ts.map +1 -0
- package/dist/components/icons/ZapIcon.d.ts +9 -0
- package/dist/components/icons/ZapIcon.d.ts.map +1 -0
- package/dist/components/icons/index.d.ts +4 -0
- package/dist/components/icons/index.d.ts.map +1 -1
- package/dist/components/navigation/accordion/Accordion.d.ts.map +1 -1
- package/dist/components/overlays/drawer/Drawer.d.ts.map +1 -1
- package/dist/components/overlays/hover-card/HoverCard.d.ts.map +1 -1
- package/dist/components/typography/Typography.d.ts.map +1 -1
- package/dist/data-table.cjs +1 -1
- package/dist/data-table.mjs +1 -1
- package/dist/date-picker.cjs +1 -1
- package/dist/date-picker.mjs +1 -1
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.mjs +1 -1
- package/dist/docs.cjs +50 -4
- package/dist/docs.cjs.map +1 -1
- package/dist/docs.d.ts +59 -9
- package/dist/docs.d.ts.map +1 -1
- package/dist/docs.mjs +50 -4
- package/dist/docs.mjs.map +1 -1
- package/dist/drawer.cjs +1 -1
- package/dist/drawer.mjs +1 -1
- package/dist/fonts.css +5 -0
- package/dist/form.cjs +1 -1
- package/dist/form.mjs +1 -1
- package/dist/foundation.css +3 -3
- package/dist/foundations/theme/ThemeProvider.d.ts +1 -0
- package/dist/foundations/theme/ThemeProvider.d.ts.map +1 -1
- package/dist/gradual-blur.cjs +1 -1
- package/dist/gradual-blur.mjs +1 -1
- package/dist/hover-card.cjs +1 -1
- package/dist/hover-card.mjs +1 -1
- package/dist/icons.cjs +5 -1
- package/dist/icons.mjs +2 -2
- package/dist/index.cjs +50 -41
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +43 -42
- package/dist/index.mjs.map +1 -1
- package/dist/input.cjs +1 -1
- package/dist/input.mjs +1 -1
- package/dist/label.cjs +1 -1
- package/dist/label.mjs +1 -1
- package/dist/loading.cjs +1 -1
- package/dist/loading.mjs +1 -1
- package/dist/multi-select-combobox.cjs +1 -1
- package/dist/multi-select-combobox.mjs +1 -1
- package/dist/otp-input.cjs +1 -1
- package/dist/otp-input.mjs +1 -1
- package/dist/password-strength-meter.cjs +1 -1
- package/dist/password-strength-meter.mjs +1 -1
- package/dist/progress-bar.cjs +3 -0
- package/dist/progress-bar.d.ts +2 -0
- package/dist/progress-bar.mjs +2 -0
- package/dist/radio.cjs +1 -1
- package/dist/radio.mjs +1 -1
- package/dist/select.cjs +1 -1
- package/dist/select.mjs +1 -1
- package/dist/skeleton.cjs +1 -1
- package/dist/skeleton.mjs +1 -1
- package/dist/spinners.cjs +1 -1
- package/dist/spinners.mjs +1 -1
- package/dist/splash-cursor.cjs +1 -1
- package/dist/splash-cursor.mjs +1 -1
- package/dist/spotlight-card.cjs +1 -1
- package/dist/spotlight-card.mjs +1 -1
- package/dist/stepper.cjs +1 -1
- package/dist/stepper.mjs +1 -1
- package/dist/sun-to-moon-button.cjs +1 -1
- package/dist/sun-to-moon-button.mjs +1 -1
- package/dist/switch.cjs +1 -1
- package/dist/switch.mjs +1 -1
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.mjs +1 -1
- package/dist/theme.cjs +1 -1
- package/dist/theme.mjs +1 -1
- package/dist/toast.cjs +1 -1
- package/dist/toast.mjs +1 -1
- package/dist/tokens.css +592 -0
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.mjs +1 -1
- package/dist/typography.cjs +1 -1
- package/dist/typography.mjs +1 -1
- package/package.json +19 -5
- package/dist/chunks/accordion-BZ5hyz0_.cjs.map +0 -1
- package/dist/chunks/accordion-C_0oGZkZ.mjs.map +0 -1
- package/dist/chunks/alert-BdBDWqBN.cjs.map +0 -1
- package/dist/chunks/alert-DeVa-NR1.mjs.map +0 -1
- package/dist/chunks/ascii-text-BzQCLfya.mjs.map +0 -1
- package/dist/chunks/ascii-text-D6lVHWph.cjs.map +0 -1
- package/dist/chunks/button-BH1eUjae.cjs.map +0 -1
- package/dist/chunks/button-CmNEMp_O.mjs.map +0 -1
- package/dist/chunks/card-CzstAQYy.mjs.map +0 -1
- package/dist/chunks/card-DZGM4zLx.cjs.map +0 -1
- package/dist/chunks/charts-Bynf6x07.mjs +0 -448
- package/dist/chunks/charts-Bynf6x07.mjs.map +0 -1
- package/dist/chunks/charts-UYl7Ecqv.cjs +0 -485
- package/dist/chunks/charts-UYl7Ecqv.cjs.map +0 -1
- package/dist/chunks/checkbox-B3eIojWs.mjs.map +0 -1
- package/dist/chunks/checkbox-DQmZwRTt.cjs.map +0 -1
- package/dist/chunks/chip-BH6wzwat.cjs.map +0 -1
- package/dist/chunks/chip-cZ7-HmWw.mjs.map +0 -1
- package/dist/chunks/chroma-grid-CC_fFzxO.mjs.map +0 -1
- package/dist/chunks/chroma-grid-DtsqM4LW.cjs.map +0 -1
- package/dist/chunks/color-palette-Cz7vqbil.cjs +0 -1156
- package/dist/chunks/color-palette-Cz7vqbil.cjs.map +0 -1
- package/dist/chunks/color-palette-yadpDCUw.mjs +0 -1150
- package/dist/chunks/color-palette-yadpDCUw.mjs.map +0 -1
- package/dist/chunks/combobox-B9Nzlhu3.mjs +0 -108
- package/dist/chunks/combobox-B9Nzlhu3.mjs.map +0 -1
- package/dist/chunks/combobox-mAvOcg-E.cjs.map +0 -1
- package/dist/chunks/data-table-BRcGhJDf.cjs.map +0 -1
- package/dist/chunks/data-table-Dp0t_I_z.mjs.map +0 -1
- package/dist/chunks/date-picker-BWBkr6LG.mjs.map +0 -1
- package/dist/chunks/date-picker-DooielHi.cjs.map +0 -1
- package/dist/chunks/dialog-C6nxSfIl.mjs.map +0 -1
- package/dist/chunks/dialog-Cbuf8V0g.cjs.map +0 -1
- package/dist/chunks/drawer-DIuvgqTA.mjs +0 -105
- package/dist/chunks/drawer-DIuvgqTA.mjs.map +0 -1
- package/dist/chunks/drawer-Dn0u8Sck.cjs.map +0 -1
- package/dist/chunks/form-DcEuk721.cjs.map +0 -1
- package/dist/chunks/form-TwlDrshv.mjs.map +0 -1
- package/dist/chunks/hover-card-DwTVfjgN.mjs.map +0 -1
- package/dist/chunks/icons-CrM6pFkv.mjs.map +0 -1
- package/dist/chunks/icons-DYkpqWYG.cjs.map +0 -1
- package/dist/chunks/input-ChhwdNGk.mjs.map +0 -1
- package/dist/chunks/input-CoRHoZkB.cjs.map +0 -1
- package/dist/chunks/multi-select-combobox-BPRTZVF6.mjs +0 -108
- package/dist/chunks/multi-select-combobox-BPRTZVF6.mjs.map +0 -1
- package/dist/chunks/multi-select-combobox-DiMwJxj_.cjs +0 -115
- package/dist/chunks/multi-select-combobox-DiMwJxj_.cjs.map +0 -1
- package/dist/chunks/otp-input-CNungc1j.mjs.map +0 -1
- package/dist/chunks/otp-input-DaQDfI9C.cjs.map +0 -1
- package/dist/chunks/password-strength-meter-u4YI00zE.cjs.map +0 -1
- package/dist/chunks/password-strength-meter-xtMqhhFg.mjs.map +0 -1
- package/dist/chunks/radio-C-fPZgSY.mjs.map +0 -1
- package/dist/chunks/radio-mCgvEhOR.cjs.map +0 -1
- package/dist/chunks/select-BB-pOzI2.mjs +0 -116
- package/dist/chunks/select-BB-pOzI2.mjs.map +0 -1
- package/dist/chunks/select-BwelAQc1.cjs +0 -122
- package/dist/chunks/select-BwelAQc1.cjs.map +0 -1
- package/dist/chunks/splash-cursor-9BsoQZl0.mjs.map +0 -1
- package/dist/chunks/splash-cursor-Dpzl_YXx.cjs.map +0 -1
- package/dist/chunks/stepper-BDz6PkjV.cjs.map +0 -1
- package/dist/chunks/stepper-uz8iRzlY.mjs.map +0 -1
- package/dist/chunks/switch-DYLavKgf.mjs.map +0 -1
- package/dist/chunks/switch-y8oWcyLp.cjs.map +0 -1
- package/dist/chunks/textarea-BWkUVpm3.cjs +0 -66
- package/dist/chunks/textarea-BWkUVpm3.cjs.map +0 -1
- package/dist/chunks/textarea-Bxqe70TW.mjs +0 -60
- package/dist/chunks/textarea-Bxqe70TW.mjs.map +0 -1
- package/dist/chunks/theme-Bwu0HKqZ.mjs.map +0 -1
- package/dist/chunks/theme-CBtWIFMT.cjs.map +0 -1
- package/dist/chunks/toast-C8JRhbSo.mjs.map +0 -1
- package/dist/chunks/toast-DWOwpD2F.cjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ascii-text-C5tyNsR3.mjs","names":[],"sources":["../../src/components/effects/ascii-text/ASCIIText.tsx"],"sourcesContent":["import React, { useRef, useEffect } from \"react\";\nimport * as THREE from \"three\";\n\nconst vertexShader = `\nvarying vec2 vUv;\nuniform float uTime;\nuniform float mouse;\nuniform float uEnableWaves;\n\nvoid main() {\n vUv = uv;\n float time = uTime * 5.;\n\n float waveFactor = uEnableWaves;\n\n vec3 transformed = position;\n\n transformed.x += sin(time + position.y) * 0.5 * waveFactor;\n transformed.y += cos(time + position.z) * 0.15 * waveFactor;\n transformed.z += sin(time + position.x) * waveFactor;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4(transformed, 1.0);\n}\n`;\n\nconst fragmentShader = `\nvarying vec2 vUv;\nuniform float mouse;\nuniform float uTime;\nuniform sampler2D uTexture;\n\nvoid main() {\n float time = uTime;\n vec2 pos = vUv;\n \n float move = sin(time + mouse) * 0.01;\n float r = texture2D(uTexture, pos + cos(time * 2. - time + pos.x) * .01).r;\n float g = texture2D(uTexture, pos + tan(time * .5 + pos.x - time) * .01).g;\n float b = texture2D(uTexture, pos - cos(time * 2. + time + pos.y) * .01).b;\n float a = texture2D(uTexture, pos).a;\n gl_FragColor = vec4(r, g, b, a);\n}\n`;\n\nconst PX_RATIO = typeof window !== \"undefined\" ? window.devicePixelRatio : 1;\n\nconst resolvedCanvasColorCache = new Map<string, string>();\n\nconst getThemeSignature = () => {\n if (typeof document === \"undefined\") return \"\";\n\n const root = document.documentElement;\n return [\n root.getAttribute(\"data-brand\") ?? \"\",\n root.getAttribute(\"data-mode\") ?? \"\",\n root.getAttribute(\"data-theme\") ?? \"\",\n ].join(\"|\");\n};\n\nconst resolveCanvasColor = (value: string): string => {\n if (typeof document === \"undefined\") return value;\n if (!value.includes(\"var(\") && !value.includes(\"color-mix(\")) return value;\n\n const cacheKey = `${getThemeSignature()}::${value}`;\n const cachedValue = resolvedCanvasColorCache.get(cacheKey);\n if (cachedValue) {\n return cachedValue;\n }\n\n const probe = document.createElement(\"span\");\n probe.style.color = value;\n probe.style.position = \"fixed\";\n probe.style.pointerEvents = \"none\";\n probe.style.opacity = \"0\";\n document.body.appendChild(probe);\n const resolvedValue = getComputedStyle(probe).color || value;\n document.body.removeChild(probe);\n resolvedCanvasColorCache.set(cacheKey, resolvedValue);\n return resolvedValue;\n};\n\ninterface AsciiFilterOptions {\n fontSize?: number;\n fontFamily?: string;\n charset?: string;\n invert?: boolean;\n}\n\nclass AsciiFilter {\n renderer: THREE.WebGLRenderer;\n domElement: HTMLDivElement;\n pre: HTMLPreElement;\n canvas: HTMLCanvasElement;\n context: CanvasRenderingContext2D;\n deg: number;\n invert: boolean;\n fontSize: number;\n fontFamily: string;\n charset: string;\n width: number = 0;\n height: number = 0;\n cols: number = 0;\n rows: number = 0;\n center: { x: number; y: number } = { x: 0, y: 0 };\n mouse: { x: number; y: number } = { x: 0, y: 0 };\n\n constructor(\n renderer: THREE.WebGLRenderer,\n { fontSize, fontFamily, charset, invert }: AsciiFilterOptions = {},\n ) {\n this.renderer = renderer;\n this.domElement = document.createElement(\"div\");\n this.domElement.style.position = \"absolute\";\n this.domElement.style.top = \"0\";\n this.domElement.style.left = \"0\";\n this.domElement.style.width = \"100%\";\n this.domElement.style.height = \"100%\";\n\n this.pre = document.createElement(\"pre\");\n this.domElement.appendChild(this.pre);\n\n this.canvas = document.createElement(\"canvas\");\n const ctx = this.canvas.getContext(\"2d\");\n if (!ctx) throw new Error(\"Could not get 2d context\");\n this.context = ctx;\n this.domElement.appendChild(this.canvas);\n\n this.deg = 0;\n this.invert = invert ?? true;\n this.fontSize = fontSize ?? 12;\n this.fontFamily = fontFamily ?? \"'Courier New', monospace\";\n this.charset =\n charset ??\n \" .'`^\\\",:;Il!i~+_-?][}{1)(|/tfjrxnuvczXYUJCLQ0OZmwqpdbkhao*#MW&8%B@$\";\n\n this.context.imageSmoothingEnabled = false;\n\n this.onMouseMove = this.onMouseMove.bind(this);\n document.addEventListener(\"mousemove\", this.onMouseMove);\n }\n\n setSize(width: number, height: number) {\n this.width = width;\n this.height = height;\n this.renderer.setSize(width, height);\n this.reset();\n\n this.center = { x: width / 2, y: height / 2 };\n this.mouse = { x: this.center.x, y: this.center.y };\n }\n\n reset() {\n this.context.font = `${this.fontSize}px ${this.fontFamily}`;\n const charWidth = this.context.measureText(\"A\").width;\n\n this.cols = Math.floor(\n this.width / (this.fontSize * (charWidth / this.fontSize)),\n );\n this.rows = Math.floor(this.height / this.fontSize);\n\n this.canvas.width = this.cols;\n this.canvas.height = this.rows;\n this.pre.style.fontFamily = this.fontFamily;\n this.pre.style.fontSize = `${this.fontSize}px`;\n this.pre.style.margin = \"0\";\n this.pre.style.padding = \"0\";\n this.pre.style.lineHeight = \"1em\";\n this.pre.style.position = \"absolute\";\n this.pre.style.left = \"0\";\n this.pre.style.top = \"0\";\n this.pre.style.zIndex = \"9\";\n this.pre.style.backgroundAttachment = \"fixed\";\n this.pre.style.mixBlendMode = \"difference\";\n }\n\n render(scene: THREE.Scene, camera: THREE.Camera) {\n this.renderer.render(scene, camera);\n\n const w = this.canvas.width;\n const h = this.canvas.height;\n this.context.clearRect(0, 0, w, h);\n if (this.context && w && h) {\n this.context.drawImage(this.renderer.domElement, 0, 0, w, h);\n }\n\n this.asciify(this.context, w, h);\n this.hue();\n }\n\n onMouseMove(e: MouseEvent) {\n this.mouse = { x: e.clientX * PX_RATIO, y: e.clientY * PX_RATIO };\n }\n\n get dx() {\n return this.mouse.x - this.center.x;\n }\n\n get dy() {\n return this.mouse.y - this.center.y;\n }\n\n hue() {\n const deg = (Math.atan2(this.dy, this.dx) * 180) / Math.PI;\n this.deg += (deg - this.deg) * 0.075;\n this.domElement.style.filter = `hue-rotate(${this.deg.toFixed(1)}deg)`;\n }\n\n asciify(ctx: CanvasRenderingContext2D, w: number, h: number) {\n if (w && h) {\n const imgData = ctx.getImageData(0, 0, w, h).data;\n let str = \"\";\n for (let y = 0; y < h; y++) {\n for (let x = 0; x < w; x++) {\n const i = x * 4 + y * 4 * w;\n const [r, g, b, a] = [\n imgData[i],\n imgData[i + 1],\n imgData[i + 2],\n imgData[i + 3],\n ];\n\n if (a === 0) {\n str += \" \";\n continue;\n }\n\n const gray = (0.3 * r + 0.6 * g + 0.1 * b) / 255;\n let idx = Math.floor((1 - gray) * (this.charset.length - 1));\n if (this.invert) idx = this.charset.length - idx - 1;\n str += this.charset[idx];\n }\n str += \"\\n\";\n }\n this.pre.innerHTML = str;\n }\n }\n\n dispose() {\n document.removeEventListener(\"mousemove\", this.onMouseMove);\n }\n}\n\ninterface CanvasTxtOptions {\n fontSize?: number;\n fontFamily?: string;\n color?: string;\n}\n\nclass CanvasTxt {\n canvas: HTMLCanvasElement;\n context: CanvasRenderingContext2D;\n txt: string;\n fontSize: number;\n fontFamily: string;\n color: string;\n font: string;\n\n constructor(\n txt: string,\n {\n fontSize = 200,\n fontFamily = \"Arial\",\n color = \"var(--ds-color-fg)\",\n }: CanvasTxtOptions = {},\n ) {\n this.canvas = document.createElement(\"canvas\");\n const ctx = this.canvas.getContext(\"2d\");\n if (!ctx) throw new Error(\"Could not get 2d context\");\n this.context = ctx;\n this.txt = txt;\n this.fontSize = fontSize;\n this.fontFamily = fontFamily;\n this.color = color;\n\n this.font = `600 ${this.fontSize}px ${this.fontFamily}`;\n }\n\n resize() {\n this.context.font = this.font;\n const metrics = this.context.measureText(this.txt);\n\n const textWidth = Math.ceil(metrics.width) + 20;\n const textHeight =\n Math.ceil(\n metrics.actualBoundingBoxAscent + metrics.actualBoundingBoxDescent,\n ) + 20;\n\n this.canvas.width = textWidth;\n this.canvas.height = textHeight;\n }\n\n render() {\n this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n this.context.fillStyle = resolveCanvasColor(this.color);\n this.context.font = this.font;\n\n const metrics = this.context.measureText(this.txt);\n const yPos = 10 + metrics.actualBoundingBoxAscent;\n\n this.context.fillText(this.txt, 10, yPos);\n }\n\n get width() {\n return this.canvas.width;\n }\n\n get height() {\n return this.canvas.height;\n }\n\n get texture() {\n return this.canvas;\n }\n}\n\ninterface CanvAsciiOptions {\n text: string;\n asciiFontSize: number;\n textFontSize: number;\n textColor: string;\n planeBaseHeight: number;\n enableWaves: boolean;\n}\n\nclass CanvAscii {\n textString: string;\n asciiFontSize: number;\n textFontSize: number;\n textColor: string;\n planeBaseHeight: number;\n container: HTMLElement;\n width: number;\n height: number;\n enableWaves: boolean;\n camera: THREE.PerspectiveCamera;\n scene: THREE.Scene;\n mouse: { x: number; y: number };\n textCanvas!: CanvasTxt;\n texture!: THREE.CanvasTexture;\n geometry!: THREE.PlaneGeometry;\n material!: THREE.ShaderMaterial;\n mesh!: THREE.Mesh;\n renderer!: THREE.WebGLRenderer;\n filter!: AsciiFilter;\n center: { x: number; y: number } = { x: 0, y: 0 };\n animationFrameId: number = 0;\n\n constructor(\n {\n text,\n asciiFontSize,\n textFontSize,\n textColor,\n planeBaseHeight,\n enableWaves,\n }: CanvAsciiOptions,\n containerElem: HTMLElement,\n width: number,\n height: number,\n ) {\n this.textString = text;\n this.asciiFontSize = asciiFontSize;\n this.textFontSize = textFontSize;\n this.textColor = textColor;\n this.planeBaseHeight = planeBaseHeight;\n this.container = containerElem;\n this.width = width;\n this.height = height;\n this.enableWaves = enableWaves;\n\n this.camera = new THREE.PerspectiveCamera(\n 45,\n this.width / this.height,\n 1,\n 1000,\n );\n this.camera.position.z = 30;\n\n this.scene = new THREE.Scene();\n this.mouse = { x: 0, y: 0 };\n\n this.onMouseMove = this.onMouseMove.bind(this);\n\n this.setMesh();\n this.setRenderer();\n }\n\n setMesh() {\n this.textCanvas = new CanvasTxt(this.textString, {\n fontSize: this.textFontSize,\n fontFamily: \"IBM Plex Mono\",\n color: this.textColor,\n });\n this.textCanvas.resize();\n this.textCanvas.render();\n\n this.texture = new THREE.CanvasTexture(this.textCanvas.texture);\n this.texture.minFilter = THREE.NearestFilter;\n\n const textAspect = this.textCanvas.width / this.textCanvas.height;\n const baseH = this.planeBaseHeight;\n const planeW = baseH * textAspect;\n const planeH = baseH;\n\n this.geometry = new THREE.PlaneGeometry(planeW, planeH, 36, 36);\n this.material = new THREE.ShaderMaterial({\n vertexShader,\n fragmentShader,\n transparent: true,\n uniforms: {\n uTime: { value: 0 },\n mouse: { value: 1.0 },\n uTexture: { value: this.texture },\n uEnableWaves: { value: this.enableWaves ? 1.0 : 0.0 },\n },\n });\n\n this.mesh = new THREE.Mesh(this.geometry, this.material);\n this.scene.add(this.mesh);\n }\n\n setRenderer() {\n this.renderer = new THREE.WebGLRenderer({ antialias: false, alpha: true });\n this.renderer.setPixelRatio(1);\n this.renderer.setClearColor(0x000000, 0);\n\n this.filter = new AsciiFilter(this.renderer, {\n fontFamily: \"IBM Plex Mono\",\n fontSize: this.asciiFontSize,\n invert: true,\n });\n\n this.container.appendChild(this.filter.domElement);\n this.setSize(this.width, this.height);\n\n this.container.addEventListener(\"mousemove\", this.onMouseMove);\n this.container.addEventListener(\"touchmove\", this.onMouseMove);\n }\n\n setSize(w: number, h: number) {\n this.width = w;\n this.height = h;\n\n this.camera.aspect = w / h;\n this.camera.updateProjectionMatrix();\n\n this.filter.setSize(w, h);\n\n this.center = { x: w / 2, y: h / 2 };\n }\n\n load() {\n this.animate();\n }\n\n onMouseMove(evt: any) {\n const e = evt.touches ? evt.touches[0] : evt;\n const bounds = this.container.getBoundingClientRect();\n const x = e.clientX - bounds.left;\n const y = e.clientY - bounds.top;\n this.mouse = { x, y };\n }\n\n animate() {\n const animateFrame = () => {\n this.animationFrameId = requestAnimationFrame(animateFrame);\n this.render();\n };\n animateFrame();\n }\n\n render() {\n const time = new Date().getTime() * 0.001;\n\n this.textCanvas.render();\n this.texture.needsUpdate = true;\n\n (this.mesh.material as any).uniforms.uTime.value = Math.sin(time);\n\n this.updateRotation();\n this.filter.render(this.scene, this.camera);\n }\n\n updateRotation() {\n const map = (\n n: number,\n start: number,\n stop: number,\n start2: number,\n stop2: number,\n ) => {\n return ((n - start) / (stop - start)) * (stop2 - start2) + start2;\n };\n\n const x = map(this.mouse.y, 0, this.height, 0.5, -0.5);\n const y = map(this.mouse.x, 0, this.width, -0.5, 0.5);\n\n this.mesh.rotation.x += (x - this.mesh.rotation.x) * 0.05;\n this.mesh.rotation.y += (y - this.mesh.rotation.y) * 0.05;\n }\n\n clear() {\n this.scene.traverse((obj: THREE.Object3D) => {\n if (obj instanceof THREE.Mesh) {\n if (Array.isArray(obj.material)) {\n obj.material.forEach((m: THREE.Material) => m.dispose());\n } else if (obj.material instanceof THREE.Material) {\n obj.material.dispose();\n }\n obj.geometry.dispose();\n }\n });\n this.scene.clear();\n }\n\n dispose() {\n cancelAnimationFrame(this.animationFrameId);\n this.filter.dispose();\n if (this.filter.domElement.parentNode === this.container) {\n this.container.removeChild(this.filter.domElement);\n }\n this.container.removeEventListener(\"mousemove\", this.onMouseMove);\n this.container.removeEventListener(\"touchmove\", this.onMouseMove);\n this.clear();\n this.renderer.dispose();\n }\n}\n\nexport interface ASCIITextProps {\n text?: string;\n asciiFontSize?: number;\n textFontSize?: number;\n textColor?: string;\n planeBaseHeight?: number;\n enableWaves?: boolean;\n className?: string;\n style?: React.CSSProperties;\n}\n\nexport const ASCIIText: React.FC<ASCIITextProps> = ({\n text = \"David!\",\n asciiFontSize = 8,\n textFontSize = 200,\n textColor = \"var(--ds-color-fg)\",\n planeBaseHeight = 8,\n enableWaves = true,\n className = \"\",\n style = {},\n}) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const asciiRef = useRef<CanvAscii | null>(null);\n\n useEffect(() => {\n if (!containerRef.current) return;\n\n const { width, height } = containerRef.current.getBoundingClientRect();\n\n const initAscii = (w: number, h: number) => {\n if (asciiRef.current) asciiRef.current.dispose();\n asciiRef.current = new CanvAscii(\n {\n text,\n asciiFontSize,\n textFontSize,\n textColor,\n planeBaseHeight,\n enableWaves,\n },\n containerRef.current!,\n w,\n h,\n );\n asciiRef.current.load();\n };\n\n if (width === 0 || height === 0) {\n const observer = new IntersectionObserver(\n ([entry]) => {\n if (\n entry.isIntersecting &&\n entry.boundingClientRect.width > 0 &&\n entry.boundingClientRect.height > 0\n ) {\n initAscii(\n entry.boundingClientRect.width,\n entry.boundingClientRect.height,\n );\n observer.disconnect();\n }\n },\n { threshold: 0.1 },\n );\n\n observer.observe(containerRef.current);\n\n return () => {\n observer.disconnect();\n if (asciiRef.current) {\n asciiRef.current.dispose();\n }\n };\n }\n\n initAscii(width, height);\n\n const ro = new ResizeObserver((entries) => {\n if (!entries[0] || !asciiRef.current) return;\n const { width: w, height: h } = entries[0].contentRect;\n if (w > 0 && h > 0) {\n asciiRef.current.setSize(w, h);\n }\n });\n ro.observe(containerRef.current);\n\n return () => {\n ro.disconnect();\n if (asciiRef.current) {\n asciiRef.current.dispose();\n }\n };\n }, [\n text,\n asciiFontSize,\n textFontSize,\n textColor,\n planeBaseHeight,\n enableWaves,\n ]);\n\n return (\n <div\n ref={containerRef}\n className={`ascii-text-container ${className}`}\n style={{\n position: \"absolute\",\n width: \"100%\",\n height: \"100%\",\n ...style,\n }}\n >\n <style>{`\n @import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@500&display=swap');\n\n .ascii-text-container canvas {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n image-rendering: optimizeSpeed;\n image-rendering: -moz-crisp-edges;\n image-rendering: -o-crisp-edges;\n image-rendering: -webkit-optimize-contrast;\n image-rendering: optimize-contrast;\n image-rendering: crisp-edges;\n image-rendering: pixelated;\n }\n\n .ascii-text-container pre {\n margin: 0;\n user-select: none;\n padding: 0;\n line-height: 1em;\n text-align: left;\n position: absolute;\n left: 0;\n top: 0;\n background-image: radial-gradient(circle, var(--ds-color-accent) 0%, var(--ds-color-accent-hover) 50%, var(--ds-color-warning) 100%);\n background-attachment: fixed;\n -webkit-text-fill-color: transparent;\n -webkit-background-clip: text;\n background-clip: text;\n z-index: 9;\n mix-blend-mode: difference;\n }\n `}</style>\n </div>\n );\n};\n\nexport default ASCIIText;\n"],"mappings":";;;;AAGA,IAAM,eAAe;;;;;;;;;;;;;;;;;;;;;AAsBrB,IAAM,iBAAiB;;;;;;;;;;;;;;;;;;AAmBvB,IAAM,WAAW,OAAO,WAAW,cAAc,OAAO,mBAAmB;AAE3E,IAAM,2CAA2B,IAAI,KAAqB;AAE1D,IAAM,0BAA0B;AAC9B,KAAI,OAAO,aAAa,YAAa,QAAO;CAE5C,MAAM,OAAO,SAAS;AACtB,QAAO;EACL,KAAK,aAAa,aAAa,IAAI;EACnC,KAAK,aAAa,YAAY,IAAI;EAClC,KAAK,aAAa,aAAa,IAAI;EACpC,CAAC,KAAK,IAAI;;AAGb,IAAM,sBAAsB,UAA0B;AACpD,KAAI,OAAO,aAAa,YAAa,QAAO;AAC5C,KAAI,CAAC,MAAM,SAAS,OAAO,IAAI,CAAC,MAAM,SAAS,aAAa,CAAE,QAAO;CAErE,MAAM,WAAW,GAAG,mBAAmB,CAAC,IAAI;CAC5C,MAAM,cAAc,yBAAyB,IAAI,SAAS;AAC1D,KAAI,YACF,QAAO;CAGT,MAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,OAAM,MAAM,QAAQ;AACpB,OAAM,MAAM,WAAW;AACvB,OAAM,MAAM,gBAAgB;AAC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,aAAa,SACb,GACA,EACD;AACD,YAAS,QAAQ,MAAM;;AAGzB,MAAI,UAAU,KAAK,WAAW,GAAG;GAC/B,MAAM,WAAW,IAAI,sBAClB,CAAC,WAAW;AACX,QACE,MAAM,kBACN,MAAM,mBAAmB,QAAQ,KACjC,MAAM,mBAAmB,SAAS,GAClC;AACA,eACE,MAAM,mBAAmB,OACzB,MAAM,mBAAmB,OAC1B;AACD,cAAS,YAAY;;MAGzB,EAAE,WAAW,IAAK,CACnB;AAED,YAAS,QAAQ,aAAa,QAAQ;AAEtC,gBAAa;AACX,aAAS,YAAY;AACrB,QAAI,SAAS,QACX,UAAS,QAAQ,SAAS;;;AAKhC,YAAU,OAAO,OAAO;EAExB,MAAM,KAAK,IAAI,gBAAgB,YAAY;AACzC,OAAI,CAAC,QAAQ,MAAM,CAAC,SAAS,QAAS;GACtC,MAAM,EAAE,OAAO,GAAG,QAAQ,MAAM,QAAQ,GAAG;AAC3C,OAAI,IAAI,KAAK,IAAI,EACf,UAAS,QAAQ,QAAQ,GAAG,EAAE;IAEhC;AACF,KAAG,QAAQ,aAAa,QAAQ;AAEhC,eAAa;AACX,MAAG,YAAY;AACf,OAAI,SAAS,QACX,UAAS,QAAQ,SAAS;;IAG7B;EACD;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,QACE,oBAAC,OAAD;EACE,KAAK;EACL,WAAW,wBAAwB;EACnC,OAAO;GACL,UAAU;GACV,OAAO;GACP,QAAQ;GACR,GAAG;GACJ;YAED,oBAAC,SAAD,EAAA,UAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAmCE,CAAA;EACN,CAAA"}
|
|
@@ -45,6 +45,33 @@ void main() {
|
|
|
45
45
|
}
|
|
46
46
|
`;
|
|
47
47
|
var PX_RATIO = typeof window !== "undefined" ? window.devicePixelRatio : 1;
|
|
48
|
+
var resolvedCanvasColorCache = /* @__PURE__ */ new Map();
|
|
49
|
+
var getThemeSignature = () => {
|
|
50
|
+
if (typeof document === "undefined") return "";
|
|
51
|
+
const root = document.documentElement;
|
|
52
|
+
return [
|
|
53
|
+
root.getAttribute("data-brand") ?? "",
|
|
54
|
+
root.getAttribute("data-mode") ?? "",
|
|
55
|
+
root.getAttribute("data-theme") ?? ""
|
|
56
|
+
].join("|");
|
|
57
|
+
};
|
|
58
|
+
var resolveCanvasColor = (value) => {
|
|
59
|
+
if (typeof document === "undefined") return value;
|
|
60
|
+
if (!value.includes("var(") && !value.includes("color-mix(")) return value;
|
|
61
|
+
const cacheKey = `${getThemeSignature()}::${value}`;
|
|
62
|
+
const cachedValue = resolvedCanvasColorCache.get(cacheKey);
|
|
63
|
+
if (cachedValue) return cachedValue;
|
|
64
|
+
const probe = document.createElement("span");
|
|
65
|
+
probe.style.color = value;
|
|
66
|
+
probe.style.position = "fixed";
|
|
67
|
+
probe.style.pointerEvents = "none";
|
|
68
|
+
probe.style.opacity = "0";
|
|
69
|
+
document.body.appendChild(probe);
|
|
70
|
+
const resolvedValue = getComputedStyle(probe).color || value;
|
|
71
|
+
document.body.removeChild(probe);
|
|
72
|
+
resolvedCanvasColorCache.set(cacheKey, resolvedValue);
|
|
73
|
+
return resolvedValue;
|
|
74
|
+
};
|
|
48
75
|
var AsciiFilter = class {
|
|
49
76
|
renderer;
|
|
50
77
|
domElement;
|
|
@@ -190,7 +217,7 @@ var CanvasTxt = class {
|
|
|
190
217
|
fontFamily;
|
|
191
218
|
color;
|
|
192
219
|
font;
|
|
193
|
-
constructor(txt, { fontSize = 200, fontFamily = "Arial", color = "
|
|
220
|
+
constructor(txt, { fontSize = 200, fontFamily = "Arial", color = "var(--ds-color-fg)" } = {}) {
|
|
194
221
|
this.canvas = document.createElement("canvas");
|
|
195
222
|
const ctx = this.canvas.getContext("2d");
|
|
196
223
|
if (!ctx) throw new Error("Could not get 2d context");
|
|
@@ -211,7 +238,7 @@ var CanvasTxt = class {
|
|
|
211
238
|
}
|
|
212
239
|
render() {
|
|
213
240
|
this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);
|
|
214
|
-
this.context.fillStyle = this.color;
|
|
241
|
+
this.context.fillStyle = resolveCanvasColor(this.color);
|
|
215
242
|
this.context.font = this.font;
|
|
216
243
|
const yPos = 10 + this.context.measureText(this.txt).actualBoundingBoxAscent;
|
|
217
244
|
this.context.fillText(this.txt, 10, yPos);
|
|
@@ -384,7 +411,7 @@ var CanvAscii = class {
|
|
|
384
411
|
this.renderer.dispose();
|
|
385
412
|
}
|
|
386
413
|
};
|
|
387
|
-
var ASCIIText = ({ text = "David!", asciiFontSize = 8, textFontSize = 200, textColor = "
|
|
414
|
+
var ASCIIText = ({ text = "David!", asciiFontSize = 8, textFontSize = 200, textColor = "var(--ds-color-fg)", planeBaseHeight = 8, enableWaves = true, className = "", style = {} }) => {
|
|
388
415
|
const containerRef = (0, react.useRef)(null);
|
|
389
416
|
const asciiRef = (0, react.useRef)(null);
|
|
390
417
|
(0, react.useEffect)(() => {
|
|
@@ -470,7 +497,7 @@ var ASCIIText = ({ text = "David!", asciiFontSize = 8, textFontSize = 200, textC
|
|
|
470
497
|
position: absolute;
|
|
471
498
|
left: 0;
|
|
472
499
|
top: 0;
|
|
473
|
-
background-image: radial-gradient(circle,
|
|
500
|
+
background-image: radial-gradient(circle, var(--ds-color-accent) 0%, var(--ds-color-accent-hover) 50%, var(--ds-color-warning) 100%);
|
|
474
501
|
background-attachment: fixed;
|
|
475
502
|
-webkit-text-fill-color: transparent;
|
|
476
503
|
-webkit-background-clip: text;
|
|
@@ -489,4 +516,4 @@ Object.defineProperty(exports, "ASCIIText", {
|
|
|
489
516
|
}
|
|
490
517
|
});
|
|
491
518
|
|
|
492
|
-
//# sourceMappingURL=ascii-text-
|
|
519
|
+
//# sourceMappingURL=ascii-text-DlmArZXh.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ascii-text-DlmArZXh.cjs","names":[],"sources":["../../src/components/effects/ascii-text/ASCIIText.tsx"],"sourcesContent":["import React, { useRef, useEffect } from \"react\";\nimport * as THREE from \"three\";\n\nconst vertexShader = `\nvarying vec2 vUv;\nuniform float uTime;\nuniform float mouse;\nuniform float uEnableWaves;\n\nvoid main() {\n vUv = uv;\n float time = uTime * 5.;\n\n float waveFactor = uEnableWaves;\n\n vec3 transformed = position;\n\n transformed.x += sin(time + position.y) * 0.5 * waveFactor;\n transformed.y += cos(time + position.z) * 0.15 * waveFactor;\n transformed.z += sin(time + position.x) * waveFactor;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4(transformed, 1.0);\n}\n`;\n\nconst fragmentShader = `\nvarying vec2 vUv;\nuniform float mouse;\nuniform float uTime;\nuniform sampler2D uTexture;\n\nvoid main() {\n float time = uTime;\n vec2 pos = vUv;\n \n float move = sin(time + mouse) * 0.01;\n float r = texture2D(uTexture, pos + cos(time * 2. - time + pos.x) * .01).r;\n float g = texture2D(uTexture, pos + tan(time * .5 + pos.x - time) * .01).g;\n float b = texture2D(uTexture, pos - cos(time * 2. + time + pos.y) * .01).b;\n float a = texture2D(uTexture, pos).a;\n gl_FragColor = vec4(r, g, b, a);\n}\n`;\n\nconst PX_RATIO = typeof window !== \"undefined\" ? window.devicePixelRatio : 1;\n\nconst resolvedCanvasColorCache = new Map<string, string>();\n\nconst getThemeSignature = () => {\n if (typeof document === \"undefined\") return \"\";\n\n const root = document.documentElement;\n return [\n root.getAttribute(\"data-brand\") ?? \"\",\n root.getAttribute(\"data-mode\") ?? \"\",\n root.getAttribute(\"data-theme\") ?? \"\",\n ].join(\"|\");\n};\n\nconst resolveCanvasColor = (value: string): string => {\n if (typeof document === \"undefined\") return value;\n if (!value.includes(\"var(\") && !value.includes(\"color-mix(\")) return value;\n\n const cacheKey = `${getThemeSignature()}::${value}`;\n const cachedValue = resolvedCanvasColorCache.get(cacheKey);\n if (cachedValue) {\n return cachedValue;\n }\n\n const probe = document.createElement(\"span\");\n probe.style.color = value;\n probe.style.position = \"fixed\";\n probe.style.pointerEvents = \"none\";\n probe.style.opacity = \"0\";\n document.body.appendChild(probe);\n const resolvedValue = getComputedStyle(probe).color || value;\n document.body.removeChild(probe);\n resolvedCanvasColorCache.set(cacheKey, resolvedValue);\n return resolvedValue;\n};\n\ninterface AsciiFilterOptions {\n fontSize?: number;\n fontFamily?: string;\n charset?: string;\n invert?: boolean;\n}\n\nclass AsciiFilter {\n renderer: THREE.WebGLRenderer;\n domElement: HTMLDivElement;\n pre: HTMLPreElement;\n canvas: HTMLCanvasElement;\n context: CanvasRenderingContext2D;\n deg: number;\n invert: boolean;\n fontSize: number;\n fontFamily: string;\n charset: string;\n width: number = 0;\n height: number = 0;\n cols: number = 0;\n rows: number = 0;\n center: { x: number; y: number } = { x: 0, y: 0 };\n mouse: { x: number; y: number } = { x: 0, y: 0 };\n\n constructor(\n renderer: THREE.WebGLRenderer,\n { fontSize, fontFamily, charset, invert }: AsciiFilterOptions = {},\n ) {\n this.renderer = renderer;\n this.domElement = document.createElement(\"div\");\n this.domElement.style.position = \"absolute\";\n this.domElement.style.top = \"0\";\n this.domElement.style.left = \"0\";\n this.domElement.style.width = \"100%\";\n this.domElement.style.height = \"100%\";\n\n this.pre = document.createElement(\"pre\");\n this.domElement.appendChild(this.pre);\n\n this.canvas = document.createElement(\"canvas\");\n const ctx = this.canvas.getContext(\"2d\");\n if (!ctx) throw new Error(\"Could not get 2d context\");\n this.context = ctx;\n this.domElement.appendChild(this.canvas);\n\n this.deg = 0;\n this.invert = invert ?? true;\n this.fontSize = fontSize ?? 12;\n this.fontFamily = fontFamily ?? \"'Courier New', monospace\";\n this.charset =\n charset ??\n \" .'`^\\\",:;Il!i~+_-?][}{1)(|/tfjrxnuvczXYUJCLQ0OZmwqpdbkhao*#MW&8%B@$\";\n\n this.context.imageSmoothingEnabled = false;\n\n this.onMouseMove = this.onMouseMove.bind(this);\n document.addEventListener(\"mousemove\", this.onMouseMove);\n }\n\n setSize(width: number, height: number) {\n this.width = width;\n this.height = height;\n this.renderer.setSize(width, height);\n this.reset();\n\n this.center = { x: width / 2, y: height / 2 };\n this.mouse = { x: this.center.x, y: this.center.y };\n }\n\n reset() {\n this.context.font = `${this.fontSize}px ${this.fontFamily}`;\n const charWidth = this.context.measureText(\"A\").width;\n\n this.cols = Math.floor(\n this.width / (this.fontSize * (charWidth / this.fontSize)),\n );\n this.rows = Math.floor(this.height / this.fontSize);\n\n this.canvas.width = this.cols;\n this.canvas.height = this.rows;\n this.pre.style.fontFamily = this.fontFamily;\n this.pre.style.fontSize = `${this.fontSize}px`;\n this.pre.style.margin = \"0\";\n this.pre.style.padding = \"0\";\n this.pre.style.lineHeight = \"1em\";\n this.pre.style.position = \"absolute\";\n this.pre.style.left = \"0\";\n this.pre.style.top = \"0\";\n this.pre.style.zIndex = \"9\";\n this.pre.style.backgroundAttachment = \"fixed\";\n this.pre.style.mixBlendMode = \"difference\";\n }\n\n render(scene: THREE.Scene, camera: THREE.Camera) {\n this.renderer.render(scene, camera);\n\n const w = this.canvas.width;\n const h = this.canvas.height;\n this.context.clearRect(0, 0, w, h);\n if (this.context && w && h) {\n this.context.drawImage(this.renderer.domElement, 0, 0, w, h);\n }\n\n this.asciify(this.context, w, h);\n this.hue();\n }\n\n onMouseMove(e: MouseEvent) {\n this.mouse = { x: e.clientX * PX_RATIO, y: e.clientY * PX_RATIO };\n }\n\n get dx() {\n return this.mouse.x - this.center.x;\n }\n\n get dy() {\n return this.mouse.y - this.center.y;\n }\n\n hue() {\n const deg = (Math.atan2(this.dy, this.dx) * 180) / Math.PI;\n this.deg += (deg - this.deg) * 0.075;\n this.domElement.style.filter = `hue-rotate(${this.deg.toFixed(1)}deg)`;\n }\n\n asciify(ctx: CanvasRenderingContext2D, w: number, h: number) {\n if (w && h) {\n const imgData = ctx.getImageData(0, 0, w, h).data;\n let str = \"\";\n for (let y = 0; y < h; y++) {\n for (let x = 0; x < w; x++) {\n const i = x * 4 + y * 4 * w;\n const [r, g, b, a] = [\n imgData[i],\n imgData[i + 1],\n imgData[i + 2],\n imgData[i + 3],\n ];\n\n if (a === 0) {\n str += \" \";\n continue;\n }\n\n const gray = (0.3 * r + 0.6 * g + 0.1 * b) / 255;\n let idx = Math.floor((1 - gray) * (this.charset.length - 1));\n if (this.invert) idx = this.charset.length - idx - 1;\n str += this.charset[idx];\n }\n str += \"\\n\";\n }\n this.pre.innerHTML = str;\n }\n }\n\n dispose() {\n document.removeEventListener(\"mousemove\", this.onMouseMove);\n }\n}\n\ninterface CanvasTxtOptions {\n fontSize?: number;\n fontFamily?: string;\n color?: string;\n}\n\nclass CanvasTxt {\n canvas: HTMLCanvasElement;\n context: CanvasRenderingContext2D;\n txt: string;\n fontSize: number;\n fontFamily: string;\n color: string;\n font: string;\n\n constructor(\n txt: string,\n {\n fontSize = 200,\n fontFamily = \"Arial\",\n color = \"var(--ds-color-fg)\",\n }: CanvasTxtOptions = {},\n ) {\n this.canvas = document.createElement(\"canvas\");\n const ctx = this.canvas.getContext(\"2d\");\n if (!ctx) throw new Error(\"Could not get 2d context\");\n this.context = ctx;\n this.txt = txt;\n this.fontSize = fontSize;\n this.fontFamily = fontFamily;\n this.color = color;\n\n this.font = `600 ${this.fontSize}px ${this.fontFamily}`;\n }\n\n resize() {\n this.context.font = this.font;\n const metrics = this.context.measureText(this.txt);\n\n const textWidth = Math.ceil(metrics.width) + 20;\n const textHeight =\n Math.ceil(\n metrics.actualBoundingBoxAscent + metrics.actualBoundingBoxDescent,\n ) + 20;\n\n this.canvas.width = textWidth;\n this.canvas.height = textHeight;\n }\n\n render() {\n this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\n this.context.fillStyle = resolveCanvasColor(this.color);\n this.context.font = this.font;\n\n const metrics = this.context.measureText(this.txt);\n const yPos = 10 + metrics.actualBoundingBoxAscent;\n\n this.context.fillText(this.txt, 10, yPos);\n }\n\n get width() {\n return this.canvas.width;\n }\n\n get height() {\n return this.canvas.height;\n }\n\n get texture() {\n return this.canvas;\n }\n}\n\ninterface CanvAsciiOptions {\n text: string;\n asciiFontSize: number;\n textFontSize: number;\n textColor: string;\n planeBaseHeight: number;\n enableWaves: boolean;\n}\n\nclass CanvAscii {\n textString: string;\n asciiFontSize: number;\n textFontSize: number;\n textColor: string;\n planeBaseHeight: number;\n container: HTMLElement;\n width: number;\n height: number;\n enableWaves: boolean;\n camera: THREE.PerspectiveCamera;\n scene: THREE.Scene;\n mouse: { x: number; y: number };\n textCanvas!: CanvasTxt;\n texture!: THREE.CanvasTexture;\n geometry!: THREE.PlaneGeometry;\n material!: THREE.ShaderMaterial;\n mesh!: THREE.Mesh;\n renderer!: THREE.WebGLRenderer;\n filter!: AsciiFilter;\n center: { x: number; y: number } = { x: 0, y: 0 };\n animationFrameId: number = 0;\n\n constructor(\n {\n text,\n asciiFontSize,\n textFontSize,\n textColor,\n planeBaseHeight,\n enableWaves,\n }: CanvAsciiOptions,\n containerElem: HTMLElement,\n width: number,\n height: number,\n ) {\n this.textString = text;\n this.asciiFontSize = asciiFontSize;\n this.textFontSize = textFontSize;\n this.textColor = textColor;\n this.planeBaseHeight = planeBaseHeight;\n this.container = containerElem;\n this.width = width;\n this.height = height;\n this.enableWaves = enableWaves;\n\n this.camera = new THREE.PerspectiveCamera(\n 45,\n this.width / this.height,\n 1,\n 1000,\n );\n this.camera.position.z = 30;\n\n this.scene = new THREE.Scene();\n this.mouse = { x: 0, y: 0 };\n\n this.onMouseMove = this.onMouseMove.bind(this);\n\n this.setMesh();\n this.setRenderer();\n }\n\n setMesh() {\n this.textCanvas = new CanvasTxt(this.textString, {\n fontSize: this.textFontSize,\n fontFamily: \"IBM Plex Mono\",\n color: this.textColor,\n });\n this.textCanvas.resize();\n this.textCanvas.render();\n\n this.texture = new THREE.CanvasTexture(this.textCanvas.texture);\n this.texture.minFilter = THREE.NearestFilter;\n\n const textAspect = this.textCanvas.width / this.textCanvas.height;\n const baseH = this.planeBaseHeight;\n const planeW = baseH * textAspect;\n const planeH = baseH;\n\n this.geometry = new THREE.PlaneGeometry(planeW, planeH, 36, 36);\n this.material = new THREE.ShaderMaterial({\n vertexShader,\n fragmentShader,\n transparent: true,\n uniforms: {\n uTime: { value: 0 },\n mouse: { value: 1.0 },\n uTexture: { value: this.texture },\n uEnableWaves: { value: this.enableWaves ? 1.0 : 0.0 },\n },\n });\n\n this.mesh = new THREE.Mesh(this.geometry, this.material);\n this.scene.add(this.mesh);\n }\n\n setRenderer() {\n this.renderer = new THREE.WebGLRenderer({ antialias: false, alpha: true });\n this.renderer.setPixelRatio(1);\n this.renderer.setClearColor(0x000000, 0);\n\n this.filter = new AsciiFilter(this.renderer, {\n fontFamily: \"IBM Plex Mono\",\n fontSize: this.asciiFontSize,\n invert: true,\n });\n\n this.container.appendChild(this.filter.domElement);\n this.setSize(this.width, this.height);\n\n this.container.addEventListener(\"mousemove\", this.onMouseMove);\n this.container.addEventListener(\"touchmove\", this.onMouseMove);\n }\n\n setSize(w: number, h: number) {\n this.width = w;\n this.height = h;\n\n this.camera.aspect = w / h;\n this.camera.updateProjectionMatrix();\n\n this.filter.setSize(w, h);\n\n this.center = { x: w / 2, y: h / 2 };\n }\n\n load() {\n this.animate();\n }\n\n onMouseMove(evt: any) {\n const e = evt.touches ? evt.touches[0] : evt;\n const bounds = this.container.getBoundingClientRect();\n const x = e.clientX - bounds.left;\n const y = e.clientY - bounds.top;\n this.mouse = { x, y };\n }\n\n animate() {\n const animateFrame = () => {\n this.animationFrameId = requestAnimationFrame(animateFrame);\n this.render();\n };\n animateFrame();\n }\n\n render() {\n const time = new Date().getTime() * 0.001;\n\n this.textCanvas.render();\n this.texture.needsUpdate = true;\n\n (this.mesh.material as any).uniforms.uTime.value = Math.sin(time);\n\n this.updateRotation();\n this.filter.render(this.scene, this.camera);\n }\n\n updateRotation() {\n const map = (\n n: number,\n start: number,\n stop: number,\n start2: number,\n stop2: number,\n ) => {\n return ((n - start) / (stop - start)) * (stop2 - start2) + start2;\n };\n\n const x = map(this.mouse.y, 0, this.height, 0.5, -0.5);\n const y = map(this.mouse.x, 0, this.width, -0.5, 0.5);\n\n this.mesh.rotation.x += (x - this.mesh.rotation.x) * 0.05;\n this.mesh.rotation.y += (y - this.mesh.rotation.y) * 0.05;\n }\n\n clear() {\n this.scene.traverse((obj: THREE.Object3D) => {\n if (obj instanceof THREE.Mesh) {\n if (Array.isArray(obj.material)) {\n obj.material.forEach((m: THREE.Material) => m.dispose());\n } else if (obj.material instanceof THREE.Material) {\n obj.material.dispose();\n }\n obj.geometry.dispose();\n }\n });\n this.scene.clear();\n }\n\n dispose() {\n cancelAnimationFrame(this.animationFrameId);\n this.filter.dispose();\n if (this.filter.domElement.parentNode === this.container) {\n this.container.removeChild(this.filter.domElement);\n }\n this.container.removeEventListener(\"mousemove\", this.onMouseMove);\n this.container.removeEventListener(\"touchmove\", this.onMouseMove);\n this.clear();\n this.renderer.dispose();\n }\n}\n\nexport interface ASCIITextProps {\n text?: string;\n asciiFontSize?: number;\n textFontSize?: number;\n textColor?: string;\n planeBaseHeight?: number;\n enableWaves?: boolean;\n className?: string;\n style?: React.CSSProperties;\n}\n\nexport const ASCIIText: React.FC<ASCIITextProps> = ({\n text = \"David!\",\n asciiFontSize = 8,\n textFontSize = 200,\n textColor = \"var(--ds-color-fg)\",\n planeBaseHeight = 8,\n enableWaves = true,\n className = \"\",\n style = {},\n}) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const asciiRef = useRef<CanvAscii | null>(null);\n\n useEffect(() => {\n if (!containerRef.current) return;\n\n const { width, height } = containerRef.current.getBoundingClientRect();\n\n const initAscii = (w: number, h: number) => {\n if (asciiRef.current) asciiRef.current.dispose();\n asciiRef.current = new CanvAscii(\n {\n text,\n asciiFontSize,\n textFontSize,\n textColor,\n planeBaseHeight,\n enableWaves,\n },\n containerRef.current!,\n w,\n h,\n );\n asciiRef.current.load();\n };\n\n if (width === 0 || height === 0) {\n const observer = new IntersectionObserver(\n ([entry]) => {\n if (\n entry.isIntersecting &&\n entry.boundingClientRect.width > 0 &&\n entry.boundingClientRect.height > 0\n ) {\n initAscii(\n entry.boundingClientRect.width,\n entry.boundingClientRect.height,\n );\n observer.disconnect();\n }\n },\n { threshold: 0.1 },\n );\n\n observer.observe(containerRef.current);\n\n return () => {\n observer.disconnect();\n if (asciiRef.current) {\n asciiRef.current.dispose();\n }\n };\n }\n\n initAscii(width, height);\n\n const ro = new ResizeObserver((entries) => {\n if (!entries[0] || !asciiRef.current) return;\n const { width: w, height: h } = entries[0].contentRect;\n if (w > 0 && h > 0) {\n asciiRef.current.setSize(w, h);\n }\n });\n ro.observe(containerRef.current);\n\n return () => {\n ro.disconnect();\n if (asciiRef.current) {\n asciiRef.current.dispose();\n }\n };\n }, [\n text,\n asciiFontSize,\n textFontSize,\n textColor,\n planeBaseHeight,\n enableWaves,\n ]);\n\n return (\n <div\n ref={containerRef}\n className={`ascii-text-container ${className}`}\n style={{\n position: \"absolute\",\n width: \"100%\",\n height: \"100%\",\n ...style,\n }}\n >\n <style>{`\n @import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@500&display=swap');\n\n .ascii-text-container canvas {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n image-rendering: optimizeSpeed;\n image-rendering: -moz-crisp-edges;\n image-rendering: -o-crisp-edges;\n image-rendering: -webkit-optimize-contrast;\n image-rendering: optimize-contrast;\n image-rendering: crisp-edges;\n image-rendering: pixelated;\n }\n\n .ascii-text-container pre {\n margin: 0;\n user-select: none;\n padding: 0;\n line-height: 1em;\n text-align: left;\n position: absolute;\n left: 0;\n top: 0;\n background-image: radial-gradient(circle, var(--ds-color-accent) 0%, var(--ds-color-accent-hover) 50%, var(--ds-color-warning) 100%);\n background-attachment: fixed;\n -webkit-text-fill-color: transparent;\n -webkit-background-clip: text;\n background-clip: text;\n z-index: 9;\n mix-blend-mode: difference;\n }\n `}</style>\n </div>\n );\n};\n\nexport default ASCIIText;\n"],"mappings":";;;;;;;AAGA,IAAM,eAAe;;;;;;;;;;;;;;;;;;;;;AAsBrB,IAAM,iBAAiB;;;;;;;;;;;;;;;;;;AAmBvB,IA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MAAM,EAAE,OAAO,GAAG,QAAQ,MAAM,QAAQ,GAAG;AAC3C,OAAI,IAAI,KAAK,IAAI,EACf,UAAS,QAAQ,QAAQ,GAAG,EAAE;IAEhC;AACF,KAAG,QAAQ,aAAa,QAAQ;AAEhC,eAAa;AACX,MAAG,YAAY;AACf,OAAI,SAAS,QACX,UAAS,QAAQ,SAAS;;IAG7B;EACD;EACA;EACA;EACA;EACA;EACA;EACD,CAAC;AAEF,QACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EACE,KAAK;EACL,WAAW,wBAAwB;EACnC,OAAO;GACL,UAAU;GACV,OAAO;GACP,QAAQ;GACR,GAAG;GACJ;YAED,iBAAA,GAAA,kBAAA,KAAC,SAAD,EAAA,UAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAmCE,CAAA;EACN,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"background-gradient-animation-BL-lnrJe.mjs","names":[],"sources":["../../src/components/effects/background-gradient-animation/BackgroundGradientAnimation.tsx","../../src/components/effects/background-gradient-animation/BackgroundGradientAnimationDemo.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from
|
|
1
|
+
{"version":3,"file":"background-gradient-animation-BL-lnrJe.mjs","names":[],"sources":["../../src/components/effects/background-gradient-animation/BackgroundGradientAnimation.tsx","../../src/components/effects/background-gradient-animation/BackgroundGradientAnimationDemo.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from \"react\";\nimport { mergeClassNames } from \"../../../utils\";\n\nexport interface BackgroundGradientAnimationProps {\n gradientBackgroundStart?: string;\n gradientBackgroundEnd?: string;\n firstColor?: string;\n secondColor?: string;\n thirdColor?: string;\n fourthColor?: string;\n fifthColor?: string;\n pointerColor?: string;\n size?: string;\n blendingValue?: string;\n children?: React.ReactNode;\n className?: string;\n interactive?: boolean;\n containerClassName?: string;\n}\n\nexport const BackgroundGradientAnimation = ({\n gradientBackgroundStart = \"rgb(108, 0, 162)\",\n gradientBackgroundEnd = \"rgb(0, 17, 82)\",\n firstColor = \"18, 113, 255\",\n secondColor = \"221, 74, 255\",\n thirdColor = \"100, 220, 255\",\n fourthColor = \"200, 50, 50\",\n fifthColor = \"180, 180, 50\",\n pointerColor = \"140, 100, 255\",\n size = \"80%\",\n blendingValue = \"hard-light\",\n children,\n className,\n interactive = true,\n containerClassName,\n}: BackgroundGradientAnimationProps) => {\n const interactiveRef = useRef<HTMLDivElement>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n\n const currentPositionRef = useRef({ x: 0, y: 0 });\n const targetPositionRef = useRef({ x: 0, y: 0 });\n\n useEffect(() => {\n if (!interactive) {\n return;\n }\n\n let animationFrameId = 0;\n\n const move = () => {\n const interactiveElement = interactiveRef.current;\n\n if (interactiveElement) {\n const currentPosition = currentPositionRef.current;\n const targetPosition = targetPositionRef.current;\n\n currentPosition.x += (targetPosition.x - currentPosition.x) / 20;\n currentPosition.y += (targetPosition.y - currentPosition.y) / 20;\n\n interactiveElement.style.transform = `translate(${Math.round(\n currentPosition.x,\n )}px, ${Math.round(currentPosition.y)}px)`;\n }\n\n animationFrameId = window.requestAnimationFrame(move);\n };\n\n animationFrameId = window.requestAnimationFrame(move);\n\n return () => {\n window.cancelAnimationFrame(animationFrameId);\n };\n }, [interactive]);\n\n const handleMouseMove = (event: React.MouseEvent<HTMLDivElement>) => {\n if (interactiveRef.current) {\n const rect = interactiveRef.current.getBoundingClientRect();\n targetPositionRef.current = {\n x: event.clientX - rect.left,\n y: event.clientY - rect.top,\n };\n }\n };\n\n const [isSafari] = useState(() =>\n typeof navigator !== \"undefined\"\n ? /^((?!chrome|android).)*safari/i.test(navigator.userAgent)\n : false,\n );\n\n const blobStyle = (\n color: string,\n _animationClass: string,\n transformOrigin: string,\n opacity: number = 1,\n ): React.CSSProperties => ({\n position: \"absolute\",\n width: size,\n height: size,\n top: `calc(50% - ${size} / 2)`,\n left: `calc(50% - ${size} / 2)`,\n background: `radial-gradient(circle at center, rgba(${color}, 0.8) 0, rgba(${color}, 0) 50%) no-repeat`,\n mixBlendMode: blendingValue as React.CSSProperties[\"mixBlendMode\"],\n transformOrigin,\n opacity,\n });\n\n return (\n <div\n ref={containerRef}\n className={mergeClassNames(\n \"h-screen w-screen relative overflow-hidden top-0 left-0\",\n containerClassName,\n )}\n style={{\n background: `linear-gradient(40deg, ${gradientBackgroundStart}, ${gradientBackgroundEnd})`,\n }}\n >\n <svg className=\"hidden\">\n <defs>\n <filter id=\"blurMe\">\n <feGaussianBlur\n in=\"SourceGraphic\"\n stdDeviation=\"10\"\n result=\"blur\"\n />\n <feColorMatrix\n in=\"blur\"\n mode=\"matrix\"\n values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 18 -8\"\n result=\"goo\"\n />\n <feBlend in=\"SourceGraphic\" in2=\"goo\" />\n </filter>\n </defs>\n </svg>\n <div className={mergeClassNames(\"\", className)}>{children}</div>\n <div\n className=\"h-full w-full\"\n style={{\n filter: isSafari ? \"blur(24px)\" : \"url(#blurMe) blur(40px)\",\n }}\n >\n {/* First blob */}\n <div\n className=\"ui:animate-gradient-first\"\n style={blobStyle(\n firstColor,\n \"animate-gradient-first\",\n \"center center\",\n )}\n />\n {/* Second blob */}\n <div\n className=\"ui:animate-gradient-second\"\n style={blobStyle(\n secondColor,\n \"animate-gradient-second\",\n \"calc(50% - 400px)\",\n )}\n />\n {/* Third blob */}\n <div\n className=\"ui:animate-gradient-third\"\n style={blobStyle(\n thirdColor,\n \"animate-gradient-third\",\n \"calc(50% + 400px)\",\n )}\n />\n {/* Fourth blob */}\n <div\n className=\"ui:animate-gradient-fourth\"\n style={blobStyle(\n fourthColor,\n \"animate-gradient-fourth\",\n \"calc(50% - 200px)\",\n 0.7,\n )}\n />\n {/* Fifth blob */}\n <div\n className=\"ui:animate-gradient-fifth\"\n style={blobStyle(\n fifthColor,\n \"animate-gradient-fifth\",\n \"calc(50% - 800px) calc(50% + 800px)\",\n )}\n />\n\n {interactive && (\n <div\n ref={interactiveRef}\n onMouseMove={handleMouseMove}\n className=\"absolute w-full h-full\"\n style={{\n top: \"-50%\",\n left: \"-50%\",\n willChange: \"transform\",\n opacity: 0.7,\n background: `radial-gradient(circle at center, rgba(${pointerColor}, 0.8) 0, rgba(${pointerColor}, 0) 50%) no-repeat`,\n mixBlendMode:\n blendingValue as React.CSSProperties[\"mixBlendMode\"],\n }}\n />\n )}\n </div>\n </div>\n );\n};\n","import { BackgroundGradientAnimation } from \"./BackgroundGradientAnimation\";\n\nexport default function BackgroundGradientAnimationDemo() {\n return (\n <BackgroundGradientAnimation>\n <div className=\"ui:absolute ui:z-50 ui:inset-0 ui:flex ui:items-center ui:justify-center ui:text-white ui:font-bold ui:px-4 ui:pointer-events-none ui:text-3xl ui:text-center md:ui:text-4xl lg:ui:text-7xl\">\n <p className=\"ui:bg-clip-text ui:text-transparent ui:drop-shadow-2xl ui:bg-gradient-to-b ui:from-white/80 ui:to-white/20\">\n Gradients X Animations\n </p>\n </div>\n </BackgroundGradientAnimation>\n );\n}\n"],"mappings":";;;;AAoBA,IAAa,+BAA+B,EAC1C,0BAA0B,oBAC1B,wBAAwB,kBACxB,aAAa,gBACb,cAAc,gBACd,aAAa,iBACb,cAAc,eACd,aAAa,gBACb,eAAe,iBACf,OAAO,OACP,gBAAgB,cAChB,UACA,WACA,cAAc,MACd,yBACsC;CACtC,MAAM,iBAAiB,OAAuB,KAAK;CACnD,MAAM,eAAe,OAAuB,KAAK;CAEjD,MAAM,qBAAqB,OAAO;EAAE,GAAG;EAAG,GAAG;EAAG,CAAC;CACjD,MAAM,oBAAoB,OAAO;EAAE,GAAG;EAAG,GAAG;EAAG,CAAC;AAEhD,iBAAgB;AACd,MAAI,CAAC,YACH;EAGF,IAAI,mBAAmB;EAEvB,MAAM,aAAa;GACjB,MAAM,qBAAqB,eAAe;AAE1C,OAAI,oBAAoB;IACtB,MAAM,kBAAkB,mBAAmB;IAC3C,MAAM,iBAAiB,kBAAkB;AAEzC,oBAAgB,MA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ACN,oBAAC,OAAD;IAAK,WAAW,gBAAgB,IAAI,UAAU;IAAG;IAAe,CAAA;GAChE,qBAAC,OAAD;IACE,WAAU;IACV,OAAO,EACL,QAAQ,WAAW,eAAe,2BACnC;cAJH;KAOE,oBAAC,OAAD;MACE,WAAU;MACV,OAAO,UACL,YACA,0BACA,gBACD;MACD,CAAA;KAEF,oBAAC,OAAD;MACE,WAAU;MACV,OAAO,UACL,aACA,2BACA,oBACD;MACD,CAAA;KAEF,oBAAC,OAAD;MACE,WAAU;MACV,OAAO,UACL,YACA,0BACA,oBACD;MACD,CAAA;KAEF,oBAAC,OAAD;MACE,WAAU;MACV,OAAO,UACL,aACA,2BACA,qBACA,GACD;MACD,CAAA;KAEF,oBAAC,OAAD;MACE,WAAU;MACV,OAAO,UACL,YACA,0BACA,sCACD;MACD,CAAA;KAED,eACC,oBAAC,OAAD;MACE,KAAK;MACL,aAAa;MACb,WAAU;MACV,OAAO;OACL,KAAK;OACL,MAAM;OACN,YAAY;OACZ,SAAS;OACT,YAAY,0CAA0C,aAAa,iBAAiB,aAAa;OACjG,cACE;OACH;MACD,CAAA;KAEA;;GACF;;;;;AC7MV,SAAwB,kCAAkC;AACxD,QACE,oBAAC,6BAAD,EAAA,UACE,oBAAC,OAAD;EAAK,WAAU;YACb,oBAAC,KAAD;GAAG,WAAU;aAA6G;GAEtH,CAAA;EACA,CAAA,EACsB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"background-gradient-animation-CXV9GDH8.cjs","names":[],"sources":["../../src/components/effects/background-gradient-animation/BackgroundGradientAnimation.tsx","../../src/components/effects/background-gradient-animation/BackgroundGradientAnimationDemo.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from
|
|
1
|
+
{"version":3,"file":"background-gradient-animation-CXV9GDH8.cjs","names":[],"sources":["../../src/components/effects/background-gradient-animation/BackgroundGradientAnimation.tsx","../../src/components/effects/background-gradient-animation/BackgroundGradientAnimationDemo.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from \"react\";\nimport { mergeClassNames } from \"../../../utils\";\n\nexport interface BackgroundGradientAnimationProps {\n gradientBackgroundStart?: string;\n gradientBackgroundEnd?: string;\n firstColor?: string;\n secondColor?: string;\n thirdColor?: string;\n fourthColor?: string;\n fifthColor?: string;\n pointerColor?: string;\n size?: string;\n blendingValue?: string;\n children?: React.ReactNode;\n className?: string;\n interactive?: boolean;\n containerClassName?: string;\n}\n\nexport const BackgroundGradientAnimation = ({\n gradientBackgroundStart = \"rgb(108, 0, 162)\",\n gradientBackgroundEnd = \"rgb(0, 17, 82)\",\n firstColor = \"18, 113, 255\",\n secondColor = \"221, 74, 255\",\n thirdColor = \"100, 220, 255\",\n fourthColor = \"200, 50, 50\",\n fifthColor = \"180, 180, 50\",\n pointerColor = \"140, 100, 255\",\n size = \"80%\",\n blendingValue = \"hard-light\",\n children,\n className,\n interactive = true,\n containerClassName,\n}: BackgroundGradientAnimationProps) => {\n const interactiveRef = useRef<HTMLDivElement>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n\n const currentPositionRef = useRef({ x: 0, y: 0 });\n const targetPositionRef = useRef({ x: 0, y: 0 });\n\n useEffect(() => {\n if (!interactive) {\n return;\n }\n\n let animationFrameId = 0;\n\n const move = () => {\n const interactiveElement = interactiveRef.current;\n\n if (interactiveElement) {\n const currentPosition = currentPositionRef.current;\n const targetPosition = targetPositionRef.current;\n\n currentPosition.x += (targetPosition.x - currentPosition.x) / 20;\n currentPosition.y += (targetPosition.y - currentPosition.y) / 20;\n\n interactiveElement.style.transform = `translate(${Math.round(\n currentPosition.x,\n )}px, ${Math.round(currentPosition.y)}px)`;\n }\n\n animationFrameId = window.requestAnimationFrame(move);\n };\n\n animationFrameId = window.requestAnimationFrame(move);\n\n return () => {\n window.cancelAnimationFrame(animationFrameId);\n };\n }, [interactive]);\n\n const handleMouseMove = (event: React.MouseEvent<HTMLDivElement>) => {\n if (interactiveRef.current) {\n const rect = interactiveRef.current.getBoundingClientRect();\n targetPositionRef.current = {\n x: event.clientX - rect.left,\n y: event.clientY - rect.top,\n };\n }\n };\n\n const [isSafari] = useState(() =>\n typeof navigator !== \"undefined\"\n ? /^((?!chrome|android).)*safari/i.test(navigator.userAgent)\n : false,\n );\n\n const blobStyle = (\n color: string,\n _animationClass: string,\n transformOrigin: string,\n opacity: number = 1,\n ): React.CSSProperties => ({\n position: \"absolute\",\n width: size,\n height: size,\n top: `calc(50% - ${size} / 2)`,\n left: `calc(50% - ${size} / 2)`,\n background: `radial-gradient(circle at center, rgba(${color}, 0.8) 0, rgba(${color}, 0) 50%) no-repeat`,\n mixBlendMode: blendingValue as React.CSSProperties[\"mixBlendMode\"],\n transformOrigin,\n opacity,\n });\n\n return (\n <div\n ref={containerRef}\n className={mergeClassNames(\n \"h-screen w-screen relative overflow-hidden top-0 left-0\",\n containerClassName,\n )}\n style={{\n background: `linear-gradient(40deg, ${gradientBackgroundStart}, ${gradientBackgroundEnd})`,\n }}\n >\n <svg className=\"hidden\">\n <defs>\n <filter id=\"blurMe\">\n <feGaussianBlur\n in=\"SourceGraphic\"\n stdDeviation=\"10\"\n result=\"blur\"\n />\n <feColorMatrix\n in=\"blur\"\n mode=\"matrix\"\n values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 18 -8\"\n result=\"goo\"\n />\n <feBlend in=\"SourceGraphic\" in2=\"goo\" />\n </filter>\n </defs>\n </svg>\n <div className={mergeClassNames(\"\", className)}>{children}</div>\n <div\n className=\"h-full w-full\"\n style={{\n filter: isSafari ? \"blur(24px)\" : \"url(#blurMe) blur(40px)\",\n }}\n >\n {/* First blob */}\n <div\n className=\"ui:animate-gradient-first\"\n style={blobStyle(\n firstColor,\n \"animate-gradient-first\",\n \"center center\",\n )}\n />\n {/* Second blob */}\n <div\n className=\"ui:animate-gradient-second\"\n style={blobStyle(\n secondColor,\n \"animate-gradient-second\",\n \"calc(50% - 400px)\",\n )}\n />\n {/* Third blob */}\n <div\n className=\"ui:animate-gradient-third\"\n style={blobStyle(\n thirdColor,\n \"animate-gradient-third\",\n \"calc(50% + 400px)\",\n )}\n />\n {/* Fourth blob */}\n <div\n className=\"ui:animate-gradient-fourth\"\n style={blobStyle(\n fourthColor,\n \"animate-gradient-fourth\",\n \"calc(50% - 200px)\",\n 0.7,\n )}\n />\n {/* Fifth blob */}\n <div\n className=\"ui:animate-gradient-fifth\"\n style={blobStyle(\n fifthColor,\n \"animate-gradient-fifth\",\n \"calc(50% - 800px) calc(50% + 800px)\",\n )}\n />\n\n {interactive && (\n <div\n ref={interactiveRef}\n onMouseMove={handleMouseMove}\n className=\"absolute w-full h-full\"\n style={{\n top: \"-50%\",\n left: \"-50%\",\n willChange: \"transform\",\n opacity: 0.7,\n background: `radial-gradient(circle at center, rgba(${pointerColor}, 0.8) 0, rgba(${pointerColor}, 0) 50%) no-repeat`,\n mixBlendMode:\n blendingValue as React.CSSProperties[\"mixBlendMode\"],\n }}\n />\n )}\n </div>\n </div>\n );\n};\n","import { BackgroundGradientAnimation } from \"./BackgroundGradientAnimation\";\n\nexport default function BackgroundGradientAnimationDemo() {\n return (\n <BackgroundGradientAnimation>\n <div className=\"ui:absolute ui:z-50 ui:inset-0 ui:flex ui:items-center ui:justify-center ui:text-white ui:font-bold ui:px-4 ui:pointer-events-none ui:text-3xl ui:text-center md:ui:text-4xl lg:ui:text-7xl\">\n <p className=\"ui:bg-clip-text ui:text-transparent ui:drop-shadow-2xl ui:bg-gradient-to-b ui:from-white/80 ui:to-white/20\">\n Gradients X Animations\n </p>\n </div>\n </BackgroundGradientAnimation>\n );\n}\n"],"mappings":";;;;;AAoBA,IAAa,+BAA+B,EAC1C,0BAA0B,oBAC1B,wBAAwB,kBACxB,aAAa,gBACb,cAAc,gBACd,aAAa,iBACb,cAAc,eACd,aAAa,gBACb,eAAe,iBACf,OAAO,OACP,gBAAgB,cAChB,UACA,WACA,cAAc,MACd,yBACsC;CACtC,MAAM,kBAAA,GAAA,MAAA,QAAwC,KAAK;CACnD,M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AA,GAAA,kBAAA,KAAC,OAAD;MACE,KAAK;MACL,aAAa;MACb,WAAU;MACV,OAAO;OACL,KAAK;OACL,MAAM;OACN,YAAY;OACZ,SAAS;OACT,YAAY,0CAA0C,aAAa,iBAAiB,aAAa;OACjG,cACE;OACH;MACD,CAAA;KAEA;;GACF;;;;;AC7MV,SAAwB,kCAAkC;AACxD,QACE,iBAAA,GAAA,kBAAA,KAAC,6BAAD,EAAA,UACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EAAK,WAAU;YACb,iBAAA,GAAA,kBAAA,KAAC,KAAD;GAAG,WAAU;aAA6G;GAEtH,CAAA;EACA,CAAA,EACsB,CAAA"}
|
|
@@ -18,8 +18,8 @@ var baseClasses = `
|
|
|
18
18
|
disabled:cursor-not-allowed
|
|
19
19
|
`;
|
|
20
20
|
var variantClassMap = {
|
|
21
|
-
primary: "bg-
|
|
22
|
-
secondary: "bg-
|
|
21
|
+
primary: "bg-accent hover:bg-accent-hover text-on-accent shadow-2",
|
|
22
|
+
secondary: "bg-surface border border-border text-fg shadow-1 hover:border-border-strong hover:bg-canvas"
|
|
23
23
|
};
|
|
24
24
|
var sizeClassMap = {
|
|
25
25
|
small: "py-2 px-3 text-xs",
|
|
@@ -39,4 +39,4 @@ var Button = ({ primary = false, size = "medium", backgroundColor, label, childr
|
|
|
39
39
|
//#endregion
|
|
40
40
|
export { Button as t };
|
|
41
41
|
|
|
42
|
-
//# sourceMappingURL=button-
|
|
42
|
+
//# sourceMappingURL=button-B0Lhj0AS.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button-B0Lhj0AS.mjs","names":[],"sources":["../../src/components/forms/button/Button.tsx"],"sourcesContent":["import type { ButtonProps } from \"./types\";\n\nconst baseClasses = `\n inline-flex\n items-center\n justify-center\n gap-2\n cursor-pointer\n rounded-lg\n font-semibold\n leading-none\n transition-all\n duration-200\n ease-in-out\n active:scale-95\n hover:opacity-90\n disabled:opacity-50\n disabled:cursor-not-allowed\n`;\nconst variantClassMap = {\n primary: \"bg-accent hover:bg-accent-hover text-on-accent shadow-2\",\n secondary:\n \"bg-surface border border-border text-fg shadow-1 hover:border-border-strong hover:bg-canvas\",\n};\nconst sizeClassMap = {\n small: \"py-2 px-3 text-xs\",\n medium: \"py-2.5 px-4 text-sm\",\n large: \"py-3 px-6 text-base\",\n};\n\nexport const Button = ({\n primary = false,\n size = \"medium\",\n backgroundColor,\n label,\n children,\n type = \"button\",\n className = \"\",\n ...props\n}: ButtonProps) => {\n const variantClasses = variantClassMap[primary ? \"primary\" : \"secondary\"];\n const sizeClasses =\n sizeClassMap[size as keyof typeof sizeClassMap] || sizeClassMap.medium;\n\n return (\n <button\n type={type}\n className={`${baseClasses} ${variantClasses} ${sizeClasses} ${className}`.trim()}\n style={backgroundColor ? { backgroundColor } : undefined}\n {...props}\n >\n {children}\n {label && <span>{label}</span>}\n </button>\n );\n};\n"],"mappings":";;AAEA,IAAM,cAAc;;;;;;;;;;;;;;;;;AAiBpB,IAAM,kBAAkB;CACtB,SAAS;CACT,WACE;CACH;AACD,IAAM,eAAe;CACnB,OAAO;CACP,QAAQ;CACR,OAAO;CACR;AAED,IAAa,UAAU,EACrB,UAAU,OACV,OAAO,UACP,iBACA,OACA,UACA,OAAO,UACP,YAAY,IACZ,GAAG,YACc;CACjB,MAAM,iBAAiB,gBAAgB,UAAU,YAAY;AAI7D,QACE,qBAAC,UAAD;EACQ;EACN,WAAW,GAAG,YAAY,GAAG,eAAe,GAL9C,aAAa,SAAsC,aAAa,OAKH,GAAG,YAAY,MAAM;EAChF,OAAO,kBAAkB,EAAE,iBAAiB,GAAG,KAAA;EAC/C,GAAI;YAJN,CAMG,UACA,SAAS,oBAAC,QAAD,EAAA,UAAO,OAAa,CAAA,CACvB"}
|
|
@@ -19,8 +19,8 @@ var baseClasses = `
|
|
|
19
19
|
disabled:cursor-not-allowed
|
|
20
20
|
`;
|
|
21
21
|
var variantClassMap = {
|
|
22
|
-
primary: "bg-
|
|
23
|
-
secondary: "bg-
|
|
22
|
+
primary: "bg-accent hover:bg-accent-hover text-on-accent shadow-2",
|
|
23
|
+
secondary: "bg-surface border border-border text-fg shadow-1 hover:border-border-strong hover:bg-canvas"
|
|
24
24
|
};
|
|
25
25
|
var sizeClassMap = {
|
|
26
26
|
small: "py-2 px-3 text-xs",
|
|
@@ -45,4 +45,4 @@ Object.defineProperty(exports, "Button", {
|
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
47
|
|
|
48
|
-
//# sourceMappingURL=button-
|
|
48
|
+
//# sourceMappingURL=button-CZL6kFzT.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button-CZL6kFzT.cjs","names":[],"sources":["../../src/components/forms/button/Button.tsx"],"sourcesContent":["import type { ButtonProps } from \"./types\";\n\nconst baseClasses = `\n inline-flex\n items-center\n justify-center\n gap-2\n cursor-pointer\n rounded-lg\n font-semibold\n leading-none\n transition-all\n duration-200\n ease-in-out\n active:scale-95\n hover:opacity-90\n disabled:opacity-50\n disabled:cursor-not-allowed\n`;\nconst variantClassMap = {\n primary: \"bg-accent hover:bg-accent-hover text-on-accent shadow-2\",\n secondary:\n \"bg-surface border border-border text-fg shadow-1 hover:border-border-strong hover:bg-canvas\",\n};\nconst sizeClassMap = {\n small: \"py-2 px-3 text-xs\",\n medium: \"py-2.5 px-4 text-sm\",\n large: \"py-3 px-6 text-base\",\n};\n\nexport const Button = ({\n primary = false,\n size = \"medium\",\n backgroundColor,\n label,\n children,\n type = \"button\",\n className = \"\",\n ...props\n}: ButtonProps) => {\n const variantClasses = variantClassMap[primary ? \"primary\" : \"secondary\"];\n const sizeClasses =\n sizeClassMap[size as keyof typeof sizeClassMap] || sizeClassMap.medium;\n\n return (\n <button\n type={type}\n className={`${baseClasses} ${variantClasses} ${sizeClasses} ${className}`.trim()}\n style={backgroundColor ? { backgroundColor } : undefined}\n {...props}\n >\n {children}\n {label && <span>{label}</span>}\n </button>\n );\n};\n"],"mappings":";;;AAEA,IAAM,cAAc;;;;;;;;;;;;;;;;;AAiBpB,IAAM,kBAAkB;CACtB,SAAS;CACT,WACE;CACH;AACD,IAAM,eAAe;CACnB,OAAO;CACP,QAAQ;CACR,OAAO;CACR;AAED,IAAa,UAAU,EACrB,UAAU,OACV,OAAO,UACP,iBACA,OACA,UACA,OAAO,UACP,YAAY,IACZ,GAAG,YACc;CACjB,MAAM,iBAAiB,gBAAgB,UAAU,YAAY;AAI7D,QACE,iBAAA,GAAA,kBAAA,MAAC,UAAD;EACQ;EACN,WAAW,GAAG,YAAY,GAAG,eAAe,GAL9C,aAAa,SAAsC,aAAa,OAKH,GAAG,YAAY,MAAM;EAChF,OAAO,kBAAkB,EAAE,iBAAiB,GAAG,KAAA;EAC/C,GAAI;YAJN,CAMG,UACA,SAAS,iBAAA,GAAA,kBAAA,KAAC,QAAD,EAAA,UAAO,OAAa,CAAA,CACvB"}
|
|
@@ -4,7 +4,7 @@ var Card = ({ title, description }) => {
|
|
|
4
4
|
return /* @__PURE__ */ jsx("div", {
|
|
5
5
|
className: "ui",
|
|
6
6
|
children: /* @__PURE__ */ jsx("div", {
|
|
7
|
-
className: "backdrop-blur-xl bg-white/70 dark:bg-neutral-900/70 border border-neutral-200 dark:border-neutral-700 rounded-lg shadow-lg overflow-hidden sm:max-w-xs lg:max-w-sm xl:max-w-md
|
|
7
|
+
className: "backdrop-blur-xl bg-white/70 dark:bg-neutral-900/70 border border-neutral-200 dark:border-neutral-700 rounded-lg shadow-lg overflow-hidden sm:max-w-xs lg:max-w-sm xl:max-w-md",
|
|
8
8
|
children: /* @__PURE__ */ jsxs("div", {
|
|
9
9
|
className: "px-6 py-4",
|
|
10
10
|
children: [/* @__PURE__ */ jsx("h2", {
|
|
@@ -21,4 +21,4 @@ var Card = ({ title, description }) => {
|
|
|
21
21
|
//#endregion
|
|
22
22
|
export { Card as t };
|
|
23
23
|
|
|
24
|
-
//# sourceMappingURL=card-
|
|
24
|
+
//# sourceMappingURL=card-CcIF6z2H.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card-CcIF6z2H.mjs","names":[],"sources":["../../src/components/data-display/card/Card.tsx"],"sourcesContent":["import type { CardProps } from \"./types\";\n\nexport const Card = ({ title, description }: CardProps) => {\n return (\n <div className=\"ui\">\n <div className=\"backdrop-blur-xl bg-white/70 dark:bg-neutral-900/70 border border-neutral-200 dark:border-neutral-700 rounded-lg shadow-lg overflow-hidden sm:max-w-xs lg:max-w-sm xl:max-w-md\">\n <div className=\"px-6 py-4\">\n <h2 className=\"text-neutral-900 dark:text-white font-bold text-xl mb-2\">\n {title}\n </h2>\n <p className=\"text-neutral-700 dark:text-neutral-300 bg-transparent border-none rounded-none font-sans text-base\">\n {description}\n </p>\n </div>\n </div>\n </div>\n );\n};\n"],"mappings":";;AAEA,IAAa,QAAQ,EAAE,OAAO,kBAA6B;AACzD,QACE,oBAAC,OAAD;EAAK,WAAU;YACb,oBAAC,OAAD;GAAK,WAAU;aACb,qBAAC,OAAD;IAAK,WAAU;cAAf,CACE,oBAAC,MAAD;KAAI,WAAU;eACX;KACE,CAAA,EACL,oBAAC,KAAD;KAAG,WAAU;eACV;KACC,CAAA,CACA;;GACF,CAAA;EACF,CAAA"}
|
|
@@ -5,7 +5,7 @@ var Card = ({ title, description }) => {
|
|
|
5
5
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
6
6
|
className: "ui",
|
|
7
7
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
8
|
-
className: "backdrop-blur-xl bg-white/70 dark:bg-neutral-900/70 border border-neutral-200 dark:border-neutral-700 rounded-lg shadow-lg overflow-hidden sm:max-w-xs lg:max-w-sm xl:max-w-md
|
|
8
|
+
className: "backdrop-blur-xl bg-white/70 dark:bg-neutral-900/70 border border-neutral-200 dark:border-neutral-700 rounded-lg shadow-lg overflow-hidden sm:max-w-xs lg:max-w-sm xl:max-w-md",
|
|
9
9
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
10
10
|
className: "px-6 py-4",
|
|
11
11
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", {
|
|
@@ -27,4 +27,4 @@ Object.defineProperty(exports, "Card", {
|
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
29
|
|
|
30
|
-
//# sourceMappingURL=card-
|
|
30
|
+
//# sourceMappingURL=card-gt-HZh0h.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card-gt-HZh0h.cjs","names":[],"sources":["../../src/components/data-display/card/Card.tsx"],"sourcesContent":["import type { CardProps } from \"./types\";\n\nexport const Card = ({ title, description }: CardProps) => {\n return (\n <div className=\"ui\">\n <div className=\"backdrop-blur-xl bg-white/70 dark:bg-neutral-900/70 border border-neutral-200 dark:border-neutral-700 rounded-lg shadow-lg overflow-hidden sm:max-w-xs lg:max-w-sm xl:max-w-md\">\n <div className=\"px-6 py-4\">\n <h2 className=\"text-neutral-900 dark:text-white font-bold text-xl mb-2\">\n {title}\n </h2>\n <p className=\"text-neutral-700 dark:text-neutral-300 bg-transparent border-none rounded-none font-sans text-base\">\n {description}\n </p>\n </div>\n </div>\n </div>\n );\n};\n"],"mappings":";;;AAEA,IAAa,QAAQ,EAAE,OAAO,kBAA6B;AACzD,QACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EAAK,WAAU;YACb,iBAAA,GAAA,kBAAA,KAAC,OAAD;GAAK,WAAU;aACb,iBAAA,GAAA,kBAAA,MAAC,OAAD;IAAK,WAAU;cAAf,CACE,iBAAA,GAAA,kBAAA,KAAC,MAAD;KAAI,WAAU;eACX;KACE,CAAA,EACL,iBAAA,GAAA,kBAAA,KAAC,KAAD;KAAG,WAAU;eACV;KACC,CAAA,CACA;;GACF,CAAA;EACF,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
require("./chunk-B_GkZjkl.cjs");
|
|
2
2
|
const require_utils = require("./utils-B4SmmY4J.cjs");
|
|
3
|
-
const require_icons = require("./icons-
|
|
3
|
+
const require_icons = require("./icons-BxIzP2jd.cjs");
|
|
4
4
|
let react = require("react");
|
|
5
5
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
6
|
let framer_motion = require("framer-motion");
|
|
@@ -290,7 +290,7 @@ var Carousel = ({ items, className, autoPlay = 0, showArrows = true, showDots =
|
|
|
290
290
|
}, index))
|
|
291
291
|
}),
|
|
292
292
|
autoPlay > 0 && !isPaused && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(framer_motion.motion.div, {
|
|
293
|
-
className: "ui:absolute ui:bottom-0 ui:left-0 ui:h-1 ui:bg-
|
|
293
|
+
className: "ui:absolute ui:bottom-0 ui:left-0 ui:h-1 ui:bg-accent/80 ui:rounded-full",
|
|
294
294
|
initial: { width: "0%" },
|
|
295
295
|
animate: { width: "100%" },
|
|
296
296
|
transition: {
|
|
@@ -310,4 +310,4 @@ Object.defineProperty(exports, "Carousel", {
|
|
|
310
310
|
}
|
|
311
311
|
});
|
|
312
312
|
|
|
313
|
-
//# sourceMappingURL=carousel-
|
|
313
|
+
//# sourceMappingURL=carousel-Cq5uwqQt.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carousel-BJ3nm2bw.mjs","names":[],"sources":["../../src/components/navigation/carousel/Carousel.tsx"],"sourcesContent":["import { useState, useEffect, useCallback, useRef } from \"react\";\nimport { motion, AnimatePresence } from \"framer-motion\";\n\nimport { ChevronLeftIcon, ChevronRightIcon } from \"../../icons\";\nimport { mergeClassNames } from \"../../../utils\";\nimport type { CarouselProps, CarouselAnimation } from \"./types\";\n\nconst variantStyles = {\n default: \"ui:bg-white ui:dark:bg-neutral-900 ui:shadow-xl\",\n glass:\n \"ui:bg-white/60 ui:dark:bg-neutral-900/50 ui:backdrop-blur-2xl ui:border ui:border-white/40 ui:dark:border-white/10\",\n minimal: \"ui:bg-transparent\",\n};\n\n// Animation variants for different carousel transitions\nconst getAnimationVariants = (animation: CarouselAnimation) => {\n const variants = {\n slide: {\n enter: (direction: number) => ({\n x: direction > 0 ? \"100%\" : \"-100%\",\n opacity: 0,\n }),\n center: { x: 0, opacity: 1 },\n exit: (direction: number) => ({\n x: direction < 0 ? \"100%\" : \"-100%\",\n opacity: 0,\n }),\n },\n fade: {\n enter: () => ({ opacity: 0 }),\n center: { opacity: 1 },\n exit: () => ({ opacity: 0 }),\n },\n scale: {\n enter: (direction: number) => ({\n scale: 0.8,\n opacity: 0,\n x: direction > 0 ? 50 : -50,\n }),\n center: { scale: 1, opacity: 1, x: 0 },\n exit: (direction: number) => ({\n scale: 0.8,\n opacity: 0,\n x: direction < 0 ? 50 : -50,\n }),\n },\n flip: {\n enter: (direction: number) => ({\n rotateY: direction > 0 ? 90 : -90,\n opacity: 0,\n }),\n center: { rotateY: 0, opacity: 1 },\n exit: (direction: number) => ({\n rotateY: direction < 0 ? 90 : -90,\n opacity: 0,\n }),\n },\n cube: {\n enter: (direction: number) => ({\n rotateY: direction > 0 ? 90 : -90,\n x: direction > 0 ? \"50%\" : \"-50%\",\n opacity: 0,\n scale: 0.8,\n }),\n center: { rotateY: 0, x: 0, opacity: 1, scale: 1 },\n exit: (direction: number) => ({\n rotateY: direction < 0 ? 90 : -90,\n x: direction < 0 ? \"50%\" : \"-50%\",\n opacity: 0,\n scale: 0.8,\n }),\n },\n cards: {\n enter: (direction: number) => ({\n scale: 0.9,\n opacity: 0,\n y: direction > 0 ? 100 : -100,\n rotateZ: direction > 0 ? 5 : -5,\n }),\n center: { scale: 1, opacity: 1, y: 0, rotateZ: 0 },\n exit: (direction: number) => ({\n scale: 0.9,\n opacity: 0,\n y: direction < 0 ? 100 : -100,\n rotateZ: direction < 0 ? 5 : -5,\n }),\n },\n };\n return variants[animation];\n};\n\n// Transition configs for each animation\nconst getTransitionConfig = (\n animation: CarouselAnimation,\n duration: number,\n) => {\n const durationSec = duration / 1000;\n const configs: Record<CarouselAnimation, object> = {\n slide: {\n x: { type: \"spring\", stiffness: 300, damping: 30 },\n opacity: { duration: durationSec },\n },\n fade: {\n opacity: { duration: durationSec, ease: \"easeInOut\" },\n },\n scale: {\n type: \"spring\",\n stiffness: 200,\n damping: 25,\n opacity: { duration: durationSec },\n },\n flip: {\n type: \"spring\",\n stiffness: 100,\n damping: 20,\n opacity: { duration: durationSec * 0.5 },\n },\n cube: {\n type: \"spring\",\n stiffness: 100,\n damping: 20,\n opacity: { duration: durationSec * 0.5 },\n },\n cards: {\n type: \"spring\",\n stiffness: 150,\n damping: 20,\n opacity: { duration: durationSec },\n },\n };\n return configs[animation];\n};\n\nexport const Carousel = ({\n items,\n className,\n autoPlay = 0,\n showArrows = true,\n showDots = true,\n infinite = true,\n pauseOnHover = true,\n animationDuration = 500,\n // gap and slidesPerView reserved for future multi-slide support\n gap: _gap = 0,\n slidesPerView: _slidesPerView = 1,\n renderArrow,\n renderDot,\n onSlideChange,\n variant = \"glass\",\n height = 400,\n style,\n initialSlide = 0,\n draggable = true,\n animation = \"slide\",\n}: CarouselProps) => {\n const animationVariants = getAnimationVariants(animation);\n const transitionConfig = getTransitionConfig(animation, animationDuration);\n const [[currentIndex, direction], setSlide] = useState([initialSlide, 0]);\n const [isPaused, setIsPaused] = useState(false);\n const intervalRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n const totalSlides = items.length;\n\n const goToSlide = useCallback(\n (index: number, dir?: number) => {\n let newIndex = index;\n if (infinite) {\n if (index < 0) newIndex = totalSlides - 1;\n else if (index >= totalSlides) newIndex = 0;\n } else {\n if (index < 0) newIndex = 0;\n else if (index >= totalSlides) newIndex = totalSlides - 1;\n }\n const newDirection = dir ?? (newIndex > currentIndex ? 1 : -1);\n setSlide([newIndex, newDirection]);\n onSlideChange?.(newIndex);\n },\n [currentIndex, infinite, totalSlides, onSlideChange],\n );\n\n const goNext = useCallback(\n () => goToSlide(currentIndex + 1, 1),\n [currentIndex, goToSlide],\n );\n const goPrev = useCallback(\n () => goToSlide(currentIndex - 1, -1),\n [currentIndex, goToSlide],\n );\n\n // Auto-play\n useEffect(() => {\n if (autoPlay > 0 && !isPaused) {\n intervalRef.current = setInterval(goNext, autoPlay);\n }\n return () => {\n if (intervalRef.current) clearInterval(intervalRef.current);\n };\n }, [autoPlay, isPaused, goNext]);\n\n // Keyboard navigation\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.key === \"ArrowLeft\") goPrev();\n if (e.key === \"ArrowRight\") goNext();\n };\n window.addEventListener(\"keydown\", handleKeyDown);\n return () => window.removeEventListener(\"keydown\", handleKeyDown);\n }, [goNext, goPrev]);\n\n // Drag handling\n const handleDragEnd = (\n _event: MouseEvent | TouchEvent | PointerEvent,\n info: {\n offset: { x: number; y: number };\n velocity: { x: number; y: number };\n },\n ) => {\n const threshold = 50;\n if (info.offset.x < -threshold) goNext();\n else if (info.offset.x > threshold) goPrev();\n };\n\n const currentItem = items[currentIndex];\n\n return (\n <div\n className={mergeClassNames(\n \"ui:relative ui:overflow-hidden ui:rounded-2xl ui:w-full\",\n variantStyles[variant],\n className,\n )}\n style={{\n height: typeof height === \"number\" ? `${height}px` : height,\n ...style,\n }}\n onMouseEnter={() => pauseOnHover && setIsPaused(true)}\n onMouseLeave={() => pauseOnHover && setIsPaused(false)}\n >\n {/* Slides */}\n <AnimatePresence initial={false} custom={direction} mode=\"wait\">\n <motion.div\n key={currentIndex}\n custom={direction}\n variants={animationVariants}\n initial=\"enter\"\n animate=\"center\"\n exit=\"exit\"\n transition={transitionConfig}\n drag={draggable ? \"x\" : false}\n dragConstraints={{ left: 0, right: 0 }}\n dragElastic={0.2}\n onDragEnd={handleDragEnd}\n className=\"ui:absolute ui:inset-0 ui:flex ui:items-center ui:justify-center ui:cursor-grab active:ui:cursor-grabbing\"\n style={{\n perspective:\n animation === \"flip\" || animation === \"cube\" ? 1000 : undefined,\n }}\n >\n {currentItem.image ? (\n <div className=\"ui:relative ui:w-full ui:h-full\">\n <img\n src={currentItem.image}\n alt={currentItem.alt || currentItem.title || \"Carousel slide\"}\n className=\"ui:w-full ui:h-full ui:object-cover\"\n />\n {(currentItem.title || currentItem.description) && (\n <div className=\"ui:absolute ui:bottom-0 ui:left-0 ui:right-0 ui:p-6 ui:bg-gradient-to-t ui:from-black/70 ui:to-transparent\">\n {currentItem.title && (\n <h3 className=\"ui:text-2xl ui:font-bold ui:text-white ui:mb-2\">\n {currentItem.title}\n </h3>\n )}\n {currentItem.description && (\n <p className=\"ui:text-white/80\">\n {currentItem.description}\n </p>\n )}\n </div>\n )}\n </div>\n ) : (\n <div className=\"ui:w-full ui:h-full ui:flex ui:items-center ui:justify-center ui:p-6\">\n {currentItem.content}\n </div>\n )}\n </motion.div>\n </AnimatePresence>\n\n {/* Navigation Arrows */}\n {showArrows && totalSlides > 1 && (\n <>\n {renderArrow ? (\n <>\n {renderArrow({ direction: \"prev\", onClick: goPrev })}\n {renderArrow({ direction: \"next\", onClick: goNext })}\n </>\n ) : (\n <>\n <motion.button\n type=\"button\"\n onClick={goPrev}\n className=\"ui:absolute ui:left-4 ui:top-1/2 ui:-translate-y-1/2 ui:z-20 ui:p-2 ui:rounded-full ui:bg-white/80 ui:dark:bg-neutral-800/80 ui:backdrop-blur-sm ui:text-neutral-800 ui:dark:text-white ui:shadow-lg ui:transition-all hover:ui:bg-white ui:dark:hover:bg-neutral-700\"\n whileHover={{ scale: 1.1 }}\n whileTap={{ scale: 0.9 }}\n aria-label=\"Previous slide\"\n >\n <ChevronLeftIcon className=\"ui:w-6 ui:h-6\" aria-hidden=\"true\" />\n </motion.button>\n <motion.button\n type=\"button\"\n onClick={goNext}\n className=\"ui:absolute ui:right-4 ui:top-1/2 ui:-translate-y-1/2 ui:z-20 ui:p-2 ui:rounded-full ui:bg-white/80 ui:dark:bg-neutral-800/80 ui:backdrop-blur-sm ui:text-neutral-800 ui:dark:text-white ui:shadow-lg ui:transition-all hover:ui:bg-white ui:dark:hover:bg-neutral-700\"\n whileHover={{ scale: 1.1 }}\n whileTap={{ scale: 0.9 }}\n aria-label=\"Next slide\"\n >\n <ChevronRightIcon\n className=\"ui:w-6 ui:h-6\"\n aria-hidden=\"true\"\n />\n </motion.button>\n </>\n )}\n </>\n )}\n\n {/* Dot Indicators */}\n {showDots && totalSlides > 1 && (\n <div className=\"ui:absolute ui:bottom-4 ui:left-1/2 ui:-translate-x-1/2 ui:z-20 ui:flex ui:gap-2 ui:p-2 ui:rounded-full ui:bg-black/20 ui:dark:bg-white/10 ui:backdrop-blur-sm\">\n {items.map((_, index) =>\n renderDot ? (\n renderDot({\n index,\n active: index === currentIndex,\n onClick: () => goToSlide(index),\n })\n ) : (\n <motion.button\n key={index}\n type=\"button\"\n onClick={() => goToSlide(index)}\n className={mergeClassNames(\n \"ui:rounded-full ui:transition-all ui:duration-300\",\n index === currentIndex\n ? \"ui:w-8 ui:h-2.5 ui:bg-white ui:shadow-lg\"\n : \"ui:w-2.5 ui:h-2.5 ui:bg-white/60 hover:ui:bg-white/90\",\n )}\n whileHover={{ scale: 1.2 }}\n whileTap={{ scale: 0.9 }}\n aria-label={`Go to slide ${index + 1}`}\n aria-current={index === currentIndex ? \"true\" : undefined}\n />\n ),\n )}\n </div>\n )}\n\n {/* Progress indicator */}\n {autoPlay > 0 && !isPaused && (\n <motion.div\n className=\"ui:absolute ui:bottom-0 ui:left-0 ui:h-1 ui:bg-primary/80 ui:rounded-full\"\n initial={{ width: \"0%\" }}\n animate={{ width: \"100%\" }}\n transition={{ duration: autoPlay / 1000, ease: \"linear\" }}\n key={currentIndex}\n />\n )}\n </div>\n );\n};\n\nCarousel.displayName = \"Carousel\";\n\nexport default Carousel;\n"],"mappings":";;;;;;AAOA,IAAM,gBAAgB;CACpB,SAAS;CACT,OACE;CACF,SAAS;CACV;AAGD,IAAM,wBAAwB,cAAiC;AAyE7D,QAxEiB;EACf,OAAO;GACL,QAAQ,eAAuB;IAC7B,GAAG,YAAY,IAAI,SAAS;IAC5B,SAAS;IACV;GACD,QAAQ;IAAE,GAAG;IAAG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J,YAAY,cAAc,KACzB,oBAAC,OAAD;IAAK,WAAU;cACZ,MAAM,KAAK,GAAG,UACb,YACE,UAAU;KACR;KACA,QAAQ,UAAU;KAClB,eAAe,UAAU,MAAM;KAChC,CAAC,GAEF,oBAAC,OAAO,QAAR;KAEE,MAAK;KACL,eAAe,UAAU,MAAM;KAC/B,WAAW,gBACT,qDACA,UAAU,eACN,6CACA,wDACL;KACD,YAAY,EAAE,OAAO,KAAK;KAC1B,UAAU,EAAE,OAAO,IAAK;KACxB,cAAY,eAAe,QAAQ;KACnC,gBAAc,UAAU,eAAe,SAAS,KAAA;KAChD,EAbK,MAaL,CAEL;IACG,CAAA;GAIP,WAAW,KAAK,CAAC,YAChB,oBAAC,OAAO,KAAR;IACE,WAAU;IACV,SAAS,EAAE,OAAO,MAAM;IACxB,SAAS,EAAE,OAAO,QAAQ;IAC1B,YAAY;KAAE,UAAU,WAAW;KAAM,MAAM;KAAU;IAEzD,EADK,aACL;GAEA;;;AAIV,SAAS,cAAc"}
|
|
1
|
+
{"version":3,"file":"carousel-Cq5uwqQt.cjs","names":[],"sources":["../../src/components/navigation/carousel/Carousel.tsx"],"sourcesContent":["import { useState, useEffect, useCallback, useRef } from \"react\";\nimport { motion, AnimatePresence } from \"framer-motion\";\n\nimport { ChevronLeftIcon, ChevronRightIcon } from \"../../icons\";\nimport { mergeClassNames } from \"../../../utils\";\nimport type { CarouselProps, CarouselAnimation } from \"./types\";\n\nconst variantStyles = {\n default: \"ui:bg-white ui:dark:bg-neutral-900 ui:shadow-xl\",\n glass:\n \"ui:bg-white/60 ui:dark:bg-neutral-900/50 ui:backdrop-blur-2xl ui:border ui:border-white/40 ui:dark:border-white/10\",\n minimal: \"ui:bg-transparent\",\n};\n\n// Animation variants for different carousel transitions\nconst getAnimationVariants = (animation: CarouselAnimation) => {\n const variants = {\n slide: {\n enter: (direction: number) => ({\n x: direction > 0 ? \"100%\" : \"-100%\",\n opacity: 0,\n }),\n center: { x: 0, opacity: 1 },\n exit: (direction: number) => ({\n x: direction < 0 ? \"100%\" : \"-100%\",\n opacity: 0,\n }),\n },\n fade: {\n enter: () => ({ opacity: 0 }),\n center: { opacity: 1 },\n exit: () => ({ opacity: 0 }),\n },\n scale: {\n enter: (direction: number) => ({\n scale: 0.8,\n opacity: 0,\n x: direction > 0 ? 50 : -50,\n }),\n center: { scale: 1, opacity: 1, x: 0 },\n exit: (direction: number) => ({\n scale: 0.8,\n opacity: 0,\n x: direction < 0 ? 50 : -50,\n }),\n },\n flip: {\n enter: (direction: number) => ({\n rotateY: direction > 0 ? 90 : -90,\n opacity: 0,\n }),\n center: { rotateY: 0, opacity: 1 },\n exit: (direction: number) => ({\n rotateY: direction < 0 ? 90 : -90,\n opacity: 0,\n }),\n },\n cube: {\n enter: (direction: number) => ({\n rotateY: direction > 0 ? 90 : -90,\n x: direction > 0 ? \"50%\" : \"-50%\",\n opacity: 0,\n scale: 0.8,\n }),\n center: { rotateY: 0, x: 0, opacity: 1, scale: 1 },\n exit: (direction: number) => ({\n rotateY: direction < 0 ? 90 : -90,\n x: direction < 0 ? \"50%\" : \"-50%\",\n opacity: 0,\n scale: 0.8,\n }),\n },\n cards: {\n enter: (direction: number) => ({\n scale: 0.9,\n opacity: 0,\n y: direction > 0 ? 100 : -100,\n rotateZ: direction > 0 ? 5 : -5,\n }),\n center: { scale: 1, opacity: 1, y: 0, rotateZ: 0 },\n exit: (direction: number) => ({\n scale: 0.9,\n opacity: 0,\n y: direction < 0 ? 100 : -100,\n rotateZ: direction < 0 ? 5 : -5,\n }),\n },\n };\n return variants[animation];\n};\n\n// Transition configs for each animation\nconst getTransitionConfig = (\n animation: CarouselAnimation,\n duration: number,\n) => {\n const durationSec = duration / 1000;\n const configs: Record<CarouselAnimation, object> = {\n slide: {\n x: { type: \"spring\", stiffness: 300, damping: 30 },\n opacity: { duration: durationSec },\n },\n fade: {\n opacity: { duration: durationSec, ease: \"easeInOut\" },\n },\n scale: {\n type: \"spring\",\n stiffness: 200,\n damping: 25,\n opacity: { duration: durationSec },\n },\n flip: {\n type: \"spring\",\n stiffness: 100,\n damping: 20,\n opacity: { duration: durationSec * 0.5 },\n },\n cube: {\n type: \"spring\",\n stiffness: 100,\n damping: 20,\n opacity: { duration: durationSec * 0.5 },\n },\n cards: {\n type: \"spring\",\n stiffness: 150,\n damping: 20,\n opacity: { duration: durationSec },\n },\n };\n return configs[animation];\n};\n\nexport const Carousel = ({\n items,\n className,\n autoPlay = 0,\n showArrows = true,\n showDots = true,\n infinite = true,\n pauseOnHover = true,\n animationDuration = 500,\n // gap and slidesPerView reserved for future multi-slide support\n gap: _gap = 0,\n slidesPerView: _slidesPerView = 1,\n renderArrow,\n renderDot,\n onSlideChange,\n variant = \"glass\",\n height = 400,\n style,\n initialSlide = 0,\n draggable = true,\n animation = \"slide\",\n}: CarouselProps) => {\n const animationVariants = getAnimationVariants(animation);\n const transitionConfig = getTransitionConfig(animation, animationDuration);\n const [[currentIndex, direction], setSlide] = useState([initialSlide, 0]);\n const [isPaused, setIsPaused] = useState(false);\n const intervalRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n const totalSlides = items.length;\n\n const goToSlide = useCallback(\n (index: number, dir?: number) => {\n let newIndex = index;\n if (infinite) {\n if (index < 0) newIndex = totalSlides - 1;\n else if (index >= totalSlides) newIndex = 0;\n } else {\n if (index < 0) newIndex = 0;\n else if (index >= totalSlides) newIndex = totalSlides - 1;\n }\n const newDirection = dir ?? (newIndex > currentIndex ? 1 : -1);\n setSlide([newIndex, newDirection]);\n onSlideChange?.(newIndex);\n },\n [currentIndex, infinite, totalSlides, onSlideChange],\n );\n\n const goNext = useCallback(\n () => goToSlide(currentIndex + 1, 1),\n [currentIndex, goToSlide],\n );\n const goPrev = useCallback(\n () => goToSlide(currentIndex - 1, -1),\n [currentIndex, goToSlide],\n );\n\n // Auto-play\n useEffect(() => {\n if (autoPlay > 0 && !isPaused) {\n intervalRef.current = setInterval(goNext, autoPlay);\n }\n return () => {\n if (intervalRef.current) clearInterval(intervalRef.current);\n };\n }, [autoPlay, isPaused, goNext]);\n\n // Keyboard navigation\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.key === \"ArrowLeft\") goPrev();\n if (e.key === \"ArrowRight\") goNext();\n };\n window.addEventListener(\"keydown\", handleKeyDown);\n return () => window.removeEventListener(\"keydown\", handleKeyDown);\n }, [goNext, goPrev]);\n\n // Drag handling\n const handleDragEnd = (\n _event: MouseEvent | TouchEvent | PointerEvent,\n info: {\n offset: { x: number; y: number };\n velocity: { x: number; y: number };\n },\n ) => {\n const threshold = 50;\n if (info.offset.x < -threshold) goNext();\n else if (info.offset.x > threshold) goPrev();\n };\n\n const currentItem = items[currentIndex];\n\n return (\n <div\n className={mergeClassNames(\n \"ui:relative ui:overflow-hidden ui:rounded-2xl ui:w-full\",\n variantStyles[variant],\n className,\n )}\n style={{\n height: typeof height === \"number\" ? `${height}px` : height,\n ...style,\n }}\n onMouseEnter={() => pauseOnHover && setIsPaused(true)}\n onMouseLeave={() => pauseOnHover && setIsPaused(false)}\n >\n {/* Slides */}\n <AnimatePresence initial={false} custom={direction} mode=\"wait\">\n <motion.div\n key={currentIndex}\n custom={direction}\n variants={animationVariants}\n initial=\"enter\"\n animate=\"center\"\n exit=\"exit\"\n transition={transitionConfig}\n drag={draggable ? \"x\" : false}\n dragConstraints={{ left: 0, right: 0 }}\n dragElastic={0.2}\n onDragEnd={handleDragEnd}\n className=\"ui:absolute ui:inset-0 ui:flex ui:items-center ui:justify-center ui:cursor-grab active:ui:cursor-grabbing\"\n style={{\n perspective:\n animation === \"flip\" || animation === \"cube\" ? 1000 : undefined,\n }}\n >\n {currentItem.image ? (\n <div className=\"ui:relative ui:w-full ui:h-full\">\n <img\n src={currentItem.image}\n alt={currentItem.alt || currentItem.title || \"Carousel slide\"}\n className=\"ui:w-full ui:h-full ui:object-cover\"\n />\n {(currentItem.title || currentItem.description) && (\n <div className=\"ui:absolute ui:bottom-0 ui:left-0 ui:right-0 ui:p-6 ui:bg-gradient-to-t ui:from-black/70 ui:to-transparent\">\n {currentItem.title && (\n <h3 className=\"ui:text-2xl ui:font-bold ui:text-white ui:mb-2\">\n {currentItem.title}\n </h3>\n )}\n {currentItem.description && (\n <p className=\"ui:text-white/80\">\n {currentItem.description}\n </p>\n )}\n </div>\n )}\n </div>\n ) : (\n <div className=\"ui:w-full ui:h-full ui:flex ui:items-center ui:justify-center ui:p-6\">\n {currentItem.content}\n </div>\n )}\n </motion.div>\n </AnimatePresence>\n\n {/* Navigation Arrows */}\n {showArrows && totalSlides > 1 && (\n <>\n {renderArrow ? (\n <>\n {renderArrow({ direction: \"prev\", onClick: goPrev })}\n {renderArrow({ direction: \"next\", onClick: goNext })}\n </>\n ) : (\n <>\n <motion.button\n type=\"button\"\n onClick={goPrev}\n className=\"ui:absolute ui:left-4 ui:top-1/2 ui:-translate-y-1/2 ui:z-20 ui:p-2 ui:rounded-full ui:bg-white/80 ui:dark:bg-neutral-800/80 ui:backdrop-blur-sm ui:text-neutral-800 ui:dark:text-white ui:shadow-lg ui:transition-all hover:ui:bg-white ui:dark:hover:bg-neutral-700\"\n whileHover={{ scale: 1.1 }}\n whileTap={{ scale: 0.9 }}\n aria-label=\"Previous slide\"\n >\n <ChevronLeftIcon className=\"ui:w-6 ui:h-6\" aria-hidden=\"true\" />\n </motion.button>\n <motion.button\n type=\"button\"\n onClick={goNext}\n className=\"ui:absolute ui:right-4 ui:top-1/2 ui:-translate-y-1/2 ui:z-20 ui:p-2 ui:rounded-full ui:bg-white/80 ui:dark:bg-neutral-800/80 ui:backdrop-blur-sm ui:text-neutral-800 ui:dark:text-white ui:shadow-lg ui:transition-all hover:ui:bg-white ui:dark:hover:bg-neutral-700\"\n whileHover={{ scale: 1.1 }}\n whileTap={{ scale: 0.9 }}\n aria-label=\"Next slide\"\n >\n <ChevronRightIcon\n className=\"ui:w-6 ui:h-6\"\n aria-hidden=\"true\"\n />\n </motion.button>\n </>\n )}\n </>\n )}\n\n {/* Dot Indicators */}\n {showDots && totalSlides > 1 && (\n <div className=\"ui:absolute ui:bottom-4 ui:left-1/2 ui:-translate-x-1/2 ui:z-20 ui:flex ui:gap-2 ui:p-2 ui:rounded-full ui:bg-black/20 ui:dark:bg-white/10 ui:backdrop-blur-sm\">\n {items.map((_, index) =>\n renderDot ? (\n renderDot({\n index,\n active: index === currentIndex,\n onClick: () => goToSlide(index),\n })\n ) : (\n <motion.button\n key={index}\n type=\"button\"\n onClick={() => goToSlide(index)}\n className={mergeClassNames(\n \"ui:rounded-full ui:transition-all ui:duration-300\",\n index === currentIndex\n ? \"ui:w-8 ui:h-2.5 ui:bg-white ui:shadow-lg\"\n : \"ui:w-2.5 ui:h-2.5 ui:bg-white/60 hover:ui:bg-white/90\",\n )}\n whileHover={{ scale: 1.2 }}\n whileTap={{ scale: 0.9 }}\n aria-label={`Go to slide ${index + 1}`}\n aria-current={index === currentIndex ? \"true\" : undefined}\n />\n ),\n )}\n </div>\n )}\n\n {/* Progress indicator */}\n {autoPlay > 0 && !isPaused && (\n <motion.div\n className=\"ui:absolute ui:bottom-0 ui:left-0 ui:h-1 ui:bg-accent/80 ui:rounded-full\"\n initial={{ width: \"0%\" }}\n animate={{ width: \"100%\" }}\n transition={{ duration: autoPlay / 1000, ease: \"linear\" }}\n key={currentIndex}\n />\n )}\n </div>\n );\n};\n\nCarousel.displayName = \"Carousel\";\n\nexport default Carousel;\n"],"mappings":";;;;;;;AAOA,IAAM,gBAAgB;CACpB,SAAS;CACT,OACE;CACF,SAAS;CACV;AAGD,IAAM,wBAAwB,cAAiC;AAyE7D,QAxEiB;EACf,OAAO;GACL,QAAQ,eAAuB;IAC7B,GAAG,YAAY,IAAI,SAAS;IAC5B,SAAS;IACV;GACD,QAAQ;IAAE,GAAG;IAAG,SAAS;IAAG;GAC5B,OAAO,eAAuB;IAC5B,GAAG,YAAY,IAAI,SAAS;IAC5B,SAAS;IACV;GACF;EACD,MAAM;GACJ,cAAc,EAAE,SAAS,GAAG;GAC5B,Q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AC,cAAA,iBAAD;KAAiB,WAAU;KAAgB,eAAY;KAAS,CAAA;IAClD,CAAA,EAChB,iBAAA,GAAA,kBAAA,KAAC,cAAA,OAAO,QAAR;IACE,MAAK;IACL,SAAS;IACT,WAAU;IACV,YAAY,EAAE,OAAO,KAAK;IAC1B,UAAU,EAAE,OAAO,IAAK;IACxB,cAAW;cAEX,iBAAA,GAAA,kBAAA,KAAC,cAAA,kBAAD;KACE,WAAU;KACV,eAAY;KACZ,CAAA;IACY,CAAA,CACf,EAAA,CAAA,EAEJ,CAAA;GAIJ,YAAY,cAAc,KACzB,iBAAA,GAAA,kBAAA,KAAC,OAAD;IAAK,WAAU;cACZ,MAAM,KAAK,GAAG,UACb,YACE,UAAU;KACR;KACA,QAAQ,UAAU;KAClB,eAAe,UAAU,MAAM;KAChC,CAAC,GAEF,iBAAA,GAAA,kBAAA,KAAC,cAAA,OAAO,QAAR;KAEE,MAAK;KACL,eAAe,UAAU,MAAM;KAC/B,WAAW,cAAA,gBACT,qDACA,UAAU,eACN,6CACA,wDACL;KACD,YAAY,EAAE,OAAO,KAAK;KAC1B,UAAU,EAAE,OAAO,IAAK;KACxB,cAAY,eAAe,QAAQ;KACnC,gBAAc,UAAU,eAAe,SAAS,KAAA;KAChD,EAbK,MAaL,CAEL;IACG,CAAA;GAIP,WAAW,KAAK,CAAC,YAChB,iBAAA,GAAA,kBAAA,KAAC,cAAA,OAAO,KAAR;IACE,WAAU;IACV,SAAS,EAAE,OAAO,MAAM;IACxB,SAAS,EAAE,OAAO,QAAQ;IAC1B,YAAY;KAAE,UAAU,WAAW;KAAM,MAAM;KAAU;IAEzD,EADK,aACL;GAEA;;;AAIV,SAAS,cAAc"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as mergeClassNames } from "./utils-ati1KkDb.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { M as ChevronLeftIcon, j as ChevronRightIcon } from "./icons-DuumN7z-.mjs";
|
|
3
3
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
4
4
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { AnimatePresence, motion } from "framer-motion";
|
|
@@ -289,7 +289,7 @@ var Carousel = ({ items, className, autoPlay = 0, showArrows = true, showDots =
|
|
|
289
289
|
}, index))
|
|
290
290
|
}),
|
|
291
291
|
autoPlay > 0 && !isPaused && /* @__PURE__ */ jsx(motion.div, {
|
|
292
|
-
className: "ui:absolute ui:bottom-0 ui:left-0 ui:h-1 ui:bg-
|
|
292
|
+
className: "ui:absolute ui:bottom-0 ui:left-0 ui:h-1 ui:bg-accent/80 ui:rounded-full",
|
|
293
293
|
initial: { width: "0%" },
|
|
294
294
|
animate: { width: "100%" },
|
|
295
295
|
transition: {
|
|
@@ -304,4 +304,4 @@ Carousel.displayName = "Carousel";
|
|
|
304
304
|
//#endregion
|
|
305
305
|
export { Carousel as t };
|
|
306
306
|
|
|
307
|
-
//# sourceMappingURL=carousel-
|
|
307
|
+
//# sourceMappingURL=carousel-DJdqBVRK.mjs.map
|