@customafk/lunas-ui 0.0.21 → 0.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/add-new-CVQQRkB9.js +2 -0
- package/dist/add-new-CVQQRkB9.js.map +1 -0
- package/dist/{add-new-BTpI7Ph7.cjs → add-new-CmzfSaTJ.cjs} +2 -2
- package/dist/add-new-CmzfSaTJ.cjs.map +1 -0
- package/dist/alert-dialog-CNHyP_A9.js +2 -0
- package/dist/alert-dialog-CNHyP_A9.js.map +1 -0
- package/dist/alert-dialog-D-oR0YW3.cjs +2 -0
- package/dist/alert-dialog-D-oR0YW3.cjs.map +1 -0
- package/dist/{badge-DHRQ-uwY.cjs → badge-D4NxkKeN.cjs} +1 -1
- package/dist/badge-D4NxkKeN.cjs.map +1 -0
- package/dist/{badge-bLqn3EB9.js → badge-DzKUgC8v.js} +1 -1
- package/dist/badge-DzKUgC8v.js.map +1 -0
- package/dist/button-BSGNpclh.cjs +2 -0
- package/dist/button-BSGNpclh.cjs.map +1 -0
- package/dist/{button-CqGv362j.d.cts → button-BajtMcjb.d.cts} +7 -5
- package/dist/button-CnMfXTBU.js +2 -0
- package/dist/button-CnMfXTBU.js.map +1 -0
- package/dist/{button-CFhTSUSV.d.ts → button-DLZoEj48.d.ts} +7 -5
- package/dist/{calendar-Cck0PPMB.cjs → calendar-B8IKzrdN.cjs} +2 -2
- package/dist/calendar-B8IKzrdN.cjs.map +1 -0
- package/dist/{calendar-BG-jrCZc.js → calendar-CbuOOMpK.js} +2 -2
- package/dist/calendar-CbuOOMpK.js.map +1 -0
- package/dist/card-CgQjctUE.js +2 -0
- package/dist/card-CgQjctUE.js.map +1 -0
- package/dist/card-DYVCumPc.cjs +2 -0
- package/dist/card-DYVCumPc.cjs.map +1 -0
- package/dist/cards/simple-card.cjs +1 -1
- package/dist/cards/simple-card.cjs.map +1 -1
- package/dist/cards/simple-card.js +1 -1
- package/dist/cards/simple-card.js.map +1 -1
- package/dist/{command-ChE1SC-Q.d.cts → command-80QuD-XX.d.ts} +12 -13
- package/dist/command-CoB5R5FI.cjs +2 -0
- package/dist/command-CoB5R5FI.cjs.map +1 -0
- package/dist/{command-DK3Z1Vcb.d.ts → command-DvCEx-HX.d.cts} +12 -13
- package/dist/command-TFZwJmux.js +2 -0
- package/dist/command-TFZwJmux.js.map +1 -0
- package/dist/data-display/country.cjs +1 -1
- package/dist/data-display/country.cjs.map +1 -1
- package/dist/data-display/country.js +1 -1
- package/dist/data-display/country.js.map +1 -1
- package/dist/data-display/data-list.cjs +1 -1
- package/dist/data-display/data-list.cjs.map +1 -1
- package/dist/data-display/data-list.d.cts +0 -2
- package/dist/data-display/data-list.d.ts +0 -2
- package/dist/data-display/data-list.js +1 -1
- package/dist/data-display/data-list.js.map +1 -1
- package/dist/data-display/date-tooltip.cjs +1 -1
- package/dist/data-display/date-tooltip.cjs.map +1 -1
- package/dist/data-display/date-tooltip.js +1 -1
- package/dist/data-display/date-tooltip.js.map +1 -1
- package/dist/data-display/date.cjs +1 -1
- package/dist/data-display/date.d.cts +1 -1
- package/dist/data-display/date.d.ts +1 -1
- package/dist/data-display/date.js +1 -1
- package/dist/data-display/empty.cjs +1 -1
- package/dist/data-display/empty.cjs.map +1 -1
- package/dist/data-display/empty.d.cts +2 -2
- package/dist/data-display/empty.d.ts +2 -2
- package/dist/data-display/empty.js +1 -1
- package/dist/data-display/empty.js.map +1 -1
- package/dist/data-display/name.cjs +1 -1
- package/dist/data-display/name.cjs.map +1 -1
- package/dist/data-display/name.js +1 -1
- package/dist/data-display/name.js.map +1 -1
- package/dist/data-display/phone-number.cjs +1 -1
- package/dist/data-display/phone-number.cjs.map +1 -1
- package/dist/data-display/phone-number.js +1 -1
- package/dist/data-display/phone-number.js.map +1 -1
- package/dist/data-display/role-badge.cjs +1 -1
- package/dist/data-display/role-badge.cjs.map +1 -1
- package/dist/data-display/role-badge.js +1 -1
- package/dist/data-display/role-badge.js.map +1 -1
- package/dist/data-display/statistic.cjs +1 -1
- package/dist/data-display/statistic.cjs.map +1 -1
- package/dist/data-display/statistic.d.cts +4 -4
- package/dist/data-display/statistic.d.ts +4 -4
- package/dist/data-display/statistic.js +1 -1
- package/dist/data-display/statistic.js.map +1 -1
- package/dist/{date-B1g1OMYc.js → date-BMq_DNsv.js} +1 -1
- package/dist/date-BMq_DNsv.js.map +1 -0
- package/dist/{date-Cw6Jf7k6.cjs → date-nd8WkPlx.cjs} +1 -1
- package/dist/date-nd8WkPlx.cjs.map +1 -0
- package/dist/{dialog-DoFMLK7H.d.cts → dialog-BInoLe-Q.d.ts} +12 -13
- package/dist/dialog-CSDDiHKO.js +2 -0
- package/dist/dialog-CSDDiHKO.js.map +1 -0
- package/dist/dialog-_Cgij9NP.cjs +2 -0
- package/dist/dialog-_Cgij9NP.cjs.map +1 -0
- package/dist/{dialog-BfAIULbh.d.ts → dialog-xylwF4m7.d.cts} +12 -13
- package/dist/dialogs/confirm-dialog.cjs +1 -1
- package/dist/dialogs/confirm-dialog.cjs.map +1 -1
- package/dist/dialogs/confirm-dialog.js +1 -1
- package/dist/dialogs/confirm-dialog.js.map +1 -1
- package/dist/dialogs/detail-dialog/component/sidebar.cjs +1 -1
- package/dist/dialogs/detail-dialog/component/sidebar.d.cts +43 -43
- package/dist/dialogs/detail-dialog/component/sidebar.d.ts +43 -43
- package/dist/dialogs/detail-dialog/component/sidebar.js +1 -1
- package/dist/dialogs/detail-dialog/index.cjs +1 -1
- package/dist/dialogs/detail-dialog/index.cjs.map +1 -1
- package/dist/dialogs/detail-dialog/index.js +1 -1
- package/dist/dialogs/detail-dialog/index.js.map +1 -1
- package/dist/dialogs/error-dialog.cjs +1 -1
- package/dist/dialogs/error-dialog.js +1 -1
- package/dist/dialogs/form-dialog.cjs +1 -1
- package/dist/dialogs/form-dialog.cjs.map +1 -1
- package/dist/dialogs/form-dialog.d.cts +3 -3
- package/dist/dialogs/form-dialog.d.ts +3 -3
- package/dist/dialogs/form-dialog.js +1 -1
- package/dist/dialogs/form-dialog.js.map +1 -1
- package/dist/dialogs/loading-dialog.cjs +1 -1
- package/dist/dialogs/loading-dialog.cjs.map +1 -1
- package/dist/dialogs/loading-dialog.js +1 -1
- package/dist/dialogs/loading-dialog.js.map +1 -1
- package/dist/dropdown-menu-BnfaOPEM.cjs +2 -0
- package/dist/dropdown-menu-BnfaOPEM.cjs.map +1 -0
- package/dist/dropdown-menu-D5uG4HZA.js +2 -0
- package/dist/dropdown-menu-D5uG4HZA.js.map +1 -0
- package/dist/{error-dialog-OeWIgIvF.cjs → error-dialog-D5R5le-W.cjs} +2 -2
- package/dist/error-dialog-D5R5le-W.cjs.map +1 -0
- package/dist/{error-dialog-Dg_OHJlH.js → error-dialog-Q99thrSD.js} +2 -2
- package/dist/error-dialog-Q99thrSD.js.map +1 -0
- package/dist/{flex-B5MQmxX8.cjs → flex-CNA_SId-.cjs} +1 -1
- package/dist/flex-CNA_SId-.cjs.map +1 -0
- package/dist/{flex-CBAzUoXK.js → flex-ILvQrYMJ.js} +1 -1
- package/dist/flex-ILvQrYMJ.js.map +1 -0
- package/dist/{form-BbU1TIro.cjs → form-CHs85hm6.cjs} +2 -2
- package/dist/form-CHs85hm6.cjs.map +1 -0
- package/dist/{form-BMnG2xLt.js → form-tabDlutX.js} +2 -2
- package/dist/form-tabDlutX.js.map +1 -0
- package/dist/{form-wrapper-wHzrskjb.js → form-wrapper-C2xlvWx0.js} +2 -2
- package/dist/form-wrapper-C2xlvWx0.js.map +1 -0
- package/dist/{form-wrapper-DeSGl64P.cjs → form-wrapper-CY-stRaQ.cjs} +2 -2
- package/dist/form-wrapper-CY-stRaQ.cjs.map +1 -0
- package/dist/forms/combobox-field.cjs +1 -1
- package/dist/forms/combobox-field.cjs.map +1 -1
- package/dist/forms/combobox-field.d.cts +2 -2
- package/dist/forms/combobox-field.d.ts +2 -2
- package/dist/forms/combobox-field.js +1 -1
- package/dist/forms/combobox-field.js.map +1 -1
- package/dist/forms/date-field.cjs +1 -1
- package/dist/forms/date-field.cjs.map +1 -1
- package/dist/forms/date-field.d.ts +2 -2
- package/dist/forms/date-field.js +1 -1
- package/dist/forms/date-field.js.map +1 -1
- package/dist/forms/form-wrapper.cjs +1 -1
- package/dist/forms/form-wrapper.d.cts +3 -3
- package/dist/forms/form-wrapper.d.ts +3 -3
- package/dist/forms/form-wrapper.js +1 -1
- package/dist/forms/multi-select-field.cjs +1 -1
- package/dist/forms/multi-select-field.cjs.map +1 -1
- package/dist/forms/multi-select-field.d.cts +2 -2
- package/dist/forms/multi-select-field.d.ts +2 -2
- package/dist/forms/multi-select-field.js +1 -1
- package/dist/forms/multi-select-field.js.map +1 -1
- package/dist/forms/number-field.cjs +1 -1
- package/dist/forms/number-field.cjs.map +1 -1
- package/dist/forms/number-field.d.cts +2 -2
- package/dist/forms/number-field.d.ts +2 -2
- package/dist/forms/number-field.js +1 -1
- package/dist/forms/number-field.js.map +1 -1
- package/dist/forms/password-field.cjs +1 -1
- package/dist/forms/password-field.cjs.map +1 -1
- package/dist/forms/password-field.d.cts +2 -2
- package/dist/forms/password-field.d.ts +2 -2
- package/dist/forms/password-field.js +1 -1
- package/dist/forms/password-field.js.map +1 -1
- package/dist/forms/select-field.cjs +1 -1
- package/dist/forms/select-field.cjs.map +1 -1
- package/dist/forms/select-field.d.cts +2 -2
- package/dist/forms/select-field.d.ts +2 -2
- package/dist/forms/select-field.js +1 -1
- package/dist/forms/select-field.js.map +1 -1
- package/dist/forms/switch-field.cjs +1 -1
- package/dist/forms/switch-field.cjs.map +1 -1
- package/dist/forms/switch-field.d.cts +2 -2
- package/dist/forms/switch-field.d.ts +2 -2
- package/dist/forms/switch-field.js +1 -1
- package/dist/forms/switch-field.js.map +1 -1
- package/dist/forms/text-field.cjs +1 -1
- package/dist/forms/text-field.cjs.map +1 -1
- package/dist/forms/text-field.d.cts +2 -2
- package/dist/forms/text-field.d.ts +2 -2
- package/dist/forms/text-field.js +1 -1
- package/dist/forms/text-field.js.map +1 -1
- package/dist/forms/textarea-field.cjs +1 -1
- package/dist/forms/textarea-field.cjs.map +1 -1
- package/dist/forms/textarea-field.d.cts +2 -2
- package/dist/forms/textarea-field.d.ts +2 -2
- package/dist/forms/textarea-field.js +1 -1
- package/dist/forms/textarea-field.js.map +1 -1
- package/dist/input--6vqz8UI.js +2 -0
- package/dist/input--6vqz8UI.js.map +1 -0
- package/dist/{input-CsU6VSlk.d.ts → input-BEvwsdQj.d.ts} +4 -4
- package/dist/{input-B0fJo2WZ.d.cts → input-Lfbw3nE_.d.cts} +4 -4
- package/dist/input-VZiryzkl.cjs +2 -0
- package/dist/input-VZiryzkl.cjs.map +1 -0
- package/dist/label-B_2ZQn0X.cjs +2 -0
- package/dist/label-B_2ZQn0X.cjs.map +1 -0
- package/dist/label-D1XmKlc3.js +2 -0
- package/dist/label-D1XmKlc3.js.map +1 -0
- package/dist/layouts/flex.cjs +1 -1
- package/dist/layouts/flex.d.cts +2 -2
- package/dist/layouts/flex.d.ts +2 -2
- package/dist/layouts/flex.js +1 -1
- package/dist/layouts/main/index.cjs +1 -1
- package/dist/layouts/main/index.cjs.map +1 -1
- package/dist/layouts/main/index.d.cts +4 -4
- package/dist/layouts/main/index.d.ts +4 -4
- package/dist/layouts/main/index.js +1 -1
- package/dist/layouts/main/index.js.map +1 -1
- package/dist/multi-select-Cjvm4tK5.cjs +2 -0
- package/dist/multi-select-Cjvm4tK5.cjs.map +1 -0
- package/dist/multi-select-D0bZVOnm.js +2 -0
- package/dist/multi-select-D0bZVOnm.js.map +1 -0
- package/dist/paragraph-B4cQhLhW.js +2 -0
- package/dist/paragraph-B4cQhLhW.js.map +1 -0
- package/dist/paragraph-DcRBcRhQ.cjs +2 -0
- package/dist/paragraph-DcRBcRhQ.cjs.map +1 -0
- package/dist/popover-CTFp7ZXi.js +2 -0
- package/dist/popover-CTFp7ZXi.js.map +1 -0
- package/dist/popover-DCcPvdz2.cjs +2 -0
- package/dist/popover-DCcPvdz2.cjs.map +1 -0
- package/dist/progress-DLxh7x1P.cjs +2 -0
- package/dist/progress-DLxh7x1P.cjs.map +1 -0
- package/dist/progress-DWrtxJv0.js +2 -0
- package/dist/progress-DWrtxJv0.js.map +1 -0
- package/dist/refresh-CYCzbKVl.js +2 -0
- package/dist/refresh-CYCzbKVl.js.map +1 -0
- package/dist/{refresh-H87p0PFk.cjs → refresh-DMj_wur3.cjs} +2 -2
- package/dist/refresh-DMj_wur3.cjs.map +1 -0
- package/dist/scroll-area-C0KQbcG0.js.map +1 -1
- package/dist/scroll-area-CBq8XL4c.cjs.map +1 -1
- package/dist/{search-input-BUIwdK4e.js → search-input-DqcwkgsY.js} +2 -2
- package/dist/search-input-DqcwkgsY.js.map +1 -0
- package/dist/{search-input-DXh-cAVU.cjs → search-input-yweS9EMM.cjs} +2 -2
- package/dist/search-input-yweS9EMM.cjs.map +1 -0
- package/dist/select-BHjk6yT3.cjs +2 -0
- package/dist/select-BHjk6yT3.cjs.map +1 -0
- package/dist/select-C6N3CXuY.js +2 -0
- package/dist/select-C6N3CXuY.js.map +1 -0
- package/dist/{separator-DgyR24FB.d.ts → separator-CGHXMKzf.d.ts} +3 -4
- package/dist/separator-Cigaqna1.cjs +2 -0
- package/dist/separator-Cigaqna1.cjs.map +1 -0
- package/dist/{separator-5OitSlUj.d.cts → separator-SKNlThFJ.d.cts} +3 -4
- package/dist/separator-aLdI4FQe.js +2 -0
- package/dist/separator-aLdI4FQe.js.map +1 -0
- package/dist/sheet-CX3PajAc.cjs +2 -0
- package/dist/sheet-CX3PajAc.cjs.map +1 -0
- package/dist/sheet-DqPtcv9H.js +2 -0
- package/dist/sheet-DqPtcv9H.js.map +1 -0
- package/dist/sidebar-BKNai9nJ.cjs +2 -0
- package/dist/sidebar-BKNai9nJ.cjs.map +1 -0
- package/dist/sidebar-BR_UWLC5.js +2 -0
- package/dist/sidebar-BR_UWLC5.js.map +1 -0
- package/dist/sidebar-C2FH-tzm.cjs +2 -0
- package/dist/sidebar-C2FH-tzm.cjs.map +1 -0
- package/dist/sidebar-DphZ29-4.js +2 -0
- package/dist/sidebar-DphZ29-4.js.map +1 -0
- package/dist/skeleton-C-9PuX3p.cjs +2 -0
- package/dist/skeleton-C-9PuX3p.cjs.map +1 -0
- package/dist/skeleton-sZeupFu_.js +2 -0
- package/dist/skeleton-sZeupFu_.js.map +1 -0
- package/dist/styles/base.cjs +0 -0
- package/dist/styles/base.css +32 -0
- package/dist/styles/base.css.map +1 -0
- package/dist/styles/base.js +1 -0
- package/dist/styles/loader.cjs +0 -0
- package/dist/styles/loader.css +116 -0
- package/dist/styles/loader.css.map +1 -0
- package/dist/styles/loader.js +1 -0
- package/dist/styles/theme.cjs +0 -0
- package/dist/styles/theme.css +106 -0
- package/dist/styles/theme.css.map +1 -0
- package/dist/styles/theme.js +1 -0
- package/dist/styles/typography.cjs +0 -0
- package/dist/styles/typography.css +9 -0
- package/dist/styles/typography.css.map +1 -0
- package/dist/styles/typography.js +1 -0
- package/dist/switch-965kHdW_.js +2 -0
- package/dist/switch-965kHdW_.js.map +1 -0
- package/dist/switch-C3igCoxt.cjs +2 -0
- package/dist/switch-C3igCoxt.cjs.map +1 -0
- package/dist/table/index.cjs +1 -1
- package/dist/table/index.cjs.map +1 -1
- package/dist/table/index.d.cts +2 -2
- package/dist/table/index.d.ts +2 -2
- package/dist/table/index.js +1 -1
- package/dist/table/index.js.map +1 -1
- package/dist/table-CTMRaGxa.cjs +2 -0
- package/dist/table-CTMRaGxa.cjs.map +1 -0
- package/dist/table-CsnugKnh.js +2 -0
- package/dist/table-CsnugKnh.js.map +1 -0
- package/dist/textarea-3XRFTUZ8.cjs +2 -0
- package/dist/textarea-3XRFTUZ8.cjs.map +1 -0
- package/dist/textarea-CQ6gAnm5.js +2 -0
- package/dist/textarea-CQ6gAnm5.js.map +1 -0
- package/dist/{title-DrIfj31i.cjs → title-6Uosk2b4.cjs} +2 -2
- package/dist/title-6Uosk2b4.cjs.map +1 -0
- package/dist/{title-CA6PvqiD.js → title-CxIwADiB.js} +2 -2
- package/dist/title-CxIwADiB.js.map +1 -0
- package/dist/{toggle-CyClmWQm.d.ts → toggle-9SGewcSc.d.cts} +5 -5
- package/dist/{toggle-BA0PLIVa.js → toggle-CHJ2edke.js} +2 -2
- package/dist/toggle-CHJ2edke.js.map +1 -0
- package/dist/{toggle-Ddewmqst.cjs → toggle-DO8QbhLS.cjs} +2 -2
- package/dist/toggle-DO8QbhLS.cjs.map +1 -0
- package/dist/{toggle-B9onDBto.d.cts → toggle-DxWgPH7j.d.ts} +5 -5
- package/dist/tooltip-B8KdfOeT.js +2 -0
- package/dist/tooltip-B8KdfOeT.js.map +1 -0
- package/dist/{tooltip-Ccg2G_fB.d.cts → tooltip-CbLQ7JEO.d.cts} +6 -6
- package/dist/tooltip-DLnAwybV.cjs +2 -0
- package/dist/tooltip-DLnAwybV.cjs.map +1 -0
- package/dist/{tooltip-Ju-oCFdl.d.ts → tooltip-DtXKnGdV.d.ts} +6 -6
- package/dist/{types-CnMfjcgO.cjs → types-CrbWxjnp.cjs} +1 -1
- package/dist/types-CrbWxjnp.cjs.map +1 -0
- package/dist/{types-BVNbk1ZN.js → types-DaIHddx7.js} +1 -1
- package/dist/types-DaIHddx7.js.map +1 -0
- package/dist/typography/paragraph.cjs +1 -1
- package/dist/typography/paragraph.d.cts +3 -4
- package/dist/typography/paragraph.d.ts +3 -4
- package/dist/typography/paragraph.js +1 -1
- package/dist/typography/title.cjs +1 -1
- package/dist/typography/title.d.cts +2 -2
- package/dist/typography/title.js +1 -1
- package/dist/ui/alert-dialog.cjs +1 -1
- package/dist/ui/alert-dialog.d.cts +12 -12
- package/dist/ui/alert-dialog.d.ts +2 -2
- package/dist/ui/alert-dialog.js +1 -1
- package/dist/ui/alert.cjs +1 -1
- package/dist/ui/alert.cjs.map +1 -1
- package/dist/ui/alert.d.cts +6 -6
- package/dist/ui/alert.d.ts +6 -6
- package/dist/ui/alert.js +1 -1
- package/dist/ui/alert.js.map +1 -1
- package/dist/ui/aspect-ratio.cjs +1 -1
- package/dist/ui/aspect-ratio.cjs.map +1 -1
- package/dist/ui/aspect-ratio.d.cts +2 -2
- package/dist/ui/aspect-ratio.d.ts +2 -2
- package/dist/ui/aspect-ratio.js +1 -1
- package/dist/ui/aspect-ratio.js.map +1 -1
- package/dist/ui/avatar.cjs.map +1 -1
- package/dist/ui/avatar.d.cts +4 -4
- package/dist/ui/avatar.d.ts +4 -4
- package/dist/ui/avatar.js.map +1 -1
- package/dist/ui/badge.cjs +1 -1
- package/dist/ui/badge.d.cts +5 -5
- package/dist/ui/badge.d.ts +5 -5
- package/dist/ui/badge.js +1 -1
- package/dist/ui/breadcrumb.cjs +1 -1
- package/dist/ui/breadcrumb.cjs.map +1 -1
- package/dist/ui/breadcrumb.d.cts +9 -9
- package/dist/ui/breadcrumb.d.ts +9 -9
- package/dist/ui/breadcrumb.js +1 -1
- package/dist/ui/breadcrumb.js.map +1 -1
- package/dist/ui/button.cjs +1 -1
- package/dist/ui/button.d.cts +1 -1
- package/dist/ui/button.d.ts +1 -1
- package/dist/ui/button.js +1 -1
- package/dist/ui/buttons/add-new.cjs +1 -1
- package/dist/ui/buttons/add-new.js +1 -1
- package/dist/ui/buttons/edit.cjs +1 -1
- package/dist/ui/buttons/edit.cjs.map +1 -1
- package/dist/ui/buttons/edit.js +1 -1
- package/dist/ui/buttons/edit.js.map +1 -1
- package/dist/ui/buttons/refresh.cjs +1 -1
- package/dist/ui/buttons/refresh.js +1 -1
- package/dist/ui/buttons/trash.cjs +1 -1
- package/dist/ui/buttons/trash.cjs.map +1 -1
- package/dist/ui/buttons/trash.js +1 -1
- package/dist/ui/buttons/trash.js.map +1 -1
- package/dist/ui/buttons/upload-image.cjs +1 -1
- package/dist/ui/buttons/upload-image.cjs.map +1 -1
- package/dist/ui/buttons/upload-image.js +1 -1
- package/dist/ui/buttons/upload-image.js.map +1 -1
- package/dist/ui/calendar.cjs +1 -1
- package/dist/ui/calendar.d.cts +5 -5
- package/dist/ui/calendar.d.ts +5 -5
- package/dist/ui/calendar.js +1 -1
- package/dist/ui/card.cjs +1 -1
- package/dist/ui/card.d.cts +8 -9
- package/dist/ui/card.d.ts +8 -9
- package/dist/ui/card.js +1 -1
- package/dist/ui/carousel.cjs +1 -1
- package/dist/ui/carousel.cjs.map +1 -1
- package/dist/ui/carousel.d.cts +8 -8
- package/dist/ui/carousel.d.ts +8 -8
- package/dist/ui/carousel.js +1 -1
- package/dist/ui/carousel.js.map +1 -1
- package/dist/ui/collapsible.cjs.map +1 -1
- package/dist/ui/collapsible.d.cts +4 -4
- package/dist/ui/collapsible.d.ts +4 -4
- package/dist/ui/collapsible.js.map +1 -1
- package/dist/ui/command.cjs +1 -1
- package/dist/ui/command.d.cts +2 -2
- package/dist/ui/command.d.ts +2 -2
- package/dist/ui/command.js +1 -1
- package/dist/ui/context-menu.cjs +1 -1
- package/dist/ui/context-menu.cjs.map +1 -1
- package/dist/ui/context-menu.d.cts +17 -17
- package/dist/ui/context-menu.d.ts +17 -17
- package/dist/ui/context-menu.js +1 -1
- package/dist/ui/context-menu.js.map +1 -1
- package/dist/ui/dialog.cjs +1 -1
- package/dist/ui/dialog.d.cts +1 -1
- package/dist/ui/dialog.d.ts +1 -1
- package/dist/ui/dialog.js +1 -1
- package/dist/ui/dropdown-menu.cjs +1 -1
- package/dist/ui/dropdown-menu.d.cts +17 -18
- package/dist/ui/dropdown-menu.d.ts +17 -18
- package/dist/ui/dropdown-menu.js +1 -1
- package/dist/ui/file-uploader.cjs +2 -2
- package/dist/ui/file-uploader.cjs.map +1 -1
- package/dist/ui/file-uploader.d.cts +5 -5
- package/dist/ui/file-uploader.d.ts +5 -5
- package/dist/ui/file-uploader.js +2 -2
- package/dist/ui/file-uploader.js.map +1 -1
- package/dist/ui/form.cjs +1 -1
- package/dist/ui/form.d.cts +7 -7
- package/dist/ui/form.d.ts +7 -7
- package/dist/ui/form.js +1 -1
- package/dist/ui/hover-card.cjs.map +1 -1
- package/dist/ui/hover-card.d.cts +4 -4
- package/dist/ui/hover-card.d.ts +4 -4
- package/dist/ui/hover-card.js.map +1 -1
- package/dist/ui/input-otp.cjs.map +1 -1
- package/dist/ui/input-otp.d.cts +6 -6
- package/dist/ui/input-otp.d.ts +6 -6
- package/dist/ui/input-otp.js.map +1 -1
- package/dist/ui/input.cjs +1 -1
- package/dist/ui/input.d.cts +1 -1
- package/dist/ui/input.d.ts +1 -1
- package/dist/ui/input.js +1 -1
- package/dist/ui/inputs/search-input.cjs +1 -1
- package/dist/ui/inputs/search-input.d.cts +3 -3
- package/dist/ui/inputs/search-input.d.ts +3 -3
- package/dist/ui/inputs/search-input.js +1 -1
- package/dist/ui/label.cjs +1 -1
- package/dist/ui/label.d.cts +2 -2
- package/dist/ui/label.d.ts +2 -2
- package/dist/ui/label.js +1 -1
- package/dist/ui/menubar.cjs +1 -1
- package/dist/ui/menubar.cjs.map +1 -1
- package/dist/ui/menubar.d.cts +18 -18
- package/dist/ui/menubar.d.ts +18 -18
- package/dist/ui/menubar.js +1 -1
- package/dist/ui/menubar.js.map +1 -1
- package/dist/ui/multi-select.cjs +1 -1
- package/dist/ui/multi-select.d.cts +4 -4
- package/dist/ui/multi-select.d.ts +4 -4
- package/dist/ui/multi-select.js +1 -1
- package/dist/ui/navigation-menu.cjs +1 -1
- package/dist/ui/navigation-menu.cjs.map +1 -1
- package/dist/ui/navigation-menu.d.cts +11 -11
- package/dist/ui/navigation-menu.d.ts +11 -11
- package/dist/ui/navigation-menu.js +1 -1
- package/dist/ui/navigation-menu.js.map +1 -1
- package/dist/ui/pagination.cjs +1 -1
- package/dist/ui/pagination.cjs.map +1 -1
- package/dist/ui/pagination.d.cts +10 -10
- package/dist/ui/pagination.d.ts +10 -10
- package/dist/ui/pagination.js +1 -1
- package/dist/ui/pagination.js.map +1 -1
- package/dist/ui/popover.cjs +1 -1
- package/dist/ui/popover.d.cts +5 -7
- package/dist/ui/popover.d.ts +5 -7
- package/dist/ui/popover.js +1 -1
- package/dist/ui/progress.cjs +1 -1
- package/dist/ui/progress.d.cts +2 -2
- package/dist/ui/progress.d.ts +2 -2
- package/dist/ui/progress.js +1 -1
- package/dist/ui/radio-group.cjs +1 -1
- package/dist/ui/radio-group.cjs.map +1 -1
- package/dist/ui/radio-group.d.cts +3 -3
- package/dist/ui/radio-group.d.ts +3 -3
- package/dist/ui/radio-group.js +1 -1
- package/dist/ui/radio-group.js.map +1 -1
- package/dist/ui/resizable.cjs.map +1 -1
- package/dist/ui/resizable.d.cts +4 -4
- package/dist/ui/resizable.d.ts +4 -4
- package/dist/ui/resizable.js.map +1 -1
- package/dist/ui/scroll-area.d.cts +3 -3
- package/dist/ui/scroll-area.d.ts +3 -3
- package/dist/ui/select.cjs +1 -1
- package/dist/ui/select.d.cts +12 -13
- package/dist/ui/select.d.ts +12 -13
- package/dist/ui/select.js +1 -1
- package/dist/ui/separator.cjs +1 -1
- package/dist/ui/separator.d.cts +1 -1
- package/dist/ui/separator.d.ts +1 -1
- package/dist/ui/separator.js +1 -1
- package/dist/ui/sheet.cjs +1 -1
- package/dist/ui/sheet.d.cts +10 -11
- package/dist/ui/sheet.d.ts +10 -11
- package/dist/ui/sheet.js +1 -1
- package/dist/ui/sidebar.cjs +1 -1
- package/dist/ui/sidebar.d.cts +43 -43
- package/dist/ui/sidebar.d.ts +43 -43
- package/dist/ui/sidebar.js +1 -1
- package/dist/ui/skeleton.cjs +1 -1
- package/dist/ui/skeleton.d.cts +2 -3
- package/dist/ui/skeleton.d.ts +2 -3
- package/dist/ui/skeleton.js +1 -1
- package/dist/ui/slider.cjs.map +1 -1
- package/dist/ui/slider.d.cts +2 -2
- package/dist/ui/slider.d.ts +2 -2
- package/dist/ui/slider.js.map +1 -1
- package/dist/ui/sonner.cjs +1 -1
- package/dist/ui/sonner.cjs.map +1 -1
- package/dist/ui/sonner.d.cts +2 -2
- package/dist/ui/sonner.d.ts +2 -2
- package/dist/ui/sonner.js +1 -1
- package/dist/ui/sonner.js.map +1 -1
- package/dist/ui/switch.cjs +1 -1
- package/dist/ui/switch.d.cts +2 -2
- package/dist/ui/switch.d.ts +2 -2
- package/dist/ui/switch.js +1 -1
- package/dist/ui/table.cjs +1 -1
- package/dist/ui/table.d.cts +9 -9
- package/dist/ui/table.d.ts +9 -9
- package/dist/ui/table.js +1 -1
- package/dist/ui/tabs.cjs +1 -1
- package/dist/ui/tabs.cjs.map +1 -1
- package/dist/ui/tabs.d.cts +5 -6
- package/dist/ui/tabs.d.ts +5 -6
- package/dist/ui/tabs.js +1 -1
- package/dist/ui/tabs.js.map +1 -1
- package/dist/ui/textarea.cjs +1 -1
- package/dist/ui/textarea.d.cts +3 -3
- package/dist/ui/textarea.d.ts +3 -3
- package/dist/ui/textarea.js +1 -1
- package/dist/ui/toggle-group.cjs +1 -1
- package/dist/ui/toggle-group.cjs.map +1 -1
- package/dist/ui/toggle-group.d.cts +4 -4
- package/dist/ui/toggle-group.d.ts +5 -5
- package/dist/ui/toggle-group.js +1 -1
- package/dist/ui/toggle-group.js.map +1 -1
- package/dist/ui/toggle.cjs +1 -1
- package/dist/ui/toggle.d.cts +1 -1
- package/dist/ui/toggle.d.ts +1 -1
- package/dist/ui/toggle.js +1 -1
- package/dist/ui/tooltip.cjs +1 -1
- package/dist/ui/tooltip.d.cts +1 -1
- package/dist/ui/tooltip.d.ts +1 -1
- package/dist/ui/tooltip.js +1 -1
- package/dist/utils-BsjVK5EW.cjs.map +1 -1
- package/dist/utils-D9AH0PUV.js.map +1 -1
- package/package.json +23 -2
- package/packages/components/cards/simple-card.tsx +11 -25
- package/packages/components/data-display/country.tsx +34 -40
- package/packages/components/data-display/data-list.tsx +15 -24
- package/packages/components/data-display/date-tooltip.tsx +9 -23
- package/packages/components/data-display/date.tsx +90 -148
- package/packages/components/data-display/empty.tsx +8 -20
- package/packages/components/data-display/name.tsx +9 -11
- package/packages/components/data-display/phone-number.tsx +7 -15
- package/packages/components/data-display/role-badge.tsx +21 -25
- package/packages/components/data-display/statistic.tsx +61 -63
- package/packages/components/dialogs/confirm-dialog.tsx +12 -19
- package/packages/components/dialogs/detail-dialog/component/header.tsx +3 -7
- package/packages/components/dialogs/detail-dialog/component/main.tsx +15 -19
- package/packages/components/dialogs/detail-dialog/component/sidebar.tsx +256 -385
- package/packages/components/dialogs/detail-dialog/component/wrapper.tsx +6 -8
- package/packages/components/dialogs/detail-dialog/index.tsx +26 -35
- package/packages/components/dialogs/error-dialog.tsx +14 -28
- package/packages/components/dialogs/form-dialog.tsx +27 -59
- package/packages/components/dialogs/loading-dialog.tsx +8 -11
- package/packages/components/forms/combobox-field.tsx +44 -81
- package/packages/components/forms/date-field.tsx +2 -5
- package/packages/components/forms/form-wrapper.tsx +45 -71
- package/packages/components/forms/multi-select-field.tsx +2 -2
- package/packages/components/forms/number-field.tsx +1 -3
- package/packages/components/forms/password-field.tsx +1 -1
- package/packages/components/forms/select-field.tsx +1 -1
- package/packages/components/forms/switch-field.tsx +2 -4
- package/packages/components/forms/text-field.tsx +3 -10
- package/packages/components/forms/textarea-field.tsx +3 -11
- package/packages/components/layouts/flex.tsx +55 -66
- package/packages/components/layouts/main/content.tsx +3 -3
- package/packages/components/layouts/main/header.tsx +15 -27
- package/packages/components/layouts/main/wrapper.tsx +3 -3
- package/packages/components/styles/base.css +29 -0
- package/packages/components/styles/loader.css +113 -0
- package/packages/components/styles/theme.css +103 -0
- package/packages/components/styles/typography.css +6 -0
- package/packages/components/table/data-table-pagination.tsx +15 -44
- package/packages/components/table/data-table.tsx +86 -173
- package/packages/components/table/index.tsx +31 -50
- package/packages/components/typography/paragraph.tsx +18 -21
- package/packages/components/typography/title.tsx +23 -28
- package/packages/components/ui/alert-dialog.tsx +44 -118
- package/packages/components/ui/alert.tsx +19 -46
- package/packages/components/ui/aspect-ratio.tsx +7 -16
- package/packages/components/ui/avatar.tsx +12 -39
- package/packages/components/ui/badge.tsx +35 -41
- package/packages/components/ui/breadcrumb.tsx +26 -62
- package/packages/components/ui/button.tsx +163 -46
- package/packages/components/ui/buttons/add-new.tsx +9 -16
- package/packages/components/ui/buttons/edit.tsx +7 -13
- package/packages/components/ui/buttons/refresh.tsx +10 -21
- package/packages/components/ui/buttons/trash.tsx +7 -13
- package/packages/components/ui/buttons/upload-image.tsx +10 -13
- package/packages/components/ui/calendar.tsx +56 -124
- package/packages/components/ui/card.tsx +21 -72
- package/packages/components/ui/carousel.tsx +79 -133
- package/packages/components/ui/checkbox.tsx +19 -29
- package/packages/components/ui/collapsible.tsx +10 -26
- package/packages/components/ui/command.tsx +65 -144
- package/packages/components/ui/context-menu.tsx +48 -110
- package/packages/components/ui/dialog.tsx +55 -110
- package/packages/components/ui/dropdown-menu.tsx +100 -169
- package/packages/components/ui/file-uploader.tsx +93 -151
- package/packages/components/ui/form.tsx +51 -115
- package/packages/components/ui/hover-card.tsx +12 -23
- package/packages/components/ui/input-otp.tsx +20 -29
- package/packages/components/ui/input.tsx +34 -34
- package/packages/components/ui/inputs/number-input.tsx +5 -13
- package/packages/components/ui/inputs/password-input.tsx +2 -8
- package/packages/components/ui/inputs/search-input.tsx +7 -7
- package/packages/components/ui/label.tsx +14 -17
- package/packages/components/ui/menubar.tsx +46 -109
- package/packages/components/ui/multi-select.tsx +250 -317
- package/packages/components/ui/navigation-menu.tsx +34 -80
- package/packages/components/ui/pagination.tsx +28 -86
- package/packages/components/ui/popover.tsx +28 -43
- package/packages/components/ui/progress.tsx +8 -19
- package/packages/components/ui/radio-group.tsx +19 -36
- package/packages/components/ui/resizable.tsx +14 -22
- package/packages/components/ui/scroll-area.tsx +14 -30
- package/packages/components/ui/select.tsx +94 -141
- package/packages/components/ui/separator.tsx +11 -13
- package/packages/components/ui/sheet.tsx +62 -98
- package/packages/components/ui/sidebar.tsx +287 -363
- package/packages/components/ui/skeleton.tsx +5 -12
- package/packages/components/ui/slider.tsx +11 -28
- package/packages/components/ui/sonner.tsx +20 -23
- package/packages/components/ui/switch.tsx +28 -34
- package/packages/components/ui/table.tsx +28 -80
- package/packages/components/ui/tabs.tsx +29 -61
- package/packages/components/ui/textarea.tsx +23 -24
- package/packages/components/ui/toggle-group.tsx +19 -28
- package/packages/components/ui/toggle.tsx +16 -29
- package/packages/components/ui/tooltip.tsx +26 -44
- package/packages/constants.tsx +16 -50
- package/packages/hooks/use-callback-ref.ts +7 -12
- package/packages/hooks/use-controllable-state.ts +37 -46
- package/packages/hooks/use-mobile.ts +11 -13
- package/packages/index.css +121 -381
- package/packages/lib/utils.ts +12 -16
- package/packages/stories/1.Guideline.mdx +3 -0
- package/packages/stories/2.Colors.mdx +145 -0
- package/packages/stories/3.Pypography.mdx +51 -0
- package/packages/stories/cards/simple-card.stories.tsx +24 -0
- package/packages/stories/data-display/data-list.stories.tsx +22 -0
- package/packages/stories/data-display/empty.stories.tsx +13 -0
- package/packages/stories/data-display/form-dialog.stories.tsx +27 -0
- package/packages/stories/data-display/name.stories.tsx +25 -0
- package/packages/stories/data-display/phone-number.stories.tsx +17 -0
- package/packages/stories/data-display/statistic.stories.tsx +41 -0
- package/packages/stories/dialogs/confirm-dialog.stories.tsx +26 -0
- package/packages/stories/dialogs/detail-dialog.stories.tsx +34 -0
- package/packages/stories/dialogs/error-dialog.stories.tsx +27 -0
- package/packages/stories/dialogs/loading-dialog.stories.tsx +16 -0
- package/packages/stories/forms/combobox-field.stories.tsx +38 -0
- package/packages/stories/forms/form-wrapper.stories.tsx +59 -0
- package/packages/stories/forms/multi-select-field.stories.tsx +42 -0
- package/packages/stories/forms/number-field.stories.tsx +35 -0
- package/packages/stories/forms/select-field.stories.tsx +39 -0
- package/packages/stories/forms/switch-field.stories.tsx +36 -0
- package/packages/stories/forms/text-field.stories.tsx +41 -0
- package/packages/stories/forms/textarea-field.stories.tsx +34 -0
- package/packages/stories/typography/paragraph.stories.tsx +45 -0
- package/packages/stories/typography/title.stories.tsx +39 -0
- package/packages/stories/ui/alert-dialog.stories.tsx +49 -0
- package/packages/stories/ui/alert.stories.tsx +63 -0
- package/packages/stories/ui/aspect-ratio.stories.tsx +22 -0
- package/packages/stories/ui/badge.stories.tsx +170 -0
- package/packages/stories/ui/breadcrumb.stories.tsx +172 -0
- package/packages/stories/ui/button.stories.tsx +181 -0
- package/packages/stories/ui/card.stories.tsx +58 -0
- package/packages/stories/ui/checkbox.stories.tsx +48 -0
- package/packages/stories/ui/command.stories.tsx +58 -0
- package/packages/stories/ui/dialog.stories.tsx +55 -0
- package/packages/stories/ui/dropdown-menu.stories.tsx +89 -0
- package/packages/stories/ui/file-uploader.stories.tsx +18 -0
- package/packages/stories/ui/input.stories.tsx +38 -0
- package/packages/stories/ui/label.stories.tsx +17 -0
- package/packages/stories/ui/multi-select.stories.tsx +29 -0
- package/packages/stories/ui/popover.stories.tsx +52 -0
- package/packages/stories/ui/progress.stories.tsx +17 -0
- package/packages/stories/ui/radio-group.stories.tsx +31 -0
- package/packages/stories/ui/select.stories.tsx +31 -0
- package/packages/stories/ui/separator.stories.tsx +31 -0
- package/packages/stories/ui/sheet.stories.tsx +50 -0
- package/packages/stories/ui/skeleton.stories.tsx +27 -0
- package/packages/stories/ui/switch.stories.tsx +21 -0
- package/packages/stories/ui/table.stories.tsx +82 -0
- package/packages/stories/ui/tabs.stories.tsx +70 -0
- package/packages/stories/ui/textarea.stories.tsx +15 -0
- package/packages/stories/ui/toaster.stories.tsx +87 -0
- package/packages/types.ts +32 -32
- package/dist/add-new-BTpI7Ph7.cjs.map +0 -1
- package/dist/add-new-DmwkHRmn.js +0 -2
- package/dist/add-new-DmwkHRmn.js.map +0 -1
- package/dist/alert-dialog-6r43mVE-.js +0 -2
- package/dist/alert-dialog-6r43mVE-.js.map +0 -1
- package/dist/alert-dialog-DEOx5Psb.cjs +0 -2
- package/dist/alert-dialog-DEOx5Psb.cjs.map +0 -1
- package/dist/badge-DHRQ-uwY.cjs.map +0 -1
- package/dist/badge-bLqn3EB9.js.map +0 -1
- package/dist/button-BgNGzTUH.cjs +0 -2
- package/dist/button-BgNGzTUH.cjs.map +0 -1
- package/dist/button-DFvetIX8.js +0 -2
- package/dist/button-DFvetIX8.js.map +0 -1
- package/dist/calendar-BG-jrCZc.js.map +0 -1
- package/dist/calendar-Cck0PPMB.cjs.map +0 -1
- package/dist/card-D8cxRC5y.js +0 -2
- package/dist/card-D8cxRC5y.js.map +0 -1
- package/dist/card-Dta5eW8u.cjs +0 -2
- package/dist/card-Dta5eW8u.cjs.map +0 -1
- package/dist/command-Bfx_Gzjv.cjs +0 -2
- package/dist/command-Bfx_Gzjv.cjs.map +0 -1
- package/dist/command-ClNBSZd3.js +0 -2
- package/dist/command-ClNBSZd3.js.map +0 -1
- package/dist/date-B1g1OMYc.js.map +0 -1
- package/dist/date-Cw6Jf7k6.cjs.map +0 -1
- package/dist/dialog-Bh4dL0ew.cjs +0 -2
- package/dist/dialog-Bh4dL0ew.cjs.map +0 -1
- package/dist/dialog-CzSIPgHw.js +0 -2
- package/dist/dialog-CzSIPgHw.js.map +0 -1
- package/dist/dropdown-menu-DTFOCPH_.js +0 -2
- package/dist/dropdown-menu-DTFOCPH_.js.map +0 -1
- package/dist/dropdown-menu-qX11mJ9V.cjs +0 -2
- package/dist/dropdown-menu-qX11mJ9V.cjs.map +0 -1
- package/dist/error-dialog-Dg_OHJlH.js.map +0 -1
- package/dist/error-dialog-OeWIgIvF.cjs.map +0 -1
- package/dist/flex-B5MQmxX8.cjs.map +0 -1
- package/dist/flex-CBAzUoXK.js.map +0 -1
- package/dist/form-BMnG2xLt.js.map +0 -1
- package/dist/form-BbU1TIro.cjs.map +0 -1
- package/dist/form-wrapper-DeSGl64P.cjs.map +0 -1
- package/dist/form-wrapper-wHzrskjb.js.map +0 -1
- package/dist/input-B030EUY5.js +0 -2
- package/dist/input-B030EUY5.js.map +0 -1
- package/dist/input-mUjZrK2c.cjs +0 -2
- package/dist/input-mUjZrK2c.cjs.map +0 -1
- package/dist/label-BrGRueFm.js +0 -2
- package/dist/label-BrGRueFm.js.map +0 -1
- package/dist/label-Cmi31X9c.cjs +0 -2
- package/dist/label-Cmi31X9c.cjs.map +0 -1
- package/dist/multi-select-BOmq9vOB.cjs +0 -2
- package/dist/multi-select-BOmq9vOB.cjs.map +0 -1
- package/dist/multi-select-CEU50SQU.js +0 -2
- package/dist/multi-select-CEU50SQU.js.map +0 -1
- package/dist/paragraph-CuR_8J0O.js +0 -2
- package/dist/paragraph-CuR_8J0O.js.map +0 -1
- package/dist/paragraph-D-nYwoh7.cjs +0 -2
- package/dist/paragraph-D-nYwoh7.cjs.map +0 -1
- package/dist/popover-BD0lz8Fh.cjs +0 -2
- package/dist/popover-BD0lz8Fh.cjs.map +0 -1
- package/dist/popover-DJnARyyO.js +0 -2
- package/dist/popover-DJnARyyO.js.map +0 -1
- package/dist/progress-Bu1_efDo.cjs +0 -2
- package/dist/progress-Bu1_efDo.cjs.map +0 -1
- package/dist/progress-CeXKNvJc.js +0 -2
- package/dist/progress-CeXKNvJc.js.map +0 -1
- package/dist/refresh-H87p0PFk.cjs.map +0 -1
- package/dist/refresh-h_6T8REa.js +0 -2
- package/dist/refresh-h_6T8REa.js.map +0 -1
- package/dist/search-input-BUIwdK4e.js.map +0 -1
- package/dist/search-input-DXh-cAVU.cjs.map +0 -1
- package/dist/select-C82socRt.cjs +0 -2
- package/dist/select-C82socRt.cjs.map +0 -1
- package/dist/select-pBujVa9I.js +0 -2
- package/dist/select-pBujVa9I.js.map +0 -1
- package/dist/separator-Bi0LBh7T.cjs +0 -2
- package/dist/separator-Bi0LBh7T.cjs.map +0 -1
- package/dist/separator-DMdqEz29.js +0 -2
- package/dist/separator-DMdqEz29.js.map +0 -1
- package/dist/sheet-2JqHfdYi.js +0 -2
- package/dist/sheet-2JqHfdYi.js.map +0 -1
- package/dist/sheet-CjCT1GXK.cjs +0 -2
- package/dist/sheet-CjCT1GXK.cjs.map +0 -1
- package/dist/sidebar-99vu8Xl2.cjs +0 -2
- package/dist/sidebar-99vu8Xl2.cjs.map +0 -1
- package/dist/sidebar-Ci1XCkoo.cjs +0 -2
- package/dist/sidebar-Ci1XCkoo.cjs.map +0 -1
- package/dist/sidebar-acyFs4AU.js +0 -2
- package/dist/sidebar-acyFs4AU.js.map +0 -1
- package/dist/sidebar-b8PM_MQy.js +0 -2
- package/dist/sidebar-b8PM_MQy.js.map +0 -1
- package/dist/skeleton-D1_Brnl9.js +0 -2
- package/dist/skeleton-D1_Brnl9.js.map +0 -1
- package/dist/skeleton-DkSs2Vh3.cjs +0 -2
- package/dist/skeleton-DkSs2Vh3.cjs.map +0 -1
- package/dist/switch-CF4DRW_3.cjs +0 -2
- package/dist/switch-CF4DRW_3.cjs.map +0 -1
- package/dist/switch-_VCthKr7.js +0 -2
- package/dist/switch-_VCthKr7.js.map +0 -1
- package/dist/table-B7URcTid.cjs +0 -2
- package/dist/table-B7URcTid.cjs.map +0 -1
- package/dist/table-DrnU8YJP.js +0 -2
- package/dist/table-DrnU8YJP.js.map +0 -1
- package/dist/textarea--5AtST9C.js +0 -2
- package/dist/textarea--5AtST9C.js.map +0 -1
- package/dist/textarea-pwK3zC15.cjs +0 -2
- package/dist/textarea-pwK3zC15.cjs.map +0 -1
- package/dist/title-CA6PvqiD.js.map +0 -1
- package/dist/title-DrIfj31i.cjs.map +0 -1
- package/dist/toggle-BA0PLIVa.js.map +0 -1
- package/dist/toggle-Ddewmqst.cjs.map +0 -1
- package/dist/tooltip-CG3D3TIL.cjs +0 -2
- package/dist/tooltip-CG3D3TIL.cjs.map +0 -1
- package/dist/tooltip-DvNio7Zt.js +0 -2
- package/dist/tooltip-DvNio7Zt.js.map +0 -1
- package/dist/types-BVNbk1ZN.js.map +0 -1
- package/dist/types-CnMfjcgO.cjs.map +0 -1
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
import React from
|
|
3
|
-
import { FileText, Image, Trash2, Upload } from
|
|
4
|
-
import Dropzone, {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} from
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
import {
|
|
11
|
-
import { Progress } from "@/components/ui/progress";
|
|
12
|
-
import { useControllableState } from "@/hooks/use-controllable-state";
|
|
13
|
-
import { cn, formatBytes } from "@/lib/utils";
|
|
1
|
+
'use client'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import { FileText, Image, Trash2, Upload } from 'lucide-react'
|
|
4
|
+
import Dropzone, { type DropzoneProps, type FileRejection } from 'react-dropzone'
|
|
5
|
+
import { toast } from 'sonner'
|
|
6
|
+
|
|
7
|
+
import { Button } from '@/components/ui/button'
|
|
8
|
+
import { Progress } from '@/components/ui/progress'
|
|
9
|
+
import { useControllableState } from '@/hooks/use-controllable-state'
|
|
10
|
+
import { cn, formatBytes } from '@/lib/utils'
|
|
14
11
|
|
|
15
12
|
interface FileUploaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
16
13
|
/**
|
|
@@ -19,7 +16,7 @@ interface FileUploaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
19
16
|
* @default undefined
|
|
20
17
|
* @example value={files}
|
|
21
18
|
*/
|
|
22
|
-
value?: File[]
|
|
19
|
+
value?: File[]
|
|
23
20
|
|
|
24
21
|
/**
|
|
25
22
|
* Function to be called when the value changes.
|
|
@@ -27,7 +24,7 @@ interface FileUploaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
27
24
|
* @default undefined
|
|
28
25
|
* @example onValueChange={(files) => setFiles(files)}
|
|
29
26
|
*/
|
|
30
|
-
onValueChange?: (files: File[]) => void
|
|
27
|
+
onValueChange?: (files: File[]) => void
|
|
31
28
|
|
|
32
29
|
/**
|
|
33
30
|
* Function to be called when files are uploaded.
|
|
@@ -35,7 +32,7 @@ interface FileUploaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
35
32
|
* @default undefined
|
|
36
33
|
* @example onUpload={(files) => uploadFiles(files)}
|
|
37
34
|
*/
|
|
38
|
-
onUpload?: (files: File[]) => Promise<void
|
|
35
|
+
onUpload?: (files: File[]) => Promise<void>
|
|
39
36
|
|
|
40
37
|
/**
|
|
41
38
|
* Progress of the uploaded files.
|
|
@@ -43,7 +40,7 @@ interface FileUploaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
43
40
|
* @default undefined
|
|
44
41
|
* @example progresses={{ "file1.png": 50 }}
|
|
45
42
|
*/
|
|
46
|
-
progresses?: Record<string, number
|
|
43
|
+
progresses?: Record<string, number>
|
|
47
44
|
|
|
48
45
|
/**
|
|
49
46
|
* Accepted file types for the uploader.
|
|
@@ -54,7 +51,7 @@ interface FileUploaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
54
51
|
* ```
|
|
55
52
|
* @example accept={["image/png", "image/jpeg"]}
|
|
56
53
|
*/
|
|
57
|
-
accept?: DropzoneProps[
|
|
54
|
+
accept?: DropzoneProps['accept']
|
|
58
55
|
|
|
59
56
|
/**
|
|
60
57
|
* Maximum file size for the uploader.
|
|
@@ -62,7 +59,7 @@ interface FileUploaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
62
59
|
* @default 1024 * 1024 * 2 // 2MB
|
|
63
60
|
* @example maxSize={1024 * 1024 * 2} // 2MB
|
|
64
61
|
*/
|
|
65
|
-
maxSize?: DropzoneProps[
|
|
62
|
+
maxSize?: DropzoneProps['maxSize']
|
|
66
63
|
|
|
67
64
|
/**
|
|
68
65
|
* Maximum number of files for the uploader.
|
|
@@ -70,7 +67,7 @@ interface FileUploaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
70
67
|
* @default 1
|
|
71
68
|
* @example maxFileCount={4}
|
|
72
69
|
*/
|
|
73
|
-
maxFileCount?: DropzoneProps[
|
|
70
|
+
maxFileCount?: DropzoneProps['maxFiles']
|
|
74
71
|
|
|
75
72
|
/**
|
|
76
73
|
* Whether the uploader should accept multiple files.
|
|
@@ -78,7 +75,7 @@ interface FileUploaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
78
75
|
* @default false
|
|
79
76
|
* @example multiple
|
|
80
77
|
*/
|
|
81
|
-
multiple?: boolean
|
|
78
|
+
multiple?: boolean
|
|
82
79
|
|
|
83
80
|
/**
|
|
84
81
|
* Whether the uploader is disabled.
|
|
@@ -86,10 +83,10 @@ interface FileUploaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
86
83
|
* @default false
|
|
87
84
|
* @example disabled
|
|
88
85
|
*/
|
|
89
|
-
disabled?: boolean
|
|
86
|
+
disabled?: boolean
|
|
90
87
|
|
|
91
|
-
showText?: boolean
|
|
92
|
-
iconSize?: number
|
|
88
|
+
showText?: boolean
|
|
89
|
+
iconSize?: number
|
|
93
90
|
}
|
|
94
91
|
|
|
95
92
|
export function FileUploader(props: FileUploaderProps) {
|
|
@@ -99,7 +96,7 @@ export function FileUploader(props: FileUploaderProps) {
|
|
|
99
96
|
onUpload,
|
|
100
97
|
progresses,
|
|
101
98
|
accept = {
|
|
102
|
-
|
|
99
|
+
'image/*': [],
|
|
103
100
|
},
|
|
104
101
|
maxSize = 1024 * 1024 * 2,
|
|
105
102
|
maxFileCount = 1,
|
|
@@ -109,112 +106,100 @@ export function FileUploader(props: FileUploaderProps) {
|
|
|
109
106
|
iconSize,
|
|
110
107
|
className,
|
|
111
108
|
...dropzoneProps
|
|
112
|
-
} = props
|
|
109
|
+
} = props
|
|
113
110
|
|
|
114
111
|
const [files, setFiles] = useControllableState({
|
|
115
112
|
prop: valueProp,
|
|
116
113
|
onChange: onValueChange,
|
|
117
|
-
})
|
|
114
|
+
})
|
|
118
115
|
|
|
119
116
|
const onDrop = React.useCallback(
|
|
120
117
|
(acceptedFiles: File[], rejectedFiles: FileRejection[]) => {
|
|
121
118
|
if (!multiple && maxFileCount === 1 && acceptedFiles.length > 1) {
|
|
122
|
-
toast.error(
|
|
119
|
+
toast.error('Cannot upload more than 1 file at a time')
|
|
123
120
|
|
|
124
|
-
return
|
|
121
|
+
return
|
|
125
122
|
}
|
|
126
123
|
|
|
127
124
|
if ((files?.length ?? 0) + acceptedFiles.length > maxFileCount) {
|
|
128
|
-
toast.error(`Cannot upload more than ${maxFileCount} files`)
|
|
129
|
-
return
|
|
125
|
+
toast.error(`Cannot upload more than ${maxFileCount} files`)
|
|
126
|
+
return
|
|
130
127
|
}
|
|
131
128
|
|
|
132
129
|
const newFiles = acceptedFiles.map((file) =>
|
|
133
130
|
Object.assign(file, {
|
|
134
131
|
preview: URL.createObjectURL(file),
|
|
135
132
|
}),
|
|
136
|
-
)
|
|
133
|
+
)
|
|
137
134
|
|
|
138
|
-
const updatedFiles = files ? [...files, ...newFiles] : newFiles
|
|
135
|
+
const updatedFiles = files ? [...files, ...newFiles] : newFiles
|
|
139
136
|
|
|
140
|
-
setFiles(updatedFiles)
|
|
137
|
+
setFiles(updatedFiles)
|
|
141
138
|
|
|
142
139
|
if (rejectedFiles.length > 0) {
|
|
143
140
|
rejectedFiles.forEach(({ file }) => {
|
|
144
|
-
toast.error(`File ${file.name} was rejected`)
|
|
145
|
-
})
|
|
141
|
+
toast.error(`File ${file.name} was rejected`)
|
|
142
|
+
})
|
|
146
143
|
}
|
|
147
144
|
|
|
148
|
-
if (
|
|
149
|
-
|
|
150
|
-
updatedFiles.length > 0 &&
|
|
151
|
-
updatedFiles.length <= maxFileCount
|
|
152
|
-
) {
|
|
153
|
-
const target =
|
|
154
|
-
updatedFiles.length > 0 ? `${updatedFiles.length} files` : `file`;
|
|
145
|
+
if (onUpload && updatedFiles.length > 0 && updatedFiles.length <= maxFileCount) {
|
|
146
|
+
const target = updatedFiles.length > 0 ? `${updatedFiles.length} files` : `file`
|
|
155
147
|
|
|
156
148
|
onUpload(updatedFiles).then(() => {
|
|
157
|
-
setFiles([])
|
|
158
|
-
toast(`${target} uploaded`)
|
|
159
|
-
})
|
|
149
|
+
setFiles([])
|
|
150
|
+
toast(`${target} uploaded`)
|
|
151
|
+
})
|
|
160
152
|
}
|
|
161
153
|
},
|
|
162
154
|
|
|
163
155
|
[files, maxFileCount, multiple, onUpload, setFiles],
|
|
164
|
-
)
|
|
156
|
+
)
|
|
165
157
|
|
|
166
158
|
function onRemove(index: number) {
|
|
167
|
-
if (!files) return
|
|
159
|
+
if (!files) return
|
|
168
160
|
|
|
169
161
|
if (isFileWithPreview(files[index])) {
|
|
170
|
-
URL.revokeObjectURL(files[index].preview)
|
|
162
|
+
URL.revokeObjectURL(files[index].preview)
|
|
171
163
|
}
|
|
172
164
|
|
|
173
|
-
const newFiles = files.filter((_, i) => i !== index)
|
|
174
|
-
setFiles(newFiles)
|
|
175
|
-
onValueChange?.(newFiles)
|
|
165
|
+
const newFiles = files.filter((_, i) => i !== index)
|
|
166
|
+
setFiles(newFiles)
|
|
167
|
+
onValueChange?.(newFiles)
|
|
176
168
|
}
|
|
177
169
|
|
|
178
170
|
// Revoke preview url when component unmounts
|
|
179
171
|
React.useEffect(() => {
|
|
180
172
|
return () => {
|
|
181
|
-
if (!files) return
|
|
173
|
+
if (!files) return
|
|
182
174
|
files.forEach((file) => {
|
|
183
175
|
if (isFileWithPreview(file)) {
|
|
184
|
-
URL.revokeObjectURL(file.preview)
|
|
176
|
+
URL.revokeObjectURL(file.preview)
|
|
185
177
|
}
|
|
186
|
-
})
|
|
187
|
-
}
|
|
178
|
+
})
|
|
179
|
+
}
|
|
188
180
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
189
|
-
}, [])
|
|
181
|
+
}, [])
|
|
190
182
|
|
|
191
|
-
const isDisabled = disabled || (files?.length ?? 0) >= maxFileCount
|
|
183
|
+
const isDisabled = disabled || (files?.length ?? 0) >= maxFileCount
|
|
192
184
|
|
|
193
185
|
return (
|
|
194
186
|
<div className="relative flex w-full flex-col gap-6">
|
|
195
|
-
<Dropzone
|
|
196
|
-
onDrop={onDrop}
|
|
197
|
-
accept={accept}
|
|
198
|
-
maxSize={maxSize}
|
|
199
|
-
maxFiles={maxFileCount}
|
|
200
|
-
multiple={maxFileCount > 1 || multiple}
|
|
201
|
-
disabled={isDisabled}
|
|
202
|
-
>
|
|
187
|
+
<Dropzone onDrop={onDrop} accept={accept} maxSize={maxSize} maxFiles={maxFileCount} multiple={maxFileCount > 1 || multiple} disabled={isDisabled}>
|
|
203
188
|
{({ getRootProps, getInputProps, isDragActive }) => (
|
|
204
189
|
<div
|
|
205
190
|
{...getRootProps()}
|
|
206
191
|
className={cn(
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
isDragActive &&
|
|
217
|
-
isDisabled &&
|
|
192
|
+
'group',
|
|
193
|
+
'border-border-weak',
|
|
194
|
+
'hover:bg-border-weak/20',
|
|
195
|
+
'relative grid h-52 w-full cursor-pointer place-items-center rounded-lg border-2 border-dashed px-5 py-2.5 text-center transition',
|
|
196
|
+
'ring-offset-background',
|
|
197
|
+
'focus-visible:ring-primary-weak',
|
|
198
|
+
'focus-visible:ring-2',
|
|
199
|
+
'focus-visible:ring-offset-2',
|
|
200
|
+
'focus-visible:outline-hidden',
|
|
201
|
+
isDragActive && 'border-border-primary-strong bg-border-weak/40',
|
|
202
|
+
isDisabled && 'pointer-events-none opacity-60',
|
|
218
203
|
className,
|
|
219
204
|
)}
|
|
220
205
|
{...dropzoneProps}
|
|
@@ -223,33 +208,22 @@ export function FileUploader(props: FileUploaderProps) {
|
|
|
223
208
|
{isDragActive ? (
|
|
224
209
|
<div className="flex flex-col items-center justify-center gap-4 sm:px-5">
|
|
225
210
|
<div className="rounded-full border border-dashed p-3">
|
|
226
|
-
<Upload
|
|
227
|
-
className="text-muted-foreground size-7"
|
|
228
|
-
aria-hidden="true"
|
|
229
|
-
/>
|
|
211
|
+
<Upload className="text-text-positive-muted size-7" aria-hidden="true" />
|
|
230
212
|
</div>
|
|
231
|
-
<p className="text-muted
|
|
232
|
-
Drop the files here
|
|
233
|
-
</p>
|
|
213
|
+
<p className="text-text-positive-muted font-medium">Drop the files here</p>
|
|
234
214
|
</div>
|
|
235
215
|
) : (
|
|
236
216
|
<div className="flex flex-col items-center justify-center gap-4 sm:px-5">
|
|
237
217
|
<div className="rounded-full border border-dashed p-3">
|
|
238
|
-
<Upload
|
|
239
|
-
size={iconSize || 24}
|
|
240
|
-
className="text-muted-foreground"
|
|
241
|
-
aria-hidden="true"
|
|
242
|
-
/>
|
|
218
|
+
<Upload size={iconSize || 24} className="text-muted-foreground" aria-hidden="true" />
|
|
243
219
|
</div>
|
|
244
220
|
{showText && (
|
|
245
221
|
<div className="flex flex-col gap-px">
|
|
246
|
-
<p className="text-
|
|
247
|
-
|
|
248
|
-
</p>
|
|
249
|
-
<p className="text-muted-foreground/70 text-xs">
|
|
222
|
+
<p className="text-text-positive-weak text-xs font-medium">Drag {`'n'`} drop files here, or click to select files</p>
|
|
223
|
+
<p className="text-text-positive-muted text-xs">
|
|
250
224
|
You can upload
|
|
251
225
|
{maxFileCount > 1
|
|
252
|
-
? ` ${maxFileCount === Infinity ?
|
|
226
|
+
? ` ${maxFileCount === Infinity ? 'multiple' : maxFileCount}
|
|
253
227
|
files (up to ${formatBytes(maxSize)} each)`
|
|
254
228
|
: ` a file with ${formatBytes(maxSize)}`}
|
|
255
229
|
</p>
|
|
@@ -263,23 +237,20 @@ export function FileUploader(props: FileUploaderProps) {
|
|
|
263
237
|
{files?.length ? (
|
|
264
238
|
<div className="h-fit w-full overflow-y-auto">
|
|
265
239
|
<div className="flex items-center justify-between px-3 py-2.5">
|
|
266
|
-
<div className="flex items-center gap-1">
|
|
267
|
-
<Image
|
|
268
|
-
className="text-muted-foreground size-4"
|
|
269
|
-
aria-hidden="true"
|
|
270
|
-
/>
|
|
240
|
+
<div className="text-text-positive-weak flex items-center gap-1">
|
|
241
|
+
<Image size={16} aria-hidden="true" />
|
|
271
242
|
<p className="text-sm">Ảnh đã tải lên ({files.length})</p>
|
|
272
243
|
</div>
|
|
273
244
|
<button
|
|
274
|
-
className="hover:text-
|
|
245
|
+
className="hover:text-text-positive text-text-positive-muted flex cursor-pointer items-center gap-1 transition-colors duration-200"
|
|
275
246
|
onClick={() => {
|
|
276
|
-
if (!files) return
|
|
247
|
+
if (!files) return
|
|
277
248
|
files.forEach((file) => {
|
|
278
|
-
if (!isFileWithPreview(file)) return
|
|
279
|
-
URL.revokeObjectURL(file.preview)
|
|
280
|
-
})
|
|
281
|
-
setFiles([])
|
|
282
|
-
onValueChange?.([])
|
|
249
|
+
if (!isFileWithPreview(file)) return
|
|
250
|
+
URL.revokeObjectURL(file.preview)
|
|
251
|
+
})
|
|
252
|
+
setFiles([])
|
|
253
|
+
onValueChange?.([])
|
|
283
254
|
}}
|
|
284
255
|
>
|
|
285
256
|
<Trash2 size={16} aria-hidden="true" />
|
|
@@ -288,85 +259,56 @@ export function FileUploader(props: FileUploaderProps) {
|
|
|
288
259
|
</div>
|
|
289
260
|
<div className="flex flex-col gap-2.5">
|
|
290
261
|
{files?.map((file, index) => (
|
|
291
|
-
<FileCard
|
|
292
|
-
key={index}
|
|
293
|
-
file={file}
|
|
294
|
-
onRemove={() => onRemove(index)}
|
|
295
|
-
progress={progresses?.[file.name]}
|
|
296
|
-
/>
|
|
262
|
+
<FileCard key={index} file={file} onRemove={() => onRemove(index)} progress={progresses?.[file.name]} />
|
|
297
263
|
))}
|
|
298
264
|
</div>
|
|
299
265
|
</div>
|
|
300
266
|
) : null}
|
|
301
267
|
</div>
|
|
302
|
-
)
|
|
268
|
+
)
|
|
303
269
|
}
|
|
304
270
|
|
|
305
271
|
interface FileCardProps {
|
|
306
|
-
file: File
|
|
307
|
-
onRemove: () => void
|
|
308
|
-
progress?: number
|
|
272
|
+
file: File
|
|
273
|
+
onRemove: () => void
|
|
274
|
+
progress?: number
|
|
309
275
|
}
|
|
310
276
|
|
|
311
277
|
function FileCard({ file, progress, onRemove }: FileCardProps) {
|
|
312
278
|
return (
|
|
313
|
-
<div className="border-border
|
|
279
|
+
<div className="border-border-weak hover:border-border relative flex items-center gap-4 rounded-md border py-2 pr-3 pl-2 shadow-xs transition-colors">
|
|
314
280
|
<div className="flex flex-1 gap-2.5">
|
|
315
281
|
{isFileWithPreview(file) ? <FilePreview file={file} /> : null}
|
|
316
282
|
<div className="flex w-full flex-col gap-2">
|
|
317
283
|
<div className="flex flex-col gap-y-0.5">
|
|
318
|
-
<p className="text-
|
|
319
|
-
|
|
320
|
-
</p>
|
|
321
|
-
<p className="text-muted-foreground text-xs">
|
|
322
|
-
{formatBytes(file.size)}
|
|
323
|
-
</p>
|
|
284
|
+
<p className="text-text-positive line-clamp-1 text-sm">{file.name}</p>
|
|
285
|
+
<p className="text-text-positive-muted text-xs">{formatBytes(file.size)}</p>
|
|
324
286
|
</div>
|
|
325
287
|
{progress ? <Progress value={progress} /> : null}
|
|
326
288
|
</div>
|
|
327
289
|
</div>
|
|
328
290
|
<div className="flex items-center gap-2">
|
|
329
|
-
<Button
|
|
330
|
-
|
|
331
|
-
variant="ghost"
|
|
332
|
-
size="icon"
|
|
333
|
-
className="size-7"
|
|
334
|
-
onClick={onRemove}
|
|
335
|
-
>
|
|
336
|
-
<Trash2
|
|
337
|
-
size={16}
|
|
338
|
-
className="text-muted-foreground/60"
|
|
339
|
-
aria-hidden="true"
|
|
340
|
-
/>
|
|
291
|
+
<Button type="button" variant="ghost" color="secondary" size="icon" className="size-7" onClick={onRemove}>
|
|
292
|
+
<Trash2 size={16} className="text-text-positive-muted" aria-hidden="true" />
|
|
341
293
|
<span className="sr-only">Remove file</span>
|
|
342
294
|
</Button>
|
|
343
295
|
</div>
|
|
344
296
|
</div>
|
|
345
|
-
)
|
|
297
|
+
)
|
|
346
298
|
}
|
|
347
299
|
|
|
348
300
|
function isFileWithPreview(file: File): file is File & { preview: string } {
|
|
349
|
-
return
|
|
301
|
+
return 'preview' in file && typeof file.preview === 'string'
|
|
350
302
|
}
|
|
351
303
|
|
|
352
304
|
interface FilePreviewProps {
|
|
353
|
-
file: File & { preview: string }
|
|
305
|
+
file: File & { preview: string }
|
|
354
306
|
}
|
|
355
307
|
|
|
356
308
|
function FilePreview({ file }: FilePreviewProps) {
|
|
357
|
-
if (file.type.startsWith(
|
|
358
|
-
return
|
|
359
|
-
<img
|
|
360
|
-
src={file.preview}
|
|
361
|
-
className="border-border aspect-square size-10 shrink-0 rounded border object-cover object-top shadow-sm"
|
|
362
|
-
/>
|
|
363
|
-
);
|
|
309
|
+
if (file.type.startsWith('image/')) {
|
|
310
|
+
return <img src={file.preview} className="border-border aspect-square size-10 shrink-0 rounded border object-cover object-top shadow-sm" />
|
|
364
311
|
}
|
|
365
312
|
|
|
366
|
-
return
|
|
367
|
-
<FileText
|
|
368
|
-
className="text-muted-foreground size-10 border"
|
|
369
|
-
aria-hidden="true"
|
|
370
|
-
/>
|
|
371
|
-
);
|
|
313
|
+
return <FileText className="text-text-positive-muted size-10 border" aria-hidden="true" />
|
|
372
314
|
}
|
|
@@ -1,57 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
import React from
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
type FormFieldContextValue<
|
|
20
|
-
TFieldValues extends FieldValues = FieldValues,
|
|
21
|
-
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
|
|
22
|
-
> = {
|
|
23
|
-
name: TName;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
const FormFieldContext = React.createContext<FormFieldContextValue>(
|
|
27
|
-
{} as FormFieldContextValue,
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
const FormField = <
|
|
31
|
-
TFieldValues extends FieldValues = FieldValues,
|
|
32
|
-
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
|
|
33
|
-
>({
|
|
1
|
+
'use client'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import { Controller, type ControllerProps, type FieldPath, type FieldValues, FormProvider, useFormContext, useFormState } from 'react-hook-form'
|
|
4
|
+
import { Label as LabelPrimitive, Slot as SlotPrimitive } from 'radix-ui'
|
|
5
|
+
|
|
6
|
+
import { Label } from '@/components/ui/label'
|
|
7
|
+
import { cn } from '@/lib/utils'
|
|
8
|
+
|
|
9
|
+
const Form = FormProvider
|
|
10
|
+
|
|
11
|
+
type FormFieldContextValue<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = {
|
|
12
|
+
name: TName
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const FormFieldContext = React.createContext<FormFieldContextValue>({} as FormFieldContextValue)
|
|
16
|
+
|
|
17
|
+
const FormField = <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({
|
|
34
18
|
...props
|
|
35
19
|
}: ControllerProps<TFieldValues, TName>) => {
|
|
36
20
|
return (
|
|
37
21
|
<FormFieldContext.Provider value={{ name: props.name }}>
|
|
38
22
|
<Controller {...props} />
|
|
39
23
|
</FormFieldContext.Provider>
|
|
40
|
-
)
|
|
41
|
-
}
|
|
24
|
+
)
|
|
25
|
+
}
|
|
42
26
|
|
|
43
27
|
const useFormField = () => {
|
|
44
|
-
const fieldContext = React.useContext(FormFieldContext)
|
|
45
|
-
const itemContext = React.useContext(FormItemContext)
|
|
46
|
-
const { getFieldState, control, resetField } = useFormContext()
|
|
47
|
-
const formState = useFormState({ name: fieldContext.name })
|
|
48
|
-
const fieldState = getFieldState(fieldContext.name, formState)
|
|
28
|
+
const fieldContext = React.useContext(FormFieldContext)
|
|
29
|
+
const itemContext = React.useContext(FormItemContext)
|
|
30
|
+
const { getFieldState, control, resetField } = useFormContext()
|
|
31
|
+
const formState = useFormState({ name: fieldContext.name })
|
|
32
|
+
const fieldState = getFieldState(fieldContext.name, formState)
|
|
49
33
|
|
|
50
34
|
if (!fieldContext) {
|
|
51
|
-
throw new Error(
|
|
35
|
+
throw new Error('useFormField should be used within <FormField>')
|
|
52
36
|
}
|
|
53
37
|
|
|
54
|
-
const { id } = itemContext
|
|
38
|
+
const { id } = itemContext
|
|
55
39
|
|
|
56
40
|
return {
|
|
57
41
|
id,
|
|
@@ -62,107 +46,59 @@ const useFormField = () => {
|
|
|
62
46
|
formDescriptionId: `${id}-form-item-description`,
|
|
63
47
|
formMessageId: `${id}-form-item-message`,
|
|
64
48
|
...fieldState,
|
|
65
|
-
}
|
|
66
|
-
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
67
51
|
|
|
68
52
|
type FormItemContextValue = {
|
|
69
|
-
id: string
|
|
70
|
-
}
|
|
53
|
+
id: string
|
|
54
|
+
}
|
|
71
55
|
|
|
72
|
-
const FormItemContext = React.createContext<FormItemContextValue>(
|
|
73
|
-
{} as FormItemContextValue,
|
|
74
|
-
);
|
|
56
|
+
const FormItemContext = React.createContext<FormItemContextValue>({} as FormItemContextValue)
|
|
75
57
|
|
|
76
|
-
function FormItem({ className, ...props }: React.ComponentProps<
|
|
77
|
-
const id = React.useId()
|
|
58
|
+
function FormItem({ className, ...props }: React.ComponentProps<'div'>) {
|
|
59
|
+
const id = React.useId()
|
|
78
60
|
|
|
79
61
|
return (
|
|
80
62
|
<FormItemContext.Provider value={{ id }}>
|
|
81
|
-
<div
|
|
82
|
-
data-slot="form-item"
|
|
83
|
-
className={cn("grid gap-1", className)}
|
|
84
|
-
{...props}
|
|
85
|
-
/>
|
|
63
|
+
<div data-slot="form-item" className={cn('grid gap-1', className)} {...props} />
|
|
86
64
|
</FormItemContext.Provider>
|
|
87
|
-
)
|
|
65
|
+
)
|
|
88
66
|
}
|
|
89
67
|
|
|
90
|
-
function FormLabel({
|
|
91
|
-
|
|
92
|
-
...props
|
|
93
|
-
}: React.ComponentProps<typeof LabelPrimitive.Root>) {
|
|
94
|
-
const { formItemId } = useFormField();
|
|
95
|
-
return (
|
|
96
|
-
<Label
|
|
97
|
-
data-slot="form-label"
|
|
98
|
-
className={cn("text-xs", className)}
|
|
99
|
-
htmlFor={formItemId}
|
|
100
|
-
{...props}
|
|
101
|
-
/>
|
|
102
|
-
);
|
|
68
|
+
function FormLabel({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>) {
|
|
69
|
+
const { formItemId } = useFormField()
|
|
70
|
+
return <Label data-slot="form-label" className={cn('text-xs', className)} htmlFor={formItemId} {...props} />
|
|
103
71
|
}
|
|
104
72
|
|
|
105
|
-
function FormControl({
|
|
106
|
-
|
|
107
|
-
}: React.ComponentProps<typeof SlotPrimitive.Slot>) {
|
|
108
|
-
const { error, formItemId, formDescriptionId, formMessageId } =
|
|
109
|
-
useFormField();
|
|
73
|
+
function FormControl({ ...props }: React.ComponentProps<typeof SlotPrimitive.Slot>) {
|
|
74
|
+
const { error, formItemId, formDescriptionId, formMessageId } = useFormField()
|
|
110
75
|
|
|
111
76
|
return (
|
|
112
77
|
<SlotPrimitive.Slot
|
|
113
78
|
data-slot="form-control"
|
|
114
79
|
id={formItemId}
|
|
115
|
-
aria-describedby={
|
|
116
|
-
!error
|
|
117
|
-
? `${formDescriptionId}`
|
|
118
|
-
: `${formDescriptionId} ${formMessageId}`
|
|
119
|
-
}
|
|
80
|
+
aria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}
|
|
120
81
|
aria-invalid={!!error}
|
|
121
82
|
{...props}
|
|
122
83
|
/>
|
|
123
|
-
)
|
|
84
|
+
)
|
|
124
85
|
}
|
|
125
86
|
|
|
126
|
-
function FormDescription({ className, ...props }: React.ComponentProps<
|
|
127
|
-
const { formDescriptionId } = useFormField()
|
|
87
|
+
function FormDescription({ className, ...props }: React.ComponentProps<'p'>) {
|
|
88
|
+
const { formDescriptionId } = useFormField()
|
|
128
89
|
|
|
129
|
-
return (
|
|
130
|
-
<p
|
|
131
|
-
data-slot="form-description"
|
|
132
|
-
id={formDescriptionId}
|
|
133
|
-
className={cn("text-muted-foreground text-sm", className)}
|
|
134
|
-
{...props}
|
|
135
|
-
/>
|
|
136
|
-
);
|
|
90
|
+
return <p data-slot="form-description" id={formDescriptionId} className={cn('text-text-positive-muted text-sm', className)} {...props} />
|
|
137
91
|
}
|
|
138
92
|
|
|
139
|
-
function FormMessage({
|
|
140
|
-
|
|
141
|
-
children,
|
|
142
|
-
...props
|
|
143
|
-
}: React.ComponentProps<"p">) {
|
|
144
|
-
const { error, formMessageId } = useFormField();
|
|
93
|
+
function FormMessage({ className, children, ...props }: React.ComponentProps<'p'>) {
|
|
94
|
+
const { error, formMessageId } = useFormField()
|
|
145
95
|
|
|
146
96
|
return (
|
|
147
|
-
<span
|
|
148
|
-
|
|
149
|
-
id={formMessageId}
|
|
150
|
-
className={cn("text-destructive text-xs", className)}
|
|
151
|
-
{...props}
|
|
152
|
-
>
|
|
153
|
-
{error ? String(error?.message ?? "") : children}
|
|
97
|
+
<span data-slot="form-message" id={formMessageId} className={cn('text-danger text-xs', className)} {...props}>
|
|
98
|
+
{error ? String(error?.message ?? '') : children}
|
|
154
99
|
</span>
|
|
155
|
-
)
|
|
100
|
+
)
|
|
156
101
|
}
|
|
157
102
|
|
|
158
103
|
// eslint-disable-next-line react-refresh/only-export-components
|
|
159
|
-
export {
|
|
160
|
-
Form,
|
|
161
|
-
FormControl,
|
|
162
|
-
FormDescription,
|
|
163
|
-
FormField,
|
|
164
|
-
FormItem,
|
|
165
|
-
FormLabel,
|
|
166
|
-
FormMessage,
|
|
167
|
-
useFormField,
|
|
168
|
-
};
|
|
104
|
+
export { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField }
|